devicetree-language-server 0.4.5 → 0.4.7
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/dist/server.js +132 -131
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var gM=Object.create;var Ap=Object.defineProperty;var yM=Object.getOwnPropertyDescriptor;var vM=Object.getOwnPropertyNames;var bM=Object.getPrototypeOf,TM=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),SM=(t,e)=>{for(var n in e)Ap(t,n,{get:e[n],enumerable:!0})},_M=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vM(e))!TM.call(t,i)&&i!==n&&Ap(t,i,{get:()=>e[i],enumerable:!(r=yM(e,i))||r.enumerable});return t};var K=(t,e,n)=>(n=t!=null?gM(bM(t)):{},_M(e||!t||!t.__esModule?Ap(n,"default",{value:t,enumerable:!0}):n,t));var iu=k(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.thenable=Nt.typedArray=Nt.stringArray=Nt.array=Nt.func=Nt.error=Nt.number=Nt.string=Nt.boolean=void 0;function EM(t){return t===!0||t===!1}Nt.boolean=EM;function OS(t){return typeof t=="string"||t instanceof String}Nt.string=OS;function wM(t){return typeof t=="number"||t instanceof Number}Nt.number=wM;function kM(t){return t instanceof Error}Nt.error=kM;function IS(t){return typeof t=="function"}Nt.func=IS;function xS(t){return Array.isArray(t)}Nt.array=xS;function NM(t){return xS(t)&&t.every(e=>OS(e))}Nt.stringArray=NM;function PM(t,e){return Array.isArray(t)&&t.every(e)}Nt.typedArray=PM;function RM(t){return t&&IS(t.then)}Nt.thenable=RM});var no=k(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.stringArray=Jt.array=Jt.func=Jt.error=Jt.number=Jt.string=Jt.boolean=void 0;function CM(t){return t===!0||t===!1}Jt.boolean=CM;function MS(t){return typeof t=="string"||t instanceof String}Jt.string=MS;function DM(t){return typeof t=="number"||t instanceof Number}Jt.number=DM;function AM(t){return t instanceof Error}Jt.error=AM;function OM(t){return typeof t=="function"}Jt.func=OM;function LS(t){return Array.isArray(t)}Jt.array=LS;function IM(t){return LS(t)&&t.every(e=>MS(e))}Jt.stringArray=IM});var nm=k(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.Message=Z.NotificationType9=Z.NotificationType8=Z.NotificationType7=Z.NotificationType6=Z.NotificationType5=Z.NotificationType4=Z.NotificationType3=Z.NotificationType2=Z.NotificationType1=Z.NotificationType0=Z.NotificationType=Z.RequestType9=Z.RequestType8=Z.RequestType7=Z.RequestType6=Z.RequestType5=Z.RequestType4=Z.RequestType3=Z.RequestType2=Z.RequestType1=Z.RequestType=Z.RequestType0=Z.AbstractMessageSignature=Z.ParameterStructures=Z.ResponseError=Z.ErrorCodes=void 0;var ps=no(),Op;(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})(Op||(Z.ErrorCodes=Op={}));var Ip=class t extends Error{constructor(e,n,r){super(n),this.code=ps.number(e)?e:Op.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Z.ResponseError=Ip;var gn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Z.ParameterStructures=gn;gn.auto=new gn("auto");gn.byPosition=new gn("byPosition");gn.byName=new gn("byName");var st=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return gn.auto}};Z.AbstractMessageSignature=st;var xp=class extends st{constructor(e){super(e,0)}};Z.RequestType0=xp;var Mp=class extends st{constructor(e,n=gn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType=Mp;var Lp=class extends st{constructor(e,n=gn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType1=Lp;var $p=class extends st{constructor(e){super(e,2)}};Z.RequestType2=$p;var qp=class extends st{constructor(e){super(e,3)}};Z.RequestType3=qp;var jp=class extends st{constructor(e){super(e,4)}};Z.RequestType4=jp;var Fp=class extends st{constructor(e){super(e,5)}};Z.RequestType5=Fp;var Bp=class extends st{constructor(e){super(e,6)}};Z.RequestType6=Bp;var Up=class extends st{constructor(e){super(e,7)}};Z.RequestType7=Up;var Vp=class extends st{constructor(e){super(e,8)}};Z.RequestType8=Vp;var zp=class extends st{constructor(e){super(e,9)}};Z.RequestType9=zp;var Wp=class extends st{constructor(e,n=gn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType=Wp;var Hp=class extends st{constructor(e){super(e,0)}};Z.NotificationType0=Hp;var Gp=class extends st{constructor(e,n=gn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType1=Gp;var Yp=class extends st{constructor(e){super(e,2)}};Z.NotificationType2=Yp;var Kp=class extends st{constructor(e){super(e,3)}};Z.NotificationType3=Kp;var Xp=class extends st{constructor(e){super(e,4)}};Z.NotificationType4=Xp;var Jp=class extends st{constructor(e){super(e,5)}};Z.NotificationType5=Jp;var Qp=class extends st{constructor(e){super(e,6)}};Z.NotificationType6=Qp;var Zp=class extends st{constructor(e){super(e,7)}};Z.NotificationType7=Zp;var em=class extends st{constructor(e){super(e,8)}};Z.NotificationType8=em;var tm=class extends st{constructor(e){super(e,9)}};Z.NotificationType9=tm;var $S;(function(t){function e(i){let s=i;return s&&ps.string(s.method)&&(ps.string(s.id)||ps.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&ps.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(ps.string(s.id)||ps.number(s.id)||s.id===null)}t.isResponse=r})($S||(Z.Message=$S={}))});var im=k(ki=>{"use strict";var qS;Object.defineProperty(ki,"__esModule",{value:!0});ki.LRUCache=ki.LinkedMap=ki.Touch=void 0;var Qt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Qt||(ki.Touch=Qt={}));var su=class{constructor(){this[qS]="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,n=Qt.None){let r=this._map.get(e);if(r)return n!==Qt.None&&this.touch(r,n),r.value}set(e,n,r=Qt.None){let i=this._map.get(e);if(i)i.value=n,r!==Qt.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Qt.None:this.addItemLast(i);break;case Qt.First:this.addItemFirst(i);break;case Qt.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 n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.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,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(qS=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.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 n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Qt.First&&n!==Qt.Last)){if(n===Qt.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Qt.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};ki.LinkedMap=su;var rm=class extends su{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),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,n=Qt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Qt.None)}set(e,n){return super.set(e,n,Qt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};ki.LRUCache=rm});var FS=k(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.Disposable=void 0;var jS;(function(t){function e(n){return{dispose:n}}t.create=e})(jS||(ou.Disposable=jS={}))});var Ni=k(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var sm;function om(){if(sm===void 0)throw new Error("No runtime abstraction layer installed");return sm}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");sm=n}t.install=e})(om||(om={}));am.default=om});var io=k(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.Emitter=ro.Event=void 0;var xM=Ni(),BS;(function(t){let e={dispose(){}};t.None=function(){return e}})(BS||(ro.Event=BS={}));var cm=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,xM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},au=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new cm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.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)}};ro.Emitter=au;au._noop=function(){}});var uu=k(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CancellationTokenSource=so.CancellationToken=void 0;var MM=Ni(),LM=no(),lm=io(),cu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:lm.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:lm.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||LM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(cu||(so.CancellationToken=cu={}));var $M=Object.freeze(function(t,e){let n=(0,MM.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),lu=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?$M:(this._emitter||(this._emitter=new lm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},um=class{get token(){return this._token||(this._token=new lu),this._token}cancel(){this._token?this._token.cancel():this._token=cu.Cancelled}dispose(){this._token?this._token instanceof lu&&this._token.dispose():this._token=cu.None}};so.CancellationTokenSource=um});var US=k(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.SharedArrayReceiverStrategy=oo.SharedArraySenderStrategy=void 0;var qM=uu(),Oa;(function(t){t.Continue=0,t.Cancelled=1})(Oa||(Oa={}));var dm=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Oa.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Oa.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};oo.SharedArraySenderStrategy=dm;var fm=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Oa.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},hm=class{constructor(e){this.token=new fm(e)}cancel(){}dispose(){}},pm=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new qM.CancellationTokenSource:new hm(n)}};oo.SharedArrayReceiverStrategy=pm});var gm=k(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.Semaphore=void 0;var jM=Ni(),mm=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((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,jM.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 n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};du.Semaphore=mm});var zS=k(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.ReadableStreamMessageReader=Pi.AbstractMessageReader=Pi.MessageReader=void 0;var vm=Ni(),ao=no(),ym=io(),FM=gm(),VS;(function(t){function e(n){let r=n;return r&&ao.func(r.listen)&&ao.func(r.dispose)&&ao.func(r.onError)&&ao.func(r.onClose)&&ao.func(r.onPartialMessage)}t.is=e})(VS||(Pi.MessageReader=VS={}));var fu=class{constructor(){this.errorEmitter=new ym.Emitter,this.closeEmitter=new ym.Emitter,this.partialMessageEmitter=new ym.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: ${ao.string(e.message)?e.message:"unknown"}`)}};Pi.AbstractMessageReader=fu;var bm;(function(t){function e(n){let r,i,s,o=new Map,a,c=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,c.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let l of n.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,vm.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(bm||(bm={}));var Tm=class extends fu{constructor(e,n){super(),this.readable=e,this.options=bm.fromOptions(n),this.buffer=(0,vm.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new FM.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 n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
-
${JSON.stringify(Object.fromEntries(r))}`));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 n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}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),h=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,h)}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 n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};
|
|
7
|
-
${JSON.stringify(N.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let x=N.id,W=T.get(x);if(
|
|
8
|
-
${JSON.stringify(N,null,4)}`);let x=N;if(pt.string(x.id)||pt.number(x.id)){let W=x.id,X=T.get(W);X&&X.reject(new Error("The received response has neither a result nor an error property."))}}function
|
|
2
|
+
"use strict";var _M=Object.create;var Ip=Object.defineProperty;var EM=Object.getOwnPropertyDescriptor;var kM=Object.getOwnPropertyNames;var wM=Object.getPrototypeOf,NM=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),PM=(t,e)=>{for(var n in e)Ip(t,n,{get:e[n],enumerable:!0})},RM=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kM(e))!NM.call(t,i)&&i!==n&&Ip(t,i,{get:()=>e[i],enumerable:!(r=EM(e,i))||r.enumerable});return t};var K=(t,e,n)=>(n=t!=null?_M(wM(t)):{},RM(e||!t||!t.__esModule?Ip(n,"default",{value:t,enumerable:!0}):n,t));var cu=w(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.thenable=Nt.typedArray=Nt.stringArray=Nt.array=Nt.func=Nt.error=Nt.number=Nt.string=Nt.boolean=void 0;function CM(t){return t===!0||t===!1}Nt.boolean=CM;function LS(t){return typeof t=="string"||t instanceof String}Nt.string=LS;function DM(t){return typeof t=="number"||t instanceof Number}Nt.number=DM;function AM(t){return t instanceof Error}Nt.error=AM;function $S(t){return typeof t=="function"}Nt.func=$S;function qS(t){return Array.isArray(t)}Nt.array=qS;function OM(t){return qS(t)&&t.every(e=>LS(e))}Nt.stringArray=OM;function IM(t,e){return Array.isArray(t)&&t.every(e)}Nt.typedArray=IM;function xM(t){return t&&$S(t.then)}Nt.thenable=xM});var io=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.stringArray=Qt.array=Qt.func=Qt.error=Qt.number=Qt.string=Qt.boolean=void 0;function MM(t){return t===!0||t===!1}Qt.boolean=MM;function jS(t){return typeof t=="string"||t instanceof String}Qt.string=jS;function LM(t){return typeof t=="number"||t instanceof Number}Qt.number=LM;function $M(t){return t instanceof Error}Qt.error=$M;function qM(t){return typeof t=="function"}Qt.func=qM;function FS(t){return Array.isArray(t)}Qt.array=FS;function jM(t){return FS(t)&&t.every(e=>jS(e))}Qt.stringArray=jM});var im=w(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.Message=Z.NotificationType9=Z.NotificationType8=Z.NotificationType7=Z.NotificationType6=Z.NotificationType5=Z.NotificationType4=Z.NotificationType3=Z.NotificationType2=Z.NotificationType1=Z.NotificationType0=Z.NotificationType=Z.RequestType9=Z.RequestType8=Z.RequestType7=Z.RequestType6=Z.RequestType5=Z.RequestType4=Z.RequestType3=Z.RequestType2=Z.RequestType1=Z.RequestType=Z.RequestType0=Z.AbstractMessageSignature=Z.ParameterStructures=Z.ResponseError=Z.ErrorCodes=void 0;var ms=io(),xp;(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})(xp||(Z.ErrorCodes=xp={}));var Mp=class t extends Error{constructor(e,n,r){super(n),this.code=ms.number(e)?e:xp.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Z.ResponseError=Mp;var yn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Z.ParameterStructures=yn;yn.auto=new yn("auto");yn.byPosition=new yn("byPosition");yn.byName=new yn("byName");var it=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return yn.auto}};Z.AbstractMessageSignature=it;var Lp=class extends it{constructor(e){super(e,0)}};Z.RequestType0=Lp;var $p=class extends it{constructor(e,n=yn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType=$p;var qp=class extends it{constructor(e,n=yn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType1=qp;var jp=class extends it{constructor(e){super(e,2)}};Z.RequestType2=jp;var Fp=class extends it{constructor(e){super(e,3)}};Z.RequestType3=Fp;var Bp=class extends it{constructor(e){super(e,4)}};Z.RequestType4=Bp;var Up=class extends it{constructor(e){super(e,5)}};Z.RequestType5=Up;var Vp=class extends it{constructor(e){super(e,6)}};Z.RequestType6=Vp;var zp=class extends it{constructor(e){super(e,7)}};Z.RequestType7=zp;var Wp=class extends it{constructor(e){super(e,8)}};Z.RequestType8=Wp;var Hp=class extends it{constructor(e){super(e,9)}};Z.RequestType9=Hp;var Gp=class extends it{constructor(e,n=yn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType=Gp;var Yp=class extends it{constructor(e){super(e,0)}};Z.NotificationType0=Yp;var Kp=class extends it{constructor(e,n=yn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType1=Kp;var Xp=class extends it{constructor(e){super(e,2)}};Z.NotificationType2=Xp;var Jp=class extends it{constructor(e){super(e,3)}};Z.NotificationType3=Jp;var Qp=class extends it{constructor(e){super(e,4)}};Z.NotificationType4=Qp;var Zp=class extends it{constructor(e){super(e,5)}};Z.NotificationType5=Zp;var em=class extends it{constructor(e){super(e,6)}};Z.NotificationType6=em;var tm=class extends it{constructor(e){super(e,7)}};Z.NotificationType7=tm;var nm=class extends it{constructor(e){super(e,8)}};Z.NotificationType8=nm;var rm=class extends it{constructor(e){super(e,9)}};Z.NotificationType9=rm;var BS;(function(t){function e(i){let s=i;return s&&ms.string(s.method)&&(ms.string(s.id)||ms.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&ms.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(ms.string(s.id)||ms.number(s.id)||s.id===null)}t.isResponse=r})(BS||(Z.Message=BS={}))});var om=w(Ni=>{"use strict";var US;Object.defineProperty(Ni,"__esModule",{value:!0});Ni.LRUCache=Ni.LinkedMap=Ni.Touch=void 0;var Zt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Zt||(Ni.Touch=Zt={}));var lu=class{constructor(){this[US]="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,n=Zt.None){let r=this._map.get(e);if(r)return n!==Zt.None&&this.touch(r,n),r.value}set(e,n,r=Zt.None){let i=this._map.get(e);if(i)i.value=n,r!==Zt.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Zt.None:this.addItemLast(i);break;case Zt.First:this.addItemFirst(i);break;case Zt.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 n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.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,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(US=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.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 n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Zt.First&&n!==Zt.Last)){if(n===Zt.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Zt.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Ni.LinkedMap=lu;var sm=class extends lu{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),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,n=Zt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Zt.None)}set(e,n){return super.set(e,n,Zt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ni.LRUCache=sm});var zS=w(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.Disposable=void 0;var VS;(function(t){function e(n){return{dispose:n}}t.create=e})(VS||(uu.Disposable=VS={}))});var Pi=w(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var am;function cm(){if(am===void 0)throw new Error("No runtime abstraction layer installed");return am}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");am=n}t.install=e})(cm||(cm={}));lm.default=cm});var oo=w(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.Emitter=so.Event=void 0;var FM=Pi(),WS;(function(t){let e={dispose(){}};t.None=function(){return e}})(WS||(so.Event=WS={}));var um=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,FM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},du=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new um),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.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)}};so.Emitter=du;du._noop=function(){}});var pu=w(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.CancellationTokenSource=ao.CancellationToken=void 0;var BM=Pi(),UM=io(),dm=oo(),fu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:dm.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:dm.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||UM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(fu||(ao.CancellationToken=fu={}));var VM=Object.freeze(function(t,e){let n=(0,BM.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.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?VM:(this._emitter||(this._emitter=new dm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},fm=class{get token(){return this._token||(this._token=new hu),this._token}cancel(){this._token?this._token.cancel():this._token=fu.Cancelled}dispose(){this._token?this._token instanceof hu&&this._token.dispose():this._token=fu.None}};ao.CancellationTokenSource=fm});var HS=w(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.SharedArrayReceiverStrategy=co.SharedArraySenderStrategy=void 0;var zM=pu(),Ia;(function(t){t.Continue=0,t.Cancelled=1})(Ia||(Ia={}));var hm=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Ia.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Ia.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};co.SharedArraySenderStrategy=hm;var pm=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ia.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},mm=class{constructor(e){this.token=new pm(e)}cancel(){}dispose(){}},gm=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new zM.CancellationTokenSource:new mm(n)}};co.SharedArrayReceiverStrategy=gm});var vm=w(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.Semaphore=void 0;var WM=Pi(),ym=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((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,WM.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 n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};mu.Semaphore=ym});var YS=w(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ReadableStreamMessageReader=Ri.AbstractMessageReader=Ri.MessageReader=void 0;var Tm=Pi(),lo=io(),bm=oo(),HM=vm(),GS;(function(t){function e(n){let r=n;return r&&lo.func(r.listen)&&lo.func(r.dispose)&&lo.func(r.onError)&&lo.func(r.onClose)&&lo.func(r.onPartialMessage)}t.is=e})(GS||(Ri.MessageReader=GS={}));var gu=class{constructor(){this.errorEmitter=new bm.Emitter,this.closeEmitter=new bm.Emitter,this.partialMessageEmitter=new bm.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: ${lo.string(e.message)?e.message:"unknown"}`)}};Ri.AbstractMessageReader=gu;var Sm;(function(t){function e(n){let r,i,s,o=new Map,a,c=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,c.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let l of n.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Tm.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(Sm||(Sm={}));var _m=class extends gu{constructor(e,n){super(),this.readable=e,this.options=Sm.fromOptions(n),this.buffer=(0,Tm.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new HM.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 n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
+
${JSON.stringify(Object.fromEntries(r))}`));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 n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Tm.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ri.ReadableStreamMessageReader=_m});var ZS=w(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.WriteableStreamMessageWriter=Ci.AbstractMessageWriter=Ci.MessageWriter=void 0;var KS=Pi(),xa=io(),GM=vm(),XS=oo(),YM="Content-Length: ",JS=`\r
|
|
4
|
+
`,QS;(function(t){function e(n){let r=n;return r&&xa.func(r.dispose)&&xa.func(r.onClose)&&xa.func(r.onError)&&xa.func(r.write)}t.is=e})(QS||(Ci.MessageWriter=QS={}));var yu=class{constructor(){this.errorEmitter=new XS.Emitter,this.closeEmitter=new XS.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${xa.string(e.message)?e.message:"unknown"}`)}};Ci.AbstractMessageWriter=yu;var Em;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,KS.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,KS.default)().applicationJson.encoder}}t.fromOptions=e})(Em||(Em={}));var km=class extends yu{constructor(e,n){super(),this.writable=e,this.options=Em.fromOptions(n),this.errorCount=0,this.writeSemaphore=new GM.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(YM,r.byteLength.toString(),JS),i.push(JS),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};Ci.WriteableStreamMessageWriter=km});var e_=w(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.AbstractMessageBuffer=void 0;var KM=13,XM=10,JM=`\r
|
|
5
|
+
`,wm=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,s=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(i=0;i<l.length;){switch(l[i]){case KM:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case XM:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=l.byteLength,r++}if(n!==4)return;let o=this._read(s+i),a=new Map,c=this.toString(o,"ascii").split(JM);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),h=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,h)}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 n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};vu.AbstractMessageBuffer=wm});var s_=w(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.createMessageConnection=ue.ConnectionOptions=ue.MessageStrategy=ue.CancellationStrategy=ue.CancellationSenderStrategy=ue.CancellationReceiverStrategy=ue.RequestCancellationReceiverStrategy=ue.IdCancellationReceiverStrategy=ue.ConnectionStrategy=ue.ConnectionError=ue.ConnectionErrors=ue.LogTraceNotification=ue.SetTraceNotification=ue.TraceFormat=ue.TraceValues=ue.Trace=ue.NullLogger=ue.ProgressType=ue.ProgressToken=void 0;var t_=Pi(),pt=io(),re=im(),n_=om(),Ma=oo(),Nm=pu(),qa;(function(t){t.type=new re.NotificationType("$/cancelRequest")})(qa||(qa={}));var Pm;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(Pm||(ue.ProgressToken=Pm={}));var La;(function(t){t.type=new re.NotificationType("$/progress")})(La||(La={}));var Rm=class{constructor(){}};ue.ProgressType=Rm;var Cm;(function(t){function e(n){return pt.func(n)}t.is=e})(Cm||(Cm={}));ue.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Le;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Le||(ue.Trace=Le={}));var r_;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(r_||(ue.TraceValues=r_={}));(function(t){function e(r){if(!pt.string(r))return t.Off;switch(r=r.toLowerCase(),r){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 n(r){switch(r){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=n})(Le||(ue.Trace=Le={}));var xn;(function(t){t.Text="text",t.JSON="json"})(xn||(ue.TraceFormat=xn={}));(function(t){function e(n){return pt.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(xn||(ue.TraceFormat=xn={}));var Dm;(function(t){t.type=new re.NotificationType("$/setTrace")})(Dm||(ue.SetTraceNotification=Dm={}));var bu;(function(t){t.type=new re.NotificationType("$/logTrace")})(bu||(ue.LogTraceNotification=bu={}));var $a;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})($a||(ue.ConnectionErrors=$a={}));var uo=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ue.ConnectionError=uo;var Am;(function(t){function e(n){let r=n;return r&&pt.func(r.cancelUndispatched)}t.is=e})(Am||(ue.ConnectionStrategy=Am={}));var Tu;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&pt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||pt.func(r.dispose))}t.is=e})(Tu||(ue.IdCancellationReceiverStrategy=Tu={}));var Om;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&pt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||pt.func(r.dispose))}t.is=e})(Om||(ue.RequestCancellationReceiverStrategy=Om={}));var Su;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new Nm.CancellationTokenSource}});function e(n){return Tu.is(n)||Om.is(n)}t.is=e})(Su||(ue.CancellationReceiverStrategy=Su={}));var _u;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(qa.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&pt.func(r.sendCancellation)&&pt.func(r.cleanup)}t.is=e})(_u||(ue.CancellationSenderStrategy=_u={}));var Eu;(function(t){t.Message=Object.freeze({receiver:Su.Message,sender:_u.Message});function e(n){let r=n;return r&&Su.is(r.receiver)&&_u.is(r.sender)}t.is=e})(Eu||(ue.CancellationStrategy=Eu={}));var ku;(function(t){function e(n){let r=n;return r&&pt.func(r.handleMessage)}t.is=e})(ku||(ue.MessageStrategy=ku={}));var i_;(function(t){function e(n){let r=n;return r&&(Eu.is(r.cancellationStrategy)||Am.is(r.connectionStrategy)||ku.is(r.messageStrategy))}t.is=e})(i_||(ue.ConnectionOptions=i_={}));var fr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(fr||(fr={}));function QM(t,e,n,r){let i=n!==void 0?n:ue.NullLogger,s=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,h=new Map,y,p=new n_.LinkedMap,T=new Map,_=new Set,v=new Map,b=Le.Off,k=xn.Text,C,L=fr.New,B=new Ma.Emitter,q=new Ma.Emitter,ce=new Ma.Emitter,ze=new Ma.Emitter,Dt=new Ma.Emitter,ye=r&&r.cancellationStrategy?r.cancellationStrategy:Eu.Message;function Un(N){if(N===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+N.toString()}function ki(N){return N===null?"res-unknown-"+(++a).toString():"res-"+N.toString()}function Hl(){return"not-"+(++o).toString()}function Op(N,x){re.Message.isRequest(x)?N.set(Un(x.id),x):re.Message.isResponse(x)?N.set(ki(x.id),x):N.set(Hl(),x)}function Gl(N){}function Pa(){return L===fr.Listening}function fs(){return L===fr.Closed}function ni(){return L===fr.Disposed}function Zs(){(L===fr.New||L===fr.Listening)&&(L=fr.Closed,q.fire(void 0))}function hs(N){B.fire([N,void 0,void 0])}function Yl(N){B.fire(N)}t.onClose(Zs),t.onError(hs),e.onClose(Zs),e.onError(Yl);function Ra(){y||p.size===0||(y=(0,t_.default)().timer.setImmediate(()=>{y=void 0,Kl()}))}function Ca(N){re.Message.isRequest(N)?Jl(N):re.Message.isNotification(N)?Zl(N):re.Message.isResponse(N)?Ql(N):eo(N)}function Kl(){if(p.size===0)return;let N=p.shift();try{let x=r?.messageStrategy;ku.is(x)?x.handleMessage(N,Ca):Ca(N)}finally{Ra()}}let Xl=N=>{try{if(re.Message.isNotification(N)&&N.method===qa.type.method){let x=N.params.id,W=Un(x),X=p.get(W);if(re.Message.isRequest(X)){let je=r?.connectionStrategy,rt=je&&je.cancelUndispatched?je.cancelUndispatched(X,Gl):void 0;if(rt&&(rt.error!==void 0||rt.result!==void 0)){p.delete(W),v.delete(x),rt.id=X.id,ps(rt,N.method,Date.now()),e.write(rt).catch(()=>i.error("Sending response for canceled message failed."));return}}let We=v.get(x);if(We!==void 0){We.cancel(),to(N);return}else _.add(x)}Op(p,N)}finally{Ra()}};function Jl(N){if(ni())return;function x(ve,Ke,Ae){let yt={jsonrpc:c,id:N.id};ve instanceof re.ResponseError?yt.error=ve.toJson():yt.result=ve===void 0?null:ve,ps(yt,Ke,Ae),e.write(yt).catch(()=>i.error("Sending response failed."))}function W(ve,Ke,Ae){let yt={jsonrpc:c,id:N.id,error:ve.toJson()};ps(yt,Ke,Ae),e.write(yt).catch(()=>i.error("Sending response failed."))}function X(ve,Ke,Ae){ve===void 0&&(ve=null);let yt={jsonrpc:c,id:N.id,result:ve};ps(yt,Ke,Ae),e.write(yt).catch(()=>i.error("Sending response failed."))}nu(N);let We=u.get(N.method),je,rt;We&&(je=We.type,rt=We.handler);let dt=Date.now();if(rt||l){let ve=N.id??String(Date.now()),Ke=Tu.is(ye.receiver)?ye.receiver.createCancellationTokenSource(ve):ye.receiver.createCancellationTokenSource(N);N.id!==null&&_.has(N.id)&&Ke.cancel(),N.id!==null&&v.set(ve,Ke);try{let Ae;if(rt)if(N.params===void 0){if(je!==void 0&&je.numberOfParams!==0){W(new re.ResponseError(re.ErrorCodes.InvalidParams,`Request ${N.method} defines ${je.numberOfParams} params but received none.`),N.method,dt);return}Ae=rt(Ke.token)}else if(Array.isArray(N.params)){if(je!==void 0&&je.parameterStructures===re.ParameterStructures.byName){W(new re.ResponseError(re.ErrorCodes.InvalidParams,`Request ${N.method} defines parameters by name but received parameters by position`),N.method,dt);return}Ae=rt(...N.params,Ke.token)}else{if(je!==void 0&&je.parameterStructures===re.ParameterStructures.byPosition){W(new re.ResponseError(re.ErrorCodes.InvalidParams,`Request ${N.method} defines parameters by position but received parameters by name`),N.method,dt);return}Ae=rt(N.params,Ke.token)}else l&&(Ae=l(N.method,N.params,Ke.token));let yt=Ae;Ae?yt.then?yt.then(Lt=>{v.delete(ve),x(Lt,N.method,dt)},Lt=>{v.delete(ve),Lt instanceof re.ResponseError?W(Lt,N.method,dt):Lt&&pt.string(Lt.message)?W(new re.ResponseError(re.ErrorCodes.InternalError,`Request ${N.method} failed with message: ${Lt.message}`),N.method,dt):W(new re.ResponseError(re.ErrorCodes.InternalError,`Request ${N.method} failed unexpectedly without providing any details.`),N.method,dt)}):(v.delete(ve),x(Ae,N.method,dt)):(v.delete(ve),X(Ae,N.method,dt))}catch(Ae){v.delete(ve),Ae instanceof re.ResponseError?x(Ae,N.method,dt):Ae&&pt.string(Ae.message)?W(new re.ResponseError(re.ErrorCodes.InternalError,`Request ${N.method} failed with message: ${Ae.message}`),N.method,dt):W(new re.ResponseError(re.ErrorCodes.InternalError,`Request ${N.method} failed unexpectedly without providing any details.`),N.method,dt)}}else W(new re.ResponseError(re.ErrorCodes.MethodNotFound,`Unhandled method ${N.method}`),N.method,dt)}function Ql(N){if(!ni())if(N.id===null)N.error?i.error(`Received response message without id: Error is:
|
|
7
|
+
${JSON.stringify(N.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let x=N.id,W=T.get(x);if(ru(N,W),W!==void 0){T.delete(x);try{if(N.error){let X=N.error;W.reject(new re.ResponseError(X.code,X.message,X.data))}else if(N.result!==void 0)W.resolve(N.result);else throw new Error("Should never happen.")}catch(X){X.message?i.error(`Response handler '${W.method}' failed with message: ${X.message}`):i.error(`Response handler '${W.method}' failed unexpectedly.`)}}}}function Zl(N){if(ni())return;let x,W;if(N.method===qa.type.method){let X=N.params.id;_.delete(X),to(N);return}else{let X=f.get(N.method);X&&(W=X.handler,x=X.type)}if(W||d)try{if(to(N),W)if(N.params===void 0)x!==void 0&&x.numberOfParams!==0&&x.parameterStructures!==re.ParameterStructures.byName&&i.error(`Notification ${N.method} defines ${x.numberOfParams} params but received none.`),W();else if(Array.isArray(N.params)){let X=N.params;N.method===La.type.method&&X.length===2&&Pm.is(X[0])?W({token:X[0],value:X[1]}):(x!==void 0&&(x.parameterStructures===re.ParameterStructures.byName&&i.error(`Notification ${N.method} defines parameters by name but received parameters by position`),x.numberOfParams!==N.params.length&&i.error(`Notification ${N.method} defines ${x.numberOfParams} params but received ${X.length} arguments`)),W(...X))}else x!==void 0&&x.parameterStructures===re.ParameterStructures.byPosition&&i.error(`Notification ${N.method} defines parameters by position but received parameters by name`),W(N.params);else d&&d(N.method,N.params)}catch(X){X.message?i.error(`Notification handler '${N.method}' failed with message: ${X.message}`):i.error(`Notification handler '${N.method}' failed unexpectedly.`)}else ce.fire(N)}function eo(N){if(!N){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
|
8
|
+
${JSON.stringify(N,null,4)}`);let x=N;if(pt.string(x.id)||pt.number(x.id)){let W=x.id,X=T.get(W);X&&X.reject(new Error("The received response has neither a result nor an error property."))}}function lr(N){if(N!=null)switch(b){case Le.Verbose:return JSON.stringify(N,null,4);case Le.Compact:return JSON.stringify(N);default:return}}function eu(N){if(!(b===Le.Off||!C))if(k===xn.Text){let x;(b===Le.Verbose||b===Le.Compact)&&N.params&&(x=`Params: ${lr(N.params)}
|
|
9
9
|
|
|
10
|
-
`),C.log(`Sending request '${N.method} - (${N.id})'.`,x)}else
|
|
10
|
+
`),C.log(`Sending request '${N.method} - (${N.id})'.`,x)}else ri("send-request",N)}function tu(N){if(!(b===Le.Off||!C))if(k===xn.Text){let x;(b===Le.Verbose||b===Le.Compact)&&(N.params?x=`Params: ${lr(N.params)}
|
|
11
11
|
|
|
12
12
|
`:x=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),C.log(`Sending notification '${N.method}'.`,x)}else
|
|
14
|
+
`),C.log(`Sending notification '${N.method}'.`,x)}else ri("send-notification",N)}function ps(N,x,W){if(!(b===Le.Off||!C))if(k===xn.Text){let X;(b===Le.Verbose||b===Le.Compact)&&(N.error&&N.error.data?X=`Error data: ${lr(N.error.data)}
|
|
15
15
|
|
|
16
|
-
`:N.result?X=`Result: ${
|
|
16
|
+
`:N.result?X=`Result: ${lr(N.result)}
|
|
17
17
|
|
|
18
18
|
`:N.error===void 0&&(X=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),C.log(`Sending response '${x} - (${N.id})'. Processing request took ${Date.now()-W}ms`,X)}else
|
|
20
|
+
`)),C.log(`Sending response '${x} - (${N.id})'. Processing request took ${Date.now()-W}ms`,X)}else ri("send-response",N)}function nu(N){if(!(b===Le.Off||!C))if(k===xn.Text){let x;(b===Le.Verbose||b===Le.Compact)&&N.params&&(x=`Params: ${lr(N.params)}
|
|
21
21
|
|
|
22
|
-
`),C.log(`Received request '${N.method} - (${N.id})'.`,x)}else
|
|
22
|
+
`),C.log(`Received request '${N.method} - (${N.id})'.`,x)}else ri("receive-request",N)}function to(N){if(!(b===Le.Off||!C||N.method===bu.type.method))if(k===xn.Text){let x;(b===Le.Verbose||b===Le.Compact)&&(N.params?x=`Params: ${lr(N.params)}
|
|
23
23
|
|
|
24
24
|
`:x=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),C.log(`Received notification '${N.method}'.`,x)}else
|
|
26
|
+
`),C.log(`Received notification '${N.method}'.`,x)}else ri("receive-notification",N)}function ru(N,x){if(!(b===Le.Off||!C))if(k===xn.Text){let W;if((b===Le.Verbose||b===Le.Compact)&&(N.error&&N.error.data?W=`Error data: ${lr(N.error.data)}
|
|
27
27
|
|
|
28
|
-
`:N.result?W=`Result: ${
|
|
28
|
+
`:N.result?W=`Result: ${lr(N.result)}
|
|
29
29
|
|
|
30
30
|
`:N.error===void 0&&(W=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),x){let X=N.error?` Request failed: ${N.error.message} (${N.error.code}).`:"";C.log(`Received response '${x.method} - (${N.id})' in ${Date.now()-x.timerStart}ms.${X}`,W)}else C.log(`Received response ${N.id} without active response promise.`,W)}else ti("receive-response",N)}function ti(N,x){if(!C||b===Me.Off)return;let W={isLSPMessage:!0,type:N,message:x,timestamp:Date.now()};C.log(W)}function wi(){if(ds())throw new co(La.Closed,"Connection is closed.");if(ei())throw new co(La.Disposed,"Connection is disposed.")}function eu(){if(Na())throw new co(La.AlreadyListening,"Connection is already listening")}function tu(){if(!Na())throw new Error("Call listen() first.")}function Or(N){return N===void 0?null:N}function Ca(N){if(N!==null)return N}function Da(N){return N!=null&&!Array.isArray(N)&&typeof N=="object"}function eo(N,x){switch(N){case ne.ParameterStructures.auto:return Da(x)?Ca(x):[Or(x)];case ne.ParameterStructures.byName:if(!Da(x))throw new Error("Received parameters by name but param is not an object literal.");return Ca(x);case ne.ParameterStructures.byPosition:return[Or(x)];default:throw new Error(`Unknown parameter structure ${N.toString()}`)}}function Aa(N,x){let W,X=N.numberOfParams;switch(X){case 0:W=void 0;break;case 1:W=eo(N.parameterStructures,x[0]);break;default:W=[];for(let We=0;We<x.length&&We<X;We++)W.push(Or(x[We]));if(x.length<X)for(let We=x.length;We<X;We++)W.push(null);break}return W}let ni={sendNotification:(N,...x)=>{wi();let W,X;if(pt.string(N)){W=N;let je=x[0],it=0,ft=ne.ParameterStructures.auto;ne.ParameterStructures.is(je)&&(it=1,ft=je);let ve=x.length,Ye=ve-it;switch(Ye){case 0:X=void 0;break;case 1:X=eo(ft,x[it]);break;default:if(ft===ne.ParameterStructures.byName)throw new Error(`Received ${Ye} parameters for 'by Name' notification parameter structure.`);X=x.slice(it,ve).map(De=>Or(De));break}}else{let je=x;W=N.method,X=Aa(N,je)}let We={jsonrpc:c,method:W,params:X};return Jl(We),e.write(We).catch(je=>{throw i.error("Sending notification failed."),je})},onNotification:(N,x)=>{wi();let W;return pt.func(N)?d=N:x&&(pt.string(N)?(W=N,f.set(N,{type:void 0,handler:x})):(W=N.method,f.set(N.method,{type:N,handler:x}))),{dispose:()=>{W!==void 0?f.delete(W):d=void 0}}},onProgress:(N,x,W)=>{if(h.has(x))throw new Error(`Progress handler for token ${x} already registered`);return h.set(x,W),{dispose:()=>{h.delete(x)}}},sendProgress:(N,x,W)=>ni.sendNotification(Ma.type,{token:x,value:W}),onUnhandledProgress:ze.event,sendRequest:(N,...x)=>{wi(),tu();let W,X,We;if(pt.string(N)){W=N;let ve=x[0],Ye=x[x.length-1],De=0,gt=ne.ParameterStructures.auto;ne.ParameterStructures.is(ve)&&(De=1,gt=ve);let Lt=x.length;wm.CancellationToken.is(Ye)&&(Lt=Lt-1,We=Ye);let In=Lt-De;switch(In){case 0:X=void 0;break;case 1:X=eo(gt,x[De]);break;default:if(gt===ne.ParameterStructures.byName)throw new Error(`Received ${In} parameters for 'by Name' request parameter structure.`);X=x.slice(De,Lt).map(nu=>Or(nu));break}}else{let ve=x;W=N.method,X=Aa(N,ve);let Ye=N.numberOfParams;We=wm.CancellationToken.is(ve[Ye])?ve[Ye]:void 0}let je=s++,it;We&&(it=We.onCancellationRequested(()=>{let ve=ye.sender.sendCancellation(ni,je);return ve===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${je}`),Promise.resolve()):ve.catch(()=>{i.log(`Sending cancellation messages for id ${je} failed`)})}));let ft={jsonrpc:c,id:je,method:W,params:X};return Xl(ft),typeof ye.sender.enableCancellation=="function"&&ye.sender.enableCancellation(ft),new Promise(async(ve,Ye)=>{let De=In=>{ve(In),ye.sender.cleanup(je),it?.dispose()},gt=In=>{Ye(In),ye.sender.cleanup(je),it?.dispose()},Lt={method:W,timerStart:Date.now(),resolve:De,reject:gt};try{await e.write(ft),T.set(je,Lt)}catch(In){throw i.error("Sending request failed."),Lt.reject(new ne.ResponseError(ne.ErrorCodes.MessageWriteError,In.message?In.message:"Unknown reason")),In}})},onRequest:(N,x)=>{wi();let W=null;return Pm.is(N)?(W=void 0,l=N):pt.string(N)?(W=null,x!==void 0&&(W=N,u.set(N,{handler:x,type:void 0}))):x!==void 0&&(W=N.method,u.set(N.method,{type:N,handler:x})),{dispose:()=>{W!==null&&(W!==void 0?u.delete(W):l=void 0)}}},hasPendingResponse:()=>T.size>0,trace:async(N,x,W)=>{let X=!1,We=xn.Text;W!==void 0&&(pt.boolean(W)?X=W:(X=W.sendNotification||!1,We=W.traceFormat||xn.Text)),b=N,w=We,b===Me.Off?C=void 0:C=x,X&&!ds()&&!ei()&&await ni.sendNotification(Rm.type,{value:Me.toString(N)})},onError:B.event,onClose:q.event,onUnhandledNotification:ce.event,onDispose:Dt.event,end:()=>{e.end()},dispose:()=>{if(ei())return;L=ur.Disposed,Dt.fire(void 0);let N=new ne.ResponseError(ne.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let x of T.values())x.reject(N);T=new Map,v=new Map,_=new Set,p=new QS.LinkedMap,pt.func(e.dispose)&&e.dispose(),pt.func(t.dispose)&&t.dispose()},listen:()=>{wi(),eu(),L=ur.Listening,t.listen(Hl)},inspect:()=>{(0,JS.default)().console.log("inspect")}};return ni.onNotification(mu.type,N=>{if(b===Me.Off||!C)return;let x=b===Me.Verbose||b===Me.Compact;C.log(N.message,x?N.verbose:void 0)}),ni.onNotification(Ma.type,N=>{let x=h.get(N.token);x?x(N.value):ze.fire(N)}),ni}ue.createMessageConnection=HM});var Su=k(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.ProgressType=I.ProgressToken=I.createMessageConnection=I.NullLogger=I.ConnectionOptions=I.ConnectionStrategy=I.AbstractMessageBuffer=I.WriteableStreamMessageWriter=I.AbstractMessageWriter=I.MessageWriter=I.ReadableStreamMessageReader=I.AbstractMessageReader=I.MessageReader=I.SharedArrayReceiverStrategy=I.SharedArraySenderStrategy=I.CancellationToken=I.CancellationTokenSource=I.Emitter=I.Event=I.Disposable=I.LRUCache=I.Touch=I.LinkedMap=I.ParameterStructures=I.NotificationType9=I.NotificationType8=I.NotificationType7=I.NotificationType6=I.NotificationType5=I.NotificationType4=I.NotificationType3=I.NotificationType2=I.NotificationType1=I.NotificationType0=I.NotificationType=I.ErrorCodes=I.ResponseError=I.RequestType9=I.RequestType8=I.RequestType7=I.RequestType6=I.RequestType5=I.RequestType4=I.RequestType3=I.RequestType2=I.RequestType1=I.RequestType0=I.RequestType=I.Message=I.RAL=void 0;I.MessageStrategy=I.CancellationStrategy=I.CancellationSenderStrategy=I.CancellationReceiverStrategy=I.ConnectionError=I.ConnectionErrors=I.LogTraceNotification=I.SetTraceNotification=I.TraceFormat=I.TraceValues=I.Trace=void 0;var Ze=nm();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return Ze.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return Ze.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return Ze.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return Ze.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return Ze.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return Ze.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return Ze.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return Ze.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return Ze.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return Ze.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return Ze.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return Ze.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return Ze.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return Ze.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return Ze.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return Ze.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return Ze.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return Ze.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return Ze.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return Ze.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return Ze.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return Ze.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return Ze.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return Ze.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return Ze.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return Ze.ParameterStructures}});var Am=im();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return Am.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return Am.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return Am.Touch}});var GM=FS();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return GM.Disposable}});var n_=io();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return n_.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return n_.Emitter}});var r_=uu();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return r_.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return r_.CancellationToken}});var i_=US();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return i_.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return i_.SharedArrayReceiverStrategy}});var Om=zS();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return Om.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return Om.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Om.ReadableStreamMessageReader}});var Im=KS();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return Im.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return Im.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Im.WriteableStreamMessageWriter}});var YM=XS();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return YM.AbstractMessageBuffer}});var Vt=t_();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Vt.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Vt.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Vt.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Vt.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Vt.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Vt.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Vt.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Vt.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Vt.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Vt.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Vt.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Vt.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Vt.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Vt.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Vt.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Vt.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Vt.MessageStrategy}});var KM=Ni();I.RAL=KM.default});var a_=k($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});var s_=require("util"),ii=Su(),_u=class t extends ii.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new s_.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};_u.emptyBuffer=Buffer.allocUnsafe(0);var xm=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ii.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ii.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ii.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ii.Disposable.create(()=>this.stream.off("data",e))}},Mm=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ii.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ii.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ii.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},o_=Object.freeze({messageBuffer:Object.freeze({create:t=>new _u(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(n){return Promise.reject(n)}}}),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 s_.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new xm(t),asWritableStream:t=>new Mm(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function Lm(){return o_}(function(t){function e(){ii.RAL.install(o_)}t.install=e})(Lm||(Lm={}));$m.default=Lm});var ys=k(_e=>{"use strict";var XM=_e&&_e.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),JM=_e&&_e.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&XM(e,t,n)};Object.defineProperty(_e,"__esModule",{value:!0});_e.createMessageConnection=_e.createServerSocketTransport=_e.createClientSocketTransport=_e.createServerPipeTransport=_e.createClientPipeTransport=_e.generateRandomPipeName=_e.StreamMessageWriter=_e.StreamMessageReader=_e.SocketMessageWriter=_e.SocketMessageReader=_e.PortMessageWriter=_e.PortMessageReader=_e.IPCMessageWriter=_e.IPCMessageReader=void 0;var lo=a_();lo.default.install();var c_=require("path"),QM=require("os"),ZM=require("crypto"),ku=require("net"),Mn=Su();JM(Su(),_e);var qm=class extends Mn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mn.Disposable.create(()=>this.process.off("message",e))}};_e.IPCMessageReader=qm;var jm=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};_e.IPCMessageWriter=jm;var Fm=class extends Mn.AbstractMessageReader{constructor(e){super(),this.onData=new Mn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};_e.PortMessageReader=Fm;var Bm=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};_e.PortMessageWriter=Bm;var ms=class extends Mn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,lo.default)().stream.asReadableStream(e),n)}};_e.SocketMessageReader=ms;var gs=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,lo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};_e.SocketMessageWriter=gs;var Eu=class extends Mn.ReadableStreamMessageReader{constructor(e,n){super((0,lo.default)().stream.asReadableStream(e),n)}};_e.StreamMessageReader=Eu;var wu=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,lo.default)().stream.asWritableStream(e),n)}};_e.StreamMessageWriter=wu;var l_=process.env.XDG_RUNTIME_DIR,e1=new Map([["linux",107],["darwin",103]]);function t1(){let t=(0,ZM.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;l_?e=c_.join(l_,`vscode-ipc-${t}.sock`):e=c_.join(QM.tmpdir(),`vscode-${t}.sock`);let n=e1.get(process.platform);return n!==void 0&&e.length>n&&(0,lo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}_e.generateRandomPipeName=t1;function n1(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,ku.createServer)(a=>{o.close(),n([new ms(a,e),new gs(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}_e.createClientPipeTransport=n1;function r1(t,e="utf-8"){let n=(0,ku.createConnection)(t);return[new ms(n,e),new gs(n,e)]}_e.createServerPipeTransport=r1;function i1(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,ku.createServer)(a=>{o.close(),n([new ms(a,e),new gs(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}_e.createClientSocketTransport=i1;function s1(t,e="utf-8"){let n=(0,ku.createConnection)(t,"127.0.0.1");return[new ms(n,e),new gs(n,e)]}_e.createServerSocketTransport=s1;function o1(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function a1(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function c1(t,e,n,r){n||(n=Mn.NullLogger);let i=o1(t)?new Eu(t):t,s=a1(e)?new wu(e):e;return Mn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Mn.createMessageConnection)(i,s,n,r)}_e.createMessageConnection=c1});var Um=k((GK,u_)=>{"use strict";u_.exports=ys()});var Pu=k((d_,Nu)=>{(function(t){if(typeof Nu=="object"&&typeof Nu.exports=="object"){var e=t(require,d_);e!==void 0&&(Nu.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 n;(function(g){function P(R){return typeof R=="string"}g.is=P})(n||(e.DocumentUri=n={}));var r;(function(g){function P(R){return typeof R=="string"}g.is=P})(r||(e.URI=r={}));var i;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function P(R){return typeof R=="number"&&g.MIN_VALUE<=R&&R<=g.MAX_VALUE}g.is=P})(i||(e.integer=i={}));var s;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function P(R){return typeof R=="number"&&g.MIN_VALUE<=R&&R<=g.MAX_VALUE}g.is=P})(s||(e.uinteger=s={}));var o;(function(g){function P(S,m){return S===Number.MAX_VALUE&&(S=s.MAX_VALUE),m===Number.MAX_VALUE&&(m=s.MAX_VALUE),{line:S,character:m}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&A.uinteger(m.line)&&A.uinteger(m.character)}g.is=R})(o||(e.Position=o={}));var a;(function(g){function P(S,m,D,M){if(A.uinteger(S)&&A.uinteger(m)&&A.uinteger(D)&&A.uinteger(M))return{start:o.create(S,m),end:o.create(D,M)};if(o.is(S)&&o.is(m))return{start:S,end:m};throw new Error("Range#create called with invalid arguments[".concat(S,", ").concat(m,", ").concat(D,", ").concat(M,"]"))}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&o.is(m.start)&&o.is(m.end)}g.is=R})(a||(e.Range=a={}));var c;(function(g){function P(S,m){return{uri:S,range:m}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&a.is(m.range)&&(A.string(m.uri)||A.undefined(m.uri))}g.is=R})(c||(e.Location=c={}));var l;(function(g){function P(S,m,D,M){return{targetUri:S,targetRange:m,targetSelectionRange:D,originSelectionRange:M}}g.create=P;function R(S){var m=S;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=R})(l||(e.LocationLink=l={}));var u;(function(g){function P(S,m,D,M){return{red:S,green:m,blue:D,alpha:M}}g.create=P;function R(S){var m=S;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=R})(u||(e.Color=u={}));var d;(function(g){function P(S,m){return{range:S,color:m}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&a.is(m.range)&&u.is(m.color)}g.is=R})(d||(e.ColorInformation=d={}));var f;(function(g){function P(S,m,D){return{label:S,textEdit:m,additionalTextEdits:D}}g.create=P;function R(S){var m=S;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=R})(f||(e.ColorPresentation=f={}));var h;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(h||(e.FoldingRangeKind=h={}));var y;(function(g){function P(S,m,D,M,le,yt){var Qe={startLine:S,endLine:m};return A.defined(D)&&(Qe.startCharacter=D),A.defined(M)&&(Qe.endCharacter=M),A.defined(le)&&(Qe.kind=le),A.defined(yt)&&(Qe.collapsedText=yt),Qe}g.create=P;function R(S){var m=S;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=R})(y||(e.FoldingRange=y={}));var p;(function(g){function P(S,m){return{location:S,message:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&c.is(m.location)&&A.string(m.message)}g.is=R})(p||(e.DiagnosticRelatedInformation=p={}));var T;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(T||(e.DiagnosticSeverity=T={}));var _;(function(g){g.Unnecessary=1,g.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(g){function P(R){var S=R;return A.objectLiteral(S)&&A.string(S.href)}g.is=P})(v||(e.CodeDescription=v={}));var b;(function(g){function P(S,m,D,M,le,yt){var Qe={range:S,message:m};return A.defined(D)&&(Qe.severity=D),A.defined(M)&&(Qe.code=M),A.defined(le)&&(Qe.source=le),A.defined(yt)&&(Qe.relatedInformation=yt),Qe}g.create=P;function R(S){var m,D=S;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,p.is))}g.is=R})(b||(e.Diagnostic=b={}));var w;(function(g){function P(S,m){for(var D=[],M=2;M<arguments.length;M++)D[M-2]=arguments[M];var le={title:S,command:m};return A.defined(D)&&D.length>0&&(le.arguments=D),le}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.title)&&A.string(m.command)}g.is=R})(w||(e.Command=w={}));var C;(function(g){function P(D,M){return{range:D,newText:M}}g.replace=P;function R(D,M){return{range:{start:D,end:D},newText:M}}g.insert=R;function S(D){return{range:D,newText:""}}g.del=S;function m(D){var M=D;return A.objectLiteral(M)&&A.string(M.newText)&&a.is(M.range)}g.is=m})(C||(e.TextEdit=C={}));var L;(function(g){function P(S,m,D){var M={label:S};return m!==void 0&&(M.needsConfirmation=m),D!==void 0&&(M.description=D),M}g.create=P;function R(S){var m=S;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=R})(L||(e.ChangeAnnotation=L={}));var B;(function(g){function P(R){var S=R;return A.string(S)}g.is=P})(B||(e.ChangeAnnotationIdentifier=B={}));var q;(function(g){function P(D,M,le){return{range:D,newText:M,annotationId:le}}g.replace=P;function R(D,M,le){return{range:{start:D,end:D},newText:M,annotationId:le}}g.insert=R;function S(D,M){return{range:D,newText:"",annotationId:M}}g.del=S;function m(D){var M=D;return C.is(M)&&(L.is(M.annotationId)||B.is(M.annotationId))}g.is=m})(q||(e.AnnotatedTextEdit=q={}));var ce;(function(g){function P(S,m){return{textDocument:S,edits:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&ds.is(m.textDocument)&&Array.isArray(m.edits)}g.is=R})(ce||(e.TextDocumentEdit=ce={}));var ze;(function(g){function P(S,m,D){var M={kind:"create",uri:S};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(M.options=m),D!==void 0&&(M.annotationId=D),M}g.create=P;function R(S){var m=S;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||B.is(m.annotationId))}g.is=R})(ze||(e.CreateFile=ze={}));var Dt;(function(g){function P(S,m,D,M){var le={kind:"rename",oldUri:S,newUri:m};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(le.options=D),M!==void 0&&(le.annotationId=M),le}g.create=P;function R(S){var m=S;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||B.is(m.annotationId))}g.is=R})(Dt||(e.RenameFile=Dt={}));var ye;(function(g){function P(S,m,D){var M={kind:"delete",uri:S};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(M.options=m),D!==void 0&&(M.annotationId=D),M}g.create=P;function R(S){var m=S;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||B.is(m.annotationId))}g.is=R})(ye||(e.DeleteFile=ye={}));var Un;(function(g){function P(R){var S=R;return S&&(S.changes!==void 0||S.documentChanges!==void 0)&&(S.documentChanges===void 0||S.documentChanges.every(function(m){return A.string(m.kind)?ze.is(m)||Dt.is(m)||ye.is(m):ce.is(m)}))}g.is=P})(Un||(e.WorkspaceEdit=Un={}));var Ei=function(){function g(P,R){this.edits=P,this.changeAnnotations=R}return g.prototype.insert=function(P,R,S){var m,D;if(S===void 0?m=C.insert(P,R):B.is(S)?(D=S,m=q.insert(P,R,S)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(S),m=q.insert(P,R,D)),this.edits.push(m),D!==void 0)return D},g.prototype.replace=function(P,R,S){var m,D;if(S===void 0?m=C.replace(P,R):B.is(S)?(D=S,m=q.replace(P,R,S)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(S),m=q.replace(P,R,D)),this.edits.push(m),D!==void 0)return D},g.prototype.delete=function(P,R){var S,m;if(R===void 0?S=C.del(P):B.is(R)?(m=R,S=q.del(P,R)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(R),S=q.del(P,m)),this.edits.push(S),m!==void 0)return m},g.prototype.add=function(P){this.edits.push(P)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(P){if(P===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),Ul=function(){function g(P){this._annotations=P===void 0?Object.create(null):P,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(P,R){var S;if(B.is(P)?S=P:(S=this.nextId(),R=P),this._annotations[S]!==void 0)throw new Error("Id ".concat(S," is already in use."));if(R===void 0)throw new Error("No annotation provided for id ".concat(S));return this._annotations[S]=R,this._size++,S},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),Dp=function(){function g(P){var R=this;this._textEditChanges=Object.create(null),P!==void 0?(this._workspaceEdit=P,P.documentChanges?(this._changeAnnotations=new Ul(P.changeAnnotations),P.changeAnnotations=this._changeAnnotations.all(),P.documentChanges.forEach(function(S){if(ce.is(S)){var m=new Ei(S.edits,R._changeAnnotations);R._textEditChanges[S.textDocument.uri]=m}})):P.changes&&Object.keys(P.changes).forEach(function(S){var m=new Ei(P.changes[S]);R._textEditChanges[S]=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(P){if(ds.is(P)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var R={uri:P.uri,version:P.version},S=this._textEditChanges[R.uri];if(!S){var m=[],D={textDocument:R,edits:m};this._workspaceEdit.documentChanges.push(D),S=new Ei(m,this._changeAnnotations),this._textEditChanges[R.uri]=S}return S}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var S=this._textEditChanges[P];if(!S){var m=[];this._workspaceEdit.changes[P]=m,S=new Ei(m),this._textEditChanges[P]=S}return S}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ul,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(P,R,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;L.is(R)||B.is(R)?m=R:S=R;var D,M;if(m===void 0?D=ze.create(P,S):(M=B.is(m)?m:this._changeAnnotations.manage(m),D=ze.create(P,S,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},g.prototype.renameFile=function(P,R,S,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;L.is(S)||B.is(S)?D=S:m=S;var M,le;if(D===void 0?M=Dt.create(P,R,m):(le=B.is(D)?D:this._changeAnnotations.manage(D),M=Dt.create(P,R,m,le)),this._workspaceEdit.documentChanges.push(M),le!==void 0)return le},g.prototype.deleteFile=function(P,R,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;L.is(R)||B.is(R)?m=R:S=R;var D,M;if(m===void 0?D=ye.create(P,S):(M=B.is(m)?m:this._changeAnnotations.manage(m),D=ye.create(P,S,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},g}();e.WorkspaceChange=Dp;var Vl;(function(g){function P(S){return{uri:S}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.uri)}g.is=R})(Vl||(e.TextDocumentIdentifier=Vl={}));var Na;(function(g){function P(S,m){return{uri:S,version:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.uri)&&A.integer(m.version)}g.is=R})(Na||(e.VersionedTextDocumentIdentifier=Na={}));var ds;(function(g){function P(S,m){return{uri:S,version:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.uri)&&(m.version===null||A.integer(m.version))}g.is=R})(ds||(e.OptionalVersionedTextDocumentIdentifier=ds={}));var ei;(function(g){function P(S,m,D,M){return{uri:S,languageId:m,version:D,text:M}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.uri)&&A.string(m.languageId)&&A.integer(m.version)&&A.string(m.text)}g.is=R})(ei||(e.TextDocumentItem=ei={}));var Js;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function P(R){var S=R;return S===g.PlainText||S===g.Markdown}g.is=P})(Js||(e.MarkupKind=Js={}));var fs;(function(g){function P(R){var S=R;return A.objectLiteral(R)&&Js.is(S.kind)&&A.string(S.value)}g.is=P})(fs||(e.MarkupContent=fs={}));var zl;(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})(zl||(e.CompletionItemKind=zl={}));var Pa;(function(g){g.PlainText=1,g.Snippet=2})(Pa||(e.InsertTextFormat=Pa={}));var Ra;(function(g){g.Deprecated=1})(Ra||(e.CompletionItemTag=Ra={}));var Wl;(function(g){function P(S,m,D){return{newText:S,insert:m,replace:D}}g.create=P;function R(S){var m=S;return m&&A.string(m.newText)&&a.is(m.insert)&&a.is(m.replace)}g.is=R})(Wl||(e.InsertReplaceEdit=Wl={}));var Hl;(function(g){g.asIs=1,g.adjustIndentation=2})(Hl||(e.InsertTextMode=Hl={}));var Gl;(function(g){function P(R){var S=R;return S&&(A.string(S.detail)||S.detail===void 0)&&(A.string(S.description)||S.description===void 0)}g.is=P})(Gl||(e.CompletionItemLabelDetails=Gl={}));var Yl;(function(g){function P(R){return{label:R}}g.create=P})(Yl||(e.CompletionItem=Yl={}));var Kl;(function(g){function P(R,S){return{items:R||[],isIncomplete:!!S}}g.create=P})(Kl||(e.CompletionList=Kl={}));var Qs;(function(g){function P(S){return S.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=P;function R(S){var m=S;return A.string(m)||A.objectLiteral(m)&&A.string(m.language)&&A.string(m.value)}g.is=R})(Qs||(e.MarkedString=Qs={}));var ar;(function(g){function P(R){var S=R;return!!S&&A.objectLiteral(S)&&(fs.is(S.contents)||Qs.is(S.contents)||A.typedArray(S.contents,Qs.is))&&(R.range===void 0||a.is(R.range))}g.is=P})(ar||(e.Hover=ar={}));var Xl;(function(g){function P(R,S){return S?{label:R,documentation:S}:{label:R}}g.create=P})(Xl||(e.ParameterInformation=Xl={}));var Jl;(function(g){function P(R,S){for(var m=[],D=2;D<arguments.length;D++)m[D-2]=arguments[D];var M={label:R};return A.defined(S)&&(M.documentation=S),A.defined(m)?M.parameters=m:M.parameters=[],M}g.create=P})(Jl||(e.SignatureInformation=Jl={}));var hs;(function(g){g.Text=1,g.Read=2,g.Write=3})(hs||(e.DocumentHighlightKind=hs={}));var Ql;(function(g){function P(R,S){var m={range:R};return A.number(S)&&(m.kind=S),m}g.create=P})(Ql||(e.DocumentHighlight=Ql={}));var Zs;(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})(Zs||(e.SymbolKind=Zs={}));var Zl;(function(g){g.Deprecated=1})(Zl||(e.SymbolTag=Zl={}));var ti;(function(g){function P(R,S,m,D,M){var le={name:R,kind:S,location:{uri:D,range:m}};return M&&(le.containerName=M),le}g.create=P})(ti||(e.SymbolInformation=ti={}));var wi;(function(g){function P(R,S,m,D){return D!==void 0?{name:R,kind:S,location:{uri:m,range:D}}:{name:R,kind:S,location:{uri:m}}}g.create=P})(wi||(e.WorkspaceSymbol=wi={}));var eu;(function(g){function P(S,m,D,M,le,yt){var Qe={name:S,detail:m,kind:D,range:M,selectionRange:le};return yt!==void 0&&(Qe.children=yt),Qe}g.create=P;function R(S){var m=S;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=R})(eu||(e.DocumentSymbol=eu={}));var tu;(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"})(tu||(e.CodeActionKind=tu={}));var Or;(function(g){g.Invoked=1,g.Automatic=2})(Or||(e.CodeActionTriggerKind=Or={}));var Ca;(function(g){function P(S,m,D){var M={diagnostics:S};return m!=null&&(M.only=m),D!=null&&(M.triggerKind=D),M}g.create=P;function R(S){var m=S;return A.defined(m)&&A.typedArray(m.diagnostics,b.is)&&(m.only===void 0||A.typedArray(m.only,A.string))&&(m.triggerKind===void 0||m.triggerKind===Or.Invoked||m.triggerKind===Or.Automatic)}g.is=R})(Ca||(e.CodeActionContext=Ca={}));var Da;(function(g){function P(S,m,D){var M={title:S},le=!0;return typeof m=="string"?(le=!1,M.kind=m):w.is(m)?M.command=m:M.edit=m,le&&D!==void 0&&(M.kind=D),M}g.create=P;function R(S){var m=S;return m&&A.string(m.title)&&(m.diagnostics===void 0||A.typedArray(m.diagnostics,b.is))&&(m.kind===void 0||A.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||w.is(m.command))&&(m.isPreferred===void 0||A.boolean(m.isPreferred))&&(m.edit===void 0||Un.is(m.edit))}g.is=R})(Da||(e.CodeAction=Da={}));var eo;(function(g){function P(S,m){var D={range:S};return A.defined(m)&&(D.data=m),D}g.create=P;function R(S){var m=S;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.command)||w.is(m.command))}g.is=R})(eo||(e.CodeLens=eo={}));var Aa;(function(g){function P(S,m){return{tabSize:S,insertSpaces:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.uinteger(m.tabSize)&&A.boolean(m.insertSpaces)}g.is=R})(Aa||(e.FormattingOptions=Aa={}));var ni;(function(g){function P(S,m,D){return{range:S,target:m,data:D}}g.create=P;function R(S){var m=S;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.target)||A.string(m.target))}g.is=R})(ni||(e.DocumentLink=ni={}));var N;(function(g){function P(S,m){return{range:S,parent:m}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&a.is(m.range)&&(m.parent===void 0||g.is(m.parent))}g.is=R})(N||(e.SelectionRange=N={}));var x;(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"})(x||(e.SemanticTokenTypes=x={}));var W;(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"})(W||(e.SemanticTokenModifiers=W={}));var X;(function(g){function P(R){var S=R;return A.objectLiteral(S)&&(S.resultId===void 0||typeof S.resultId=="string")&&Array.isArray(S.data)&&(S.data.length===0||typeof S.data[0]=="number")}g.is=P})(X||(e.SemanticTokens=X={}));var We;(function(g){function P(S,m){return{range:S,text:m}}g.create=P;function R(S){var m=S;return m!=null&&a.is(m.range)&&A.string(m.text)}g.is=R})(We||(e.InlineValueText=We={}));var je;(function(g){function P(S,m,D){return{range:S,variableName:m,caseSensitiveLookup:D}}g.create=P;function R(S){var m=S;return m!=null&&a.is(m.range)&&A.boolean(m.caseSensitiveLookup)&&(A.string(m.variableName)||m.variableName===void 0)}g.is=R})(je||(e.InlineValueVariableLookup=je={}));var it;(function(g){function P(S,m){return{range:S,expression:m}}g.create=P;function R(S){var m=S;return m!=null&&a.is(m.range)&&(A.string(m.expression)||m.expression===void 0)}g.is=R})(it||(e.InlineValueEvaluatableExpression=it={}));var ft;(function(g){function P(S,m){return{frameId:S,stoppedLocation:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&a.is(S.stoppedLocation)}g.is=R})(ft||(e.InlineValueContext=ft={}));var ve;(function(g){g.Type=1,g.Parameter=2;function P(R){return R===1||R===2}g.is=P})(ve||(e.InlayHintKind=ve={}));var Ye;(function(g){function P(S){return{value:S}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&(m.tooltip===void 0||A.string(m.tooltip)||fs.is(m.tooltip))&&(m.location===void 0||c.is(m.location))&&(m.command===void 0||w.is(m.command))}g.is=R})(Ye||(e.InlayHintLabelPart=Ye={}));var De;(function(g){function P(S,m,D){var M={position:S,label:m};return D!==void 0&&(M.kind=D),M}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&o.is(m.position)&&(A.string(m.label)||A.typedArray(m.label,Ye.is))&&(m.kind===void 0||ve.is(m.kind))&&m.textEdits===void 0||A.typedArray(m.textEdits,C.is)&&(m.tooltip===void 0||A.string(m.tooltip)||fs.is(m.tooltip))&&(m.paddingLeft===void 0||A.boolean(m.paddingLeft))&&(m.paddingRight===void 0||A.boolean(m.paddingRight))}g.is=R})(De||(e.InlayHint=De={}));var gt;(function(g){function P(R){return{kind:"snippet",value:R}}g.createSnippet=P})(gt||(e.StringValue=gt={}));var Lt;(function(g){function P(R,S,m,D){return{insertText:R,filterText:S,range:m,command:D}}g.create=P})(Lt||(e.InlineCompletionItem=Lt={}));var In;(function(g){function P(R){return{items:R}}g.create=P})(In||(e.InlineCompletionList=In={}));var nu;(function(g){g.Invoked=0,g.Automatic=1})(nu||(e.InlineCompletionTriggerKind=nu={}));var PS;(function(g){function P(R,S){return{range:R,text:S}}g.create=P})(PS||(e.SelectedCompletionInfo=PS={}));var RS;(function(g){function P(R,S){return{triggerKind:R,selectedCompletionInfo:S}}g.create=P})(RS||(e.InlineCompletionContext=RS={}));var CS;(function(g){function P(R){var S=R;return A.objectLiteral(S)&&r.is(S.uri)&&A.string(S.name)}g.is=P})(CS||(e.WorkspaceFolder=CS={})),e.EOL=[`
|
|
32
|
+
`)),x){let X=N.error?` Request failed: ${N.error.message} (${N.error.code}).`:"";C.log(`Received response '${x.method} - (${N.id})' in ${Date.now()-x.timerStart}ms.${X}`,W)}else C.log(`Received response ${N.id} without active response promise.`,W)}else ri("receive-response",N)}function ri(N,x){if(!C||b===Le.Off)return;let W={isLSPMessage:!0,type:N,message:x,timestamp:Date.now()};C.log(W)}function wi(){if(fs())throw new uo($a.Closed,"Connection is closed.");if(ni())throw new uo($a.Disposed,"Connection is disposed.")}function iu(){if(Pa())throw new uo($a.AlreadyListening,"Connection is already listening")}function su(){if(!Pa())throw new Error("Call listen() first.")}function xr(N){return N===void 0?null:N}function Da(N){if(N!==null)return N}function Aa(N){return N!=null&&!Array.isArray(N)&&typeof N=="object"}function no(N,x){switch(N){case re.ParameterStructures.auto:return Aa(x)?Da(x):[xr(x)];case re.ParameterStructures.byName:if(!Aa(x))throw new Error("Received parameters by name but param is not an object literal.");return Da(x);case re.ParameterStructures.byPosition:return[xr(x)];default:throw new Error(`Unknown parameter structure ${N.toString()}`)}}function Oa(N,x){let W,X=N.numberOfParams;switch(X){case 0:W=void 0;break;case 1:W=no(N.parameterStructures,x[0]);break;default:W=[];for(let We=0;We<x.length&&We<X;We++)W.push(xr(x[We]));if(x.length<X)for(let We=x.length;We<X;We++)W.push(null);break}return W}let ii={sendNotification:(N,...x)=>{wi();let W,X;if(pt.string(N)){W=N;let je=x[0],rt=0,dt=re.ParameterStructures.auto;re.ParameterStructures.is(je)&&(rt=1,dt=je);let ve=x.length,Ke=ve-rt;switch(Ke){case 0:X=void 0;break;case 1:X=no(dt,x[rt]);break;default:if(dt===re.ParameterStructures.byName)throw new Error(`Received ${Ke} parameters for 'by Name' notification parameter structure.`);X=x.slice(rt,ve).map(Ae=>xr(Ae));break}}else{let je=x;W=N.method,X=Oa(N,je)}let We={jsonrpc:c,method:W,params:X};return tu(We),e.write(We).catch(je=>{throw i.error("Sending notification failed."),je})},onNotification:(N,x)=>{wi();let W;return pt.func(N)?d=N:x&&(pt.string(N)?(W=N,f.set(N,{type:void 0,handler:x})):(W=N.method,f.set(N.method,{type:N,handler:x}))),{dispose:()=>{W!==void 0?f.delete(W):d=void 0}}},onProgress:(N,x,W)=>{if(h.has(x))throw new Error(`Progress handler for token ${x} already registered`);return h.set(x,W),{dispose:()=>{h.delete(x)}}},sendProgress:(N,x,W)=>ii.sendNotification(La.type,{token:x,value:W}),onUnhandledProgress:ze.event,sendRequest:(N,...x)=>{wi(),su();let W,X,We;if(pt.string(N)){W=N;let ve=x[0],Ke=x[x.length-1],Ae=0,yt=re.ParameterStructures.auto;re.ParameterStructures.is(ve)&&(Ae=1,yt=ve);let Lt=x.length;Nm.CancellationToken.is(Ke)&&(Lt=Lt-1,We=Ke);let In=Lt-Ae;switch(In){case 0:X=void 0;break;case 1:X=no(yt,x[Ae]);break;default:if(yt===re.ParameterStructures.byName)throw new Error(`Received ${In} parameters for 'by Name' request parameter structure.`);X=x.slice(Ae,Lt).map(ou=>xr(ou));break}}else{let ve=x;W=N.method,X=Oa(N,ve);let Ke=N.numberOfParams;We=Nm.CancellationToken.is(ve[Ke])?ve[Ke]:void 0}let je=s++,rt;We&&(rt=We.onCancellationRequested(()=>{let ve=ye.sender.sendCancellation(ii,je);return ve===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${je}`),Promise.resolve()):ve.catch(()=>{i.log(`Sending cancellation messages for id ${je} failed`)})}));let dt={jsonrpc:c,id:je,method:W,params:X};return eu(dt),typeof ye.sender.enableCancellation=="function"&&ye.sender.enableCancellation(dt),new Promise(async(ve,Ke)=>{let Ae=In=>{ve(In),ye.sender.cleanup(je),rt?.dispose()},yt=In=>{Ke(In),ye.sender.cleanup(je),rt?.dispose()},Lt={method:W,timerStart:Date.now(),resolve:Ae,reject:yt};try{await e.write(dt),T.set(je,Lt)}catch(In){throw i.error("Sending request failed."),Lt.reject(new re.ResponseError(re.ErrorCodes.MessageWriteError,In.message?In.message:"Unknown reason")),In}})},onRequest:(N,x)=>{wi();let W=null;return Cm.is(N)?(W=void 0,l=N):pt.string(N)?(W=null,x!==void 0&&(W=N,u.set(N,{handler:x,type:void 0}))):x!==void 0&&(W=N.method,u.set(N.method,{type:N,handler:x})),{dispose:()=>{W!==null&&(W!==void 0?u.delete(W):l=void 0)}}},hasPendingResponse:()=>T.size>0,trace:async(N,x,W)=>{let X=!1,We=xn.Text;W!==void 0&&(pt.boolean(W)?X=W:(X=W.sendNotification||!1,We=W.traceFormat||xn.Text)),b=N,k=We,b===Le.Off?C=void 0:C=x,X&&!fs()&&!ni()&&await ii.sendNotification(Dm.type,{value:Le.toString(N)})},onError:B.event,onClose:q.event,onUnhandledNotification:ce.event,onDispose:Dt.event,end:()=>{e.end()},dispose:()=>{if(ni())return;L=fr.Disposed,Dt.fire(void 0);let N=new re.ResponseError(re.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let x of T.values())x.reject(N);T=new Map,v=new Map,_=new Set,p=new n_.LinkedMap,pt.func(e.dispose)&&e.dispose(),pt.func(t.dispose)&&t.dispose()},listen:()=>{wi(),iu(),L=fr.Listening,t.listen(Xl)},inspect:()=>{(0,t_.default)().console.log("inspect")}};return ii.onNotification(bu.type,N=>{if(b===Le.Off||!C)return;let x=b===Le.Verbose||b===Le.Compact;C.log(N.message,x?N.verbose:void 0)}),ii.onNotification(La.type,N=>{let x=h.get(N.token);x?x(N.value):ze.fire(N)}),ii}ue.createMessageConnection=QM});var wu=w(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.ProgressType=I.ProgressToken=I.createMessageConnection=I.NullLogger=I.ConnectionOptions=I.ConnectionStrategy=I.AbstractMessageBuffer=I.WriteableStreamMessageWriter=I.AbstractMessageWriter=I.MessageWriter=I.ReadableStreamMessageReader=I.AbstractMessageReader=I.MessageReader=I.SharedArrayReceiverStrategy=I.SharedArraySenderStrategy=I.CancellationToken=I.CancellationTokenSource=I.Emitter=I.Event=I.Disposable=I.LRUCache=I.Touch=I.LinkedMap=I.ParameterStructures=I.NotificationType9=I.NotificationType8=I.NotificationType7=I.NotificationType6=I.NotificationType5=I.NotificationType4=I.NotificationType3=I.NotificationType2=I.NotificationType1=I.NotificationType0=I.NotificationType=I.ErrorCodes=I.ResponseError=I.RequestType9=I.RequestType8=I.RequestType7=I.RequestType6=I.RequestType5=I.RequestType4=I.RequestType3=I.RequestType2=I.RequestType1=I.RequestType0=I.RequestType=I.Message=I.RAL=void 0;I.MessageStrategy=I.CancellationStrategy=I.CancellationSenderStrategy=I.CancellationReceiverStrategy=I.ConnectionError=I.ConnectionErrors=I.LogTraceNotification=I.SetTraceNotification=I.TraceFormat=I.TraceValues=I.Trace=void 0;var et=im();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return et.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return et.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return et.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return et.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return et.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return et.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return et.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return et.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return et.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return et.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return et.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return et.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return et.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return et.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return et.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return et.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return et.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return et.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return et.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return et.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return et.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return et.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return et.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return et.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return et.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return et.ParameterStructures}});var Im=om();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return Im.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return Im.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return Im.Touch}});var ZM=zS();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return ZM.Disposable}});var o_=oo();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return o_.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return o_.Emitter}});var a_=pu();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return a_.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return a_.CancellationToken}});var c_=HS();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return c_.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return c_.SharedArrayReceiverStrategy}});var xm=YS();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return xm.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return xm.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return xm.ReadableStreamMessageReader}});var Mm=ZS();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return Mm.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return Mm.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Mm.WriteableStreamMessageWriter}});var e1=e_();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return e1.AbstractMessageBuffer}});var Vt=s_();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Vt.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Vt.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Vt.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Vt.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Vt.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Vt.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Vt.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Vt.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Vt.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Vt.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Vt.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Vt.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Vt.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Vt.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Vt.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Vt.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Vt.MessageStrategy}});var t1=Pi();I.RAL=t1.default});var d_=w(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var l_=require("util"),oi=wu(),Nu=class t extends oi.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new l_.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};Nu.emptyBuffer=Buffer.allocUnsafe(0);var Lm=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),oi.Disposable.create(()=>this.stream.off("data",e))}},$m=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},u_=Object.freeze({messageBuffer:Object.freeze({create:t=>new Nu(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(n){return Promise.reject(n)}}}),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 l_.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Lm(t),asWritableStream:t=>new $m(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function qm(){return u_}(function(t){function e(){oi.RAL.install(u_)}t.install=e})(qm||(qm={}));jm.default=qm});var vs=w(_e=>{"use strict";var n1=_e&&_e.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),r1=_e&&_e.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&n1(e,t,n)};Object.defineProperty(_e,"__esModule",{value:!0});_e.createMessageConnection=_e.createServerSocketTransport=_e.createClientSocketTransport=_e.createServerPipeTransport=_e.createClientPipeTransport=_e.generateRandomPipeName=_e.StreamMessageWriter=_e.StreamMessageReader=_e.SocketMessageWriter=_e.SocketMessageReader=_e.PortMessageWriter=_e.PortMessageReader=_e.IPCMessageWriter=_e.IPCMessageReader=void 0;var fo=d_();fo.default.install();var f_=require("path"),i1=require("os"),s1=require("crypto"),Cu=require("net"),Mn=wu();r1(wu(),_e);var Fm=class extends Mn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mn.Disposable.create(()=>this.process.off("message",e))}};_e.IPCMessageReader=Fm;var Bm=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};_e.IPCMessageWriter=Bm;var Um=class extends Mn.AbstractMessageReader{constructor(e){super(),this.onData=new Mn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};_e.PortMessageReader=Um;var Vm=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};_e.PortMessageWriter=Vm;var gs=class extends Mn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,fo.default)().stream.asReadableStream(e),n)}};_e.SocketMessageReader=gs;var ys=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,fo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};_e.SocketMessageWriter=ys;var Pu=class extends Mn.ReadableStreamMessageReader{constructor(e,n){super((0,fo.default)().stream.asReadableStream(e),n)}};_e.StreamMessageReader=Pu;var Ru=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,fo.default)().stream.asWritableStream(e),n)}};_e.StreamMessageWriter=Ru;var h_=process.env.XDG_RUNTIME_DIR,o1=new Map([["linux",107],["darwin",103]]);function a1(){let t=(0,s1.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;h_?e=f_.join(h_,`vscode-ipc-${t}.sock`):e=f_.join(i1.tmpdir(),`vscode-${t}.sock`);let n=o1.get(process.platform);return n!==void 0&&e.length>n&&(0,fo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}_e.generateRandomPipeName=a1;function c1(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Cu.createServer)(a=>{o.close(),n([new gs(a,e),new ys(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}_e.createClientPipeTransport=c1;function l1(t,e="utf-8"){let n=(0,Cu.createConnection)(t);return[new gs(n,e),new ys(n,e)]}_e.createServerPipeTransport=l1;function u1(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Cu.createServer)(a=>{o.close(),n([new gs(a,e),new ys(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}_e.createClientSocketTransport=u1;function d1(t,e="utf-8"){let n=(0,Cu.createConnection)(t,"127.0.0.1");return[new gs(n,e),new ys(n,e)]}_e.createServerSocketTransport=d1;function f1(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function h1(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function p1(t,e,n,r){n||(n=Mn.NullLogger);let i=f1(t)?new Pu(t):t,s=h1(e)?new Ru(e):e;return Mn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Mn.createMessageConnection)(i,s,n,r)}_e.createMessageConnection=p1});var zm=w((e3,p_)=>{"use strict";p_.exports=vs()});var Au=w((m_,Du)=>{(function(t){if(typeof Du=="object"&&typeof Du.exports=="object"){var e=t(require,m_);e!==void 0&&(Du.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 n;(function(g){function P(R){return typeof R=="string"}g.is=P})(n||(e.DocumentUri=n={}));var r;(function(g){function P(R){return typeof R=="string"}g.is=P})(r||(e.URI=r={}));var i;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function P(R){return typeof R=="number"&&g.MIN_VALUE<=R&&R<=g.MAX_VALUE}g.is=P})(i||(e.integer=i={}));var s;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function P(R){return typeof R=="number"&&g.MIN_VALUE<=R&&R<=g.MAX_VALUE}g.is=P})(s||(e.uinteger=s={}));var o;(function(g){function P(S,m){return S===Number.MAX_VALUE&&(S=s.MAX_VALUE),m===Number.MAX_VALUE&&(m=s.MAX_VALUE),{line:S,character:m}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&A.uinteger(m.line)&&A.uinteger(m.character)}g.is=R})(o||(e.Position=o={}));var a;(function(g){function P(S,m,D,M){if(A.uinteger(S)&&A.uinteger(m)&&A.uinteger(D)&&A.uinteger(M))return{start:o.create(S,m),end:o.create(D,M)};if(o.is(S)&&o.is(m))return{start:S,end:m};throw new Error("Range#create called with invalid arguments[".concat(S,", ").concat(m,", ").concat(D,", ").concat(M,"]"))}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&o.is(m.start)&&o.is(m.end)}g.is=R})(a||(e.Range=a={}));var c;(function(g){function P(S,m){return{uri:S,range:m}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&a.is(m.range)&&(A.string(m.uri)||A.undefined(m.uri))}g.is=R})(c||(e.Location=c={}));var l;(function(g){function P(S,m,D,M){return{targetUri:S,targetRange:m,targetSelectionRange:D,originSelectionRange:M}}g.create=P;function R(S){var m=S;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=R})(l||(e.LocationLink=l={}));var u;(function(g){function P(S,m,D,M){return{red:S,green:m,blue:D,alpha:M}}g.create=P;function R(S){var m=S;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=R})(u||(e.Color=u={}));var d;(function(g){function P(S,m){return{range:S,color:m}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&a.is(m.range)&&u.is(m.color)}g.is=R})(d||(e.ColorInformation=d={}));var f;(function(g){function P(S,m,D){return{label:S,textEdit:m,additionalTextEdits:D}}g.create=P;function R(S){var m=S;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=R})(f||(e.ColorPresentation=f={}));var h;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(h||(e.FoldingRangeKind=h={}));var y;(function(g){function P(S,m,D,M,le,vt){var Ze={startLine:S,endLine:m};return A.defined(D)&&(Ze.startCharacter=D),A.defined(M)&&(Ze.endCharacter=M),A.defined(le)&&(Ze.kind=le),A.defined(vt)&&(Ze.collapsedText=vt),Ze}g.create=P;function R(S){var m=S;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=R})(y||(e.FoldingRange=y={}));var p;(function(g){function P(S,m){return{location:S,message:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&c.is(m.location)&&A.string(m.message)}g.is=R})(p||(e.DiagnosticRelatedInformation=p={}));var T;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(T||(e.DiagnosticSeverity=T={}));var _;(function(g){g.Unnecessary=1,g.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(g){function P(R){var S=R;return A.objectLiteral(S)&&A.string(S.href)}g.is=P})(v||(e.CodeDescription=v={}));var b;(function(g){function P(S,m,D,M,le,vt){var Ze={range:S,message:m};return A.defined(D)&&(Ze.severity=D),A.defined(M)&&(Ze.code=M),A.defined(le)&&(Ze.source=le),A.defined(vt)&&(Ze.relatedInformation=vt),Ze}g.create=P;function R(S){var m,D=S;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,p.is))}g.is=R})(b||(e.Diagnostic=b={}));var k;(function(g){function P(S,m){for(var D=[],M=2;M<arguments.length;M++)D[M-2]=arguments[M];var le={title:S,command:m};return A.defined(D)&&D.length>0&&(le.arguments=D),le}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.title)&&A.string(m.command)}g.is=R})(k||(e.Command=k={}));var C;(function(g){function P(D,M){return{range:D,newText:M}}g.replace=P;function R(D,M){return{range:{start:D,end:D},newText:M}}g.insert=R;function S(D){return{range:D,newText:""}}g.del=S;function m(D){var M=D;return A.objectLiteral(M)&&A.string(M.newText)&&a.is(M.range)}g.is=m})(C||(e.TextEdit=C={}));var L;(function(g){function P(S,m,D){var M={label:S};return m!==void 0&&(M.needsConfirmation=m),D!==void 0&&(M.description=D),M}g.create=P;function R(S){var m=S;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=R})(L||(e.ChangeAnnotation=L={}));var B;(function(g){function P(R){var S=R;return A.string(S)}g.is=P})(B||(e.ChangeAnnotationIdentifier=B={}));var q;(function(g){function P(D,M,le){return{range:D,newText:M,annotationId:le}}g.replace=P;function R(D,M,le){return{range:{start:D,end:D},newText:M,annotationId:le}}g.insert=R;function S(D,M){return{range:D,newText:"",annotationId:M}}g.del=S;function m(D){var M=D;return C.is(M)&&(L.is(M.annotationId)||B.is(M.annotationId))}g.is=m})(q||(e.AnnotatedTextEdit=q={}));var ce;(function(g){function P(S,m){return{textDocument:S,edits:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&fs.is(m.textDocument)&&Array.isArray(m.edits)}g.is=R})(ce||(e.TextDocumentEdit=ce={}));var ze;(function(g){function P(S,m,D){var M={kind:"create",uri:S};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(M.options=m),D!==void 0&&(M.annotationId=D),M}g.create=P;function R(S){var m=S;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||B.is(m.annotationId))}g.is=R})(ze||(e.CreateFile=ze={}));var Dt;(function(g){function P(S,m,D,M){var le={kind:"rename",oldUri:S,newUri:m};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(le.options=D),M!==void 0&&(le.annotationId=M),le}g.create=P;function R(S){var m=S;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||B.is(m.annotationId))}g.is=R})(Dt||(e.RenameFile=Dt={}));var ye;(function(g){function P(S,m,D){var M={kind:"delete",uri:S};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(M.options=m),D!==void 0&&(M.annotationId=D),M}g.create=P;function R(S){var m=S;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||B.is(m.annotationId))}g.is=R})(ye||(e.DeleteFile=ye={}));var Un;(function(g){function P(R){var S=R;return S&&(S.changes!==void 0||S.documentChanges!==void 0)&&(S.documentChanges===void 0||S.documentChanges.every(function(m){return A.string(m.kind)?ze.is(m)||Dt.is(m)||ye.is(m):ce.is(m)}))}g.is=P})(Un||(e.WorkspaceEdit=Un={}));var ki=function(){function g(P,R){this.edits=P,this.changeAnnotations=R}return g.prototype.insert=function(P,R,S){var m,D;if(S===void 0?m=C.insert(P,R):B.is(S)?(D=S,m=q.insert(P,R,S)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(S),m=q.insert(P,R,D)),this.edits.push(m),D!==void 0)return D},g.prototype.replace=function(P,R,S){var m,D;if(S===void 0?m=C.replace(P,R):B.is(S)?(D=S,m=q.replace(P,R,S)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(S),m=q.replace(P,R,D)),this.edits.push(m),D!==void 0)return D},g.prototype.delete=function(P,R){var S,m;if(R===void 0?S=C.del(P):B.is(R)?(m=R,S=q.del(P,R)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(R),S=q.del(P,m)),this.edits.push(S),m!==void 0)return m},g.prototype.add=function(P){this.edits.push(P)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(P){if(P===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),Hl=function(){function g(P){this._annotations=P===void 0?Object.create(null):P,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(P,R){var S;if(B.is(P)?S=P:(S=this.nextId(),R=P),this._annotations[S]!==void 0)throw new Error("Id ".concat(S," is already in use."));if(R===void 0)throw new Error("No annotation provided for id ".concat(S));return this._annotations[S]=R,this._size++,S},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),Op=function(){function g(P){var R=this;this._textEditChanges=Object.create(null),P!==void 0?(this._workspaceEdit=P,P.documentChanges?(this._changeAnnotations=new Hl(P.changeAnnotations),P.changeAnnotations=this._changeAnnotations.all(),P.documentChanges.forEach(function(S){if(ce.is(S)){var m=new ki(S.edits,R._changeAnnotations);R._textEditChanges[S.textDocument.uri]=m}})):P.changes&&Object.keys(P.changes).forEach(function(S){var m=new ki(P.changes[S]);R._textEditChanges[S]=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(P){if(fs.is(P)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var R={uri:P.uri,version:P.version},S=this._textEditChanges[R.uri];if(!S){var m=[],D={textDocument:R,edits:m};this._workspaceEdit.documentChanges.push(D),S=new ki(m,this._changeAnnotations),this._textEditChanges[R.uri]=S}return S}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var S=this._textEditChanges[P];if(!S){var m=[];this._workspaceEdit.changes[P]=m,S=new ki(m),this._textEditChanges[P]=S}return S}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Hl,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(P,R,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;L.is(R)||B.is(R)?m=R:S=R;var D,M;if(m===void 0?D=ze.create(P,S):(M=B.is(m)?m:this._changeAnnotations.manage(m),D=ze.create(P,S,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},g.prototype.renameFile=function(P,R,S,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;L.is(S)||B.is(S)?D=S:m=S;var M,le;if(D===void 0?M=Dt.create(P,R,m):(le=B.is(D)?D:this._changeAnnotations.manage(D),M=Dt.create(P,R,m,le)),this._workspaceEdit.documentChanges.push(M),le!==void 0)return le},g.prototype.deleteFile=function(P,R,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;L.is(R)||B.is(R)?m=R:S=R;var D,M;if(m===void 0?D=ye.create(P,S):(M=B.is(m)?m:this._changeAnnotations.manage(m),D=ye.create(P,S,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},g}();e.WorkspaceChange=Op;var Gl;(function(g){function P(S){return{uri:S}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.uri)}g.is=R})(Gl||(e.TextDocumentIdentifier=Gl={}));var Pa;(function(g){function P(S,m){return{uri:S,version:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.uri)&&A.integer(m.version)}g.is=R})(Pa||(e.VersionedTextDocumentIdentifier=Pa={}));var fs;(function(g){function P(S,m){return{uri:S,version:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.uri)&&(m.version===null||A.integer(m.version))}g.is=R})(fs||(e.OptionalVersionedTextDocumentIdentifier=fs={}));var ni;(function(g){function P(S,m,D,M){return{uri:S,languageId:m,version:D,text:M}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.string(m.uri)&&A.string(m.languageId)&&A.integer(m.version)&&A.string(m.text)}g.is=R})(ni||(e.TextDocumentItem=ni={}));var Zs;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function P(R){var S=R;return S===g.PlainText||S===g.Markdown}g.is=P})(Zs||(e.MarkupKind=Zs={}));var hs;(function(g){function P(R){var S=R;return A.objectLiteral(R)&&Zs.is(S.kind)&&A.string(S.value)}g.is=P})(hs||(e.MarkupContent=hs={}));var Yl;(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})(Yl||(e.CompletionItemKind=Yl={}));var Ra;(function(g){g.PlainText=1,g.Snippet=2})(Ra||(e.InsertTextFormat=Ra={}));var Ca;(function(g){g.Deprecated=1})(Ca||(e.CompletionItemTag=Ca={}));var Kl;(function(g){function P(S,m,D){return{newText:S,insert:m,replace:D}}g.create=P;function R(S){var m=S;return m&&A.string(m.newText)&&a.is(m.insert)&&a.is(m.replace)}g.is=R})(Kl||(e.InsertReplaceEdit=Kl={}));var Xl;(function(g){g.asIs=1,g.adjustIndentation=2})(Xl||(e.InsertTextMode=Xl={}));var Jl;(function(g){function P(R){var S=R;return S&&(A.string(S.detail)||S.detail===void 0)&&(A.string(S.description)||S.description===void 0)}g.is=P})(Jl||(e.CompletionItemLabelDetails=Jl={}));var Ql;(function(g){function P(R){return{label:R}}g.create=P})(Ql||(e.CompletionItem=Ql={}));var Zl;(function(g){function P(R,S){return{items:R||[],isIncomplete:!!S}}g.create=P})(Zl||(e.CompletionList=Zl={}));var eo;(function(g){function P(S){return S.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=P;function R(S){var m=S;return A.string(m)||A.objectLiteral(m)&&A.string(m.language)&&A.string(m.value)}g.is=R})(eo||(e.MarkedString=eo={}));var lr;(function(g){function P(R){var S=R;return!!S&&A.objectLiteral(S)&&(hs.is(S.contents)||eo.is(S.contents)||A.typedArray(S.contents,eo.is))&&(R.range===void 0||a.is(R.range))}g.is=P})(lr||(e.Hover=lr={}));var eu;(function(g){function P(R,S){return S?{label:R,documentation:S}:{label:R}}g.create=P})(eu||(e.ParameterInformation=eu={}));var tu;(function(g){function P(R,S){for(var m=[],D=2;D<arguments.length;D++)m[D-2]=arguments[D];var M={label:R};return A.defined(S)&&(M.documentation=S),A.defined(m)?M.parameters=m:M.parameters=[],M}g.create=P})(tu||(e.SignatureInformation=tu={}));var ps;(function(g){g.Text=1,g.Read=2,g.Write=3})(ps||(e.DocumentHighlightKind=ps={}));var nu;(function(g){function P(R,S){var m={range:R};return A.number(S)&&(m.kind=S),m}g.create=P})(nu||(e.DocumentHighlight=nu={}));var to;(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})(to||(e.SymbolKind=to={}));var ru;(function(g){g.Deprecated=1})(ru||(e.SymbolTag=ru={}));var ri;(function(g){function P(R,S,m,D,M){var le={name:R,kind:S,location:{uri:D,range:m}};return M&&(le.containerName=M),le}g.create=P})(ri||(e.SymbolInformation=ri={}));var wi;(function(g){function P(R,S,m,D){return D!==void 0?{name:R,kind:S,location:{uri:m,range:D}}:{name:R,kind:S,location:{uri:m}}}g.create=P})(wi||(e.WorkspaceSymbol=wi={}));var iu;(function(g){function P(S,m,D,M,le,vt){var Ze={name:S,detail:m,kind:D,range:M,selectionRange:le};return vt!==void 0&&(Ze.children=vt),Ze}g.create=P;function R(S){var m=S;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=R})(iu||(e.DocumentSymbol=iu={}));var su;(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"})(su||(e.CodeActionKind=su={}));var xr;(function(g){g.Invoked=1,g.Automatic=2})(xr||(e.CodeActionTriggerKind=xr={}));var Da;(function(g){function P(S,m,D){var M={diagnostics:S};return m!=null&&(M.only=m),D!=null&&(M.triggerKind=D),M}g.create=P;function R(S){var m=S;return A.defined(m)&&A.typedArray(m.diagnostics,b.is)&&(m.only===void 0||A.typedArray(m.only,A.string))&&(m.triggerKind===void 0||m.triggerKind===xr.Invoked||m.triggerKind===xr.Automatic)}g.is=R})(Da||(e.CodeActionContext=Da={}));var Aa;(function(g){function P(S,m,D){var M={title:S},le=!0;return typeof m=="string"?(le=!1,M.kind=m):k.is(m)?M.command=m:M.edit=m,le&&D!==void 0&&(M.kind=D),M}g.create=P;function R(S){var m=S;return m&&A.string(m.title)&&(m.diagnostics===void 0||A.typedArray(m.diagnostics,b.is))&&(m.kind===void 0||A.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||k.is(m.command))&&(m.isPreferred===void 0||A.boolean(m.isPreferred))&&(m.edit===void 0||Un.is(m.edit))}g.is=R})(Aa||(e.CodeAction=Aa={}));var no;(function(g){function P(S,m){var D={range:S};return A.defined(m)&&(D.data=m),D}g.create=P;function R(S){var m=S;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.command)||k.is(m.command))}g.is=R})(no||(e.CodeLens=no={}));var Oa;(function(g){function P(S,m){return{tabSize:S,insertSpaces:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&A.uinteger(m.tabSize)&&A.boolean(m.insertSpaces)}g.is=R})(Oa||(e.FormattingOptions=Oa={}));var ii;(function(g){function P(S,m,D){return{range:S,target:m,data:D}}g.create=P;function R(S){var m=S;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.target)||A.string(m.target))}g.is=R})(ii||(e.DocumentLink=ii={}));var N;(function(g){function P(S,m){return{range:S,parent:m}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&a.is(m.range)&&(m.parent===void 0||g.is(m.parent))}g.is=R})(N||(e.SelectionRange=N={}));var x;(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"})(x||(e.SemanticTokenTypes=x={}));var W;(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"})(W||(e.SemanticTokenModifiers=W={}));var X;(function(g){function P(R){var S=R;return A.objectLiteral(S)&&(S.resultId===void 0||typeof S.resultId=="string")&&Array.isArray(S.data)&&(S.data.length===0||typeof S.data[0]=="number")}g.is=P})(X||(e.SemanticTokens=X={}));var We;(function(g){function P(S,m){return{range:S,text:m}}g.create=P;function R(S){var m=S;return m!=null&&a.is(m.range)&&A.string(m.text)}g.is=R})(We||(e.InlineValueText=We={}));var je;(function(g){function P(S,m,D){return{range:S,variableName:m,caseSensitiveLookup:D}}g.create=P;function R(S){var m=S;return m!=null&&a.is(m.range)&&A.boolean(m.caseSensitiveLookup)&&(A.string(m.variableName)||m.variableName===void 0)}g.is=R})(je||(e.InlineValueVariableLookup=je={}));var rt;(function(g){function P(S,m){return{range:S,expression:m}}g.create=P;function R(S){var m=S;return m!=null&&a.is(m.range)&&(A.string(m.expression)||m.expression===void 0)}g.is=R})(rt||(e.InlineValueEvaluatableExpression=rt={}));var dt;(function(g){function P(S,m){return{frameId:S,stoppedLocation:m}}g.create=P;function R(S){var m=S;return A.defined(m)&&a.is(S.stoppedLocation)}g.is=R})(dt||(e.InlineValueContext=dt={}));var ve;(function(g){g.Type=1,g.Parameter=2;function P(R){return R===1||R===2}g.is=P})(ve||(e.InlayHintKind=ve={}));var Ke;(function(g){function P(S){return{value:S}}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&(m.tooltip===void 0||A.string(m.tooltip)||hs.is(m.tooltip))&&(m.location===void 0||c.is(m.location))&&(m.command===void 0||k.is(m.command))}g.is=R})(Ke||(e.InlayHintLabelPart=Ke={}));var Ae;(function(g){function P(S,m,D){var M={position:S,label:m};return D!==void 0&&(M.kind=D),M}g.create=P;function R(S){var m=S;return A.objectLiteral(m)&&o.is(m.position)&&(A.string(m.label)||A.typedArray(m.label,Ke.is))&&(m.kind===void 0||ve.is(m.kind))&&m.textEdits===void 0||A.typedArray(m.textEdits,C.is)&&(m.tooltip===void 0||A.string(m.tooltip)||hs.is(m.tooltip))&&(m.paddingLeft===void 0||A.boolean(m.paddingLeft))&&(m.paddingRight===void 0||A.boolean(m.paddingRight))}g.is=R})(Ae||(e.InlayHint=Ae={}));var yt;(function(g){function P(R){return{kind:"snippet",value:R}}g.createSnippet=P})(yt||(e.StringValue=yt={}));var Lt;(function(g){function P(R,S,m,D){return{insertText:R,filterText:S,range:m,command:D}}g.create=P})(Lt||(e.InlineCompletionItem=Lt={}));var In;(function(g){function P(R){return{items:R}}g.create=P})(In||(e.InlineCompletionList=In={}));var ou;(function(g){g.Invoked=0,g.Automatic=1})(ou||(e.InlineCompletionTriggerKind=ou={}));var AS;(function(g){function P(R,S){return{range:R,text:S}}g.create=P})(AS||(e.SelectedCompletionInfo=AS={}));var OS;(function(g){function P(R,S){return{triggerKind:R,selectedCompletionInfo:S}}g.create=P})(OS||(e.InlineCompletionContext=OS={}));var IS;(function(g){function P(R){var S=R;return A.objectLiteral(S)&&r.is(S.uri)&&A.string(S.name)}g.is=P})(IS||(e.WorkspaceFolder=IS={})),e.EOL=[`
|
|
33
33
|
`,`\r
|
|
34
|
-
`,"\r"];var
|
|
34
|
+
`,"\r"];var xS;(function(g){function P(D,M,le,vt){return new SM(D,M,le,vt)}g.create=P;function R(D){var M=D;return!!(A.defined(M)&&A.string(M.uri)&&(A.undefined(M.languageId)||A.string(M.languageId))&&A.uinteger(M.lineCount)&&A.func(M.getText)&&A.func(M.positionAt)&&A.func(M.offsetAt))}g.is=R;function S(D,M){for(var le=D.getText(),vt=m(M,function(ro,au){var MS=ro.range.start.line-au.range.start.line;return MS===0?ro.range.start.character-au.range.start.character:MS}),Ze=le.length,ur=vt.length-1;ur>=0;ur--){var dr=vt[ur],si=D.offsetAt(dr.range.start),Se=D.offsetAt(dr.range.end);if(Se<=Ze)le=le.substring(0,si)+dr.newText+le.substring(Se,le.length);else throw new Error("Overlapping edit");Ze=si}return le}g.applyEdits=S;function m(D,M){if(D.length<=1)return D;var le=D.length/2|0,vt=D.slice(0,le),Ze=D.slice(le);m(vt,M),m(Ze,M);for(var ur=0,dr=0,si=0;ur<vt.length&&dr<Ze.length;){var Se=M(vt[ur],Ze[dr]);Se<=0?D[si++]=vt[ur++]:D[si++]=Ze[dr++]}for(;ur<vt.length;)D[si++]=vt[ur++];for(;dr<Ze.length;)D[si++]=Ze[dr++];return D}})(xS||(e.TextDocument=xS={}));var SM=function(){function g(P,R,S,m){this._uri=P,this._languageId=R,this._version=S,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(g.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),g.prototype.getText=function(P){if(P){var R=this.offsetAt(P.start),S=this.offsetAt(P.end);return this._content.substring(R,S)}return this._content},g.prototype.update=function(P,R){this._content=P.text,this._version=R,this._lineOffsets=void 0},g.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var P=[],R=this._content,S=!0,m=0;m<R.length;m++){S&&(P.push(m),S=!1);var D=R.charAt(m);S=D==="\r"||D===`
|
|
35
35
|
`,D==="\r"&&m+1<R.length&&R.charAt(m+1)===`
|
|
36
|
-
`&&m++}S&&R.length>0&&P.push(R.length),this._lineOffsets=P}return this._lineOffsets},g.prototype.positionAt=function(P){P=Math.max(Math.min(P,this._content.length),0);var R=this.getLineOffsets(),S=0,m=R.length;if(m===0)return o.create(0,P);for(;S<m;){var D=Math.floor((S+m)/2);R[D]>P?m=D:S=D+1}var M=S-1;return o.create(M,P-R[M])},g.prototype.offsetAt=function(P){var R=this.getLineOffsets();if(P.line>=R.length)return this._content.length;if(P.line<0)return 0;var S=R[P.line],m=P.line+1<R.length?R[P.line+1]:this._content.length;return Math.max(Math.min(S+P.character,m),S)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),A;(function(g){var P=Object.prototype.toString;function R(Se){return typeof Se<"u"}g.defined=R;function S(Se){return typeof Se>"u"}g.undefined=S;function m(Se){return Se===!0||Se===!1}g.boolean=m;function D(Se){return P.call(Se)==="[object String]"}g.string=D;function M(Se){return P.call(Se)==="[object Number]"}g.number=M;function le(Se,to,ru){return P.call(Se)==="[object Number]"&&to<=Se&&Se<=ru}g.numberRange=le;function yt(Se){return P.call(Se)==="[object Number]"&&-2147483648<=Se&&Se<=2147483647}g.integer=yt;function Qe(Se){return P.call(Se)==="[object Number]"&&0<=Se&&Se<=2147483647}g.uinteger=Qe;function cr(Se){return P.call(Se)==="[object Function]"}g.func=cr;function lr(Se){return Se!==null&&typeof Se=="object"}g.objectLiteral=lr;function ri(Se,to){return Array.isArray(Se)&&Se.every(to)}g.typedArray=ri})(A||(A={}))})});var ht=k(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.ProtocolNotificationType=yn.ProtocolNotificationType0=yn.ProtocolRequestType=yn.ProtocolRequestType0=yn.RegistrationType=yn.MessageDirection=void 0;var uo=ys(),f_;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(f_||(yn.MessageDirection=f_={}));var Vm=class{constructor(e){this.method=e}};yn.RegistrationType=Vm;var zm=class extends uo.RequestType0{constructor(e){super(e)}};yn.ProtocolRequestType0=zm;var Wm=class extends uo.RequestType{constructor(e){super(e,uo.ParameterStructures.byName)}};yn.ProtocolRequestType=Wm;var Hm=class extends uo.NotificationType0{constructor(e){super(e)}};yn.ProtocolNotificationType0=Hm;var Gm=class extends uo.NotificationType{constructor(e){super(e,uo.ParameterStructures.byName)}};yn.ProtocolNotificationType=Gm});var Ru=k(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.objectLiteral=Pt.typedArray=Pt.stringArray=Pt.array=Pt.func=Pt.error=Pt.number=Pt.string=Pt.boolean=void 0;function l1(t){return t===!0||t===!1}Pt.boolean=l1;function h_(t){return typeof t=="string"||t instanceof String}Pt.string=h_;function u1(t){return typeof t=="number"||t instanceof Number}Pt.number=u1;function d1(t){return t instanceof Error}Pt.error=d1;function f1(t){return typeof t=="function"}Pt.func=f1;function p_(t){return Array.isArray(t)}Pt.array=p_;function h1(t){return p_(t)&&t.every(e=>h_(e))}Pt.stringArray=h1;function p1(t,e){return Array.isArray(t)&&t.every(e)}Pt.typedArray=p1;function m1(t){return t!==null&&typeof t=="object"}Pt.objectLiteral=m1});var y_=k(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.ImplementationRequest=void 0;var m_=ht(),g_;(function(t){t.method="textDocument/implementation",t.messageDirection=m_.MessageDirection.clientToServer,t.type=new m_.ProtocolRequestType(t.method)})(g_||(Cu.ImplementationRequest=g_={}))});var T_=k(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.TypeDefinitionRequest=void 0;var v_=ht(),b_;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=v_.MessageDirection.clientToServer,t.type=new v_.ProtocolRequestType(t.method)})(b_||(Du.TypeDefinitionRequest=b_={}))});var E_=k(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.DidChangeWorkspaceFoldersNotification=fo.WorkspaceFoldersRequest=void 0;var Au=ht(),S_;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Au.MessageDirection.serverToClient,t.type=new Au.ProtocolRequestType0(t.method)})(S_||(fo.WorkspaceFoldersRequest=S_={}));var __;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Au.MessageDirection.clientToServer,t.type=new Au.ProtocolNotificationType(t.method)})(__||(fo.DidChangeWorkspaceFoldersNotification=__={}))});var N_=k(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.ConfigurationRequest=void 0;var w_=ht(),k_;(function(t){t.method="workspace/configuration",t.messageDirection=w_.MessageDirection.serverToClient,t.type=new w_.ProtocolRequestType(t.method)})(k_||(Ou.ConfigurationRequest=k_={}))});var C_=k(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.ColorPresentationRequest=ho.DocumentColorRequest=void 0;var Iu=ht(),P_;(function(t){t.method="textDocument/documentColor",t.messageDirection=Iu.MessageDirection.clientToServer,t.type=new Iu.ProtocolRequestType(t.method)})(P_||(ho.DocumentColorRequest=P_={}));var R_;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Iu.MessageDirection.clientToServer,t.type=new Iu.ProtocolRequestType(t.method)})(R_||(ho.ColorPresentationRequest=R_={}))});var O_=k(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.FoldingRangeRefreshRequest=po.FoldingRangeRequest=void 0;var xu=ht(),D_;(function(t){t.method="textDocument/foldingRange",t.messageDirection=xu.MessageDirection.clientToServer,t.type=new xu.ProtocolRequestType(t.method)})(D_||(po.FoldingRangeRequest=D_={}));var A_;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=xu.MessageDirection.serverToClient,t.type=new xu.ProtocolRequestType0(t.method)})(A_||(po.FoldingRangeRefreshRequest=A_={}))});var M_=k(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.DeclarationRequest=void 0;var I_=ht(),x_;(function(t){t.method="textDocument/declaration",t.messageDirection=I_.MessageDirection.clientToServer,t.type=new I_.ProtocolRequestType(t.method)})(x_||(Mu.DeclarationRequest=x_={}))});var q_=k(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.SelectionRangeRequest=void 0;var L_=ht(),$_;(function(t){t.method="textDocument/selectionRange",t.messageDirection=L_.MessageDirection.clientToServer,t.type=new L_.ProtocolRequestType(t.method)})($_||(Lu.SelectionRangeRequest=$_={}))});var U_=k(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.WorkDoneProgressCancelNotification=Ci.WorkDoneProgressCreateRequest=Ci.WorkDoneProgress=void 0;var g1=ys(),$u=ht(),j_;(function(t){t.type=new g1.ProgressType;function e(n){return n===t.type}t.is=e})(j_||(Ci.WorkDoneProgress=j_={}));var F_;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=$u.MessageDirection.serverToClient,t.type=new $u.ProtocolRequestType(t.method)})(F_||(Ci.WorkDoneProgressCreateRequest=F_={}));var B_;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=$u.MessageDirection.clientToServer,t.type=new $u.ProtocolNotificationType(t.method)})(B_||(Ci.WorkDoneProgressCancelNotification=B_={}))});var H_=k(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.CallHierarchyOutgoingCallsRequest=Di.CallHierarchyIncomingCallsRequest=Di.CallHierarchyPrepareRequest=void 0;var mo=ht(),V_;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(V_||(Di.CallHierarchyPrepareRequest=V_={}));var z_;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(z_||(Di.CallHierarchyIncomingCallsRequest=z_={}));var W_;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(W_||(Di.CallHierarchyOutgoingCallsRequest=W_={}))});var Q_=k(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.SemanticTokensRefreshRequest=vn.SemanticTokensRangeRequest=vn.SemanticTokensDeltaRequest=vn.SemanticTokensRequest=vn.SemanticTokensRegistrationType=vn.TokenFormat=void 0;var si=ht(),G_;(function(t){t.Relative="relative"})(G_||(vn.TokenFormat=G_={}));var qa;(function(t){t.method="textDocument/semanticTokens",t.type=new si.RegistrationType(t.method)})(qa||(vn.SemanticTokensRegistrationType=qa={}));var Y_;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=qa.method})(Y_||(vn.SemanticTokensRequest=Y_={}));var K_;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=qa.method})(K_||(vn.SemanticTokensDeltaRequest=K_={}));var X_;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=qa.method})(X_||(vn.SemanticTokensRangeRequest=X_={}));var J_;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=si.MessageDirection.serverToClient,t.type=new si.ProtocolRequestType0(t.method)})(J_||(vn.SemanticTokensRefreshRequest=J_={}))});var tE=k(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.ShowDocumentRequest=void 0;var Z_=ht(),eE;(function(t){t.method="window/showDocument",t.messageDirection=Z_.MessageDirection.serverToClient,t.type=new Z_.ProtocolRequestType(t.method)})(eE||(qu.ShowDocumentRequest=eE={}))});var iE=k(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.LinkedEditingRangeRequest=void 0;var nE=ht(),rE;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=nE.MessageDirection.clientToServer,t.type=new nE.ProtocolRequestType(t.method)})(rE||(ju.LinkedEditingRangeRequest=rE={}))});var fE=k(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.WillDeleteFilesRequest=Zt.DidDeleteFilesNotification=Zt.DidRenameFilesNotification=Zt.WillRenameFilesRequest=Zt.DidCreateFilesNotification=Zt.WillCreateFilesRequest=Zt.FileOperationPatternKind=void 0;var Vn=ht(),sE;(function(t){t.file="file",t.folder="folder"})(sE||(Zt.FileOperationPatternKind=sE={}));var oE;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(oE||(Zt.WillCreateFilesRequest=oE={}));var aE;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(aE||(Zt.DidCreateFilesNotification=aE={}));var cE;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(cE||(Zt.WillRenameFilesRequest=cE={}));var lE;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(lE||(Zt.DidRenameFilesNotification=lE={}));var uE;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(uE||(Zt.DidDeleteFilesNotification=uE={}));var dE;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(dE||(Zt.WillDeleteFilesRequest=dE={}))});var yE=k(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.MonikerRequest=Ai.MonikerKind=Ai.UniquenessLevel=void 0;var hE=ht(),pE;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(pE||(Ai.UniquenessLevel=pE={}));var mE;(function(t){t.$import="import",t.$export="export",t.local="local"})(mE||(Ai.MonikerKind=mE={}));var gE;(function(t){t.method="textDocument/moniker",t.messageDirection=hE.MessageDirection.clientToServer,t.type=new hE.ProtocolRequestType(t.method)})(gE||(Ai.MonikerRequest=gE={}))});var SE=k(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.TypeHierarchySubtypesRequest=Oi.TypeHierarchySupertypesRequest=Oi.TypeHierarchyPrepareRequest=void 0;var go=ht(),vE;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(vE||(Oi.TypeHierarchyPrepareRequest=vE={}));var bE;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(bE||(Oi.TypeHierarchySupertypesRequest=bE={}));var TE;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(TE||(Oi.TypeHierarchySubtypesRequest=TE={}))});var wE=k(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.InlineValueRefreshRequest=yo.InlineValueRequest=void 0;var Fu=ht(),_E;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Fu.MessageDirection.clientToServer,t.type=new Fu.ProtocolRequestType(t.method)})(_E||(yo.InlineValueRequest=_E={}));var EE;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Fu.MessageDirection.serverToClient,t.type=new Fu.ProtocolRequestType0(t.method)})(EE||(yo.InlineValueRefreshRequest=EE={}))});var RE=k(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.InlayHintRefreshRequest=Ii.InlayHintResolveRequest=Ii.InlayHintRequest=void 0;var vo=ht(),kE;(function(t){t.method="textDocument/inlayHint",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method)})(kE||(Ii.InlayHintRequest=kE={}));var NE;(function(t){t.method="inlayHint/resolve",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method)})(NE||(Ii.InlayHintResolveRequest=NE={}));var PE;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=vo.MessageDirection.serverToClient,t.type=new vo.ProtocolRequestType0(t.method)})(PE||(Ii.InlayHintRefreshRequest=PE={}))});var ME=k(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.DiagnosticRefreshRequest=zn.WorkspaceDiagnosticRequest=zn.DocumentDiagnosticRequest=zn.DocumentDiagnosticReportKind=zn.DiagnosticServerCancellationData=void 0;var xE=ys(),y1=Ru(),bo=ht(),CE;(function(t){function e(n){let r=n;return r&&y1.boolean(r.retriggerRequest)}t.is=e})(CE||(zn.DiagnosticServerCancellationData=CE={}));var DE;(function(t){t.Full="full",t.Unchanged="unchanged"})(DE||(zn.DocumentDiagnosticReportKind=DE={}));var AE;(function(t){t.method="textDocument/diagnostic",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.partialResult=new xE.ProgressType})(AE||(zn.DocumentDiagnosticRequest=AE={}));var OE;(function(t){t.method="workspace/diagnostic",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.partialResult=new xE.ProgressType})(OE||(zn.WorkspaceDiagnosticRequest=OE={}));var IE;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=bo.MessageDirection.serverToClient,t.type=new bo.ProtocolRequestType0(t.method)})(IE||(zn.DiagnosticRefreshRequest=IE={}))});var UE=k(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.DidCloseNotebookDocumentNotification=vt.DidSaveNotebookDocumentNotification=vt.DidChangeNotebookDocumentNotification=vt.NotebookCellArrayChange=vt.DidOpenNotebookDocumentNotification=vt.NotebookDocumentSyncRegistrationType=vt.NotebookDocument=vt.NotebookCell=vt.ExecutionSummary=vt.NotebookCellKind=void 0;var ja=Pu(),dr=Ru(),Ir=ht(),Ym;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Ym||(vt.NotebookCellKind=Ym={}));var Km;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return dr.objectLiteral(s)&&ja.uinteger.is(s.executionOrder)&&(s.success===void 0||dr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(Km||(vt.ExecutionSummary=Km={}));var Bu;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return dr.objectLiteral(o)&&Ym.is(o.kind)&&ja.DocumentUri.is(o.document)&&(o.metadata===void 0||dr.objectLiteral(o.metadata))}t.is=n;function r(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)&&!Km.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;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(dr.objectLiteral(s)&&dr.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}})(Bu||(vt.NotebookCell=Bu={}));var LE;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return dr.objectLiteral(i)&&dr.string(i.uri)&&ja.integer.is(i.version)&&dr.typedArray(i.cells,Bu.is)}t.is=n})(LE||(vt.NotebookDocument=LE={}));var To;(function(t){t.method="notebookDocument/sync",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.RegistrationType(t.method)})(To||(vt.NotebookDocumentSyncRegistrationType=To={}));var $E;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=To.method})($E||(vt.DidOpenNotebookDocumentNotification=$E={}));var qE;(function(t){function e(r){let i=r;return dr.objectLiteral(i)&&ja.uinteger.is(i.start)&&ja.uinteger.is(i.deleteCount)&&(i.cells===void 0||dr.typedArray(i.cells,Bu.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(qE||(vt.NotebookCellArrayChange=qE={}));var jE;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=To.method})(jE||(vt.DidChangeNotebookDocumentNotification=jE={}));var FE;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=To.method})(FE||(vt.DidSaveNotebookDocumentNotification=FE={}));var BE;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=To.method})(BE||(vt.DidCloseNotebookDocumentNotification=BE={}))});var WE=k(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.InlineCompletionRequest=void 0;var VE=ht(),zE;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=VE.MessageDirection.clientToServer,t.type=new VE.ProtocolRequestType(t.method)})(zE||(Uu.InlineCompletionRequest=zE={}))});var ik=k(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.WorkspaceSymbolRequest=E.CodeActionResolveRequest=E.CodeActionRequest=E.DocumentSymbolRequest=E.DocumentHighlightRequest=E.ReferencesRequest=E.DefinitionRequest=E.SignatureHelpRequest=E.SignatureHelpTriggerKind=E.HoverRequest=E.CompletionResolveRequest=E.CompletionRequest=E.CompletionTriggerKind=E.PublishDiagnosticsNotification=E.WatchKind=E.RelativePattern=E.FileChangeType=E.DidChangeWatchedFilesNotification=E.WillSaveTextDocumentWaitUntilRequest=E.WillSaveTextDocumentNotification=E.TextDocumentSaveReason=E.DidSaveTextDocumentNotification=E.DidCloseTextDocumentNotification=E.DidChangeTextDocumentNotification=E.TextDocumentContentChangeEvent=E.DidOpenTextDocumentNotification=E.TextDocumentSyncKind=E.TelemetryEventNotification=E.LogMessageNotification=E.ShowMessageRequest=E.ShowMessageNotification=E.MessageType=E.DidChangeConfigurationNotification=E.ExitNotification=E.ShutdownRequest=E.InitializedNotification=E.InitializeErrorCodes=E.InitializeRequest=E.WorkDoneProgressOptions=E.TextDocumentRegistrationOptions=E.StaticRegistrationOptions=E.PositionEncodingKind=E.FailureHandlingKind=E.ResourceOperationKind=E.UnregistrationRequest=E.RegistrationRequest=E.DocumentSelector=E.NotebookCellTextDocumentFilter=E.NotebookDocumentFilter=E.TextDocumentFilter=void 0;E.MonikerRequest=E.MonikerKind=E.UniquenessLevel=E.WillDeleteFilesRequest=E.DidDeleteFilesNotification=E.WillRenameFilesRequest=E.DidRenameFilesNotification=E.WillCreateFilesRequest=E.DidCreateFilesNotification=E.FileOperationPatternKind=E.LinkedEditingRangeRequest=E.ShowDocumentRequest=E.SemanticTokensRegistrationType=E.SemanticTokensRefreshRequest=E.SemanticTokensRangeRequest=E.SemanticTokensDeltaRequest=E.SemanticTokensRequest=E.TokenFormat=E.CallHierarchyPrepareRequest=E.CallHierarchyOutgoingCallsRequest=E.CallHierarchyIncomingCallsRequest=E.WorkDoneProgressCancelNotification=E.WorkDoneProgressCreateRequest=E.WorkDoneProgress=E.SelectionRangeRequest=E.DeclarationRequest=E.FoldingRangeRefreshRequest=E.FoldingRangeRequest=E.ColorPresentationRequest=E.DocumentColorRequest=E.ConfigurationRequest=E.DidChangeWorkspaceFoldersNotification=E.WorkspaceFoldersRequest=E.TypeDefinitionRequest=E.ImplementationRequest=E.ApplyWorkspaceEditRequest=E.ExecuteCommandRequest=E.PrepareRenameRequest=E.RenameRequest=E.PrepareSupportDefaultBehavior=E.DocumentOnTypeFormattingRequest=E.DocumentRangesFormattingRequest=E.DocumentRangeFormattingRequest=E.DocumentFormattingRequest=E.DocumentLinkResolveRequest=E.DocumentLinkRequest=E.CodeLensRefreshRequest=E.CodeLensResolveRequest=E.CodeLensRequest=E.WorkspaceSymbolResolveRequest=void 0;E.InlineCompletionRequest=E.DidCloseNotebookDocumentNotification=E.DidSaveNotebookDocumentNotification=E.DidChangeNotebookDocumentNotification=E.NotebookCellArrayChange=E.DidOpenNotebookDocumentNotification=E.NotebookDocumentSyncRegistrationType=E.NotebookDocument=E.NotebookCell=E.ExecutionSummary=E.NotebookCellKind=E.DiagnosticRefreshRequest=E.WorkspaceDiagnosticRequest=E.DocumentDiagnosticRequest=E.DocumentDiagnosticReportKind=E.DiagnosticServerCancellationData=E.InlayHintRefreshRequest=E.InlayHintResolveRequest=E.InlayHintRequest=E.InlineValueRefreshRequest=E.InlineValueRequest=E.TypeHierarchySupertypesRequest=E.TypeHierarchySubtypesRequest=E.TypeHierarchyPrepareRequest=void 0;var U=ht(),HE=Pu(),$t=Ru(),v1=y_();Object.defineProperty(E,"ImplementationRequest",{enumerable:!0,get:function(){return v1.ImplementationRequest}});var b1=T_();Object.defineProperty(E,"TypeDefinitionRequest",{enumerable:!0,get:function(){return b1.TypeDefinitionRequest}});var ek=E_();Object.defineProperty(E,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return ek.WorkspaceFoldersRequest}});Object.defineProperty(E,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return ek.DidChangeWorkspaceFoldersNotification}});var T1=N_();Object.defineProperty(E,"ConfigurationRequest",{enumerable:!0,get:function(){return T1.ConfigurationRequest}});var tk=C_();Object.defineProperty(E,"DocumentColorRequest",{enumerable:!0,get:function(){return tk.DocumentColorRequest}});Object.defineProperty(E,"ColorPresentationRequest",{enumerable:!0,get:function(){return tk.ColorPresentationRequest}});var nk=O_();Object.defineProperty(E,"FoldingRangeRequest",{enumerable:!0,get:function(){return nk.FoldingRangeRequest}});Object.defineProperty(E,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return nk.FoldingRangeRefreshRequest}});var S1=M_();Object.defineProperty(E,"DeclarationRequest",{enumerable:!0,get:function(){return S1.DeclarationRequest}});var _1=q_();Object.defineProperty(E,"SelectionRangeRequest",{enumerable:!0,get:function(){return _1.SelectionRangeRequest}});var eg=U_();Object.defineProperty(E,"WorkDoneProgress",{enumerable:!0,get:function(){return eg.WorkDoneProgress}});Object.defineProperty(E,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return eg.WorkDoneProgressCreateRequest}});Object.defineProperty(E,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return eg.WorkDoneProgressCancelNotification}});var tg=H_();Object.defineProperty(E,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return tg.CallHierarchyIncomingCallsRequest}});Object.defineProperty(E,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return tg.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(E,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return tg.CallHierarchyPrepareRequest}});var So=Q_();Object.defineProperty(E,"TokenFormat",{enumerable:!0,get:function(){return So.TokenFormat}});Object.defineProperty(E,"SemanticTokensRequest",{enumerable:!0,get:function(){return So.SemanticTokensRequest}});Object.defineProperty(E,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return So.SemanticTokensDeltaRequest}});Object.defineProperty(E,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return So.SemanticTokensRangeRequest}});Object.defineProperty(E,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return So.SemanticTokensRefreshRequest}});Object.defineProperty(E,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return So.SemanticTokensRegistrationType}});var E1=tE();Object.defineProperty(E,"ShowDocumentRequest",{enumerable:!0,get:function(){return E1.ShowDocumentRequest}});var w1=iE();Object.defineProperty(E,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return w1.LinkedEditingRangeRequest}});var vs=fE();Object.defineProperty(E,"FileOperationPatternKind",{enumerable:!0,get:function(){return vs.FileOperationPatternKind}});Object.defineProperty(E,"DidCreateFilesNotification",{enumerable:!0,get:function(){return vs.DidCreateFilesNotification}});Object.defineProperty(E,"WillCreateFilesRequest",{enumerable:!0,get:function(){return vs.WillCreateFilesRequest}});Object.defineProperty(E,"DidRenameFilesNotification",{enumerable:!0,get:function(){return vs.DidRenameFilesNotification}});Object.defineProperty(E,"WillRenameFilesRequest",{enumerable:!0,get:function(){return vs.WillRenameFilesRequest}});Object.defineProperty(E,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return vs.DidDeleteFilesNotification}});Object.defineProperty(E,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return vs.WillDeleteFilesRequest}});var ng=yE();Object.defineProperty(E,"UniquenessLevel",{enumerable:!0,get:function(){return ng.UniquenessLevel}});Object.defineProperty(E,"MonikerKind",{enumerable:!0,get:function(){return ng.MonikerKind}});Object.defineProperty(E,"MonikerRequest",{enumerable:!0,get:function(){return ng.MonikerRequest}});var rg=SE();Object.defineProperty(E,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return rg.TypeHierarchyPrepareRequest}});Object.defineProperty(E,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return rg.TypeHierarchySubtypesRequest}});Object.defineProperty(E,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return rg.TypeHierarchySupertypesRequest}});var rk=wE();Object.defineProperty(E,"InlineValueRequest",{enumerable:!0,get:function(){return rk.InlineValueRequest}});Object.defineProperty(E,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return rk.InlineValueRefreshRequest}});var ig=RE();Object.defineProperty(E,"InlayHintRequest",{enumerable:!0,get:function(){return ig.InlayHintRequest}});Object.defineProperty(E,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ig.InlayHintResolveRequest}});Object.defineProperty(E,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ig.InlayHintRefreshRequest}});var Fa=ME();Object.defineProperty(E,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Fa.DiagnosticServerCancellationData}});Object.defineProperty(E,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Fa.DocumentDiagnosticReportKind}});Object.defineProperty(E,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Fa.DocumentDiagnosticRequest}});Object.defineProperty(E,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Fa.WorkspaceDiagnosticRequest}});Object.defineProperty(E,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Fa.DiagnosticRefreshRequest}});var xr=UE();Object.defineProperty(E,"NotebookCellKind",{enumerable:!0,get:function(){return xr.NotebookCellKind}});Object.defineProperty(E,"ExecutionSummary",{enumerable:!0,get:function(){return xr.ExecutionSummary}});Object.defineProperty(E,"NotebookCell",{enumerable:!0,get:function(){return xr.NotebookCell}});Object.defineProperty(E,"NotebookDocument",{enumerable:!0,get:function(){return xr.NotebookDocument}});Object.defineProperty(E,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return xr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(E,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return xr.DidOpenNotebookDocumentNotification}});Object.defineProperty(E,"NotebookCellArrayChange",{enumerable:!0,get:function(){return xr.NotebookCellArrayChange}});Object.defineProperty(E,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return xr.DidChangeNotebookDocumentNotification}});Object.defineProperty(E,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return xr.DidSaveNotebookDocumentNotification}});Object.defineProperty(E,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return xr.DidCloseNotebookDocumentNotification}});var k1=WE();Object.defineProperty(E,"InlineCompletionRequest",{enumerable:!0,get:function(){return k1.InlineCompletionRequest}});var Xm;(function(t){function e(n){let r=n;return $t.string(r)||$t.string(r.language)||$t.string(r.scheme)||$t.string(r.pattern)}t.is=e})(Xm||(E.TextDocumentFilter=Xm={}));var Jm;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebookType)||$t.string(r.scheme)||$t.string(r.pattern))}t.is=e})(Jm||(E.NotebookDocumentFilter=Jm={}));var Qm;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebook)||Jm.is(r.notebook))&&(r.language===void 0||$t.string(r.language))}t.is=e})(Qm||(E.NotebookCellTextDocumentFilter=Qm={}));var Zm;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!$t.string(r)&&!Xm.is(r)&&!Qm.is(r))return!1;return!0}t.is=e})(Zm||(E.DocumentSelector=Zm={}));var GE;(function(t){t.method="client/registerCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(GE||(E.RegistrationRequest=GE={}));var YE;(function(t){t.method="client/unregisterCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(YE||(E.UnregistrationRequest=YE={}));var KE;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(KE||(E.ResourceOperationKind=KE={}));var XE;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(XE||(E.FailureHandlingKind=XE={}));var JE;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(JE||(E.PositionEncodingKind=JE={}));var QE;(function(t){function e(n){let r=n;return r&&$t.string(r.id)&&r.id.length>0}t.hasId=e})(QE||(E.StaticRegistrationOptions=QE={}));var ZE;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Zm.is(r.documentSelector))}t.is=e})(ZE||(E.TextDocumentRegistrationOptions=ZE={}));var ew;(function(t){function e(r){let i=r;return $t.objectLiteral(i)&&(i.workDoneProgress===void 0||$t.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&$t.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(ew||(E.WorkDoneProgressOptions=ew={}));var tw;(function(t){t.method="initialize",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(tw||(E.InitializeRequest=tw={}));var nw;(function(t){t.unknownProtocolVersion=1})(nw||(E.InitializeErrorCodes=nw={}));var rw;(function(t){t.method="initialized",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(rw||(E.InitializedNotification=rw={}));var iw;(function(t){t.method="shutdown",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType0(t.method)})(iw||(E.ShutdownRequest=iw={}));var sw;(function(t){t.method="exit",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType0(t.method)})(sw||(E.ExitNotification=sw={}));var ow;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(ow||(E.DidChangeConfigurationNotification=ow={}));var aw;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(aw||(E.MessageType=aw={}));var cw;(function(t){t.method="window/showMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(cw||(E.ShowMessageNotification=cw={}));var lw;(function(t){t.method="window/showMessageRequest",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(lw||(E.ShowMessageRequest=lw={}));var uw;(function(t){t.method="window/logMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(uw||(E.LogMessageNotification=uw={}));var dw;(function(t){t.method="telemetry/event",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(dw||(E.TelemetryEventNotification=dw={}));var fw;(function(t){t.None=0,t.Full=1,t.Incremental=2})(fw||(E.TextDocumentSyncKind=fw={}));var hw;(function(t){t.method="textDocument/didOpen",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(hw||(E.DidOpenTextDocumentNotification=hw={}));var pw;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(pw||(E.TextDocumentContentChangeEvent=pw={}));var mw;(function(t){t.method="textDocument/didChange",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(mw||(E.DidChangeTextDocumentNotification=mw={}));var gw;(function(t){t.method="textDocument/didClose",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(gw||(E.DidCloseTextDocumentNotification=gw={}));var yw;(function(t){t.method="textDocument/didSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(yw||(E.DidSaveTextDocumentNotification=yw={}));var vw;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(vw||(E.TextDocumentSaveReason=vw={}));var bw;(function(t){t.method="textDocument/willSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(bw||(E.WillSaveTextDocumentNotification=bw={}));var Tw;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Tw||(E.WillSaveTextDocumentWaitUntilRequest=Tw={}));var Sw;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Sw||(E.DidChangeWatchedFilesNotification=Sw={}));var _w;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(_w||(E.FileChangeType=_w={}));var Ew;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&(HE.URI.is(r.baseUri)||HE.WorkspaceFolder.is(r.baseUri))&&$t.string(r.pattern)}t.is=e})(Ew||(E.RelativePattern=Ew={}));var ww;(function(t){t.Create=1,t.Change=2,t.Delete=4})(ww||(E.WatchKind=ww={}));var kw;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(kw||(E.PublishDiagnosticsNotification=kw={}));var Nw;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Nw||(E.CompletionTriggerKind=Nw={}));var Pw;(function(t){t.method="textDocument/completion",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Pw||(E.CompletionRequest=Pw={}));var Rw;(function(t){t.method="completionItem/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Rw||(E.CompletionResolveRequest=Rw={}));var Cw;(function(t){t.method="textDocument/hover",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Cw||(E.HoverRequest=Cw={}));var Dw;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Dw||(E.SignatureHelpTriggerKind=Dw={}));var Aw;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Aw||(E.SignatureHelpRequest=Aw={}));var Ow;(function(t){t.method="textDocument/definition",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ow||(E.DefinitionRequest=Ow={}));var Iw;(function(t){t.method="textDocument/references",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Iw||(E.ReferencesRequest=Iw={}));var xw;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(xw||(E.DocumentHighlightRequest=xw={}));var Mw;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Mw||(E.DocumentSymbolRequest=Mw={}));var Lw;(function(t){t.method="textDocument/codeAction",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Lw||(E.CodeActionRequest=Lw={}));var $w;(function(t){t.method="codeAction/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})($w||(E.CodeActionResolveRequest=$w={}));var qw;(function(t){t.method="workspace/symbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(qw||(E.WorkspaceSymbolRequest=qw={}));var jw;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(jw||(E.WorkspaceSymbolResolveRequest=jw={}));var Fw;(function(t){t.method="textDocument/codeLens",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Fw||(E.CodeLensRequest=Fw={}));var Bw;(function(t){t.method="codeLens/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Bw||(E.CodeLensResolveRequest=Bw={}));var Uw;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType0(t.method)})(Uw||(E.CodeLensRefreshRequest=Uw={}));var Vw;(function(t){t.method="textDocument/documentLink",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Vw||(E.DocumentLinkRequest=Vw={}));var zw;(function(t){t.method="documentLink/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(zw||(E.DocumentLinkResolveRequest=zw={}));var Ww;(function(t){t.method="textDocument/formatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ww||(E.DocumentFormattingRequest=Ww={}));var Hw;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Hw||(E.DocumentRangeFormattingRequest=Hw={}));var Gw;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Gw||(E.DocumentRangesFormattingRequest=Gw={}));var Yw;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Yw||(E.DocumentOnTypeFormattingRequest=Yw={}));var Kw;(function(t){t.Identifier=1})(Kw||(E.PrepareSupportDefaultBehavior=Kw={}));var Xw;(function(t){t.method="textDocument/rename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Xw||(E.RenameRequest=Xw={}));var Jw;(function(t){t.method="textDocument/prepareRename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Jw||(E.PrepareRenameRequest=Jw={}));var Qw;(function(t){t.method="workspace/executeCommand",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Qw||(E.ExecuteCommandRequest=Qw={}));var Zw;(function(t){t.method="workspace/applyEdit",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType("workspace/applyEdit")})(Zw||(E.ApplyWorkspaceEditRequest=Zw={}))});var ok=k(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.createProtocolConnection=void 0;var sk=ys();function N1(t,e,n,r){return sk.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,sk.createMessageConnection)(t,e,n,r)}Vu.createProtocolConnection=N1});var ck=k(bn=>{"use strict";var P1=bn&&bn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),zu=bn&&bn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&P1(e,t,n)};Object.defineProperty(bn,"__esModule",{value:!0});bn.LSPErrorCodes=bn.createProtocolConnection=void 0;zu(ys(),bn);zu(Pu(),bn);zu(ht(),bn);zu(ik(),bn);var R1=ok();Object.defineProperty(bn,"createProtocolConnection",{enumerable:!0,get:function(){return R1.createProtocolConnection}});var ak;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(ak||(bn.LSPErrorCodes=ak={}))});var Tt=k(Mr=>{"use strict";var C1=Mr&&Mr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),lk=Mr&&Mr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&C1(e,t,n)};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.createProtocolConnection=void 0;var D1=Um();lk(Um(),Mr);lk(ck(),Mr);function A1(t,e,n,r){return(0,D1.createMessageConnection)(t,e,n,r)}Mr.createProtocolConnection=A1});var sg=k(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.generateUuid=Wn.parse=Wn.isUUID=Wn.v4=Wn.empty=void 0;var Ba=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Ua=class t extends Ba{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(""))}};Ua._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Ua._timeHighBits=["8","9","a","b"];Wn.empty=new Ba("00000000-0000-0000-0000-000000000000");function uk(){return new Ua}Wn.v4=uk;var O1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function dk(t){return O1.test(t)}Wn.isUUID=dk;function I1(t){if(!dk(t))throw new Error("invalid uuid");return new Ba(t)}Wn.parse=I1;function x1(){return uk().asHex()}Wn.generateUuid=x1});var fk=k(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.attachPartialResult=Mi.ProgressFeature=Mi.attachWorkDone=void 0;var xi=Tt(),M1=sg(),bs=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(xi.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(xi.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(xi.WorkDoneProgress.type,this._token,{kind:"end"})}};bs.Instances=new Map;var Wu=class extends bs{constructor(e,n){super(e,n),this._source=new xi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Va=class{constructor(){}begin(){}report(){}done(){}},Hu=class extends Va{constructor(){super(),this._source=new xi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function L1(t,e){if(e===void 0||e.workDoneToken===void 0)return new Va;let n=e.workDoneToken;return delete e.workDoneToken,new bs(t,n)}Mi.attachWorkDone=L1;var $1=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(xi.WorkDoneProgressCancelNotification.type,n=>{let r=bs.Instances.get(n.token);(r instanceof Wu||r instanceof Hu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Va:new bs(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,M1.generateUuid)();return this.connection.sendRequest(xi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Wu(this.connection,e))}else return Promise.resolve(new Hu)}};Mi.ProgressFeature=$1;var og;(function(t){t.type=new xi.ProgressType})(og||(og={}));var ag=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(og.type,this._token,e)}};function q1(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new ag(t,n)}Mi.attachPartialResult=q1});var hk=k(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.ConfigurationFeature=void 0;var j1=Tt(),F1=iu(),B1=t=>class extends t{getConfiguration(e){return e?F1.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(j1.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Gu.ConfigurationFeature=B1});var pk=k(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.WorkspaceFoldersFeature=void 0;var Yu=Tt(),U1=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Yu.Emitter,this.connection.onNotification(Yu.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Yu.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(Yu.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Ku.WorkspaceFoldersFeature=U1});var mk=k(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.CallHierarchyFeature=void 0;var cg=Tt(),V1=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(cg.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=cg.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=cg.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Xu.CallHierarchyFeature=V1});var ug=k(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.SemanticTokensBuilder=Li.SemanticTokensDiff=Li.SemanticTokensFeature=void 0;var Ju=Tt(),z1=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ju.SemanticTokensRefreshRequest.type),on:e=>{let n=Ju.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Ju.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Ju.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Li.SemanticTokensFeature=z1;var Qu=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Li.SemanticTokensDiff=Qu;var lg=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,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}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 Qu(this._prevData,this._data).computeDiff()}:this.build()}};Li.SemanticTokensBuilder=lg});var gk=k(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.ShowDocumentFeature=void 0;var W1=Tt(),H1=t=>class extends t{showDocument(e){return this.connection.sendRequest(W1.ShowDocumentRequest.type,e)}};Zu.ShowDocumentFeature=H1});var yk=k(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.FileOperationsFeature=void 0;var _o=Tt(),G1=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(_o.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(_o.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(_o.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(_o.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(_o.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(_o.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};ed.FileOperationsFeature=G1});var vk=k(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.LinkedEditingRangeFeature=void 0;var Y1=Tt(),K1=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Y1.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};td.LinkedEditingRangeFeature=K1});var bk=k(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.TypeHierarchyFeature=void 0;var dg=Tt(),X1=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(dg.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=dg.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=dg.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};nd.TypeHierarchyFeature=X1});var Sk=k(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.InlineValueFeature=void 0;var Tk=Tt(),J1=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Tk.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(Tk.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};rd.InlineValueFeature=J1});var Ek=k(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.FoldingRangeFeature=void 0;var _k=Tt(),Q1=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(_k.FoldingRangeRefreshRequest.type),on:e=>{let n=_k.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};id.FoldingRangeFeature=Q1});var wk=k(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.InlayHintFeature=void 0;var fg=Tt(),Z1=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(fg.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(fg.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(fg.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};sd.InlayHintFeature=Z1});var kk=k(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.DiagnosticFeature=void 0;var za=Tt(),eL=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(za.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(za.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(za.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(za.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(za.WorkspaceDiagnosticRequest.partialResult,n)))}}};od.DiagnosticFeature=eL});var pg=k(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.TextDocuments=void 0;var Ts=Tt(),hg=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Ts.Emitter,this._onDidOpen=new Ts.Emitter,this._onDidClose=new Ts.Emitter,this._onDidSave=new Ts.Emitter,this._onWillSave=new Ts.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=Ts.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.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)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.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})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Ts.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};ad.TextDocuments=hg});var gg=k(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.NotebookDocuments=Eo.NotebookSyncFeature=void 0;var Hn=Tt(),Nk=pg(),tL=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Hn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Hn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Hn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Hn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Eo.NotebookSyncFeature=tL;var cd=class t{onDidOpenTextDocument(e){return this.openHandler=e,Hn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Hn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Hn.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}};cd.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var mg=class{constructor(e){e instanceof Nk.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Nk.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Hn.Emitter,this._onDidChange=new Hn.Emitter,this._onDidSave=new Hn.Emitter,this._onDidClose=new Hn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new cd,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.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 _=c.cells;if(_.structure!==void 0){let v=_.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),_.structure.didOpen!==void 0)for(let b of _.structure.didOpen)n.openTextDocument({textDocument:b}),l.push(b.uri);if(_.structure.didClose)for(let b of _.structure.didClose)n.closeTextDocument({textDocument:b}),u.push(b.uri)}if(_.data!==void 0){let v=new Map(_.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let w=v.get(s.cells[b].document);if(w!==void 0){let C=s.cells.splice(b,1,w);if(d.push({old:C[0],new:w}),v.delete(w.document),v.size===0)break}}}if(_.textContent!==void 0)for(let v of _.textContent)n.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),f.push(v.document.uri)}this.updateCellMap(s);let h={notebookDocument:s};a&&(h.metadata={old:o,new:s.metadata});let y=[];for(let _ of l)y.push(this.getNotebookCell(_));let p=[];for(let _ of u)p.push(this.getNotebookCell(_));let T=[];for(let _ of f)T.push(this.getNotebookCell(_));(y.length>0||p.length>0||d.length>0||T.length>0)&&(h.cells={added:y,removed:p,changed:{data:d,textContent:T}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.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)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Hn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};Eo.NotebookDocuments=mg});var Pk=k(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.MonikerFeature=void 0;var nL=Tt(),rL=t=>class extends t{get moniker(){return{on:e=>{let n=nL.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ld.MonikerFeature=rL});var _g=k(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.createConnection=Ae.combineFeatures=Ae.combineNotebooksFeatures=Ae.combineLanguagesFeatures=Ae.combineWorkspaceFeatures=Ae.combineWindowFeatures=Ae.combineClientFeatures=Ae.combineTracerFeatures=Ae.combineTelemetryFeatures=Ae.combineConsoleFeatures=Ae._NotebooksImpl=Ae._LanguagesImpl=Ae.BulkUnregistration=Ae.BulkRegistration=Ae.ErrorMessageTracker=void 0;var G=Tt(),Gn=iu(),vg=sg(),ae=fk(),iL=hk(),sL=pk(),oL=mk(),aL=ug(),cL=gk(),lL=yk(),uL=vk(),dL=bk(),fL=Sk(),hL=Ek(),pL=wk(),mL=kk(),gL=gg(),yL=Pk();function yg(t){if(t!==null)return t}var bg=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Ae.ErrorMessageTracker=bg;var ud=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(G.MessageType.Error,e)}warn(e){this.send(G.MessageType.Warning,e)}info(e){this.send(G.MessageType.Info,e)}log(e){this.send(G.MessageType.Log,e)}debug(e){this.send(G.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(G.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,G.RAL)().console.error("Sending log message failed")})}},Tg=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,...n){let r={type:G.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(yg)}showWarningMessage(e,...n){let r={type:G.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(yg)}showInformationMessage(e,...n){let r={type:G.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(yg)}},Rk=(0,cL.ShowDocumentFeature)((0,ae.ProgressFeature)(Tg)),Ck;(function(t){function e(){return new dd}t.create=e})(Ck||(Ae.BulkRegistration=Ck={}));var dd=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Gn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=vg.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},Dk;(function(t){function e(){return new Wa(void 0,[])}t.create=e})(Dk||(Ae.BulkUnregistration=Dk={}));var Wa=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(G.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Gn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(G.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},fd=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,n,r){return e instanceof dd?this.registerMany(e):e instanceof Wa?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=Gn.string(n)?n:n.method,s=vg.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(G.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,n){let r=Gn.string(e)?e:e.method,i=vg.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(G.RegistrationRequest.type,s).then(o=>G.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(G.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(G.RegistrationRequest.type,n).then(()=>new Wa(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Sg=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 n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(G.ApplyWorkspaceEditRequest.type,r)}},Ak=(0,lL.FileOperationsFeature)((0,sL.WorkspaceFoldersFeature)((0,iL.ConfigurationFeature)(Sg))),hd=class{constructor(){this._trace=G.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,n){this._trace!==G.Trace.Off&&this.connection.sendNotification(G.LogTraceNotification.type,{message:e,verbose:this._trace===G.Trace.Verbose?n:void 0}).catch(()=>{})}},pd=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(G.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},md=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,ae.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ae.attachPartialResult)(this.connection,n)}};Ae._LanguagesImpl=md;var Ok=(0,hL.FoldingRangeFeature)((0,yL.MonikerFeature)((0,mL.DiagnosticFeature)((0,pL.InlayHintFeature)((0,fL.InlineValueFeature)((0,dL.TypeHierarchyFeature)((0,uL.LinkedEditingRangeFeature)((0,aL.SemanticTokensFeature)((0,oL.CallHierarchyFeature)(md))))))))),gd=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,ae.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ae.attachPartialResult)(this.connection,n)}};Ae._NotebooksImpl=gd;var Ik=(0,gL.NotebookSyncFeature)(gd);function xk(t,e){return function(n){return e(t(n))}}Ae.combineConsoleFeatures=xk;function Mk(t,e){return function(n){return e(t(n))}}Ae.combineTelemetryFeatures=Mk;function Lk(t,e){return function(n){return e(t(n))}}Ae.combineTracerFeatures=Lk;function $k(t,e){return function(n){return e(t(n))}}Ae.combineClientFeatures=$k;function qk(t,e){return function(n){return e(t(n))}}Ae.combineWindowFeatures=qk;function jk(t,e){return function(n){return e(t(n))}}Ae.combineWorkspaceFeatures=jk;function Fk(t,e){return function(n){return e(t(n))}}Ae.combineLanguagesFeatures=Fk;function Bk(t,e){return function(n){return e(t(n))}}Ae.combineNotebooksFeatures=Bk;function vL(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,xk),tracer:n(t.tracer,e.tracer,Lk),telemetry:n(t.telemetry,e.telemetry,Mk),client:n(t.client,e.client,$k),window:n(t.window,e.window,qk),workspace:n(t.workspace,e.workspace,jk),languages:n(t.languages,e.languages,Fk),notebooks:n(t.notebooks,e.notebooks,Bk)}}Ae.combineFeatures=vL;function bL(t,e,n){let r=n&&n.console?new(n.console(ud)):new ud,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(hd)):new hd,o=n&&n.telemetry?new(n.telemetry(pd)):new pd,a=n&&n.client?new(n.client(fd)):new fd,c=n&&n.window?new(n.window(Rk)):new Rk,l=n&&n.workspace?new(n.workspace(Ak)):new Ak,u=n&&n.languages?new(n.languages(Ok)):new Ok,d=n&&n.notebooks?new(n.notebooks(Ik)):new Ik,f=[r,s,o,a,c,l,u,d];function h(v){return v instanceof Promise?v:Gn.thenable(v)?new Promise((b,w)=>{v.then(C=>b(C),C=>w(C))}):Promise.resolve(v)}let y,p,T,_={listen:()=>i.listen(),sendRequest:(v,...b)=>i.sendRequest(Gn.string(v)?v:v.method,...b),onRequest:(v,b)=>i.onRequest(v,b),sendNotification:(v,b)=>{let w=Gn.string(v)?v:v.method;return i.sendNotification(w,b)},onNotification:(v,b)=>i.onNotification(v,b),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:v=>(p=v,{dispose:()=>{p=void 0}}),onInitialized:v=>i.onNotification(G.InitializedNotification.type,v),onShutdown:v=>(y=v,{dispose:()=>{y=void 0}}),onExit:v=>(T=v,{dispose:()=>{T=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:v=>i.onNotification(G.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>i.onNotification(G.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>i.onNotification(G.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>i.onNotification(G.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>i.onNotification(G.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>i.onNotification(G.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>i.onRequest(G.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>i.onNotification(G.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>i.sendNotification(G.PublishDiagnosticsNotification.type,v),onHover:v=>i.onRequest(G.HoverRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),void 0)),onCompletion:v=>i.onRequest(G.CompletionRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onCompletionResolve:v=>i.onRequest(G.CompletionResolveRequest.type,v),onSignatureHelp:v=>i.onRequest(G.SignatureHelpRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),void 0)),onDeclaration:v=>i.onRequest(G.DeclarationRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onDefinition:v=>i.onRequest(G.DefinitionRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onTypeDefinition:v=>i.onRequest(G.TypeDefinitionRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onImplementation:v=>i.onRequest(G.ImplementationRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onReferences:v=>i.onRequest(G.ReferencesRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onDocumentHighlight:v=>i.onRequest(G.DocumentHighlightRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onDocumentSymbol:v=>i.onRequest(G.DocumentSymbolRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onWorkspaceSymbol:v=>i.onRequest(G.WorkspaceSymbolRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onWorkspaceSymbolResolve:v=>i.onRequest(G.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>i.onRequest(G.CodeActionRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onCodeActionResolve:v=>i.onRequest(G.CodeActionResolveRequest.type,(b,w)=>v(b,w)),onCodeLens:v=>i.onRequest(G.CodeLensRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onCodeLensResolve:v=>i.onRequest(G.CodeLensResolveRequest.type,(b,w)=>v(b,w)),onDocumentFormatting:v=>i.onRequest(G.DocumentFormattingRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),void 0)),onDocumentRangeFormatting:v=>i.onRequest(G.DocumentRangeFormattingRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),void 0)),onDocumentOnTypeFormatting:v=>i.onRequest(G.DocumentOnTypeFormattingRequest.type,(b,w)=>v(b,w)),onRenameRequest:v=>i.onRequest(G.RenameRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),void 0)),onPrepareRename:v=>i.onRequest(G.PrepareRenameRequest.type,(b,w)=>v(b,w)),onDocumentLinks:v=>i.onRequest(G.DocumentLinkRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onDocumentLinkResolve:v=>i.onRequest(G.DocumentLinkResolveRequest.type,(b,w)=>v(b,w)),onDocumentColor:v=>i.onRequest(G.DocumentColorRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onColorPresentation:v=>i.onRequest(G.ColorPresentationRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onFoldingRanges:v=>i.onRequest(G.FoldingRangeRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onSelectionRanges:v=>i.onRequest(G.SelectionRangeRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onExecuteCommand:v=>i.onRequest(G.ExecuteCommandRequest.type,(b,w)=>v(b,w,(0,ae.attachWorkDone)(i,b),void 0)),dispose:()=>i.dispose()};for(let v of f)v.attach(_);return i.onRequest(G.InitializeRequest.type,v=>{e.initialize(v),Gn.string(v.trace)&&(s.trace=G.Trace.fromString(v.trace));for(let b of f)b.initialize(v.capabilities);if(p){let b=p(v,new G.CancellationTokenSource().token,(0,ae.attachWorkDone)(i,v),void 0);return h(b).then(w=>{if(w instanceof G.ResponseError)return w;let C=w;C||(C={capabilities:{}});let L=C.capabilities;L||(L={},C.capabilities=L),L.textDocumentSync===void 0||L.textDocumentSync===null?L.textDocumentSync=Gn.number(_.__textDocumentSync)?_.__textDocumentSync:G.TextDocumentSyncKind.None:!Gn.number(L.textDocumentSync)&&!Gn.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=Gn.number(_.__textDocumentSync)?_.__textDocumentSync:G.TextDocumentSyncKind.None);for(let B of f)B.fillServerCapabilities(L);return C})}else{let b={capabilities:{textDocumentSync:G.TextDocumentSyncKind.None}};for(let w of f)w.fillServerCapabilities(b.capabilities);return b}}),i.onRequest(G.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new G.CancellationTokenSource().token)}),i.onNotification(G.ExitNotification.type,()=>{try{T&&T()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(G.SetTraceNotification.type,v=>{s.trace=G.Trace.fromString(v.value)}),_}Ae.createConnection=bL});var Uk=k(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.resolveModulePath=Tn.FileSystem=Tn.resolveGlobalYarnPath=Tn.resolveGlobalNodePath=Tn.resolve=Tn.uriToFilePath=void 0;var TL=require("url"),fr=require("path"),Eg=require("fs"),Pg=require("child_process");function SL(t){let e=TL.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return fr.normalize(n.join("/"))}Tn.uriToFilePath=SL;function wg(){return process.platform==="win32"}function yd(t,e,n,r){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&&Eg.existsSync(e)&&(l[i]?l[i]=e+fr.delimiter+l[i]:l[i]=e,r&&r(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,Pg.fork)("",[],{cwd:n,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)}})}Tn.resolve=yd;function kg(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};wg()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,Pg.spawnSync)(e,["config","get","prefix"],r).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?wg()?fr.join(o,"node_modules"):fr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Tn.resolveGlobalNodePath=kg;function _L(t){let e="yarn",n={encoding:"utf8"};wg()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,Pg.spawnSync)(e,["global","dir","--json"],n),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 fr.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Tn.resolveGlobalYarnPath=_L;var Ng;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Eg.existsSync(__filename.toUpperCase())||!Eg.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?fr.normalize(s).indexOf(fr.normalize(i))===0:fr.normalize(s).toLowerCase().indexOf(fr.normalize(i).toLowerCase())===0}t.isParent=r})(Ng||(Tn.FileSystem=Ng={}));function EL(t,e,n,r){return n?(fr.isAbsolute(n)||(n=fr.join(t,n)),yd(e,n,n,r).then(i=>Ng.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>yd(e,kg(r),t,r))):yd(e,kg(r),t,r)}Tn.resolveModulePath=EL});var Rg=k((t9,Vk)=>{"use strict";Vk.exports=Tt()});var zk=k(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.InlineCompletionFeature=void 0;var wL=Tt(),kL=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(wL.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};vd.InlineCompletionFeature=kL});var Gk=k(en=>{"use strict";var NL=en&&en.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Hk=en&&en.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&NL(e,t,n)};Object.defineProperty(en,"__esModule",{value:!0});en.ProposedFeatures=en.NotebookDocuments=en.TextDocuments=en.SemanticTokensBuilder=void 0;var PL=ug();Object.defineProperty(en,"SemanticTokensBuilder",{enumerable:!0,get:function(){return PL.SemanticTokensBuilder}});var RL=zk();Hk(Tt(),en);var CL=pg();Object.defineProperty(en,"TextDocuments",{enumerable:!0,get:function(){return CL.TextDocuments}});var DL=gg();Object.defineProperty(en,"NotebookDocuments",{enumerable:!0,get:function(){return DL.NotebookDocuments}});Hk(_g(),en);var Wk;(function(t){t.all={__brand:"features",languages:RL.InlineCompletionFeature}})(Wk||(en.ProposedFeatures=Wk={}))});var J=k(Yn=>{"use strict";var AL=Yn&&Yn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Jk=Yn&&Yn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&AL(e,t,n)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.createConnection=Yn.Files=void 0;var Yk=require("node:util"),Cg=iu(),OL=_g(),Ha=Uk(),Ss=Rg();Jk(Rg(),Yn);Jk(Gk(),Yn);var Kk;(function(t){t.uriToFilePath=Ha.uriToFilePath,t.resolveGlobalNodePath=Ha.resolveGlobalNodePath,t.resolveGlobalYarnPath=Ha.resolveGlobalYarnPath,t.resolve=Ha.resolve,t.resolveModulePath=Ha.resolveModulePath})(Kk||(Yn.Files=Kk={}));var Xk;function bd(){if(Xk!==void 0)try{Xk.end()}catch{}}var wo=!1,Qk;function IL(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Qk=setInterval(()=>{try{process.kill(r,0)}catch{bd(),process.exit(wo?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}IL();var xL={initialize:t=>{let e=t.processId;Cg.number(e)&&Qk===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=>{bd(),process.exit(t)}};function ML(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Ss.ConnectionStrategy.is(t)||Ss.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),LL(s,o,a,i)}Yn.createConnection=ML;function LL(t,e,n,r){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 Ss.IPCMessageReader(process),e=new Ss.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,Ss.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,Ss.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(Cg.func(t.read)&&Cg.func(t.on)){let c=t;c.on("end",()=>{bd(),process.exit(wo?0:1)}),c.on("close",()=>{bd(),process.exit(wo?0:1)})}let a=c=>{let l=(0,Ss.createProtocolConnection)(t,e,c,n);return i&&$L(c),l};return(0,OL.createConnection)(a,xL,r)}function $L(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,Yk.inspect)(i)).join(" ")}let n=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=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,Yk.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
|
-
`)?
|
|
36
|
+
`&&m++}S&&R.length>0&&P.push(R.length),this._lineOffsets=P}return this._lineOffsets},g.prototype.positionAt=function(P){P=Math.max(Math.min(P,this._content.length),0);var R=this.getLineOffsets(),S=0,m=R.length;if(m===0)return o.create(0,P);for(;S<m;){var D=Math.floor((S+m)/2);R[D]>P?m=D:S=D+1}var M=S-1;return o.create(M,P-R[M])},g.prototype.offsetAt=function(P){var R=this.getLineOffsets();if(P.line>=R.length)return this._content.length;if(P.line<0)return 0;var S=R[P.line],m=P.line+1<R.length?R[P.line+1]:this._content.length;return Math.max(Math.min(S+P.character,m),S)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),A;(function(g){var P=Object.prototype.toString;function R(Se){return typeof Se<"u"}g.defined=R;function S(Se){return typeof Se>"u"}g.undefined=S;function m(Se){return Se===!0||Se===!1}g.boolean=m;function D(Se){return P.call(Se)==="[object String]"}g.string=D;function M(Se){return P.call(Se)==="[object Number]"}g.number=M;function le(Se,ro,au){return P.call(Se)==="[object Number]"&&ro<=Se&&Se<=au}g.numberRange=le;function vt(Se){return P.call(Se)==="[object Number]"&&-2147483648<=Se&&Se<=2147483647}g.integer=vt;function Ze(Se){return P.call(Se)==="[object Number]"&&0<=Se&&Se<=2147483647}g.uinteger=Ze;function ur(Se){return P.call(Se)==="[object Function]"}g.func=ur;function dr(Se){return Se!==null&&typeof Se=="object"}g.objectLiteral=dr;function si(Se,ro){return Array.isArray(Se)&&Se.every(ro)}g.typedArray=si})(A||(A={}))})});var ft=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ProtocolNotificationType=vn.ProtocolNotificationType0=vn.ProtocolRequestType=vn.ProtocolRequestType0=vn.RegistrationType=vn.MessageDirection=void 0;var ho=vs(),g_;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(g_||(vn.MessageDirection=g_={}));var Wm=class{constructor(e){this.method=e}};vn.RegistrationType=Wm;var Hm=class extends ho.RequestType0{constructor(e){super(e)}};vn.ProtocolRequestType0=Hm;var Gm=class extends ho.RequestType{constructor(e){super(e,ho.ParameterStructures.byName)}};vn.ProtocolRequestType=Gm;var Ym=class extends ho.NotificationType0{constructor(e){super(e)}};vn.ProtocolNotificationType0=Ym;var Km=class extends ho.NotificationType{constructor(e){super(e,ho.ParameterStructures.byName)}};vn.ProtocolNotificationType=Km});var Ou=w(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.objectLiteral=Pt.typedArray=Pt.stringArray=Pt.array=Pt.func=Pt.error=Pt.number=Pt.string=Pt.boolean=void 0;function m1(t){return t===!0||t===!1}Pt.boolean=m1;function y_(t){return typeof t=="string"||t instanceof String}Pt.string=y_;function g1(t){return typeof t=="number"||t instanceof Number}Pt.number=g1;function y1(t){return t instanceof Error}Pt.error=y1;function v1(t){return typeof t=="function"}Pt.func=v1;function v_(t){return Array.isArray(t)}Pt.array=v_;function b1(t){return v_(t)&&t.every(e=>y_(e))}Pt.stringArray=b1;function T1(t,e){return Array.isArray(t)&&t.every(e)}Pt.typedArray=T1;function S1(t){return t!==null&&typeof t=="object"}Pt.objectLiteral=S1});var S_=w(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.ImplementationRequest=void 0;var b_=ft(),T_;(function(t){t.method="textDocument/implementation",t.messageDirection=b_.MessageDirection.clientToServer,t.type=new b_.ProtocolRequestType(t.method)})(T_||(Iu.ImplementationRequest=T_={}))});var k_=w(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.TypeDefinitionRequest=void 0;var __=ft(),E_;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=__.MessageDirection.clientToServer,t.type=new __.ProtocolRequestType(t.method)})(E_||(xu.TypeDefinitionRequest=E_={}))});var P_=w(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.DidChangeWorkspaceFoldersNotification=po.WorkspaceFoldersRequest=void 0;var Mu=ft(),w_;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Mu.MessageDirection.serverToClient,t.type=new Mu.ProtocolRequestType0(t.method)})(w_||(po.WorkspaceFoldersRequest=w_={}));var N_;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Mu.MessageDirection.clientToServer,t.type=new Mu.ProtocolNotificationType(t.method)})(N_||(po.DidChangeWorkspaceFoldersNotification=N_={}))});var D_=w(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.ConfigurationRequest=void 0;var R_=ft(),C_;(function(t){t.method="workspace/configuration",t.messageDirection=R_.MessageDirection.serverToClient,t.type=new R_.ProtocolRequestType(t.method)})(C_||(Lu.ConfigurationRequest=C_={}))});var I_=w(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.ColorPresentationRequest=mo.DocumentColorRequest=void 0;var $u=ft(),A_;(function(t){t.method="textDocument/documentColor",t.messageDirection=$u.MessageDirection.clientToServer,t.type=new $u.ProtocolRequestType(t.method)})(A_||(mo.DocumentColorRequest=A_={}));var O_;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=$u.MessageDirection.clientToServer,t.type=new $u.ProtocolRequestType(t.method)})(O_||(mo.ColorPresentationRequest=O_={}))});var L_=w(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.FoldingRangeRefreshRequest=go.FoldingRangeRequest=void 0;var qu=ft(),x_;(function(t){t.method="textDocument/foldingRange",t.messageDirection=qu.MessageDirection.clientToServer,t.type=new qu.ProtocolRequestType(t.method)})(x_||(go.FoldingRangeRequest=x_={}));var M_;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=qu.MessageDirection.serverToClient,t.type=new qu.ProtocolRequestType0(t.method)})(M_||(go.FoldingRangeRefreshRequest=M_={}))});var j_=w(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.DeclarationRequest=void 0;var $_=ft(),q_;(function(t){t.method="textDocument/declaration",t.messageDirection=$_.MessageDirection.clientToServer,t.type=new $_.ProtocolRequestType(t.method)})(q_||(ju.DeclarationRequest=q_={}))});var U_=w(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.SelectionRangeRequest=void 0;var F_=ft(),B_;(function(t){t.method="textDocument/selectionRange",t.messageDirection=F_.MessageDirection.clientToServer,t.type=new F_.ProtocolRequestType(t.method)})(B_||(Fu.SelectionRangeRequest=B_={}))});var H_=w(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.WorkDoneProgressCancelNotification=Di.WorkDoneProgressCreateRequest=Di.WorkDoneProgress=void 0;var _1=vs(),Bu=ft(),V_;(function(t){t.type=new _1.ProgressType;function e(n){return n===t.type}t.is=e})(V_||(Di.WorkDoneProgress=V_={}));var z_;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Bu.MessageDirection.serverToClient,t.type=new Bu.ProtocolRequestType(t.method)})(z_||(Di.WorkDoneProgressCreateRequest=z_={}));var W_;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Bu.MessageDirection.clientToServer,t.type=new Bu.ProtocolNotificationType(t.method)})(W_||(Di.WorkDoneProgressCancelNotification=W_={}))});var X_=w(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.CallHierarchyOutgoingCallsRequest=Ai.CallHierarchyIncomingCallsRequest=Ai.CallHierarchyPrepareRequest=void 0;var yo=ft(),G_;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(G_||(Ai.CallHierarchyPrepareRequest=G_={}));var Y_;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(Y_||(Ai.CallHierarchyIncomingCallsRequest=Y_={}));var K_;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(K_||(Ai.CallHierarchyOutgoingCallsRequest=K_={}))});var nE=w(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.SemanticTokensRefreshRequest=bn.SemanticTokensRangeRequest=bn.SemanticTokensDeltaRequest=bn.SemanticTokensRequest=bn.SemanticTokensRegistrationType=bn.TokenFormat=void 0;var ai=ft(),J_;(function(t){t.Relative="relative"})(J_||(bn.TokenFormat=J_={}));var ja;(function(t){t.method="textDocument/semanticTokens",t.type=new ai.RegistrationType(t.method)})(ja||(bn.SemanticTokensRegistrationType=ja={}));var Q_;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=ja.method})(Q_||(bn.SemanticTokensRequest=Q_={}));var Z_;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=ja.method})(Z_||(bn.SemanticTokensDeltaRequest=Z_={}));var eE;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=ja.method})(eE||(bn.SemanticTokensRangeRequest=eE={}));var tE;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=ai.MessageDirection.serverToClient,t.type=new ai.ProtocolRequestType0(t.method)})(tE||(bn.SemanticTokensRefreshRequest=tE={}))});var sE=w(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.ShowDocumentRequest=void 0;var rE=ft(),iE;(function(t){t.method="window/showDocument",t.messageDirection=rE.MessageDirection.serverToClient,t.type=new rE.ProtocolRequestType(t.method)})(iE||(Uu.ShowDocumentRequest=iE={}))});var cE=w(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.LinkedEditingRangeRequest=void 0;var oE=ft(),aE;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=oE.MessageDirection.clientToServer,t.type=new oE.ProtocolRequestType(t.method)})(aE||(Vu.LinkedEditingRangeRequest=aE={}))});var gE=w(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.WillDeleteFilesRequest=en.DidDeleteFilesNotification=en.DidRenameFilesNotification=en.WillRenameFilesRequest=en.DidCreateFilesNotification=en.WillCreateFilesRequest=en.FileOperationPatternKind=void 0;var Vn=ft(),lE;(function(t){t.file="file",t.folder="folder"})(lE||(en.FileOperationPatternKind=lE={}));var uE;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(uE||(en.WillCreateFilesRequest=uE={}));var dE;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(dE||(en.DidCreateFilesNotification=dE={}));var fE;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(fE||(en.WillRenameFilesRequest=fE={}));var hE;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(hE||(en.DidRenameFilesNotification=hE={}));var pE;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(pE||(en.DidDeleteFilesNotification=pE={}));var mE;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(mE||(en.WillDeleteFilesRequest=mE={}))});var SE=w(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.MonikerRequest=Oi.MonikerKind=Oi.UniquenessLevel=void 0;var yE=ft(),vE;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(vE||(Oi.UniquenessLevel=vE={}));var bE;(function(t){t.$import="import",t.$export="export",t.local="local"})(bE||(Oi.MonikerKind=bE={}));var TE;(function(t){t.method="textDocument/moniker",t.messageDirection=yE.MessageDirection.clientToServer,t.type=new yE.ProtocolRequestType(t.method)})(TE||(Oi.MonikerRequest=TE={}))});var wE=w(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.TypeHierarchySubtypesRequest=Ii.TypeHierarchySupertypesRequest=Ii.TypeHierarchyPrepareRequest=void 0;var vo=ft(),_E;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method)})(_E||(Ii.TypeHierarchyPrepareRequest=_E={}));var EE;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method)})(EE||(Ii.TypeHierarchySupertypesRequest=EE={}));var kE;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method)})(kE||(Ii.TypeHierarchySubtypesRequest=kE={}))});var RE=w(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.InlineValueRefreshRequest=bo.InlineValueRequest=void 0;var zu=ft(),NE;(function(t){t.method="textDocument/inlineValue",t.messageDirection=zu.MessageDirection.clientToServer,t.type=new zu.ProtocolRequestType(t.method)})(NE||(bo.InlineValueRequest=NE={}));var PE;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=zu.MessageDirection.serverToClient,t.type=new zu.ProtocolRequestType0(t.method)})(PE||(bo.InlineValueRefreshRequest=PE={}))});var OE=w(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.InlayHintRefreshRequest=xi.InlayHintResolveRequest=xi.InlayHintRequest=void 0;var To=ft(),CE;(function(t){t.method="textDocument/inlayHint",t.messageDirection=To.MessageDirection.clientToServer,t.type=new To.ProtocolRequestType(t.method)})(CE||(xi.InlayHintRequest=CE={}));var DE;(function(t){t.method="inlayHint/resolve",t.messageDirection=To.MessageDirection.clientToServer,t.type=new To.ProtocolRequestType(t.method)})(DE||(xi.InlayHintResolveRequest=DE={}));var AE;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=To.MessageDirection.serverToClient,t.type=new To.ProtocolRequestType0(t.method)})(AE||(xi.InlayHintRefreshRequest=AE={}))});var jE=w(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.DiagnosticRefreshRequest=zn.WorkspaceDiagnosticRequest=zn.DocumentDiagnosticRequest=zn.DocumentDiagnosticReportKind=zn.DiagnosticServerCancellationData=void 0;var qE=vs(),E1=Ou(),So=ft(),IE;(function(t){function e(n){let r=n;return r&&E1.boolean(r.retriggerRequest)}t.is=e})(IE||(zn.DiagnosticServerCancellationData=IE={}));var xE;(function(t){t.Full="full",t.Unchanged="unchanged"})(xE||(zn.DocumentDiagnosticReportKind=xE={}));var ME;(function(t){t.method="textDocument/diagnostic",t.messageDirection=So.MessageDirection.clientToServer,t.type=new So.ProtocolRequestType(t.method),t.partialResult=new qE.ProgressType})(ME||(zn.DocumentDiagnosticRequest=ME={}));var LE;(function(t){t.method="workspace/diagnostic",t.messageDirection=So.MessageDirection.clientToServer,t.type=new So.ProtocolRequestType(t.method),t.partialResult=new qE.ProgressType})(LE||(zn.WorkspaceDiagnosticRequest=LE={}));var $E;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=So.MessageDirection.serverToClient,t.type=new So.ProtocolRequestType0(t.method)})($E||(zn.DiagnosticRefreshRequest=$E={}))});var HE=w(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.DidCloseNotebookDocumentNotification=bt.DidSaveNotebookDocumentNotification=bt.DidChangeNotebookDocumentNotification=bt.NotebookCellArrayChange=bt.DidOpenNotebookDocumentNotification=bt.NotebookDocumentSyncRegistrationType=bt.NotebookDocument=bt.NotebookCell=bt.ExecutionSummary=bt.NotebookCellKind=void 0;var Fa=Au(),hr=Ou(),Mr=ft(),Xm;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Xm||(bt.NotebookCellKind=Xm={}));var Jm;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return hr.objectLiteral(s)&&Fa.uinteger.is(s.executionOrder)&&(s.success===void 0||hr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(Jm||(bt.ExecutionSummary=Jm={}));var Wu;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return hr.objectLiteral(o)&&Xm.is(o.kind)&&Fa.DocumentUri.is(o.document)&&(o.metadata===void 0||hr.objectLiteral(o.metadata))}t.is=n;function r(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)&&!Jm.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;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(hr.objectLiteral(s)&&hr.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}})(Wu||(bt.NotebookCell=Wu={}));var FE;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return hr.objectLiteral(i)&&hr.string(i.uri)&&Fa.integer.is(i.version)&&hr.typedArray(i.cells,Wu.is)}t.is=n})(FE||(bt.NotebookDocument=FE={}));var _o;(function(t){t.method="notebookDocument/sync",t.messageDirection=Mr.MessageDirection.clientToServer,t.type=new Mr.RegistrationType(t.method)})(_o||(bt.NotebookDocumentSyncRegistrationType=_o={}));var BE;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Mr.MessageDirection.clientToServer,t.type=new Mr.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(BE||(bt.DidOpenNotebookDocumentNotification=BE={}));var UE;(function(t){function e(r){let i=r;return hr.objectLiteral(i)&&Fa.uinteger.is(i.start)&&Fa.uinteger.is(i.deleteCount)&&(i.cells===void 0||hr.typedArray(i.cells,Wu.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(UE||(bt.NotebookCellArrayChange=UE={}));var VE;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Mr.MessageDirection.clientToServer,t.type=new Mr.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(VE||(bt.DidChangeNotebookDocumentNotification=VE={}));var zE;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Mr.MessageDirection.clientToServer,t.type=new Mr.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(zE||(bt.DidSaveNotebookDocumentNotification=zE={}));var WE;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Mr.MessageDirection.clientToServer,t.type=new Mr.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(WE||(bt.DidCloseNotebookDocumentNotification=WE={}))});var KE=w(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.InlineCompletionRequest=void 0;var GE=ft(),YE;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=GE.MessageDirection.clientToServer,t.type=new GE.ProtocolRequestType(t.method)})(YE||(Hu.InlineCompletionRequest=YE={}))});var cw=w(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.WorkspaceSymbolRequest=E.CodeActionResolveRequest=E.CodeActionRequest=E.DocumentSymbolRequest=E.DocumentHighlightRequest=E.ReferencesRequest=E.DefinitionRequest=E.SignatureHelpRequest=E.SignatureHelpTriggerKind=E.HoverRequest=E.CompletionResolveRequest=E.CompletionRequest=E.CompletionTriggerKind=E.PublishDiagnosticsNotification=E.WatchKind=E.RelativePattern=E.FileChangeType=E.DidChangeWatchedFilesNotification=E.WillSaveTextDocumentWaitUntilRequest=E.WillSaveTextDocumentNotification=E.TextDocumentSaveReason=E.DidSaveTextDocumentNotification=E.DidCloseTextDocumentNotification=E.DidChangeTextDocumentNotification=E.TextDocumentContentChangeEvent=E.DidOpenTextDocumentNotification=E.TextDocumentSyncKind=E.TelemetryEventNotification=E.LogMessageNotification=E.ShowMessageRequest=E.ShowMessageNotification=E.MessageType=E.DidChangeConfigurationNotification=E.ExitNotification=E.ShutdownRequest=E.InitializedNotification=E.InitializeErrorCodes=E.InitializeRequest=E.WorkDoneProgressOptions=E.TextDocumentRegistrationOptions=E.StaticRegistrationOptions=E.PositionEncodingKind=E.FailureHandlingKind=E.ResourceOperationKind=E.UnregistrationRequest=E.RegistrationRequest=E.DocumentSelector=E.NotebookCellTextDocumentFilter=E.NotebookDocumentFilter=E.TextDocumentFilter=void 0;E.MonikerRequest=E.MonikerKind=E.UniquenessLevel=E.WillDeleteFilesRequest=E.DidDeleteFilesNotification=E.WillRenameFilesRequest=E.DidRenameFilesNotification=E.WillCreateFilesRequest=E.DidCreateFilesNotification=E.FileOperationPatternKind=E.LinkedEditingRangeRequest=E.ShowDocumentRequest=E.SemanticTokensRegistrationType=E.SemanticTokensRefreshRequest=E.SemanticTokensRangeRequest=E.SemanticTokensDeltaRequest=E.SemanticTokensRequest=E.TokenFormat=E.CallHierarchyPrepareRequest=E.CallHierarchyOutgoingCallsRequest=E.CallHierarchyIncomingCallsRequest=E.WorkDoneProgressCancelNotification=E.WorkDoneProgressCreateRequest=E.WorkDoneProgress=E.SelectionRangeRequest=E.DeclarationRequest=E.FoldingRangeRefreshRequest=E.FoldingRangeRequest=E.ColorPresentationRequest=E.DocumentColorRequest=E.ConfigurationRequest=E.DidChangeWorkspaceFoldersNotification=E.WorkspaceFoldersRequest=E.TypeDefinitionRequest=E.ImplementationRequest=E.ApplyWorkspaceEditRequest=E.ExecuteCommandRequest=E.PrepareRenameRequest=E.RenameRequest=E.PrepareSupportDefaultBehavior=E.DocumentOnTypeFormattingRequest=E.DocumentRangesFormattingRequest=E.DocumentRangeFormattingRequest=E.DocumentFormattingRequest=E.DocumentLinkResolveRequest=E.DocumentLinkRequest=E.CodeLensRefreshRequest=E.CodeLensResolveRequest=E.CodeLensRequest=E.WorkspaceSymbolResolveRequest=void 0;E.InlineCompletionRequest=E.DidCloseNotebookDocumentNotification=E.DidSaveNotebookDocumentNotification=E.DidChangeNotebookDocumentNotification=E.NotebookCellArrayChange=E.DidOpenNotebookDocumentNotification=E.NotebookDocumentSyncRegistrationType=E.NotebookDocument=E.NotebookCell=E.ExecutionSummary=E.NotebookCellKind=E.DiagnosticRefreshRequest=E.WorkspaceDiagnosticRequest=E.DocumentDiagnosticRequest=E.DocumentDiagnosticReportKind=E.DiagnosticServerCancellationData=E.InlayHintRefreshRequest=E.InlayHintResolveRequest=E.InlayHintRequest=E.InlineValueRefreshRequest=E.InlineValueRequest=E.TypeHierarchySupertypesRequest=E.TypeHierarchySubtypesRequest=E.TypeHierarchyPrepareRequest=void 0;var U=ft(),XE=Au(),$t=Ou(),k1=S_();Object.defineProperty(E,"ImplementationRequest",{enumerable:!0,get:function(){return k1.ImplementationRequest}});var w1=k_();Object.defineProperty(E,"TypeDefinitionRequest",{enumerable:!0,get:function(){return w1.TypeDefinitionRequest}});var iw=P_();Object.defineProperty(E,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return iw.WorkspaceFoldersRequest}});Object.defineProperty(E,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return iw.DidChangeWorkspaceFoldersNotification}});var N1=D_();Object.defineProperty(E,"ConfigurationRequest",{enumerable:!0,get:function(){return N1.ConfigurationRequest}});var sw=I_();Object.defineProperty(E,"DocumentColorRequest",{enumerable:!0,get:function(){return sw.DocumentColorRequest}});Object.defineProperty(E,"ColorPresentationRequest",{enumerable:!0,get:function(){return sw.ColorPresentationRequest}});var ow=L_();Object.defineProperty(E,"FoldingRangeRequest",{enumerable:!0,get:function(){return ow.FoldingRangeRequest}});Object.defineProperty(E,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return ow.FoldingRangeRefreshRequest}});var P1=j_();Object.defineProperty(E,"DeclarationRequest",{enumerable:!0,get:function(){return P1.DeclarationRequest}});var R1=U_();Object.defineProperty(E,"SelectionRangeRequest",{enumerable:!0,get:function(){return R1.SelectionRangeRequest}});var ng=H_();Object.defineProperty(E,"WorkDoneProgress",{enumerable:!0,get:function(){return ng.WorkDoneProgress}});Object.defineProperty(E,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return ng.WorkDoneProgressCreateRequest}});Object.defineProperty(E,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return ng.WorkDoneProgressCancelNotification}});var rg=X_();Object.defineProperty(E,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return rg.CallHierarchyIncomingCallsRequest}});Object.defineProperty(E,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return rg.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(E,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return rg.CallHierarchyPrepareRequest}});var Eo=nE();Object.defineProperty(E,"TokenFormat",{enumerable:!0,get:function(){return Eo.TokenFormat}});Object.defineProperty(E,"SemanticTokensRequest",{enumerable:!0,get:function(){return Eo.SemanticTokensRequest}});Object.defineProperty(E,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Eo.SemanticTokensDeltaRequest}});Object.defineProperty(E,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Eo.SemanticTokensRangeRequest}});Object.defineProperty(E,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Eo.SemanticTokensRefreshRequest}});Object.defineProperty(E,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Eo.SemanticTokensRegistrationType}});var C1=sE();Object.defineProperty(E,"ShowDocumentRequest",{enumerable:!0,get:function(){return C1.ShowDocumentRequest}});var D1=cE();Object.defineProperty(E,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return D1.LinkedEditingRangeRequest}});var bs=gE();Object.defineProperty(E,"FileOperationPatternKind",{enumerable:!0,get:function(){return bs.FileOperationPatternKind}});Object.defineProperty(E,"DidCreateFilesNotification",{enumerable:!0,get:function(){return bs.DidCreateFilesNotification}});Object.defineProperty(E,"WillCreateFilesRequest",{enumerable:!0,get:function(){return bs.WillCreateFilesRequest}});Object.defineProperty(E,"DidRenameFilesNotification",{enumerable:!0,get:function(){return bs.DidRenameFilesNotification}});Object.defineProperty(E,"WillRenameFilesRequest",{enumerable:!0,get:function(){return bs.WillRenameFilesRequest}});Object.defineProperty(E,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return bs.DidDeleteFilesNotification}});Object.defineProperty(E,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return bs.WillDeleteFilesRequest}});var ig=SE();Object.defineProperty(E,"UniquenessLevel",{enumerable:!0,get:function(){return ig.UniquenessLevel}});Object.defineProperty(E,"MonikerKind",{enumerable:!0,get:function(){return ig.MonikerKind}});Object.defineProperty(E,"MonikerRequest",{enumerable:!0,get:function(){return ig.MonikerRequest}});var sg=wE();Object.defineProperty(E,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return sg.TypeHierarchyPrepareRequest}});Object.defineProperty(E,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return sg.TypeHierarchySubtypesRequest}});Object.defineProperty(E,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return sg.TypeHierarchySupertypesRequest}});var aw=RE();Object.defineProperty(E,"InlineValueRequest",{enumerable:!0,get:function(){return aw.InlineValueRequest}});Object.defineProperty(E,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return aw.InlineValueRefreshRequest}});var og=OE();Object.defineProperty(E,"InlayHintRequest",{enumerable:!0,get:function(){return og.InlayHintRequest}});Object.defineProperty(E,"InlayHintResolveRequest",{enumerable:!0,get:function(){return og.InlayHintResolveRequest}});Object.defineProperty(E,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return og.InlayHintRefreshRequest}});var Ba=jE();Object.defineProperty(E,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ba.DiagnosticServerCancellationData}});Object.defineProperty(E,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ba.DocumentDiagnosticReportKind}});Object.defineProperty(E,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ba.DocumentDiagnosticRequest}});Object.defineProperty(E,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ba.WorkspaceDiagnosticRequest}});Object.defineProperty(E,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ba.DiagnosticRefreshRequest}});var Lr=HE();Object.defineProperty(E,"NotebookCellKind",{enumerable:!0,get:function(){return Lr.NotebookCellKind}});Object.defineProperty(E,"ExecutionSummary",{enumerable:!0,get:function(){return Lr.ExecutionSummary}});Object.defineProperty(E,"NotebookCell",{enumerable:!0,get:function(){return Lr.NotebookCell}});Object.defineProperty(E,"NotebookDocument",{enumerable:!0,get:function(){return Lr.NotebookDocument}});Object.defineProperty(E,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Lr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(E,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Lr.DidOpenNotebookDocumentNotification}});Object.defineProperty(E,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Lr.NotebookCellArrayChange}});Object.defineProperty(E,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Lr.DidChangeNotebookDocumentNotification}});Object.defineProperty(E,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Lr.DidSaveNotebookDocumentNotification}});Object.defineProperty(E,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Lr.DidCloseNotebookDocumentNotification}});var A1=KE();Object.defineProperty(E,"InlineCompletionRequest",{enumerable:!0,get:function(){return A1.InlineCompletionRequest}});var Qm;(function(t){function e(n){let r=n;return $t.string(r)||$t.string(r.language)||$t.string(r.scheme)||$t.string(r.pattern)}t.is=e})(Qm||(E.TextDocumentFilter=Qm={}));var Zm;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebookType)||$t.string(r.scheme)||$t.string(r.pattern))}t.is=e})(Zm||(E.NotebookDocumentFilter=Zm={}));var eg;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebook)||Zm.is(r.notebook))&&(r.language===void 0||$t.string(r.language))}t.is=e})(eg||(E.NotebookCellTextDocumentFilter=eg={}));var tg;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!$t.string(r)&&!Qm.is(r)&&!eg.is(r))return!1;return!0}t.is=e})(tg||(E.DocumentSelector=tg={}));var JE;(function(t){t.method="client/registerCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(JE||(E.RegistrationRequest=JE={}));var QE;(function(t){t.method="client/unregisterCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(QE||(E.UnregistrationRequest=QE={}));var ZE;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(ZE||(E.ResourceOperationKind=ZE={}));var ek;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(ek||(E.FailureHandlingKind=ek={}));var tk;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(tk||(E.PositionEncodingKind=tk={}));var nk;(function(t){function e(n){let r=n;return r&&$t.string(r.id)&&r.id.length>0}t.hasId=e})(nk||(E.StaticRegistrationOptions=nk={}));var rk;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||tg.is(r.documentSelector))}t.is=e})(rk||(E.TextDocumentRegistrationOptions=rk={}));var ik;(function(t){function e(r){let i=r;return $t.objectLiteral(i)&&(i.workDoneProgress===void 0||$t.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&$t.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(ik||(E.WorkDoneProgressOptions=ik={}));var sk;(function(t){t.method="initialize",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(sk||(E.InitializeRequest=sk={}));var ok;(function(t){t.unknownProtocolVersion=1})(ok||(E.InitializeErrorCodes=ok={}));var ak;(function(t){t.method="initialized",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(ak||(E.InitializedNotification=ak={}));var ck;(function(t){t.method="shutdown",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType0(t.method)})(ck||(E.ShutdownRequest=ck={}));var lk;(function(t){t.method="exit",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType0(t.method)})(lk||(E.ExitNotification=lk={}));var uk;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(uk||(E.DidChangeConfigurationNotification=uk={}));var dk;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(dk||(E.MessageType=dk={}));var fk;(function(t){t.method="window/showMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(fk||(E.ShowMessageNotification=fk={}));var hk;(function(t){t.method="window/showMessageRequest",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(hk||(E.ShowMessageRequest=hk={}));var pk;(function(t){t.method="window/logMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(pk||(E.LogMessageNotification=pk={}));var mk;(function(t){t.method="telemetry/event",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(mk||(E.TelemetryEventNotification=mk={}));var gk;(function(t){t.None=0,t.Full=1,t.Incremental=2})(gk||(E.TextDocumentSyncKind=gk={}));var yk;(function(t){t.method="textDocument/didOpen",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(yk||(E.DidOpenTextDocumentNotification=yk={}));var vk;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(vk||(E.TextDocumentContentChangeEvent=vk={}));var bk;(function(t){t.method="textDocument/didChange",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(bk||(E.DidChangeTextDocumentNotification=bk={}));var Tk;(function(t){t.method="textDocument/didClose",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Tk||(E.DidCloseTextDocumentNotification=Tk={}));var Sk;(function(t){t.method="textDocument/didSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Sk||(E.DidSaveTextDocumentNotification=Sk={}));var _k;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(_k||(E.TextDocumentSaveReason=_k={}));var Ek;(function(t){t.method="textDocument/willSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Ek||(E.WillSaveTextDocumentNotification=Ek={}));var kk;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(kk||(E.WillSaveTextDocumentWaitUntilRequest=kk={}));var wk;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(wk||(E.DidChangeWatchedFilesNotification=wk={}));var Nk;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Nk||(E.FileChangeType=Nk={}));var Pk;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&(XE.URI.is(r.baseUri)||XE.WorkspaceFolder.is(r.baseUri))&&$t.string(r.pattern)}t.is=e})(Pk||(E.RelativePattern=Pk={}));var Rk;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Rk||(E.WatchKind=Rk={}));var Ck;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(Ck||(E.PublishDiagnosticsNotification=Ck={}));var Dk;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Dk||(E.CompletionTriggerKind=Dk={}));var Ak;(function(t){t.method="textDocument/completion",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ak||(E.CompletionRequest=Ak={}));var Ok;(function(t){t.method="completionItem/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ok||(E.CompletionResolveRequest=Ok={}));var Ik;(function(t){t.method="textDocument/hover",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ik||(E.HoverRequest=Ik={}));var xk;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(xk||(E.SignatureHelpTriggerKind=xk={}));var Mk;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Mk||(E.SignatureHelpRequest=Mk={}));var Lk;(function(t){t.method="textDocument/definition",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Lk||(E.DefinitionRequest=Lk={}));var $k;(function(t){t.method="textDocument/references",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})($k||(E.ReferencesRequest=$k={}));var qk;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(qk||(E.DocumentHighlightRequest=qk={}));var jk;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(jk||(E.DocumentSymbolRequest=jk={}));var Fk;(function(t){t.method="textDocument/codeAction",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Fk||(E.CodeActionRequest=Fk={}));var Bk;(function(t){t.method="codeAction/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Bk||(E.CodeActionResolveRequest=Bk={}));var Uk;(function(t){t.method="workspace/symbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Uk||(E.WorkspaceSymbolRequest=Uk={}));var Vk;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Vk||(E.WorkspaceSymbolResolveRequest=Vk={}));var zk;(function(t){t.method="textDocument/codeLens",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(zk||(E.CodeLensRequest=zk={}));var Wk;(function(t){t.method="codeLens/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Wk||(E.CodeLensResolveRequest=Wk={}));var Hk;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType0(t.method)})(Hk||(E.CodeLensRefreshRequest=Hk={}));var Gk;(function(t){t.method="textDocument/documentLink",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Gk||(E.DocumentLinkRequest=Gk={}));var Yk;(function(t){t.method="documentLink/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Yk||(E.DocumentLinkResolveRequest=Yk={}));var Kk;(function(t){t.method="textDocument/formatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Kk||(E.DocumentFormattingRequest=Kk={}));var Xk;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Xk||(E.DocumentRangeFormattingRequest=Xk={}));var Jk;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Jk||(E.DocumentRangesFormattingRequest=Jk={}));var Qk;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Qk||(E.DocumentOnTypeFormattingRequest=Qk={}));var Zk;(function(t){t.Identifier=1})(Zk||(E.PrepareSupportDefaultBehavior=Zk={}));var ew;(function(t){t.method="textDocument/rename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ew||(E.RenameRequest=ew={}));var tw;(function(t){t.method="textDocument/prepareRename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(tw||(E.PrepareRenameRequest=tw={}));var nw;(function(t){t.method="workspace/executeCommand",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(nw||(E.ExecuteCommandRequest=nw={}));var rw;(function(t){t.method="workspace/applyEdit",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType("workspace/applyEdit")})(rw||(E.ApplyWorkspaceEditRequest=rw={}))});var uw=w(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.createProtocolConnection=void 0;var lw=vs();function O1(t,e,n,r){return lw.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,lw.createMessageConnection)(t,e,n,r)}Gu.createProtocolConnection=O1});var fw=w(Tn=>{"use strict";var I1=Tn&&Tn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Yu=Tn&&Tn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&I1(e,t,n)};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.LSPErrorCodes=Tn.createProtocolConnection=void 0;Yu(vs(),Tn);Yu(Au(),Tn);Yu(ft(),Tn);Yu(cw(),Tn);var x1=uw();Object.defineProperty(Tn,"createProtocolConnection",{enumerable:!0,get:function(){return x1.createProtocolConnection}});var dw;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(dw||(Tn.LSPErrorCodes=dw={}))});var Tt=w($r=>{"use strict";var M1=$r&&$r.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),hw=$r&&$r.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&M1(e,t,n)};Object.defineProperty($r,"__esModule",{value:!0});$r.createProtocolConnection=void 0;var L1=zm();hw(zm(),$r);hw(fw(),$r);function $1(t,e,n,r){return(0,L1.createMessageConnection)(t,e,n,r)}$r.createProtocolConnection=$1});var ag=w(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.generateUuid=Wn.parse=Wn.isUUID=Wn.v4=Wn.empty=void 0;var Ua=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Va=class t extends Ua{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(""))}};Va._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Va._timeHighBits=["8","9","a","b"];Wn.empty=new Ua("00000000-0000-0000-0000-000000000000");function pw(){return new Va}Wn.v4=pw;var q1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function mw(t){return q1.test(t)}Wn.isUUID=mw;function j1(t){if(!mw(t))throw new Error("invalid uuid");return new Ua(t)}Wn.parse=j1;function F1(){return pw().asHex()}Wn.generateUuid=F1});var gw=w(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.attachPartialResult=Li.ProgressFeature=Li.attachWorkDone=void 0;var Mi=Tt(),B1=ag(),Ts=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Mi.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(Mi.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Mi.WorkDoneProgress.type,this._token,{kind:"end"})}};Ts.Instances=new Map;var Ku=class extends Ts{constructor(e,n){super(e,n),this._source=new Mi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},za=class{constructor(){}begin(){}report(){}done(){}},Xu=class extends za{constructor(){super(),this._source=new Mi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function U1(t,e){if(e===void 0||e.workDoneToken===void 0)return new za;let n=e.workDoneToken;return delete e.workDoneToken,new Ts(t,n)}Li.attachWorkDone=U1;var V1=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Mi.WorkDoneProgressCancelNotification.type,n=>{let r=Ts.Instances.get(n.token);(r instanceof Ku||r instanceof Xu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new za:new Ts(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,B1.generateUuid)();return this.connection.sendRequest(Mi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Ku(this.connection,e))}else return Promise.resolve(new Xu)}};Li.ProgressFeature=V1;var cg;(function(t){t.type=new Mi.ProgressType})(cg||(cg={}));var lg=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(cg.type,this._token,e)}};function z1(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new lg(t,n)}Li.attachPartialResult=z1});var yw=w(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.ConfigurationFeature=void 0;var W1=Tt(),H1=cu(),G1=t=>class extends t{getConfiguration(e){return e?H1.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(W1.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Ju.ConfigurationFeature=G1});var vw=w(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.WorkspaceFoldersFeature=void 0;var Qu=Tt(),Y1=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Qu.Emitter,this.connection.onNotification(Qu.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Qu.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(Qu.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Zu.WorkspaceFoldersFeature=Y1});var bw=w(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.CallHierarchyFeature=void 0;var ug=Tt(),K1=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(ug.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=ug.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=ug.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ed.CallHierarchyFeature=K1});var fg=w($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.SemanticTokensBuilder=$i.SemanticTokensDiff=$i.SemanticTokensFeature=void 0;var td=Tt(),X1=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(td.SemanticTokensRefreshRequest.type),on:e=>{let n=td.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=td.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=td.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};$i.SemanticTokensFeature=X1;var nd=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};$i.SemanticTokensDiff=nd;var dg=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,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}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 nd(this._prevData,this._data).computeDiff()}:this.build()}};$i.SemanticTokensBuilder=dg});var Tw=w(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.ShowDocumentFeature=void 0;var J1=Tt(),Q1=t=>class extends t{showDocument(e){return this.connection.sendRequest(J1.ShowDocumentRequest.type,e)}};rd.ShowDocumentFeature=Q1});var Sw=w(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.FileOperationsFeature=void 0;var ko=Tt(),Z1=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(ko.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(ko.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(ko.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(ko.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(ko.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(ko.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};id.FileOperationsFeature=Z1});var _w=w(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.LinkedEditingRangeFeature=void 0;var eL=Tt(),tL=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(eL.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};sd.LinkedEditingRangeFeature=tL});var Ew=w(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.TypeHierarchyFeature=void 0;var hg=Tt(),nL=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(hg.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=hg.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=hg.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};od.TypeHierarchyFeature=nL});var ww=w(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.InlineValueFeature=void 0;var kw=Tt(),rL=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(kw.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(kw.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};ad.InlineValueFeature=rL});var Pw=w(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.FoldingRangeFeature=void 0;var Nw=Tt(),iL=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Nw.FoldingRangeRefreshRequest.type),on:e=>{let n=Nw.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};cd.FoldingRangeFeature=iL});var Rw=w(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.InlayHintFeature=void 0;var pg=Tt(),sL=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(pg.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(pg.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(pg.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};ld.InlayHintFeature=sL});var Cw=w(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.DiagnosticFeature=void 0;var Wa=Tt(),oL=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Wa.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Wa.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Wa.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Wa.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Wa.WorkspaceDiagnosticRequest.partialResult,n)))}}};ud.DiagnosticFeature=oL});var gg=w(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.TextDocuments=void 0;var Ss=Tt(),mg=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Ss.Emitter,this._onDidOpen=new Ss.Emitter,this._onDidClose=new Ss.Emitter,this._onDidSave=new Ss.Emitter,this._onWillSave=new Ss.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=Ss.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.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)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.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})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Ss.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};dd.TextDocuments=mg});var vg=w(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.NotebookDocuments=wo.NotebookSyncFeature=void 0;var Hn=Tt(),Dw=gg(),aL=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Hn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Hn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Hn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Hn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};wo.NotebookSyncFeature=aL;var fd=class t{onDidOpenTextDocument(e){return this.openHandler=e,Hn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Hn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Hn.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}};fd.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var yg=class{constructor(e){e instanceof Dw.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Dw.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Hn.Emitter,this._onDidChange=new Hn.Emitter,this._onDidSave=new Hn.Emitter,this._onDidClose=new Hn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new fd,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.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 _=c.cells;if(_.structure!==void 0){let v=_.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),_.structure.didOpen!==void 0)for(let b of _.structure.didOpen)n.openTextDocument({textDocument:b}),l.push(b.uri);if(_.structure.didClose)for(let b of _.structure.didClose)n.closeTextDocument({textDocument:b}),u.push(b.uri)}if(_.data!==void 0){let v=new Map(_.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let k=v.get(s.cells[b].document);if(k!==void 0){let C=s.cells.splice(b,1,k);if(d.push({old:C[0],new:k}),v.delete(k.document),v.size===0)break}}}if(_.textContent!==void 0)for(let v of _.textContent)n.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),f.push(v.document.uri)}this.updateCellMap(s);let h={notebookDocument:s};a&&(h.metadata={old:o,new:s.metadata});let y=[];for(let _ of l)y.push(this.getNotebookCell(_));let p=[];for(let _ of u)p.push(this.getNotebookCell(_));let T=[];for(let _ of f)T.push(this.getNotebookCell(_));(y.length>0||p.length>0||d.length>0||T.length>0)&&(h.cells={added:y,removed:p,changed:{data:d,textContent:T}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.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)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Hn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};wo.NotebookDocuments=yg});var Aw=w(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.MonikerFeature=void 0;var cL=Tt(),lL=t=>class extends t{get moniker(){return{on:e=>{let n=cL.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};hd.MonikerFeature=lL});var kg=w(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createConnection=Oe.combineFeatures=Oe.combineNotebooksFeatures=Oe.combineLanguagesFeatures=Oe.combineWorkspaceFeatures=Oe.combineWindowFeatures=Oe.combineClientFeatures=Oe.combineTracerFeatures=Oe.combineTelemetryFeatures=Oe.combineConsoleFeatures=Oe._NotebooksImpl=Oe._LanguagesImpl=Oe.BulkUnregistration=Oe.BulkRegistration=Oe.ErrorMessageTracker=void 0;var G=Tt(),Gn=cu(),Tg=ag(),ae=gw(),uL=yw(),dL=vw(),fL=bw(),hL=fg(),pL=Tw(),mL=Sw(),gL=_w(),yL=Ew(),vL=ww(),bL=Pw(),TL=Rw(),SL=Cw(),_L=vg(),EL=Aw();function bg(t){if(t!==null)return t}var Sg=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Oe.ErrorMessageTracker=Sg;var pd=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(G.MessageType.Error,e)}warn(e){this.send(G.MessageType.Warning,e)}info(e){this.send(G.MessageType.Info,e)}log(e){this.send(G.MessageType.Log,e)}debug(e){this.send(G.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(G.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,G.RAL)().console.error("Sending log message failed")})}},_g=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,...n){let r={type:G.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(bg)}showWarningMessage(e,...n){let r={type:G.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(bg)}showInformationMessage(e,...n){let r={type:G.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(bg)}},Ow=(0,pL.ShowDocumentFeature)((0,ae.ProgressFeature)(_g)),Iw;(function(t){function e(){return new md}t.create=e})(Iw||(Oe.BulkRegistration=Iw={}));var md=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Gn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=Tg.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},xw;(function(t){function e(){return new Ha(void 0,[])}t.create=e})(xw||(Oe.BulkUnregistration=xw={}));var Ha=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(G.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Gn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(G.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},gd=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,n,r){return e instanceof md?this.registerMany(e):e instanceof Ha?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=Gn.string(n)?n:n.method,s=Tg.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(G.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,n){let r=Gn.string(e)?e:e.method,i=Tg.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(G.RegistrationRequest.type,s).then(o=>G.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(G.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(G.RegistrationRequest.type,n).then(()=>new Ha(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Eg=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 n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(G.ApplyWorkspaceEditRequest.type,r)}},Mw=(0,mL.FileOperationsFeature)((0,dL.WorkspaceFoldersFeature)((0,uL.ConfigurationFeature)(Eg))),yd=class{constructor(){this._trace=G.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,n){this._trace!==G.Trace.Off&&this.connection.sendNotification(G.LogTraceNotification.type,{message:e,verbose:this._trace===G.Trace.Verbose?n:void 0}).catch(()=>{})}},vd=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(G.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},bd=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,ae.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ae.attachPartialResult)(this.connection,n)}};Oe._LanguagesImpl=bd;var Lw=(0,bL.FoldingRangeFeature)((0,EL.MonikerFeature)((0,SL.DiagnosticFeature)((0,TL.InlayHintFeature)((0,vL.InlineValueFeature)((0,yL.TypeHierarchyFeature)((0,gL.LinkedEditingRangeFeature)((0,hL.SemanticTokensFeature)((0,fL.CallHierarchyFeature)(bd))))))))),Td=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,ae.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ae.attachPartialResult)(this.connection,n)}};Oe._NotebooksImpl=Td;var $w=(0,_L.NotebookSyncFeature)(Td);function qw(t,e){return function(n){return e(t(n))}}Oe.combineConsoleFeatures=qw;function jw(t,e){return function(n){return e(t(n))}}Oe.combineTelemetryFeatures=jw;function Fw(t,e){return function(n){return e(t(n))}}Oe.combineTracerFeatures=Fw;function Bw(t,e){return function(n){return e(t(n))}}Oe.combineClientFeatures=Bw;function Uw(t,e){return function(n){return e(t(n))}}Oe.combineWindowFeatures=Uw;function Vw(t,e){return function(n){return e(t(n))}}Oe.combineWorkspaceFeatures=Vw;function zw(t,e){return function(n){return e(t(n))}}Oe.combineLanguagesFeatures=zw;function Ww(t,e){return function(n){return e(t(n))}}Oe.combineNotebooksFeatures=Ww;function kL(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,qw),tracer:n(t.tracer,e.tracer,Fw),telemetry:n(t.telemetry,e.telemetry,jw),client:n(t.client,e.client,Bw),window:n(t.window,e.window,Uw),workspace:n(t.workspace,e.workspace,Vw),languages:n(t.languages,e.languages,zw),notebooks:n(t.notebooks,e.notebooks,Ww)}}Oe.combineFeatures=kL;function wL(t,e,n){let r=n&&n.console?new(n.console(pd)):new pd,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(yd)):new yd,o=n&&n.telemetry?new(n.telemetry(vd)):new vd,a=n&&n.client?new(n.client(gd)):new gd,c=n&&n.window?new(n.window(Ow)):new Ow,l=n&&n.workspace?new(n.workspace(Mw)):new Mw,u=n&&n.languages?new(n.languages(Lw)):new Lw,d=n&&n.notebooks?new(n.notebooks($w)):new $w,f=[r,s,o,a,c,l,u,d];function h(v){return v instanceof Promise?v:Gn.thenable(v)?new Promise((b,k)=>{v.then(C=>b(C),C=>k(C))}):Promise.resolve(v)}let y,p,T,_={listen:()=>i.listen(),sendRequest:(v,...b)=>i.sendRequest(Gn.string(v)?v:v.method,...b),onRequest:(v,b)=>i.onRequest(v,b),sendNotification:(v,b)=>{let k=Gn.string(v)?v:v.method;return i.sendNotification(k,b)},onNotification:(v,b)=>i.onNotification(v,b),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:v=>(p=v,{dispose:()=>{p=void 0}}),onInitialized:v=>i.onNotification(G.InitializedNotification.type,v),onShutdown:v=>(y=v,{dispose:()=>{y=void 0}}),onExit:v=>(T=v,{dispose:()=>{T=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:v=>i.onNotification(G.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>i.onNotification(G.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>i.onNotification(G.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>i.onNotification(G.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>i.onNotification(G.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>i.onNotification(G.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>i.onRequest(G.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>i.onNotification(G.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>i.sendNotification(G.PublishDiagnosticsNotification.type,v),onHover:v=>i.onRequest(G.HoverRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),void 0)),onCompletion:v=>i.onRequest(G.CompletionRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onCompletionResolve:v=>i.onRequest(G.CompletionResolveRequest.type,v),onSignatureHelp:v=>i.onRequest(G.SignatureHelpRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),void 0)),onDeclaration:v=>i.onRequest(G.DeclarationRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onDefinition:v=>i.onRequest(G.DefinitionRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onTypeDefinition:v=>i.onRequest(G.TypeDefinitionRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onImplementation:v=>i.onRequest(G.ImplementationRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onReferences:v=>i.onRequest(G.ReferencesRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onDocumentHighlight:v=>i.onRequest(G.DocumentHighlightRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onDocumentSymbol:v=>i.onRequest(G.DocumentSymbolRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onWorkspaceSymbol:v=>i.onRequest(G.WorkspaceSymbolRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onWorkspaceSymbolResolve:v=>i.onRequest(G.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>i.onRequest(G.CodeActionRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onCodeActionResolve:v=>i.onRequest(G.CodeActionResolveRequest.type,(b,k)=>v(b,k)),onCodeLens:v=>i.onRequest(G.CodeLensRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onCodeLensResolve:v=>i.onRequest(G.CodeLensResolveRequest.type,(b,k)=>v(b,k)),onDocumentFormatting:v=>i.onRequest(G.DocumentFormattingRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),void 0)),onDocumentRangeFormatting:v=>i.onRequest(G.DocumentRangeFormattingRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),void 0)),onDocumentOnTypeFormatting:v=>i.onRequest(G.DocumentOnTypeFormattingRequest.type,(b,k)=>v(b,k)),onRenameRequest:v=>i.onRequest(G.RenameRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),void 0)),onPrepareRename:v=>i.onRequest(G.PrepareRenameRequest.type,(b,k)=>v(b,k)),onDocumentLinks:v=>i.onRequest(G.DocumentLinkRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onDocumentLinkResolve:v=>i.onRequest(G.DocumentLinkResolveRequest.type,(b,k)=>v(b,k)),onDocumentColor:v=>i.onRequest(G.DocumentColorRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onColorPresentation:v=>i.onRequest(G.ColorPresentationRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onFoldingRanges:v=>i.onRequest(G.FoldingRangeRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onSelectionRanges:v=>i.onRequest(G.SelectionRangeRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),(0,ae.attachPartialResult)(i,b))),onExecuteCommand:v=>i.onRequest(G.ExecuteCommandRequest.type,(b,k)=>v(b,k,(0,ae.attachWorkDone)(i,b),void 0)),dispose:()=>i.dispose()};for(let v of f)v.attach(_);return i.onRequest(G.InitializeRequest.type,v=>{e.initialize(v),Gn.string(v.trace)&&(s.trace=G.Trace.fromString(v.trace));for(let b of f)b.initialize(v.capabilities);if(p){let b=p(v,new G.CancellationTokenSource().token,(0,ae.attachWorkDone)(i,v),void 0);return h(b).then(k=>{if(k instanceof G.ResponseError)return k;let C=k;C||(C={capabilities:{}});let L=C.capabilities;L||(L={},C.capabilities=L),L.textDocumentSync===void 0||L.textDocumentSync===null?L.textDocumentSync=Gn.number(_.__textDocumentSync)?_.__textDocumentSync:G.TextDocumentSyncKind.None:!Gn.number(L.textDocumentSync)&&!Gn.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=Gn.number(_.__textDocumentSync)?_.__textDocumentSync:G.TextDocumentSyncKind.None);for(let B of f)B.fillServerCapabilities(L);return C})}else{let b={capabilities:{textDocumentSync:G.TextDocumentSyncKind.None}};for(let k of f)k.fillServerCapabilities(b.capabilities);return b}}),i.onRequest(G.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new G.CancellationTokenSource().token)}),i.onNotification(G.ExitNotification.type,()=>{try{T&&T()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(G.SetTraceNotification.type,v=>{s.trace=G.Trace.fromString(v.value)}),_}Oe.createConnection=wL});var Hw=w(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.resolveModulePath=Sn.FileSystem=Sn.resolveGlobalYarnPath=Sn.resolveGlobalNodePath=Sn.resolve=Sn.uriToFilePath=void 0;var NL=require("url"),pr=require("path"),wg=require("fs"),Cg=require("child_process");function PL(t){let e=NL.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return pr.normalize(n.join("/"))}Sn.uriToFilePath=PL;function Ng(){return process.platform==="win32"}function Sd(t,e,n,r){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&&wg.existsSync(e)&&(l[i]?l[i]=e+pr.delimiter+l[i]:l[i]=e,r&&r(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,Cg.fork)("",[],{cwd:n,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)}})}Sn.resolve=Sd;function Pg(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Ng()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,Cg.spawnSync)(e,["config","get","prefix"],r).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?Ng()?pr.join(o,"node_modules"):pr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Sn.resolveGlobalNodePath=Pg;function RL(t){let e="yarn",n={encoding:"utf8"};Ng()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,Cg.spawnSync)(e,["global","dir","--json"],n),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 pr.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Sn.resolveGlobalYarnPath=RL;var Rg;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!wg.existsSync(__filename.toUpperCase())||!wg.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?pr.normalize(s).indexOf(pr.normalize(i))===0:pr.normalize(s).toLowerCase().indexOf(pr.normalize(i).toLowerCase())===0}t.isParent=r})(Rg||(Sn.FileSystem=Rg={}));function CL(t,e,n,r){return n?(pr.isAbsolute(n)||(n=pr.join(t,n)),Sd(e,n,n,r).then(i=>Rg.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Sd(e,Pg(r),t,r))):Sd(e,Pg(r),t,r)}Sn.resolveModulePath=CL});var Dg=w((cX,Gw)=>{"use strict";Gw.exports=Tt()});var Yw=w(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.InlineCompletionFeature=void 0;var DL=Tt(),AL=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(DL.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};_d.InlineCompletionFeature=AL});var Jw=w(tn=>{"use strict";var OL=tn&&tn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Xw=tn&&tn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&OL(e,t,n)};Object.defineProperty(tn,"__esModule",{value:!0});tn.ProposedFeatures=tn.NotebookDocuments=tn.TextDocuments=tn.SemanticTokensBuilder=void 0;var IL=fg();Object.defineProperty(tn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return IL.SemanticTokensBuilder}});var xL=Yw();Xw(Tt(),tn);var ML=gg();Object.defineProperty(tn,"TextDocuments",{enumerable:!0,get:function(){return ML.TextDocuments}});var LL=vg();Object.defineProperty(tn,"NotebookDocuments",{enumerable:!0,get:function(){return LL.NotebookDocuments}});Xw(kg(),tn);var Kw;(function(t){t.all={__brand:"features",languages:xL.InlineCompletionFeature}})(Kw||(tn.ProposedFeatures=Kw={}))});var J=w(Yn=>{"use strict";var $L=Yn&&Yn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),tN=Yn&&Yn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&$L(e,t,n)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.createConnection=Yn.Files=void 0;var Qw=require("node:util"),Ag=cu(),qL=kg(),Ga=Hw(),_s=Dg();tN(Dg(),Yn);tN(Jw(),Yn);var Zw;(function(t){t.uriToFilePath=Ga.uriToFilePath,t.resolveGlobalNodePath=Ga.resolveGlobalNodePath,t.resolveGlobalYarnPath=Ga.resolveGlobalYarnPath,t.resolve=Ga.resolve,t.resolveModulePath=Ga.resolveModulePath})(Zw||(Yn.Files=Zw={}));var eN;function Ed(){if(eN!==void 0)try{eN.end()}catch{}}var No=!1,nN;function jL(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(nN=setInterval(()=>{try{process.kill(r,0)}catch{Ed(),process.exit(No?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}jL();var FL={initialize:t=>{let e=t.processId;Ag.number(e)&&nN===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(No?0:1)}},3e3)},get shutdownReceived(){return No},set shutdownReceived(t){No=t},exit:t=>{Ed(),process.exit(t)}};function BL(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),_s.ConnectionStrategy.is(t)||_s.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),UL(s,o,a,i)}Yn.createConnection=BL;function UL(t,e,n,r){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 _s.IPCMessageReader(process),e=new _s.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,_s.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,_s.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(Ag.func(t.read)&&Ag.func(t.on)){let c=t;c.on("end",()=>{Ed(),process.exit(No?0:1)}),c.on("close",()=>{Ed(),process.exit(No?0:1)})}let a=c=>{let l=(0,_s.createProtocolConnection)(t,e,c,n);return i&&VL(c),l};return(0,qL.createConnection)(a,FL,r)}function VL(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,Qw.inspect)(i)).join(" ")}let n=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=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,Qw.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 iN=w((hX,rN)=>{"use strict";rN.exports=J()});var Ne=w(Gt=>{"use strict";var cy=Symbol.for("yaml.alias"),GR=Symbol.for("yaml.document"),wf=Symbol.for("yaml.map"),YR=Symbol.for("yaml.pair"),ly=Symbol.for("yaml.scalar"),Nf=Symbol.for("yaml.seq"),gi=Symbol.for("yaml.node.type"),H$=t=>!!t&&typeof t=="object"&&t[gi]===cy,G$=t=>!!t&&typeof t=="object"&&t[gi]===GR,Y$=t=>!!t&&typeof t=="object"&&t[gi]===wf,K$=t=>!!t&&typeof t=="object"&&t[gi]===YR,KR=t=>!!t&&typeof t=="object"&&t[gi]===ly,X$=t=>!!t&&typeof t=="object"&&t[gi]===Nf;function XR(t){if(t&&typeof t=="object")switch(t[gi]){case wf:case Nf:return!0}return!1}function J$(t){if(t&&typeof t=="object")switch(t[gi]){case cy:case wf:case ly:case Nf:return!0}return!1}var Q$=t=>(KR(t)||XR(t))&&!!t.anchor;Gt.ALIAS=cy;Gt.DOC=GR;Gt.MAP=wf;Gt.NODE_TYPE=gi;Gt.PAIR=YR;Gt.SCALAR=ly;Gt.SEQ=Nf;Gt.hasAnchor=Q$;Gt.isAlias=H$;Gt.isCollection=XR;Gt.isDocument=G$;Gt.isMap=Y$;Gt.isNode=J$;Gt.isPair=K$;Gt.isScalar=KR;Gt.isSeq=X$});var yc=w(uy=>{"use strict";var It=Ne(),Pn=Symbol("break visit"),JR=Symbol("skip children"),Gr=Symbol("remove node");function Pf(t,e){let n=QR(e);It.isDocument(t)?zo(null,t.contents,n,Object.freeze([t]))===Gr&&(t.contents=null):zo(null,t,n,Object.freeze([]))}Pf.BREAK=Pn;Pf.SKIP=JR;Pf.REMOVE=Gr;function zo(t,e,n,r){let i=ZR(t,e,n,r);if(It.isNode(i)||It.isPair(i))return e0(t,r,i),zo(t,i,n,r);if(typeof i!="symbol"){if(It.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=zo(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===Pn)return Pn;o===Gr&&(e.items.splice(s,1),s-=1)}}}else if(It.isPair(e)){r=Object.freeze(r.concat(e));let s=zo("key",e.key,n,r);if(s===Pn)return Pn;s===Gr&&(e.key=null);let o=zo("value",e.value,n,r);if(o===Pn)return Pn;o===Gr&&(e.value=null)}}return i}async function Rf(t,e){let n=QR(e);It.isDocument(t)?await Wo(null,t.contents,n,Object.freeze([t]))===Gr&&(t.contents=null):await Wo(null,t,n,Object.freeze([]))}Rf.BREAK=Pn;Rf.SKIP=JR;Rf.REMOVE=Gr;async function Wo(t,e,n,r){let i=await ZR(t,e,n,r);if(It.isNode(i)||It.isPair(i))return e0(t,r,i),Wo(t,i,n,r);if(typeof i!="symbol"){if(It.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=await Wo(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===Pn)return Pn;o===Gr&&(e.items.splice(s,1),s-=1)}}}else if(It.isPair(e)){r=Object.freeze(r.concat(e));let s=await Wo("key",e.key,n,r);if(s===Pn)return Pn;s===Gr&&(e.key=null);let o=await Wo("value",e.value,n,r);if(o===Pn)return Pn;o===Gr&&(e.value=null)}}return i}function QR(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 ZR(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(It.isMap(e))return n.Map?.(t,e,r);if(It.isSeq(e))return n.Seq?.(t,e,r);if(It.isPair(e))return n.Pair?.(t,e,r);if(It.isScalar(e))return n.Scalar?.(t,e,r);if(It.isAlias(e))return n.Alias?.(t,e,r)}function e0(t,e,n){let r=e[e.length-1];if(It.isCollection(r))r.items[t]=n;else if(It.isPair(r))t==="key"?r.key=n:r.value=n;else if(It.isDocument(r))r.contents=n;else{let i=It.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}uy.visit=Pf;uy.visitAsync=Rf});var dy=w(n0=>{"use strict";var t0=Ne(),Z$=yc(),eq={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},tq=t=>t.replace(/[!,[\]{}]/g,e=>eq[e]),vc=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}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,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+tq(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&t0.isNode(e.contents)){let s={};Z$.visit(e.contents,(o,a)=>{t0.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
|
|
38
|
+
`)}};vc.defaultYaml={explicit:!1,version:"1.2"};vc.defaultTags={"!!":"tag:yaml.org,2002:"};n0.Directives=vc});var Cf=w(bc=>{"use strict";var r0=Ne(),nq=yc();function rq(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function i0(t){let e=new Set;return nq.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function s0(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function iq(t,e){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i||(i=i0(t));let o=s0(e,i);return i.add(o),o},setAnchors:()=>{for(let s of n){let o=r.get(s);if(typeof o=="object"&&o.anchor&&(r0.isScalar(o.node)||r0.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:r}}bc.anchorIsValid=rq;bc.anchorNames=i0;bc.createNodeAnchors=iq;bc.findNewAnchor=s0});var fy=w(o0=>{"use strict";function Tc(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let o=r[i],a=Tc(t,r,String(i),o);a===void 0?delete r[i]:a!==o&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),o=Tc(t,r,i,s);o===void 0?r.delete(i):o!==s&&r.set(i,o)}else if(r instanceof Set)for(let i of Array.from(r)){let s=Tc(t,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let o=Tc(t,r,i,s);o===void 0?delete r[i]:o!==s&&(r[i]=o)}return t.call(e,n,r)}o0.applyReviver=Tc});var zi=w(c0=>{"use strict";var sq=Ne();function a0(t,e,n){if(Array.isArray(t))return t.map((r,i)=>a0(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!sq.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}c0.toJS=a0});var Df=w(u0=>{"use strict";var oq=fy(),l0=Ne(),aq=zi(),hy=class{constructor(e){Object.defineProperty(this,l0.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:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!l0.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=aq.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof s=="function"?oq.applyReviver(s,{"":a},"",a):a}};u0.NodeBase=hy});var Sc=w(f0=>{"use strict";var cq=Cf(),d0=yc(),Af=Ne(),lq=Df(),uq=zi(),py=class extends lq.NodeBase{constructor(e){super(Af.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return d0.visit(e,{Node:(r,i)=>{if(i===this)return d0.visit.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,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=r.get(o);if(a||(uq.toJS(o,null,n),a=r.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Of(i,o,r)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(cq.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 Of(t,e,n){if(Af.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Af.isCollection(e)){let r=0;for(let i of e.items){let s=Of(t,i,n);s>r&&(r=s)}return r}else if(Af.isPair(e)){let r=Of(t,e.key,n),i=Of(t,e.value,n);return Math.max(r,i)}return 1}f0.Alias=py});var Ct=w(my=>{"use strict";var dq=Ne(),fq=Df(),hq=zi(),pq=t=>!t||typeof t!="function"&&typeof t!="object",Wi=class extends fq.NodeBase{constructor(e){super(dq.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:hq.toJS(this.value,e,n)}toString(){return String(this.value)}};Wi.BLOCK_FOLDED="BLOCK_FOLDED";Wi.BLOCK_LITERAL="BLOCK_LITERAL";Wi.PLAIN="PLAIN";Wi.QUOTE_DOUBLE="QUOTE_DOUBLE";Wi.QUOTE_SINGLE="QUOTE_SINGLE";my.Scalar=Wi;my.isScalarValue=pq});var _c=w(p0=>{"use strict";var mq=Sc(),Ps=Ne(),h0=Ct(),gq="tag:yaml.org,2002:";function yq(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}function vq(t,e,n){if(Ps.isDocument(t)&&(t=t.contents),Ps.isNode(t))return t;if(Ps.isPair(t)){let d=n.schema[Ps.MAP].createNode?.(n.schema,null,n);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:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor||(c.anchor=i(t)),new mq.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=gq+e.slice(2));let l=yq(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new h0.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?o[Ps.MAP]:Symbol.iterator in Object(t)?o[Ps.SEQ]:o[Ps.MAP]}s&&(s(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new h0.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}p0.createNode=vq});var xf=w(If=>{"use strict";var bq=_c(),Yr=Ne(),Tq=Df();function gy(t,e,n){let r=n;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]=r,r=o}else r=new Map([[s,r]])}return bq.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var m0=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,yy=class extends Tq.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>Yr.isNode(r)||Yr.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(m0(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(Yr.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,gy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(Yr.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&Yr.isScalar(s)?s.value:s:Yr.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Yr.isPair(n))return!1;let r=n.value;return r==null||e&&Yr.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return Yr.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(Yr.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,gy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};If.Collection=yy;If.collectionFromPath=gy;If.isEmptyPath=m0});var Ec=w(Mf=>{"use strict";var Sq=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function vy(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var _q=(t,e,n)=>t.endsWith(`
|
|
39
|
+
`)?vy(n,e):n.includes(`
|
|
40
40
|
`)?`
|
|
41
|
-
`+
|
|
42
|
-
`)n===
|
|
43
|
-
`&&h!==" "){let
|
|
44
|
-
`&&
|
|
45
|
-
${e}${t.slice(0,C)}`:(n===
|
|
46
|
-
${e}${t.slice(
|
|
47
|
-
`);r=e,i=e+1,s=t[i]}return r}
|
|
48
|
-
`){if(s-o>r)return!0;if(o=s+1,i-o<=r)return!1}return!0}function
|
|
41
|
+
`+vy(n,e):(t.endsWith(" ")?"":" ")+n;Mf.indentComment=vy;Mf.lineComment=_q;Mf.stringifyComment=Sq});var y0=w(kc=>{"use strict";var Eq="flow",by="block",Lf="quoted";function kq(t,e,n="flow",{indentAtStart:r,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 r=="number"&&(r>i-Math.max(2,s)?l.push(0):d=i-r);let f,h,y=!1,p=-1,T=-1,_=-1;n===by&&(p=g0(t,p,e.length),p!==-1&&(d=p+c));for(let b;b=t[p+=1];){if(n===Lf&&b==="\\"){switch(T=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}_=p}if(b===`
|
|
42
|
+
`)n===by&&(p=g0(t,p,e.length)),d=p+e.length+c,f=void 0;else{if(b===" "&&h&&h!==" "&&h!==`
|
|
43
|
+
`&&h!==" "){let k=t[p+1];k&&k!==" "&&k!==`
|
|
44
|
+
`&&k!==" "&&(f=p)}if(p>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===Lf){for(;h===" "||h===" ";)h=b,b=t[p+=1],y=!0;let k=p>_+1?p-2:T-1;if(u[k])return t;l.push(k),u[k]=!0,d=k+c,f=void 0}else y=!0}h=b}if(y&&a&&a(),l.length===0)return t;o&&o();let v=t.slice(0,l[0]);for(let b=0;b<l.length;++b){let k=l[b],C=l[b+1]||t.length;k===0?v=`
|
|
45
|
+
${e}${t.slice(0,C)}`:(n===Lf&&u[k]&&(v+=`${t[k]}\\`),v+=`
|
|
46
|
+
${e}${t.slice(k+1,C)}`)}return v}function g0(t,e,n){let r=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
47
|
+
`);r=e,i=e+1,s=t[i]}return r}kc.FOLD_BLOCK=by;kc.FOLD_FLOW=Eq;kc.FOLD_QUOTED=Lf;kc.foldFlowLines=kq});var Nc=w(v0=>{"use strict";var _r=Ct(),Hi=y0(),qf=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),jf=t=>/^(%|---|\.\.\.)/m.test(t);function wq(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
|
|
48
|
+
`){if(s-o>r)return!0;if(o=s+1,i-o<=r)return!1}return!0}function wc(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(jf(t)?" ":""),o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let u=n.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+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<i)c+=1;else{for(o+=n.slice(a,c)+`
|
|
49
49
|
|
|
50
50
|
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
51
|
-
`,c+=2;o+=s,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:
|
|
52
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return
|
|
53
|
-
${n}`)+"'";return e.implicitKey?r:
|
|
51
|
+
`,c+=2;o+=s,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:Hi.foldFlowLines(o,s,Hi.FOLD_QUOTED,qf(e,!1))}function Ty(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
52
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return wc(t,e);let n=e.indent||(jf(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
53
|
+
${n}`)+"'";return e.implicitKey?r:Hi.foldFlowLines(r,n,Hi.FOLD_FLOW,qf(e,!1))}function Ho(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=wc;else{let i=t.includes('"'),s=t.includes("'");i&&!s?r=Ty:s&&!i?r=wc:r=n?Ty:wc}return r(t,e)}var Sy;try{Sy=new RegExp(`(^|(?<!
|
|
54
54
|
))
|
|
55
55
|
+(?!
|
|
56
|
-
|$)`,"g")}catch{
|
|
56
|
+
|$)`,"g")}catch{Sy=/\n+(?!\n|$)/g}function $f({comment:t,type:e,value:n},r,i,s){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return Ho(n,r);let l=r.indent||(r.forceBlockIndent||jf(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===_r.Scalar.BLOCK_FOLDED?!1:e===_r.Scalar.BLOCK_LITERAL?!0:!wq(n,c,l.length);if(!n)return u?`|
|
|
57
57
|
`:`>
|
|
58
58
|
`;let d,f;for(f=n.length;f>0;--f){let C=n[f-1];if(C!==`
|
|
59
59
|
`&&C!==" "&&C!==" ")break}let h=n.substring(f),y=h.indexOf(`
|
|
60
60
|
`);y===-1?d="-":n===h||y!==h.length-1?(d="+",s&&s()):d="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
|
|
61
|
-
`&&(h=h.slice(0,-1)),h=h.replace(
|
|
62
|
-
`)_=T;else break}let v=n.substring(0,_<T?_+1:T);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let
|
|
63
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,B=
|
|
64
|
-
${l}${q}`}return n=n.replace(/\n+/g,`$&${l}`),`|${
|
|
65
|
-
${l}${v}${n}${h}`}function
|
|
66
|
-
`)||u&&/[[\]{},]/.test(s))return
|
|
67
|
-
`)?
|
|
68
|
-
`))return
|
|
69
|
-
${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(d),{compat:h,tags:y}=e.doc.schema;if(y.some(f)||h?.some(f))return
|
|
70
|
-
${e.indent}${a}`:a}
|
|
71
|
-
${a}:`):(T=`${T}:`,f&&(T+=
|
|
61
|
+
`&&(h=h.slice(0,-1)),h=h.replace(Sy,`$&${l}`));let p=!1,T,_=-1;for(T=0;T<n.length;++T){let C=n[T];if(C===" ")p=!0;else if(C===`
|
|
62
|
+
`)_=T;else break}let v=n.substring(0,_<T?_+1:T);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let k=(p?l?"2":"1":"")+d;if(t&&(k+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let C=n.replace(/\n+/g,`
|
|
63
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,B=qf(r,!0);o!=="folded"&&e!==_r.Scalar.BLOCK_FOLDED&&(B.onOverflow=()=>{L=!0});let q=Hi.foldFlowLines(`${v}${C}${h}`,l,Hi.FOLD_BLOCK,B);if(!L)return`>${k}
|
|
64
|
+
${l}${q}`}return n=n.replace(/\n+/g,`$&${l}`),`|${k}
|
|
65
|
+
${l}${v}${n}${h}`}function Nq(t,e,n,r){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 Ho(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
|
|
67
|
+
`)?Ho(s,e):$f(t,e,n,r);if(!a&&!u&&i!==_r.Scalar.PLAIN&&s.includes(`
|
|
68
|
+
`))return $f(t,e,n,r);if(jf(s)){if(c==="")return e.forceBlockIndent=!0,$f(t,e,n,r);if(a&&c===l)return Ho(s,e)}let d=s.replace(/\n+/g,`$&
|
|
69
|
+
${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(d),{compat:h,tags:y}=e.doc.schema;if(y.some(f)||h?.some(f))return Ho(s,e)}return a?d:Hi.foldFlowLines(d,c,Hi.FOLD_FLOW,qf(e,!1))}function Pq(t,e,n,r){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==_r.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=_r.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case _r.Scalar.BLOCK_FOLDED:case _r.Scalar.BLOCK_LITERAL:return i||s?Ho(o.value,e):$f(o,e,n,r);case _r.Scalar.QUOTE_DOUBLE:return wc(o.value,e);case _r.Scalar.QUOTE_SINGLE:return Ty(o.value,e);case _r.Scalar.PLAIN:return Nq(o,e,n,r);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}v0.stringifyString=Pq});var Pc=w(_y=>{"use strict";var Rq=Cf(),Gi=Ne(),Cq=Ec(),Dq=Nc();function Aq(t,e){let n=Object.assign({blockQuote:!0,commentString:Cq.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),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Oq(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 n,r;if(Gi.isScalar(e)){r=e.value;let i=t.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}n=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??typeof r;throw new Error(`Tag not resolved for ${i} value`)}return n}function Iq(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(Gi.isScalar(t)||Gi.isCollection(t))&&t.anchor;s&&Rq.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let o=t.tag?t.tag:e.default?null:e.tag;return o&&i.push(r.directives.tagString(o)),i.join(" ")}function xq(t,e,n,r){if(Gi.isPair(t))return t.toString(e,n,r);if(Gi.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=Gi.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i||(i=Oq(e.doc.schema.tags,s));let o=Iq(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(s,e,n,r):Gi.isScalar(s)?Dq.stringifyString(s,e,n,r):s.toString(e,n,r);return o?Gi.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
70
|
+
${e.indent}${a}`:a}_y.createStringifyContext=Aq;_y.stringify=xq});var _0=w(S0=>{"use strict";var yi=Ne(),b0=Ct(),T0=Pc(),Rc=Ec();function Mq({key:t,value:e},n,r,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=yi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(yi.isCollection(t)||!yi.isNode(t)&&typeof t=="object"){let B="With simple keys, collection cannot be used as a key value";throw new Error(B)}}let h=!d&&(!t||f&&e==null&&!n.inFlow||yi.isCollection(t)||(yi.isScalar(t)?t.type===b0.Scalar.BLOCK_FOLDED||t.type===b0.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!s),indent:a+c});let y=!1,p=!1,T=T0.stringify(t,n,()=>y=!0,()=>p=!0);if(!h&&!n.inFlow&&T.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return y&&r&&r(),T===""?"?":h?`? ${T}`:T}else if(s&&!d||e==null&&h)return T=`? ${T}`,f&&!y?T+=Rc.lineComment(T,n.indent,l(f)):p&&i&&i(),T;y&&(f=null),h?(f&&(T+=Rc.lineComment(T,n.indent,l(f))),T=`? ${T}
|
|
71
|
+
${a}:`):(T=`${T}:`,f&&(T+=Rc.lineComment(T,n.indent,l(f))));let _,v,b;yi.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(_=!1,v=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!f&&yi.isScalar(e)&&(n.indentAtStart=T.length+1),p=!1,!u&&c.length>=2&&!n.inFlow&&!h&&yi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let k=!1,C=T0.stringify(e,n,()=>k=!0,()=>p=!0),L=" ";if(f||_||v){if(L=_?`
|
|
72
72
|
`:"",v){let B=l(v);L+=`
|
|
73
|
-
${
|
|
73
|
+
${Rc.indentComment(B,n.indent)}`}C===""&&!n.inFlow?L===`
|
|
74
74
|
`&&(L=`
|
|
75
75
|
|
|
76
76
|
`):L+=`
|
|
77
|
-
${n.indent}`}else if(!h&&
|
|
77
|
+
${n.indent}`}else if(!h&&yi.isCollection(e)){let B=C[0],q=C.indexOf(`
|
|
78
78
|
`),ce=q!==-1,ze=n.inFlow??e.flow??e.items.length===0;if(ce||!ze){let Dt=!1;if(ce&&(B==="&"||B==="!")){let ye=C.indexOf(" ");B==="&"&&ye!==-1&&ye<q&&C[ye+1]==="!"&&(ye=C.indexOf(" ",ye+1)),(ye===-1||q<ye)&&(Dt=!0)}Dt||(L=`
|
|
79
79
|
${n.indent}`)}}else(C===""||C[0]===`
|
|
80
|
-
`)&&(L="");return T+=L+C,n.inFlow?
|
|
80
|
+
`)&&(L="");return T+=L+C,n.inFlow?k&&r&&r():b&&!k?T+=Rc.lineComment(T,n.indent,l(b)):p&&i&&i(),T}S0.stringifyPair=Mq});var ky=w(Ey=>{"use strict";function Lq(t,...e){t==="debug"&&console.log(...e)}function $q(t,e){(t==="debug"||t==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Ey.debug=Lq;Ey.warn=$q});var Vf=w(Uf=>{"use strict";var Cc=Ne(),E0=Ct(),Ff="<<",Bf={identify:t=>t===Ff||typeof t=="symbol"&&t.description===Ff,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new E0.Scalar(Symbol(Ff)),{addToJSMap:k0}),stringify:()=>Ff},qq=(t,e)=>(Bf.identify(e)||Cc.isScalar(e)&&(!e.type||e.type===E0.Scalar.PLAIN)&&Bf.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Bf.tag&&n.default);function k0(t,e,n){if(n=t&&Cc.isAlias(n)?n.resolve(t.doc):n,Cc.isSeq(n))for(let r of n.items)wy(t,e,r);else if(Array.isArray(n))for(let r of n)wy(t,e,r);else wy(t,e,n)}function wy(t,e,n){let r=t&&Cc.isAlias(n)?n.resolve(t.doc):n;if(!Cc.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.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}Uf.addMergeToJSMap=k0;Uf.isMergeKey=qq;Uf.merge=Bf});var Py=w(P0=>{"use strict";var jq=ky(),w0=Vf(),Fq=Pc(),N0=Ne(),Ny=zi();function Bq(t,e,{key:n,value:r}){if(N0.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(w0.isMergeKey(t,n))w0.addMergeToJSMap(t,e,r);else{let i=Ny.toJS(n,"",t);if(e instanceof Map)e.set(i,Ny.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let s=Uq(n,i,t),o=Ny.toJS(r,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function Uq(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(N0.isNode(t)&&n?.doc){let r=Fq.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),jq.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}P0.addPairToJSMap=Bq});var Yi=w(Ry=>{"use strict";var R0=_c(),Vq=_0(),zq=Py(),zf=Ne();function Wq(t,e,n){let r=R0.createNode(t,void 0,n),i=R0.createNode(e,void 0,n);return new Wf(r,i)}var Wf=class t{constructor(e,n=null){Object.defineProperty(this,zf.NODE_TYPE,{value:zf.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return zf.isNode(n)&&(n=n.clone(e)),zf.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return zq.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?Vq.stringifyPair(this,e,n,r):JSON.stringify(this)}};Ry.Pair=Wf;Ry.createPair=Wq});var Cy=w(D0=>{"use strict";var Rs=Ne(),C0=Pc(),Hf=Ec();function Hq(t,e,n){return(e.inFlow??t.flow?Yq:Gq)(t,e,n)}function Gq({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:s,type:null}),d=!1,f=[];for(let y=0;y<e.length;++y){let p=e[y],T=null;if(Rs.isNode(p))!d&&p.spaceBefore&&f.push(""),Gf(n,f,p.commentBefore,d),p.comment&&(T=p.comment);else if(Rs.isPair(p)){let v=Rs.isNode(p.key)?p.key:null;v&&(!d&&v.spaceBefore&&f.push(""),Gf(n,f,v.commentBefore,d))}d=!1;let _=C0.stringify(p,u,()=>T=null,()=>d=!0);T&&(_+=Hf.lineComment(_,s,l(T))),d&&T&&(d=!1),f.push(r+_)}let h;if(f.length===0)h=i.start+i.end;else{h=f[0];for(let y=1;y<f.length;++y){let p=f[y];h+=p?`
|
|
81
81
|
${c}${p}`:`
|
|
82
82
|
`}}return t?(h+=`
|
|
83
|
-
`+
|
|
83
|
+
`+Hf.indentComment(l(t),c),a&&a()):d&&o&&o(),h}function Yq({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;r+=s;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let y=0;y<t.length;++y){let p=t[y],T=null;if(Rs.isNode(p))p.spaceBefore&&d.push(""),Gf(e,d,p.commentBefore,!1),p.comment&&(T=p.comment);else if(Rs.isPair(p)){let v=Rs.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&d.push(""),Gf(e,d,v.commentBefore,!1),v.comment&&(l=!0));let b=Rs.isNode(p.value)?p.value:null;b?(b.comment&&(T=b.comment),b.commentBefore&&(l=!0)):p.value==null&&v?.comment&&(T=v.comment)}T&&(l=!0);let _=C0.stringify(p,c,()=>T=null);y<t.length-1&&(_+=","),T&&(_+=Hf.lineComment(_,r,a(T))),!l&&(d.length>u||_.includes(`
|
|
84
84
|
`))&&(l=!0),d.push(_),u=d.length}let{start:f,end:h}=n;if(d.length===0)return f+h;if(!l){let y=d.reduce((p,T)=>p+T.length+2,2);l=e.options.lineWidth>0&&y>e.options.lineWidth}if(l){let y=f;for(let p of d)y+=p?`
|
|
85
85
|
${s}${i}${p}`:`
|
|
86
86
|
`;return`${y}
|
|
87
|
-
${i}${h}`}else return`${f}${o}${d.join(" ")}${o}${h}`}function
|
|
88
|
-
`:" ")}return
|
|
87
|
+
${i}${h}`}else return`${f}${o}${d.join(" ")}${o}${h}`}function Gf({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=Hf.indentComment(e(r),t);n.push(s.trimStart())}}D0.stringifyCollection=Hq});var Xi=w(Ay=>{"use strict";var Kq=Cy(),Xq=Py(),Jq=xf(),Ki=Ne(),Yf=Yi(),Qq=Ct();function Dc(t,e){let n=Ki.isScalar(e)?e.value:e;for(let r of t)if(Ki.isPair(r)&&(r.key===e||r.key===n||Ki.isScalar(r.key)&&r.key.value===n))return r}var Dy=class extends Jq.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ki.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:s}=r,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&o.items.push(Yf.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;Ki.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Yf.Pair(e,e?.value):r=new Yf.Pair(e.key,e.value);let i=Dc(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Ki.isScalar(i.value)&&Qq.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let o=this.items.findIndex(a=>s(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=Dc(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=Dc(this.items,e)?.value;return(!n&&Ki.isScalar(i)?i.value:i)??void 0}has(e){return!!Dc(this.items,e)}set(e,n){this.add(new Yf.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)Xq.addPairToJSMap(n,i,s);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Ki.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})),Kq.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};Ay.YAMLMap=Dy;Ay.findPair=Dc});var Go=w(O0=>{"use strict";var Zq=Ne(),A0=Xi(),ej={collection:"map",default:!0,nodeClass:A0.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Zq.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>A0.YAMLMap.from(t,e,n)};O0.map=ej});var Ji=w(I0=>{"use strict";var tj=_c(),nj=Cy(),rj=xf(),Xf=Ne(),ij=Ct(),sj=zi(),Oy=class extends rj.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Xf.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Kf(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Kf(e);if(typeof r!="number")return;let i=this.items[r];return!n&&Xf.isScalar(i)?i.value:i}has(e){let n=Kf(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=Kf(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];Xf.isScalar(i)&&ij.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(sj.toJS(s,String(i++),n));return r}toString(e,n,r){return e?nj.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof i=="function"){let c=n instanceof Set?a:String(o++);a=i.call(n,c,a)}s.items.push(tj.createNode(a,void 0,r))}}return s}};function Kf(t){let e=Xf.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}I0.YAMLSeq=Oy});var Yo=w(M0=>{"use strict";var oj=Ne(),x0=Ji(),aj={collection:"seq",default:!0,nodeClass:x0.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return oj.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>x0.YAMLSeq.from(t,e,n)};M0.seq=aj});var Ac=w(L0=>{"use strict";var cj=Nc(),lj={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),cj.stringifyString(t,e,n,r)}};L0.string=lj});var Jf=w(j0=>{"use strict";var $0=Ct(),q0={identify:t=>t==null,createNode:()=>new $0.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $0.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&q0.test.test(t)?t:e.options.nullStr};j0.nullTag=q0});var Iy=w(B0=>{"use strict";var uj=Ct(),F0={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new uj.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&F0.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};B0.boolTag=F0});var Ko=w(U0=>{"use strict";function dj({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=JSON.stringify(r);if(!t&&e&&(!n||n==="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}U0.stringifyNumber=dj});var My=w(Qf=>{"use strict";var fj=Ct(),xy=Ko(),hj={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:xy.stringifyNumber},pj={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():xy.stringifyNumber(t)}},mj={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 fj.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:xy.stringifyNumber};Qf.float=mj;Qf.floatExp=pj;Qf.floatNaN=hj});var $y=w(eh=>{"use strict";var V0=Ko(),Zf=t=>typeof t=="bigint"||Number.isInteger(t),Ly=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function z0(t,e,n){let{value:r}=t;return Zf(r)&&r>=0?n+r.toString(e):V0.stringifyNumber(t)}var gj={identify:t=>Zf(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Ly(t,2,8,n),stringify:t=>z0(t,8,"0o")},yj={identify:Zf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Ly(t,0,10,n),stringify:V0.stringifyNumber},vj={identify:t=>Zf(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Ly(t,2,16,n),stringify:t=>z0(t,16,"0x")};eh.int=yj;eh.intHex=vj;eh.intOct=gj});var H0=w(W0=>{"use strict";var bj=Go(),Tj=Jf(),Sj=Yo(),_j=Ac(),Ej=Iy(),qy=My(),jy=$y(),kj=[bj.map,Sj.seq,_j.string,Tj.nullTag,Ej.boolTag,jy.intOct,jy.int,jy.intHex,qy.floatNaN,qy.floatExp,qy.float];W0.schema=kj});var K0=w(Y0=>{"use strict";var wj=Ct(),Nj=Go(),Pj=Yo();function G0(t){return typeof t=="bigint"||Number.isInteger(t)}var th=({value:t})=>JSON.stringify(t),Rj=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:th},{identify:t=>t==null,createNode:()=>new wj.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:G0,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>G0(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}],Cj={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Dj=[Nj.map,Pj.seq].concat(Rj,Cj);Y0.schema=Dj});var By=w(X0=>{"use strict";var Fy=Ct(),Aj=Nc(),Oj={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 n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,i,s){let o=n,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=Fy.Scalar.BLOCK_LITERAL),e!==Fy.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,f=0;d<l;++d,f+=c)u[d]=a.substr(f,c);a=u.join(e===Fy.Scalar.BLOCK_LITERAL?`
|
|
88
|
+
`:" ")}return Aj.stringifyString({comment:t,type:e,value:a},r,i,s)}};X0.binary=Oj});var ih=w(rh=>{"use strict";var nh=Ne(),Uy=Yi(),Ij=Ct(),xj=Ji();function J0(t,e){if(nh.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!nh.isPair(r)){if(nh.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new Uy.Pair(new Ij.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
89
89
|
${i.key.commentBefore}`:r.commentBefore),r.comment){let s=i.value??i.key;s.comment=s.comment?`${r.comment}
|
|
90
|
-
${s.comment}`:r.comment}r=i}t.items[n]=eh.isPair(r)?r:new Fy.Pair(r)}}else e("Expected a sequence for this tag");return t}function W0(t,e,n){let{replacer:r}=n,i=new Pj.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 r=="function"&&(o=r.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(Fy.createPair(a,c,n))}return i}var Rj={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:z0,createNode:W0};th.createPairs=W0;th.pairs=Rj;th.resolvePairs=z0});var Vy=k(Uy=>{"use strict";var H0=Ne(),By=Vi(),Rc=Ki(),Cj=Xi(),G0=nh(),Rs=class t extends Cj.YAMLSeq{constructor(){super(),this.add=Rc.YAMLMap.prototype.add.bind(this),this.delete=Rc.YAMLMap.prototype.delete.bind(this),this.get=Rc.YAMLMap.prototype.get.bind(this),this.has=Rc.YAMLMap.prototype.has.bind(this),this.set=Rc.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,o;if(H0.isPair(i)?(s=By.toJS(i.key,"",n),o=By.toJS(i.value,s,n)):s=By.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,n,r){let i=G0.createPairs(e,n,r),s=new this;return s.items=i.items,s}};Rs.tag="tag:yaml.org,2002:omap";var Dj={collection:"seq",identify:t=>t instanceof Map,nodeClass:Rs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=G0.resolvePairs(t,e),r=[];for(let{key:i}of n.items)H0.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Rs,n)},createNode:(t,e,n)=>Rs.from(t,e,n)};Uy.YAMLOMap=Rs;Uy.omap=Dj});var Q0=k(zy=>{"use strict";var Y0=Ct();function K0({value:t,source:e},n){return e&&(t?X0:J0).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var X0={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 Y0.Scalar(!0),stringify:K0},J0={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 Y0.Scalar(!1),stringify:K0};zy.falseTag=J0;zy.trueTag=X0});var Z0=k(rh=>{"use strict";var Aj=Ct(),Wy=Go(),Oj={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:Wy.stringifyNumber},Ij={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():Wy.stringifyNumber(t)}},xj={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 Aj.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Wy.stringifyNumber};rh.float=xj;rh.floatExp=Ij;rh.floatNaN=Oj});var tC=k(Dc=>{"use strict";var eC=Go(),Cc=t=>typeof t=="bigint"||Number.isInteger(t);function ih(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){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,n);return i==="-"?-1*s:s}function Hy(t,e,n){let{value:r}=t;if(Cc(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return eC.stringifyNumber(t)}var Mj={identify:Cc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>ih(t,2,2,n),stringify:t=>Hy(t,2,"0b")},Lj={identify:Cc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>ih(t,1,8,n),stringify:t=>Hy(t,8,"0")},$j={identify:Cc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>ih(t,0,10,n),stringify:eC.stringifyNumber},qj={identify:Cc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>ih(t,2,16,n),stringify:t=>Hy(t,16,"0x")};Dc.int=$j;Dc.intBin=Mj;Dc.intHex=qj;Dc.intOct=Lj});var Yy=k(Gy=>{"use strict";var ah=Ne(),sh=Gi(),oh=Ki(),Cs=class t extends oh.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;ah.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new sh.Pair(e.key,null):n=new sh.Pair(e,null),oh.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=oh.findPair(this.items,e);return!n&&ah.isPair(r)?ah.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=oh.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new sh.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),s.items.push(sh.createPair(o,null,r));return s}};Cs.tag="tag:yaml.org,2002:set";var jj={collection:"map",identify:t=>t instanceof Set,nodeClass:Cs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Cs.from(t,e,n),resolve(t,e){if(ah.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Cs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Gy.YAMLSet=Cs;Gy.set=jj});var Xy=k(ch=>{"use strict";var Fj=Go();function Ky(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*s:s}function nC(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Fj.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(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))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Bj={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:n})=>Ky(t,n),stringify:nC},Uj={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=>Ky(t,!1),stringify:nC},rC={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(rC.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=Ky(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$/,"")};ch.floatTime=Uj;ch.intTime=Bj;ch.timestamp=rC});var oC=k(sC=>{"use strict";var Vj=Wo(),zj=Kf(),Wj=Ho(),Hj=Pc(),Gj=jy(),iC=Q0(),Jy=Z0(),lh=tC(),Yj=Bf(),Kj=Vy(),Xj=nh(),Jj=Yy(),Qy=Xy(),Qj=[Vj.map,Wj.seq,Hj.string,zj.nullTag,iC.trueTag,iC.falseTag,lh.intBin,lh.intOct,lh.int,lh.intHex,Jy.floatNaN,Jy.floatExp,Jy.float,Gj.binary,Yj.merge,Kj.omap,Xj.pairs,Jj.set,Qy.intTime,Qy.floatTime,Qy.timestamp];sC.schema=Qj});var gC=k(tv=>{"use strict";var uC=Wo(),Zj=Kf(),dC=Ho(),eF=Pc(),tF=Ay(),Zy=Iy(),ev=My(),nF=j0(),rF=U0(),fC=jy(),Ac=Bf(),hC=Vy(),pC=nh(),aC=oC(),mC=Yy(),uh=Xy(),cC=new Map([["core",nF.schema],["failsafe",[uC.map,dC.seq,eF.string]],["json",rF.schema],["yaml11",aC.schema],["yaml-1.1",aC.schema]]),lC={binary:fC.binary,bool:tF.boolTag,float:Zy.float,floatExp:Zy.floatExp,floatNaN:Zy.floatNaN,floatTime:uh.floatTime,int:ev.int,intHex:ev.intHex,intOct:ev.intOct,intTime:uh.intTime,map:uC.map,merge:Ac.merge,null:Zj.nullTag,omap:hC.omap,pairs:pC.pairs,seq:dC.seq,set:mC.set,timestamp:uh.timestamp},iF={"tag:yaml.org,2002:binary":fC.binary,"tag:yaml.org,2002:merge":Ac.merge,"tag:yaml.org,2002:omap":hC.omap,"tag:yaml.org,2002:pairs":pC.pairs,"tag:yaml.org,2002:set":mC.set,"tag:yaml.org,2002:timestamp":uh.timestamp};function sF(t,e,n){let r=cC.get(e);if(r&&!t)return n&&!r.includes(Ac.merge)?r.concat(Ac.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(cC.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 n&&(i=i.concat(Ac.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?lC[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(lC).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},[])}tv.coreKnownTags=iF;tv.getTags=sF});var iv=k(yC=>{"use strict";var nv=Ne(),oF=Wo(),aF=Ho(),cF=Pc(),dh=gC(),lF=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,rv=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?dh.getTags(e,"compat"):e?dh.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?dh.coreKnownTags:{},this.tags=dh.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,nv.MAP,{value:oF.map}),Object.defineProperty(this,nv.SCALAR,{value:cF.string}),Object.defineProperty(this,nv.SEQ,{value:aF.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?lF:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};yC.Schema=rv});var bC=k(vC=>{"use strict";var uF=Ne(),sv=Ec(),Oc=bc();function dF(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=sv.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(Oc.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(uF.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Oc.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=sv.stringify(t.contents,i,()=>a=null,c);a&&(l+=Oc.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(sv.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
|
|
91
|
-
`)?(n.push("..."),n.push(
|
|
90
|
+
${s.comment}`:r.comment}r=i}t.items[n]=nh.isPair(r)?r:new Uy.Pair(r)}}else e("Expected a sequence for this tag");return t}function Q0(t,e,n){let{replacer:r}=n,i=new xj.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 r=="function"&&(o=r.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(Uy.createPair(a,c,n))}return i}var Mj={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:J0,createNode:Q0};rh.createPairs=Q0;rh.pairs=Mj;rh.resolvePairs=J0});var Wy=w(zy=>{"use strict";var Z0=Ne(),Vy=zi(),Oc=Xi(),Lj=Ji(),eC=ih(),Cs=class t extends Lj.YAMLSeq{constructor(){super(),this.add=Oc.YAMLMap.prototype.add.bind(this),this.delete=Oc.YAMLMap.prototype.delete.bind(this),this.get=Oc.YAMLMap.prototype.get.bind(this),this.has=Oc.YAMLMap.prototype.has.bind(this),this.set=Oc.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,o;if(Z0.isPair(i)?(s=Vy.toJS(i.key,"",n),o=Vy.toJS(i.value,s,n)):s=Vy.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,n,r){let i=eC.createPairs(e,n,r),s=new this;return s.items=i.items,s}};Cs.tag="tag:yaml.org,2002:omap";var $j={collection:"seq",identify:t=>t instanceof Map,nodeClass:Cs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=eC.resolvePairs(t,e),r=[];for(let{key:i}of n.items)Z0.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Cs,n)},createNode:(t,e,n)=>Cs.from(t,e,n)};zy.YAMLOMap=Cs;zy.omap=$j});var sC=w(Hy=>{"use strict";var tC=Ct();function nC({value:t,source:e},n){return e&&(t?rC:iC).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var rC={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 tC.Scalar(!0),stringify:nC},iC={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 tC.Scalar(!1),stringify:nC};Hy.falseTag=iC;Hy.trueTag=rC});var oC=w(sh=>{"use strict";var qj=Ct(),Gy=Ko(),jj={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:Gy.stringifyNumber},Fj={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():Gy.stringifyNumber(t)}},Bj={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 qj.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Gy.stringifyNumber};sh.float=Bj;sh.floatExp=Fj;sh.floatNaN=jj});var cC=w(xc=>{"use strict";var aC=Ko(),Ic=t=>typeof t=="bigint"||Number.isInteger(t);function oh(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){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,n);return i==="-"?-1*s:s}function Yy(t,e,n){let{value:r}=t;if(Ic(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return aC.stringifyNumber(t)}var Uj={identify:Ic,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>oh(t,2,2,n),stringify:t=>Yy(t,2,"0b")},Vj={identify:Ic,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>oh(t,1,8,n),stringify:t=>Yy(t,8,"0")},zj={identify:Ic,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>oh(t,0,10,n),stringify:aC.stringifyNumber},Wj={identify:Ic,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>oh(t,2,16,n),stringify:t=>Yy(t,16,"0x")};xc.int=zj;xc.intBin=Uj;xc.intHex=Wj;xc.intOct=Vj});var Xy=w(Ky=>{"use strict";var lh=Ne(),ah=Yi(),ch=Xi(),Ds=class t extends ch.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;lh.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new ah.Pair(e.key,null):n=new ah.Pair(e,null),ch.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=ch.findPair(this.items,e);return!n&&lh.isPair(r)?lh.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=ch.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new ah.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),s.items.push(ah.createPair(o,null,r));return s}};Ds.tag="tag:yaml.org,2002:set";var Hj={collection:"map",identify:t=>t instanceof Set,nodeClass:Ds,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ds.from(t,e,n),resolve(t,e){if(lh.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ds,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Ky.YAMLSet=Ds;Ky.set=Hj});var Qy=w(uh=>{"use strict";var Gj=Ko();function Jy(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*s:s}function lC(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Gj.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(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))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Yj={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:n})=>Jy(t,n),stringify:lC},Kj={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=>Jy(t,!1),stringify:lC},uC={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(uC.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=Jy(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$/,"")};uh.floatTime=Kj;uh.intTime=Yj;uh.timestamp=uC});var hC=w(fC=>{"use strict";var Xj=Go(),Jj=Jf(),Qj=Yo(),Zj=Ac(),eF=By(),dC=sC(),Zy=oC(),dh=cC(),tF=Vf(),nF=Wy(),rF=ih(),iF=Xy(),ev=Qy(),sF=[Xj.map,Qj.seq,Zj.string,Jj.nullTag,dC.trueTag,dC.falseTag,dh.intBin,dh.intOct,dh.int,dh.intHex,Zy.floatNaN,Zy.floatExp,Zy.float,eF.binary,tF.merge,nF.omap,rF.pairs,iF.set,ev.intTime,ev.floatTime,ev.timestamp];fC.schema=sF});var EC=w(rv=>{"use strict";var yC=Go(),oF=Jf(),vC=Yo(),aF=Ac(),cF=Iy(),tv=My(),nv=$y(),lF=H0(),uF=K0(),bC=By(),Mc=Vf(),TC=Wy(),SC=ih(),pC=hC(),_C=Xy(),fh=Qy(),mC=new Map([["core",lF.schema],["failsafe",[yC.map,vC.seq,aF.string]],["json",uF.schema],["yaml11",pC.schema],["yaml-1.1",pC.schema]]),gC={binary:bC.binary,bool:cF.boolTag,float:tv.float,floatExp:tv.floatExp,floatNaN:tv.floatNaN,floatTime:fh.floatTime,int:nv.int,intHex:nv.intHex,intOct:nv.intOct,intTime:fh.intTime,map:yC.map,merge:Mc.merge,null:oF.nullTag,omap:TC.omap,pairs:SC.pairs,seq:vC.seq,set:_C.set,timestamp:fh.timestamp},dF={"tag:yaml.org,2002:binary":bC.binary,"tag:yaml.org,2002:merge":Mc.merge,"tag:yaml.org,2002:omap":TC.omap,"tag:yaml.org,2002:pairs":SC.pairs,"tag:yaml.org,2002:set":_C.set,"tag:yaml.org,2002:timestamp":fh.timestamp};function fF(t,e,n){let r=mC.get(e);if(r&&!t)return n&&!r.includes(Mc.merge)?r.concat(Mc.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(mC.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 n&&(i=i.concat(Mc.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?gC[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(gC).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},[])}rv.coreKnownTags=dF;rv.getTags=fF});var ov=w(kC=>{"use strict";var iv=Ne(),hF=Go(),pF=Yo(),mF=Ac(),hh=EC(),gF=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,sv=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?hh.getTags(e,"compat"):e?hh.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?hh.coreKnownTags:{},this.tags=hh.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,iv.MAP,{value:hF.map}),Object.defineProperty(this,iv.SCALAR,{value:mF.string}),Object.defineProperty(this,iv.SEQ,{value:pF.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?gF:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};kC.Schema=sv});var NC=w(wC=>{"use strict";var yF=Ne(),av=Pc(),Lc=Ec();function vF(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=av.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(Lc.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(yF.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Lc.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=av.stringify(t.contents,i,()=>a=null,c);a&&(l+=Lc.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(av.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
|
|
91
|
+
`)?(n.push("..."),n.push(Lc.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(Lc.indentComment(s(c),"")))}return n.join(`
|
|
92
92
|
`)+`
|
|
93
|
-
`}
|
|
93
|
+
`}wC.stringifyDocument=vF});var $c=w(PC=>{"use strict";var bF=Sc(),Xo=xf(),Qn=Ne(),TF=Yi(),SF=zi(),_F=ov(),EF=NC(),cv=Cf(),kF=fy(),wF=_c(),lv=dy(),uv=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qn.NODE_TYPE,{value:Qn.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new lv.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[Qn.NODE_TYPE]:{value:Qn.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=Qn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Jo(this.contents)&&this.contents.add(e)}addIn(e,n){Jo(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=cv.anchorNames(this);e.anchor=!n||r.has(n)?cv.findNewAnchor(n||"a",r):n}return new bF.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let T=v=>typeof v=="number"||v instanceof String||v instanceof Number,_=n.filter(T).map(String);_.length>0&&(n=n.concat(_)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:h}=cv.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},p=wF.createNode(e,u,y);return a&&Qn.isCollection(p)&&(p.flow=!0),f(),p}createPair(e,n,r={}){let i=this.createNode(e,null,r),s=this.createNode(n,null,r);return new TF.Pair(i,s)}delete(e){return Jo(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Xo.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Jo(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Qn.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Xo.isEmptyPath(e)?!n&&Qn.isScalar(this.contents)?this.contents.value:this.contents:Qn.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Qn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Xo.isEmptyPath(e)?this.contents!==void 0:Qn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Xo.collectionFromPath(this.schema,[e],n):Jo(this.contents)&&this.contents.set(e,n)}setIn(e,n){Xo.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Xo.collectionFromPath(this.schema,Array.from(e),n):Jo(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new lv.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new lv.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=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(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new _F.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=SF.toJS(this.contents,n??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?kF.applyReviver(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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 n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return EF.stringifyDocument(this,e)}};function Jo(t){if(Qn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}PC.Document=uv});var Fc=w(jc=>{"use strict";var qc=class extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},dv=class extends qc{constructor(e,n,r){super("YAMLParseError",e,n,r)}},fv=class extends qc{constructor(e,n,r){super("YAMLWarning",e,n,r)}},NF=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).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"),r>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
94
94
|
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c&&c.line===r&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-s)));let l=" ".repeat(s)+"^".repeat(a);n.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 n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(
|
|
100
|
-
`+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||
|
|
101
|
-
`+b.comment:v.comment=b.comment);let
|
|
102
|
-
`+L.comment:l.comment=L.comment),d=L.end;continue}!o&&n.options.strict
|
|
103
|
-
`+B:q.comment=B,L.comment=L.comment.substring(B.length+1)}}if(!o&&!
|
|
104
|
-
`+ce.comment:q.comment=ce.comment);let Dt=new
|
|
105
|
-
`+T.comment:l.comment=T.comment),l.range=[r.offset,p,T.offset]}else l.range=[r.offset,p,p];return l}
|
|
98
|
+
`}};jc.YAMLError=qc;jc.YAMLParseError=dv;jc.YAMLWarning=fv;jc.prettifyError=NF});var Bc=w(RC=>{"use strict";function PF(t,{flow:e,indicator:n,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",h=!1,y=!1,p=null,T=null,_=null,v=null,b=null,k=null,C=null;for(let q of t)switch(y&&(q.type!=="space"&&q.type!=="newline"&&q.type!=="comma"&&s(q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),p&&(l&&q.type!=="comment"&&q.type!=="newline"&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),q.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&q.source.includes(" ")&&(p=q),u=!0;break;case"comment":{u||s(q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let ce=q.source.substring(1)||" ";d?d+=f+ce:d=ce,f="",l=!1;break}case"newline":l?d?d+=q.source:c=!0:f+=q.source,l=!0,h=!0,(T||_)&&(v=q),u=!0;break;case"anchor":T&&s(q,"MULTIPLE_ANCHORS","A node can have at most one anchor"),q.source.endsWith(":")&&s(q.offset+q.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=q,C===null&&(C=q.offset),l=!1,u=!1,y=!0;break;case"tag":{_&&s(q,"MULTIPLE_TAGS","A node can have at most one tag"),_=q,C===null&&(C=q.offset),l=!1,u=!1,y=!0;break}case n:(T||_)&&s(q,"BAD_PROP_ORDER",`Anchors and tags must be after the ${q.source} indicator`),k&&s(q,"UNEXPECTED_TOKEN",`Unexpected ${q.source} in ${e??"collection"}`),k=q,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){b&&s(q,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=q,l=!1,u=!1;break}default:s(q,"UNEXPECTED_TOKEN",`Unexpected ${q.type} token`),l=!1,u=!1}let L=t[t.length-1],B=L?L.offset+L.source.length:i;return y&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:k,spaceBefore:c,comment:d,hasNewline:h,anchor:T,tag:_,newlineAfterProp:v,end:B,start:C??B}}RC.resolveProps=PF});var ph=w(CC=>{"use strict";function hv(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 n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(hv(e.key)||hv(e.value))return!0}return!1;default:return!0}}CC.containsNewline=hv});var pv=w(DC=>{"use strict";var RF=ph();function CF(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&RF.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}DC.flowIndentCheck=CF});var mv=w(OC=>{"use strict";var AC=Ne();function DF(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,o)=>s===o||AC.isScalar(s)&&AC.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,n))}OC.mapIncludes=DF});var qC=w($C=>{"use strict";var IC=Yi(),AF=Xi(),xC=Bc(),OF=ph(),MC=pv(),IF=mv(),LC="All mapping items must start at the same column";function xF({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??AF.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:f,sep:h,value:y}=u,p=xC.resolveProps(d,{indicator:"explicit-key-ind",next:f??h?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),T=!p.found;if(T){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!==r.indent&&i(c,"BAD_INDENT",LC)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(a.comment?a.comment+=`
|
|
100
|
+
`+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||OF.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(c,"BAD_INDENT",LC);n.atKey=!0;let _=p.end,v=f?t(n,f,p,i):e(n,_,d,null,p,i);n.schema.compat&&MC.flowIndentCheck(r.indent,f,i),n.atKey=!1,IF.mapIncludes(n,a.items,v)&&i(_,"DUPLICATE_KEY","Map keys must be unique");let b=xC.resolveProps(h??[],{indicator:"map-value-ind",next:y,offset:v.range[2],onError:i,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=b.end,b.found){T&&(y?.type==="block-map"&&!b.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<b.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let k=y?t(n,y,b,i):e(n,c,h,null,b,i);n.schema.compat&&MC.flowIndentCheck(r.indent,y,i),c=k.range[2];let C=new IC.Pair(v,k);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{T&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(v.comment?v.comment+=`
|
|
101
|
+
`+b.comment:v.comment=b.comment);let k=new IC.Pair(v);n.options.keepSourceTokens&&(k.srcToken=u),a.items.push(k)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}$C.resolveBlockMap=xF});var FC=w(jC=>{"use strict";var MF=Ji(),LF=Bc(),$F=pv();function qF({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??MF.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let f=LF.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.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 h=d?t(n,d,f,i):e(n,f.end,u,null,f,i);n.schema.compat&&$F.flowIndentCheck(r.indent,d,i),c=h.range[2],a.items.push(h)}return a.range=[r.offset,c,l??c],a}jC.resolveBlockSeq=qF});var Qo=w(BC=>{"use strict";function jF(t,e,n,r){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":{n&&!s&&r(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:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}BC.resolveEnd=jF});var WC=w(zC=>{"use strict";var FF=Ne(),BF=Yi(),UC=Xi(),UF=Ji(),VF=Qo(),VC=Bc(),zF=ph(),WF=mv(),gv="Block collections are not allowed within flow collections",yv=t=>t&&(t.type==="block-map"||t.type==="block-seq");function HF({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?UC.YAMLMap:UF.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let T=0;T<r.items.length;++T){let _=r.items[T],{start:v,key:b,sep:k,value:C}=_,L=VC.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:b??k?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!k&&!C){T===0&&L.comma?i(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):T<r.items.length-1&&i(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),L.comment&&(l.comment?l.comment+=`
|
|
102
|
+
`+L.comment:l.comment=L.comment),d=L.end;continue}!o&&n.options.strict&&zF.containsNewline(b)&&i(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0)L.comma&&i(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(L.comma||i(L.start,"MISSING_CHAR",`Missing , between ${a} items`),L.comment){let B="";e:for(let q of v)switch(q.type){case"comma":case"space":break;case"comment":B=q.source.substring(1);break e;default:break e}if(B){let q=l.items[l.items.length-1];FF.isPair(q)&&(q=q.value??q.key),q.comment?q.comment+=`
|
|
103
|
+
`+B:q.comment=B,L.comment=L.comment.substring(B.length+1)}}if(!o&&!k&&!L.found){let B=C?t(n,C,L,i):e(n,L.end,k,null,L,i);l.items.push(B),d=B.range[2],yv(C)&&i(B.range,"BLOCK_IN_FLOW",gv)}else{n.atKey=!0;let B=L.end,q=b?t(n,b,L,i):e(n,B,v,null,L,i);yv(b)&&i(q.range,"BLOCK_IN_FLOW",gv),n.atKey=!1;let ce=VC.resolveProps(k??[],{flow:a,indicator:"map-value-ind",next:C,offset:q.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(ce.found){if(!o&&!L.found&&n.options.strict){if(k)for(let ye of k){if(ye===ce.found)break;if(ye.type==="newline"){i(ye,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<ce.found.offset-1024&&i(ce.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(ce.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let ze=C?t(n,C,ce,i):ce.found?e(n,ce.end,k,null,ce,i):null;ze?yv(C)&&i(ze.range,"BLOCK_IN_FLOW",gv):ce.comment&&(q.comment?q.comment+=`
|
|
104
|
+
`+ce.comment:q.comment=ce.comment);let Dt=new BF.Pair(q,ze);if(n.options.keepSourceTokens&&(Dt.srcToken=_),o){let ye=l;WF.mapIncludes(n,ye.items,q)&&i(B,"DUPLICATE_KEY","Map keys must be unique"),ye.items.push(Dt)}else{let ye=new UC.YAMLMap(n.schema);ye.flow=!0,ye.items.push(Dt);let Un=(ze??q).range;ye.range=[q.range[0],Un[1],Un[2]],l.items.push(ye)}d=ze?ze.range[2]:ce.end}}let f=o?"}":"]",[h,...y]=r.end,p=d;if(h&&h.source===f)p=h.offset+h.source.length;else{let T=a[0].toUpperCase()+a.substring(1),_=u?`${T} must end with a ${f}`:`${T} in block collection must be sufficiently indented and end with a ${f}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",_),h&&h.source.length!==1&&y.unshift(h)}if(y.length>0){let T=VF.resolveEnd(y,p,n.options.strict,i);T.comment&&(l.comment?l.comment+=`
|
|
105
|
+
`+T.comment:l.comment=T.comment),l.range=[r.offset,p,T.offset]}else l.range=[r.offset,p,p];return l}zC.resolveFlowCollection=HF});var GC=w(HC=>{"use strict";var GF=Ne(),YF=Ct(),KF=Xi(),XF=Ji(),JF=qC(),QF=FC(),ZF=WC();function vv(t,e,n,r,i,s){let o=n.type==="block-map"?JF.resolveBlockMap(t,e,n,r,s):n.type==="block-seq"?QF.resolveBlockSeq(t,e,n,r,s):ZF.resolveFlowCollection(t,e,n,r,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function eB(t,e,n,r,i){let s=r.tag,o=s?e.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=r,y=f&&s?f.offset>s.offset?f:s:f??s;y&&(!h||h.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===KF.YAMLMap.tagName&&a==="map"||o===XF.YAMLSeq.tagName&&a==="seq")return vv(t,e,n,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),vv(t,e,n,i,o)}let l=vv(t,e,n,i,o,c),u=c.resolve?.(l,f=>i(s,"TAG_RESOLVE_FAILED",f),e.options)??l,d=GF.isNode(u)?u:new YF.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}HC.composeCollection=eB});var Tv=w(YC=>{"use strict";var bv=Ct();function tB(t,e,n){let r=e.offset,i=nB(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?bv.Scalar.BLOCK_FOLDED:bv.Scalar.BLOCK_LITERAL,o=e.source?rB(e.source):[],a=o.length;for(let p=o.length-1;p>=0;--p){let T=o[p][1];if(T===""||T==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&o.length>0?`
|
|
106
106
|
`.repeat(Math.max(1,o.length-1)):"",T=r+i.length;return e.source&&(T+=e.source.length),{value:p,type:s,comment:i.comment,range:[r,T,T]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let p=0;p<a;++p){let[T,_]=o[p];if(_===""||_==="\r")i.indent===0&&T.length>c&&(c=T.length);else{T.length<c&&n(l+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=T.length),u=p,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=T.length+_.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>c&&(a=p+1);let d="",f="",h=!1;for(let p=0;p<u;++p)d+=o[p][0].slice(c)+`
|
|
107
|
-
`;for(let p=u;p<a;++p){let[T,_]=o[p];l+=T.length+_.length+1;let v=_[_.length-1]==="\r";if(v&&(_=_.slice(0,-1)),_&&T.length<c){let
|
|
107
|
+
`;for(let p=u;p<a;++p){let[T,_]=o[p];l+=T.length+_.length+1;let v=_[_.length-1]==="\r";if(v&&(_=_.slice(0,-1)),_&&T.length<c){let k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-_.length-(v?2:1),"BAD_INDENT",k),T=""}s===bv.Scalar.BLOCK_LITERAL?(d+=f+T.slice(c)+_,f=`
|
|
108
108
|
`):T.length>c||_[0]===" "?(f===" "?f=`
|
|
109
109
|
`:!h&&f===`
|
|
110
110
|
`&&(f=`
|
|
@@ -117,73 +117,74 @@ ${l}
|
|
|
117
117
|
`+o[p][0].slice(c);d[d.length-1]!==`
|
|
118
118
|
`&&(d+=`
|
|
119
119
|
`);break;default:d+=`
|
|
120
|
-
`}let y=r+i.length+e.source.length;return{value:d,type:s,comment:i.comment,range:[r,y,y]}}function
|
|
120
|
+
`}let y=r+i.length+e.source.length;return{value:d,type:s,comment:i.comment,range:[r,y,y]}}function nB({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(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 h=i[f];if(!a&&(h==="-"||h==="+"))a=h;else{let y=Number(h);!o&&y?o=y:c===-1&&(c=t+f)}}c!==-1&&r(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 h=e[f];switch(h.type){case"space":l=!0;case"newline":d+=h.source.length;break;case"comment":n&&!l&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=h.source.length,u=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),d+=h.source.length;break;default:{let y=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",y);let p=h.source;p&&typeof p=="string"&&(d+=p.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}function rB(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}YC.resolveBlockScalar=tB});var _v=w(XC=>{"use strict";var Sv=Ct(),iB=Qo();function sB(t,e,n){let{offset:r,type:i,source:s,end:o}=t,a,c,l=(f,h,y)=>n(r+f,h,y);switch(i){case"scalar":a=Sv.Scalar.PLAIN,c=oB(s,l);break;case"single-quoted-scalar":a=Sv.Scalar.QUOTE_SINGLE,c=aB(s,l);break;case"double-quoted-scalar":a=Sv.Scalar.QUOTE_DOUBLE,c=cB(s,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,d=iB.resolveEnd(o,u,e,n);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function oB(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),KC(t)}function aB(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),KC(t.slice(1,-1)).replace(/''/g,"'")}function KC(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
121
121
|
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
122
122
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let i=r[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;r=n.exec(t);)r[1]===""?s===`
|
|
123
123
|
`?i+=s:s=`
|
|
124
|
-
`:(i+=s+r[1],s=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),i+s+(r?.[1]??"")}function
|
|
124
|
+
`:(i+=s+r[1],s=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),i+s+(r?.[1]??"")}function cB(t,e){let n="";for(let r=1;r<t.length-1;++r){let i=t[r];if(!(i==="\r"&&t[r+1]===`
|
|
125
125
|
`))if(i===`
|
|
126
|
-
`){let{fold:s,offset:o}=
|
|
126
|
+
`){let{fold:s,offset:o}=lB(t,r);n+=s,r=o}else if(i==="\\"){let s=t[++r],o=uB[s];if(o)n+=o;else if(s===`
|
|
127
127
|
`)for(s=t[r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="\r"&&t[r+1]===`
|
|
128
|
-
`)for(s=t[++r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];n+=
|
|
128
|
+
`)for(s=t[++r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];n+=dB(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){let s=r,o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
|
|
129
129
|
`&&!(o==="\r"&&t[r+2]===`
|
|
130
|
-
`)&&(n+=r>s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function
|
|
130
|
+
`)&&(n+=r>s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function lB(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
|
|
131
131
|
`||r==="\r")&&!(r==="\r"&&t[e+2]!==`
|
|
132
132
|
`);)r===`
|
|
133
133
|
`&&(n+=`
|
|
134
|
-
`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var
|
|
135
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
134
|
+
`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var uB={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 dB(t,e,n,r){let i=t.substr(e,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}XC.resolveFlowScalar=sB});var ZC=w(QC=>{"use strict";var As=Ne(),JC=Ct(),fB=Tv(),hB=_v();function pB(t,e,n,r){let{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?fB.resolveBlockScalar(t,e,r):hB.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[As.SCALAR]:c?l=mB(t.schema,i,c,n,r):e.type==="scalar"?l=gB(t,i,e,r):l=t.schema[As.SCALAR];let u;try{let d=l.resolve(i,f=>r(n??e,"TAG_RESOLVE_FAILED",f),t.options);u=As.isScalar(d)?d:new JC.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);r(n??e,"TAG_RESOLVE_FAILED",f),u=new JC.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 mB(t,e,n,r,i){if(n==="!")return t[As.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===n)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[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[As.SCALAR])}function gB({atKey:t,directives:e,schema:n},r,i,s){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[As.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[As.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}QC.composeScalar=pB});var tD=w(eD=>{"use strict";function yB(t,e,n){if(e){n===null&&(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}eD.emptyScalarPosition=yB});var iD=w(kv=>{"use strict";var vB=Sc(),bB=Ne(),TB=GC(),nD=ZC(),SB=Qo(),_B=tD(),EB={composeNode:rD,composeEmptyNode:Ev};function rD(t,e,n,r){let i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=kB(t,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=nD.composeScalar(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=TB.composeCollection(EB,t,e,n,r),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",d),l=Ev(t,e.offset,void 0,null,n,r),u=!1}}return a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!bB.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),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 Ev(t,e,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:_B.emptyScalarPosition(e,n,r),indent:-1,source:""},d=nD.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 kB({options:t},{offset:e,source:n,end:r},i){let s=new vB.Alias(n.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=SB.resolveEnd(r,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}kv.composeEmptyNode=Ev;kv.composeNode=rD});var aD=w(oD=>{"use strict";var wB=$c(),sD=iD(),NB=Qo(),PB=Bc();function RB(t,e,{offset:n,start:r,value:i,end:s},o){let a=Object.assign({_directives:e},t),c=new wB.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=PB.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,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?sD.composeNode(l,i,u,o):sD.composeEmptyNode(l,u.end,r,null,u,o);let d=c.contents.range[2],f=NB.resolveEnd(s,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}oD.composeDoc=RB});var Nv=w(uD=>{"use strict";var CB=dy(),DB=$c(),Uc=Fc(),cD=Ne(),AB=aD(),OB=Qo();function Vc(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:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function lD(t){let e="",n=!1,r=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":r?`
|
|
136
136
|
|
|
137
137
|
`:`
|
|
138
|
-
`)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var
|
|
139
|
-
${r}`:r;else if(i||e.directives.docStart||!s)e.commentBefore=r;else if(
|
|
138
|
+
`)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var wv=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let o=Vc(n);s?this.warnings.push(new Uc.YAMLWarning(o,r,i)):this.errors.push(new Uc.YAMLParseError(o,r,i))},this.directives=new CB.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=lD(this.prelude);if(r){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
139
|
+
${r}`:r;else if(i||e.directives.docStart||!s)e.commentBefore=r;else if(cD.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];cD.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
|
|
140
140
|
${a}`:r}else{let o=s.commentBefore;s.commentBefore=o?`${r}
|
|
141
|
-
${o}`:r}}n?(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
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new
|
|
141
|
+
${o}`:r}}n?(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:lD(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{let s=Vc(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=AB.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Uc.YAMLParseError(Vc(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Uc.YAMLParseError(Vc(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=OB.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
142
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Uc.YAMLParseError(Vc(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new DB.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};uD.Composer=wv});var hD=w(mh=>{"use strict";var IB=Tv(),xB=_v(),MB=Fc(),dD=Nc();function LB(t,e=!0,n){if(t){let r=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,s,o);else throw new MB.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return xB.resolveFlowScalar(t,e,r);case"block-scalar":return IB.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function $B(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=dD.stringifyString({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
143
143
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
144
144
|
`),u=a.substring(0,l),d=a.substring(l+1)+`
|
|
145
|
-
`,f=[{type:"block-scalar-header",offset:s,indent:r,source:u}];return
|
|
146
|
-
`}),{type:"block-scalar",offset:s,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:c};default:return{type:"scalar",offset:s,indent:r,source:a,end:c}}}function
|
|
145
|
+
`,f=[{type:"block-scalar-header",offset:s,indent:r,source:u}];return fD(f,c)||f.push({type:"newline",offset:-1,indent:r,source:`
|
|
146
|
+
`}),{type:"block-scalar",offset:s,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:c};default:return{type:"scalar",offset:s,indent:r,source:a,end:c}}}function qB(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&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=dD.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">":jB(t,c);break;case'"':Pv(t,c,"double-quoted-scalar");break;case"'":Pv(t,c,"single-quoted-scalar");break;default:Pv(t,c,"scalar")}}function jB(t,e){let n=e.indexOf(`
|
|
147
147
|
`),r=e.substring(0,n),i=e.substring(n+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=r,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:r}];
|
|
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:n,source:e,end:[i]});break}default:{let r="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:n,indent:r,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=r,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:r}];fD(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 fD(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function Pv(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of r)s.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});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:n,source:e,end:[i]});break}default:{let r="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:n,indent:r,source:e,end:i})}}}mh.createScalarToken=$B;mh.resolveAsScalar=LB;mh.setScalarValue=qB});var mD=w(pD=>{"use strict";var FB=t=>"type"in t?yh(t):gh(t);function yh(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=yh(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=gh(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=gh(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=gh(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function gh({start:t,key:e,sep:n,value:r}){let i="";for(let s of t)i+=s.source;if(e&&(i+=yh(e)),n)for(let s of n)i+=s.source;return r&&(i+=yh(r)),i}pD.stringify=FB});var bD=w(vD=>{"use strict";var Rv=Symbol("break visit"),BB=Symbol("skip children"),gD=Symbol("remove item");function Os(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),yD(Object.freeze([]),t,e)}Os.BREAK=Rv;Os.SKIP=BB;Os.REMOVE=gD;Os.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};Os.parentCollection=(t,e)=>{let n=Os.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function yD(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;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=yD(Object.freeze(t.concat([[i,o]])),s.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Rv)return Rv;a===gD&&(s.items.splice(o,1),o-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}vD.visit=Os});var vh=w(Rn=>{"use strict";var Cv=hD(),UB=mD(),VB=bD(),Dv="\uFEFF",Av="",Ov="",Iv="",zB=t=>!!t&&"items"in t,WB=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function HB(t){switch(t){case Dv:return"<BOM>";case Av:return"<DOC>";case Ov:return"<FLOW_END>";case Iv:return"<SCALAR>";default:return JSON.stringify(t)}}function GB(t){switch(t){case Dv:return"byte-order-mark";case Av:return"doc-mode";case Ov:return"flow-error-end";case Iv: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}Rn.createScalarToken=
|
|
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}Rn.createScalarToken=Cv.createScalarToken;Rn.resolveAsScalar=Cv.resolveAsScalar;Rn.setScalarValue=Cv.setScalarValue;Rn.stringify=UB.stringify;Rn.visit=VB.visit;Rn.BOM=Dv;Rn.DOCUMENT=Av;Rn.FLOW_END=Ov;Rn.SCALAR=Iv;Rn.isCollection=zB;Rn.isScalar=WB;Rn.prettyToken=HB;Rn.tokenType=GB});var Lv=w(SD=>{"use strict";var zc=vh();function Er(t){switch(t){case void 0:case" ":case`
|
|
153
|
+
`:case"\r":case" ":return!0;default:return!1}}var TD=new Set("0123456789ABCDEFabcdef"),YB=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),bh=new Set(",[]{}"),KB=new Set(` ,[]{}
|
|
154
|
+
\r `),xv=t=>!t||KB.has(t),Mv=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,n=!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=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
155
155
|
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
156
156
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let i=this.buffer[r+e+1];if(i===`
|
|
157
157
|
`||!i&&!this.atEnd)return e+r+1}return n===`
|
|
158
|
-
`||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&
|
|
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
|
+
`||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&Er(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]===zc.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let s=e[r-1];if(s===" "||s===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield zc.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 n=this.peek(3);if((n==="---"||n==="...")&&Er(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Er(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Er(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(xv),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&Er(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield zc.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(xv),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||Er(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),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),i=r.indexOf(`
|
|
160
160
|
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
|
|
161
|
-
`,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>
|
|
161
|
+
`,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Er(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
|
|
162
162
|
`:e=s,n=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(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n: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(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
165
165
|
`;)r=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+n>a)e=s;else break}while(!0);return yield
|
|
166
|
+
`&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield zc.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(Er(s)||e&&bh.has(s))break;n=r}else if(Er(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
|
|
167
167
|
`?(r+=1,i=`
|
|
168
|
-
`,s=this.buffer[r+1]):n=r),s==="#"||e&&
|
|
169
|
-
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&
|
|
168
|
+
`,s=this.buffer[r+1]):n=r),s==="#"||e&&bh.has(s))break;if(i===`
|
|
169
|
+
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&bh.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield zc.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(xv))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,n=this.charAt(1);if(Er(n)||e&&bh.has(n))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,n=this.buffer[e];for(;!Er(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(YB.has(n))n=this.buffer[++e];else if(n==="%"&&TD.has(this.buffer[e+1])&&TD.has(this.buffer[e+2]))n=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 n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};
|
|
171
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};SD.Lexer=Mv});var qv=w(_D=>{"use strict";var $v=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<e?n=s+1:r=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}};_D.LineCounter=$v});var Fv=w(PD=>{"use strict";var ED=vh(),XB=Lv();function Is(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function kD(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 ND(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 Th(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 Zo(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 wD(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Is(e.start,"explicit-key-ind")&&!Is(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ND(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 jv=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 XB.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",ED.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=ED.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&wD(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&kD(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.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":{kD(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 n=this.startBlockValue(e);n?this.stack.push(n):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 n=Th(this.peek(2)),r=Zo(n),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:r,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 n=this.source.indexOf(`
|
|
172
172
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
173
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let c=n.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=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(
|
|
173
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let c=n.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=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Is(n.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(ND(n.key)&&!Is(n.sep,"newline")){let o=Zo(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Is(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Zo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Is(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{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||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){r&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Is(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=Th(r),s=Zo(i);wD(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 n=this.source.indexOf(`
|
|
174
174
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
175
|
-
`,n)+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 n=vh(e),r=Jo(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=vh(e),r=Jo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};TD.Parser=$v});var kD=k(Uc=>{"use strict";var SD=wv(),zB=Ic(),Bc=Lc(),WB=_y(),HB=Ne(),GB=Lv(),_D=qv();function ED(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new GB.LineCounter||null,prettyErrors:e}}function YB(t,e={}){let{lineCounter:n,prettyErrors:r}=ED(e),i=new _D.Parser(n?.addNewLine),s=new SD.Composer(e),o=Array.from(s.compose(i.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(Bc.prettifyError(t,n)),a.warnings.forEach(Bc.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function wD(t,e={}){let{lineCounter:n,prettyErrors:r}=ED(e),i=new _D.Parser(n?.addNewLine),s=new SD.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 Bc.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Bc.prettifyError(t,n)),o.warnings.forEach(Bc.prettifyError(t,n))),o}function KB(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=wD(t,n);if(!i)return null;if(i.warnings.forEach(s=>WB.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:r},n))}function XB(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return HB.isDocument(t)&&!r?t.toString(n):new zB.Document(t,r,n).toString(n)}Uc.parse=KB;Uc.parseAllDocuments=YB;Uc.parseDocument=wD;Uc.stringify=XB});var Fv=k(Fe=>{"use strict";var JB=wv(),QB=Ic(),ZB=iv(),jv=Lc(),eU=yc(),Ji=Ne(),tU=Gi(),nU=Ct(),rU=Ki(),iU=Xi(),sU=gh(),oU=xv(),aU=Lv(),cU=qv(),bh=kD(),ND=hc();Fe.Composer=JB.Composer;Fe.Document=QB.Document;Fe.Schema=ZB.Schema;Fe.YAMLError=jv.YAMLError;Fe.YAMLParseError=jv.YAMLParseError;Fe.YAMLWarning=jv.YAMLWarning;Fe.Alias=eU.Alias;Fe.isAlias=Ji.isAlias;Fe.isCollection=Ji.isCollection;Fe.isDocument=Ji.isDocument;Fe.isMap=Ji.isMap;Fe.isNode=Ji.isNode;Fe.isPair=Ji.isPair;Fe.isScalar=Ji.isScalar;Fe.isSeq=Ji.isSeq;Fe.Pair=tU.Pair;Fe.Scalar=nU.Scalar;Fe.YAMLMap=rU.YAMLMap;Fe.YAMLSeq=iU.YAMLSeq;Fe.CST=sU;Fe.Lexer=oU.Lexer;Fe.LineCounter=aU.LineCounter;Fe.Parser=cU.Parser;Fe.parse=bh.parse;Fe.parseAllDocuments=bh.parseAllDocuments;Fe.parseDocument=bh.parseDocument;Fe.stringify=bh.stringify;Fe.visit=ND.visit;Fe.visitAsync=ND.visitAsync});var AD=k((vie,DD)=>{"use strict";DD.exports=RD;function RD(t,e,n){t instanceof RegExp&&(t=PD(t,n)),e instanceof RegExp&&(e=PD(e,n));var r=CD(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function PD(t,e){var n=e.match(t);return n?n[0]:null}RD.range=CD;function CD(t,e,n){var r,i,s,o,a,c=n.indexOf(t),l=n.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(r=[],s=n.length;u>=0&&!a;)u==c?(r.push(u),c=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),l]:(i=r.pop(),i<s&&(s=i,o=l),l=n.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[s,o])}return a}});var jD=k((bie,qD)=>{var OD=AD();qD.exports=dU;var ID="\0SLASH"+Math.random()+"\0",xD="\0OPEN"+Math.random()+"\0",Uv="\0CLOSE"+Math.random()+"\0",MD="\0COMMA"+Math.random()+"\0",LD="\0PERIOD"+Math.random()+"\0";function Bv(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function lU(t){return t.split("\\\\").join(ID).split("\\{").join(xD).split("\\}").join(Uv).split("\\,").join(MD).split("\\.").join(LD)}function uU(t){return t.split(ID).join("\\").split(xD).join("{").split(Uv).join("}").split(MD).join(",").split(LD).join(".")}function $D(t){if(!t)return[""];var e=[],n=OD("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=$D(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function dU(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),Vc(lU(t),!0).map(uU)):[]}function fU(t){return"{"+t+"}"}function hU(t){return/^-?0\d/.test(t)}function pU(t,e){return t<=e}function mU(t,e){return t>=e}function Vc(t,e){var n=[],r=OD("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?Vc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=c||l,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+Uv+r.post,Vc(t)):[t];var f;if(u)f=r.body.split(/\.\./);else if(f=$D(r.body),f.length===1&&(f=Vc(f[0],!1).map(fU),f.length===1))return s.map(function(ze){return r.pre+f[0]+ze});var h;if(u){var y=Bv(f[0]),p=Bv(f[1]),T=Math.max(f[0].length,f[1].length),_=f.length==3?Math.abs(Bv(f[2])):1,v=pU,b=p<y;b&&(_*=-1,v=mU);var w=f.some(hU);h=[];for(var C=y;v(C,p);C+=_){var L;if(l)L=String.fromCharCode(C),L==="\\"&&(L="");else if(L=String(C),w){var B=T-L.length;if(B>0){var q=new Array(B+1).join("0");C<0?L="-"+q+L.slice(1):L=q+L}}h.push(L)}}else{h=[];for(var ce=0;ce<f.length;ce++)h.push.apply(h,Vc(f[ce],!1))}for(var ce=0;ce<h.length;ce++)for(var o=0;o<s.length;o++){var a=i+h[ce]+s[o];(!e||u||a)&&n.push(a)}}return n}});var al=k(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.regexpCode=Ce.getEsmExportName=Ce.getProperty=Ce.safeStringify=Ce.stringify=Ce.strConcat=Ce.addCodeArg=Ce.str=Ce._=Ce.nil=Ce._Code=Ce.Name=Ce.IDENTIFIER=Ce._CodeOrName=void 0;var sl=class{};Ce._CodeOrName=sl;Ce.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ls=class extends sl{constructor(e){if(super(),!Ce.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}}};Ce.Name=Ls;var er=class extends sl{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((n,r)=>`${n}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,r)=>(r instanceof Ls&&(n[r.str]=(n[r.str]||0)+1),n),{})}};Ce._Code=er;Ce.nil=new er("");function NA(t,...e){let n=[t[0]],r=0;for(;r<e.length;)ab(n,e[r]),n.push(t[++r]);return new er(n)}Ce._=NA;var ob=new er("+");function PA(t,...e){let n=[ol(t[0])],r=0;for(;r<e.length;)n.push(ob),ab(n,e[r]),n.push(ob,ol(t[++r]));return EV(n),new er(n)}Ce.str=PA;function ab(t,e){e instanceof er?t.push(...e._items):e instanceof Ls?t.push(e):t.push(NV(e))}Ce.addCodeArg=ab;function EV(t){let e=1;for(;e<t.length-1;){if(t[e]===ob){let n=wV(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function wV(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ls||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 Ls))return`"${t}${e.slice(1)}`}function kV(t,e){return e.emptyStr()?t:t.emptyStr()?e:PA`${t}${e}`}Ce.strConcat=kV;function NV(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:ol(Array.isArray(t)?t.join(","):t)}function PV(t){return new er(ol(t))}Ce.stringify=PV;function ol(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ce.safeStringify=ol;function RV(t){return typeof t=="string"&&Ce.IDENTIFIER.test(t)?new er(`.${t}`):NA`[${t}]`}Ce.getProperty=RV;function CV(t){if(typeof t=="string"&&Ce.IDENTIFIER.test(t))return new er(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ce.getEsmExportName=CV;function DV(t){return new er(t.toString())}Ce.regexpCode=DV});var ub=k(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ValueScope=Dn.ValueScopeName=Dn.Scope=Dn.varKinds=Dn.UsedValueState=void 0;var Cn=al(),cb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},jh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(jh||(Dn.UsedValueState=jh={}));Dn.varKinds={const:new Cn.Name("const"),let:new Cn.Name("let"),var:new Cn.Name("var")};var Fh=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof Cn.Name?e:this.name(e)}name(e){return new Cn.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,r;if(!((r=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||r===void 0)&&r.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Dn.Scope=Fh;var Bh=class extends Cn.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,Cn._)`.${new Cn.Name(n)}[${r}]`}};Dn.ValueScopeName=Bh;var AV=(0,Cn._)`\n`,lb=class extends Fh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?AV:Cn.nil}}get(){return this._scope}name(e){return new Bh(e,this._newName(e))}value(e,n){var r;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(r=n.key)!==null&&r!==void 0?r:n.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]=n.ref,i.setValue(n,{property:s,itemIndex:l}),i}getValue(e,n){let r=this._values[e];if(r)return r.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,Cn._)`${e}${r.scopePath}`})}scopeCode(e=this._values,n,r){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},n,r)}_reduceValues(e,n,r={},i){let s=Cn.nil;for(let o in e){let a=e[o];if(!a)continue;let c=r[o]=r[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,jh.Started);let u=n(l);if(u){let d=this.opts.es5?Dn.varKinds.var:Dn.varKinds.const;s=(0,Cn._)`${s}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))s=(0,Cn._)`${s}${u}${this.opts._n}`;else throw new cb(l);c.set(l,jh.Completed)})}return s}};Dn.ValueScope=lb});var fe=k(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.or=me.and=me.not=me.CodeGen=me.operators=me.varKinds=me.ValueScopeName=me.ValueScope=me.Scope=me.Name=me.regexpCode=me.stringify=me.getProperty=me.nil=me.strConcat=me.str=me._=void 0;var Ee=al(),Nr=ub(),ns=al();Object.defineProperty(me,"_",{enumerable:!0,get:function(){return ns._}});Object.defineProperty(me,"str",{enumerable:!0,get:function(){return ns.str}});Object.defineProperty(me,"strConcat",{enumerable:!0,get:function(){return ns.strConcat}});Object.defineProperty(me,"nil",{enumerable:!0,get:function(){return ns.nil}});Object.defineProperty(me,"getProperty",{enumerable:!0,get:function(){return ns.getProperty}});Object.defineProperty(me,"stringify",{enumerable:!0,get:function(){return ns.stringify}});Object.defineProperty(me,"regexpCode",{enumerable:!0,get:function(){return ns.regexpCode}});Object.defineProperty(me,"Name",{enumerable:!0,get:function(){return ns.Name}});var Wh=ub();Object.defineProperty(me,"Scope",{enumerable:!0,get:function(){return Wh.Scope}});Object.defineProperty(me,"ValueScope",{enumerable:!0,get:function(){return Wh.ValueScope}});Object.defineProperty(me,"ValueScopeName",{enumerable:!0,get:function(){return Wh.ValueScopeName}});Object.defineProperty(me,"varKinds",{enumerable:!0,get:function(){return Wh.varKinds}});me.operators={GT:new Ee._Code(">"),GTE:new Ee._Code(">="),LT:new Ee._Code("<"),LTE:new Ee._Code("<="),EQ:new Ee._Code("==="),NEQ:new Ee._Code("!=="),NOT:new Ee._Code("!"),OR:new Ee._Code("||"),AND:new Ee._Code("&&"),ADD:new Ee._Code("+")};var bi=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},db=class extends bi{constructor(e,n,r){super(),this.varKind=e,this.name=n,this.rhs=r}render({es5:e,_n:n}){let r=e?Nr.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${i};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=ua(this.rhs,e,n)),this}get names(){return this.rhs instanceof Ee._CodeOrName?this.rhs.names:{}}},Uh=class extends bi{constructor(e,n,r){super(),this.lhs=e,this.rhs=n,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof Ee.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ua(this.rhs,e,n),this}get names(){let e=this.lhs instanceof Ee.Name?{}:{...this.lhs.names};return zh(e,this.rhs)}},fb=class extends Uh{constructor(e,n,r,i){super(e,r,i),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},hb=class extends bi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},pb=class extends bi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},mb=class extends bi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},gb=class extends bi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=ua(this.code,e,n),this}get names(){return this.code instanceof Ee._CodeOrName?this.code.names:{}}},cl=class extends bi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,r)=>n+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let r=e[n].optimizeNodes();Array.isArray(r)?e.splice(n,1,...r):r?e[n]=r:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:r}=this,i=r.length;for(;i--;){let s=r[i];s.optimizeNames(e,n)||(OV(e,s.names),r.splice(i,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>js(e,n.names),{})}},Ti=class extends cl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},yb=class extends cl{},la=class extends Ti{};la.kind="else";var $s=class t extends Ti{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new la(r):r}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(RA(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=ua(this.condition,e,n),this}get names(){let e=super.names;return zh(e,this.condition),this.else&&js(e,this.else.names),e}};$s.kind="if";var qs=class extends Ti{};qs.kind="for";var vb=class extends qs{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=ua(this.iteration,e,n),this}get names(){return js(super.names,this.iteration.names)}},bb=class extends qs{constructor(e,n,r,i){super(),this.varKind=e,this.name=n,this.from=r,this.to=i}render(e){let n=e.es5?Nr.varKinds.var:this.varKind,{name:r,from:i,to:s}=this;return`for(${n} ${r}=${i}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=zh(super.names,this.from);return zh(e,this.to)}},Vh=class extends qs{constructor(e,n,r,i){super(),this.loop=e,this.varKind=n,this.name=r,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=ua(this.iterable,e,n),this}get names(){return js(super.names,this.iterable.names)}},ll=class extends Ti{constructor(e,n,r){super(),this.name=e,this.args=n,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};ll.kind="func";var ul=class extends cl{render(e){return"return "+super.render(e)}};ul.kind="return";var Tb=class extends Ti{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var r,i;return super.optimizeNames(e,n),(r=this.catch)===null||r===void 0||r.optimizeNames(e,n),(i=this.finally)===null||i===void 0||i.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&js(e,this.catch.names),this.finally&&js(e,this.finally.names),e}},dl=class extends Ti{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};dl.kind="catch";var fl=class extends Ti{render(e){return"finally"+super.render(e)}};fl.kind="finally";var Sb=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
176
|
-
`:""},this._extScope=e,this._scope=new Nr.Scope({parent:e}),this._nodes=[new yb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let r=this._extScope.value(e,n);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,r,i){let s=this._scope.toName(n);return r!==void 0&&i&&(this._constants[s.str]=r),this._leafNode(new db(e,s,r)),s}const(e,n,r){return this._def(Nr.varKinds.const,e,n,r)}let(e,n,r){return this._def(Nr.varKinds.let,e,n,r)}var(e,n,r){return this._def(Nr.varKinds.var,e,n,r)}assign(e,n,r){return this._leafNode(new Uh(e,n,r))}add(e,n){return this._leafNode(new fb(e,me.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==Ee.nil&&this._leafNode(new gb(e)),this}object(...e){let n=["{"];for(let[r,i]of e)n.length>1&&n.push(","),n.push(r),(r!==i||this.opts.es5)&&(n.push(":"),(0,Ee.addCodeArg)(n,i));return n.push("}"),new Ee._Code(n)}if(e,n,r){if(this._blockNode(new $s(e)),n&&r)this.code(n).else().code(r).endIf();else if(n)this.code(n).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new $s(e))}else(){return this._elseNode(new la)}endIf(){return this._endBlockNode($s,la)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new vb(e),n)}forRange(e,n,r,i,s=this.opts.es5?Nr.varKinds.var:Nr.varKinds.let){let o=this._scope.toName(e);return this._for(new bb(s,o,n,r),()=>i(o))}forOf(e,n,r,i=Nr.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=n instanceof Ee.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Ee._)`${o}.length`,a=>{this.var(s,(0,Ee._)`${o}[${a}]`),r(s)})}return this._for(new Vh("of",i,s,n),()=>r(s))}forIn(e,n,r,i=this.opts.es5?Nr.varKinds.var:Nr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ee._)`Object.keys(${n})`,r);let s=this._scope.toName(e);return this._for(new Vh("in",i,s,n),()=>r(s))}endFor(){return this._endBlockNode(qs)}label(e){return this._leafNode(new hb(e))}break(e){return this._leafNode(new pb(e))}return(e){let n=new ul;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ul)}try(e,n,r){if(!n&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Tb;if(this._blockNode(i),this.code(e),n){let s=this.name("e");this._currNode=i.catch=new dl(s),n(s)}return r&&(this._currNode=i.finally=new fl,this.code(r)),this._endBlockNode(dl,fl)}throw(e){return this._leafNode(new mb(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-n;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=Ee.nil,r,i){return this._blockNode(new ll(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(ll)}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,n){let r=this._currNode;if(r instanceof e||n&&r instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof $s))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};me.CodeGen=Sb;function js(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function zh(t,e){return e instanceof Ee._CodeOrName?js(t,e.names):t}function ua(t,e,n){if(t instanceof Ee.Name)return r(t);if(!i(t))return t;return new Ee._Code(t._items.reduce((s,o)=>(o instanceof Ee.Name&&(o=r(o)),o instanceof Ee._Code?s.push(...o._items):s.push(o),s),[]));function r(s){let o=n[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ee._Code&&s._items.some(o=>o instanceof Ee.Name&&e[o.str]===1&&n[o.str]!==void 0)}}function OV(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function RA(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ee._)`!${_b(t)}`}me.not=RA;var IV=CA(me.operators.AND);function xV(...t){return t.reduce(IV)}me.and=xV;var MV=CA(me.operators.OR);function LV(...t){return t.reduce(MV)}me.or=LV;function CA(t){return(e,n)=>e===Ee.nil?n:n===Ee.nil?e:(0,Ee._)`${_b(e)} ${t} ${_b(n)}`}function _b(t){return t instanceof Ee.Name?t:(0,Ee._)`(${t})`}});var be=k(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.checkStrictMode=ge.getErrorPath=ge.Type=ge.useFunc=ge.setEvaluated=ge.evaluatedPropsToName=ge.mergeEvaluated=ge.eachItem=ge.unescapeJsonPointer=ge.escapeJsonPointer=ge.escapeFragment=ge.unescapeFragment=ge.schemaRefOrVal=ge.schemaHasRulesButRef=ge.schemaHasRules=ge.checkUnknownRules=ge.alwaysValidSchema=ge.toHash=void 0;var Je=fe(),$V=al();function qV(t){let e={};for(let n of t)e[n]=!0;return e}ge.toHash=qV;function jV(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(OA(t,e),!IA(e,t.self.RULES.all))}ge.alwaysValidSchema=jV;function OA(t,e=t.schema){let{opts:n,self:r}=t;if(!n.strictSchema||typeof e=="boolean")return;let i=r.RULES.keywords;for(let s in e)i[s]||LA(t,`unknown keyword: "${s}"`)}ge.checkUnknownRules=OA;function IA(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}ge.schemaHasRules=IA;function FV(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}ge.schemaHasRulesButRef=FV;function BV({topSchemaRef:t,schemaPath:e},n,r,i){if(!i){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Je._)`${n}`}return(0,Je._)`${t}${e}${(0,Je.getProperty)(r)}`}ge.schemaRefOrVal=BV;function UV(t){return xA(decodeURIComponent(t))}ge.unescapeFragment=UV;function VV(t){return encodeURIComponent(wb(t))}ge.escapeFragment=VV;function wb(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}ge.escapeJsonPointer=wb;function xA(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}ge.unescapeJsonPointer=xA;function zV(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}ge.eachItem=zV;function DA({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:r}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof Je.Name?(s instanceof Je.Name?t(i,s,o):e(i,s,o),o):s instanceof Je.Name?(e(i,o,s),s):n(s,o);return a===Je.Name&&!(c instanceof Je.Name)?r(i,c):c}}ge.mergeEvaluated={props:DA({mergeNames:(t,e,n)=>t.if((0,Je._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Je._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Je._)`${n} || {}`).code((0,Je._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,Je._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Je._)`${n} || {}`),kb(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:MA}),items:DA({mergeNames:(t,e,n)=>t.if((0,Je._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Je._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,Je._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Je._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function MA(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Je._)`{}`);return e!==void 0&&kb(t,n,e),n}ge.evaluatedPropsToName=MA;function kb(t,e,n){Object.keys(n).forEach(r=>t.assign((0,Je._)`${e}${(0,Je.getProperty)(r)}`,!0))}ge.setEvaluated=kb;var AA={};function WV(t,e){return t.scopeValue("func",{ref:e,code:AA[e.code]||(AA[e.code]=new $V._Code(e.code))})}ge.useFunc=WV;var Eb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Eb||(ge.Type=Eb={}));function HV(t,e,n){if(t instanceof Je.Name){let r=e===Eb.Num;return n?r?(0,Je._)`"[" + ${t} + "]"`:(0,Je._)`"['" + ${t} + "']"`:r?(0,Je._)`"/" + ${t}`:(0,Je._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Je.getProperty)(t).toString():"/"+wb(t)}ge.getErrorPath=HV;function LA(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}ge.checkStrictMode=LA});var tr=k(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var on=fe(),GV={data:new on.Name("data"),valCxt:new on.Name("valCxt"),instancePath:new on.Name("instancePath"),parentData:new on.Name("parentData"),parentDataProperty:new on.Name("parentDataProperty"),rootData:new on.Name("rootData"),dynamicAnchors:new on.Name("dynamicAnchors"),vErrors:new on.Name("vErrors"),errors:new on.Name("errors"),this:new on.Name("this"),self:new on.Name("self"),scope:new on.Name("scope"),json:new on.Name("json"),jsonPos:new on.Name("jsonPos"),jsonLen:new on.Name("jsonLen"),jsonPart:new on.Name("jsonPart")};Nb.default=GV});var hl=k(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.extendErrors=an.resetErrorsCount=an.reportExtraError=an.reportError=an.keyword$DataError=an.keywordError=void 0;var Pe=fe(),Hh=be(),pn=tr();an.keywordError={message:({keyword:t})=>(0,Pe.str)`must pass "${t}" keyword validation`};an.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Pe.str)`"${t}" keyword must be ${e} ($data)`:(0,Pe.str)`"${t}" keyword is invalid ($data)`};function YV(t,e=an.keywordError,n,r){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,c=jA(t,e,n);r??(o||a)?$A(s,c):qA(i,(0,Pe._)`[${c}]`)}an.reportError=YV;function KV(t,e=an.keywordError,n){let{it:r}=t,{gen:i,compositeRule:s,allErrors:o}=r,a=jA(t,e,n);$A(i,a),s||o||qA(r,pn.default.vErrors)}an.reportExtraError=KV;function XV(t,e){t.assign(pn.default.errors,e),t.if((0,Pe._)`${pn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Pe._)`${pn.default.vErrors}.length`,e),()=>t.assign(pn.default.vErrors,null)))}an.resetErrorsCount=XV;function JV({gen:t,keyword:e,schemaValue:n,data:r,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,pn.default.errors,a=>{t.const(o,(0,Pe._)`${pn.default.vErrors}[${a}]`),t.if((0,Pe._)`${o}.instancePath === undefined`,()=>t.assign((0,Pe._)`${o}.instancePath`,(0,Pe.strConcat)(pn.default.instancePath,s.errorPath))),t.assign((0,Pe._)`${o}.schemaPath`,(0,Pe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Pe._)`${o}.schema`,n),t.assign((0,Pe._)`${o}.data`,r))})}an.extendErrors=JV;function $A(t,e){let n=t.const("err",e);t.if((0,Pe._)`${pn.default.vErrors} === null`,()=>t.assign(pn.default.vErrors,(0,Pe._)`[${n}]`),(0,Pe._)`${pn.default.vErrors}.push(${n})`),t.code((0,Pe._)`${pn.default.errors}++`)}function qA(t,e){let{gen:n,validateName:r,schemaEnv:i}=t;i.$async?n.throw((0,Pe._)`new ${t.ValidationError}(${e})`):(n.assign((0,Pe._)`${r}.errors`,e),n.return(!1))}var Fs={keyword:new Pe.Name("keyword"),schemaPath:new Pe.Name("schemaPath"),params:new Pe.Name("params"),propertyName:new Pe.Name("propertyName"),message:new Pe.Name("message"),schema:new Pe.Name("schema"),parentSchema:new Pe.Name("parentSchema")};function jA(t,e,n){let{createErrors:r}=t.it;return r===!1?(0,Pe._)`{}`:QV(t,e,n)}function QV(t,e,n={}){let{gen:r,it:i}=t,s=[ZV(i,n),e2(t,n)];return t2(t,e,s),r.object(...s)}function ZV({errorPath:t},{instancePath:e}){let n=e?(0,Pe.str)`${t}${(0,Hh.getErrorPath)(e,Hh.Type.Str)}`:t;return[pn.default.instancePath,(0,Pe.strConcat)(pn.default.instancePath,n)]}function e2({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:r}){let i=r?e:(0,Pe.str)`${e}/${t}`;return n&&(i=(0,Pe.str)`${i}${(0,Hh.getErrorPath)(n,Hh.Type.Str)}`),[Fs.schemaPath,i]}function t2(t,{params:e,message:n},r){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([Fs.keyword,i],[Fs.params,typeof e=="function"?e(t):e||(0,Pe._)`{}`]),c.messages&&r.push([Fs.message,typeof n=="function"?n(t):n]),c.verbose&&r.push([Fs.schema,o],[Fs.parentSchema,(0,Pe._)`${u}${d}`],[pn.default.data,s]),l&&r.push([Fs.propertyName,l])}});var BA=k(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.boolOrEmptySchema=da.topBoolOrEmptySchema=void 0;var n2=hl(),r2=fe(),i2=tr(),s2={message:"boolean schema is false"};function o2(t){let{gen:e,schema:n,validateName:r}=t;n===!1?FA(t,!1):typeof n=="object"&&n.$async===!0?e.return(i2.default.data):(e.assign((0,r2._)`${r}.errors`,null),e.return(!0))}da.topBoolOrEmptySchema=o2;function a2(t,e){let{gen:n,schema:r}=t;r===!1?(n.var(e,!1),FA(t)):n.var(e,!0)}da.boolOrEmptySchema=a2;function FA(t,e){let{gen:n,data:r}=t,i={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,n2.reportError)(i,s2,void 0,e)}});var Pb=k(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.getRules=fa.isJSONType=void 0;var c2=["string","number","integer","boolean","null","object","array"],l2=new Set(c2);function u2(t){return typeof t=="string"&&l2.has(t)}fa.isJSONType=u2;function d2(){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=d2});var Rb=k(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.shouldUseRule=rs.shouldUseGroup=rs.schemaHasRulesForType=void 0;function f2({schema:t,self:e},n){let r=e.RULES.types[n];return r&&r!==!0&&UA(t,r)}rs.schemaHasRulesForType=f2;function UA(t,e){return e.rules.some(n=>VA(t,n))}rs.shouldUseGroup=UA;function VA(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(r=>t[r]!==void 0))}rs.shouldUseRule=VA});var pl=k(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.reportTypeError=cn.checkDataTypes=cn.checkDataType=cn.coerceAndCheckDataType=cn.getJSONTypes=cn.getSchemaTypes=cn.DataType=void 0;var h2=Pb(),p2=Rb(),m2=hl(),he=fe(),zA=be(),ha;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ha||(cn.DataType=ha={}));function g2(t){let e=WA(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}cn.getSchemaTypes=g2;function WA(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(h2.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}cn.getJSONTypes=WA;function y2(t,e){let{gen:n,data:r,opts:i}=t,s=v2(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,p2.schemaHasRulesForType)(t,e[0]));if(o){let a=Db(e,r,i.strictNumbers,ha.Wrong);n.if(a,()=>{s.length?b2(t,e,s):Ab(t)})}return o}cn.coerceAndCheckDataType=y2;var HA=new Set(["string","number","integer","boolean","null"]);function v2(t,e){return e?t.filter(n=>HA.has(n)||e==="array"&&n==="array"):[]}function b2(t,e,n){let{gen:r,data:i,opts:s}=t,o=r.let("dataType",(0,he._)`typeof ${i}`),a=r.let("coerced",(0,he._)`undefined`);s.coerceTypes==="array"&&r.if((0,he._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>r.assign(i,(0,he._)`${i}[0]`).assign(o,(0,he._)`typeof ${i}`).if(Db(e,i,s.strictNumbers),()=>r.assign(a,i))),r.if((0,he._)`${a} !== undefined`);for(let l of n)(HA.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);r.else(),Ab(t),r.endIf(),r.if((0,he._)`${a} !== undefined`,()=>{r.assign(i,a),T2(t,a)});function c(l){switch(l){case"string":r.elseIf((0,he._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,he._)`"" + ${i}`).elseIf((0,he._)`${i} === null`).assign(a,(0,he._)`""`);return;case"number":r.elseIf((0,he._)`${o} == "boolean" || ${i} === null
|
|
175
|
+
`,n)+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 n=Th(e),r=Zo(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Th(e),r=Zo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};PD.Parser=jv});var OD=w(Hc=>{"use strict";var RD=Nv(),JB=$c(),Wc=Fc(),QB=ky(),ZB=Ne(),eU=qv(),CD=Fv();function DD(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new eU.LineCounter||null,prettyErrors:e}}function tU(t,e={}){let{lineCounter:n,prettyErrors:r}=DD(e),i=new CD.Parser(n?.addNewLine),s=new RD.Composer(e),o=Array.from(s.compose(i.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(Wc.prettifyError(t,n)),a.warnings.forEach(Wc.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function AD(t,e={}){let{lineCounter:n,prettyErrors:r}=DD(e),i=new CD.Parser(n?.addNewLine),s=new RD.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 Wc.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Wc.prettifyError(t,n)),o.warnings.forEach(Wc.prettifyError(t,n))),o}function nU(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=AD(t,n);if(!i)return null;if(i.warnings.forEach(s=>QB.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:r},n))}function rU(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return ZB.isDocument(t)&&!r?t.toString(n):new JB.Document(t,r,n).toString(n)}Hc.parse=nU;Hc.parseAllDocuments=tU;Hc.parseDocument=AD;Hc.stringify=rU});var Uv=w(Fe=>{"use strict";var iU=Nv(),sU=$c(),oU=ov(),Bv=Fc(),aU=Sc(),Qi=Ne(),cU=Yi(),lU=Ct(),uU=Xi(),dU=Ji(),fU=vh(),hU=Lv(),pU=qv(),mU=Fv(),Sh=OD(),ID=yc();Fe.Composer=iU.Composer;Fe.Document=sU.Document;Fe.Schema=oU.Schema;Fe.YAMLError=Bv.YAMLError;Fe.YAMLParseError=Bv.YAMLParseError;Fe.YAMLWarning=Bv.YAMLWarning;Fe.Alias=aU.Alias;Fe.isAlias=Qi.isAlias;Fe.isCollection=Qi.isCollection;Fe.isDocument=Qi.isDocument;Fe.isMap=Qi.isMap;Fe.isNode=Qi.isNode;Fe.isPair=Qi.isPair;Fe.isScalar=Qi.isScalar;Fe.isSeq=Qi.isSeq;Fe.Pair=cU.Pair;Fe.Scalar=lU.Scalar;Fe.YAMLMap=uU.YAMLMap;Fe.YAMLSeq=dU.YAMLSeq;Fe.CST=fU;Fe.Lexer=hU.Lexer;Fe.LineCounter=pU.LineCounter;Fe.Parser=mU.Parser;Fe.parse=Sh.parse;Fe.parseAllDocuments=Sh.parseAllDocuments;Fe.parseDocument=Sh.parseDocument;Fe.stringify=Sh.stringify;Fe.visit=ID.visit;Fe.visitAsync=ID.visitAsync});var qD=w((Aie,$D)=>{"use strict";$D.exports=MD;function MD(t,e,n){t instanceof RegExp&&(t=xD(t,n)),e instanceof RegExp&&(e=xD(e,n));var r=LD(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function xD(t,e){var n=e.match(t);return n?n[0]:null}MD.range=LD;function LD(t,e,n){var r,i,s,o,a,c=n.indexOf(t),l=n.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(r=[],s=n.length;u>=0&&!a;)u==c?(r.push(u),c=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),l]:(i=r.pop(),i<s&&(s=i,o=l),l=n.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[s,o])}return a}});var HD=w((Oie,WD)=>{var jD=qD();WD.exports=vU;var FD="\0SLASH"+Math.random()+"\0",BD="\0OPEN"+Math.random()+"\0",zv="\0CLOSE"+Math.random()+"\0",UD="\0COMMA"+Math.random()+"\0",VD="\0PERIOD"+Math.random()+"\0";function Vv(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function gU(t){return t.split("\\\\").join(FD).split("\\{").join(BD).split("\\}").join(zv).split("\\,").join(UD).split("\\.").join(VD)}function yU(t){return t.split(FD).join("\\").split(BD).join("{").split(zv).join("}").split(UD).join(",").split(VD).join(".")}function zD(t){if(!t)return[""];var e=[],n=jD("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=zD(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function vU(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),Gc(gU(t),!0).map(yU)):[]}function bU(t){return"{"+t+"}"}function TU(t){return/^-?0\d/.test(t)}function SU(t,e){return t<=e}function _U(t,e){return t>=e}function Gc(t,e){var n=[],r=jD("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?Gc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=c||l,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+zv+r.post,Gc(t)):[t];var f;if(u)f=r.body.split(/\.\./);else if(f=zD(r.body),f.length===1&&(f=Gc(f[0],!1).map(bU),f.length===1))return s.map(function(ze){return r.pre+f[0]+ze});var h;if(u){var y=Vv(f[0]),p=Vv(f[1]),T=Math.max(f[0].length,f[1].length),_=f.length==3?Math.abs(Vv(f[2])):1,v=SU,b=p<y;b&&(_*=-1,v=_U);var k=f.some(TU);h=[];for(var C=y;v(C,p);C+=_){var L;if(l)L=String.fromCharCode(C),L==="\\"&&(L="");else if(L=String(C),k){var B=T-L.length;if(B>0){var q=new Array(B+1).join("0");C<0?L="-"+q+L.slice(1):L=q+L}}h.push(L)}}else{h=[];for(var ce=0;ce<f.length;ce++)h.push.apply(h,Gc(f[ce],!1))}for(var ce=0;ce<h.length;ce++)for(var o=0;o<s.length;o++){var a=i+h[ce]+s[o];(!e||u||a)&&n.push(a)}}return n}});var dl=w(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.regexpCode=De.getEsmExportName=De.getProperty=De.safeStringify=De.stringify=De.strConcat=De.addCodeArg=De.str=De._=De.nil=De._Code=De.Name=De.IDENTIFIER=De._CodeOrName=void 0;var ll=class{};De._CodeOrName=ll;De.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var $s=class extends ll{constructor(e){if(super(),!De.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}}};De.Name=$s;var nr=class extends ll{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((n,r)=>`${n}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,r)=>(r instanceof $s&&(n[r.str]=(n[r.str]||0)+1),n),{})}};De._Code=nr;De.nil=new nr("");function IA(t,...e){let n=[t[0]],r=0;for(;r<e.length;)lb(n,e[r]),n.push(t[++r]);return new nr(n)}De._=IA;var cb=new nr("+");function xA(t,...e){let n=[ul(t[0])],r=0;for(;r<e.length;)n.push(cb),lb(n,e[r]),n.push(cb,ul(t[++r]));return DV(n),new nr(n)}De.str=xA;function lb(t,e){e instanceof nr?t.push(...e._items):e instanceof $s?t.push(e):t.push(IV(e))}De.addCodeArg=lb;function DV(t){let e=1;for(;e<t.length-1;){if(t[e]===cb){let n=AV(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function AV(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof $s||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 $s))return`"${t}${e.slice(1)}`}function OV(t,e){return e.emptyStr()?t:t.emptyStr()?e:xA`${t}${e}`}De.strConcat=OV;function IV(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:ul(Array.isArray(t)?t.join(","):t)}function xV(t){return new nr(ul(t))}De.stringify=xV;function ul(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}De.safeStringify=ul;function MV(t){return typeof t=="string"&&De.IDENTIFIER.test(t)?new nr(`.${t}`):IA`[${t}]`}De.getProperty=MV;function LV(t){if(typeof t=="string"&&De.IDENTIFIER.test(t))return new nr(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}De.getEsmExportName=LV;function $V(t){return new nr(t.toString())}De.regexpCode=$V});var fb=w(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ValueScope=Dn.ValueScopeName=Dn.Scope=Dn.varKinds=Dn.UsedValueState=void 0;var Cn=dl(),ub=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Bh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Bh||(Dn.UsedValueState=Bh={}));Dn.varKinds={const:new Cn.Name("const"),let:new Cn.Name("let"),var:new Cn.Name("var")};var Uh=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof Cn.Name?e:this.name(e)}name(e){return new Cn.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,r;if(!((r=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||r===void 0)&&r.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Dn.Scope=Uh;var Vh=class extends Cn.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,Cn._)`.${new Cn.Name(n)}[${r}]`}};Dn.ValueScopeName=Vh;var qV=(0,Cn._)`\n`,db=class extends Uh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?qV:Cn.nil}}get(){return this._scope}name(e){return new Vh(e,this._newName(e))}value(e,n){var r;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(r=n.key)!==null&&r!==void 0?r:n.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]=n.ref,i.setValue(n,{property:s,itemIndex:l}),i}getValue(e,n){let r=this._values[e];if(r)return r.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,Cn._)`${e}${r.scopePath}`})}scopeCode(e=this._values,n,r){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},n,r)}_reduceValues(e,n,r={},i){let s=Cn.nil;for(let o in e){let a=e[o];if(!a)continue;let c=r[o]=r[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Bh.Started);let u=n(l);if(u){let d=this.opts.es5?Dn.varKinds.var:Dn.varKinds.const;s=(0,Cn._)`${s}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))s=(0,Cn._)`${s}${u}${this.opts._n}`;else throw new ub(l);c.set(l,Bh.Completed)})}return s}};Dn.ValueScope=db});var fe=w(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.or=me.and=me.not=me.CodeGen=me.operators=me.varKinds=me.ValueScopeName=me.ValueScope=me.Scope=me.Name=me.regexpCode=me.stringify=me.getProperty=me.nil=me.strConcat=me.str=me._=void 0;var Ee=dl(),Rr=fb(),rs=dl();Object.defineProperty(me,"_",{enumerable:!0,get:function(){return rs._}});Object.defineProperty(me,"str",{enumerable:!0,get:function(){return rs.str}});Object.defineProperty(me,"strConcat",{enumerable:!0,get:function(){return rs.strConcat}});Object.defineProperty(me,"nil",{enumerable:!0,get:function(){return rs.nil}});Object.defineProperty(me,"getProperty",{enumerable:!0,get:function(){return rs.getProperty}});Object.defineProperty(me,"stringify",{enumerable:!0,get:function(){return rs.stringify}});Object.defineProperty(me,"regexpCode",{enumerable:!0,get:function(){return rs.regexpCode}});Object.defineProperty(me,"Name",{enumerable:!0,get:function(){return rs.Name}});var Gh=fb();Object.defineProperty(me,"Scope",{enumerable:!0,get:function(){return Gh.Scope}});Object.defineProperty(me,"ValueScope",{enumerable:!0,get:function(){return Gh.ValueScope}});Object.defineProperty(me,"ValueScopeName",{enumerable:!0,get:function(){return Gh.ValueScopeName}});Object.defineProperty(me,"varKinds",{enumerable:!0,get:function(){return Gh.varKinds}});me.operators={GT:new Ee._Code(">"),GTE:new Ee._Code(">="),LT:new Ee._Code("<"),LTE:new Ee._Code("<="),EQ:new Ee._Code("==="),NEQ:new Ee._Code("!=="),NOT:new Ee._Code("!"),OR:new Ee._Code("||"),AND:new Ee._Code("&&"),ADD:new Ee._Code("+")};var Ti=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},hb=class extends Ti{constructor(e,n,r){super(),this.varKind=e,this.name=n,this.rhs=r}render({es5:e,_n:n}){let r=e?Rr.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${i};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=fa(this.rhs,e,n)),this}get names(){return this.rhs instanceof Ee._CodeOrName?this.rhs.names:{}}},zh=class extends Ti{constructor(e,n,r){super(),this.lhs=e,this.rhs=n,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof Ee.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=fa(this.rhs,e,n),this}get names(){let e=this.lhs instanceof Ee.Name?{}:{...this.lhs.names};return Hh(e,this.rhs)}},pb=class extends zh{constructor(e,n,r,i){super(e,r,i),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},mb=class extends Ti{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},gb=class extends Ti{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},yb=class extends Ti{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},vb=class extends Ti{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=fa(this.code,e,n),this}get names(){return this.code instanceof Ee._CodeOrName?this.code.names:{}}},fl=class extends Ti{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,r)=>n+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let r=e[n].optimizeNodes();Array.isArray(r)?e.splice(n,1,...r):r?e[n]=r:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:r}=this,i=r.length;for(;i--;){let s=r[i];s.optimizeNames(e,n)||(jV(e,s.names),r.splice(i,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>Fs(e,n.names),{})}},Si=class extends fl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},bb=class extends fl{},da=class extends Si{};da.kind="else";var qs=class t extends Si{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new da(r):r}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(MA(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=fa(this.condition,e,n),this}get names(){let e=super.names;return Hh(e,this.condition),this.else&&Fs(e,this.else.names),e}};qs.kind="if";var js=class extends Si{};js.kind="for";var Tb=class extends js{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=fa(this.iteration,e,n),this}get names(){return Fs(super.names,this.iteration.names)}},Sb=class extends js{constructor(e,n,r,i){super(),this.varKind=e,this.name=n,this.from=r,this.to=i}render(e){let n=e.es5?Rr.varKinds.var:this.varKind,{name:r,from:i,to:s}=this;return`for(${n} ${r}=${i}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=Hh(super.names,this.from);return Hh(e,this.to)}},Wh=class extends js{constructor(e,n,r,i){super(),this.loop=e,this.varKind=n,this.name=r,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=fa(this.iterable,e,n),this}get names(){return Fs(super.names,this.iterable.names)}},hl=class extends Si{constructor(e,n,r){super(),this.name=e,this.args=n,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};hl.kind="func";var pl=class extends fl{render(e){return"return "+super.render(e)}};pl.kind="return";var _b=class extends Si{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var r,i;return super.optimizeNames(e,n),(r=this.catch)===null||r===void 0||r.optimizeNames(e,n),(i=this.finally)===null||i===void 0||i.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&Fs(e,this.catch.names),this.finally&&Fs(e,this.finally.names),e}},ml=class extends Si{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ml.kind="catch";var gl=class extends Si{render(e){return"finally"+super.render(e)}};gl.kind="finally";var Eb=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
176
|
+
`:""},this._extScope=e,this._scope=new Rr.Scope({parent:e}),this._nodes=[new bb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let r=this._extScope.value(e,n);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,r,i){let s=this._scope.toName(n);return r!==void 0&&i&&(this._constants[s.str]=r),this._leafNode(new hb(e,s,r)),s}const(e,n,r){return this._def(Rr.varKinds.const,e,n,r)}let(e,n,r){return this._def(Rr.varKinds.let,e,n,r)}var(e,n,r){return this._def(Rr.varKinds.var,e,n,r)}assign(e,n,r){return this._leafNode(new zh(e,n,r))}add(e,n){return this._leafNode(new pb(e,me.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==Ee.nil&&this._leafNode(new vb(e)),this}object(...e){let n=["{"];for(let[r,i]of e)n.length>1&&n.push(","),n.push(r),(r!==i||this.opts.es5)&&(n.push(":"),(0,Ee.addCodeArg)(n,i));return n.push("}"),new Ee._Code(n)}if(e,n,r){if(this._blockNode(new qs(e)),n&&r)this.code(n).else().code(r).endIf();else if(n)this.code(n).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new qs(e))}else(){return this._elseNode(new da)}endIf(){return this._endBlockNode(qs,da)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new Tb(e),n)}forRange(e,n,r,i,s=this.opts.es5?Rr.varKinds.var:Rr.varKinds.let){let o=this._scope.toName(e);return this._for(new Sb(s,o,n,r),()=>i(o))}forOf(e,n,r,i=Rr.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=n instanceof Ee.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Ee._)`${o}.length`,a=>{this.var(s,(0,Ee._)`${o}[${a}]`),r(s)})}return this._for(new Wh("of",i,s,n),()=>r(s))}forIn(e,n,r,i=this.opts.es5?Rr.varKinds.var:Rr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ee._)`Object.keys(${n})`,r);let s=this._scope.toName(e);return this._for(new Wh("in",i,s,n),()=>r(s))}endFor(){return this._endBlockNode(js)}label(e){return this._leafNode(new mb(e))}break(e){return this._leafNode(new gb(e))}return(e){let n=new pl;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(pl)}try(e,n,r){if(!n&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new _b;if(this._blockNode(i),this.code(e),n){let s=this.name("e");this._currNode=i.catch=new ml(s),n(s)}return r&&(this._currNode=i.finally=new gl,this.code(r)),this._endBlockNode(ml,gl)}throw(e){return this._leafNode(new yb(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-n;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=Ee.nil,r,i){return this._blockNode(new hl(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(hl)}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,n){let r=this._currNode;if(r instanceof e||n&&r instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof qs))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};me.CodeGen=Eb;function Fs(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function Hh(t,e){return e instanceof Ee._CodeOrName?Fs(t,e.names):t}function fa(t,e,n){if(t instanceof Ee.Name)return r(t);if(!i(t))return t;return new Ee._Code(t._items.reduce((s,o)=>(o instanceof Ee.Name&&(o=r(o)),o instanceof Ee._Code?s.push(...o._items):s.push(o),s),[]));function r(s){let o=n[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ee._Code&&s._items.some(o=>o instanceof Ee.Name&&e[o.str]===1&&n[o.str]!==void 0)}}function jV(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function MA(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ee._)`!${kb(t)}`}me.not=MA;var FV=LA(me.operators.AND);function BV(...t){return t.reduce(FV)}me.and=BV;var UV=LA(me.operators.OR);function VV(...t){return t.reduce(UV)}me.or=VV;function LA(t){return(e,n)=>e===Ee.nil?n:n===Ee.nil?e:(0,Ee._)`${kb(e)} ${t} ${kb(n)}`}function kb(t){return t instanceof Ee.Name?t:(0,Ee._)`(${t})`}});var be=w(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.checkStrictMode=ge.getErrorPath=ge.Type=ge.useFunc=ge.setEvaluated=ge.evaluatedPropsToName=ge.mergeEvaluated=ge.eachItem=ge.unescapeJsonPointer=ge.escapeJsonPointer=ge.escapeFragment=ge.unescapeFragment=ge.schemaRefOrVal=ge.schemaHasRulesButRef=ge.schemaHasRules=ge.checkUnknownRules=ge.alwaysValidSchema=ge.toHash=void 0;var Je=fe(),zV=dl();function WV(t){let e={};for(let n of t)e[n]=!0;return e}ge.toHash=WV;function HV(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(jA(t,e),!FA(e,t.self.RULES.all))}ge.alwaysValidSchema=HV;function jA(t,e=t.schema){let{opts:n,self:r}=t;if(!n.strictSchema||typeof e=="boolean")return;let i=r.RULES.keywords;for(let s in e)i[s]||VA(t,`unknown keyword: "${s}"`)}ge.checkUnknownRules=jA;function FA(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}ge.schemaHasRules=FA;function GV(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}ge.schemaHasRulesButRef=GV;function YV({topSchemaRef:t,schemaPath:e},n,r,i){if(!i){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Je._)`${n}`}return(0,Je._)`${t}${e}${(0,Je.getProperty)(r)}`}ge.schemaRefOrVal=YV;function KV(t){return BA(decodeURIComponent(t))}ge.unescapeFragment=KV;function XV(t){return encodeURIComponent(Nb(t))}ge.escapeFragment=XV;function Nb(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}ge.escapeJsonPointer=Nb;function BA(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}ge.unescapeJsonPointer=BA;function JV(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}ge.eachItem=JV;function $A({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:r}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof Je.Name?(s instanceof Je.Name?t(i,s,o):e(i,s,o),o):s instanceof Je.Name?(e(i,o,s),s):n(s,o);return a===Je.Name&&!(c instanceof Je.Name)?r(i,c):c}}ge.mergeEvaluated={props:$A({mergeNames:(t,e,n)=>t.if((0,Je._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Je._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Je._)`${n} || {}`).code((0,Je._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,Je._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Je._)`${n} || {}`),Pb(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:UA}),items:$A({mergeNames:(t,e,n)=>t.if((0,Je._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Je._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,Je._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Je._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function UA(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Je._)`{}`);return e!==void 0&&Pb(t,n,e),n}ge.evaluatedPropsToName=UA;function Pb(t,e,n){Object.keys(n).forEach(r=>t.assign((0,Je._)`${e}${(0,Je.getProperty)(r)}`,!0))}ge.setEvaluated=Pb;var qA={};function QV(t,e){return t.scopeValue("func",{ref:e,code:qA[e.code]||(qA[e.code]=new zV._Code(e.code))})}ge.useFunc=QV;var wb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(wb||(ge.Type=wb={}));function ZV(t,e,n){if(t instanceof Je.Name){let r=e===wb.Num;return n?r?(0,Je._)`"[" + ${t} + "]"`:(0,Je._)`"['" + ${t} + "']"`:r?(0,Je._)`"/" + ${t}`:(0,Je._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Je.getProperty)(t).toString():"/"+Nb(t)}ge.getErrorPath=ZV;function VA(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}ge.checkStrictMode=VA});var rr=w(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var on=fe(),e2={data:new on.Name("data"),valCxt:new on.Name("valCxt"),instancePath:new on.Name("instancePath"),parentData:new on.Name("parentData"),parentDataProperty:new on.Name("parentDataProperty"),rootData:new on.Name("rootData"),dynamicAnchors:new on.Name("dynamicAnchors"),vErrors:new on.Name("vErrors"),errors:new on.Name("errors"),this:new on.Name("this"),self:new on.Name("self"),scope:new on.Name("scope"),json:new on.Name("json"),jsonPos:new on.Name("jsonPos"),jsonLen:new on.Name("jsonLen"),jsonPart:new on.Name("jsonPart")};Rb.default=e2});var yl=w(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.extendErrors=an.resetErrorsCount=an.reportExtraError=an.reportError=an.keyword$DataError=an.keywordError=void 0;var Pe=fe(),Yh=be(),mn=rr();an.keywordError={message:({keyword:t})=>(0,Pe.str)`must pass "${t}" keyword validation`};an.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Pe.str)`"${t}" keyword must be ${e} ($data)`:(0,Pe.str)`"${t}" keyword is invalid ($data)`};function t2(t,e=an.keywordError,n,r){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,c=HA(t,e,n);r??(o||a)?zA(s,c):WA(i,(0,Pe._)`[${c}]`)}an.reportError=t2;function n2(t,e=an.keywordError,n){let{it:r}=t,{gen:i,compositeRule:s,allErrors:o}=r,a=HA(t,e,n);zA(i,a),s||o||WA(r,mn.default.vErrors)}an.reportExtraError=n2;function r2(t,e){t.assign(mn.default.errors,e),t.if((0,Pe._)`${mn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Pe._)`${mn.default.vErrors}.length`,e),()=>t.assign(mn.default.vErrors,null)))}an.resetErrorsCount=r2;function i2({gen:t,keyword:e,schemaValue:n,data:r,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,mn.default.errors,a=>{t.const(o,(0,Pe._)`${mn.default.vErrors}[${a}]`),t.if((0,Pe._)`${o}.instancePath === undefined`,()=>t.assign((0,Pe._)`${o}.instancePath`,(0,Pe.strConcat)(mn.default.instancePath,s.errorPath))),t.assign((0,Pe._)`${o}.schemaPath`,(0,Pe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Pe._)`${o}.schema`,n),t.assign((0,Pe._)`${o}.data`,r))})}an.extendErrors=i2;function zA(t,e){let n=t.const("err",e);t.if((0,Pe._)`${mn.default.vErrors} === null`,()=>t.assign(mn.default.vErrors,(0,Pe._)`[${n}]`),(0,Pe._)`${mn.default.vErrors}.push(${n})`),t.code((0,Pe._)`${mn.default.errors}++`)}function WA(t,e){let{gen:n,validateName:r,schemaEnv:i}=t;i.$async?n.throw((0,Pe._)`new ${t.ValidationError}(${e})`):(n.assign((0,Pe._)`${r}.errors`,e),n.return(!1))}var Bs={keyword:new Pe.Name("keyword"),schemaPath:new Pe.Name("schemaPath"),params:new Pe.Name("params"),propertyName:new Pe.Name("propertyName"),message:new Pe.Name("message"),schema:new Pe.Name("schema"),parentSchema:new Pe.Name("parentSchema")};function HA(t,e,n){let{createErrors:r}=t.it;return r===!1?(0,Pe._)`{}`:s2(t,e,n)}function s2(t,e,n={}){let{gen:r,it:i}=t,s=[o2(i,n),a2(t,n)];return c2(t,e,s),r.object(...s)}function o2({errorPath:t},{instancePath:e}){let n=e?(0,Pe.str)`${t}${(0,Yh.getErrorPath)(e,Yh.Type.Str)}`:t;return[mn.default.instancePath,(0,Pe.strConcat)(mn.default.instancePath,n)]}function a2({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:r}){let i=r?e:(0,Pe.str)`${e}/${t}`;return n&&(i=(0,Pe.str)`${i}${(0,Yh.getErrorPath)(n,Yh.Type.Str)}`),[Bs.schemaPath,i]}function c2(t,{params:e,message:n},r){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([Bs.keyword,i],[Bs.params,typeof e=="function"?e(t):e||(0,Pe._)`{}`]),c.messages&&r.push([Bs.message,typeof n=="function"?n(t):n]),c.verbose&&r.push([Bs.schema,o],[Bs.parentSchema,(0,Pe._)`${u}${d}`],[mn.default.data,s]),l&&r.push([Bs.propertyName,l])}});var YA=w(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.boolOrEmptySchema=ha.topBoolOrEmptySchema=void 0;var l2=yl(),u2=fe(),d2=rr(),f2={message:"boolean schema is false"};function h2(t){let{gen:e,schema:n,validateName:r}=t;n===!1?GA(t,!1):typeof n=="object"&&n.$async===!0?e.return(d2.default.data):(e.assign((0,u2._)`${r}.errors`,null),e.return(!0))}ha.topBoolOrEmptySchema=h2;function p2(t,e){let{gen:n,schema:r}=t;r===!1?(n.var(e,!1),GA(t)):n.var(e,!0)}ha.boolOrEmptySchema=p2;function GA(t,e){let{gen:n,data:r}=t,i={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,l2.reportError)(i,f2,void 0,e)}});var Cb=w(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.getRules=pa.isJSONType=void 0;var m2=["string","number","integer","boolean","null","object","array"],g2=new Set(m2);function y2(t){return typeof t=="string"&&g2.has(t)}pa.isJSONType=y2;function v2(){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:{}}}pa.getRules=v2});var Db=w(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.shouldUseRule=is.shouldUseGroup=is.schemaHasRulesForType=void 0;function b2({schema:t,self:e},n){let r=e.RULES.types[n];return r&&r!==!0&&KA(t,r)}is.schemaHasRulesForType=b2;function KA(t,e){return e.rules.some(n=>XA(t,n))}is.shouldUseGroup=KA;function XA(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(r=>t[r]!==void 0))}is.shouldUseRule=XA});var vl=w(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.reportTypeError=cn.checkDataTypes=cn.checkDataType=cn.coerceAndCheckDataType=cn.getJSONTypes=cn.getSchemaTypes=cn.DataType=void 0;var T2=Cb(),S2=Db(),_2=yl(),he=fe(),JA=be(),ma;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ma||(cn.DataType=ma={}));function E2(t){let e=QA(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}cn.getSchemaTypes=E2;function QA(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(T2.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}cn.getJSONTypes=QA;function k2(t,e){let{gen:n,data:r,opts:i}=t,s=w2(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,S2.schemaHasRulesForType)(t,e[0]));if(o){let a=Ob(e,r,i.strictNumbers,ma.Wrong);n.if(a,()=>{s.length?N2(t,e,s):Ib(t)})}return o}cn.coerceAndCheckDataType=k2;var ZA=new Set(["string","number","integer","boolean","null"]);function w2(t,e){return e?t.filter(n=>ZA.has(n)||e==="array"&&n==="array"):[]}function N2(t,e,n){let{gen:r,data:i,opts:s}=t,o=r.let("dataType",(0,he._)`typeof ${i}`),a=r.let("coerced",(0,he._)`undefined`);s.coerceTypes==="array"&&r.if((0,he._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>r.assign(i,(0,he._)`${i}[0]`).assign(o,(0,he._)`typeof ${i}`).if(Ob(e,i,s.strictNumbers),()=>r.assign(a,i))),r.if((0,he._)`${a} !== undefined`);for(let l of n)(ZA.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);r.else(),Ib(t),r.endIf(),r.if((0,he._)`${a} !== undefined`,()=>{r.assign(i,a),P2(t,a)});function c(l){switch(l){case"string":r.elseIf((0,he._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,he._)`"" + ${i}`).elseIf((0,he._)`${i} === null`).assign(a,(0,he._)`""`);return;case"number":r.elseIf((0,he._)`${o} == "boolean" || ${i} === null
|
|
177
177
|
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,he._)`+${i}`);return;case"integer":r.elseIf((0,he._)`${o} === "boolean" || ${i} === null
|
|
178
178
|
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,he._)`+${i}`);return;case"boolean":r.elseIf((0,he._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,he._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":r.elseIf((0,he._)`${i} === "" || ${i} === 0 || ${i} === false`),r.assign(a,null);return;case"array":r.elseIf((0,he._)`${o} === "string" || ${o} === "number"
|
|
179
|
-
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,he._)`[${i}]`)}}}function T2({gen:t,parentData:e,parentDataProperty:n},r){t.if((0,he._)`${e} !== undefined`,()=>t.assign((0,he._)`${e}[${n}]`,r))}function Cb(t,e,n,r=ha.Correct){let i=r===ha.Correct?he.operators.EQ:he.operators.NEQ,s;switch(t){case"null":return(0,he._)`${e} ${i} null`;case"array":s=(0,he._)`Array.isArray(${e})`;break;case"object":s=(0,he._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,he._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,he._)`typeof ${e} ${i} ${t}`}return r===ha.Correct?s:(0,he.not)(s);function o(a=he.nil){return(0,he.and)((0,he._)`typeof ${e} == "number"`,a,n?(0,he._)`isFinite(${e})`:he.nil)}}cn.checkDataType=Cb;function Db(t,e,n,r){if(t.length===1)return Cb(t[0],e,n,r);let i,s=(0,zA.toHash)(t);if(s.array&&s.object){let o=(0,he._)`typeof ${e} != "object"`;i=s.null?o:(0,he._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=he.nil;s.number&&delete s.integer;for(let o in s)i=(0,he.and)(i,Cb(o,e,n,r));return i}cn.checkDataTypes=Db;var S2={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,he._)`{type: ${t}}`:(0,he._)`{type: ${e}}`};function Ab(t){let e=_2(t);(0,m2.reportError)(e,S2)}cn.reportTypeError=Ab;function _2(t){let{gen:e,data:n,schema:r}=t,i=(0,zA.schemaRefOrVal)(t,r,"type");return{gen:e,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:t}}});var YA=k(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.assignDefaults=void 0;var pa=fe(),E2=be();function w2(t,e){let{properties:n,items:r}=t.schema;if(e==="object"&&n)for(let i in n)GA(t,i,n[i].default);else e==="array"&&Array.isArray(r)&&r.forEach((i,s)=>GA(t,s,i.default))}Gh.assignDefaults=w2;function GA(t,e,n){let{gen:r,compositeRule:i,data:s,opts:o}=t;if(n===void 0)return;let a=(0,pa._)`${s}${(0,pa.getProperty)(e)}`;if(i){(0,E2.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,pa._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,pa._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,pa._)`${a} = ${(0,pa.stringify)(n)}`)}});var nr=k(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.validateUnion=Ge.validateArray=Ge.usePattern=Ge.callValidateCode=Ge.schemaProperties=Ge.allSchemaProperties=Ge.noPropertyInData=Ge.propertyInData=Ge.isOwnProperty=Ge.hasPropFunc=Ge.reportMissingProp=Ge.checkMissingProp=Ge.checkReportMissingProp=void 0;var ut=fe(),Ob=be(),is=tr(),k2=be();function N2(t,e){let{gen:n,data:r,it:i}=t;n.if(xb(n,r,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ut._)`${e}`},!0),t.error()})}Ge.checkReportMissingProp=N2;function P2({gen:t,data:e,it:{opts:n}},r,i){return(0,ut.or)(...r.map(s=>(0,ut.and)(xb(t,e,s,n.ownProperties),(0,ut._)`${i} = ${s}`)))}Ge.checkMissingProp=P2;function R2(t,e){t.setParams({missingProperty:e},!0),t.error()}Ge.reportMissingProp=R2;function KA(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ut._)`Object.prototype.hasOwnProperty`})}Ge.hasPropFunc=KA;function Ib(t,e,n){return(0,ut._)`${KA(t)}.call(${e}, ${n})`}Ge.isOwnProperty=Ib;function C2(t,e,n,r){let i=(0,ut._)`${e}${(0,ut.getProperty)(n)} !== undefined`;return r?(0,ut._)`${i} && ${Ib(t,e,n)}`:i}Ge.propertyInData=C2;function xb(t,e,n,r){let i=(0,ut._)`${e}${(0,ut.getProperty)(n)} === undefined`;return r?(0,ut.or)(i,(0,ut.not)(Ib(t,e,n))):i}Ge.noPropertyInData=xb;function XA(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ge.allSchemaProperties=XA;function D2(t,e){return XA(e).filter(n=>!(0,Ob.alwaysValidSchema)(t,e[n]))}Ge.schemaProperties=D2;function A2({schemaCode:t,data:e,it:{gen:n,topSchemaRef:r,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,ut._)`${t}, ${e}, ${r}${i}`:e,d=[[is.default.instancePath,(0,ut.strConcat)(is.default.instancePath,s)],[is.default.parentData,o.parentData],[is.default.parentDataProperty,o.parentDataProperty],[is.default.rootData,is.default.rootData]];o.opts.dynamicRef&&d.push([is.default.dynamicAnchors,is.default.dynamicAnchors]);let f=(0,ut._)`${u}, ${n.object(...d)}`;return c!==ut.nil?(0,ut._)`${a}.call(${c}, ${f})`:(0,ut._)`${a}(${f})`}Ge.callValidateCode=A2;var O2=(0,ut._)`new RegExp`;function I2({gen:t,it:{opts:e}},n){let r=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(n,r);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,ut._)`${i.code==="new RegExp"?O2:(0,k2.useFunc)(t,i)}(${n}, ${r})`})}Ge.usePattern=I2;function x2(t){let{gen:e,data:n,keyword:r,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,ut._)`${n}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:r,dataProp:l,dataPropType:Ob.Type.Num},s),e.if((0,ut.not)(s),a)})}}Ge.validateArray=x2;function M2(t){let{gen:e,schema:n,keyword:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(c=>(0,Ob.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>n.forEach((c,l)=>{let u=t.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,ut._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,ut.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ge.validateUnion=M2});var ZA=k(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.validateKeywordUsage=Xr.validSchemaType=Xr.funcKeywordCode=Xr.macroKeywordCode=void 0;var mn=fe(),Bs=tr(),L2=nr(),$2=hl();function q2(t,e){let{gen:n,keyword:r,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),c=QA(n,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=n.name("valid");t.subschema({schema:a,schemaPath:mn.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Xr.macroKeywordCode=q2;function j2(t,e){var n;let{gen:r,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=t;B2(c,e);let l=!a&&e.compile?e.compile.call(c.self,s,o,c):e.validate,u=QA(r,i,l),d=r.let("valid");t.block$data(d,f),t.ok((n=e.valid)!==null&&n!==void 0?n:d);function f(){if(e.errors===!1)p(),e.modifying&&JA(t),T(()=>t.error());else{let _=e.async?h():y();e.modifying&&JA(t),T(()=>F2(t,_))}}function h(){let _=r.let("ruleErrs",null);return r.try(()=>p((0,mn._)`await `),v=>r.assign(d,!1).if((0,mn._)`${v} instanceof ${c.ValidationError}`,()=>r.assign(_,(0,mn._)`${v}.errors`),()=>r.throw(v))),_}function y(){let _=(0,mn._)`${u}.errors`;return r.assign(_,null),p(mn.nil),_}function p(_=e.async?(0,mn._)`await `:mn.nil){let v=c.opts.passContext?Bs.default.this:Bs.default.self,b=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,mn._)`${_}${(0,L2.callValidateCode)(t,u,v,b)}`,e.modifying)}function T(_){var v;r.if((0,mn.not)((v=e.valid)!==null&&v!==void 0?v:d),_)}}Xr.funcKeywordCode=j2;function JA(t){let{gen:e,data:n,it:r}=t;e.if(r.parentData,()=>e.assign(n,(0,mn._)`${r.parentData}[${r.parentDataProperty}]`))}function F2(t,e){let{gen:n}=t;n.if((0,mn._)`Array.isArray(${e})`,()=>{n.assign(Bs.default.vErrors,(0,mn._)`${Bs.default.vErrors} === null ? ${e} : ${Bs.default.vErrors}.concat(${e})`).assign(Bs.default.errors,(0,mn._)`${Bs.default.vErrors}.length`),(0,$2.extendErrors)(t)},()=>t.error())}function B2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function QA(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,mn.stringify)(n)})}function U2(t,e,n=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||n&&typeof t>"u")}Xr.validSchemaType=U2;function V2({schema:t,opts:e,self:n,errSchemaPath:r},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 "${r}": `+n.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(c);else throw new Error(c)}}Xr.validateKeywordUsage=V2});var tO=k(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.extendSubschemaMode=ss.extendSubschemaData=ss.getSubschema=void 0;var Jr=fe(),eO=be();function z2(t,{keyword:e,schemaProp:n,schema:r,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return n===void 0?{schema:a,schemaPath:(0,Jr._)`${t.schemaPath}${(0,Jr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[n],schemaPath:(0,Jr._)`${t.schemaPath}${(0,Jr.getProperty)(e)}${(0,Jr.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,eO.escapeFragment)(n)}`}}if(r!==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:r,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}ss.getSubschema=z2;function W2(t,e,{dataProp:n,dataPropType:r,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Jr._)`${e.data}${(0,Jr.getProperty)(n)}`,!0);c(f),t.errorPath=(0,Jr.str)`${l}${(0,eO.getErrorPath)(n,r,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Jr._)`${n}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof Jr.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]}}ss.extendSubschemaData=W2;function H2(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:s}){r!==void 0&&(t.compositeRule=r),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=n}ss.extendSubschemaMode=H2});var Mb=k((Ose,nO)=>{"use strict";nO.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}});var iO=k((Ise,rO)=>{"use strict";var os=rO.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var r=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};Yh(e,r,i,t,"",t)};os.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};os.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};os.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};os.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 Yh(t,e,n,r,i,s,o,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,i,s,o,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in os.arrayKeywords)for(var f=0;f<d.length;f++)Yh(t,e,n,d[f],i+"/"+u+"/"+f,s,i,u,r,f)}else if(u in os.propsKeywords){if(d&&typeof d=="object")for(var h in d)Yh(t,e,n,d[h],i+"/"+u+"/"+G2(h),s,i,u,r,h)}else(u in os.keywords||t.allKeys&&!(u in os.skipKeywords))&&Yh(t,e,n,d,i+"/"+u,s,i,u,r)}n(r,i,s,o,a,c,l)}}function G2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ml=k(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.getSchemaRefs=An.resolveUrl=An.normalizeId=An._getFullPath=An.getFullPath=An.inlineRef=void 0;var Y2=be(),K2=Mb(),X2=iO(),J2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Q2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Lb(t):e?sO(t)<=e:!1}An.inlineRef=Q2;var Z2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Lb(t){for(let e in t){if(Z2.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(Lb)||typeof n=="object"&&Lb(n))return!0}return!1}function sO(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!J2.has(n)&&(typeof t[n]=="object"&&(0,Y2.eachItem)(t[n],r=>e+=sO(r)),e===1/0))return 1/0}return e}function oO(t,e="",n){n!==!1&&(e=ma(e));let r=t.parse(e);return aO(t,r)}An.getFullPath=oO;function aO(t,e){return t.serialize(e).split("#")[0]+"#"}An._getFullPath=aO;var ez=/#\/?$/;function ma(t){return t?t.replace(ez,""):""}An.normalizeId=ma;function tz(t,e,n){return n=ma(n),t.resolve(e,n)}An.resolveUrl=tz;var nz=/^[a-z_][-a-z0-9._]*$/i;function rz(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,i=ma(t[n]||e),s={"":i},o=oO(r,i,!1),a={},c=new Set;return X2(t,{allKeys:!0},(d,f,h,y)=>{if(y===void 0)return;let p=o+f,T=s[y];typeof d[n]=="string"&&(T=_.call(this,d[n])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),s[f]=T;function _(b){let w=this.opts.uriResolver.resolve;if(b=ma(T?w(T,b):b),c.has(b))throw u(b);c.add(b);let C=this.refs[b];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?l(d,C.schema,b):b!==ma(p)&&(b[0]==="#"?(l(d,a[b],b),a[b]=d):this.refs[b]=p),b}function v(b){if(typeof b=="string"){if(!nz.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}}),a;function l(d,f,h){if(f!==void 0&&!K2(d,f))throw u(h)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}An.getSchemaRefs=rz});var vl=k(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.getData=as.KeywordCxt=as.validateFunctionCode=void 0;var fO=BA(),cO=pl(),qb=Rb(),Kh=pl(),iz=YA(),yl=ZA(),$b=tO(),Q=fe(),se=tr(),sz=ml(),Si=be(),gl=hl();function oz(t){if(mO(t)&&(gO(t),pO(t))){lz(t);return}hO(t,()=>(0,fO.topBoolOrEmptySchema)(t))}as.validateFunctionCode=oz;function hO({gen:t,validateName:e,schema:n,schemaEnv:r,opts:i},s){i.code.es5?t.func(e,(0,Q._)`${se.default.data}, ${se.default.valCxt}`,r.$async,()=>{t.code((0,Q._)`"use strict"; ${lO(n,i)}`),cz(t,i),t.code(s)}):t.func(e,(0,Q._)`${se.default.data}, ${az(i)}`,r.$async,()=>t.code(lO(n,i)).code(s))}function az(t){return(0,Q._)`{${se.default.instancePath}="", ${se.default.parentData}, ${se.default.parentDataProperty}, ${se.default.rootData}=${se.default.data}${t.dynamicRef?(0,Q._)`, ${se.default.dynamicAnchors}={}`:Q.nil}}={}`}function cz(t,e){t.if(se.default.valCxt,()=>{t.var(se.default.instancePath,(0,Q._)`${se.default.valCxt}.${se.default.instancePath}`),t.var(se.default.parentData,(0,Q._)`${se.default.valCxt}.${se.default.parentData}`),t.var(se.default.parentDataProperty,(0,Q._)`${se.default.valCxt}.${se.default.parentDataProperty}`),t.var(se.default.rootData,(0,Q._)`${se.default.valCxt}.${se.default.rootData}`),e.dynamicRef&&t.var(se.default.dynamicAnchors,(0,Q._)`${se.default.valCxt}.${se.default.dynamicAnchors}`)},()=>{t.var(se.default.instancePath,(0,Q._)`""`),t.var(se.default.parentData,(0,Q._)`undefined`),t.var(se.default.parentDataProperty,(0,Q._)`undefined`),t.var(se.default.rootData,se.default.data),e.dynamicRef&&t.var(se.default.dynamicAnchors,(0,Q._)`{}`)})}function lz(t){let{schema:e,opts:n,gen:r}=t;hO(t,()=>{n.$comment&&e.$comment&&vO(t),pz(t),r.let(se.default.vErrors,null),r.let(se.default.errors,0),n.unevaluated&&uz(t),yO(t),yz(t)})}function uz(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,Q._)`${n}.evaluated`),e.if((0,Q._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Q._)`${t.evaluated}.props`,(0,Q._)`undefined`)),e.if((0,Q._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Q._)`${t.evaluated}.items`,(0,Q._)`undefined`))}function lO(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,Q._)`/*# sourceURL=${n} */`:Q.nil}function dz(t,e){if(mO(t)&&(gO(t),pO(t))){fz(t,e);return}(0,fO.boolOrEmptySchema)(t,e)}function pO({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function mO(t){return typeof t.schema!="boolean"}function fz(t,e){let{schema:n,gen:r,opts:i}=t;i.$comment&&n.$comment&&vO(t),mz(t),gz(t);let s=r.const("_errs",se.default.errors);yO(t,s),r.var(e,(0,Q._)`${s} === ${se.default.errors}`)}function gO(t){(0,Si.checkUnknownRules)(t),hz(t)}function yO(t,e){if(t.opts.jtd)return uO(t,[],!1,e);let n=(0,cO.getSchemaTypes)(t.schema),r=(0,cO.coerceAndCheckDataType)(t,n);uO(t,n,!r,e)}function hz(t){let{schema:e,errSchemaPath:n,opts:r,self:i}=t;e.$ref&&r.ignoreKeywordsWithRef&&(0,Si.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function pz(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,Si.checkStrictMode)(t,"default is ignored in the schema root")}function mz(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,sz.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function gz(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function vO({gen:t,schemaEnv:e,schema:n,errSchemaPath:r,opts:i}){let s=n.$comment;if(i.$comment===!0)t.code((0,Q._)`${se.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,Q.str)`${r}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,Q._)`${se.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function yz(t){let{gen:e,schemaEnv:n,validateName:r,ValidationError:i,opts:s}=t;n.$async?e.if((0,Q._)`${se.default.errors} === 0`,()=>e.return(se.default.data),()=>e.throw((0,Q._)`new ${i}(${se.default.vErrors})`)):(e.assign((0,Q._)`${r}.errors`,se.default.vErrors),s.unevaluated&&vz(t),e.return((0,Q._)`${se.default.errors} === 0`))}function vz({gen:t,evaluated:e,props:n,items:r}){n instanceof Q.Name&&t.assign((0,Q._)`${e}.props`,n),r instanceof Q.Name&&t.assign((0,Q._)`${e}.items`,r)}function uO(t,e,n,r){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Si.schemaHasRulesButRef)(s,u))){i.block(()=>TO(t,"$ref",u.all.$ref.definition));return}c.jtd||bz(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,Kh.checkDataType)(f.type,o,c.strictNumbers)),dO(t,f),e.length===1&&e[0]===f.type&&n&&(i.else(),(0,Kh.reportTypeError)(t)),i.endIf()):dO(t,f),a||i.if((0,Q._)`${se.default.errors} === ${r||0}`))}}function dO(t,e){let{gen:n,schema:r,opts:{useDefaults:i}}=t;i&&(0,iz.assignDefaults)(t,e.type),n.block(()=>{for(let s of e.rules)(0,qb.shouldUseRule)(r,s)&&TO(t,s.keyword,s.definition,e.type)})}function bz(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Tz(t,e),t.opts.allowUnionTypes||Sz(t,e),_z(t,t.dataTypes))}function Tz(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{bO(t.dataTypes,n)||jb(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),wz(t,e)}}function Sz(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&jb(t,"use allowUnionTypes to allow union type keyword")}function _z(t,e){let n=t.self.RULES.all;for(let r in n){let i=n[r];if(typeof i=="object"&&(0,qb.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>Ez(e,o))&&jb(t,`missing type "${s.join(",")}" for keyword "${r}"`)}}}function Ez(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function bO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function wz(t,e){let n=[];for(let r of t.dataTypes)bO(e,r)?n.push(r):e.includes("integer")&&r==="number"&&n.push("integer");t.dataTypes=n}function jb(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,Si.checkStrictMode)(t,e,t.opts.strictTypes)}var Xh=class{constructor(e,n,r){if((0,yl.validateKeywordUsage)(e,n,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Si.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",SO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,yl.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",se.default.errors))}result(e,n,r){this.failResult((0,Q.not)(e),n,r)}failResult(e,n,r){this.gen.if(e),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,Q.not)(e),void 0,n)}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:n}=this;this.fail((0,Q._)`${n} !== undefined && (${(0,Q.or)(this.invalid$data(),e)})`)}error(e,n,r){if(n){this.setParams(n),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,n){(e?gl.reportExtraError:gl.reportError)(this,this.def.error,n)}$dataError(){(0,gl.reportError)(this,this.def.$dataError||gl.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,gl.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,r=Q.nil){this.gen.block(()=>{this.check$data(e,r),n()})}check$data(e=Q.nil,n=Q.nil){if(!this.$data)return;let{gen:r,schemaCode:i,schemaType:s,def:o}=this;r.if((0,Q.or)((0,Q._)`${i} === undefined`,n)),e!==Q.nil&&r.assign(e,!0),(s.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Q.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:r,def:i,it:s}=this;return(0,Q.or)(o(),a());function o(){if(r.length){if(!(n instanceof Q.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,Q._)`${(0,Kh.checkDataTypes)(c,n,s.opts.strictNumbers,Kh.DataType.Wrong)}`}return Q.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,Q._)`!${c}(${n})`}return Q.nil}}subschema(e,n){let r=(0,$b.getSubschema)(this.it,e);(0,$b.extendSubschemaData)(r,this.it,e),(0,$b.extendSubschemaMode)(r,e);let i={...this.it,...r,items:void 0,props:void 0};return dz(i,n),i}mergeEvaluated(e,n){let{it:r,gen:i}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=Si.mergeEvaluated.props(i,e.props,r.props,n)),r.items!==!0&&e.items!==void 0&&(r.items=Si.mergeEvaluated.items(i,e.items,r.items,n)))}mergeValidEvaluated(e,n){let{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(n,()=>this.mergeEvaluated(e,Q.Name)),!0}};as.KeywordCxt=Xh;function TO(t,e,n,r){let i=new Xh(t,n,e);"code"in n?n.code(i,r):i.$data&&n.validate?(0,yl.funcKeywordCode)(i,n):"macro"in n?(0,yl.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,yl.funcKeywordCode)(i,n)}var kz=/^\/(?:[^~]|~0|~1)*$/,Nz=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function SO(t,{dataLevel:e,dataNames:n,dataPathArr:r}){let i,s;if(t==="")return se.default.rootData;if(t[0]==="/"){if(!kz.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=se.default.rootData}else{let l=Nz.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 r[e-u]}if(u>e)throw new Error(c("data",u));if(s=n[e-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,Q._)`${s}${(0,Q.getProperty)((0,Si.unescapeJsonPointer)(l))}`,o=(0,Q._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}as.getData=SO});var Jh=k(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var Fb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Bb.default=Fb});var bl=k(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var Ub=ml(),Vb=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,Ub.resolveUrl)(e,n,r),this.missingSchema=(0,Ub.normalizeId)((0,Ub.getFullPath)(e,this.missingRef))}};zb.default=Vb});var Tl=k(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.resolveSchema=rr.getCompilingSchema=rr.resolveRef=rr.compileSchema=rr.SchemaEnv=void 0;var Pr=fe(),Pz=Jh(),Us=tr(),Rr=ml(),_O=be(),Rz=vl(),ga=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,Rr.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};rr.SchemaEnv=ga;function Hb(t){let e=EO.call(this,t);if(e)return e;let n=(0,Rr.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Pr.CodeGen(this.scope,{es5:r,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:Pz.default,code:(0,Pr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Us.default.data,parentData:Us.default.parentData,parentDataProperty:Us.default.parentDataProperty,dataNames:[Us.default.data],dataPathArr:[Pr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Pr.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:Pr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Pr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Rz.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(Us.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let h=new Function(`${Us.default.self}`,`${Us.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:p}=l;h.evaluated={props:y instanceof Pr.Name?void 0:y,items:p instanceof Pr.Name?void 0:p,dynamicProps:y instanceof Pr.Name,dynamicItems:p instanceof Pr.Name},h.source&&(h.source.evaluated=(0,Pr.stringify)(h.evaluated))}return t.validate=h,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)}}rr.compileSchema=Hb;function Cz(t,e,n){var r;n=(0,Rr.resolveUrl)(this.opts.uriResolver,e,n);let i=t.refs[n];if(i)return i;let s=Oz.call(this,t,n);if(s===void 0){let o=(r=t.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;o&&(s=new ga({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[n]=Dz.call(this,s)}rr.resolveRef=Cz;function Dz(t){return(0,Rr.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Hb.call(this,t)}function EO(t){for(let e of this._compilations)if(Az(e,t))return e}rr.getCompilingSchema=EO;function Az(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Oz(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||Qh.call(this,t,e)}function Qh(t,e){let n=this.opts.uriResolver.parse(e),r=(0,Rr._getFullPath)(this.opts.uriResolver,n),i=(0,Rr.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===i)return Wb.call(this,n,t);let s=(0,Rr.normalizeId)(r),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=Qh.call(this,t,o);return typeof a?.schema!="object"?void 0:Wb.call(this,n,a)}if(typeof o?.schema=="object"){if(o.validate||Hb.call(this,o),s===(0,Rr.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Rr.resolveUrl)(this.opts.uriResolver,i,l)),new ga({schema:a,schemaId:c,root:t,baseId:i})}return Wb.call(this,n,o)}}rr.resolveSchema=Qh;var Iz=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Wb(t,{baseId:e,schema:n,root:r}){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 n=="boolean")return;let c=n[(0,_O.unescapeFragment)(a)];if(c===void 0)return;n=c;let l=typeof n=="object"&&n[this.opts.schemaId];!Iz.has(a)&&l&&(e=(0,Rr.resolveUrl)(this.opts.uriResolver,e,l))}let s;if(typeof n!="boolean"&&n.$ref&&!(0,_O.schemaHasRulesButRef)(n,this.RULES)){let a=(0,Rr.resolveUrl)(this.opts.uriResolver,e,n.$ref);s=Qh.call(this,r,a)}let{schemaId:o}=this.opts;if(s=s||new ga({schema:n,schemaId:o,root:r,baseId:e}),s.schema!==s.root.schema)return s}});var wO=k((jse,xz)=>{xz.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 NO=k((Fse,kO)=>{"use strict";var Mz={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};kO.exports={HEX:Mz}});var xO=k((Bse,IO)=>{"use strict";var{HEX:Lz}=NO(),$z=/^(?:(?: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 DO(t){if(OO(t,".")<3)return{host:t,isIPV4:!1};let e=t.match($z)||[],[n]=e;return n?{host:jz(n,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function Gb(t,e=!1){let n="",r=!0;for(let i of t){if(Lz[i]===void 0)return;i!=="0"&&r===!0&&(r=!1),r||(n+=i)}return e&&n.length===0&&(n="0"),n}function qz(t){let e=0,n={error:!1,address:"",zone:""},r=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=Gb(i);if(l!==void 0)r.push(l);else return n.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++,r.push(":"),e>7){n.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?n.zone=i.join(""):a?r.push(i.join("")):r.push(Gb(i))),n.address=r.join(""),n}function AO(t){if(OO(t,":")<2)return{host:t,isIPV6:!1};let e=qz(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,r=e.address;return e.zone&&(n+="%"+e.zone,r+="%25"+e.zone),{host:n,escapedHost:r,isIPV6:!0}}}function jz(t,e){let n="",r=!0,i=t.length;for(let s=0;s<i;s++){let o=t[s];o==="0"&&r?(s+1<=i&&t[s+1]===e||s+1===i)&&(n+=o,r=!1):(o===e?r=!0:r=!1,n+=o)}return n}function OO(t,e){let n=0;for(let r=0;r<t.length;r++)t[r]===e&&n++;return n}var PO=/^\.\.?\//u,RO=/^\/\.(?:\/|$)/u,CO=/^\/\.\.(?:\/|$)/u,Fz=/^\/?(?:.|\n)*?(?=\/|$)/u;function Bz(t){let e=[];for(;t.length;)if(t.match(PO))t=t.replace(PO,"");else if(t.match(RO))t=t.replace(RO,"/");else if(t.match(CO))t=t.replace(CO,"/"),e.pop();else if(t==="."||t==="..")t="";else{let n=t.match(Fz);if(n){let r=n[0];t=t.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function Uz(t,e){let n=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=n(t.scheme)),t.userinfo!==void 0&&(t.userinfo=n(t.userinfo)),t.host!==void 0&&(t.host=n(t.host)),t.path!==void 0&&(t.path=n(t.path)),t.query!==void 0&&(t.query=n(t.query)),t.fragment!==void 0&&(t.fragment=n(t.fragment)),t}function Vz(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host),r=DO(n);if(r.isIPV4)n=r.host;else{let i=AO(r.host);i.isIPV6===!0?n=`[${i.escapedHost}]`:n=t.host}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}IO.exports={recomposeAuthority:Vz,normalizeComponentEncoding:Uz,removeDotSegments:Bz,normalizeIPv4:DO,normalizeIPv6:AO,stringArrayToHexStripped:Gb}});var FO=k((Use,jO)=>{"use strict";var zz=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,Wz=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function MO(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function LO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function $O(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 Hz(t){return t.secure=MO(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Gz(t){if((t.port===(MO(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,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function Yz(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(Wz);if(n){let r=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let i=`${r}:${e.nid||t.nid}`,s=Yb[i];t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Kz(t,e){let n=e.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),i=`${n}:${e.nid||r}`,s=Yb[i];s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function Xz(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!zz.test(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function Jz(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var qO={scheme:"http",domainHost:!0,parse:LO,serialize:$O},Qz={scheme:"https",domainHost:qO.domainHost,parse:LO,serialize:$O},Zh={scheme:"ws",domainHost:!0,parse:Hz,serialize:Gz},Zz={scheme:"wss",domainHost:Zh.domainHost,parse:Zh.parse,serialize:Zh.serialize},eW={scheme:"urn",parse:Yz,serialize:Kz,skipNormalize:!0},tW={scheme:"urn:uuid",parse:Xz,serialize:Jz,skipNormalize:!0},Yb={http:qO,https:Qz,ws:Zh,wss:Zz,urn:eW,"urn:uuid":tW};jO.exports=Yb});var UO=k((Vse,tp)=>{"use strict";var{normalizeIPv6:nW,normalizeIPv4:rW,removeDotSegments:Sl,recomposeAuthority:iW,normalizeComponentEncoding:ep}=xO(),Kb=FO();function sW(t,e){return typeof t=="string"?t=Qr(_i(t,e),e):typeof t=="object"&&(t=_i(Qr(t,e),e)),t}function oW(t,e,n){let r=Object.assign({scheme:"null"},n),i=BO(_i(t,r),_i(e,r),r,!0);return Qr(i,{...r,skipEscape:!0})}function BO(t,e,n,r){let i={};return r||(t=_i(Qr(t,n),n),e=_i(Qr(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Sl(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=Sl(e.path||""),i.query=e.query):(e.path?(e.path.charAt(0)==="/"?i.path=Sl(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=Sl(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 aW(t,e,n){return typeof t=="string"?(t=unescape(t),t=Qr(ep(_i(t,n),!0),{...n,skipEscape:!0})):typeof t=="object"&&(t=Qr(ep(t,!0),{...n,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Qr(ep(_i(e,n),!0),{...n,skipEscape:!0})):typeof e=="object"&&(e=Qr(ep(e,!0),{...n,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function Qr(t,e){let n={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:""},r=Object.assign({},e),i=[],s=Kb[(r.scheme||n.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&i.push(n.scheme,":");let o=iW(n);if(o!==void 0&&(r.reference!=="suffix"&&i.push("//"),i.push(o),n.path&&n.path.charAt(0)!=="/"&&i.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!s||!s.absolutePath)&&(a=Sl(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return n.query!==void 0&&i.push("?",n.query),n.fragment!==void 0&&i.push("#",n.fragment),i.join("")}var cW=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function lW(t){let e=0;for(let n=0,r=t.length;n<r;++n)if(e=t.charCodeAt(n),e>126||cW[e])return!0;return!1}var uW=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _i(t,e){let n=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=t.indexOf("%")!==-1,s=!1;n.reference==="suffix"&&(t=(n.scheme?n.scheme+":":"")+"//"+t);let o=t.match(uW);if(o){if(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5]),r.host){let c=rW(r.host);if(c.isIPV4===!1){let l=nW(c.host);r.host=l.host.toLowerCase(),s=l.isIPV6}else r.host=c.host,s=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");let a=Kb[(n.scheme||r.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(n.domainHost||a&&a.domainHost)&&s===!1&&lW(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(c){r.error=r.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),i&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return r}var Xb={SCHEMES:Kb,normalize:sW,resolve:oW,resolveComponents:BO,equal:aW,serialize:Qr,parse:_i};tp.exports=Xb;tp.exports.default=Xb;tp.exports.fastUri=Xb});var zO=k(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var VO=UO();VO.code='require("ajv/dist/runtime/uri").default';Jb.default=VO});var QO=k(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.CodeGen=Yt.Name=Yt.nil=Yt.stringify=Yt.str=Yt._=Yt.KeywordCxt=void 0;var dW=vl();Object.defineProperty(Yt,"KeywordCxt",{enumerable:!0,get:function(){return dW.KeywordCxt}});var ya=fe();Object.defineProperty(Yt,"_",{enumerable:!0,get:function(){return ya._}});Object.defineProperty(Yt,"str",{enumerable:!0,get:function(){return ya.str}});Object.defineProperty(Yt,"stringify",{enumerable:!0,get:function(){return ya.stringify}});Object.defineProperty(Yt,"nil",{enumerable:!0,get:function(){return ya.nil}});Object.defineProperty(Yt,"Name",{enumerable:!0,get:function(){return ya.Name}});Object.defineProperty(Yt,"CodeGen",{enumerable:!0,get:function(){return ya.CodeGen}});var fW=Jh(),KO=bl(),hW=Pb(),_l=Tl(),pW=fe(),El=ml(),np=pl(),Zb=be(),WO=wO(),mW=zO(),XO=(t,e)=>new RegExp(t,e);XO.code="new RegExp";var gW=["removeAdditional","useDefaults","coerceTypes"],yW=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),vW={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."},bW={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},HO=200;function TW(t){var e,n,r,i,s,o,a,c,l,u,d,f,h,y,p,T,_,v,b,w,C,L,B,q,ce;let ze=t.strict,Dt=(e=t.code)===null||e===void 0?void 0:e.optimize,ye=Dt===!0||Dt===void 0?1:Dt||0,Un=(r=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:XO,Ei=(i=t.uriResolver)!==null&&i!==void 0?i:mW.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:ze)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:ze)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:ze)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:ze)!==null&&f!==void 0?f:"log",strictRequired:(y=(h=t.strictRequired)!==null&&h!==void 0?h:ze)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:ye,regExp:Un}:{optimize:ye,regExp:Un},loopRequired:(p=t.loopRequired)!==null&&p!==void 0?p:HO,loopEnum:(T=t.loopEnum)!==null&&T!==void 0?T:HO,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(w=t.schemaId)!==null&&w!==void 0?w:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(L=t.validateSchema)!==null&&L!==void 0?L:!0,validateFormats:(B=t.validateFormats)!==null&&B!==void 0?B:!0,unicodeRegExp:(q=t.unicodeRegExp)!==null&&q!==void 0?q:!0,int32range:(ce=t.int32range)!==null&&ce!==void 0?ce:!0,uriResolver:Ei}}var wl=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...TW(e)};let{es5:n,lines:r}=this.opts.code;this.scope=new pW.ValueScope({scope:{},prefixes:yW,es5:n,lines:r}),this.logger=NW(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,hW.getRules)(),GO.call(this,vW,e,"NOT SUPPORTED"),GO.call(this,bW,e,"DEPRECATED","warn"),this._metaOpts=wW.call(this),e.formats&&_W.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&EW.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),SW.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:r}=this.opts,i=WO;r==="id"&&(i={...WO},i.id=i.$id,delete i.$id),n&&e&&this.addMetaSchema(i,i[r],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let i=r(n);return"$async"in r||(this.errors=r.errors),i}compile(e,n){let r=this._addSchema(e,n);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return i.call(this,e,n);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 KO.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,n)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,n,r,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,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 n=(0,El.normalizeId)(n||s),this._checkUnique(n),this.schemas[n]=this._addSchema(e,r,n,i,!0),this}addMetaSchema(e,n,r=this.opts.validateSchema){return this.addSchema(e,n,!0,r),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(r,e);if(!i&&n){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 n;for(;typeof(n=YO.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:r}=this.opts,i=new _l.SchemaEnv({schema:{},schemaId:r});if(n=_l.resolveSchema.call(this,i,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}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 n=YO.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let r=e[this.opts.schemaId];return r&&(r=(0,El.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let r;if(typeof e=="string")r=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=r);else if(typeof e=="object"&&n===void 0){if(n=e,r=n.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(RW.call(this,r,n),!n)return(0,Zb.eachItem)(r,s=>Qb.call(this,s)),this;DW.call(this,n);let i={...n,type:(0,np.getJSONTypes)(n.type),schemaType:(0,np.getJSONTypes)(n.schemaType)};return(0,Zb.eachItem)(r,i.type.length===0?s=>Qb.call(this,s,i):s=>i.type.forEach(o=>Qb.call(this,s,i,o))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let r of n.rules){let i=r.rules.findIndex(s=>s.keyword===e);i>=0&&r.rules.splice(i,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${r}${i.instancePath} ${i.message}`).reduce((i,s)=>i+n+s)}$dataMetaSchema(e,n){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of n){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in r){let c=r[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=JO(u))}}return e}_removeAllSchemas(e,n){for(let r in e){let i=e[r];(!n||n.test(r))&&(typeof i=="string"?delete e[r]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[r]))}}_addSchema(e,n,r,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;r=(0,El.normalizeId)(o||r);let l=El.getSchemaRefs.call(this,e,r);return c=new _l.SchemaEnv({schema:e,schemaId:a,meta:n,baseId:r,localRefs:l}),this._cache.set(c.schema,c),s&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=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):_l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{_l.compileSchema.call(this,e)}finally{this.opts=n}}};wl.ValidationError=fW.default;wl.MissingRefError=KO.default;Yt.default=wl;function GO(t,e,n,r="error"){for(let i in t){let s=i;s in e&&this.logger[r](`${n}: option ${i}. ${t[s]}`)}}function YO(t){return t=(0,El.normalizeId)(t),this.schemas[t]||this.refs[t]}function SW(){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 _W(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function EW(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 n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function wW(){let t={...this.opts};for(let e of gW)delete t[e];return t}var kW={log(){},warn(){},error(){}};function NW(t){if(t===!1)return kW;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 PW=/^[a-z_$][a-z0-9_$:-]*$/i;function RW(t,e){let{RULES:n}=this;if((0,Zb.eachItem)(t,r=>{if(n.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!PW.test(r))throw new Error(`Keyword ${r} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Qb(t,e,n){var r;let i=e?.post;if(n&&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===n);if(o||(o={type:n,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,np.getJSONTypes)(e.type),schemaType:(0,np.getJSONTypes)(e.schemaType)}};e.before?CW.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function CW(t,e,n){let r=t.rules.findIndex(i=>i.keyword===n);r>=0?t.rules.splice(r,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function DW(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=JO(e)),t.validateSchema=this.compile(e,!0))}var AW={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function JO(t){return{anyOf:[t,AW]}}});var ZO=k(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});var OW={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};eT.default=OW});var sp=k(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.callRef=Vs.getValidate=void 0;var IW=bl(),eI=nr(),On=fe(),va=tr(),tI=Tl(),rp=be(),xW={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:r}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=r,{root:l}=s;if((n==="#"||n==="#/")&&i===l.baseId)return d();let u=tI.resolveRef.call(c,l,i,n);if(u===void 0)throw new IW.default(r.opts.uriResolver,i,n);if(u instanceof tI.SchemaEnv)return f(u);return h(u);function d(){if(s===l)return ip(t,o,s,s.$async);let y=e.scopeValue("root",{ref:l});return ip(t,(0,On._)`${y}.validate`,l,l.$async)}function f(y){let p=nI(t,y);ip(t,p,y,y.$async)}function h(y){let p=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,On.stringify)(y)}:{ref:y}),T=e.name("valid"),_=t.subschema({schema:y,dataTypes:[],schemaPath:On.nil,topSchemaRef:p,errSchemaPath:n},T);t.mergeEvaluated(_),t.ok(T)}}};function nI(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,On._)`${n.scopeValue("wrapper",{ref:e})}.validate`}Vs.getValidate=nI;function ip(t,e,n,r){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?va.default.this:On.nil;r?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,On._)`await ${(0,eI.callValidateCode)(t,e,l)}`),h(e),o||i.assign(y,!0)},p=>{i.if((0,On._)`!(${p} instanceof ${s.ValidationError})`,()=>i.throw(p)),f(p),o||i.assign(y,!1)}),t.ok(y)}function d(){t.result((0,eI.callValidateCode)(t,e,l),()=>h(e),()=>f(e))}function f(y){let p=(0,On._)`${y}.errors`;i.assign(va.default.vErrors,(0,On._)`${va.default.vErrors} === null ? ${p} : ${va.default.vErrors}.concat(${p})`),i.assign(va.default.errors,(0,On._)`${va.default.vErrors}.length`)}function h(y){var p;if(!s.opts.unevaluated)return;let T=(p=n?.validate)===null||p===void 0?void 0:p.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=rp.mergeEvaluated.props(i,T.props,s.props));else{let _=i.var("props",(0,On._)`${y}.evaluated.props`);s.props=rp.mergeEvaluated.props(i,_,s.props,On.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=rp.mergeEvaluated.items(i,T.items,s.items));else{let _=i.var("items",(0,On._)`${y}.evaluated.items`);s.items=rp.mergeEvaluated.items(i,_,s.items,On.Name)}}}Vs.callRef=ip;Vs.default=xW});var rI=k(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});var MW=ZO(),LW=sp(),$W=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",MW.default,LW.default];tT.default=$W});var iI=k(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});var op=fe(),cs=op.operators,ap={maximum:{okStr:"<=",ok:cs.LTE,fail:cs.GT},minimum:{okStr:">=",ok:cs.GTE,fail:cs.LT},exclusiveMaximum:{okStr:"<",ok:cs.LT,fail:cs.GTE},exclusiveMinimum:{okStr:">",ok:cs.GT,fail:cs.LTE}},qW={message:({keyword:t,schemaCode:e})=>(0,op.str)`must be ${ap[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,op._)`{comparison: ${ap[t].okStr}, limit: ${e}}`},jW={keyword:Object.keys(ap),type:"number",schemaType:"number",$data:!0,error:qW,code(t){let{keyword:e,data:n,schemaCode:r}=t;t.fail$data((0,op._)`${n} ${ap[e].fail} ${r} || isNaN(${n})`)}};nT.default=jW});var sI=k(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});var kl=fe(),FW={message:({schemaCode:t})=>(0,kl.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,kl._)`{multipleOf: ${t}}`},BW={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:FW,code(t){let{gen:e,data:n,schemaCode:r,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,kl._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,kl._)`${o} !== parseInt(${o})`;t.fail$data((0,kl._)`(${r} === 0 || (${o} = ${n}/${r}, ${a}))`)}};rT.default=BW});var aI=k(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});function oI(t){let e=t.length,n=0,r=0,i;for(;r<e;)n++,i=t.charCodeAt(r++),i>=55296&&i<=56319&&r<e&&(i=t.charCodeAt(r),(i&64512)===56320&&r++);return n}iT.default=oI;oI.code='require("ajv/dist/runtime/ucs2length").default'});var cI=k(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});var zs=fe(),UW=be(),VW=aI(),zW={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,zs.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,zs._)`{limit: ${t}}`},WW={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:zW,code(t){let{keyword:e,data:n,schemaCode:r,it:i}=t,s=e==="maxLength"?zs.operators.GT:zs.operators.LT,o=i.opts.unicode===!1?(0,zs._)`${n}.length`:(0,zs._)`${(0,UW.useFunc)(t.gen,VW.default)}(${n})`;t.fail$data((0,zs._)`${o} ${s} ${r}`)}};sT.default=WW});var lI=k(oT=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});var HW=nr(),cp=fe(),GW={message:({schemaCode:t})=>(0,cp.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,cp._)`{pattern: ${t}}`},YW={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:GW,code(t){let{data:e,$data:n,schema:r,schemaCode:i,it:s}=t,o=s.opts.unicodeRegExp?"u":"",a=n?(0,cp._)`(new RegExp(${i}, ${o}))`:(0,HW.usePattern)(t,r);t.fail$data((0,cp._)`!${a}.test(${e})`)}};oT.default=YW});var uI=k(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});var Nl=fe(),KW={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,Nl.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,Nl._)`{limit: ${t}}`},XW={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:KW,code(t){let{keyword:e,data:n,schemaCode:r}=t,i=e==="maxProperties"?Nl.operators.GT:Nl.operators.LT;t.fail$data((0,Nl._)`Object.keys(${n}).length ${i} ${r}`)}};aT.default=XW});var dI=k(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});var Pl=nr(),Rl=fe(),JW=be(),QW={message:({params:{missingProperty:t}})=>(0,Rl.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Rl._)`{missingProperty: ${t}}`},ZW={keyword:"required",type:"object",schemaType:"array",$data:!0,error:QW,code(t){let{gen:e,schema:n,schemaCode:r,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&n.length===0)return;let c=n.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:y}=t.it;for(let p of n)if(h?.[p]===void 0&&!y.has(p)){let T=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${p}" is not defined at "${T}" (strictRequired)`;(0,JW.checkStrictMode)(o,_,o.opts.strictRequired)}}function l(){if(c||s)t.block$data(Rl.nil,d);else for(let h of n)(0,Pl.checkReportMissingProp)(t,h)}function u(){let h=e.let("missing");if(c||s){let y=e.let("valid",!0);t.block$data(y,()=>f(h,y)),t.ok(y)}else e.if((0,Pl.checkMissingProp)(t,n,h)),(0,Pl.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",r,h=>{t.setParams({missingProperty:h}),e.if((0,Pl.noPropertyInData)(e,i,h,a.ownProperties),()=>t.error())})}function f(h,y){t.setParams({missingProperty:h}),e.forOf(h,r,()=>{e.assign(y,(0,Pl.propertyInData)(e,i,h,a.ownProperties)),e.if((0,Rl.not)(y),()=>{t.error(),e.break()})},Rl.nil)}}};cT.default=ZW});var fI=k(lT=>{"use strict";Object.defineProperty(lT,"__esModule",{value:!0});var Cl=fe(),eH={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,Cl.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,Cl._)`{limit: ${t}}`},tH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:eH,code(t){let{keyword:e,data:n,schemaCode:r}=t,i=e==="maxItems"?Cl.operators.GT:Cl.operators.LT;t.fail$data((0,Cl._)`${n}.length ${i} ${r}`)}};lT.default=tH});var lp=k(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});var hI=Mb();hI.code='require("ajv/dist/runtime/equal").default';uT.default=hI});var pI=k(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});var dT=pl(),Kt=fe(),nH=be(),rH=lp(),iH={message:({params:{i:t,j:e}})=>(0,Kt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Kt._)`{i: ${t}, j: ${e}}`},sH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:iH,code(t){let{gen:e,data:n,$data:r,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!r&&!i)return;let c=e.let("valid"),l=s.items?(0,dT.getSchemaTypes)(s.items):[];t.block$data(c,u,(0,Kt._)`${o} === false`),t.ok(c);function u(){let y=e.let("i",(0,Kt._)`${n}.length`),p=e.let("j");t.setParams({i:y,j:p}),e.assign(c,!0),e.if((0,Kt._)`${y} > 1`,()=>(d()?f:h)(y,p))}function d(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function f(y,p){let T=e.name("item"),_=(0,dT.checkDataTypes)(l,T,a.opts.strictNumbers,dT.DataType.Wrong),v=e.const("indices",(0,Kt._)`{}`);e.for((0,Kt._)`;${y}--;`,()=>{e.let(T,(0,Kt._)`${n}[${y}]`),e.if(_,(0,Kt._)`continue`),l.length>1&&e.if((0,Kt._)`typeof ${T} == "string"`,(0,Kt._)`${T} += "_"`),e.if((0,Kt._)`typeof ${v}[${T}] == "number"`,()=>{e.assign(p,(0,Kt._)`${v}[${T}]`),t.error(),e.assign(c,!1).break()}).code((0,Kt._)`${v}[${T}] = ${y}`)})}function h(y,p){let T=(0,nH.useFunc)(e,rH.default),_=e.name("outer");e.label(_).for((0,Kt._)`;${y}--;`,()=>e.for((0,Kt._)`${p} = ${y}; ${p}--;`,()=>e.if((0,Kt._)`${T}(${n}[${y}], ${n}[${p}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};fT.default=sH});var mI=k(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});var hT=fe(),oH=be(),aH=lp(),cH={message:"must be equal to constant",params:({schemaCode:t})=>(0,hT._)`{allowedValue: ${t}}`},lH={keyword:"const",$data:!0,error:cH,code(t){let{gen:e,data:n,$data:r,schemaCode:i,schema:s}=t;r||s&&typeof s=="object"?t.fail$data((0,hT._)`!${(0,oH.useFunc)(e,aH.default)}(${n}, ${i})`):t.fail((0,hT._)`${s} !== ${n}`)}};pT.default=lH});var gI=k(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});var Dl=fe(),uH=be(),dH=lp(),fH={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Dl._)`{allowedValues: ${t}}`},hH={keyword:"enum",schemaType:"array",$data:!0,error:fH,code(t){let{gen:e,data:n,$data:r,schema:i,schemaCode:s,it:o}=t;if(!r&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,uH.useFunc)(e,dH.default)),u;if(a||r)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let h=e.const("vSchema",s);u=(0,Dl.or)(...i.map((y,p)=>f(h,p)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",s,h=>e.if((0,Dl._)`${l()}(${n}, ${h})`,()=>e.assign(u,!0).break()))}function f(h,y){let p=i[y];return typeof p=="object"&&p!==null?(0,Dl._)`${l()}(${n}, ${h}[${y}])`:(0,Dl._)`${n} === ${p}`}}};mT.default=hH});var yI=k(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});var pH=iI(),mH=sI(),gH=cI(),yH=lI(),vH=uI(),bH=dI(),TH=fI(),SH=pI(),_H=mI(),EH=gI(),wH=[pH.default,mH.default,gH.default,yH.default,vH.default,bH.default,TH.default,SH.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},_H.default,EH.default];gT.default=wH});var vT=k(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.validateAdditionalItems=void 0;var Ws=fe(),yT=be(),kH={message:({params:{len:t}})=>(0,Ws.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ws._)`{limit: ${t}}`},NH={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:kH,code(t){let{parentSchema:e,it:n}=t,{items:r}=e;if(!Array.isArray(r)){(0,yT.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}vI(t,r)}};function vI(t,e){let{gen:n,schema:r,data:i,keyword:s,it:o}=t;o.items=!0;let a=n.const("len",(0,Ws._)`${i}.length`);if(r===!1)t.setParams({len:e.length}),t.pass((0,Ws._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,yT.alwaysValidSchema)(o,r)){let l=n.var("valid",(0,Ws._)`${a} <= ${e.length}`);n.if((0,Ws.not)(l),()=>c(l)),t.ok(l)}function c(l){n.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:yT.Type.Num},l),o.allErrors||n.if((0,Ws.not)(l),()=>n.break())})}}Al.validateAdditionalItems=vI;Al.default=NH});var bT=k(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.validateTuple=void 0;var bI=fe(),up=be(),PH=nr(),RH={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return TI(t,"additionalItems",e);n.items=!0,!(0,up.alwaysValidSchema)(n,e)&&t.ok((0,PH.validateArray)(t))}};function TI(t,e,n=t.schema){let{gen:r,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=up.mergeEvaluated.items(r,n.length,a.items));let c=r.name("valid"),l=r.const("len",(0,bI._)`${s}.length`);n.forEach((d,f)=>{(0,up.alwaysValidSchema)(a,d)||(r.if((0,bI._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:h}=a,y=n.length,p=y===d.minItems&&(y===d.maxItems||d[e]===!1);if(f.strictTuples&&!p){let T=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,up.checkStrictMode)(a,T,f.strictTuples)}}}Ol.validateTuple=TI;Ol.default=RH});var SI=k(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});var CH=bT(),DH={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,CH.validateTuple)(t,"items")};TT.default=DH});var EI=k(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});var _I=fe(),AH=be(),OH=nr(),IH=vT(),xH={message:({params:{len:t}})=>(0,_I.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,_I._)`{limit: ${t}}`},MH={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:xH,code(t){let{schema:e,parentSchema:n,it:r}=t,{prefixItems:i}=n;r.items=!0,!(0,AH.alwaysValidSchema)(r,e)&&(i?(0,IH.validateAdditionalItems)(t,i):t.ok((0,OH.validateArray)(t)))}};ST.default=MH});var wI=k(_T=>{"use strict";Object.defineProperty(_T,"__esModule",{value:!0});var ir=fe(),dp=be(),LH={message:({params:{min:t,max:e}})=>e===void 0?(0,ir.str)`must contain at least ${t} valid item(s)`:(0,ir.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,ir._)`{minContains: ${t}}`:(0,ir._)`{minContains: ${t}, maxContains: ${e}}`},$H={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:LH,code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:s}=t,o,a,{minContains:c,maxContains:l}=r;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,ir._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,dp.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,dp.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,dp.alwaysValidSchema)(s,n)){let p=(0,ir._)`${u} >= ${o}`;a!==void 0&&(p=(0,ir._)`${p} && ${u} <= ${a}`),t.pass(p);return}s.items=!0;let d=e.name("valid");a===void 0&&o===1?h(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,ir._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let p=e.name("_valid"),T=e.let("count",0);h(p,()=>e.if(p,()=>y(T)))}function h(p,T){e.forRange("i",0,u,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:dp.Type.Num,compositeRule:!0},p),T()})}function y(p){e.code((0,ir._)`${p}++`),a===void 0?e.if((0,ir._)`${p} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,ir._)`${p} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,ir._)`${p} >= ${o}`,()=>e.assign(d,!0)))}}};_T.default=$H});var fp=k(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateSchemaDeps=Zr.validatePropertyDeps=Zr.error=void 0;var ET=fe(),qH=be(),Il=nr();Zr.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let r=e===1?"property":"properties";return(0,ET.str)`must have ${r} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:r}})=>(0,ET._)`{property: ${t},
|
|
179
|
+
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,he._)`[${i}]`)}}}function P2({gen:t,parentData:e,parentDataProperty:n},r){t.if((0,he._)`${e} !== undefined`,()=>t.assign((0,he._)`${e}[${n}]`,r))}function Ab(t,e,n,r=ma.Correct){let i=r===ma.Correct?he.operators.EQ:he.operators.NEQ,s;switch(t){case"null":return(0,he._)`${e} ${i} null`;case"array":s=(0,he._)`Array.isArray(${e})`;break;case"object":s=(0,he._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,he._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,he._)`typeof ${e} ${i} ${t}`}return r===ma.Correct?s:(0,he.not)(s);function o(a=he.nil){return(0,he.and)((0,he._)`typeof ${e} == "number"`,a,n?(0,he._)`isFinite(${e})`:he.nil)}}cn.checkDataType=Ab;function Ob(t,e,n,r){if(t.length===1)return Ab(t[0],e,n,r);let i,s=(0,JA.toHash)(t);if(s.array&&s.object){let o=(0,he._)`typeof ${e} != "object"`;i=s.null?o:(0,he._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=he.nil;s.number&&delete s.integer;for(let o in s)i=(0,he.and)(i,Ab(o,e,n,r));return i}cn.checkDataTypes=Ob;var R2={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,he._)`{type: ${t}}`:(0,he._)`{type: ${e}}`};function Ib(t){let e=C2(t);(0,_2.reportError)(e,R2)}cn.reportTypeError=Ib;function C2(t){let{gen:e,data:n,schema:r}=t,i=(0,JA.schemaRefOrVal)(t,r,"type");return{gen:e,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:t}}});var tO=w(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.assignDefaults=void 0;var ga=fe(),D2=be();function A2(t,e){let{properties:n,items:r}=t.schema;if(e==="object"&&n)for(let i in n)eO(t,i,n[i].default);else e==="array"&&Array.isArray(r)&&r.forEach((i,s)=>eO(t,s,i.default))}Kh.assignDefaults=A2;function eO(t,e,n){let{gen:r,compositeRule:i,data:s,opts:o}=t;if(n===void 0)return;let a=(0,ga._)`${s}${(0,ga.getProperty)(e)}`;if(i){(0,D2.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,ga._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,ga._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,ga._)`${a} = ${(0,ga.stringify)(n)}`)}});var ir=w(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.validateUnion=Ye.validateArray=Ye.usePattern=Ye.callValidateCode=Ye.schemaProperties=Ye.allSchemaProperties=Ye.noPropertyInData=Ye.propertyInData=Ye.isOwnProperty=Ye.hasPropFunc=Ye.reportMissingProp=Ye.checkMissingProp=Ye.checkReportMissingProp=void 0;var lt=fe(),xb=be(),ss=rr(),O2=be();function I2(t,e){let{gen:n,data:r,it:i}=t;n.if(Lb(n,r,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,lt._)`${e}`},!0),t.error()})}Ye.checkReportMissingProp=I2;function x2({gen:t,data:e,it:{opts:n}},r,i){return(0,lt.or)(...r.map(s=>(0,lt.and)(Lb(t,e,s,n.ownProperties),(0,lt._)`${i} = ${s}`)))}Ye.checkMissingProp=x2;function M2(t,e){t.setParams({missingProperty:e},!0),t.error()}Ye.reportMissingProp=M2;function nO(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,lt._)`Object.prototype.hasOwnProperty`})}Ye.hasPropFunc=nO;function Mb(t,e,n){return(0,lt._)`${nO(t)}.call(${e}, ${n})`}Ye.isOwnProperty=Mb;function L2(t,e,n,r){let i=(0,lt._)`${e}${(0,lt.getProperty)(n)} !== undefined`;return r?(0,lt._)`${i} && ${Mb(t,e,n)}`:i}Ye.propertyInData=L2;function Lb(t,e,n,r){let i=(0,lt._)`${e}${(0,lt.getProperty)(n)} === undefined`;return r?(0,lt.or)(i,(0,lt.not)(Mb(t,e,n))):i}Ye.noPropertyInData=Lb;function rO(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ye.allSchemaProperties=rO;function $2(t,e){return rO(e).filter(n=>!(0,xb.alwaysValidSchema)(t,e[n]))}Ye.schemaProperties=$2;function q2({schemaCode:t,data:e,it:{gen:n,topSchemaRef:r,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,lt._)`${t}, ${e}, ${r}${i}`:e,d=[[ss.default.instancePath,(0,lt.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,lt._)`${u}, ${n.object(...d)}`;return c!==lt.nil?(0,lt._)`${a}.call(${c}, ${f})`:(0,lt._)`${a}(${f})`}Ye.callValidateCode=q2;var j2=(0,lt._)`new RegExp`;function F2({gen:t,it:{opts:e}},n){let r=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(n,r);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,lt._)`${i.code==="new RegExp"?j2:(0,O2.useFunc)(t,i)}(${n}, ${r})`})}Ye.usePattern=F2;function B2(t){let{gen:e,data:n,keyword:r,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,lt._)`${n}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:r,dataProp:l,dataPropType:xb.Type.Num},s),e.if((0,lt.not)(s),a)})}}Ye.validateArray=B2;function U2(t){let{gen:e,schema:n,keyword:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(c=>(0,xb.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>n.forEach((c,l)=>{let u=t.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,lt._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,lt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ye.validateUnion=U2});var oO=w(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.validateKeywordUsage=Qr.validSchemaType=Qr.funcKeywordCode=Qr.macroKeywordCode=void 0;var gn=fe(),Us=rr(),V2=ir(),z2=yl();function W2(t,e){let{gen:n,keyword:r,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),c=sO(n,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=n.name("valid");t.subschema({schema:a,schemaPath:gn.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Qr.macroKeywordCode=W2;function H2(t,e){var n;let{gen:r,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=t;Y2(c,e);let l=!a&&e.compile?e.compile.call(c.self,s,o,c):e.validate,u=sO(r,i,l),d=r.let("valid");t.block$data(d,f),t.ok((n=e.valid)!==null&&n!==void 0?n:d);function f(){if(e.errors===!1)p(),e.modifying&&iO(t),T(()=>t.error());else{let _=e.async?h():y();e.modifying&&iO(t),T(()=>G2(t,_))}}function h(){let _=r.let("ruleErrs",null);return r.try(()=>p((0,gn._)`await `),v=>r.assign(d,!1).if((0,gn._)`${v} instanceof ${c.ValidationError}`,()=>r.assign(_,(0,gn._)`${v}.errors`),()=>r.throw(v))),_}function y(){let _=(0,gn._)`${u}.errors`;return r.assign(_,null),p(gn.nil),_}function p(_=e.async?(0,gn._)`await `:gn.nil){let v=c.opts.passContext?Us.default.this:Us.default.self,b=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,gn._)`${_}${(0,V2.callValidateCode)(t,u,v,b)}`,e.modifying)}function T(_){var v;r.if((0,gn.not)((v=e.valid)!==null&&v!==void 0?v:d),_)}}Qr.funcKeywordCode=H2;function iO(t){let{gen:e,data:n,it:r}=t;e.if(r.parentData,()=>e.assign(n,(0,gn._)`${r.parentData}[${r.parentDataProperty}]`))}function G2(t,e){let{gen:n}=t;n.if((0,gn._)`Array.isArray(${e})`,()=>{n.assign(Us.default.vErrors,(0,gn._)`${Us.default.vErrors} === null ? ${e} : ${Us.default.vErrors}.concat(${e})`).assign(Us.default.errors,(0,gn._)`${Us.default.vErrors}.length`),(0,z2.extendErrors)(t)},()=>t.error())}function Y2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function sO(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,gn.stringify)(n)})}function K2(t,e,n=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||n&&typeof t>"u")}Qr.validSchemaType=K2;function X2({schema:t,opts:e,self:n,errSchemaPath:r},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 "${r}": `+n.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(c);else throw new Error(c)}}Qr.validateKeywordUsage=X2});var cO=w(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.extendSubschemaMode=os.extendSubschemaData=os.getSubschema=void 0;var Zr=fe(),aO=be();function J2(t,{keyword:e,schemaProp:n,schema:r,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return n===void 0?{schema:a,schemaPath:(0,Zr._)`${t.schemaPath}${(0,Zr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[n],schemaPath:(0,Zr._)`${t.schemaPath}${(0,Zr.getProperty)(e)}${(0,Zr.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,aO.escapeFragment)(n)}`}}if(r!==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:r,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}os.getSubschema=J2;function Q2(t,e,{dataProp:n,dataPropType:r,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Zr._)`${e.data}${(0,Zr.getProperty)(n)}`,!0);c(f),t.errorPath=(0,Zr.str)`${l}${(0,aO.getErrorPath)(n,r,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Zr._)`${n}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof Zr.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]}}os.extendSubschemaData=Q2;function Z2(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:s}){r!==void 0&&(t.compositeRule=r),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=n}os.extendSubschemaMode=Z2});var $b=w((Wse,lO)=>{"use strict";lO.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}});var dO=w((Hse,uO)=>{"use strict";var as=uO.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var r=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};Xh(e,r,i,t,"",t)};as.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};as.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};as.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};as.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 Xh(t,e,n,r,i,s,o,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,i,s,o,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in as.arrayKeywords)for(var f=0;f<d.length;f++)Xh(t,e,n,d[f],i+"/"+u+"/"+f,s,i,u,r,f)}else if(u in as.propsKeywords){if(d&&typeof d=="object")for(var h in d)Xh(t,e,n,d[h],i+"/"+u+"/"+ez(h),s,i,u,r,h)}else(u in as.keywords||t.allKeys&&!(u in as.skipKeywords))&&Xh(t,e,n,d,i+"/"+u,s,i,u,r)}n(r,i,s,o,a,c,l)}}function ez(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var bl=w(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.getSchemaRefs=An.resolveUrl=An.normalizeId=An._getFullPath=An.getFullPath=An.inlineRef=void 0;var tz=be(),nz=$b(),rz=dO(),iz=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function sz(t,e=!0){return typeof t=="boolean"?!0:e===!0?!qb(t):e?fO(t)<=e:!1}An.inlineRef=sz;var oz=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qb(t){for(let e in t){if(oz.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(qb)||typeof n=="object"&&qb(n))return!0}return!1}function fO(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!iz.has(n)&&(typeof t[n]=="object"&&(0,tz.eachItem)(t[n],r=>e+=fO(r)),e===1/0))return 1/0}return e}function hO(t,e="",n){n!==!1&&(e=ya(e));let r=t.parse(e);return pO(t,r)}An.getFullPath=hO;function pO(t,e){return t.serialize(e).split("#")[0]+"#"}An._getFullPath=pO;var az=/#\/?$/;function ya(t){return t?t.replace(az,""):""}An.normalizeId=ya;function cz(t,e,n){return n=ya(n),t.resolve(e,n)}An.resolveUrl=cz;var lz=/^[a-z_][-a-z0-9._]*$/i;function uz(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,i=ya(t[n]||e),s={"":i},o=hO(r,i,!1),a={},c=new Set;return rz(t,{allKeys:!0},(d,f,h,y)=>{if(y===void 0)return;let p=o+f,T=s[y];typeof d[n]=="string"&&(T=_.call(this,d[n])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),s[f]=T;function _(b){let k=this.opts.uriResolver.resolve;if(b=ya(T?k(T,b):b),c.has(b))throw u(b);c.add(b);let C=this.refs[b];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?l(d,C.schema,b):b!==ya(p)&&(b[0]==="#"?(l(d,a[b],b),a[b]=d):this.refs[b]=p),b}function v(b){if(typeof b=="string"){if(!lz.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}}),a;function l(d,f,h){if(f!==void 0&&!nz(d,f))throw u(h)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}An.getSchemaRefs=uz});var _l=w(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.getData=cs.KeywordCxt=cs.validateFunctionCode=void 0;var bO=YA(),mO=vl(),Fb=Db(),Jh=vl(),dz=tO(),Sl=oO(),jb=cO(),Q=fe(),oe=rr(),fz=bl(),_i=be(),Tl=yl();function hz(t){if(_O(t)&&(EO(t),SO(t))){gz(t);return}TO(t,()=>(0,bO.topBoolOrEmptySchema)(t))}cs.validateFunctionCode=hz;function TO({gen:t,validateName:e,schema:n,schemaEnv:r,opts:i},s){i.code.es5?t.func(e,(0,Q._)`${oe.default.data}, ${oe.default.valCxt}`,r.$async,()=>{t.code((0,Q._)`"use strict"; ${gO(n,i)}`),mz(t,i),t.code(s)}):t.func(e,(0,Q._)`${oe.default.data}, ${pz(i)}`,r.$async,()=>t.code(gO(n,i)).code(s))}function pz(t){return(0,Q._)`{${oe.default.instancePath}="", ${oe.default.parentData}, ${oe.default.parentDataProperty}, ${oe.default.rootData}=${oe.default.data}${t.dynamicRef?(0,Q._)`, ${oe.default.dynamicAnchors}={}`:Q.nil}}={}`}function mz(t,e){t.if(oe.default.valCxt,()=>{t.var(oe.default.instancePath,(0,Q._)`${oe.default.valCxt}.${oe.default.instancePath}`),t.var(oe.default.parentData,(0,Q._)`${oe.default.valCxt}.${oe.default.parentData}`),t.var(oe.default.parentDataProperty,(0,Q._)`${oe.default.valCxt}.${oe.default.parentDataProperty}`),t.var(oe.default.rootData,(0,Q._)`${oe.default.valCxt}.${oe.default.rootData}`),e.dynamicRef&&t.var(oe.default.dynamicAnchors,(0,Q._)`${oe.default.valCxt}.${oe.default.dynamicAnchors}`)},()=>{t.var(oe.default.instancePath,(0,Q._)`""`),t.var(oe.default.parentData,(0,Q._)`undefined`),t.var(oe.default.parentDataProperty,(0,Q._)`undefined`),t.var(oe.default.rootData,oe.default.data),e.dynamicRef&&t.var(oe.default.dynamicAnchors,(0,Q._)`{}`)})}function gz(t){let{schema:e,opts:n,gen:r}=t;TO(t,()=>{n.$comment&&e.$comment&&wO(t),Sz(t),r.let(oe.default.vErrors,null),r.let(oe.default.errors,0),n.unevaluated&&yz(t),kO(t),kz(t)})}function yz(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,Q._)`${n}.evaluated`),e.if((0,Q._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Q._)`${t.evaluated}.props`,(0,Q._)`undefined`)),e.if((0,Q._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Q._)`${t.evaluated}.items`,(0,Q._)`undefined`))}function gO(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,Q._)`/*# sourceURL=${n} */`:Q.nil}function vz(t,e){if(_O(t)&&(EO(t),SO(t))){bz(t,e);return}(0,bO.boolOrEmptySchema)(t,e)}function SO({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function _O(t){return typeof t.schema!="boolean"}function bz(t,e){let{schema:n,gen:r,opts:i}=t;i.$comment&&n.$comment&&wO(t),_z(t),Ez(t);let s=r.const("_errs",oe.default.errors);kO(t,s),r.var(e,(0,Q._)`${s} === ${oe.default.errors}`)}function EO(t){(0,_i.checkUnknownRules)(t),Tz(t)}function kO(t,e){if(t.opts.jtd)return yO(t,[],!1,e);let n=(0,mO.getSchemaTypes)(t.schema),r=(0,mO.coerceAndCheckDataType)(t,n);yO(t,n,!r,e)}function Tz(t){let{schema:e,errSchemaPath:n,opts:r,self:i}=t;e.$ref&&r.ignoreKeywordsWithRef&&(0,_i.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function Sz(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,_i.checkStrictMode)(t,"default is ignored in the schema root")}function _z(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,fz.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Ez(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function wO({gen:t,schemaEnv:e,schema:n,errSchemaPath:r,opts:i}){let s=n.$comment;if(i.$comment===!0)t.code((0,Q._)`${oe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,Q.str)`${r}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,Q._)`${oe.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function kz(t){let{gen:e,schemaEnv:n,validateName:r,ValidationError:i,opts:s}=t;n.$async?e.if((0,Q._)`${oe.default.errors} === 0`,()=>e.return(oe.default.data),()=>e.throw((0,Q._)`new ${i}(${oe.default.vErrors})`)):(e.assign((0,Q._)`${r}.errors`,oe.default.vErrors),s.unevaluated&&wz(t),e.return((0,Q._)`${oe.default.errors} === 0`))}function wz({gen:t,evaluated:e,props:n,items:r}){n instanceof Q.Name&&t.assign((0,Q._)`${e}.props`,n),r instanceof Q.Name&&t.assign((0,Q._)`${e}.items`,r)}function yO(t,e,n,r){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,_i.schemaHasRulesButRef)(s,u))){i.block(()=>PO(t,"$ref",u.all.$ref.definition));return}c.jtd||Nz(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,Fb.shouldUseGroup)(s,f)&&(f.type?(i.if((0,Jh.checkDataType)(f.type,o,c.strictNumbers)),vO(t,f),e.length===1&&e[0]===f.type&&n&&(i.else(),(0,Jh.reportTypeError)(t)),i.endIf()):vO(t,f),a||i.if((0,Q._)`${oe.default.errors} === ${r||0}`))}}function vO(t,e){let{gen:n,schema:r,opts:{useDefaults:i}}=t;i&&(0,dz.assignDefaults)(t,e.type),n.block(()=>{for(let s of e.rules)(0,Fb.shouldUseRule)(r,s)&&PO(t,s.keyword,s.definition,e.type)})}function Nz(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Pz(t,e),t.opts.allowUnionTypes||Rz(t,e),Cz(t,t.dataTypes))}function Pz(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{NO(t.dataTypes,n)||Bb(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),Az(t,e)}}function Rz(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Bb(t,"use allowUnionTypes to allow union type keyword")}function Cz(t,e){let n=t.self.RULES.all;for(let r in n){let i=n[r];if(typeof i=="object"&&(0,Fb.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>Dz(e,o))&&Bb(t,`missing type "${s.join(",")}" for keyword "${r}"`)}}}function Dz(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function NO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Az(t,e){let n=[];for(let r of t.dataTypes)NO(e,r)?n.push(r):e.includes("integer")&&r==="number"&&n.push("integer");t.dataTypes=n}function Bb(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,_i.checkStrictMode)(t,e,t.opts.strictTypes)}var Qh=class{constructor(e,n,r){if((0,Sl.validateKeywordUsage)(e,n,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_i.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",RO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Sl.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",oe.default.errors))}result(e,n,r){this.failResult((0,Q.not)(e),n,r)}failResult(e,n,r){this.gen.if(e),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,Q.not)(e),void 0,n)}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:n}=this;this.fail((0,Q._)`${n} !== undefined && (${(0,Q.or)(this.invalid$data(),e)})`)}error(e,n,r){if(n){this.setParams(n),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,n){(e?Tl.reportExtraError:Tl.reportError)(this,this.def.error,n)}$dataError(){(0,Tl.reportError)(this,this.def.$dataError||Tl.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Tl.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,r=Q.nil){this.gen.block(()=>{this.check$data(e,r),n()})}check$data(e=Q.nil,n=Q.nil){if(!this.$data)return;let{gen:r,schemaCode:i,schemaType:s,def:o}=this;r.if((0,Q.or)((0,Q._)`${i} === undefined`,n)),e!==Q.nil&&r.assign(e,!0),(s.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Q.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:r,def:i,it:s}=this;return(0,Q.or)(o(),a());function o(){if(r.length){if(!(n instanceof Q.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,Q._)`${(0,Jh.checkDataTypes)(c,n,s.opts.strictNumbers,Jh.DataType.Wrong)}`}return Q.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,Q._)`!${c}(${n})`}return Q.nil}}subschema(e,n){let r=(0,jb.getSubschema)(this.it,e);(0,jb.extendSubschemaData)(r,this.it,e),(0,jb.extendSubschemaMode)(r,e);let i={...this.it,...r,items:void 0,props:void 0};return vz(i,n),i}mergeEvaluated(e,n){let{it:r,gen:i}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=_i.mergeEvaluated.props(i,e.props,r.props,n)),r.items!==!0&&e.items!==void 0&&(r.items=_i.mergeEvaluated.items(i,e.items,r.items,n)))}mergeValidEvaluated(e,n){let{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(n,()=>this.mergeEvaluated(e,Q.Name)),!0}};cs.KeywordCxt=Qh;function PO(t,e,n,r){let i=new Qh(t,n,e);"code"in n?n.code(i,r):i.$data&&n.validate?(0,Sl.funcKeywordCode)(i,n):"macro"in n?(0,Sl.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,Sl.funcKeywordCode)(i,n)}var Oz=/^\/(?:[^~]|~0|~1)*$/,Iz=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function RO(t,{dataLevel:e,dataNames:n,dataPathArr:r}){let i,s;if(t==="")return oe.default.rootData;if(t[0]==="/"){if(!Oz.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=oe.default.rootData}else{let l=Iz.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 r[e-u]}if(u>e)throw new Error(c("data",u));if(s=n[e-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,Q._)`${s}${(0,Q.getProperty)((0,_i.unescapeJsonPointer)(l))}`,o=(0,Q._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}cs.getData=RO});var Zh=w(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});var Ub=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Vb.default=Ub});var El=w(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var zb=bl(),Wb=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,zb.resolveUrl)(e,n,r),this.missingSchema=(0,zb.normalizeId)((0,zb.getFullPath)(e,this.missingRef))}};Hb.default=Wb});var kl=w(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.resolveSchema=sr.getCompilingSchema=sr.resolveRef=sr.compileSchema=sr.SchemaEnv=void 0;var Cr=fe(),xz=Zh(),Vs=rr(),Dr=bl(),CO=be(),Mz=_l(),va=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,Dr.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};sr.SchemaEnv=va;function Yb(t){let e=DO.call(this,t);if(e)return e;let n=(0,Dr.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Cr.CodeGen(this.scope,{es5:r,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:xz.default,code:(0,Cr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Vs.default.data,parentData:Vs.default.parentData,parentDataProperty:Vs.default.parentDataProperty,dataNames:[Vs.default.data],dataPathArr:[Cr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Cr.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:Cr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Cr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Mz.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(Vs.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let h=new Function(`${Vs.default.self}`,`${Vs.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:p}=l;h.evaluated={props:y instanceof Cr.Name?void 0:y,items:p instanceof Cr.Name?void 0:p,dynamicProps:y instanceof Cr.Name,dynamicItems:p instanceof Cr.Name},h.source&&(h.source.evaluated=(0,Cr.stringify)(h.evaluated))}return t.validate=h,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)}}sr.compileSchema=Yb;function Lz(t,e,n){var r;n=(0,Dr.resolveUrl)(this.opts.uriResolver,e,n);let i=t.refs[n];if(i)return i;let s=jz.call(this,t,n);if(s===void 0){let o=(r=t.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;o&&(s=new va({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[n]=$z.call(this,s)}sr.resolveRef=Lz;function $z(t){return(0,Dr.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Yb.call(this,t)}function DO(t){for(let e of this._compilations)if(qz(e,t))return e}sr.getCompilingSchema=DO;function qz(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function jz(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||ep.call(this,t,e)}function ep(t,e){let n=this.opts.uriResolver.parse(e),r=(0,Dr._getFullPath)(this.opts.uriResolver,n),i=(0,Dr.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===i)return Gb.call(this,n,t);let s=(0,Dr.normalizeId)(r),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=ep.call(this,t,o);return typeof a?.schema!="object"?void 0:Gb.call(this,n,a)}if(typeof o?.schema=="object"){if(o.validate||Yb.call(this,o),s===(0,Dr.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Dr.resolveUrl)(this.opts.uriResolver,i,l)),new va({schema:a,schemaId:c,root:t,baseId:i})}return Gb.call(this,n,o)}}sr.resolveSchema=ep;var Fz=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Gb(t,{baseId:e,schema:n,root:r}){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 n=="boolean")return;let c=n[(0,CO.unescapeFragment)(a)];if(c===void 0)return;n=c;let l=typeof n=="object"&&n[this.opts.schemaId];!Fz.has(a)&&l&&(e=(0,Dr.resolveUrl)(this.opts.uriResolver,e,l))}let s;if(typeof n!="boolean"&&n.$ref&&!(0,CO.schemaHasRulesButRef)(n,this.RULES)){let a=(0,Dr.resolveUrl)(this.opts.uriResolver,e,n.$ref);s=ep.call(this,r,a)}let{schemaId:o}=this.opts;if(s=s||new va({schema:n,schemaId:o,root:r,baseId:e}),s.schema!==s.root.schema)return s}});var AO=w((Qse,Bz)=>{Bz.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 IO=w((Zse,OO)=>{"use strict";var Uz={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};OO.exports={HEX:Uz}});var BO=w((eoe,FO)=>{"use strict";var{HEX:Vz}=IO(),zz=/^(?:(?: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 $O(t){if(jO(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(zz)||[],[n]=e;return n?{host:Hz(n,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function Kb(t,e=!1){let n="",r=!0;for(let i of t){if(Vz[i]===void 0)return;i!=="0"&&r===!0&&(r=!1),r||(n+=i)}return e&&n.length===0&&(n="0"),n}function Wz(t){let e=0,n={error:!1,address:"",zone:""},r=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=Kb(i);if(l!==void 0)r.push(l);else return n.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++,r.push(":"),e>7){n.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?n.zone=i.join(""):a?r.push(i.join("")):r.push(Kb(i))),n.address=r.join(""),n}function qO(t){if(jO(t,":")<2)return{host:t,isIPV6:!1};let e=Wz(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,r=e.address;return e.zone&&(n+="%"+e.zone,r+="%25"+e.zone),{host:n,escapedHost:r,isIPV6:!0}}}function Hz(t,e){let n="",r=!0,i=t.length;for(let s=0;s<i;s++){let o=t[s];o==="0"&&r?(s+1<=i&&t[s+1]===e||s+1===i)&&(n+=o,r=!1):(o===e?r=!0:r=!1,n+=o)}return n}function jO(t,e){let n=0;for(let r=0;r<t.length;r++)t[r]===e&&n++;return n}var xO=/^\.\.?\//u,MO=/^\/\.(?:\/|$)/u,LO=/^\/\.\.(?:\/|$)/u,Gz=/^\/?(?:.|\n)*?(?=\/|$)/u;function Yz(t){let e=[];for(;t.length;)if(t.match(xO))t=t.replace(xO,"");else if(t.match(MO))t=t.replace(MO,"/");else if(t.match(LO))t=t.replace(LO,"/"),e.pop();else if(t==="."||t==="..")t="";else{let n=t.match(Gz);if(n){let r=n[0];t=t.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function Kz(t,e){let n=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=n(t.scheme)),t.userinfo!==void 0&&(t.userinfo=n(t.userinfo)),t.host!==void 0&&(t.host=n(t.host)),t.path!==void 0&&(t.path=n(t.path)),t.query!==void 0&&(t.query=n(t.query)),t.fragment!==void 0&&(t.fragment=n(t.fragment)),t}function Xz(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host),r=$O(n);if(r.isIPV4)n=r.host;else{let i=qO(r.host);i.isIPV6===!0?n=`[${i.escapedHost}]`:n=t.host}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}FO.exports={recomposeAuthority:Xz,normalizeComponentEncoding:Kz,removeDotSegments:Yz,normalizeIPv4:$O,normalizeIPv6:qO,stringArrayToHexStripped:Kb}});var GO=w((toe,HO)=>{"use strict";var Jz=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,Qz=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function UO(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function VO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function zO(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 Zz(t){return t.secure=UO(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function eW(t){if((t.port===(UO(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,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function tW(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(Qz);if(n){let r=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let i=`${r}:${e.nid||t.nid}`,s=Xb[i];t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function nW(t,e){let n=e.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),i=`${n}:${e.nid||r}`,s=Xb[i];s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function rW(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!Jz.test(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function iW(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var WO={scheme:"http",domainHost:!0,parse:VO,serialize:zO},sW={scheme:"https",domainHost:WO.domainHost,parse:VO,serialize:zO},tp={scheme:"ws",domainHost:!0,parse:Zz,serialize:eW},oW={scheme:"wss",domainHost:tp.domainHost,parse:tp.parse,serialize:tp.serialize},aW={scheme:"urn",parse:tW,serialize:nW,skipNormalize:!0},cW={scheme:"urn:uuid",parse:rW,serialize:iW,skipNormalize:!0},Xb={http:WO,https:sW,ws:tp,wss:oW,urn:aW,"urn:uuid":cW};HO.exports=Xb});var KO=w((noe,rp)=>{"use strict";var{normalizeIPv6:lW,normalizeIPv4:uW,removeDotSegments:wl,recomposeAuthority:dW,normalizeComponentEncoding:np}=BO(),Jb=GO();function fW(t,e){return typeof t=="string"?t=ei(Ei(t,e),e):typeof t=="object"&&(t=Ei(ei(t,e),e)),t}function hW(t,e,n){let r=Object.assign({scheme:"null"},n),i=YO(Ei(t,r),Ei(e,r),r,!0);return ei(i,{...r,skipEscape:!0})}function YO(t,e,n,r){let i={};return r||(t=Ei(ei(t,n),n),e=Ei(ei(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=wl(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=wl(e.path||""),i.query=e.query):(e.path?(e.path.charAt(0)==="/"?i.path=wl(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=wl(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 pW(t,e,n){return typeof t=="string"?(t=unescape(t),t=ei(np(Ei(t,n),!0),{...n,skipEscape:!0})):typeof t=="object"&&(t=ei(np(t,!0),{...n,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=ei(np(Ei(e,n),!0),{...n,skipEscape:!0})):typeof e=="object"&&(e=ei(np(e,!0),{...n,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function ei(t,e){let n={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:""},r=Object.assign({},e),i=[],s=Jb[(r.scheme||n.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&i.push(n.scheme,":");let o=dW(n);if(o!==void 0&&(r.reference!=="suffix"&&i.push("//"),i.push(o),n.path&&n.path.charAt(0)!=="/"&&i.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!s||!s.absolutePath)&&(a=wl(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return n.query!==void 0&&i.push("?",n.query),n.fragment!==void 0&&i.push("#",n.fragment),i.join("")}var mW=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function gW(t){let e=0;for(let n=0,r=t.length;n<r;++n)if(e=t.charCodeAt(n),e>126||mW[e])return!0;return!1}var yW=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Ei(t,e){let n=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=t.indexOf("%")!==-1,s=!1;n.reference==="suffix"&&(t=(n.scheme?n.scheme+":":"")+"//"+t);let o=t.match(yW);if(o){if(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5]),r.host){let c=uW(r.host);if(c.isIPV4===!1){let l=lW(c.host);r.host=l.host.toLowerCase(),s=l.isIPV6}else r.host=c.host,s=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");let a=Jb[(n.scheme||r.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(n.domainHost||a&&a.domainHost)&&s===!1&&gW(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(c){r.error=r.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),i&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return r}var Qb={SCHEMES:Jb,normalize:fW,resolve:hW,resolveComponents:YO,equal:pW,serialize:ei,parse:Ei};rp.exports=Qb;rp.exports.default=Qb;rp.exports.fastUri=Qb});var JO=w(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var XO=KO();XO.code='require("ajv/dist/runtime/uri").default';Zb.default=XO});var sI=w(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.CodeGen=Kt.Name=Kt.nil=Kt.stringify=Kt.str=Kt._=Kt.KeywordCxt=void 0;var vW=_l();Object.defineProperty(Kt,"KeywordCxt",{enumerable:!0,get:function(){return vW.KeywordCxt}});var ba=fe();Object.defineProperty(Kt,"_",{enumerable:!0,get:function(){return ba._}});Object.defineProperty(Kt,"str",{enumerable:!0,get:function(){return ba.str}});Object.defineProperty(Kt,"stringify",{enumerable:!0,get:function(){return ba.stringify}});Object.defineProperty(Kt,"nil",{enumerable:!0,get:function(){return ba.nil}});Object.defineProperty(Kt,"Name",{enumerable:!0,get:function(){return ba.Name}});Object.defineProperty(Kt,"CodeGen",{enumerable:!0,get:function(){return ba.CodeGen}});var bW=Zh(),nI=El(),TW=Cb(),Nl=kl(),SW=fe(),Pl=bl(),ip=vl(),tT=be(),QO=AO(),_W=JO(),rI=(t,e)=>new RegExp(t,e);rI.code="new RegExp";var EW=["removeAdditional","useDefaults","coerceTypes"],kW=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),wW={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."},NW={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ZO=200;function PW(t){var e,n,r,i,s,o,a,c,l,u,d,f,h,y,p,T,_,v,b,k,C,L,B,q,ce;let ze=t.strict,Dt=(e=t.code)===null||e===void 0?void 0:e.optimize,ye=Dt===!0||Dt===void 0?1:Dt||0,Un=(r=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:rI,ki=(i=t.uriResolver)!==null&&i!==void 0?i:_W.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:ze)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:ze)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:ze)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:ze)!==null&&f!==void 0?f:"log",strictRequired:(y=(h=t.strictRequired)!==null&&h!==void 0?h:ze)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:ye,regExp:Un}:{optimize:ye,regExp:Un},loopRequired:(p=t.loopRequired)!==null&&p!==void 0?p:ZO,loopEnum:(T=t.loopEnum)!==null&&T!==void 0?T:ZO,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(k=t.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(L=t.validateSchema)!==null&&L!==void 0?L:!0,validateFormats:(B=t.validateFormats)!==null&&B!==void 0?B:!0,unicodeRegExp:(q=t.unicodeRegExp)!==null&&q!==void 0?q:!0,int32range:(ce=t.int32range)!==null&&ce!==void 0?ce:!0,uriResolver:ki}}var Rl=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...PW(e)};let{es5:n,lines:r}=this.opts.code;this.scope=new SW.ValueScope({scope:{},prefixes:kW,es5:n,lines:r}),this.logger=IW(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,TW.getRules)(),eI.call(this,wW,e,"NOT SUPPORTED"),eI.call(this,NW,e,"DEPRECATED","warn"),this._metaOpts=AW.call(this),e.formats&&CW.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&DW.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),RW.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:r}=this.opts,i=QO;r==="id"&&(i={...QO},i.id=i.$id,delete i.$id),n&&e&&this.addMetaSchema(i,i[r],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let i=r(n);return"$async"in r||(this.errors=r.errors),i}compile(e,n){let r=this._addSchema(e,n);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return i.call(this,e,n);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 nI.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,n)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,n,r,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,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 n=(0,Pl.normalizeId)(n||s),this._checkUnique(n),this.schemas[n]=this._addSchema(e,r,n,i,!0),this}addMetaSchema(e,n,r=this.opts.validateSchema){return this.addSchema(e,n,!0,r),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(r,e);if(!i&&n){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 n;for(;typeof(n=tI.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:r}=this.opts,i=new Nl.SchemaEnv({schema:{},schemaId:r});if(n=Nl.resolveSchema.call(this,i,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}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 n=tI.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let r=e[this.opts.schemaId];return r&&(r=(0,Pl.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let r;if(typeof e=="string")r=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=r);else if(typeof e=="object"&&n===void 0){if(n=e,r=n.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(MW.call(this,r,n),!n)return(0,tT.eachItem)(r,s=>eT.call(this,s)),this;$W.call(this,n);let i={...n,type:(0,ip.getJSONTypes)(n.type),schemaType:(0,ip.getJSONTypes)(n.schemaType)};return(0,tT.eachItem)(r,i.type.length===0?s=>eT.call(this,s,i):s=>i.type.forEach(o=>eT.call(this,s,i,o))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let r of n.rules){let i=r.rules.findIndex(s=>s.keyword===e);i>=0&&r.rules.splice(i,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${r}${i.instancePath} ${i.message}`).reduce((i,s)=>i+n+s)}$dataMetaSchema(e,n){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of n){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in r){let c=r[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=iI(u))}}return e}_removeAllSchemas(e,n){for(let r in e){let i=e[r];(!n||n.test(r))&&(typeof i=="string"?delete e[r]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[r]))}}_addSchema(e,n,r,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;r=(0,Pl.normalizeId)(o||r);let l=Pl.getSchemaRefs.call(this,e,r);return c=new Nl.SchemaEnv({schema:e,schemaId:a,meta:n,baseId:r,localRefs:l}),this._cache.set(c.schema,c),s&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=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):Nl.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{Nl.compileSchema.call(this,e)}finally{this.opts=n}}};Rl.ValidationError=bW.default;Rl.MissingRefError=nI.default;Kt.default=Rl;function eI(t,e,n,r="error"){for(let i in t){let s=i;s in e&&this.logger[r](`${n}: option ${i}. ${t[s]}`)}}function tI(t){return t=(0,Pl.normalizeId)(t),this.schemas[t]||this.refs[t]}function RW(){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 CW(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function DW(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 n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function AW(){let t={...this.opts};for(let e of EW)delete t[e];return t}var OW={log(){},warn(){},error(){}};function IW(t){if(t===!1)return OW;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 xW=/^[a-z_$][a-z0-9_$:-]*$/i;function MW(t,e){let{RULES:n}=this;if((0,tT.eachItem)(t,r=>{if(n.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!xW.test(r))throw new Error(`Keyword ${r} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function eT(t,e,n){var r;let i=e?.post;if(n&&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===n);if(o||(o={type:n,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,ip.getJSONTypes)(e.type),schemaType:(0,ip.getJSONTypes)(e.schemaType)}};e.before?LW.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function LW(t,e,n){let r=t.rules.findIndex(i=>i.keyword===n);r>=0?t.rules.splice(r,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function $W(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=iI(e)),t.validateSchema=this.compile(e,!0))}var qW={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function iI(t){return{anyOf:[t,qW]}}});var oI=w(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});var jW={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};nT.default=jW});var ap=w(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.callRef=zs.getValidate=void 0;var FW=El(),aI=ir(),On=fe(),Ta=rr(),cI=kl(),sp=be(),BW={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:r}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=r,{root:l}=s;if((n==="#"||n==="#/")&&i===l.baseId)return d();let u=cI.resolveRef.call(c,l,i,n);if(u===void 0)throw new FW.default(r.opts.uriResolver,i,n);if(u instanceof cI.SchemaEnv)return f(u);return h(u);function d(){if(s===l)return op(t,o,s,s.$async);let y=e.scopeValue("root",{ref:l});return op(t,(0,On._)`${y}.validate`,l,l.$async)}function f(y){let p=lI(t,y);op(t,p,y,y.$async)}function h(y){let p=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,On.stringify)(y)}:{ref:y}),T=e.name("valid"),_=t.subschema({schema:y,dataTypes:[],schemaPath:On.nil,topSchemaRef:p,errSchemaPath:n},T);t.mergeEvaluated(_),t.ok(T)}}};function lI(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,On._)`${n.scopeValue("wrapper",{ref:e})}.validate`}zs.getValidate=lI;function op(t,e,n,r){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?Ta.default.this:On.nil;r?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,On._)`await ${(0,aI.callValidateCode)(t,e,l)}`),h(e),o||i.assign(y,!0)},p=>{i.if((0,On._)`!(${p} instanceof ${s.ValidationError})`,()=>i.throw(p)),f(p),o||i.assign(y,!1)}),t.ok(y)}function d(){t.result((0,aI.callValidateCode)(t,e,l),()=>h(e),()=>f(e))}function f(y){let p=(0,On._)`${y}.errors`;i.assign(Ta.default.vErrors,(0,On._)`${Ta.default.vErrors} === null ? ${p} : ${Ta.default.vErrors}.concat(${p})`),i.assign(Ta.default.errors,(0,On._)`${Ta.default.vErrors}.length`)}function h(y){var p;if(!s.opts.unevaluated)return;let T=(p=n?.validate)===null||p===void 0?void 0:p.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=sp.mergeEvaluated.props(i,T.props,s.props));else{let _=i.var("props",(0,On._)`${y}.evaluated.props`);s.props=sp.mergeEvaluated.props(i,_,s.props,On.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=sp.mergeEvaluated.items(i,T.items,s.items));else{let _=i.var("items",(0,On._)`${y}.evaluated.items`);s.items=sp.mergeEvaluated.items(i,_,s.items,On.Name)}}}zs.callRef=op;zs.default=BW});var uI=w(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});var UW=oI(),VW=ap(),zW=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",UW.default,VW.default];rT.default=zW});var dI=w(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});var cp=fe(),ls=cp.operators,lp={maximum:{okStr:"<=",ok:ls.LTE,fail:ls.GT},minimum:{okStr:">=",ok:ls.GTE,fail:ls.LT},exclusiveMaximum:{okStr:"<",ok:ls.LT,fail:ls.GTE},exclusiveMinimum:{okStr:">",ok:ls.GT,fail:ls.LTE}},WW={message:({keyword:t,schemaCode:e})=>(0,cp.str)`must be ${lp[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,cp._)`{comparison: ${lp[t].okStr}, limit: ${e}}`},HW={keyword:Object.keys(lp),type:"number",schemaType:"number",$data:!0,error:WW,code(t){let{keyword:e,data:n,schemaCode:r}=t;t.fail$data((0,cp._)`${n} ${lp[e].fail} ${r} || isNaN(${n})`)}};iT.default=HW});var fI=w(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});var Cl=fe(),GW={message:({schemaCode:t})=>(0,Cl.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Cl._)`{multipleOf: ${t}}`},YW={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:GW,code(t){let{gen:e,data:n,schemaCode:r,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,Cl._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Cl._)`${o} !== parseInt(${o})`;t.fail$data((0,Cl._)`(${r} === 0 || (${o} = ${n}/${r}, ${a}))`)}};sT.default=YW});var pI=w(oT=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});function hI(t){let e=t.length,n=0,r=0,i;for(;r<e;)n++,i=t.charCodeAt(r++),i>=55296&&i<=56319&&r<e&&(i=t.charCodeAt(r),(i&64512)===56320&&r++);return n}oT.default=hI;hI.code='require("ajv/dist/runtime/ucs2length").default'});var mI=w(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});var Ws=fe(),KW=be(),XW=pI(),JW={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,Ws.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,Ws._)`{limit: ${t}}`},QW={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:JW,code(t){let{keyword:e,data:n,schemaCode:r,it:i}=t,s=e==="maxLength"?Ws.operators.GT:Ws.operators.LT,o=i.opts.unicode===!1?(0,Ws._)`${n}.length`:(0,Ws._)`${(0,KW.useFunc)(t.gen,XW.default)}(${n})`;t.fail$data((0,Ws._)`${o} ${s} ${r}`)}};aT.default=QW});var gI=w(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});var ZW=ir(),up=fe(),eH={message:({schemaCode:t})=>(0,up.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,up._)`{pattern: ${t}}`},tH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:eH,code(t){let{data:e,$data:n,schema:r,schemaCode:i,it:s}=t,o=s.opts.unicodeRegExp?"u":"",a=n?(0,up._)`(new RegExp(${i}, ${o}))`:(0,ZW.usePattern)(t,r);t.fail$data((0,up._)`!${a}.test(${e})`)}};cT.default=tH});var yI=w(lT=>{"use strict";Object.defineProperty(lT,"__esModule",{value:!0});var Dl=fe(),nH={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,Dl.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,Dl._)`{limit: ${t}}`},rH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:nH,code(t){let{keyword:e,data:n,schemaCode:r}=t,i=e==="maxProperties"?Dl.operators.GT:Dl.operators.LT;t.fail$data((0,Dl._)`Object.keys(${n}).length ${i} ${r}`)}};lT.default=rH});var vI=w(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});var Al=ir(),Ol=fe(),iH=be(),sH={message:({params:{missingProperty:t}})=>(0,Ol.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Ol._)`{missingProperty: ${t}}`},oH={keyword:"required",type:"object",schemaType:"array",$data:!0,error:sH,code(t){let{gen:e,schema:n,schemaCode:r,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&n.length===0)return;let c=n.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:y}=t.it;for(let p of n)if(h?.[p]===void 0&&!y.has(p)){let T=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${p}" is not defined at "${T}" (strictRequired)`;(0,iH.checkStrictMode)(o,_,o.opts.strictRequired)}}function l(){if(c||s)t.block$data(Ol.nil,d);else for(let h of n)(0,Al.checkReportMissingProp)(t,h)}function u(){let h=e.let("missing");if(c||s){let y=e.let("valid",!0);t.block$data(y,()=>f(h,y)),t.ok(y)}else e.if((0,Al.checkMissingProp)(t,n,h)),(0,Al.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",r,h=>{t.setParams({missingProperty:h}),e.if((0,Al.noPropertyInData)(e,i,h,a.ownProperties),()=>t.error())})}function f(h,y){t.setParams({missingProperty:h}),e.forOf(h,r,()=>{e.assign(y,(0,Al.propertyInData)(e,i,h,a.ownProperties)),e.if((0,Ol.not)(y),()=>{t.error(),e.break()})},Ol.nil)}}};uT.default=oH});var bI=w(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});var Il=fe(),aH={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,Il.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,Il._)`{limit: ${t}}`},cH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:aH,code(t){let{keyword:e,data:n,schemaCode:r}=t,i=e==="maxItems"?Il.operators.GT:Il.operators.LT;t.fail$data((0,Il._)`${n}.length ${i} ${r}`)}};dT.default=cH});var dp=w(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});var TI=$b();TI.code='require("ajv/dist/runtime/equal").default';fT.default=TI});var SI=w(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});var hT=vl(),Xt=fe(),lH=be(),uH=dp(),dH={message:({params:{i:t,j:e}})=>(0,Xt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Xt._)`{i: ${t}, j: ${e}}`},fH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:dH,code(t){let{gen:e,data:n,$data:r,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!r&&!i)return;let c=e.let("valid"),l=s.items?(0,hT.getSchemaTypes)(s.items):[];t.block$data(c,u,(0,Xt._)`${o} === false`),t.ok(c);function u(){let y=e.let("i",(0,Xt._)`${n}.length`),p=e.let("j");t.setParams({i:y,j:p}),e.assign(c,!0),e.if((0,Xt._)`${y} > 1`,()=>(d()?f:h)(y,p))}function d(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function f(y,p){let T=e.name("item"),_=(0,hT.checkDataTypes)(l,T,a.opts.strictNumbers,hT.DataType.Wrong),v=e.const("indices",(0,Xt._)`{}`);e.for((0,Xt._)`;${y}--;`,()=>{e.let(T,(0,Xt._)`${n}[${y}]`),e.if(_,(0,Xt._)`continue`),l.length>1&&e.if((0,Xt._)`typeof ${T} == "string"`,(0,Xt._)`${T} += "_"`),e.if((0,Xt._)`typeof ${v}[${T}] == "number"`,()=>{e.assign(p,(0,Xt._)`${v}[${T}]`),t.error(),e.assign(c,!1).break()}).code((0,Xt._)`${v}[${T}] = ${y}`)})}function h(y,p){let T=(0,lH.useFunc)(e,uH.default),_=e.name("outer");e.label(_).for((0,Xt._)`;${y}--;`,()=>e.for((0,Xt._)`${p} = ${y}; ${p}--;`,()=>e.if((0,Xt._)`${T}(${n}[${y}], ${n}[${p}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};pT.default=fH});var _I=w(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});var mT=fe(),hH=be(),pH=dp(),mH={message:"must be equal to constant",params:({schemaCode:t})=>(0,mT._)`{allowedValue: ${t}}`},gH={keyword:"const",$data:!0,error:mH,code(t){let{gen:e,data:n,$data:r,schemaCode:i,schema:s}=t;r||s&&typeof s=="object"?t.fail$data((0,mT._)`!${(0,hH.useFunc)(e,pH.default)}(${n}, ${i})`):t.fail((0,mT._)`${s} !== ${n}`)}};gT.default=gH});var EI=w(yT=>{"use strict";Object.defineProperty(yT,"__esModule",{value:!0});var xl=fe(),yH=be(),vH=dp(),bH={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,xl._)`{allowedValues: ${t}}`},TH={keyword:"enum",schemaType:"array",$data:!0,error:bH,code(t){let{gen:e,data:n,$data:r,schema:i,schemaCode:s,it:o}=t;if(!r&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,yH.useFunc)(e,vH.default)),u;if(a||r)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let h=e.const("vSchema",s);u=(0,xl.or)(...i.map((y,p)=>f(h,p)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",s,h=>e.if((0,xl._)`${l()}(${n}, ${h})`,()=>e.assign(u,!0).break()))}function f(h,y){let p=i[y];return typeof p=="object"&&p!==null?(0,xl._)`${l()}(${n}, ${h}[${y}])`:(0,xl._)`${n} === ${p}`}}};yT.default=TH});var kI=w(vT=>{"use strict";Object.defineProperty(vT,"__esModule",{value:!0});var SH=dI(),_H=fI(),EH=mI(),kH=gI(),wH=yI(),NH=vI(),PH=bI(),RH=SI(),CH=_I(),DH=EI(),AH=[SH.default,_H.default,EH.default,kH.default,wH.default,NH.default,PH.default,RH.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},CH.default,DH.default];vT.default=AH});var TT=w(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.validateAdditionalItems=void 0;var Hs=fe(),bT=be(),OH={message:({params:{len:t}})=>(0,Hs.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Hs._)`{limit: ${t}}`},IH={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:OH,code(t){let{parentSchema:e,it:n}=t,{items:r}=e;if(!Array.isArray(r)){(0,bT.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}wI(t,r)}};function wI(t,e){let{gen:n,schema:r,data:i,keyword:s,it:o}=t;o.items=!0;let a=n.const("len",(0,Hs._)`${i}.length`);if(r===!1)t.setParams({len:e.length}),t.pass((0,Hs._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,bT.alwaysValidSchema)(o,r)){let l=n.var("valid",(0,Hs._)`${a} <= ${e.length}`);n.if((0,Hs.not)(l),()=>c(l)),t.ok(l)}function c(l){n.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:bT.Type.Num},l),o.allErrors||n.if((0,Hs.not)(l),()=>n.break())})}}Ml.validateAdditionalItems=wI;Ml.default=IH});var ST=w(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.validateTuple=void 0;var NI=fe(),fp=be(),xH=ir(),MH={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return PI(t,"additionalItems",e);n.items=!0,!(0,fp.alwaysValidSchema)(n,e)&&t.ok((0,xH.validateArray)(t))}};function PI(t,e,n=t.schema){let{gen:r,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=fp.mergeEvaluated.items(r,n.length,a.items));let c=r.name("valid"),l=r.const("len",(0,NI._)`${s}.length`);n.forEach((d,f)=>{(0,fp.alwaysValidSchema)(a,d)||(r.if((0,NI._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:h}=a,y=n.length,p=y===d.minItems&&(y===d.maxItems||d[e]===!1);if(f.strictTuples&&!p){let T=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,fp.checkStrictMode)(a,T,f.strictTuples)}}}Ll.validateTuple=PI;Ll.default=MH});var RI=w(_T=>{"use strict";Object.defineProperty(_T,"__esModule",{value:!0});var LH=ST(),$H={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,LH.validateTuple)(t,"items")};_T.default=$H});var DI=w(ET=>{"use strict";Object.defineProperty(ET,"__esModule",{value:!0});var CI=fe(),qH=be(),jH=ir(),FH=TT(),BH={message:({params:{len:t}})=>(0,CI.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,CI._)`{limit: ${t}}`},UH={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:BH,code(t){let{schema:e,parentSchema:n,it:r}=t,{prefixItems:i}=n;r.items=!0,!(0,qH.alwaysValidSchema)(r,e)&&(i?(0,FH.validateAdditionalItems)(t,i):t.ok((0,jH.validateArray)(t)))}};ET.default=UH});var AI=w(kT=>{"use strict";Object.defineProperty(kT,"__esModule",{value:!0});var or=fe(),hp=be(),VH={message:({params:{min:t,max:e}})=>e===void 0?(0,or.str)`must contain at least ${t} valid item(s)`:(0,or.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,or._)`{minContains: ${t}}`:(0,or._)`{minContains: ${t}, maxContains: ${e}}`},zH={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:VH,code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:s}=t,o,a,{minContains:c,maxContains:l}=r;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,or._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,hp.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,hp.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,hp.alwaysValidSchema)(s,n)){let p=(0,or._)`${u} >= ${o}`;a!==void 0&&(p=(0,or._)`${p} && ${u} <= ${a}`),t.pass(p);return}s.items=!0;let d=e.name("valid");a===void 0&&o===1?h(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,or._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let p=e.name("_valid"),T=e.let("count",0);h(p,()=>e.if(p,()=>y(T)))}function h(p,T){e.forRange("i",0,u,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:hp.Type.Num,compositeRule:!0},p),T()})}function y(p){e.code((0,or._)`${p}++`),a===void 0?e.if((0,or._)`${p} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,or._)`${p} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,or._)`${p} >= ${o}`,()=>e.assign(d,!0)))}}};kT.default=zH});var pp=w(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.validateSchemaDeps=ti.validatePropertyDeps=ti.error=void 0;var wT=fe(),WH=be(),$l=ir();ti.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let r=e===1?"property":"properties";return(0,wT.str)`must have ${r} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:r}})=>(0,wT._)`{property: ${t},
|
|
180
180
|
missingProperty: ${r},
|
|
181
181
|
depsCount: ${e},
|
|
182
|
-
deps: ${n}}`};var jH={keyword:"dependencies",type:"object",schemaType:"object",error:Zr.error,code(t){let[e,n]=FH(t);kI(t,e),NI(t,n)}};function FH({schema:t}){let e={},n={};for(let r in t){if(r==="__proto__")continue;let i=Array.isArray(t[r])?e:n;i[r]=t[r]}return[e,n]}function kI(t,e=t.schema){let{gen:n,data:r,it:i}=t;if(Object.keys(e).length===0)return;let s=n.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Il.propertyInData)(n,r,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?n.if(c,()=>{for(let l of a)(0,Il.checkReportMissingProp)(t,l)}):(n.if((0,ET._)`${c} && (${(0,Il.checkMissingProp)(t,a,s)})`),(0,Il.reportMissingProp)(t,s),n.else())}}Zr.validatePropertyDeps=kI;function NI(t,e=t.schema){let{gen:n,data:r,keyword:i,it:s}=t,o=n.name("valid");for(let a in e)(0,qH.alwaysValidSchema)(s,e[a])||(n.if((0,Il.propertyInData)(n,r,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>n.var(o,!0)),t.ok(o))}Zr.validateSchemaDeps=NI;Zr.default=jH});var RI=k(wT=>{"use strict";Object.defineProperty(wT,"__esModule",{value:!0});var PI=fe(),BH=be(),UH={message:"property name must be valid",params:({params:t})=>(0,PI._)`{propertyName: ${t.propertyName}}`},VH={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:UH,code(t){let{gen:e,schema:n,data:r,it:i}=t;if((0,BH.alwaysValidSchema)(i,n))return;let s=e.name("valid");e.forIn("key",r,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,PI.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};wT.default=VH});var NT=k(kT=>{"use strict";Object.defineProperty(kT,"__esModule",{value:!0});var hp=nr(),Cr=fe(),zH=tr(),pp=be(),WH={message:"must NOT have additional properties",params:({params:t})=>(0,Cr._)`{additionalProperty: ${t.additionalProperty}}`},HH={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:WH,code(t){let{gen:e,schema:n,parentSchema:r,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,pp.alwaysValidSchema)(o,n))return;let l=(0,hp.allSchemaProperties)(r.properties),u=(0,hp.allSchemaProperties)(r.patternProperties);d(),t.ok((0,Cr._)`${s} === ${zH.default.errors}`);function d(){e.forIn("key",i,T=>{!l.length&&!u.length?y(T):e.if(f(T),()=>y(T))})}function f(T){let _;if(l.length>8){let v=(0,pp.schemaRefOrVal)(o,r.properties,"properties");_=(0,hp.isOwnProperty)(e,v,T)}else l.length?_=(0,Cr.or)(...l.map(v=>(0,Cr._)`${T} === ${v}`)):_=Cr.nil;return u.length&&(_=(0,Cr.or)(_,...u.map(v=>(0,Cr._)`${(0,hp.usePattern)(t,v)}.test(${T})`))),(0,Cr.not)(_)}function h(T){e.code((0,Cr._)`delete ${i}[${T}]`)}function y(T){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){h(T);return}if(n===!1){t.setParams({additionalProperty:T}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,pp.alwaysValidSchema)(o,n)){let _=e.name("valid");c.removeAdditional==="failing"?(p(T,_,!1),e.if((0,Cr.not)(_),()=>{t.reset(),h(T)})):(p(T,_),a||e.if((0,Cr.not)(_),()=>e.break()))}}function p(T,_,v){let b={keyword:"additionalProperties",dataProp:T,dataPropType:pp.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}}};kT.default=HH});var AI=k(RT=>{"use strict";Object.defineProperty(RT,"__esModule",{value:!0});var GH=vl(),CI=nr(),PT=be(),DI=NT(),YH={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:s}=t;s.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&DI.default.code(new GH.KeywordCxt(s,DI.default,"additionalProperties"));let o=(0,CI.allSchemaProperties)(n);for(let d of o)s.definedProperties.add(d);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=PT.mergeEvaluated.props(e,(0,PT.toHash)(o),s.props));let a=o.filter(d=>!(0,PT.alwaysValidSchema)(s,n[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,CI.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&&n[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};RT.default=YH});var MI=k(CT=>{"use strict";Object.defineProperty(CT,"__esModule",{value:!0});var OI=nr(),mp=fe(),II=be(),xI=be(),KH={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:r,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,OI.allSchemaProperties)(n),c=a.filter(p=>(0,II.alwaysValidSchema)(s,n[p]));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 mp.Name)&&(s.props=(0,xI.evaluatedPropsToName)(e,s.props));let{props:d}=s;f();function f(){for(let p of a)l&&h(p),s.allErrors?y(p):(e.var(u,!0),y(p),e.if(u))}function h(p){for(let T in l)new RegExp(p).test(T)&&(0,II.checkStrictMode)(s,`property ${T} matches pattern ${p} (use allowMatchingProperties)`)}function y(p){e.forIn("key",r,T=>{e.if((0,mp._)`${(0,OI.usePattern)(t,p)}.test(${T})`,()=>{let _=c.includes(p);_||t.subschema({keyword:"patternProperties",schemaProp:p,dataProp:T,dataPropType:xI.Type.Str},u),s.opts.unevaluated&&d!==!0?e.assign((0,mp._)`${d}[${T}]`,!0):!_&&!s.allErrors&&e.if((0,mp.not)(u),()=>e.break())})})}}};CT.default=KH});var LI=k(DT=>{"use strict";Object.defineProperty(DT,"__esModule",{value:!0});var XH=be(),JH={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:r}=t;if((0,XH.alwaysValidSchema)(r,n)){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"}};DT.default=JH});var $I=k(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});var QH=nr(),ZH={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:QH.validateUnion,error:{message:"must match a schema in anyOf"}};AT.default=ZH});var qI=k(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});var gp=fe(),eG=be(),tG={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,gp._)`{passingSchemas: ${t.passing}}`},nG={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:tG,code(t){let{gen:e,schema:n,parentSchema:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;let s=n,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,eG.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,gp._)`${c} && ${o}`).assign(o,!1).assign(a,(0,gp._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,gp.Name)})})}}};OT.default=nG});var jI=k(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});var rG=be(),iG={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let i=e.name("valid");n.forEach((s,o)=>{if((0,rG.alwaysValidSchema)(r,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};IT.default=iG});var UI=k(xT=>{"use strict";Object.defineProperty(xT,"__esModule",{value:!0});var yp=fe(),BI=be(),sG={message:({params:t})=>(0,yp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,yp._)`{failingKeyword: ${t.ifClause}}`},oG={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:sG,code(t){let{gen:e,parentSchema:n,it:r}=t;n.then===void 0&&n.else===void 0&&(0,BI.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let i=FI(r,"then"),s=FI(r,"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,yp.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,yp._)`${u}`):t.setParams({ifClause:u})}}}};function FI(t,e){let n=t.schema[e];return n!==void 0&&!(0,BI.alwaysValidSchema)(t,n)}xT.default=oG});var VI=k(MT=>{"use strict";Object.defineProperty(MT,"__esModule",{value:!0});var aG=be(),cG={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,aG.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};MT.default=cG});var zI=k(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0});var lG=vT(),uG=SI(),dG=bT(),fG=EI(),hG=wI(),pG=fp(),mG=RI(),gG=NT(),yG=AI(),vG=MI(),bG=LI(),TG=$I(),SG=qI(),_G=jI(),EG=UI(),wG=VI();function kG(t=!1){let e=[bG.default,TG.default,SG.default,_G.default,EG.default,wG.default,mG.default,gG.default,pG.default,yG.default,vG.default];return t?e.push(uG.default,fG.default):e.push(lG.default,dG.default),e.push(hG.default),e}LT.default=kG});var WI=k($T=>{"use strict";Object.defineProperty($T,"__esModule",{value:!0});var kt=fe(),NG={message:({schemaCode:t})=>(0,kt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,kt._)`{format: ${t}}`},PG={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:NG,code(t,e){let{gen:n,data:r,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():h();function f(){let y=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),p=n.const("fDef",(0,kt._)`${y}[${o}]`),T=n.let("fType"),_=n.let("format");n.if((0,kt._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>n.assign(T,(0,kt._)`${p}.type || "string"`).assign(_,(0,kt._)`${p}.validate`),()=>n.assign(T,(0,kt._)`"string"`).assign(_,p)),t.fail$data((0,kt.or)(v(),b()));function v(){return c.strictSchema===!1?kt.nil:(0,kt._)`${o} && !${_}`}function b(){let w=u.$async?(0,kt._)`(${p}.async ? await ${_}(${r}) : ${_}(${r}))`:(0,kt._)`${_}(${r})`,C=(0,kt._)`(typeof ${_} == "function" ? ${w} : ${_}.test(${r}))`;return(0,kt._)`${_} && ${_} !== true && ${T} === ${e} && !${C}`}}function h(){let y=d.formats[s];if(!y){v();return}if(y===!0)return;let[p,T,_]=b(y);p===e&&t.pass(w());function v(){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 b(C){let L=C instanceof RegExp?(0,kt.regexpCode)(C):c.code.formats?(0,kt._)`${c.code.formats}${(0,kt.getProperty)(s)}`:void 0,B=n.scopeValue("formats",{key:s,ref:C,code:L});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,kt._)`${B}.validate`]:["string",C,B]}function w(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw new Error("async format in sync schema");return(0,kt._)`await ${_}(${r})`}return typeof T=="function"?(0,kt._)`${_}(${r})`:(0,kt._)`${_}.test(${r})`}}}};$T.default=PG});var HI=k(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0});var RG=WI(),CG=[RG.default];qT.default=CG});var GI=k(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 KI=k(jT=>{"use strict";Object.defineProperty(jT,"__esModule",{value:!0});var DG=rI(),AG=yI(),OG=zI(),IG=HI(),YI=GI(),xG=[DG.default,AG.default,(0,OG.default)(),IG.default,YI.metadataVocabulary,YI.contentVocabulary];jT.default=xG});var BT=k(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.dynamicAnchor=void 0;var FT=fe(),MG=tr(),XI=Tl(),LG=sp(),$G={keyword:"$dynamicAnchor",schemaType:"string",code:t=>JI(t,t.schema)};function JI(t,e){let{gen:n,it:r}=t;r.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,FT._)`${MG.default.dynamicAnchors}${(0,FT.getProperty)(e)}`,s=r.errSchemaPath==="#"?r.validateName:qG(t);n.if((0,FT._)`!${i}`,()=>n.assign(i,s))}xl.dynamicAnchor=JI;function qG(t){let{schemaEnv:e,schema:n,self:r}=t.it,{root:i,baseId:s,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new XI.SchemaEnv({schema:n,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return XI.compileSchema.call(r,l),(0,LG.getValidate)(t,l)}xl.default=$G});var UT=k(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.dynamicRef=void 0;var QI=fe(),jG=tr(),ZI=sp(),FG={keyword:"$dynamicRef",schemaType:"string",code:t=>ex(t,t.schema)};function ex(t,e){let{gen:n,keyword:r,it:i}=t;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let s=e.slice(1);if(i.allErrors)o();else{let c=n.let("valid",!1);o(c),t.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=n.let("_v",(0,QI._)`${jG.default.dynamicAnchors}${(0,QI.getProperty)(s)}`);n.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>n.block(()=>{(0,ZI.callRef)(t,c),n.let(l,!0)}):()=>(0,ZI.callRef)(t,c)}}Ml.dynamicRef=ex;Ml.default=FG});var tx=k(VT=>{"use strict";Object.defineProperty(VT,"__esModule",{value:!0});var BG=BT(),UG=be(),VG={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,BG.dynamicAnchor)(t,""):(0,UG.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};VT.default=VG});var nx=k(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});var zG=UT(),WG={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,zG.dynamicRef)(t,t.schema)};zT.default=WG});var rx=k(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:!0});var HG=BT(),GG=UT(),YG=tx(),KG=nx(),XG=[HG.default,GG.default,YG.default,KG.default];WT.default=XG});var sx=k(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});var ix=fp(),JG={keyword:"dependentRequired",type:"object",schemaType:"object",error:ix.error,code:t=>(0,ix.validatePropertyDeps)(t)};HT.default=JG});var ox=k(GT=>{"use strict";Object.defineProperty(GT,"__esModule",{value:!0});var QG=fp(),ZG={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,QG.validateSchemaDeps)(t)};GT.default=ZG});var ax=k(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});var eY=be(),tY={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:n}){e.contains===void 0&&(0,eY.checkStrictMode)(n,`"${t}" without "contains" is ignored`)}};YT.default=tY});var cx=k(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});var nY=sx(),rY=ox(),iY=ax(),sY=[nY.default,rY.default,iY.default];KT.default=sY});var ux=k(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});var ls=fe(),lx=be(),oY=tr(),aY={message:"must NOT have unevaluated properties",params:({params:t})=>(0,ls._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},cY={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:aY,code(t){let{gen:e,schema:n,data:r,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=s;a instanceof ls.Name?e.if((0,ls._)`${a} !== true`,()=>e.forIn("key",r,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",r,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),s.props=!0,t.ok((0,ls._)`${i} === ${oY.default.errors}`);function c(d){if(n===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,lx.alwaysValidSchema)(s,n)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:lx.Type.Str},f),o||e.if((0,ls.not)(f),()=>e.break())}}function l(d,f){return(0,ls._)`!${d} || !${d}[${f}]`}function u(d,f){let h=[];for(let y in d)d[y]===!0&&h.push((0,ls._)`${f} !== ${y}`);return(0,ls.and)(...h)}}};XT.default=cY});var fx=k(JT=>{"use strict";Object.defineProperty(JT,"__esModule",{value:!0});var Hs=fe(),dx=be(),lY={message:({params:{len:t}})=>(0,Hs.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Hs._)`{limit: ${t}}`},uY={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:lY,code(t){let{gen:e,schema:n,data:r,it:i}=t,s=i.items||0;if(s===!0)return;let o=e.const("len",(0,Hs._)`${r}.length`);if(n===!1)t.setParams({len:s}),t.fail((0,Hs._)`${o} > ${s}`);else if(typeof n=="object"&&!(0,dx.alwaysValidSchema)(i,n)){let c=e.var("valid",(0,Hs._)`${o} <= ${s}`);e.if((0,Hs.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:dx.Type.Num},c),i.allErrors||e.if((0,Hs.not)(c),()=>e.break())})}}};JT.default=uY});var hx=k(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0});var dY=ux(),fY=fx(),hY=[dY.default,fY.default];QT.default=hY});var mx=k(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.DiscrError=void 0;var px;(function(t){t.Tag="tag",t.Mapping="mapping"})(px||(vp.DiscrError=px={}))});var yx=k(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});var Ta=fe(),ZT=mx(),gx=Tl(),pY=bl(),mY=be(),gY={message:({params:{discrError:t,tagName:e}})=>t===ZT.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,Ta._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},yY={keyword:"discriminator",type:"object",schemaType:"object",error:gY,code(t){let{gen:e,data:n,schema:r,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Ta._)`${n}${(0,Ta.getProperty)(a)}`);e.if((0,Ta._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:ZT.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let h=f();e.if(!1);for(let y in h)e.elseIf((0,Ta._)`${l} === ${y}`),e.assign(c,d(h[y]));e.else(),t.error(!1,{discrError:ZT.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(h){let y=e.name("valid"),p=t.subschema({keyword:"oneOf",schemaProp:h},y);return t.mergeEvaluated(p,Ta.Name),y}function f(){var h;let y={},p=_(i),T=!0;for(let w=0;w<o.length;w++){let C=o[w];if(C?.$ref&&!(0,mY.schemaHasRulesButRef)(C,s.self.RULES)){let B=C.$ref;if(C=gx.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,B),C instanceof gx.SchemaEnv&&(C=C.schema),C===void 0)throw new pY.default(s.opts.uriResolver,s.baseId,B)}let L=(h=C?.properties)===null||h===void 0?void 0:h[a];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);T=T&&(p||_(C)),v(L,w)}if(!T)throw new Error(`discriminator: "${a}" must be required`);return y;function _({required:w}){return Array.isArray(w)&&w.includes(a)}function v(w,C){if(w.const)b(w.const,C);else if(w.enum)for(let L of w.enum)b(L,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(w,C){if(typeof w!="string"||w in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[w]=C}}}};eS.default=yY});var vx=k((Voe,vY)=>{vY.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 bx=k((zoe,bY)=>{bY.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 Tx=k((Woe,TY)=>{TY.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 Sx=k((Hoe,SY)=>{SY.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 _x=k((Goe,_Y)=>{_Y.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 Ex=k((Yoe,EY)=>{EY.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 wx=k((Koe,wY)=>{wY.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 kx=k(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});var kY=vx(),NY=bx(),PY=Tx(),RY=Sx(),CY=_x(),DY=Ex(),AY=wx(),OY=["/properties"];function IY(t){return[kY,NY,PY,RY,e(this,CY),DY,e(this,AY)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function e(n,r){return t?n.$dataMetaSchema(r,OY):r}}tS.default=IY});var Nx=k((dt,rS)=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.MissingRefError=dt.ValidationError=dt.CodeGen=dt.Name=dt.nil=dt.stringify=dt.str=dt._=dt.KeywordCxt=dt.Ajv2019=void 0;var xY=QO(),MY=KI(),LY=rx(),$Y=cx(),qY=hx(),jY=yx(),FY=kx(),nS="https://json-schema.org/draft/2019-09/schema",Sa=class extends xY.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(LY.default),MY.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary($Y.default),this.addVocabulary(qY.default),this.opts.discriminator&&this.addKeyword(jY.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:n}=this.opts;n&&(FY.default.call(this,e),this.refs["http://json-schema.org/schema"]=nS)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(nS)?nS:void 0)}};dt.Ajv2019=Sa;rS.exports=dt=Sa;rS.exports.Ajv2019=Sa;Object.defineProperty(dt,"__esModule",{value:!0});dt.default=Sa;var BY=vl();Object.defineProperty(dt,"KeywordCxt",{enumerable:!0,get:function(){return BY.KeywordCxt}});var _a=fe();Object.defineProperty(dt,"_",{enumerable:!0,get:function(){return _a._}});Object.defineProperty(dt,"str",{enumerable:!0,get:function(){return _a.str}});Object.defineProperty(dt,"stringify",{enumerable:!0,get:function(){return _a.stringify}});Object.defineProperty(dt,"nil",{enumerable:!0,get:function(){return _a.nil}});Object.defineProperty(dt,"Name",{enumerable:!0,get:function(){return _a.Name}});Object.defineProperty(dt,"CodeGen",{enumerable:!0,get:function(){return _a.CodeGen}});var UY=Jh();Object.defineProperty(dt,"ValidationError",{enumerable:!0,get:function(){return UY.default}});var VY=bl();Object.defineProperty(dt,"MissingRefError",{enumerable:!0,get:function(){return VY.default}})});var rt=K(eN());var Td=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=nN(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.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=tN(r.text,!1,s);if(c-a===u.length)for(let f=0,h=u.length;f<h;f++)l[f+a+1]=u[f];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=r.text.length-(o-s);if(d!==0)for(let f=a+1+u.length,h=l.length;f<h;f++)l[f]=l[f]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=tN(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},ko;(function(t){function e(i,s,o,a){return new Td(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Td)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=Dg(s.map(qL),(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=r})(ko||(ko={}));function Dg(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Dg(r,e),Dg(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function tN(t,e,n=0){let r=e?[n]:[];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++,r.push(n+i+1))}return r}function nN(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function qL(t){let e=nN(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Sd=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],_d=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Bd=K(J());var Ig=K(require("url")),sN=require("crypto"),oN=require("path");var Og=K(J());var tn=class{constructor(e,n,r){this.uri=e;this.range=n;this.issues=r}},Ed=class extends tn{constructor(n,r,i,s){super(r,i,s);this.value=n;this.type="STRING"}},wd=class extends tn{constructor(n,r,i,s){super(r,i,s);this.values=n;this.type="BYTESTRING"}},kd=class extends tn{constructor(n,r,i,s){super(r,i,s);this.value=n;this.type="ARRAY_VALUE"}},Nd=class extends tn{constructor(n,r,i,s,o){super(i,s,o);this.label=n;this.nodePath=r;this.type="LABEL_REF"}},Pd=class extends tn{constructor(n,r,i,s){super(r,i,s);this.nodePath=n;this.type="NODE_PATH"}},Rd=class extends tn{constructor(n,r,i,s,o){super(i,s,o);this.value=n;this.evaluated=r}},Cd=class extends Rd{constructor(n,r,i,s,o){super(n,r,i,s,o);this.type="NUMBER_VALUE"}},Dd=class extends Rd{constructor(n,r,i,s,o){super(n,r,i,s,o);this.type="EXPRESSION"}},Ad=class extends tn{constructor(n,r,i,s){super(r,i,s);this.value=n}},Od=class extends tn{constructor(n,r,i,s,o){super(i,s,o);this.name=n;this.values=r}},Id=class extends tn{constructor(n,r,i,s){super(r,i,s);this.address=n}},xd=class extends tn{constructor(n,r,i,s,o,a){super(s,o,a);this.fullName=n;this.name=r;this.address=i}},Md=class extends tn{constructor(n,r,i,s){super(r,i,s);this.name=n}};var Ga=class extends tn{constructor(n,r,i,s,o,a,c){super(o,a,c);this.type=n;this.name=r;this.properties=i;this.nodes=s}},Ld=class extends Ga{constructor(e,n,r,i,s,o){super("REF",e,n,r,i,s,o)}},$d=class extends Ga{constructor(e,n,r,i,s){super("ROOT",null,e,n,r,i,s)}},qd=class extends Ga{constructor(e,n,r,i,s,o){super("CHILD",e,n,r,i,s,o)}};var Sn=K(J()),j=class{constructor(e){this._children=[];this.issues=[];this._fisrtToken=e?.start,this._lastToken=e?.end}addIssue(e){this.issues.push(e)}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 oe(e,this.uri)?[this]:this.children.flatMap(n=>n.getTopMostAstNodeForFile(e))}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getDocumentSymbols(e)??[]);if(!oe(this.uri,e))return[];let n=te(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:n,selectionRange:n,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Sn.SymbolKind.File,Sn.SymbolKind.Class,Sn.SymbolKind.Constant].some(r=>r===e))return[];let n=te(this);return[{location:Sn.Location.create(pe(this.uri),n),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(r=>r.getWorkspaceSymbols()??[]).filter(r=>r.kind===Sn.SymbolKind.File||r.kind===Sn.SymbolKind.Class||r.kind===Sn.SymbolKind.Constant)]}buildSemanticTokens(e){this._children.forEach(n=>n.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(oi(this.semanticTokenType),ai(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(n=>n===e||n.isAncestorOf(e))}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return Sn.Range.create(Sn.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),Sn.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}serialize(e){return new tn(this.uri,this.range,this.serializeIssues)}};function jL(t){return t.replace(/'(.)'/g,(e,n)=>n.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function Ag(t){try{return(0,eval)(jL(t))}catch(e){console.log(e)}return t}var et=class extends j{toJson(){return-1}resolve(e){return rN(this.toString(),e)}evaluate(e){return Ag(this.resolve(e))}isTrue(e){return Ag(`!!(${this.resolve(e)})`)}toPrettyString(e){let n=this.evaluate(e);return`${n.toString()} /* ${this.toString()}${typeof n=="number"?` = 0x${n.toString(16)}`:""} */`}serialize(e){return new Dd(this.toString(),this.evaluate(e),this.uri,this.range,this.serializeIssues)}},ci=class extends et{constructor(n,r,i){super();this.expression=n;this.wrapped=r;this.join=i;this.addChild(n),i&&(this.addChild(i.operator),this.addChild(i.expression))}get firstToken(){return this.openBracket?this.openBracket:super.firstToken}get lastToken(){return this.closeBracket?this.closeBracket:super.lastToken}addExpression(n,r){this.addChild(n),this.addChild(r)}toString(){let n=this.children.map(r=>r.toString()).join(" ");return this.wrapped?`(${n})`:`${n}`}isTrue(n){let r=`(${this.children.map(i=>i instanceof et?i.resolve(n):i.toString()).join(" ")})`;return Ag(`!!${r}`)}};var Lr=class extends et{constructor(n,r,i){super(r);this.value=n;this.docSymbolsMeta={name:`param${i+1}`,kind:Og.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},$r=class extends et{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(n){return oe(this.uri,n)?[{name:this.functionName.name,kind:Og.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(n)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(n=>n?.toString()??"<NULL>").join(",")})`}isTrue(n){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&n.has(this.params[0].value)):super.isTrue(n)}};var _s=(t,e,n=!0,r=!0)=>({start:{line:t?.pos.line??0,character:n?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var te=t=>_s(t.tokenIndexes.start,t.tokenIndexes.end),aN=" ",cN=t=>{aN=t},No=()=>aN,oi=t=>Sd.findIndex(e=>e===t),ai=t=>_d.findIndex(e=>e===t),xg=(t,e,n)=>!oe(t.uri,e)||n.line<t.pos.line?!1:n.line>t.pos.line?!0:n.character>t.pos.colEnd,FL=(t,e,n)=>oe(t.uri,e)?n.line<t.pos.line?!0:n.line>t.pos.line?!1:n.character<t.pos.col:!1,Kn=(t,e,n)=>!!(oe(t.uri,e)&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line<n.line||t.tokenIndexes.start.pos.line===n.line&&t.tokenIndexes.start.pos.col<=n.character)&&(t.tokenIndexes.end.pos.line>n.line||t.tokenIndexes.end.pos.line===n.line&&t.tokenIndexes.end.pos.colEnd>=n.character)),lN=(t,e,n)=>!!(oe(t.uri,e)&&t.lastToken.value!==";"&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line===n.line||t.tokenIndexes.end.pos.line===n.line)&&n.character>=t.tokenIndexes.end.pos.colEnd),uN=(t,e,n)=>{if(!t)return!1;let i=t.filter(s=>s.pos.line===n.line).at(-1);return i&&i.pos.col>=n.character?!1:e.tokenIndexes?.end===i};var jr=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].reverse().find(s=>Kn(s,e,n));return r},Ya=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].find(s=>FL(s.lastToken,e,n));return r===t?void 0:r},Ka=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].reverse().find(s=>xg(s.firstToken,e,n));return r===t?void 0:r},z=(t,e,n=Bd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:c.issues?c.issues.map(UL).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.issues.push(u),{raw:c,diagnostic:u}},qt=(t,e,n=Bd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:VL(c),source:"devicetree",tags:c.tags,relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(zL).join(" or "),location:{uri:pe(d.uri),range:te(d)}}))]},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},$=(t,e,n=Bd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:WL(c),relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(HL).join(" or "),location:{uri:pe(d.uri),range:te(d)}}))],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.issues.push(u),{raw:c,diagnostic:u}},dN=(t,e)=>[...t].sort((r,i)=>{let s=e.getSortKey(r),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(!r.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return r.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?r.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:r.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function St(t,e,n){let r=Ue(t.textDocument.uri);if(!e)return[];let i=performance.now(),o=(await e.getRuntime()).getDeepestAstNode(r,t.position),a=e.getSortKey(o?.ast);return console.log(`search: ${performance.now()-i}ms`),n(o,l=>{let u=t.position;return oe(l.uri,r)?!!(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 H(t,e){return{start:t,end:e??t}}var F=(t,e)=>t?.tokens.some(n=>n===e),Ke=(t,e=!1)=>n=>n?.value&&(e?t.toLowerCase()===n.value.toLowerCase():t===n.value)?"yes":BL(t)(n),Oe=t=>e=>e?.tokens.some(n=>n===t)?"yes":"no",BL=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",hr=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&oe(t.uri,e.uri),nn=(t,e)=>t?.adjacentToken&&t.adjacentToken.value===e?.value||e?.adjacentToken&&e.adjacentToken.value===t?.value?!0:!!t&&!!e&&hr(t,e)&&t.pos.colEnd===e.pos.col,Ud=t=>t.map((e,n)=>({index:n,context:e,files:e.getContextFiles()})),pr=(t,e,n,r)=>{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 n?.getContextFiles().find(s=>oe(s,e.uri))?n:Ud(t).sort(s=>s.context.id===r?-1:0).find(s=>s.files.some(o=>oe(o,e.uri)))?.context},Mg=(t,e)=>Ud(t).filter(r=>r.files.some(i=>oe(i,e))).map(r=>r.context),fN=t=>{let e=/^(\w+)\s+(.+)$/,n=/^(\w+)\(([^)]*)\)\s+(.+)$/,r=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,i;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=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else 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}}else if(i=e.exec(t)){let[,,s]=i;return s.trim()}},rN=(t,e)=>{let n=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),r=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),i=t,s;do s=i,i=n(s),i=r(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},pe=t=>Ig.default.pathToFileURL(t).toString(),Ue=t=>tt(Ig.default.fileURLToPath(t)),oe=(t,e)=>!t||!e?!1:t===e,tt=t=>(0,oN.normalize)(process.platform==="win32"?t.toLowerCase():t),li=t=>(0,sN.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"),UL=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 referance";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include";case 37:return"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"}},VL=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.`}}).join(" or "),zL=t=>{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";default:return"TODO"}},WL=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 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 29:return`INTRO exceeds address space avalable 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"}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),HL=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";default:return"TODO"}},qr=(t,e)=>{let n=Math.max(t.length,e.length);for(let r=0;r<n;r++){let i=t[t.length-n+r]??0,s=e[e.length-n+r]??0;if(i<s)return-1;if(i>s)return 1}return 0},$i=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),i=0;for(let s=0;s<n;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0,c=o+a+i;r[n-1-s]=c>>>0,i=c>4294967295?1:0}return i&&r.unshift(1),r},GL=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),i=0;for(let s=0;s<n;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,r[n-1-s]=o-a>>>0}for(;r.length>1&&r[0]===0;)r.shift();return r},YL=(t,e)=>$i(t,e),hN=(t,e)=>{let n=[];for(let r of t){let i=r.childAddress,s=r.length,o=$i(i,s);if(qr(e,i)>=0&&qr(e,o)<0){let a=GL(e,i),c=r.parentAddress,l=YL(c,a),u=$i(c,s);n.push({start:l,end:u,ast:r.ast})}}return n};function pN(t){return Array.isArray(t)&&Array.isArray(t[0])}function Xa(t){return!t||t instanceof $r?t:Xa(t.parentNode)}function mN(t,e){let n=t.getText(),r=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=n;for(let s of r){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 iN(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 gN(t,e){return iN(t.end,e.start)>0&&iN(t.start,e.end)<0}var mr=K(J());var SN=K(J());var yN=K(J());var Le=class extends j{constructor(n,r){super(r);this.value=n;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:yN.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return new Ed(this.value,this.uri,this.range,this.serializeIssues)}};var bN=K(J());var vN=K(J());var zt=class extends et{constructor(n,r){super(r);this.value=n;this.docSymbolsMeta={name:this.value.toString(),kind:vN.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(n){return this.value.toString(n)}toJson(){return this.value}toPrettyString(n){let r=this.evaluate(n);return`${r.toString()} /* ${typeof r=="number"?`0x${r.toString(16)}`:""} */`}serialize(){return new Cd(this.value.toString(),this.value,this.uri,this.range,this.serializeIssues)}};var Rt=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Cell Array",kind:bN.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(n=>n.toString()).join(" ")}>`}toPrettyString(n){return`<${this.values.map(r=>r.toPrettyString(n)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(n=>n.value instanceof zt)){let n=new ArrayBuffer(8),r=new DataView(n);return this.values.map(i=>i.value.value).forEach((i,s)=>{r.setUint32(s*4,i)}),r.getBigUint64(0)}return this.values.map(n=>n.value?.toJson()??NaN)}serialize(n){let r=this.values.map(i=>i.value?.serialize(n)??null);return new kd(r,this.uri,this.range,this.serializeIssues)}};var TN=K(J());var ui=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Byte String Value",kind:TN.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(n=>n.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(n=>n.value?.toJson()??NaN)}serialize(){return new wd(this.values.map(n=>n.value?{value:n.value.toString(16),range:n.value.range,evaluated:n.value.value}:null),this.uri,this.range,this.serializeIssues)}};var He=class extends j{constructor(n,r){super(r);this.name=n;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return new Ad(this.name,this.uri,this.range,this.serializeIssues)}},Xe=class extends j{constructor(n,r=[]){super();this.propertyName=n;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:SN.SymbolKind.Property},this.labels.forEach(i=>this.addChild(i)),this.addChild(n)}set values(n){if(this._values)throw new Error("Only one property name is allowed");this._values=n,this.addChild(n)}get values(){return this._values}get quickValues(){return this.values?.values.map(n=>n?n.value instanceof Le?n.value.value:n.value instanceof Rt?n.value.values.map(r=>r.value instanceof zt?r.value.value:NaN):n.value instanceof ui?n.value.values.map(r=>r.value?.value??NaN):NaN:null)}getFlatAstValues(){return this.values?.values.flatMap(n=>n?n.value instanceof Le?n.value:n.value instanceof Rt?n.value.values.map(r=>r.value):n.value instanceof ui?n.value.values.map(r=>r.value):n.value:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(n){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toPrettyString(n)??"NULL").join(", ")??"NULL"}`:""};`}serialize(n){return new Od(this.propertyName?.serialize()??null,this.values?.values.map(r=>r?.value?.serialize(n)??null)??null,this.uri,this.range,this.serializeIssues)}};var _N=K(J()),un=class extends j{constructor(n,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:n,kind:_N.SymbolKind.Function}}};var _n=class extends un{constructor(n){super("Delete Node",n);this._nodeNameOrRef=null}set nodeNameOrRef(n){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=n,this.addChild(n)}get nodeNameOrRef(){return this._nodeNameOrRef}};var at=class extends un{constructor(n){super("Delete Property",n);this._propertyName=null}set propertyName(n){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=n,this.addChild(n)}get propertyName(){return this._propertyName}};var EN=K(J());var de=class extends j{constructor(n){super();this.label=n;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:EN.SymbolKind.Key},this.addChild(n)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return new Nd(this.label?.toString()??null,this.linksTo?.pathString??null,this.uri,this.range,this.serializeIssues)}};var bt=class t extends j{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof mt)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 _n)}addNodeChild(e){this.addChild(e)}},mt=class extends bt{constructor(){super(),this.docSymbolsMeta={name:"/",kind:mr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Xe)}get name(){return new xe("/",H(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof at)}get nodes(){return this.children.filter(e=>e instanceof Ie)}get pathName(){return"/"}serialize(e){return new $d(this.properties.map(n=>n.serialize(e)),this.nodes.map(n=>n.serialize(e)),this.uri,this.range,this.serializeIssues)}},jt=class extends bt{constructor(n=[]){super();this.labels=n;this._reference=null;this.docSymbolsMeta={name:"DTC Name",kind:mr.SymbolKind.Class},n.forEach(r=>{super.addChild(r)})}get serializeIssues(){return[...this.issues,...this.reference?.issues??[]].map(n=>n())}set reference(n){if(this._reference)throw new Error("Only on label reference is allowed");this._reference=n;let r;n instanceof de?r=n.value:r=n?.path?.pathParts.at(-1)?.name??"DTC Name",this.docSymbolsMeta={name:r??"DTC Name",kind:mr.SymbolKind.Class},this.addChild(n)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get reference(){return this._reference}get nodes(){return this.children.filter(n=>n instanceof Ie)}get pathName(){if(this.reference instanceof de&&this.reference.label?.value)return`&${this.reference.label.value}`}get properties(){return this.children.filter(n=>n instanceof Xe)}get deleteProperties(){return this.children.filter(n=>n instanceof at)}serialize(n){return new Ld(this.reference?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},Ie=class t extends bt{constructor(n=[],r){super();this.labels=n;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:mr.SymbolKind.Class},r&&this.addChild(r),n.forEach(i=>{this.addChild(i)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(n=>n())}set name(n){if(this._name)throw new Error("Only on label reference is allowed");this._name=n,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:mr.SymbolKind.Class},this.addChild(n)}get name(){return this._name}get nodes(){return this.children.filter(n=>n instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(n=>n instanceof Xe)}get deleteProperties(){return this.children.filter(n=>n instanceof at)}serialize(n){return new qd(this.name?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},Ja=class extends j{constructor(n,r){super(r);this.address=n;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((n,r)=>n.toString(16).padStart(r?8:0,"0")).join("")??"NaN"}serialize(){return new Id(this.address,this.uri,this.range,this.serializeIssues)}},xe=class extends j{constructor(n,r,i){super(r);this.name=n;this._address=i;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(n){if(this._address)throw new Error("Address can only be set once");n&&(this.lastToken=void 0,this._address=n,n.forEach(r=>this.addChild(r)))}get fullAddress(){return this._address?[...this._address.flatMap(n=>n.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(n=>n.toString()).join(",")}`:this.name}buildSemanticTokens(n){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};n(oi("type"),ai("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(i=>{n(oi("decorator"),ai("declaration"),{start:i.firstToken,end:i.lastToken}),i.buildSemanticTokens(n)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(n=>n.issues)??[]].map(n=>n())}serialize(){return new xd(this.toString(),new Md(this.name,this.uri,mr.Range.create(mr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.col),mr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.colEnd)),[]),this.address?.map(n=>n.serialize())??null,this.uri,this.range,this.serializeIssues)}};var br=K(J());var At=t=>t instanceof un?!0:t instanceof bt?!1:t.parentNode?At(t.parentNode):!1;var Po=t=>[...t.map(e=>{if(e instanceof Ie||e instanceof mt)return e.name;if(e instanceof jt)return e.reference})].filter(e=>!!e),Lg=(t,e)=>e?e.parentNode===t||Lg(t,e.parentNode):!1;var ct=K(J());var wN=K(J());var di=class extends j{constructor(){super();this._pathParts=[]}addPath(n,r){this._pathParts.push(n),r&&this.addChild(r),this.addChild(n)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(n=>n?.toString()??"<NULL>").join("/")}buildSemanticTokens(n){this._children.forEach(r=>{r instanceof xe?r.buildSemanticTokens(n):n(oi("operator"),ai("declaration"),r.tokenIndexes)})}},Ln=class extends j{constructor(n){super();this.path=n;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:wN.SymbolKind.Namespace},this.addChild(n)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return new Pd(this.path?.toString()??null,this.uri,this.range,this.serializeIssues)}};var ie=K(J());var Vd=K(J());var kN=require("path"),fi=class extends j{constructor(n,r){super();this.keyword=n;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:Vd.SymbolKind.File},this.addChild(n),this.addChild(r)}get resolvedPath(){return this._resolvedPath}set resolvedPath(n){this.docSymbolsMeta={name:`Include ${n}`,kind:Vd.SymbolKind.File},this._resolvedPath=n}},Ro=class extends j{constructor(n,r,i){super(i);this._path=n;this.relative=r;this.docSymbolsMeta={name:(0,kN.basename)(this.path),kind:Vd.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var hi=class extends j{constructor(n){super();this.comments=n;n.forEach(this.addChild.bind(this))}},gr=class extends j{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var KL=async(t,e,n)=>{let r=ie.Position.create(t.pos.line,t.pos.col),i=n.find(s=>Kn(s,e,r));if(i)return jr(i,e,r)},$g=t=>{if(t)return t instanceof bt?t:$g(t?.parentNode)},Co=(t,e,n=0)=>{if(!e||!oe(e.uri,t)||!e.parentNode?.uri)return n;let r=$g(e.parentNode);return Co(t,r,n+1)},XL=(t,e)=>async n=>{let r=t.filter(a=>!(a instanceof fi)&&!(a instanceof gr)&&!(a instanceof hi)),i=await KL(n.firstToken,e,r);if(!i||i===n||n.allDescendants.some(a=>a===i))return 0;if(!(i instanceof bt))return;let s=$g(i);return Co(e,s)};async function qg(t,e,n){let r=n.split(`
|
|
183
|
-
`),
|
|
184
|
-
`))
|
|
185
|
-
|
|
186
|
-
`)}
|
|
182
|
+
deps: ${n}}`};var HH={keyword:"dependencies",type:"object",schemaType:"object",error:ti.error,code(t){let[e,n]=GH(t);OI(t,e),II(t,n)}};function GH({schema:t}){let e={},n={};for(let r in t){if(r==="__proto__")continue;let i=Array.isArray(t[r])?e:n;i[r]=t[r]}return[e,n]}function OI(t,e=t.schema){let{gen:n,data:r,it:i}=t;if(Object.keys(e).length===0)return;let s=n.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,$l.propertyInData)(n,r,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?n.if(c,()=>{for(let l of a)(0,$l.checkReportMissingProp)(t,l)}):(n.if((0,wT._)`${c} && (${(0,$l.checkMissingProp)(t,a,s)})`),(0,$l.reportMissingProp)(t,s),n.else())}}ti.validatePropertyDeps=OI;function II(t,e=t.schema){let{gen:n,data:r,keyword:i,it:s}=t,o=n.name("valid");for(let a in e)(0,WH.alwaysValidSchema)(s,e[a])||(n.if((0,$l.propertyInData)(n,r,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>n.var(o,!0)),t.ok(o))}ti.validateSchemaDeps=II;ti.default=HH});var MI=w(NT=>{"use strict";Object.defineProperty(NT,"__esModule",{value:!0});var xI=fe(),YH=be(),KH={message:"property name must be valid",params:({params:t})=>(0,xI._)`{propertyName: ${t.propertyName}}`},XH={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:KH,code(t){let{gen:e,schema:n,data:r,it:i}=t;if((0,YH.alwaysValidSchema)(i,n))return;let s=e.name("valid");e.forIn("key",r,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,xI.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};NT.default=XH});var RT=w(PT=>{"use strict";Object.defineProperty(PT,"__esModule",{value:!0});var mp=ir(),Ar=fe(),JH=rr(),gp=be(),QH={message:"must NOT have additional properties",params:({params:t})=>(0,Ar._)`{additionalProperty: ${t.additionalProperty}}`},ZH={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:QH,code(t){let{gen:e,schema:n,parentSchema:r,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,gp.alwaysValidSchema)(o,n))return;let l=(0,mp.allSchemaProperties)(r.properties),u=(0,mp.allSchemaProperties)(r.patternProperties);d(),t.ok((0,Ar._)`${s} === ${JH.default.errors}`);function d(){e.forIn("key",i,T=>{!l.length&&!u.length?y(T):e.if(f(T),()=>y(T))})}function f(T){let _;if(l.length>8){let v=(0,gp.schemaRefOrVal)(o,r.properties,"properties");_=(0,mp.isOwnProperty)(e,v,T)}else l.length?_=(0,Ar.or)(...l.map(v=>(0,Ar._)`${T} === ${v}`)):_=Ar.nil;return u.length&&(_=(0,Ar.or)(_,...u.map(v=>(0,Ar._)`${(0,mp.usePattern)(t,v)}.test(${T})`))),(0,Ar.not)(_)}function h(T){e.code((0,Ar._)`delete ${i}[${T}]`)}function y(T){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){h(T);return}if(n===!1){t.setParams({additionalProperty:T}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,gp.alwaysValidSchema)(o,n)){let _=e.name("valid");c.removeAdditional==="failing"?(p(T,_,!1),e.if((0,Ar.not)(_),()=>{t.reset(),h(T)})):(p(T,_),a||e.if((0,Ar.not)(_),()=>e.break()))}}function p(T,_,v){let b={keyword:"additionalProperties",dataProp:T,dataPropType:gp.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}}};PT.default=ZH});var qI=w(DT=>{"use strict";Object.defineProperty(DT,"__esModule",{value:!0});var eG=_l(),LI=ir(),CT=be(),$I=RT(),tG={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:s}=t;s.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&$I.default.code(new eG.KeywordCxt(s,$I.default,"additionalProperties"));let o=(0,LI.allSchemaProperties)(n);for(let d of o)s.definedProperties.add(d);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=CT.mergeEvaluated.props(e,(0,CT.toHash)(o),s.props));let a=o.filter(d=>!(0,CT.alwaysValidSchema)(s,n[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,LI.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&&n[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};DT.default=tG});var UI=w(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});var jI=ir(),yp=fe(),FI=be(),BI=be(),nG={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:r,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,jI.allSchemaProperties)(n),c=a.filter(p=>(0,FI.alwaysValidSchema)(s,n[p]));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 yp.Name)&&(s.props=(0,BI.evaluatedPropsToName)(e,s.props));let{props:d}=s;f();function f(){for(let p of a)l&&h(p),s.allErrors?y(p):(e.var(u,!0),y(p),e.if(u))}function h(p){for(let T in l)new RegExp(p).test(T)&&(0,FI.checkStrictMode)(s,`property ${T} matches pattern ${p} (use allowMatchingProperties)`)}function y(p){e.forIn("key",r,T=>{e.if((0,yp._)`${(0,jI.usePattern)(t,p)}.test(${T})`,()=>{let _=c.includes(p);_||t.subschema({keyword:"patternProperties",schemaProp:p,dataProp:T,dataPropType:BI.Type.Str},u),s.opts.unevaluated&&d!==!0?e.assign((0,yp._)`${d}[${T}]`,!0):!_&&!s.allErrors&&e.if((0,yp.not)(u),()=>e.break())})})}}};AT.default=nG});var VI=w(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});var rG=be(),iG={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:r}=t;if((0,rG.alwaysValidSchema)(r,n)){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"}};OT.default=iG});var zI=w(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});var sG=ir(),oG={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sG.validateUnion,error:{message:"must match a schema in anyOf"}};IT.default=oG});var WI=w(xT=>{"use strict";Object.defineProperty(xT,"__esModule",{value:!0});var vp=fe(),aG=be(),cG={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,vp._)`{passingSchemas: ${t.passing}}`},lG={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:cG,code(t){let{gen:e,schema:n,parentSchema:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;let s=n,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,aG.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,vp._)`${c} && ${o}`).assign(o,!1).assign(a,(0,vp._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,vp.Name)})})}}};xT.default=lG});var HI=w(MT=>{"use strict";Object.defineProperty(MT,"__esModule",{value:!0});var uG=be(),dG={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let i=e.name("valid");n.forEach((s,o)=>{if((0,uG.alwaysValidSchema)(r,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};MT.default=dG});var KI=w(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0});var bp=fe(),YI=be(),fG={message:({params:t})=>(0,bp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,bp._)`{failingKeyword: ${t.ifClause}}`},hG={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:fG,code(t){let{gen:e,parentSchema:n,it:r}=t;n.then===void 0&&n.else===void 0&&(0,YI.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let i=GI(r,"then"),s=GI(r,"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,bp.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,bp._)`${u}`):t.setParams({ifClause:u})}}}};function GI(t,e){let n=t.schema[e];return n!==void 0&&!(0,YI.alwaysValidSchema)(t,n)}LT.default=hG});var XI=w($T=>{"use strict";Object.defineProperty($T,"__esModule",{value:!0});var pG=be(),mG={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,pG.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};$T.default=mG});var JI=w(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0});var gG=TT(),yG=RI(),vG=ST(),bG=DI(),TG=AI(),SG=pp(),_G=MI(),EG=RT(),kG=qI(),wG=UI(),NG=VI(),PG=zI(),RG=WI(),CG=HI(),DG=KI(),AG=XI();function OG(t=!1){let e=[NG.default,PG.default,RG.default,CG.default,DG.default,AG.default,_G.default,EG.default,SG.default,kG.default,wG.default];return t?e.push(yG.default,bG.default):e.push(gG.default,vG.default),e.push(TG.default),e}qT.default=OG});var QI=w(jT=>{"use strict";Object.defineProperty(jT,"__esModule",{value:!0});var wt=fe(),IG={message:({schemaCode:t})=>(0,wt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,wt._)`{format: ${t}}`},xG={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:IG,code(t,e){let{gen:n,data:r,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():h();function f(){let y=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),p=n.const("fDef",(0,wt._)`${y}[${o}]`),T=n.let("fType"),_=n.let("format");n.if((0,wt._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>n.assign(T,(0,wt._)`${p}.type || "string"`).assign(_,(0,wt._)`${p}.validate`),()=>n.assign(T,(0,wt._)`"string"`).assign(_,p)),t.fail$data((0,wt.or)(v(),b()));function v(){return c.strictSchema===!1?wt.nil:(0,wt._)`${o} && !${_}`}function b(){let k=u.$async?(0,wt._)`(${p}.async ? await ${_}(${r}) : ${_}(${r}))`:(0,wt._)`${_}(${r})`,C=(0,wt._)`(typeof ${_} == "function" ? ${k} : ${_}.test(${r}))`;return(0,wt._)`${_} && ${_} !== true && ${T} === ${e} && !${C}`}}function h(){let y=d.formats[s];if(!y){v();return}if(y===!0)return;let[p,T,_]=b(y);p===e&&t.pass(k());function v(){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 b(C){let L=C instanceof RegExp?(0,wt.regexpCode)(C):c.code.formats?(0,wt._)`${c.code.formats}${(0,wt.getProperty)(s)}`:void 0,B=n.scopeValue("formats",{key:s,ref:C,code:L});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,wt._)`${B}.validate`]:["string",C,B]}function k(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw new Error("async format in sync schema");return(0,wt._)`await ${_}(${r})`}return typeof T=="function"?(0,wt._)`${_}(${r})`:(0,wt._)`${_}.test(${r})`}}}};jT.default=xG});var ZI=w(FT=>{"use strict";Object.defineProperty(FT,"__esModule",{value:!0});var MG=QI(),LG=[MG.default];FT.default=LG});var ex=w(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.contentVocabulary=Sa.metadataVocabulary=void 0;Sa.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Sa.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var nx=w(BT=>{"use strict";Object.defineProperty(BT,"__esModule",{value:!0});var $G=uI(),qG=kI(),jG=JI(),FG=ZI(),tx=ex(),BG=[$G.default,qG.default,(0,jG.default)(),FG.default,tx.metadataVocabulary,tx.contentVocabulary];BT.default=BG});var VT=w(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.dynamicAnchor=void 0;var UT=fe(),UG=rr(),rx=kl(),VG=ap(),zG={keyword:"$dynamicAnchor",schemaType:"string",code:t=>ix(t,t.schema)};function ix(t,e){let{gen:n,it:r}=t;r.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,UT._)`${UG.default.dynamicAnchors}${(0,UT.getProperty)(e)}`,s=r.errSchemaPath==="#"?r.validateName:WG(t);n.if((0,UT._)`!${i}`,()=>n.assign(i,s))}ql.dynamicAnchor=ix;function WG(t){let{schemaEnv:e,schema:n,self:r}=t.it,{root:i,baseId:s,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new rx.SchemaEnv({schema:n,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return rx.compileSchema.call(r,l),(0,VG.getValidate)(t,l)}ql.default=zG});var zT=w(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.dynamicRef=void 0;var sx=fe(),HG=rr(),ox=ap(),GG={keyword:"$dynamicRef",schemaType:"string",code:t=>ax(t,t.schema)};function ax(t,e){let{gen:n,keyword:r,it:i}=t;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let s=e.slice(1);if(i.allErrors)o();else{let c=n.let("valid",!1);o(c),t.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=n.let("_v",(0,sx._)`${HG.default.dynamicAnchors}${(0,sx.getProperty)(s)}`);n.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>n.block(()=>{(0,ox.callRef)(t,c),n.let(l,!0)}):()=>(0,ox.callRef)(t,c)}}jl.dynamicRef=ax;jl.default=GG});var cx=w(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:!0});var YG=VT(),KG=be(),XG={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,YG.dynamicAnchor)(t,""):(0,KG.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};WT.default=XG});var lx=w(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});var JG=zT(),QG={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,JG.dynamicRef)(t,t.schema)};HT.default=QG});var ux=w(GT=>{"use strict";Object.defineProperty(GT,"__esModule",{value:!0});var ZG=VT(),eY=zT(),tY=cx(),nY=lx(),rY=[ZG.default,eY.default,tY.default,nY.default];GT.default=rY});var fx=w(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});var dx=pp(),iY={keyword:"dependentRequired",type:"object",schemaType:"object",error:dx.error,code:t=>(0,dx.validatePropertyDeps)(t)};YT.default=iY});var hx=w(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});var sY=pp(),oY={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,sY.validateSchemaDeps)(t)};KT.default=oY});var px=w(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});var aY=be(),cY={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:n}){e.contains===void 0&&(0,aY.checkStrictMode)(n,`"${t}" without "contains" is ignored`)}};XT.default=cY});var mx=w(JT=>{"use strict";Object.defineProperty(JT,"__esModule",{value:!0});var lY=fx(),uY=hx(),dY=px(),fY=[lY.default,uY.default,dY.default];JT.default=fY});var yx=w(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0});var us=fe(),gx=be(),hY=rr(),pY={message:"must NOT have unevaluated properties",params:({params:t})=>(0,us._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},mY={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:pY,code(t){let{gen:e,schema:n,data:r,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=s;a instanceof us.Name?e.if((0,us._)`${a} !== true`,()=>e.forIn("key",r,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",r,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),s.props=!0,t.ok((0,us._)`${i} === ${hY.default.errors}`);function c(d){if(n===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,gx.alwaysValidSchema)(s,n)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:gx.Type.Str},f),o||e.if((0,us.not)(f),()=>e.break())}}function l(d,f){return(0,us._)`!${d} || !${d}[${f}]`}function u(d,f){let h=[];for(let y in d)d[y]===!0&&h.push((0,us._)`${f} !== ${y}`);return(0,us.and)(...h)}}};QT.default=mY});var bx=w(ZT=>{"use strict";Object.defineProperty(ZT,"__esModule",{value:!0});var Gs=fe(),vx=be(),gY={message:({params:{len:t}})=>(0,Gs.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Gs._)`{limit: ${t}}`},yY={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:gY,code(t){let{gen:e,schema:n,data:r,it:i}=t,s=i.items||0;if(s===!0)return;let o=e.const("len",(0,Gs._)`${r}.length`);if(n===!1)t.setParams({len:s}),t.fail((0,Gs._)`${o} > ${s}`);else if(typeof n=="object"&&!(0,vx.alwaysValidSchema)(i,n)){let c=e.var("valid",(0,Gs._)`${o} <= ${s}`);e.if((0,Gs.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:vx.Type.Num},c),i.allErrors||e.if((0,Gs.not)(c),()=>e.break())})}}};ZT.default=yY});var Tx=w(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});var vY=yx(),bY=bx(),TY=[vY.default,bY.default];eS.default=TY});var _x=w(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});Tp.DiscrError=void 0;var Sx;(function(t){t.Tag="tag",t.Mapping="mapping"})(Sx||(Tp.DiscrError=Sx={}))});var kx=w(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});var _a=fe(),tS=_x(),Ex=kl(),SY=El(),_Y=be(),EY={message:({params:{discrError:t,tagName:e}})=>t===tS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,_a._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},kY={keyword:"discriminator",type:"object",schemaType:"object",error:EY,code(t){let{gen:e,data:n,schema:r,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,_a._)`${n}${(0,_a.getProperty)(a)}`);e.if((0,_a._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:tS.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let h=f();e.if(!1);for(let y in h)e.elseIf((0,_a._)`${l} === ${y}`),e.assign(c,d(h[y]));e.else(),t.error(!1,{discrError:tS.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(h){let y=e.name("valid"),p=t.subschema({keyword:"oneOf",schemaProp:h},y);return t.mergeEvaluated(p,_a.Name),y}function f(){var h;let y={},p=_(i),T=!0;for(let k=0;k<o.length;k++){let C=o[k];if(C?.$ref&&!(0,_Y.schemaHasRulesButRef)(C,s.self.RULES)){let B=C.$ref;if(C=Ex.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,B),C instanceof Ex.SchemaEnv&&(C=C.schema),C===void 0)throw new SY.default(s.opts.uriResolver,s.baseId,B)}let L=(h=C?.properties)===null||h===void 0?void 0:h[a];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);T=T&&(p||_(C)),v(L,k)}if(!T)throw new Error(`discriminator: "${a}" must be required`);return y;function _({required:k}){return Array.isArray(k)&&k.includes(a)}function v(k,C){if(k.const)b(k.const,C);else if(k.enum)for(let L of k.enum)b(L,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(k,C){if(typeof k!="string"||k in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[k]=C}}}};nS.default=kY});var wx=w((nae,wY)=>{wY.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 Nx=w((rae,NY)=>{NY.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 Px=w((iae,PY)=>{PY.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 Rx=w((sae,RY)=>{RY.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 Cx=w((oae,CY)=>{CY.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 Dx=w((aae,DY)=>{DY.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 Ax=w((cae,AY)=>{AY.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 Ox=w(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});var OY=wx(),IY=Nx(),xY=Px(),MY=Rx(),LY=Cx(),$Y=Dx(),qY=Ax(),jY=["/properties"];function FY(t){return[OY,IY,xY,MY,e(this,LY),$Y,e(this,qY)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function e(n,r){return t?n.$dataMetaSchema(r,jY):r}}rS.default=FY});var Ix=w((ut,sS)=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.MissingRefError=ut.ValidationError=ut.CodeGen=ut.Name=ut.nil=ut.stringify=ut.str=ut._=ut.KeywordCxt=ut.Ajv2019=void 0;var BY=sI(),UY=nx(),VY=ux(),zY=mx(),WY=Tx(),HY=kx(),GY=Ox(),iS="https://json-schema.org/draft/2019-09/schema",Ea=class extends BY.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(VY.default),UY.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(zY.default),this.addVocabulary(WY.default),this.opts.discriminator&&this.addKeyword(HY.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:n}=this.opts;n&&(GY.default.call(this,e),this.refs["http://json-schema.org/schema"]=iS)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(iS)?iS:void 0)}};ut.Ajv2019=Ea;sS.exports=ut=Ea;sS.exports.Ajv2019=Ea;Object.defineProperty(ut,"__esModule",{value:!0});ut.default=Ea;var YY=_l();Object.defineProperty(ut,"KeywordCxt",{enumerable:!0,get:function(){return YY.KeywordCxt}});var ka=fe();Object.defineProperty(ut,"_",{enumerable:!0,get:function(){return ka._}});Object.defineProperty(ut,"str",{enumerable:!0,get:function(){return ka.str}});Object.defineProperty(ut,"stringify",{enumerable:!0,get:function(){return ka.stringify}});Object.defineProperty(ut,"nil",{enumerable:!0,get:function(){return ka.nil}});Object.defineProperty(ut,"Name",{enumerable:!0,get:function(){return ka.Name}});Object.defineProperty(ut,"CodeGen",{enumerable:!0,get:function(){return ka.CodeGen}});var KY=Zh();Object.defineProperty(ut,"ValidationError",{enumerable:!0,get:function(){return KY.default}});var XY=El();Object.defineProperty(ut,"MissingRefError",{enumerable:!0,get:function(){return XY.default}})});var Qe=K(iN());var kd=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=oN(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.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=sN(r.text,!1,s);if(c-a===u.length)for(let f=0,h=u.length;f<h;f++)l[f+a+1]=u[f];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=r.text.length-(o-s);if(d!==0)for(let f=a+1+u.length,h=l.length;f<h;f++)l[f]=l[f]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=sN(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},Po;(function(t){function e(i,s,o,a){return new kd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof kd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=Og(s.map(zL),(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=r})(Po||(Po={}));function Og(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Og(r,e),Og(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function sN(t,e,n=0){let r=e?[n]:[];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++,r.push(n+i+1))}return r}function oN(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function zL(t){let e=oN(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var wd=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],Nd=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var zd=K(J());var Mg=K(require("url")),lN=require("crypto"),uN=require("path");var xg=K(J());var nn=class{constructor(e,n,r){this.uri=e;this.range=n;this.issues=r}},Pd=class extends nn{constructor(n,r,i,s){super(r,i,s);this.value=n;this.type="STRING"}},Rd=class extends nn{constructor(n,r,i,s){super(r,i,s);this.values=n;this.type="BYTESTRING"}},Cd=class extends nn{constructor(n,r,i,s){super(r,i,s);this.value=n;this.type="ARRAY_VALUE"}},Dd=class extends nn{constructor(n,r,i,s,o){super(i,s,o);this.label=n;this.nodePath=r;this.type="LABEL_REF"}},Ad=class extends nn{constructor(n,r,i,s){super(r,i,s);this.nodePath=n;this.type="NODE_PATH"}},Od=class extends nn{constructor(n,r,i,s,o){super(i,s,o);this.value=n;this.evaluated=r}},Id=class extends Od{constructor(n,r,i,s,o){super(n,r,i,s,o);this.type="NUMBER_VALUE"}},xd=class extends Od{constructor(n,r,i,s,o){super(n,r,i,s,o);this.type="EXPRESSION"}},Md=class extends nn{constructor(n,r,i,s){super(r,i,s);this.value=n}},Ld=class extends nn{constructor(n,r,i,s,o){super(i,s,o);this.name=n;this.values=r}},$d=class extends nn{constructor(n,r,i,s){super(r,i,s);this.address=n}},qd=class extends nn{constructor(n,r,i,s,o,a){super(s,o,a);this.fullName=n;this.name=r;this.address=i}},jd=class extends nn{constructor(n,r,i,s){super(r,i,s);this.name=n}};var Ya=class extends nn{constructor(n,r,i,s,o,a,c){super(o,a,c);this.type=n;this.name=r;this.properties=i;this.nodes=s}},Fd=class extends Ya{constructor(e,n,r,i,s,o){super("REF",e,n,r,i,s,o)}},Bd=class extends Ya{constructor(e,n,r,i,s){super("ROOT",null,e,n,r,i,s)}},Ud=class extends Ya{constructor(e,n,r,i,s,o){super("CHILD",e,n,r,i,s,o)}};var _n=K(J()),j=class{constructor(e){this._children=[];this.issues=[];this._fisrtToken=e?.start,this._lastToken=e?.end}addIssue(e){this.issues.push(e)}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 se(e,this.uri)?[this]:this.children.flatMap(n=>n.getTopMostAstNodeForFile(e))}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getDocumentSymbols(e)??[]);if(!se(this.uri,e))return[];let n=te(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:n,selectionRange:n,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![_n.SymbolKind.File,_n.SymbolKind.Class,_n.SymbolKind.Constant].some(r=>r===e))return[];let n=te(this);return[{location:_n.Location.create(pe(this.uri),n),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(r=>r.getWorkspaceSymbols()??[]).filter(r=>r.kind===_n.SymbolKind.File||r.kind===_n.SymbolKind.Class||r.kind===_n.SymbolKind.Constant)]}buildSemanticTokens(e){this._children.forEach(n=>n.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(ci(this.semanticTokenType),li(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(n=>n===e||n.isAncestorOf(e))}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return _n.Range.create(_n.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),_n.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}serialize(e){return new nn(this.uri,this.range,this.serializeIssues)}};function WL(t){return t.replace(/'(.)'/g,(e,n)=>n.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function Ig(t){try{return(0,eval)(WL(t))}catch(e){console.log(e)}return t}var tt=class extends j{toJson(){return-1}resolve(e){return aN(this.toString(),e)}evaluate(e){return Ig(this.resolve(e))}isTrue(e){return Ig(`!!(${this.resolve(e)})`)}toPrettyString(e){let n=this.evaluate(e);return`${n.toString()} /* ${this.toString()}${typeof n=="number"?` = 0x${n.toString(16)}`:""} */`}serialize(e){return new xd(this.toString(),this.evaluate(e),this.uri,this.range,this.serializeIssues)}},ui=class extends tt{constructor(n,r,i){super();this.expression=n;this.wrapped=r;this.join=i;this.addChild(n),i&&(this.addChild(i.operator),this.addChild(i.expression))}get firstToken(){return this.openBracket?this.openBracket:super.firstToken}get lastToken(){return this.closeBracket?this.closeBracket:super.lastToken}addExpression(n,r){this.addChild(n),this.addChild(r)}toString(){let n=this.children.map(r=>r.toString()).join(" ");return this.wrapped?`(${n})`:`${n}`}isTrue(n){let r=`(${this.children.map(i=>i instanceof tt?i.resolve(n):i.toString()).join(" ")})`;return Ig(`!!${r}`)}};var qr=class extends tt{constructor(n,r,i){super(r);this.value=n;this.docSymbolsMeta={name:`param${i+1}`,kind:xg.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},jr=class extends tt{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(n){return se(this.uri,n)?[{name:this.functionName.name,kind:xg.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(n)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(n=>n?.toString()??"<NULL>").join(",")})`}isTrue(n){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&n.has(this.params[0].value)):super.isTrue(n)}};var Es=(t,e,n=!0,r=!0)=>({start:{line:t?.pos.line??0,character:n?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var te=t=>Es(t.tokenIndexes.start,t.tokenIndexes.end),dN=" ",fN=t=>{dN=t},Ro=()=>dN,ci=t=>wd.findIndex(e=>e===t),li=t=>Nd.findIndex(e=>e===t),Lg=(t,e,n)=>!se(t.uri,e)||n.line<t.pos.line?!1:n.line>t.pos.line?!0:n.character>t.pos.colEnd,HL=(t,e,n)=>se(t.uri,e)?n.line<t.pos.line?!0:n.line>t.pos.line?!1:n.character<t.pos.col:!1,Kn=(t,e,n)=>!!(se(t.uri,e)&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line<n.line||t.tokenIndexes.start.pos.line===n.line&&t.tokenIndexes.start.pos.col<=n.character)&&(t.tokenIndexes.end.pos.line>n.line||t.tokenIndexes.end.pos.line===n.line&&t.tokenIndexes.end.pos.colEnd>=n.character)),hN=(t,e,n)=>!!(se(t.uri,e)&&t.lastToken.value!==";"&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line===n.line||t.tokenIndexes.end.pos.line===n.line)&&n.character>=t.tokenIndexes.end.pos.colEnd),pN=(t,e,n)=>{if(!t)return!1;let i=t.filter(s=>s.pos.line===n.line).at(-1);return i&&i.pos.col>=n.character?!1:e.tokenIndexes?.end===i};var Br=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].reverse().find(s=>Kn(s,e,n));return r},Xa=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].find(s=>HL(s.lastToken,e,n));return r===t?void 0:r},Ja=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].reverse().find(s=>Lg(s.firstToken,e,n));return r===t?void 0:r},z=(t,e,n=zd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:c.issues?c.issues.map(YL).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.issues.push(u),{raw:c,diagnostic:u}},qt=(t,e,n=zd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:KL(c),source:"devicetree",tags:c.tags,relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(XL).join(" or "),location:{uri:pe(d.uri),range:te(d)}}))]},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},$=(t,e,n=zd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:JL(c),relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(QL).join(" or "),location:{uri:pe(d.uri),range:te(d)}}))],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.issues.push(u),{raw:c,diagnostic:u}},mN=(t,e)=>[...t].sort((r,i)=>{let s=e.getSortKey(r),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(!r.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return r.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?r.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:r.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function St(t,e,n){let r=Ue(t.textDocument.uri);if(!e)return[];let i=performance.now(),o=(await e.getRuntime()).getDeepestAstNode(r,t.position),a=e.getSortKey(o?.ast);return console.log(`search: ${performance.now()-i}ms`),n(o,l=>{let u=t.position;return se(l.uri,r)?!!(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 H(t,e){return{start:t,end:e??t}}var F=(t,e)=>t?.tokens.some(n=>n===e),Xe=(t,e=!1)=>n=>n?.value&&(e?t.toLowerCase()===n.value.toLowerCase():t===n.value)?"yes":GL(t)(n),Ie=t=>e=>e?.tokens.some(n=>n===t)?"yes":"no",GL=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",mr=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&se(t.uri,e.uri),zt=(t,e)=>t?.adjacentToken&&t.adjacentToken.value===e?.value||e?.adjacentToken&&e.adjacentToken.value===t?.value?!0:!!t&&!!e&&mr(t,e)&&t.pos.colEnd===e.pos.col,Wd=t=>t.map((e,n)=>({index:n,context:e,files:e.getContextFiles()})),gr=(t,e,n,r)=>{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 n?.getContextFiles().find(s=>se(s,e.uri))?n:Wd(t).sort(s=>s.context.id===r?-1:0).find(s=>s.files.some(o=>se(o,e.uri)))?.context},$g=(t,e)=>Wd(t).filter(r=>r.files.some(i=>se(i,e))).map(r=>r.context),gN=t=>{let e=/^(\w+)\s+(.+)$/,n=/^(\w+)\(([^)]*)\)\s+(.+)$/,r=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,i;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=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else 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}}else if(i=e.exec(t)){let[,,s]=i;return s.trim()}},aN=(t,e)=>{let n=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),r=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),i=t,s;do s=i,i=n(s),i=r(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},pe=t=>Mg.default.pathToFileURL(t).toString(),Ue=t=>nt(Mg.default.fileURLToPath(t)),se=(t,e)=>!t||!e?!1:t===e,nt=t=>(0,uN.normalize)(process.platform==="win32"?t.toLowerCase():t),di=t=>(0,lN.createHash)("sha256").update([nt(t.dtsFile),...t.includePaths.map(nt),...t.overlays.map(nt),t.bindingType,...t.zephyrBindings.map(nt),...t.deviceOrgBindingsMetaSchema.map(nt),...t.deviceOrgTreeBindings.map(nt)].join(":")).digest("hex"),YL=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 referance";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"Unkown 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"}},KL=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.`}}).join(" or "),XL=t=>{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";default:return"TODO"}},JL=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 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 29:return`INTRO exceeds address space avalable 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"}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),QL=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";default:return"TODO"}},Fr=(t,e)=>{let n=Math.max(t.length,e.length);for(let r=0;r<n;r++){let i=t[t.length-n+r]??0,s=e[e.length-n+r]??0;if(i<s)return-1;if(i>s)return 1}return 0},qi=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),i=0;for(let s=0;s<n;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0,c=o+a+i;r[n-1-s]=c>>>0,i=c>4294967295?1:0}return i&&r.unshift(1),r},ZL=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),i=0;for(let s=0;s<n;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,r[n-1-s]=o-a>>>0}for(;r.length>1&&r[0]===0;)r.shift();return r},e$=(t,e)=>qi(t,e),yN=(t,e)=>{let n=[];for(let r of t){let i=r.childAddress,s=r.length,o=qi(i,s);if(Fr(e,i)>=0&&Fr(e,o)<0){let a=ZL(e,i),c=r.parentAddress,l=e$(c,a),u=qi(c,s);n.push({start:l,end:u,ast:r.ast})}}return n};function vN(t){return Array.isArray(t)&&Array.isArray(t[0])}function Qa(t){return!t||t instanceof jr?t:Qa(t.parentNode)}function bN(t,e){let n=t.getText(),r=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=n;for(let s of r){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 cN(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 TN(t,e){return cN(t.end,e.start)>0&&cN(t.start,e.end)<0}var yr=K(J());var wN=K(J());var SN=K(J());var Re=class extends j{constructor(n,r){super(r);this.value=n;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:SN.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return new Pd(this.value,this.uri,this.range,this.serializeIssues)}};var EN=K(J());var _N=K(J());var Wt=class extends tt{constructor(n,r){super(r);this.value=n;this.docSymbolsMeta={name:this.value.toString(),kind:_N.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(n){return this.value.toString(n)}toJson(){return this.value}toPrettyString(n){let r=this.evaluate(n);return`${r.toString()} /* ${typeof r=="number"?`0x${r.toString(16)}`:""} */`}serialize(){return new Id(this.value.toString(),this.value,this.uri,this.range,this.serializeIssues)}};var Rt=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Cell Array",kind:EN.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(n=>n.toString()).join(" ")}>`}toPrettyString(n){return`<${this.values.map(r=>r.toPrettyString(n)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(n=>n.value instanceof Wt)){let n=new ArrayBuffer(8),r=new DataView(n);return this.values.map(i=>i.value.value).forEach((i,s)=>{r.setUint32(s*4,i)}),r.getBigUint64(0)}return this.values.map(n=>n.value?.toJson()??NaN)}serialize(n){let r=this.values.map(i=>i.value?.serialize(n)??null);return new Cd(r,this.uri,this.range,this.serializeIssues)}};var kN=K(J());var fi=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Byte String Value",kind:kN.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(n=>n.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(n=>n.value?.toJson()??NaN)}serialize(){return new Rd(this.values.map(n=>n.value?{value:n.value.toString(16),range:n.value.range,evaluated:n.value.value}:null),this.uri,this.range,this.serializeIssues)}};var He=class extends j{constructor(n,r){super(r);this.name=n;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return new Md(this.name,this.uri,this.range,this.serializeIssues)}},Ge=class extends j{constructor(n,r=[]){super();this.propertyName=n;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:wN.SymbolKind.Property},this.labels.forEach(i=>this.addChild(i)),this.addChild(n)}set values(n){if(this._values)throw new Error("Only one property name is allowed");this._values=n,this.addChild(n)}get values(){return this._values}get quickValues(){return this.values?.values.map(n=>n?n.value instanceof Re?n.value.value:n.value instanceof Rt?n.value.values.map(r=>r.value instanceof Wt?r.value.value:NaN):n.value instanceof fi?n.value.values.map(r=>r.value?.value??NaN):NaN:null)}getFlatAstValues(){return this.values?.values.flatMap(n=>n?n.value instanceof Re?n.value:n.value instanceof Rt?n.value.values.map(r=>r.value):n.value instanceof fi?n.value.values.map(r=>r.value):n.value:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(n){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toPrettyString(n)??"NULL").join(", ")??"NULL"}`:""};`}serialize(n){return new Ld(this.propertyName?.serialize()??null,this.values?.values.map(r=>r?.value?.serialize(n)??null)??null,this.uri,this.range,this.serializeIssues)}};var NN=K(J()),un=class extends j{constructor(n,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:n,kind:NN.SymbolKind.Function}}};var En=class extends un{constructor(n){super("Delete Node",n);this._nodeNameOrRef=null}set nodeNameOrRef(n){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=n,this.addChild(n)}get nodeNameOrRef(){return this._nodeNameOrRef}};var ot=class extends un{constructor(n){super("Delete Property",n);this._propertyName=null}set propertyName(n){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=n,this.addChild(n)}get propertyName(){return this._propertyName}};var PN=K(J());var de=class extends j{constructor(n){super();this.label=n;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:PN.SymbolKind.Key},this.addChild(n)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return new Dd(this.label?.toString()??null,this.linksTo?.pathString??null,this.uri,this.range,this.serializeIssues)}};var mt=class t extends j{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof gt)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 En)}addNodeChild(e){this.addChild(e)}},gt=class extends mt{constructor(){super(),this.docSymbolsMeta={name:"/",kind:yr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Ge)}get name(){return new Me("/",H(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof ot)}get nodes(){return this.children.filter(e=>e instanceof xe)}get pathName(){return"/"}serialize(e){return new Bd(this.properties.map(n=>n.serialize(e)),this.nodes.map(n=>n.serialize(e)),this.uri,this.range,this.serializeIssues)}},jt=class extends mt{constructor(n=[]){super();this.labels=n;this._reference=null;this.docSymbolsMeta={name:"DTC Name",kind:yr.SymbolKind.Class},n.forEach(r=>{super.addChild(r)})}get serializeIssues(){return[...this.issues,...this.reference?.issues??[]].map(n=>n())}set reference(n){if(this._reference)throw new Error("Only on label reference is allowed");this._reference=n;let r;n instanceof de?r=n.value:r=n?.path?.pathParts.at(-1)?.name??"DTC Name",this.docSymbolsMeta={name:r??"DTC Name",kind:yr.SymbolKind.Class},this.addChild(n)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get reference(){return this._reference}get nodes(){return this.children.filter(n=>n instanceof xe)}get pathName(){if(this.reference instanceof de&&this.reference.label?.value)return`&${this.reference.label.value}`}get properties(){return this.children.filter(n=>n instanceof Ge)}get deleteProperties(){return this.children.filter(n=>n instanceof ot)}serialize(n){return new Fd(this.reference?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},xe=class t extends mt{constructor(n=[],r){super();this.labels=n;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:yr.SymbolKind.Class},r&&this.addChild(r),n.forEach(i=>{this.addChild(i)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(n=>n())}set name(n){if(this._name)throw new Error("Only on label reference is allowed");this._name=n,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:yr.SymbolKind.Class},this.addChild(n)}get name(){return this._name}get nodes(){return this.children.filter(n=>n instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(n=>n instanceof Ge)}get deleteProperties(){return this.children.filter(n=>n instanceof ot)}serialize(n){return new Ud(this.name?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},Za=class extends j{constructor(n,r){super(r);this.address=n;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((n,r)=>n.toString(16).padStart(r?8:0,"0")).join("")??"NaN"}serialize(){return new $d(this.address,this.uri,this.range,this.serializeIssues)}},Me=class extends j{constructor(n,r,i){super(r);this.name=n;this._address=i;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(n){if(this._address)throw new Error("Address can only be set once");n&&(this.lastToken=void 0,this._address=n,n.forEach(r=>this.addChild(r)))}get fullAddress(){return this._address?[...this._address.flatMap(n=>n.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(n=>n.toString()).join(",")}`:this.name}buildSemanticTokens(n){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};n(ci("type"),li("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(i=>{n(ci("decorator"),li("declaration"),{start:i.firstToken,end:i.lastToken}),i.buildSemanticTokens(n)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(n=>n.issues)??[]].map(n=>n())}serialize(){return new qd(this.toString(),new jd(this.name,this.uri,yr.Range.create(yr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.col),yr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.colEnd)),[]),this.address?.map(n=>n.serialize())??null,this.uri,this.range,this.serializeIssues)}};var Sr=K(J());var dn=class extends j{constructor(n,r,i,s){super();this.startLabels=n;this.value=r;this.endLabels=i;this.bits=s;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(s),this.addChild(r),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toPrettyString(n){return`${[this.value?.toPrettyString(n)??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var At=t=>t instanceof un?!0:t instanceof mt?!1:t.parentNode?At(t.parentNode):!1;var qg=t=>{if(t instanceof Ge)return t;if(!(t instanceof mt))return t.parentNode?qg(t.parentNode):void 0},ks=t=>!t||t instanceof Ge?!1:t instanceof dn||ks(t.parentNode),Co=t=>[...t.map(e=>{if(e instanceof xe||e instanceof gt)return e.name;if(e instanceof jt)return e.reference})].filter(e=>!!e),jg=(t,e)=>e?e.parentNode===t||jg(t,e.parentNode):!1;var at=K(J());var RN=K(J());var hi=class extends j{constructor(){super();this._pathParts=[]}addPath(n,r){this._pathParts.push(n),r&&this.addChild(r),this.addChild(n)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(n=>n?.toString()??"<NULL>").join("/")}buildSemanticTokens(n){this._children.forEach(r=>{r instanceof Me?r.buildSemanticTokens(n):n(ci("operator"),li("declaration"),r.tokenIndexes)})}},Ln=class extends j{constructor(n){super();this.path=n;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:RN.SymbolKind.Namespace},this.addChild(n)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return new Ad(this.path?.toString()??null,this.uri,this.range,this.serializeIssues)}};var ne=K(J());var Hd=K(J());var CN=require("path"),pi=class extends j{constructor(n,r){super();this.keyword=n;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:Hd.SymbolKind.File},this.addChild(n),this.addChild(r)}get resolvedPath(){return this._resolvedPath}set resolvedPath(n){this.docSymbolsMeta={name:`Include ${n}`,kind:Hd.SymbolKind.File},this._resolvedPath=n}},Do=class extends j{constructor(n,r,i){super(i);this._path=n;this.relative=r;this.docSymbolsMeta={name:(0,CN.basename)(this.path),kind:Hd.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var Xn=class extends j{constructor(n){super();this.comments=n;n.forEach(this.addChild.bind(this))}toString(){return this.comments.map(n=>n.toString()).join(`
|
|
183
|
+
`)}},Jn=class extends j{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}toString(){let e,n=this.firstToken,r="";for(;n!==this.lastToken;)r+=n?.value.padStart(n.value.length+(e?n.pos.col-e.pos.colEnd:0)," "),e=n,n=n?.nextToken;n&&(r+=n?.value.padStart(n.value.length+(e?n.pos.col-e.pos.colEnd:0)," "));let i=r.match(/^\s*(?:(?:\/\/|\/\*+)\s*)?(.*?)\s*(?:\*\/)?\s*$/s);return i?i[1]:""}};var t$=async(t,e,n)=>{let r=ne.Position.create(t.pos.line,t.pos.col),i=n.find(s=>Kn(s,e,r));if(i)return Br(i,e,r)},Fg=t=>{if(t)return t instanceof mt?t:Fg(t?.parentNode)},Ao=(t,e,n=0)=>{if(!e||!se(e.uri,t)||!e.parentNode?.uri)return n;let r=Fg(e.parentNode);return Ao(t,r,n+1)},n$=(t,e)=>async n=>{let r=t.filter(a=>!(a instanceof pi)&&!(a instanceof Jn)&&!(a instanceof Xn)),i=await t$(n.firstToken,e,r);if(!i||i===n||n.allDescendants.some(a=>a===i))return{level:0};let s=Fg(i);return{level:Ao(e,s),inAst:i}};async function Bg(t,e,n){let r=n.split(`
|
|
184
|
+
`),i=[],s=Ue(t.textDocument.uri),o=await e.getRuntime(),a=o.fileTopMostAsts(s);if(o.includes.filter(d=>se(d.resolvedPath,s)).length>1){let d=[];a.forEach(f=>{d.some(h=>h.firstToken.pos.line===f.firstToken.pos.line&&h.firstToken.pos.col===f.firstToken.pos.col)||d.push(f)}),a=d}let l=n$(a,s);i.push(...(await Promise.all(a.flatMap(async d=>await IN(t,d,s,l,r)))).flat()),t.options.trimTrailingWhitespace&&i.push(...s$(r,i));let u=r$(a,r);return u.length?i.filter(d=>!i$(d.range.start,u)):i}var r$=(t,e)=>{let n=ne.Position.create(e.length-1,e.at(-1)?.length??0),r=[],i;return t.filter(o=>(o instanceof Xn||o instanceof Jn)&&/^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:ne.Position.create(o.firstToken.pos.line,o instanceof Xn?o.firstToken.pos.colEnd:0)};else if(a==="dts-format on"&&i){let c=ne.Position.create(o.lastToken.pos.line,o instanceof Xn?o.lastToken.pos.colEnd-1:e[o.lastToken.pos.line-1].length);r.push(ne.Range.create(i.start,c)),i=void 0}}),i&&r.push(ne.Range.create(i.start,n)),r};function DN(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 i$=(t,e)=>e.some(n=>DN(t,n.start)>=0&&DN(t,n.end)<=0),s$=(t,e)=>{let n=[];return t.forEach((r,i)=>{let s=r.trimEnd();if(s.length!==r.length){let o=ne.Range.create(ne.Position.create(i,s.length),ne.Position.create(i,r.length));e.some(a=>TN(o,a.range))||n.push(ne.TextEdit.del(o))}}),n},nc=(t,e,n=1,r=!1,i=t.prevToken)=>{if(i){let s=t.pos.line-i.pos.line;if(s-n&&(s!==2&&n!==0||n===0||r))return ne.TextEdit.replace(ne.Range.create(ne.Position.create(i.pos.line,i.pos.colEnd),ne.Position.create(t.pos.line-n,n?e[t.pos.line-n].length:t.pos.col)),"".padEnd(n-(r?1:0),`
|
|
185
|
+
`))}else if(t.pos.line)return ne.TextEdit.del(ne.Range.create(ne.Position.create(0,0),ne.Position.create(t.pos.line,0)))},AN=(t,e,n,r="")=>{let i=t.pos.line===t.prevToken?.pos.line;if(t.prevToken&&i)return ne.TextEdit.replace(ne.Range.create(ne.Position.create(t.prevToken.pos.line,t.prevToken.pos.colEnd),ne.Position.create(t.pos.line,t.pos.col)),`
|
|
186
|
+
${"".padStart(e*n.length,n)}${r}`)},Yd=(t,e,n,r,i="")=>{let s=`${"".padStart(e*n.length,n)}${i}`,o=ne.Range.create(ne.Position.create(t.pos.line,0),ne.Position.create(t.pos.line,t.pos.col)),a=b$(r,o);return s===a?[]:[ne.TextEdit.replace(ne.Range.create(ne.Position.create(t.pos.line,0),ne.Position.create(t.pos.line,t.pos.col)),s)]},ht=(t,e,n=1,r=!1,i=!1)=>{if(!t.nextToken)return[];if(t.nextToken?.pos.line!==t.pos.line){if(r)return[];let s=nc(t.nextToken,e,0);if(!s)throw new Error("remove new LinesEdit must be defined");return n&&(s.newText=`${"".padEnd(n,i?" ":" ")}${s.newText}`),[s]}return n===0?[ne.TextEdit.del(ne.Range.create(ne.Position.create(t.pos.line,t.pos.colEnd),ne.Position.create(t.nextToken.pos.line,t.nextToken.pos.col)))]:t.nextToken.pos.line===t.pos.line&&t.pos.colEnd===t.nextToken.pos.col?[ne.TextEdit.insert(ne.Position.create(t.nextToken.pos.line,t.nextToken.pos.col),"".padEnd(n,i?" ":" "))]:[ne.TextEdit.replace(ne.Range.create(ne.Position.create(t.pos.line,t.pos.colEnd),ne.Position.create(t.nextToken.pos.line,t.nextToken.pos.col)),"".padEnd(n,i?" ":" "))]},ec=(t,e)=>t.slice(1).flatMap(n=>n.firstToken.prevToken?ht(n.firstToken.prevToken,e):[]),o$=async(t,e,n,r,i,s,o)=>{if(!se(e.uri,n))return[];let a=[];if(a.push(...vr(e.firstToken,r,i,s)),e instanceof xe||e instanceof jt)if(a.push(...ec(e.labels,s)),e instanceof xe){e.labels.length&&e.name&&e.name.firstToken.prevToken&&a.push(...ht(e.name.firstToken.prevToken,s));let c=e.name&&e.openScope?ht(e.name.lastToken,s):[];a.push(...c)}else{e.labels.length&&e.reference?.firstToken.prevToken&&a.push(...ht(e.reference.firstToken.prevToken,s));let c=e.reference&&e.openScope?ht(e.reference.lastToken,s):[];a.push(...c)}else e instanceof gt&&e.firstToken.value==="/"&&e.openScope&&a.push(...ht(e.firstToken,s,1));return a.push(...(await Promise.all(e.children.flatMap(c=>IN(t,c,n,o,s,r+1)))).flat()),e.closeScope&&(e.openScope&&e.closeScope.prevToken===e.openScope?a.push(...ht(e.openScope,s)):a.push(...vr(e.closeScope,r,i,s,void 0,1,!0))),e.lastToken.value===";"&&e.closeScope&&a.push(...rc(e.closeScope,e.lastToken)),a},a$=(t,e,n,r,i,s)=>{let o=[];if(o.push(...ec(e.labels,s)),e.labels.length&&e.value?.firstToken.prevToken&&o.push(...ht(e.value.firstToken.prevToken,s)),e.firstToken.pos.line!==e.firstToken.prevToken?.pos.line){let a=nc(e.firstToken,s,1,!0);a&&o.push(a),o.push(...Yd(e.firstToken,n,r.singleIndent,s,tc(r,t+4)))}else o.push(...ht(e.firstToken.prevToken,s,i&&e.firstToken.prevToken===i?0:1));return e.value instanceof tt&&o.push(...Gd(e.value,s)),o},c$=(t,e,n,r,i)=>{let s=[];if(e instanceof Rt||e instanceof fi){if(s.push(...e.values.flatMap(o=>a$(t,o,n,r,e.openBracket,i))),e.closeBracket?.prevToken)if(e.closeBracket.prevToken.pos.line===e.closeBracket.pos.line)s.push(...ht(e.closeBracket.prevToken,i,e.closeBracket.prevToken===e.values.at(-1)?.lastToken?0:1));else{let o=nc(e.closeBracket,i,1,!0);o&&s.push(o),s.push(...Yd(e.closeBracket,n,r.singleIndent,i,tc(r,t+3)))}}else e instanceof tt&&s.push(...Gd(e,i));return s},Gd=(t,e)=>t instanceof jr?l$(t,e):t instanceof ui?u$(t,e):[],l$=(t,e)=>{let n=[];return n.push(...ht(t.functionName.lastToken,e,0)),t.params.forEach((r,i)=>{r?.firstToken.prevToken&&n.push(...ht(r?.firstToken.prevToken,e,i?1:0)),r?.splitToken&&n.push(...rc(r.lastToken,r.splitToken))}),t.lastToken.value===")"&&t.lastToken.prevToken&&n.push(...ht(t.lastToken.prevToken,e,0)),n},u$=(t,e)=>{let n=[];return t.openBracket&&t.openBracket.nextToken&&n.push(...ht(t.openBracket,e,0)),n.push(...Gd(t.expression,e)),t.join&&(t.join.operator.firstToken.prevToken&&n.push(...ht(t.join.operator.firstToken.prevToken,e)),t.join.expression.firstToken.prevToken&&n.push(...ht(t.join.expression.firstToken.prevToken,e)),n.push(...Gd(t.join.expression,e))),t.closeBracket&&t.closeBracket.prevToken&&n.push(...ht(t.closeBracket.prevToken,e,0)),n},d$=(t,e,n,r,i)=>{let s=[];return s.push(...ec(e.startLabels,i)),s.push(...c$(t,e.value,n,r,i)),s.push(...ec(e.endLabels,i)),s},tc=(t,e)=>{if(t.insertSpaces)return"".padStart(e," ");let n=Math.floor(e/t.tabSize),r=e%t.tabSize;return`${"".padStart(n," ")}${"".padStart(r," ")}`},f$=(t,e,n,r,i)=>{let s=[];return e.values.forEach((o,a)=>{if(!o)return[];let c=o.firstToken.prevToken,l=a?e.values.at(a-1):void 0;if(c)if(c.pos.line===o.firstToken.pos.line)if(c.value===","&&l?.lastToken.pos.line!==o.firstToken.pos.line&&c.prevToken?.pos.line!==o.firstToken.pos.line){let u=AN(o.firstToken,n,r.singleIndent,tc(r,t+3));u&&s.push(u)}else s.push(...ht(c,i,1));else{let u=nc(o.firstToken,i,1,!0);u&&s.push(u),s.push(...Yd(o.firstToken,n,r.singleIndent,i,tc(r,t+3)))}s.push(...d$(t,o,n,r,i)),o.nextValueSeparator&&s.push(...rc(o.lastToken,o.nextValueSeparator))}),s},h$=(t,e,n,r,i)=>{if(!se(t.uri,i))return[];let s=[];return s.push(...vr(t.firstToken,e,n.singleIndent,r)),s.push(...ec(t.labels,r)),t.labels.length&&t.propertyName?.firstToken.prevToken&&s.push(...ht(t.propertyName.firstToken.prevToken,r)),t.values&&(t.propertyName&&s.push(...ht(t.propertyName?.lastToken,r)),s.push(...f$(t.propertyName?.name.length??0,t.values,e,n,r))),t.lastToken.value===";"&&s.push(...rc(t.children.at(-1).lastToken,t.lastToken)),s},vr=(t,e,n,r,i,s,o)=>{let a=[],c=AN(t,e,n,i);if(c)a.push(c);else{let l=nc(t,r,s,o);l&&a.push(l),a.push(...Yd(t,e,n,r,i))}return a},rc=(t,e)=>t.pos.line===e.pos.line&&t.pos.colEnd+1===e.pos.colEnd?[]:t.nextToken===e?[ne.TextEdit.replace(ne.Range.create(ne.Position.create(t.pos.line,t.pos.colEnd),ne.Position.create(e.pos.line,e.pos.colEnd)),e.value)]:[ne.TextEdit.insert(ne.Position.create(t.pos.line,t.pos.colEnd),e.value),ne.TextEdit.del(ne.Range.create(ne.Position.create(e.prevToken?.pos.line??e.pos.line,e.prevToken?.pos.colEnd??e.pos.col),ne.Position.create(e.pos.line,e.pos.colEnd)))],p$=(t,e,n,r)=>{let i=[];i.push(...vr(t.firstToken,e,n,r));let s=ht(t.keyword.lastToken,r);return i.push(...s),t.lastToken.value===";"&&i.push(...rc(t.children.at(-1).lastToken,t.lastToken)),i},m$=(t,e,n,r,i)=>{if(n===void 0)return[];if(!se(t.uri,e))return[];let s=[];s.push(...vr(t.firstToken,n.level,r,i));let o=ht(t.keyword.lastToken,i);return s.push(...o),s},g$=(t,e,n,r,i)=>t.comments.flatMap((s,o)=>y$(s,e,n,r,o?o===t.comments.length-1?"last":"comment":"first",i)),ON=(t,e,n="")=>{let r=e?qg(e):void 0;if(!r)return n;let i=ks(e),s=r.propertyName?.name.length??0;return`${`${tc(t,s+(i?4:3)-n.length)}`}${n}`},y$=(t,e,n,r,i,s)=>{if(!t.firstToken.prevToken)return vr(t.firstToken,e?.level??0,n,r);if(t.firstToken.pos.line===t.firstToken.prevToken?.pos.line)return ht(t.firstToken.prevToken,r,1,void 0,!0);if(e===void 0)return[];let a=[],c="",l=t.toString();switch(i==="last"&&l.trim()!==""&&t.lastToken.prevToken&&(i="comment",a.push(...vr(t.lastToken.prevToken,e?.level??0,n,r," "))),i){case"comment":c=t.firstToken.value==="*"?" ":" * ";break;case"first":break;case"last":c=" ";break}return e?.inAst instanceof mt?a.push(...vr(t.firstToken,e?.level??0,n,r,c)):a.push(...vr(t.firstToken,e?.level??0,n,r,ON(s,e?.inAst,c))),a},v$=(t,e,n,r,i)=>t.firstToken.prevToken?t.firstToken.pos.line===t.firstToken.prevToken.pos.line?ht(t.firstToken.prevToken,r,1,void 0,!0):vr(t.firstToken,e?.level??0,n,r,ON(i,e?.inAst)):vr(t.firstToken,e?.level??0,n,r),IN=async(t,e,n,r,i,s=0)=>{let o=t.options.tabSize,a=t.options.insertSpaces,c=a?"".padStart(o," "):" ",l={tabSize:o,insertSpaces:a,singleIndent:c};return fN(c),e instanceof mt?o$(t,e,n,s,c,i,r):e instanceof Ge?h$(e,s,l,i,n):e instanceof un?p$(e,s,c,i):e instanceof pi?m$(e,n,await r(e),c,i):e instanceof Jn?v$(e,await r(e),c,i,l):e instanceof Xn?g$(e,await r(e),c,i,l):[]};function b$(t,e){let n=t[e.start.line],r=t[e.end.line];if(e.start.line===e.end.line)return n.substring(e.start.character,e.end.character);let i=t.slice(e.start.line+1,e.end.line);return[n.substring(e.start.character),...i,r.substring(0,e.end.character)].join(`
|
|
187
|
+
`)}function T$(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 Y=class{constructor(e,n,r="optional",i=void 0,s,o){this.name=e;this.type=n;this.def=i;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:at.MarkupKind.Markdown,value:["### Type","**DTS native type** ",`${this.type.map(e=>e.types.map(T$).join(" or ")).join(",")}
|
|
187
188
|
|
|
188
189
|
`,...this.bindingType?["**Binding type** ",`${this.bindingType}
|
|
189
190
|
|
|
@@ -192,9 +193,9 @@ ${r}${"".padStart(e*n.length,n)}`)},jg=(t,e,n,r,i="")=>{let s=`${"".padStart(e*n
|
|
|
192
193
|
`)]:[],...this.examples?["### Example",this.examples.join(`
|
|
193
194
|
|
|
194
195
|
`)]:[]].join(`
|
|
195
|
-
`)});this.signatureArgsCyclic=!1;typeof r!="function"?this.required=()=>r:this.required=r,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,n,r,i){let s=this.required(n);if(i){if(s==="omitted")return[$(11,i.ast,
|
|
196
|
-
${"".padEnd(
|
|
197
|
-
`)};`,this.description,...a.flat())],activeSignature:0,activeParameter:d}}return o.signatureArgsCyclic&&d&&(d=d%a.length),{signatures:[ct.SignatureInformation.create(`${n.name} = <${a.map(f=>f.label).join(" ")}>;`,this.description,...a)],activeSignature:0,activeParameter:d}}getPropertyListCompletionItems(n){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(n)!=="omitted"&&typeof r.name=="string").map(r=>{let i=n&&r.required(n),s=!!n.property.some(a=>r.getNameMatch(a.name)),o="a";return i==="required"?o=s?"Y":"!":o=s?"Z":"B",{label:`${r.name}`,kind:ct.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var dn=class extends j{constructor(n,r,i,s){super();this.startLabels=n;this.value=r;this.endLabels=i;this.bits=s;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(s),this.addChild(r),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toPrettyString(n){return`${[this.value?.toPrettyString(n)??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var we=t=>{if(!t?.values.some(e=>!(e?.value instanceof Rt)))return t?.values.flatMap(e=>e.value.values.map(n=>n.value))??[]};var Re=(t,e,n,r)=>{let i=t.ast.values?.values.at(e)?.value;if(i instanceof Rt){let s=i.values.at(n);if(s?.value instanceof et){let o=s.value.evaluate(r);if(typeof o=="number")return o}}},$n=(t,e,n=0)=>{if(t instanceof dn){if(t?.value instanceof Rt){let r=t.value.values.at(n);if(r?.value instanceof zt)return e.getPhandle(r.value.value);if(r?.value instanceof de)return r.value.linksTo;if(r?.value instanceof Ln)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof zt)return e.getPhandle(t.value);if(t instanceof de)return t.linksTo;if(t instanceof Ln)return t.path?.pathParts.at(-1)?.linksTo}},V=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var RN=()=>{let t=new Y("compatible",V("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 Do=K(J()),CN=()=>{let t=new Y("device_type",V("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 n=e.ast.values?.values.at(0)?.value;if(n instanceof Le&&n.value!==e.parent.name)return e.parent.name==="cpu"?[$(12,e.ast,Do.DiagnosticSeverity.Error,[],[],[e.name])]:[$(13,e.ast,Do.DiagnosticSeverity.Error,[],[],[e.name])]}return t.required(e.parent)!=="required"?[$(14,e.ast,Do.DiagnosticSeverity.Hint,[],[Do.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 DN=()=>{let t=new Y("#interrupt-cells",V("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 AN=()=>{let t=new Y("interrupt-controller",V("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var ON=()=>{let t=new Y("interrupt-parent",V("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 qi=K(J()),IN=()=>{let t=new Y("interrupts",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=we(e.ast.values);if(!i)return r;let s=e.parent,o=s.getProperty("interrupt-parent"),a=s.root,c=o?$n(o?.ast.values?.values.at(0),a):s.parent;if(!c)return o?(r.push($(17,o.ast.values?.values.at(0)?.value??o.ast)),r):(r.push($(16,e.ast,qi.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",e.parent.pathString])),r);let l=c.getProperty("#interrupt-cells");if(!l)return r;let u=Re(l,0,0,n);if(!u)return r;let d=[...Array.from({length:u},(p,T)=>`Interrupt${u>1?T:""}`)];t.signatureArgs=d.map(p=>qi.ParameterInformation.create(p));let f=c.getProperty("interrupt-map"),h=s.parent?.getProperty("#address-cells");f&&!h&&r.push($(16,e.ast.propertyName??e.ast,qi.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",s.parent.pathString]));let y=0;for(;y<i.length;){if(!l){r.push($(16,e.ast,qi.DiagnosticSeverity.Error,[...c.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",c.pathString]));break}let p=i.length-y;if(u>p)return r.push($(19,i.at(-1),qi.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:u},()=>"Interrupt")].join(" ")}> `])),r;let T=i.slice(y,y+u),_=s.mappedReg(n)?.at(0)?.startAddress;if(f&&_){let v=c.getNexusMapEntyMatch("interrupt",n,T,_);v?.match?e.nexusMapsTo.push({mappingValuesAst:T,mapItem:v.match}):r.push($(31,v.entry,qi.DiagnosticSeverity.Error,[f.ast]))}y+=u}return r});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 Fr=K(J()),xN=()=>{let t=new Y("interrupts-extended",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=i.getProperty("interrupts");s&&r.push($(15,s.ast,Fr.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.getProperty("interrupt-parent");o&&r.push($(15,o.ast,Fr.DiagnosticSeverity.Warning,[e.ast],[],[o.name,"is ignored when 'interrupts-extended' is used"]));let a=i.root,c=we(e.ast.values);if(!c?.length)return[];let l=0,u=0,d=[];for(;l<c.length;){let f=$n(c[l],a);if(!f)return r.push($(17,c[l],Fr.DiagnosticSeverity.Error)),r;let h=f.getProperty("#interrupt-cells");if(!h){r.push($(16,e.ast,Fr.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",f.pathString]));break}f?.getProperty("#address-cells")||r.push($(16,e.ast,Fr.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",f.pathString]));let p=Re(h,0,0,n);if(p==null)return r;let T=c.length-l-1;if(d.push([`${u}_phandel`,...Array.from({length:p},(w,C)=>`${u}_interrupt${p>1?C:""}`)]),p>T)return r.push($(19,c.at(-1),Fr.DiagnosticSeverity.Error,[],[],[e.name,`<${d.at(-1).join(" ")}>`])),r;let _=c.slice(l+1,l+1+p),v=f.getProperty("interrupt-map"),b=i.mappedReg(n)?.at(0)?.startAddress;if(v&&b){let w=f.getNexusMapEntyMatch("interrupt",n,_,b);w?.match?e.nexusMapsTo.push({mappingValuesAst:_,mapItem:w.match}):r.push($(31,w.entry,Fr.DiagnosticSeverity.Error,[v.ast]))}l+=p+1,u++}return d.push([`${u}_phandel`,`${u}_interrupt...`]),t.signatureArgs=d.map(f=>f.map(h=>Fr.ParameterInformation.create(h))),r});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 MN=()=>{let t=new Y("dma-noncoherent",V("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 LN=()=>{let t=new Y("dma-coherent",V("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 Hd=K(J()),$N=()=>{let t=new Y("dma-ranges",V(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],i=we(e.ast.values);if(!i?.length)return[];let s=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n),c=[...Array.from({length:o},(l,u)=>`child-bus-address${o>1?u:""}`),...Array.from({length:a},(l,u)=>`parent-bus-address${a>1?u:""}`),...Array.from({length:s},(l,u)=>`length${s>1?u:""}`)];return t.signatureArgs=c.map(l=>Hd.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,(i.length===0||i.length%(o+a+s)!==0)&&r.push($(19,i.at(i.length-i.length%(o+a+s))??e.ast,Hd.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:s},()=>"length")].join(" ")}>`])),r});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 tc=K(J()),Gd=()=>{let t=new Y("ranges",V(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],i=we(e.ast.values);if(!i?.length)return[];let s=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n),c=[...Array.from({length:o},(l,u)=>`child-bus-address${o>1?u:""}`),...Array.from({length:a},(l,u)=>`parent-bus-address${a>1?u:""}`),...Array.from({length:s},(l,u)=>`length${s>1?u:""}`)];return t.signatureArgs=c.map(l=>tc.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,(i.length===0||i.length%(o+a+s)!==0)&&r.push($(19,i.at(i.length-i.length%(o+a+s))??e.ast,tc.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:a},()=>"length")].join(" ")}>`])),r.length===0&&e.parent.nodes.forEach(l=>{let u=l.getProperty("reg");u&&l.mappedReg(n)?.forEach(d=>{!d?.mappingEnd||!d.mappedAst||d.inMappingRange||(d.regAst,r.push($(29,d.regAst,tc.DiagnosticSeverity.Warning,[d.mappedAst],[],[u.name,`0x${d.endAddress.map((f,h)=>f.toString(16).padStart(h?8:0,"0")).join("")}`,`0x${d.mappingEnd.map((f,h)=>f.toString(16).padStart(h?8:0,"0")).join("")}`])))})}),r});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 {
|
|
196
|
+
`)});this.signatureArgsCyclic=!1;typeof r!="function"?this.required=()=>r:this.required=r,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,n,r,i){let s=this.required(n);if(i){if(s==="omitted")return[$(11,i.ast,at.DiagnosticSeverity.Error,void 0,[],[r])]}else{if(s==="required"){let l=e.getOrderedNodeAst(n),u=Co(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=" = <>";break;case"STRING":case"STRINGLIST":d=' = ""';break;case"BYTESTRING":d=" = []";break}return[...l.map((f,h)=>{let y=f.openScope??u[h].lastToken;return $(0,u[h],at.DiagnosticSeverity.Error,[],[],[r],at.TextEdit.insert(at.Position.create(y.pos.line,y.pos.col+1),`
|
|
197
|
+
${"".padEnd(Ao(u[h].uri,f)*Ro().length,Ro())}${r}${d};`))})]}return[]}let o=S$(i),a=[],c=(l,u,d)=>{if(d??=i.ast,!(l.some(h=>h==u)||l.some(h=>h=="STRINGLIST")&&(u==="STRING"||u==="STRINGLIST")||l.some(h=>h=="PROP_ENCODED_ARRAY")&&(u==="U32"||u==="U64"))){let h=[];l.forEach(y=>{switch(y){case"EMPTY":h.push(1);break;case"STRING":h.push(2);break;case"STRINGLIST":h.push(3);break;case"U32":h.push(5);break;case"U64":h.push(6);break;case"PROP_ENCODED_ARRAY":h.push(7);break}}),h.length&&a.push($(h,d,at.DiagnosticSeverity.Error,[],[],[i.name]))}};if(this.type[0].types.some(l=>l==="ANY"))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push($(4,i.ast.values??i.ast,at.DiagnosticSeverity.Error,[],[],[r,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push($(3,i.ast.values?.values[d]??i.ast))})}else{this.type[0].types.some(u=>u==="STRINGLIST")?o.some(u=>c(["STRINGLIST"],u,i.ast.values?.values[0]?.value)):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)):o.length>1&&this.type[0].types.some(u=>u!=="EMPTY")?a.push($(8,i.ast.propertyName??i.ast,at.DiagnosticSeverity.Error,(i.ast.values?.values.slice(1)??[]).filter(u=>!!u),[],[i.name])):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;l.some(d=>u.value===d)||a.push($(9,i.ast.values?.values[0]?.value??i.ast,at.DiagnosticSeverity.Error,[],[],[this.values(i).map(d=>`'${d}'`).join(" or ")]))}}return a}getPropertyCompletionItems(e,n,r){let i=this.type.at(n);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:at.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`,insertText:r?`${s}`:`"${s}"`})):i?.types.some(s=>s==="U32"||s==="U64")?this.values(e).map(s=>({label:`<${s}>`,kind:at.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`,insertText:r?`${s}`:`<${s}>`})):[]}},S$=t=>t.ast.values?t.ast.values.values.map(e=>_$(e)):["EMPTY"],_$=t=>t?t.value instanceof Re?"STRING":t.value instanceof Rt?t.value.values.length===1?"U32":t.value.values.length===2?"U64":"PROP_ENCODED_ARRAY":t.value instanceof de||t.value instanceof Ln?"U32":"BYTESTRING":"UNKNOWN",ic=class{constructor(){this.extends=new Set}},fn=class extends ic{constructor(n=()=>[]){super();this.additionalValidations=n;this.#e=[];this.noMismatchPropertiesAllowed=!1}#e;#t;getIssue(n,r){let i=[],s=r.getProperty("status"),o=s?.ast.values?.values.at(0)?.value;if(o instanceof Re&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(l=>i.push($(21,l,at.DiagnosticSeverity.Hint,[...s?.ast?[s?.ast]:[]],[at.DiagnosticTag.Unnecessary]))),i;let a=new Set,c=this.properties.flatMap(l=>{if(typeof l.name=="string"){let f=r.getProperty(l.name);return f&&a.add(f),l.validateProperty(n,r,l.name,f)}let u=r.property.filter(f=>l.getNameMatch(f.name));u.forEach(f=>a.add(f));let d=this.properties.filter(f=>f!==l)??[];return d.length&&u.some(f=>d.some(h=>h.getNameMatch(f.name)))?[]:u.flatMap(f=>l.validateProperty(n,r,f.name,f))});return a.size!==r.property.length&&this.noMismatchPropertiesAllowed&&r.property.filter(u=>!a.has(u)).forEach(u=>{i.push($(27,u.ast,at.DiagnosticSeverity.Error,[],[],[u.name],at.TextEdit.del(Es(u.ast.firstToken.prevToken,u.ast.lastToken,!1))))}),[...i,...c,...this.additionalValidations(n,r)]}get properties(){return this.#e}addProperty(n){Array.isArray(n)?n.forEach(r=>this.#e.push(r)):this.#e.push(n),this.#e.sort((r,i)=>typeof r.name=="string"&&typeof i.name=="string"||typeof r.name!="string"&&typeof i.name!="string"?0:typeof r.name=="string"?-1:1)}get childNodeType(){return this.#t}set childNodeType(n){n&&(this.#t=r=>{let i=n(r);return i.bindingsPath=this.bindingsPath,i})}getOnPropertyHover(n){let r=this.properties.find(i=>i.getNameMatch(n));return r?.onHover.bind(r)()}getSignatureHelp(n,r,i,s){let o=this.properties.find(f=>f.getNameMatch(n.name)),a=o?.signatureArgs;if(!o||!a)return;let c=n.getArgumentIndex(i),l=n.getArgumentIndex(s),d=n.getArgumentIndex(r)??l??(c!==void 0?c+1:void 0);if(vN(a)){let f=0;if(d!==void 0){let h=d,y=d?a.findIndex(p=>f<=h&&p.length+f>h?!0:(f+=p.length,!1)):void 0;y!==void 0&&(y>1&&(d=d-a.slice(0,y-1).reduce((p,T)=>p+T.length,0)),a=a.slice(y?y-1:0,y+2))}return{signatures:[at.SignatureInformation.create(`${n.name} = ${a.map(h=>`<${h.map(y=>y.label).join(" ")}>`).join(`,
|
|
198
|
+
`)};`,this.description,...a.flat())],activeSignature:0,activeParameter:d}}return o.signatureArgsCyclic&&d&&(d=d%a.length),{signatures:[at.SignatureInformation.create(`${n.name} = <${a.map(f=>f.label).join(" ")}>;`,this.description,...a)],activeSignature:0,activeParameter:d}}getPropertyListCompletionItems(n){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(n)!=="omitted"&&typeof r.name=="string").map(r=>{let i=n&&r.required(n),s=!!n.property.some(a=>r.getNameMatch(a.name)),o="a";return i==="required"?o=s?"Y":"!":o=s?"Z":"B",{label:`${r.name}`,kind:at.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var ke=t=>{if(!t?.values.some(e=>!(e?.value instanceof Rt)))return t?.values.flatMap(e=>e.value.values.map(n=>n.value))??[]};var Ce=(t,e,n,r)=>{let i=t.ast.values?.values.at(e)?.value;if(i instanceof Rt){let s=i.values.at(n);if(s?.value instanceof tt){let o=s.value.evaluate(r);if(typeof o=="number")return o}}},$n=(t,e,n=0)=>{if(t instanceof dn){if(t?.value instanceof Rt){let r=t.value.values.at(n);if(r?.value instanceof Wt)return e.getPhandle(r.value.value);if(r?.value instanceof de)return r.value.linksTo;if(r?.value instanceof Ln)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof Wt)return e.getPhandle(t.value);if(t instanceof de)return t.linksTo;if(t instanceof Ln)return t.path?.pathParts.at(-1)?.linksTo}},V=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var xN=()=>{let t=new Y("compatible",V("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 Oo=K(J()),MN=()=>{let t=new Y("device_type",V("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 n=e.ast.values?.values.at(0)?.value;if(n instanceof Re&&n.value!==e.parent.name)return e.parent.name==="cpu"?[$(12,e.ast,Oo.DiagnosticSeverity.Error,[],[],[e.name])]:[$(13,e.ast,Oo.DiagnosticSeverity.Error,[],[],[e.name])]}return t.required(e.parent)!=="required"?[$(14,e.ast,Oo.DiagnosticSeverity.Hint,[],[Oo.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 LN=()=>{let t=new Y("#interrupt-cells",V("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 $N=()=>{let t=new Y("interrupt-controller",V("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var qN=()=>{let t=new Y("interrupt-parent",V("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 ji=K(J()),jN=()=>{let t=new Y("interrupts",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=ke(e.ast.values);if(!i)return r;let s=e.parent,o=s.getProperty("interrupt-parent"),a=s.root,c=o?$n(o?.ast.values?.values.at(0),a):s.parent;if(!c)return o?(r.push($(17,o.ast.values?.values.at(0)?.value??o.ast)),r):(r.push($(16,e.ast,ji.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",e.parent.pathString])),r);let l=c.getProperty("#interrupt-cells");if(!l)return r;let u=Ce(l,0,0,n);if(!u)return r;let d=[...Array.from({length:u},(p,T)=>`Interrupt${u>1?T:""}`)];t.signatureArgs=d.map(p=>ji.ParameterInformation.create(p));let f=c.getProperty("interrupt-map"),h=s.parent?.getProperty("#address-cells");f&&!h&&r.push($(16,e.ast.propertyName??e.ast,ji.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",s.parent.pathString]));let y=0;for(;y<i.length;){if(!l){r.push($(16,e.ast,ji.DiagnosticSeverity.Error,[...c.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",c.pathString]));break}let p=i.length-y;if(u>p)return r.push($(19,i.at(-1),ji.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:u},()=>"Interrupt")].join(" ")}> `])),r;let T=i.slice(y,y+u),_=s.mappedReg(n)?.at(0)?.startAddress;if(f&&_){let v=c.getNexusMapEntyMatch("interrupt",n,T,_);v?.match?e.nexusMapsTo.push({mappingValuesAst:T,mapItem:v.match}):r.push($(31,v.entry,ji.DiagnosticSeverity.Error,[f.ast]))}y+=u}return r});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 Ur=K(J()),FN=()=>{let t=new Y("interrupts-extended",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=i.getProperty("interrupts");s&&r.push($(15,s.ast,Ur.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.getProperty("interrupt-parent");o&&r.push($(15,o.ast,Ur.DiagnosticSeverity.Warning,[e.ast],[],[o.name,"is ignored when 'interrupts-extended' is used"]));let a=i.root,c=ke(e.ast.values);if(!c?.length)return[];let l=0,u=0,d=[];for(;l<c.length;){let f=$n(c[l],a);if(!f)return r.push($(17,c[l],Ur.DiagnosticSeverity.Error)),r;let h=f.getProperty("#interrupt-cells");if(!h){r.push($(16,e.ast,Ur.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",f.pathString]));break}f?.getProperty("#address-cells")||r.push($(16,e.ast,Ur.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",f.pathString]));let p=Ce(h,0,0,n);if(p==null)return r;let T=c.length-l-1;if(d.push([`${u}_phandel`,...Array.from({length:p},(k,C)=>`${u}_interrupt${p>1?C:""}`)]),p>T)return r.push($(19,c.at(-1),Ur.DiagnosticSeverity.Error,[],[],[e.name,`<${d.at(-1).join(" ")}>`])),r;let _=c.slice(l+1,l+1+p),v=f.getProperty("interrupt-map"),b=i.mappedReg(n)?.at(0)?.startAddress;if(v&&b){let k=f.getNexusMapEntyMatch("interrupt",n,_,b);k?.match?e.nexusMapsTo.push({mappingValuesAst:_,mapItem:k.match}):r.push($(31,k.entry,Ur.DiagnosticSeverity.Error,[v.ast]))}l+=p+1,u++}return d.push([`${u}_phandel`,`${u}_interrupt...`]),t.signatureArgs=d.map(f=>f.map(h=>Ur.ParameterInformation.create(h))),r});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 BN=()=>{let t=new Y("dma-noncoherent",V("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 UN=()=>{let t=new Y("dma-coherent",V("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 Kd=K(J()),VN=()=>{let t=new Y("dma-ranges",V(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],i=ke(e.ast.values);if(!i?.length)return[];let s=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n),c=[...Array.from({length:o},(l,u)=>`child-bus-address${o>1?u:""}`),...Array.from({length:a},(l,u)=>`parent-bus-address${a>1?u:""}`),...Array.from({length:s},(l,u)=>`length${s>1?u:""}`)];return t.signatureArgs=c.map(l=>Kd.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,(i.length===0||i.length%(o+a+s)!==0)&&r.push($(19,i.at(i.length-i.length%(o+a+s))??e.ast,Kd.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:s},()=>"length")].join(" ")}>`])),r});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 sc=K(J()),Xd=()=>{let t=new Y("ranges",V(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],i=ke(e.ast.values);if(!i?.length)return[];let s=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n),c=[...Array.from({length:o},(l,u)=>`child-bus-address${o>1?u:""}`),...Array.from({length:a},(l,u)=>`parent-bus-address${a>1?u:""}`),...Array.from({length:s},(l,u)=>`length${s>1?u:""}`)];return t.signatureArgs=c.map(l=>sc.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,(i.length===0||i.length%(o+a+s)!==0)&&r.push($(19,i.at(i.length-i.length%(o+a+s))??e.ast,sc.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:a},()=>"length")].join(" ")}>`])),r.length===0&&e.parent.nodes.forEach(l=>{let u=l.getProperty("reg");u&&l.mappedReg(n)?.forEach(d=>{!d?.mappingEnd||!d.mappedAst||d.inMappingRange||(d.regAst,r.push($(29,d.regAst,sc.DiagnosticSeverity.Warning,[d.mappedAst],[],[u.name,`0x${d.endAddress.map((f,h)=>f.toString(16).padStart(h?8:0,"0")).join("")}`,`0x${d.mappingEnd.map((f,h)=>f.toString(16).padStart(h?8:0,"0")).join("")}`])))})}),r});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 {
|
|
198
199
|
compatible = "simple-bus";
|
|
199
200
|
#address-cells = <1>;
|
|
200
201
|
#size-cells = <1>;
|
|
@@ -209,7 +210,7 @@ ${"".padEnd(Co(u[h].uri,f)*No().length,No())}${r}${d};`))})]}return[]}let o=p$(i
|
|
|
209
210
|
};
|
|
210
211
|
};`,"```"].join(`
|
|
211
212
|
`),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
|
|
212
|
-
`),"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
|
|
213
|
+
`),"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 zN=()=>{let t=new Y("virtual-reg",V("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 oc=K(J());var WN=()=>{let t=new Y("reg",V("PROP_ENCODED_ARRAY"),e=>e.address!==void 0?"required":"omitted",void 0,void 0,(e,n)=>{let r=[],i=ke(e.ast.values);if(!i)return[];let s=e.parent.parentSizeCells(n),o=e.parent.parentAddressCells(n),a=[...Array.from({length:o},(l,u)=>`address${o>1?u:""}`),...Array.from({length:s},(l,u)=>`size${s>1?u:""}`)];if(t.signatureArgs=a.map(l=>oc.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,i.length===0||i.length%(s+o)!==0)return r.push($(19,i.at(i.length-i.length%(s+o))??e.ast,oc.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"address"),...Array.from({length:s},()=>"size")].join(" ")}>`])),r;let c=i.slice(0,o).map((l,u)=>Ce(e,0,u,n)??0);if(e.parent.address&&Fr(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(o-1),d=l&&u?new j(H(l.firstToken,u.lastToken)):void 0;r.push($(10,d??e.ast.values??e.ast,oc.DiagnosticSeverity.Error,[],[],[e.name]))}return r});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 Jd=()=>new Y("#size-cells",V("U32"),"optional",1);var Qd=()=>{let t=new Y("#address-cells",V("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 {
|
|
213
214
|
#address-cells = <1>;
|
|
214
215
|
#size-cells = <1>;
|
|
215
216
|
serial@4600 {
|
|
@@ -220,8 +221,8 @@ ${"".padEnd(Co(u[h].uri,f)*No().length,No())}${r}${d};`))})]}return[]}let o=p$(i
|
|
|
220
221
|
interrupt-parent = <&ipic>;
|
|
221
222
|
};
|
|
222
223
|
};`,"```"].join(`
|
|
223
|
-
`),"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
|
|
224
|
-
The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var
|
|
224
|
+
`),"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 HN=()=>{let t=new Y("status",V("STRING"),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return t.description=[`The status property indicates the operational status of a device.
|
|
225
|
+
The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var GN=K(J()),YN=()=>{let t=new Y("phandle",V("U32"),"optional",void 0,void 0,(e,n)=>{let r=Ce(e,0,0,n);if(r){let i=e.parent.root.getAllPhandle(r);if(i.length>1&&i.at(-1)===e.parent)return[$(18,e.ast.values?.values.at(0)??e.ast,GN.DiagnosticSeverity.Error,i.slice(0,-1).flatMap(s=>s.getProperty("phandle")?.ast).filter(s=>!!s),[],[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 {
|
|
225
226
|
phandle = <1>;
|
|
226
227
|
interrupt-controller;
|
|
227
228
|
reg = <0x10000000 0x100>;
|
|
@@ -229,10 +230,10 @@ ${"".padEnd(Co(u[h].uri,f)*No().length,No())}${r}${d};`))})]}return[]}let o=p$(i
|
|
|
229
230
|
`),"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 {
|
|
230
231
|
interrupt-parent = <1>;
|
|
231
232
|
};`,"```"].join(`
|
|
232
|
-
`)],t};var VN=()=>{let t=new Y("model",V("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 Xd=K(J()),zN=()=>{let t=new Y("name",V("STRING"),"optional",void 0,void 0,e=>[$(14,e.ast,Xd.DiagnosticSeverity.Warning,[],[Xd.DiagnosticTag.Deprecated],[e.name])]);return t.hideAutoComplete=!0,t};var yr=K(J());var WN=()=>{let t=new Y("interrupt-map",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=e.parent.root,o=we(e.ast.values);if(!o?.length)return[];i.getProperty("#address-cells")||r.push($(16,e.ast,yr.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",i.pathString]));let c=i.getProperty("#interrupt-cells");if(!c)return r.push($(16,e.ast,yr.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),r;let l=i.addressCells(n),u=Re(c,0,0,n),d={};if(u==null)return r;let f=0,h=[],y=0,p=0;for(;f<o.length;){if(h.push([...Array.from({length:l},(B,q)=>`${y}_ChildAddr${l>1?q:""}`),...Array.from({length:u},(B,q)=>`${y}_ChildIntrpt${u>1?q:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),f+l+u>=o.length){let B=f+l+u;r.push($(20,o[o.length-1],yr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%B===0?B:(o.length-p)%B).join(" ")}`]));break}let T=new j(H(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),_="";for(let B=f;B<l+u+f;B++){let q=o[B];_+=`${q instanceof et?q.evaluate(n).toString():q.toString()}:`}d[_]??=[],d[_].push(T),f+=l+u;let v=l+u+1;if(o.length<f+1){r.push($(20,o[o.length-1],yr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%v===0?v:(o.length-p)%v).join(" ")}`]));break}let b=$n(o[f],s);if(!b){r.push($(17,o[f],yr.DiagnosticSeverity.Error));break}let w=b.addressCells(n),C=b.getProperty("#interrupt-cells");if(!C){r.push($(16,o[f],yr.DiagnosticSeverity.Error,[...b.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]));break}f++;let L=Re(C,0,0,n);if(L==null)break;if(h.splice(-1,1,[...Array.from({length:l},(B,q)=>`${y}_ChildAddr${l>1?q:""}`),...Array.from({length:u},(B,q)=>`${y}_ChildIntrpt${u>1?q:""}`),`${y}_IntrptParent`,...Array.from({length:w},(B,q)=>`${y}_ParentAddr${w>1?q:""}`),...Array.from({length:L},(B,q)=>`${y}_ParentIntrpt${L>1?q:""}`)]),f+=w+L,o.length<f){let B=l+u+1+w+L;r.push($(20,o[o.length-1],yr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%B===0?B:(o.length-p)%B).join(" ")}`]));break}p=f,y++}if(h.push([...Array.from({length:l},(T,_)=>`${y}_ChildAddr${l>1?_:""}`),...Array.from({length:u},(T,_)=>`${y}_ChildIntrpt${u>1?_:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),t.signatureArgs=h.map(T=>T.map(_=>yr.ParameterInformation.create(_))),!e.ast.values)return[];for(let T=0;T<e.ast.values.values.length;T++){let _=e.ast.values.values.at(T);if(_&&(r.length||u==null||!(_.value instanceof Rt)))return r}return Object.values(d).forEach(T=>{T.length>1&&r.push($(30,T[T.length-1],yr.DiagnosticSeverity.Error,T.slice(0,-1)))}),r});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 HN;(function(t){function e(n){return typeof n=="string"}t.is=e})(HN||(HN={}));var Fg;(function(t){function e(n){return typeof n=="string"}t.is=e})(Fg||(Fg={}));var GN;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(GN||(GN={}));var Jd;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Jd||(Jd={}));var vr;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Jd.MAX_VALUE),i===Number.MAX_VALUE&&(i=Jd.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.uinteger(i.line)&&O.uinteger(i.character)}t.is=n})(vr||(vr={}));var _t;(function(t){function e(r,i,s,o){if(O.uinteger(r)&&O.uinteger(i)&&O.uinteger(s)&&O.uinteger(o))return{start:vr.create(r,i),end:vr.create(s,o)};if(vr.is(r)&&vr.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&vr.is(i.start)&&vr.is(i.end)}t.is=n})(_t||(_t={}));var Qd;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&_t.is(i.range)&&(O.string(i.uri)||O.undefined(i.uri))}t.is=n})(Qd||(Qd={}));var YN;(function(t){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&_t.is(i.targetRange)&&O.string(i.targetUri)&&_t.is(i.targetSelectionRange)&&(_t.is(i.originSelectionRange)||O.undefined(i.originSelectionRange))}t.is=n})(YN||(YN={}));var Bg;(function(t){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.numberRange(i.red,0,1)&&O.numberRange(i.green,0,1)&&O.numberRange(i.blue,0,1)&&O.numberRange(i.alpha,0,1)}t.is=n})(Bg||(Bg={}));var KN;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&_t.is(i.range)&&Bg.is(i.color)}t.is=n})(KN||(KN={}));var XN;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.string(i.label)&&(O.undefined(i.textEdit)||Oo.is(i))&&(O.undefined(i.additionalTextEdits)||O.typedArray(i.additionalTextEdits,Oo.is))}t.is=n})(XN||(XN={}));var JN;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(JN||(JN={}));var QN;(function(t){function e(r,i,s,o,a,c){let l={startLine:r,endLine:i};return O.defined(s)&&(l.startCharacter=s),O.defined(o)&&(l.endCharacter=o),O.defined(a)&&(l.kind=a),O.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.uinteger(i.startLine)&&O.uinteger(i.startLine)&&(O.undefined(i.startCharacter)||O.uinteger(i.startCharacter))&&(O.undefined(i.endCharacter)||O.uinteger(i.endCharacter))&&(O.undefined(i.kind)||O.string(i.kind))}t.is=n})(QN||(QN={}));var Ug;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&Qd.is(i.location)&&O.string(i.message)}t.is=n})(Ug||(Ug={}));var wn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(wn||(wn={}));var ZN;(function(t){t.Unnecessary=1,t.Deprecated=2})(ZN||(ZN={}));var eP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&O.string(r.href)}t.is=e})(eP||(eP={}));var Zd;(function(t){function e(r,i,s,o,a,c){let l={range:r,message:i};return O.defined(s)&&(l.severity=s),O.defined(o)&&(l.code=o),O.defined(a)&&(l.source=a),O.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var i;let s=r;return O.defined(s)&&_t.is(s.range)&&O.string(s.message)&&(O.number(s.severity)||O.undefined(s.severity))&&(O.integer(s.code)||O.string(s.code)||O.undefined(s.code))&&(O.undefined(s.codeDescription)||O.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(O.string(s.source)||O.undefined(s.source))&&(O.undefined(s.relatedInformation)||O.typedArray(s.relatedInformation,Ug.is))}t.is=n})(Zd||(Zd={}));var Ao;(function(t){function e(r,i,...s){let o={title:r,command:i};return O.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.title)&&O.string(i.command)}t.is=n})(Ao||(Ao={}));var Oo;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function n(s,o){return{range:{start:s,end:s},newText:o}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){let o=s;return O.objectLiteral(o)&&O.string(o.newText)&&_t.is(o.range)}t.is=i})(Oo||(Oo={}));var Vg;(function(t){function e(r,i,s){let o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.string(i.label)&&(O.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(O.string(i.description)||i.description===void 0)}t.is=n})(Vg||(Vg={}));var Io;(function(t){function e(n){let r=n;return O.string(r)}t.is=e})(Io||(Io={}));var tP;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}t.del=r;function i(s){let o=s;return Oo.is(o)&&(Vg.is(o.annotationId)||Io.is(o.annotationId))}t.is=i})(tP||(tP={}));var zg;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&Kg.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(zg||(zg={}));var Wg;(function(t){function e(r,i,s){let o={kind:"create",uri:r};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 n(r){let i=r;return i&&i.kind==="create"&&O.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||O.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||O.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Io.is(i.annotationId))}t.is=n})(Wg||(Wg={}));var Hg;(function(t){function e(r,i,s,o){let a={kind:"rename",oldUri:r,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 n(r){let i=r;return i&&i.kind==="rename"&&O.string(i.oldUri)&&O.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||O.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||O.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Io.is(i.annotationId))}t.is=n})(Hg||(Hg={}));var Gg;(function(t){function e(r,i,s){let o={kind:"delete",uri:r};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 n(r){let i=r;return i&&i.kind==="delete"&&O.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||O.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||O.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Io.is(i.annotationId))}t.is=n})(Gg||(Gg={}));var Yg;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>O.string(i.kind)?Wg.is(i)||Hg.is(i)||Gg.is(i):zg.is(i)))}t.is=e})(Yg||(Yg={}));var nP;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)}t.is=n})(nP||(nP={}));var rP;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&O.integer(i.version)}t.is=n})(rP||(rP={}));var Kg;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&(i.version===null||O.integer(i.version))}t.is=n})(Kg||(Kg={}));var iP;(function(t){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&O.string(i.languageId)&&O.integer(i.version)&&O.string(i.text)}t.is=n})(iP||(iP={}));var Xg;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){let r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Xg||(Xg={}));var rc;(function(t){function e(n){let r=n;return O.objectLiteral(n)&&Xg.is(r.kind)&&O.string(r.value)}t.is=e})(rc||(rc={}));var sP;(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})(sP||(sP={}));var oP;(function(t){t.PlainText=1,t.Snippet=2})(oP||(oP={}));var aP;(function(t){t.Deprecated=1})(aP||(aP={}));var cP;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){let i=r;return i&&O.string(i.newText)&&_t.is(i.insert)&&_t.is(i.replace)}t.is=n})(cP||(cP={}));var lP;(function(t){t.asIs=1,t.adjustIndentation=2})(lP||(lP={}));var uP;(function(t){function e(n){let r=n;return r&&(O.string(r.detail)||r.detail===void 0)&&(O.string(r.description)||r.description===void 0)}t.is=e})(uP||(uP={}));var dP;(function(t){function e(n){return{label:n}}t.create=e})(dP||(dP={}));var fP;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(fP||(fP={}));var ef;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){let i=r;return O.string(i)||O.objectLiteral(i)&&O.string(i.language)&&O.string(i.value)}t.is=n})(ef||(ef={}));var hP;(function(t){function e(n){let r=n;return!!r&&O.objectLiteral(r)&&(rc.is(r.contents)||ef.is(r.contents)||O.typedArray(r.contents,ef.is))&&(n.range===void 0||_t.is(n.range))}t.is=e})(hP||(hP={}));var kn;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(kn||(kn={}));var pP;(function(t){function e(n,r,...i){let s={label:n};return O.defined(r)&&(s.documentation=r),O.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(pP||(pP={}));var mP;(function(t){t.Text=1,t.Read=2,t.Write=3})(mP||(mP={}));var gP;(function(t){function e(n,r){let i={range:n};return O.number(r)&&(i.kind=r),i}t.create=e})(gP||(gP={}));var yP;(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})(yP||(yP={}));var vP;(function(t){t.Deprecated=1})(vP||(vP={}));var bP;(function(t){function e(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(bP||(bP={}));var TP;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(TP||(TP={}));var SP;(function(t){function e(r,i,s,o,a,c){let l={name:r,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let i=r;return i&&O.string(i.name)&&O.number(i.kind)&&_t.is(i.range)&&_t.is(i.selectionRange)&&(i.detail===void 0||O.string(i.detail))&&(i.deprecated===void 0||O.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(SP||(SP={}));var _P;(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"})(_P||(_P={}));var tf;(function(t){t.Invoked=1,t.Automatic=2})(tf||(tf={}));var EP;(function(t){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function n(r){let i=r;return O.defined(i)&&O.typedArray(i.diagnostics,Zd.is)&&(i.only===void 0||O.typedArray(i.only,O.string))&&(i.triggerKind===void 0||i.triggerKind===tf.Invoked||i.triggerKind===tf.Automatic)}t.is=n})(EP||(EP={}));var wP;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Ao.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return i&&O.string(i.title)&&(i.diagnostics===void 0||O.typedArray(i.diagnostics,Zd.is))&&(i.kind===void 0||O.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Ao.is(i.command))&&(i.isPreferred===void 0||O.boolean(i.isPreferred))&&(i.edit===void 0||Yg.is(i.edit))}t.is=n})(wP||(wP={}));var kP;(function(t){function e(r,i){let s={range:r};return O.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return O.defined(i)&&_t.is(i.range)&&(O.undefined(i.command)||Ao.is(i.command))}t.is=n})(kP||(kP={}));var NP;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.uinteger(i.tabSize)&&O.boolean(i.insertSpaces)}t.is=n})(NP||(NP={}));var PP;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return O.defined(i)&&_t.is(i.range)&&(O.undefined(i.target)||O.string(i.target))}t.is=n})(PP||(PP={}));var RP;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&_t.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(RP||(RP={}));var CP;(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"})(CP||(CP={}));var DP;(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"})(DP||(DP={}));var AP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(AP||(AP={}));var OP;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){let i=r;return i!=null&&_t.is(i.range)&&O.string(i.text)}t.is=n})(OP||(OP={}));var IP;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){let i=r;return i!=null&&_t.is(i.range)&&O.boolean(i.caseSensitiveLookup)&&(O.string(i.variableName)||i.variableName===void 0)}t.is=n})(IP||(IP={}));var xP;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){let i=r;return i!=null&&_t.is(i.range)&&(O.string(i.expression)||i.expression===void 0)}t.is=n})(xP||(xP={}));var MP;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&_t.is(r.stoppedLocation)}t.is=n})(MP||(MP={}));var Jg;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(Jg||(Jg={}));var Qg;(function(t){function e(r){return{value:r}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&(i.tooltip===void 0||O.string(i.tooltip)||rc.is(i.tooltip))&&(i.location===void 0||Qd.is(i.location))&&(i.command===void 0||Ao.is(i.command))}t.is=n})(Qg||(Qg={}));var LP;(function(t){function e(r,i,s){let o={position:r,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&vr.is(i.position)&&(O.string(i.label)||O.typedArray(i.label,Qg.is))&&(i.kind===void 0||Jg.is(i.kind))&&i.textEdits===void 0||O.typedArray(i.textEdits,Oo.is)&&(i.tooltip===void 0||O.string(i.tooltip)||rc.is(i.tooltip))&&(i.paddingLeft===void 0||O.boolean(i.paddingLeft))&&(i.paddingRight===void 0||O.boolean(i.paddingRight))}t.is=n})(LP||(LP={}));var $P;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})($P||($P={}));var qP;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(qP||(qP={}));var jP;(function(t){function e(n){return{items:n}}t.create=e})(jP||(jP={}));var FP;(function(t){t.Invoked=0,t.Automatic=1})(FP||(FP={}));var BP;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(BP||(BP={}));var UP;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(UP||(UP={}));var VP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&Fg.is(r.uri)&&O.string(r.name)}t.is=e})(VP||(VP={}));var zP;(function(t){function e(s,o,a,c){return new Zg(s,o,a,c)}t.create=e;function n(s){let o=s;return!!(O.defined(o)&&O.string(o.uri)&&(O.undefined(o.languageId)||O.string(o.languageId))&&O.uinteger(o.lineCount)&&O.func(o.getText)&&O.func(o.positionAt)&&O.func(o.offsetAt))}t.is=n;function r(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),h=s.offsetAt(d.range.end);if(h<=l)a=a.substring(0,f)+d.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=r;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}})(zP||(zP={}));var Zg=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
|
|
233
|
+
`)],t};var KN=()=>{let t=new Y("model",V("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 Zd=K(J()),XN=()=>{let t=new Y("name",V("STRING"),"optional",void 0,void 0,e=>[$(14,e.ast,Zd.DiagnosticSeverity.Warning,[],[Zd.DiagnosticTag.Deprecated],[e.name])]);return t.hideAutoComplete=!0,t};var br=K(J());var JN=()=>{let t=new Y("interrupt-map",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=e.parent.root,o=ke(e.ast.values);if(!o?.length)return[];i.getProperty("#address-cells")||r.push($(16,e.ast,br.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",i.pathString]));let c=i.getProperty("#interrupt-cells");if(!c)return r.push($(16,e.ast,br.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),r;let l=i.addressCells(n),u=Ce(c,0,0,n),d={};if(u==null)return r;let f=0,h=[],y=0,p=0;for(;f<o.length;){if(h.push([...Array.from({length:l},(B,q)=>`${y}_ChildAddr${l>1?q:""}`),...Array.from({length:u},(B,q)=>`${y}_ChildIntrpt${u>1?q:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),f+l+u>=o.length){let B=f+l+u;r.push($(20,o[o.length-1],br.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%B===0?B:(o.length-p)%B).join(" ")}`]));break}let T=new j(H(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),_="";for(let B=f;B<l+u+f;B++){let q=o[B];_+=`${q instanceof tt?q.evaluate(n).toString():q.toString()}:`}d[_]??=[],d[_].push(T),f+=l+u;let v=l+u+1;if(o.length<f+1){r.push($(20,o[o.length-1],br.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%v===0?v:(o.length-p)%v).join(" ")}`]));break}let b=$n(o[f],s);if(!b){r.push($(17,o[f],br.DiagnosticSeverity.Error));break}let k=b.addressCells(n),C=b.getProperty("#interrupt-cells");if(!C){r.push($(16,o[f],br.DiagnosticSeverity.Error,[...b.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]));break}f++;let L=Ce(C,0,0,n);if(L==null)break;if(h.splice(-1,1,[...Array.from({length:l},(B,q)=>`${y}_ChildAddr${l>1?q:""}`),...Array.from({length:u},(B,q)=>`${y}_ChildIntrpt${u>1?q:""}`),`${y}_IntrptParent`,...Array.from({length:k},(B,q)=>`${y}_ParentAddr${k>1?q:""}`),...Array.from({length:L},(B,q)=>`${y}_ParentIntrpt${L>1?q:""}`)]),f+=k+L,o.length<f){let B=l+u+1+k+L;r.push($(20,o[o.length-1],br.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%B===0?B:(o.length-p)%B).join(" ")}`]));break}p=f,y++}if(h.push([...Array.from({length:l},(T,_)=>`${y}_ChildAddr${l>1?_:""}`),...Array.from({length:u},(T,_)=>`${y}_ChildIntrpt${u>1?_:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),t.signatureArgs=h.map(T=>T.map(_=>br.ParameterInformation.create(_))),!e.ast.values)return[];for(let T=0;T<e.ast.values.values.length;T++){let _=e.ast.values.values.at(T);if(_&&(r.length||u==null||!(_.value instanceof Rt)))return r}return Object.values(d).forEach(T=>{T.length>1&&r.push($(30,T[T.length-1],br.DiagnosticSeverity.Error,T.slice(0,-1)))}),r});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 QN;(function(t){function e(n){return typeof n=="string"}t.is=e})(QN||(QN={}));var Ug;(function(t){function e(n){return typeof n=="string"}t.is=e})(Ug||(Ug={}));var ZN;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(ZN||(ZN={}));var ef;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(ef||(ef={}));var Tr;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=ef.MAX_VALUE),i===Number.MAX_VALUE&&(i=ef.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.uinteger(i.line)&&O.uinteger(i.character)}t.is=n})(Tr||(Tr={}));var _t;(function(t){function e(r,i,s,o){if(O.uinteger(r)&&O.uinteger(i)&&O.uinteger(s)&&O.uinteger(o))return{start:Tr.create(r,i),end:Tr.create(s,o)};if(Tr.is(r)&&Tr.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&Tr.is(i.start)&&Tr.is(i.end)}t.is=n})(_t||(_t={}));var tf;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&_t.is(i.range)&&(O.string(i.uri)||O.undefined(i.uri))}t.is=n})(tf||(tf={}));var eP;(function(t){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&_t.is(i.targetRange)&&O.string(i.targetUri)&&_t.is(i.targetSelectionRange)&&(_t.is(i.originSelectionRange)||O.undefined(i.originSelectionRange))}t.is=n})(eP||(eP={}));var Vg;(function(t){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.numberRange(i.red,0,1)&&O.numberRange(i.green,0,1)&&O.numberRange(i.blue,0,1)&&O.numberRange(i.alpha,0,1)}t.is=n})(Vg||(Vg={}));var tP;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&_t.is(i.range)&&Vg.is(i.color)}t.is=n})(tP||(tP={}));var nP;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.string(i.label)&&(O.undefined(i.textEdit)||xo.is(i))&&(O.undefined(i.additionalTextEdits)||O.typedArray(i.additionalTextEdits,xo.is))}t.is=n})(nP||(nP={}));var rP;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(rP||(rP={}));var iP;(function(t){function e(r,i,s,o,a,c){let l={startLine:r,endLine:i};return O.defined(s)&&(l.startCharacter=s),O.defined(o)&&(l.endCharacter=o),O.defined(a)&&(l.kind=a),O.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.uinteger(i.startLine)&&O.uinteger(i.startLine)&&(O.undefined(i.startCharacter)||O.uinteger(i.startCharacter))&&(O.undefined(i.endCharacter)||O.uinteger(i.endCharacter))&&(O.undefined(i.kind)||O.string(i.kind))}t.is=n})(iP||(iP={}));var zg;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&tf.is(i.location)&&O.string(i.message)}t.is=n})(zg||(zg={}));var kn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(kn||(kn={}));var sP;(function(t){t.Unnecessary=1,t.Deprecated=2})(sP||(sP={}));var oP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&O.string(r.href)}t.is=e})(oP||(oP={}));var nf;(function(t){function e(r,i,s,o,a,c){let l={range:r,message:i};return O.defined(s)&&(l.severity=s),O.defined(o)&&(l.code=o),O.defined(a)&&(l.source=a),O.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var i;let s=r;return O.defined(s)&&_t.is(s.range)&&O.string(s.message)&&(O.number(s.severity)||O.undefined(s.severity))&&(O.integer(s.code)||O.string(s.code)||O.undefined(s.code))&&(O.undefined(s.codeDescription)||O.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(O.string(s.source)||O.undefined(s.source))&&(O.undefined(s.relatedInformation)||O.typedArray(s.relatedInformation,zg.is))}t.is=n})(nf||(nf={}));var Io;(function(t){function e(r,i,...s){let o={title:r,command:i};return O.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.title)&&O.string(i.command)}t.is=n})(Io||(Io={}));var xo;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function n(s,o){return{range:{start:s,end:s},newText:o}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){let o=s;return O.objectLiteral(o)&&O.string(o.newText)&&_t.is(o.range)}t.is=i})(xo||(xo={}));var Wg;(function(t){function e(r,i,s){let o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.string(i.label)&&(O.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(O.string(i.description)||i.description===void 0)}t.is=n})(Wg||(Wg={}));var Mo;(function(t){function e(n){let r=n;return O.string(r)}t.is=e})(Mo||(Mo={}));var aP;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}t.del=r;function i(s){let o=s;return xo.is(o)&&(Wg.is(o.annotationId)||Mo.is(o.annotationId))}t.is=i})(aP||(aP={}));var Hg;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&Jg.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Hg||(Hg={}));var Gg;(function(t){function e(r,i,s){let o={kind:"create",uri:r};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 n(r){let i=r;return i&&i.kind==="create"&&O.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||O.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||O.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Mo.is(i.annotationId))}t.is=n})(Gg||(Gg={}));var Yg;(function(t){function e(r,i,s,o){let a={kind:"rename",oldUri:r,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 n(r){let i=r;return i&&i.kind==="rename"&&O.string(i.oldUri)&&O.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||O.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||O.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Mo.is(i.annotationId))}t.is=n})(Yg||(Yg={}));var Kg;(function(t){function e(r,i,s){let o={kind:"delete",uri:r};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 n(r){let i=r;return i&&i.kind==="delete"&&O.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||O.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||O.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Mo.is(i.annotationId))}t.is=n})(Kg||(Kg={}));var Xg;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>O.string(i.kind)?Gg.is(i)||Yg.is(i)||Kg.is(i):Hg.is(i)))}t.is=e})(Xg||(Xg={}));var cP;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)}t.is=n})(cP||(cP={}));var lP;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&O.integer(i.version)}t.is=n})(lP||(lP={}));var Jg;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&(i.version===null||O.integer(i.version))}t.is=n})(Jg||(Jg={}));var uP;(function(t){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&O.string(i.languageId)&&O.integer(i.version)&&O.string(i.text)}t.is=n})(uP||(uP={}));var Qg;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){let r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Qg||(Qg={}));var ac;(function(t){function e(n){let r=n;return O.objectLiteral(n)&&Qg.is(r.kind)&&O.string(r.value)}t.is=e})(ac||(ac={}));var dP;(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})(dP||(dP={}));var fP;(function(t){t.PlainText=1,t.Snippet=2})(fP||(fP={}));var hP;(function(t){t.Deprecated=1})(hP||(hP={}));var pP;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){let i=r;return i&&O.string(i.newText)&&_t.is(i.insert)&&_t.is(i.replace)}t.is=n})(pP||(pP={}));var mP;(function(t){t.asIs=1,t.adjustIndentation=2})(mP||(mP={}));var gP;(function(t){function e(n){let r=n;return r&&(O.string(r.detail)||r.detail===void 0)&&(O.string(r.description)||r.description===void 0)}t.is=e})(gP||(gP={}));var yP;(function(t){function e(n){return{label:n}}t.create=e})(yP||(yP={}));var vP;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(vP||(vP={}));var rf;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){let i=r;return O.string(i)||O.objectLiteral(i)&&O.string(i.language)&&O.string(i.value)}t.is=n})(rf||(rf={}));var bP;(function(t){function e(n){let r=n;return!!r&&O.objectLiteral(r)&&(ac.is(r.contents)||rf.is(r.contents)||O.typedArray(r.contents,rf.is))&&(n.range===void 0||_t.is(n.range))}t.is=e})(bP||(bP={}));var wn;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(wn||(wn={}));var TP;(function(t){function e(n,r,...i){let s={label:n};return O.defined(r)&&(s.documentation=r),O.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(TP||(TP={}));var SP;(function(t){t.Text=1,t.Read=2,t.Write=3})(SP||(SP={}));var _P;(function(t){function e(n,r){let i={range:n};return O.number(r)&&(i.kind=r),i}t.create=e})(_P||(_P={}));var EP;(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})(EP||(EP={}));var kP;(function(t){t.Deprecated=1})(kP||(kP={}));var wP;(function(t){function e(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(wP||(wP={}));var NP;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(NP||(NP={}));var PP;(function(t){function e(r,i,s,o,a,c){let l={name:r,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let i=r;return i&&O.string(i.name)&&O.number(i.kind)&&_t.is(i.range)&&_t.is(i.selectionRange)&&(i.detail===void 0||O.string(i.detail))&&(i.deprecated===void 0||O.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(PP||(PP={}));var RP;(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"})(RP||(RP={}));var sf;(function(t){t.Invoked=1,t.Automatic=2})(sf||(sf={}));var CP;(function(t){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function n(r){let i=r;return O.defined(i)&&O.typedArray(i.diagnostics,nf.is)&&(i.only===void 0||O.typedArray(i.only,O.string))&&(i.triggerKind===void 0||i.triggerKind===sf.Invoked||i.triggerKind===sf.Automatic)}t.is=n})(CP||(CP={}));var DP;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Io.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return i&&O.string(i.title)&&(i.diagnostics===void 0||O.typedArray(i.diagnostics,nf.is))&&(i.kind===void 0||O.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Io.is(i.command))&&(i.isPreferred===void 0||O.boolean(i.isPreferred))&&(i.edit===void 0||Xg.is(i.edit))}t.is=n})(DP||(DP={}));var AP;(function(t){function e(r,i){let s={range:r};return O.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return O.defined(i)&&_t.is(i.range)&&(O.undefined(i.command)||Io.is(i.command))}t.is=n})(AP||(AP={}));var OP;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.uinteger(i.tabSize)&&O.boolean(i.insertSpaces)}t.is=n})(OP||(OP={}));var IP;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return O.defined(i)&&_t.is(i.range)&&(O.undefined(i.target)||O.string(i.target))}t.is=n})(IP||(IP={}));var xP;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&_t.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(xP||(xP={}));var MP;(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"})(MP||(MP={}));var LP;(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"})(LP||(LP={}));var $P;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})($P||($P={}));var qP;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){let i=r;return i!=null&&_t.is(i.range)&&O.string(i.text)}t.is=n})(qP||(qP={}));var jP;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){let i=r;return i!=null&&_t.is(i.range)&&O.boolean(i.caseSensitiveLookup)&&(O.string(i.variableName)||i.variableName===void 0)}t.is=n})(jP||(jP={}));var FP;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){let i=r;return i!=null&&_t.is(i.range)&&(O.string(i.expression)||i.expression===void 0)}t.is=n})(FP||(FP={}));var BP;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&_t.is(r.stoppedLocation)}t.is=n})(BP||(BP={}));var Zg;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(Zg||(Zg={}));var ey;(function(t){function e(r){return{value:r}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&(i.tooltip===void 0||O.string(i.tooltip)||ac.is(i.tooltip))&&(i.location===void 0||tf.is(i.location))&&(i.command===void 0||Io.is(i.command))}t.is=n})(ey||(ey={}));var UP;(function(t){function e(r,i,s){let o={position:r,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&Tr.is(i.position)&&(O.string(i.label)||O.typedArray(i.label,ey.is))&&(i.kind===void 0||Zg.is(i.kind))&&i.textEdits===void 0||O.typedArray(i.textEdits,xo.is)&&(i.tooltip===void 0||O.string(i.tooltip)||ac.is(i.tooltip))&&(i.paddingLeft===void 0||O.boolean(i.paddingLeft))&&(i.paddingRight===void 0||O.boolean(i.paddingRight))}t.is=n})(UP||(UP={}));var VP;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(VP||(VP={}));var zP;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(zP||(zP={}));var WP;(function(t){function e(n){return{items:n}}t.create=e})(WP||(WP={}));var HP;(function(t){t.Invoked=0,t.Automatic=1})(HP||(HP={}));var GP;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(GP||(GP={}));var YP;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(YP||(YP={}));var KP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&Ug.is(r.uri)&&O.string(r.name)}t.is=e})(KP||(KP={}));var XP;(function(t){function e(s,o,a,c){return new ty(s,o,a,c)}t.create=e;function n(s){let o=s;return!!(O.defined(o)&&O.string(o.uri)&&(O.undefined(o.languageId)||O.string(o.languageId))&&O.uinteger(o.lineCount)&&O.func(o.getText)&&O.func(o.positionAt)&&O.func(o.offsetAt))}t.is=n;function r(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),h=s.offsetAt(d.range.end);if(h<=l)a=a.substring(0,f)+d.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=r;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}})(XP||(XP={}));var ty=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
|
|
233
234
|
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
234
|
-
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return
|
|
235
|
-
rialnumber.`],t};function
|
|
235
|
+
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return Tr.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return Tr.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}},O;(function(t){let e=Object.prototype.toString;function n(h){return typeof h<"u"}t.defined=n;function r(h){return typeof h>"u"}t.undefined=r;function i(h){return h===!0||h===!1}t.boolean=i;function s(h){return e.call(h)==="[object String]"}t.string=s;function o(h){return e.call(h)==="[object Number]"}t.number=o;function a(h,y,p){return e.call(h)==="[object Number]"&&y<=h&&h<=p}t.numberRange=a;function c(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=c;function l(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=l;function u(h){return e.call(h)==="[object Function]"}t.func=u;function d(h){return h!==null&&typeof h=="object"}t.objectLiteral=d;function f(h,y){return Array.isArray(h)&&h.every(y)}t.typedArray=f})(O||(O={}));var JP=()=>{let t=new Y("interrupt-map-mask",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=ke(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#interrupt-cells");if(!o)return r;let a=i.addressCells(n),c=Ce(o,0,0,n);if(c==null)return r;let l=[...Array.from({length:a},(u,d)=>`AddressMask${a>1?d:""}`),...Array.from({length:c},(u,d)=>`InterruptMask${c>1?d:""}`)];return t.signatureArgs=l.map(u=>wn.create(u)),s.length!==a+c&&r.push($(19,e.ast.values??e.ast,kn.Error,[],[],[e.name,`<${[...Array.from({length:a},()=>"AddressMask"),...Array.from({length:c},()=>"InterruptMask")].join(" ")}>`])),r});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 Vr=K(J());var QP=()=>{let t=new Y(/^(?!interrupt-|no-).*?-map$/,V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=e.name.split("-map",1)[0],i=[],s=e.parent,o=e.parent.root,a=s.getProperty(`#${r}-cells`);if(!a)return i.push($(16,e.ast,Vr.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,`#${r}-cells`,`/${s.path.slice(1).join("/")}`])),i;let c=Ce(a,0,0,n);if(c==null)return i;let l=ke(e.ast.values);if(!l?.length)return[];let u={},d=0,f=0,h=[],y=0;for(;d<l.length;){if(h.push([...Array.from({length:c},(k,C)=>`${y}_Interrupt${c>1?C:""}`),`${y}_SpecifierParent`,`${y}_ParentSpecifier...`]),d+c>=l.length){let k=d+c;i.push($(20,l[l.length-1],Vr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((l.length-f)%k===0?k:(l.length-f)%k).join(" ")}`]));break}let p=new j(H(l.at(d).firstToken,l.at(c+d-1)?.lastToken)),T="";for(let k=d;k<c+d;k++){let C=l[k];T+=`${C instanceof tt?C.evaluate(n).toString():C.toString()}:`}if(u[T]??=[],u[T].push(p),d+=c,l.length<d+1){let k=c+1;i.push($(20,l[l.length-1],Vr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((l.length-f)%k===0?k:(l.length-f)%k).join(" ")}`]));break}let _=$n(l[d],o);if(!_){i.push($(17,l[d],Vr.DiagnosticSeverity.Error));break}let v=_.getProperty(`#${r}-cells`);if(!v)return i.push($(16,l[d],Vr.DiagnosticSeverity.Error,[..._.nodeNameOrLabelRef],[],[e.name,`#${r}-cells`,`/${s.path.slice(1).join("/")}`])),i;d++;let b=Ce(v,0,0,n);if(b==null)break;if(h.splice(-1,1,[...Array.from({length:c},(k,C)=>`${y}_ChildSpecifier${c>1?C:""}`),`${y}_SpecifierParent`,...Array.from({length:b},(k,C)=>`${y}_ParentSpecifier${b>1?C:""}`)]),d+=b,l.length<d){let k=c+1+b;i.push($(20,l[l.length-1],Vr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((l.length-f)%k===0?k:(l.length-f)%k).join(" ")}`]));break}f=d,y++}return h.push([...Array.from({length:c},(p,T)=>`${y}_Interrupt${c>1?T:""}`),`${y}_SpecifierParent`,`${y}_ParentSpecifier...`]),t.signatureArgs=h.map(p=>p.map(T=>Vr.ParameterInformation.create(T))),Object.values(u).forEach(p=>{p.length>1&&i.push($(30,p[p.length-1],Vr.DiagnosticSeverity.Error,p.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 ZP=()=>{let t=new Y(/^(?!interrupt-).*?-map-mask$/,V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=ke(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return r;let c=Ce(a,0,0,n);if(c==null)return r;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];return t.signatureArgs=l.map(u=>wn.create(u)),s.length!==c&&r.push($(19,e.ast.values??e.ast,kn.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`])),r});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 eR=()=>{let t=new Y(/^(?!interrupt-).*?-map-pass-thru$/,V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=ke(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return r;let c=Ce(a,0,0,n);if(c==null)return r;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];return t.signatureArgs=l.map(u=>wn.create(u)),s.length!==c&&r.push($(19,e.ast.values??e.ast,kn.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`])),r});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 tR=()=>{let t=new Y(/^(?!#(?:address-|interrupt-|size-)).*-cells$/,V("U32"));return t.list=!0,t.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],t};function Nn(){let t=new fn;return t.addProperty([xN(),KN(),YN(),HN(),Qd(),Jd(),WN(),zN(),Xd(),VN(),UN(),BN(),XN(),MN(),jN(),qN(),FN(),LN(),$N(),JN(),JP(),QP(),ZP(),eR(),tR()]),t}var nR=()=>{let t=new Y("chassis-type",V("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 rR=()=>{let t=new Y("serial-number",V("STRING"),"optional");return t.description=[`Specifies a string representing the device\u2019s se-
|
|
236
|
+
rialnumber.`],t};function iR(){let t=Nn();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let n=t.properties.find(s=>s.name==="#size-cells");n.required=()=>"required";let r=t.properties.find(s=>s.name==="model");r.required=()=>"required";let i=t.properties.find(s=>s.name==="compatible");return i.required=()=>"required",t.addProperty([nR(),rR()]),t}var Fi=K(J());function sR(){let t=new fn((n,r)=>{let i=[];return r.parent?.name!=="/"&&i.push($(26,r.definitions[0],Fi.DiagnosticSeverity.Error,r.definitions.slice(1),[],["Aliases node can only be added to a root node"])),r.nodes.forEach(s=>{s.definitions.forEach(o=>{i.push($(26,o,Fi.DiagnosticSeverity.Error,[],[],["Aliases node can not have child nodes"],Fi.TextEdit.del(Es(o.firstToken.prevToken,o.lastToken,!1)),"Delete Node"))})}),i});t.noMismatchPropertiesAllowed=!0;let e=new Y(/^[-A-Za-z0-9]+$/,V(["STRING","U32"]),void 0,void 0,void 0,n=>{let r=[],i=n.ast.quickValues;if(i?.length===1&&typeof i[0]=="string"){if(!i[0].startsWith("/"))return r.push($(23,n.ast.values??n.ast,Fi.DiagnosticSeverity.Error,[],[],[i[0],n.name])),r;if(i[0].trim().endsWith("/"))return r.push($(23,n.ast.values??n.ast,Fi.DiagnosticSeverity.Error,[],[],["",i[0]])),r;let s=n.parent.root,o=i[0].split("/").slice(1);for(;o[0];){let a=s,c=o.splice(0,1)[0],[l,u]=c.split("@"),d=u?.split(",").map(f=>Number.parseInt(f,16));if(s=l?a.getNode(l,d,!1):void 0,!s){r.push($(23,n.ast.values??n.ast,Fi.DiagnosticSeverity.Error,[],[],[l,a.fullName]));break}}}return r});return e.description=["Each property of the /aliases node defines an alias."],t.addProperty([e]),t}function oR(){let t=Nn();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(n=>n.name==="reg");return e.required=()=>"required",t}var cR=K(J());var aR=(t,e,n)=>{let r=t?.(e,n)??[],i=e.parent.root.getProperty(e.name),s=i?Ce(i,0,0,n):void 0,o=e.parent.getProperty(e.name);return(o?Ce(o,0,0,n):void 0)!==s&&r.push($(28,e.ast,cR.DiagnosticSeverity.Error,[...i?.ast?[i.ast]:[]],void 0,[`${e.name} value in this node must match value of root node`])),r};function lR(){let t=new fn;t.noMismatchPropertiesAllowed=!0;let e=Qd(),n=e?.additionalTypeCheck;e.additionalTypeCheck=(o,a)=>aR(n,o,a),e.required=()=>"required";let r=Jd(),i=r?.additionalTypeCheck;r.additionalTypeCheck=(o,a)=>aR(i,o,a),r.required=()=>"required";let s=Xd();return s.required=()=>"required",s.type=V("EMPTY"),s.additionalTypeCheck=void 0,t.addProperty([e,r,s]),t}var uR=K(J());function dR(){let t=Nn();t.additionalValidations=(i,s)=>{let o=[];return s.parent?.name!=="/"&&o.push($(26,s.definitions[0],uR.DiagnosticSeverity.Error,s.definitions.slice(1),[],["Chosen node can only be added to a root node"])),o};let e=new Y("bootargs",V("STRING"));e.description=[`A string that specifies the boot arguments for
|
|
236
237
|
theclientprogram. Thevaluecouldpotentially
|
|
237
238
|
be a null string if no boot arguments are re-
|
|
238
239
|
quired.`];let n=new Y("stdout-path ",V("STRING"));n.description=[`A string that specifies the full path to the node
|
|
@@ -244,21 +245,21 @@ ified, stdout-path should be assumed to define
|
|
|
244
245
|
theinput device.`];let r=new Y("stdin-path ",V("STRING"));return r.description=[`A string that specifies the boot arguments for
|
|
245
246
|
theclientprogram. Thevaluecouldpotentially
|
|
246
247
|
be a null string if no boot arguments are re-
|
|
247
|
-
quired.`],t.addProperty([e,n,r]),t}var
|
|
248
|
+
quired.`],t.addProperty([e,n,r]),t}var ny=K(J());function fR(){let t=Nn();t.additionalValidations=(i,s)=>s.parent?.name!=="/"?[$(26,s.definitions[0],ny.DiagnosticSeverity.Error,s.definitions.slice(1),[],["Cpus node can only be added to a root node"])]:[];let e=t.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let n=t.properties.find(i=>i.name==="#size-cells");n.required=()=>"required";let r=n?.additionalTypeCheck;return n.additionalTypeCheck=(i,s)=>{let o=r?.(i,s)??[],a=i.parent.getProperty(i.name);return(a?Ce(a,0,0,s):void 0)!==0&&o.push($(28,i.ast,ny.DiagnosticSeverity.Error,void 0,void 0,[`${i.name} value in cpus node must be '0'`])),o},t}var hR=K(J());function pR(){let t=Nn();t.additionalValidations=(r,i)=>i.parent?.name!=="cpus"?[$(26,i.definitions[0],hR.DiagnosticSeverity.Error,i.definitions.slice(1),[],["`cpu` node can only be a child of `cpus` node"])]:[];let e=t.properties.find(r=>r.name==="device_type");e.required=()=>"required";let n=t.properties.find(r=>r.name==="reg");return n.required=()=>"required",n.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
|
|
248
249
|
CP U/threads represented by the CPU node.
|
|
249
250
|
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.
|
|
250
251
|
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.
|
|
251
252
|
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.
|
|
252
253
|
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
|
|
253
254
|
If a CPU/thread's PIR (pending interrupt reg-ister) is modifiable, a client program should modify PIR to match the reg property value.
|
|
254
|
-
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
|
|
255
|
-
any circumstances other than under the control of the device driver using the region.`],t};var fR=()=>{let t=new Y("reusable",V("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 hR=()=>{let t=new Y("size",V("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],i=we(e.ast.values),s=e.parent.sizeCells(n),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];return t.signatureArgs=o.map(a=>kn.create(a)),i?.length!==e.parent.sizeCells(n)&&r.push($(19,e.ast.values??e.ast,wn.Error,[],[],[e.name,`<${Array.from({length:s},()=>"size")}>`])),r});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function pR(){let t=Nn(),e=t.properties.find(n=>n.name==="reg");return e.required=()=>"optional",t.addProperty([hR(),lR(),uR(),dR(),fR()]),t}function ws(t){switch(t?.name){case"/":return QP();case"aliases":return ZP();case"memory":return eR();case"reserved-memory":return rR();case"chosen":return sR();case"cpus":return oR();case"cpu":return cR()}return t?.parent?.name==="reserved-memory"?pR():Nn()}var ke=class t{constructor(e,n,r,i=null){this.bindingLoader=e;this.name=n;this.address=r;this.parent=i;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];i?.addNode(this)}static toJson(e){let n={};return e.property.forEach(r=>n[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>n[r.fullName]=t.toJson(r)),n}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=[ws(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(n=>n===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(n=>n===e)?this:[...this._nodes,...this._deletedNodes.map(n=>n.node)].map(n=>n.getReferenceBy(e)).find(n=>n)}get nodeNameOrLabelRef(){return Po([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,n){let r=[...this.definitions,...this.referencedBy].find(i=>Kn(i,e,n));if(r){let i=this.deletes.map(c=>({item:this,ast:jr(c,e,n),beforeAst:Ka(c,e,n),afterAst:Ya(c,e,n)})).find(c=>Kn(c.ast,e,n));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=>Kn(c.ast,e,n)||c.ast.lastToken.value!==";"&&lN(c.ast,e,n));if(s)return s.item.getDeepestAstNode(e,n);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,n)).find(c=>c);if(o)return o;let a=jr(r,e,n);return{item:this,ast:a,beforeAst:Ka(a,e,n),afterAst:Ya(a,e,n)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Ie).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.property.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.property.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){let e=[...this.property.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.issues),...this._deletedNodes.flatMap(n=>n.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues];return this.name==="/"&&this.definitions.length&&(this._nodes.some(n=>n.name==="cpus")||e.push(qt(9,this.definitions.at(-1).name??new j(H(this.definitions.at(-1).firstToken)),br.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),e}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[qt(6,e.property.ast,br.DiagnosticSeverity.Hint,[e.by],[br.DiagnosticTag.Deprecated],[e.property.name]),...e.property.allReplaced.map(n=>qt(6,n.ast,br.DiagnosticSeverity.Hint,[e.by],[br.DiagnosticTag.Deprecated],[e.property.name])),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(n=>n instanceof Ie),...e.node.referencedBy].flatMap(n=>{let r;return n instanceof Ie?r=n.name.toString():n.reference instanceof de?r=n.reference.label.value:r=n.reference.path.pathParts.at(-1).name,qt(7,n,br.DiagnosticSeverity.Hint,[e.by],[br.DiagnosticTag.Deprecated],[r])})])}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,n){return this._nodes.some(r=>r.name===e&&(r.address===n||r.address?.every((i,s)=>n?.at(s)===i)))}hasProperty(e){return this._properties.some(n=>n.name===e)}getProperty(e){return this._properties.find(n=>n.name===e)}deleteNode(e,n,r){let i=this._nodes.findIndex(s=>s.name===e&&(s.address===r||r?.every((o,a)=>s.address?.at(a)===o)));i!==-1&&(this._deletedNodes.push({node:this._nodes[i],by:n}),this._nodes.splice(i,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Rt){let r=n.values[0].value;if(r instanceof zt&&r.value===e)return[this,...this._nodes.flatMap(i=>i.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Rt){let r=n.values[0].value;if(r instanceof zt&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,n,r=!0){let i=r||!!n||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!i||o.address===n||o.address?.every((a,c)=>n?.at(c)===a)));if(s!==-1)return this._nodes[s]}deleteProperty(e,n){let r=this._properties.findIndex(i=>i.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:n}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let n=this._properties.findIndex(r=>r.name===e.name);if(n===-1)this._properties.push(e);else{let r=this._properties.splice(n,1)[0];this._properties.push(e),e.replaces=r,r.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(r=>this._nodeTypes=r):this._nodeTypes=[ws(this)])}getChild(e,n=!0){let r=[...e];r.splice(0,1);let i=r[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,n);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,n){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let r=[...e];return r.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!n(s.by)).map(s=>s.node)].find(s=>s.fullName===r[0])?.getChildFromScope(r,n)}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 n=this.getProperty("reg");if(!n){this.#e=null;return}let r=this.parentAddressCells(e),i=this.parentSizeCells(e),s=[],o=we(n.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:r}).map(()=>o.pop()),c=Array.from({length:i}).map(()=>o.pop());if(![...a,...c].every(d=>d instanceof et))continue;let l=a.map(d=>d.evaluate(e)),u=c.map(d=>d.evaluate(e));[...l,...u].every(d=>typeof d=="number")&&s.push({startAddress:l,endAddress:$i(l,u),size:u,ast:new j(H(a[0].firstToken,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 n=this.getProperty("ranges");if(!n){this.#t=null;return}let r=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=we(n.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:r}).map(()=>a.pop());if(![...c,...l,...u].every(y=>y instanceof et))continue;let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(H(c[0].firstToken,u.at(-1).lastToken))})}return this.#t=o,this.#t}#i;dmaRangeMap(e){if(this.#i!==void 0)return this.#i;let n=this.getProperty("dma-ranges");if(!n){this.#i=null;return}let r=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=we(n.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:r}).map(()=>a.pop());if(![...c,...l,...u].every(y=>y instanceof et))continue;let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(H(c[0].firstToken,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}#n;addressCells(e){if(this.#n!==void 0)return this.#n;let n=this?.getProperty("#address-cells");return this.#n=n?Re(n,0,0,e)??2:2,this.#n}#o;sizeCells(e){if(this.#o!==void 0)return this.#o;let n=this.getProperty("#size-cells");return this.#o=n?Re(n,0,0,e)??1:1,this.#o}#f;mappedReg(e){if(this.#f!==void 0)return this.#f;let n=this.parent?.rangeMap(e),r=this.regArray(e);return this.#f=r?.flatMap(i=>{let s=i.startAddress,o=i.size,a=$i(s,o),c=this.parent?.mappedReg(e),l={startAddress:s,startAddressRaw:s,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regAst:i.ast};if(!n)return[l];let u=hN(n,s);return u.length?u.map(d=>(l.mappedAst=d.ast,l.startAddress=d.start,l.endAddress=$i(d.start,o),l.inMappingRange=qr(l.endAddress,d.end)<=0,l.mappingEnd=d.end,{...l,mappedAst:d.ast,startAddress:d.start,endAddress:$i(d.start,o),inMappingRange:qr(l.endAddress,d.end)<=0,mappingEnd:d.end})):[l]}).sort((i,s)=>qr(i.endAddress,s.endAddress))??[],this.#f}getNexusMapEntyMatch(e,n,r,i=[]){let s=new j(H(r[0].firstToken,r.at(-1).lastToken)),o=this.getNexusMap(e,n);if(o){let a=[...i.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...r.map((l,u)=>{let d=l instanceof et?l.evaluate(n):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 et?u.evaluate(n):u).toString()).join(":")===a);return{entry:s,match:c}}return{entry:s}}getNexusMap(e,n){let r=this.getProperty(`${e}-map`),i=we(r?.ast.values);if(!i?.length)return;let s=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=Re(o,0,0,n);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(n));let c=[],l=0;for(;l<i.length;){let f=i.slice(l,a+l);if(l+=a,i.length<l+1)break;let h=$n(i[l],s);if(!h)break;let y=h.getProperty(`#${e}-cells`);if(!y)return;l++;let p=Re(y,0,0,n);if(p==null||(e==="interrupt"&&(p+=h.addressCells(n)),l+=p,i.length<l))break;let T=i.slice(l-p,l);c.push({mappingValues:f,node:h,parentValues:T})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,h)=>(u?Re(u,0,h,n):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?`
|
|
255
|
+
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 mR=()=>{let t=new Y("alignment",V("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],i=ke(e.ast.values),s=e.parent.sizeCells(n),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];return t.signatureArgs=o.map(a=>wn.create(a)),i?.length!==s&&r.push($(19,e.ast.values??e.ast,kn.Error,[],[],[e.name,`<${Array.from({length:e.parent.sizeCells(n)},()=>"size")}>`])),r});return t.description=["Address boundary for alignment of allocation."],t};var gR=()=>{let t=new Y("alloc-ranges",V("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],i=ke(e.ast.values);if(!i)return[];let s=e.parent.addressCells(n),o=e.parent.sizeCells(n),a=[...Array.from({length:s},(c,l)=>`address${s>1?l:""}`),...Array.from({length:o},(c,l)=>`size${o>1?l:""}`)];return t.signatureArgs=a.map(c=>wn.create(c)),t.signatureArgsCyclic=!0,(i.length===0||i.length%(s+o)!==0)&&r.push($(19,i.at(i.length-i.length%(o+s))??e.ast,kn.Error,[],[],[e.name,`<${[...Array.from({length:s},()=>"address"),...Array.from({length:o},()=>"size")].join(" ")}>`])),r});return t.description=["Specifies regions of memory that are acceptable to allocate from"],t};var yR=()=>{let t=new Y("no-map",V("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
|
|
256
|
+
any circumstances other than under the control of the device driver using the region.`],t};var vR=()=>{let t=new Y("reusable",V("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 bR=()=>{let t=new Y("size",V("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],i=ke(e.ast.values),s=e.parent.sizeCells(n),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];return t.signatureArgs=o.map(a=>wn.create(a)),i?.length!==e.parent.sizeCells(n)&&r.push($(19,e.ast.values??e.ast,kn.Error,[],[],[e.name,`<${Array.from({length:s},()=>"size")}>`])),r});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function TR(){let t=Nn(),e=t.properties.find(n=>n.name==="reg");return e.required=()=>"optional",t.addProperty([bR(),mR(),gR(),yR(),vR()]),t}function ws(t){switch(t?.name){case"/":return iR();case"aliases":return sR();case"memory":return oR();case"reserved-memory":return lR();case"chosen":return dR();case"cpus":return fR();case"cpu":return pR()}return t?.parent?.name==="reserved-memory"?TR():Nn()}var we=class t{constructor(e,n,r,i=null){this.bindingLoader=e;this.name=n;this.address=r;this.parent=i;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];i?.addNode(this)}static toJson(e){let n={};return e.property.forEach(r=>n[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>n[r.fullName]=t.toJson(r)),n}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=[ws(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(n=>n===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(n=>n===e)?this:[...this._nodes,...this._deletedNodes.map(n=>n.node)].map(n=>n.getReferenceBy(e)).find(n=>n)}get nodeNameOrLabelRef(){return Co([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,n){let r=[...this.definitions,...this.referencedBy].find(i=>Kn(i,e,n));if(r){let i=this.deletes.map(c=>({item:this,ast:Br(c,e,n),beforeAst:Ja(c,e,n),afterAst:Xa(c,e,n)})).find(c=>Kn(c.ast,e,n));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=>Kn(c.ast,e,n)||c.ast.lastToken.value!==";"&&hN(c.ast,e,n));if(s)return s.item.getDeepestAstNode(e,n);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,n)).find(c=>c);if(o)return o;let a=Br(r,e,n);return{item:this,ast:a,beforeAst:Ja(a,e,n),afterAst:Xa(a,e,n)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof xe).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.property.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.property.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){let e=[...this.property.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.issues),...this._deletedNodes.flatMap(n=>n.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues];return this.name==="/"&&this.definitions.length&&(this._nodes.some(n=>n.name==="cpus")||e.push(qt(9,this.definitions.at(-1).name??new j(H(this.definitions.at(-1).firstToken)),Sr.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),e}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[qt(6,e.property.ast,Sr.DiagnosticSeverity.Hint,[e.by],[Sr.DiagnosticTag.Deprecated],[e.property.name]),...e.property.allReplaced.map(n=>qt(6,n.ast,Sr.DiagnosticSeverity.Hint,[e.by],[Sr.DiagnosticTag.Deprecated],[e.property.name])),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(n=>n instanceof xe),...e.node.referencedBy].flatMap(n=>{let r;return n instanceof xe?r=n.name.toString():n.reference instanceof de?r=n.reference.label.value:r=n.reference.path.pathParts.at(-1).name,qt(7,n,Sr.DiagnosticSeverity.Hint,[e.by],[Sr.DiagnosticTag.Deprecated],[r])})])}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,n){return this._nodes.some(r=>r.name===e&&(r.address===n||r.address?.every((i,s)=>n?.at(s)===i)))}hasProperty(e){return this._properties.some(n=>n.name===e)}getProperty(e){return this._properties.find(n=>n.name===e)}deleteNode(e,n,r){let i=this._nodes.findIndex(s=>s.name===e&&(s.address===r||r?.every((o,a)=>s.address?.at(a)===o)));i!==-1&&(this._deletedNodes.push({node:this._nodes[i],by:n}),this._nodes.splice(i,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Rt){let r=n.values[0].value;if(r instanceof Wt&&r.value===e)return[this,...this._nodes.flatMap(i=>i.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Rt){let r=n.values[0].value;if(r instanceof Wt&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,n,r=!0){let i=r||!!n||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!i||o.address===n||o.address?.every((a,c)=>n?.at(c)===a)));if(s!==-1)return this._nodes[s]}deleteProperty(e,n){let r=this._properties.findIndex(i=>i.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:n}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let n=this._properties.findIndex(r=>r.name===e.name);if(n===-1)this._properties.push(e);else{let r=this._properties.splice(n,1)[0];this._properties.push(e),e.replaces=r,r.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(r=>this._nodeTypes=r):this._nodeTypes=[ws(this)])}getChild(e,n=!0){let r=[...e];r.splice(0,1);let i=r[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,n);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,n){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let r=[...e];return r.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!n(s.by)).map(s=>s.node)].find(s=>s.fullName===r[0])?.getChildFromScope(r,n)}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 n=this.getProperty("reg");if(!n){this.#e=null;return}let r=this.parentAddressCells(e),i=this.parentSizeCells(e),s=[],o=ke(n.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:r}).map(()=>o.pop()),c=Array.from({length:i}).map(()=>o.pop());if(![...a,...c].every(d=>d instanceof tt))continue;let l=a.map(d=>d.evaluate(e)),u=c.map(d=>d.evaluate(e));[...l,...u].every(d=>typeof d=="number")&&s.push({startAddress:l,endAddress:qi(l,u),size:u,ast:new j(H(a[0].firstToken,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 n=this.getProperty("ranges");if(!n){this.#t=null;return}let r=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=ke(n.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:r}).map(()=>a.pop());if(![...c,...l,...u].every(y=>y instanceof tt))continue;let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(H(c[0].firstToken,u.at(-1).lastToken))})}return this.#t=o,this.#t}#i;dmaRangeMap(e){if(this.#i!==void 0)return this.#i;let n=this.getProperty("dma-ranges");if(!n){this.#i=null;return}let r=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=ke(n.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:r}).map(()=>a.pop());if(![...c,...l,...u].every(y=>y instanceof tt))continue;let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(H(c[0].firstToken,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}#n;addressCells(e){if(this.#n!==void 0)return this.#n;let n=this?.getProperty("#address-cells");return this.#n=n?Ce(n,0,0,e)??2:2,this.#n}#o;sizeCells(e){if(this.#o!==void 0)return this.#o;let n=this.getProperty("#size-cells");return this.#o=n?Ce(n,0,0,e)??1:1,this.#o}#f;mappedReg(e){if(this.#f!==void 0)return this.#f;let n=this.parent?.rangeMap(e),r=this.regArray(e);return this.#f=r?.flatMap(i=>{let s=i.startAddress,o=i.size,a=qi(s,o),c=this.parent?.mappedReg(e),l={startAddress:s,startAddressRaw:s,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regAst:i.ast};if(!n)return[l];let u=yN(n,s);return u.length?u.map(d=>(l.mappedAst=d.ast,l.startAddress=d.start,l.endAddress=qi(d.start,o),l.inMappingRange=Fr(l.endAddress,d.end)<=0,l.mappingEnd=d.end,{...l,mappedAst:d.ast,startAddress:d.start,endAddress:qi(d.start,o),inMappingRange:Fr(l.endAddress,d.end)<=0,mappingEnd:d.end})):[l]}).sort((i,s)=>Fr(i.endAddress,s.endAddress))??[],this.#f}getNexusMapEntyMatch(e,n,r,i=[]){let s=new j(H(r[0].firstToken,r.at(-1).lastToken)),o=this.getNexusMap(e,n);if(o){let a=[...i.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...r.map((l,u)=>{let d=l instanceof tt?l.evaluate(n):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 tt?u.evaluate(n):u).toString()).join(":")===a);return{entry:s,match:c}}return{entry:s}}getNexusMap(e,n){let r=this.getProperty(`${e}-map`),i=ke(r?.ast.values);if(!i?.length)return;let s=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=Ce(o,0,0,n);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(n));let c=[],l=0;for(;l<i.length;){let f=i.slice(l,a+l);if(l+=a,i.length<l+1)break;let h=$n(i[l],s);if(!h)break;let y=h.getProperty(`#${e}-cells`);if(!y)return;l++;let p=Ce(y,0,0,n);if(p==null||(e==="interrupt"&&(p+=h.addressCells(n)),l+=p,i.length<l))break;let T=i.slice(l-p,l);c.push({mappingValues:f,node:h,parentValues:T})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,h)=>(u?Ce(u,0,h,n):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?`
|
|
256
257
|
`:""}${this.property.map(n=>n.toPrettyString(e)).join(`
|
|
257
258
|
`)}${this.nodes.length?`
|
|
258
259
|
${this.nodes.map(n=>`${n.fullName}{ /* ... */ };`).join(`
|
|
259
260
|
`)}`:""}
|
|
260
|
-
};`}toMarkupContent(e){return{kind:
|
|
261
|
-
`)}}toFullString(e,n=1){let r=this.definitions.some(s=>s instanceof
|
|
261
|
+
};`}toMarkupContent(e){return{kind:Sr.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(`
|
|
262
|
+
`)}}toFullString(e,n=1){let r=this.definitions.some(s=>s instanceof xe&&s.omitIfNoRef),i=r&&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.property.length?`
|
|
262
263
|
${" ".repeat(n)}`:""}${this.property.map(s=>s.toString()).join(`
|
|
263
264
|
${" ".repeat(n)}`)}${this.nodes.length?`
|
|
264
265
|
${" ".repeat(n)}${this.nodes.map(s=>`${s.fullName}{ ... };`).join(`
|
|
@@ -269,43 +270,43 @@ ${" ".repeat(n)}`:""}${this.property.map(s=>s.toPrettyString(e)).join(`
|
|
|
269
270
|
${" ".repeat(n)}`)}${this.nodes.length?`
|
|
270
271
|
${" ".repeat(n)}${this.nodes.map(s=>s.toFullString(e,n+1)).join(`
|
|
271
272
|
${" ".repeat(n)}`)}`:""}
|
|
272
|
-
${" ".repeat(n-1)}}; ${i?" */":""}`}serialize(e){let n=this.mappedReg(e),r=[...this.definitions,...this.referencedBy],i=this.nodeType;return{nodeType:i instanceof
|
|
273
|
-
`)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var
|
|
273
|
+
${" ".repeat(n-1)}}; ${i?" */":""}`}serialize(e){let n=this.mappedReg(e),r=[...this.definitions,...this.referencedBy],i=this.nodeType;return{nodeType:i instanceof fn?{...this.nodeType,properties:i.properties.map(s=>({name:typeof s.name=="string"?s.name:s.name.toString(),allowedValues:s.allowedValues,type:s.type}))}:void 0,issues:r.flatMap(s=>s.serializeIssues),path:this.pathString,name:this.fullName,nodes:r.map(s=>s.serialize(e)),properties:this.property.map(s=>s.ast.serialize(e)),childNodes:this.nodes.map(s=>s.serialize(e)),reg:n?.map(s=>({mappedStartAddress:s?.startAddress,mappedEndAddress:s?.endAddress,startAddress:s?.startAddressRaw,endAddress:s?.endAddressRaw,size:s?.size,inMappingRange:s?.inMappingRange}))}}};var Lo=K(J());var ry=K(J());var Bi=class extends j{constructor(n,r){super(r);this.label=n;this.docSymbolsMeta={name:this.label.value,kind:ry.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(n)}toString(){return`${this.label.toString()}:`}},Ht=class extends j{constructor(n,r){super(r);this.value=n;this.docSymbolsMeta={name:this.value,kind:ry.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(n){let r=this.parentNode;if(!(r instanceof de&&r.linksTo)){super.buildSemanticTokens(n);return}n(ci("type"),li("declaration"),{start:this.firstToken,end:this.lastToken})}toString(){return`${this.value}`}};var Ve=class{constructor(e,n){this.ast=e;this.parent=n;this.nexusMapsTo=[]}getDeepestAstNode(e,n){let r=Br(this.ast,e,n);return this.ast.assignOperatorToken&&Lg(this.ast.assignOperatorToken,e,n)?{item:this,ast:r,beforeAst:Ja(this.ast,e,n),afterAst:Xa(this.ast,e,n)}:{item:this,ast:r}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof Bi)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(n=>n===e)?this:null}))}getArgumentIndex(e){if(!e)return;let n=this.ast.getFlatAstValues()?.findIndex(r=>r===e||r?.isAncestorOf(e));return n===-1?void 0:n}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[qt(0,this.replaces.ast,Lo.DiagnosticSeverity.Hint,[this.ast],[Lo.DiagnosticTag.Unnecessary],[this.name])]:[]]}onHover(){if(this.nexusMapsTo.length)return{kind:Lo.MarkupKind.Markdown,value:["### Nexus mappings",...this.nexusMapsTo.flatMap(e=>["```",`${this.name} = <... ${e.mappingValuesAst.map(n=>n.toString()).join(" ")} ...> maps to <... ${e.mapItem.mappingValues.map(n=>n.toString()).join(" ")} ...>;`,"```",`[Mapping (${e.mappingValuesAst.map(n=>n.toString()).join(" ")})](${`${e.mapItem.mappingValues[0].uri}#L${e.mapItem.mappingValues[0].firstToken.pos.line}`})`])].join(`
|
|
274
|
+
`)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var NR=K(J());var mc=require("fs");var of=class t{constructor(e,n){this.text=e;this.uri=n;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this._tokens=[];this.lines=this.text.replace(`\r
|
|
274
275
|
`,`
|
|
275
276
|
`).split(/\n/).map(r=>`${r}
|
|
276
277
|
`),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
|
|
277
|
-
`)&&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==="?"}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 n=this.lineNumber;if(!this.move()||this.lineNumber!==n)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let n=e,r;for(;this.currentChar!==e;){if(this.currentChar===`
|
|
278
|
-
`){let a=this.lineNumber,c=this.columnNumber,l=n.length;this.pushToken({tokens:[21],value:n,pos:{col:c-l,line:a,len:l,colEnd:c},adjacentToken:r}),r=this._tokens.at(-1),n=""}else if(this.currentChar==="\\"){let a=this.lineNumber;if(n+=this.currentChar??"",this.move())a===this.lineNumber&&(n+=this.currentChar??"");else break}else n+=this.currentChar??"";if(!this.move())break}n+=e;let i=this.lineNumber,s=this.columnNumber+1,o=n.length;this.pushToken({tokens:[21],value:n,pos:{col:s-o,line:i,len:o,colEnd:s},adjacentToken:r}),this.move()}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let n=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(!n)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let r=this._tokens.at(-1);return n&&!r?.tokens.some(i=>i===21)&&r&&r.pos.len<e.length?this.process(e.slice(r.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let n={...e,uri:this.uri},r=this._tokens.at(-1);n.prevToken=r,r&&(r.nextToken=n),this._tokens.push(n)}isLetters(e){let n=e.match(/^[A-Za-z]+/);return n?.[0]?(this.pushToken({tokens:[47],value:n?.[0],pos:this.generatePos(e,n?.[0])}),!0):!1}isDigit(e){let n=e.match(/^[0-9]/);return n?.[0]?(this.pushToken({tokens:[20,19],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isHexDigit(e){let n=e.match(/^[A-Fa-f]/);return n?.[0]?(this.pushToken({tokens:[20,47],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isCurlyOpen(e){let n="{";return e===n?(this.pushToken({tokens:[2],pos:this.generatePos(e,n),value:"{"}),!0):!1}isCurlyClose(e){let n="}";return e===n?(this.pushToken({tokens:[3],pos:this.generatePos(e,n),value:"}"}),!0):!1}isSemicolon(e){let n=";";return e===n?(this.pushToken({tokens:[1],pos:this.generatePos(e,n),value:n}),!0):!1}isColon(e){let n=":";return e===n?(this.pushToken({tokens:[50],pos:this.generatePos(e,n),value:n}),!0):!1}isHash(e){let n="#";return e.startsWith(n)?(this.pushToken({tokens:[46],pos:this.generatePos(e,n),value:n}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let n="=";return e===n?(this.pushToken({tokens:[0],pos:this.generatePos(e,n),value:n}),!0):!1}isGtSym(e){let n=">";return e===n?(this.pushToken({tokens:[4],pos:this.generatePos(e,n),value:n}),!0):!1}isLtSym(e){let n="<";return e===n?(this.pushToken({tokens:[5],pos:this.generatePos(e,n),value:n}),!0):!1}isLogicalNot(e){let n="!";return e===n?(this.pushToken({tokens:[6],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseOr(e){let n="|";return e===n?(this.pushToken({tokens:[8],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseXOr(e){let n="^";return e===n?(this.pushToken({tokens:[9],pos:this.generatePos(e,n),value:n}),!0):!1}isAmpersand(e){let n="&";return e===n?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseNot(e){let n="~";return e===n?(this.pushToken({tokens:[10],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundOpen(e){let n="(";return e===n?(this.pushToken({tokens:[42],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundClose(e){let n=")";return e===n?(this.pushToken({tokens:[43],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareOpen(e){let n="[";return e===n?(this.pushToken({tokens:[11],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareClose(e){let n="]";return e===n?(this.pushToken({tokens:[12],pos:this.generatePos(e,n),value:n}),!0):!1}isComma(e){let n=",";return e===n?(this.pushToken({tokens:[24],pos:this.generatePos(e,n),value:n}),!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 n=e.match(/^["']/);return n?.[0]?(this.rewind(e.slice(1)),this.getString(n[0]),!0):!1}isForwardSlash(e){let n="/";return e===n?(this.pushToken({tokens:[13],pos:this.generatePos(e,n),value:"/"}),!0):!1}isBackSlash(e){let n="\\";return e===n?(this.pushToken({tokens:[14],pos:this.generatePos(e,n),value:"\\"}),!0):!1}isAddOperator(e){let n="+";return e===n?(this.pushToken({tokens:[15],pos:this.generatePos(e,n),value:n}),!0):!1}isQuestionMark(e){let n="?";return e===n?(this.pushToken({tokens:[44],pos:this.generatePos(e,n),value:n}),!0):!1}isPeriod(e){let n=".";return e===n?(this.pushToken({tokens:[45],pos:this.generatePos(e,n),value:n}),!0):!1}isNegateOperator(e){let n="-";return e===n?(this.pushToken({tokens:[16],pos:this.generatePos(e,n),value:n}),!0):!1}isUnderScore(e){let n="_";return e===n?(this.pushToken({tokens:[48],pos:this.generatePos(e,n),value:n}),!0):!1}isAt(e){let n="@";return e===n?(this.pushToken({tokens:[49],pos:this.generatePos(e,n),value:n}),!0):!1}isMultiplicationOperator(e){let n="*";return e===n?(this.pushToken({tokens:[17],pos:this.generatePos(e,n),value:n}),!0):!1}isModulusOperator(e){let n="%";return e===n?(this.pushToken({tokens:[18],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefine(e){let n="#define";return e.toLowerCase()===n?(this.pushToken({tokens:[25],pos:this.generatePos(e,n),value:n}),!0):!1}isCInclude(e){let n="#include";return e.toLowerCase()===n?(this.pushToken({tokens:[26],pos:this.generatePos(e,n),value:n}),!0):!1}isCLine(e){let n="#line";return e.toLowerCase()===n?(this.pushToken({tokens:[27],pos:this.generatePos(e,n),value:n}),!0):!1}isCUndef(e){let n="#undef";return e.toLowerCase()===n?(this.pushToken({tokens:[28],pos:this.generatePos(e,n),value:n}),!0):!1}isCError(e){let n="#error";return e.toLowerCase()===n?(this.pushToken({tokens:[29],pos:this.generatePos(e,n),value:n}),!0):!1}isCPragma(e){let n="#pragma";return e.toLowerCase()===n?(this.pushToken({tokens:[30],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefined(e){let n="#defined";return e.toLowerCase()===n?(this.pushToken({tokens:[31],pos:this.generatePos(e,n),value:n}),!0):!1}isCIf(e){let n="#if";return e.toLowerCase()===n?(this.pushToken({tokens:[32],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfDef(e){let n="#ifdef";return e.toLowerCase()===n?(this.pushToken({tokens:[33],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfNDef(e){let n="#ifndef";return e.toLowerCase()===n?(this.pushToken({tokens:[34],pos:this.generatePos(e,n),value:n}),!0):!1}isCElIf(e){let n="#elif";return e.toLowerCase()===n?(this.pushToken({tokens:[35],pos:this.generatePos(e,n),value:n}),!0):!1}isCElse(e){let n="#else";return e.toLowerCase()===n?(this.pushToken({tokens:[36],pos:this.generatePos(e,n),value:n}),!0):!1}isCEndIf(e){let n="#endif";return e.toLowerCase()===n?(this.pushToken({tokens:[37],pos:this.generatePos(e,n),value:n}),!0):!1}isCTrue(e){let n="true";return e==n?(this.pushToken({tokens:[38],value:n,pos:this.generatePos(e,n)}),!0):!1}isCFalse(e){let n="false";return e==n?(this.pushToken({tokens:[39],value:n,pos:this.generatePos(e,n)}),!0):!1}generatePos(e,n){let r=this.columnNumber-e.length;return{line:this.lineNumber,col:r,len:n.length,colEnd:r+n.length}}};var lt=class extends j{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var ny=require("fs"),Lo=require("path");var mR=K(J());var Ot=class extends et{constructor(n,r){super(r);this.name=n;this.docSymbolsMeta={name:this.name.toString(),kind:mR.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var rf=class extends j{constructor(n,r){super(r);this.operator=n;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var gR=K(J());var sf=class extends lt{toString(){return"..."}},Ur=class extends j{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(n){return oe(this.uri,n)?[{name:this.functionName.name,kind:gR.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r.getDocumentSymbols(n))}]:[]}toString(){return`${this.functionName}(${this.params.map(n=>n.toString()).join(",")})`}};var Bi=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,n=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||!oe(this.currentToken?.uri,e.uri))return;let i=this.currentToken,s=i;for(;this.currentToken?.pos.line===r;)s=this.moveToNextToken;if(n){let o=new j(H(i,s));this._issues.push(z(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(),n=this.positionStack.pop();if(n===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=n}peekIndex(e=1){let n=this.positionStack.at(-1*e);if(n===void 0)throw new Error("Index out of bounds");return n}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 n=[];return e.every(r=>{let i=this.currentToken,s=r(i),o=!1;return s!=="no"&&i&&(n.push(i),this.moveToNextToken,o=nn(i,this.currentToken)),s==="yes"&&o}),this.mergeStack(),n}consumeAnyConcurrentTokens(e){this.enqueueToStack();let n=[],r,i=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&i);)n.push(this.currentToken),r=this.currentToken,this.moveToNextToken,i=nn(r,this.currentToken);return this.mergeStack(),n}getDocumentSymbols(e){return this.allAstItems.flatMap(n=>n.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,n){let r=[],i=(s,o,a)=>{if(!a?.start||!a?.end||!oe(a.start.uri,n)||!oe(a.end.uri,n))return;let c=a.end.pos.colEnd-a.start.pos.col;r.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)}),r.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,n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Oe));if(!r.length){this.popStack();return}let i=r.map(o=>o.value).join("");if(!i.match(/^[_A-Za-z]/)){this.popStack();return}let s=new Ot(i,H(r[0],r.at(-1)));return!n&&s.name!=="defined"&&(e.get(s.name)||this._issues.push(z(42,s))),this.mergeStack(),s}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let n=e,r;if(F(e,40)?(r="&",F(this.currentToken,40)&&(r="&&",n=this.moveToNextToken)):F(e,10)?(r="!",F(this.currentToken,0)&&(r="!=",n=this.moveToNextToken)):F(e,8)?(r="|",F(this.currentToken,8)&&(r="||",n=this.moveToNextToken)):F(e,9)?r="^":F(e,4)?(r=">",F(this.currentToken,4)?(r="<<",n=this.moveToNextToken):F(this.currentToken,0)&&(r=">=",n=this.moveToNextToken)):F(e,5)?(r="<",F(this.currentToken,5)?(r=">>",n=this.moveToNextToken):F(this.currentToken,0)&&(r="<=",n=this.moveToNextToken)):F(e,15)?r="+":F(e,16)?r="-":F(e,17)?r="*":F(e,13)?r="/":F(e,18)?r="%":F(e,46)?F(this.currentToken,46)&&(r="##",n=this.moveToNextToken):F(e,0)&&F(this.currentToken,0)&&(r="==",n=this.moveToNextToken),r){let i=new rf(r,H(e,n));return this.mergeStack(),i}this.popStack()}parseScopedBlock(e,n,r){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(p=>"items"in p?a(p.items):p),c=[i],l=[],u=[];u[0]={rewind:o,tokens:[]};let d=this.currentToken;for(;d&&!n(d);){if(r?.(d)){let y=this.peekIndex()+1,p=()=>{this.positionStack[this.positionStack.length-1]=y};c.push(d),l.push(d),u[u.length]={rewind:p,tokens:[]}}else if(e(d)){let y=this.parseScopedBlock(e,n,r);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&&n(f)&&(this.moveToNextToken,c.push(f));let h={startToken:i,items:c,splitTokens:u,endToken:f,separatorTokens:l};return this.mergeStack(),h}isFunctionCall(e){this.enqueueToStack();let n=this.processCIdentifier(e,!1);if(!n){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}if(n.name==="defined")r.length>1?this._issues.push(z(44,n)):r.length<1&&this._issues.push(z(45,n));else{let s=e.get(n.name)?.macro;s&&(s?.identifier instanceof Ur?r.length>s.identifier.params.length?this._issues.push(z(44,n,void 0,[s])):r.length<s.identifier.params.length&&this._issues.push(z(45,n,void 0,[s])):this._issues.push(z(43,n)))}let i=new $r(n,r);return i.lastToken=this.prevToken,this.mergeStack(),i}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([Ke("0"),Ke("x",!0)]);if(e.length!==2){this.popStack();return}let n=this.consumeAnyConcurrentTokens([19,20].map(Oe));if(!n.length){this.popStack();return}let r=Number.parseInt(n.map(s=>s.value).join(""),16),i=new zt(r,H(e[0],n.at(-1)));return this.mergeStack(),i}processDec(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19].map(Oe));if(!e.length){this.popStack();return}let n=Number.parseInt(e.map(i=>i.value).join(""),10),r=new zt(n,H(e[0],e.at(-1)));return this.mergeStack(),r}processEnclosedExpression(e){this.enqueueToStack();let n,r;if(F(this.currentToken,42)){let i;n=this.moveToNextToken,r=n;let s=this.processExpression(e,!0);return s&&(i=new ci(s,!0),s=new ci(i,!1),i.openBracket=n),F(this.currentToken,43)?(r=this.moveToNextToken,i&&(i.closeBracket=r)):this._issues.push(z(26,new j(H(n)))),this.mergeStack(),s}this.popStack()}processExpression(e,n=!1){this.enqueueToStack();let r;if(r=this.processEnclosedExpression(e)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(),!r){this.popStack();return}if(n){let i=this.isOperator();for(;i;){let s=this.processExpression(e);s?r instanceof ci?r.addExpression(i,s):r=new ci(r,!1,{operator:i,expression:s}):this._issues.push(z(27,i)),i=this.isOperator()}}return this.mergeStack(),r}processMacroCallParams(){if(!F(this.currentToken,42))return;let e=this.parseScopedBlock(r=>!!F(r,42),r=>!!F(r,43),r=>!!F(r,24));return e?.items.length===2&&F(e.endToken,43)?[]:e?.splitTokens.map((r,i)=>{if(r.tokens.length===0)return null;let s=new Lr(r.tokens.map((o,a)=>{let c=o.value;return o.pos.line===r.tokens.at(a+1)?.pos.line&&(c=c.padEnd(r.tokens[a+1].pos.col-o.pos.col," ")),c}).join(""),H(r.tokens[0],r.tokens.at(-1)),i);return s.splitToken=e.separatorTokens.at(i),s})}};var of=class t extends Bi{constructor(n){super();this.uri=n;this.comments=[];this.tokens=[]}cleanUpComments(){let n=[];for(let r=0;r<this.tokens.length;r++){let i=t.processBlockComment(this.tokens,r)||t.processLineComment(this.tokens,r);i&&(r=i.index,n.push(...i.tokenUsed),this.comments.push(i.comment))}n.reverse().forEach(r=>this.tokens.splice(r,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=qn().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComment(n,r){let i=[],s=()=>(i.push(r++),n[r]),o=()=>n[r],a=()=>n[r-1],c=o(),l=c;if(!c||!F(c,13)||(l=s(),!F(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!F(a(),17)||!F(o(),13)||!nn(a(),o())),d=l.pos.line,f=c,h=[];l=s();do{if(o()?.pos.line!==d){let T=new gr(H(f,a()));h.push(T),d=o().pos.line??0,f=o()}l=s()}while(r<n.length&&!u());let y=new gr(H(f,o()));h.push(y);let p=new hi(h);return s(),{comment:p,tokenUsed:i,index:r-1}}static processLineComment(n,r){let i=[];if(!F(n[r],13)||n.length===r+1||!F(n[r+1],13)||!nn(n[r],n[r+1]))return;for(;n[r].pos.line===n.at(r+1)?.pos.line;)i.push(r++);return i.push(r++),{comment:new gr(H(n[i[0]],n[i.at(-1)])),tokenUsed:i,index:r-1}}};var yR=K(J()),af=class extends j{constructor(n,r){super(n);this.content=r}toString(){let n=this.content.filter(r=>!F(r,14));return n.map((r,i)=>{let s=r.value;return r.pos.line===n.at(i+1)?.pos.line?s=s.padEnd(n[i+1].pos.col-r.pos.col," "):n.at(i+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},sc=class extends j{constructor(n,r,i){super();this.keyword=n;this.identifier=r;this.content=i;this.addChild(n),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ot?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:yR.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
279
|
-
`)}}};var ks=class extends j{constructor(e){super(e)}},oc=class extends j{constructor(n,r){super();this.keyword=n;this.content=r;this.active=!1;this.addChild(n)}},ac=class extends oc{constructor(n,r,i){super(n,i);this.identifier=r;this.addChild(r),this.addChild(i)}useBlock(n){return this.identifier&&n.has(this.identifier.name)}},cf=class extends oc{constructor(n,r,i){super(n,i);this.expression=r;this.addChild(r),this.addChild(i)}useBlock(n){return this.expression instanceof $r?this.expression.functionName.name==="defined"?this.expression&&n.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(n):this.expression?.isTrue(n)}},lf=class extends ac{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},cc=class extends oc{};var Mo=class extends j{constructor(n,r,i){super();this.ifDef=n;this.endIf=r;this.elseOption=i;this.addChild(n),i&&this.addChild(i),this.addChild(r)}getInValidTokenRange(n,r){let i=[],s=a=>r.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(n);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}},Ui=class extends j{constructor(n,r,i){super();this.ifBlocks=n;this.endIf=r;this.elseOption=i;n.forEach(s=>this.addChild(s)),i&&this.addChild(i),this.addChild(r)}getInValidTokenRange(n,r){let i=[],s=a=>r.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach((a,c)=>{i.push({start:s(a.tokenIndexes.start),end:s(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(n)?(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 lc=K(J());var $o=class extends Bi{constructor(n,r,i){super();this.uri=n;this.incudes=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;i&&(Array.from(i).forEach(([s,o])=>this.macroSnapShot.set(s,o)),Array.from(i).forEach(([s,o])=>this.macros.set(s,o)))}get currentToken(){let n=this.prevToken,r=hr(n,this.tokens.at(this.peekIndex()))||!n||F(n,14)&&n.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!r))return this.macroStart&&F(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(n){super.reset(),this.macros.clear(),n?(this.macroSnapShot.clear(),Array.from(n).forEach(([r,i])=>this.macroSnapShot.set(r,i)),Array.from(n).forEach(([r,i])=>this.macros.set(r,i))):Array.from(this.macroSnapShot).forEach(([r,i])=>this.macros.set(r,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(n){let r=this.stable;return this.parsing=new Promise(i=>{r.then(()=>{if(n&&n.size===this.macroSnapShot.size){let s=Array.from(n);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(n),this.parse().then(i)})}),this.parsing}async parse(){let n=new of(this.uri);if(await n.stable,this.tokens=n.tokens,this.nodes.push(...n.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||!oe(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let r=this.currentToken,i=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!F(r,25))return this.popStack(),!1;this.macroStart=!0;let i=new lt(H(r)),s=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(z(30,i)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new af(H(o[0],o.at(-1)),o));let c=new sc(i,s,a);this.macros.set(c.name,{macro:c,resolver:fN(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(n,l-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!F(r,28))return this.popStack(),!1;this.macroStart=!0;let i=new lt(H(r)),s=this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(z(30,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(n,a-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let n=[];for(;this.currentToken;){let r=this.moveToNextToken;r&&n.push(r)}return n}isFunctionDefinition(){this.enqueueToStack();let n=this.processCIdentifier(this.macros,!0);if(!n){this.popStack();return}let r=this.moveToNextToken;if(!F(r,42)||!nn(n.lastToken,r)){this.popStack();return}let i=[],s=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;s;)i.push(s),!F(this.currentToken,24)&&!F(this.currentToken,43)?this._issues.push(z(28,s)):F(this.currentToken,43)||(r=this.moveToNextToken),s=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new Ur(n,i);return F(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(z(26,i.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let n=this.checkConcurrentTokens([Oe(45),Oe(45),Oe(45)]);if(n.length!==3){this.popStack();return}let r=new sf(H(n[0],n.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let n=this.peekIndex(),r=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>F(o,a))&&!hr(o.prevToken,o),o=>!!o&&[37].some(a=>F(o,a))&&!hr(o.prevToken,o),o=>!!o&&[36,35].some(a=>F(o,a))&&!hr(o.prevToken,o));if(!r)return;let i;F(r.startToken,32)?i=this.processIfBlock(r,(o,a,c)=>new cf(o,a??null,c)):i=this.processIfDefBlock(r,(o,a,c)=>F(r.startToken,33)?new ac(o,a??null,c):new lf(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 Ui?i.ifBlocks:[i.ifDef],...i.elseOption?[i.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(z(47,o.content,lc.DiagnosticSeverity.Hint,[],[lc.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=n}processIfDefBlock(n,r){this.enqueueToStack(),this.macroStart=!0;let i=new lt(H(n.startToken));n.splitTokens[0].rewind();let s=this.processCIdentifier(this.macros,!0);s||this._issues.push(z(31,i)),this.macroStart=!1;let o,a=s?.lastToken.nextToken??i.lastToken.nextToken;a&&n.splitTokens[0].tokens.find(f=>f===a)&&(o=new ks(H(a,n.splitTokens[0].tokens.at(-1))));let c=r(i,s??null,o??null),l;if(n.splitTokens.length>1){let f=n.splitTokens[1].tokens[0].prevToken,h=new lt(H(f)),y;n.splitTokens[1].tokens.length&&(y=new ks(H(n.splitTokens[1].tokens[0],n.splitTokens[1].tokens.at(-1)))),l=new cc(h,y??null)}let u;n.endToken?u=new lt(H(n.endToken)):this._issues.push(z(46,i));let d=new Mo(c,u??null,l);return this.mergeStack(),d}processIfBlock(n,r){this.enqueueToStack();let i=new lt(H(n.startToken)),s=[],o;n.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new lt(H(d));this.macroStart=!0;let h=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===n.splitTokens.length-1&&F(d,36)){let p=d,T=new lt(H(p)),_;l.tokens.length&&(_=new ks(H(l.tokens[0],l.tokens.at(-1)))),o=new cc(T,_??null)}else{h||this._issues.push(z(31,i));let p,T=h?.lastToken.nextToken??i.lastToken.nextToken;T&&l.tokens.find(v=>v===T)&&(p=new ks(H(T,n.splitTokens[u].tokens.at(-1))));let _=r(f,h??null,p??null);s.push(_)}});let a;n.endToken?a=new lt(H(n.endToken)):this._issues.push(z(46,i));let c=new Ui(s,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(n){if(n.path.path)return n.path.relative?[(0,Lo.resolve)((0,Lo.dirname)(n.uri),n.path.path),...this.incudes.map(r=>(0,Lo.resolve)(r,n.path.path))].find(r=>(0,ny.existsSync)(r)):this.incudes.map(r=>(0,Lo.resolve)(r,n.path.path)).find(r=>(0,ny.existsSync)(r))}async processInclude(){this.enqueueToStack();let n=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let i=r,s=r;if(F(r,26))this.moveToNextToken;else{let p=this.checkConcurrentTokens([Oe(13),Ke("include"),Oe(13)]);if(p.length!==3)return this.popStack(),!1;i=p[0],s=p.at(-1)}let o=i,a=new lt(H(i,s));r=this.moveToNextToken;let c=r,l=!!F(r,21);if(!c||!l&&!F(r,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=r?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!F(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new Ro(u,l,H(c,r)),f=new fi(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!F(this.currentToken,4)?this._issues.push(z(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let h=this.peekIndex(),y=this.resolveInclude(f);if(f.resolvedPath=y,y||this._issues.push(z(36,f.path,lc.DiagnosticSeverity.Warning)),y){qn().requestTokens(y,!0);let p=await uc().getCPreprocessorParser(y,this.incudes,this.macros,this.uri);await p.stable,this._issues.push(...p.issues),this.macros.clear(),Array.from(p.macros).forEach(([T,_])=>this.macros.set(T,_)),y.endsWith(".h")?this.tokens.splice(n,h-n):this.tokens.splice(n,h-n,...p.tokens),this.nodes.push(...p.nodes),this.dtsIncludes.push(...p.dtsIncludes)}else this.tokens.splice(n,h-n);return this.positionStack[this.positionStack.length-1]=n,!0}};var ry,uf=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,n,r,i){e=tt(e);let s=`${Array.from(r).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(s);if(o)return o.reparse(r),o;console.log("No cpreprocess cache",e);let a=new $o(e,n,r),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 n=this.headerFiles.get(e);n&&Array.from(n).forEach(r=>{r[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(r[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function uc(){return ry??=new uf,ry}function vR(){ry=new uf}var iy,df=class t{constructor(){this.fileMap=new Map}static clone(e){let n=e.map(r=>({...r}));return n.forEach((r,i)=>{r.prevToken=n[i-1],r.nextToken=n[i+1]}),n}needsRenew(e,n){return e=tt(e),this.fileMap.get(e)?.text!==n}getDocument(e){return ko.create(e,"devicetree",0,this.fileMap.get(e)?.text??(0,dc.readFileSync)(e).toString())}renewLexer(e,n){if(e=tt(e),uc().reset(e),!e||!(0,dc.existsSync)(e))return[];try{n??=(0,dc.readFileSync)(e).toString();let r=new nf(n,e);return this.fileMap.set(e,r),t.clone(r.tokens)}catch{}return[]}requestTokens(e,n){e=tt(e);let r=this.fileMap.get(e)?.tokens;return!r&&n?[...this.renewLexer(e)]:t.clone(r??[])}reset(e){e=tt(e),uc().reset(e),this.fileMap.delete(e)}};function qn(){return iy??=new df,iy}function bR(){iy=new df}var qo=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new ke(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let n=this.fileTopMostAstCache.get(e);if(n)return n;let r=[...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,r),r}getDeepestAstNode(e,n){let i=this.fileTopMostAsts(e).find(s=>Kn(s,e,n)||uN(qn().requestTokens(e,!1),s,n));if(i instanceof jt){let o=this.rootNode.getReferenceBy(i)?.getDeepestAstNode(e,n);return o?{...o,runtime:this}:{item:null,runtime:this,ast:jr(i,e,n)}}else if(i instanceof mt&&i.path){let s=this.rootNode.getDeepestAstNode(e,n);return s?{...s,runtime:this}:void 0}else if(i instanceof Ie&&i.path){let s=t.getNodeFromPath(i.path.slice(1),this.rootNode)?.getDeepestAstNode(e,n);return s?{...s,runtime:this}:void 0}else if(i)return{runtime:this,item:null,ast:jr(i,e,n)}}static getNodeFromPath(e,n,r=!0){if(e.length===0)return n;let i=e[0].split("@"),s=i[0],a=i.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=n.getNode(s,a,r);return l?t.getNodeFromPath(c,l,r):void 0}resolvePath(e,n){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(n??=this.rootNode.allDescendantsLabels,n.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof bt)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],n=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{n.has(r.label.label.value)?n.get(r.label.label.value)?.push(r):n.set(r.label.label.value,[r])}),Array.from(n).forEach(r=>{let i=r[1];if(i.length>1){let s=i.find(a=>a.owner instanceof ke);(!i.every(a=>a&&a.owner===s?.owner)||!s)&&e.push(qt(4,i.at(0).label,TR.DiagnosticSeverity.Error,i.slice(1).map(a=>a.label),[],[i.at(0).label.label.value]))}}),e}get typesIssues(){let e=n=>[...n.nodeType?.getIssue(this,n)??[],...n.nodes.flatMap(r=>e(r))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return dN([...e.definitions,...e.referencedBy],this.context)}};var SR=K(J()),ff=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Values",kind:SR.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(n=>n?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(n=>n?.toJson())}};var _R=K(J()),hf=class extends j{constructor(n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:"DTS Document version",kind:_R.SymbolKind.Function}}};var Vr=class extends j{constructor(n,r){super();this.value=n;this.labels=r;this.labels.forEach(i=>{this.addChild(i)}),this.addChild(this.value)}toString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toString(n)??"NULL"}`}toPrettyString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toPrettyString(n)??"NULL"}`}};var ER=K(J()),pf=class extends j{constructor(n,r,i){super();this.keyword=n;this.startAddress=r;this.endAddress=i;this.addChild(n),this.docSymbolsMeta={name:"Memreserve",kind:ER.SymbolKind.Function},this.addChild(r),this.addChild(i)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var wR=K(J()),mf=class extends j{constructor(n,r){super();this.keyword=n;this.bitsSize=r;this.addChild(n),this.docSymbolsMeta={name:"bits",kind:wR.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var gf=K(J()),fc=class extends Bi{constructor(n,r,i){super();this.uri=n;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new bt;this.unhandledStatements=new mt;this.cPreprocessorParser=new $o(this.uri,this.incudes,i)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(n=>n.resolvedPath).filter(n=>!!n)]}reset(){super.reset(),this.others=[],this.rootDocument=new bt,this._issues=[],this.unhandledStatements=new mt}async reparse(){let n=performance.now(),r=this.stable;return this.parsing=new Promise(i=>{r.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-n),i()})}),this.parsing}async parse(){let n=performance.now();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 i=this.moveToNextToken;if(i){let s=new j(H(i));this._issues.push(z(22,s)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(i=>{this._issues.push(z(32,i))}),this.unhandledStatements.deleteProperties.forEach(i=>{this._issues.push(z(33,i))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(n){this.enqueueToStack();let r=this.moveToNextToken,i=r,s=13;if(!r||!F(r,s))return this.popStack(),!1;if(i=this.moveToNextToken,s=2,!i||!F(i,s))return this.popStack(),!1;let o=new mt;o.openScope=i,n.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??i;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(n){let r=this.currentToken;if(F(r,3))this.moveToNextToken;else{let i=this.prevToken;if(i){let s=new j(H(i));this._issues.push(z(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(n.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return F(this.currentToken,3)||F(this.currentToken,1)}endStatement(n=!0){let r=this.currentToken;if(!F(r,1)){let i=this.prevToken;if(i&&n){let s=new j(H(this.prevToken));return this._issues.push(z(1,s)),i}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;F(this.currentToken,1);){let n=this.moveToNextToken;if(n){let r=new j(H(n));this._issues.push(z(23,r))}}}processNode(n,r){if(this.done)return!1;let i=!1,s=!1;do{if(s=this.isChildNode(n,r)||this.isProperty(n)||this.isDeleteNode(n,r)||this.isDeleteProperty(n),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new j(H(o));this._issues.push(z(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;i=i||s}while(!this.isNodeEnd());return i}processOptionalLabelAssign(n=!1){let r=[],i=this.isLabelAssign(n);for(;i;)r.push(i),i=this.isLabelAssign(n);return r}isChildNode(n,r){this.enqueueToStack();let i;r==="Name"&&(i=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new jt(s):new Ie(s,i);if(r==="Ref"?(this.enqueueToStack(),a=this.processNodePathRef(),!a||!F(this.currentToken,2)?(this.popStack(),a=void 0):this.mergeStack(),a??=this.isLabelRef()):r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!F(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(z(r==="Name"?[7]:[10,48,11],c))}let l=!1;if(a&&c instanceof jt?(c.reference=a,l=!0):o&&c instanceof Ie&&(l=o.address!==void 0,c.name=o),F(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(z(2,u))}else return this.popStack(),!1;return n.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let n=this.prevToken;this.enqueueToStack();let r=this.checkConcurrentTokens([Ke("0"),Ke("x",!0)]);r.length!==2?(r=[],this.popStack()):(this._issues.push(z(50,new j(H(r[0],r[1])),gf.DiagnosticSeverity.Warning)),n=r.at(-1),this.mergeStack());let i=this.consumeAnyConcurrentTokens([19,20,48].map(Oe)),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(n){if(o.some(c=>Number.isNaN(c))){let c=new j(H(n));this._issues.push(z(8,c))}else if(!Number.isNaN(o)&&!nn(n,i[0])){let c=new j(H(n,i.at(0)));this._issues.push(z(29,c))}}return this.currentToken?.value.toUpperCase()==="ULL"&&(this._issues.push(z(51,new j(H(this.currentToken)),gf.DiagnosticSeverity.Warning)),this.moveToNextToken),new Ja(o,H(r.at(0)??i[0]??this.prevToken,this.prevToken))}processNodeAddresses(n){this.enqueueToStack();let r=this.checkConcurrentTokens([Oe(49)]);if(r.length){if(!nn(n.lastToken,r[0])){let a=new j(H(n.lastToken,r[0]));this._issues.push(z(29,a))}let i=[],s=()=>{if(i.push(this.processNodeAddress()),F(this.currentToken,24)){if(this.prevToken&&!nn(this.prevToken,this.currentToken)){let a=new j(H(this.prevToken,this.currentToken));this._issues.push(z(29,a))}this.moveToNextToken,s()}};s();let o=this.currentToken;for(;!F(this.currentToken,2)&&!F(this.currentToken,1)&&!F(this.currentToken,3)&&hr(this.currentToken,i.at(-1)?.lastToken);)this.moveToNextToken;if(o&&o!==this.currentToken){this._issues.push(z(52,new j(H(o,this.currentToken))));let a=new Ja([],H(o,this.prevToken));i.push(a)}return this.mergeStack(),i}this.popStack()}isNodeName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Oe));if(!n.length){this.popStack();return}let r=n.map(o=>o.value).join(""),i=new xe(r,H(n[0],n.at(-1))),s=this.processNodeAddresses(i);return i.address=s,r.match(/^[A-Za-z]/)||this._issues.push(z(49,i)),this.mergeStack(),i}isPropertyName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Oe));if(!n.length){this.popStack();return}let r=new He(n.map(i=>i.value).join(""),H(n[0],n.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Oe));if(!n.length){this.popStack();return}let r=n.map(s=>s.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let i=new Wt(r,H(n[0],n.at(-1)));return this.mergeStack(),i}isLabelAssign(n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Oe));if(!r.length){this.popStack();return}let i=r.map(c=>c.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&F(s,50),a=new Fi(new Wt(i,H(r[0],r.at(-1))),H(r[0],o?s:r.at(-1)));if(o){let c=r.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.colEnd)&&this._issues.push(z(29,new j(H(c,s)))),this.moveToNextToken}else if(n)this._issues.push(z(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(),i=this.isPropertyName();if(!i)return this.popStack(),!1;if(F(this.currentToken,2)||F(this.currentToken,49))return this.popStack(),!1;let s=new Xe(i,r),o;F(this.currentToken,0)?(s.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(s),o?.values.filter(c=>!!c).length||this._issues.push(z(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,n.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let n=this.checkConcurrentTokens([Oe(13),Ke("d"),Ke("ts"),Oe(16),Ke("v"),Ke("1")]);if(n.length!==6)return this.popStack(),!1;let r=n[0],i=r,s=new lt;s.firstToken=r;let o=new hf(s);if(this.others.push(o),F(this.currentToken,13))i=this.moveToNextToken;else return s.lastToken=n.at(-1),this._issues.push(z(21,o)),this.mergeStack(),!0;return s.lastToken=i,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let n=this.checkConcurrentTokens([Oe(13),Ke("memreserve")]);if(n.length!==2)return this.popStack(),!1;let r=new lt;r.firstToken=n[0];let s=n[0];F(this.currentToken,13)?(s=this.moveToNextToken,r.lastToken=s):(r.lastToken=n.at(-1),this._issues.push(z(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new pf(r,o,a);return this.others.push(c),o||this._issues.push(z(37,r)),a||this._issues.push(z(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let n=this.checkConcurrentTokens([Oe(13),Ke("b"),Ke("its")]);if(n.length!==3){this.popStack();return}let r=new lt;r.firstToken=n[0];let s=n[0];F(this.currentToken,13)?(s=this.moveToNextToken,r.lastToken=s):(r.lastToken=n.at(-1),this._issues.push(z(21,r)));let o=this.processDec(),a=new mf(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(z(40,o)):this._issues.push(z(39,r)),this._issues.push(z(41,a,gf.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let n=this.checkConcurrentTokens([Oe(13),Ke("omit"),Oe(16),Ke("if"),Oe(16),Ke("no"),Oe(16),Ke("ref"),Oe(13)]);if(n.length!==9){this.popStack();return}let r=new lt(H(n[0],n.at(-1)));return this.mergeStack(),r}isDeleteNode(n,r){this.enqueueToStack();let i=this.checkConcurrentTokens([Oe(13),Ke("d"),Ke("e"),Ke("lete"),Oe(16),Ke("node")]);if(!i.length)return this.popStack(),!1;let s=i[0],o=s,a=new lt;if(a.firstToken=s,i.length===1&&!F(this.currentToken,2)){this._issues.push(z(25,a)),a.lastToken=i.at(-1);let d=new _n(a);return n.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(z(c.startsWith("/delete-n")?34:25,a)):F(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(z(21,a));let l=new _n(a);if(hr(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(z(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(z(7,f));let h=d||f?void 0:this.isNodeName();h&&r==="Ref"&&this._issues.push(z(10,h)),!d&&!h&&!f&&this._issues.push(z([7,10],l)),l.nodeNameOrRef=d??f??h??null}else r==="Name"?this._issues.push(z(7,a)):r==="Ref"&&this._issues.push(z(10,a));let u=this.endStatement();return l.lastToken=u,n.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(n){this.enqueueToStack();let r=this.checkConcurrentTokens([Oe(13),Ke("d"),Ke("e"),Ke("lete"),Oe(16),Ke("property")]);if(!r.length)return this.popStack(),!1;let i=r[0],s=i,o=new lt;if(o.firstToken=i,r.length===1&&!F(this.currentToken,2)){this._issues.push(z(25,o)),o.lastToken=r.at(-1);let u=new at(o);return n.addNodeChild(u),this.mergeStack(),!0}let a=r.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=r.at(-1),a!=="/delete-property"?this._issues.push(z(a.startsWith("/delete-p")?35:25,o)):F(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(z(21,o));let c=new at(o);if(hr(o.tokenIndexes?.end,i)){let u=this.isPropertyName();u||this._issues.push(z(6,c)),c.propertyName=u??null}else this._issues.push(z(6,o));let l=this.endStatement();return c.lastToken=l,n.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.processNodePathRef();if(!r){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&i.push(...this.processOptionalLabelAssign(!0));let s=new dn(n,r,i);return this.mergeStack(),s}processValue(n){this.enqueueToStack();let i=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue()||this.arrayValues(n)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!F(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d,f=F(this.currentToken,24);if(f)d=this.currentToken,this.moveToNextToken;else if(!hr(this.prevToken,this.currentToken))break;let h=o();if(u&&h===null&&f){let p=new j(H(u,this.currentToken));this._issues.push(z(0,p))}if(!f&&h===null)break;if(l&&!f&&h){let p=new j(H(l));this._issues.push(z(28,p))}let y=c.at(-1);y&&(y.nextValueSeparator??=d),c.push(h)}return c})();if(i.length===0){this.popStack();return}return this.mergeStack(),new ff(i)}processStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.consumeAnyConcurrentTokens([Oe(21)]);if(!r.length){this.popStack();return}if(r.some(l=>!l?.value))throw new Error("Token must have value");let i=r.map(l=>l.value).join(`
|
|
280
|
-
`),s=i;s.match(/["']$/)&&(s=s.slice(1,-1));let o=new Le(s,H(r[0],r.at(-1)));i.match(/["']$/)||this._issues.push(z(i.startsWith('"')?16:17,o));let a=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(a=this.processOptionalLabelAssign(!0));let c=new dn(n,o,a);return this.mergeStack(),c}arrayValues(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),i=this.processBits(),s=this.currentToken;if(F(s,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(n)??null;o.openBracket=s;let a=this.processOptionalLabelAssign(!0)??[],c=new dn(r,o,a,i);F(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(z(12,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=s,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,i=r;if(!F(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(z(15,u))});let a=new ui(s??[]);a.openBracket=i,a.values.length===0&&(a.firstToken=r,this._issues.push(z(14,a)));let c=new dn(n,a,o);F(this.currentToken,12)?a.closeBracket=this.moveToNextToken:this._issues.push(z(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=r,a.lastToken=this.prevToken,c}processLabeledValue(n){this.enqueueToStack();let r=n(),i=[];if(!r)return this.popStack(),[];for(;r;)i=[...i,r],r=n();if(i){let s=n();s&&(i=[...i,s])}return this.mergeStack(),i}processArrayValues(n){this.enqueueToStack();let r=this.processLabeledValue(()=>this.processRefValue(!1)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),i=new Rt(r);return r.length===0&&(i.firstToken=this.currentToken),this.mergeStack(),i}processLabeledHex(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),i=this.processHex();if(!i){this.popStack();return}let s=new Vr(i,r);return this.mergeStack(),s}processHexString(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(Oe));if(!r.length){this.popStack();return}let i=Number.parseInt(r.map(a=>a.value).join(""),16),s=new zt(i,H(r[0],r.at(-1))),o=new Vr(s,n);return this.mergeStack(),o}processLabeledDec(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),i=this.processDec();if(!i){this.popStack();return}let s=new Vr(i,r);return this.mergeStack(),s}processLabeledExpression(n=!0,r=n){this.enqueueToStack();let i=[];n&&(i=this.processOptionalLabelAssign(r));let s=this.processExpression(this.cPreprocessorParser.macros);if(!s){this.popStack();return}let o=new Vr(s,i);return this.mergeStack(),o}isExpressionValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.processExpression(this.cPreprocessorParser.macros);if(!r){this.popStack();return}let i=this.processOptionalLabelAssign(!0),s=new dn(n,r,i);return this.mergeStack(),s}isLabelRef(){this.enqueueToStack();let n=this.currentToken;if(!n||!F(n,40)){this.popStack();return}else this.moveToNextToken;let r=this.isLabelName();if(!r){let s=new de(null);return this._issues.push(z(18,new j(H(n)))),s.firstToken=n,this.mergeStack(),s}n&&(r.firstToken.pos.line!==n.pos.line||r.firstToken.pos.col!==n.pos.colEnd)&&this._issues.push(z(29,new j(H(n,r.firstToken))));let i=new de(r);return i.firstToken=n,this.mergeStack(),i}isLabelRefValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.isLabelRef();if(!r){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(i=this.processOptionalLabelAssign(!0));let s=new dn(n,r,i);return this.mergeStack(),s}processRefValue(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),i=this.currentToken;if(!i||!F(i,40)){this.popStack();return}let s=this.processNodePathRef();if(s!==void 0){let c=new Vr(s,r);return this.mergeStack(),c}let o=this.isLabelRef();if(o===void 0){this._issues.push(z([18,9],new j(H(i))));let c=new Vr(null,r);return c.firstToken=r.at(0)?.firstToken??i,this.mergeStack(),c}let a=new Vr(o,r);return a.firstToken=r.at(0)?.firstToken??i,this.mergeStack(),a}processNodePath(n=!0,r=new di){this.enqueueToStack();let i;if(F(this.currentToken,13))i=this.moveToNextToken;else{if(!n){this.popStack();return}this.prevToken&&this._issues.push(z(19,new j(H(this.prevToken))))}let s=this.isNodeName();if(s||this._issues.push(z(7,new j(H(i??this.prevToken)))),r.addPath(s??null,i?new j(H(i)):void 0),n&&!i&&r.children.length===0){this.mergeStack();return}return this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let n=this.moveToNextToken,r=n;if(!F(r,40)){this.popStack();return}let i=this.moveToNextToken;if(r=i,!F(r,2)){this.popStack();return}if(n&&!nn(n,i)){let l=new j(H(n,i));this._issues.push(z(29,l))}let s=this.processNodePath(),o=new Ln(s??null),a=this.currentToken??this.prevToken,c=a;return s?.children.forEach((l,u)=>{if(u===s?.children.length-1&&l&&c&&!nn(l.lastToken,c)){this._issues.push(z(29,new j(H(l.lastToken,c))));return}if(u===0&&i&&!nn(i,l?.firstToken)){this._issues.push(z(29,new j(H(i,l?.firstToken))));return}let d=s?.children[u+1];l&&d&&!nn(l.lastToken,d.firstToken)&&this._issues.push(z(29,new j(H(l.lastToken,d?.firstToken))))}),F(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(z(3,new j(H(this.prevToken)))),o.firstToken=n,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(n=>n instanceof fi)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var jo=K(J());var kR=require("fs");var NR=require("path"),yf=class t{constructor(e,n){this.settings=e;this.bindingLoader=n;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let r={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,NR.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=r.overlays,this.overlays.filter(kR.existsSync),this.parser=new fc(r.dtsFile,r.includePaths),this.ctxNames_.add(r.ctxName),this.id=li(r),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(i=>new fc(i,r.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,n=i=>({file:i,includes:(e.get(i)??[]).map(s=>n(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:n(this.parser.uri),overlays:this.overlays.map(n)}}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(n=>oe(n,e))}getUriParser(e){let n=this.overlayParsers.find(r=>r.getFiles().some(i=>oe(i,e)));return n??=this.parser.getFiles().some(r=>oe(r,e))?this.parser:void 0,n}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,n){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>oe(s.ast.uri,e)&&(!n||Kn(s.ast,e,n))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof Le&&l.compatible===o.value.value);return c?{range:te(o.value),target:pe(c.bindingsPath)}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>oe(s.uri,e)&&(!n||Kn(s,e,n))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:te(s.path),target:pe(o)}}).filter(s=>s)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let n=s=>[...s.property,...s.nodes.flatMap(n)],r=n(e.rootNode),i=e.rootNode.allDescendantsLabels;r.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof de){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,jo.DiagnosticSeverity.Error,[],[],[o.value]))}else o instanceof di&&this.linkNodePath(o,e.rootNode)}))}linkNodePath(e,n){let r=n,i=e.pathParts;for(let s=0;s<i.length&&i[s];s++){let o=!1,a=i[s];if(a){let c=r?.getNode(a.name,a.fullAddress,!1);a.linksTo=c,!o&&!c&&(o=!0,this._issues.push(qt(8,a,jo.DiagnosticSeverity.Error,[],[],[a.toString(),`${e.pathParts.filter(l=>l?.linksTo).map(l=>l?.toString()).join("/")}`]))),c?.linkedNodeNamePaths.push(a),r=c}else break}}async reevaluate(e){let n=this.getUriParser(e);return n?(this.sortKeys=new WeakMap,await n.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 n=new qo(this);this._issues=[],this.processRoot(this.parser.rootDocument,n);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,n);return n.includes=this.parser.includes,n.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof gr),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,i)=>this.sortKeys.set(r,i)),this.linkPropertiesLabelsAndNodePaths(n),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),n}processRoot(e,n){for(let r=0;r<e.children.length;r++){let i=e.children[r];this.processChild(i,n.rootNode,n)}}processChild(e,n,r){e instanceof bt?this.processDtcBaseNode(e,n,r):e instanceof Xe?this.processDtcProperty(e,n,r):e instanceof _n?this.processDeleteNode(e,n,r):e instanceof at&&this.processDeleteProperty(e,n,r)}checkNodeUniqueNames(e,n){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.fullAddress===void 0||qr(c.address,a.fullAddress)===0)),i=n.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof Ie&&o.name)r(s.map(a=>({name:a.name,address:a.fullAddress})),o.name)&&this._issues.push(qt(2,o.name)),s.push(o.name);else if(o instanceof _n&&o.nodeNameOrRef instanceof xe){let a=o.nodeNameOrRef;r(i,a)&&(s=s.filter(c=>r(s.map(l=>({name:l.name,address:l.fullAddress})),c)))}})}processDtcBaseNode(e,n,r){e instanceof mt?this.processDtcRootNode(e,r):e instanceof Ie?this.processDtcChildNode(e,n,r):e instanceof jt&&this.processDtcRefNode(e,r)}processDtcRootNode(e,n){n.roots.push(e),n.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,n.rootNode),[...e.children].forEach(r=>this.processChild(r,n.rootNode,n))}processDtcChildNode(e,n,r){if(e.name?.name){let i=e.path?r.resolvePath(e.path):void 0,o=(i?r.rootNode.getChild(i):void 0)??new ke(this.bindingLoader,e.name.name,e.name.fullAddress,n);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),n=o,this.checkNodeUniqueNames(e,o)}[...e.children].forEach(i=>this.processChild(i,n,r))}processDtcRefNodeLabelRef(e,n,r){let i,s=e.resolveNodePath??(e.pathName?r.resolvePath([e.pathName]):void 0);return s?(e.resolveNodePath??=[...s],i=r.rootNode.getChild(s),n.linksTo=i,e.labels.forEach(o=>o.lastLinkedTo=i),i?.linkedRefLabels.push(n),i?.referencedBy.push(e),e.labels.forEach(o=>{r.labelsUsedCache.set(o.label.value,s)}),i?(r.references.push(e),this.checkNodeUniqueNames(e,i)):r.unlinkedRefNodes.push(e)):(this._issues.push(qt(3,n,jo.DiagnosticSeverity.Error,[],[],[n.label?.value??""])),r.unlinkedRefNodes.push(e)),i}processDtcRefNodeNodePathRef(e,n,r){let i;n.path&&this.linkNodePath(n.path,r.rootNode);let o=n.path?.pathParts.at(-1)?.linksTo?.path;return o?(e.resolveNodePath??=o,i=r.rootNode.getChild(o),e.labels.forEach(a=>a.lastLinkedTo=i),i?.referencedBy.push(e),e.labels.forEach(a=>{r.labelsUsedCache.set(a.label.value,o)}),i?(r.references.push(e),this.checkNodeUniqueNames(e,i)):r.unlinkedRefNodes.push(e)):r.unlinkedRefNodes.push(e),i}processDtcRefNode(e,n){let r;e.reference?e.reference instanceof de?r=this.processDtcRefNodeLabelRef(e,e.reference,n):r=this.processDtcRefNodeNodePathRef(e,e.reference,n):n.unlinkedRefNodes.push(e),[...e.children].forEach(i=>this.processChild(i,r??new ke(this.bindingLoader,""),n))}processDtcProperty(e,n,r){e.propertyName?.name&&n.addProperty(new Ve(e,n)),e.children.forEach(i=>this.processChild(i,n,r))}processDeleteNode(e,n,r){if(e.nodeNameOrRef instanceof xe&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!n.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(qt(5,e.nodeNameOrRef));else{n.deletes.push(e);let i=n.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=i,n.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),i?.labels.forEach(s=>{r.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof de&&e.nodeNameOrRef.value){let i=r.resolvePath([`&${e.nodeNameOrRef.value}`]),s;i?(s=r.rootNode.getChild(i),n.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{r.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof bt&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(qt(3,e.nodeNameOrRef,jo.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Ln&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(i=>!i)){let i=r.rootNode,s=e.nodeNameOrRef.path.pathParts;for(let l=0;l<s.length&&s[l];l++){let u=s[l];if(u){let d=i?.getNode(u.name,u.fullAddress,!1);u.linksTo=d,d?.linkedNodeNamePaths.push(u),i=d}}let o=e.nodeNameOrRef.path.pathParts.every(l=>l),a=e.nodeNameOrRef.path.pathParts.find(l=>l&&!l.linksTo),c=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;c||(r.unlinkedDeletes.push(e),a&&this._issues.push(qt(8,a,jo.DiagnosticSeverity.Error,[],[],[a.toString(),`${e.nodeNameOrRef.path.pathParts.filter(l=>l?.linksTo).map(l=>l?.toString()).join("/")}`]))),n.deletes.push(e),c?.labels.forEach(l=>{r.labelsUsedCache.delete(l.label.value)}),c?.parent?.deleteNode(c.name,e,c.address),e.parentNode instanceof bt&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(i=>this.processChild(i,n,r))}processDeleteProperty(e,n,r){e.propertyName?.name&&!n.hasProperty(e.propertyName.name)?this._issues.push(qt(1,e.propertyName)):e.propertyName?.name&&(n.deletes.push(e),n.deleteProperty(e.propertyName.name,e)),e.children.forEach(i=>this.processChild(i,n,r))}static#e(e,n,r){let i=r.get(n);i||(i=[],r.set(n,i)),i.push(e)}async getDiagnostics(){let e=new Map;try{return(await this.getAllParsers()).forEach(i=>{i.issues.forEach(s=>t.#e(s.diagnostic(),s.raw.astElement.uri,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(n){throw console.error(n),n}}async toFullString(){return`/dts-v1/;
|
|
281
|
-
${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}async serialize(){return(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var Et=K(J());var
|
|
278
|
+
`)&&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==="?"}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 n=this.lineNumber;if(!this.move()||this.lineNumber!==n)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 n=e,r;for(;this.currentChar!==e;){if(this.currentChar===`
|
|
279
|
+
`){let a=this.lineNumber,c=this.columnNumber,l=n.length;this.pushToken({tokens:[21],value:n,pos:{col:c-l,line:a,len:l,colEnd:c},adjacentToken:r}),r=this._tokens.at(-1),n=""}else if(this.currentChar==="\\"){let a=this.lineNumber;if(n+=this.currentChar??"",this.move())a===this.lineNumber&&(n+=this.currentChar??"");else break}else n+=this.currentChar??"";if(!this.move())break}n+=e;let i=this.lineNumber,s=this.columnNumber+1,o=n.length;this.pushToken({tokens:[21],value:n,pos:{col:s-o,line:i,len:o,colEnd:s},adjacentToken:r}),this.move()}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let n=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(!n)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let r=this._tokens.at(-1);return n&&!r?.tokens.some(i=>i===21)&&r&&r.pos.len<e.length?this.process(e.slice(r.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let n={...e,uri:this.uri},r=this._tokens.at(-1);n.prevToken=r,r&&(r.nextToken=n),this._tokens.push(n)}isLetters(e){let n=e.match(/^[A-Za-z]+/);return n?.[0]?(this.pushToken({tokens:[47],value:n?.[0],pos:this.generatePos(e,n?.[0])}),!0):!1}isDigit(e){let n=e.match(/^[0-9]/);return n?.[0]?(this.pushToken({tokens:[20,19],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isHexDigit(e){let n=e.match(/^[A-Fa-f]/);return n?.[0]?(this.pushToken({tokens:[20,47],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isCurlyOpen(e){let n="{";return e===n?(this.pushToken({tokens:[2],pos:this.generatePos(e,n),value:"{"}),!0):!1}isCurlyClose(e){let n="}";return e===n?(this.pushToken({tokens:[3],pos:this.generatePos(e,n),value:"}"}),!0):!1}isSemicolon(e){let n=";";return e===n?(this.pushToken({tokens:[1],pos:this.generatePos(e,n),value:n}),!0):!1}isColon(e){let n=":";return e===n?(this.pushToken({tokens:[50],pos:this.generatePos(e,n),value:n}),!0):!1}isHash(e){let n="#";return e.startsWith(n)?(this.pushToken({tokens:[46],pos:this.generatePos(e,n),value:n}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let n="=";return e===n?(this.pushToken({tokens:[0],pos:this.generatePos(e,n),value:n}),!0):!1}isGtSym(e){let n=">";return e===n?(this.pushToken({tokens:[4],pos:this.generatePos(e,n),value:n}),!0):!1}isLtSym(e){let n="<";return e===n?(this.pushToken({tokens:[5],pos:this.generatePos(e,n),value:n}),!0):!1}isLogicalNot(e){let n="!";return e===n?(this.pushToken({tokens:[6],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseOr(e){let n="|";return e===n?(this.pushToken({tokens:[8],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseXOr(e){let n="^";return e===n?(this.pushToken({tokens:[9],pos:this.generatePos(e,n),value:n}),!0):!1}isAmpersand(e){let n="&";return e===n?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseNot(e){let n="~";return e===n?(this.pushToken({tokens:[10],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundOpen(e){let n="(";return e===n?(this.pushToken({tokens:[42],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundClose(e){let n=")";return e===n?(this.pushToken({tokens:[43],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareOpen(e){let n="[";return e===n?(this.pushToken({tokens:[11],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareClose(e){let n="]";return e===n?(this.pushToken({tokens:[12],pos:this.generatePos(e,n),value:n}),!0):!1}isComma(e){let n=",";return e===n?(this.pushToken({tokens:[24],pos:this.generatePos(e,n),value:n}),!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 n=e.match(/^["']/);return n?.[0]?(this.rewind(e.slice(1)),this.getString(n[0]),!0):!1}isForwardSlash(e){let n="/";return e===n?(this.pushToken({tokens:[13],pos:this.generatePos(e,n),value:"/"}),!0):!1}isBackSlash(e){let n="\\";return e===n?(this.pushToken({tokens:[14],pos:this.generatePos(e,n),value:"\\"}),!0):!1}isAddOperator(e){let n="+";return e===n?(this.pushToken({tokens:[15],pos:this.generatePos(e,n),value:n}),!0):!1}isQuestionMark(e){let n="?";return e===n?(this.pushToken({tokens:[44],pos:this.generatePos(e,n),value:n}),!0):!1}isPeriod(e){let n=".";return e===n?(this.pushToken({tokens:[45],pos:this.generatePos(e,n),value:n}),!0):!1}isNegateOperator(e){let n="-";return e===n?(this.pushToken({tokens:[16],pos:this.generatePos(e,n),value:n}),!0):!1}isUnderScore(e){let n="_";return e===n?(this.pushToken({tokens:[48],pos:this.generatePos(e,n),value:n}),!0):!1}isAt(e){let n="@";return e===n?(this.pushToken({tokens:[49],pos:this.generatePos(e,n),value:n}),!0):!1}isMultiplicationOperator(e){let n="*";return e===n?(this.pushToken({tokens:[17],pos:this.generatePos(e,n),value:n}),!0):!1}isModulusOperator(e){let n="%";return e===n?(this.pushToken({tokens:[18],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefine(e){let n="#define";return e.toLowerCase()===n?(this.pushToken({tokens:[25],pos:this.generatePos(e,n),value:n}),!0):!1}isCInclude(e){let n="#include";return e.toLowerCase()===n?(this.pushToken({tokens:[26],pos:this.generatePos(e,n),value:n}),!0):!1}isCLine(e){let n="#line";return e.toLowerCase()===n?(this.pushToken({tokens:[27],pos:this.generatePos(e,n),value:n}),!0):!1}isCUndef(e){let n="#undef";return e.toLowerCase()===n?(this.pushToken({tokens:[28],pos:this.generatePos(e,n),value:n}),!0):!1}isCError(e){let n="#error";return e.toLowerCase()===n?(this.pushToken({tokens:[29],pos:this.generatePos(e,n),value:n}),!0):!1}isCPragma(e){let n="#pragma";return e.toLowerCase()===n?(this.pushToken({tokens:[30],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefined(e){let n="#defined";return e.toLowerCase()===n?(this.pushToken({tokens:[31],pos:this.generatePos(e,n),value:n}),!0):!1}isCIf(e){let n="#if";return e.toLowerCase()===n?(this.pushToken({tokens:[32],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfDef(e){let n="#ifdef";return e.toLowerCase()===n?(this.pushToken({tokens:[33],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfNDef(e){let n="#ifndef";return e.toLowerCase()===n?(this.pushToken({tokens:[34],pos:this.generatePos(e,n),value:n}),!0):!1}isCElIf(e){let n="#elif";return e.toLowerCase()===n?(this.pushToken({tokens:[35],pos:this.generatePos(e,n),value:n}),!0):!1}isCElse(e){let n="#else";return e.toLowerCase()===n?(this.pushToken({tokens:[36],pos:this.generatePos(e,n),value:n}),!0):!1}isCEndIf(e){let n="#endif";return e.toLowerCase()===n?(this.pushToken({tokens:[37],pos:this.generatePos(e,n),value:n}),!0):!1}isCTrue(e){let n="true";return e==n?(this.pushToken({tokens:[38],value:n,pos:this.generatePos(e,n)}),!0):!1}isCFalse(e){let n="false";return e==n?(this.pushToken({tokens:[39],value:n,pos:this.generatePos(e,n)}),!0):!1}generatePos(e,n){let r=this.columnNumber-e.length;return{line:this.lineNumber,col:r,len:n.length,colEnd:r+n.length}}};var ct=class extends j{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var iy=require("fs"),qo=require("path");var SR=K(J());var Ot=class extends tt{constructor(n,r){super(r);this.name=n;this.docSymbolsMeta={name:this.name.toString(),kind:SR.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var af=class extends j{constructor(n,r){super(r);this.operator=n;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var _R=K(J());var cf=class extends ct{toString(){return"..."}},zr=class extends j{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(n){return se(this.uri,n)?[{name:this.functionName.name,kind:_R.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r.getDocumentSymbols(n))}]:[]}toString(){return`${this.functionName}(${this.params.map(n=>n.toString()).join(",")})`}};var Ui=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,n=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||!se(this.currentToken?.uri,e.uri))return;let i=this.currentToken,s=i;for(;this.currentToken?.pos.line===r&&se(this.currentToken?.uri,e.uri);)s=this.moveToNextToken;if(n){let o=new j(H(i,s));this._issues.push(z(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(),n=this.positionStack.pop();if(n===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=n}peekIndex(e=1){let n=this.positionStack.at(-1*e);if(n===void 0)throw new Error("Index out of bounds");return n}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 n=[];return e.every(r=>{let i=this.currentToken,s=r(i),o=!1;return s!=="no"&&i&&(n.push(i),this.moveToNextToken,o=zt(i,this.currentToken)),s==="yes"&&o}),this.mergeStack(),n}consumeAnyConcurrentTokens(e){this.enqueueToStack();let n=[],r,i=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&i);)n.push(this.currentToken),r=this.currentToken,this.moveToNextToken,i=zt(r,this.currentToken);return this.mergeStack(),n}getDocumentSymbols(e){return this.allAstItems.flatMap(n=>n.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,n){let r=[],i=(s,o,a)=>{if(!a?.start||!a?.end||!se(a.start.uri,n)||!se(a.end.uri,n))return;let c=a.end.pos.colEnd-a.start.pos.col;r.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)}),r.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,n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!r.length){this.popStack();return}let i=r.map(o=>o.value).join("");if(!i.match(/^[_A-Za-z]/)){this.popStack();return}let s=new Ot(i,H(r[0],r.at(-1)));return!n&&s.name!=="defined"&&(e.get(s.name)||this._issues.push(z(42,s))),this.mergeStack(),s}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let n=e,r;if(F(e,40)?(r="&",F(this.currentToken,40)&&(r="&&",n=this.moveToNextToken)):F(e,10)?(r="!",F(this.currentToken,0)&&(r="!=",n=this.moveToNextToken)):F(e,8)?(r="|",F(this.currentToken,8)&&(r="||",n=this.moveToNextToken)):F(e,9)?r="^":F(e,4)?(r=">",F(this.currentToken,4)?(r="<<",n=this.moveToNextToken):F(this.currentToken,0)&&(r=">=",n=this.moveToNextToken)):F(e,5)?(r="<",F(this.currentToken,5)?(r=">>",n=this.moveToNextToken):F(this.currentToken,0)&&(r="<=",n=this.moveToNextToken)):F(e,15)?r="+":F(e,16)?r="-":F(e,17)?r="*":F(e,13)?r="/":F(e,18)?r="%":F(e,46)?F(this.currentToken,46)&&(r="##",n=this.moveToNextToken):F(e,0)&&F(this.currentToken,0)&&(r="==",n=this.moveToNextToken),r){let i=new af(r,H(e,n));return this.mergeStack(),i}this.popStack()}parseScopedBlock(e,n,r){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(p=>"items"in p?a(p.items):p),c=[i],l=[],u=[];u[0]={rewind:o,tokens:[]};let d=this.currentToken;for(;d&&!n(d);){if(r?.(d)){let y=this.peekIndex()+1,p=()=>{this.positionStack[this.positionStack.length-1]=y};c.push(d),l.push(d),u[u.length]={rewind:p,tokens:[]}}else if(e(d)){let y=this.parseScopedBlock(e,n,r);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&&n(f)&&(this.moveToNextToken,c.push(f));let h={startToken:i,items:c,splitTokens:u,endToken:f,separatorTokens:l};return this.mergeStack(),h}isFunctionCall(e){this.enqueueToStack(),this.currentToken?.value==="\\"&&this.currentToken.pos.line!==this.currentToken.nextToken?.pos.line&&this.moveToNextToken;let n=this.processCIdentifier(e,!1);if(!n){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}if(n.name==="defined")r.length>1?this._issues.push(z(44,n)):r.length<1&&this._issues.push(z(45,n));else{let s=e.get(n.name)?.macro;s&&(s?.identifier instanceof zr?r.length>s.identifier.params.length?this._issues.push(z(44,n,void 0,[s])):r.length<s.identifier.params.length&&this._issues.push(z(45,n,void 0,[s])):this._issues.push(z(43,n)))}let i=new jr(n,r);return i.lastToken=this.prevToken,this.mergeStack(),i}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([Xe("0"),Xe("x",!0)]);if(e.length!==2){this.popStack();return}let n=this.consumeAnyConcurrentTokens([19,20].map(Ie));if(!n.length){this.popStack();return}let r=Number.parseInt(n.map(s=>s.value).join(""),16),i=new Wt(r,H(e[0],n.at(-1)));return this.mergeStack(),i}processDec(e=!1){this.enqueueToStack();let n;e&&(F(this.currentToken,16)||F(this.currentToken,15))&&zt(this.currentToken,this.currentToken?.nextToken)&&(n=this.moveToNextToken);let r=this.consumeAnyConcurrentTokens([19].map(Ie));if(!r.length){this.popStack();return}let i=Number.parseInt(r.map(o=>o.value).join(""),10);n&&F(n,16)&&(i=4294967295-i);let s=new Wt(i,H(n??r[0],r.at(-1)));return this.mergeStack(),s}processEnclosedExpression(e){this.enqueueToStack(),this.currentToken?.value==="\\"&&this.currentToken.pos.line!==this.currentToken.nextToken?.pos.line&&this.moveToNextToken;let n,r;if(F(this.currentToken,42)){let i;n=this.moveToNextToken,r=n;let s=this.processExpression(e,!0);return s&&(i=new ui(s,!0),s=new ui(i,!1),i.openBracket=n),F(this.currentToken,43)?(r=this.moveToNextToken,i&&(i.closeBracket=r)):this._issues.push(z(26,new j(H(n)))),this.mergeStack(),s}this.popStack()}processExpression(e,n=!1){this.enqueueToStack();let r;if(r=this.processEnclosedExpression(e)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(!0),!r){this.popStack();return}if(n){let i=this.isOperator();for(;i;){let s=this.processExpression(e);s?r instanceof ui?r.addExpression(i,s):r=new ui(r,!1,{operator:i,expression:s}):this._issues.push(z(27,i)),i=this.isOperator()}}return this.mergeStack(),r}processMacroCallParams(){if(!F(this.currentToken,42))return;let e=this.parseScopedBlock(r=>!!F(r,42),r=>!!F(r,43),r=>!!F(r,24));return e?.items.length===2&&F(e.endToken,43)?[]:e?.splitTokens.map((r,i)=>{if(r.tokens.length===0)return null;let s=new qr(r.tokens.map((o,a)=>{let c=o.value;return o.pos.line===r.tokens.at(a+1)?.pos.line?c=c.padEnd(r.tokens[a+1].pos.col-o.pos.col," "):o.value==="\\"&&(c=c.slice(0,-1)),c}).join(""),H(r.tokens[0],r.tokens.at(-1)),i);return s.splitToken=e.separatorTokens.at(i),s})}};var lf=class t extends Ui{constructor(n){super();this.uri=n;this.comments=[];this.tokens=[]}cleanUpComments(){let n=[];for(let r=0;r<this.tokens.length;r++){let i=t.processBlockComment(this.tokens,r)||t.processLineComment(this.tokens,r);i&&(r=i.index,n.push(...i.tokenUsed),this.comments.push(i.comment))}n.reverse().forEach(r=>this.tokens.splice(r,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=qn().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComment(n,r){let i=[],s=()=>(i.push(r++),n[r]),o=()=>n[r],a=()=>n[r-1],c=o(),l=c;if(!c||!F(c,13)||(l=s(),!F(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!F(a(),17)||!F(o(),13)||!zt(a(),o())),d=l.pos.line,f=c,h=[];l=s();do{if(o()?.pos.line!==d){let T=new Jn(H(f,a()));h.push(T),d=o().pos.line??0,f=o()}l=s()}while(r<n.length&&!u());let y=new Jn(H(f,o()));h.push(y);let p=new Xn(h);return s(),{comment:p,tokenUsed:i,index:r-1}}static processLineComment(n,r){let i=[];if(!F(n[r],13)||n.length===r+1||!F(n[r+1],13)||!zt(n[r],n[r+1]))return;for(;n[r].pos.line===n.at(r+1)?.pos.line;)i.push(r++);return i.push(r++),{comment:new Jn(H(n[i[0]],n[i.at(-1)])),tokenUsed:i,index:r-1}}};var ER=K(J()),uf=class extends j{constructor(n,r){super(n);this.content=r}toString(){let n=this.content.filter(r=>!F(r,14));return n.map((r,i)=>{let s=r.value;return r.pos.line===n.at(i+1)?.pos.line?s=s.padEnd(n[i+1].pos.col-r.pos.col," "):n.at(i+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},lc=class extends j{constructor(n,r,i){super();this.keyword=n;this.identifier=r;this.content=i;this.addChild(n),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ot?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:ER.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
280
|
+
`)}}};var Ns=class extends j{constructor(e){super(e)}},uc=class extends j{constructor(n,r){super();this.keyword=n;this.content=r;this.active=!1;this.addChild(n)}},dc=class extends uc{constructor(n,r,i){super(n,i);this.identifier=r;this.addChild(r),this.addChild(i)}useBlock(n){return this.identifier&&n.has(this.identifier.name)}},df=class extends uc{constructor(n,r,i){super(n,i);this.expression=r;this.addChild(r),this.addChild(i)}useBlock(n){return this.expression instanceof jr?this.expression.functionName.name==="defined"?this.expression&&n.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(n):this.expression?.isTrue(n)}},ff=class extends dc{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},fc=class extends uc{};var $o=class extends j{constructor(n,r,i){super();this.ifDef=n;this.endIf=r;this.elseOption=i;this.addChild(n),i&&this.addChild(i),this.addChild(r)}getInValidTokenRange(n,r){let i=[],s=a=>r.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(n);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}},Vi=class extends j{constructor(n,r,i){super();this.ifBlocks=n;this.endIf=r;this.elseOption=i;n.forEach(s=>this.addChild(s)),i&&this.addChild(i),this.addChild(r)}getInValidTokenRange(n,r){let i=[],s=a=>r.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach((a,c)=>{i.push({start:s(a.tokenIndexes.start),end:s(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(n)?(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 hc=K(J());var jo=class extends Ui{constructor(n,r,i){super();this.uri=n;this.incudes=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;i&&(Array.from(i).forEach(([s,o])=>this.macroSnapShot.set(s,o)),Array.from(i).forEach(([s,o])=>this.macros.set(s,o)))}get currentToken(){let n=this.prevToken,r=mr(n,this.tokens.at(this.peekIndex()))||!n||F(n,14)&&n.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!r))return this.macroStart&&F(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(n){super.reset(),this.macros.clear(),n?(this.macroSnapShot.clear(),Array.from(n).forEach(([r,i])=>this.macroSnapShot.set(r,i)),Array.from(n).forEach(([r,i])=>this.macros.set(r,i))):Array.from(this.macroSnapShot).forEach(([r,i])=>this.macros.set(r,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(n){let r=this.stable;return this.parsing=new Promise(i=>{r.then(()=>{if(n&&n.size===this.macroSnapShot.size){let s=Array.from(n);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(n),this.parse().then(i)})}),this.parsing}async parse(){let n=new lf(this.uri);if(await n.stable,this.tokens=n.tokens,this.nodes.push(...n.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||!se(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let r=this.currentToken,i=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!F(r,25))return this.popStack(),!1;this.macroStart=!0;let i=new ct(H(r)),s=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(z(30,i)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new uf(H(o[0],o.at(-1)),o));let c=new lc(i,s,a);this.macros.set(c.name,{macro:c,resolver:gN(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(n,l-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!F(r,28))return this.popStack(),!1;this.macroStart=!0;let i=new ct(H(r)),s=this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(z(30,i)),this.mergeStack(),this.macroStart=!1,!0;let o=new lc(i,s);this.macros.delete(s.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(n,a-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let n=[];for(;this.currentToken;){let r=this.moveToNextToken;r&&n.push(r)}return n}isFunctionDefinition(){this.enqueueToStack();let n=this.processCIdentifier(this.macros,!0);if(!n){this.popStack();return}let r=this.moveToNextToken;if(!F(r,42)||!zt(n.lastToken,r)){this.popStack();return}let i=[],s=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;s;)i.push(s),!F(this.currentToken,24)&&!F(this.currentToken,43)?this._issues.push(z(28,s)):F(this.currentToken,43)||(r=this.moveToNextToken),s=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new zr(n,i);return F(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(z(26,i.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(45),Ie(45),Ie(45)]);if(n.length!==3){this.popStack();return}let r=new cf(H(n[0],n.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let n=this.peekIndex(),r=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>F(o,a))&&!mr(o.prevToken,o),o=>!!o&&[37].some(a=>F(o,a))&&!mr(o.prevToken,o),o=>!!o&&[36,35].some(a=>F(o,a))&&!mr(o.prevToken,o));if(!r)return;let i;F(r.startToken,32)?i=this.processIfBlock(r,(o,a,c)=>new df(o,a??null,c)):i=this.processIfDefBlock(r,(o,a,c)=>F(r.startToken,33)?new dc(o,a??null,c):new ff(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 Vi?i.ifBlocks:[i.ifDef],...i.elseOption?[i.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(z(47,o.content,hc.DiagnosticSeverity.Hint,[],[hc.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=n}processIfDefBlock(n,r){this.enqueueToStack(),this.macroStart=!0;let i=new ct(H(n.startToken));n.splitTokens[0].rewind();let s=this.processCIdentifier(this.macros,!0);s||this._issues.push(z(31,i)),this.macroStart=!1;let o,a=s?.lastToken.nextToken??i.lastToken.nextToken;a&&n.splitTokens[0].tokens.find(f=>f===a)&&(o=new Ns(H(a,n.splitTokens[0].tokens.at(-1))));let c=r(i,s??null,o??null),l;if(n.splitTokens.length>1){let f=n.splitTokens[1].tokens[0].prevToken,h=new ct(H(f)),y;n.splitTokens[1].tokens.length&&(y=new Ns(H(n.splitTokens[1].tokens[0],n.splitTokens[1].tokens.at(-1)))),l=new fc(h,y??null)}let u;n.endToken?u=new ct(H(n.endToken)):this._issues.push(z(46,i));let d=new $o(c,u??null,l);return this.mergeStack(),d}processIfBlock(n,r){this.enqueueToStack();let i=new ct(H(n.startToken)),s=[],o;n.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new ct(H(d));this.macroStart=!0;let h=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===n.splitTokens.length-1&&F(d,36)){let p=d,T=new ct(H(p)),_;l.tokens.length&&(_=new Ns(H(l.tokens[0],l.tokens.at(-1)))),o=new fc(T,_??null)}else{h||this._issues.push(z(31,i));let p,T=h?.lastToken.nextToken??i.lastToken.nextToken;T&&l.tokens.find(v=>v===T)&&(p=new Ns(H(T,n.splitTokens[u].tokens.at(-1))));let _=r(f,h??null,p??null);s.push(_)}});let a;n.endToken?a=new ct(H(n.endToken)):this._issues.push(z(46,i));let c=new Vi(s,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(n){if(n.path.path)return n.path.relative?[(0,qo.resolve)((0,qo.dirname)(n.uri),n.path.path),...this.incudes.map(r=>(0,qo.resolve)(r,n.path.path))].find(r=>(0,iy.existsSync)(r)):this.incudes.map(r=>(0,qo.resolve)(r,n.path.path)).find(r=>(0,iy.existsSync)(r))}async processInclude(){this.enqueueToStack();let n=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let i=r,s=r;if(F(r,26))this.moveToNextToken;else{let p=this.checkConcurrentTokens([Ie(13),Xe("include"),Ie(13)]);if(p.length!==3)return this.popStack(),!1;i=p[0],s=p.at(-1)}let o=i,a=new ct(H(i,s));r=this.moveToNextToken;let c=r,l=!!F(r,21);if(!c||!l&&!F(r,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=r?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!F(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new Do(u,l,H(c,r)),f=new pi(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!F(this.currentToken,4)?this._issues.push(z(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let h=this.peekIndex(),y=this.resolveInclude(f);if(f.resolvedPath=y,y||this._issues.push(z(36,f.path,hc.DiagnosticSeverity.Warning)),y){qn().requestTokens(y,!0);let p=await pc().getCPreprocessorParser(y,this.incudes,this.macros,this.uri);await p.stable,this._issues.push(...p.issues),this.macros.clear(),Array.from(p.macros).forEach(([T,_])=>this.macros.set(T,_)),y.endsWith(".h")?this.tokens.splice(n,h-n):this.tokens.splice(n,h-n,...p.tokens),this.nodes.push(...p.nodes),this.dtsIncludes.push(...p.dtsIncludes)}else this.tokens.splice(n,h-n);return this.positionStack[this.positionStack.length-1]=n,!0}};var sy,hf=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,n,r,i){e=nt(e);let s=`${Array.from(r).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(s);if(o)return o.reparse(r),o;console.log("No cpreprocess cache",e);let a=new jo(e,n,r),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=nt(e);let n=this.headerFiles.get(e);n&&Array.from(n).forEach(r=>{r[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(r[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function pc(){return sy??=new hf,sy}function kR(){sy=new hf}var oy,pf=class t{constructor(){this.fileMap=new Map}static clone(e){let n=e.map(r=>({...r}));return n.forEach((r,i)=>{r.prevToken=n[i-1],r.nextToken=n[i+1]}),n}needsRenew(e,n){return e=nt(e),this.fileMap.get(e)?.text!==n}getDocument(e){return Po.create(e,"devicetree",0,this.fileMap.get(e)?.text??(0,mc.readFileSync)(e).toString())}renewLexer(e,n){if(e=nt(e),pc().reset(e),!e||!(0,mc.existsSync)(e))return[];try{n??=(0,mc.readFileSync)(e).toString();let r=new of(n,e);return this.fileMap.set(e,r),t.clone(r.tokens)}catch{}return[]}requestTokens(e,n){e=nt(e);let r=this.fileMap.get(e)?.tokens;return!r&&n?[...this.renewLexer(e)]:t.clone(r??[])}reset(e){e=nt(e),pc().reset(e),this.fileMap.delete(e)}};function qn(){return oy??=new pf,oy}function wR(){oy=new pf}var Fo=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new we(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let n=this.fileTopMostAstCache.get(e);if(n)return n;let r=[...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,r),r}getDeepestAstNode(e,n){let i=this.fileTopMostAsts(e).find(s=>Kn(s,e,n)||pN(qn().requestTokens(e,!1),s,n));if(i instanceof jt){let o=this.rootNode.getReferenceBy(i)?.getDeepestAstNode(e,n);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Br(i,e,n)}}else if(i instanceof gt&&i.path){let s=this.rootNode.getDeepestAstNode(e,n);return s?{...s,runtime:this}:void 0}else if(i instanceof xe&&i.path){let s=t.getNodeFromPath(i.path.slice(1),this.rootNode)?.getDeepestAstNode(e,n);return s?{...s,runtime:this}:void 0}else if(i)return{runtime:this,item:null,ast:Br(i,e,n)}}static getNodeFromPath(e,n,r=!0){if(e.length===0)return n;let i=e[0].split("@"),s=i[0],a=i.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=n.getNode(s,a,r);return l?t.getNodeFromPath(c,l,r):void 0}resolvePath(e,n){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(n??=this.rootNode.allDescendantsLabels,n.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof mt)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],n=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{n.has(r.label.label.value)?n.get(r.label.label.value)?.push(r):n.set(r.label.label.value,[r])}),Array.from(n).forEach(r=>{let i=r[1];if(i.length>1){let s=i.find(a=>a.owner instanceof we);(!i.every(a=>a&&a.owner===s?.owner)||!s)&&e.push(qt(4,i.at(0).label,NR.DiagnosticSeverity.Error,i.slice(1).map(a=>a.label),[],[i.at(0).label.label.value]))}}),e}get typesIssues(){let e=n=>[...n.nodeType?.getIssue(this,n)??[],...n.nodes.flatMap(r=>e(r))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return mN([...e.definitions,...e.referencedBy],this.context)}};var PR=K(J()),mf=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Values",kind:PR.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(n=>n?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(n=>n?.toJson())}};var RR=K(J()),gf=class extends j{constructor(n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:"DTS Document version",kind:RR.SymbolKind.Function}}};var Wr=class extends j{constructor(n,r){super();this.value=n;this.labels=r;this.labels.forEach(i=>{this.addChild(i)}),this.addChild(this.value)}toString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toString(n)??"NULL"}`}toPrettyString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toPrettyString(n)??"NULL"}`}};var CR=K(J()),yf=class extends j{constructor(n,r,i){super();this.keyword=n;this.startAddress=r;this.endAddress=i;this.addChild(n),this.docSymbolsMeta={name:"Memreserve",kind:CR.SymbolKind.Function},this.addChild(r),this.addChild(i)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var DR=K(J()),vf=class extends j{constructor(n,r){super();this.keyword=n;this.bitsSize=r;this.addChild(n),this.docSymbolsMeta={name:"bits",kind:DR.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var bf=K(J()),gc=class extends Ui{constructor(n,r,i){super();this.uri=n;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new mt;this.unhandledStatements=new gt;this.cPreprocessorParser=new jo(this.uri,this.incudes,i)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(n=>n.resolvedPath).filter(n=>!!n)]}reset(){super.reset(),this.others=[],this.rootDocument=new mt,this._issues=[],this.unhandledStatements=new gt}async reparse(){let n=performance.now(),r=this.stable;return this.parsing=new Promise(i=>{r.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-n),i()})}),this.parsing}async parse(){let n=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,nt(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 i=this.moveToNextToken;if(i){let s=new j(H(i));this._issues.push(z(22,s)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(i=>{this._issues.push(z(32,i))}),this.unhandledStatements.deleteProperties.forEach(i=>{this._issues.push(z(33,i))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(n){this.enqueueToStack();let r=this.moveToNextToken,i=r,s=13;if(!r||!F(r,s))return this.popStack(),!1;if(i=this.moveToNextToken,s=2,!i||!F(i,s))return this.popStack(),!1;let o=new gt;o.openScope=i,n.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??i;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(n){let r=this.currentToken;if(F(r,3))this.moveToNextToken;else{let i=this.prevToken;if(i){let s=new j(H(i));this._issues.push(z(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(n.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return F(this.currentToken,3)||F(this.currentToken,1)}endStatement(n=!0){let r=this.currentToken;if(!F(r,1)){let i=this.prevToken;if(i&&n){let s=new j(H(this.prevToken));return this._issues.push(z(1,s)),i}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;F(this.currentToken,1);){let n=this.moveToNextToken;if(n){let r=new j(H(n));this._issues.push(z(23,r))}}}processNode(n,r){if(this.done)return!1;let i=!1,s=!1;do{if(s=this.isChildNode(n,r)||this.isProperty(n)||this.isDeleteNode(n,r)||this.isDeleteProperty(n),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new j(H(o));this._issues.push(z(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;i=i||s}while(!this.isNodeEnd());return i}processOptionalLabelAssign(n=!1){let r=[],i=this.isLabelAssign(n);for(;i;)r.push(i),i=this.isLabelAssign(n);return r}isChildNode(n,r){this.enqueueToStack();let i;r==="Name"&&(i=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new jt(s):new xe(s,i);if(r==="Ref"?(this.enqueueToStack(),a=this.processNodePathRef(),!a||!F(this.currentToken,2)?(this.popStack(),a=void 0):this.mergeStack(),a??=this.isLabelRef()):r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!F(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(z(r==="Name"?[7]:[10,48,11],c))}let l=!1;if(a&&c instanceof jt?(c.reference=a,l=!0):o&&c instanceof xe&&(l=o.address!==void 0,c.name=o),F(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(z(2,u))}else return this.popStack(),!1;return n.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let n=this.prevToken;this.enqueueToStack();let r=this.checkConcurrentTokens([Xe("0"),Xe("x",!0)]);r.length!==2?(r=[],this.popStack()):(this._issues.push(z(50,new j(H(r[0],r[1])),bf.DiagnosticSeverity.Warning)),n=r.at(-1),this.mergeStack());let i=this.consumeAnyConcurrentTokens([19,20,48].map(Ie)),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(n){if(o.some(c=>Number.isNaN(c))){let c=new j(H(n));this._issues.push(z(8,c))}else if(!Number.isNaN(o)&&!zt(n,i[0])){let c=new j(H(n,i.at(0)));this._issues.push(z(29,c))}}return this.currentToken?.value.toUpperCase()==="ULL"&&(this._issues.push(z(51,new j(H(this.currentToken)),bf.DiagnosticSeverity.Warning)),this.moveToNextToken),new Za(o,H(r.at(0)??i[0]??this.prevToken,this.prevToken))}processNodeAddresses(n){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(49)]);if(r.length){if(!zt(n.lastToken,r[0])){let a=new j(H(n.lastToken,r[0]));this._issues.push(z(29,a))}let i=[],s=()=>{if(i.push(this.processNodeAddress()),F(this.currentToken,24)){if(this.prevToken&&!zt(this.prevToken,this.currentToken)){let a=new j(H(this.prevToken,this.currentToken));this._issues.push(z(29,a))}this.moveToNextToken,s()}};s();let o=this.currentToken;for(;!F(this.currentToken,2)&&!F(this.currentToken,1)&&!F(this.currentToken,3)&&mr(this.currentToken,i.at(-1)?.lastToken);)this.moveToNextToken;if(o&&o!==this.currentToken){this._issues.push(z(52,new j(H(o,this.currentToken))));let a=new Za([],H(o,this.prevToken));i.push(a)}return this.mergeStack(),i}this.popStack()}isNodeName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Ie));if(!n.length){this.popStack();return}let r=n.map(o=>o.value).join(""),i=new Me(r,H(n[0],n.at(-1))),s=this.processNodeAddresses(i);return i.address=s,r.match(/^[A-Za-z]/)||this._issues.push(z(49,i)),this.mergeStack(),i}isPropertyName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Ie));if(!n.length){this.popStack();return}let r=new He(n.map(i=>i.value).join(""),H(n[0],n.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!n.length){this.popStack();return}let r=n.map(s=>s.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let i=new Ht(r,H(n[0],n.at(-1)));return this.mergeStack(),i}isLabelAssign(n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!r.length){this.popStack();return}let i=r.map(c=>c.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&F(s,50),a=new Bi(new Ht(i,H(r[0],r.at(-1))),H(r[0],o?s:r.at(-1)));if(o){let c=r.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.colEnd)&&this._issues.push(z(29,new j(H(c,s)))),this.moveToNextToken}else if(n)this._issues.push(z(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(),i=this.isPropertyName();if(!i)return this.popStack(),!1;if(F(this.currentToken,2)||F(this.currentToken,49))return this.popStack(),!1;let s=new Ge(i,r),o;F(this.currentToken,0)?(s.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(),o?.values.filter(c=>!!c).length||this._issues.push(z(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,n.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),Xe("d"),Xe("ts"),Ie(16),Xe("v"),Xe("1")]);if(n.length!==6)return this.popStack(),!1;let r=n[0],i=r,s=new ct;s.firstToken=r;let o=new gf(s);if(this.others.push(o),F(this.currentToken,13))i=this.moveToNextToken;else return s.lastToken=n.at(-1),this._issues.push(z(21,o)),this.mergeStack(),!0;return s.lastToken=i,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),Xe("memreserve")]);if(n.length!==2)return this.popStack(),!1;let r=new ct;r.firstToken=n[0];let s=n[0];F(this.currentToken,13)?(s=this.moveToNextToken,r.lastToken=s):(r.lastToken=n.at(-1),this._issues.push(z(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new yf(r,o,a);return this.others.push(c),o||this._issues.push(z(37,r)),a||this._issues.push(z(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),Xe("b"),Xe("its")]);if(n.length!==3){this.popStack();return}let r=new ct;r.firstToken=n[0];let s=n[0];F(this.currentToken,13)?(s=this.moveToNextToken,r.lastToken=s):(r.lastToken=n.at(-1),this._issues.push(z(21,r)));let o=this.processDec(),a=new vf(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(z(40,o)):this._issues.push(z(39,r)),this._issues.push(z(41,a,bf.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),Xe("omit"),Ie(16),Xe("if"),Ie(16),Xe("no"),Ie(16),Xe("ref"),Ie(13)]);if(n.length!==9){this.popStack();return}let r=new ct(H(n[0],n.at(-1)));return this.mergeStack(),r}isDeleteNode(n,r){this.enqueueToStack();let i=this.checkConcurrentTokens([Ie(13),Xe("d"),Xe("e"),Xe("lete"),Ie(16),Xe("node")]);if(!i.length)return this.popStack(),!1;let s=i[0],o=s,a=new ct;if(a.firstToken=s,i.length===1&&!F(this.currentToken,2)){this._issues.push(z(25,a)),a.lastToken=i.at(-1);let d=new En(a);return n.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(z(c.startsWith("/delete-n")?34:25,a)):F(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(z(21,a));let l=new En(a);if(mr(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(z(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(z(7,f));let h=d||f?void 0:this.isNodeName();h&&r==="Ref"&&this._issues.push(z(10,h)),!d&&!h&&!f&&this._issues.push(z([7,10],l)),l.nodeNameOrRef=d??f??h??null}else r==="Name"?this._issues.push(z(7,a)):r==="Ref"&&this._issues.push(z(10,a));let u=this.endStatement();return l.lastToken=u,n.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(n){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(13),Xe("d"),Xe("e"),Xe("lete"),Ie(16),Xe("property")]);if(!r.length)return this.popStack(),!1;let i=r[0],s=i,o=new ct;if(o.firstToken=i,r.length===1&&!F(this.currentToken,2)){this._issues.push(z(25,o)),o.lastToken=r.at(-1);let u=new ot(o);return n.addNodeChild(u),this.mergeStack(),!0}let a=r.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=r.at(-1),a!=="/delete-property"?this._issues.push(z(a.startsWith("/delete-p")?35:25,o)):F(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(z(21,o));let c=new ot(o);if(mr(o.tokenIndexes?.end,i)){let u=this.isPropertyName();u||this._issues.push(z(6,c)),c.propertyName=u??null}else this._issues.push(z(6,o));let l=this.endStatement();return c.lastToken=l,n.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.processNodePathRef();if(!r){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&i.push(...this.processOptionalLabelAssign(!0));let s=new dn(n,r,i);return this.mergeStack(),s}processValue(){this.enqueueToStack();let r=(()=>{let s=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue()||this.arrayValues()||this.processByteStringValue()||this.isExpressionValue())??null,o=s();if(!o)return[];let a=[o];for(;!F(this.currentToken,1);){let c=this.prevToken,l=this.currentToken,u,d=F(this.currentToken,24);if(d)u=this.currentToken,this.moveToNextToken;else if(!mr(this.prevToken,this.currentToken))break;let f=s();if(l&&f===null&&d){let y=new j(H(l,this.currentToken));this._issues.push(z(0,y))}if(!d&&f===null)break;if(c&&!d&&f){let y=new j(H(c));this._issues.push(z(28,y))}let h=a.at(-1);h&&(h.nextValueSeparator??=u),a.push(f)}return a})();if(r.length===0){this.popStack();return}return this.mergeStack(),new mf(r)}processStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.consumeAnyConcurrentTokens([Ie(21)]);if(!r.length){this.popStack();return}if(r.some(l=>!l?.value))throw new Error("Token must have value");let i=r.map(l=>l.value).join(`
|
|
281
|
+
`),s=i;s.match(/["']$/)&&(s=s.slice(1,-1));let o=new Re(s,H(r[0],r.at(-1)));i.match(/["']$/)||this._issues.push(z(i.startsWith('"')?16:17,o));let a=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(a=this.processOptionalLabelAssign(!0));let c=new dn(n,o,a);return this.mergeStack(),c}arrayValues(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.processBits(),i=this.currentToken;if(F(i,5))this.moveToNextToken;else{this.popStack();return}let s=this.processArrayValues()??null;s.openBracket=i;let o=this.processOptionalLabelAssign(!0)??[],a=new dn(n,s,o,r);F(this.currentToken,4)?(s&&(s.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(z(12,a));let c=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(c=this.processOptionalLabelAssign(!0)),this.mergeStack(),a.endLabels.push(...c),a.firstToken=i,a.lastToken=this.prevToken,a}processByteStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,i=r;if(!F(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(z(15,u))});let a=new fi(s??[]);a.openBracket=i,a.values.length===0&&(a.firstToken=r,this._issues.push(z(14,a)));let c=new dn(n,a,o);F(this.currentToken,12)?a.closeBracket=this.moveToNextToken:this._issues.push(z(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=r,a.lastToken=this.prevToken,c}processLabeledValue(n){this.enqueueToStack();let r=n(),i=[];if(!r)return this.popStack(),[];for(;r;)i=[...i,r],r=n();if(i){let s=n();s&&(i=[...i,s])}return this.mergeStack(),i}processArrayValues(){this.enqueueToStack();let n=this.processLabeledValue(()=>this.processRefValue(!1)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),r=new Rt(n);return n.length===0&&(r.firstToken=this.currentToken),this.mergeStack(),r}processLabeledHex(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),i=this.processHex();if(!i){this.popStack();return}let s=new Wr(i,r);return this.mergeStack(),s}processHexString(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(Ie));if(!r.length){this.popStack();return}let i=Number.parseInt(r.map(a=>a.value).join(""),16),s=new Wt(i,H(r[0],r.at(-1))),o=new Wr(s,n);return this.mergeStack(),o}processLabeledDec(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),i=this.processDec();if(!i){this.popStack();return}let s=new Wr(i,r);return this.mergeStack(),s}processLabeledExpression(n=!0,r=n){this.enqueueToStack();let i=[];n&&(i=this.processOptionalLabelAssign(r));let s=this.processExpression(this.cPreprocessorParser.macros);if(!s){this.popStack();return}let o=new Wr(s,i);return this.mergeStack(),o}isExpressionValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.processExpression(this.cPreprocessorParser.macros);if(!r){this.popStack();return}let i=this.processOptionalLabelAssign(!0),s=new dn(n,r,i);return this.mergeStack(),s}isLabelRef(){this.enqueueToStack();let n=this.currentToken;if(!n||!F(n,40)){this.popStack();return}else this.moveToNextToken;let r=this.isLabelName();if(!r){let s=new de(null);return this._issues.push(z(18,new j(H(n)))),s.firstToken=n,this.mergeStack(),s}n&&(r.firstToken.pos.line!==n.pos.line||r.firstToken.pos.col!==n.pos.colEnd)&&this._issues.push(z(29,new j(H(n,r.firstToken))));let i=new de(r);return i.firstToken=n,this.mergeStack(),i}isLabelRefValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.isLabelRef();if(!r){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(i=this.processOptionalLabelAssign(!0));let s=new dn(n,r,i);return this.mergeStack(),s}processRefValue(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),i=this.currentToken;if(!i||!F(i,40)){this.popStack();return}let s=this.processNodePathRef();if(s!==void 0){let c=new Wr(s,r);return this.mergeStack(),c}let o=this.isLabelRef();if(o===void 0){this._issues.push(z([18,9],new j(H(i))));let c=new Wr(null,r);return c.firstToken=r.at(0)?.firstToken??i,this.mergeStack(),c}let a=new Wr(o,r);return a.firstToken=r.at(0)?.firstToken??i,this.mergeStack(),a}processNodePath(n=!0,r=new hi){this.enqueueToStack();let i;if(F(this.currentToken,13))i=this.moveToNextToken;else{if(!n){this.popStack();return}this.prevToken&&this._issues.push(z(19,new j(H(this.prevToken))))}let s=this.isNodeName();if(s||this._issues.push(z(7,new j(H(i??this.prevToken)))),r.addPath(s??null,i?new j(H(i)):void 0),n&&!i&&r.children.length===0){this.mergeStack();return}return this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let n=this.moveToNextToken,r=n;if(!F(r,40)){this.popStack();return}let i=this.moveToNextToken;if(r=i,!F(r,2)){this.popStack();return}if(n&&!zt(n,i)){let l=new j(H(n,i));this._issues.push(z(29,l))}let s=this.processNodePath(),o=new Ln(s??null),a=this.currentToken??this.prevToken,c=a;return s?.children.forEach((l,u)=>{if(u===s?.children.length-1&&l&&c&&!zt(l.lastToken,c)){this._issues.push(z(29,new j(H(l.lastToken,c))));return}if(u===0&&i&&!zt(i,l?.firstToken)){this._issues.push(z(29,new j(H(i,l?.firstToken))));return}let d=s?.children[u+1];l&&d&&!zt(l.lastToken,d.firstToken)&&this._issues.push(z(29,new j(H(l.lastToken,d?.firstToken))))}),F(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(z(3,new j(H(this.prevToken)))),o.firstToken=n,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(n=>n instanceof pi)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var Bo=K(J());var AR=require("fs");var OR=require("path"),Tf=class t{constructor(e,n){this.settings=e;this.bindingLoader=n;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let r={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,OR.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=r.overlays,this.overlays.filter(AR.existsSync),this.parser=new gc(r.dtsFile,r.includePaths),this.ctxNames_.add(r.ctxName),this.id=di(r),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(i=>new gc(i,r.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,n=i=>({file:i,includes:(e.get(i)??[]).map(s=>n(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:n(this.parser.uri),overlays:this.overlays.map(n)}}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(n=>se(n,e))}getUriParser(e){let n=this.overlayParsers.find(r=>r.getFiles().some(i=>se(i,e)));return n??=this.parser.getFiles().some(r=>se(r,e))?this.parser:void 0,n}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,n){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>se(s.ast.uri,e)&&(!n||Kn(s.ast,e,n))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof Re&&l.compatible===o.value.value);return c?{range:te(o.value),target:pe(c.bindingsPath)}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>se(s.uri,e)&&(!n||Kn(s,e,n))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:te(s.path),target:pe(o)}}).filter(s=>s)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let n=s=>[...s.property,...s.nodes.flatMap(n)],r=n(e.rootNode),i=e.rootNode.allDescendantsLabels;r.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof de){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,Bo.DiagnosticSeverity.Error,[],[],[o.value]))}else o instanceof hi&&this.linkNodePath(o,e.rootNode)}))}linkNodePath(e,n){let r=n,i=e.pathParts;for(let s=0;s<i.length&&i[s];s++){let o=!1,a=i[s];if(a){let c=r?.getNode(a.name,a.fullAddress,!1);a.linksTo=c,!o&&!c&&(o=!0,this._issues.push(qt(8,a,Bo.DiagnosticSeverity.Error,[],[],[a.toString(),`${e.pathParts.filter(l=>l?.linksTo).map(l=>l?.toString()).join("/")}`]))),c?.linkedNodeNamePaths.push(a),r=c}else break}}async reevaluate(e){let n=this.getUriParser(e);return n?(this.sortKeys=new WeakMap,await n.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 n=new Fo(this);this._issues=[],this.processRoot(this.parser.rootDocument,n);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,n);return n.includes=this.parser.includes,n.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof Jn),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,i)=>this.sortKeys.set(r,i)),this.linkPropertiesLabelsAndNodePaths(n),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),n}processRoot(e,n){for(let r=0;r<e.children.length;r++){let i=e.children[r];this.processChild(i,n.rootNode,n)}}processChild(e,n,r){e instanceof mt?this.processDtcBaseNode(e,n,r):e instanceof Ge?this.processDtcProperty(e,n,r):e instanceof En?this.processDeleteNode(e,n,r):e instanceof ot&&this.processDeleteProperty(e,n,r)}checkNodeUniqueNames(e,n){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.fullAddress===void 0||Fr(c.address,a.fullAddress)===0)),i=n.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof xe&&o.name)r(s.map(a=>({name:a.name,address:a.fullAddress})),o.name)&&this._issues.push(qt(2,o.name)),s.push(o.name);else if(o instanceof En&&o.nodeNameOrRef instanceof Me){let a=o.nodeNameOrRef;r(i,a)&&(s=s.filter(c=>r(s.map(l=>({name:l.name,address:l.fullAddress})),c)))}})}processDtcBaseNode(e,n,r){e instanceof gt?this.processDtcRootNode(e,r):e instanceof xe?this.processDtcChildNode(e,n,r):e instanceof jt&&this.processDtcRefNode(e,r)}processDtcRootNode(e,n){n.roots.push(e),n.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,n.rootNode),e.children.forEach(r=>this.processChild(r,n.rootNode,n))}processDtcChildNode(e,n,r){if(e.name?.name){let i=e.path?r.resolvePath(e.path):void 0,o=(i?r.rootNode.getChild(i):void 0)??new we(this.bindingLoader,e.name.name,e.name.fullAddress,n);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),n=o,this.checkNodeUniqueNames(e,o)}e.children.forEach(i=>this.processChild(i,n,r))}processDtcRefNodeLabelRef(e,n,r){let i,s=e.resolveNodePath??(e.pathName?r.resolvePath([e.pathName]):void 0);return s?(e.resolveNodePath??=[...s],i=r.rootNode.getChild(s),n.linksTo=i,e.labels.forEach(o=>o.lastLinkedTo=i),i?.linkedRefLabels.push(n),i?.referencedBy.push(e),e.labels.forEach(o=>{r.labelsUsedCache.set(o.label.value,s)}),i?(r.references.push(e),this.checkNodeUniqueNames(e,i)):r.unlinkedRefNodes.push(e)):(this._issues.push(qt(3,n,Bo.DiagnosticSeverity.Error,[],[],[n.label?.value??""])),r.unlinkedRefNodes.push(e)),i}processDtcRefNodeNodePathRef(e,n,r){let i;n.path&&this.linkNodePath(n.path,r.rootNode);let o=n.path?.pathParts.at(-1)?.linksTo?.path;return o?(e.resolveNodePath??=o,i=r.rootNode.getChild(o),e.labels.forEach(a=>a.lastLinkedTo=i),i?.referencedBy.push(e),e.labels.forEach(a=>{r.labelsUsedCache.set(a.label.value,o)}),i?(r.references.push(e),this.checkNodeUniqueNames(e,i)):r.unlinkedRefNodes.push(e)):r.unlinkedRefNodes.push(e),i}processDtcRefNode(e,n){let r;e.reference?e.reference instanceof de?r=this.processDtcRefNodeLabelRef(e,e.reference,n):r=this.processDtcRefNodeNodePathRef(e,e.reference,n):n.unlinkedRefNodes.push(e),e.children.forEach(i=>this.processChild(i,r??new we(this.bindingLoader,""),n))}processDtcProperty(e,n,r){e.propertyName?.name&&n.addProperty(new Ve(e,n)),e.children.forEach(i=>this.processChild(i,n,r))}processDeleteNode(e,n,r){if(e.nodeNameOrRef instanceof Me&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!n.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(qt(5,e.nodeNameOrRef));else{n.deletes.push(e);let i=n.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=i,n.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),i?.labels.forEach(s=>{r.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof de&&e.nodeNameOrRef.value){let i=r.resolvePath([`&${e.nodeNameOrRef.value}`]),s;i?(s=r.rootNode.getChild(i),n.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{r.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof mt&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(qt(3,e.nodeNameOrRef,Bo.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Ln&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(i=>!i)){let i=r.rootNode,s=e.nodeNameOrRef.path.pathParts;for(let l=0;l<s.length&&s[l];l++){let u=s[l];if(u){let d=i?.getNode(u.name,u.fullAddress,!1);u.linksTo=d,d?.linkedNodeNamePaths.push(u),i=d}}let o=e.nodeNameOrRef.path.pathParts.every(l=>l),a=e.nodeNameOrRef.path.pathParts.find(l=>l&&!l.linksTo),c=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;c||(r.unlinkedDeletes.push(e),a&&this._issues.push(qt(8,a,Bo.DiagnosticSeverity.Error,[],[],[a.toString(),`${e.nodeNameOrRef.path.pathParts.filter(l=>l?.linksTo).map(l=>l?.toString()).join("/")}`]))),n.deletes.push(e),c?.labels.forEach(l=>{r.labelsUsedCache.delete(l.label.value)}),c?.parent?.deleteNode(c.name,e,c.address),e.parentNode instanceof mt&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(i=>this.processChild(i,n,r))}processDeleteProperty(e,n,r){e.propertyName?.name&&!n.hasProperty(e.propertyName.name)?this._issues.push(qt(1,e.propertyName)):e.propertyName?.name&&(n.deletes.push(e),n.deleteProperty(e.propertyName.name,e)),e.children.forEach(i=>this.processChild(i,n,r))}static#e(e,n,r){let i=r.get(n);i||(i=[],r.set(n,i)),i.push(e)}async getSyntaxIssues(e=new Map,n){return(await this.getAllParsers()).forEach(r=>{n?r.issues.filter(i=>n(i.raw)).forEach(i=>t.#e(i.diagnostic(),i.raw.astElement.uri,e)):r.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(n){throw console.error(n),n}}async toFullString(){return`/dts-v1/;
|
|
282
|
+
${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}async serialize(){return(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var Et=K(J());var IR=require("fs"),Uo=require("path");function E$(t){if(!t||!(t.ast instanceof Do))return[];let e=r=>r.flatMap(i=>(0,IR.readdirSync)(i,{withFileTypes:!0,recursive:!0}).filter(s=>s.name.toLowerCase().endsWith(".dtsi")||s.name.toLowerCase().endsWith(".h")).map(s=>({label:`${(0,Uo.join)((0,Uo.relative)(i,s.parentPath),s.name)}`,kind:Et.CompletionItemKind.File})));if(t.ast.relative)return e([(0,Uo.dirname)(t.ast.uri)]);let n=t.runtime.context.settings.includePaths??[];return e(n)}var Sf=(t,e)=>[...t.labels.filter(e),...t.deletedNodes.filter(n=>!e(n.by)).flatMap(n=>Sf(n.node,e)),...t.nodes.flatMap(n=>Sf(n,e))],ay=(t,e)=>[...t.labels,...t.deletedNodes.filter(n=>!e(n.by)).flatMap(n=>ay(n.node,e)),...t.nodes.flatMap(n=>ay(n,e))];function k$(t,e){if(!t||!(t.item instanceof Ve)||!(t.ast instanceof de))return[];let n=r=>ay(r,e);return Array.from(new Set(n(t.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Method}))}function w$(t,e){if(!t||t.item!==null||!(t.ast instanceof de)||!(t.ast.parentNode instanceof jt))return[];let n=r=>Sf(r,e).filter(i=>e(i));return[...Array.from(new Set(n(t.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:r,insertText:`${r} {
|
|
282
283
|
$1
|
|
283
|
-
};`,kind:Et.CompletionItemKind.Value,insertTextFormat:Et.InsertTextFormat.Snippet}))]}function b$(t,e){let n=i=>i?i.parentNode instanceof jt||i.parentNode instanceof mt||i.parentNode instanceof Ie?!1:n(i.parentNode):!0;if(!t||t.item!==null||!At(t.ast)||!n(t.ast))return[];let r=i=>bf(i,e).filter(s=>e(s));return t.ast instanceof lt?r(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(t.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:t.ast instanceof de?`${i}`:`&${i}`,kind:Et.CompletionItemKind.Variable}))}function T$(t,e){if(!t||!(t.item instanceof ke)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof un)||t.beforeAst?.parentNode instanceof at))return[];let n=r=>[...r.nodes,...r.deletedNodes.filter(i=>!e(i.by)).map(i=>i.node)].flatMap(i=>i.definitions.filter(s=>s instanceof Ie)).filter(i=>e(i));return t.ast instanceof xe||t.ast instanceof _n||t.beforeAst?.parentNode instanceof _n?Array.from(new Set(n(t.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-node/",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]}function S$(t,e){if(!t||!(t.item instanceof ke)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof un)||t.beforeAst?.parentNode instanceof _n))return[];let n=r=>[...r.property,...r.deletedProperties.filter(i=>!e(i.by)).map(i=>i.property)].flatMap(i=>[i,...i.allReplaced]).filter(i=>e(i.ast));return t.ast instanceof He||t.ast instanceof at||t.beforeAst?.parentNode instanceof at?Array.from(new Set(n(t.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:Et.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:Et.InsertTextFormat.Snippet}]:[]}function _$(t,e){let n=t?.ast instanceof di?t.ast:t?.ast.parentNode;if(!t||!n||!(n instanceof di))return[];let r=n.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let i=r.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...i],e);return[...o?.nodes.filter(a=>!At(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...i,o].join("/")}`,kind:Et.CompletionItemKind.Variable}))}var vf=t=>!t||t instanceof Xe?!1:t instanceof dn||vf(t.parentNode);function E$(t){return!t||!(t.item instanceof Ve&&t.item.ast.assignOperatorToken)?[]:!vf(t?.ast)&&!(t.ast instanceof Xe&&t.item.ast.values===null)&&!vf(t.beforeAst)&&!vf(t.afterAst)?[]:t.item.parent.nodeType instanceof En?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([r,i])=>i.macro.identifier instanceof Ur?{label:`${i.macro.identifier.toString()}`,insertText:`${i.macro.name}(${i.macro.identifier.params.map((s,o)=>s instanceof Ot?`$${o+1}`:"").join(", ")})`,kind:Et.CompletionItemKind.Function,sortText:`~${i.macro.name}`,insertTextFormat:Et.InsertTextFormat.Snippet}:{label:i.macro.identifier.name,kind:Et.CompletionItemKind.Variable,sortText:`~${i.macro.name}`}):[]}async function RR(t,e){return St(t,e,(n,r)=>[...S$(n,r),...T$(n,r),...b$(n,r),..._$(n,r),...v$(n,r),...y$(n,r),...g$(n),...E$(n)])}var zr=K(J());function w$(t){if(!t||t.item===null||!(t.ast instanceof He))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast),r.parent.deletedProperties.find(i=>i.property===r)?.by??[]].map(i=>{if(i instanceof Xe)return zr.Location.create(pe(i.uri),te(i.propertyName??i));if(i instanceof at)return zr.Location.create(pe(i.uri),te(i.propertyName??i))}).filter(i=>i);if(t.item instanceof Ve&&t.ast instanceof He)return n(e(t.item));if(t.item instanceof ke&&t.ast instanceof He&&t.ast.parentNode instanceof at){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function k$(t){if(!t)return[];let e=n=>{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("/"))===n)return!0}).map(o=>o.ast)??[],s=n.parent?.deletedNodes.filter(o=>o.node===n&&(o.by.nodeNameOrRef instanceof xe?o.by.nodeNameOrRef!==t.ast:!n.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...i,...n.linkedRefLabels,...n.linkedNodeNamePaths,...n.definitions,...s].map(o=>{if(o instanceof mt)return zr.Location.create(pe(o.uri),te(o.name??o));if(o instanceof Ie)return zr.Location.create(pe(o.uri),te(o.name??o));if(o instanceof xe)return zr.Location.create(pe(o.uri),te(o));if(o instanceof xe)return zr.Location.create(pe(o.uri),te(o));if(o instanceof de)return zr.Location.create(pe(o.uri),te(o.label??o));if(o instanceof Xe)return zr.Location.create(pe((o.values??o)?.uri),te(o.values??o))}).filter(o=>o)};if(t.item instanceof ke&&!At(t.ast))return e(t.item);if(t.ast instanceof Wt&&t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof xe&&t.ast.linksTo)return At(t.ast)?[...e(t.ast.linksTo),zr.Location.create(pe(t.ast.uri),te(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof Le&&t.item instanceof Ve&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}async function CR(t,e){return St(t,e,n=>[...k$(n),...w$(n)])}var pi=K(J());function DR(t){if(!t||t.item===null||!(t.ast instanceof He))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast),r.parent.deletedProperties.find(i=>i.property===r)?.by??[]].map(i=>{if((i instanceof Xe||i instanceof at)&&i.propertyName)return pi.Location.create(pe(i.uri),te(i.propertyName))}).filter(i=>i);if(t.item instanceof Ve&&t.ast instanceof He)return n(e(t.item));if(t.item instanceof ke&&t.ast instanceof He&&t.ast.parentNode instanceof at){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function AR(t,e){if(!e||!(e.ast instanceof Wt))return[];"newName"in t&&(e.ast.parentNode instanceof de&&t.newName.startsWith("&")?t.newName=t.newName.slice(1):e.ast.parentNode instanceof Fi&&t.newName.endsWith(":")&&(t.newName=t.newName.slice(0,-1)));let n=e.ast.value,r=i=>[...i.definitions.filter(s=>s instanceof Ie).flatMap(s=>s.labels.map(o=>o.label)),...i.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===n).map(s=>{if(s)return pi.Location.create(pe(s.uri),te(s))}).filter(s=>s);return e.item instanceof ke&&!At(e.ast)?r(e.item):e.ast instanceof Wt&&e.ast.parentNode instanceof de&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function OR(t){if(!t||!(t.ast instanceof xe))return[];let e=n=>{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(n)||c===n)return!0}}).map(o=>o.ast)??[],s=n.parent?.deletedNodes.filter(o=>o.node===n&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...i,...n.linkedNodeNamePaths,...n.definitions,...s].map(o=>{if(o instanceof Ie&&o.name)return pi.Location.create(pe(o.uri),te(o.name));if(o instanceof xe)return pi.Location.create(pe(o.uri),te(o));if(o instanceof Xe&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof Le){let a=o.values.values[0].value,c=te(a),l=a.value.split("/"),u=n.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(pe(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof ke&&!At(t.ast)?e(t.item):t.ast instanceof xe&&t.ast.linksTo?At(t.ast)?[...e(t.ast.linksTo),pi.Location.create(pe(t.ast.uri),te(t.ast))]:e(t.ast.linksTo):[]}async function IR(t,e){let n={};return(await St(t,e,i=>[...OR(i),...AR(t,i),...DR(i)])).forEach(i=>{n[i.uri]??=[],n[i.uri].push(pi.TextEdit.replace(i.range,t.newName))}),{changes:n}}async function xR(t,e){let n=await St(t,e,r=>[...OR(r),...AR(t,r),...DR(r)]);if(n.some(r=>e?.settings.lockRenameEdits?.some(i=>Ue(r.uri).startsWith(i))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!n.length}}var Bo=K(J());function N$(t){if(!t||t.item===null||!(t.ast instanceof He))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast)].map(i=>{if(i instanceof Xe)return Bo.Location.create(pe(i.uri),te(i.propertyName??i))}).filter(i=>i);if(t.item instanceof Ve&&t.ast instanceof He)return n(e(t.item));if(t.item instanceof ke&&t.ast instanceof He&&t.ast.parentNode instanceof at){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function P$(t){if(!t)return[];let e=n=>[...n.definitions,...n.referencedBy].map(r=>{if(r instanceof mt)return Bo.Location.create(pe(r.uri),te(r));if(r instanceof Ie)return Bo.Location.create(pe(r.uri),te(r));if(r instanceof jt)return Bo.Location.create(pe(r.uri),te(r))}).filter(r=>r);if(t.item instanceof ke&&!At(t.ast))return e(t.item);if(t.ast instanceof Wt&&t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof xe&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof Le&&t.item instanceof Ve&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}function R$(t){if(t?.ast instanceof Ot||t?.ast instanceof Lr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ot?t.ast.name:t.ast.value);if(e)return[Bo.Location.create(pe(e.macro.uri),te(e.macro.identifier))]}return[]}async function MR(t,e){return St(t,e,n=>[...P$(n),...N$(n),...R$(n)])}var Tf=K(J());function C$(t){if(!t||t.item===null||!(t.ast instanceof He))return;let e=r=>r.replaces?e(r.replaces):r,n=r=>Tf.Location.create(pe(r.ast.uri),te(r.ast.propertyName??r.ast));if(t.item instanceof Ve&&t.ast instanceof He)return n(e(t.item));if(t.item instanceof ke&&t.ast instanceof He&&t.ast.parentNode instanceof at){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(e(r))}}function D$(t){if(!t)return;let e=n=>{let r=n.definitions.at(0);return r?Tf.Location.create(pe(r.uri),te(r)):void 0};if(t.item instanceof ke&&!At(t.ast))return e(t.item);if(t.ast instanceof Wt&&t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof xe&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof Le&&t.item instanceof Ve&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}}function A$(t){if(t?.ast instanceof Ot||t?.ast instanceof Lr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ot?t.ast.name:t.ast.value);if(e)return Tf.Location.create(pe(e.macro.uri),te(e.macro.identifier))}}async function LR(t,e){return(await St(t,e,n=>[D$(n)||C$(n)||A$(n)])).at(0)}var re=K(J());var O$=(t,e,n,r,i)=>{switch(n){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(re.Range.create(re.Position.create(r.range.start.line,t.pos.colEnd),re.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},I$=(t,e,n,r,i)=>{if(!r)return[];switch(t){case 0:return[{title:i??`Add Property "${r.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 27:return[{title:i??"Remove Property",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 26:return[{title:i??"TODO",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 25:return r?[{title:i??"TODO",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}]:[];default:return}};function $R(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>O$(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>I$(l,a,t.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),n=e.filter(a=>a.kind===re.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),i=e.filter(a=>a.kind!==re.CodeActionKind.SourceFixAll),s=n.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return r.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,...n.map(a=>({...a,kind:re.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:re.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:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var Sf=t=>!t||t instanceof Xe?!1:t instanceof dn||Sf(t.parentNode);function x$(t){if(!t||!(t.item instanceof Ve&&t.item.ast.assignOperatorToken))return[];let e=Sf(t?.ast);if(!e&&!(t.ast instanceof Xe&&t.item.ast.values===null)&&!Sf(t.beforeAst)&&!Sf(t.afterAst))return[];let n=-1;t.item.ast.values===null?n=0:n=(t.item.ast.values?.values.findIndex(i=>i&&Lg(i,t.beforeAst))??-1)+1,n===-1&&(n=0);let r=t.item.parent.nodeType;return r instanceof En?r.properties.find(i=>i.name===t.item?.name)?.getPropertyCompletionItems(t.item,n,e)??[]:[]}function M$(t){if(!t||!(t.item instanceof Ve&&t.ast instanceof He&&t.item.ast.values==null||t.item instanceof ke)||At(t.ast)||t.beforeAst?.parentNode instanceof un)return[];let e=n=>n.nodeType?.getPropertyListCompletionItems(n)??[];return t.item instanceof Ve?e(t.item.parent):e(t.item)}async function qR(t,e){return St(t,e,n=>[...x$(n),...M$(n)])}var _f=K(J());async function L$(t){if(t?.ast instanceof Ot||t?.ast instanceof Lr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof Ot?t.ast.name:t.ast.value);if(e){let n=Xa(t.ast),r=(await t.runtime.context.getAllParsers()).at(-1);if(n){let i=n?.evaluate(r.cPreprocessorParser.macros);return{contents:{kind:_f.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${i}${typeof i=="number"?` (0x${i.toString(16)})`:""}`,"```"].join(`
|
|
284
|
-
`)},range:te(t.ast)}}return{contents:{kind:
|
|
285
|
-
`)},range:te(t.ast)}}}}async function
|
|
286
|
-
${n?.value??""}`},range:te(t.ast)}}}function jR(t,e){return St(t,e,async n=>[await $$(n)||q$(n)||await L$(n)])}var sS=K(Fv());var GD=K(jD(),1);var zc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var gU={"[: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]},Wc=t=>t.replace(/[[\]\\-]/g,"\\$&"),yU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),FD=t=>t.join(""),BD=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,c=!1,l=!1,u=n,d="";e:for(;s<t.length;){let p=t.charAt(s);if((p==="!"||p==="^")&&s===n+1){l=!0,s++;continue}if(p==="]"&&o&&!c){u=s+1;break}if(o=!0,p==="\\"&&!c){c=!0,s++;continue}if(p==="["&&!c){for(let[T,[_,v,b]]of Object.entries(gU))if(t.startsWith(T,s)){if(d)return["$.",!1,t.length-n,!0];s+=T.length,b?i.push(_):r.push(_),a=a||v;continue e}}if(c=!1,d){p>d?r.push(Wc(d)+"-"+Wc(p)):p===d&&r.push(Wc(p)),d="",s++;continue}if(t.startsWith("-]",s+1)){r.push(Wc(p+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=p,s+=2;continue}r.push(Wc(p)),s++}if(u<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let p=r[0].length===2?r[0].slice(-1):r[0];return[yU(p),!1,u-n,!1]}let f="["+(l?"^":"")+FD(r)+"]",h="["+(l?"":"^")+FD(i)+"]";return[r.length&&i.length?"("+f+"|"+h+")":r.length?f:h,a,u-n,!0]};var _r=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var vU=new Set(["!","?","+","*","@"]),UD=t=>vU.has(t),bU="(?!(?:^|/)\\.\\.?(?:$|/))",Th="(?!\\.)",TU=new Set(["[","."]),SU=new Set(["..","."]),_U=new Set("().*{}+?[]^$\\!"),EU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Vv="[^/]",VD=Vv+"*?",zD=Vv+"+?",Qo=class t{type;#e;#t;#i=!1;#n=[];#o;#f;#l;#d=!1;#a;#c;#s=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#f=this.#o?this.#o.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)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.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.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 n=e,r=n.#o;for(;r;){for(let i=n.#f+1;!r.type&&i<r.#n.length;i++)for(let s of e.#n){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#n[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#n.push(n)}}toJSON(){let e=this.type===null?this.#n.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#n.map(n=>n.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 n=0;n<this.#f;n++){let r=e.#n[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#n.length:0;return this.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#n)n.copyIn(r);return n}static#v(e,n,r,i){let s=!1,o=!1,a=-1,c=!1;if(n.type===null){let h=r,y="";for(;h<e.length;){let p=e.charAt(h++);if(s||p==="\\"){s=!s,y+=p;continue}if(o){h===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(h===a+2&&c)&&(o=!1),y+=p;continue}else if(p==="["){o=!0,a=h,c=!1,y+=p;continue}if(!i.noext&&UD(p)&&e.charAt(h)==="("){n.push(y),y="";let T=new t(p,n);h=t.#v(e,T,h,i),n.push(T);continue}y+=p}return n.push(y),h}let l=r+1,u=new t(null,n),d=[],f="";for(;l<e.length;){let h=e.charAt(l++);if(s||h==="\\"){s=!s,f+=h;continue}if(o){l===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===a+2&&c)&&(o=!1),f+=h;continue}else if(h==="["){o=!0,a=l,c=!1,f+=h;continue}if(UD(h)&&e.charAt(l)==="("){u.push(f),f="";let y=new t(h,u);u.push(y),l=t.#v(e,y,l,i);continue}if(h==="|"){u.push(f),f="",d.push(u),u=new t(null,n);continue}if(h===")")return f===""&&n.#n.length===0&&(n.#s=!0),u.push(f),f="",n.push(...d,u),l;f+=h}return n.type=null,n.#t=void 0,n.#n=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#v(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(h=>{let[y,p,T,_]=typeof h=="string"?t.#h(h,this.#t,c):h.toRegExpSource(e);return this.#t=this.#t||T,this.#i=this.#i||_,y}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&SU.has(this.#n[0]))){let y=TU,p=n&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),T=!n&&!e&&y.has(l.charAt(0));u=p?bU:T?Th:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,_r(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#p(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#t=void 0,[c,_r(this.toString()),!1,!1]}let o=!r||e||n||!Th?"":this.#p(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!n?Th:"")+zD;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Th:"")+VD+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,_r(s),this.#t=!!this.#t,this.#i]}#p(e){return this.#n.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#i=this.#i||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#h(e,n,r=!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+=(_U.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,d,f]=BD(e,a);if(d){s+=l,o=o||u,a+=d-1,n=n||f;continue}}if(c==="*"){r&&e==="*"?s+=zD:s+=VD,n=!0;continue}if(c==="?"){s+=Vv,n=!0;continue}s+=EU(c)}return[s,_r(e),!!n,o]}};var Zo=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var fn=(t,e,n={})=>(zc(e),!n.nocomment&&e.charAt(0)==="#"?!1:new jn(e,n).match(t)),wU=/^\*+([^+@!?\*\[\(]*)$/,kU=t=>e=>!e.startsWith(".")&&e.endsWith(t),NU=t=>e=>e.endsWith(t),PU=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),RU=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),CU=/^\*+\.\*+$/,DU=t=>!t.startsWith(".")&&t.includes("."),AU=t=>t!=="."&&t!==".."&&t.includes("."),OU=/^\.\*+$/,IU=t=>t!=="."&&t!==".."&&t.startsWith("."),xU=/^\*+$/,MU=t=>t.length!==0&&!t.startsWith("."),LU=t=>t.length!==0&&t!=="."&&t!=="..",$U=/^\?+([^+@!?\*\[\(]*)?$/,qU=([t,e=""])=>{let n=YD([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},jU=([t,e=""])=>{let n=KD([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},FU=([t,e=""])=>{let n=KD([t]);return e?r=>n(r)&&r.endsWith(e):n},BU=([t,e=""])=>{let n=YD([t]);return e?r=>n(r)&&r.endsWith(e):n},YD=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},KD=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},XD=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",WD={win32:{sep:"\\"},posix:{sep:"/"}},UU=XD==="win32"?WD.win32.sep:WD.posix.sep;fn.sep=UU;var Gt=Symbol("globstar **");fn.GLOBSTAR=Gt;var VU="[^/]",zU=VU+"*?",WU="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",HU="(?:(?!(?:\\/|^)\\.).)*?",GU=(t,e={})=>n=>fn(n,t,e);fn.filter=GU;var Jn=(t,e={})=>Object.assign({},t,e),YU=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return fn;let e=fn;return Object.assign((r,i,s={})=>e(r,i,Jn(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,Jn(t,s))}static defaults(i){return e.defaults(Jn(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,Jn(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,Jn(t,s))}},unescape:(r,i={})=>e.unescape(r,Jn(t,i)),escape:(r,i={})=>e.escape(r,Jn(t,i)),filter:(r,i={})=>e.filter(r,Jn(t,i)),defaults:r=>e.defaults(Jn(t,r)),makeRe:(r,i={})=>e.makeRe(r,Jn(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,Jn(t,i)),match:(r,i,s={})=>e.match(r,i,Jn(t,s)),sep:e.sep,GLOBSTAR:Gt})};fn.defaults=YU;var JD=(t,e={})=>(zc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,GD.default)(t));fn.braceExpand=JD;var KU=(t,e={})=>new jn(t,e).makeRe();fn.makeRe=KU;var XU=(t,e,n={})=>{let r=new jn(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};fn.match=XU;var HD=/[?*]|[+@!]\(.*?\)|\[|\]/,JU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){zc(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||XD,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.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 n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),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]==="?"||!HD.test(s[2]))&&!HD.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 r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],c=r[i+2],l=r[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(i,1);let u=r.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let p=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!p&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),_=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),v=!_&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),b=T?3:p?0:void 0,w=v?3:_?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[C,L]=[e[b],n[w]];C.toLowerCase()===L.toLowerCase()&&(n[w]=C,w>b?n=n.slice(w):b>w&&(e=e.slice(b)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,c=e.length,l=n.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=n[a],d=e[o];if(this.debug(n,u,d),u===!1)return!1;if(u===Gt){this.debug("GLOBSTAR",[n,u,d]);var f=o,h=a+1;if(h===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(`
|
|
284
|
+
};`,kind:Et.CompletionItemKind.Value,insertTextFormat:Et.InsertTextFormat.Snippet}))]}function N$(t,e){let n=i=>i?i.parentNode instanceof jt||i.parentNode instanceof gt||i.parentNode instanceof xe?!1:n(i.parentNode):!0;if(!t||t.item!==null||!At(t.ast)||!n(t.ast))return[];let r=i=>Sf(i,e).filter(s=>e(s));return t.ast instanceof ct?r(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(t.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:t.ast instanceof de?`${i}`:`&${i}`,kind:Et.CompletionItemKind.Variable}))}function P$(t,e){if(!t||!(t.item instanceof we)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof un)||t.beforeAst?.parentNode instanceof ot))return[];let n=r=>[...r.nodes,...r.deletedNodes.filter(i=>!e(i.by)).map(i=>i.node)].flatMap(i=>i.definitions.filter(s=>s instanceof xe)).filter(i=>e(i));return t.ast instanceof Me||t.ast instanceof En||t.beforeAst?.parentNode instanceof En?Array.from(new Set(n(t.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-node/",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]}function R$(t,e){if(!t||!(t.item instanceof we)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof un)||t.beforeAst?.parentNode instanceof En))return[];let n=r=>[...r.property,...r.deletedProperties.filter(i=>!e(i.by)).map(i=>i.property)].flatMap(i=>[i,...i.allReplaced]).filter(i=>e(i.ast));return t.ast instanceof He||t.ast instanceof ot||t.beforeAst?.parentNode instanceof ot?Array.from(new Set(n(t.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:Et.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:Et.InsertTextFormat.Snippet}]:[]}function C$(t,e){let n=t?.ast instanceof hi?t.ast:t?.ast.parentNode;if(!t||!n||!(n instanceof hi))return[];let r=n.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let i=r.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...i],e);return[...o?.nodes.filter(a=>!At(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...i,o].join("/")}`,kind:Et.CompletionItemKind.Variable}))}function D$(t){return!t||!(t.item instanceof Ve&&t.item.ast.assignOperatorToken)||t.ast instanceof Re?[]:!ks(t?.ast)&&!(t.ast instanceof Ge&&t.item.ast.values===null)&&!ks(t.beforeAst)&&!ks(t.afterAst)?[]:t.item.parent.nodeType instanceof fn?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([r,i])=>i.macro.identifier instanceof zr?{label:`${i.macro.identifier.toString()}`,insertText:`${i.macro.name}(${i.macro.identifier.params.map((s,o)=>s instanceof Ot?`$${o+1}`:"").join(", ")})`,kind:Et.CompletionItemKind.Function,sortText:`~${i.macro.name}`,insertTextFormat:Et.InsertTextFormat.Snippet}:{label:i.macro.identifier.name,kind:Et.CompletionItemKind.Variable,sortText:`~${i.macro.name}`}):[]}async function xR(t,e){return St(t,e,(n,r)=>[...R$(n,r),...P$(n,r),...N$(n,r),...C$(n,r),...w$(n,r),...k$(n,r),...E$(n),...D$(n)])}var Hr=K(J());function A$(t){if(!t||t.item===null||!(t.ast instanceof He))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast),r.parent.deletedProperties.find(i=>i.property===r)?.by??[]].map(i=>{if(i instanceof Ge)return Hr.Location.create(pe(i.uri),te(i.propertyName??i));if(i instanceof ot)return Hr.Location.create(pe(i.uri),te(i.propertyName??i))}).filter(i=>i);if(t.item instanceof Ve&&t.ast instanceof He)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof He&&t.ast.parentNode instanceof ot){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function O$(t){if(!t)return[];let e=n=>{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("/"))===n)return!0}).map(o=>o.ast)??[],s=n.parent?.deletedNodes.filter(o=>o.node===n&&(o.by.nodeNameOrRef instanceof Me?o.by.nodeNameOrRef!==t.ast:!n.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...i,...n.linkedRefLabels,...n.linkedNodeNamePaths,...n.definitions,...s].map(o=>{if(o instanceof gt)return Hr.Location.create(pe(o.uri),te(o.name??o));if(o instanceof xe)return Hr.Location.create(pe(o.uri),te(o.name??o));if(o instanceof Me)return Hr.Location.create(pe(o.uri),te(o));if(o instanceof Me)return Hr.Location.create(pe(o.uri),te(o));if(o instanceof de)return Hr.Location.create(pe(o.uri),te(o.label??o));if(o instanceof Ge)return Hr.Location.create(pe((o.values??o)?.uri),te(o.values??o))}).filter(o=>o)};if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof Ht&&t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return At(t.ast)?[...e(t.ast.linksTo),Hr.Location.create(pe(t.ast.uri),te(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof Re&&t.item instanceof Ve&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}async function MR(t,e){return St(t,e,n=>[...O$(n),...A$(n)])}var mi=K(J());function LR(t){if(!t||t.item===null||!(t.ast instanceof He))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast),r.parent.deletedProperties.find(i=>i.property===r)?.by??[]].map(i=>{if((i instanceof Ge||i instanceof ot)&&i.propertyName)return mi.Location.create(pe(i.uri),te(i.propertyName))}).filter(i=>i);if(t.item instanceof Ve&&t.ast instanceof He)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof He&&t.ast.parentNode instanceof ot){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function $R(t,e){if(!e||!(e.ast instanceof Ht))return[];"newName"in t&&(e.ast.parentNode instanceof de&&t.newName.startsWith("&")?t.newName=t.newName.slice(1):e.ast.parentNode instanceof Bi&&t.newName.endsWith(":")&&(t.newName=t.newName.slice(0,-1)));let n=e.ast.value,r=i=>[...i.definitions.filter(s=>s instanceof xe).flatMap(s=>s.labels.map(o=>o.label)),...i.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===n).map(s=>{if(s)return mi.Location.create(pe(s.uri),te(s))}).filter(s=>s);return e.item instanceof we&&!At(e.ast)?r(e.item):e.ast instanceof Ht&&e.ast.parentNode instanceof de&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function qR(t){if(!t||!(t.ast instanceof Me))return[];let e=n=>{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(n)||c===n)return!0}}).map(o=>o.ast)??[],s=n.parent?.deletedNodes.filter(o=>o.node===n&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...i,...n.linkedNodeNamePaths,...n.definitions,...s].map(o=>{if(o instanceof xe&&o.name)return mi.Location.create(pe(o.uri),te(o.name));if(o instanceof Me)return mi.Location.create(pe(o.uri),te(o));if(o instanceof Ge&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof Re){let a=o.values.values[0].value,c=te(a),l=a.value.split("/"),u=n.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,mi.Location.create(pe(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof we&&!At(t.ast)?e(t.item):t.ast instanceof Me&&t.ast.linksTo?At(t.ast)?[...e(t.ast.linksTo),mi.Location.create(pe(t.ast.uri),te(t.ast))]:e(t.ast.linksTo):[]}async function jR(t,e){let n={};return(await St(t,e,i=>[...qR(i),...$R(t,i),...LR(i)])).forEach(i=>{n[i.uri]??=[],n[i.uri].push(mi.TextEdit.replace(i.range,t.newName))}),{changes:n}}async function FR(t,e){let n=await St(t,e,r=>[...qR(r),...$R(t,r),...LR(r)]);if(n.some(r=>e?.settings.lockRenameEdits?.some(i=>Ue(r.uri).startsWith(i))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!n.length}}var Vo=K(J());function I$(t){if(!t||t.item===null||!(t.ast instanceof He))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast)].map(i=>{if(i instanceof Ge)return Vo.Location.create(pe(i.uri),te(i.propertyName??i))}).filter(i=>i);if(t.item instanceof Ve&&t.ast instanceof He)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof He&&t.ast.parentNode instanceof ot){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function x$(t){if(!t)return[];let e=n=>[...n.definitions,...n.referencedBy].map(r=>{if(r instanceof gt)return Vo.Location.create(pe(r.uri),te(r));if(r instanceof xe)return Vo.Location.create(pe(r.uri),te(r));if(r instanceof jt)return Vo.Location.create(pe(r.uri),te(r))}).filter(r=>r);if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof Ht&&t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof Re&&t.item instanceof Ve&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}function M$(t){if(t?.ast instanceof Ot||t?.ast instanceof qr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ot?t.ast.name:t.ast.value);if(e)return[Vo.Location.create(pe(e.macro.uri),te(e.macro.identifier))]}return[]}async function BR(t,e){return St(t,e,n=>[...x$(n),...I$(n),...M$(n)])}var _f=K(J());function L$(t){if(!t||t.item===null||!(t.ast instanceof He))return;let e=r=>r.replaces?e(r.replaces):r,n=r=>_f.Location.create(pe(r.ast.uri),te(r.ast.propertyName??r.ast));if(t.item instanceof Ve&&t.ast instanceof He)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof He&&t.ast.parentNode instanceof ot){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(e(r))}}function $$(t){if(!t)return;let e=n=>{let r=n.definitions.at(0);return r?_f.Location.create(pe(r.uri),te(r)):void 0};if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof Ht&&t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof Re&&t.item instanceof Ve&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}}function q$(t){if(t?.ast instanceof Ot||t?.ast instanceof qr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ot?t.ast.name:t.ast.value);if(e)return _f.Location.create(pe(e.macro.uri),te(e.macro.identifier))}}async function UR(t,e){return(await St(t,e,n=>[$$(n)||L$(n)||q$(n)])).at(0)}var ie=K(J());var j$=(t,e,n,r,i)=>{switch(n){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.insert(ie.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.insert(ie.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.replace(ie.Range.create(ie.Position.create(r.range.start.line,t.pos.colEnd),ie.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.insert(ie.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.insert(ie.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.insert(ie.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.insert(ie.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:ie.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ie.TextEdit.insert(ie.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},F$=(t,e,n,r,i)=>{if(!r)return[];switch(t){case 0:return[{title:i??`Add Property "${r.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 27:return[{title:i??"Remove Property",diagnostics:[e],kind:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 26:return[{title:i??"TODO",diagnostics:[e],kind:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 25:return r?[{title:i??"TODO",diagnostics:[e],kind:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}]:[];default:return}};function VR(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>j$(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>F$(l,a,t.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),n=e.filter(a=>a.kind===ie.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),i=e.filter(a=>a.kind!==ie.CodeActionKind.SourceFixAll),s=n.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return r.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,...n.map(a=>({...a,kind:ie.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:ie.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:ie.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var zR=K(J());var Ef=t=>!t||t instanceof Ge?!1:t instanceof dn||Ef(t.parentNode);function B$(t){if(!t||!(t.item instanceof Ve&&t.item.ast.assignOperatorToken))return[];let e=Ef(t?.ast);if(!e&&!(t.ast instanceof Ge&&t.item.ast.values===null)&&!Ef(t.beforeAst)&&!Ef(t.afterAst))return[];let n=-1;if(t.item.ast.values===null?n=0:n=(t.item.ast.values?.values.findIndex(i=>i&&jg(i,t.beforeAst))??-1)+1,n===-1&&(n=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 fn&&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:zR.CompletionItemKind.Variable,insertText:e?c:`"${c}"`})))}let r=t.item.parent.nodeType;return r instanceof fn?r.properties.find(i=>i.name===t.item?.name)?.getPropertyCompletionItems(t.item,n,e)??[]:[]}function U$(t){if(!t||!(t.item instanceof Ve&&t.ast instanceof He&&t.item.ast.values==null||t.item instanceof we)||At(t.ast)||t.beforeAst?.parentNode instanceof un)return[];let e=n=>n.nodeType?.getPropertyListCompletionItems(n)??[];return t.item instanceof Ve?e(t.item.parent):e(t.item)}async function WR(t,e){return St(t,e,n=>[...B$(n),...U$(n)])}var kf=K(J());async function V$(t){if(t?.ast instanceof Ot||t?.ast instanceof qr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof Ot?t.ast.name:t.ast.value);if(e){let n=Qa(t.ast),r=(await t.runtime.context.getAllParsers()).at(-1);if(n){let i=n?.evaluate(r.cPreprocessorParser.macros);return{contents:{kind:kf.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${i}${typeof i=="number"?` (0x${i.toString(16)})`:""}`,"```"].join(`
|
|
285
|
+
`)},range:te(t.ast)}}return{contents:{kind:kf.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${t.ast?.evaluate(r.cPreprocessorParser.macros)}`,"```"].join(`
|
|
286
|
+
`)},range:te(t.ast)}}}}async function z$(t){if(!t)return;let e=(await t.runtime.context.getAllParsers()).at(-1);if(t?.ast instanceof Me){let n=t.ast.linksTo;if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}if(t?.ast.parentNode instanceof de){let n=t.ast.parentNode.linksTo;if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}if(t?.ast instanceof Re&&t.item instanceof Ve&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}if(t?.item instanceof we)return{contents:t.item.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}function W$(t){if(t?.item instanceof Ve&&t.ast instanceof He){let e=t.item.onHover(),n=t.item.parent.nodeType?.getOnPropertyHover(t.item.name);if(e||n)return{contents:{kind:kf.MarkupKind.Markdown,value:`${e?.value??""}
|
|
287
|
+
${n?.value??""}`},range:te(t.ast)}}}function HR(t,e){return St(t,e,async n=>[await z$(n)||W$(n)||await V$(n)])}var aS=K(Uv());var eA=K(HD(),1);var Yc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var EU={"[: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]},Kc=t=>t.replace(/[[\]\\-]/g,"\\$&"),kU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),GD=t=>t.join(""),YD=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,c=!1,l=!1,u=n,d="";e:for(;s<t.length;){let p=t.charAt(s);if((p==="!"||p==="^")&&s===n+1){l=!0,s++;continue}if(p==="]"&&o&&!c){u=s+1;break}if(o=!0,p==="\\"&&!c){c=!0,s++;continue}if(p==="["&&!c){for(let[T,[_,v,b]]of Object.entries(EU))if(t.startsWith(T,s)){if(d)return["$.",!1,t.length-n,!0];s+=T.length,b?i.push(_):r.push(_),a=a||v;continue e}}if(c=!1,d){p>d?r.push(Kc(d)+"-"+Kc(p)):p===d&&r.push(Kc(p)),d="",s++;continue}if(t.startsWith("-]",s+1)){r.push(Kc(p+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=p,s+=2;continue}r.push(Kc(p)),s++}if(u<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let p=r[0].length===2?r[0].slice(-1):r[0];return[kU(p),!1,u-n,!1]}let f="["+(l?"^":"")+GD(r)+"]",h="["+(l?"":"^")+GD(i)+"]";return[r.length&&i.length?"("+f+"|"+h+")":r.length?f:h,a,u-n,!0]};var kr=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var wU=new Set(["!","?","+","*","@"]),KD=t=>wU.has(t),NU="(?!(?:^|/)\\.\\.?(?:$|/))",_h="(?!\\.)",PU=new Set(["[","."]),RU=new Set(["..","."]),CU=new Set("().*{}+?[]^$\\!"),DU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Wv="[^/]",XD=Wv+"*?",JD=Wv+"+?",ea=class t{type;#e;#t;#i=!1;#n=[];#o;#f;#l;#d=!1;#a;#c;#s=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#f=this.#o?this.#o.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)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.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.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 n=e,r=n.#o;for(;r;){for(let i=n.#f+1;!r.type&&i<r.#n.length;i++)for(let s of e.#n){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#n[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#n.push(n)}}toJSON(){let e=this.type===null?this.#n.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#n.map(n=>n.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 n=0;n<this.#f;n++){let r=e.#n[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#n.length:0;return this.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#n)n.copyIn(r);return n}static#v(e,n,r,i){let s=!1,o=!1,a=-1,c=!1;if(n.type===null){let h=r,y="";for(;h<e.length;){let p=e.charAt(h++);if(s||p==="\\"){s=!s,y+=p;continue}if(o){h===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(h===a+2&&c)&&(o=!1),y+=p;continue}else if(p==="["){o=!0,a=h,c=!1,y+=p;continue}if(!i.noext&&KD(p)&&e.charAt(h)==="("){n.push(y),y="";let T=new t(p,n);h=t.#v(e,T,h,i),n.push(T);continue}y+=p}return n.push(y),h}let l=r+1,u=new t(null,n),d=[],f="";for(;l<e.length;){let h=e.charAt(l++);if(s||h==="\\"){s=!s,f+=h;continue}if(o){l===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===a+2&&c)&&(o=!1),f+=h;continue}else if(h==="["){o=!0,a=l,c=!1,f+=h;continue}if(KD(h)&&e.charAt(l)==="("){u.push(f),f="";let y=new t(h,u);u.push(y),l=t.#v(e,y,l,i);continue}if(h==="|"){u.push(f),f="",d.push(u),u=new t(null,n);continue}if(h===")")return f===""&&n.#n.length===0&&(n.#s=!0),u.push(f),f="",n.push(...d,u),l;f+=h}return n.type=null,n.#t=void 0,n.#n=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#v(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(h=>{let[y,p,T,_]=typeof h=="string"?t.#h(h,this.#t,c):h.toRegExpSource(e);return this.#t=this.#t||T,this.#i=this.#i||_,y}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&RU.has(this.#n[0]))){let y=PU,p=n&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),T=!n&&!e&&y.has(l.charAt(0));u=p?NU:T?_h:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,kr(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#p(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#t=void 0,[c,kr(this.toString()),!1,!1]}let o=!r||e||n||!_h?"":this.#p(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!n?_h:"")+JD;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?_h:"")+XD+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,kr(s),this.#t=!!this.#t,this.#i]}#p(e){return this.#n.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#i=this.#i||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#h(e,n,r=!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+=(CU.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,d,f]=YD(e,a);if(d){s+=l,o=o||u,a+=d-1,n=n||f;continue}}if(c==="*"){r&&e==="*"?s+=JD:s+=XD,n=!0;continue}if(c==="?"){s+=Wv,n=!0;continue}s+=DU(c)}return[s,kr(e),!!n,o]}};var ta=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var hn=(t,e,n={})=>(Yc(e),!n.nocomment&&e.charAt(0)==="#"?!1:new jn(e,n).match(t)),AU=/^\*+([^+@!?\*\[\(]*)$/,OU=t=>e=>!e.startsWith(".")&&e.endsWith(t),IU=t=>e=>e.endsWith(t),xU=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),MU=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),LU=/^\*+\.\*+$/,$U=t=>!t.startsWith(".")&&t.includes("."),qU=t=>t!=="."&&t!==".."&&t.includes("."),jU=/^\.\*+$/,FU=t=>t!=="."&&t!==".."&&t.startsWith("."),BU=/^\*+$/,UU=t=>t.length!==0&&!t.startsWith("."),VU=t=>t.length!==0&&t!=="."&&t!=="..",zU=/^\?+([^+@!?\*\[\(]*)?$/,WU=([t,e=""])=>{let n=tA([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},HU=([t,e=""])=>{let n=nA([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},GU=([t,e=""])=>{let n=nA([t]);return e?r=>n(r)&&r.endsWith(e):n},YU=([t,e=""])=>{let n=tA([t]);return e?r=>n(r)&&r.endsWith(e):n},tA=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},nA=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},rA=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",QD={win32:{sep:"\\"},posix:{sep:"/"}},KU=rA==="win32"?QD.win32.sep:QD.posix.sep;hn.sep=KU;var Yt=Symbol("globstar **");hn.GLOBSTAR=Yt;var XU="[^/]",JU=XU+"*?",QU="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ZU="(?:(?!(?:\\/|^)\\.).)*?",eV=(t,e={})=>n=>hn(n,t,e);hn.filter=eV;var Zn=(t,e={})=>Object.assign({},t,e),tV=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return hn;let e=hn;return Object.assign((r,i,s={})=>e(r,i,Zn(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,Zn(t,s))}static defaults(i){return e.defaults(Zn(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,Zn(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,Zn(t,s))}},unescape:(r,i={})=>e.unescape(r,Zn(t,i)),escape:(r,i={})=>e.escape(r,Zn(t,i)),filter:(r,i={})=>e.filter(r,Zn(t,i)),defaults:r=>e.defaults(Zn(t,r)),makeRe:(r,i={})=>e.makeRe(r,Zn(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,Zn(t,i)),match:(r,i,s={})=>e.match(r,i,Zn(t,s)),sep:e.sep,GLOBSTAR:Yt})};hn.defaults=tV;var iA=(t,e={})=>(Yc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,eA.default)(t));hn.braceExpand=iA;var nV=(t,e={})=>new jn(t,e).makeRe();hn.makeRe=nV;var rV=(t,e,n={})=>{let r=new jn(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};hn.match=rV;var ZD=/[?*]|[+@!]\(.*?\)|\[|\]/,iV=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){Yc(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||rA,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.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 n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),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]==="?"||!ZD.test(s[2]))&&!ZD.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 r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],c=r[i+2],l=r[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(i,1);let u=r.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let p=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!p&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),_=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),v=!_&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),b=T?3:p?0:void 0,k=v?3:_?0:void 0;if(typeof b=="number"&&typeof k=="number"){let[C,L]=[e[b],n[k]];C.toLowerCase()===L.toLowerCase()&&(n[k]=C,k>b?n=n.slice(k):b>k&&(e=e.slice(b)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,c=e.length,l=n.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=n[a],d=e[o];if(this.debug(n,u,d),u===!1)return!1;if(u===Yt){this.debug("GLOBSTAR",[n,u,d]);var f=o,h=a+1;if(h===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(`
|
|
287
288
|
globstar while`,e,f,n,h,y),this.matchOne(e.slice(f),n.slice(h),r))return this.debug("globstar found match!",f,c,y),!0;if(y==="."||y===".."||!i.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,f,n,h);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
|
|
288
|
-
>>> no match, partial?`,e,f,n,h),f===c))}let p;if(typeof u=="string"?(p=d===u,this.debug("string match",u,d,p)):(p=u.test(d),this.debug("pattern match",u,d,p)),!p)return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return JD(this.pattern,this.options)}parse(e){zc(e);let n=this.options;if(e==="**")return Gt;if(e==="")return"";let r,i=null;(r=e.match(xU))?i=n.dot?LU:MU:(r=e.match(wU))?i=(n.nocase?n.dot?RU:PU:n.dot?NU:kU)(r[1]):(r=e.match($U))?i=(n.nocase?n.dot?jU:qU:n.dot?FU:BU)(r):(r=e.match(CU))?i=n.dot?AU:DU:(r=e.match(OU))&&(i=IU);let s=Qo.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 n=this.options,r=n.noglobstar?zU:n.dot?WU:HU,i=new Set(n.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"?JU(u):u===Gt?Gt:u._src});return l.forEach((u,d)=>{let f=l[d+1],h=l[d-1];u!==Gt||h===Gt||(h===void 0?f!==void 0&&f!==Gt?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=h+"(?:\\/|"+r+")?":f!==Gt&&(l[d-1]=h+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=Gt))}),l.filter(u=>u!==Gt).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,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=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(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return fn.defaults(e).Minimatch}};fn.AST=Qo;fn.Minimatch=jn;fn.escape=Zo;fn.unescape=_r;var SA=require("node:url");var ea=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ZD=new Set,zv=typeof process=="object"&&process?process:{},eA=(t,e,n,r)=>{typeof zv.emitWarning=="function"?zv.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},Sh=globalThis.AbortController,QD=globalThis.AbortSignal;if(typeof Sh>"u"){QD=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Sh=class{constructor(){e()}signal=new QD;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=zv.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,eA("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 QU=t=>!ZD.has(t),jie=Symbol("type"),Qi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),tA=t=>Qi(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)}},Wv=class t{heap;length;static#e=!1;static create(e){let n=tA(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Hc=class t{#e;#t;#i;#n;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#y;#v;#p;#h;#E;#g;#w;#k;#T;#S;#_;#m;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#y,prev:e.#v,get head(){return e.#p},get tail(){return e.#h},free:e.#E,isBackgroundFetch:n=>e.#u(n),backgroundFetch:(n,r,i,s)=>e.#q(n,r,i,s),moveToTail:n=>e.#F(n),indexes:n=>e.#P(n),rindexes:n=>e.#R(n),isStale:n=>e.#b(n)}}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.#n}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:h=0,maxEntrySize:y=0,sizeCalculation:p,fetchMethod:T,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:C,ignoreFetchAbort:L}=e;if(n!==0&&!Qi(n))throw new TypeError("max option must be a nonnegative integer");let B=n?tA(n):Array;if(!B)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=h,this.maxEntrySize=y||this.#t,this.sizeCalculation=p,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(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=_,T!==void 0&&typeof T!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=T,this.#_=!!T,this.#a=new Map,this.#c=new Array(n).fill(void 0),this.#s=new Array(n).fill(void 0),this.#y=new B(n),this.#v=new B(n),this.#p=0,this.#h=0,this.#E=Wv.create(n),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#n=u,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#S=!!this.#i,this.#m=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#t!==0&&!Qi(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Qi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Qi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Qi(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 q="LRU_CACHE_UNBOUNDED";QU(q)&&(ZD.add(q),eA("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",q,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new ta(this.#e),n=new ta(this.#e);this.#T=e,this.#k=n,this.#O=(s,o,a=ea.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(s)&&this.#A(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#N=s=>{n[s]=e[s]!==0?ea.now():0},this.#r=(s,o)=>{if(e[o]){let a=e[o],c=n[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=r||i();let l=s.now-c;s.remainingTTL=a-l}};let r=0,i=()=>{let s=ea.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=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=n[o];if(!a||!c)return 1/0;let l=(r||i())-c;return a-l},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#N=()=>{};#r=()=>{};#O=()=>{};#b=()=>!1;#D(){let e=new ta(this.#e);this.#d=0,this.#w=e,this.#I=n=>{this.#d-=e[n],e[n]=0},this.#M=(n,r,i,s)=>{if(this.#u(r))return 0;if(!Qi(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!Qi(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=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#d>s;)this.#$(!0)}this.#d+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#d)}}#I=e=>{};#x=(e,n,r)=>{};#M=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#h;!(!this.#L(n)||((e||!this.#b(n))&&(yield n),n===this.#p));)n=this.#v[n]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#p;!(!this.#L(n)||((e||!this.#b(n))&&(yield n),n===this.#h));)n=this.#y[n]}#L(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*rentries(){for(let e of this.#R())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*keys(){for(let e of this.#P()){let n=this.#c[e];n!==void 0&&!this.#u(this.#s[e])&&(yield n)}}*rkeys(){for(let e of this.#R()){let n=this.#c[e];n!==void 0&&!this.#u(this.#s[e])&&(yield n)}}*values(){for(let e of this.#P())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#R())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#P()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#c[r],this))return this.get(this.#c[r],n)}}forEach(e,n=this){for(let r of this.#P()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}rforEach(e,n=this){for(let r of this.#R()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}purgeStale(){let e=!1;for(let n of this.#R({allowStale:!0}))this.#b(n)&&(this.#A(this.#c[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#s[n],i=this.#u(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#T&&this.#k){let o=this.#T[n],a=this.#k[n];if(o&&a){let c=o-(ea.now()-a);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[n]),s}dump(){let e=[];for(let n of this.#P({allowStale:!0})){let r=this.#c[n],i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#T&&this.#k){o.ttl=this.#T[n];let a=ea.now()-this.#k[n];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=ea.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#M(e,n,r.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.#h:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#$(!1):this.#l,this.#c[d]=e,this.#s[d]=n,this.#a.set(e,d),this.#y[this.#h]=d,this.#v[d]=this.#h,this.#h=d,this.#l++,this.#x(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(n!==f){if(this.#_&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=f;h!==void 0&&!o&&(this.#S&&this.#i?.(h,e,"set"),this.#m&&this.#g?.push([h,e,"set"]))}else o||(this.#S&&this.#i?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#I(d),this.#x(d,u,c),this.#s[d]=n,c){c.set="replace";let h=f&&this.#u(f)?f.__staleWhileFetching:f;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update")}if(i!==0&&!this.#T&&this.#C(),this.#T&&(l||this.#O(d,i,s),c&&this.#r(c,d)),!o&&this.#m&&this.#g){let f=this.#g,h;for(;h=f?.shift();)this.#n?.(...h)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#p];if(this.#$(!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,n;for(;n=e?.shift();)this.#n?.(...n)}}}#$(e){let n=this.#p,r=this.#c[n],i=this.#s[n];return this.#_&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#S||this.#m)&&(this.#S&&this.#i?.(i,r,"evict"),this.#m&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#c[n]=void 0,this.#s[n]=void 0,this.#E.push(n)),this.#l===1?(this.#p=this.#h=0,this.#E.length=0):this.#p=this.#y[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,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.#b(s))i&&(i.has="stale",this.#r(i,s));else return r&&this.#N(s),i&&(i.has="hit",this.#r(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#s[i];return this.#u(s)?s.__staleWhileFetching:s}#q(e,n,r,i){let s=n===void 0?void 0:this.#s[n];if(this.#u(s))return s;let o=new Sh,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:i},l=(p,T=!1)=>{let{aborted:_}=o.signal,v=r.ignoreFetchAbort&&p!==void 0;if(r.status&&(_&&!T?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,v&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),_&&!v&&!T)return d(o.signal.reason);let b=h;return this.#s[n]===h&&(p===void 0?b.__staleWhileFetching?this.#s[n]=b.__staleWhileFetching:this.#A(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,p,c.options))),p},u=p=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=p),d(p)),d=p=>{let{aborted:T}=o.signal,_=T&&r.allowStaleOnFetchAbort,v=_||r.allowStaleOnFetchRejection,b=v||r.noDeleteOnFetchRejection,w=h;if(this.#s[n]===h&&(!b||w.__staleWhileFetching===void 0?this.#A(e,"fetch"):_||(this.#s[n]=w.__staleWhileFetching)),v)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw p},f=(p,T)=>{let _=this.#o?.(e,s,c);_&&_ instanceof Promise&&_.then(v=>p(v===void 0?void 0:v),T),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(p(void 0),r.allowStaleOnFetchAbort&&(p=v=>l(v,!0)))})};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(f).then(l,u),y=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,y,{...c.options,status:void 0}),n=this.#a.get(e)):this.#s[n]=y,y}#u(e){if(!this.#_)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Sh}async fetch(e,n={}){let{allowStale:r=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:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:p,forceRefresh:T=!1,status:_,signal:v}=n;if(!this.#_)return _&&(_.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:_});let b={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:y,ignoreFetchAbort:h,status:_,signal:v},w=this.#a.get(e);if(w===void 0){_&&(_.fetch="miss");let C=this.#q(e,w,b,p);return C.__returned=C}else{let C=this.#s[w];if(this.#u(C)){let ze=r&&C.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",ze&&(_.returnedStale=!0)),ze?C.__staleWhileFetching:C.__returned=C}let L=this.#b(w);if(!T&&!L)return _&&(_.fetch="hit"),this.#F(w),i&&this.#N(w),_&&this.#r(_,w),C;let B=this.#q(e,w,b,p),ce=B.__staleWhileFetching!==void 0&&r;return _&&(_.fetch=L?"stale":"refresh",ce&&L&&(_.returnedStale=!0)),ce?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#f;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=r(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#r(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&r&&(o.returnedStale=!0),r?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),i&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,n){this.#v[n]=e,this.#y[e]=n}#F(e){e!==this.#h&&(e===this.#p?this.#p=this.#y[e]:this.#j(this.#v[e],this.#y[e]),this.#j(this.#h,e),this.#h=e)}delete(e){return this.#A(e,"delete")}#A(e,n){let r=!1;if(this.#l!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(i);let s=this.#s[i];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#m)&&(this.#S&&this.#i?.(s,e,n),this.#m&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#c[i]=void 0,this.#s[i]=void 0,i===this.#h)this.#h=this.#v[i];else if(i===this.#p)this.#p=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.#E.push(i)}}if(this.#m&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#n?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#R({allowStale:!0})){let r=this.#s[n];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#c[n];this.#S&&this.#i?.(r,i,e),this.#m&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#T&&this.#k&&(this.#T.fill(0),this.#k.fill(0)),this.#w&&this.#w.fill(0),this.#p=0,this.#h=0,this.#E.length=0,this.#d=0,this.#l=0,this.#m&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#n?.(...r)}}};var ia=require("node:path"),dA=require("node:url"),Kr=require("fs"),cV=K(require("node:fs"),1),ts=require("node:fs/promises");var Rh=require("node:events"),Qv=K(require("node:stream"),1),oA=require("node:string_decoder"),nA=typeof process=="object"&&process?process:{stdout:null,stderr:null},ZU=t=>!!t&&typeof t=="object"&&(t instanceof es||t instanceof Qv.default||eV(t)||tV(t)),eV=t=>!!t&&typeof t=="object"&&t instanceof Rh.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==Qv.default.Writable.prototype.pipe,tV=t=>!!t&&typeof t=="object"&&t instanceof Rh.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",yi=Symbol("EOF"),vi=Symbol("maybeEmitEnd"),Zi=Symbol("emittedEnd"),_h=Symbol("emittingEnd"),Gc=Symbol("emittedError"),Eh=Symbol("closed"),rA=Symbol("read"),wh=Symbol("flush"),iA=Symbol("flushChunk"),Er=Symbol("encoding"),na=Symbol("decoder"),Ft=Symbol("flowing"),Yc=Symbol("paused"),ra=Symbol("resume"),Bt=Symbol("buffer"),hn=Symbol("pipes"),Ut=Symbol("bufferLength"),Hv=Symbol("bufferPush"),kh=Symbol("bufferShift"),rn=Symbol("objectMode"),wt=Symbol("destroyed"),Gv=Symbol("error"),Yv=Symbol("emitData"),sA=Symbol("emitEnd"),Kv=Symbol("emitEnd2"),Gr=Symbol("async"),Xv=Symbol("abort"),Nh=Symbol("aborted"),Kc=Symbol("signal"),Is=Symbol("dataListeners"),Fn=Symbol("discarded"),Xc=t=>Promise.resolve().then(t),nV=t=>t(),rV=t=>t==="end"||t==="finish"||t==="prefinish",iV=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,sV=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Ph=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[ra](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Jv=class extends Ph{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},oV=t=>!!t.objectMode,aV=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",es=class extends Rh.EventEmitter{[Ft]=!1;[Yc]=!1;[hn]=[];[Bt]=[];[rn];[Er];[Gr];[na];[yi]=!1;[Zi]=!1;[_h]=!1;[Eh]=!1;[Gc]=null;[Ut]=0;[wt]=!1;[Kc];[Nh]=!1;[Is]=0;[Fn]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");oV(n)?(this[rn]=!0,this[Er]=null):aV(n)?(this[Er]=n.encoding,this[rn]=!1):(this[rn]=!1,this[Er]=null),this[Gr]=!!n.async,this[na]=this[Er]?new oA.StringDecoder(this[Er]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Bt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[hn]});let{signal:r}=n;r&&(this[Kc]=r,r.aborted?this[Xv]():r.addEventListener("abort",()=>this[Xv]()))}get bufferLength(){return this[Ut]}get encoding(){return this[Er]}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[rn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Gr]}set async(e){this[Gr]=this[Gr]||!!e}[Xv](){this[Nh]=!0,this.emit("abort",this[Kc]?.reason),this.destroy(this[Kc]?.reason)}get aborted(){return this[Nh]}set aborted(e){}write(e,n,r){if(this[Nh])return!1;if(this[yi])throw new Error("write after end");if(this[wt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[Gr]?Xc:nV;if(!this[rn]&&!Buffer.isBuffer(e)){if(sV(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(iV(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[rn]?(this[Ft]&&this[Ut]!==0&&this[wh](!0),this[Ft]?this.emit("data",e):this[Hv](e),this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft]):e.length?(typeof e=="string"&&!(n===this[Er]&&!this[na]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Er]&&(e=this[na].write(e)),this[Ft]&&this[Ut]!==0&&this[wh](!0),this[Ft]?this.emit("data",e):this[Hv](e),this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft]):(this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft])}read(e){if(this[wt])return null;if(this[Fn]=!1,this[Ut]===0||e===0||e&&e>this[Ut])return this[vi](),null;this[rn]&&(e=null),this[Bt].length>1&&!this[rn]&&(this[Bt]=[this[Er]?this[Bt].join(""):Buffer.concat(this[Bt],this[Ut])]);let n=this[rA](e||null,this[Bt][0]);return this[vi](),n}[rA](e,n){if(this[rn])this[kh]();else{let r=n;e===r.length||e===null?this[kh]():typeof r=="string"?(this[Bt][0]=r.slice(e),n=r.slice(0,e),this[Ut]-=e):(this[Bt][0]=r.subarray(e),n=r.subarray(0,e),this[Ut]-=e)}return this.emit("data",n),!this[Bt].length&&!this[yi]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[yi]=!0,this.writable=!1,(this[Ft]||!this[Yc])&&this[vi](),this}[ra](){this[wt]||(!this[Is]&&!this[hn].length&&(this[Fn]=!0),this[Yc]=!1,this[Ft]=!0,this.emit("resume"),this[Bt].length?this[wh]():this[yi]?this[vi]():this.emit("drain"))}resume(){return this[ra]()}pause(){this[Ft]=!1,this[Yc]=!0,this[Fn]=!1}get destroyed(){return this[wt]}get flowing(){return this[Ft]}get paused(){return this[Yc]}[Hv](e){this[rn]?this[Ut]+=1:this[Ut]+=e.length,this[Bt].push(e)}[kh](){return this[rn]?this[Ut]-=1:this[Ut]-=this[Bt][0].length,this[Bt].shift()}[wh](e=!1){do;while(this[iA](this[kh]())&&this[Bt].length);!e&&!this[Bt].length&&!this[yi]&&this.emit("drain")}[iA](e){return this.emit("data",e),this[Ft]}pipe(e,n){if(this[wt])return e;this[Fn]=!1;let r=this[Zi];return n=n||{},e===nA.stdout||e===nA.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[hn].push(n.proxyErrors?new Jv(this,e,n):new Ph(this,e,n)),this[Gr]?Xc(()=>this[ra]()):this[ra]()),e}unpipe(e){let n=this[hn].find(r=>r.dest===e);n&&(this[hn].length===1?(this[Ft]&&this[Is]===0&&(this[Ft]=!1),this[hn]=[]):this[hn].splice(this[hn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[Fn]=!1,this[Is]++,!this[hn].length&&!this[Ft]&&this[ra]();else if(e==="readable"&&this[Ut]!==0)super.emit("readable");else if(rV(e)&&this[Zi])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Gc]){let i=n;this[Gr]?Xc(()=>i.call(this,this[Gc])):i.call(this,this[Gc])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Is]=this.listeners("data").length,this[Is]===0&&!this[Fn]&&!this[hn].length&&(this[Ft]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Is]=0,!this[Fn]&&!this[hn].length&&(this[Ft]=!1)),n}get emittedEnd(){return this[Zi]}[vi](){!this[_h]&&!this[Zi]&&!this[wt]&&this[Bt].length===0&&this[yi]&&(this[_h]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Eh]&&this.emit("close"),this[_h]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==wt&&this[wt])return!1;if(e==="data")return!this[rn]&&!r?!1:this[Gr]?(Xc(()=>this[Yv](r)),!0):this[Yv](r);if(e==="end")return this[sA]();if(e==="close"){if(this[Eh]=!0,!this[Zi]&&!this[wt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Gc]=r,super.emit(Gv,r);let s=!this[Kc]||this.listeners("error").length?super.emit("error",r):!1;return this[vi](),s}else if(e==="resume"){let s=super.emit("resume");return this[vi](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[vi](),i}[Yv](e){for(let r of this[hn])r.dest.write(e)===!1&&this.pause();let n=this[Fn]?!1:super.emit("data",e);return this[vi](),n}[sA](){return this[Zi]?!1:(this[Zi]=!0,this.readable=!1,this[Gr]?(Xc(()=>this[Kv]()),!0):this[Kv]())}[Kv](){if(this[na]){let n=this[na].end();if(n){for(let r of this[hn])r.dest.write(n);this[Fn]||super.emit("data",n)}}for(let n of this[hn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[rn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[rn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[rn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Er]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(wt,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Fn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[yi])return n();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(wt,u),n(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(wt,u),this.pause(),s({value:d,done:!!this[yi]})},l=()=>{this.off("error",a),this.off("data",c),this.off(wt,u),n(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,s=d,this.once(wt,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Fn]=!1;let e=!1,n=()=>(this.pause(),this.off(Gv,n),this.off(wt,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(Gv,n),this.once(wt,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[wt])return e?this.emit("error",e):this.emit(wt),this;this[wt]=!0,this[Fn]=!0,this[Bt].length=0,this[Ut]=0;let n=this;return typeof n.close=="function"&&!this[Eh]&&n.close(),e?this.emit("error",e):this.emit(wt),this}static get isStream(){return ZU}};var lV=Kr.realpathSync.native,Qc={lstatSync:Kr.lstatSync,readdir:Kr.readdir,readdirSync:Kr.readdirSync,readlinkSync:Kr.readlinkSync,realpathSync:lV,promises:{lstat:ts.lstat,readdir:ts.readdir,readlink:ts.readlink,realpath:ts.realpath}},fA=t=>!t||t===Qc||t===cV?Qc:{...Qc,...t,promises:{...Qc.promises,...t.promises||{}}},hA=/^\\\\\?\\([a-z]:)\\?$/i,uV=t=>t.replace(/\//g,"\\").replace(hA,"$1\\"),dV=/[\\\/]/,Zn=0,pA=1,mA=2,Yr=4,gA=6,yA=8,xs=10,vA=12,Qn=15,Jc=~Qn,Zv=16,aA=32,Zc=64,wr=128,Ch=256,Ah=512,cA=Zc|wr|Ah,fV=1023,eb=t=>t.isFile()?yA:t.isDirectory()?Yr:t.isSymbolicLink()?xs:t.isCharacterDevice()?mA:t.isBlockDevice()?gA:t.isSocket()?vA:t.isFIFO()?pA:Zn,lA=new Map,el=t=>{let e=lA.get(t);if(e)return e;let n=t.normalize("NFKD");return lA.set(t,n),n},uA=new Map,Dh=t=>{let e=uA.get(t);if(e)return e;let n=el(t.toLowerCase());return uA.set(t,n),n},Oh=class extends Hc{constructor(){super({max:256})}},tb=class extends Hc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}},bA=Symbol("PathScurry setAsCwd"),sn=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#n;get nlink(){return this.#n}#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}#p;get ctimeMs(){return this.#p}#h;get birthtimeMs(){return this.#h}#E;get atime(){return this.#E}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#k;get birthtime(){return this.#k}#T;#S;#_;#m;#C;#N;#r;#O;#b;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=Zn,r,i,s,o,a){this.name=e,this.#T=s?Dh(e):el(e),this.#r=n&fV,this.nocase=s,this.roots=i,this.root=r||this,this.#O=o,this.#_=a.fullpath,this.#C=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=fA(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#O}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#O.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#O.set(this,n),this.#r&=~Zv,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Dh(e):el(e);for(let c of r)if(c.#T===i)return c;let s=this.parent?this.sep:"",o=this.#_?this.#_+s+e:void 0,a=this.newChild(e,Zn,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=wr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,n=this.parent;if(!n)return this.#C=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,n=this.parent;if(!n)return this.#N=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#_!==void 0)return this.#_;let e=this.name,n=this.parent;if(!n)return this.#_=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#_=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,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#m=r}isUnknown(){return(this.#r&Qn)===Zn}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.#r&Qn)===yA}isDirectory(){return(this.#r&Qn)===Yr}isCharacterDevice(){return(this.#r&Qn)===mA}isBlockDevice(){return(this.#r&Qn)===gA}isFIFO(){return(this.#r&Qn)===pA}isSocket(){return(this.#r&Qn)===vA}isSymbolicLink(){return(this.#r&xs)===xs}lstatCached(){return this.#r&aA?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#r&Qn;return!(e!==Zn&&e!==xs||this.#r&Ch||this.#r&wr)}calledReaddir(){return!!(this.#r&Zv)}isENOENT(){return!!(this.#r&wr)}isNamed(e){return this.nocase?this.#T===Dh(e):this.#T===el(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#b=r}catch(n){this.#u(n.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#b=r}catch(n){this.#u(n.code);return}}#x(e){this.#r|=Zv;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#M()}}#M(){this.#r&wr||(this.#r=(this.#r|wr)&Jc,this.#P())}#P(){let e=this.children();e.provisional=0;for(let n of e)n.#M()}#R(){this.#r|=Ah,this.#L()}#L(){if(this.#r&Zc)return;let e=this.#r;(e&Qn)===Yr&&(e&=Jc),this.#r=e|Zc,this.#P()}#$(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#M():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#M()}#u(e=""){let n=this.#r;n|=Ch,e==="ENOENT"&&(n|=wr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=Jc),this.#r=n,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#j(e,n){return this.#A(e,n)||this.#F(e,n)}#F(e,n){let r=eb(e),i=this.newChild(e.name,r,{parent:this}),s=i.#r&Qn;return s!==Yr&&s!==xs&&s!==Zn&&(i.#r|=Zc),n.unshift(i),n.provisional++,i}#A(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?Dh(e.name):el(e.name))===i.#T)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#r=n.#r&Jc|eb(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if((this.#r&wr)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#r&wr)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#W(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:h,mtime:y,mtimeMs:p,nlink:T,rdev:_,size:v,uid:b}=e;this.#E=n,this.#y=r,this.#k=i,this.#h=s,this.#d=o,this.#s=a,this.#w=c,this.#p=l,this.#t=u,this.#f=d,this.#a=f,this.#i=h,this.#g=y,this.#v=p,this.#n=T,this.#l=_,this.#c=v,this.#o=b;let w=eb(e);this.#r=this.#r&Jc|w|aA,w!==Zn&&w!==Yr&&w!==xs&&(this.#r|=Zc)}#V=[];#z=!1;#H(e){this.#z=!1;let n=this.#V.slice();this.#V.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#V.push(e),this.#z)return;this.#z=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#$(s.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#x(r)}this.#H(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#j(i,e);this.#x(e)}catch(i){this.#$(i.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#j(r,e);this.#x(e)}catch(r){this.#$(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&cA)return!1;let e=Qn&this.#r;return e===Zn||e===Yr||e===xs}shouldWalk(e,n){return(this.#r&Yr)===Yr&&!(this.#r&cA)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#D)return this.#D;if(!((Ah|Ch|wr)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#D)return this.#D;if(!((Ah|Ch|wr)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}[bA](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#C=r.join(this.sep),i.#N=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#C=void 0,i.#N=void 0,i=i.parent}},Ih=class t extends sn{sep="\\";splitSep=dV;constructor(e,n=Zn,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=Zn,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return ia.win32.parse(e).root}getRoot(e){if(e=uV(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new sa(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(hA,"$1\\"),e===n}},xh=class t extends sn{splitSep="/";sep="/";constructor(e,n=Zn,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=Zn,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Mh=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#n;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=Qc}={}){this.#n=fA(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,dA.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Oh,this.#t=new Oh,this.#i=new tb(s);let c=a.substring(this.rootPath.length).split(r);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.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=n.sep,f=this.rootPath,h=!1;for(let y of c){let p=u--;l=l.child(y,{relative:new Array(p).fill("..").join(d),relativePosix:new Array(p).fill("..").join("/"),fullpath:f+=(h?"":d)+y}),h=!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 n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,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,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?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:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((h,y)=>{if(h)return f(h);let p=y.length;if(!p)return f();let T=()=>{--p===0&&f()};for(let _ of y)(!s||s(_))&&a.push(r?_:_.fullpath()),i&&_.isSymbolicLink()?_.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,T):T()):_.shouldWalk(c,o)?l(_,T):T()},!0)},u=e;return new Promise((d,f)=>{l(u,h=>{if(h)return f(h);d(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!s||s(d))&&a.push(r?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,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!s||s(u))&&(yield r?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,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new es({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=(T,_,v=!1)=>{if(T)return a.emit("error",T);if(i&&!v){let b=[];for(let w of _)w.isSymbolicLink()&&b.push(w.realpath().then(C=>C?.isUnknown()?C.lstat():C));if(b.length){Promise.all(b).then(()=>y(null,_,!0));return}}for(let b of _)b&&(!s||s(b))&&(a.write(r?b:b.fullpath())||(f=!0));u--;for(let b of _){let w=b.realpathCached()||b;w.shouldWalk(c,o)&&l.push(w)}f&&!a.flowing?a.once("drain",d):p||d()},p=!0;h.readdirCB(y,!0),p=!1}};return d(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new es({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=h.readdirSync();for(let p of y)(!s||s(p))&&(a.write(r?p:p.fullpath())||(f=!0));u--;for(let p of y){let T=p;if(p.isSymbolicLink()){if(!(i&&(T=p.realpathSync())))continue;T.isUnknown()&&T.lstatSync()}T.shouldWalk(c,o)&&l.push(T)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[bA](n)}},sa=class extends Mh{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,ia.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return ia.win32.parse(e).root.toUpperCase()}newRoot(e){return new Ih(this.rootPath,Yr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},oa=class extends Mh{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,ia.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new xh(this.rootPath,Yr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},tl=class extends oa{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}},zie=process.platform==="win32"?Ih:xh,TA=process.platform==="win32"?sa:process.platform==="darwin"?tl:oa;var hV=t=>t.length>=1,pV=t=>t.length>=1,aa=class t{#e;#t;#i;length;#n;#o;#f;#l;#d;#a;#c=!0;constructor(e,n,r,i){if(!hV(e))throw new TypeError("empty pattern list");if(!pV(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#i=r,this.#n=i,this.#i===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,f,h,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let p=[s,o,a,c,""].join("/"),T=[u,d,f,h,""].join("/");this.#e=[p,...l],this.#t=[T,...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]===Gt}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.#n),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.#n==="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.#n==="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 mV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ca=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=mV}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new jn(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new aa(i,s,0,this.platform),a=new jn(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 n=e.fullpath(),r=`${n}/`,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(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};var nb=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}},rb=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}},ib=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},nl=class t{hasWalkedCache;matches=new rb;subwalks=new ib;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new nb}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){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===Gt){(!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 h=i.parent||i;f?this.hasWalkedCache.hasWalked(h,f)||this.subwalks.add(h,f):this.matches.add(h,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,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Gt?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,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var gV=(t,e)=>typeof t=="string"?new ca([t],e):Array.isArray(t)?new ca(t,e):t,Lh=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=gV(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(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,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}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,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}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,n)}matchFinish(e,n){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n: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(r){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,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new nl(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,r,o):a.readdirCB((l,u)=>this.walkCB3(a,u,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of r.subwalks.entries())s++,this.walkCB2(a,c,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new nl(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())s++,this.walkCB2Sync(a,c,r.child(),o);o()}},rl=class extends Lh{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(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}},il=class extends Lh{results;constructor(e,n,r){super(e,n,r),this.results=new es({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 yV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",kr=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,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,SA.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=n.platform||yV,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=n.platform==="win32"?sa:n.platform==="darwin"?tl:n.platform?oa:TA;this.scurry=new c(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(c=>new jn(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 aa(c,u,0,this.platform)})}async walk(){return[...await new rl(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 rl(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 il(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 il(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 sb=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new jn(n,e).hasMagic())return!0;return!1};function $h(t,e={}){return new kr(t,e).streamSync()}function EA(t,e={}){return new kr(t,e).stream()}function wA(t,e={}){return new kr(t,e).walkSync()}async function _A(t,e={}){return new kr(t,e).walk()}function qh(t,e={}){return new kr(t,e).iterateSync()}function kA(t,e={}){return new kr(t,e).iterate()}var vV=$h,bV=Object.assign(EA,{sync:$h}),TV=qh,SV=Object.assign(kA,{sync:qh}),_V=Object.assign(wA,{stream:$h,iterate:qh}),Ms=Object.assign(_A,{glob:_A,globSync:wA,sync:_V,globStream:EA,stream:bV,globStreamSync:$h,streamSync:vV,globIterate:kA,iterate:SV,globIterateSync:qh,iterateSync:TV,Glob:kr,hasMagic:sb,escape:Zo,unescape:_r});Ms.glob=Ms;var oS=require("path"),aS=require("fs");var Cx=K(Nx());var iS={};SM(iS,{$id:()=>WY,$schema:()=>zY,default:()=>XY,definitions:()=>GY,properties:()=>KY,title:()=>HY,type:()=>YY});var zY="http://json-schema.org/draft-07/schema#",WY="http://json-schema.org/draft-07/schema#",HY="Core schema meta-schema",GY={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:[]}},YY=["object","boolean"],KY={$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:"#"}},XY={$schema:zY,$id:WY,title:HY,definitions:GY,type:YY,properties:KY,default:!0};var xt=K(J());var bp=class extends ec{constructor(n,r){super();this.ajv=n;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(n,r){let i=[],s=r.getProperty("status"),o=s?.ast.values?.values.at(0)?.value;if(o instanceof Le&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>i.push($(21,c,xt.DiagnosticSeverity.Hint,[...s?.ast?[s?.ast]:[]],[xt.DiagnosticTag.Unnecessary]))),i;let a=ke.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>i.push(...JY(n,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.pathString}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.pathString}`,this.schemaKey,c)}return i}getOnPropertyHover(n){let r=(this.validate?.schema).properties?.[n];if(r&&typeof r=="object"&&"description"in r)return{kind:xt.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
|
|
289
|
+
>>> no match, partial?`,e,f,n,h),f===c))}let p;if(typeof u=="string"?(p=d===u,this.debug("string match",u,d,p)):(p=u.test(d),this.debug("pattern match",u,d,p)),!p)return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return iA(this.pattern,this.options)}parse(e){Yc(e);let n=this.options;if(e==="**")return Yt;if(e==="")return"";let r,i=null;(r=e.match(BU))?i=n.dot?VU:UU:(r=e.match(AU))?i=(n.nocase?n.dot?MU:xU:n.dot?IU:OU)(r[1]):(r=e.match(zU))?i=(n.nocase?n.dot?HU:WU:n.dot?GU:YU)(r):(r=e.match(LU))?i=n.dot?qU:$U:(r=e.match(jU))&&(i=FU);let s=ea.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 n=this.options,r=n.noglobstar?JU:n.dot?QU:ZU,i=new Set(n.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"?iV(u):u===Yt?Yt:u._src});return l.forEach((u,d)=>{let f=l[d+1],h=l[d-1];u!==Yt||h===Yt||(h===void 0?f!==void 0&&f!==Yt?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=h+"(?:\\/|"+r+")?":f!==Yt&&(l[d-1]=h+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=Yt))}),l.filter(u=>u!==Yt).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,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=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(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return hn.defaults(e).Minimatch}};hn.AST=ea;hn.Minimatch=jn;hn.escape=ta;hn.unescape=kr;var RA=require("node:url");var na=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,oA=new Set,Hv=typeof process=="object"&&process?process:{},aA=(t,e,n,r)=>{typeof Hv.emitWarning=="function"?Hv.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},Eh=globalThis.AbortController,sA=globalThis.AbortSignal;if(typeof Eh>"u"){sA=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Eh=class{constructor(){e()}signal=new sA;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=Hv.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,aA("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 sV=t=>!oA.has(t),Qie=Symbol("type"),Zi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),cA=t=>Zi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ra:null:null,ra=class extends Array{constructor(e){super(e),this.fill(0)}},Gv=class t{heap;length;static#e=!1;static create(e){let n=cA(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Xc=class t{#e;#t;#i;#n;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#y;#v;#p;#h;#E;#g;#k;#w;#T;#S;#_;#m;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#T,sizes:e.#k,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#y,prev:e.#v,get head(){return e.#p},get tail(){return e.#h},free:e.#E,isBackgroundFetch:n=>e.#u(n),backgroundFetch:(n,r,i,s)=>e.#q(n,r,i,s),moveToTail:n=>e.#F(n),indexes:n=>e.#P(n),rindexes:n=>e.#R(n),isStale:n=>e.#b(n)}}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.#n}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:h=0,maxEntrySize:y=0,sizeCalculation:p,fetchMethod:T,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:C,ignoreFetchAbort:L}=e;if(n!==0&&!Zi(n))throw new TypeError("max option must be a nonnegative integer");let B=n?cA(n):Array;if(!B)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=h,this.maxEntrySize=y||this.#t,this.sizeCalculation=p,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(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=_,T!==void 0&&typeof T!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=T,this.#_=!!T,this.#a=new Map,this.#c=new Array(n).fill(void 0),this.#s=new Array(n).fill(void 0),this.#y=new B(n),this.#v=new B(n),this.#p=0,this.#h=0,this.#E=Gv.create(n),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#n=u,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#S=!!this.#i,this.#m=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#t!==0&&!Zi(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Zi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Zi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Zi(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 q="LRU_CACHE_UNBOUNDED";sV(q)&&(oA.add(q),aA("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",q,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new ra(this.#e),n=new ra(this.#e);this.#T=e,this.#w=n,this.#O=(s,o,a=na.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(s)&&this.#A(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#N=s=>{n[s]=e[s]!==0?na.now():0},this.#r=(s,o)=>{if(e[o]){let a=e[o],c=n[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=r||i();let l=s.now-c;s.remainingTTL=a-l}};let r=0,i=()=>{let s=na.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=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=n[o];if(!a||!c)return 1/0;let l=(r||i())-c;return a-l},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#N=()=>{};#r=()=>{};#O=()=>{};#b=()=>!1;#D(){let e=new ra(this.#e);this.#d=0,this.#k=e,this.#I=n=>{this.#d-=e[n],e[n]=0},this.#M=(n,r,i,s)=>{if(this.#u(r))return 0;if(!Zi(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!Zi(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=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#d>s;)this.#$(!0)}this.#d+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#d)}}#I=e=>{};#x=(e,n,r)=>{};#M=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#h;!(!this.#L(n)||((e||!this.#b(n))&&(yield n),n===this.#p));)n=this.#v[n]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#p;!(!this.#L(n)||((e||!this.#b(n))&&(yield n),n===this.#h));)n=this.#y[n]}#L(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*rentries(){for(let e of this.#R())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*keys(){for(let e of this.#P()){let n=this.#c[e];n!==void 0&&!this.#u(this.#s[e])&&(yield n)}}*rkeys(){for(let e of this.#R()){let n=this.#c[e];n!==void 0&&!this.#u(this.#s[e])&&(yield n)}}*values(){for(let e of this.#P())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#R())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#P()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#c[r],this))return this.get(this.#c[r],n)}}forEach(e,n=this){for(let r of this.#P()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}rforEach(e,n=this){for(let r of this.#R()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}purgeStale(){let e=!1;for(let n of this.#R({allowStale:!0}))this.#b(n)&&(this.#A(this.#c[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#s[n],i=this.#u(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#T&&this.#w){let o=this.#T[n],a=this.#w[n];if(o&&a){let c=o-(na.now()-a);s.ttl=c,s.start=Date.now()}}return this.#k&&(s.size=this.#k[n]),s}dump(){let e=[];for(let n of this.#P({allowStale:!0})){let r=this.#c[n],i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#T&&this.#w){o.ttl=this.#T[n];let a=na.now()-this.#w[n];o.start=Math.floor(Date.now()-a)}this.#k&&(o.size=this.#k[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=na.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#M(e,n,r.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.#h:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#$(!1):this.#l,this.#c[d]=e,this.#s[d]=n,this.#a.set(e,d),this.#y[this.#h]=d,this.#v[d]=this.#h,this.#h=d,this.#l++,this.#x(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(n!==f){if(this.#_&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=f;h!==void 0&&!o&&(this.#S&&this.#i?.(h,e,"set"),this.#m&&this.#g?.push([h,e,"set"]))}else o||(this.#S&&this.#i?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#I(d),this.#x(d,u,c),this.#s[d]=n,c){c.set="replace";let h=f&&this.#u(f)?f.__staleWhileFetching:f;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update")}if(i!==0&&!this.#T&&this.#C(),this.#T&&(l||this.#O(d,i,s),c&&this.#r(c,d)),!o&&this.#m&&this.#g){let f=this.#g,h;for(;h=f?.shift();)this.#n?.(...h)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#p];if(this.#$(!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,n;for(;n=e?.shift();)this.#n?.(...n)}}}#$(e){let n=this.#p,r=this.#c[n],i=this.#s[n];return this.#_&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#S||this.#m)&&(this.#S&&this.#i?.(i,r,"evict"),this.#m&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#c[n]=void 0,this.#s[n]=void 0,this.#E.push(n)),this.#l===1?(this.#p=this.#h=0,this.#E.length=0):this.#p=this.#y[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,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.#b(s))i&&(i.has="stale",this.#r(i,s));else return r&&this.#N(s),i&&(i.has="hit",this.#r(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#s[i];return this.#u(s)?s.__staleWhileFetching:s}#q(e,n,r,i){let s=n===void 0?void 0:this.#s[n];if(this.#u(s))return s;let o=new Eh,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:i},l=(p,T=!1)=>{let{aborted:_}=o.signal,v=r.ignoreFetchAbort&&p!==void 0;if(r.status&&(_&&!T?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,v&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),_&&!v&&!T)return d(o.signal.reason);let b=h;return this.#s[n]===h&&(p===void 0?b.__staleWhileFetching?this.#s[n]=b.__staleWhileFetching:this.#A(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,p,c.options))),p},u=p=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=p),d(p)),d=p=>{let{aborted:T}=o.signal,_=T&&r.allowStaleOnFetchAbort,v=_||r.allowStaleOnFetchRejection,b=v||r.noDeleteOnFetchRejection,k=h;if(this.#s[n]===h&&(!b||k.__staleWhileFetching===void 0?this.#A(e,"fetch"):_||(this.#s[n]=k.__staleWhileFetching)),v)return r.status&&k.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),k.__staleWhileFetching;if(k.__returned===k)throw p},f=(p,T)=>{let _=this.#o?.(e,s,c);_&&_ instanceof Promise&&_.then(v=>p(v===void 0?void 0:v),T),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(p(void 0),r.allowStaleOnFetchAbort&&(p=v=>l(v,!0)))})};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(f).then(l,u),y=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,y,{...c.options,status:void 0}),n=this.#a.get(e)):this.#s[n]=y,y}#u(e){if(!this.#_)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Eh}async fetch(e,n={}){let{allowStale:r=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:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:p,forceRefresh:T=!1,status:_,signal:v}=n;if(!this.#_)return _&&(_.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:_});let b={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:y,ignoreFetchAbort:h,status:_,signal:v},k=this.#a.get(e);if(k===void 0){_&&(_.fetch="miss");let C=this.#q(e,k,b,p);return C.__returned=C}else{let C=this.#s[k];if(this.#u(C)){let ze=r&&C.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",ze&&(_.returnedStale=!0)),ze?C.__staleWhileFetching:C.__returned=C}let L=this.#b(k);if(!T&&!L)return _&&(_.fetch="hit"),this.#F(k),i&&this.#N(k),_&&this.#r(_,k),C;let B=this.#q(e,k,b,p),ce=B.__staleWhileFetching!==void 0&&r;return _&&(_.fetch=L?"stale":"refresh",ce&&L&&(_.returnedStale=!0)),ce?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#f;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=r(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#r(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&r&&(o.returnedStale=!0),r?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),i&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,n){this.#v[n]=e,this.#y[e]=n}#F(e){e!==this.#h&&(e===this.#p?this.#p=this.#y[e]:this.#j(this.#v[e],this.#y[e]),this.#j(this.#h,e),this.#h=e)}delete(e){return this.#A(e,"delete")}#A(e,n){let r=!1;if(this.#l!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(i);let s=this.#s[i];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#m)&&(this.#S&&this.#i?.(s,e,n),this.#m&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#c[i]=void 0,this.#s[i]=void 0,i===this.#h)this.#h=this.#v[i];else if(i===this.#p)this.#p=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.#E.push(i)}}if(this.#m&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#n?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#R({allowStale:!0})){let r=this.#s[n];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#c[n];this.#S&&this.#i?.(r,i,e),this.#m&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#T&&this.#w&&(this.#T.fill(0),this.#w.fill(0)),this.#k&&this.#k.fill(0),this.#p=0,this.#h=0,this.#E.length=0,this.#d=0,this.#l=0,this.#m&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#n?.(...r)}}};var oa=require("node:path"),vA=require("node:url"),Jr=require("fs"),mV=K(require("node:fs"),1),ns=require("node:fs/promises");var Dh=require("node:events"),eb=K(require("node:stream"),1),hA=require("node:string_decoder"),lA=typeof process=="object"&&process?process:{stdout:null,stderr:null},oV=t=>!!t&&typeof t=="object"&&(t instanceof ts||t instanceof eb.default||aV(t)||cV(t)),aV=t=>!!t&&typeof t=="object"&&t instanceof Dh.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==eb.default.Writable.prototype.pipe,cV=t=>!!t&&typeof t=="object"&&t instanceof Dh.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",vi=Symbol("EOF"),bi=Symbol("maybeEmitEnd"),es=Symbol("emittedEnd"),kh=Symbol("emittingEnd"),Jc=Symbol("emittedError"),wh=Symbol("closed"),uA=Symbol("read"),Nh=Symbol("flush"),dA=Symbol("flushChunk"),wr=Symbol("encoding"),ia=Symbol("decoder"),Ft=Symbol("flowing"),Qc=Symbol("paused"),sa=Symbol("resume"),Bt=Symbol("buffer"),pn=Symbol("pipes"),Ut=Symbol("bufferLength"),Yv=Symbol("bufferPush"),Ph=Symbol("bufferShift"),rn=Symbol("objectMode"),kt=Symbol("destroyed"),Kv=Symbol("error"),Xv=Symbol("emitData"),fA=Symbol("emitEnd"),Jv=Symbol("emitEnd2"),Kr=Symbol("async"),Qv=Symbol("abort"),Rh=Symbol("aborted"),Zc=Symbol("signal"),xs=Symbol("dataListeners"),Fn=Symbol("discarded"),el=t=>Promise.resolve().then(t),lV=t=>t(),uV=t=>t==="end"||t==="finish"||t==="prefinish",dV=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,fV=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Ch=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[sa](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Zv=class extends Ch{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},hV=t=>!!t.objectMode,pV=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",ts=class extends Dh.EventEmitter{[Ft]=!1;[Qc]=!1;[pn]=[];[Bt]=[];[rn];[wr];[Kr];[ia];[vi]=!1;[es]=!1;[kh]=!1;[wh]=!1;[Jc]=null;[Ut]=0;[kt]=!1;[Zc];[Rh]=!1;[xs]=0;[Fn]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");hV(n)?(this[rn]=!0,this[wr]=null):pV(n)?(this[wr]=n.encoding,this[rn]=!1):(this[rn]=!1,this[wr]=null),this[Kr]=!!n.async,this[ia]=this[wr]?new hA.StringDecoder(this[wr]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Bt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[pn]});let{signal:r}=n;r&&(this[Zc]=r,r.aborted?this[Qv]():r.addEventListener("abort",()=>this[Qv]()))}get bufferLength(){return this[Ut]}get encoding(){return this[wr]}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[rn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Kr]}set async(e){this[Kr]=this[Kr]||!!e}[Qv](){this[Rh]=!0,this.emit("abort",this[Zc]?.reason),this.destroy(this[Zc]?.reason)}get aborted(){return this[Rh]}set aborted(e){}write(e,n,r){if(this[Rh])return!1;if(this[vi])throw new Error("write after end");if(this[kt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[Kr]?el:lV;if(!this[rn]&&!Buffer.isBuffer(e)){if(fV(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(dV(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[rn]?(this[Ft]&&this[Ut]!==0&&this[Nh](!0),this[Ft]?this.emit("data",e):this[Yv](e),this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft]):e.length?(typeof e=="string"&&!(n===this[wr]&&!this[ia]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[wr]&&(e=this[ia].write(e)),this[Ft]&&this[Ut]!==0&&this[Nh](!0),this[Ft]?this.emit("data",e):this[Yv](e),this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft]):(this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft])}read(e){if(this[kt])return null;if(this[Fn]=!1,this[Ut]===0||e===0||e&&e>this[Ut])return this[bi](),null;this[rn]&&(e=null),this[Bt].length>1&&!this[rn]&&(this[Bt]=[this[wr]?this[Bt].join(""):Buffer.concat(this[Bt],this[Ut])]);let n=this[uA](e||null,this[Bt][0]);return this[bi](),n}[uA](e,n){if(this[rn])this[Ph]();else{let r=n;e===r.length||e===null?this[Ph]():typeof r=="string"?(this[Bt][0]=r.slice(e),n=r.slice(0,e),this[Ut]-=e):(this[Bt][0]=r.subarray(e),n=r.subarray(0,e),this[Ut]-=e)}return this.emit("data",n),!this[Bt].length&&!this[vi]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[vi]=!0,this.writable=!1,(this[Ft]||!this[Qc])&&this[bi](),this}[sa](){this[kt]||(!this[xs]&&!this[pn].length&&(this[Fn]=!0),this[Qc]=!1,this[Ft]=!0,this.emit("resume"),this[Bt].length?this[Nh]():this[vi]?this[bi]():this.emit("drain"))}resume(){return this[sa]()}pause(){this[Ft]=!1,this[Qc]=!0,this[Fn]=!1}get destroyed(){return this[kt]}get flowing(){return this[Ft]}get paused(){return this[Qc]}[Yv](e){this[rn]?this[Ut]+=1:this[Ut]+=e.length,this[Bt].push(e)}[Ph](){return this[rn]?this[Ut]-=1:this[Ut]-=this[Bt][0].length,this[Bt].shift()}[Nh](e=!1){do;while(this[dA](this[Ph]())&&this[Bt].length);!e&&!this[Bt].length&&!this[vi]&&this.emit("drain")}[dA](e){return this.emit("data",e),this[Ft]}pipe(e,n){if(this[kt])return e;this[Fn]=!1;let r=this[es];return n=n||{},e===lA.stdout||e===lA.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[pn].push(n.proxyErrors?new Zv(this,e,n):new Ch(this,e,n)),this[Kr]?el(()=>this[sa]()):this[sa]()),e}unpipe(e){let n=this[pn].find(r=>r.dest===e);n&&(this[pn].length===1?(this[Ft]&&this[xs]===0&&(this[Ft]=!1),this[pn]=[]):this[pn].splice(this[pn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[Fn]=!1,this[xs]++,!this[pn].length&&!this[Ft]&&this[sa]();else if(e==="readable"&&this[Ut]!==0)super.emit("readable");else if(uV(e)&&this[es])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Jc]){let i=n;this[Kr]?el(()=>i.call(this,this[Jc])):i.call(this,this[Jc])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[xs]=this.listeners("data").length,this[xs]===0&&!this[Fn]&&!this[pn].length&&(this[Ft]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[xs]=0,!this[Fn]&&!this[pn].length&&(this[Ft]=!1)),n}get emittedEnd(){return this[es]}[bi](){!this[kh]&&!this[es]&&!this[kt]&&this[Bt].length===0&&this[vi]&&(this[kh]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[wh]&&this.emit("close"),this[kh]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==kt&&this[kt])return!1;if(e==="data")return!this[rn]&&!r?!1:this[Kr]?(el(()=>this[Xv](r)),!0):this[Xv](r);if(e==="end")return this[fA]();if(e==="close"){if(this[wh]=!0,!this[es]&&!this[kt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Jc]=r,super.emit(Kv,r);let s=!this[Zc]||this.listeners("error").length?super.emit("error",r):!1;return this[bi](),s}else if(e==="resume"){let s=super.emit("resume");return this[bi](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[bi](),i}[Xv](e){for(let r of this[pn])r.dest.write(e)===!1&&this.pause();let n=this[Fn]?!1:super.emit("data",e);return this[bi](),n}[fA](){return this[es]?!1:(this[es]=!0,this.readable=!1,this[Kr]?(el(()=>this[Jv]()),!0):this[Jv]())}[Jv](){if(this[ia]){let n=this[ia].end();if(n){for(let r of this[pn])r.dest.write(n);this[Fn]||super.emit("data",n)}}for(let n of this[pn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[rn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[rn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[rn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[wr]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(kt,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Fn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[vi])return n();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(kt,u),n(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(kt,u),this.pause(),s({value:d,done:!!this[vi]})},l=()=>{this.off("error",a),this.off("data",c),this.off(kt,u),n(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,s=d,this.once(kt,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Fn]=!1;let e=!1,n=()=>(this.pause(),this.off(Kv,n),this.off(kt,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(Kv,n),this.once(kt,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[kt])return e?this.emit("error",e):this.emit(kt),this;this[kt]=!0,this[Fn]=!0,this[Bt].length=0,this[Ut]=0;let n=this;return typeof n.close=="function"&&!this[wh]&&n.close(),e?this.emit("error",e):this.emit(kt),this}static get isStream(){return oV}};var gV=Jr.realpathSync.native,nl={lstatSync:Jr.lstatSync,readdir:Jr.readdir,readdirSync:Jr.readdirSync,readlinkSync:Jr.readlinkSync,realpathSync:gV,promises:{lstat:ns.lstat,readdir:ns.readdir,readlink:ns.readlink,realpath:ns.realpath}},bA=t=>!t||t===nl||t===mV?nl:{...nl,...t,promises:{...nl.promises,...t.promises||{}}},TA=/^\\\\\?\\([a-z]:)\\?$/i,yV=t=>t.replace(/\//g,"\\").replace(TA,"$1\\"),vV=/[\\\/]/,tr=0,SA=1,_A=2,Xr=4,EA=6,kA=8,Ms=10,wA=12,er=15,tl=~er,tb=16,pA=32,rl=64,Nr=128,Ah=256,Ih=512,mA=rl|Nr|Ih,bV=1023,nb=t=>t.isFile()?kA:t.isDirectory()?Xr:t.isSymbolicLink()?Ms:t.isCharacterDevice()?_A:t.isBlockDevice()?EA:t.isSocket()?wA:t.isFIFO()?SA:tr,gA=new Map,il=t=>{let e=gA.get(t);if(e)return e;let n=t.normalize("NFKD");return gA.set(t,n),n},yA=new Map,Oh=t=>{let e=yA.get(t);if(e)return e;let n=il(t.toLowerCase());return yA.set(t,n),n},xh=class extends Xc{constructor(){super({max:256})}},rb=class extends Xc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}},NA=Symbol("PathScurry setAsCwd"),sn=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#n;get nlink(){return this.#n}#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}#p;get ctimeMs(){return this.#p}#h;get birthtimeMs(){return this.#h}#E;get atime(){return this.#E}#g;get mtime(){return this.#g}#k;get ctime(){return this.#k}#w;get birthtime(){return this.#w}#T;#S;#_;#m;#C;#N;#r;#O;#b;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=tr,r,i,s,o,a){this.name=e,this.#T=s?Oh(e):il(e),this.#r=n&bV,this.nocase=s,this.roots=i,this.root=r||this,this.#O=o,this.#_=a.fullpath,this.#C=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=bA(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#O}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#O.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#O.set(this,n),this.#r&=~tb,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Oh(e):il(e);for(let c of r)if(c.#T===i)return c;let s=this.parent?this.sep:"",o=this.#_?this.#_+s+e:void 0,a=this.newChild(e,tr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=Nr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,n=this.parent;if(!n)return this.#C=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,n=this.parent;if(!n)return this.#N=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#_!==void 0)return this.#_;let e=this.name,n=this.parent;if(!n)return this.#_=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#_=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,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#m=r}isUnknown(){return(this.#r&er)===tr}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.#r&er)===kA}isDirectory(){return(this.#r&er)===Xr}isCharacterDevice(){return(this.#r&er)===_A}isBlockDevice(){return(this.#r&er)===EA}isFIFO(){return(this.#r&er)===SA}isSocket(){return(this.#r&er)===wA}isSymbolicLink(){return(this.#r&Ms)===Ms}lstatCached(){return this.#r&pA?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#r&er;return!(e!==tr&&e!==Ms||this.#r&Ah||this.#r&Nr)}calledReaddir(){return!!(this.#r&tb)}isENOENT(){return!!(this.#r&Nr)}isNamed(e){return this.nocase?this.#T===Oh(e):this.#T===il(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#b=r}catch(n){this.#u(n.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#b=r}catch(n){this.#u(n.code);return}}#x(e){this.#r|=tb;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#M()}}#M(){this.#r&Nr||(this.#r=(this.#r|Nr)&tl,this.#P())}#P(){let e=this.children();e.provisional=0;for(let n of e)n.#M()}#R(){this.#r|=Ih,this.#L()}#L(){if(this.#r&rl)return;let e=this.#r;(e&er)===Xr&&(e&=tl),this.#r=e|rl,this.#P()}#$(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#M():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#M()}#u(e=""){let n=this.#r;n|=Ah,e==="ENOENT"&&(n|=Nr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=tl),this.#r=n,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#j(e,n){return this.#A(e,n)||this.#F(e,n)}#F(e,n){let r=nb(e),i=this.newChild(e.name,r,{parent:this}),s=i.#r&er;return s!==Xr&&s!==Ms&&s!==tr&&(i.#r|=rl),n.unshift(i),n.provisional++,i}#A(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?Oh(e.name):il(e.name))===i.#T)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#r=n.#r&tl|nb(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if((this.#r&Nr)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#r&Nr)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#W(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:h,mtime:y,mtimeMs:p,nlink:T,rdev:_,size:v,uid:b}=e;this.#E=n,this.#y=r,this.#w=i,this.#h=s,this.#d=o,this.#s=a,this.#k=c,this.#p=l,this.#t=u,this.#f=d,this.#a=f,this.#i=h,this.#g=y,this.#v=p,this.#n=T,this.#l=_,this.#c=v,this.#o=b;let k=nb(e);this.#r=this.#r&tl|k|pA,k!==tr&&k!==Xr&&k!==Ms&&(this.#r|=rl)}#V=[];#z=!1;#H(e){this.#z=!1;let n=this.#V.slice();this.#V.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#V.push(e),this.#z)return;this.#z=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#$(s.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#x(r)}this.#H(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#j(i,e);this.#x(e)}catch(i){this.#$(i.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#j(r,e);this.#x(e)}catch(r){this.#$(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&mA)return!1;let e=er&this.#r;return e===tr||e===Xr||e===Ms}shouldWalk(e,n){return(this.#r&Xr)===Xr&&!(this.#r&mA)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#D)return this.#D;if(!((Ih|Ah|Nr)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#D)return this.#D;if(!((Ih|Ah|Nr)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}[NA](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#C=r.join(this.sep),i.#N=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#C=void 0,i.#N=void 0,i=i.parent}},Mh=class t extends sn{sep="\\";splitSep=vV;constructor(e,n=tr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=tr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return oa.win32.parse(e).root}getRoot(e){if(e=yV(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new aa(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(TA,"$1\\"),e===n}},Lh=class t extends sn{splitSep="/";sep="/";constructor(e,n=tr,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=tr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}},$h=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#n;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=nl}={}){this.#n=bA(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,vA.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new xh,this.#t=new xh,this.#i=new rb(s);let c=a.substring(this.rootPath.length).split(r);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.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=n.sep,f=this.rootPath,h=!1;for(let y of c){let p=u--;l=l.child(y,{relative:new Array(p).fill("..").join(d),relativePosix:new Array(p).fill("..").join("/"),fullpath:f+=(h?"":d)+y}),h=!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 n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,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,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?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:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((h,y)=>{if(h)return f(h);let p=y.length;if(!p)return f();let T=()=>{--p===0&&f()};for(let _ of y)(!s||s(_))&&a.push(r?_:_.fullpath()),i&&_.isSymbolicLink()?_.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,T):T()):_.shouldWalk(c,o)?l(_,T):T()},!0)},u=e;return new Promise((d,f)=>{l(u,h=>{if(h)return f(h);d(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!s||s(d))&&a.push(r?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,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!s||s(u))&&(yield r?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,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new ts({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=(T,_,v=!1)=>{if(T)return a.emit("error",T);if(i&&!v){let b=[];for(let k of _)k.isSymbolicLink()&&b.push(k.realpath().then(C=>C?.isUnknown()?C.lstat():C));if(b.length){Promise.all(b).then(()=>y(null,_,!0));return}}for(let b of _)b&&(!s||s(b))&&(a.write(r?b:b.fullpath())||(f=!0));u--;for(let b of _){let k=b.realpathCached()||b;k.shouldWalk(c,o)&&l.push(k)}f&&!a.flowing?a.once("drain",d):p||d()},p=!0;h.readdirCB(y,!0),p=!1}};return d(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new ts({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=h.readdirSync();for(let p of y)(!s||s(p))&&(a.write(r?p:p.fullpath())||(f=!0));u--;for(let p of y){let T=p;if(p.isSymbolicLink()){if(!(i&&(T=p.realpathSync())))continue;T.isUnknown()&&T.lstatSync()}T.shouldWalk(c,o)&&l.push(T)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[NA](n)}},aa=class extends $h{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,oa.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return oa.win32.parse(e).root.toUpperCase()}newRoot(e){return new Mh(this.rootPath,Xr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ca=class extends $h{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,oa.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Lh(this.rootPath,Xr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},sl=class extends ca{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}},rse=process.platform==="win32"?Mh:Lh,PA=process.platform==="win32"?aa:process.platform==="darwin"?sl:ca;var TV=t=>t.length>=1,SV=t=>t.length>=1,la=class t{#e;#t;#i;length;#n;#o;#f;#l;#d;#a;#c=!0;constructor(e,n,r,i){if(!TV(e))throw new TypeError("empty pattern list");if(!SV(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#i=r,this.#n=i,this.#i===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,f,h,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let p=[s,o,a,c,""].join("/"),T=[u,d,f,h,""].join("/");this.#e=[p,...l],this.#t=[T,...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]===Yt}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.#n),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.#n==="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.#n==="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 _V=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ua=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=_V}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new jn(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new la(i,s,0,this.platform),a=new jn(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 n=e.fullpath(),r=`${n}/`,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(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};var ib=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}},sb=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}},ob=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},ol=class t{hasWalkedCache;matches=new sb;subwalks=new ob;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new ib}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){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===Yt){(!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 h=i.parent||i;f?this.hasWalkedCache.hasWalked(h,f)||this.subwalks.add(h,f):this.matches.add(h,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,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Yt?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,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var EV=(t,e)=>typeof t=="string"?new ua([t],e):Array.isArray(t)?new ua(t,e):t,qh=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=EV(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(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,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}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,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}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,n)}matchFinish(e,n){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n: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(r){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,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new ol(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,r,o):a.readdirCB((l,u)=>this.walkCB3(a,u,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of r.subwalks.entries())s++,this.walkCB2(a,c,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new ol(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())s++,this.walkCB2Sync(a,c,r.child(),o);o()}},al=class extends qh{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(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}},cl=class extends qh{results;constructor(e,n,r){super(e,n,r),this.results=new ts({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 kV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Pr=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,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,RA.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=n.platform||kV,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=n.platform==="win32"?aa:n.platform==="darwin"?sl:n.platform?ca:PA;this.scurry=new c(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(c=>new jn(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 la(c,u,0,this.platform)})}async walk(){return[...await 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}).walk()]}walkSync(){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}).walkSync()]}stream(){return new cl(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 cl(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 ab=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new jn(n,e).hasMagic())return!0;return!1};function jh(t,e={}){return new Pr(t,e).streamSync()}function DA(t,e={}){return new Pr(t,e).stream()}function AA(t,e={}){return new Pr(t,e).walkSync()}async function CA(t,e={}){return new Pr(t,e).walk()}function Fh(t,e={}){return new Pr(t,e).iterateSync()}function OA(t,e={}){return new Pr(t,e).iterate()}var wV=jh,NV=Object.assign(DA,{sync:jh}),PV=Fh,RV=Object.assign(OA,{sync:Fh}),CV=Object.assign(AA,{stream:jh,iterate:Fh}),Ls=Object.assign(CA,{glob:CA,globSync:AA,sync:CV,globStream:DA,stream:NV,globStreamSync:jh,streamSync:wV,globIterate:OA,iterate:RV,globIterateSync:Fh,iterateSync:PV,Glob:Pr,hasMagic:ab,escape:ta,unescape:kr});Ls.glob=Ls;var cS=require("path"),lS=require("fs");var Lx=K(Ix());var oS={};PM(oS,{$id:()=>QY,$schema:()=>JY,default:()=>rK,definitions:()=>eK,properties:()=>nK,title:()=>ZY,type:()=>tK});var JY="http://json-schema.org/draft-07/schema#",QY="http://json-schema.org/draft-07/schema#",ZY="Core schema meta-schema",eK={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:[]}},tK=["object","boolean"],nK={$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:"#"}},rK={$schema:JY,$id:QY,title:ZY,definitions:eK,type:tK,properties:nK,default:!0};var xt=K(J());var Sp=class extends ic{constructor(n,r){super();this.ajv=n;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(n,r){let i=[],s=r.getProperty("status"),o=s?.ast.values?.values.at(0)?.value;if(o instanceof Re&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>i.push($(21,c,xt.DiagnosticSeverity.Hint,[...s?.ast?[s?.ast]:[]],[xt.DiagnosticTag.Unnecessary]))),i;let a=we.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>i.push(...iK(n,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.pathString}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.pathString}`,this.schemaKey,c)}return i}getOnPropertyHover(n){let r=(this.validate?.schema).properties?.[n];if(r&&typeof r=="object"&&"description"in r)return{kind:xt.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
|
|
289
290
|
|
|
290
291
|
`):r.description]:[]].join(`
|
|
291
|
-
`)}}getSignatureHelp(){}getPropertyListCompletionItems(n){let r=Object.keys((this.validate?.schema).properties),i=(this.validate?.schema).required;return r.map(s=>{let o=n&&i.some(l=>l===s),a=!!n.property.some(l=>s===l.name),c="a";return o?c=a?"Y":"!":c=a?"Z":"B",{label:`${s}`,kind:xt.CompletionItemKind.Property,sortText:`${c}${s}`}})??[]}},
|
|
292
|
-
${"".padEnd(
|
|
292
|
+
`)}}getSignatureHelp(){}getPropertyListCompletionItems(n){let r=Object.keys((this.validate?.schema).properties),i=(this.validate?.schema).required;return r.map(s=>{let o=n&&i.some(l=>l===s),a=!!n.property.some(l=>s===l.name),c="a";return o?c=a?"Y":"!":c=a?"Z":"B",{label:`${s}`,kind:xt.CompletionItemKind.Property,sortText:`${c}${s}`}})??[]}},iK=(t,e,n,r)=>{let i=sK(n,e.instancePath),s=i.node;if(e.keyword==="additionalProperties"){let o=s.getProperty(e.params.additionalProperty);return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`Node "${s.name}" ${e.message}: ${o.name}`],xt.TextEdit.del(Es(o.ast.firstToken.prevToken,o.ast.lastToken,!1)),"Remove property")]:[]}else if(e.keyword==="type"){let o=s.getProperty(e.instancePath.split("/")[1]);return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`"${o.name}" ${e.message??"NO MESSAGE"}`])]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let o=e.params.missingProperty,a=t.getOrderedNodeAst(s),c=Co(a);return a.map((l,u)=>{let d=l.openScope??c[u].lastToken;return $(0,c[u],xt.DiagnosticSeverity.Error,[],[],[o],xt.TextEdit.insert(xt.Position.create(d.pos.line,d.pos.col+1),`
|
|
293
|
+
${"".padEnd(Ao(c[u].uri,l)*Ro().length,Ro())}${o};`))})}else if(e.keyword==="const"){let o=i.property;return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}: ${e.params.allowedValue}`])]:[]}else if(e.keyword==="enum"){let o=i.property;return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}:
|
|
293
294
|
${e.params.allowedValues.join(`
|
|
294
295
|
`)}
|
|
295
296
|
${r}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=s.getProperty(e.instancePath.split("/").at(-1)??"");return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}`])]:[]}return i.property?[$(25,i.property.ast,void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
296
297
|
${JSON.stringify(e)}
|
|
297
|
-
${r}`])]:[$(25,i.node.definitions[0]instanceof
|
|
298
|
+
${r}`])]:[$(25,i.node.definitions[0]instanceof gt?i.node.definitions[0]:i.node.definitions[0].name??i.node.definitions[0],void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
298
299
|
${JSON.stringify(e)}
|
|
299
|
-
${r}`])]},QY=(t,e)=>Px(t,e.split("/").filter(n=>n)),Px=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let n=e[0].split("@"),r=n[0],i=n.at(1)?.split(",").map(o=>Number.parseInt(o,16)),s=t.getNode(r,i);return s?Px(s,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var cS=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(i=>!(i?.value instanceof Le)))return r?.values.map(i=>(i?.value).value)}parseMetaSchema(e,n){Ms.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,oS.resolve)(e,i);try{let s=sS.default.parse((0,aS.readFileSync)(i,"utf-8"));n.addMetaSchema(s),this.schemaIdValidators.set(s.$id,i)}catch{}})}parseBindings(e,n){Ms.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,oS.resolve)(e,i);try{let s=sS.default.parse((0,aS.readFileSync)(i,"utf-8"));n.addSchema(s),this.schemaIdValidators.set(s.$id,i)}catch(s){console.warn(i,s.message)}})}getNodeTypes(e,n,r){let i=`${e.join(";")}::${n.join(";")}`,s=this.ajvMap.get(i);return s||(s=new Cx.default({strict:!1,strictSchema:!1,strictNumbers:!1}),s.addMetaSchema(iS),this.ajvMap.set(i,s),e.forEach(c=>this.parseMetaSchema(c,s)),n.forEach(c=>this.parseBindings(c,s))),t.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new bp(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)??[]}},Rx,Dx=()=>(Rx??=new cS,Rx);var Mx=K(Fv());var Ea=require("path"),Lx=require("fs");var Bn=K(J());var Ax=t=>{switch(t){case"string":return V("STRING");case"int":return V("U32");case"boolean":return V("EMPTY");case"array":return V("PROP_ENCODED_ARRAY");case"uint8-array":return V("BYTESTRING");case"string-array":return V("STRINGLIST");case"phandle":return V("U32");case"phandles":return V("PROP_ENCODED_ARRAY");case"phandle-array":return V("PROP_ENCODED_ARRAY");case"path":return V(["STRING","U32"]);case"compound":return V("ANY")}},Ox=(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(n=>typeof n=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(n=>typeof n=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(n=>typeof n=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},Tp=(t,e)=>{if(e=e.include.reduce((n,r)=>{let i=t.find(s=>(0,Ea.basename)(s.filePath)===r.name);if(i){let s=r["property-blocklist"];return n.include=n.include.filter(o=>o!==r),ZY(t,i,n,s)??n}return console.warn(`Unable to find ${r}`),n},e),e["child-binding"]&&(e["child-binding"].include=$x(e["child-binding"].include),e["child-binding"]=Tp(t,e["child-binding"])),!e.include.length)return e},ZY=(t,e,n,r=[])=>{let i=Tp(t,e),s=Tp(t,n);if(!i||!s)return;let o=new Set;Object.keys(i?.properties??{}).forEach(d=>o.add(d)),Object.keys(s?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=r?.some(y=>y===d)?{}:i.properties?.[d]??{},h=s.properties?.[d]??{};a={...a,[d]:{...f,...h}}}),s.properties=a;let c=new Set;return Object.keys(i).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(i).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=i[d]??[],h=s[d]??[];s[d]=Array.from([...f,...h])}),s},$x=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],lS=class t{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(i=>!(i?.value instanceof Le)))return r?.values.map(i=>(i?.value).value)}getNodeTypes(e,n){let r=t.getNodeCompatible(n);if(!r)return[ws(n)];let i=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);if(i.length)return i;this.loadTypeAndCache(e);let s=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);return s.length?s:[ws(n)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(n=>{if(this.readFolders.indexOf(n)!==-1)return;this.readFolders.push(n);let i=Ms.sync("**/*.yaml",{cwd:n,ignore:"test/*"}).map(o=>{o=(0,Ea.resolve)(n,o);try{let a=Mx.default.parse((0,Lx.readFileSync)(o,"utf-8"));return{...a,include:$x(a?.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),s=i.map(o=>Tp(i,o)).filter(o=>!!o&&!o.include.length);eK(s,this.typeCache)})}},Ix,qx=()=>(Ix??=new lS,Ix),eK=(t,e)=>t.forEach(n=>{let r=n.compatible??(n.filePath?(0,Ea.basename)(n.filePath,"yaml"):void 0);r&&e.set(r,i=>jx(n,i))}),jx=(t,e)=>{let n=ws(e);n.compatible=t.compatible??(t.filePath?(0,Ea.basename)(t.filePath,"yaml"):void 0),n.description=t.description,n.bindingsPath=t.filePath,n.bus=typeof t.bus=="string"?[t.bus]:t.bus,n.onBus=t["on-bus"];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];tK(n,s,o),n.cellsValues=i}),t["child-binding"]){let s=t["child-binding"];n.childNodeType=o=>jx(s,o)}return n},tK=(t,e,n)=>{let r=t.properties.find(i=>i.getNameMatch(e));if(r&&typeof r.name=="string"){r.required=()=>n.required?"required":"optional",r.values=()=>n.enum??[],r.constValue=Ox(n.type,n.const),r.bindingType=n.type;let i=r.additionalTypeCheck;r.additionalTypeCheck=(s,o)=>[...xx(n,e,r)(s,o),...i?.(s,o)??[]]}else{let i=n.type==="compound"?r?.type:Ax(n.type);i??=Ax(n.type);let s=new Y(e,i,n.required?"required":"optional",void 0,n.enum);s.additionalTypeCheck=(o,a)=>{let c=[...r?.additionalTypeCheck?.(o,a)??[],...xx(n,e,s)(o,a)];return s.signatureArgs??=r?.signatureArgs,s.signatureArgsCyclic??=!!r?.signatureArgsCyclic,c},s.description=n.description?[n.description]:r?.description,s.bindingType=n.type,s.constValue=Ox(n.type,n.const),t.addProperty(s)}},xx=(t,e,n)=>{let r=t;return(i,s)=>{let o=i.parent.root,a=[];if(r.const){let c=i.ast.quickValues;if(c?.length==1){let l=Array.isArray(r.const)?r.const:[r.const];Array.isArray(c[0])&&l.length===c[0].length&&c[0].every((d,f)=>typeof d=="number"&&Number.isNaN(d)||l[f]===d)||a.push($(24,i.ast.values??i.ast,Bn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${r.type}" with value: ${r.const}`]))}}if(r.deprecated&&a.push($(14,i.ast,Bn.DiagnosticSeverity.Warning,[],[Bn.DiagnosticTag.Deprecated],[i.name])),(r.type==="phandle"||r.type==="phandles"||r.type==="path")&&we(i.ast.values)?.forEach(l=>{$n(l,o)||a.push($(22,l,Bn.DiagnosticSeverity.Error))}),r.type==="path"&&i.ast.values?.values.at(0)?.value instanceof Le){let c=i.ast.values?.values.at(0)?.value,l=[];c.value.split("/").every(u=>{let d=o.getNode(u);return d?l.push(u):a.push($(23,c,Bn.DiagnosticSeverity.Error,[],[],[u,`/${l.join("/")}`])),!d})}if(r.type==="phandle-array"){let c=we(i.ast.values),l=0,u=[],d=0;for(;c&&l<c.length;){let f=c.at(l),h=$n(f,o);if(!h){a.push($(22,f??i.ast,Bn.DiagnosticSeverity.Error));break}let y="";e.endsWith("-gpios")?y="gpio":y=r["specifier-space"]??e.slice(0,-1);let p=h.getProperty(`#${y}-cells`);if(!p){a.push($(16,i.ast,Bn.DiagnosticSeverity.Error,[...h.nodeNameOrLabelRef],[],[i.name,`#${y}-cells`,`/${h.path.slice(1).join("/")}`]));break}let T=p?Re(p,0,0,s)??0:0,_=h.nodeType?.cellsValues?.find(w=>w.specifier===y)?.values;if(u.push([`${d}_phandel`,..._?.map(w=>`${d}_${w}`)??[],...Array.from({length:T-(_?.length??0)},(w,C)=>`${d}_cell${T-(_?.length??0)?C:""}`)]),1+T>c.length-l){a.push($(19,f??i.ast,Bn.DiagnosticSeverity.Error,[],[],[i.name,`<${u.at(-1).join(" ")}>`]));break}l+=1+T;let v=c.slice(l-T,l),b=h.getProperty(`${y}-map`);if(b){let w=h.getNexusMapEntyMatch(y,s,v);w?.match?i.nexusMapsTo.push({mappingValuesAst:v,mapItem:w.match}):a.push($(31,w.entry,Bn.DiagnosticSeverity.Error,[b.ast]))}d++}u.push([`${d}_phandel`,`${d}_cell...`]),n.signatureArgs=u.map(f=>f.map(h=>Bn.ParameterInformation.create(h)))}return a}};var Fx=(t,e)=>({files:t,type:e,getNodeTypes:async n=>{switch(e){case"Zephyr":return qx().getNodeTypes(t.zephyrBindings,n);case"DevicetreeOrg":return Dx().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n)}}});var Sp=K(J());var nK=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:Sp.FoldingRangeKind.Comment}],uS=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(uS):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:Sp.FoldingRangeKind.Region},...t.nodes.flatMap(uS)],Bx=t=>{let e=[];return[...t instanceof Ui?t.ifBlocks.map(n=>({start:(n.expression??n.keyword).lastToken,end:n.content?.lastToken??(n.expression??n.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(n=>{!n||!n.end||e.push({startLine:n.start.pos.line,startCharacter:n.start.pos.col,endLine:n.end.pos.line,endCharacter:n.end.pos.colEnd,kind:Sp.FoldingRangeKind.Region})}),e},rK=t=>t instanceof bt?uS(t):t instanceof Mo||t instanceof Ui?Bx(t):t instanceof hi?nK(t):[];function Ux(t,e){return e.allAstItems.flatMap(n=>[n,...n.allDescendants]).filter(n=>oe(n.uri,t)).flatMap(rK)}var Ys=K(J());function iK(t){if(!t||!(t.ast instanceof xe)&&!(t.ast instanceof Wt))return[];let e=n=>n.nodeType?.bindingsPath?[Ys.Location.create(pe(n.nodeType.bindingsPath),Ys.Range.create(Ys.Position.create(0,0),Ys.Position.create(0,0)))]:[];return t.item instanceof ke&&!At(t.ast)?e(t.item):t.ast instanceof Wt&&t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof xe&&t.ast.linksTo?e(t.ast.linksTo):[]}async function Vx(t,e){return St(t,e,n=>[...iK(n)])}var Ep=require("fs");var sK=(t,e)=>{qn().reset(t),qn().requestTokens(t,!0),e(t)},_p=class{constructor(e,n,r){this.file=e;this.cb=n;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,n=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),sK(e,n)},(0,Ep.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,Ep.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var Xt=K(require("path")),dS=require("fs");var Dr=t=>{if(t)return Array.isArray(t)?t:[t]},oK=t=>({...t,deviceOrgBindingsMetaSchema:Dr(t.deviceOrgBindingsMetaSchema),deviceOrgTreeBindings:Dr(t.deviceOrgTreeBindings),includePaths:Dr(t.includePaths),lockRenameEdits:Dr(t.lockRenameEdits),zephyrBindings:Dr(t.zephyrBindings),overlays:Dr(t.overlays)}),zx=t=>({...t,defaultDeviceOrgBindingsMetaSchema:Dr(t.defaultDeviceOrgBindingsMetaSchema),defaultDeviceOrgTreeBindings:Dr(t.defaultDeviceOrgTreeBindings),defaultIncludePaths:Dr(t.defaultIncludePaths),defaultLockRenameEdits:Dr(t.defaultLockRenameEdits),defaultZephyrBindings:Dr(t.defaultZephyrBindings),contexts:t.contexts?.map(oK)}),sr=async(t,e)=>(e&&(t=t.replaceAll("${workspaceFolder}",e)),t),Ks={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},fS=async(t,e,n)=>{let r=(t.cwd?await sr(t.cwd,n):void 0)??e.cwd,i=await Promise.all((t.includePaths??e.defaultIncludePaths).map(f=>sr(f,n))),s=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(f=>sr(f,n))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(f=>sr(f,n))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(f=>sr(f,n))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(f=>sr(f,n)));r&&o==="Zephyr"&&(!s||s.length===0)&&(s=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[];return r&&(s=s.map(f=>(0,Xt.resolve)(r,f)).filter(f=>(0,dS.existsSync)(f)),a=a?.map(f=>(0,Xt.resolve)(r,f)),c=c.map(f=>(0,Xt.resolve)(r,f)),i=i.map(f=>(0,Xt.resolve)(r,f)),u=(0,Xt.resolve)(r,u),d=d.map(f=>(0,Xt.resolve)(r,f)),l=l.map(f=>(0,Xt.resolve)(r,f))),{ctxName:t.ctxName??(0,Xt.basename)(u),cwd:r?tt(r):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)}},Ll=async(t,e)=>{let n=t.cwd?await sr(t.cwd,e):void 0,r=t.defaultBindingType,i=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>sr(d,e))),s=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>sr(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>sr(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>sr(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>sr(d,e)));n&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,Xt.resolve)(n,d)),r==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,Xt.resolve)(n,d)),i=i.map(d=>(0,Xt.resolve)(n,d)),s=(t.defaultDeviceOrgTreeBindings??[]).map(d=>(0,Xt.resolve)(n,d)),c=c.map(d=>(0,Xt.resolve)(n,d)));let l={cwd:n,defaultDeviceOrgBindingsMetaSchema:i,defaultDeviceOrgTreeBindings:s,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:r,autoChangeContext:t.autoChangeContext??Ks.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??Ks.allowAdhocContexts},u=(await Promise.all(t.contexts?.map(d=>fS(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,dS.existsSync)(f)&&Xt.default.isAbsolute(f)));return{...l,contexts:u}};var Pp=require("path");var Wx=t=>`DT_PROP(${hS(t.parent)}, ${t.name.replaceAll("-","_")}))`,Hx=t=>t.parent.labels.map(e=>`DT_PROP(DT_NODELABEL(${e.label.toString()}), ${t.name.replaceAll("-","_")})`);var hS=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`,Gx=t=>t.labels.map(e=>`DT_NODELABEL(${e.label.toString()})`),Yx=t=>{let e=[];return qo.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 de&&s.linksTo===t||s instanceof Ln&&s.path?.pathParts.at(-1)?.linksTo===t)return!0})?.forEach(i=>e.push(`DT_ALIAS(${i.name.replaceAll("-","_")})`)),e};function aK(t,e){if(!t||!(t.item instanceof Ve)||!(t.ast instanceof He))return[];let n=[];if(e.settings.bindingType==="Zephyr"){n.push({type:"dt_zephyr_macro_prop_node_path",data:Wx(t.item)});let r=t.item;Hx(t.item).forEach(i=>{n.push({type:"dt_zephyr_macro_prop_node_label",data:i})})}return n}function cK(t,e){if(!t||t.item===null)return[];let n;if(t.item instanceof ke?n=t.item:t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo?n=t.ast.parentNode.linksTo:t.ast instanceof xe&&t.ast.linksTo&&(n=t.ast.linksTo),!n)return[];let r=[{type:"path",data:n.pathString}];return e.settings.bindingType==="Zephyr"&&(Gx(n).forEach(i=>{r.push({type:"dt_zephyr_macro_node_label",data:i})}),r.push({type:"dt_zephyr_macro_node_path",data:hS(n)}),Yx(n).forEach(i=>{r.push({type:"dt_zephyr_macro_prop_node_alias",data:i})})),r}async function Kx(t,e){return e?St(t,e,n=>[...cK(n,e),...aK(n,e)]):[]}var Xx=K(J());function lK(t){return!t||!(t.item instanceof Ve)?void 0:t.item.parent.nodeType?.getSignatureHelp?.(t.item,t.ast,t.beforeAst,t.afterAst)}async function uK(t){let e=Xa(t?.ast);if(!e||!e.params.length||!t?.ast||t.ast===e.functionName)return;let r=(await t.runtime.context.getAllParsers()).at(-1).cPreprocessorParser.macros.get(e.functionName.name)?.macro.identifier;if(!r||!(r instanceof Ur))return;let i=r.params.map(o=>({label:o instanceof Ot?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:[Xx.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 Jx(t,e){if(e)return(await St(t,e,async n=>[await uK(n)||lK(n)])).at(0)}var $l=class{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(e,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,c,r,i)}diffWithOptionsObj(e,n,r,i){var s;let o=v=>{if(v=this.postProcess(v,r),i){setTimeout(function(){i(v)},0);return}else return v},a=n.length,c=e.length,l=1,u=a+c;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));let d=(s=r.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}],y=this.extractCommon(h[0],n,e,0,r);if(h[0].oldPos+1>=c&&y+1>=a)return o(this.buildValues(h[0].lastComponent,n,e));let p=-1/0,T=1/0,_=()=>{for(let v=Math.max(p,-l);v<=Math.min(T,l);v+=2){let b,w=h[v-1],C=h[v+1];w&&(h[v-1]=void 0);let L=!1;if(C){let q=C.oldPos-v;L=C&&0<=q&&q<a}let B=w&&w.oldPos+1<c;if(!L&&!B){h[v]=void 0;continue}if(!B||L&&w.oldPos<C.oldPos?b=this.addToPath(C,!0,!1,0,r):b=this.addToPath(w,!1,!0,1,r),y=this.extractCommon(b,n,e,v,r),b.oldPos+1>=c&&y+1>=a)return o(this.buildValues(b.lastComponent,n,e))||!0;h[v]=b,b.oldPos+1>=c&&(T=Math.min(T,v-1)),y+1>=a&&(p=Math.max(p,v+1))}l++};if(i)(function v(){setTimeout(function(){if(l>u||Date.now()>f)return i(void 0);_()||v()},0)})();else for(;l<=u&&Date.now()<=f;){let v=_();if(v)return v}}addToPath(e,n,r,i,s){let o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(e,n,r,i,s){let o=n.length,a=r.length,c=e.oldPos,l=c-i,u=0;for(;l+1<o&&c+1<a&&this.equals(r[c+1],n[l+1],s);)l++,c++,u++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,l}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){let i=[],s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();let o=i.length,a=0,c=0,l=0;for(;a<o;a++){let u=i[a];if(u.removed)u.value=this.join(r.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let d=n.slice(c,c+u.count);d=d.map(function(f,h){let y=r[l+h];return y.length>f.length?y:f}),u.value=this.join(d)}else u.value=this.join(n.slice(c,c+u.count));c+=u.count,u.added||(l+=u.count)}}return i}};var pS=class extends $l{constructor(){super(...arguments),this.tokenize=fK}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
|
|
300
|
+
${r}`])]},sK=(t,e)=>xx(t,e.split("/").filter(n=>n)),xx=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let n=e[0].split("@"),r=n[0],i=n.at(1)?.split(",").map(o=>Number.parseInt(o,16)),s=t.getNode(r,i);return s?xx(s,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var uS=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(i=>!(i?.value instanceof Re)))return r?.values.map(i=>(i?.value).value)}parseMetaSchema(e,n){Ls.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,cS.resolve)(e,i);try{let s=aS.default.parse((0,lS.readFileSync)(i,"utf-8"));n.addMetaSchema(s),this.schemaIdValidators.set(s.$id,i)}catch{}})}parseBindings(e,n){Ls.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,cS.resolve)(e,i);try{let s=aS.default.parse((0,lS.readFileSync)(i,"utf-8"));n.addSchema(s),this.schemaIdValidators.set(s.$id,i)}catch(s){console.warn(i,s.message)}})}getNodeTypes(e,n,r){let i=`${e.join(";")}::${n.join(";")}`,s=this.ajvMap.get(i);return s||(s=new Lx.default({strict:!1,strictSchema:!1,strictNumbers:!1}),s.addMetaSchema(oS),this.ajvMap.set(i,s),e.forEach(c=>this.parseMetaSchema(c,s)),n.forEach(c=>this.parseBindings(c,s))),t.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new Sp(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())}},Mx,dS=()=>(Mx??=new uS,Mx);var Bx=K(Uv());var Ks=require("path"),Ux=require("fs");var Bn=K(J());var $x=t=>{switch(t){case"string":return V("STRING");case"int":return V("U32");case"boolean":return V("EMPTY");case"array":return V("PROP_ENCODED_ARRAY");case"uint8-array":return V("BYTESTRING");case"string-array":return V("STRINGLIST");case"phandle":return V("U32");case"phandles":return V("PROP_ENCODED_ARRAY");case"phandle-array":return V("PROP_ENCODED_ARRAY");case"path":return V(["STRING","U32"]);case"compound":return V("ANY")}},qx=(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(n=>typeof n=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(n=>typeof n=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(n=>typeof n=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},_p=(t,e)=>{if(e.extends??=[],e=e.include.reduce((n,r)=>{let i=t.find(s=>(0,Ks.basename)(s.filePath)===r.name);if(i){let s=r["property-blocklist"];return e.extends?.push(...n.include.map(o=>(0,Ks.basename)(o.name,".yaml"))),n.include=n.include.filter(o=>o!==r),oK(t,i,n,s)??n}return console.warn(`Unable to find ${r}`),n},e),e["child-binding"]&&(e["child-binding"].include=Vx(e["child-binding"].include),e["child-binding"]=_p(t,e["child-binding"])),!e.include.length)return e},oK=(t,e,n,r=[])=>{let i=_p(t,e),s=_p(t,n);if(!i||!s)return;let o=new Set;Object.keys(i?.properties??{}).forEach(d=>o.add(d)),Object.keys(s?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=r?.some(y=>y===d)?{}:i.properties?.[d]??{},h=s.properties?.[d]??{};a={...a,[d]:{...f,...h}}}),s.properties=a,s.extends??=[],s.extends.push(...i.extends??[]);let c=new Set;return Object.keys(i).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(i).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=i[d]??[],h=s[d]??[];s[d]=Array.from([...f,...h])}),s},Vx=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],fS=class t{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values?.values.filter(s=>s&&s.value instanceof Re);if(i?.length)return i.map(s=>(s?.value).value)}getNodeTypes(e,n){let r=t.getNodeCompatible(n);if(!r)return[ws(n)];let i=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);if(i.length)return i;this.loadTypeAndCache(e);let s=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);return s.length?s:[ws(n)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(n=>{if(this.readFolders.indexOf(n)!==-1)return;this.readFolders.push(n);let i=Ls.sync("**/*.yaml",{cwd:n,ignore:"test/*"}).map(o=>{o=(0,Ks.resolve)(n,o);try{let a=Bx.default.parse((0,Ux.readFileSync)(o,"utf-8"));return{...a,include:Vx(a?.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),s=i.map(o=>_p(i,o)).filter(o=>!!o&&!o.include.length);aK(s,this.typeCache)})}getBindings(){return Array.from(this.typeCache.keys())}},jx,hS=()=>(jx??=new fS,jx),aK=(t,e)=>t.forEach(n=>{let r=n.compatible??(n.filePath?(0,Ks.basename)(n.filePath,".yaml"):void 0);r&&e.set(r,i=>zx(n,i))}),zx=(t,e)=>{let n=ws(e);n.compatible=t.compatible??(t.filePath?(0,Ks.basename)(t.filePath,".yaml"):void 0),n.description=t.description,n.bindingsPath=t.filePath,n.bus=typeof t.bus=="string"?[t.bus]:t.bus,n.onBus=t["on-bus"],t.extends?.forEach(s=>n.extends.add(s));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];cK(n,s,o),n.cellsValues=i}),t["child-binding"]){let s=t["child-binding"];n.childNodeType=o=>zx(s,o)}return n},cK=(t,e,n)=>{let r=t.properties.find(i=>i.getNameMatch(e));if(r&&typeof r.name=="string"){r.required=()=>n.required?"required":"optional",r.values=()=>n.enum??[],r.constValue=qx(n.type,n.const),r.bindingType=n.type;let i=r.additionalTypeCheck;r.additionalTypeCheck=(s,o)=>[...Fx(n,e,r)(s,o),...i?.(s,o)??[]]}else{let i=n.type==="compound"?r?.type:$x(n.type);i??=$x(n.type);let s=new Y(e,i,n.required?"required":"optional",void 0,n.enum);s.additionalTypeCheck=(o,a)=>{let c=[...r?.additionalTypeCheck?.(o,a)??[],...Fx(n,e,s)(o,a)];return s.signatureArgs??=r?.signatureArgs,s.signatureArgsCyclic??=!!r?.signatureArgsCyclic,c},s.description=n.description?[n.description]:r?.description,s.bindingType=n.type,s.constValue=qx(n.type,n.const),t.addProperty(s)}},Fx=(t,e,n)=>{let r=t;return(i,s)=>{let o=i.parent.root,a=[];if(r.const){let c=i.ast.quickValues;if(c?.length==1){let l=Array.isArray(r.const)?r.const:[r.const];Array.isArray(c[0])&&l.length===c[0].length&&c[0].every((d,f)=>typeof d=="number"&&Number.isNaN(d)||l[f]===d)||a.push($(24,i.ast.values??i.ast,Bn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${r.type}" with value: ${r.const}`]))}}if(r.deprecated&&a.push($(14,i.ast,Bn.DiagnosticSeverity.Warning,[],[Bn.DiagnosticTag.Deprecated],[i.name])),(r.type==="phandle"||r.type==="phandles"||r.type==="path")&&ke(i.ast.values)?.forEach(l=>{$n(l,o)||a.push($(22,l,Bn.DiagnosticSeverity.Error))}),r.type==="path"&&i.ast.values?.values.at(0)?.value instanceof Re){let c=i.ast.values?.values.at(0)?.value,l=[];c.value.split("/").every(u=>{let d=o.getNode(u);return d?l.push(u):a.push($(23,c,Bn.DiagnosticSeverity.Error,[],[],[u,`/${l.join("/")}`])),!d})}if(r.type==="phandle-array"){let c=ke(i.ast.values),l=0,u=[],d=0;for(;c&&l<c.length;){let f=c.at(l),h=$n(f,o);if(!h){a.push($(22,f??i.ast,Bn.DiagnosticSeverity.Error));break}let y="";e.endsWith("-gpios")?y="gpio":y=r["specifier-space"]??e.slice(0,-1);let p=h.getProperty(`#${y}-cells`);if(!p){a.push($(16,i.ast,Bn.DiagnosticSeverity.Error,[...h.nodeNameOrLabelRef],[],[i.name,`#${y}-cells`,`/${h.path.slice(1).join("/")}`]));break}let T=p?Ce(p,0,0,s)??0:0,_=h.nodeType?.cellsValues?.find(k=>k.specifier===y)?.values;if(u.push([`${d}_phandel`,..._?.map(k=>`${d}_${k}`)??[],...Array.from({length:T-(_?.length??0)},(k,C)=>`${d}_cell${T-(_?.length??0)?C:""}`)]),1+T>c.length-l){a.push($(19,f??i.ast,Bn.DiagnosticSeverity.Error,[],[],[i.name,`<${u.at(-1).join(" ")}>`]));break}l+=1+T;let v=c.slice(l-T,l),b=h.getProperty(`${y}-map`);if(b){let k=h.getNexusMapEntyMatch(y,s,v);k?.match?i.nexusMapsTo.push({mappingValuesAst:v,mapItem:k.match}):a.push($(31,k.entry,Bn.DiagnosticSeverity.Error,[b.ast]))}d++}u.push([`${d}_phandel`,`${d}_cell...`]),n.signatureArgs=u.map(f=>f.map(h=>Bn.ParameterInformation.create(h)))}return a}};var Wx=(t,e)=>({files:t,type:e,getNodeTypes:async n=>{switch(e){case"Zephyr":return hS().getNodeTypes(t.zephyrBindings,n);case"DevicetreeOrg":return dS().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n)}},getBindings:()=>{switch(e){case"Zephyr":return hS().getBindings();case"DevicetreeOrg":return dS().getBindings()}}});var Ep=K(J());var lK=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:Ep.FoldingRangeKind.Comment}],pS=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(pS):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:Ep.FoldingRangeKind.Region},...t.nodes.flatMap(pS)],Hx=t=>{let e=[];return[...t instanceof Vi?t.ifBlocks.map(n=>({start:(n.expression??n.keyword).lastToken,end:n.content?.lastToken??(n.expression??n.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(n=>{!n||!n.end||e.push({startLine:n.start.pos.line,startCharacter:n.start.pos.col,endLine:n.end.pos.line,endCharacter:n.end.pos.colEnd,kind:Ep.FoldingRangeKind.Region})}),e},uK=t=>t instanceof mt?pS(t):t instanceof $o||t instanceof Vi?Hx(t):t instanceof Xn?lK(t):[];function Gx(t,e){return e.allAstItems.flatMap(n=>[n,...n.allDescendants]).filter(n=>se(n.uri,t)).flatMap(uK)}var Xs=K(J());function dK(t){if(!t||!(t.ast instanceof Me)&&!(t.ast instanceof Ht))return[];let e=n=>n.nodeType?.bindingsPath?[Xs.Location.create(pe(n.nodeType.bindingsPath),Xs.Range.create(Xs.Position.create(0,0),Xs.Position.create(0,0)))]:[];return t.item instanceof we&&!At(t.ast)?e(t.item):t.ast instanceof Ht&&t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof Me&&t.ast.linksTo?e(t.ast.linksTo):[]}async function Yx(t,e){return St(t,e,n=>[...dK(n)])}var wp=require("fs");var fK=(t,e)=>{qn().reset(t),qn().requestTokens(t,!0),e(t)},kp=class{constructor(e,n,r){this.file=e;this.cb=n;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,n=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),fK(e,n)},(0,wp.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,wp.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var Jt=K(require("path")),mS=require("fs");var Or=t=>{if(t)return Array.isArray(t)?t:[t]},hK=t=>({...t,deviceOrgBindingsMetaSchema:Or(t.deviceOrgBindingsMetaSchema),deviceOrgTreeBindings:Or(t.deviceOrgTreeBindings),includePaths:Or(t.includePaths),lockRenameEdits:Or(t.lockRenameEdits),zephyrBindings:Or(t.zephyrBindings),overlays:Or(t.overlays)}),Kx=t=>({...t,defaultDeviceOrgBindingsMetaSchema:Or(t.defaultDeviceOrgBindingsMetaSchema),defaultDeviceOrgTreeBindings:Or(t.defaultDeviceOrgTreeBindings),defaultIncludePaths:Or(t.defaultIncludePaths),defaultLockRenameEdits:Or(t.defaultLockRenameEdits),defaultZephyrBindings:Or(t.defaultZephyrBindings),contexts:t.contexts?.map(hK)}),ar=async(t,e)=>(e&&(t=t.replaceAll("${workspaceFolder}",e)),t),Js={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},gS=async(t,e,n)=>{let r=(t.cwd?await ar(t.cwd,n):void 0)??e.cwd,i=await Promise.all((t.includePaths??e.defaultIncludePaths).map(f=>ar(f,n))),s=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(f=>ar(f,n))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(f=>ar(f,n))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(f=>ar(f,n))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(f=>ar(f,n)));r&&o==="Zephyr"&&(!s||s.length===0)&&(s=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[];return r&&(s=s.map(f=>(0,Jt.resolve)(r,f)).filter(f=>(0,mS.existsSync)(f)),a=a?.map(f=>(0,Jt.resolve)(r,f)),c=c.map(f=>(0,Jt.resolve)(r,f)),i=i.map(f=>(0,Jt.resolve)(r,f)),u=(0,Jt.resolve)(r,u),d=d.map(f=>(0,Jt.resolve)(r,f)),l=l.map(f=>(0,Jt.resolve)(r,f))),{ctxName:t.ctxName??(0,Jt.basename)(u),cwd:r?nt(r):void 0,includePaths:i.map(nt),zephyrBindings:s.map(nt),bindingType:o,deviceOrgTreeBindings:a.map(nt),deviceOrgBindingsMetaSchema:c.map(nt),dtsFile:nt(u),overlays:d.map(nt),lockRenameEdits:l.map(nt)}},Fl=async(t,e)=>{let n=t.cwd?await ar(t.cwd,e):void 0,r=t.defaultBindingType,i=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>ar(d,e))),s=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>ar(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>ar(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>ar(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>ar(d,e)));n&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,Jt.resolve)(n,d)),r==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,Jt.resolve)(n,d)),i=i.map(d=>(0,Jt.resolve)(n,d)),s=(t.defaultDeviceOrgTreeBindings??[]).map(d=>(0,Jt.resolve)(n,d)),c=c.map(d=>(0,Jt.resolve)(n,d)));let l={cwd:n,defaultDeviceOrgBindingsMetaSchema:i,defaultDeviceOrgTreeBindings:s,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:r,autoChangeContext:t.autoChangeContext??Js.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??Js.allowAdhocContexts},u=(await Promise.all(t.contexts?.map(d=>gS(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,mS.existsSync)(f)&&Jt.default.isAbsolute(f)));return{...l,contexts:u}};var Cp=require("path");var Xx=t=>`DT_PROP(${yS(t.parent)}, ${t.name.replaceAll("-","_")}))`,Jx=t=>t.parent.labels.map(e=>`DT_PROP(DT_NODELABEL(${e.label.toString()}), ${t.name.replaceAll("-","_")})`);var yS=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`,Qx=t=>t.labels.map(e=>`DT_NODELABEL(${e.label.toString()})`),Zx=t=>{let e=[];return Fo.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 de&&s.linksTo===t||s instanceof Ln&&s.path?.pathParts.at(-1)?.linksTo===t)return!0})?.forEach(i=>e.push(`DT_ALIAS(${i.name.replaceAll("-","_")})`)),e};function pK(t,e){if(!t||!(t.item instanceof Ve)||!(t.ast instanceof He))return[];let n=[];if(e.settings.bindingType==="Zephyr"){n.push({type:"dt_zephyr_macro_prop_node_path",data:Xx(t.item)});let r=t.item;Jx(t.item).forEach(i=>{n.push({type:"dt_zephyr_macro_prop_node_label",data:i})})}return n}function mK(t,e){if(!t||t.item===null)return[];let n;if(t.item instanceof we?n=t.item:t.ast.parentNode instanceof de&&t.ast.parentNode.linksTo?n=t.ast.parentNode.linksTo:t.ast instanceof Me&&t.ast.linksTo&&(n=t.ast.linksTo),!n)return[];let r=[{type:"path",data:n.pathString}];return e.settings.bindingType==="Zephyr"&&(Qx(n).forEach(i=>{r.push({type:"dt_zephyr_macro_node_label",data:i})}),r.push({type:"dt_zephyr_macro_node_path",data:yS(n)}),Zx(n).forEach(i=>{r.push({type:"dt_zephyr_macro_prop_node_alias",data:i})})),r}async function eM(t,e){return e?St(t,e,n=>[...mK(n,e),...pK(n,e)]):[]}var tM=K(J());function gK(t){return!t||!(t.item instanceof Ve)?void 0:t.item.parent.nodeType?.getSignatureHelp?.(t.item,t.ast,t.beforeAst,t.afterAst)}async function yK(t){let e=Qa(t?.ast);if(!e||!e.params.length||!t?.ast||t.ast===e.functionName)return;let r=(await t.runtime.context.getAllParsers()).at(-1).cPreprocessorParser.macros.get(e.functionName.name)?.macro.identifier;if(!r||!(r instanceof zr))return;let i=r.params.map(o=>({label:o instanceof Ot?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:[tM.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 nM(t,e){if(e)return(await St(t,e,async n=>[await yK(n)||gK(n)])).at(0)}var Bl=class{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(e,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,c,r,i)}diffWithOptionsObj(e,n,r,i){var s;let o=v=>{if(v=this.postProcess(v,r),i){setTimeout(function(){i(v)},0);return}else return v},a=n.length,c=e.length,l=1,u=a+c;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));let d=(s=r.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}],y=this.extractCommon(h[0],n,e,0,r);if(h[0].oldPos+1>=c&&y+1>=a)return o(this.buildValues(h[0].lastComponent,n,e));let p=-1/0,T=1/0,_=()=>{for(let v=Math.max(p,-l);v<=Math.min(T,l);v+=2){let b,k=h[v-1],C=h[v+1];k&&(h[v-1]=void 0);let L=!1;if(C){let q=C.oldPos-v;L=C&&0<=q&&q<a}let B=k&&k.oldPos+1<c;if(!L&&!B){h[v]=void 0;continue}if(!B||L&&k.oldPos<C.oldPos?b=this.addToPath(C,!0,!1,0,r):b=this.addToPath(k,!1,!0,1,r),y=this.extractCommon(b,n,e,v,r),b.oldPos+1>=c&&y+1>=a)return o(this.buildValues(b.lastComponent,n,e))||!0;h[v]=b,b.oldPos+1>=c&&(T=Math.min(T,v-1)),y+1>=a&&(p=Math.max(p,v+1))}l++};if(i)(function v(){setTimeout(function(){if(l>u||Date.now()>f)return i(void 0);_()||v()},0)})();else for(;l<=u&&Date.now()<=f;){let v=_();if(v)return v}}addToPath(e,n,r,i,s){let o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(e,n,r,i,s){let o=n.length,a=r.length,c=e.oldPos,l=c-i,u=0;for(;l+1<o&&c+1<a&&this.equals(r[c+1],n[l+1],s);)l++,c++,u++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,l}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){let i=[],s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();let o=i.length,a=0,c=0,l=0;for(;a<o;a++){let u=i[a];if(u.removed)u.value=this.join(r.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let d=n.slice(c,c+u.count);d=d.map(function(f,h){let y=r[l+h];return y.length>f.length?y:f}),u.value=this.join(d)}else u.value=this.join(n.slice(c,c+u.count));c+=u.count,u.added||(l+=u.count)}}return i}};var vS=class extends Bl{constructor(){super(...arguments),this.tokenize=bK}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
|
|
300
301
|
`))&&(e=e.trim()),(!r.newlineIsToken||!n.includes(`
|
|
301
302
|
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
|
|
302
303
|
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
303
|
-
`)&&(n=n.slice(0,-1))),super.equals(e,n,r)}},
|
|
304
|
-
`));let n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){let s=r[i];i%2&&!e.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function
|
|
305
|
-
`)?v.lines[b]=v.lines[b].slice(0,-1):(v.lines.splice(b+1,0,"\"),b++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:s,hunks:f}}}function
|
|
304
|
+
`)&&(n=n.slice(0,-1))),super.equals(e,n,r)}},vK=new vS;function bS(t,e,n){return vK.diff(t,e,n)}function bK(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
|
|
305
|
+
`));let n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){let s=r[i];i%2&&!e.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function TS(t,e,n,r,i,s,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);let c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:u}=a;bS(n,r,Object.assign(Object.assign({},a),{callback:d=>{let f=l(d);u(f)}}))}else return l(bS(n,r,a));function l(u){if(!u)return;u.push({value:"",lines:[]});function d(v){return v.map(function(b){return" "+b})}let f=[],h=0,y=0,p=[],T=1,_=1;for(let v=0;v<u.length;v++){let b=u[v],k=b.lines||TK(b.value);if(b.lines=k,b.added||b.removed){if(!h){let C=u[v-1];h=T,y=_,C&&(p=c>0?d(C.lines.slice(-c)):[],h-=p.length,y-=p.length)}for(let C of k)p.push((b.added?"+":"-")+C);b.added?_+=k.length:T+=k.length}else{if(h)if(k.length<=c*2&&v<u.length-2)for(let C of d(k))p.push(C);else{let C=Math.min(k.length,c);for(let B of d(k.slice(0,C)))p.push(B);let L={oldStart:h,oldLines:T-h+C,newStart:y,newLines:_-y+C,lines:p};f.push(L),h=0,y=0,p=[]}T+=k.length,_+=k.length}}for(let v of f)for(let b=0;b<v.lines.length;b++)v.lines[b].endsWith(`
|
|
306
|
+
`)?v.lines[b]=v.lines[b].slice(0,-1):(v.lines.splice(b+1,0,"\"),b++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:s,hunks:f}}}function Np(t){if(Array.isArray(t))return t.map(Np).join(`
|
|
306
307
|
`);let e=[];t.oldFileName==t.newFileName&&e.push("Index: "+t.oldFileName),e.push("==================================================================="),e.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),e.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader));for(let n=0;n<t.hunks.length;n++){let r=t.hunks[n];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),e.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@");for(let i of r.lines)e.push(i)}return e.join(`
|
|
307
308
|
`)+`
|
|
308
|
-
`}function
|
|
309
|
+
`}function rM(t,e,n,r,i,s,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:a}=o;TS(t,e,n,r,i,s,Object.assign(Object.assign({},o),{callback:c=>{a(c?Np(c):void 0)}}))}else{let a=TS(t,e,n,r,i,s,o);return a?Np(a):void 0}}function SS(t,e,n,r,i,s){return rM(t,t,e,n,r,i,s)}function TK(t){let e=t.endsWith(`
|
|
309
310
|
`),n=t.split(`
|
|
310
311
|
`).map(r=>r+`
|
|
311
|
-
`);return e?n.pop():n.push(n.pop().slice(0,-1)),n}var Zx=require("timers"),eM=require("events");var vS=class extends eM.EventEmitter{constructor(e=3e3,n=1e3){super(),this.thresholdBytes=e*1024*1024,this.interval=(0,Zx.setInterval)(()=>{let r=process.memoryUsage().heapUsed;r>this.thresholdBytes&&this.emit("thresholdExceeded",{usedMb:(r/1024/1024).toFixed(2),thresholdMb:e})},n)}stop(){clearInterval(this.interval)}},pK=new vS(3e3),tM=()=>{pK.on("thresholdExceeded",({usedMb:t,thresholdMb:e})=>{console.warn(`[HeapMonitor] Heap usage exceeded ${e}MB: ${t}MB used`),bR(),vR()})};var $e=[],Be,ka,Np=new WeakMap,kp=new Map;tM();var rM=async t=>{await t.stable(),t.getContextFiles().forEach(e=>{kp.has(e)||kp.set(e,new _p(e,wS,n=>!!Rp(n))),kp.get(e)?.watch()})},_S=async t=>{let e=$e.indexOf(t);if(e===-1)return;Cp(t,void 0,!0),Np.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let n=await Xs(t);if(ee.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Be===t,type:n.type}),$e.splice(e,1),await NS(),t===Be&&(Be=void 0,$e.length)){let r=ka?pr($e,{uri:ka}):void 0;r??=$e[0],console.log("Active context was deleted. Forcing active to",r.id),await Mt({id:r.id},!0)}iM(t)},iM=async t=>{await t.stable(),t.getContextFiles().forEach(e=>kp.get(e)?.unwatch())},mK=t=>{let e=Np.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},qe=async()=>{await Promise.all($e.map(mK))},ES=async t=>(await sM()).indexOf(t)!==-1,sM=async()=>{let t=await oM();return $e.filter(e=>!t.some(n=>n===e))},oM=async()=>{let t=await SS();return $e.filter(e=>t.contexts.find(n=>li(n)===e.id))},gK=async()=>{let t=await SK();return $e.filter(e=>t.contexts.find(n=>li(n)===e.id))},yK=async t=>(await gK()).indexOf(t)!==-1,vK=async(t,e)=>{if(t===e)return!0;let n=(await t.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath),r=(await e.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath);return r.some(i=>oe(i.resolvedPath,t.parser.uri))&&n.length?n.every(i=>r.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=>oe(i,t.parser.uri))},bK=async t=>{if(!await ES(t))return;let e=await sM(),n=await oM(),r=await Ud(e);if($e.indexOf(t)===-1)return;let i=await Promise.all(r.flatMap(a=>[...n,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await vK(a.context,c)})))),s=t.getContextFiles(),o=r.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==t&&oe(a.context.parser.uri,t.parser.uri)&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(_S)},ee=(0,rt.createConnection)(rt.ProposedFeatures.all),Ar=new rt.TextDocuments(ko),aM=!1,bS=!1,cM=!1,lM=!1,uM=!1,TS;ee.onInitialize(t=>{TS=t.workspaceFolders??[],ee.console.log(`[Server(${process.pid}) ${TS?.at(0)?.uri} Version 0.4.5 ] Started and initialize received`);let e=t.capabilities;aM=!!(e.workspace&&e.workspace.configuration),bS=!!(e.workspace&&e.workspace.workspaceFolders),cM=!!e.workspace?.diagnostics?.refreshSupport,lM=!!e.workspace?.semanticTokens?.refreshSupport,uM=!!e.workspace?.foldingRange?.refreshSupport;let n={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:rt.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[rt.CodeActionKind.QuickFix,rt.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:Sd,tokenModifiers:_d},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0,signatureHelpProvider:{triggerCharacters:["<","("],retriggerCharacters:[" ",","]}}};return bS&&(n.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),n});ee.onInitialized(()=>{aM&&ee.client.register(rt.DidChangeConfigurationNotification.type,{}),bS&&ee.workspace.onDidChangeWorkspaceFolders(async t=>{ee.console.log("Workspace folder change event received"),await Bl()})});var TK=async()=>{let t=dM();return t={...Ks,...t},Ll(t,await Fl())},SS=async()=>{let t=wK();return t={...Ks,...t},Ll(t,await Fl())},SK=async()=>{let t=kK();return t={...Ks,...t},Ll(t,await Fl())},jl=async()=>{let t=EK();return t={...Ks,...t},Ll(t,await Fl())},_K=new Map,Fl=async()=>(await ee.workspace.getWorkspaceFolders()??TS)?.map(e=>Ue(e.uri))?.at(0),nM=async t=>{let e=pr($e,{id:li(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 n=li(t);console.log(`(ID: ${n}) New context [${t.ctxName}]`),console.log(`(ID: ${n}) Settings: ${JSON.stringify(t,void 0," ")}`);let r=new yf(t,t.bindingType?Fx({zephyrBindings:t.zephyrBindings??[],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);$e.push(r),rM(r),await r.stable();let i=await Xs(r);return ee.sendNotification("devicetree/contextCreated",{ctxNames:r.ctxNames.map(s=>s.toString()),id:r.id,...await r.getFileTree(),settings:r.settings,active:r===Be,type:i.type}),await bK(r),await NS(),r},Bl=async()=>{let t=await SS(),e=await jl();e.allowAdhocContexts||(e=await SS());let n=e.contexts.map(li);$e.filter(i=>!n.includes(i.id)).forEach(_S),await t.contexts?.reduce((i,s)=>i.then(async()=>{await nM(s)}),Promise.resolve()),e.allowAdhocContexts&&await(await TK()).contexts?.reduce((s,o)=>s.then(async()=>{pr($e,{uri:o.dtsFile})||await nM(o)}),Promise.resolve()),ka?await Mt({uri:ka}):!Be&&$e.length&&(console.log(`No active context using first context (ID: ${$e[0].id}) [${$e[0].ctxNames.join(",")}]`),await Mt({id:$e[0].id}))},or,us,ql=new Map,wa=new Map,EK=()=>!us&&!or?void 0:{...us,...or,contexts:[...or?.contexts??[],...Array.from(wa.values()),...Array.from(ql.values())]},dM=()=>!us&&!or?void 0:{...us,...or,contexts:[...Array.from(ql.values())]},wK=()=>!us&&!or?void 0:{...us,...or,contexts:[...or?.contexts??[],...Array.from(wa.values())]},kK=()=>!us&&!or?void 0:{...or,contexts:[...or?.contexts??[]]};function NK(t){let e={...t};for(let n in e)e[n]===null&&delete e[n];return e}var fM=async()=>{let t=await jl();console.log("Resolved settings",JSON.stringify(t,void 0," ")),ee.sendNotification("devicetree/settingsChanged",t),await Bl(),qe().then(()=>{cM&&ee.languages.diagnostics.refresh()})};ee.onDidChangeConfiguration(async t=>{t?.settings?.devicetree&&(or=zx(NK(t.settings.devicetree)),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await fM())});var hM=()=>{let t=Be?.getContextFiles();Array.from(Ar.keys()).forEach(e=>{t?.some(n=>oe(n,Ue(e)))||ee.sendDiagnostics({uri:e,version:Ar.get(e)?.version,diagnostics:[{severity:rt.DiagnosticSeverity.Warning,range:rt.Range.create(rt.Position.create(0,0),rt.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})})},wS=async t=>{let e=Mg($e,t);if(e.length)e.forEach(n=>{Np.get(n)?.abort.abort();let r=new AbortController,i=new Promise(s=>{setTimeout(async()=>{if(r.signal.aborted){s();return}let o=performance.now(),a=Be===n,c=a?pM(n):[];iM(n),await n.reevaluate(t),rM(n),a&&kS(n).then(l=>{let u=l.items.map(d=>({uri:d.uri,version:d.version??void 0,diagnostics:d.items}));Cp(n,c.filter(d=>u.every(f=>f.uri!==d.uri))),u.forEach(d=>{ee.sendDiagnostics(d)})}),s(),console.log("reevaluate",performance.now()-o)},50)});Np.set(n,{abort:r,promise:i})});else{if((await jl()).allowAdhocContexts===!1)return;await Bl(),await Mt({uri:t})}},PK=t=>Ar.keys().find(e=>oe(Ue(e),t)),Rp=t=>{let e=PK(t);if(e)return Ar.get(e)},pM=t=>t.getContextFiles().map(e=>({uri:pe(e),version:Rp(e)?.version,diagnostics:[]})),Cp=async(t,e=pM(t),n=!1)=>{!n&&t!==Be||await Promise.all(e.filter(r=>t===Be||!Be?.getContextFiles().some(i=>oe(Ue(r.uri),i))).map(r=>ee.sendDiagnostics({uri:r.uri,version:Ar.get(r.uri)?.version,diagnostics:[]})))},kS=async t=>{await t.stable();let e=performance.now(),n=await t.getDiagnostics(),r=t.getContextFiles().map(i=>({uri:pe(i),kind:rt.DocumentDiagnosticReportKind.Full,items:n.get(i)??[],version:Rp(i)?.version??null}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...r]}},NS=async()=>{let t=await Promise.all($e.map(Xs));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,Be===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Xs=async t=>{let e=await ES(t),n=!e&&await yK(t);return{ctx:t,type:e?"Ad Hoc":n?"User":"3rd Party"}},Mt=async(t,e=!1)=>{"uri"in t&&(ka=t.uri,console.log("Active File Uri",ka));let n=await jl();if(await qe(),Be&&!e&&!n.autoChangeContext||!e&&Be?.getContextFiles().find(s=>"uri"in t&&oe(s,t.uri)))return!1;let r=Be,i=pr($e,t);return r!==i&&(r&&Cp(r),Be=i,i?(Xs(i).then(async s=>{let o=await i.getFileTree();!i||i!==Be&&!$e.includes(i)||ee.sendNotification("devicetree/newActiveContext",{ctxNames:i.ctxNames.map(a=>a.toString()),id:i.id,...o,settings:i.settings,active:Be===i,type:s.type})}),kS(i).then(s=>{s.items.map(o=>({uri:o.uri,version:o.version??void 0,diagnostics:o.items})).forEach(o=>{ee.sendDiagnostics(o)})}),await NS()):ee.sendNotification("devicetree/newActiveContext",void 0)),uM&&ee.languages.foldingRange.refresh(),lM&&ee.languages.semanticTokens.refresh(),hM(),!0};Ar.listen(ee);Ar.onDidClose(async t=>{let e=Ue(t.document.uri),n=Mg($e,e);if(n.length===0){ql.delete(e),ee.sendDiagnostics({uri:t.document.uri,version:Ar.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(n.map(async r=>{(r?.getContextFiles()??[]).filter(o=>o!==e).some(o=>Rp(o))?Be?.getContextFiles().some(o=>oe(o,e))||ee.sendDiagnostics({uri:t.document.uri,version:Ar.get(t.document.uri)?.version,diagnostics:[]}):await ES(r)?(_S(r),ql.delete(r.settings.dtsFile)):Cp(r)})),_K.delete(t.document.uri)});Ar.onDidOpen(async t=>{await qe(),hM();let e=Ue(t.document.uri),n=pr($e,{uri:e});if(n)n!==Be&&await Mt({id:n.id});else{let r={ctxName:(0,Pp.basename)(e),dtsFile:e};ql.set(e,r),await wS(e)}});Ar.onDidChangeContent(async t=>{let e=Ue(t.document.uri),n=t.document.getText(),r=qn();r.needsRenew(e,n)&&(console.log("Content changed"),r.renewLexer(e,n),await wS(e))});ee.listen();ee.languages.diagnostics.onWorkspace(async()=>{await qe();let t=Be;return t?kS(t):{items:[]}});ee.onDidChangeWatchedFiles(t=>{ee.console.log("We received a file change event")});ee.onCompletion(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return n?[...await RR(t,n),...await qR(t,n)]:[]});ee.onCompletionResolve(t=>t);var ln=t=>{let e=dM();return pr($e,{uri:t},Be,e?.preferredContext)};ee.onDocumentSymbol(async t=>{await qe();let e=Ue(t.textDocument.uri),n=ln(e);return n?n.getUriParser(e)?.getDocumentSymbols(e):[]});ee.onWorkspaceSymbol(async()=>{await qe();let t=Be;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ee.languages.semanticTokens.on(async t=>{try{await qe();let e=Ue(t.textDocument.uri),n=ln(e),r=new rt.SemanticTokensBuilder,i=n?.isInContext(e);return!n||!i?{data:[]}:((await n.getAllParsers()).forEach(s=>s.buildSemanticTokens(r,e)),r.build())}catch(e){throw console.log(e),e}});ee.onDocumentLinks(async t=>{await qe();let e=Ue(t.textDocument.uri);return ln(e)?.getDocumentLinks(e)});ee.onPrepareRename(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return xR(t,n)});ee.onRenameRequest(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return IR(t,n)});ee.onReferences(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return CR(t,n)});ee.onDefinition(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e),r=(await n?.getDocumentLinks(e,t.position))?.filter(i=>i.target).map(i=>rt.Location.create(i.target,i.range))??[];return r.length?r:MR(t,n)});ee.onDeclaration(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return LR(t,n)});ee.onCodeAction(async t=>$R(t));ee.onDocumentFormatting(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return n?qg(t,n,qn().getDocument(e).getText()):[]});ee.onHover(async t=>{await qe();let e=Ue(t.textDocument.uri),n=ln(e);return(await jR(t,n)).at(0)});ee.onFoldingRanges(async t=>{await qe();let e=Ue(t.textDocument.uri),n=ln(e),r=n?.isInContext(e);if(!n||!r)return[];let i=(await n.getAllParsers()).find(s=>s.getFiles().some(o=>o===e));return i?Ux(e,i):[]});ee.onTypeDefinition(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return Vx(t,n)});ee.onSignatureHelp(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return Jx(t,n)});ee.onRequest("devicetree/getContexts",async()=>(await qe(),Promise.all($e.map(async t=>{let e=await Xs(t);return{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Be===t,type:e.type}}))));ee.onRequest("devicetree/setActive",async t=>(await qe(),console.log("devicetree/setActive",t),await Mt(t,!0)));ee.onRequest("devicetree/getActiveContext",async t=>{if(await qe(),console.log("devicetree/getActiveContext",t),await Mt({id:t},!0),!Be)return;let e=await Xs(Be);return Be?{ctxNames:Be.ctxNames.map(n=>n.toString()),id:t,...await Be.getFileTree(),settings:Be.settings,active:!0,type:e.type}:void 0});ee.onRequest("devicetree/setDefaultSettings",async t=>{await qe(),us=t,console.log("Integration Settings",t),await fM()});ee.onRequest("devicetree/requestContext",async t=>{await qe();let e=await jl(),n=await fS(t,e,await Fl());console.log("devicetree/requestContext",n);let r=li(n),i=Array.from(wa).find(([,a])=>a.ctxName===t.ctxName);if(i){let a=i[0].split(":",1)[0];pr($e,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),wa.delete(i[0])}wa.set(`${r}:${t.ctxName}`,t),await Bl();let s=$e.find(a=>a.id===r);if(!s)throw new Error("Failed to create context");let o=await Xs(s);return{ctxNames:s.ctxNames.map(a=>a.toString()),id:r,...await s.getFileTree(),settings:s.settings,active:!0,type:o.type}});ee.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await qe(),wa.delete(`${t}:${e}`);let n=pr($e,{id:t});if(n){if(n.removeCtxName(e),n.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await Bl()}});ee.onRequest("devicetree/compiledDtsOutput",async t=>(await qe(),t?pr($e,{id:t})?.toFullString():void 0));ee.onRequest("devicetree/serializedContext",async t=>(await qe(),t?pr($e,{id:t})?.serialize():void 0));ee.onRequest("devicetree/customActions",async t=>(await qe(),Kx(t,Be)));ee.onRequest("devicetree/activeFileUri",async t=>{await qe(),Mt({uri:t})});var RK=async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);if(!n)return[];let r=qn().getDocument(e),i=r.getText(),s=await qg(t,n,r.getText());if(s.length===0)return;let o=mN(r,s);if(o===r.getText())return;let a=(0,Pp.relative)(n.settings.cwd??process.cwd(),e);return yS(`a/${a}`,i,o)};ee.onRequest("devicetree/formattingDiff",RK);ee.onRequest("devicetree/diagnosticIssues",async t=>{await qe();let e=Ue(t.uri);Mt({uri:e});let n=ln(e);if(!n)return[];let r=(await n.getDiagnostics()).get(e);if(r?.length)return r});
|
|
312
|
+
`);return e?n.pop():n.push(n.pop().slice(0,-1)),n}var iM=require("timers"),sM=require("events");var _S=class extends sM.EventEmitter{constructor(e=3e3,n=1e3){super(),this.thresholdBytes=e*1024*1024,this.interval=(0,iM.setInterval)(()=>{let r=process.memoryUsage().heapUsed;r>this.thresholdBytes&&this.emit("thresholdExceeded",{usedMb:(r/1024/1024).toFixed(2),thresholdMb:e})},n)}stop(){clearInterval(this.interval)}},SK=new _S(3e3),oM=()=>{SK.on("thresholdExceeded",({usedMb:t,thresholdMb:e})=>{console.warn(`[HeapMonitor] Heap usage exceeded ${e}MB: ${t}MB used`),wR(),kR()})};var $e=[],Be,Na,Rp=new WeakMap,Pp=new Map;oM();var cM=async t=>{await t.stable(),t.getContextFiles().forEach(e=>{Pp.has(e)||Pp.set(e,new kp(e,RS,n=>!!Dp(n))),Pp.get(e)?.watch()})},NS=async t=>{let e=$e.indexOf(t);if(e===-1)return;Ap(t,void 0,!0),Rp.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let n=await Qs(t);if(ee.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Be===t,type:n.type}),$e.splice(e,1),await DS(),t===Be&&(Be=void 0,$e.length)){let r=Na?gr($e,{uri:Na}):void 0;r??=$e[0],console.log("Active context was deleted. Forcing active to",r.id),await Mt({id:r.id},!0)}lM(t)},lM=async t=>{await t.stable(),t.getContextFiles().forEach(e=>Pp.get(e)?.unwatch())},_K=t=>{let e=Rp.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},qe=async()=>{await Promise.all($e.map(_K))},PS=async t=>(await uM()).indexOf(t)!==-1,uM=async()=>{let t=await dM();return $e.filter(e=>!t.some(n=>n===e))},dM=async()=>{let t=await wS();return $e.filter(e=>t.contexts.find(n=>di(n)===e.id))},EK=async()=>{let t=await RK();return $e.filter(e=>t.contexts.find(n=>di(n)===e.id))},kK=async t=>(await EK()).indexOf(t)!==-1,wK=async(t,e)=>{if(t===e)return!0;let n=(await t.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath),r=(await e.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath);return r.some(i=>se(i.resolvedPath,t.parser.uri))&&n.length?n.every(i=>r.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=>se(i,t.parser.uri))},NK=async t=>{if(!await PS(t))return;let e=await uM(),n=await dM(),r=await Wd(e);if($e.indexOf(t)===-1)return;let i=await Promise.all(r.flatMap(a=>[...n,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await wK(a.context,c)})))),s=t.getContextFiles(),o=r.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==t&&se(a.context.parser.uri,t.parser.uri)&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(NS)},ee=(0,Qe.createConnection)(Qe.ProposedFeatures.all),Ir=new Qe.TextDocuments(Po),fM=!1,ES=!1,hM=!1,pM=!1,mM=!1,kS;ee.onInitialize(t=>{kS=t.workspaceFolders??[],ee.console.log(`[Server(${process.pid}) ${kS?.at(0)?.uri} Version 0.4.7 ] Started and initialize received`);let e=t.capabilities;fM=!!(e.workspace&&e.workspace.configuration),ES=!!(e.workspace&&e.workspace.workspaceFolders),hM=!!e.workspace?.diagnostics?.refreshSupport,pM=!!e.workspace?.semanticTokens?.refreshSupport,mM=!!e.workspace?.foldingRange?.refreshSupport;let n={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Qe.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," ",'"']},codeActionProvider:{codeActionKinds:[Qe.CodeActionKind.QuickFix,Qe.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:wd,tokenModifiers:Nd},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0,signatureHelpProvider:{triggerCharacters:["<","("],retriggerCharacters:[" ",","]}}};return ES&&(n.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),n});ee.onInitialized(()=>{fM&&ee.client.register(Qe.DidChangeConfigurationNotification.type,{}),ES&&ee.workspace.onDidChangeWorkspaceFolders(async t=>{ee.console.log("Workspace folder change event received"),await Wl()})});var PK=async()=>{let t=gM();return t={...Js,...t},Fl(t,await zl())},wS=async()=>{let t=AK();return t={...Js,...t},Fl(t,await zl())},RK=async()=>{let t=OK();return t={...Js,...t},Fl(t,await zl())},Vl=async()=>{let t=DK();return t={...Js,...t},Fl(t,await zl())},CK=new Map,zl=async()=>(await ee.workspace.getWorkspaceFolders()??kS)?.map(e=>Ue(e.uri))?.at(0),aM=async t=>{let e=gr($e,{id:di(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 n=di(t);console.log(`(ID: ${n}) New context [${t.ctxName}]`),console.log(`(ID: ${n}) Settings: ${JSON.stringify(t,void 0," ")}`);let r=new Tf(t,t.bindingType?Wx({zephyrBindings:t.zephyrBindings??[],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);$e.push(r),cM(r),await r.stable();let i=await Qs(r);return ee.sendNotification("devicetree/contextCreated",{ctxNames:r.ctxNames.map(s=>s.toString()),id:r.id,...await r.getFileTree(),settings:r.settings,active:r===Be,type:i.type}),await NK(r),await DS(),r},Wl=async()=>{let t=await wS(),e=await Vl();e.allowAdhocContexts||(e=await wS());let n=e.contexts.map(di);$e.filter(i=>!n.includes(i.id)).forEach(NS),await t.contexts?.reduce((i,s)=>i.then(async()=>{await aM(s)}),Promise.resolve()),e.allowAdhocContexts&&await(await PK()).contexts?.reduce((s,o)=>s.then(async()=>{gr($e,{uri:o.dtsFile})||await aM(o)}),Promise.resolve()),Na?await Mt({uri:Na}):!Be&&$e.length&&(console.log(`No active context using first context (ID: ${$e[0].id}) [${$e[0].ctxNames.join(",")}]`),await Mt({id:$e[0].id}))},cr,ds,Ul=new Map,wa=new Map,DK=()=>!ds&&!cr?void 0:{...ds,...cr,contexts:[...cr?.contexts??[],...Array.from(wa.values()),...Array.from(Ul.values())]},gM=()=>!ds&&!cr?void 0:{...ds,...cr,contexts:[...Array.from(Ul.values())]},AK=()=>!ds&&!cr?void 0:{...ds,...cr,contexts:[...cr?.contexts??[],...Array.from(wa.values())]},OK=()=>!ds&&!cr?void 0:{...cr,contexts:[...cr?.contexts??[]]};function IK(t){let e={...t};for(let n in e)e[n]===null&&delete e[n];return e}var yM=async()=>{let t=await Vl();console.log("Resolved settings",JSON.stringify(t,void 0," ")),ee.sendNotification("devicetree/settingsChanged",t),await Wl(),qe().then(()=>{hM&&ee.languages.diagnostics.refresh()})};ee.onDidChangeConfiguration(async t=>{t?.settings?.devicetree&&(cr=Kx(IK(t.settings.devicetree)),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await yM())});var vM=()=>{let t=Be?.getContextFiles();Array.from(Ir.keys()).forEach(e=>{t?.some(n=>se(n,Ue(e)))||ee.sendDiagnostics({uri:e,version:Ir.get(e)?.version,diagnostics:[{severity:Qe.DiagnosticSeverity.Warning,range:Qe.Range.create(Qe.Position.create(0,0),Qe.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})})},RS=async t=>{let e=$g($e,t);if(e.length)e.forEach(n=>{Rp.get(n)?.abort.abort();let r=new AbortController,i=new Promise(s=>{setTimeout(async()=>{if(r.signal.aborted){s();return}let o=performance.now(),a=Be===n,c=a?bM(n):[];lM(n),await n.reevaluate(t),cM(n),a&&CS(n).then(l=>{let u=l.items.map(d=>({uri:d.uri,version:d.version??void 0,diagnostics:d.items}));Ap(n,c.filter(d=>u.every(f=>f.uri!==d.uri))),u.forEach(d=>{ee.sendDiagnostics(d)})}),s(),console.log("reevaluate",performance.now()-o)},50)});Rp.set(n,{abort:r,promise:i})});else{if((await Vl()).allowAdhocContexts===!1)return;await Wl(),await Mt({uri:t})}},xK=t=>Ir.keys().find(e=>se(Ue(e),t)),Dp=t=>{let e=xK(t);if(e)return Ir.get(e)},bM=t=>t.getContextFiles().map(e=>({uri:pe(e),version:Dp(e)?.version,diagnostics:[]})),Ap=async(t,e=bM(t),n=!1)=>{!n&&t!==Be||await Promise.all(e.filter(r=>t===Be||!Be?.getContextFiles().some(i=>se(Ue(r.uri),i))).map(r=>ee.sendDiagnostics({uri:r.uri,version:Ir.get(r.uri)?.version,diagnostics:[]})))},CS=async t=>{await t.stable();let e=performance.now(),n=await t.getDiagnostics(),r=t.getContextFiles().map(i=>({uri:pe(i),kind:Qe.DocumentDiagnosticReportKind.Full,items:n.get(i)??[],version:Dp(i)?.version??null}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...r]}},DS=async()=>{let t=await Promise.all($e.map(Qs));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,Be===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Qs=async t=>{let e=await PS(t),n=!e&&await kK(t);return{ctx:t,type:e?"Ad Hoc":n?"User":"3rd Party"}},Mt=async(t,e=!1)=>{"uri"in t&&(Na=t.uri,console.log("Active File Uri",Na));let n=await Vl();if(await qe(),Be&&!e&&!n.autoChangeContext||!e&&Be?.getContextFiles().find(s=>"uri"in t&&se(s,t.uri)))return!1;let r=Be,i=gr($e,t);return r!==i&&(r&&Ap(r),Be=i,i?(Qs(i).then(async s=>{let o=await i.getFileTree();!i||i!==Be&&!$e.includes(i)||ee.sendNotification("devicetree/newActiveContext",{ctxNames:i.ctxNames.map(a=>a.toString()),id:i.id,...o,settings:i.settings,active:Be===i,type:s.type})}),CS(i).then(s=>{s.items.map(o=>({uri:o.uri,version:o.version??void 0,diagnostics:o.items})).forEach(o=>{ee.sendDiagnostics(o)})}),await DS()):ee.sendNotification("devicetree/newActiveContext",void 0)),mM&&ee.languages.foldingRange.refresh(),pM&&ee.languages.semanticTokens.refresh(),vM(),!0};Ir.listen(ee);Ir.onDidClose(async t=>{let e=Ue(t.document.uri),n=$g($e,e);if(n.length===0){Ul.delete(e),ee.sendDiagnostics({uri:t.document.uri,version:Ir.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(n.map(async r=>{(r?.getContextFiles()??[]).filter(o=>o!==e).some(o=>Dp(o))?Be?.getContextFiles().some(o=>se(o,e))||ee.sendDiagnostics({uri:t.document.uri,version:Ir.get(t.document.uri)?.version,diagnostics:[]}):await PS(r)?(NS(r),Ul.delete(r.settings.dtsFile)):Ap(r)})),CK.delete(t.document.uri)});Ir.onDidOpen(async t=>{await qe(),vM();let e=Ue(t.document.uri),n=gr($e,{uri:e});if(n)n!==Be&&await Mt({id:n.id});else{let r={ctxName:(0,Cp.basename)(e),dtsFile:e};Ul.set(e,r),await RS(e)}});Ir.onDidChangeContent(async t=>{let e=Ue(t.document.uri),n=t.document.getText(),r=qn();r.needsRenew(e,n)&&(console.log("Content changed"),r.renewLexer(e,n),await RS(e))});ee.listen();ee.languages.diagnostics.onWorkspace(async()=>{await qe();let t=Be;return t?CS(t):{items:[]}});ee.onDidChangeWatchedFiles(t=>{ee.console.log("We received a file change event")});ee.onCompletion(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return n?[...await xR(t,n),...await WR(t,n)]:[]});ee.onCompletionResolve(t=>t);var ln=t=>{let e=gM();return gr($e,{uri:t},Be,e?.preferredContext)};ee.onDocumentSymbol(async t=>{await qe();let e=Ue(t.textDocument.uri),n=ln(e);return n?n.getUriParser(e)?.getDocumentSymbols(e):[]});ee.onWorkspaceSymbol(async()=>{await qe();let t=Be;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ee.languages.semanticTokens.on(async t=>{try{await qe();let e=Ue(t.textDocument.uri),n=ln(e),r=new Qe.SemanticTokensBuilder,i=n?.isInContext(e);return!n||!i?{data:[]}:((await n.getAllParsers()).forEach(s=>s.buildSemanticTokens(r,e)),r.build())}catch(e){throw console.log(e),e}});ee.onDocumentLinks(async t=>{await qe();let e=Ue(t.textDocument.uri);return ln(e)?.getDocumentLinks(e)});ee.onPrepareRename(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return FR(t,n)});ee.onRenameRequest(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return jR(t,n)});ee.onReferences(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return MR(t,n)});ee.onDefinition(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e),r=(await n?.getDocumentLinks(e,t.position))?.filter(i=>i.target).map(i=>Qe.Location.create(i.target,i.range))??[];return r.length?r:BR(t,n)});ee.onDeclaration(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return UR(t,n)});ee.onCodeAction(async t=>VR(t));ee.onDocumentFormatting(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return n?Bg(t,n,qn().getDocument(e).getText()):[]});ee.onHover(async t=>{await qe();let e=Ue(t.textDocument.uri),n=ln(e);return(await HR(t,n)).at(0)});ee.onFoldingRanges(async t=>{await qe();let e=Ue(t.textDocument.uri),n=ln(e),r=n?.isInContext(e);if(!n||!r)return[];let i=(await n.getAllParsers()).find(s=>s.getFiles().some(o=>o===e));return i?Gx(e,i):[]});ee.onTypeDefinition(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return Yx(t,n)});ee.onSignatureHelp(async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);return nM(t,n)});ee.onRequest("devicetree/getContexts",async()=>(await qe(),Promise.all($e.map(async t=>{let e=await Qs(t);return{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Be===t,type:e.type}}))));ee.onRequest("devicetree/setActive",async t=>(await qe(),console.log("devicetree/setActive",t),await Mt(t,!0)));ee.onRequest("devicetree/getActiveContext",async t=>{if(await qe(),console.log("devicetree/getActiveContext",t),await Mt({id:t},!0),!Be)return;let e=await Qs(Be);return Be?{ctxNames:Be.ctxNames.map(n=>n.toString()),id:t,...await Be.getFileTree(),settings:Be.settings,active:!0,type:e.type}:void 0});ee.onRequest("devicetree/setDefaultSettings",async t=>{await qe(),ds=t,console.log("Integration Settings",t),await yM()});ee.onRequest("devicetree/requestContext",async t=>{await qe();let e=await Vl(),n=await gS(t,e,await zl());console.log("devicetree/requestContext",n);let r=di(n),i=Array.from(wa).find(([,a])=>a.ctxName===t.ctxName);if(i){let a=i[0].split(":",1)[0];gr($e,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),wa.delete(i[0])}wa.set(`${r}:${t.ctxName}`,t),await Wl();let s=$e.find(a=>a.id===r);if(!s)throw new Error("Failed to create context");let o=await Qs(s);return{ctxNames:s.ctxNames.map(a=>a.toString()),id:r,...await s.getFileTree(),settings:s.settings,active:!0,type:o.type}});ee.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await qe(),wa.delete(`${t}:${e}`);let n=gr($e,{id:t});if(n){if(n.removeCtxName(e),n.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await Wl()}});ee.onRequest("devicetree/compiledDtsOutput",async t=>(await qe(),t?gr($e,{id:t})?.toFullString():void 0));ee.onRequest("devicetree/serializedContext",async t=>(await qe(),t?gr($e,{id:t})?.serialize():void 0));ee.onRequest("devicetree/customActions",async t=>(await qe(),eM(t,Be)));ee.onRequest("devicetree/activeFileUri",async t=>{await qe(),Mt({uri:t})});var TM=(t,e,n)=>{let r=[42,44,45,36];return n||r.push(52,32,8,49),t.severity===Qe.DiagnosticSeverity.Error&&se(t.astElement.uri,e)&&!r.some(i=>t.issues.includes(i))},MK=async t=>{await qe();let e=Ue(t.textDocument.uri);Mt({uri:e});let n=ln(e);if(!n)return[];if((await n.getSyntaxIssues(void 0,l=>TM(l,e,!1))).get(e)?.length)throw new Error("Unable to format. Files has sytnax issues.");let i=qn().getDocument(e),s=i.getText(),o=await Bg(t,n,i.getText());if(o.length===0)return;let a=bN(i,o);if(a===i.getText())return;let c=(0,Cp.relative)(n.settings.cwd??process.cwd(),e);return SS(`a/${c}`,s,a)};ee.onRequest("devicetree/formattingDiff",MK);ee.onRequest("devicetree/diagnosticIssues",async({uri:t,full:e})=>{await qe();let n=Ue(t);Mt({uri:n});let r=ln(n);if(!r)return[];let i=e?(await r.getDiagnostics()).get(n):(await r.getSyntaxIssues(void 0,s=>TM(s,n,!!e))).get(n);if(i?.length)return i});
|