devicetree-language-server 0.2.5 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/server.js +171 -155
- package/package.json +2 -1
package/dist/server.js
CHANGED
|
@@ -1,193 +1,197 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var vA=Object.create;var Th=Object.defineProperty;var bA=Object.getOwnPropertyDescriptor;var TA=Object.getOwnPropertyNames;var _A=Object.getPrototypeOf,SA=Object.prototype.hasOwnProperty;var k=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),kA=(r,e)=>{for(var t in e)Th(r,t,{get:e[t],enumerable:!0})},wA=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of TA(e))!SA.call(r,s)&&s!==t&&Th(r,s,{get:()=>e[s],enumerable:!(n=bA(e,s))||n.enumerable});return r};var z=(r,e,t)=>(t=r!=null?vA(_A(r)):{},wA(e||!r||!r.__esModule?Th(t,"default",{value:r,enumerable:!0}):t,r));var bl=k(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.thenable=mt.typedArray=mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function EA(r){return r===!0||r===!1}mt.boolean=EA;function eT(r){return typeof r=="string"||r instanceof String}mt.string=eT;function NA(r){return typeof r=="number"||r instanceof Number}mt.number=NA;function PA(r){return r instanceof Error}mt.error=PA;function tT(r){return typeof r=="function"}mt.func=tT;function rT(r){return Array.isArray(r)}mt.array=rT;function RA(r){return rT(r)&&r.every(e=>eT(e))}mt.stringArray=RA;function CA(r,e){return Array.isArray(r)&&r.every(e)}mt.typedArray=CA;function DA(r){return r&&tT(r.then)}mt.thenable=DA});var Oi=k(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.stringArray=Ut.array=Ut.func=Ut.error=Ut.number=Ut.string=Ut.boolean=void 0;function OA(r){return r===!0||r===!1}Ut.boolean=OA;function nT(r){return typeof r=="string"||r instanceof String}Ut.string=nT;function AA(r){return typeof r=="number"||r instanceof Number}Ut.number=AA;function IA(r){return r instanceof Error}Ut.error=IA;function MA(r){return typeof r=="function"}Ut.func=MA;function sT(r){return Array.isArray(r)}Ut.array=sT;function xA(r){return sT(r)&&r.every(e=>nT(e))}Ut.stringArray=xA});var Hh=k(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.Message=X.NotificationType9=X.NotificationType8=X.NotificationType7=X.NotificationType6=X.NotificationType5=X.NotificationType4=X.NotificationType3=X.NotificationType2=X.NotificationType1=X.NotificationType0=X.NotificationType=X.RequestType9=X.RequestType8=X.RequestType7=X.RequestType6=X.RequestType5=X.RequestType4=X.RequestType3=X.RequestType2=X.RequestType1=X.RequestType=X.RequestType0=X.AbstractMessageSignature=X.ParameterStructures=X.ResponseError=X.ErrorCodes=void 0;var Bs=Oi(),_h;(function(r){r.ParseError=-32700,r.InvalidRequest=-32600,r.MethodNotFound=-32601,r.InvalidParams=-32602,r.InternalError=-32603,r.jsonrpcReservedErrorRangeStart=-32099,r.serverErrorStart=-32099,r.MessageWriteError=-32099,r.MessageReadError=-32098,r.PendingResponseRejected=-32097,r.ConnectionInactive=-32096,r.ServerNotInitialized=-32002,r.UnknownErrorCode=-32001,r.jsonrpcReservedErrorRangeEnd=-32e3,r.serverErrorEnd=-32e3})(_h||(X.ErrorCodes=_h={}));var Sh=class r extends Error{constructor(e,t,n){super(t),this.code=Bs.number(e)?e:_h.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,r.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};X.ResponseError=Sh;var ir=class r{constructor(e){this.kind=e}static is(e){return e===r.auto||e===r.byName||e===r.byPosition}toString(){return this.kind}};X.ParameterStructures=ir;ir.auto=new ir("auto");ir.byPosition=new ir("byPosition");ir.byName=new ir("byName");var Ye=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return ir.auto}};X.AbstractMessageSignature=Ye;var kh=class extends Ye{constructor(e){super(e,0)}};X.RequestType0=kh;var wh=class extends Ye{constructor(e,t=ir.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};X.RequestType=wh;var Eh=class extends Ye{constructor(e,t=ir.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};X.RequestType1=Eh;var Nh=class extends Ye{constructor(e){super(e,2)}};X.RequestType2=Nh;var Ph=class extends Ye{constructor(e){super(e,3)}};X.RequestType3=Ph;var Rh=class extends Ye{constructor(e){super(e,4)}};X.RequestType4=Rh;var Ch=class extends Ye{constructor(e){super(e,5)}};X.RequestType5=Ch;var Dh=class extends Ye{constructor(e){super(e,6)}};X.RequestType6=Dh;var Oh=class extends Ye{constructor(e){super(e,7)}};X.RequestType7=Oh;var Ah=class extends Ye{constructor(e){super(e,8)}};X.RequestType8=Ah;var Ih=class extends Ye{constructor(e){super(e,9)}};X.RequestType9=Ih;var Mh=class extends Ye{constructor(e,t=ir.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};X.NotificationType=Mh;var xh=class extends Ye{constructor(e){super(e,0)}};X.NotificationType0=xh;var Lh=class extends Ye{constructor(e,t=ir.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};X.NotificationType1=Lh;var $h=class extends Ye{constructor(e){super(e,2)}};X.NotificationType2=$h;var qh=class extends Ye{constructor(e){super(e,3)}};X.NotificationType3=qh;var jh=class extends Ye{constructor(e){super(e,4)}};X.NotificationType4=jh;var Fh=class extends Ye{constructor(e){super(e,5)}};X.NotificationType5=Fh;var Bh=class extends Ye{constructor(e){super(e,6)}};X.NotificationType6=Bh;var Uh=class extends Ye{constructor(e){super(e,7)}};X.NotificationType7=Uh;var Vh=class extends Ye{constructor(e){super(e,8)}};X.NotificationType8=Vh;var Wh=class extends Ye{constructor(e){super(e,9)}};X.NotificationType9=Wh;var iT;(function(r){function e(s){let i=s;return i&&Bs.string(i.method)&&(Bs.string(i.id)||Bs.number(i.id))}r.isRequest=e;function t(s){let i=s;return i&&Bs.string(i.method)&&s.id===void 0}r.isNotification=t;function n(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(Bs.string(i.id)||Bs.number(i.id)||i.id===null)}r.isResponse=n})(iT||(X.Message=iT={}))});var zh=k(Yn=>{"use strict";var oT;Object.defineProperty(Yn,"__esModule",{value:!0});Yn.LRUCache=Yn.LinkedMap=Yn.Touch=void 0;var Vt;(function(r){r.None=0,r.First=1,r.AsOld=r.First,r.Last=2,r.AsNew=r.Last})(Vt||(Yn.Touch=Vt={}));var Tl=class{constructor(){this[oT]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=Vt.None){let n=this._map.get(e);if(n)return t!==Vt.None&&this.touch(n,t),n.value}set(e,t,n=Vt.None){let s=this._map.get(e);if(s)s.value=t,n!==Vt.None&&this.touch(s,n);else{switch(s={key:e,value:t,next:void 0,previous:void 0},n){case Vt.None:this.addItemLast(s);break;case Vt.First:this.addItemFirst(s);break;case Vt.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.key,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.value,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:[t.key,t.value],done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}[(oT=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==Vt.First&&t!==Vt.Last)){if(t===Vt.First){if(e===this._head)return;let n=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(n.previous=s,s.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===Vt.Last){if(e===this._tail)return;let n=e.next,s=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=s,s.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};Yn.LinkedMap=Tl;var Kh=class extends Tl{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=Vt.AsNew){return super.get(e,t)}peek(e){return super.get(e,Vt.None)}set(e,t){return super.set(e,t,Vt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Yn.LRUCache=Kh});var cT=k(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.Disposable=void 0;var aT;(function(r){function e(t){return{dispose:t}}r.create=e})(aT||(_l.Disposable=aT={}))});var Jn=k(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});var Gh;function Yh(){if(Gh===void 0)throw new Error("No runtime abstraction layer installed");return Gh}(function(r){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Gh=t}r.install=e})(Yh||(Yh={}));Jh.default=Yh});var Ii=k(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Emitter=Ai.Event=void 0;var LA=Jn(),lT;(function(r){let e={dispose(){}};r.None=function(){return e}})(lT||(Ai.Event=lT={}));var Xh=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let s=0,i=this._callbacks.length;s<i;s++)if(this._callbacks[s]===e)if(this._contexts[s]===t){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],n=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=n.length;i<o;i++)try{t.push(n[i].apply(s[i],e))}catch(a){(0,LA.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Sl=class r{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{this._callbacks||(this._callbacks=new Xh),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),s.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Ai.Emitter=Sl;Sl._noop=function(){}});var El=k(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.CancellationTokenSource=Mi.CancellationToken=void 0;var $A=Jn(),qA=Oi(),Qh=Ii(),kl;(function(r){r.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Qh.Event.None}),r.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Qh.Event.None});function e(t){let n=t;return n&&(n===r.None||n===r.Cancelled||qA.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}r.is=e})(kl||(Mi.CancellationToken=kl={}));var jA=Object.freeze(function(r,e){let t=(0,$A.default)().timer.setTimeout(r.bind(e),0);return{dispose(){t.dispose()}}}),wl=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?jA:(this._emitter||(this._emitter=new Qh.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Zh=class{get token(){return this._token||(this._token=new wl),this._token}cancel(){this._token?this._token.cancel():this._token=kl.Cancelled}dispose(){this._token?this._token instanceof wl&&this._token.dispose():this._token=kl.None}};Mi.CancellationTokenSource=Zh});var uT=k(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.SharedArrayReceiverStrategy=xi.SharedArraySenderStrategy=void 0;var FA=El(),oa;(function(r){r.Continue=0,r.Cancelled=1})(oa||(oa={}));var ep=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),n=new Int32Array(t,0,1);n[0]=oa.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let n=this.buffers.get(t);if(n===void 0)return;let s=new Int32Array(n,0,1);Atomics.store(s,0,oa.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};xi.SharedArraySenderStrategy=ep;var tp=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")}},rp=class{constructor(e){this.token=new tp(e)}cancel(){}dispose(){}},np=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new FA.CancellationTokenSource:new rp(t)}};xi.SharedArrayReceiverStrategy=np});var ip=k(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.Semaphore=void 0;var BA=Jn(),sp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,BA.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Nl.Semaphore=sp});var fT=k(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.ReadableStreamMessageReader=Xn.AbstractMessageReader=Xn.MessageReader=void 0;var ap=Jn(),Li=Oi(),op=Ii(),UA=ip(),dT;(function(r){function e(t){let n=t;return n&&Li.func(n.listen)&&Li.func(n.dispose)&&Li.func(n.onError)&&Li.func(n.onClose)&&Li.func(n.onPartialMessage)}r.is=e})(dT||(Xn.MessageReader=dT={}));var Pl=class{constructor(){this.errorEmitter=new op.Emitter,this.closeEmitter=new op.Emitter,this.partialMessageEmitter=new op.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: ${Li.string(e.message)?e.message:"unknown"}`)}};Xn.AbstractMessageReader=Pl;var cp;(function(r){function e(t){let n,s,i,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")n=t??"utf-8";else{if(n=t.charset??"utf-8",t.contentDecoder!==void 0&&(i=t.contentDecoder,o.set(i.name,i)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,ap.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}r.fromOptions=e})(cp||(cp={}));var lp=class extends Pl{constructor(e,t){super(),this.readable=e,this.options=cp.fromOptions(t),this.buffer=(0,ap.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new UA.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let s=n.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
-
${JSON.stringify(Object.fromEntries(
|
|
4
|
-
`,
|
|
5
|
-
`,
|
|
6
|
-
${u}`);let f=u.substr(0,d),p=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,p)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(i)}if(this._chunks[0].byteLength>e){let i=this._chunks[0],o=this.asNative(i,e);return this._chunks[0]=i.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),
|
|
7
|
-
${JSON.stringify(
|
|
8
|
-
${JSON.stringify(
|
|
2
|
+
"use strict";var jA=Object.create;var Ah=Object.defineProperty;var FA=Object.getOwnPropertyDescriptor;var BA=Object.getOwnPropertyNames;var UA=Object.getPrototypeOf,VA=Object.prototype.hasOwnProperty;var w=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),WA=(n,e)=>{for(var t in e)Ah(n,t,{get:e[t],enumerable:!0})},HA=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of BA(e))!VA.call(n,s)&&s!==t&&Ah(n,s,{get:()=>e[s],enumerable:!(r=FA(e,s))||r.enumerable});return n};var H=(n,e,t)=>(t=n!=null?jA(UA(n)):{},HA(e||!n||!n.__esModule?Ah(t,"default",{value:n,enumerable:!0}):t,n));var Al=w(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.thenable=vt.typedArray=vt.stringArray=vt.array=vt.func=vt.error=vt.number=vt.string=vt.boolean=void 0;function KA(n){return n===!0||n===!1}vt.boolean=KA;function hT(n){return typeof n=="string"||n instanceof String}vt.string=hT;function zA(n){return typeof n=="number"||n instanceof Number}vt.number=zA;function GA(n){return n instanceof Error}vt.error=GA;function pT(n){return typeof n=="function"}vt.func=pT;function mT(n){return Array.isArray(n)}vt.array=mT;function YA(n){return mT(n)&&n.every(e=>hT(e))}vt.stringArray=YA;function JA(n,e){return Array.isArray(n)&&n.every(e)}vt.typedArray=JA;function XA(n){return n&&pT(n.then)}vt.thenable=XA});var Fi=w(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.stringArray=Wt.array=Wt.func=Wt.error=Wt.number=Wt.string=Wt.boolean=void 0;function QA(n){return n===!0||n===!1}Wt.boolean=QA;function gT(n){return typeof n=="string"||n instanceof String}Wt.string=gT;function ZA(n){return typeof n=="number"||n instanceof Number}Wt.number=ZA;function eI(n){return n instanceof Error}Wt.error=eI;function tI(n){return typeof n=="function"}Wt.func=tI;function yT(n){return Array.isArray(n)}Wt.array=yT;function nI(n){return yT(n)&&n.every(e=>gT(e))}Wt.stringArray=nI});var rp=w(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.Message=X.NotificationType9=X.NotificationType8=X.NotificationType7=X.NotificationType6=X.NotificationType5=X.NotificationType4=X.NotificationType3=X.NotificationType2=X.NotificationType1=X.NotificationType0=X.NotificationType=X.RequestType9=X.RequestType8=X.RequestType7=X.RequestType6=X.RequestType5=X.RequestType4=X.RequestType3=X.RequestType2=X.RequestType1=X.RequestType=X.RequestType0=X.AbstractMessageSignature=X.ParameterStructures=X.ResponseError=X.ErrorCodes=void 0;var Ys=Fi(),Ih;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(Ih||(X.ErrorCodes=Ih={}));var Mh=class n extends Error{constructor(e,t,r){super(t),this.code=Ys.number(e)?e:Ih.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};X.ResponseError=Mh;var ln=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};X.ParameterStructures=ln;ln.auto=new ln("auto");ln.byPosition=new ln("byPosition");ln.byName=new ln("byName");var Ze=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return ln.auto}};X.AbstractMessageSignature=Ze;var xh=class extends Ze{constructor(e){super(e,0)}};X.RequestType0=xh;var $h=class extends Ze{constructor(e,t=ln.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};X.RequestType=$h;var Lh=class extends Ze{constructor(e,t=ln.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};X.RequestType1=Lh;var qh=class extends Ze{constructor(e){super(e,2)}};X.RequestType2=qh;var jh=class extends Ze{constructor(e){super(e,3)}};X.RequestType3=jh;var Fh=class extends Ze{constructor(e){super(e,4)}};X.RequestType4=Fh;var Bh=class extends Ze{constructor(e){super(e,5)}};X.RequestType5=Bh;var Uh=class extends Ze{constructor(e){super(e,6)}};X.RequestType6=Uh;var Vh=class extends Ze{constructor(e){super(e,7)}};X.RequestType7=Vh;var Wh=class extends Ze{constructor(e){super(e,8)}};X.RequestType8=Wh;var Hh=class extends Ze{constructor(e){super(e,9)}};X.RequestType9=Hh;var Kh=class extends Ze{constructor(e,t=ln.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};X.NotificationType=Kh;var zh=class extends Ze{constructor(e){super(e,0)}};X.NotificationType0=zh;var Gh=class extends Ze{constructor(e,t=ln.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};X.NotificationType1=Gh;var Yh=class extends Ze{constructor(e){super(e,2)}};X.NotificationType2=Yh;var Jh=class extends Ze{constructor(e){super(e,3)}};X.NotificationType3=Jh;var Xh=class extends Ze{constructor(e){super(e,4)}};X.NotificationType4=Xh;var Qh=class extends Ze{constructor(e){super(e,5)}};X.NotificationType5=Qh;var Zh=class extends Ze{constructor(e){super(e,6)}};X.NotificationType6=Zh;var ep=class extends Ze{constructor(e){super(e,7)}};X.NotificationType7=ep;var tp=class extends Ze{constructor(e){super(e,8)}};X.NotificationType8=tp;var np=class extends Ze{constructor(e){super(e,9)}};X.NotificationType9=np;var vT;(function(n){function e(s){let i=s;return i&&Ys.string(i.method)&&(Ys.string(i.id)||Ys.number(i.id))}n.isRequest=e;function t(s){let i=s;return i&&Ys.string(i.method)&&s.id===void 0}n.isNotification=t;function r(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(Ys.string(i.id)||Ys.number(i.id)||i.id===null)}n.isResponse=r})(vT||(X.Message=vT={}))});var ip=w(rs=>{"use strict";var bT;Object.defineProperty(rs,"__esModule",{value:!0});rs.LRUCache=rs.LinkedMap=rs.Touch=void 0;var Ht;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(Ht||(rs.Touch=Ht={}));var Il=class{constructor(){this[bT]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=Ht.None){let r=this._map.get(e);if(r)return t!==Ht.None&&this.touch(r,t),r.value}set(e,t,r=Ht.None){let s=this._map.get(e);if(s)s.value=t,r!==Ht.None&&this.touch(s,r);else{switch(s={key:e,value:t,next:void 0,previous:void 0},r){case Ht.None:this.addItemLast(s);break;case Ht.First:this.addItemFirst(s);break;case Ht.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let r=this._state,s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.key,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.value,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:[t.key,t.value],done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}[(bT=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==Ht.First&&t!==Ht.Last)){if(t===Ht.First){if(e===this._head)return;let r=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(r.previous=s,s.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===Ht.Last){if(e===this._tail)return;let r=e.next,s=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=s,s.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};rs.LinkedMap=Il;var sp=class extends Il{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=Ht.AsNew){return super.get(e,t)}peek(e){return super.get(e,Ht.None)}set(e,t){return super.set(e,t,Ht.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};rs.LRUCache=sp});var ST=w(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.Disposable=void 0;var TT;(function(n){function e(t){return{dispose:t}}n.create=e})(TT||(Ml.Disposable=TT={}))});var ss=w(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});var op;function ap(){if(op===void 0)throw new Error("No runtime abstraction layer installed");return op}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");op=t}n.install=e})(ap||(ap={}));cp.default=ap});var Ui=w(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.Emitter=Bi.Event=void 0;var rI=ss(),_T;(function(n){let e={dispose(){}};n.None=function(){return e}})(_T||(Bi.Event=_T={}));var lp=class{add(e,t=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let r=!1;for(let s=0,i=this._callbacks.length;s<i;s++)if(this._callbacks[s]===e)if(this._contexts[s]===t){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],r=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=r.length;i<o;i++)try{t.push(r[i].apply(s[i],e))}catch(a){(0,rI.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},xl=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,r)=>{this._callbacks||(this._callbacks=new lp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),s.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Bi.Emitter=xl;xl._noop=function(){}});var ql=w(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.CancellationTokenSource=Vi.CancellationToken=void 0;var sI=ss(),iI=Fi(),up=Ui(),$l;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:up.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:up.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||iI.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})($l||(Vi.CancellationToken=$l={}));var oI=Object.freeze(function(n,e){let t=(0,sI.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),Ll=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?oI:(this._emitter||(this._emitter=new up.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},dp=class{get token(){return this._token||(this._token=new Ll),this._token}cancel(){this._token?this._token.cancel():this._token=$l.Cancelled}dispose(){this._token?this._token instanceof Ll&&this._token.dispose():this._token=$l.None}};Vi.CancellationTokenSource=dp});var wT=w(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.SharedArrayReceiverStrategy=Wi.SharedArraySenderStrategy=void 0;var aI=ql(),ma;(function(n){n.Continue=0,n.Cancelled=1})(ma||(ma={}));var fp=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=ma.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let s=new Int32Array(r,0,1);Atomics.store(s,0,ma.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Wi.SharedArraySenderStrategy=fp;var hp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===ma.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},pp=class{constructor(e){this.token=new hp(e)}cancel(){}dispose(){}},mp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new aI.CancellationTokenSource:new pp(t)}};Wi.SharedArrayReceiverStrategy=mp});var yp=w(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.Semaphore=void 0;var cI=ss(),gp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,r)=>{this._waiting.push({thunk:e,resolve:t,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,cI.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};jl.Semaphore=gp});var kT=w(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.ReadableStreamMessageReader=is.AbstractMessageReader=is.MessageReader=void 0;var bp=ss(),Hi=Fi(),vp=Ui(),lI=yp(),ET;(function(n){function e(t){let r=t;return r&&Hi.func(r.listen)&&Hi.func(r.dispose)&&Hi.func(r.onError)&&Hi.func(r.onClose)&&Hi.func(r.onPartialMessage)}n.is=e})(ET||(is.MessageReader=ET={}));var Fl=class{constructor(){this.errorEmitter=new vp.Emitter,this.closeEmitter=new vp.Emitter,this.partialMessageEmitter=new vp.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: ${Hi.string(e.message)?e.message:"unknown"}`)}};is.AbstractMessageReader=Fl;var Tp;(function(n){function e(t){let r,s,i,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")r=t??"utf-8";else{if(r=t.charset??"utf-8",t.contentDecoder!==void 0&&(i=t.contentDecoder,o.set(i.name,i)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,bp.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(Tp||(Tp={}));var Sp=class extends Fl{constructor(e,t){super(),this.readable=e,this.options=Tp.fromOptions(t),this.buffer=(0,bp.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new lI.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let s=r.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
+
${JSON.stringify(Object.fromEntries(r))}`));return}let i=parseInt(s);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=i}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,s=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(s)}).catch(r=>{this.fireError(r)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,bp.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};is.ReadableStreamMessageReader=Sp});var DT=w(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.WriteableStreamMessageWriter=os.AbstractMessageWriter=os.MessageWriter=void 0;var NT=ss(),ga=Fi(),uI=yp(),PT=Ui(),dI="Content-Length: ",RT=`\r
|
|
4
|
+
`,CT;(function(n){function e(t){let r=t;return r&&ga.func(r.dispose)&&ga.func(r.onClose)&&ga.func(r.onError)&&ga.func(r.write)}n.is=e})(CT||(os.MessageWriter=CT={}));var Bl=class{constructor(){this.errorEmitter=new PT.Emitter,this.closeEmitter=new PT.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,r){this.errorEmitter.fire([this.asError(e),t,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ga.string(e.message)?e.message:"unknown"}`)}};os.AbstractMessageWriter=Bl;var _p;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,NT.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,NT.default)().applicationJson.encoder}}n.fromOptions=e})(_p||(_p={}));var wp=class extends Bl{constructor(e,t){super(),this.writable=e,this.options=_p.fromOptions(t),this.errorCount=0,this.writeSemaphore=new uI.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let s=[];return s.push(dI,r.byteLength.toString(),RT),s.push(RT),this.doWrite(e,s,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,t,r){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(r)}catch(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};os.WriteableStreamMessageWriter=wp});var OT=w(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.AbstractMessageBuffer=void 0;var fI=13,hI=10,pI=`\r
|
|
5
|
+
`,Ep=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,r=0,s=0,i=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(s=0;s<l.length;){switch(l[s]){case fI:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case hI:switch(t){case 1:t=2;break;case 3:t=4,s++;break e;default:t=0}break;default:t=0}s++}i+=l.byteLength,r++}if(t!==4)return;let o=this._read(i+s),a=new Map,c=this.toString(o,"ascii").split(pI);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],d=u.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
|
|
6
|
+
${u}`);let f=u.substr(0,d),p=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,p)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(i)}if(this._chunks[0].byteLength>e){let i=this._chunks[0],o=this.asNative(i,e);return this._chunks[0]=i.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),r=0,s=0;for(;e>0;){let i=this._chunks[s];if(i.byteLength>e){let o=i.slice(0,e);t.set(o,r),r+=e,this._chunks[s]=i.slice(e),this._totalLength-=e,e-=e}else t.set(i,r),r+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,e-=i.byteLength}return t}};Ul.AbstractMessageBuffer=Ep});var $T=w(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.ConnectionOptions=ae.MessageStrategy=ae.CancellationStrategy=ae.CancellationSenderStrategy=ae.CancellationReceiverStrategy=ae.RequestCancellationReceiverStrategy=ae.IdCancellationReceiverStrategy=ae.ConnectionStrategy=ae.ConnectionError=ae.ConnectionErrors=ae.LogTraceNotification=ae.SetTraceNotification=ae.TraceFormat=ae.TraceValues=ae.Trace=ae.NullLogger=ae.ProgressType=ae.ProgressToken=void 0;var AT=ss(),at=Fi(),ee=rp(),IT=ip(),ya=Ui(),kp=ql(),Ta;(function(n){n.type=new ee.NotificationType("$/cancelRequest")})(Ta||(Ta={}));var Np;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(Np||(ae.ProgressToken=Np={}));var va;(function(n){n.type=new ee.NotificationType("$/progress")})(va||(va={}));var Pp=class{constructor(){}};ae.ProgressType=Pp;var Rp;(function(n){function e(t){return at.func(t)}n.is=e})(Rp||(Rp={}));ae.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Pe;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(Pe||(ae.Trace=Pe={}));var MT;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(MT||(ae.TraceValues=MT={}));(function(n){function e(r){if(!at.string(r))return n.Off;switch(r=r.toLowerCase(),r){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(r){switch(r){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(Pe||(ae.Trace=Pe={}));var _n;(function(n){n.Text="text",n.JSON="json"})(_n||(ae.TraceFormat=_n={}));(function(n){function e(t){return at.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(_n||(ae.TraceFormat=_n={}));var Cp;(function(n){n.type=new ee.NotificationType("$/setTrace")})(Cp||(ae.SetTraceNotification=Cp={}));var Vl;(function(n){n.type=new ee.NotificationType("$/logTrace")})(Vl||(ae.LogTraceNotification=Vl={}));var ba;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(ba||(ae.ConnectionErrors=ba={}));var Ki=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};ae.ConnectionError=Ki;var Dp;(function(n){function e(t){let r=t;return r&&at.func(r.cancelUndispatched)}n.is=e})(Dp||(ae.ConnectionStrategy=Dp={}));var Wl;(function(n){function e(t){let r=t;return r&&(r.kind===void 0||r.kind==="id")&&at.func(r.createCancellationTokenSource)&&(r.dispose===void 0||at.func(r.dispose))}n.is=e})(Wl||(ae.IdCancellationReceiverStrategy=Wl={}));var Op;(function(n){function e(t){let r=t;return r&&r.kind==="request"&&at.func(r.createCancellationTokenSource)&&(r.dispose===void 0||at.func(r.dispose))}n.is=e})(Op||(ae.RequestCancellationReceiverStrategy=Op={}));var Hl;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new kp.CancellationTokenSource}});function e(t){return Wl.is(t)||Op.is(t)}n.is=e})(Hl||(ae.CancellationReceiverStrategy=Hl={}));var Kl;(function(n){n.Message=Object.freeze({sendCancellation(t,r){return t.sendNotification(Ta.type,{id:r})},cleanup(t){}});function e(t){let r=t;return r&&at.func(r.sendCancellation)&&at.func(r.cleanup)}n.is=e})(Kl||(ae.CancellationSenderStrategy=Kl={}));var zl;(function(n){n.Message=Object.freeze({receiver:Hl.Message,sender:Kl.Message});function e(t){let r=t;return r&&Hl.is(r.receiver)&&Kl.is(r.sender)}n.is=e})(zl||(ae.CancellationStrategy=zl={}));var Gl;(function(n){function e(t){let r=t;return r&&at.func(r.handleMessage)}n.is=e})(Gl||(ae.MessageStrategy=Gl={}));var xT;(function(n){function e(t){let r=t;return r&&(zl.is(r.cancellationStrategy)||Dp.is(r.connectionStrategy)||Gl.is(r.messageStrategy))}n.is=e})(xT||(ae.ConnectionOptions=xT={}));var Qn;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(Qn||(Qn={}));function mI(n,e,t,r){let s=t!==void 0?t:ae.NullLogger,i=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,p=new Map,b,g=new IT.LinkedMap,S=new Map,E=new Set,T=new Map,v=Pe.Off,R=_n.Text,A,$=Qn.New,W=new ya.Emitter,j=new ya.Emitter,ie=new ya.Emitter,qe=new ya.Emitter,wt=new ya.Emitter,he=r&&r.cancellationStrategy?r.cancellationStrategy:zl.Message;function Cn(k){if(k===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+k.toString()}function ts(k){return k===null?"res-unknown-"+(++a).toString():"res-"+k.toString()}function gl(){return"not-"+(++o).toString()}function Oh(k,M){ee.Message.isRequest(M)?k.set(Cn(M.id),M):ee.Message.isResponse(M)?k.set(ts(M.id),M):k.set(gl(),M)}function yl(k){}function la(){return $===Qn.Listening}function Ks(){return $===Qn.Closed}function Lr(){return $===Qn.Disposed}function xi(){($===Qn.New||$===Qn.Listening)&&($=Qn.Closed,j.fire(void 0))}function zs(k){W.fire([k,void 0,void 0])}function vl(k){W.fire(k)}n.onClose(xi),n.onError(zs),e.onClose(xi),e.onError(vl);function ua(){b||g.size===0||(b=(0,AT.default)().timer.setImmediate(()=>{b=void 0,bl()}))}function da(k){ee.Message.isRequest(k)?Sl(k):ee.Message.isNotification(k)?wl(k):ee.Message.isResponse(k)?_l(k):$i(k)}function bl(){if(g.size===0)return;let k=g.shift();try{let M=r?.messageStrategy;Gl.is(M)?M.handleMessage(k,da):da(k)}finally{ua()}}let Tl=k=>{try{if(ee.Message.isNotification(k)&&k.method===Ta.type.method){let M=k.params.id,B=Cn(M),z=g.get(B);if(ee.Message.isRequest(z)){let De=r?.connectionStrategy,Qe=De&&De.cancelUndispatched?De.cancelUndispatched(z,yl):void 0;if(Qe&&(Qe.error!==void 0||Qe.result!==void 0)){g.delete(B),T.delete(M),Qe.id=z.id,Gs(Qe,k.method,Date.now()),e.write(Qe).catch(()=>s.error("Sending response for canceled message failed."));return}}let je=T.get(M);if(je!==void 0){je.cancel(),Li(k);return}else E.add(M)}Oh(g,k)}finally{ua()}};function Sl(k){if(Lr())return;function M(pe,Ve,Ee){let lt={jsonrpc:c,id:k.id};pe instanceof ee.ResponseError?lt.error=pe.toJson():lt.result=pe===void 0?null:pe,Gs(lt,Ve,Ee),e.write(lt).catch(()=>s.error("Sending response failed."))}function B(pe,Ve,Ee){let lt={jsonrpc:c,id:k.id,error:pe.toJson()};Gs(lt,Ve,Ee),e.write(lt).catch(()=>s.error("Sending response failed."))}function z(pe,Ve,Ee){pe===void 0&&(pe=null);let lt={jsonrpc:c,id:k.id,result:pe};Gs(lt,Ve,Ee),e.write(lt).catch(()=>s.error("Sending response failed."))}Nl(k);let je=u.get(k.method),De,Qe;je&&(De=je.type,Qe=je.handler);let it=Date.now();if(Qe||l){let pe=k.id??String(Date.now()),Ve=Wl.is(he.receiver)?he.receiver.createCancellationTokenSource(pe):he.receiver.createCancellationTokenSource(k);k.id!==null&&E.has(k.id)&&Ve.cancel(),k.id!==null&&T.set(pe,Ve);try{let Ee;if(Qe)if(k.params===void 0){if(De!==void 0&&De.numberOfParams!==0){B(new ee.ResponseError(ee.ErrorCodes.InvalidParams,`Request ${k.method} defines ${De.numberOfParams} params but received none.`),k.method,it);return}Ee=Qe(Ve.token)}else if(Array.isArray(k.params)){if(De!==void 0&&De.parameterStructures===ee.ParameterStructures.byName){B(new ee.ResponseError(ee.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by name but received parameters by position`),k.method,it);return}Ee=Qe(...k.params,Ve.token)}else{if(De!==void 0&&De.parameterStructures===ee.ParameterStructures.byPosition){B(new ee.ResponseError(ee.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by position but received parameters by name`),k.method,it);return}Ee=Qe(k.params,Ve.token)}else l&&(Ee=l(k.method,k.params,Ve.token));let lt=Ee;Ee?lt.then?lt.then(Dt=>{T.delete(pe),M(Dt,k.method,it)},Dt=>{T.delete(pe),Dt instanceof ee.ResponseError?B(Dt,k.method,it):Dt&&at.string(Dt.message)?B(new ee.ResponseError(ee.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${Dt.message}`),k.method,it):B(new ee.ResponseError(ee.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,it)}):(T.delete(pe),M(Ee,k.method,it)):(T.delete(pe),z(Ee,k.method,it))}catch(Ee){T.delete(pe),Ee instanceof ee.ResponseError?M(Ee,k.method,it):Ee&&at.string(Ee.message)?B(new ee.ResponseError(ee.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${Ee.message}`),k.method,it):B(new ee.ResponseError(ee.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,it)}}else B(new ee.ResponseError(ee.ErrorCodes.MethodNotFound,`Unhandled method ${k.method}`),k.method,it)}function _l(k){if(!Lr())if(k.id===null)k.error?s.error(`Received response message without id: Error is:
|
|
7
|
+
${JSON.stringify(k.error,void 0,4)}`):s.error("Received response message without id. No further error information provided.");else{let M=k.id,B=S.get(M);if(Pl(k,B),B!==void 0){S.delete(M);try{if(k.error){let z=k.error;B.reject(new ee.ResponseError(z.code,z.message,z.data))}else if(k.result!==void 0)B.resolve(k.result);else throw new Error("Should never happen.")}catch(z){z.message?s.error(`Response handler '${B.method}' failed with message: ${z.message}`):s.error(`Response handler '${B.method}' failed unexpectedly.`)}}}}function wl(k){if(Lr())return;let M,B;if(k.method===Ta.type.method){let z=k.params.id;E.delete(z),Li(k);return}else{let z=f.get(k.method);z&&(B=z.handler,M=z.type)}if(B||d)try{if(Li(k),B)if(k.params===void 0)M!==void 0&&M.numberOfParams!==0&&M.parameterStructures!==ee.ParameterStructures.byName&&s.error(`Notification ${k.method} defines ${M.numberOfParams} params but received none.`),B();else if(Array.isArray(k.params)){let z=k.params;k.method===va.type.method&&z.length===2&&Np.is(z[0])?B({token:z[0],value:z[1]}):(M!==void 0&&(M.parameterStructures===ee.ParameterStructures.byName&&s.error(`Notification ${k.method} defines parameters by name but received parameters by position`),M.numberOfParams!==k.params.length&&s.error(`Notification ${k.method} defines ${M.numberOfParams} params but received ${z.length} arguments`)),B(...z))}else M!==void 0&&M.parameterStructures===ee.ParameterStructures.byPosition&&s.error(`Notification ${k.method} defines parameters by position but received parameters by name`),B(k.params);else d&&d(k.method,k.params)}catch(z){z.message?s.error(`Notification handler '${k.method}' failed with message: ${z.message}`):s.error(`Notification handler '${k.method}' failed unexpectedly.`)}else ie.fire(k)}function $i(k){if(!k){s.error("Received empty message.");return}s.error(`Received message which is neither a response nor a notification message:
|
|
8
|
+
${JSON.stringify(k,null,4)}`);let M=k;if(at.string(M.id)||at.number(M.id)){let B=M.id,z=S.get(B);z&&z.reject(new Error("The received response has neither a result nor an error property."))}}function Yn(k){if(k!=null)switch(v){case Pe.Verbose:return JSON.stringify(k,null,4);case Pe.Compact:return JSON.stringify(k);default:return}}function El(k){if(!(v===Pe.Off||!A))if(R===_n.Text){let M;(v===Pe.Verbose||v===Pe.Compact)&&k.params&&(M=`Params: ${Yn(k.params)}
|
|
9
9
|
|
|
10
|
-
`),A.log(`Sending request '${
|
|
10
|
+
`),A.log(`Sending request '${k.method} - (${k.id})'.`,M)}else qr("send-request",k)}function kl(k){if(!(v===Pe.Off||!A))if(R===_n.Text){let M;(v===Pe.Verbose||v===Pe.Compact)&&(k.params?M=`Params: ${Yn(k.params)}
|
|
11
11
|
|
|
12
12
|
`:M=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),A.log(`Sending notification '${
|
|
14
|
+
`),A.log(`Sending notification '${k.method}'.`,M)}else qr("send-notification",k)}function Gs(k,M,B){if(!(v===Pe.Off||!A))if(R===_n.Text){let z;(v===Pe.Verbose||v===Pe.Compact)&&(k.error&&k.error.data?z=`Error data: ${Yn(k.error.data)}
|
|
15
15
|
|
|
16
|
-
`:
|
|
16
|
+
`:k.result?z=`Result: ${Yn(k.result)}
|
|
17
17
|
|
|
18
|
-
`:
|
|
18
|
+
`:k.error===void 0&&(z=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),A.log(`Sending response '${M} - (${
|
|
20
|
+
`)),A.log(`Sending response '${M} - (${k.id})'. Processing request took ${Date.now()-B}ms`,z)}else qr("send-response",k)}function Nl(k){if(!(v===Pe.Off||!A))if(R===_n.Text){let M;(v===Pe.Verbose||v===Pe.Compact)&&k.params&&(M=`Params: ${Yn(k.params)}
|
|
21
21
|
|
|
22
|
-
`),A.log(`Received request '${
|
|
22
|
+
`),A.log(`Received request '${k.method} - (${k.id})'.`,M)}else qr("receive-request",k)}function Li(k){if(!(v===Pe.Off||!A||k.method===Vl.type.method))if(R===_n.Text){let M;(v===Pe.Verbose||v===Pe.Compact)&&(k.params?M=`Params: ${Yn(k.params)}
|
|
23
23
|
|
|
24
24
|
`:M=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),A.log(`Received notification '${
|
|
26
|
+
`),A.log(`Received notification '${k.method}'.`,M)}else qr("receive-notification",k)}function Pl(k,M){if(!(v===Pe.Off||!A))if(R===_n.Text){let B;if((v===Pe.Verbose||v===Pe.Compact)&&(k.error&&k.error.data?B=`Error data: ${Yn(k.error.data)}
|
|
27
27
|
|
|
28
|
-
`:
|
|
28
|
+
`:k.result?B=`Result: ${Yn(k.result)}
|
|
29
29
|
|
|
30
|
-
`:
|
|
30
|
+
`:k.error===void 0&&(B=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),M){let K=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";A.log(`Received response '${M.method} - (${E.id})' in ${Date.now()-M.timerStart}ms.${K}`,B)}else A.log(`Received response ${E.id} without active response promise.`,B)}else On("receive-response",E)}function On(E,M){if(!A||v===Ne.Off)return;let B={isLSPMessage:!0,type:E,message:M,timestamp:Date.now()};A.log(B)}function Gn(){if(qs())throw new $i(ua.Closed,"Connection is closed.");if(Dn())throw new $i(ua.Disposed,"Connection is disposed.")}function ml(){if(ea())throw new $i(ua.AlreadyListening,"Connection is already listening")}function gl(){if(!ea())throw new Error("Call listen() first.")}function ln(E){return E===void 0?null:E}function na(E){if(E!==null)return E}function sa(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function Ci(E,M){switch(E){case Z.ParameterStructures.auto:return sa(M)?na(M):[ln(M)];case Z.ParameterStructures.byName:if(!sa(M))throw new Error("Received parameters by name but param is not an object literal.");return na(M);case Z.ParameterStructures.byPosition:return[ln(M)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function ia(E,M){let B,K=E.numberOfParams;switch(K){case 0:B=void 0;break;case 1:B=Ci(E.parameterStructures,M[0]);break;default:B=[];for(let $e=0;$e<M.length&&$e<K;$e++)B.push(ln(M[$e]));if(M.length<K)for(let $e=M.length;$e<K;$e++)B.push(null);break}return B}let An={sendNotification:(E,...M)=>{Gn();let B,K;if(st.string(E)){B=E;let De=M[0],Ge=0,tt=Z.ParameterStructures.auto;Z.ParameterStructures.is(De)&&(Ge=1,tt=De);let fe=M.length,Be=fe-Ge;switch(Be){case 0:K=void 0;break;case 1:K=Ci(tt,M[Ge]);break;default:if(tt===Z.ParameterStructures.byName)throw new Error(`Received ${Be} parameters for 'by Name' notification parameter structure.`);K=M.slice(Ge,fe).map(ke=>ln(ke));break}}else{let De=M;B=E.method,K=ia(E,De)}let $e={jsonrpc:c,method:B,params:K};return fl($e),e.write($e).catch(De=>{throw s.error("Sending notification failed."),De})},onNotification:(E,M)=>{Gn();let B;return st.func(E)?d=E:M&&(st.string(E)?(B=E,f.set(E,{type:void 0,handler:M})):(B=E.method,f.set(E.method,{type:E,handler:M}))),{dispose:()=>{B!==void 0?f.delete(B):d=void 0}}},onProgress:(E,M,B)=>{if(p.has(M))throw new Error(`Progress handler for token ${M} already registered`);return p.set(M,B),{dispose:()=>{p.delete(M)}}},sendProgress:(E,M,B)=>An.sendNotification(la.type,{token:M,value:B}),onUnhandledProgress:Le.event,sendRequest:(E,...M)=>{Gn(),gl();let B,K,$e;if(st.string(E)){B=E;let fe=M[0],Be=M[M.length-1],ke=0,ot=Z.ParameterStructures.auto;Z.ParameterStructures.is(fe)&&(ke=1,ot=fe);let Nt=M.length;hp.CancellationToken.is(Be)&&(Nt=Nt-1,$e=Be);let yr=Nt-ke;switch(yr){case 0:K=void 0;break;case 1:K=Ci(ot,M[ke]);break;default:if(ot===Z.ParameterStructures.byName)throw new Error(`Received ${yr} parameters for 'by Name' request parameter structure.`);K=M.slice(ke,Nt).map(yl=>ln(yl));break}}else{let fe=M;B=E.method,K=ia(E,fe);let Be=E.numberOfParams;$e=hp.CancellationToken.is(fe[Be])?fe[Be]:void 0}let De=i++,Ge;$e&&(Ge=$e.onCancellationRequested(()=>{let fe=de.sender.sendCancellation(An,De);return fe===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${De}`),Promise.resolve()):fe.catch(()=>{s.log(`Sending cancellation messages for id ${De} failed`)})}));let tt={jsonrpc:c,id:De,method:B,params:K};return dl(tt),typeof de.sender.enableCancellation=="function"&&de.sender.enableCancellation(tt),new Promise(async(fe,Be)=>{let ke=yr=>{fe(yr),de.sender.cleanup(De),Ge?.dispose()},ot=yr=>{Be(yr),de.sender.cleanup(De),Ge?.dispose()},Nt={method:B,timerStart:Date.now(),resolve:ke,reject:ot};try{await e.write(tt),_.set(De,Nt)}catch(yr){throw s.error("Sending request failed."),Nt.reject(new Z.ResponseError(Z.ErrorCodes.MessageWriteError,yr.message?yr.message:"Unknown reason")),yr}})},onRequest:(E,M)=>{Gn();let B=null;return gp.is(E)?(B=void 0,l=E):st.string(E)?(B=null,M!==void 0&&(B=E,u.set(E,{handler:M,type:void 0}))):M!==void 0&&(B=E.method,u.set(E.method,{type:E,handler:M})),{dispose:()=>{B!==null&&(B!==void 0?u.delete(B):l=void 0)}}},hasPendingResponse:()=>_.size>0,trace:async(E,M,B)=>{let K=!1,$e=vr.Text;B!==void 0&&(st.boolean(B)?K=B:(K=B.sendNotification||!1,$e=B.traceFormat||vr.Text)),v=E,R=$e,v===Ne.Off?A=void 0:A=M,K&&!qs()&&!Dn()&&await An.sendNotification(yp.type,{value:Ne.toString(E)})},onError:W.event,onClose:j.event,onUnhandledNotification:ne.event,onDispose:Tt.event,end:()=>{e.end()},dispose:()=>{if(Dn())return;L=Wr.Disposed,Tt.fire(void 0);let E=new Z.ResponseError(Z.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let M of _.values())M.reject(E);_=new Map,T=new Map,w=new Set,g=new TT.LinkedMap,st.func(e.dispose)&&e.dispose(),st.func(r.dispose)&&r.dispose()},listen:()=>{Gn(),ml(),L=Wr.Listening,r.listen(al)},inspect:()=>{(0,bT.default)().console.log("inspect")}};return An.onNotification(Dl.type,E=>{if(v===Ne.Off||!A)return;let M=v===Ne.Verbose||v===Ne.Compact;A.log(E.message,M?E.verbose:void 0)}),An.onNotification(la.type,E=>{let M=p.get(E.token);M?M(E.value):Le.fire(E)}),An}ie.createMessageConnection=GA});var Ll=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 Ke=Hh();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return Ke.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return Ke.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return Ke.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return Ke.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return Ke.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return Ke.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return Ke.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return Ke.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return Ke.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return Ke.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return Ke.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return Ke.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return Ke.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return Ke.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return Ke.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return Ke.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return Ke.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return Ke.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return Ke.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return Ke.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return Ke.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return Ke.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return Ke.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return Ke.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return Ke.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return Ke.ParameterStructures}});var Tp=zh();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return Tp.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return Tp.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return Tp.Touch}});var YA=cT();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return YA.Disposable}});var wT=Ii();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return wT.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return wT.Emitter}});var ET=El();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return ET.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return ET.CancellationToken}});var NT=uT();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return NT.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return NT.SharedArrayReceiverStrategy}});var _p=fT();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return _p.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return _p.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return _p.ReadableStreamMessageReader}});var Sp=yT();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return Sp.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return Sp.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Sp.WriteableStreamMessageWriter}});var JA=vT();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return JA.AbstractMessageBuffer}});var It=kT();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return It.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return It.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return It.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return It.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return It.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return It.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return It.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return It.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return It.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return It.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return It.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return It.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return It.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return It.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return It.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return It.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return It.MessageStrategy}});var XA=Jn();I.RAL=XA.default});var CT=k(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});var PT=require("util"),Mn=Ll(),$l=class r extends Mn.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return r.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new PT.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};$l.emptyBuffer=Buffer.allocUnsafe(0);var kp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mn.Disposable.create(()=>this.stream.off("data",e))}},wp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((n,s)=>{let i=o=>{o==null?n():s(o)};typeof e=="string"?this.stream.write(e,t,i):this.stream.write(e,i)})}end(){this.stream.end()}},RT=Object.freeze({messageBuffer:Object.freeze({create:r=>new $l(r)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(r,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(r,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(r,e)=>{try{return r instanceof Buffer?Promise.resolve(JSON.parse(r.toString(e.charset))):Promise.resolve(JSON.parse(new PT.TextDecoder(e.charset).decode(r)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:r=>new kp(r),asWritableStream:r=>new wp(r)}),console,timer:Object.freeze({setTimeout(r,e,...t){let n=setTimeout(r,e,...t);return{dispose:()=>clearTimeout(n)}},setImmediate(r,...e){let t=setImmediate(r,...e);return{dispose:()=>clearImmediate(t)}},setInterval(r,e,...t){let n=setInterval(r,e,...t);return{dispose:()=>clearInterval(n)}}})});function Ep(){return RT}(function(r){function e(){Mn.RAL.install(RT)}r.install=e})(Ep||(Ep={}));Np.default=Ep});var Ws=k(ge=>{"use strict";var QA=ge&&ge.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ZA=ge&&ge.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&QA(e,r,t)};Object.defineProperty(ge,"__esModule",{value:!0});ge.createMessageConnection=ge.createServerSocketTransport=ge.createClientSocketTransport=ge.createServerPipeTransport=ge.createClientPipeTransport=ge.generateRandomPipeName=ge.StreamMessageWriter=ge.StreamMessageReader=ge.SocketMessageWriter=ge.SocketMessageReader=ge.PortMessageWriter=ge.PortMessageReader=ge.IPCMessageWriter=ge.IPCMessageReader=void 0;var qi=CT();qi.default.install();var DT=require("path"),eI=require("os"),tI=require("crypto"),Fl=require("net"),br=Ll();ZA(Ll(),ge);var Pp=class extends br.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",n=>this.fireError(n)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),br.Disposable.create(()=>this.process.off("message",e))}};ge.IPCMessageReader=Pp;var Rp=class extends br.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",n=>this.fireError(n)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ge.IPCMessageWriter=Rp;var Cp=class extends br.AbstractMessageReader{constructor(e){super(),this.onData=new br.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};ge.PortMessageReader=Cp;var Dp=class extends br.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ge.PortMessageWriter=Dp;var Us=class extends br.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,qi.default)().stream.asReadableStream(e),t)}};ge.SocketMessageReader=Us;var Vs=class extends br.WriteableStreamMessageWriter{constructor(e,t){super((0,qi.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ge.SocketMessageWriter=Vs;var ql=class extends br.ReadableStreamMessageReader{constructor(e,t){super((0,qi.default)().stream.asReadableStream(e),t)}};ge.StreamMessageReader=ql;var jl=class extends br.WriteableStreamMessageWriter{constructor(e,t){super((0,qi.default)().stream.asWritableStream(e),t)}};ge.StreamMessageWriter=jl;var OT=process.env.XDG_RUNTIME_DIR,rI=new Map([["linux",107],["darwin",103]]);function nI(){let r=(0,tI.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${r}-sock`;let e;OT?e=DT.join(OT,`vscode-ipc-${r}.sock`):e=DT.join(eI.tmpdir(),`vscode-${r}.sock`);let t=rI.get(process.platform);return t!==void 0&&e.length>t&&(0,qi.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}ge.generateRandomPipeName=nI;function sI(r,e="utf-8"){let t,n=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Fl.createServer)(a=>{o.close(),t([new Us(a,e),new Vs(a,e)])});o.on("error",i),o.listen(r,()=>{o.removeListener("error",i),s({onConnected:()=>n})})})}ge.createClientPipeTransport=sI;function iI(r,e="utf-8"){let t=(0,Fl.createConnection)(r);return[new Us(t,e),new Vs(t,e)]}ge.createServerPipeTransport=iI;function oI(r,e="utf-8"){let t,n=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Fl.createServer)(a=>{o.close(),t([new Us(a,e),new Vs(a,e)])});o.on("error",i),o.listen(r,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>n})})})}ge.createClientSocketTransport=oI;function aI(r,e="utf-8"){let t=(0,Fl.createConnection)(r,"127.0.0.1");return[new Us(t,e),new Vs(t,e)]}ge.createServerSocketTransport=aI;function cI(r){let e=r;return e.read!==void 0&&e.addListener!==void 0}function lI(r){let e=r;return e.write!==void 0&&e.addListener!==void 0}function uI(r,e,t,n){t||(t=br.NullLogger);let s=cI(r)?new ql(r):r,i=lI(e)?new jl(e):e;return br.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,br.createMessageConnection)(s,i,t,n)}ge.createMessageConnection=uI});var Op=k((SK,AT)=>{"use strict";AT.exports=Ws()});var Ul=k((IT,Bl)=>{(function(r){if(typeof Bl=="object"&&typeof Bl.exports=="object"){var e=r(require,IT);e!==void 0&&(Bl.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],r)})(function(r,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(m){function N(P){return typeof P=="string"}m.is=N})(t||(e.DocumentUri=t={}));var n;(function(m){function N(P){return typeof P=="string"}m.is=N})(n||(e.URI=n={}));var s;(function(m){m.MIN_VALUE=-2147483648,m.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&m.MIN_VALUE<=P&&P<=m.MAX_VALUE}m.is=N})(s||(e.integer=s={}));var i;(function(m){m.MIN_VALUE=0,m.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&m.MIN_VALUE<=P&&P<=m.MAX_VALUE}m.is=N})(i||(e.uinteger=i={}));var o;(function(m){function N(y,h){return y===Number.MAX_VALUE&&(y=i.MAX_VALUE),h===Number.MAX_VALUE&&(h=i.MAX_VALUE),{line:y,character:h}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.uinteger(h.line)&&O.uinteger(h.character)}m.is=P})(o||(e.Position=o={}));var a;(function(m){function N(y,h,D,x){if(O.uinteger(y)&&O.uinteger(h)&&O.uinteger(D)&&O.uinteger(x))return{start:o.create(y,h),end:o.create(D,x)};if(o.is(y)&&o.is(h))return{start:y,end:h};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(h,", ").concat(D,", ").concat(x,"]"))}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&o.is(h.start)&&o.is(h.end)}m.is=P})(a||(e.Range=a={}));var c;(function(m){function N(y,h){return{uri:y,range:h}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.range)&&(O.string(h.uri)||O.undefined(h.uri))}m.is=P})(c||(e.Location=c={}));var l;(function(m){function N(y,h,D,x){return{targetUri:y,targetRange:h,targetSelectionRange:D,originSelectionRange:x}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.targetRange)&&O.string(h.targetUri)&&a.is(h.targetSelectionRange)&&(a.is(h.originSelectionRange)||O.undefined(h.originSelectionRange))}m.is=P})(l||(e.LocationLink=l={}));var u;(function(m){function N(y,h,D,x){return{red:y,green:h,blue:D,alpha:x}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.numberRange(h.red,0,1)&&O.numberRange(h.green,0,1)&&O.numberRange(h.blue,0,1)&&O.numberRange(h.alpha,0,1)}m.is=P})(u||(e.Color=u={}));var d;(function(m){function N(y,h){return{range:y,color:h}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.range)&&u.is(h.color)}m.is=P})(d||(e.ColorInformation=d={}));var f;(function(m){function N(y,h,D){return{label:y,textEdit:h,additionalTextEdits:D}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.string(h.label)&&(O.undefined(h.textEdit)||A.is(h))&&(O.undefined(h.additionalTextEdits)||O.typedArray(h.additionalTextEdits,A.is))}m.is=P})(f||(e.ColorPresentation=f={}));var p;(function(m){m.Comment="comment",m.Imports="imports",m.Region="region"})(p||(e.FoldingRangeKind=p={}));var b;(function(m){function N(y,h,D,x,se,at){var He={startLine:y,endLine:h};return O.defined(D)&&(He.startCharacter=D),O.defined(x)&&(He.endCharacter=x),O.defined(se)&&(He.kind=se),O.defined(at)&&(He.collapsedText=at),He}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.uinteger(h.startLine)&&O.uinteger(h.startLine)&&(O.undefined(h.startCharacter)||O.uinteger(h.startCharacter))&&(O.undefined(h.endCharacter)||O.uinteger(h.endCharacter))&&(O.undefined(h.kind)||O.string(h.kind))}m.is=P})(b||(e.FoldingRange=b={}));var g;(function(m){function N(y,h){return{location:y,message:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&c.is(h.location)&&O.string(h.message)}m.is=P})(g||(e.DiagnosticRelatedInformation=g={}));var _;(function(m){m.Error=1,m.Warning=2,m.Information=3,m.Hint=4})(_||(e.DiagnosticSeverity=_={}));var w;(function(m){m.Unnecessary=1,m.Deprecated=2})(w||(e.DiagnosticTag=w={}));var T;(function(m){function N(P){var y=P;return O.objectLiteral(y)&&O.string(y.href)}m.is=N})(T||(e.CodeDescription=T={}));var v;(function(m){function N(y,h,D,x,se,at){var He={range:y,message:h};return O.defined(D)&&(He.severity=D),O.defined(x)&&(He.code=x),O.defined(se)&&(He.source=se),O.defined(at)&&(He.relatedInformation=at),He}m.create=N;function P(y){var h,D=y;return O.defined(D)&&a.is(D.range)&&O.string(D.message)&&(O.number(D.severity)||O.undefined(D.severity))&&(O.integer(D.code)||O.string(D.code)||O.undefined(D.code))&&(O.undefined(D.codeDescription)||O.string((h=D.codeDescription)===null||h===void 0?void 0:h.href))&&(O.string(D.source)||O.undefined(D.source))&&(O.undefined(D.relatedInformation)||O.typedArray(D.relatedInformation,g.is))}m.is=P})(v||(e.Diagnostic=v={}));var R;(function(m){function N(y,h){for(var D=[],x=2;x<arguments.length;x++)D[x-2]=arguments[x];var se={title:y,command:h};return O.defined(D)&&D.length>0&&(se.arguments=D),se}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.title)&&O.string(h.command)}m.is=P})(R||(e.Command=R={}));var A;(function(m){function N(D,x){return{range:D,newText:x}}m.replace=N;function P(D,x){return{range:{start:D,end:D},newText:x}}m.insert=P;function y(D){return{range:D,newText:""}}m.del=y;function h(D){var x=D;return O.objectLiteral(x)&&O.string(x.newText)&&a.is(x.range)}m.is=h})(A||(e.TextEdit=A={}));var L;(function(m){function N(y,h,D){var x={label:y};return h!==void 0&&(x.needsConfirmation=h),D!==void 0&&(x.description=D),x}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.string(h.label)&&(O.boolean(h.needsConfirmation)||h.needsConfirmation===void 0)&&(O.string(h.description)||h.description===void 0)}m.is=P})(L||(e.ChangeAnnotation=L={}));var W;(function(m){function N(P){var y=P;return O.string(y)}m.is=N})(W||(e.ChangeAnnotationIdentifier=W={}));var j;(function(m){function N(D,x,se){return{range:D,newText:x,annotationId:se}}m.replace=N;function P(D,x,se){return{range:{start:D,end:D},newText:x,annotationId:se}}m.insert=P;function y(D,x){return{range:D,newText:"",annotationId:x}}m.del=y;function h(D){var x=D;return A.is(x)&&(L.is(x.annotationId)||W.is(x.annotationId))}m.is=h})(j||(e.AnnotatedTextEdit=j={}));var ne;(function(m){function N(y,h){return{textDocument:y,edits:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&qs.is(h.textDocument)&&Array.isArray(h.edits)}m.is=P})(ne||(e.TextDocumentEdit=ne={}));var Le;(function(m){function N(y,h,D){var x={kind:"create",uri:y};return h!==void 0&&(h.overwrite!==void 0||h.ignoreIfExists!==void 0)&&(x.options=h),D!==void 0&&(x.annotationId=D),x}m.create=N;function P(y){var h=y;return h&&h.kind==="create"&&O.string(h.uri)&&(h.options===void 0||(h.options.overwrite===void 0||O.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||O.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}m.is=P})(Le||(e.CreateFile=Le={}));var Tt;(function(m){function N(y,h,D,x){var se={kind:"rename",oldUri:y,newUri:h};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(se.options=D),x!==void 0&&(se.annotationId=x),se}m.create=N;function P(y){var h=y;return h&&h.kind==="rename"&&O.string(h.oldUri)&&O.string(h.newUri)&&(h.options===void 0||(h.options.overwrite===void 0||O.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||O.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}m.is=P})(Tt||(e.RenameFile=Tt={}));var de;(function(m){function N(y,h,D){var x={kind:"delete",uri:y};return h!==void 0&&(h.recursive!==void 0||h.ignoreIfNotExists!==void 0)&&(x.options=h),D!==void 0&&(x.annotationId=D),x}m.create=N;function P(y){var h=y;return h&&h.kind==="delete"&&O.string(h.uri)&&(h.options===void 0||(h.options.recursive===void 0||O.boolean(h.options.recursive))&&(h.options.ignoreIfNotExists===void 0||O.boolean(h.options.ignoreIfNotExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}m.is=P})(de||(e.DeleteFile=de={}));var kr;(function(m){function N(P){var y=P;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(h){return O.string(h.kind)?Le.is(h)||Tt.is(h)||de.is(h):ne.is(h)}))}m.is=N})(kr||(e.WorkspaceEdit=kr={}));var zn=function(){function m(N,P){this.edits=N,this.changeAnnotations=P}return m.prototype.insert=function(N,P,y){var h,D;if(y===void 0?h=A.insert(N,P):W.is(y)?(D=y,h=j.insert(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),h=j.insert(N,P,D)),this.edits.push(h),D!==void 0)return D},m.prototype.replace=function(N,P,y){var h,D;if(y===void 0?h=A.replace(N,P):W.is(y)?(D=y,h=j.replace(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),h=j.replace(N,P,D)),this.edits.push(h),D!==void 0)return D},m.prototype.delete=function(N,P){var y,h;if(P===void 0?y=A.del(N):W.is(P)?(h=P,y=j.del(N,P)):(this.assertChangeAnnotations(this.changeAnnotations),h=this.changeAnnotations.manage(P),y=j.del(N,h)),this.edits.push(y),h!==void 0)return h},m.prototype.add=function(N){this.edits.push(N)},m.prototype.all=function(){return this.edits},m.prototype.clear=function(){this.edits.splice(0,this.edits.length)},m.prototype.assertChangeAnnotations=function(N){if(N===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},m}(),nl=function(){function m(N){this._annotations=N===void 0?Object.create(null):N,this._counter=0,this._size=0}return m.prototype.all=function(){return this._annotations},Object.defineProperty(m.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),m.prototype.manage=function(N,P){var y;if(W.is(N)?y=N:(y=this.nextId(),P=N),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(P===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=P,this._size++,y},m.prototype.nextId=function(){return this._counter++,this._counter.toString()},m}(),bh=function(){function m(N){var P=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new nl(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function(y){if(ne.is(y)){var h=new zn(y.edits,P._changeAnnotations);P._textEditChanges[y.textDocument.uri]=h}})):N.changes&&Object.keys(N.changes).forEach(function(y){var h=new zn(N.changes[y]);P._textEditChanges[y]=h})):this._workspaceEdit={}}return Object.defineProperty(m.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}),m.prototype.getTextEditChange=function(N){if(qs.is(N)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P={uri:N.uri,version:N.version},y=this._textEditChanges[P.uri];if(!y){var h=[],D={textDocument:P,edits:h};this._workspaceEdit.documentChanges.push(D),y=new zn(h,this._changeAnnotations),this._textEditChanges[P.uri]=y}return y}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var y=this._textEditChanges[N];if(!y){var h=[];this._workspaceEdit.changes[N]=h,y=new zn(h),this._textEditChanges[N]=y}return y}},m.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new nl,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},m.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},m.prototype.createFile=function(N,P,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;L.is(P)||W.is(P)?h=P:y=P;var D,x;if(h===void 0?D=Le.create(N,y):(x=W.is(h)?h:this._changeAnnotations.manage(h),D=Le.create(N,y,x)),this._workspaceEdit.documentChanges.push(D),x!==void 0)return x},m.prototype.renameFile=function(N,P,y,h){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;L.is(y)||W.is(y)?D=y:h=y;var x,se;if(D===void 0?x=Tt.create(N,P,h):(se=W.is(D)?D:this._changeAnnotations.manage(D),x=Tt.create(N,P,h,se)),this._workspaceEdit.documentChanges.push(x),se!==void 0)return se},m.prototype.deleteFile=function(N,P,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;L.is(P)||W.is(P)?h=P:y=P;var D,x;if(h===void 0?D=de.create(N,y):(x=W.is(h)?h:this._changeAnnotations.manage(h),D=de.create(N,y,x)),this._workspaceEdit.documentChanges.push(D),x!==void 0)return x},m}();e.WorkspaceChange=bh;var sl;(function(m){function N(y){return{uri:y}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)}m.is=P})(sl||(e.TextDocumentIdentifier=sl={}));var ea;(function(m){function N(y,h){return{uri:y,version:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&O.integer(h.version)}m.is=P})(ea||(e.VersionedTextDocumentIdentifier=ea={}));var qs;(function(m){function N(y,h){return{uri:y,version:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&(h.version===null||O.integer(h.version))}m.is=P})(qs||(e.OptionalVersionedTextDocumentIdentifier=qs={}));var Dn;(function(m){function N(y,h,D,x){return{uri:y,languageId:h,version:D,text:x}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&O.string(h.languageId)&&O.integer(h.version)&&O.string(h.text)}m.is=P})(Dn||(e.TextDocumentItem=Dn={}));var Ni;(function(m){m.PlainText="plaintext",m.Markdown="markdown";function N(P){var y=P;return y===m.PlainText||y===m.Markdown}m.is=N})(Ni||(e.MarkupKind=Ni={}));var js;(function(m){function N(P){var y=P;return O.objectLiteral(P)&&Ni.is(y.kind)&&O.string(y.value)}m.is=N})(js||(e.MarkupContent=js={}));var il;(function(m){m.Text=1,m.Method=2,m.Function=3,m.Constructor=4,m.Field=5,m.Variable=6,m.Class=7,m.Interface=8,m.Module=9,m.Property=10,m.Unit=11,m.Value=12,m.Enum=13,m.Keyword=14,m.Snippet=15,m.Color=16,m.File=17,m.Reference=18,m.Folder=19,m.EnumMember=20,m.Constant=21,m.Struct=22,m.Event=23,m.Operator=24,m.TypeParameter=25})(il||(e.CompletionItemKind=il={}));var ta;(function(m){m.PlainText=1,m.Snippet=2})(ta||(e.InsertTextFormat=ta={}));var ra;(function(m){m.Deprecated=1})(ra||(e.CompletionItemTag=ra={}));var ol;(function(m){function N(y,h,D){return{newText:y,insert:h,replace:D}}m.create=N;function P(y){var h=y;return h&&O.string(h.newText)&&a.is(h.insert)&&a.is(h.replace)}m.is=P})(ol||(e.InsertReplaceEdit=ol={}));var al;(function(m){m.asIs=1,m.adjustIndentation=2})(al||(e.InsertTextMode=al={}));var cl;(function(m){function N(P){var y=P;return y&&(O.string(y.detail)||y.detail===void 0)&&(O.string(y.description)||y.description===void 0)}m.is=N})(cl||(e.CompletionItemLabelDetails=cl={}));var ll;(function(m){function N(P){return{label:P}}m.create=N})(ll||(e.CompletionItem=ll={}));var ul;(function(m){function N(P,y){return{items:P||[],isIncomplete:!!y}}m.create=N})(ul||(e.CompletionList=ul={}));var Pi;(function(m){function N(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}m.fromPlainText=N;function P(y){var h=y;return O.string(h)||O.objectLiteral(h)&&O.string(h.language)&&O.string(h.value)}m.is=P})(Pi||(e.MarkedString=Pi={}));var Br;(function(m){function N(P){var y=P;return!!y&&O.objectLiteral(y)&&(js.is(y.contents)||Pi.is(y.contents)||O.typedArray(y.contents,Pi.is))&&(P.range===void 0||a.is(P.range))}m.is=N})(Br||(e.Hover=Br={}));var dl;(function(m){function N(P,y){return y?{label:P,documentation:y}:{label:P}}m.create=N})(dl||(e.ParameterInformation=dl={}));var fl;(function(m){function N(P,y){for(var h=[],D=2;D<arguments.length;D++)h[D-2]=arguments[D];var x={label:P};return O.defined(y)&&(x.documentation=y),O.defined(h)?x.parameters=h:x.parameters=[],x}m.create=N})(fl||(e.SignatureInformation=fl={}));var Fs;(function(m){m.Text=1,m.Read=2,m.Write=3})(Fs||(e.DocumentHighlightKind=Fs={}));var hl;(function(m){function N(P,y){var h={range:P};return O.number(y)&&(h.kind=y),h}m.create=N})(hl||(e.DocumentHighlight=hl={}));var Ri;(function(m){m.File=1,m.Module=2,m.Namespace=3,m.Package=4,m.Class=5,m.Method=6,m.Property=7,m.Field=8,m.Constructor=9,m.Enum=10,m.Interface=11,m.Function=12,m.Variable=13,m.Constant=14,m.String=15,m.Number=16,m.Boolean=17,m.Array=18,m.Object=19,m.Key=20,m.Null=21,m.EnumMember=22,m.Struct=23,m.Event=24,m.Operator=25,m.TypeParameter=26})(Ri||(e.SymbolKind=Ri={}));var pl;(function(m){m.Deprecated=1})(pl||(e.SymbolTag=pl={}));var On;(function(m){function N(P,y,h,D,x){var se={name:P,kind:y,location:{uri:D,range:h}};return x&&(se.containerName=x),se}m.create=N})(On||(e.SymbolInformation=On={}));var Gn;(function(m){function N(P,y,h,D){return D!==void 0?{name:P,kind:y,location:{uri:h,range:D}}:{name:P,kind:y,location:{uri:h}}}m.create=N})(Gn||(e.WorkspaceSymbol=Gn={}));var ml;(function(m){function N(y,h,D,x,se,at){var He={name:y,detail:h,kind:D,range:x,selectionRange:se};return at!==void 0&&(He.children=at),He}m.create=N;function P(y){var h=y;return h&&O.string(h.name)&&O.number(h.kind)&&a.is(h.range)&&a.is(h.selectionRange)&&(h.detail===void 0||O.string(h.detail))&&(h.deprecated===void 0||O.boolean(h.deprecated))&&(h.children===void 0||Array.isArray(h.children))&&(h.tags===void 0||Array.isArray(h.tags))}m.is=P})(ml||(e.DocumentSymbol=ml={}));var gl;(function(m){m.Empty="",m.QuickFix="quickfix",m.Refactor="refactor",m.RefactorExtract="refactor.extract",m.RefactorInline="refactor.inline",m.RefactorRewrite="refactor.rewrite",m.Source="source",m.SourceOrganizeImports="source.organizeImports",m.SourceFixAll="source.fixAll"})(gl||(e.CodeActionKind=gl={}));var ln;(function(m){m.Invoked=1,m.Automatic=2})(ln||(e.CodeActionTriggerKind=ln={}));var na;(function(m){function N(y,h,D){var x={diagnostics:y};return h!=null&&(x.only=h),D!=null&&(x.triggerKind=D),x}m.create=N;function P(y){var h=y;return O.defined(h)&&O.typedArray(h.diagnostics,v.is)&&(h.only===void 0||O.typedArray(h.only,O.string))&&(h.triggerKind===void 0||h.triggerKind===ln.Invoked||h.triggerKind===ln.Automatic)}m.is=P})(na||(e.CodeActionContext=na={}));var sa;(function(m){function N(y,h,D){var x={title:y},se=!0;return typeof h=="string"?(se=!1,x.kind=h):R.is(h)?x.command=h:x.edit=h,se&&D!==void 0&&(x.kind=D),x}m.create=N;function P(y){var h=y;return h&&O.string(h.title)&&(h.diagnostics===void 0||O.typedArray(h.diagnostics,v.is))&&(h.kind===void 0||O.string(h.kind))&&(h.edit!==void 0||h.command!==void 0)&&(h.command===void 0||R.is(h.command))&&(h.isPreferred===void 0||O.boolean(h.isPreferred))&&(h.edit===void 0||kr.is(h.edit))}m.is=P})(sa||(e.CodeAction=sa={}));var Ci;(function(m){function N(y,h){var D={range:y};return O.defined(h)&&(D.data=h),D}m.create=N;function P(y){var h=y;return O.defined(h)&&a.is(h.range)&&(O.undefined(h.command)||R.is(h.command))}m.is=P})(Ci||(e.CodeLens=Ci={}));var ia;(function(m){function N(y,h){return{tabSize:y,insertSpaces:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.uinteger(h.tabSize)&&O.boolean(h.insertSpaces)}m.is=P})(ia||(e.FormattingOptions=ia={}));var An;(function(m){function N(y,h,D){return{range:y,target:h,data:D}}m.create=N;function P(y){var h=y;return O.defined(h)&&a.is(h.range)&&(O.undefined(h.target)||O.string(h.target))}m.is=P})(An||(e.DocumentLink=An={}));var E;(function(m){function N(y,h){return{range:y,parent:h}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.range)&&(h.parent===void 0||m.is(h.parent))}m.is=P})(E||(e.SelectionRange=E={}));var M;(function(m){m.namespace="namespace",m.type="type",m.class="class",m.enum="enum",m.interface="interface",m.struct="struct",m.typeParameter="typeParameter",m.parameter="parameter",m.variable="variable",m.property="property",m.enumMember="enumMember",m.event="event",m.function="function",m.method="method",m.macro="macro",m.keyword="keyword",m.modifier="modifier",m.comment="comment",m.string="string",m.number="number",m.regexp="regexp",m.operator="operator",m.decorator="decorator"})(M||(e.SemanticTokenTypes=M={}));var B;(function(m){m.declaration="declaration",m.definition="definition",m.readonly="readonly",m.static="static",m.deprecated="deprecated",m.abstract="abstract",m.async="async",m.modification="modification",m.documentation="documentation",m.defaultLibrary="defaultLibrary"})(B||(e.SemanticTokenModifiers=B={}));var K;(function(m){function N(P){var y=P;return O.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}m.is=N})(K||(e.SemanticTokens=K={}));var $e;(function(m){function N(y,h){return{range:y,text:h}}m.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&O.string(h.text)}m.is=P})($e||(e.InlineValueText=$e={}));var De;(function(m){function N(y,h,D){return{range:y,variableName:h,caseSensitiveLookup:D}}m.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&O.boolean(h.caseSensitiveLookup)&&(O.string(h.variableName)||h.variableName===void 0)}m.is=P})(De||(e.InlineValueVariableLookup=De={}));var Ge;(function(m){function N(y,h){return{range:y,expression:h}}m.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&(O.string(h.expression)||h.expression===void 0)}m.is=P})(Ge||(e.InlineValueEvaluatableExpression=Ge={}));var tt;(function(m){function N(y,h){return{frameId:y,stoppedLocation:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&a.is(y.stoppedLocation)}m.is=P})(tt||(e.InlineValueContext=tt={}));var fe;(function(m){m.Type=1,m.Parameter=2;function N(P){return P===1||P===2}m.is=N})(fe||(e.InlayHintKind=fe={}));var Be;(function(m){function N(y){return{value:y}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&(h.tooltip===void 0||O.string(h.tooltip)||js.is(h.tooltip))&&(h.location===void 0||c.is(h.location))&&(h.command===void 0||R.is(h.command))}m.is=P})(Be||(e.InlayHintLabelPart=Be={}));var ke;(function(m){function N(y,h,D){var x={position:y,label:h};return D!==void 0&&(x.kind=D),x}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&o.is(h.position)&&(O.string(h.label)||O.typedArray(h.label,Be.is))&&(h.kind===void 0||fe.is(h.kind))&&h.textEdits===void 0||O.typedArray(h.textEdits,A.is)&&(h.tooltip===void 0||O.string(h.tooltip)||js.is(h.tooltip))&&(h.paddingLeft===void 0||O.boolean(h.paddingLeft))&&(h.paddingRight===void 0||O.boolean(h.paddingRight))}m.is=P})(ke||(e.InlayHint=ke={}));var ot;(function(m){function N(P){return{kind:"snippet",value:P}}m.createSnippet=N})(ot||(e.StringValue=ot={}));var Nt;(function(m){function N(P,y,h,D){return{insertText:P,filterText:y,range:h,command:D}}m.create=N})(Nt||(e.InlineCompletionItem=Nt={}));var yr;(function(m){function N(P){return{items:P}}m.create=N})(yr||(e.InlineCompletionList=yr={}));var yl;(function(m){m.Invoked=0,m.Automatic=1})(yl||(e.InlineCompletionTriggerKind=yl={}));var Yb;(function(m){function N(P,y){return{range:P,text:y}}m.create=N})(Yb||(e.SelectedCompletionInfo=Yb={}));var Jb;(function(m){function N(P,y){return{triggerKind:P,selectedCompletionInfo:y}}m.create=N})(Jb||(e.InlineCompletionContext=Jb={}));var Xb;(function(m){function N(P){var y=P;return O.objectLiteral(y)&&n.is(y.uri)&&O.string(y.name)}m.is=N})(Xb||(e.WorkspaceFolder=Xb={})),e.EOL=[`
|
|
32
|
+
`)),M){let z=k.error?` Request failed: ${k.error.message} (${k.error.code}).`:"";A.log(`Received response '${M.method} - (${k.id})' in ${Date.now()-M.timerStart}ms.${z}`,B)}else A.log(`Received response ${k.id} without active response promise.`,B)}else qr("receive-response",k)}function qr(k,M){if(!A||v===Pe.Off)return;let B={isLSPMessage:!0,type:k,message:M,timestamp:Date.now()};A.log(B)}function ns(){if(Ks())throw new Ki(ba.Closed,"Connection is closed.");if(Lr())throw new Ki(ba.Disposed,"Connection is disposed.")}function Rl(){if(la())throw new Ki(ba.AlreadyListening,"Connection is already listening")}function Cl(){if(!la())throw new Error("Call listen() first.")}function mr(k){return k===void 0?null:k}function fa(k){if(k!==null)return k}function ha(k){return k!=null&&!Array.isArray(k)&&typeof k=="object"}function qi(k,M){switch(k){case ee.ParameterStructures.auto:return ha(M)?fa(M):[mr(M)];case ee.ParameterStructures.byName:if(!ha(M))throw new Error("Received parameters by name but param is not an object literal.");return fa(M);case ee.ParameterStructures.byPosition:return[mr(M)];default:throw new Error(`Unknown parameter structure ${k.toString()}`)}}function pa(k,M){let B,z=k.numberOfParams;switch(z){case 0:B=void 0;break;case 1:B=qi(k.parameterStructures,M[0]);break;default:B=[];for(let je=0;je<M.length&&je<z;je++)B.push(mr(M[je]));if(M.length<z)for(let je=M.length;je<z;je++)B.push(null);break}return B}let jr={sendNotification:(k,...M)=>{ns();let B,z;if(at.string(k)){B=k;let De=M[0],Qe=0,it=ee.ParameterStructures.auto;ee.ParameterStructures.is(De)&&(Qe=1,it=De);let pe=M.length,Ve=pe-Qe;switch(Ve){case 0:z=void 0;break;case 1:z=qi(it,M[Qe]);break;default:if(it===ee.ParameterStructures.byName)throw new Error(`Received ${Ve} parameters for 'by Name' notification parameter structure.`);z=M.slice(Qe,pe).map(Ee=>mr(Ee));break}}else{let De=M;B=k.method,z=pa(k,De)}let je={jsonrpc:c,method:B,params:z};return kl(je),e.write(je).catch(De=>{throw s.error("Sending notification failed."),De})},onNotification:(k,M)=>{ns();let B;return at.func(k)?d=k:M&&(at.string(k)?(B=k,f.set(k,{type:void 0,handler:M})):(B=k.method,f.set(k.method,{type:k,handler:M}))),{dispose:()=>{B!==void 0?f.delete(B):d=void 0}}},onProgress:(k,M,B)=>{if(p.has(M))throw new Error(`Progress handler for token ${M} already registered`);return p.set(M,B),{dispose:()=>{p.delete(M)}}},sendProgress:(k,M,B)=>jr.sendNotification(va.type,{token:M,value:B}),onUnhandledProgress:qe.event,sendRequest:(k,...M)=>{ns(),Cl();let B,z,je;if(at.string(k)){B=k;let pe=M[0],Ve=M[M.length-1],Ee=0,lt=ee.ParameterStructures.auto;ee.ParameterStructures.is(pe)&&(Ee=1,lt=pe);let Dt=M.length;kp.CancellationToken.is(Ve)&&(Dt=Dt-1,je=Ve);let Sn=Dt-Ee;switch(Sn){case 0:z=void 0;break;case 1:z=qi(lt,M[Ee]);break;default:if(lt===ee.ParameterStructures.byName)throw new Error(`Received ${Sn} parameters for 'by Name' request parameter structure.`);z=M.slice(Ee,Dt).map(Dl=>mr(Dl));break}}else{let pe=M;B=k.method,z=pa(k,pe);let Ve=k.numberOfParams;je=kp.CancellationToken.is(pe[Ve])?pe[Ve]:void 0}let De=i++,Qe;je&&(Qe=je.onCancellationRequested(()=>{let pe=he.sender.sendCancellation(jr,De);return pe===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${De}`),Promise.resolve()):pe.catch(()=>{s.log(`Sending cancellation messages for id ${De} failed`)})}));let it={jsonrpc:c,id:De,method:B,params:z};return El(it),typeof he.sender.enableCancellation=="function"&&he.sender.enableCancellation(it),new Promise(async(pe,Ve)=>{let Ee=Sn=>{pe(Sn),he.sender.cleanup(De),Qe?.dispose()},lt=Sn=>{Ve(Sn),he.sender.cleanup(De),Qe?.dispose()},Dt={method:B,timerStart:Date.now(),resolve:Ee,reject:lt};try{await e.write(it),S.set(De,Dt)}catch(Sn){throw s.error("Sending request failed."),Dt.reject(new ee.ResponseError(ee.ErrorCodes.MessageWriteError,Sn.message?Sn.message:"Unknown reason")),Sn}})},onRequest:(k,M)=>{ns();let B=null;return Rp.is(k)?(B=void 0,l=k):at.string(k)?(B=null,M!==void 0&&(B=k,u.set(k,{handler:M,type:void 0}))):M!==void 0&&(B=k.method,u.set(k.method,{type:k,handler:M})),{dispose:()=>{B!==null&&(B!==void 0?u.delete(B):l=void 0)}}},hasPendingResponse:()=>S.size>0,trace:async(k,M,B)=>{let z=!1,je=_n.Text;B!==void 0&&(at.boolean(B)?z=B:(z=B.sendNotification||!1,je=B.traceFormat||_n.Text)),v=k,R=je,v===Pe.Off?A=void 0:A=M,z&&!Ks()&&!Lr()&&await jr.sendNotification(Cp.type,{value:Pe.toString(k)})},onError:W.event,onClose:j.event,onUnhandledNotification:ie.event,onDispose:wt.event,end:()=>{e.end()},dispose:()=>{if(Lr())return;$=Qn.Disposed,wt.fire(void 0);let k=new ee.ResponseError(ee.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let M of S.values())M.reject(k);S=new Map,T=new Map,E=new Set,g=new IT.LinkedMap,at.func(e.dispose)&&e.dispose(),at.func(n.dispose)&&n.dispose()},listen:()=>{ns(),Rl(),$=Qn.Listening,n.listen(Tl)},inspect:()=>{(0,AT.default)().console.log("inspect")}};return jr.onNotification(Vl.type,k=>{if(v===Pe.Off||!A)return;let M=v===Pe.Verbose||v===Pe.Compact;A.log(k.message,M?k.verbose:void 0)}),jr.onNotification(va.type,k=>{let M=p.get(k.token);M?M(k.value):qe.fire(k)}),jr}ae.createMessageConnection=mI});var Yl=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 Ye=rp();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return Ye.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return Ye.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return Ye.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return Ye.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return Ye.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return Ye.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return Ye.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return Ye.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return Ye.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return Ye.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return Ye.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return Ye.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return Ye.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return Ye.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return Ye.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return Ye.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return Ye.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return Ye.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return Ye.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return Ye.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return Ye.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return Ye.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return Ye.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return Ye.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return Ye.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return Ye.ParameterStructures}});var Ap=ip();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return Ap.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return Ap.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return Ap.Touch}});var gI=ST();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return gI.Disposable}});var LT=Ui();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return LT.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return LT.Emitter}});var qT=ql();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return qT.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return qT.CancellationToken}});var jT=wT();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return jT.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return jT.SharedArrayReceiverStrategy}});var Ip=kT();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return Ip.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return Ip.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Ip.ReadableStreamMessageReader}});var Mp=DT();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return Mp.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return Mp.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Mp.WriteableStreamMessageWriter}});var yI=OT();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return yI.AbstractMessageBuffer}});var $t=$T();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return $t.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return $t.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return $t.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return $t.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return $t.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return $t.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return $t.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return $t.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return $t.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return $t.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return $t.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return $t.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return $t.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return $t.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return $t.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return $t.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return $t.MessageStrategy}});var vI=ss();I.RAL=vI.default});var UT=w(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});var FT=require("util"),Br=Yl(),Jl=class n extends Br.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return n.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new FT.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};Jl.emptyBuffer=Buffer.allocUnsafe(0);var xp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Br.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Br.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Br.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Br.Disposable.create(()=>this.stream.off("data",e))}},$p=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Br.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Br.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Br.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((r,s)=>{let i=o=>{o==null?r():s(o)};typeof e=="string"?this.stream.write(e,t,i):this.stream.write(e,i)})}end(){this.stream.end()}},BT=Object.freeze({messageBuffer:Object.freeze({create:n=>new Jl(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new FT.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new xp(n),asWritableStream:n=>new $p(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let r=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(r)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let r=setInterval(n,e,...t);return{dispose:()=>clearInterval(r)}}})});function Lp(){return BT}(function(n){function e(){Br.RAL.install(BT)}n.install=e})(Lp||(Lp={}));qp.default=Lp});var Qs=w(ve=>{"use strict";var bI=ve&&ve.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),TI=ve&&ve.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bI(e,n,t)};Object.defineProperty(ve,"__esModule",{value:!0});ve.createMessageConnection=ve.createServerSocketTransport=ve.createClientSocketTransport=ve.createServerPipeTransport=ve.createClientPipeTransport=ve.generateRandomPipeName=ve.StreamMessageWriter=ve.StreamMessageReader=ve.SocketMessageWriter=ve.SocketMessageReader=ve.PortMessageWriter=ve.PortMessageReader=ve.IPCMessageWriter=ve.IPCMessageReader=void 0;var zi=UT();zi.default.install();var VT=require("path"),SI=require("os"),_I=require("crypto"),Zl=require("net"),wn=Yl();TI(Yl(),ve);var jp=class extends wn.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",r=>this.fireError(r)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),wn.Disposable.create(()=>this.process.off("message",e))}};ve.IPCMessageReader=jp;var Fp=class extends wn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",r=>this.fireError(r)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ve.IPCMessageWriter=Fp;var Bp=class extends wn.AbstractMessageReader{constructor(e){super(),this.onData=new wn.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};ve.PortMessageReader=Bp;var Up=class extends wn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ve.PortMessageWriter=Up;var Js=class extends wn.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,zi.default)().stream.asReadableStream(e),t)}};ve.SocketMessageReader=Js;var Xs=class extends wn.WriteableStreamMessageWriter{constructor(e,t){super((0,zi.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ve.SocketMessageWriter=Xs;var Xl=class extends wn.ReadableStreamMessageReader{constructor(e,t){super((0,zi.default)().stream.asReadableStream(e),t)}};ve.StreamMessageReader=Xl;var Ql=class extends wn.WriteableStreamMessageWriter{constructor(e,t){super((0,zi.default)().stream.asWritableStream(e),t)}};ve.StreamMessageWriter=Ql;var WT=process.env.XDG_RUNTIME_DIR,wI=new Map([["linux",107],["darwin",103]]);function EI(){let n=(0,_I.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;WT?e=VT.join(WT,`vscode-ipc-${n}.sock`):e=VT.join(SI.tmpdir(),`vscode-${n}.sock`);let t=wI.get(process.platform);return t!==void 0&&e.length>t&&(0,zi.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}ve.generateRandomPipeName=EI;function kI(n,e="utf-8"){let t,r=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Zl.createServer)(a=>{o.close(),t([new Js(a,e),new Xs(a,e)])});o.on("error",i),o.listen(n,()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}ve.createClientPipeTransport=kI;function NI(n,e="utf-8"){let t=(0,Zl.createConnection)(n);return[new Js(t,e),new Xs(t,e)]}ve.createServerPipeTransport=NI;function PI(n,e="utf-8"){let t,r=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Zl.createServer)(a=>{o.close(),t([new Js(a,e),new Xs(a,e)])});o.on("error",i),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}ve.createClientSocketTransport=PI;function RI(n,e="utf-8"){let t=(0,Zl.createConnection)(n,"127.0.0.1");return[new Js(t,e),new Xs(t,e)]}ve.createServerSocketTransport=RI;function CI(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function DI(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function OI(n,e,t,r){t||(t=wn.NullLogger);let s=CI(n)?new Xl(n):n,i=DI(e)?new Ql(e):e;return wn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,wn.createMessageConnection)(s,i,t,r)}ve.createMessageConnection=OI});var Vp=w((ez,HT)=>{"use strict";HT.exports=Qs()});var tu=w((KT,eu)=>{(function(n){if(typeof eu=="object"&&typeof eu.exports=="object"){var e=n(require,KT);e!==void 0&&(eu.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],n)})(function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(m){function N(P){return typeof P=="string"}m.is=N})(t||(e.DocumentUri=t={}));var r;(function(m){function N(P){return typeof P=="string"}m.is=N})(r||(e.URI=r={}));var s;(function(m){m.MIN_VALUE=-2147483648,m.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&m.MIN_VALUE<=P&&P<=m.MAX_VALUE}m.is=N})(s||(e.integer=s={}));var i;(function(m){m.MIN_VALUE=0,m.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&m.MIN_VALUE<=P&&P<=m.MAX_VALUE}m.is=N})(i||(e.uinteger=i={}));var o;(function(m){function N(y,h){return y===Number.MAX_VALUE&&(y=i.MAX_VALUE),h===Number.MAX_VALUE&&(h=i.MAX_VALUE),{line:y,character:h}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.uinteger(h.line)&&O.uinteger(h.character)}m.is=P})(o||(e.Position=o={}));var a;(function(m){function N(y,h,D,x){if(O.uinteger(y)&&O.uinteger(h)&&O.uinteger(D)&&O.uinteger(x))return{start:o.create(y,h),end:o.create(D,x)};if(o.is(y)&&o.is(h))return{start:y,end:h};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(h,", ").concat(D,", ").concat(x,"]"))}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&o.is(h.start)&&o.is(h.end)}m.is=P})(a||(e.Range=a={}));var c;(function(m){function N(y,h){return{uri:y,range:h}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.range)&&(O.string(h.uri)||O.undefined(h.uri))}m.is=P})(c||(e.Location=c={}));var l;(function(m){function N(y,h,D,x){return{targetUri:y,targetRange:h,targetSelectionRange:D,originSelectionRange:x}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.targetRange)&&O.string(h.targetUri)&&a.is(h.targetSelectionRange)&&(a.is(h.originSelectionRange)||O.undefined(h.originSelectionRange))}m.is=P})(l||(e.LocationLink=l={}));var u;(function(m){function N(y,h,D,x){return{red:y,green:h,blue:D,alpha:x}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.numberRange(h.red,0,1)&&O.numberRange(h.green,0,1)&&O.numberRange(h.blue,0,1)&&O.numberRange(h.alpha,0,1)}m.is=P})(u||(e.Color=u={}));var d;(function(m){function N(y,h){return{range:y,color:h}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.range)&&u.is(h.color)}m.is=P})(d||(e.ColorInformation=d={}));var f;(function(m){function N(y,h,D){return{label:y,textEdit:h,additionalTextEdits:D}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.string(h.label)&&(O.undefined(h.textEdit)||A.is(h))&&(O.undefined(h.additionalTextEdits)||O.typedArray(h.additionalTextEdits,A.is))}m.is=P})(f||(e.ColorPresentation=f={}));var p;(function(m){m.Comment="comment",m.Imports="imports",m.Region="region"})(p||(e.FoldingRangeKind=p={}));var b;(function(m){function N(y,h,D,x,oe,ut){var Ge={startLine:y,endLine:h};return O.defined(D)&&(Ge.startCharacter=D),O.defined(x)&&(Ge.endCharacter=x),O.defined(oe)&&(Ge.kind=oe),O.defined(ut)&&(Ge.collapsedText=ut),Ge}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.uinteger(h.startLine)&&O.uinteger(h.startLine)&&(O.undefined(h.startCharacter)||O.uinteger(h.startCharacter))&&(O.undefined(h.endCharacter)||O.uinteger(h.endCharacter))&&(O.undefined(h.kind)||O.string(h.kind))}m.is=P})(b||(e.FoldingRange=b={}));var g;(function(m){function N(y,h){return{location:y,message:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&c.is(h.location)&&O.string(h.message)}m.is=P})(g||(e.DiagnosticRelatedInformation=g={}));var S;(function(m){m.Error=1,m.Warning=2,m.Information=3,m.Hint=4})(S||(e.DiagnosticSeverity=S={}));var E;(function(m){m.Unnecessary=1,m.Deprecated=2})(E||(e.DiagnosticTag=E={}));var T;(function(m){function N(P){var y=P;return O.objectLiteral(y)&&O.string(y.href)}m.is=N})(T||(e.CodeDescription=T={}));var v;(function(m){function N(y,h,D,x,oe,ut){var Ge={range:y,message:h};return O.defined(D)&&(Ge.severity=D),O.defined(x)&&(Ge.code=x),O.defined(oe)&&(Ge.source=oe),O.defined(ut)&&(Ge.relatedInformation=ut),Ge}m.create=N;function P(y){var h,D=y;return O.defined(D)&&a.is(D.range)&&O.string(D.message)&&(O.number(D.severity)||O.undefined(D.severity))&&(O.integer(D.code)||O.string(D.code)||O.undefined(D.code))&&(O.undefined(D.codeDescription)||O.string((h=D.codeDescription)===null||h===void 0?void 0:h.href))&&(O.string(D.source)||O.undefined(D.source))&&(O.undefined(D.relatedInformation)||O.typedArray(D.relatedInformation,g.is))}m.is=P})(v||(e.Diagnostic=v={}));var R;(function(m){function N(y,h){for(var D=[],x=2;x<arguments.length;x++)D[x-2]=arguments[x];var oe={title:y,command:h};return O.defined(D)&&D.length>0&&(oe.arguments=D),oe}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.title)&&O.string(h.command)}m.is=P})(R||(e.Command=R={}));var A;(function(m){function N(D,x){return{range:D,newText:x}}m.replace=N;function P(D,x){return{range:{start:D,end:D},newText:x}}m.insert=P;function y(D){return{range:D,newText:""}}m.del=y;function h(D){var x=D;return O.objectLiteral(x)&&O.string(x.newText)&&a.is(x.range)}m.is=h})(A||(e.TextEdit=A={}));var $;(function(m){function N(y,h,D){var x={label:y};return h!==void 0&&(x.needsConfirmation=h),D!==void 0&&(x.description=D),x}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.string(h.label)&&(O.boolean(h.needsConfirmation)||h.needsConfirmation===void 0)&&(O.string(h.description)||h.description===void 0)}m.is=P})($||(e.ChangeAnnotation=$={}));var W;(function(m){function N(P){var y=P;return O.string(y)}m.is=N})(W||(e.ChangeAnnotationIdentifier=W={}));var j;(function(m){function N(D,x,oe){return{range:D,newText:x,annotationId:oe}}m.replace=N;function P(D,x,oe){return{range:{start:D,end:D},newText:x,annotationId:oe}}m.insert=P;function y(D,x){return{range:D,newText:"",annotationId:x}}m.del=y;function h(D){var x=D;return A.is(x)&&($.is(x.annotationId)||W.is(x.annotationId))}m.is=h})(j||(e.AnnotatedTextEdit=j={}));var ie;(function(m){function N(y,h){return{textDocument:y,edits:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&Ks.is(h.textDocument)&&Array.isArray(h.edits)}m.is=P})(ie||(e.TextDocumentEdit=ie={}));var qe;(function(m){function N(y,h,D){var x={kind:"create",uri:y};return h!==void 0&&(h.overwrite!==void 0||h.ignoreIfExists!==void 0)&&(x.options=h),D!==void 0&&(x.annotationId=D),x}m.create=N;function P(y){var h=y;return h&&h.kind==="create"&&O.string(h.uri)&&(h.options===void 0||(h.options.overwrite===void 0||O.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||O.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}m.is=P})(qe||(e.CreateFile=qe={}));var wt;(function(m){function N(y,h,D,x){var oe={kind:"rename",oldUri:y,newUri:h};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(oe.options=D),x!==void 0&&(oe.annotationId=x),oe}m.create=N;function P(y){var h=y;return h&&h.kind==="rename"&&O.string(h.oldUri)&&O.string(h.newUri)&&(h.options===void 0||(h.options.overwrite===void 0||O.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||O.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}m.is=P})(wt||(e.RenameFile=wt={}));var he;(function(m){function N(y,h,D){var x={kind:"delete",uri:y};return h!==void 0&&(h.recursive!==void 0||h.ignoreIfNotExists!==void 0)&&(x.options=h),D!==void 0&&(x.annotationId=D),x}m.create=N;function P(y){var h=y;return h&&h.kind==="delete"&&O.string(h.uri)&&(h.options===void 0||(h.options.recursive===void 0||O.boolean(h.options.recursive))&&(h.options.ignoreIfNotExists===void 0||O.boolean(h.options.ignoreIfNotExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}m.is=P})(he||(e.DeleteFile=he={}));var Cn;(function(m){function N(P){var y=P;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(h){return O.string(h.kind)?qe.is(h)||wt.is(h)||he.is(h):ie.is(h)}))}m.is=N})(Cn||(e.WorkspaceEdit=Cn={}));var ts=function(){function m(N,P){this.edits=N,this.changeAnnotations=P}return m.prototype.insert=function(N,P,y){var h,D;if(y===void 0?h=A.insert(N,P):W.is(y)?(D=y,h=j.insert(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),h=j.insert(N,P,D)),this.edits.push(h),D!==void 0)return D},m.prototype.replace=function(N,P,y){var h,D;if(y===void 0?h=A.replace(N,P):W.is(y)?(D=y,h=j.replace(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),h=j.replace(N,P,D)),this.edits.push(h),D!==void 0)return D},m.prototype.delete=function(N,P){var y,h;if(P===void 0?y=A.del(N):W.is(P)?(h=P,y=j.del(N,P)):(this.assertChangeAnnotations(this.changeAnnotations),h=this.changeAnnotations.manage(P),y=j.del(N,h)),this.edits.push(y),h!==void 0)return h},m.prototype.add=function(N){this.edits.push(N)},m.prototype.all=function(){return this.edits},m.prototype.clear=function(){this.edits.splice(0,this.edits.length)},m.prototype.assertChangeAnnotations=function(N){if(N===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},m}(),gl=function(){function m(N){this._annotations=N===void 0?Object.create(null):N,this._counter=0,this._size=0}return m.prototype.all=function(){return this._annotations},Object.defineProperty(m.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),m.prototype.manage=function(N,P){var y;if(W.is(N)?y=N:(y=this.nextId(),P=N),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(P===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=P,this._size++,y},m.prototype.nextId=function(){return this._counter++,this._counter.toString()},m}(),Oh=function(){function m(N){var P=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new gl(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function(y){if(ie.is(y)){var h=new ts(y.edits,P._changeAnnotations);P._textEditChanges[y.textDocument.uri]=h}})):N.changes&&Object.keys(N.changes).forEach(function(y){var h=new ts(N.changes[y]);P._textEditChanges[y]=h})):this._workspaceEdit={}}return Object.defineProperty(m.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}),m.prototype.getTextEditChange=function(N){if(Ks.is(N)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P={uri:N.uri,version:N.version},y=this._textEditChanges[P.uri];if(!y){var h=[],D={textDocument:P,edits:h};this._workspaceEdit.documentChanges.push(D),y=new ts(h,this._changeAnnotations),this._textEditChanges[P.uri]=y}return y}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var y=this._textEditChanges[N];if(!y){var h=[];this._workspaceEdit.changes[N]=h,y=new ts(h),this._textEditChanges[N]=y}return y}},m.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new gl,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},m.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},m.prototype.createFile=function(N,P,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;$.is(P)||W.is(P)?h=P:y=P;var D,x;if(h===void 0?D=qe.create(N,y):(x=W.is(h)?h:this._changeAnnotations.manage(h),D=qe.create(N,y,x)),this._workspaceEdit.documentChanges.push(D),x!==void 0)return x},m.prototype.renameFile=function(N,P,y,h){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;$.is(y)||W.is(y)?D=y:h=y;var x,oe;if(D===void 0?x=wt.create(N,P,h):(oe=W.is(D)?D:this._changeAnnotations.manage(D),x=wt.create(N,P,h,oe)),this._workspaceEdit.documentChanges.push(x),oe!==void 0)return oe},m.prototype.deleteFile=function(N,P,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;$.is(P)||W.is(P)?h=P:y=P;var D,x;if(h===void 0?D=he.create(N,y):(x=W.is(h)?h:this._changeAnnotations.manage(h),D=he.create(N,y,x)),this._workspaceEdit.documentChanges.push(D),x!==void 0)return x},m}();e.WorkspaceChange=Oh;var yl;(function(m){function N(y){return{uri:y}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)}m.is=P})(yl||(e.TextDocumentIdentifier=yl={}));var la;(function(m){function N(y,h){return{uri:y,version:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&O.integer(h.version)}m.is=P})(la||(e.VersionedTextDocumentIdentifier=la={}));var Ks;(function(m){function N(y,h){return{uri:y,version:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&(h.version===null||O.integer(h.version))}m.is=P})(Ks||(e.OptionalVersionedTextDocumentIdentifier=Ks={}));var Lr;(function(m){function N(y,h,D,x){return{uri:y,languageId:h,version:D,text:x}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&O.string(h.languageId)&&O.integer(h.version)&&O.string(h.text)}m.is=P})(Lr||(e.TextDocumentItem=Lr={}));var xi;(function(m){m.PlainText="plaintext",m.Markdown="markdown";function N(P){var y=P;return y===m.PlainText||y===m.Markdown}m.is=N})(xi||(e.MarkupKind=xi={}));var zs;(function(m){function N(P){var y=P;return O.objectLiteral(P)&&xi.is(y.kind)&&O.string(y.value)}m.is=N})(zs||(e.MarkupContent=zs={}));var vl;(function(m){m.Text=1,m.Method=2,m.Function=3,m.Constructor=4,m.Field=5,m.Variable=6,m.Class=7,m.Interface=8,m.Module=9,m.Property=10,m.Unit=11,m.Value=12,m.Enum=13,m.Keyword=14,m.Snippet=15,m.Color=16,m.File=17,m.Reference=18,m.Folder=19,m.EnumMember=20,m.Constant=21,m.Struct=22,m.Event=23,m.Operator=24,m.TypeParameter=25})(vl||(e.CompletionItemKind=vl={}));var ua;(function(m){m.PlainText=1,m.Snippet=2})(ua||(e.InsertTextFormat=ua={}));var da;(function(m){m.Deprecated=1})(da||(e.CompletionItemTag=da={}));var bl;(function(m){function N(y,h,D){return{newText:y,insert:h,replace:D}}m.create=N;function P(y){var h=y;return h&&O.string(h.newText)&&a.is(h.insert)&&a.is(h.replace)}m.is=P})(bl||(e.InsertReplaceEdit=bl={}));var Tl;(function(m){m.asIs=1,m.adjustIndentation=2})(Tl||(e.InsertTextMode=Tl={}));var Sl;(function(m){function N(P){var y=P;return y&&(O.string(y.detail)||y.detail===void 0)&&(O.string(y.description)||y.description===void 0)}m.is=N})(Sl||(e.CompletionItemLabelDetails=Sl={}));var _l;(function(m){function N(P){return{label:P}}m.create=N})(_l||(e.CompletionItem=_l={}));var wl;(function(m){function N(P,y){return{items:P||[],isIncomplete:!!y}}m.create=N})(wl||(e.CompletionList=wl={}));var $i;(function(m){function N(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}m.fromPlainText=N;function P(y){var h=y;return O.string(h)||O.objectLiteral(h)&&O.string(h.language)&&O.string(h.value)}m.is=P})($i||(e.MarkedString=$i={}));var Yn;(function(m){function N(P){var y=P;return!!y&&O.objectLiteral(y)&&(zs.is(y.contents)||$i.is(y.contents)||O.typedArray(y.contents,$i.is))&&(P.range===void 0||a.is(P.range))}m.is=N})(Yn||(e.Hover=Yn={}));var El;(function(m){function N(P,y){return y?{label:P,documentation:y}:{label:P}}m.create=N})(El||(e.ParameterInformation=El={}));var kl;(function(m){function N(P,y){for(var h=[],D=2;D<arguments.length;D++)h[D-2]=arguments[D];var x={label:P};return O.defined(y)&&(x.documentation=y),O.defined(h)?x.parameters=h:x.parameters=[],x}m.create=N})(kl||(e.SignatureInformation=kl={}));var Gs;(function(m){m.Text=1,m.Read=2,m.Write=3})(Gs||(e.DocumentHighlightKind=Gs={}));var Nl;(function(m){function N(P,y){var h={range:P};return O.number(y)&&(h.kind=y),h}m.create=N})(Nl||(e.DocumentHighlight=Nl={}));var Li;(function(m){m.File=1,m.Module=2,m.Namespace=3,m.Package=4,m.Class=5,m.Method=6,m.Property=7,m.Field=8,m.Constructor=9,m.Enum=10,m.Interface=11,m.Function=12,m.Variable=13,m.Constant=14,m.String=15,m.Number=16,m.Boolean=17,m.Array=18,m.Object=19,m.Key=20,m.Null=21,m.EnumMember=22,m.Struct=23,m.Event=24,m.Operator=25,m.TypeParameter=26})(Li||(e.SymbolKind=Li={}));var Pl;(function(m){m.Deprecated=1})(Pl||(e.SymbolTag=Pl={}));var qr;(function(m){function N(P,y,h,D,x){var oe={name:P,kind:y,location:{uri:D,range:h}};return x&&(oe.containerName=x),oe}m.create=N})(qr||(e.SymbolInformation=qr={}));var ns;(function(m){function N(P,y,h,D){return D!==void 0?{name:P,kind:y,location:{uri:h,range:D}}:{name:P,kind:y,location:{uri:h}}}m.create=N})(ns||(e.WorkspaceSymbol=ns={}));var Rl;(function(m){function N(y,h,D,x,oe,ut){var Ge={name:y,detail:h,kind:D,range:x,selectionRange:oe};return ut!==void 0&&(Ge.children=ut),Ge}m.create=N;function P(y){var h=y;return h&&O.string(h.name)&&O.number(h.kind)&&a.is(h.range)&&a.is(h.selectionRange)&&(h.detail===void 0||O.string(h.detail))&&(h.deprecated===void 0||O.boolean(h.deprecated))&&(h.children===void 0||Array.isArray(h.children))&&(h.tags===void 0||Array.isArray(h.tags))}m.is=P})(Rl||(e.DocumentSymbol=Rl={}));var Cl;(function(m){m.Empty="",m.QuickFix="quickfix",m.Refactor="refactor",m.RefactorExtract="refactor.extract",m.RefactorInline="refactor.inline",m.RefactorRewrite="refactor.rewrite",m.Source="source",m.SourceOrganizeImports="source.organizeImports",m.SourceFixAll="source.fixAll"})(Cl||(e.CodeActionKind=Cl={}));var mr;(function(m){m.Invoked=1,m.Automatic=2})(mr||(e.CodeActionTriggerKind=mr={}));var fa;(function(m){function N(y,h,D){var x={diagnostics:y};return h!=null&&(x.only=h),D!=null&&(x.triggerKind=D),x}m.create=N;function P(y){var h=y;return O.defined(h)&&O.typedArray(h.diagnostics,v.is)&&(h.only===void 0||O.typedArray(h.only,O.string))&&(h.triggerKind===void 0||h.triggerKind===mr.Invoked||h.triggerKind===mr.Automatic)}m.is=P})(fa||(e.CodeActionContext=fa={}));var ha;(function(m){function N(y,h,D){var x={title:y},oe=!0;return typeof h=="string"?(oe=!1,x.kind=h):R.is(h)?x.command=h:x.edit=h,oe&&D!==void 0&&(x.kind=D),x}m.create=N;function P(y){var h=y;return h&&O.string(h.title)&&(h.diagnostics===void 0||O.typedArray(h.diagnostics,v.is))&&(h.kind===void 0||O.string(h.kind))&&(h.edit!==void 0||h.command!==void 0)&&(h.command===void 0||R.is(h.command))&&(h.isPreferred===void 0||O.boolean(h.isPreferred))&&(h.edit===void 0||Cn.is(h.edit))}m.is=P})(ha||(e.CodeAction=ha={}));var qi;(function(m){function N(y,h){var D={range:y};return O.defined(h)&&(D.data=h),D}m.create=N;function P(y){var h=y;return O.defined(h)&&a.is(h.range)&&(O.undefined(h.command)||R.is(h.command))}m.is=P})(qi||(e.CodeLens=qi={}));var pa;(function(m){function N(y,h){return{tabSize:y,insertSpaces:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&O.uinteger(h.tabSize)&&O.boolean(h.insertSpaces)}m.is=P})(pa||(e.FormattingOptions=pa={}));var jr;(function(m){function N(y,h,D){return{range:y,target:h,data:D}}m.create=N;function P(y){var h=y;return O.defined(h)&&a.is(h.range)&&(O.undefined(h.target)||O.string(h.target))}m.is=P})(jr||(e.DocumentLink=jr={}));var k;(function(m){function N(y,h){return{range:y,parent:h}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.range)&&(h.parent===void 0||m.is(h.parent))}m.is=P})(k||(e.SelectionRange=k={}));var M;(function(m){m.namespace="namespace",m.type="type",m.class="class",m.enum="enum",m.interface="interface",m.struct="struct",m.typeParameter="typeParameter",m.parameter="parameter",m.variable="variable",m.property="property",m.enumMember="enumMember",m.event="event",m.function="function",m.method="method",m.macro="macro",m.keyword="keyword",m.modifier="modifier",m.comment="comment",m.string="string",m.number="number",m.regexp="regexp",m.operator="operator",m.decorator="decorator"})(M||(e.SemanticTokenTypes=M={}));var B;(function(m){m.declaration="declaration",m.definition="definition",m.readonly="readonly",m.static="static",m.deprecated="deprecated",m.abstract="abstract",m.async="async",m.modification="modification",m.documentation="documentation",m.defaultLibrary="defaultLibrary"})(B||(e.SemanticTokenModifiers=B={}));var z;(function(m){function N(P){var y=P;return O.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}m.is=N})(z||(e.SemanticTokens=z={}));var je;(function(m){function N(y,h){return{range:y,text:h}}m.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&O.string(h.text)}m.is=P})(je||(e.InlineValueText=je={}));var De;(function(m){function N(y,h,D){return{range:y,variableName:h,caseSensitiveLookup:D}}m.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&O.boolean(h.caseSensitiveLookup)&&(O.string(h.variableName)||h.variableName===void 0)}m.is=P})(De||(e.InlineValueVariableLookup=De={}));var Qe;(function(m){function N(y,h){return{range:y,expression:h}}m.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&(O.string(h.expression)||h.expression===void 0)}m.is=P})(Qe||(e.InlineValueEvaluatableExpression=Qe={}));var it;(function(m){function N(y,h){return{frameId:y,stoppedLocation:h}}m.create=N;function P(y){var h=y;return O.defined(h)&&a.is(y.stoppedLocation)}m.is=P})(it||(e.InlineValueContext=it={}));var pe;(function(m){m.Type=1,m.Parameter=2;function N(P){return P===1||P===2}m.is=N})(pe||(e.InlayHintKind=pe={}));var Ve;(function(m){function N(y){return{value:y}}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&(h.tooltip===void 0||O.string(h.tooltip)||zs.is(h.tooltip))&&(h.location===void 0||c.is(h.location))&&(h.command===void 0||R.is(h.command))}m.is=P})(Ve||(e.InlayHintLabelPart=Ve={}));var Ee;(function(m){function N(y,h,D){var x={position:y,label:h};return D!==void 0&&(x.kind=D),x}m.create=N;function P(y){var h=y;return O.objectLiteral(h)&&o.is(h.position)&&(O.string(h.label)||O.typedArray(h.label,Ve.is))&&(h.kind===void 0||pe.is(h.kind))&&h.textEdits===void 0||O.typedArray(h.textEdits,A.is)&&(h.tooltip===void 0||O.string(h.tooltip)||zs.is(h.tooltip))&&(h.paddingLeft===void 0||O.boolean(h.paddingLeft))&&(h.paddingRight===void 0||O.boolean(h.paddingRight))}m.is=P})(Ee||(e.InlayHint=Ee={}));var lt;(function(m){function N(P){return{kind:"snippet",value:P}}m.createSnippet=N})(lt||(e.StringValue=lt={}));var Dt;(function(m){function N(P,y,h,D){return{insertText:P,filterText:y,range:h,command:D}}m.create=N})(Dt||(e.InlineCompletionItem=Dt={}));var Sn;(function(m){function N(P){return{items:P}}m.create=N})(Sn||(e.InlineCompletionList=Sn={}));var Dl;(function(m){m.Invoked=0,m.Automatic=1})(Dl||(e.InlineCompletionTriggerKind=Dl={}));var cT;(function(m){function N(P,y){return{range:P,text:y}}m.create=N})(cT||(e.SelectedCompletionInfo=cT={}));var lT;(function(m){function N(P,y){return{triggerKind:P,selectedCompletionInfo:y}}m.create=N})(lT||(e.InlineCompletionContext=lT={}));var uT;(function(m){function N(P){var y=P;return O.objectLiteral(y)&&r.is(y.uri)&&O.string(y.name)}m.is=N})(uT||(e.WorkspaceFolder=uT={})),e.EOL=[`
|
|
33
33
|
`,`\r
|
|
34
|
-
`,"\r"];var
|
|
34
|
+
`,"\r"];var dT;(function(m){function N(D,x,oe,ut){return new qA(D,x,oe,ut)}m.create=N;function P(D){var x=D;return!!(O.defined(x)&&O.string(x.uri)&&(O.undefined(x.languageId)||O.string(x.languageId))&&O.uinteger(x.lineCount)&&O.func(x.getText)&&O.func(x.positionAt)&&O.func(x.offsetAt))}m.is=P;function y(D,x){for(var oe=D.getText(),ut=h(x,function(ji,Ol){var fT=ji.range.start.line-Ol.range.start.line;return fT===0?ji.range.start.character-Ol.range.start.character:fT}),Ge=oe.length,Jn=ut.length-1;Jn>=0;Jn--){var Xn=ut[Jn],Fr=D.offsetAt(Xn.range.start),ye=D.offsetAt(Xn.range.end);if(ye<=Ge)oe=oe.substring(0,Fr)+Xn.newText+oe.substring(ye,oe.length);else throw new Error("Overlapping edit");Ge=Fr}return oe}m.applyEdits=y;function h(D,x){if(D.length<=1)return D;var oe=D.length/2|0,ut=D.slice(0,oe),Ge=D.slice(oe);h(ut,x),h(Ge,x);for(var Jn=0,Xn=0,Fr=0;Jn<ut.length&&Xn<Ge.length;){var ye=x(ut[Jn],Ge[Xn]);ye<=0?D[Fr++]=ut[Jn++]:D[Fr++]=Ge[Xn++]}for(;Jn<ut.length;)D[Fr++]=ut[Jn++];for(;Xn<Ge.length;)D[Fr++]=Ge[Xn++];return D}})(dT||(e.TextDocument=dT={}));var qA=function(){function m(N,P,y,h){this._uri=N,this._languageId=P,this._version=y,this._content=h,this._lineOffsets=void 0}return Object.defineProperty(m.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),m.prototype.getText=function(N){if(N){var P=this.offsetAt(N.start),y=this.offsetAt(N.end);return this._content.substring(P,y)}return this._content},m.prototype.update=function(N,P){this._content=N.text,this._version=P,this._lineOffsets=void 0},m.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var N=[],P=this._content,y=!0,h=0;h<P.length;h++){y&&(N.push(h),y=!1);var D=P.charAt(h);y=D==="\r"||D===`
|
|
35
35
|
`,D==="\r"&&h+1<P.length&&P.charAt(h+1)===`
|
|
36
|
-
`&&h++}y&&P.length>0&&N.push(P.length),this._lineOffsets=N}return this._lineOffsets},m.prototype.positionAt=function(N){N=Math.max(Math.min(N,this._content.length),0);var P=this.getLineOffsets(),y=0,h=P.length;if(h===0)return o.create(0,N);for(;y<h;){var D=Math.floor((y+h)/2);P[D]>N?h=D:y=D+1}var x=y-1;return o.create(x,N-P[x])},m.prototype.offsetAt=function(N){var P=this.getLineOffsets();if(N.line>=P.length)return this._content.length;if(N.line<0)return 0;var y=P[N.line],h=N.line+1<P.length?P[N.line+1]:this._content.length;return Math.max(Math.min(y+N.character,h),y)},Object.defineProperty(m.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),m}(),O;(function(m){var N=Object.prototype.toString;function P(me){return typeof me<"u"}m.defined=P;function y(me){return typeof me>"u"}m.undefined=y;function h(me){return me===!0||me===!1}m.boolean=h;function D(me){return N.call(me)==="[object String]"}m.string=D;function x(me){return N.call(me)==="[object Number]"}m.number=x;function se(me,Di,vl){return N.call(me)==="[object Number]"&&Di<=me&&me<=vl}m.numberRange=se;function at(me){return N.call(me)==="[object Number]"&&-2147483648<=me&&me<=2147483647}m.integer=at;function He(me){return N.call(me)==="[object Number]"&&0<=me&&me<=2147483647}m.uinteger=He;function Ur(me){return N.call(me)==="[object Function]"}m.func=Ur;function Vr(me){return me!==null&&typeof me=="object"}m.objectLiteral=Vr;function In(me,Di){return Array.isArray(me)&&me.every(Di)}m.typedArray=In})(O||(O={}))})});var rt=k(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.ProtocolNotificationType=or.ProtocolNotificationType0=or.ProtocolRequestType=or.ProtocolRequestType0=or.RegistrationType=or.MessageDirection=void 0;var ji=Ws(),MT;(function(r){r.clientToServer="clientToServer",r.serverToClient="serverToClient",r.both="both"})(MT||(or.MessageDirection=MT={}));var Ap=class{constructor(e){this.method=e}};or.RegistrationType=Ap;var Ip=class extends ji.RequestType0{constructor(e){super(e)}};or.ProtocolRequestType0=Ip;var Mp=class extends ji.RequestType{constructor(e){super(e,ji.ParameterStructures.byName)}};or.ProtocolRequestType=Mp;var xp=class extends ji.NotificationType0{constructor(e){super(e)}};or.ProtocolNotificationType0=xp;var Lp=class extends ji.NotificationType{constructor(e){super(e,ji.ParameterStructures.byName)}};or.ProtocolNotificationType=Lp});var Vl=k(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.objectLiteral=gt.typedArray=gt.stringArray=gt.array=gt.func=gt.error=gt.number=gt.string=gt.boolean=void 0;function dI(r){return r===!0||r===!1}gt.boolean=dI;function xT(r){return typeof r=="string"||r instanceof String}gt.string=xT;function fI(r){return typeof r=="number"||r instanceof Number}gt.number=fI;function hI(r){return r instanceof Error}gt.error=hI;function pI(r){return typeof r=="function"}gt.func=pI;function LT(r){return Array.isArray(r)}gt.array=LT;function mI(r){return LT(r)&&r.every(e=>xT(e))}gt.stringArray=mI;function gI(r,e){return Array.isArray(r)&&r.every(e)}gt.typedArray=gI;function yI(r){return r!==null&&typeof r=="object"}gt.objectLiteral=yI});var jT=k(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.ImplementationRequest=void 0;var $T=rt(),qT;(function(r){r.method="textDocument/implementation",r.messageDirection=$T.MessageDirection.clientToServer,r.type=new $T.ProtocolRequestType(r.method)})(qT||(Wl.ImplementationRequest=qT={}))});var UT=k(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.TypeDefinitionRequest=void 0;var FT=rt(),BT;(function(r){r.method="textDocument/typeDefinition",r.messageDirection=FT.MessageDirection.clientToServer,r.type=new FT.ProtocolRequestType(r.method)})(BT||(Hl.TypeDefinitionRequest=BT={}))});var HT=k(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.DidChangeWorkspaceFoldersNotification=Fi.WorkspaceFoldersRequest=void 0;var Kl=rt(),VT;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=Kl.MessageDirection.serverToClient,r.type=new Kl.ProtocolRequestType0(r.method)})(VT||(Fi.WorkspaceFoldersRequest=VT={}));var WT;(function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=Kl.MessageDirection.clientToServer,r.type=new Kl.ProtocolNotificationType(r.method)})(WT||(Fi.DidChangeWorkspaceFoldersNotification=WT={}))});var GT=k(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.ConfigurationRequest=void 0;var KT=rt(),zT;(function(r){r.method="workspace/configuration",r.messageDirection=KT.MessageDirection.serverToClient,r.type=new KT.ProtocolRequestType(r.method)})(zT||(zl.ConfigurationRequest=zT={}))});var XT=k(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ColorPresentationRequest=Bi.DocumentColorRequest=void 0;var Gl=rt(),YT;(function(r){r.method="textDocument/documentColor",r.messageDirection=Gl.MessageDirection.clientToServer,r.type=new Gl.ProtocolRequestType(r.method)})(YT||(Bi.DocumentColorRequest=YT={}));var JT;(function(r){r.method="textDocument/colorPresentation",r.messageDirection=Gl.MessageDirection.clientToServer,r.type=new Gl.ProtocolRequestType(r.method)})(JT||(Bi.ColorPresentationRequest=JT={}))});var e_=k(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.FoldingRangeRefreshRequest=Ui.FoldingRangeRequest=void 0;var Yl=rt(),QT;(function(r){r.method="textDocument/foldingRange",r.messageDirection=Yl.MessageDirection.clientToServer,r.type=new Yl.ProtocolRequestType(r.method)})(QT||(Ui.FoldingRangeRequest=QT={}));var ZT;(function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=Yl.MessageDirection.serverToClient,r.type=new Yl.ProtocolRequestType0(r.method)})(ZT||(Ui.FoldingRangeRefreshRequest=ZT={}))});var n_=k(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.DeclarationRequest=void 0;var t_=rt(),r_;(function(r){r.method="textDocument/declaration",r.messageDirection=t_.MessageDirection.clientToServer,r.type=new t_.ProtocolRequestType(r.method)})(r_||(Jl.DeclarationRequest=r_={}))});var o_=k(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.SelectionRangeRequest=void 0;var s_=rt(),i_;(function(r){r.method="textDocument/selectionRange",r.messageDirection=s_.MessageDirection.clientToServer,r.type=new s_.ProtocolRequestType(r.method)})(i_||(Xl.SelectionRangeRequest=i_={}))});var u_=k(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.WorkDoneProgressCancelNotification=Zn.WorkDoneProgressCreateRequest=Zn.WorkDoneProgress=void 0;var vI=Ws(),Ql=rt(),a_;(function(r){r.type=new vI.ProgressType;function e(t){return t===r.type}r.is=e})(a_||(Zn.WorkDoneProgress=a_={}));var c_;(function(r){r.method="window/workDoneProgress/create",r.messageDirection=Ql.MessageDirection.serverToClient,r.type=new Ql.ProtocolRequestType(r.method)})(c_||(Zn.WorkDoneProgressCreateRequest=c_={}));var l_;(function(r){r.method="window/workDoneProgress/cancel",r.messageDirection=Ql.MessageDirection.clientToServer,r.type=new Ql.ProtocolNotificationType(r.method)})(l_||(Zn.WorkDoneProgressCancelNotification=l_={}))});var p_=k(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.CallHierarchyOutgoingCallsRequest=es.CallHierarchyIncomingCallsRequest=es.CallHierarchyPrepareRequest=void 0;var Vi=rt(),d_;(function(r){r.method="textDocument/prepareCallHierarchy",r.messageDirection=Vi.MessageDirection.clientToServer,r.type=new Vi.ProtocolRequestType(r.method)})(d_||(es.CallHierarchyPrepareRequest=d_={}));var f_;(function(r){r.method="callHierarchy/incomingCalls",r.messageDirection=Vi.MessageDirection.clientToServer,r.type=new Vi.ProtocolRequestType(r.method)})(f_||(es.CallHierarchyIncomingCallsRequest=f_={}));var h_;(function(r){r.method="callHierarchy/outgoingCalls",r.messageDirection=Vi.MessageDirection.clientToServer,r.type=new Vi.ProtocolRequestType(r.method)})(h_||(es.CallHierarchyOutgoingCallsRequest=h_={}))});var T_=k(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.SemanticTokensRefreshRequest=ar.SemanticTokensRangeRequest=ar.SemanticTokensDeltaRequest=ar.SemanticTokensRequest=ar.SemanticTokensRegistrationType=ar.TokenFormat=void 0;var xn=rt(),m_;(function(r){r.Relative="relative"})(m_||(ar.TokenFormat=m_={}));var fa;(function(r){r.method="textDocument/semanticTokens",r.type=new xn.RegistrationType(r.method)})(fa||(ar.SemanticTokensRegistrationType=fa={}));var g_;(function(r){r.method="textDocument/semanticTokens/full",r.messageDirection=xn.MessageDirection.clientToServer,r.type=new xn.ProtocolRequestType(r.method),r.registrationMethod=fa.method})(g_||(ar.SemanticTokensRequest=g_={}));var y_;(function(r){r.method="textDocument/semanticTokens/full/delta",r.messageDirection=xn.MessageDirection.clientToServer,r.type=new xn.ProtocolRequestType(r.method),r.registrationMethod=fa.method})(y_||(ar.SemanticTokensDeltaRequest=y_={}));var v_;(function(r){r.method="textDocument/semanticTokens/range",r.messageDirection=xn.MessageDirection.clientToServer,r.type=new xn.ProtocolRequestType(r.method),r.registrationMethod=fa.method})(v_||(ar.SemanticTokensRangeRequest=v_={}));var b_;(function(r){r.method="workspace/semanticTokens/refresh",r.messageDirection=xn.MessageDirection.serverToClient,r.type=new xn.ProtocolRequestType0(r.method)})(b_||(ar.SemanticTokensRefreshRequest=b_={}))});var k_=k(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.ShowDocumentRequest=void 0;var __=rt(),S_;(function(r){r.method="window/showDocument",r.messageDirection=__.MessageDirection.serverToClient,r.type=new __.ProtocolRequestType(r.method)})(S_||(Zl.ShowDocumentRequest=S_={}))});var N_=k(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.LinkedEditingRangeRequest=void 0;var w_=rt(),E_;(function(r){r.method="textDocument/linkedEditingRange",r.messageDirection=w_.MessageDirection.clientToServer,r.type=new w_.ProtocolRequestType(r.method)})(E_||(eu.LinkedEditingRangeRequest=E_={}))});var M_=k(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.WillDeleteFilesRequest=Wt.DidDeleteFilesNotification=Wt.DidRenameFilesNotification=Wt.WillRenameFilesRequest=Wt.DidCreateFilesNotification=Wt.WillCreateFilesRequest=Wt.FileOperationPatternKind=void 0;var wr=rt(),P_;(function(r){r.file="file",r.folder="folder"})(P_||(Wt.FileOperationPatternKind=P_={}));var R_;(function(r){r.method="workspace/willCreateFiles",r.messageDirection=wr.MessageDirection.clientToServer,r.type=new wr.ProtocolRequestType(r.method)})(R_||(Wt.WillCreateFilesRequest=R_={}));var C_;(function(r){r.method="workspace/didCreateFiles",r.messageDirection=wr.MessageDirection.clientToServer,r.type=new wr.ProtocolNotificationType(r.method)})(C_||(Wt.DidCreateFilesNotification=C_={}));var D_;(function(r){r.method="workspace/willRenameFiles",r.messageDirection=wr.MessageDirection.clientToServer,r.type=new wr.ProtocolRequestType(r.method)})(D_||(Wt.WillRenameFilesRequest=D_={}));var O_;(function(r){r.method="workspace/didRenameFiles",r.messageDirection=wr.MessageDirection.clientToServer,r.type=new wr.ProtocolNotificationType(r.method)})(O_||(Wt.DidRenameFilesNotification=O_={}));var A_;(function(r){r.method="workspace/didDeleteFiles",r.messageDirection=wr.MessageDirection.clientToServer,r.type=new wr.ProtocolNotificationType(r.method)})(A_||(Wt.DidDeleteFilesNotification=A_={}));var I_;(function(r){r.method="workspace/willDeleteFiles",r.messageDirection=wr.MessageDirection.clientToServer,r.type=new wr.ProtocolRequestType(r.method)})(I_||(Wt.WillDeleteFilesRequest=I_={}))});var j_=k(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.MonikerRequest=ts.MonikerKind=ts.UniquenessLevel=void 0;var x_=rt(),L_;(function(r){r.document="document",r.project="project",r.group="group",r.scheme="scheme",r.global="global"})(L_||(ts.UniquenessLevel=L_={}));var $_;(function(r){r.$import="import",r.$export="export",r.local="local"})($_||(ts.MonikerKind=$_={}));var q_;(function(r){r.method="textDocument/moniker",r.messageDirection=x_.MessageDirection.clientToServer,r.type=new x_.ProtocolRequestType(r.method)})(q_||(ts.MonikerRequest=q_={}))});var V_=k(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.TypeHierarchySubtypesRequest=rs.TypeHierarchySupertypesRequest=rs.TypeHierarchyPrepareRequest=void 0;var Wi=rt(),F_;(function(r){r.method="textDocument/prepareTypeHierarchy",r.messageDirection=Wi.MessageDirection.clientToServer,r.type=new Wi.ProtocolRequestType(r.method)})(F_||(rs.TypeHierarchyPrepareRequest=F_={}));var B_;(function(r){r.method="typeHierarchy/supertypes",r.messageDirection=Wi.MessageDirection.clientToServer,r.type=new Wi.ProtocolRequestType(r.method)})(B_||(rs.TypeHierarchySupertypesRequest=B_={}));var U_;(function(r){r.method="typeHierarchy/subtypes",r.messageDirection=Wi.MessageDirection.clientToServer,r.type=new Wi.ProtocolRequestType(r.method)})(U_||(rs.TypeHierarchySubtypesRequest=U_={}))});var K_=k(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.InlineValueRefreshRequest=Hi.InlineValueRequest=void 0;var tu=rt(),W_;(function(r){r.method="textDocument/inlineValue",r.messageDirection=tu.MessageDirection.clientToServer,r.type=new tu.ProtocolRequestType(r.method)})(W_||(Hi.InlineValueRequest=W_={}));var H_;(function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=tu.MessageDirection.serverToClient,r.type=new tu.ProtocolRequestType0(r.method)})(H_||(Hi.InlineValueRefreshRequest=H_={}))});var J_=k(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.InlayHintRefreshRequest=ns.InlayHintResolveRequest=ns.InlayHintRequest=void 0;var Ki=rt(),z_;(function(r){r.method="textDocument/inlayHint",r.messageDirection=Ki.MessageDirection.clientToServer,r.type=new Ki.ProtocolRequestType(r.method)})(z_||(ns.InlayHintRequest=z_={}));var G_;(function(r){r.method="inlayHint/resolve",r.messageDirection=Ki.MessageDirection.clientToServer,r.type=new Ki.ProtocolRequestType(r.method)})(G_||(ns.InlayHintResolveRequest=G_={}));var Y_;(function(r){r.method="workspace/inlayHint/refresh",r.messageDirection=Ki.MessageDirection.serverToClient,r.type=new Ki.ProtocolRequestType0(r.method)})(Y_||(ns.InlayHintRefreshRequest=Y_={}))});var nS=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.DiagnosticRefreshRequest=Er.WorkspaceDiagnosticRequest=Er.DocumentDiagnosticRequest=Er.DocumentDiagnosticReportKind=Er.DiagnosticServerCancellationData=void 0;var rS=Ws(),bI=Vl(),zi=rt(),X_;(function(r){function e(t){let n=t;return n&&bI.boolean(n.retriggerRequest)}r.is=e})(X_||(Er.DiagnosticServerCancellationData=X_={}));var Q_;(function(r){r.Full="full",r.Unchanged="unchanged"})(Q_||(Er.DocumentDiagnosticReportKind=Q_={}));var Z_;(function(r){r.method="textDocument/diagnostic",r.messageDirection=zi.MessageDirection.clientToServer,r.type=new zi.ProtocolRequestType(r.method),r.partialResult=new rS.ProgressType})(Z_||(Er.DocumentDiagnosticRequest=Z_={}));var eS;(function(r){r.method="workspace/diagnostic",r.messageDirection=zi.MessageDirection.clientToServer,r.type=new zi.ProtocolRequestType(r.method),r.partialResult=new rS.ProgressType})(eS||(Er.WorkspaceDiagnosticRequest=eS={}));var tS;(function(r){r.method="workspace/diagnostic/refresh",r.messageDirection=zi.MessageDirection.serverToClient,r.type=new zi.ProtocolRequestType0(r.method)})(tS||(Er.DiagnosticRefreshRequest=tS={}))});var uS=k(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.DidCloseNotebookDocumentNotification=ct.DidSaveNotebookDocumentNotification=ct.DidChangeNotebookDocumentNotification=ct.NotebookCellArrayChange=ct.DidOpenNotebookDocumentNotification=ct.NotebookDocumentSyncRegistrationType=ct.NotebookDocument=ct.NotebookCell=ct.ExecutionSummary=ct.NotebookCellKind=void 0;var ha=Ul(),Hr=Vl(),un=rt(),$p;(function(r){r.Markup=1,r.Code=2;function e(t){return t===1||t===2}r.is=e})($p||(ct.NotebookCellKind=$p={}));var qp;(function(r){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}r.create=e;function t(s){let i=s;return Hr.objectLiteral(i)&&ha.uinteger.is(i.executionOrder)&&(i.success===void 0||Hr.boolean(i.success))}r.is=t;function n(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}r.equals=n})(qp||(ct.ExecutionSummary=qp={}));var ru;(function(r){function e(i,o){return{kind:i,document:o}}r.create=e;function t(i){let o=i;return Hr.objectLiteral(o)&&$p.is(o.kind)&&ha.DocumentUri.is(o.document)&&(o.metadata===void 0||Hr.objectLiteral(o.metadata))}r.is=t;function n(i,o){let a=new Set;return i.document!==o.document&&a.add("document"),i.kind!==o.kind&&a.add("kind"),i.executionSummary!==o.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||o.metadata!==void 0)&&!s(i.metadata,o.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||o.executionSummary!==void 0)&&!qp.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}r.diff=n;function s(i,o){if(i===o)return!0;if(i==null||o===null||o===void 0||typeof i!=typeof o||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(i.length!==o.length)return!1;for(let l=0;l<i.length;l++)if(!s(i[l],o[l]))return!1}if(Hr.objectLiteral(i)&&Hr.objectLiteral(o)){let l=Object.keys(i),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!s(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!s(i[f],o[f]))return!1}}return!0}})(ru||(ct.NotebookCell=ru={}));var sS;(function(r){function e(n,s,i,o){return{uri:n,notebookType:s,version:i,cells:o}}r.create=e;function t(n){let s=n;return Hr.objectLiteral(s)&&Hr.string(s.uri)&&ha.integer.is(s.version)&&Hr.typedArray(s.cells,ru.is)}r.is=t})(sS||(ct.NotebookDocument=sS={}));var Gi;(function(r){r.method="notebookDocument/sync",r.messageDirection=un.MessageDirection.clientToServer,r.type=new un.RegistrationType(r.method)})(Gi||(ct.NotebookDocumentSyncRegistrationType=Gi={}));var iS;(function(r){r.method="notebookDocument/didOpen",r.messageDirection=un.MessageDirection.clientToServer,r.type=new un.ProtocolNotificationType(r.method),r.registrationMethod=Gi.method})(iS||(ct.DidOpenNotebookDocumentNotification=iS={}));var oS;(function(r){function e(n){let s=n;return Hr.objectLiteral(s)&&ha.uinteger.is(s.start)&&ha.uinteger.is(s.deleteCount)&&(s.cells===void 0||Hr.typedArray(s.cells,ru.is))}r.is=e;function t(n,s,i){let o={start:n,deleteCount:s};return i!==void 0&&(o.cells=i),o}r.create=t})(oS||(ct.NotebookCellArrayChange=oS={}));var aS;(function(r){r.method="notebookDocument/didChange",r.messageDirection=un.MessageDirection.clientToServer,r.type=new un.ProtocolNotificationType(r.method),r.registrationMethod=Gi.method})(aS||(ct.DidChangeNotebookDocumentNotification=aS={}));var cS;(function(r){r.method="notebookDocument/didSave",r.messageDirection=un.MessageDirection.clientToServer,r.type=new un.ProtocolNotificationType(r.method),r.registrationMethod=Gi.method})(cS||(ct.DidSaveNotebookDocumentNotification=cS={}));var lS;(function(r){r.method="notebookDocument/didClose",r.messageDirection=un.MessageDirection.clientToServer,r.type=new un.ProtocolNotificationType(r.method),r.registrationMethod=Gi.method})(lS||(ct.DidCloseNotebookDocumentNotification=lS={}))});var hS=k(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.InlineCompletionRequest=void 0;var dS=rt(),fS;(function(r){r.method="textDocument/inlineCompletion",r.messageDirection=dS.MessageDirection.clientToServer,r.type=new dS.ProtocolRequestType(r.method)})(fS||(nu.InlineCompletionRequest=fS={}))});var Nk=k(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.WorkspaceSymbolRequest=S.CodeActionResolveRequest=S.CodeActionRequest=S.DocumentSymbolRequest=S.DocumentHighlightRequest=S.ReferencesRequest=S.DefinitionRequest=S.SignatureHelpRequest=S.SignatureHelpTriggerKind=S.HoverRequest=S.CompletionResolveRequest=S.CompletionRequest=S.CompletionTriggerKind=S.PublishDiagnosticsNotification=S.WatchKind=S.RelativePattern=S.FileChangeType=S.DidChangeWatchedFilesNotification=S.WillSaveTextDocumentWaitUntilRequest=S.WillSaveTextDocumentNotification=S.TextDocumentSaveReason=S.DidSaveTextDocumentNotification=S.DidCloseTextDocumentNotification=S.DidChangeTextDocumentNotification=S.TextDocumentContentChangeEvent=S.DidOpenTextDocumentNotification=S.TextDocumentSyncKind=S.TelemetryEventNotification=S.LogMessageNotification=S.ShowMessageRequest=S.ShowMessageNotification=S.MessageType=S.DidChangeConfigurationNotification=S.ExitNotification=S.ShutdownRequest=S.InitializedNotification=S.InitializeErrorCodes=S.InitializeRequest=S.WorkDoneProgressOptions=S.TextDocumentRegistrationOptions=S.StaticRegistrationOptions=S.PositionEncodingKind=S.FailureHandlingKind=S.ResourceOperationKind=S.UnregistrationRequest=S.RegistrationRequest=S.DocumentSelector=S.NotebookCellTextDocumentFilter=S.NotebookDocumentFilter=S.TextDocumentFilter=void 0;S.MonikerRequest=S.MonikerKind=S.UniquenessLevel=S.WillDeleteFilesRequest=S.DidDeleteFilesNotification=S.WillRenameFilesRequest=S.DidRenameFilesNotification=S.WillCreateFilesRequest=S.DidCreateFilesNotification=S.FileOperationPatternKind=S.LinkedEditingRangeRequest=S.ShowDocumentRequest=S.SemanticTokensRegistrationType=S.SemanticTokensRefreshRequest=S.SemanticTokensRangeRequest=S.SemanticTokensDeltaRequest=S.SemanticTokensRequest=S.TokenFormat=S.CallHierarchyPrepareRequest=S.CallHierarchyOutgoingCallsRequest=S.CallHierarchyIncomingCallsRequest=S.WorkDoneProgressCancelNotification=S.WorkDoneProgressCreateRequest=S.WorkDoneProgress=S.SelectionRangeRequest=S.DeclarationRequest=S.FoldingRangeRefreshRequest=S.FoldingRangeRequest=S.ColorPresentationRequest=S.DocumentColorRequest=S.ConfigurationRequest=S.DidChangeWorkspaceFoldersNotification=S.WorkspaceFoldersRequest=S.TypeDefinitionRequest=S.ImplementationRequest=S.ApplyWorkspaceEditRequest=S.ExecuteCommandRequest=S.PrepareRenameRequest=S.RenameRequest=S.PrepareSupportDefaultBehavior=S.DocumentOnTypeFormattingRequest=S.DocumentRangesFormattingRequest=S.DocumentRangeFormattingRequest=S.DocumentFormattingRequest=S.DocumentLinkResolveRequest=S.DocumentLinkRequest=S.CodeLensRefreshRequest=S.CodeLensResolveRequest=S.CodeLensRequest=S.WorkspaceSymbolResolveRequest=void 0;S.InlineCompletionRequest=S.DidCloseNotebookDocumentNotification=S.DidSaveNotebookDocumentNotification=S.DidChangeNotebookDocumentNotification=S.NotebookCellArrayChange=S.DidOpenNotebookDocumentNotification=S.NotebookDocumentSyncRegistrationType=S.NotebookDocument=S.NotebookCell=S.ExecutionSummary=S.NotebookCellKind=S.DiagnosticRefreshRequest=S.WorkspaceDiagnosticRequest=S.DocumentDiagnosticRequest=S.DocumentDiagnosticReportKind=S.DiagnosticServerCancellationData=S.InlayHintRefreshRequest=S.InlayHintResolveRequest=S.InlayHintRequest=S.InlineValueRefreshRequest=S.InlineValueRequest=S.TypeHierarchySupertypesRequest=S.TypeHierarchySubtypesRequest=S.TypeHierarchyPrepareRequest=void 0;var q=rt(),pS=Ul(),Pt=Vl(),TI=jT();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return TI.ImplementationRequest}});var _I=UT();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return _I.TypeDefinitionRequest}});var Sk=HT();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Sk.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Sk.DidChangeWorkspaceFoldersNotification}});var SI=GT();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return SI.ConfigurationRequest}});var kk=XT();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return kk.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return kk.ColorPresentationRequest}});var wk=e_();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return wk.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return wk.FoldingRangeRefreshRequest}});var kI=n_();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return kI.DeclarationRequest}});var wI=o_();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return wI.SelectionRangeRequest}});var Vp=u_();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return Vp.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Vp.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Vp.WorkDoneProgressCancelNotification}});var Wp=p_();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Wp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Wp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Wp.CallHierarchyPrepareRequest}});var Yi=T_();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return Yi.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return Yi.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Yi.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Yi.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Yi.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Yi.SemanticTokensRegistrationType}});var EI=k_();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return EI.ShowDocumentRequest}});var NI=N_();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return NI.LinkedEditingRangeRequest}});var Hs=M_();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return Hs.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Hs.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Hs.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Hs.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Hs.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Hs.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Hs.WillDeleteFilesRequest}});var Hp=j_();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Hp.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Hp.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Hp.MonikerRequest}});var Kp=V_();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Kp.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Kp.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Kp.TypeHierarchySupertypesRequest}});var Ek=K_();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return Ek.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Ek.InlineValueRefreshRequest}});var zp=J_();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return zp.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return zp.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return zp.InlayHintRefreshRequest}});var pa=nS();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return pa.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return pa.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return pa.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return pa.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return pa.DiagnosticRefreshRequest}});var dn=uS();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return dn.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return dn.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return dn.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return dn.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return dn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return dn.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return dn.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return dn.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return dn.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return dn.DidCloseNotebookDocumentNotification}});var PI=hS();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return PI.InlineCompletionRequest}});var jp;(function(r){function e(t){let n=t;return Pt.string(n)||Pt.string(n.language)||Pt.string(n.scheme)||Pt.string(n.pattern)}r.is=e})(jp||(S.TextDocumentFilter=jp={}));var Fp;(function(r){function e(t){let n=t;return Pt.objectLiteral(n)&&(Pt.string(n.notebookType)||Pt.string(n.scheme)||Pt.string(n.pattern))}r.is=e})(Fp||(S.NotebookDocumentFilter=Fp={}));var Bp;(function(r){function e(t){let n=t;return Pt.objectLiteral(n)&&(Pt.string(n.notebook)||Fp.is(n.notebook))&&(n.language===void 0||Pt.string(n.language))}r.is=e})(Bp||(S.NotebookCellTextDocumentFilter=Bp={}));var Up;(function(r){function e(t){if(!Array.isArray(t))return!1;for(let n of t)if(!Pt.string(n)&&!jp.is(n)&&!Bp.is(n))return!1;return!0}r.is=e})(Up||(S.DocumentSelector=Up={}));var mS;(function(r){r.method="client/registerCapability",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType(r.method)})(mS||(S.RegistrationRequest=mS={}));var gS;(function(r){r.method="client/unregisterCapability",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType(r.method)})(gS||(S.UnregistrationRequest=gS={}));var yS;(function(r){r.Create="create",r.Rename="rename",r.Delete="delete"})(yS||(S.ResourceOperationKind=yS={}));var vS;(function(r){r.Abort="abort",r.Transactional="transactional",r.TextOnlyTransactional="textOnlyTransactional",r.Undo="undo"})(vS||(S.FailureHandlingKind=vS={}));var bS;(function(r){r.UTF8="utf-8",r.UTF16="utf-16",r.UTF32="utf-32"})(bS||(S.PositionEncodingKind=bS={}));var TS;(function(r){function e(t){let n=t;return n&&Pt.string(n.id)&&n.id.length>0}r.hasId=e})(TS||(S.StaticRegistrationOptions=TS={}));var _S;(function(r){function e(t){let n=t;return n&&(n.documentSelector===null||Up.is(n.documentSelector))}r.is=e})(_S||(S.TextDocumentRegistrationOptions=_S={}));var SS;(function(r){function e(n){let s=n;return Pt.objectLiteral(s)&&(s.workDoneProgress===void 0||Pt.boolean(s.workDoneProgress))}r.is=e;function t(n){let s=n;return s&&Pt.boolean(s.workDoneProgress)}r.hasWorkDoneProgress=t})(SS||(S.WorkDoneProgressOptions=SS={}));var kS;(function(r){r.method="initialize",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(kS||(S.InitializeRequest=kS={}));var wS;(function(r){r.unknownProtocolVersion=1})(wS||(S.InitializeErrorCodes=wS={}));var ES;(function(r){r.method="initialized",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(ES||(S.InitializedNotification=ES={}));var NS;(function(r){r.method="shutdown",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType0(r.method)})(NS||(S.ShutdownRequest=NS={}));var PS;(function(r){r.method="exit",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType0(r.method)})(PS||(S.ExitNotification=PS={}));var RS;(function(r){r.method="workspace/didChangeConfiguration",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(RS||(S.DidChangeConfigurationNotification=RS={}));var CS;(function(r){r.Error=1,r.Warning=2,r.Info=3,r.Log=4,r.Debug=5})(CS||(S.MessageType=CS={}));var DS;(function(r){r.method="window/showMessage",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolNotificationType(r.method)})(DS||(S.ShowMessageNotification=DS={}));var OS;(function(r){r.method="window/showMessageRequest",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType(r.method)})(OS||(S.ShowMessageRequest=OS={}));var AS;(function(r){r.method="window/logMessage",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolNotificationType(r.method)})(AS||(S.LogMessageNotification=AS={}));var IS;(function(r){r.method="telemetry/event",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolNotificationType(r.method)})(IS||(S.TelemetryEventNotification=IS={}));var MS;(function(r){r.None=0,r.Full=1,r.Incremental=2})(MS||(S.TextDocumentSyncKind=MS={}));var xS;(function(r){r.method="textDocument/didOpen",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(xS||(S.DidOpenTextDocumentNotification=xS={}));var LS;(function(r){function e(n){let s=n;return s!=null&&typeof s.text=="string"&&s.range!==void 0&&(s.rangeLength===void 0||typeof s.rangeLength=="number")}r.isIncremental=e;function t(n){let s=n;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}r.isFull=t})(LS||(S.TextDocumentContentChangeEvent=LS={}));var $S;(function(r){r.method="textDocument/didChange",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})($S||(S.DidChangeTextDocumentNotification=$S={}));var qS;(function(r){r.method="textDocument/didClose",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(qS||(S.DidCloseTextDocumentNotification=qS={}));var jS;(function(r){r.method="textDocument/didSave",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(jS||(S.DidSaveTextDocumentNotification=jS={}));var FS;(function(r){r.Manual=1,r.AfterDelay=2,r.FocusOut=3})(FS||(S.TextDocumentSaveReason=FS={}));var BS;(function(r){r.method="textDocument/willSave",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(BS||(S.WillSaveTextDocumentNotification=BS={}));var US;(function(r){r.method="textDocument/willSaveWaitUntil",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(US||(S.WillSaveTextDocumentWaitUntilRequest=US={}));var VS;(function(r){r.method="workspace/didChangeWatchedFiles",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(VS||(S.DidChangeWatchedFilesNotification=VS={}));var WS;(function(r){r.Created=1,r.Changed=2,r.Deleted=3})(WS||(S.FileChangeType=WS={}));var HS;(function(r){function e(t){let n=t;return Pt.objectLiteral(n)&&(pS.URI.is(n.baseUri)||pS.WorkspaceFolder.is(n.baseUri))&&Pt.string(n.pattern)}r.is=e})(HS||(S.RelativePattern=HS={}));var KS;(function(r){r.Create=1,r.Change=2,r.Delete=4})(KS||(S.WatchKind=KS={}));var zS;(function(r){r.method="textDocument/publishDiagnostics",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolNotificationType(r.method)})(zS||(S.PublishDiagnosticsNotification=zS={}));var GS;(function(r){r.Invoked=1,r.TriggerCharacter=2,r.TriggerForIncompleteCompletions=3})(GS||(S.CompletionTriggerKind=GS={}));var YS;(function(r){r.method="textDocument/completion",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(YS||(S.CompletionRequest=YS={}));var JS;(function(r){r.method="completionItem/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(JS||(S.CompletionResolveRequest=JS={}));var XS;(function(r){r.method="textDocument/hover",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(XS||(S.HoverRequest=XS={}));var QS;(function(r){r.Invoked=1,r.TriggerCharacter=2,r.ContentChange=3})(QS||(S.SignatureHelpTriggerKind=QS={}));var ZS;(function(r){r.method="textDocument/signatureHelp",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(ZS||(S.SignatureHelpRequest=ZS={}));var ek;(function(r){r.method="textDocument/definition",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(ek||(S.DefinitionRequest=ek={}));var tk;(function(r){r.method="textDocument/references",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(tk||(S.ReferencesRequest=tk={}));var rk;(function(r){r.method="textDocument/documentHighlight",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(rk||(S.DocumentHighlightRequest=rk={}));var nk;(function(r){r.method="textDocument/documentSymbol",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(nk||(S.DocumentSymbolRequest=nk={}));var sk;(function(r){r.method="textDocument/codeAction",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(sk||(S.CodeActionRequest=sk={}));var ik;(function(r){r.method="codeAction/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(ik||(S.CodeActionResolveRequest=ik={}));var ok;(function(r){r.method="workspace/symbol",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(ok||(S.WorkspaceSymbolRequest=ok={}));var ak;(function(r){r.method="workspaceSymbol/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(ak||(S.WorkspaceSymbolResolveRequest=ak={}));var ck;(function(r){r.method="textDocument/codeLens",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(ck||(S.CodeLensRequest=ck={}));var lk;(function(r){r.method="codeLens/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(lk||(S.CodeLensResolveRequest=lk={}));var uk;(function(r){r.method="workspace/codeLens/refresh",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType0(r.method)})(uk||(S.CodeLensRefreshRequest=uk={}));var dk;(function(r){r.method="textDocument/documentLink",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(dk||(S.DocumentLinkRequest=dk={}));var fk;(function(r){r.method="documentLink/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(fk||(S.DocumentLinkResolveRequest=fk={}));var hk;(function(r){r.method="textDocument/formatting",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(hk||(S.DocumentFormattingRequest=hk={}));var pk;(function(r){r.method="textDocument/rangeFormatting",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(pk||(S.DocumentRangeFormattingRequest=pk={}));var mk;(function(r){r.method="textDocument/rangesFormatting",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(mk||(S.DocumentRangesFormattingRequest=mk={}));var gk;(function(r){r.method="textDocument/onTypeFormatting",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(gk||(S.DocumentOnTypeFormattingRequest=gk={}));var yk;(function(r){r.Identifier=1})(yk||(S.PrepareSupportDefaultBehavior=yk={}));var vk;(function(r){r.method="textDocument/rename",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(vk||(S.RenameRequest=vk={}));var bk;(function(r){r.method="textDocument/prepareRename",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(bk||(S.PrepareRenameRequest=bk={}));var Tk;(function(r){r.method="workspace/executeCommand",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(Tk||(S.ExecuteCommandRequest=Tk={}));var _k;(function(r){r.method="workspace/applyEdit",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType("workspace/applyEdit")})(_k||(S.ApplyWorkspaceEditRequest=_k={}))});var Rk=k(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.createProtocolConnection=void 0;var Pk=Ws();function RI(r,e,t,n){return Pk.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Pk.createMessageConnection)(r,e,t,n)}su.createProtocolConnection=RI});var Dk=k(cr=>{"use strict";var CI=cr&&cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),iu=cr&&cr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&CI(e,r,t)};Object.defineProperty(cr,"__esModule",{value:!0});cr.LSPErrorCodes=cr.createProtocolConnection=void 0;iu(Ws(),cr);iu(Ul(),cr);iu(rt(),cr);iu(Nk(),cr);var DI=Rk();Object.defineProperty(cr,"createProtocolConnection",{enumerable:!0,get:function(){return DI.createProtocolConnection}});var Ck;(function(r){r.lspReservedErrorRangeStart=-32899,r.RequestFailed=-32803,r.ServerCancelled=-32802,r.ContentModified=-32801,r.RequestCancelled=-32800,r.lspReservedErrorRangeEnd=-32800})(Ck||(cr.LSPErrorCodes=Ck={}))});var ut=k(fn=>{"use strict";var OI=fn&&fn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ok=fn&&fn.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&OI(e,r,t)};Object.defineProperty(fn,"__esModule",{value:!0});fn.createProtocolConnection=void 0;var AI=Op();Ok(Op(),fn);Ok(Dk(),fn);function II(r,e,t,n){return(0,AI.createMessageConnection)(r,e,t,n)}fn.createProtocolConnection=II});var Gp=k(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.generateUuid=Nr.parse=Nr.isUUID=Nr.v4=Nr.empty=void 0;var ma=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ga=class r extends ma{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return r._oneOf(r._chars)}constructor(){super([r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-","4",r._randomHex(),r._randomHex(),r._randomHex(),"-",r._oneOf(r._timeHighBits),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex()].join(""))}};ga._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ga._timeHighBits=["8","9","a","b"];Nr.empty=new ma("00000000-0000-0000-0000-000000000000");function Ak(){return new ga}Nr.v4=Ak;var MI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ik(r){return MI.test(r)}Nr.isUUID=Ik;function xI(r){if(!Ik(r))throw new Error("invalid uuid");return new ma(r)}Nr.parse=xI;function LI(){return Ak().asHex()}Nr.generateUuid=LI});var Mk=k(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.attachPartialResult=is.ProgressFeature=is.attachWorkDone=void 0;var ss=ut(),$I=Gp(),Ks=class r{constructor(e,t){this._connection=e,this._token=t,r.Instances.set(this._token,this)}begin(e,t,n,s){let i={kind:"begin",title:e,percentage:t,message:n,cancellable:s};this._connection.sendProgress(ss.WorkDoneProgress.type,this._token,i)}report(e,t){let n={kind:"report"};typeof e=="number"?(n.percentage=e,t!==void 0&&(n.message=t)):n.message=e,this._connection.sendProgress(ss.WorkDoneProgress.type,this._token,n)}done(){r.Instances.delete(this._token),this._connection.sendProgress(ss.WorkDoneProgress.type,this._token,{kind:"end"})}};Ks.Instances=new Map;var ou=class extends Ks{constructor(e,t){super(e,t),this._source=new ss.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ya=class{constructor(){}begin(){}report(){}done(){}},au=class extends ya{constructor(){super(),this._source=new ss.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function qI(r,e){if(e===void 0||e.workDoneToken===void 0)return new ya;let t=e.workDoneToken;return delete e.workDoneToken,new Ks(r,t)}is.attachWorkDone=qI;var jI=r=>class extends r{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ss.WorkDoneProgressCancelNotification.type,t=>{let n=Ks.Instances.get(t.token);(n instanceof ou||n instanceof au)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ya:new Ks(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,$I.generateUuid)();return this.connection.sendRequest(ss.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new ou(this.connection,e))}else return Promise.resolve(new au)}};is.ProgressFeature=jI;var Yp;(function(r){r.type=new ss.ProgressType})(Yp||(Yp={}));var Jp=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Yp.type,this._token,e)}};function FI(r,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Jp(r,t)}is.attachPartialResult=FI});var xk=k(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.ConfigurationFeature=void 0;var BI=ut(),UI=bl(),VI=r=>class extends r{getConfiguration(e){return e?UI.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(BI.ConfigurationRequest.type,t).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};cu.ConfigurationFeature=VI});var Lk=k(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.WorkspaceFoldersFeature=void 0;var lu=ut(),WI=r=>class extends r{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new lu.Emitter,this.connection.onNotification(lu.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(lu.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(lu.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};uu.WorkspaceFoldersFeature=WI});var $k=k(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.CallHierarchyFeature=void 0;var Xp=ut(),HI=r=>class extends r{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Xp.CallHierarchyPrepareRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=Xp.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))},onOutgoingCalls:e=>{let t=Xp.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};du.CallHierarchyFeature=HI});var Zp=k(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.SemanticTokensBuilder=os.SemanticTokensDiff=os.SemanticTokensFeature=void 0;var fu=ut(),KI=r=>class extends r{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(fu.SemanticTokensRefreshRequest.type),on:e=>{let t=fu.SemanticTokensRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))},onDelta:e=>{let t=fu.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))},onRange:e=>{let t=fu.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};os.SemanticTokensFeature=KI;var hu=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let s=e-1,i=t-1;for(;s>=n&&i>=n&&this.originalSequence[s]===this.modifiedSequence[i];)s--,i--;(s<n||i<n)&&(s++,i++);let o=s-n+1,a=this.modifiedSequence.slice(n,i+1);return a.length===1&&a[0]===this.originalSequence[s]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:a}]}else return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};os.SemanticTokensDiff=hu;var Qp=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,s,i){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=s,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new hu(this._prevData,this._data).computeDiff()}:this.build()}};os.SemanticTokensBuilder=Qp});var qk=k(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.ShowDocumentFeature=void 0;var zI=ut(),GI=r=>class extends r{showDocument(e){return this.connection.sendRequest(zI.ShowDocumentRequest.type,e)}};pu.ShowDocumentFeature=GI});var jk=k(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.FileOperationsFeature=void 0;var Ji=ut(),YI=r=>class extends r{onDidCreateFiles(e){return this.connection.onNotification(Ji.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(Ji.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(Ji.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(Ji.WillCreateFilesRequest.type,(t,n)=>e(t,n))}onWillRenameFiles(e){return this.connection.onRequest(Ji.WillRenameFilesRequest.type,(t,n)=>e(t,n))}onWillDeleteFiles(e){return this.connection.onRequest(Ji.WillDeleteFilesRequest.type,(t,n)=>e(t,n))}};mu.FileOperationsFeature=YI});var Fk=k(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.LinkedEditingRangeFeature=void 0;var JI=ut(),XI=r=>class extends r{onLinkedEditingRange(e){return this.connection.onRequest(JI.LinkedEditingRangeRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))}};gu.LinkedEditingRangeFeature=XI});var Bk=k(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.TypeHierarchyFeature=void 0;var em=ut(),QI=r=>class extends r{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(em.TypeHierarchyPrepareRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=em.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))},onSubtypes:e=>{let t=em.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};yu.TypeHierarchyFeature=QI});var Vk=k(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.InlineValueFeature=void 0;var Uk=ut(),ZI=r=>class extends r{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Uk.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(Uk.InlineValueRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t)))}}};vu.InlineValueFeature=ZI});var Hk=k(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.FoldingRangeFeature=void 0;var Wk=ut(),eM=r=>class extends r{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Wk.FoldingRangeRefreshRequest.type),on:e=>{let t=Wk.FoldingRangeRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};bu.FoldingRangeFeature=eM});var Kk=k(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.InlayHintFeature=void 0;var tm=ut(),tM=r=>class extends r{get inlayHint(){return{refresh:()=>this.connection.sendRequest(tm.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(tm.InlayHintRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(tm.InlayHintResolveRequest.type,(t,n)=>e(t,n))}}};Tu.InlayHintFeature=tM});var zk=k(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.DiagnosticFeature=void 0;var va=ut(),rM=r=>class extends r{get diagnostics(){return{refresh:()=>this.connection.sendRequest(va.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(va.DocumentDiagnosticRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(va.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(va.WorkspaceDiagnosticRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(va.WorkspaceDiagnosticRequest.partialResult,t)))}}};_u.DiagnosticFeature=rM});var nm=k(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.TextDocuments=void 0;var zs=ut(),rm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new zs.Emitter,this._onDidOpen=new zs.Emitter,this._onDidClose=new zs.Emitter,this._onDidSave=new zs.Emitter,this._onWillSave=new zs.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=zs.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(n=>{let s=n.textDocument,i=this._configuration.create(s.uri,s.languageId,s.version,s.text);this._syncedDocuments.set(s.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(n=>{let s=n.textDocument,i=n.contentChanges;if(i.length===0)return;let{version:o}=s;if(o==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let a=this._syncedDocuments.get(s.uri);a!==void 0&&(a=this._configuration.update(a,i,o),this._syncedDocuments.set(s.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(n=>{let s=this._syncedDocuments.get(n.textDocument.uri);s!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:s})))})),t.push(e.onWillSaveTextDocument(n=>{let s=this._syncedDocuments.get(n.textDocument.uri);s!==void 0&&this._onWillSave.fire(Object.freeze({document:s,reason:n.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((n,s)=>{let i=this._syncedDocuments.get(n.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:n.reason}),s):[]})),t.push(e.onDidSaveTextDocument(n=>{let s=this._syncedDocuments.get(n.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),zs.Disposable.create(()=>{t.forEach(n=>n.dispose())})}};Su.TextDocuments=rm});var im=k(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.NotebookDocuments=Xi.NotebookSyncFeature=void 0;var Pr=ut(),Gk=nm(),nM=r=>class extends r{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Pr.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Pr.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Pr.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Pr.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};Xi.NotebookSyncFeature=nM;var ku=class r{onDidOpenTextDocument(e){return this.openHandler=e,Pr.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Pr.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Pr.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}};ku.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var sm=class{constructor(e){e instanceof Gk.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Gk.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Pr.Emitter,this._onDidChange=new Pr.Emitter,this._onDidSave=new Pr.Emitter,this._onDidClose=new Pr.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new ku,n=[];return n.push(this.cellTextDocuments.listen(t)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(s=>{this.notebookDocuments.set(s.notebookDocument.uri,s.notebookDocument);for(let i of s.cellTextDocuments)t.openTextDocument({textDocument:i});this.updateCellMap(s.notebookDocument),this._onDidOpen.fire(s.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i===void 0)return;i.version=s.notebookDocument.version;let o=i.metadata,a=!1,c=s.change;c.metadata!==void 0&&(a=!0,i.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let w=c.cells;if(w.structure!==void 0){let T=w.structure.array;if(i.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),w.structure.didOpen!==void 0)for(let v of w.structure.didOpen)t.openTextDocument({textDocument:v}),l.push(v.uri);if(w.structure.didClose)for(let v of w.structure.didClose)t.closeTextDocument({textDocument:v}),u.push(v.uri)}if(w.data!==void 0){let T=new Map(w.data.map(v=>[v.document,v]));for(let v=0;v<=i.cells.length;v++){let R=T.get(i.cells[v].document);if(R!==void 0){let A=i.cells.splice(v,1,R);if(d.push({old:A[0],new:R}),T.delete(R.document),T.size===0)break}}}if(w.textContent!==void 0)for(let T of w.textContent)t.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),f.push(T.document.uri)}this.updateCellMap(i);let p={notebookDocument:i};a&&(p.metadata={old:o,new:i.metadata});let b=[];for(let w of l)b.push(this.getNotebookCell(w));let g=[];for(let w of u)g.push(this.getNotebookCell(w));let _=[];for(let w of f)_.push(this.getNotebookCell(w));(b.length>0||g.length>0||d.length>0||_.length>0)&&(p.cells={added:b,removed:g,changed:{data:d,textContent:_}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let o of s.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(s.notebookDocument.uri);for(let o of i.cells)this.notebookCellMap.delete(o.document)}})),Pr.Disposable.create(()=>{n.forEach(s=>s.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};Xi.NotebookDocuments=sm});var Yk=k(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.MonikerFeature=void 0;var sM=ut(),iM=r=>class extends r{get moniker(){return{on:e=>{let t=sM.MonikerRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};wu.MonikerFeature=iM});var dm=k(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.createConnection=we.combineFeatures=we.combineNotebooksFeatures=we.combineLanguagesFeatures=we.combineWorkspaceFeatures=we.combineWindowFeatures=we.combineClientFeatures=we.combineTracerFeatures=we.combineTelemetryFeatures=we.combineConsoleFeatures=we._NotebooksImpl=we._LanguagesImpl=we.BulkUnregistration=we.BulkRegistration=we.ErrorMessageTracker=void 0;var U=ut(),Rr=bl(),am=Gp(),re=Mk(),oM=xk(),aM=Lk(),cM=$k(),lM=Zp(),uM=qk(),dM=jk(),fM=Fk(),hM=Bk(),pM=Vk(),mM=Hk(),gM=Kk(),yM=zk(),vM=im(),bM=Yk();function om(r){if(r!==null)return r}var cm=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};we.ErrorMessageTracker=cm;var Eu=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},lm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let n={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,n).then(om)}showWarningMessage(e,...t){let n={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,n).then(om)}showInformationMessage(e,...t){let n={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,n).then(om)}},Jk=(0,uM.ShowDocumentFeature)((0,re.ProgressFeature)(lm)),Xk;(function(r){function e(){return new Nu}r.create=e})(Xk||(we.BulkRegistration=Xk={}));var Nu=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let n=Rr.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let s=am.generateUuid();this._registrations.push({id:s,method:n,registerOptions:t||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Qk;(function(r){function e(){return new ba(void 0,[])}r.create=e})(Qk||(we.BulkUnregistration=Qk={}));var ba=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Rr.string(e)?e:e.method,n=this._unregistrations.get(t);if(!n)return!1;let s={unregisterations:[n]};return this._connection.sendRequest(U.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(t)},i=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},Pu=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof Nu?this.registerMany(e):e instanceof ba?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,t,n){let s=Rr.string(t)?t:t.method,i=am.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:i,method:s}),e),a=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(a)))}registerSingle2(e,t){let n=Rr.string(e)?e:e.method,s=am.generateUuid(),i={registrations:[{id:s,method:n,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,i).then(o=>U.Disposable.create(()=>{this.unregisterSingle(s,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let n={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new ba(this._connection,t.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},um=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(s){return s&&!!s.edit}let n=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,n)}},Zk=(0,dM.FileOperationsFeature)((0,aM.WorkspaceFoldersFeature)((0,oM.ConfigurationFeature)(um))),Ru=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},Cu=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Du=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,re.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,re.attachPartialResult)(this.connection,t)}};we._LanguagesImpl=Du;var ew=(0,mM.FoldingRangeFeature)((0,bM.MonikerFeature)((0,yM.DiagnosticFeature)((0,gM.InlayHintFeature)((0,pM.InlineValueFeature)((0,hM.TypeHierarchyFeature)((0,fM.LinkedEditingRangeFeature)((0,lM.SemanticTokensFeature)((0,cM.CallHierarchyFeature)(Du))))))))),Ou=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,re.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,re.attachPartialResult)(this.connection,t)}};we._NotebooksImpl=Ou;var tw=(0,vM.NotebookSyncFeature)(Ou);function rw(r,e){return function(t){return e(r(t))}}we.combineConsoleFeatures=rw;function nw(r,e){return function(t){return e(r(t))}}we.combineTelemetryFeatures=nw;function sw(r,e){return function(t){return e(r(t))}}we.combineTracerFeatures=sw;function iw(r,e){return function(t){return e(r(t))}}we.combineClientFeatures=iw;function ow(r,e){return function(t){return e(r(t))}}we.combineWindowFeatures=ow;function aw(r,e){return function(t){return e(r(t))}}we.combineWorkspaceFeatures=aw;function cw(r,e){return function(t){return e(r(t))}}we.combineLanguagesFeatures=cw;function lw(r,e){return function(t){return e(r(t))}}we.combineNotebooksFeatures=lw;function TM(r,e){function t(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:t(r.console,e.console,rw),tracer:t(r.tracer,e.tracer,sw),telemetry:t(r.telemetry,e.telemetry,nw),client:t(r.client,e.client,iw),window:t(r.window,e.window,ow),workspace:t(r.workspace,e.workspace,aw),languages:t(r.languages,e.languages,cw),notebooks:t(r.notebooks,e.notebooks,lw)}}we.combineFeatures=TM;function _M(r,e,t){let n=t&&t.console?new(t.console(Eu)):new Eu,s=r(n);n.rawAttach(s);let i=t&&t.tracer?new(t.tracer(Ru)):new Ru,o=t&&t.telemetry?new(t.telemetry(Cu)):new Cu,a=t&&t.client?new(t.client(Pu)):new Pu,c=t&&t.window?new(t.window(Jk)):new Jk,l=t&&t.workspace?new(t.workspace(Zk)):new Zk,u=t&&t.languages?new(t.languages(ew)):new ew,d=t&&t.notebooks?new(t.notebooks(tw)):new tw,f=[n,i,o,a,c,l,u,d];function p(T){return T instanceof Promise?T:Rr.thenable(T)?new Promise((v,R)=>{T.then(A=>v(A),A=>R(A))}):Promise.resolve(T)}let b,g,_,w={listen:()=>s.listen(),sendRequest:(T,...v)=>s.sendRequest(Rr.string(T)?T:T.method,...v),onRequest:(T,v)=>s.onRequest(T,v),sendNotification:(T,v)=>{let R=Rr.string(T)?T:T.method;return s.sendNotification(R,v)},onNotification:(T,v)=>s.onNotification(T,v),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:T=>(g=T,{dispose:()=>{g=void 0}}),onInitialized:T=>s.onNotification(U.InitializedNotification.type,T),onShutdown:T=>(b=T,{dispose:()=>{b=void 0}}),onExit:T=>(_=T,{dispose:()=>{_=void 0}}),get console(){return n},get telemetry(){return o},get tracer(){return i},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:T=>s.onNotification(U.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>s.onNotification(U.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>s.onNotification(U.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>s.onNotification(U.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>s.onNotification(U.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>s.onNotification(U.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>s.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>s.onNotification(U.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>s.sendNotification(U.PublishDiagnosticsNotification.type,T),onHover:T=>s.onRequest(U.HoverRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onCompletion:T=>s.onRequest(U.CompletionRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onCompletionResolve:T=>s.onRequest(U.CompletionResolveRequest.type,T),onSignatureHelp:T=>s.onRequest(U.SignatureHelpRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onDeclaration:T=>s.onRequest(U.DeclarationRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onDefinition:T=>s.onRequest(U.DefinitionRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onTypeDefinition:T=>s.onRequest(U.TypeDefinitionRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onImplementation:T=>s.onRequest(U.ImplementationRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onReferences:T=>s.onRequest(U.ReferencesRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onDocumentHighlight:T=>s.onRequest(U.DocumentHighlightRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onDocumentSymbol:T=>s.onRequest(U.DocumentSymbolRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onWorkspaceSymbol:T=>s.onRequest(U.WorkspaceSymbolRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onWorkspaceSymbolResolve:T=>s.onRequest(U.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>s.onRequest(U.CodeActionRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onCodeActionResolve:T=>s.onRequest(U.CodeActionResolveRequest.type,(v,R)=>T(v,R)),onCodeLens:T=>s.onRequest(U.CodeLensRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onCodeLensResolve:T=>s.onRequest(U.CodeLensResolveRequest.type,(v,R)=>T(v,R)),onDocumentFormatting:T=>s.onRequest(U.DocumentFormattingRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onDocumentRangeFormatting:T=>s.onRequest(U.DocumentRangeFormattingRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onDocumentOnTypeFormatting:T=>s.onRequest(U.DocumentOnTypeFormattingRequest.type,(v,R)=>T(v,R)),onRenameRequest:T=>s.onRequest(U.RenameRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onPrepareRename:T=>s.onRequest(U.PrepareRenameRequest.type,(v,R)=>T(v,R)),onDocumentLinks:T=>s.onRequest(U.DocumentLinkRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onDocumentLinkResolve:T=>s.onRequest(U.DocumentLinkResolveRequest.type,(v,R)=>T(v,R)),onDocumentColor:T=>s.onRequest(U.DocumentColorRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onColorPresentation:T=>s.onRequest(U.ColorPresentationRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onFoldingRanges:T=>s.onRequest(U.FoldingRangeRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onSelectionRanges:T=>s.onRequest(U.SelectionRangeRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onExecuteCommand:T=>s.onRequest(U.ExecuteCommandRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),dispose:()=>s.dispose()};for(let T of f)T.attach(w);return s.onRequest(U.InitializeRequest.type,T=>{e.initialize(T),Rr.string(T.trace)&&(i.trace=U.Trace.fromString(T.trace));for(let v of f)v.initialize(T.capabilities);if(g){let v=g(T,new U.CancellationTokenSource().token,(0,re.attachWorkDone)(s,T),void 0);return p(v).then(R=>{if(R instanceof U.ResponseError)return R;let A=R;A||(A={capabilities:{}});let L=A.capabilities;L||(L={},A.capabilities=L),L.textDocumentSync===void 0||L.textDocumentSync===null?L.textDocumentSync=Rr.number(w.__textDocumentSync)?w.__textDocumentSync:U.TextDocumentSyncKind.None:!Rr.number(L.textDocumentSync)&&!Rr.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=Rr.number(w.__textDocumentSync)?w.__textDocumentSync:U.TextDocumentSyncKind.None);for(let W of f)W.fillServerCapabilities(L);return A})}else{let v={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(v.capabilities);return v}}),s.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,b)return b(new U.CancellationTokenSource().token)}),s.onNotification(U.ExitNotification.type,()=>{try{_&&_()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),s.onNotification(U.SetTraceNotification.type,T=>{i.trace=U.Trace.fromString(T.value)}),w}we.createConnection=_M});var uw=k(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.resolveModulePath=lr.FileSystem=lr.resolveGlobalYarnPath=lr.resolveGlobalNodePath=lr.resolve=lr.uriToFilePath=void 0;var SM=require("url"),Kr=require("path"),fm=require("fs"),gm=require("child_process");function kM(r){let e=SM.parse(r);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var n=0,s=t.length;n<s;n++)t[n]=decodeURIComponent(t[n]);if(process.platform==="win32"&&t.length>1){let i=t[0],o=t[1];i.length===0&&o.length>1&&o[1]===":"&&t.shift()}return Kr.normalize(t.join("/"))}lr.uriToFilePath=kM;function hm(){return process.platform==="win32"}function Au(r,e,t,n){let s="NODE_PATH",i=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&fm.existsSync(e)&&(l[s]?l[s]=e+Kr.delimiter+l[s]:l[s]=e,n&&n(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,gm.fork)("",[],{cwd:t,env:l,execArgv:["-e",i]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${r} 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: ${r}`)))});let d={c:"rs",a:r};u.send(d)}catch(u){a(u)}})}lr.resolve=Au;function pm(r){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(i=>t[i]=process.env[i]),t.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:t};hm()&&(e="npm.cmd",n.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,gm.spawnSync)(e,["config","get","prefix"],n).stdout;if(!i){r&&r("'npm config get prefix' didn't return a value.");return}let o=i.trim();return r&&r(`'npm config get prefix' value is: ${o}`),o.length>0?hm()?Kr.join(o,"node_modules"):Kr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}lr.resolveGlobalNodePath=pm;function wM(r){let e="yarn",t={encoding:"utf8"};hm()&&(e="yarn.cmd",t.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let s=(0,gm.spawnSync)(e,["global","dir","--json"],t),i=s.stdout;if(!i){r&&(r("'yarn global dir' didn't return a value."),s.stderr&&r(s.stderr));return}let o=i.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return Kr.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}lr.resolveGlobalYarnPath=wM;var mm;(function(r){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!fm.existsSync(__filename.toUpperCase())||!fm.existsSync(__filename.toLowerCase())),e}r.isCaseSensitive=t;function n(s,i){return t()?Kr.normalize(i).indexOf(Kr.normalize(s))===0:Kr.normalize(i).toLowerCase().indexOf(Kr.normalize(s).toLowerCase())===0}r.isParent=n})(mm||(lr.FileSystem=mm={}));function EM(r,e,t,n){return t?(Kr.isAbsolute(t)||(t=Kr.join(r,t)),Au(e,t,t,n).then(s=>mm.isParent(t,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>Au(e,pm(n),r,n))):Au(e,pm(n),r,n)}lr.resolveModulePath=EM});var ym=k((Dz,dw)=>{"use strict";dw.exports=ut()});var fw=k(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.InlineCompletionFeature=void 0;var NM=ut(),PM=r=>class extends r{get inlineCompletion(){return{on:e=>this.connection.onRequest(NM.InlineCompletionRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t)))}}};Iu.InlineCompletionFeature=PM});var mw=k(Ht=>{"use strict";var RM=Ht&&Ht.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),pw=Ht&&Ht.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&RM(e,r,t)};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ProposedFeatures=Ht.NotebookDocuments=Ht.TextDocuments=Ht.SemanticTokensBuilder=void 0;var CM=Zp();Object.defineProperty(Ht,"SemanticTokensBuilder",{enumerable:!0,get:function(){return CM.SemanticTokensBuilder}});var DM=fw();pw(ut(),Ht);var OM=nm();Object.defineProperty(Ht,"TextDocuments",{enumerable:!0,get:function(){return OM.TextDocuments}});var AM=im();Object.defineProperty(Ht,"NotebookDocuments",{enumerable:!0,get:function(){return AM.NotebookDocuments}});pw(dm(),Ht);var hw;(function(r){r.all={__brand:"features",languages:DM.InlineCompletionFeature}})(hw||(Ht.ProposedFeatures=hw={}))});var J=k(Cr=>{"use strict";var IM=Cr&&Cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),bw=Cr&&Cr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&IM(e,r,t)};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.createConnection=Cr.Files=void 0;var gw=require("node:util"),vm=bl(),MM=dm(),Ta=uw(),Gs=ym();bw(ym(),Cr);bw(mw(),Cr);var yw;(function(r){r.uriToFilePath=Ta.uriToFilePath,r.resolveGlobalNodePath=Ta.resolveGlobalNodePath,r.resolveGlobalYarnPath=Ta.resolveGlobalYarnPath,r.resolve=Ta.resolve,r.resolveModulePath=Ta.resolveModulePath})(yw||(Cr.Files=yw={}));var vw;function Mu(){if(vw!==void 0)try{vw.end()}catch{}}var Qi=!1,Tw;function xM(){let r="--clientProcessId";function e(t){try{let n=parseInt(t);isNaN(n)||(Tw=setInterval(()=>{try{process.kill(n,0)}catch{Mu(),process.exit(Qi?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let n=process.argv[t];if(n===r&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let s=n.split("=");s[0]===r&&e(s[1])}}}xM();var LM={initialize:r=>{let e=r.processId;vm.number(e)&&Tw===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Qi?0:1)}},3e3)},get shutdownReceived(){return Qi},set shutdownReceived(r){Qi=r},exit:r=>{Mu(),process.exit(r)}};function $M(r,e,t,n){let s,i,o,a;return r!==void 0&&r.__brand==="features"&&(s=r,r=e,e=t,t=n),Gs.ConnectionStrategy.is(r)||Gs.ConnectionOptions.is(r)?a=r:(i=r,o=e,a=t),qM(i,o,a,s)}Cr.createConnection=$M;function qM(r,e,t,n){let s=!1;if(!r&&!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"){r=new Gs.IPCMessageReader(process),e=new Gs.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!0,r=process.stdin,e=process.stdout;break}else if(f==="--socket"){c=parseInt(u[d+1]);break}else if(f==="--pipe"){l=u[d+1];break}else{var i=f.split("=");if(i[0]==="--socket"){c=parseInt(i[1]);break}else if(i[0]==="--pipe"){l=i[1];break}}}if(c){let d=(0,Gs.createServerSocketTransport)(c);r=d[0],e=d[1]}else if(l){let d=(0,Gs.createServerPipeTransport)(l);r=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!r)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(vm.func(r.read)&&vm.func(r.on)){let c=r;c.on("end",()=>{Mu(),process.exit(Qi?0:1)}),c.on("close",()=>{Mu(),process.exit(Qi?0:1)})}let a=c=>{let l=(0,Gs.createProtocolConnection)(r,e,c,t);return s&&jM(c),l};return(0,MM.createConnection)(a,LM,n)}function jM(r){function e(n){return n.map(s=>typeof s=="string"?s:(0,gw.inspect)(s)).join(" ")}let t=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)r.error("Assertion failed");else{let[o,...a]=i;r.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(s="default"){let i=String(s),o=t.get(i)??0;o+=1,t.set(i,o),r.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?t.clear():t.delete(String(s))},console.debug=function(...s){r.log(e(s))},console.dir=function(s,i){r.log((0,gw.inspect)(s,i))},console.log=function(...s){r.log(e(s))},console.error=function(...s){r.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),r.log(`${o}
|
|
37
|
-
${i}`)},console.warn=function(...s){
|
|
38
|
-
`)}};
|
|
39
|
-
`)?
|
|
36
|
+
`&&h++}y&&P.length>0&&N.push(P.length),this._lineOffsets=N}return this._lineOffsets},m.prototype.positionAt=function(N){N=Math.max(Math.min(N,this._content.length),0);var P=this.getLineOffsets(),y=0,h=P.length;if(h===0)return o.create(0,N);for(;y<h;){var D=Math.floor((y+h)/2);P[D]>N?h=D:y=D+1}var x=y-1;return o.create(x,N-P[x])},m.prototype.offsetAt=function(N){var P=this.getLineOffsets();if(N.line>=P.length)return this._content.length;if(N.line<0)return 0;var y=P[N.line],h=N.line+1<P.length?P[N.line+1]:this._content.length;return Math.max(Math.min(y+N.character,h),y)},Object.defineProperty(m.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),m}(),O;(function(m){var N=Object.prototype.toString;function P(ye){return typeof ye<"u"}m.defined=P;function y(ye){return typeof ye>"u"}m.undefined=y;function h(ye){return ye===!0||ye===!1}m.boolean=h;function D(ye){return N.call(ye)==="[object String]"}m.string=D;function x(ye){return N.call(ye)==="[object Number]"}m.number=x;function oe(ye,ji,Ol){return N.call(ye)==="[object Number]"&&ji<=ye&&ye<=Ol}m.numberRange=oe;function ut(ye){return N.call(ye)==="[object Number]"&&-2147483648<=ye&&ye<=2147483647}m.integer=ut;function Ge(ye){return N.call(ye)==="[object Number]"&&0<=ye&&ye<=2147483647}m.uinteger=Ge;function Jn(ye){return N.call(ye)==="[object Function]"}m.func=Jn;function Xn(ye){return ye!==null&&typeof ye=="object"}m.objectLiteral=Xn;function Fr(ye,ji){return Array.isArray(ye)&&ye.every(ji)}m.typedArray=Fr})(O||(O={}))})});var ot=w(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.ProtocolNotificationType=un.ProtocolNotificationType0=un.ProtocolRequestType=un.ProtocolRequestType0=un.RegistrationType=un.MessageDirection=void 0;var Gi=Qs(),zT;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(zT||(un.MessageDirection=zT={}));var Wp=class{constructor(e){this.method=e}};un.RegistrationType=Wp;var Hp=class extends Gi.RequestType0{constructor(e){super(e)}};un.ProtocolRequestType0=Hp;var Kp=class extends Gi.RequestType{constructor(e){super(e,Gi.ParameterStructures.byName)}};un.ProtocolRequestType=Kp;var zp=class extends Gi.NotificationType0{constructor(e){super(e)}};un.ProtocolNotificationType0=zp;var Gp=class extends Gi.NotificationType{constructor(e){super(e,Gi.ParameterStructures.byName)}};un.ProtocolNotificationType=Gp});var nu=w(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.objectLiteral=bt.typedArray=bt.stringArray=bt.array=bt.func=bt.error=bt.number=bt.string=bt.boolean=void 0;function AI(n){return n===!0||n===!1}bt.boolean=AI;function GT(n){return typeof n=="string"||n instanceof String}bt.string=GT;function II(n){return typeof n=="number"||n instanceof Number}bt.number=II;function MI(n){return n instanceof Error}bt.error=MI;function xI(n){return typeof n=="function"}bt.func=xI;function YT(n){return Array.isArray(n)}bt.array=YT;function $I(n){return YT(n)&&n.every(e=>GT(e))}bt.stringArray=$I;function LI(n,e){return Array.isArray(n)&&n.every(e)}bt.typedArray=LI;function qI(n){return n!==null&&typeof n=="object"}bt.objectLiteral=qI});var QT=w(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.ImplementationRequest=void 0;var JT=ot(),XT;(function(n){n.method="textDocument/implementation",n.messageDirection=JT.MessageDirection.clientToServer,n.type=new JT.ProtocolRequestType(n.method)})(XT||(ru.ImplementationRequest=XT={}))});var tS=w(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.TypeDefinitionRequest=void 0;var ZT=ot(),eS;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=ZT.MessageDirection.clientToServer,n.type=new ZT.ProtocolRequestType(n.method)})(eS||(su.TypeDefinitionRequest=eS={}))});var sS=w(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.DidChangeWorkspaceFoldersNotification=Yi.WorkspaceFoldersRequest=void 0;var iu=ot(),nS;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=iu.MessageDirection.serverToClient,n.type=new iu.ProtocolRequestType0(n.method)})(nS||(Yi.WorkspaceFoldersRequest=nS={}));var rS;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=iu.MessageDirection.clientToServer,n.type=new iu.ProtocolNotificationType(n.method)})(rS||(Yi.DidChangeWorkspaceFoldersNotification=rS={}))});var aS=w(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.ConfigurationRequest=void 0;var iS=ot(),oS;(function(n){n.method="workspace/configuration",n.messageDirection=iS.MessageDirection.serverToClient,n.type=new iS.ProtocolRequestType(n.method)})(oS||(ou.ConfigurationRequest=oS={}))});var uS=w(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.ColorPresentationRequest=Ji.DocumentColorRequest=void 0;var au=ot(),cS;(function(n){n.method="textDocument/documentColor",n.messageDirection=au.MessageDirection.clientToServer,n.type=new au.ProtocolRequestType(n.method)})(cS||(Ji.DocumentColorRequest=cS={}));var lS;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=au.MessageDirection.clientToServer,n.type=new au.ProtocolRequestType(n.method)})(lS||(Ji.ColorPresentationRequest=lS={}))});var hS=w(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.FoldingRangeRefreshRequest=Xi.FoldingRangeRequest=void 0;var cu=ot(),dS;(function(n){n.method="textDocument/foldingRange",n.messageDirection=cu.MessageDirection.clientToServer,n.type=new cu.ProtocolRequestType(n.method)})(dS||(Xi.FoldingRangeRequest=dS={}));var fS;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=cu.MessageDirection.serverToClient,n.type=new cu.ProtocolRequestType0(n.method)})(fS||(Xi.FoldingRangeRefreshRequest=fS={}))});var gS=w(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.DeclarationRequest=void 0;var pS=ot(),mS;(function(n){n.method="textDocument/declaration",n.messageDirection=pS.MessageDirection.clientToServer,n.type=new pS.ProtocolRequestType(n.method)})(mS||(lu.DeclarationRequest=mS={}))});var bS=w(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.SelectionRangeRequest=void 0;var yS=ot(),vS;(function(n){n.method="textDocument/selectionRange",n.messageDirection=yS.MessageDirection.clientToServer,n.type=new yS.ProtocolRequestType(n.method)})(vS||(uu.SelectionRangeRequest=vS={}))});var wS=w(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.WorkDoneProgressCancelNotification=as.WorkDoneProgressCreateRequest=as.WorkDoneProgress=void 0;var jI=Qs(),du=ot(),TS;(function(n){n.type=new jI.ProgressType;function e(t){return t===n.type}n.is=e})(TS||(as.WorkDoneProgress=TS={}));var SS;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=du.MessageDirection.serverToClient,n.type=new du.ProtocolRequestType(n.method)})(SS||(as.WorkDoneProgressCreateRequest=SS={}));var _S;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=du.MessageDirection.clientToServer,n.type=new du.ProtocolNotificationType(n.method)})(_S||(as.WorkDoneProgressCancelNotification=_S={}))});var PS=w(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.CallHierarchyOutgoingCallsRequest=cs.CallHierarchyIncomingCallsRequest=cs.CallHierarchyPrepareRequest=void 0;var Qi=ot(),ES;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=Qi.MessageDirection.clientToServer,n.type=new Qi.ProtocolRequestType(n.method)})(ES||(cs.CallHierarchyPrepareRequest=ES={}));var kS;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=Qi.MessageDirection.clientToServer,n.type=new Qi.ProtocolRequestType(n.method)})(kS||(cs.CallHierarchyIncomingCallsRequest=kS={}));var NS;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=Qi.MessageDirection.clientToServer,n.type=new Qi.ProtocolRequestType(n.method)})(NS||(cs.CallHierarchyOutgoingCallsRequest=NS={}))});var IS=w(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.SemanticTokensRefreshRequest=dn.SemanticTokensRangeRequest=dn.SemanticTokensDeltaRequest=dn.SemanticTokensRequest=dn.SemanticTokensRegistrationType=dn.TokenFormat=void 0;var Ur=ot(),RS;(function(n){n.Relative="relative"})(RS||(dn.TokenFormat=RS={}));var Sa;(function(n){n.method="textDocument/semanticTokens",n.type=new Ur.RegistrationType(n.method)})(Sa||(dn.SemanticTokensRegistrationType=Sa={}));var CS;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=Ur.MessageDirection.clientToServer,n.type=new Ur.ProtocolRequestType(n.method),n.registrationMethod=Sa.method})(CS||(dn.SemanticTokensRequest=CS={}));var DS;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=Ur.MessageDirection.clientToServer,n.type=new Ur.ProtocolRequestType(n.method),n.registrationMethod=Sa.method})(DS||(dn.SemanticTokensDeltaRequest=DS={}));var OS;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=Ur.MessageDirection.clientToServer,n.type=new Ur.ProtocolRequestType(n.method),n.registrationMethod=Sa.method})(OS||(dn.SemanticTokensRangeRequest=OS={}));var AS;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=Ur.MessageDirection.serverToClient,n.type=new Ur.ProtocolRequestType0(n.method)})(AS||(dn.SemanticTokensRefreshRequest=AS={}))});var $S=w(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.ShowDocumentRequest=void 0;var MS=ot(),xS;(function(n){n.method="window/showDocument",n.messageDirection=MS.MessageDirection.serverToClient,n.type=new MS.ProtocolRequestType(n.method)})(xS||(fu.ShowDocumentRequest=xS={}))});var jS=w(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.LinkedEditingRangeRequest=void 0;var LS=ot(),qS;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=LS.MessageDirection.clientToServer,n.type=new LS.ProtocolRequestType(n.method)})(qS||(hu.LinkedEditingRangeRequest=qS={}))});var zS=w(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.WillDeleteFilesRequest=Kt.DidDeleteFilesNotification=Kt.DidRenameFilesNotification=Kt.WillRenameFilesRequest=Kt.DidCreateFilesNotification=Kt.WillCreateFilesRequest=Kt.FileOperationPatternKind=void 0;var Dn=ot(),FS;(function(n){n.file="file",n.folder="folder"})(FS||(Kt.FileOperationPatternKind=FS={}));var BS;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=Dn.MessageDirection.clientToServer,n.type=new Dn.ProtocolRequestType(n.method)})(BS||(Kt.WillCreateFilesRequest=BS={}));var US;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=Dn.MessageDirection.clientToServer,n.type=new Dn.ProtocolNotificationType(n.method)})(US||(Kt.DidCreateFilesNotification=US={}));var VS;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=Dn.MessageDirection.clientToServer,n.type=new Dn.ProtocolRequestType(n.method)})(VS||(Kt.WillRenameFilesRequest=VS={}));var WS;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=Dn.MessageDirection.clientToServer,n.type=new Dn.ProtocolNotificationType(n.method)})(WS||(Kt.DidRenameFilesNotification=WS={}));var HS;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=Dn.MessageDirection.clientToServer,n.type=new Dn.ProtocolNotificationType(n.method)})(HS||(Kt.DidDeleteFilesNotification=HS={}));var KS;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=Dn.MessageDirection.clientToServer,n.type=new Dn.ProtocolRequestType(n.method)})(KS||(Kt.WillDeleteFilesRequest=KS={}))});var QS=w(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.MonikerRequest=ls.MonikerKind=ls.UniquenessLevel=void 0;var GS=ot(),YS;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(YS||(ls.UniquenessLevel=YS={}));var JS;(function(n){n.$import="import",n.$export="export",n.local="local"})(JS||(ls.MonikerKind=JS={}));var XS;(function(n){n.method="textDocument/moniker",n.messageDirection=GS.MessageDirection.clientToServer,n.type=new GS.ProtocolRequestType(n.method)})(XS||(ls.MonikerRequest=XS={}))});var n_=w(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.TypeHierarchySubtypesRequest=us.TypeHierarchySupertypesRequest=us.TypeHierarchyPrepareRequest=void 0;var Zi=ot(),ZS;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Zi.MessageDirection.clientToServer,n.type=new Zi.ProtocolRequestType(n.method)})(ZS||(us.TypeHierarchyPrepareRequest=ZS={}));var e_;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Zi.MessageDirection.clientToServer,n.type=new Zi.ProtocolRequestType(n.method)})(e_||(us.TypeHierarchySupertypesRequest=e_={}));var t_;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Zi.MessageDirection.clientToServer,n.type=new Zi.ProtocolRequestType(n.method)})(t_||(us.TypeHierarchySubtypesRequest=t_={}))});var i_=w(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.InlineValueRefreshRequest=eo.InlineValueRequest=void 0;var pu=ot(),r_;(function(n){n.method="textDocument/inlineValue",n.messageDirection=pu.MessageDirection.clientToServer,n.type=new pu.ProtocolRequestType(n.method)})(r_||(eo.InlineValueRequest=r_={}));var s_;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=pu.MessageDirection.serverToClient,n.type=new pu.ProtocolRequestType0(n.method)})(s_||(eo.InlineValueRefreshRequest=s_={}))});var l_=w(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.InlayHintRefreshRequest=ds.InlayHintResolveRequest=ds.InlayHintRequest=void 0;var to=ot(),o_;(function(n){n.method="textDocument/inlayHint",n.messageDirection=to.MessageDirection.clientToServer,n.type=new to.ProtocolRequestType(n.method)})(o_||(ds.InlayHintRequest=o_={}));var a_;(function(n){n.method="inlayHint/resolve",n.messageDirection=to.MessageDirection.clientToServer,n.type=new to.ProtocolRequestType(n.method)})(a_||(ds.InlayHintResolveRequest=a_={}));var c_;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=to.MessageDirection.serverToClient,n.type=new to.ProtocolRequestType0(n.method)})(c_||(ds.InlayHintRefreshRequest=c_={}))});var g_=w(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.DiagnosticRefreshRequest=On.WorkspaceDiagnosticRequest=On.DocumentDiagnosticRequest=On.DocumentDiagnosticReportKind=On.DiagnosticServerCancellationData=void 0;var m_=Qs(),FI=nu(),no=ot(),u_;(function(n){function e(t){let r=t;return r&&FI.boolean(r.retriggerRequest)}n.is=e})(u_||(On.DiagnosticServerCancellationData=u_={}));var d_;(function(n){n.Full="full",n.Unchanged="unchanged"})(d_||(On.DocumentDiagnosticReportKind=d_={}));var f_;(function(n){n.method="textDocument/diagnostic",n.messageDirection=no.MessageDirection.clientToServer,n.type=new no.ProtocolRequestType(n.method),n.partialResult=new m_.ProgressType})(f_||(On.DocumentDiagnosticRequest=f_={}));var h_;(function(n){n.method="workspace/diagnostic",n.messageDirection=no.MessageDirection.clientToServer,n.type=new no.ProtocolRequestType(n.method),n.partialResult=new m_.ProgressType})(h_||(On.WorkspaceDiagnosticRequest=h_={}));var p_;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=no.MessageDirection.serverToClient,n.type=new no.ProtocolRequestType0(n.method)})(p_||(On.DiagnosticRefreshRequest=p_={}))});var w_=w(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.DidCloseNotebookDocumentNotification=dt.DidSaveNotebookDocumentNotification=dt.DidChangeNotebookDocumentNotification=dt.NotebookCellArrayChange=dt.DidOpenNotebookDocumentNotification=dt.NotebookDocumentSyncRegistrationType=dt.NotebookDocument=dt.NotebookCell=dt.ExecutionSummary=dt.NotebookCellKind=void 0;var _a=tu(),Zn=nu(),gr=ot(),Yp;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(Yp||(dt.NotebookCellKind=Yp={}));var Jp;(function(n){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}n.create=e;function t(s){let i=s;return Zn.objectLiteral(i)&&_a.uinteger.is(i.executionOrder)&&(i.success===void 0||Zn.boolean(i.success))}n.is=t;function r(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}n.equals=r})(Jp||(dt.ExecutionSummary=Jp={}));var mu;(function(n){function e(i,o){return{kind:i,document:o}}n.create=e;function t(i){let o=i;return Zn.objectLiteral(o)&&Yp.is(o.kind)&&_a.DocumentUri.is(o.document)&&(o.metadata===void 0||Zn.objectLiteral(o.metadata))}n.is=t;function r(i,o){let a=new Set;return i.document!==o.document&&a.add("document"),i.kind!==o.kind&&a.add("kind"),i.executionSummary!==o.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||o.metadata!==void 0)&&!s(i.metadata,o.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||o.executionSummary!==void 0)&&!Jp.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.diff=r;function s(i,o){if(i===o)return!0;if(i==null||o===null||o===void 0||typeof i!=typeof o||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(i.length!==o.length)return!1;for(let l=0;l<i.length;l++)if(!s(i[l],o[l]))return!1}if(Zn.objectLiteral(i)&&Zn.objectLiteral(o)){let l=Object.keys(i),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!s(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!s(i[f],o[f]))return!1}}return!0}})(mu||(dt.NotebookCell=mu={}));var y_;(function(n){function e(r,s,i,o){return{uri:r,notebookType:s,version:i,cells:o}}n.create=e;function t(r){let s=r;return Zn.objectLiteral(s)&&Zn.string(s.uri)&&_a.integer.is(s.version)&&Zn.typedArray(s.cells,mu.is)}n.is=t})(y_||(dt.NotebookDocument=y_={}));var ro;(function(n){n.method="notebookDocument/sync",n.messageDirection=gr.MessageDirection.clientToServer,n.type=new gr.RegistrationType(n.method)})(ro||(dt.NotebookDocumentSyncRegistrationType=ro={}));var v_;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=gr.MessageDirection.clientToServer,n.type=new gr.ProtocolNotificationType(n.method),n.registrationMethod=ro.method})(v_||(dt.DidOpenNotebookDocumentNotification=v_={}));var b_;(function(n){function e(r){let s=r;return Zn.objectLiteral(s)&&_a.uinteger.is(s.start)&&_a.uinteger.is(s.deleteCount)&&(s.cells===void 0||Zn.typedArray(s.cells,mu.is))}n.is=e;function t(r,s,i){let o={start:r,deleteCount:s};return i!==void 0&&(o.cells=i),o}n.create=t})(b_||(dt.NotebookCellArrayChange=b_={}));var T_;(function(n){n.method="notebookDocument/didChange",n.messageDirection=gr.MessageDirection.clientToServer,n.type=new gr.ProtocolNotificationType(n.method),n.registrationMethod=ro.method})(T_||(dt.DidChangeNotebookDocumentNotification=T_={}));var S_;(function(n){n.method="notebookDocument/didSave",n.messageDirection=gr.MessageDirection.clientToServer,n.type=new gr.ProtocolNotificationType(n.method),n.registrationMethod=ro.method})(S_||(dt.DidSaveNotebookDocumentNotification=S_={}));var __;(function(n){n.method="notebookDocument/didClose",n.messageDirection=gr.MessageDirection.clientToServer,n.type=new gr.ProtocolNotificationType(n.method),n.registrationMethod=ro.method})(__||(dt.DidCloseNotebookDocumentNotification=__={}))});var N_=w(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.InlineCompletionRequest=void 0;var E_=ot(),k_;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=E_.MessageDirection.clientToServer,n.type=new E_.ProtocolRequestType(n.method)})(k_||(gu.InlineCompletionRequest=k_={}))});var jw=w(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.WorkspaceSymbolRequest=_.CodeActionResolveRequest=_.CodeActionRequest=_.DocumentSymbolRequest=_.DocumentHighlightRequest=_.ReferencesRequest=_.DefinitionRequest=_.SignatureHelpRequest=_.SignatureHelpTriggerKind=_.HoverRequest=_.CompletionResolveRequest=_.CompletionRequest=_.CompletionTriggerKind=_.PublishDiagnosticsNotification=_.WatchKind=_.RelativePattern=_.FileChangeType=_.DidChangeWatchedFilesNotification=_.WillSaveTextDocumentWaitUntilRequest=_.WillSaveTextDocumentNotification=_.TextDocumentSaveReason=_.DidSaveTextDocumentNotification=_.DidCloseTextDocumentNotification=_.DidChangeTextDocumentNotification=_.TextDocumentContentChangeEvent=_.DidOpenTextDocumentNotification=_.TextDocumentSyncKind=_.TelemetryEventNotification=_.LogMessageNotification=_.ShowMessageRequest=_.ShowMessageNotification=_.MessageType=_.DidChangeConfigurationNotification=_.ExitNotification=_.ShutdownRequest=_.InitializedNotification=_.InitializeErrorCodes=_.InitializeRequest=_.WorkDoneProgressOptions=_.TextDocumentRegistrationOptions=_.StaticRegistrationOptions=_.PositionEncodingKind=_.FailureHandlingKind=_.ResourceOperationKind=_.UnregistrationRequest=_.RegistrationRequest=_.DocumentSelector=_.NotebookCellTextDocumentFilter=_.NotebookDocumentFilter=_.TextDocumentFilter=void 0;_.MonikerRequest=_.MonikerKind=_.UniquenessLevel=_.WillDeleteFilesRequest=_.DidDeleteFilesNotification=_.WillRenameFilesRequest=_.DidRenameFilesNotification=_.WillCreateFilesRequest=_.DidCreateFilesNotification=_.FileOperationPatternKind=_.LinkedEditingRangeRequest=_.ShowDocumentRequest=_.SemanticTokensRegistrationType=_.SemanticTokensRefreshRequest=_.SemanticTokensRangeRequest=_.SemanticTokensDeltaRequest=_.SemanticTokensRequest=_.TokenFormat=_.CallHierarchyPrepareRequest=_.CallHierarchyOutgoingCallsRequest=_.CallHierarchyIncomingCallsRequest=_.WorkDoneProgressCancelNotification=_.WorkDoneProgressCreateRequest=_.WorkDoneProgress=_.SelectionRangeRequest=_.DeclarationRequest=_.FoldingRangeRefreshRequest=_.FoldingRangeRequest=_.ColorPresentationRequest=_.DocumentColorRequest=_.ConfigurationRequest=_.DidChangeWorkspaceFoldersNotification=_.WorkspaceFoldersRequest=_.TypeDefinitionRequest=_.ImplementationRequest=_.ApplyWorkspaceEditRequest=_.ExecuteCommandRequest=_.PrepareRenameRequest=_.RenameRequest=_.PrepareSupportDefaultBehavior=_.DocumentOnTypeFormattingRequest=_.DocumentRangesFormattingRequest=_.DocumentRangeFormattingRequest=_.DocumentFormattingRequest=_.DocumentLinkResolveRequest=_.DocumentLinkRequest=_.CodeLensRefreshRequest=_.CodeLensResolveRequest=_.CodeLensRequest=_.WorkspaceSymbolResolveRequest=void 0;_.InlineCompletionRequest=_.DidCloseNotebookDocumentNotification=_.DidSaveNotebookDocumentNotification=_.DidChangeNotebookDocumentNotification=_.NotebookCellArrayChange=_.DidOpenNotebookDocumentNotification=_.NotebookDocumentSyncRegistrationType=_.NotebookDocument=_.NotebookCell=_.ExecutionSummary=_.NotebookCellKind=_.DiagnosticRefreshRequest=_.WorkspaceDiagnosticRequest=_.DocumentDiagnosticRequest=_.DocumentDiagnosticReportKind=_.DiagnosticServerCancellationData=_.InlayHintRefreshRequest=_.InlayHintResolveRequest=_.InlayHintRequest=_.InlineValueRefreshRequest=_.InlineValueRequest=_.TypeHierarchySupertypesRequest=_.TypeHierarchySubtypesRequest=_.TypeHierarchyPrepareRequest=void 0;var q=ot(),P_=tu(),Ot=nu(),BI=QT();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return BI.ImplementationRequest}});var UI=tS();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return UI.TypeDefinitionRequest}});var xw=sS();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return xw.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return xw.DidChangeWorkspaceFoldersNotification}});var VI=aS();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return VI.ConfigurationRequest}});var $w=uS();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return $w.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return $w.ColorPresentationRequest}});var Lw=hS();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return Lw.FoldingRangeRequest}});Object.defineProperty(_,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Lw.FoldingRangeRefreshRequest}});var WI=gS();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return WI.DeclarationRequest}});var HI=bS();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return HI.SelectionRangeRequest}});var tm=wS();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return tm.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return tm.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return tm.WorkDoneProgressCancelNotification}});var nm=PS();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return nm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return nm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return nm.CallHierarchyPrepareRequest}});var so=IS();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return so.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return so.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return so.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return so.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return so.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return so.SemanticTokensRegistrationType}});var KI=$S();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return KI.ShowDocumentRequest}});var zI=jS();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return zI.LinkedEditingRangeRequest}});var Zs=zS();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return Zs.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Zs.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Zs.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Zs.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Zs.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Zs.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Zs.WillDeleteFilesRequest}});var rm=QS();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return rm.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return rm.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return rm.MonikerRequest}});var sm=n_();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return sm.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return sm.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return sm.TypeHierarchySupertypesRequest}});var qw=i_();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return qw.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return qw.InlineValueRefreshRequest}});var im=l_();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return im.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return im.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return im.InlayHintRefreshRequest}});var wa=g_();Object.defineProperty(_,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return wa.DiagnosticServerCancellationData}});Object.defineProperty(_,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return wa.DocumentDiagnosticReportKind}});Object.defineProperty(_,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return wa.DocumentDiagnosticRequest}});Object.defineProperty(_,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return wa.WorkspaceDiagnosticRequest}});Object.defineProperty(_,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return wa.DiagnosticRefreshRequest}});var yr=w_();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return yr.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return yr.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return yr.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return yr.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return yr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return yr.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return yr.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return yr.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return yr.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return yr.DidCloseNotebookDocumentNotification}});var GI=N_();Object.defineProperty(_,"InlineCompletionRequest",{enumerable:!0,get:function(){return GI.InlineCompletionRequest}});var Xp;(function(n){function e(t){let r=t;return Ot.string(r)||Ot.string(r.language)||Ot.string(r.scheme)||Ot.string(r.pattern)}n.is=e})(Xp||(_.TextDocumentFilter=Xp={}));var Qp;(function(n){function e(t){let r=t;return Ot.objectLiteral(r)&&(Ot.string(r.notebookType)||Ot.string(r.scheme)||Ot.string(r.pattern))}n.is=e})(Qp||(_.NotebookDocumentFilter=Qp={}));var Zp;(function(n){function e(t){let r=t;return Ot.objectLiteral(r)&&(Ot.string(r.notebook)||Qp.is(r.notebook))&&(r.language===void 0||Ot.string(r.language))}n.is=e})(Zp||(_.NotebookCellTextDocumentFilter=Zp={}));var em;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let r of t)if(!Ot.string(r)&&!Xp.is(r)&&!Zp.is(r))return!1;return!0}n.is=e})(em||(_.DocumentSelector=em={}));var R_;(function(n){n.method="client/registerCapability",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(R_||(_.RegistrationRequest=R_={}));var C_;(function(n){n.method="client/unregisterCapability",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(C_||(_.UnregistrationRequest=C_={}));var D_;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(D_||(_.ResourceOperationKind=D_={}));var O_;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(O_||(_.FailureHandlingKind=O_={}));var A_;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(A_||(_.PositionEncodingKind=A_={}));var I_;(function(n){function e(t){let r=t;return r&&Ot.string(r.id)&&r.id.length>0}n.hasId=e})(I_||(_.StaticRegistrationOptions=I_={}));var M_;(function(n){function e(t){let r=t;return r&&(r.documentSelector===null||em.is(r.documentSelector))}n.is=e})(M_||(_.TextDocumentRegistrationOptions=M_={}));var x_;(function(n){function e(r){let s=r;return Ot.objectLiteral(s)&&(s.workDoneProgress===void 0||Ot.boolean(s.workDoneProgress))}n.is=e;function t(r){let s=r;return s&&Ot.boolean(s.workDoneProgress)}n.hasWorkDoneProgress=t})(x_||(_.WorkDoneProgressOptions=x_={}));var $_;(function(n){n.method="initialize",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})($_||(_.InitializeRequest=$_={}));var L_;(function(n){n.unknownProtocolVersion=1})(L_||(_.InitializeErrorCodes=L_={}));var q_;(function(n){n.method="initialized",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(q_||(_.InitializedNotification=q_={}));var j_;(function(n){n.method="shutdown",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType0(n.method)})(j_||(_.ShutdownRequest=j_={}));var F_;(function(n){n.method="exit",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType0(n.method)})(F_||(_.ExitNotification=F_={}));var B_;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(B_||(_.DidChangeConfigurationNotification=B_={}));var U_;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(U_||(_.MessageType=U_={}));var V_;(function(n){n.method="window/showMessage",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(V_||(_.ShowMessageNotification=V_={}));var W_;(function(n){n.method="window/showMessageRequest",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(W_||(_.ShowMessageRequest=W_={}));var H_;(function(n){n.method="window/logMessage",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(H_||(_.LogMessageNotification=H_={}));var K_;(function(n){n.method="telemetry/event",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(K_||(_.TelemetryEventNotification=K_={}));var z_;(function(n){n.None=0,n.Full=1,n.Incremental=2})(z_||(_.TextDocumentSyncKind=z_={}));var G_;(function(n){n.method="textDocument/didOpen",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(G_||(_.DidOpenTextDocumentNotification=G_={}));var Y_;(function(n){function e(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range!==void 0&&(s.rangeLength===void 0||typeof s.rangeLength=="number")}n.isIncremental=e;function t(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}n.isFull=t})(Y_||(_.TextDocumentContentChangeEvent=Y_={}));var J_;(function(n){n.method="textDocument/didChange",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(J_||(_.DidChangeTextDocumentNotification=J_={}));var X_;(function(n){n.method="textDocument/didClose",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(X_||(_.DidCloseTextDocumentNotification=X_={}));var Q_;(function(n){n.method="textDocument/didSave",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(Q_||(_.DidSaveTextDocumentNotification=Q_={}));var Z_;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(Z_||(_.TextDocumentSaveReason=Z_={}));var ew;(function(n){n.method="textDocument/willSave",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(ew||(_.WillSaveTextDocumentNotification=ew={}));var tw;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(tw||(_.WillSaveTextDocumentWaitUntilRequest=tw={}));var nw;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(nw||(_.DidChangeWatchedFilesNotification=nw={}));var rw;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(rw||(_.FileChangeType=rw={}));var sw;(function(n){function e(t){let r=t;return Ot.objectLiteral(r)&&(P_.URI.is(r.baseUri)||P_.WorkspaceFolder.is(r.baseUri))&&Ot.string(r.pattern)}n.is=e})(sw||(_.RelativePattern=sw={}));var iw;(function(n){n.Create=1,n.Change=2,n.Delete=4})(iw||(_.WatchKind=iw={}));var ow;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(ow||(_.PublishDiagnosticsNotification=ow={}));var aw;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(aw||(_.CompletionTriggerKind=aw={}));var cw;(function(n){n.method="textDocument/completion",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(cw||(_.CompletionRequest=cw={}));var lw;(function(n){n.method="completionItem/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(lw||(_.CompletionResolveRequest=lw={}));var uw;(function(n){n.method="textDocument/hover",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(uw||(_.HoverRequest=uw={}));var dw;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(dw||(_.SignatureHelpTriggerKind=dw={}));var fw;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(fw||(_.SignatureHelpRequest=fw={}));var hw;(function(n){n.method="textDocument/definition",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(hw||(_.DefinitionRequest=hw={}));var pw;(function(n){n.method="textDocument/references",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(pw||(_.ReferencesRequest=pw={}));var mw;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(mw||(_.DocumentHighlightRequest=mw={}));var gw;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(gw||(_.DocumentSymbolRequest=gw={}));var yw;(function(n){n.method="textDocument/codeAction",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(yw||(_.CodeActionRequest=yw={}));var vw;(function(n){n.method="codeAction/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(vw||(_.CodeActionResolveRequest=vw={}));var bw;(function(n){n.method="workspace/symbol",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(bw||(_.WorkspaceSymbolRequest=bw={}));var Tw;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Tw||(_.WorkspaceSymbolResolveRequest=Tw={}));var Sw;(function(n){n.method="textDocument/codeLens",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Sw||(_.CodeLensRequest=Sw={}));var _w;(function(n){n.method="codeLens/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(_w||(_.CodeLensResolveRequest=_w={}));var ww;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType0(n.method)})(ww||(_.CodeLensRefreshRequest=ww={}));var Ew;(function(n){n.method="textDocument/documentLink",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Ew||(_.DocumentLinkRequest=Ew={}));var kw;(function(n){n.method="documentLink/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(kw||(_.DocumentLinkResolveRequest=kw={}));var Nw;(function(n){n.method="textDocument/formatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Nw||(_.DocumentFormattingRequest=Nw={}));var Pw;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Pw||(_.DocumentRangeFormattingRequest=Pw={}));var Rw;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Rw||(_.DocumentRangesFormattingRequest=Rw={}));var Cw;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Cw||(_.DocumentOnTypeFormattingRequest=Cw={}));var Dw;(function(n){n.Identifier=1})(Dw||(_.PrepareSupportDefaultBehavior=Dw={}));var Ow;(function(n){n.method="textDocument/rename",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Ow||(_.RenameRequest=Ow={}));var Aw;(function(n){n.method="textDocument/prepareRename",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Aw||(_.PrepareRenameRequest=Aw={}));var Iw;(function(n){n.method="workspace/executeCommand",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Iw||(_.ExecuteCommandRequest=Iw={}));var Mw;(function(n){n.method="workspace/applyEdit",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType("workspace/applyEdit")})(Mw||(_.ApplyWorkspaceEditRequest=Mw={}))});var Bw=w(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.createProtocolConnection=void 0;var Fw=Qs();function YI(n,e,t,r){return Fw.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Fw.createMessageConnection)(n,e,t,r)}yu.createProtocolConnection=YI});var Vw=w(fn=>{"use strict";var JI=fn&&fn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),vu=fn&&fn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&JI(e,n,t)};Object.defineProperty(fn,"__esModule",{value:!0});fn.LSPErrorCodes=fn.createProtocolConnection=void 0;vu(Qs(),fn);vu(tu(),fn);vu(ot(),fn);vu(jw(),fn);var XI=Bw();Object.defineProperty(fn,"createProtocolConnection",{enumerable:!0,get:function(){return XI.createProtocolConnection}});var Uw;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(Uw||(fn.LSPErrorCodes=Uw={}))});var ht=w(vr=>{"use strict";var QI=vr&&vr.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Ww=vr&&vr.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&QI(e,n,t)};Object.defineProperty(vr,"__esModule",{value:!0});vr.createProtocolConnection=void 0;var ZI=Vp();Ww(Vp(),vr);Ww(Vw(),vr);function eM(n,e,t,r){return(0,ZI.createMessageConnection)(n,e,t,r)}vr.createProtocolConnection=eM});var om=w(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.generateUuid=An.parse=An.isUUID=An.v4=An.empty=void 0;var Ea=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ka=class n extends Ea{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return n._oneOf(n._chars)}constructor(){super([n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-","4",n._randomHex(),n._randomHex(),n._randomHex(),"-",n._oneOf(n._timeHighBits),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex()].join(""))}};ka._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ka._timeHighBits=["8","9","a","b"];An.empty=new Ea("00000000-0000-0000-0000-000000000000");function Hw(){return new ka}An.v4=Hw;var tM=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Kw(n){return tM.test(n)}An.isUUID=Kw;function nM(n){if(!Kw(n))throw new Error("invalid uuid");return new Ea(n)}An.parse=nM;function rM(){return Hw().asHex()}An.generateUuid=rM});var zw=w(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.attachPartialResult=hs.ProgressFeature=hs.attachWorkDone=void 0;var fs=ht(),sM=om(),ei=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,r,s){let i={kind:"begin",title:e,percentage:t,message:r,cancellable:s};this._connection.sendProgress(fs.WorkDoneProgress.type,this._token,i)}report(e,t){let r={kind:"report"};typeof e=="number"?(r.percentage=e,t!==void 0&&(r.message=t)):r.message=e,this._connection.sendProgress(fs.WorkDoneProgress.type,this._token,r)}done(){n.Instances.delete(this._token),this._connection.sendProgress(fs.WorkDoneProgress.type,this._token,{kind:"end"})}};ei.Instances=new Map;var bu=class extends ei{constructor(e,t){super(e,t),this._source=new fs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Na=class{constructor(){}begin(){}report(){}done(){}},Tu=class extends Na{constructor(){super(),this._source=new fs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function iM(n,e){if(e===void 0||e.workDoneToken===void 0)return new Na;let t=e.workDoneToken;return delete e.workDoneToken,new ei(n,t)}hs.attachWorkDone=iM;var oM=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(fs.WorkDoneProgressCancelNotification.type,t=>{let r=ei.Instances.get(t.token);(r instanceof bu||r instanceof Tu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Na:new ei(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,sM.generateUuid)();return this.connection.sendRequest(fs.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new bu(this.connection,e))}else return Promise.resolve(new Tu)}};hs.ProgressFeature=oM;var am;(function(n){n.type=new fs.ProgressType})(am||(am={}));var cm=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(am.type,this._token,e)}};function aM(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new cm(n,t)}hs.attachPartialResult=aM});var Gw=w(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.ConfigurationFeature=void 0;var cM=ht(),lM=Al(),uM=n=>class extends n{getConfiguration(e){return e?lM.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(cM.ConfigurationRequest.type,t).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Su.ConfigurationFeature=uM});var Yw=w(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.WorkspaceFoldersFeature=void 0;var _u=ht(),dM=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new _u.Emitter,this.connection.onNotification(_u.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(_u.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(_u.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};wu.WorkspaceFoldersFeature=dM});var Jw=w(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.CallHierarchyFeature=void 0;var lm=ht(),fM=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(lm.CallHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=lm.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onOutgoingCalls:e=>{let t=lm.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Eu.CallHierarchyFeature=fM});var dm=w(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.SemanticTokensBuilder=ps.SemanticTokensDiff=ps.SemanticTokensFeature=void 0;var ku=ht(),hM=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(ku.SemanticTokensRefreshRequest.type),on:e=>{let t=ku.SemanticTokensRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onDelta:e=>{let t=ku.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onRange:e=>{let t=ku.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};ps.SemanticTokensFeature=hM;var Nu=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,r=0;for(;r<t&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<t&&r<e){let s=e-1,i=t-1;for(;s>=r&&i>=r&&this.originalSequence[s]===this.modifiedSequence[i];)s--,i--;(s<r||i<r)&&(s++,i++);let o=s-r+1,a=this.modifiedSequence.slice(r,i+1);return a.length===1&&a[0]===this.originalSequence[s]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<t?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};ps.SemanticTokensDiff=Nu;var um=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,r,s,i){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Nu(this._prevData,this._data).computeDiff()}:this.build()}};ps.SemanticTokensBuilder=um});var Xw=w(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.ShowDocumentFeature=void 0;var pM=ht(),mM=n=>class extends n{showDocument(e){return this.connection.sendRequest(pM.ShowDocumentRequest.type,e)}};Pu.ShowDocumentFeature=mM});var Qw=w(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.FileOperationsFeature=void 0;var io=ht(),gM=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(io.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(io.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(io.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(io.WillCreateFilesRequest.type,(t,r)=>e(t,r))}onWillRenameFiles(e){return this.connection.onRequest(io.WillRenameFilesRequest.type,(t,r)=>e(t,r))}onWillDeleteFiles(e){return this.connection.onRequest(io.WillDeleteFilesRequest.type,(t,r)=>e(t,r))}};Ru.FileOperationsFeature=gM});var Zw=w(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.LinkedEditingRangeFeature=void 0;var yM=ht(),vM=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(yM.LinkedEditingRangeRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0))}};Cu.LinkedEditingRangeFeature=vM});var eE=w(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.TypeHierarchyFeature=void 0;var fm=ht(),bM=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(fm.TypeHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=fm.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onSubtypes:e=>{let t=fm.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Du.TypeHierarchyFeature=bM});var nE=w(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.InlineValueFeature=void 0;var tE=ht(),TM=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(tE.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(tE.InlineValueRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};Ou.InlineValueFeature=TM});var sE=w(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.FoldingRangeFeature=void 0;var rE=ht(),SM=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(rE.FoldingRangeRefreshRequest.type),on:e=>{let t=rE.FoldingRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Au.FoldingRangeFeature=SM});var iE=w(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.InlayHintFeature=void 0;var hm=ht(),_M=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(hm.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(hm.InlayHintRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(hm.InlayHintResolveRequest.type,(t,r)=>e(t,r))}}};Iu.InlayHintFeature=_M});var oE=w(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.DiagnosticFeature=void 0;var Pa=ht(),wM=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Pa.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Pa.DocumentDiagnosticRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Pa.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(Pa.WorkspaceDiagnosticRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Pa.WorkspaceDiagnosticRequest.partialResult,t)))}}};Mu.DiagnosticFeature=wM});var mm=w(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.TextDocuments=void 0;var ti=ht(),pm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ti.Emitter,this._onDidOpen=new ti.Emitter,this._onDidClose=new ti.Emitter,this._onDidSave=new ti.Emitter,this._onWillSave=new ti.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=ti.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(r=>{let s=r.textDocument,i=this._configuration.create(s.uri,s.languageId,s.version,s.text);this._syncedDocuments.set(s.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(r=>{let s=r.textDocument,i=r.contentChanges;if(i.length===0)return;let{version:o}=s;if(o==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let a=this._syncedDocuments.get(s.uri);a!==void 0&&(a=this._configuration.update(a,i,o),this._syncedDocuments.set(s.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:s})))})),t.push(e.onWillSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onWillSave.fire(Object.freeze({document:s,reason:r.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((r,s)=>{let i=this._syncedDocuments.get(r.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:r.reason}),s):[]})),t.push(e.onDidSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),ti.Disposable.create(()=>{t.forEach(r=>r.dispose())})}};xu.TextDocuments=pm});var ym=w(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.NotebookDocuments=oo.NotebookSyncFeature=void 0;var In=ht(),aE=mm(),EM=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(In.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(In.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(In.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(In.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};oo.NotebookSyncFeature=EM;var $u=class n{onDidOpenTextDocument(e){return this.openHandler=e,In.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,In.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,In.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return n.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return n.NULL_DISPOSE}onDidSaveTextDocument(){return n.NULL_DISPOSE}};$u.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var gm=class{constructor(e){e instanceof aE.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new aE.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new In.Emitter,this._onDidChange=new In.Emitter,this._onDidSave=new In.Emitter,this._onDidClose=new In.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(t);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new $u,r=[];return r.push(this.cellTextDocuments.listen(t)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(s=>{this.notebookDocuments.set(s.notebookDocument.uri,s.notebookDocument);for(let i of s.cellTextDocuments)t.openTextDocument({textDocument:i});this.updateCellMap(s.notebookDocument),this._onDidOpen.fire(s.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i===void 0)return;i.version=s.notebookDocument.version;let o=i.metadata,a=!1,c=s.change;c.metadata!==void 0&&(a=!0,i.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let E=c.cells;if(E.structure!==void 0){let T=E.structure.array;if(i.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),E.structure.didOpen!==void 0)for(let v of E.structure.didOpen)t.openTextDocument({textDocument:v}),l.push(v.uri);if(E.structure.didClose)for(let v of E.structure.didClose)t.closeTextDocument({textDocument:v}),u.push(v.uri)}if(E.data!==void 0){let T=new Map(E.data.map(v=>[v.document,v]));for(let v=0;v<=i.cells.length;v++){let R=T.get(i.cells[v].document);if(R!==void 0){let A=i.cells.splice(v,1,R);if(d.push({old:A[0],new:R}),T.delete(R.document),T.size===0)break}}}if(E.textContent!==void 0)for(let T of E.textContent)t.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),f.push(T.document.uri)}this.updateCellMap(i);let p={notebookDocument:i};a&&(p.metadata={old:o,new:i.metadata});let b=[];for(let E of l)b.push(this.getNotebookCell(E));let g=[];for(let E of u)g.push(this.getNotebookCell(E));let S=[];for(let E of f)S.push(this.getNotebookCell(E));(b.length>0||g.length>0||d.length>0||S.length>0)&&(p.cells={added:b,removed:g,changed:{data:d,textContent:S}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let o of s.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(s.notebookDocument.uri);for(let o of i.cells)this.notebookCellMap.delete(o.document)}})),In.Disposable.create(()=>{r.forEach(s=>s.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};oo.NotebookDocuments=gm});var cE=w(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.MonikerFeature=void 0;var kM=ht(),NM=n=>class extends n{get moniker(){return{on:e=>{let t=kM.MonikerRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Lu.MonikerFeature=NM});var wm=w(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.createConnection=ke.combineFeatures=ke.combineNotebooksFeatures=ke.combineLanguagesFeatures=ke.combineWorkspaceFeatures=ke.combineWindowFeatures=ke.combineClientFeatures=ke.combineTracerFeatures=ke.combineTelemetryFeatures=ke.combineConsoleFeatures=ke._NotebooksImpl=ke._LanguagesImpl=ke.BulkUnregistration=ke.BulkRegistration=ke.ErrorMessageTracker=void 0;var U=ht(),Mn=Al(),bm=om(),re=zw(),PM=Gw(),RM=Yw(),CM=Jw(),DM=dm(),OM=Xw(),AM=Qw(),IM=Zw(),MM=eE(),xM=nE(),$M=sE(),LM=iE(),qM=oE(),jM=ym(),FM=cE();function vm(n){if(n!==null)return n}var Tm=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};ke.ErrorMessageTracker=Tm;var qu=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},Sm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let r={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(vm)}showWarningMessage(e,...t){let r={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(vm)}showInformationMessage(e,...t){let r={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(vm)}},lE=(0,OM.ShowDocumentFeature)((0,re.ProgressFeature)(Sm)),uE;(function(n){function e(){return new ju}n.create=e})(uE||(ke.BulkRegistration=uE={}));var ju=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let r=Mn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let s=bm.generateUuid();this._registrations.push({id:s,method:r,registerOptions:t||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},dE;(function(n){function e(){return new Ra(void 0,[])}n.create=e})(dE||(ke.BulkUnregistration=dE={}));var Ra=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Mn.string(e)?e:e.method,r=this._unregistrations.get(t);if(!r)return!1;let s={unregisterations:[r]};return this._connection.sendRequest(U.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(t)},i=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Fu=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,r){return e instanceof ju?this.registerMany(e):e instanceof Ra?this.registerSingle1(e,t,r):this.registerSingle2(e,t)}registerSingle1(e,t,r){let s=Mn.string(t)?t:t.method,i=bm.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:i,method:s}),e),a=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(a)))}registerSingle2(e,t){let r=Mn.string(e)?e:e.method,s=bm.generateUuid(),i={registrations:[{id:s,method:r,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,i).then(o=>U.Disposable.create(()=>{this.unregisterSingle(s,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let r={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new Ra(this._connection,t.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},_m=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(s){return s&&!!s.edit}let r=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,r)}},fE=(0,AM.FileOperationsFeature)((0,RM.WorkspaceFoldersFeature)((0,PM.ConfigurationFeature)(_m))),Bu=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},Uu=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Vu=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,re.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,re.attachPartialResult)(this.connection,t)}};ke._LanguagesImpl=Vu;var hE=(0,$M.FoldingRangeFeature)((0,FM.MonikerFeature)((0,qM.DiagnosticFeature)((0,LM.InlayHintFeature)((0,xM.InlineValueFeature)((0,MM.TypeHierarchyFeature)((0,IM.LinkedEditingRangeFeature)((0,DM.SemanticTokensFeature)((0,CM.CallHierarchyFeature)(Vu))))))))),Wu=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,re.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,re.attachPartialResult)(this.connection,t)}};ke._NotebooksImpl=Wu;var pE=(0,jM.NotebookSyncFeature)(Wu);function mE(n,e){return function(t){return e(n(t))}}ke.combineConsoleFeatures=mE;function gE(n,e){return function(t){return e(n(t))}}ke.combineTelemetryFeatures=gE;function yE(n,e){return function(t){return e(n(t))}}ke.combineTracerFeatures=yE;function vE(n,e){return function(t){return e(n(t))}}ke.combineClientFeatures=vE;function bE(n,e){return function(t){return e(n(t))}}ke.combineWindowFeatures=bE;function TE(n,e){return function(t){return e(n(t))}}ke.combineWorkspaceFeatures=TE;function SE(n,e){return function(t){return e(n(t))}}ke.combineLanguagesFeatures=SE;function _E(n,e){return function(t){return e(n(t))}}ke.combineNotebooksFeatures=_E;function BM(n,e){function t(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:t(n.console,e.console,mE),tracer:t(n.tracer,e.tracer,yE),telemetry:t(n.telemetry,e.telemetry,gE),client:t(n.client,e.client,vE),window:t(n.window,e.window,bE),workspace:t(n.workspace,e.workspace,TE),languages:t(n.languages,e.languages,SE),notebooks:t(n.notebooks,e.notebooks,_E)}}ke.combineFeatures=BM;function UM(n,e,t){let r=t&&t.console?new(t.console(qu)):new qu,s=n(r);r.rawAttach(s);let i=t&&t.tracer?new(t.tracer(Bu)):new Bu,o=t&&t.telemetry?new(t.telemetry(Uu)):new Uu,a=t&&t.client?new(t.client(Fu)):new Fu,c=t&&t.window?new(t.window(lE)):new lE,l=t&&t.workspace?new(t.workspace(fE)):new fE,u=t&&t.languages?new(t.languages(hE)):new hE,d=t&&t.notebooks?new(t.notebooks(pE)):new pE,f=[r,i,o,a,c,l,u,d];function p(T){return T instanceof Promise?T:Mn.thenable(T)?new Promise((v,R)=>{T.then(A=>v(A),A=>R(A))}):Promise.resolve(T)}let b,g,S,E={listen:()=>s.listen(),sendRequest:(T,...v)=>s.sendRequest(Mn.string(T)?T:T.method,...v),onRequest:(T,v)=>s.onRequest(T,v),sendNotification:(T,v)=>{let R=Mn.string(T)?T:T.method;return s.sendNotification(R,v)},onNotification:(T,v)=>s.onNotification(T,v),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:T=>(g=T,{dispose:()=>{g=void 0}}),onInitialized:T=>s.onNotification(U.InitializedNotification.type,T),onShutdown:T=>(b=T,{dispose:()=>{b=void 0}}),onExit:T=>(S=T,{dispose:()=>{S=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return i},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:T=>s.onNotification(U.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>s.onNotification(U.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>s.onNotification(U.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>s.onNotification(U.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>s.onNotification(U.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>s.onNotification(U.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>s.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>s.onNotification(U.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>s.sendNotification(U.PublishDiagnosticsNotification.type,T),onHover:T=>s.onRequest(U.HoverRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onCompletion:T=>s.onRequest(U.CompletionRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onCompletionResolve:T=>s.onRequest(U.CompletionResolveRequest.type,T),onSignatureHelp:T=>s.onRequest(U.SignatureHelpRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onDeclaration:T=>s.onRequest(U.DeclarationRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onDefinition:T=>s.onRequest(U.DefinitionRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onTypeDefinition:T=>s.onRequest(U.TypeDefinitionRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onImplementation:T=>s.onRequest(U.ImplementationRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onReferences:T=>s.onRequest(U.ReferencesRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onDocumentHighlight:T=>s.onRequest(U.DocumentHighlightRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onDocumentSymbol:T=>s.onRequest(U.DocumentSymbolRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onWorkspaceSymbol:T=>s.onRequest(U.WorkspaceSymbolRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onWorkspaceSymbolResolve:T=>s.onRequest(U.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>s.onRequest(U.CodeActionRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onCodeActionResolve:T=>s.onRequest(U.CodeActionResolveRequest.type,(v,R)=>T(v,R)),onCodeLens:T=>s.onRequest(U.CodeLensRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onCodeLensResolve:T=>s.onRequest(U.CodeLensResolveRequest.type,(v,R)=>T(v,R)),onDocumentFormatting:T=>s.onRequest(U.DocumentFormattingRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onDocumentRangeFormatting:T=>s.onRequest(U.DocumentRangeFormattingRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onDocumentOnTypeFormatting:T=>s.onRequest(U.DocumentOnTypeFormattingRequest.type,(v,R)=>T(v,R)),onRenameRequest:T=>s.onRequest(U.RenameRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),onPrepareRename:T=>s.onRequest(U.PrepareRenameRequest.type,(v,R)=>T(v,R)),onDocumentLinks:T=>s.onRequest(U.DocumentLinkRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onDocumentLinkResolve:T=>s.onRequest(U.DocumentLinkResolveRequest.type,(v,R)=>T(v,R)),onDocumentColor:T=>s.onRequest(U.DocumentColorRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onColorPresentation:T=>s.onRequest(U.ColorPresentationRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onFoldingRanges:T=>s.onRequest(U.FoldingRangeRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onSelectionRanges:T=>s.onRequest(U.SelectionRangeRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),(0,re.attachPartialResult)(s,v))),onExecuteCommand:T=>s.onRequest(U.ExecuteCommandRequest.type,(v,R)=>T(v,R,(0,re.attachWorkDone)(s,v),void 0)),dispose:()=>s.dispose()};for(let T of f)T.attach(E);return s.onRequest(U.InitializeRequest.type,T=>{e.initialize(T),Mn.string(T.trace)&&(i.trace=U.Trace.fromString(T.trace));for(let v of f)v.initialize(T.capabilities);if(g){let v=g(T,new U.CancellationTokenSource().token,(0,re.attachWorkDone)(s,T),void 0);return p(v).then(R=>{if(R instanceof U.ResponseError)return R;let A=R;A||(A={capabilities:{}});let $=A.capabilities;$||($={},A.capabilities=$),$.textDocumentSync===void 0||$.textDocumentSync===null?$.textDocumentSync=Mn.number(E.__textDocumentSync)?E.__textDocumentSync:U.TextDocumentSyncKind.None:!Mn.number($.textDocumentSync)&&!Mn.number($.textDocumentSync.change)&&($.textDocumentSync.change=Mn.number(E.__textDocumentSync)?E.__textDocumentSync:U.TextDocumentSyncKind.None);for(let W of f)W.fillServerCapabilities($);return A})}else{let v={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(v.capabilities);return v}}),s.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,b)return b(new U.CancellationTokenSource().token)}),s.onNotification(U.ExitNotification.type,()=>{try{S&&S()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),s.onNotification(U.SetTraceNotification.type,T=>{i.trace=U.Trace.fromString(T.value)}),E}ke.createConnection=UM});var wE=w(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.resolveModulePath=hn.FileSystem=hn.resolveGlobalYarnPath=hn.resolveGlobalNodePath=hn.resolve=hn.uriToFilePath=void 0;var VM=require("url"),er=require("path"),Em=require("fs"),Rm=require("child_process");function WM(n){let e=VM.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var r=0,s=t.length;r<s;r++)t[r]=decodeURIComponent(t[r]);if(process.platform==="win32"&&t.length>1){let i=t[0],o=t[1];i.length===0&&o.length>1&&o[1]===":"&&t.shift()}return er.normalize(t.join("/"))}hn.uriToFilePath=WM;function km(){return process.platform==="win32"}function Hu(n,e,t,r){let s="NODE_PATH",i=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&Em.existsSync(e)&&(l[s]?l[s]=e+er.delimiter+l[s]:l[s]=e,r&&r(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,Rm.fork)("",[],{cwd:t,env:l,execArgv:["-e",i]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} failed`));return}u.on("error",f=>{a(f)}),u.on("message",f=>{f.c==="r"&&(u.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}hn.resolve=Hu;function Nm(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(i=>t[i]=process.env[i]),t.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:t};km()&&(e="npm.cmd",r.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,Rm.spawnSync)(e,["config","get","prefix"],r).stdout;if(!i){n&&n("'npm config get prefix' didn't return a value.");return}let o=i.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?km()?er.join(o,"node_modules"):er.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}hn.resolveGlobalNodePath=Nm;function HM(n){let e="yarn",t={encoding:"utf8"};km()&&(e="yarn.cmd",t.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,Rm.spawnSync)(e,["global","dir","--json"],t),i=s.stdout;if(!i){n&&(n("'yarn global dir' didn't return a value."),s.stderr&&n(s.stderr));return}let o=i.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return er.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}hn.resolveGlobalYarnPath=HM;var Pm;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Em.existsSync(__filename.toUpperCase())||!Em.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function r(s,i){return t()?er.normalize(i).indexOf(er.normalize(s))===0:er.normalize(i).toLowerCase().indexOf(er.normalize(s).toLowerCase())===0}n.isParent=r})(Pm||(hn.FileSystem=Pm={}));function KM(n,e,t,r){return t?(er.isAbsolute(t)||(t=er.join(n,t)),Hu(e,t,t,r).then(s=>Pm.isParent(t,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>Hu(e,Nm(r),n,r))):Hu(e,Nm(r),n,r)}hn.resolveModulePath=KM});var Cm=w((cG,EE)=>{"use strict";EE.exports=ht()});var kE=w(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.InlineCompletionFeature=void 0;var zM=ht(),GM=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(zM.InlineCompletionRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};Ku.InlineCompletionFeature=GM});var RE=w(zt=>{"use strict";var YM=zt&&zt.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),PE=zt&&zt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&YM(e,n,t)};Object.defineProperty(zt,"__esModule",{value:!0});zt.ProposedFeatures=zt.NotebookDocuments=zt.TextDocuments=zt.SemanticTokensBuilder=void 0;var JM=dm();Object.defineProperty(zt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return JM.SemanticTokensBuilder}});var XM=kE();PE(ht(),zt);var QM=mm();Object.defineProperty(zt,"TextDocuments",{enumerable:!0,get:function(){return QM.TextDocuments}});var ZM=ym();Object.defineProperty(zt,"NotebookDocuments",{enumerable:!0,get:function(){return ZM.NotebookDocuments}});PE(wm(),zt);var NE;(function(n){n.all={__brand:"features",languages:XM.InlineCompletionFeature}})(NE||(zt.ProposedFeatures=NE={}))});var J=w(xn=>{"use strict";var ex=xn&&xn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),AE=xn&&xn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ex(e,n,t)};Object.defineProperty(xn,"__esModule",{value:!0});xn.createConnection=xn.Files=void 0;var CE=require("node:util"),Dm=Al(),tx=wm(),Ca=wE(),ni=Cm();AE(Cm(),xn);AE(RE(),xn);var DE;(function(n){n.uriToFilePath=Ca.uriToFilePath,n.resolveGlobalNodePath=Ca.resolveGlobalNodePath,n.resolveGlobalYarnPath=Ca.resolveGlobalYarnPath,n.resolve=Ca.resolve,n.resolveModulePath=Ca.resolveModulePath})(DE||(xn.Files=DE={}));var OE;function zu(){if(OE!==void 0)try{OE.end()}catch{}}var ao=!1,IE;function nx(){let n="--clientProcessId";function e(t){try{let r=parseInt(t);isNaN(r)||(IE=setInterval(()=>{try{process.kill(r,0)}catch{zu(),process.exit(ao?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let r=process.argv[t];if(r===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let s=r.split("=");s[0]===n&&e(s[1])}}}nx();var rx={initialize:n=>{let e=n.processId;Dm.number(e)&&IE===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(ao?0:1)}},3e3)},get shutdownReceived(){return ao},set shutdownReceived(n){ao=n},exit:n=>{zu(),process.exit(n)}};function sx(n,e,t,r){let s,i,o,a;return n!==void 0&&n.__brand==="features"&&(s=n,n=e,e=t,t=r),ni.ConnectionStrategy.is(n)||ni.ConnectionOptions.is(n)?a=n:(i=n,o=e,a=t),ix(i,o,a,s)}xn.createConnection=sx;function ix(n,e,t,r){let s=!1;if(!n&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let f=u[d];if(f==="--node-ipc"){n=new ni.IPCMessageReader(process),e=new ni.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!0,n=process.stdin,e=process.stdout;break}else if(f==="--socket"){c=parseInt(u[d+1]);break}else if(f==="--pipe"){l=u[d+1];break}else{var i=f.split("=");if(i[0]==="--socket"){c=parseInt(i[1]);break}else if(i[0]==="--pipe"){l=i[1];break}}}if(c){let d=(0,ni.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,ni.createServerPipeTransport)(l);n=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!n)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Dm.func(n.read)&&Dm.func(n.on)){let c=n;c.on("end",()=>{zu(),process.exit(ao?0:1)}),c.on("close",()=>{zu(),process.exit(ao?0:1)})}let a=c=>{let l=(0,ni.createProtocolConnection)(n,e,c,t);return s&&ox(c),l};return(0,tx.createConnection)(a,rx,r)}function ox(n){function e(r){return r.map(s=>typeof s=="string"?s:(0,CE.inspect)(s)).join(" ")}let t=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)n.error("Assertion failed");else{let[o,...a]=i;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(s="default"){let i=String(s),o=t.get(i)??0;o+=1,t.set(i,o),n.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?t.clear():t.delete(String(s))},console.debug=function(...s){n.log(e(s))},console.dir=function(s,i){n.log((0,CE.inspect)(s,i))},console.log=function(...s){n.log(e(s))},console.error=function(...s){n.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),n.log(`${o}
|
|
37
|
+
${i}`)},console.warn=function(...s){n.warn(e(s))}}});var xE=w((hG,ME)=>{"use strict";ME.exports=J()});var Se=w(jt=>{"use strict";var Km=Symbol.for("yaml.alias"),vN=Symbol.for("yaml.document"),Nd=Symbol.for("yaml.map"),bN=Symbol.for("yaml.pair"),zm=Symbol.for("yaml.scalar"),Pd=Symbol.for("yaml.seq"),zr=Symbol.for("yaml.node.type"),Yx=n=>!!n&&typeof n=="object"&&n[zr]===Km,Jx=n=>!!n&&typeof n=="object"&&n[zr]===vN,Xx=n=>!!n&&typeof n=="object"&&n[zr]===Nd,Qx=n=>!!n&&typeof n=="object"&&n[zr]===bN,TN=n=>!!n&&typeof n=="object"&&n[zr]===zm,Zx=n=>!!n&&typeof n=="object"&&n[zr]===Pd;function SN(n){if(n&&typeof n=="object")switch(n[zr]){case Nd:case Pd:return!0}return!1}function e$(n){if(n&&typeof n=="object")switch(n[zr]){case Km:case Nd:case zm:case Pd:return!0}return!1}var t$=n=>(TN(n)||SN(n))&&!!n.anchor;jt.ALIAS=Km;jt.DOC=vN;jt.MAP=Nd;jt.NODE_TYPE=zr;jt.PAIR=bN;jt.SCALAR=zm;jt.SEQ=Pd;jt.hasAnchor=t$;jt.isAlias=Yx;jt.isCollection=SN;jt.isDocument=Jx;jt.isMap=Xx;jt.isNode=e$;jt.isPair=Qx;jt.isScalar=TN;jt.isSeq=Zx});var Ba=w(Gm=>{"use strict";var Rt=Se(),mn=Symbol("break visit"),_N=Symbol("skip children"),Nr=Symbol("remove node");function Rd(n,e){let t=wN(e);Rt.isDocument(n)?No(null,n.contents,t,Object.freeze([n]))===Nr&&(n.contents=null):No(null,n,t,Object.freeze([]))}Rd.BREAK=mn;Rd.SKIP=_N;Rd.REMOVE=Nr;function No(n,e,t,r){let s=EN(n,e,t,r);if(Rt.isNode(s)||Rt.isPair(s))return kN(n,r,s),No(n,s,t,r);if(typeof s!="symbol"){if(Rt.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=No(i,e.items[i],t,r);if(typeof o=="number")i=o-1;else{if(o===mn)return mn;o===Nr&&(e.items.splice(i,1),i-=1)}}}else if(Rt.isPair(e)){r=Object.freeze(r.concat(e));let i=No("key",e.key,t,r);if(i===mn)return mn;i===Nr&&(e.key=null);let o=No("value",e.value,t,r);if(o===mn)return mn;o===Nr&&(e.value=null)}}return s}async function Cd(n,e){let t=wN(e);Rt.isDocument(n)?await Po(null,n.contents,t,Object.freeze([n]))===Nr&&(n.contents=null):await Po(null,n,t,Object.freeze([]))}Cd.BREAK=mn;Cd.SKIP=_N;Cd.REMOVE=Nr;async function Po(n,e,t,r){let s=await EN(n,e,t,r);if(Rt.isNode(s)||Rt.isPair(s))return kN(n,r,s),Po(n,s,t,r);if(typeof s!="symbol"){if(Rt.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=await Po(i,e.items[i],t,r);if(typeof o=="number")i=o-1;else{if(o===mn)return mn;o===Nr&&(e.items.splice(i,1),i-=1)}}}else if(Rt.isPair(e)){r=Object.freeze(r.concat(e));let i=await Po("key",e.key,t,r);if(i===mn)return mn;i===Nr&&(e.key=null);let o=await Po("value",e.value,t,r);if(o===mn)return mn;o===Nr&&(e.value=null)}}return s}function wN(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function EN(n,e,t,r){if(typeof t=="function")return t(n,e,r);if(Rt.isMap(e))return t.Map?.(n,e,r);if(Rt.isSeq(e))return t.Seq?.(n,e,r);if(Rt.isPair(e))return t.Pair?.(n,e,r);if(Rt.isScalar(e))return t.Scalar?.(n,e,r);if(Rt.isAlias(e))return t.Alias?.(n,e,r)}function kN(n,e,t){let r=e[e.length-1];if(Rt.isCollection(r))r.items[n]=t;else if(Rt.isPair(r))n==="key"?r.key=t:r.value=t;else if(Rt.isDocument(r))r.contents=t;else{let s=Rt.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}Gm.visit=Rd;Gm.visitAsync=Cd});var Ym=w(PN=>{"use strict";var NN=Se(),n$=Ba(),r$={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},s$=n=>n.replace(/[!,[\]{}]/g,e=>r$[e]),Ua=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return t(String(o)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+s$(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),s;if(e&&r.length>0&&NN.isNode(e.contents)){let i={};n$.visit(e.contents,(o,a)=>{NN.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
|
|
38
|
+
`)}};Ua.defaultYaml={explicit:!1,version:"1.2"};Ua.defaultTags={"!!":"tag:yaml.org,2002:"};PN.Directives=Ua});var Dd=w(Va=>{"use strict";var RN=Se(),i$=Ba();function o$(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function CN(n){let e=new Set;return i$.visit(n,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function DN(n,e){for(let t=1;;++t){let r=`${n}${t}`;if(!e.has(r))return r}}function a$(n,e){let t=[],r=new Map,s=null;return{onAnchor:i=>{t.push(i),s||(s=CN(n));let o=DN(e,s);return s.add(o),o},setAnchors:()=>{for(let i of t){let o=r.get(i);if(typeof o=="object"&&o.anchor&&(RN.isScalar(o.node)||RN.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}Va.anchorIsValid=o$;Va.anchorNames=CN;Va.createNodeAnchors=a$;Va.findNewAnchor=DN});var Jm=w(ON=>{"use strict";function Wa(n,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){let o=r[s],a=Wa(n,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(let s of Array.from(r.keys())){let i=r.get(s),o=Wa(n,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(let s of Array.from(r)){let i=Wa(n,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(let[s,i]of Object.entries(r)){let o=Wa(n,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return n.call(e,t,r)}ON.applyReviver=Wa});var Es=w(IN=>{"use strict";var c$=Se();function AN(n,e,t){if(Array.isArray(n))return n.map((r,s)=>AN(r,String(s),t));if(n&&typeof n.toJSON=="function"){if(!t||!c$.hasAnchor(n))return n.toJSON(e,t);let r={aliasCount:0,count:1,res:void 0};t.anchors.set(n,r),t.onCreate=i=>{r.res=i,delete t.onCreate};let s=n.toJSON(e,t);return t.onCreate&&t.onCreate(s),s}return typeof n=="bigint"&&!t?.keep?Number(n):n}IN.toJS=AN});var Od=w(xN=>{"use strict";var l$=Jm(),MN=Se(),u$=Es(),Xm=class{constructor(e){Object.defineProperty(this,MN.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!MN.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=u$.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?l$.applyReviver(i,{"":a},"",a):a}};xN.NodeBase=Xm});var Ha=w(LN=>{"use strict";var d$=Dd(),$N=Ba(),Ad=Se(),f$=Od(),h$=Es(),Qm=class extends f$.NodeBase{constructor(e){super(Ad.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return $N.visit(e,{Node:(r,s)=>{if(s===this)return $N.visit.BREAK;s.anchor===this.source&&(t=s)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:s,maxAliasCount:i}=t,o=this.resolve(s);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(h$.toJS(o,null,t),a=r.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Id(s,o,r)),a.count*a.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,r){let s=`*${this.source}`;if(e){if(d$.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function Id(n,e,t){if(Ad.isAlias(e)){let r=e.resolve(n),s=t&&r&&t.get(r);return s?s.count*s.aliasCount:0}else if(Ad.isCollection(e)){let r=0;for(let s of e.items){let i=Id(n,s,t);i>r&&(r=i)}return r}else if(Ad.isPair(e)){let r=Id(n,e.key,t),s=Id(n,e.value,t);return Math.max(r,s)}return 1}LN.Alias=Qm});var _t=w(Zm=>{"use strict";var p$=Se(),m$=Od(),g$=Es(),y$=n=>!n||typeof n!="function"&&typeof n!="object",ks=class extends m$.NodeBase{constructor(e){super(p$.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:g$.toJS(this.value,e,t)}toString(){return String(this.value)}};ks.BLOCK_FOLDED="BLOCK_FOLDED";ks.BLOCK_LITERAL="BLOCK_LITERAL";ks.PLAIN="PLAIN";ks.QUOTE_DOUBLE="QUOTE_DOUBLE";ks.QUOTE_SINGLE="QUOTE_SINGLE";Zm.Scalar=ks;Zm.isScalarValue=y$});var Ka=w(jN=>{"use strict";var v$=Ha(),ui=Se(),qN=_t(),b$="tag:yaml.org,2002:";function T$(n,e,t){if(e){let r=t.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(r=>r.identify?.(n)&&!r.format)}function S$(n,e,t){if(ui.isDocument(n)&&(n=n.contents),ui.isNode(n))return n;if(ui.isPair(n)){let d=t.schema[ui.MAP].createNode?.(t.schema,null,t);return d.items.push(n),d}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=t,c;if(r&&n&&typeof n=="object"){if(c=a.get(n),c)return c.anchor||(c.anchor=s(n)),new v$.Alias(c.anchor);c={anchor:null,node:null},a.set(n,c)}e?.startsWith("!!")&&(e=b$+e.slice(2));let l=T$(n,e,o.tags);if(!l){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let d=new qN.Scalar(n);return c&&(c.node=d),d}l=n instanceof Map?o[ui.MAP]:Symbol.iterator in Object(n)?o[ui.SEQ]:o[ui.MAP]}i&&(i(l),delete t.onTagObj);let u=l?.createNode?l.createNode(t.schema,n,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,n,t):new qN.Scalar(n);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}jN.createNode=S$});var xd=w(Md=>{"use strict";var _$=Ka(),Pr=Se(),w$=Od();function eg(n,e,t){let r=t;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return _$.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var FN=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,tg=class extends w$.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>Pr.isNode(r)||Pr.isPair(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(FN(e))this.add(t);else{let[r,...s]=e,i=this.get(r,!0);if(Pr.isCollection(i))i.addIn(s,t);else if(i===void 0&&this.schema)this.set(r,eg(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let s=this.get(t,!0);if(Pr.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...s]=e,i=this.get(r,!0);return s.length===0?!t&&Pr.isScalar(i)?i.value:i:Pr.isCollection(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Pr.isPair(t))return!1;let r=t.value;return r==null||e&&Pr.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let s=this.get(t,!0);return Pr.isCollection(s)?s.hasIn(r):!1}setIn(e,t){let[r,...s]=e;if(s.length===0)this.set(r,t);else{let i=this.get(r,!0);if(Pr.isCollection(i))i.setIn(s,t);else if(i===void 0&&this.schema)this.set(r,eg(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};Md.Collection=tg;Md.collectionFromPath=eg;Md.isEmptyPath=FN});var za=w($d=>{"use strict";var E$=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function ng(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var k$=(n,e,t)=>n.endsWith(`
|
|
39
|
+
`)?ng(t,e):t.includes(`
|
|
40
40
|
`)?`
|
|
41
|
-
`+
|
|
42
|
-
`)t===
|
|
43
|
-
`&&p!==" "){let R=
|
|
44
|
-
`&&R!==" "&&(f=g)}if(g>=d)if(f)l.push(f),d=f+c,f=void 0;else if(t===
|
|
45
|
-
${e}${
|
|
46
|
-
${e}${
|
|
47
|
-
`);
|
|
48
|
-
`){if(i-o>
|
|
41
|
+
`+ng(t,e):(n.endsWith(" ")?"":" ")+t;$d.indentComment=ng;$d.lineComment=k$;$d.stringifyComment=E$});var UN=w(Ga=>{"use strict";var N$="flow",rg="block",Ld="quoted";function P$(n,e,t="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return n;s<i&&(i=0);let c=Math.max(1+i,1+s-e.length);if(n.length<=c)return n;let l=[],u={},d=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):d=s-r);let f,p,b=!1,g=-1,S=-1,E=-1;t===rg&&(g=BN(n,g,e.length),g!==-1&&(d=g+c));for(let v;v=n[g+=1];){if(t===Ld&&v==="\\"){switch(S=g,n[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}E=g}if(v===`
|
|
42
|
+
`)t===rg&&(g=BN(n,g,e.length)),d=g+e.length+c,f=void 0;else{if(v===" "&&p&&p!==" "&&p!==`
|
|
43
|
+
`&&p!==" "){let R=n[g+1];R&&R!==" "&&R!==`
|
|
44
|
+
`&&R!==" "&&(f=g)}if(g>=d)if(f)l.push(f),d=f+c,f=void 0;else if(t===Ld){for(;p===" "||p===" ";)p=v,v=n[g+=1],b=!0;let R=g>E+1?g-2:S-1;if(u[R])return n;l.push(R),u[R]=!0,d=R+c,f=void 0}else b=!0}p=v}if(b&&a&&a(),l.length===0)return n;o&&o();let T=n.slice(0,l[0]);for(let v=0;v<l.length;++v){let R=l[v],A=l[v+1]||n.length;R===0?T=`
|
|
45
|
+
${e}${n.slice(0,A)}`:(t===Ld&&u[R]&&(T+=`${n[R]}\\`),T+=`
|
|
46
|
+
${e}${n.slice(R+1,A)}`)}return T}function BN(n,e,t){let r=e,s=e+1,i=n[s];for(;i===" "||i===" ";)if(e<s+t)i=n[++e];else{do i=n[++e];while(i&&i!==`
|
|
47
|
+
`);r=e,s=e+1,i=n[s]}return r}Ga.FOLD_BLOCK=rg;Ga.FOLD_FLOW=N$;Ga.FOLD_QUOTED=Ld;Ga.foldFlowLines=P$});var Ja=w(VN=>{"use strict";var ir=_t(),Ns=UN(),jd=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Fd=n=>/^(%|---|\.\.\.)/m.test(n);function R$(n,e,t){if(!e||e<0)return!1;let r=e-t,s=n.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(n[i]===`
|
|
48
|
+
`){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function Ya(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Fd(n)?" ":""),o="",a=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(a,c);let u=t.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||t[c+2]==='"'||t.length<s)c+=1;else{for(o+=t.slice(a,c)+`
|
|
49
49
|
|
|
50
50
|
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
|
|
51
|
-
`,c+=2;o+=i,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,
|
|
52
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
53
|
-
${t}`)+"'";return e.implicitKey?
|
|
51
|
+
`,c+=2;o+=i,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,r?o:Ns.foldFlowLines(o,i,Ns.FOLD_QUOTED,jd(e,!1))}function sg(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
52
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return Ya(n,e);let t=e.indent||(Fd(n)?" ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
53
|
+
${t}`)+"'";return e.implicitKey?r:Ns.foldFlowLines(r,t,Ns.FOLD_FLOW,jd(e,!1))}function Ro(n,e){let{singleQuote:t}=e.options,r;if(t===!1)r=Ya;else{let s=n.includes('"'),i=n.includes("'");s&&!i?r=sg:i&&!s?r=Ya:r=t?sg:Ya}return r(n,e)}var ig;try{ig=new RegExp(`(^|(?<!
|
|
54
54
|
))
|
|
55
55
|
+(?!
|
|
56
|
-
|$)`,"g")}catch{
|
|
56
|
+
|$)`,"g")}catch{ig=/\n+(?!\n|$)/g}function qd({comment:n,type:e,value:t},r,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return Ro(t,r);let l=r.indent||(r.forceBlockIndent||Fd(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===ir.Scalar.BLOCK_FOLDED?!1:e===ir.Scalar.BLOCK_LITERAL?!0:!R$(t,c,l.length);if(!t)return u?`|
|
|
57
57
|
`:`>
|
|
58
58
|
`;let d,f;for(f=t.length;f>0;--f){let A=t[f-1];if(A!==`
|
|
59
59
|
`&&A!==" "&&A!==" ")break}let p=t.substring(f),b=p.indexOf(`
|
|
60
60
|
`);b===-1?d="-":t===p||b!==p.length-1?(d="+",i&&i()):d="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
|
|
61
|
-
`&&(p=p.slice(0,-1)),p=p.replace(
|
|
62
|
-
`)
|
|
63
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`)
|
|
61
|
+
`&&(p=p.slice(0,-1)),p=p.replace(ig,`$&${l}`));let g=!1,S,E=-1;for(S=0;S<t.length;++S){let A=t[S];if(A===" ")g=!0;else if(A===`
|
|
62
|
+
`)E=S;else break}let T=t.substring(0,E<S?E+1:S);T&&(t=t.substring(T.length),T=T.replace(/\n+/g,`$&${l}`));let R=(g?l?"2":"1":"")+d;if(n&&(R+=" "+a(n.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){let A=t.replace(/\n+/g,`
|
|
63
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),$=!1,W=jd(r,!0);o!=="folded"&&e!==ir.Scalar.BLOCK_FOLDED&&(W.onOverflow=()=>{$=!0});let j=Ns.foldFlowLines(`${T}${A}${p}`,l,Ns.FOLD_BLOCK,W);if(!$)return`>${R}
|
|
64
64
|
${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${R}
|
|
65
|
-
${l}${T}${t}${p}`}function
|
|
66
|
-
`)||u&&/[[\]{},]/.test(i))return
|
|
67
|
-
`)?
|
|
68
|
-
`))return
|
|
69
|
-
${c}`);if(o){let f=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:p,tags:b}=e.doc.schema;if(b.some(f)||p?.some(f))return
|
|
70
|
-
${e.indent}${a}`:a}
|
|
71
|
-
${a}:`):(
|
|
72
|
-
`:"",T){let W=l(T)
|
|
73
|
-
${
|
|
74
|
-
`&&(
|
|
65
|
+
${l}${T}${t}${p}`}function C$(n,e,t,r){let{type:s,value:i}=n,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&i.includes(`
|
|
66
|
+
`)||u&&/[[\]{},]/.test(i))return Ro(i,e);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
|
|
67
|
+
`)?Ro(i,e):qd(n,e,t,r);if(!a&&!u&&s!==ir.Scalar.PLAIN&&i.includes(`
|
|
68
|
+
`))return qd(n,e,t,r);if(Fd(i)){if(c==="")return e.forceBlockIndent=!0,qd(n,e,t,r);if(a&&c===l)return Ro(i,e)}let d=i.replace(/\n+/g,`$&
|
|
69
|
+
${c}`);if(o){let f=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:p,tags:b}=e.doc.schema;if(b.some(f)||p?.some(f))return Ro(i,e)}return a?d:Ns.foldFlowLines(d,c,Ns.FOLD_FLOW,jd(e,!1))}function D$(n,e,t,r){let{implicitKey:s,inFlow:i}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==ir.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ir.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case ir.Scalar.BLOCK_FOLDED:case ir.Scalar.BLOCK_LITERAL:return s||i?Ro(o.value,e):qd(o,e,t,r);case ir.Scalar.QUOTE_DOUBLE:return Ya(o.value,e);case ir.Scalar.QUOTE_SINGLE:return sg(o.value,e);case ir.Scalar.PLAIN:return C$(o,e,t,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=s&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}VN.stringifyString=D$});var Xa=w(og=>{"use strict";var O$=Dd(),Ps=Se(),A$=za(),I$=Ja();function M$(n,e){let t=Object.assign({blockQuote:!0,commentString:A$.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e),r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function x$(n,e){if(e.tag){let s=n.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let t,r;if(Ps.isScalar(e)){r=e.value;let s=n.filter(i=>i.identify?.(r));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}t=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,t=n.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!t){let s=r?.constructor?.name??typeof r;throw new Error(`Tag not resolved for ${s} value`)}return t}function $$(n,e,{anchors:t,doc:r}){if(!r.directives)return"";let s=[],i=(Ps.isScalar(n)||Ps.isCollection(n))&&n.anchor;i&&O$.anchorIsValid(i)&&(t.add(i),s.push(`&${i}`));let o=n.tag?n.tag:e.default?null:e.tag;return o&&s.push(r.directives.tagString(o)),s.join(" ")}function L$(n,e,t,r){if(Ps.isPair(n))return n.toString(e,t,r);if(Ps.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let s,i=Ps.isNode(n)?n:e.doc.createNode(n,{onTagObj:c=>s=c});s||(s=x$(e.doc.schema.tags,i));let o=$$(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,t,r):Ps.isScalar(i)?I$.stringifyString(i,e,t,r):i.toString(e,t,r);return o?Ps.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
70
|
+
${e.indent}${a}`:a}og.createStringifyContext=M$;og.stringify=L$});var zN=w(KN=>{"use strict";var Gr=Se(),WN=_t(),HN=Xa(),Qa=za();function q$({key:n,value:e},t,r,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=t,f=Gr.isNode(n)&&n.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Gr.isCollection(n)||!Gr.isNode(n)&&typeof n=="object"){let W="With simple keys, collection cannot be used as a key value";throw new Error(W)}}let p=!d&&(!n||f&&e==null&&!t.inFlow||Gr.isCollection(n)||(Gr.isScalar(n)?n.type===WN.Scalar.BLOCK_FOLDED||n.type===WN.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(d||!i),indent:a+c});let b=!1,g=!1,S=HN.stringify(n,t,()=>b=!0,()=>g=!0);if(!p&&!t.inFlow&&S.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(i||e==null)return b&&r&&r(),S===""?"?":p?`? ${S}`:S}else if(i&&!d||e==null&&p)return S=`? ${S}`,f&&!b?S+=Qa.lineComment(S,t.indent,l(f)):g&&s&&s(),S;b&&(f=null),p?(f&&(S+=Qa.lineComment(S,t.indent,l(f))),S=`? ${S}
|
|
71
|
+
${a}:`):(S=`${S}:`,f&&(S+=Qa.lineComment(S,t.indent,l(f))));let E,T,v;Gr.isNode(e)?(E=!!e.spaceBefore,T=e.commentBefore,v=e.comment):(E=!1,T=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!f&&Gr.isScalar(e)&&(t.indentAtStart=S.length+1),g=!1,!u&&c.length>=2&&!t.inFlow&&!p&&Gr.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let R=!1,A=HN.stringify(e,t,()=>R=!0,()=>g=!0),$=" ";if(f||E||T){if($=E?`
|
|
72
|
+
`:"",T){let W=l(T);$+=`
|
|
73
|
+
${Qa.indentComment(W,t.indent)}`}A===""&&!t.inFlow?$===`
|
|
74
|
+
`&&($=`
|
|
75
75
|
|
|
76
|
-
`)
|
|
77
|
-
${t.indent}`}else if(!p&&
|
|
78
|
-
`),
|
|
76
|
+
`):$+=`
|
|
77
|
+
${t.indent}`}else if(!p&&Gr.isCollection(e)){let W=A[0],j=A.indexOf(`
|
|
78
|
+
`),ie=j!==-1,qe=t.inFlow??e.flow??e.items.length===0;if(ie||!qe){let wt=!1;if(ie&&(W==="&"||W==="!")){let he=A.indexOf(" ");W==="&"&&he!==-1&&he<j&&A[he+1]==="!"&&(he=A.indexOf(" ",he+1)),(he===-1||j<he)&&(wt=!0)}wt||($=`
|
|
79
79
|
${t.indent}`)}}else(A===""||A[0]===`
|
|
80
|
-
`)&&(
|
|
80
|
+
`)&&($="");return S+=$+A,t.inFlow?R&&r&&r():v&&!R?S+=Qa.lineComment(S,t.indent,l(v)):g&&s&&s(),S}KN.stringifyPair=q$});var cg=w(ag=>{"use strict";function j$(n,...e){n==="debug"&&console.log(...e)}function F$(n,e){(n==="debug"||n==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}ag.debug=j$;ag.warn=F$});var Wd=w(Vd=>{"use strict";var Za=Se(),GN=_t(),Bd="<<",Ud={identify:n=>n===Bd||typeof n=="symbol"&&n.description===Bd,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new GN.Scalar(Symbol(Bd)),{addToJSMap:YN}),stringify:()=>Bd},B$=(n,e)=>(Ud.identify(e)||Za.isScalar(e)&&(!e.type||e.type===GN.Scalar.PLAIN)&&Ud.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===Ud.tag&&t.default);function YN(n,e,t){if(t=n&&Za.isAlias(t)?t.resolve(n.doc):t,Za.isSeq(t))for(let r of t.items)lg(n,e,r);else if(Array.isArray(t))for(let r of t)lg(n,e,r);else lg(n,e,t)}function lg(n,e,t){let r=n&&Za.isAlias(t)?t.resolve(n.doc):t;if(!Za.isMap(r))throw new Error("Merge sources must be maps or map aliases");let s=r.toJSON(null,n,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}Vd.addMergeToJSMap=YN;Vd.isMergeKey=B$;Vd.merge=Ud});var dg=w(QN=>{"use strict";var U$=cg(),JN=Wd(),V$=Xa(),XN=Se(),ug=Es();function W$(n,e,{key:t,value:r}){if(XN.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,r);else if(JN.isMergeKey(n,t))JN.addMergeToJSMap(n,e,r);else{let s=ug.toJS(t,"",n);if(e instanceof Map)e.set(s,ug.toJS(r,s,n));else if(e instanceof Set)e.add(s);else{let i=H$(t,s,n),o=ug.toJS(r,i,n);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function H$(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(XN.isNode(n)&&t?.doc){let r=V$.createStringifyContext(t.doc,{});r.anchors=new Set;for(let i of t.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;let s=n.toString(r);if(!t.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),U$.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return s}return JSON.stringify(e)}QN.addPairToJSMap=W$});var Rs=w(fg=>{"use strict";var ZN=Ka(),K$=zN(),z$=dg(),Hd=Se();function G$(n,e,t){let r=ZN.createNode(n,void 0,t),s=ZN.createNode(e,void 0,t);return new Kd(r,s)}var Kd=class n{constructor(e,t=null){Object.defineProperty(this,Hd.NODE_TYPE,{value:Hd.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return Hd.isNode(t)&&(t=t.clone(e)),Hd.isNode(r)&&(r=r.clone(e)),new n(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return z$.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?K$.stringifyPair(this,e,t,r):JSON.stringify(this)}};fg.Pair=Kd;fg.createPair=G$});var hg=w(tP=>{"use strict";var di=Se(),eP=Xa(),zd=za();function Y$(n,e,t){return(e.inFlow??n.flow?X$:J$)(n,e,t)}function J$({comment:n,items:e},t,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=t,u=Object.assign({},t,{indent:i,type:null}),d=!1,f=[];for(let b=0;b<e.length;++b){let g=e[b],S=null;if(di.isNode(g))!d&&g.spaceBefore&&f.push(""),Gd(t,f,g.commentBefore,d),g.comment&&(S=g.comment);else if(di.isPair(g)){let T=di.isNode(g.key)?g.key:null;T&&(!d&&T.spaceBefore&&f.push(""),Gd(t,f,T.commentBefore,d))}d=!1;let E=eP.stringify(g,u,()=>S=null,()=>d=!0);S&&(E+=zd.lineComment(E,i,l(S))),d&&S&&(d=!1),f.push(r+E)}let p;if(f.length===0)p=s.start+s.end;else{p=f[0];for(let b=1;b<f.length;++b){let g=f[b];p+=g?`
|
|
81
81
|
${c}${g}`:`
|
|
82
|
-
`}}return
|
|
83
|
-
`+
|
|
84
|
-
`))&&(l=!0),d.push(
|
|
82
|
+
`}}return n?(p+=`
|
|
83
|
+
`+zd.indentComment(l(n),c),a&&a()):d&&o&&o(),p}function X$({items:n},e,{flowChars:t,itemIndent:r}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let b=0;b<n.length;++b){let g=n[b],S=null;if(di.isNode(g))g.spaceBefore&&d.push(""),Gd(e,d,g.commentBefore,!1),g.comment&&(S=g.comment);else if(di.isPair(g)){let T=di.isNode(g.key)?g.key:null;T&&(T.spaceBefore&&d.push(""),Gd(e,d,T.commentBefore,!1),T.comment&&(l=!0));let v=di.isNode(g.value)?g.value:null;v?(v.comment&&(S=v.comment),v.commentBefore&&(l=!0)):g.value==null&&T?.comment&&(S=T.comment)}S&&(l=!0);let E=eP.stringify(g,c,()=>S=null);b<n.length-1&&(E+=","),S&&(E+=zd.lineComment(E,r,a(S))),!l&&(d.length>u||E.includes(`
|
|
84
|
+
`))&&(l=!0),d.push(E),u=d.length}let{start:f,end:p}=t;if(d.length===0)return f+p;if(!l){let b=d.reduce((g,S)=>g+S.length+2,2);l=e.options.lineWidth>0&&b>e.options.lineWidth}if(l){let b=f;for(let g of d)b+=g?`
|
|
85
85
|
${i}${s}${g}`:`
|
|
86
86
|
`;return`${b}
|
|
87
|
-
${s}${p}`}else return`${f}${o}${d.join(" ")}${o}${p}`}function
|
|
88
|
-
`:" ")}return
|
|
89
|
-
${s.key.commentBefore}`:
|
|
90
|
-
${i.comment}`:n.comment}n=s}r.items[t]=Wd.isPair(n)?n:new hg.Pair(n)}}else e("Expected a sequence for this tag");return r}function uP(r,e,t){let{replacer:n}=t,s=new p1.YAMLSeq(r);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(hg.createPair(a,c,t))}return s}var m1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:lP,createNode:uP};Hd.createPairs=uP;Hd.pairs=m1;Hd.resolvePairs=lP});var gg=k(mg=>{"use strict";var dP=be(),pg=gs(),za=Ss(),g1=ks(),fP=Kd(),ii=class r extends g1.YAMLSeq{constructor(){super(),this.add=za.YAMLMap.prototype.add.bind(this),this.delete=za.YAMLMap.prototype.delete.bind(this),this.get=za.YAMLMap.prototype.get.bind(this),this.has=za.YAMLMap.prototype.has.bind(this),this.set=za.YAMLMap.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let s of this.items){let i,o;if(dP.isPair(s)?(i=pg.toJS(s.key,"",t),o=pg.toJS(s.value,i,t)):i=pg.toJS(s,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(e,t,n){let s=fP.createPairs(e,t,n),i=new this;return i.items=s.items,i}};ii.tag="tag:yaml.org,2002:omap";var y1={collection:"seq",identify:r=>r instanceof Map,nodeClass:ii,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=fP.resolvePairs(r,e),n=[];for(let{key:s}of t.items)dP.isScalar(s)&&(n.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):n.push(s.value));return Object.assign(new ii,t)},createNode:(r,e,t)=>ii.from(r,e,t)};mg.YAMLOMap=ii;mg.omap=y1});var yP=k(yg=>{"use strict";var hP=bt();function pP({value:r,source:e},t){return e&&(r?mP:gP).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var mP={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new hP.Scalar(!0),stringify:pP},gP={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new hP.Scalar(!1),stringify:pP};yg.falseTag=gP;yg.trueTag=mP});var vP=k(zd=>{"use strict";var v1=bt(),vg=So(),b1={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:vg.stringifyNumber},T1={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():vg.stringifyNumber(r)}},_1={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new v1.Scalar(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:vg.stringifyNumber};zd.float=_1;zd.floatExp=T1;zd.floatNaN=b1});var TP=k(Ya=>{"use strict";var bP=So(),Ga=r=>typeof r=="bigint"||Number.isInteger(r);function Gd(r,e,t,{intAsBigInt:n}){let s=r[0];if((s==="-"||s==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let o=BigInt(r);return s==="-"?BigInt(-1)*o:o}let i=parseInt(r,t);return s==="-"?-1*i:i}function bg(r,e,t){let{value:n}=r;if(Ga(n)){let s=n.toString(e);return n<0?"-"+t+s.substr(1):t+s}return bP.stringifyNumber(r)}var S1={identify:Ga,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>Gd(r,2,2,t),stringify:r=>bg(r,2,"0b")},k1={identify:Ga,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>Gd(r,1,8,t),stringify:r=>bg(r,8,"0")},w1={identify:Ga,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>Gd(r,0,10,t),stringify:bP.stringifyNumber},E1={identify:Ga,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>Gd(r,2,16,t),stringify:r=>bg(r,16,"0x")};Ya.int=w1;Ya.intBin=S1;Ya.intHex=E1;Ya.intOct=k1});var _g=k(Tg=>{"use strict";var Xd=be(),Yd=Ts(),Jd=Ss(),oi=class r extends Jd.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(e){let t;Xd.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Yd.Pair(e.key,null):t=new Yd.Pair(e,null),Jd.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Jd.findPair(this.items,e);return!t&&Xd.isPair(n)?Xd.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Jd.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Yd.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:s}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof s=="function"&&(o=s.call(t,o,o)),i.items.push(Yd.createPair(o,null,n));return i}};oi.tag="tag:yaml.org,2002:set";var N1={collection:"map",identify:r=>r instanceof Set,nodeClass:oi,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>oi.from(r,e,t),resolve(r,e){if(Xd.isMap(r)){if(r.hasAllNullValues(!0))return Object.assign(new oi,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}};Tg.YAMLSet=oi;Tg.set=N1});var kg=k(Qd=>{"use strict";var P1=So();function Sg(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,s=o=>e?BigInt(o):Number(o),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*i:i}function _P(r){let{value:e}=r,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return P1.stringifyNumber(r);let n="";e<0&&(n="-",e*=t(-1));let s=t(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var R1={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>Sg(r,t),stringify:_P},C1={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>Sg(r,!1),stringify:_P},SP={identify:r=>r 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(r){let e=r.match(SP.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,n-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=Sg(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:r})=>r.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};Qd.floatTime=C1;Qd.intTime=R1;Qd.timestamp=SP});var EP=k(wP=>{"use strict";var D1=To(),O1=jd(),A1=_o(),I1=Ka(),M1=fg(),kP=yP(),wg=vP(),Zd=TP(),x1=Od(),L1=gg(),$1=Kd(),q1=_g(),Eg=kg(),j1=[D1.map,A1.seq,I1.string,O1.nullTag,kP.trueTag,kP.falseTag,Zd.intBin,Zd.intOct,Zd.int,Zd.intHex,wg.floatNaN,wg.floatExp,wg.float,M1.binary,x1.merge,L1.omap,$1.pairs,q1.set,Eg.intTime,Eg.floatTime,Eg.timestamp];wP.schema=j1});var xP=k(Rg=>{"use strict";var CP=To(),F1=jd(),DP=_o(),B1=Ka(),U1=sg(),Ng=og(),Pg=cg(),V1=sP(),W1=aP(),OP=fg(),Ja=Od(),AP=gg(),IP=Kd(),NP=EP(),MP=_g(),ef=kg(),PP=new Map([["core",V1.schema],["failsafe",[CP.map,DP.seq,B1.string]],["json",W1.schema],["yaml11",NP.schema],["yaml-1.1",NP.schema]]),RP={binary:OP.binary,bool:U1.boolTag,float:Ng.float,floatExp:Ng.floatExp,floatNaN:Ng.floatNaN,floatTime:ef.floatTime,int:Pg.int,intHex:Pg.intHex,intOct:Pg.intOct,intTime:ef.intTime,map:CP.map,merge:Ja.merge,null:F1.nullTag,omap:AP.omap,pairs:IP.pairs,seq:DP.seq,set:MP.set,timestamp:ef.timestamp},H1={"tag:yaml.org,2002:binary":OP.binary,"tag:yaml.org,2002:merge":Ja.merge,"tag:yaml.org,2002:omap":AP.omap,"tag:yaml.org,2002:pairs":IP.pairs,"tag:yaml.org,2002:set":MP.set,"tag:yaml.org,2002:timestamp":ef.timestamp};function K1(r,e,t){let n=PP.get(e);if(n&&!r)return t&&!n.includes(Ja.merge)?n.concat(Ja.merge):n.slice();let s=n;if(!s)if(Array.isArray(r))s=[];else{let i=Array.from(PP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(r))for(let i of r)s=s.concat(i);else typeof r=="function"&&(s=r(s.slice()));return t&&(s=s.concat(Ja.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?RP[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(RP).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}Rg.coreKnownTags=H1;Rg.getTags=K1});var Og=k(LP=>{"use strict";var Cg=be(),z1=To(),G1=_o(),Y1=Ka(),tf=xP(),J1=(r,e)=>r.key<e.key?-1:r.key>e.key?1:0,Dg=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?tf.getTags(e,"compat"):e?tf.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?tf.coreKnownTags:{},this.tags=tf.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,Cg.MAP,{value:z1.map}),Object.defineProperty(this,Cg.SCALAR,{value:Y1.string}),Object.defineProperty(this,Cg.SEQ,{value:G1.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?J1:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};LP.Schema=Dg});var qP=k($P=>{"use strict";var X1=be(),Ag=Ua(),Xa=qa();function Q1(r,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let c=r.directives.toString(r);c?(t.push(c),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let s=Ag.createStringifyContext(r,e),{commentString:i}=s.options;if(r.commentBefore){t.length!==1&&t.unshift("");let c=i(r.commentBefore);t.unshift(Xa.indentComment(c,""))}let o=!1,a=null;if(r.contents){if(X1.isNode(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let u=i(r.contents.commentBefore);t.push(Xa.indentComment(u,""))}s.forceBlockIndent=!!r.comment,a=r.contents.comment}let c=a?void 0:()=>o=!0,l=Ag.stringify(r.contents,s,()=>a=null,c);a&&(l+=Xa.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(Ag.stringify(r.contents,s));if(r.directives?.docEnd)if(r.comment){let c=i(r.comment);c.includes(`
|
|
91
|
-
`)?(t.push("..."),t.push(
|
|
87
|
+
${s}${p}`}else return`${f}${o}${d.join(" ")}${o}${p}`}function Gd({indent:n,options:{commentString:e}},t,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){let i=zd.indentComment(e(r),n);t.push(i.trimStart())}}tP.stringifyCollection=Y$});var Ds=w(mg=>{"use strict";var Q$=hg(),Z$=dg(),eL=xd(),Cs=Se(),Yd=Rs(),tL=_t();function ec(n,e){let t=Cs.isScalar(e)?e.value:e;for(let r of n)if(Cs.isPair(r)&&(r.key===e||r.key===t||Cs.isScalar(r.key)&&r.key.value===t))return r}var pg=class extends eL.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Cs.MAP,e),this.items=[]}static from(e,t,r){let{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(t,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(Yd.createPair(c,l,r))};if(t instanceof Map)for(let[c,l]of t)a(c,l);else if(t&&typeof t=="object")for(let c of Object.keys(t))a(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let r;Cs.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Yd.Pair(e,e?.value):r=new Yd.Pair(e.key,e.value);let s=ec(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${r.key} already set`);Cs.isScalar(s.value)&&tL.isScalarValue(r.value)?s.value.value=r.value:s.value=r.value}else if(i){let o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let t=ec(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let s=ec(this.items,e)?.value;return(!t&&Cs.isScalar(s)?s.value:s)??void 0}has(e){return!!ec(this.items,e)}set(e,t){this.add(new Yd.Pair(e,t),!0)}toJSON(e,t,r){let s=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(let i of this.items)Z$.addPairToJSMap(t,s,i);return s}toString(e,t,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!Cs.isPair(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Q$.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}};mg.YAMLMap=pg;mg.findPair=ec});var Co=w(rP=>{"use strict";var nL=Se(),nP=Ds(),rL={collection:"map",default:!0,nodeClass:nP.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return nL.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>nP.YAMLMap.from(n,e,t)};rP.map=rL});var Os=w(sP=>{"use strict";var sL=Ka(),iL=hg(),oL=xd(),Xd=Se(),aL=_t(),cL=Es(),gg=class extends oL.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Xd.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Jd(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let r=Jd(e);if(typeof r!="number")return;let s=this.items[r];return!t&&Xd.isScalar(s)?s.value:s}has(e){let t=Jd(e);return typeof t=="number"&&t<this.items.length}set(e,t){let r=Jd(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[r];Xd.isScalar(s)&&aL.isScalarValue(t)?s.value=t:this.items[r]=t}toJSON(e,t){let r=[];t?.onCreate&&t.onCreate(r);let s=0;for(let i of this.items)r.push(cL.toJS(i,String(s++),t));return r}toString(e,t,r){return e?iL.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof s=="function"){let c=t instanceof Set?a:String(o++);a=s.call(t,c,a)}i.items.push(sL.createNode(a,void 0,r))}}return i}};function Jd(n){let e=Xd.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}sP.YAMLSeq=gg});var Do=w(oP=>{"use strict";var lL=Se(),iP=Os(),uL={collection:"seq",default:!0,nodeClass:iP.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return lL.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>iP.YAMLSeq.from(n,e,t)};oP.seq=uL});var tc=w(aP=>{"use strict";var dL=Ja(),fL={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,r){return e=Object.assign({actualString:!0},e),dL.stringifyString(n,e,t,r)}};aP.string=fL});var Qd=w(uP=>{"use strict";var cP=_t(),lP={identify:n=>n==null,createNode:()=>new cP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new cP.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&lP.test.test(n)?n:e.options.nullStr};uP.nullTag=lP});var yg=w(fP=>{"use strict";var hL=_t(),dP={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new hL.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&dP.test.test(n)){let r=n[0]==="t"||n[0]==="T";if(e===r)return n}return e?t.options.trueStr:t.options.falseStr}};fP.boolTag=dP});var Oo=w(hP=>{"use strict";function pL({format:n,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);let s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}hP.stringifyNumber=pL});var bg=w(Zd=>{"use strict";var mL=_t(),vg=Oo(),gL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:vg.stringifyNumber},yL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():vg.stringifyNumber(n)}},vL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new mL.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:vg.stringifyNumber};Zd.float=vL;Zd.floatExp=yL;Zd.floatNaN=gL});var Sg=w(tf=>{"use strict";var pP=Oo(),ef=n=>typeof n=="bigint"||Number.isInteger(n),Tg=(n,e,t,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),t);function mP(n,e,t){let{value:r}=n;return ef(r)&&r>=0?t+r.toString(e):pP.stringifyNumber(n)}var bL={identify:n=>ef(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Tg(n,2,8,t),stringify:n=>mP(n,8,"0o")},TL={identify:ef,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Tg(n,0,10,t),stringify:pP.stringifyNumber},SL={identify:n=>ef(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Tg(n,2,16,t),stringify:n=>mP(n,16,"0x")};tf.int=TL;tf.intHex=SL;tf.intOct=bL});var yP=w(gP=>{"use strict";var _L=Co(),wL=Qd(),EL=Do(),kL=tc(),NL=yg(),_g=bg(),wg=Sg(),PL=[_L.map,EL.seq,kL.string,wL.nullTag,NL.boolTag,wg.intOct,wg.int,wg.intHex,_g.floatNaN,_g.floatExp,_g.float];gP.schema=PL});var TP=w(bP=>{"use strict";var RL=_t(),CL=Co(),DL=Do();function vP(n){return typeof n=="bigint"||Number.isInteger(n)}var nf=({value:n})=>JSON.stringify(n),OL=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:nf},{identify:n=>n==null,createNode:()=>new RL.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:nf},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:nf},{identify:vP,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>vP(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:nf}],AL={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},IL=[CL.map,DL.seq].concat(OL,AL);bP.schema=IL});var kg=w(SP=>{"use strict";var Eg=_t(),ML=Ja(),xL={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let s=0;s<t.length;++s)r[s]=t.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},r,s,i){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=Eg.Scalar.BLOCK_LITERAL),e!==Eg.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===Eg.Scalar.BLOCK_LITERAL?`
|
|
88
|
+
`:" ")}return ML.stringifyString({comment:n,type:e,value:a},r,s,i)}};SP.binary=xL});var of=w(sf=>{"use strict";var rf=Se(),Ng=Rs(),$L=_t(),LL=Os();function _P(n,e){if(rf.isSeq(n))for(let t=0;t<n.items.length;++t){let r=n.items[t];if(!rf.isPair(r)){if(rf.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let s=r.items[0]||new Ng.Pair(new $L.Scalar(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
89
|
+
${s.key.commentBefore}`:r.commentBefore),r.comment){let i=s.value??s.key;i.comment=i.comment?`${r.comment}
|
|
90
|
+
${i.comment}`:r.comment}r=s}n.items[t]=rf.isPair(r)?r:new Ng.Pair(r)}}else e("Expected a sequence for this tag");return n}function wP(n,e,t){let{replacer:r}=t,s=new LL.YAMLSeq(n);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(Ng.createPair(a,c,t))}return s}var qL={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:_P,createNode:wP};sf.createPairs=wP;sf.pairs=qL;sf.resolvePairs=_P});var Cg=w(Rg=>{"use strict";var EP=Se(),Pg=Es(),nc=Ds(),jL=Os(),kP=of(),fi=class n extends jL.YAMLSeq{constructor(){super(),this.add=nc.YAMLMap.prototype.add.bind(this),this.delete=nc.YAMLMap.prototype.delete.bind(this),this.get=nc.YAMLMap.prototype.get.bind(this),this.has=nc.YAMLMap.prototype.has.bind(this),this.set=nc.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;t?.onCreate&&t.onCreate(r);for(let s of this.items){let i,o;if(EP.isPair(s)?(i=Pg.toJS(s.key,"",t),o=Pg.toJS(s.value,i,t)):i=Pg.toJS(s,"",t),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let s=kP.createPairs(e,t,r),i=new this;return i.items=s.items,i}};fi.tag="tag:yaml.org,2002:omap";var FL={collection:"seq",identify:n=>n instanceof Map,nodeClass:fi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=kP.resolvePairs(n,e),r=[];for(let{key:s}of t.items)EP.isScalar(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new fi,t)},createNode:(n,e,t)=>fi.from(n,e,t)};Rg.YAMLOMap=fi;Rg.omap=FL});var DP=w(Dg=>{"use strict";var NP=_t();function PP({value:n,source:e},t){return e&&(n?RP:CP).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var RP={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new NP.Scalar(!0),stringify:PP},CP={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new NP.Scalar(!1),stringify:PP};Dg.falseTag=CP;Dg.trueTag=RP});var OP=w(af=>{"use strict";var BL=_t(),Og=Oo(),UL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Og.stringifyNumber},VL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Og.stringifyNumber(n)}},WL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new BL.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let r=n.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Og.stringifyNumber};af.float=WL;af.floatExp=VL;af.floatNaN=UL});var IP=w(sc=>{"use strict";var AP=Oo(),rc=n=>typeof n=="bigint"||Number.isInteger(n);function cf(n,e,t,{intAsBigInt:r}){let s=n[0];if((s==="-"||s==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),r){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return s==="-"?BigInt(-1)*o:o}let i=parseInt(n,t);return s==="-"?-1*i:i}function Ag(n,e,t){let{value:r}=n;if(rc(r)){let s=r.toString(e);return r<0?"-"+t+s.substr(1):t+s}return AP.stringifyNumber(n)}var HL={identify:rc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>cf(n,2,2,t),stringify:n=>Ag(n,2,"0b")},KL={identify:rc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>cf(n,1,8,t),stringify:n=>Ag(n,8,"0")},zL={identify:rc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>cf(n,0,10,t),stringify:AP.stringifyNumber},GL={identify:rc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>cf(n,2,16,t),stringify:n=>Ag(n,16,"0x")};sc.int=zL;sc.intBin=HL;sc.intHex=GL;sc.intOct=KL});var Mg=w(Ig=>{"use strict";var df=Se(),lf=Rs(),uf=Ds(),hi=class n extends uf.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;df.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new lf.Pair(e.key,null):t=new lf.Pair(e,null),uf.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=uf.findPair(this.items,e);return!t&&df.isPair(r)?df.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=uf.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new lf.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){let{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof s=="function"&&(o=s.call(t,o,o)),i.items.push(lf.createPair(o,null,r));return i}};hi.tag="tag:yaml.org,2002:set";var YL={collection:"map",identify:n=>n instanceof Set,nodeClass:hi,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>hi.from(n,e,t),resolve(n,e){if(df.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new hi,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};Ig.YAMLSet=hi;Ig.set=YL});var $g=w(ff=>{"use strict";var JL=Oo();function xg(n,e){let t=n[0],r=t==="-"||t==="+"?n.substring(1):n,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*i:i}function MP(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return JL.stringifyNumber(n);let r="";e<0&&(r="-",e*=t(-1));let s=t(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var XL={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>xg(n,t),stringify:MP},QL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>xg(n,!1),stringify:MP},xP={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(xP.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,r-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=xg(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:n})=>n.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};ff.floatTime=QL;ff.intTime=XL;ff.timestamp=xP});var qP=w(LP=>{"use strict";var ZL=Co(),e1=Qd(),t1=Do(),n1=tc(),r1=kg(),$P=DP(),Lg=OP(),hf=IP(),s1=Wd(),i1=Cg(),o1=of(),a1=Mg(),qg=$g(),c1=[ZL.map,t1.seq,n1.string,e1.nullTag,$P.trueTag,$P.falseTag,hf.intBin,hf.intOct,hf.int,hf.intHex,Lg.floatNaN,Lg.floatExp,Lg.float,r1.binary,s1.merge,i1.omap,o1.pairs,a1.set,qg.intTime,qg.floatTime,qg.timestamp];LP.schema=c1});var GP=w(Bg=>{"use strict";var UP=Co(),l1=Qd(),VP=Do(),u1=tc(),d1=yg(),jg=bg(),Fg=Sg(),f1=yP(),h1=TP(),WP=kg(),ic=Wd(),HP=Cg(),KP=of(),jP=qP(),zP=Mg(),pf=$g(),FP=new Map([["core",f1.schema],["failsafe",[UP.map,VP.seq,u1.string]],["json",h1.schema],["yaml11",jP.schema],["yaml-1.1",jP.schema]]),BP={binary:WP.binary,bool:d1.boolTag,float:jg.float,floatExp:jg.floatExp,floatNaN:jg.floatNaN,floatTime:pf.floatTime,int:Fg.int,intHex:Fg.intHex,intOct:Fg.intOct,intTime:pf.intTime,map:UP.map,merge:ic.merge,null:l1.nullTag,omap:HP.omap,pairs:KP.pairs,seq:VP.seq,set:zP.set,timestamp:pf.timestamp},p1={"tag:yaml.org,2002:binary":WP.binary,"tag:yaml.org,2002:merge":ic.merge,"tag:yaml.org,2002:omap":HP.omap,"tag:yaml.org,2002:pairs":KP.pairs,"tag:yaml.org,2002:set":zP.set,"tag:yaml.org,2002:timestamp":pf.timestamp};function m1(n,e,t){let r=FP.get(e);if(r&&!n)return t&&!r.includes(ic.merge)?r.concat(ic.merge):r.slice();let s=r;if(!s)if(Array.isArray(n))s=[];else{let i=Array.from(FP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(n))for(let i of n)s=s.concat(i);else typeof n=="function"&&(s=n(s.slice()));return t&&(s=s.concat(ic.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?BP[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(BP).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}Bg.coreKnownTags=p1;Bg.getTags=m1});var Wg=w(YP=>{"use strict";var Ug=Se(),g1=Co(),y1=Do(),v1=tc(),mf=GP(),b1=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,Vg=class n{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?mf.getTags(e,"compat"):e?mf.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?mf.coreKnownTags:{},this.tags=mf.getTags(t,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Ug.MAP,{value:g1.map}),Object.defineProperty(this,Ug.SCALAR,{value:v1.string}),Object.defineProperty(this,Ug.SEQ,{value:y1.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?b1:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};YP.Schema=Vg});var XP=w(JP=>{"use strict";var T1=Se(),Hg=Xa(),oc=za();function S1(n,e){let t=[],r=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),r=!0):n.directives.docStart&&(r=!0)}r&&t.push("---");let s=Hg.createStringifyContext(n,e),{commentString:i}=s.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=i(n.commentBefore);t.unshift(oc.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(T1.isNode(n.contents)){if(n.contents.spaceBefore&&r&&t.push(""),n.contents.commentBefore){let u=i(n.contents.commentBefore);t.push(oc.indentComment(u,""))}s.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=Hg.stringify(n.contents,s,()=>a=null,c);a&&(l+=oc.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(Hg.stringify(n.contents,s));if(n.directives?.docEnd)if(n.comment){let c=i(n.comment);c.includes(`
|
|
91
|
+
`)?(t.push("..."),t.push(oc.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(oc.indentComment(i(c),"")))}return t.join(`
|
|
92
92
|
`)+`
|
|
93
|
-
`}
|
|
94
|
-
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=t.linePos[1];c&&c.line===
|
|
93
|
+
`}JP.stringifyDocument=S1});var ac=w(QP=>{"use strict";var _1=Ha(),Ao=xd(),qn=Se(),w1=Rs(),E1=Es(),k1=Wg(),N1=XP(),Kg=Dd(),P1=Jm(),R1=Ka(),zg=Ym(),Gg=class n{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,qn.NODE_TYPE,{value:qn.DOC});let s=null;typeof t=="function"||Array.isArray(t)?s=t:r===void 0&&t&&(r=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new zg.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){let e=Object.create(n.prototype,{[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){Io(this.contents)&&this.contents.add(e)}addIn(e,t){Io(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=Kg.anchorNames(this);e.anchor=!t||r.has(t)?Kg.findNewAnchor(t||"a",r):t}return new _1.Alias(e.anchor)}createNode(e,t,r){let s;if(typeof t=="function")e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){let S=T=>typeof T=="number"||T instanceof String||T instanceof Number,E=t.filter(S).map(String);E.length>0&&(t=t.concat(E)),s=t}else r===void 0&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=Kg.createNodeAnchors(this,o||"a"),b={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:p},g=R1.createNode(e,u,b);return a&&qn.isCollection(g)&&(g.flow=!0),f(),g}createPair(e,t,r={}){let s=this.createNode(e,null,r),i=this.createNode(t,null,r);return new w1.Pair(s,i)}delete(e){return Io(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ao.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Io(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return qn.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ao.isEmptyPath(e)?!t&&qn.isScalar(this.contents)?this.contents.value:this.contents:qn.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return qn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ao.isEmptyPath(e)?this.contents!==void 0:qn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ao.collectionFromPath(this.schema,[e],t):Io(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ao.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ao.collectionFromPath(this.schema,Array.from(e),t):Io(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new zg.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 zg.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new k1.Schema(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=E1.toJS(this.contents,t??"",a);if(typeof i=="function")for(let{count:l,res:u}of a.anchors.values())i(u,l);return typeof o=="function"?P1.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return N1.stringifyDocument(this,e)}};function Io(n){if(qn.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}QP.Document=Gg});var uc=w(lc=>{"use strict";var cc=class extends Error{constructor(e,t,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=t}},Yg=class extends cc{constructor(e,t,r){super("YAMLParseError",e,t,r)}},Jg=class extends cc{constructor(e,t,r){super("YAMLWarning",e,t,r)}},C1=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:r,col:s}=t.linePos[0];t.message+=` at line ${r}, column ${s}`;let i=s-1,o=n.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,i))){let a=n.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
94
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=t.linePos[1];c&&c.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));let l=" ".repeat(i)+"^".repeat(a);t.message+=`:
|
|
95
95
|
|
|
96
96
|
${o}
|
|
97
97
|
${l}
|
|
98
|
-
`}};
|
|
99
|
-
`))return!0;if(
|
|
100
|
-
`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||
|
|
101
|
-
`+v.comment:T.comment=v.comment);let R=new
|
|
102
|
-
|
|
103
|
-
`+W:j.comment=W
|
|
104
|
-
`+
|
|
105
|
-
`+
|
|
106
|
-
`.repeat(Math.max(1,o.length-1)):"",
|
|
107
|
-
`;for(let g=u;g<a;++g){let[
|
|
108
|
-
`):
|
|
98
|
+
`}};lc.YAMLError=cc;lc.YAMLParseError=Yg;lc.YAMLWarning=Jg;lc.prettifyError=C1});var dc=w(ZP=>{"use strict";function D1(n,{flow:e,indicator:t,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,b=!1,g=null,S=null,E=null,T=null,v=null,R=null,A=null;for(let j of n)switch(b&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&i(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),g&&(l&&j.type!=="comment"&&j.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),j.type){case"space":!e&&(t!=="doc-start"||r?.type!=="flow-collection")&&j.source.includes(" ")&&(g=j),u=!0;break;case"comment":{u||i(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let ie=j.source.substring(1)||" ";d?d+=f+ie:d=ie,f="",l=!1;break}case"newline":l?d?d+=j.source:c=!0:f+=j.source,l=!0,p=!0,(S||E)&&(T=j),u=!0;break;case"anchor":S&&i(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&i(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=j,A===null&&(A=j.offset),l=!1,u=!1,b=!0;break;case"tag":{E&&i(j,"MULTIPLE_TAGS","A node can have at most one tag"),E=j,A===null&&(A=j.offset),l=!1,u=!1,b=!0;break}case t:(S||E)&&i(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),R&&i(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${e??"collection"}`),R=j,l=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&i(j,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=j,l=!1,u=!1;break}default:i(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),l=!1,u=!1}let $=n[n.length-1],W=$?$.offset+$.source.length:s;return b&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:R,spaceBefore:c,comment:d,hasNewline:p,anchor:S,tag:E,newlineAfterProp:T,end:W,start:A??W}}ZP.resolveProps=D1});var gf=w(e0=>{"use strict";function Xg(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
99
|
+
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Xg(e.key)||Xg(e.value))return!0}return!1;default:return!0}}e0.containsNewline=Xg});var Qg=w(t0=>{"use strict";var O1=gf();function A1(n,e,t){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&O1.containsNewline(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}t0.flowIndentCheck=A1});var Zg=w(r0=>{"use strict";var n0=Se();function I1(n,e,t){let{uniqueKeys:r}=n.options;if(r===!1)return!1;let s=typeof r=="function"?r:(i,o)=>i===o||n0.isScalar(i)&&n0.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,t))}r0.mapIncludes=I1});var l0=w(c0=>{"use strict";var s0=Rs(),M1=Ds(),i0=dc(),x1=gf(),o0=Qg(),$1=Zg(),a0="All mapping items must start at the same column";function L1({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=i?.nodeClass??M1.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:f,sep:p,value:b}=u,g=i0.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),S=!g.found;if(S){if(f&&(f.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==r.indent&&s(c,"BAD_INDENT",a0)),!g.anchor&&!g.tag&&!p){l=g.end,g.comment&&(a.comment?a.comment+=`
|
|
100
|
+
`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||x1.containsNewline(f))&&s(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&s(c,"BAD_INDENT",a0);t.atKey=!0;let E=g.end,T=f?n(t,f,g,s):e(t,E,d,null,g,s);t.schema.compat&&o0.flowIndentCheck(r.indent,f,s),t.atKey=!1,$1.mapIncludes(t,a.items,T)&&s(E,"DUPLICATE_KEY","Map keys must be unique");let v=i0.resolveProps(p??[],{indicator:"map-value-ind",next:b,offset:T.range[2],onError:s,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=v.end,v.found){S&&(b?.type==="block-map"&&!v.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&g.start<v.found.offset-1024&&s(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let R=b?n(t,b,v,s):e(t,c,p,null,v,s);t.schema.compat&&o0.flowIndentCheck(r.indent,b,s),c=R.range[2];let A=new s0.Pair(T,R);t.options.keepSourceTokens&&(A.srcToken=u),a.items.push(A)}else{S&&s(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(T.comment?T.comment+=`
|
|
101
|
+
`+v.comment:T.comment=v.comment);let R=new s0.Pair(T);t.options.keepSourceTokens&&(R.srcToken=u),a.items.push(R)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}c0.resolveBlockMap=L1});var d0=w(u0=>{"use strict";var q1=Os(),j1=dc(),F1=Qg();function B1({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=i?.nodeClass??q1.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let f=j1.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d&&d.type==="block-seq"?s(f.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?n(t,d,f,s):e(t,f.end,u,null,f,s);t.schema.compat&&F1.flowIndentCheck(r.indent,d,s),c=p.range[2],a.items.push(p)}return a.range=[r.offset,c,l??c],a}u0.resolveBlockSeq=B1});var Mo=w(f0=>{"use strict";function U1(n,e,t,r){let s="";if(n){let i=!1,o="";for(let a of n){let{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{t&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}f0.resolveEnd=U1});var g0=w(m0=>{"use strict";var V1=Se(),W1=Rs(),h0=Ds(),H1=Os(),K1=Mo(),p0=dc(),z1=gf(),G1=Zg(),ey="Block collections are not allowed within flow collections",ty=n=>n&&(n.type==="block-map"||n.type==="block-seq");function Y1({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?h0.YAMLMap:H1.YAMLSeq),l=new c(t.schema);l.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){let E=r.items[S],{start:T,key:v,sep:R,value:A}=E,$=p0.resolveProps(T,{flow:a,indicator:"explicit-key-ind",next:v??R?.[0],offset:d,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!$.found){if(!$.anchor&&!$.tag&&!R&&!A){S===0&&$.comma?s($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):S<r.items.length-1&&s($.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),$.comment&&(l.comment?l.comment+=`
|
|
102
|
+
`+$.comment:l.comment=$.comment),d=$.end;continue}!o&&t.options.strict&&z1.containsNewline(v)&&s(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)$.comma&&s($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if($.comma||s($.start,"MISSING_CHAR",`Missing , between ${a} items`),$.comment){let W="";e:for(let j of T)switch(j.type){case"comma":case"space":break;case"comment":W=j.source.substring(1);break e;default:break e}if(W){let j=l.items[l.items.length-1];V1.isPair(j)&&(j=j.value??j.key),j.comment?j.comment+=`
|
|
103
|
+
`+W:j.comment=W,$.comment=$.comment.substring(W.length+1)}}if(!o&&!R&&!$.found){let W=A?n(t,A,$,s):e(t,$.end,R,null,$,s);l.items.push(W),d=W.range[2],ty(A)&&s(W.range,"BLOCK_IN_FLOW",ey)}else{t.atKey=!0;let W=$.end,j=v?n(t,v,$,s):e(t,W,T,null,$,s);ty(v)&&s(j.range,"BLOCK_IN_FLOW",ey),t.atKey=!1;let ie=p0.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:A,offset:j.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(ie.found){if(!o&&!$.found&&t.options.strict){if(R)for(let he of R){if(he===ie.found)break;if(he.type==="newline"){s(he,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}$.start<ie.found.offset-1024&&s(ie.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source&&A.source[0]===":"?s(A,"MISSING_CHAR",`Missing space after : in ${a}`):s(ie.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let qe=A?n(t,A,ie,s):ie.found?e(t,ie.end,R,null,ie,s):null;qe?ty(A)&&s(qe.range,"BLOCK_IN_FLOW",ey):ie.comment&&(j.comment?j.comment+=`
|
|
104
|
+
`+ie.comment:j.comment=ie.comment);let wt=new W1.Pair(j,qe);if(t.options.keepSourceTokens&&(wt.srcToken=E),o){let he=l;G1.mapIncludes(t,he.items,j)&&s(W,"DUPLICATE_KEY","Map keys must be unique"),he.items.push(wt)}else{let he=new h0.YAMLMap(t.schema);he.flow=!0,he.items.push(wt);let Cn=(qe??j).range;he.range=[j.range[0],Cn[1],Cn[2]],l.items.push(he)}d=qe?qe.range[2]:ie.end}}let f=o?"}":"]",[p,...b]=r.end,g=d;if(p&&p.source===f)g=p.offset+p.source.length;else{let S=a[0].toUpperCase()+a.substring(1),E=u?`${S} must end with a ${f}`:`${S} in block collection must be sufficiently indented and end with a ${f}`;s(d,u?"MISSING_CHAR":"BAD_INDENT",E),p&&p.source.length!==1&&b.unshift(p)}if(b.length>0){let S=K1.resolveEnd(b,g,t.options.strict,s);S.comment&&(l.comment?l.comment+=`
|
|
105
|
+
`+S.comment:l.comment=S.comment),l.range=[r.offset,g,S.offset]}else l.range=[r.offset,g,g];return l}m0.resolveFlowCollection=Y1});var v0=w(y0=>{"use strict";var J1=Se(),X1=_t(),Q1=Ds(),Z1=Os(),eq=l0(),tq=d0(),nq=g0();function ny(n,e,t,r,s,i){let o=t.type==="block-map"?eq.resolveBlockMap(n,e,t,r,i):t.type==="block-seq"?tq.resolveBlockSeq(n,e,t,r,i):nq.resolveFlowCollection(n,e,t,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function rq(n,e,t,r,s){let i=r.tag,o=i?e.directives.tagName(i.source,f=>s(i,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=r,b=f&&i?f.offset>i.offset?f:i:f??i;b&&(!p||p.offset<b.offset)&&s(b,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Q1.YAMLMap.tagName&&a==="map"||o===Z1.YAMLSeq.tagName&&a==="seq")return ny(n,e,t,s,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){let f=e.schema.knownTags[o];if(f&&f.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?.collection?s(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ny(n,e,t,s,o)}let l=ny(n,e,t,s,o,c),u=c.resolve?.(l,f=>s(i,"TAG_RESOLVE_FAILED",f),e.options)??l,d=J1.isNode(u)?u:new X1.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}y0.composeCollection=rq});var sy=w(b0=>{"use strict";var ry=_t();function sq(n,e,t){let r=e.offset,s=iq(e,n.options.strict,t);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};let i=s.mode===">"?ry.Scalar.BLOCK_FOLDED:ry.Scalar.BLOCK_LITERAL,o=e.source?oq(e.source):[],a=o.length;for(let g=o.length-1;g>=0;--g){let S=o[g][1];if(S===""||S==="\r")a=g;else break}if(a===0){let g=s.chomp==="+"&&o.length>0?`
|
|
106
|
+
`.repeat(Math.max(1,o.length-1)):"",S=r+s.length;return e.source&&(S+=e.source.length),{value:g,type:i,comment:s.comment,range:[r,S,S]}}let c=e.indent+s.indent,l=e.offset+s.length,u=0;for(let g=0;g<a;++g){let[S,E]=o[g];if(E===""||E==="\r")s.indent===0&&S.length>c&&(c=S.length);else{S.length<c&&t(l+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=S.length),u=g,c===0&&!n.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=S.length+E.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>c&&(a=g+1);let d="",f="",p=!1;for(let g=0;g<u;++g)d+=o[g][0].slice(c)+`
|
|
107
|
+
`;for(let g=u;g<a;++g){let[S,E]=o[g];l+=S.length+E.length+1;let T=E[E.length-1]==="\r";if(T&&(E=E.slice(0,-1)),E&&S.length<c){let R=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;t(l-E.length-(T?2:1),"BAD_INDENT",R),S=""}i===ry.Scalar.BLOCK_LITERAL?(d+=f+S.slice(c)+E,f=`
|
|
108
|
+
`):S.length>c||E[0]===" "?(f===" "?f=`
|
|
109
109
|
`:!p&&f===`
|
|
110
110
|
`&&(f=`
|
|
111
111
|
|
|
112
|
-
`),d+=f+
|
|
113
|
-
`,p=!0):
|
|
112
|
+
`),d+=f+S.slice(c)+E,f=`
|
|
113
|
+
`,p=!0):E===""?f===`
|
|
114
114
|
`?d+=`
|
|
115
115
|
`:f=`
|
|
116
|
-
`:(d+=f+
|
|
116
|
+
`:(d+=f+E,f=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)d+=`
|
|
117
117
|
`+o[g][0].slice(c);d[d.length-1]!==`
|
|
118
118
|
`&&(d+=`
|
|
119
119
|
`);break;default:d+=`
|
|
120
|
-
`}let b=
|
|
120
|
+
`}let b=r+s.length+e.source.length;return{value:d,type:i,comment:s.comment,range:[r,b,b]}}function iq({offset:n,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],i=s[0],o=0,a="",c=-1;for(let f=1;f<s.length;++f){let p=s[f];if(!a&&(p==="-"||p==="+"))a=p;else{let b=Number(p);!o&&b?o=b:c===-1&&(c=n+f)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,u="",d=s.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":l=!0;case"newline":d+=p.source.length;break;case"comment":t&&!l&&r(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=p.source.length,u=p.source.substring(1);break;case"error":r(p,"UNEXPECTED_TOKEN",p.message),d+=p.source.length;break;default:{let b=`Unexpected token in block scalar header: ${p.type}`;r(p,"UNEXPECTED_TOKEN",b);let g=p.source;g&&typeof g=="string"&&(d+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:d}}function oq(n){let e=n.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),i=[r?.[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}b0.resolveBlockScalar=sq});var oy=w(S0=>{"use strict";var iy=_t(),aq=Mo();function cq(n,e,t){let{offset:r,type:s,source:i,end:o}=n,a,c,l=(f,p,b)=>t(r+f,p,b);switch(s){case"scalar":a=iy.Scalar.PLAIN,c=lq(i,l);break;case"single-quoted-scalar":a=iy.Scalar.QUOTE_SINGLE,c=uq(i,l);break;case"double-quoted-scalar":a=iy.Scalar.QUOTE_DOUBLE,c=dq(i,l);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}let u=r+i.length,d=aq.resolveEnd(o,u,e,t);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function lq(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),T0(n)}function uq(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),T0(n.slice(1,-1)).replace(/''/g,"'")}function T0(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
121
121
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
122
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let
|
|
122
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(n);if(!r)return n;let s=r[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;r=t.exec(n);)r[1]===""?i===`
|
|
123
123
|
`?s+=i:i=`
|
|
124
|
-
`:(s+=i+
|
|
124
|
+
`:(s+=i+r[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(n),s+i+(r?.[1]??"")}function dq(n,e){let t="";for(let r=1;r<n.length-1;++r){let s=n[r];if(!(s==="\r"&&n[r+1]===`
|
|
125
125
|
`))if(s===`
|
|
126
|
-
`){let{fold:i,offset:o}=
|
|
127
|
-
`)for(i=r
|
|
128
|
-
`)for(i=
|
|
129
|
-
`&&!(o==="\r"&&r
|
|
130
|
-
`)&&(t+=
|
|
131
|
-
`||
|
|
132
|
-
`);)
|
|
126
|
+
`){let{fold:i,offset:o}=fq(n,r);t+=i,r=o}else if(s==="\\"){let i=n[++r],o=hq[i];if(o)t+=o;else if(i===`
|
|
127
|
+
`)for(i=n[r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="\r"&&n[r+1]===`
|
|
128
|
+
`)for(i=n[++r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];t+=pq(n,r+1,a,e),r+=a}else{let a=n.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(s===" "||s===" "){let i=r,o=n[r+1];for(;o===" "||o===" ";)o=n[++r+1];o!==`
|
|
129
|
+
`&&!(o==="\r"&&n[r+2]===`
|
|
130
|
+
`)&&(t+=r>i?n.slice(i,r+1):s)}else t+=s}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function fq(n,e){let t="",r=n[e+1];for(;(r===" "||r===" "||r===`
|
|
131
|
+
`||r==="\r")&&!(r==="\r"&&n[e+2]!==`
|
|
132
|
+
`);)r===`
|
|
133
133
|
`&&(t+=`
|
|
134
|
-
`),e+=1,n
|
|
135
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
134
|
+
`),e+=1,r=n[e+1];return t||(t=" "),{fold:t,offset:e}}var hq={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 pq(n,e,t,r){let s=n.substr(e,t),o=s.length===t&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){let a=n.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}S0.resolveFlowScalar=cq});var E0=w(w0=>{"use strict";var pi=Se(),_0=_t(),mq=sy(),gq=oy();function yq(n,e,t,r){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?mq.resolveBlockScalar(n,e,r):gq.resolveFlowScalar(e,n.options.strict,r),c=t?n.directives.tagName(t.source,d=>r(t,"TAG_RESOLVE_FAILED",d)):null,l;n.options.stringKeys&&n.atKey?l=n.schema[pi.SCALAR]:c?l=vq(n.schema,s,c,t,r):e.type==="scalar"?l=bq(n,s,e,r):l=n.schema[pi.SCALAR];let u;try{let d=l.resolve(s,f=>r(t??e,"TAG_RESOLVE_FAILED",f),n.options);u=pi.isScalar(d)?d:new _0.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);r(t??e,"TAG_RESOLVE_FAILED",f),u=new _0.Scalar(s)}return u.range=a,u.source=s,i&&(u.type=i),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function vq(n,e,t,r,s){if(t==="!")return n[pi.SCALAR];let i=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[pi.SCALAR])}function bq({atKey:n,directives:e,schema:t},r,s,i){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(r))||t[pi.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(r))??t[pi.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}w0.composeScalar=yq});var N0=w(k0=>{"use strict";function Tq(n,e,t){if(e){t===null&&(t=e.length);for(let r=t-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":n-=s.source.length;continue}for(s=e[++r];s?.type==="space";)n+=s.source.length,s=e[++r];break}}return n}k0.emptyScalarPosition=Tq});var C0=w(cy=>{"use strict";var Sq=Ha(),_q=Se(),wq=v0(),P0=E0(),Eq=Mo(),kq=N0(),Nq={composeNode:R0,composeEmptyNode:ay};function R0(n,e,t,r){let s=n.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=t,l,u=!0;switch(e.type){case"alias":l=Pq(n,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=P0.composeScalar(n,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=wq.composeCollection(Nq,n,e,t,r),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",d),l=ay(n,e.offset,void 0,null,t,r),u=!1}}return a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&n.options.stringKeys&&(!_q.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),n.options.keepSourceTokens&&u&&(l.srcToken=e),l}function ay(n,e,t,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:kq.emptyScalarPosition(e,t,r),indent:-1,source:""},d=P0.composeScalar(n,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function Pq({options:n},{offset:e,source:t,end:r},s){let i=new Sq.Alias(t.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Eq.resolveEnd(r,o,n.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}cy.composeEmptyNode=ay;cy.composeNode=R0});var A0=w(O0=>{"use strict";var Rq=ac(),D0=C0(),Cq=Mo(),Dq=dc();function Oq(n,e,{offset:t,start:r,value:s,end:i},o){let a=Object.assign({_directives:e},n),c=new Rq.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Dq.resolveProps(r,{indicator:"doc-start",next:s??i?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?D0.composeNode(l,s,u,o):D0.composeEmptyNode(l,u.end,r,null,u,o);let d=c.contents.range[2],f=Cq.resolveEnd(i,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[t,d,f.offset],c}O0.composeDoc=Oq});var uy=w(x0=>{"use strict";var Aq=Ym(),Iq=ac(),fc=uc(),I0=Se(),Mq=A0(),xq=Mo();function hc(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function M0(n){let e="",t=!1,r=!1;for(let s=0;s<n.length;++s){let i=n[s];switch(i[0]){case"#":e+=(e===""?"":r?`
|
|
136
136
|
|
|
137
137
|
`:`
|
|
138
|
-
`)+(i.substring(1)||" "),t=!0,
|
|
139
|
-
${
|
|
140
|
-
${a}`:
|
|
141
|
-
${o}`:
|
|
142
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
138
|
+
`)+(i.substring(1)||" "),t=!0,r=!1;break;case"%":n[s+1]?.[0]!=="#"&&(s+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}var ly=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,s,i)=>{let o=hc(t);i?this.warnings.push(new fc.YAMLWarning(o,r,s)):this.errors.push(new fc.YAMLParseError(o,r,s))},this.directives=new Aq.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:s}=M0(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
139
|
+
${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(I0.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];I0.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
|
|
140
|
+
${a}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
|
|
141
|
+
${o}`:r}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:M0(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let s of e)yield*this.next(s);yield*this.end(t,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,r,s)=>{let i=hc(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Mq.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new fc.YAMLParseError(hc(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new fc.YAMLParseError(hc(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let t=xq.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
142
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new fc.YAMLParseError(hc(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),s=new Iq.Document(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}};x0.Composer=ly});var q0=w(yf=>{"use strict";var $q=sy(),Lq=oy(),qq=uc(),$0=Ja();function jq(n,e=!0,t){if(n){let r=(s,i,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(t)t(a,i,o);else throw new qq.YAMLParseError([a,a+1],i,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Lq.resolveFlowScalar(n,e,r);case"block-scalar":return $q.resolveBlockScalar({options:{strict:e}},n,r)}}return null}function Fq(n,e){let{implicitKey:t=!1,indent:r,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=$0.stringifyString({type:o,value:n},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
143
143
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
144
144
|
`),u=a.substring(0,l),d=a.substring(l+1)+`
|
|
145
|
-
`,f=[{type:"block-scalar-header",offset:i,indent:
|
|
146
|
-
`}),{type:"block-scalar",offset:i,indent:
|
|
147
|
-
`),
|
|
148
|
-
`;if(
|
|
149
|
-
`});for(let c of Object.keys(
|
|
150
|
-
`};delete
|
|
145
|
+
`,f=[{type:"block-scalar-header",offset:i,indent:r,source:u}];return L0(f,c)||f.push({type:"newline",offset:-1,indent:r,source:`
|
|
146
|
+
`}),{type:"block-scalar",offset:i,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function Bq(n,e,t={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=t,a="indent"in n?n.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=n.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=$0.stringifyString({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Uq(n,c);break;case'"':dy(n,c,"double-quoted-scalar");break;case"'":dy(n,c,"single-quoted-scalar");break;default:dy(n,c,"scalar")}}function Uq(n,e){let t=e.indexOf(`
|
|
147
|
+
`),r=e.substring(0,t),s=e.substring(t+1)+`
|
|
148
|
+
`;if(n.type==="block-scalar"){let i=n.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,n.source=s}else{let{offset:i}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:r}];L0(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
149
|
+
`});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:s})}}function L0(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function dy(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let r=n.props.slice(1),s=e.length;n.props[0].type==="block-scalar-header"&&(s-=n.props[0].source.length);for(let i of r)i.offset+=s;delete n.props,Object.assign(n,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{let s={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
150
|
+
`};delete n.items,Object.assign(n,{type:t,source:e,end:[s]});break}default:{let r="indent"in n?n.indent:-1,s="end"in n&&Array.isArray(n.end)?n.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(n))i!=="type"&&i!=="offset"&&delete n[i];Object.assign(n,{type:t,indent:r,source:e,end:s})}}}yf.createScalarToken=Fq;yf.resolveAsScalar=jq;yf.setScalarValue=Bq});var F0=w(j0=>{"use strict";var Vq=n=>"type"in n?bf(n):vf(n);function bf(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=bf(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=vf(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=vf(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=vf(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function vf({start:n,key:e,sep:t,value:r}){let s="";for(let i of n)s+=i.source;if(e&&(s+=bf(e)),t)for(let i of t)s+=i.source;return r&&(s+=bf(r)),s}j0.stringify=Vq});var W0=w(V0=>{"use strict";var fy=Symbol("break visit"),Wq=Symbol("skip children"),B0=Symbol("remove item");function mi(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),U0(Object.freeze([]),n,e)}mi.BREAK=fy;mi.SKIP=Wq;mi.REMOVE=B0;mi.itemAtPath=(n,e)=>{let t=n;for(let[r,s]of e){let i=t?.[r];if(i&&"items"in i)t=i.items[s];else return}return t};mi.parentCollection=(n,e)=>{let t=mi.itemAtPath(n,e.slice(0,-1)),r=e[e.length-1][0],s=t?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function U0(n,e,t){let r=t(e,n);if(typeof r=="symbol")return r;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=U0(Object.freeze(n.concat([[s,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===fy)return fy;a===B0&&(i.items.splice(o,1),o-=1)}}typeof r=="function"&&s==="key"&&(r=r(e,n))}}return typeof r=="function"?r(e,n):r}V0.visit=mi});var Tf=w(gn=>{"use strict";var hy=q0(),Hq=F0(),Kq=W0(),py="\uFEFF",my="",gy="",yy="",zq=n=>!!n&&"items"in n,Gq=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function Yq(n){switch(n){case py:return"<BOM>";case my:return"<DOC>";case gy:return"<FLOW_END>";case yy:return"<SCALAR>";default:return JSON.stringify(n)}}function Jq(n){switch(n){case py:return"byte-order-mark";case my:return"doc-mode";case gy:return"flow-error-end";case yy: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(
|
|
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(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}gn.createScalarToken=hy.createScalarToken;gn.resolveAsScalar=hy.resolveAsScalar;gn.setScalarValue=hy.setScalarValue;gn.stringify=Hq.stringify;gn.visit=Kq.visit;gn.BOM=py;gn.DOCUMENT=my;gn.FLOW_END=gy;gn.SCALAR=yy;gn.isCollection=zq;gn.isScalar=Gq;gn.prettyToken=Yq;gn.tokenType=Jq});var Ty=w(K0=>{"use strict";var pc=Tf();function or(n){switch(n){case void 0:case" ":case`
|
|
153
|
+
`:case"\r":case" ":return!0;default:return!1}}var H0=new Set("0123456789ABCDEFabcdef"),Xq=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Sf=new Set(",[]{}"),Qq=new Set(` ,[]{}
|
|
154
|
+
\r `),vy=n=>!n||Qq.has(n),by=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
155
155
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
156
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let
|
|
157
|
-
`||!s&&!this.atEnd)return e+
|
|
158
|
-
`||
|
|
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]===
|
|
160
|
-
`,this.pos);if(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=
|
|
161
|
-
`,i)}s!==-1&&(t=s-(
|
|
156
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){let s=this.buffer[r+e+1];if(s===`
|
|
157
|
+
`||!s&&!this.atEnd)return e+r+1}return t===`
|
|
158
|
+
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&or(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]===pc.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,r=e.indexOf("#");for(;r!==-1;){let i=e[r-1];if(i===" "||i===" "){t=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let i=e[t-1];if(i===" "||i===" ")t-=1;else break}let s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield pc.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&or(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!or(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&or(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(vy),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&or(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield pc.FLOW_END,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(vy),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||or(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),s=r.indexOf(`
|
|
160
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
|
|
161
|
+
`,i)}s!==-1&&(t=s-(r[s-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>or(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":t+=1;break;case`
|
|
162
162
|
`:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
163
|
-
`)break}default:break e}if(!
|
|
164
|
-
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(
|
|
165
|
-
`;)
|
|
166
|
-
`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield
|
|
167
|
-
`?(
|
|
168
|
-
`,i=this.buffer[
|
|
169
|
-
`){let o=this.continueScalar(
|
|
163
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
164
|
+
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
165
|
+
`;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
166
|
+
`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield pc.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){let i=this.buffer[r+1];if(or(i)||e&&Sf.has(i))break;t=r}else if(or(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
|
|
167
|
+
`?(r+=1,s=`
|
|
168
|
+
`,i=this.buffer[r+1]):t=r),i==="#"||e&&Sf.has(i))break;if(s===`
|
|
169
|
+
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Sf.has(s))break;t=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield pc.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(vy))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(or(t)||e&&Sf.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!or(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Xq.has(t))t=this.buffer[++e];else if(t==="%"&&H0.has(this.buffer[e+1])&&H0.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
170
170
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
171
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,
|
|
171
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");let s=t-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=t),s}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};K0.Lexer=by});var _y=w(z0=>{"use strict";var Sy=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let i=t+r>>1;this.lineStarts[i]<e?t=i+1:r=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let s=this.lineStarts[t-1];return{line:t,col:e-s+1}}}};z0.LineCounter=Sy});var Ey=w(Q0=>{"use strict";var G0=Tf(),Zq=Ty();function gi(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Y0(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function X0(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function _f(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function xo(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function J0(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!gi(e.start,"explicit-key-ind")&&!gi(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,X0(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 wy=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 Zq.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",G0.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=G0.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&J0(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Y0(s.start)===-1&&(t.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Y0(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=_f(this.peek(2)),r=xo(t),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
172
172
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
173
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let
|
|
173
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):s||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(gi(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(X0(t.key)&&!gi(t.sep,"newline")){let o=xo(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(gi(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=xo(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):gi(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||t.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){r&&o.type!=="block-seq"&&e.items.push({start:i}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||gi(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let s=_f(r),i=xo(s);J0(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
174
174
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
175
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=lf(e),n=No(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=lf(e),n=No(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};j0.Parser=uy});var W0=k(ac=>{"use strict";var F0=Xg(),Oq=Qa(),oc=tc(),Aq=Ym(),Iq=be(),Mq=ly(),B0=dy();function U0(r){let e=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||e&&new Mq.LineCounter||null,prettyErrors:e}}function xq(r,e={}){let{lineCounter:t,prettyErrors:n}=U0(e),s=new B0.Parser(t?.addNewLine),i=new F0.Composer(e),o=Array.from(i.compose(s.parse(r)));if(n&&t)for(let a of o)a.errors.forEach(oc.prettifyError(r,t)),a.warnings.forEach(oc.prettifyError(r,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function V0(r,e={}){let{lineCounter:t,prettyErrors:n}=U0(e),s=new B0.Parser(t?.addNewLine),i=new F0.Composer(e),o=null;for(let a of i.compose(s.parse(r),!0,r.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new oc.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(oc.prettifyError(r,t)),o.warnings.forEach(oc.prettifyError(r,t))),o}function Lq(r,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=V0(r,t);if(!s)return null;if(s.warnings.forEach(i=>Aq.warn(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:n},t))}function $q(r,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(r===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return Iq.isDocument(r)&&!n?r.toString(t):new Oq.Document(r,n,t).toString(t)}ac.parse=Lq;ac.parseAllDocuments=xq;ac.parseDocument=V0;ac.stringify=$q});var hy=k(Me=>{"use strict";var qq=Xg(),jq=Qa(),Fq=Og(),fy=tc(),Bq=La(),ws=be(),Uq=Ts(),Vq=bt(),Wq=Ss(),Hq=ks(),Kq=af(),zq=ay(),Gq=ly(),Yq=dy(),uf=W0(),H0=Aa();Me.Composer=qq.Composer;Me.Document=jq.Document;Me.Schema=Fq.Schema;Me.YAMLError=fy.YAMLError;Me.YAMLParseError=fy.YAMLParseError;Me.YAMLWarning=fy.YAMLWarning;Me.Alias=Bq.Alias;Me.isAlias=ws.isAlias;Me.isCollection=ws.isCollection;Me.isDocument=ws.isDocument;Me.isMap=ws.isMap;Me.isNode=ws.isNode;Me.isPair=ws.isPair;Me.isScalar=ws.isScalar;Me.isSeq=ws.isSeq;Me.Pair=Uq.Pair;Me.Scalar=Vq.Scalar;Me.YAMLMap=Wq.YAMLMap;Me.YAMLSeq=Hq.YAMLSeq;Me.CST=Kq;Me.Lexer=zq.Lexer;Me.LineCounter=Gq.LineCounter;Me.Parser=Yq.Parser;Me.parse=uf.parse;Me.parseAllDocuments=uf.parseAllDocuments;Me.parseDocument=uf.parseDocument;Me.stringify=uf.stringify;Me.visit=H0.visit;Me.visitAsync=H0.visitAsync});var J0=k((c5,Y0)=>{"use strict";Y0.exports=z0;function z0(r,e,t){r instanceof RegExp&&(r=K0(r,t)),e instanceof RegExp&&(e=K0(e,t));var n=G0(r,e,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+e.length)}}function K0(r,e){var t=e.match(r);return t?t[0]:null}z0.range=G0;function G0(r,e,t){var n,s,i,o,a,c=t.indexOf(r),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(r===e)return[c,l];for(n=[],i=t.length;u>=0&&!a;)u==c?(n.push(u),c=t.indexOf(r,u+1)):n.length==1?a=[n.pop(),l]:(s=n.pop(),s<i&&(i=s,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;n.length&&(a=[i,o])}return a}});var sR=k((l5,nR)=>{var X0=J0();nR.exports=Qq;var Q0="\0SLASH"+Math.random()+"\0",Z0="\0OPEN"+Math.random()+"\0",my="\0CLOSE"+Math.random()+"\0",eR="\0COMMA"+Math.random()+"\0",tR="\0PERIOD"+Math.random()+"\0";function py(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function Jq(r){return r.split("\\\\").join(Q0).split("\\{").join(Z0).split("\\}").join(my).split("\\,").join(eR).split("\\.").join(tR)}function Xq(r){return r.split(Q0).join("\\").split(Z0).join("{").split(my).join("}").split(eR).join(",").split(tR).join(".")}function rR(r){if(!r)return[""];var e=[],t=X0("{","}",r);if(!t)return r.split(",");var n=t.pre,s=t.body,i=t.post,o=n.split(",");o[o.length-1]+="{"+s+"}";var a=rR(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Qq(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),cc(Jq(r),!0).map(Xq)):[]}function Zq(r){return"{"+r+"}"}function ej(r){return/^-?0\d/.test(r)}function tj(r,e){return r<=e}function rj(r,e){return r>=e}function cc(r,e){var t=[],n=X0("{","}",r);if(!n)return[r];var s=n.pre,i=n.post.length?cc(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<i.length;o++){var a=s+"{"+n.body+"}"+i[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=c||l,d=n.body.indexOf(",")>=0;if(!u&&!d)return n.post.match(/,.*\}/)?(r=n.pre+"{"+n.body+my+n.post,cc(r)):[r];var f;if(u)f=n.body.split(/\.\./);else if(f=rR(n.body),f.length===1&&(f=cc(f[0],!1).map(Zq),f.length===1))return i.map(function(Le){return n.pre+f[0]+Le});var p;if(u){var b=py(f[0]),g=py(f[1]),_=Math.max(f[0].length,f[1].length),w=f.length==3?Math.abs(py(f[2])):1,T=tj,v=g<b;v&&(w*=-1,T=rj);var R=f.some(ej);p=[];for(var A=b;T(A,g);A+=w){var L;if(l)L=String.fromCharCode(A),L==="\\"&&(L="");else if(L=String(A),R){var W=_-L.length;if(W>0){var j=new Array(W+1).join("0");A<0?L="-"+j+L.slice(1):L=j+L}}p.push(L)}}else{p=[];for(var ne=0;ne<f.length;ne++)p.push.apply(p,cc(f[ne],!1))}for(var ne=0;ne<p.length;ne++)for(var o=0;o<i.length;o++){var a=s+p[ne]+i[o];(!e||u||a)&&t.push(a)}}return t}});var Nc=k(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.regexpCode=Se.getEsmExportName=Se.getProperty=Se.safeStringify=Se.stringify=Se.strConcat=Se.addCodeArg=Se.str=Se._=Se.nil=Se._Code=Se.Name=Se.IDENTIFIER=Se._CodeOrName=void 0;var wc=class{};Se._CodeOrName=wc;Se.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var hi=class extends wc{constructor(e){if(super(),!Se.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}}};Se.Name=hi;var Lr=class extends wc{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>(n instanceof hi&&(t[n.str]=(t[n.str]||0)+1),t),{})}};Se._Code=Lr;Se.nil=new Lr("");function HR(r,...e){let t=[r[0]],n=0;for(;n<e.length;)My(t,e[n]),t.push(r[++n]);return new Lr(t)}Se._=HR;var Iy=new Lr("+");function KR(r,...e){let t=[Ec(r[0])],n=0;for(;n<e.length;)t.push(Iy),My(t,e[n]),t.push(Iy,Ec(r[++n]));return uF(t),new Lr(t)}Se.str=KR;function My(r,e){e instanceof Lr?r.push(...e._items):e instanceof hi?r.push(e):r.push(hF(e))}Se.addCodeArg=My;function uF(r){let e=1;for(;e<r.length-1;){if(r[e]===Iy){let t=dF(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function dF(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof hi||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof hi))return`"${r}${e.slice(1)}`}function fF(r,e){return e.emptyStr()?r:r.emptyStr()?e:KR`${r}${e}`}Se.strConcat=fF;function hF(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:Ec(Array.isArray(r)?r.join(","):r)}function pF(r){return new Lr(Ec(r))}Se.stringify=pF;function Ec(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Se.safeStringify=Ec;function mF(r){return typeof r=="string"&&Se.IDENTIFIER.test(r)?new Lr(`.${r}`):HR`[${r}]`}Se.getProperty=mF;function gF(r){if(typeof r=="string"&&Se.IDENTIFIER.test(r))return new Lr(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}Se.getEsmExportName=gF;function yF(r){return new Lr(r.toString())}Se.regexpCode=yF});var $y=k(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.ValueScope=pr.ValueScopeName=pr.Scope=pr.varKinds=pr.UsedValueState=void 0;var hr=Nc(),xy=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Df;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(Df||(pr.UsedValueState=Df={}));pr.varKinds={const:new hr.Name("const"),let:new hr.Name("let"),var:new hr.Name("var")};var Of=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof hr.Name?e:this.name(e)}name(e){return new hr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};pr.Scope=Of;var Af=class extends hr.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=(0,hr._)`.${new hr.Name(t)}[${n}]`}};pr.ValueScopeName=Af;var vF=(0,hr._)`\n`,Ly=class extends Of{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?vF:hr.nil}}get(){return this._scope}name(e){return new Af(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=t.key)!==null&&n!==void 0?n:t.ref,a=this._values[i];if(a){let u=a.get(o);if(u)return u}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=t.ref,s.setValue(t,{property:i,itemIndex:l}),s}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,hr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,n)}_reduceValues(e,t,n={},s){let i=hr.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Df.Started);let u=t(l);if(u){let d=this.opts.es5?pr.varKinds.var:pr.varKinds.const;i=(0,hr._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=s?.(l))i=(0,hr._)`${i}${u}${this.opts._n}`;else throw new xy(l);c.set(l,Df.Completed)})}return i}};pr.ValueScope=Ly});var oe=k(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.or=le.and=le.not=le.CodeGen=le.operators=le.varKinds=le.ValueScopeName=le.ValueScope=le.Scope=le.Name=le.regexpCode=le.stringify=le.getProperty=le.nil=le.strConcat=le.str=le._=void 0;var ye=Nc(),sn=$y(),Cs=Nc();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return Cs._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return Cs.str}});Object.defineProperty(le,"strConcat",{enumerable:!0,get:function(){return Cs.strConcat}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return Cs.nil}});Object.defineProperty(le,"getProperty",{enumerable:!0,get:function(){return Cs.getProperty}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return Cs.stringify}});Object.defineProperty(le,"regexpCode",{enumerable:!0,get:function(){return Cs.regexpCode}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return Cs.Name}});var Lf=$y();Object.defineProperty(le,"Scope",{enumerable:!0,get:function(){return Lf.Scope}});Object.defineProperty(le,"ValueScope",{enumerable:!0,get:function(){return Lf.ValueScope}});Object.defineProperty(le,"ValueScopeName",{enumerable:!0,get:function(){return Lf.ValueScopeName}});Object.defineProperty(le,"varKinds",{enumerable:!0,get:function(){return Lf.varKinds}});le.operators={GT:new ye._Code(">"),GTE:new ye._Code(">="),LT:new ye._Code("<"),LTE:new ye._Code("<="),EQ:new ye._Code("==="),NEQ:new ye._Code("!=="),NOT:new ye._Code("!"),OR:new ye._Code("||"),AND:new ye._Code("&&"),ADD:new ye._Code("+")};var Vn=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},qy=class extends Vn{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?sn.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=jo(this.rhs,e,t)),this}get names(){return this.rhs instanceof ye._CodeOrName?this.rhs.names:{}}},If=class extends Vn{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof ye.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=jo(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ye.Name?{}:{...this.lhs.names};return xf(e,this.rhs)}},jy=class extends If{constructor(e,t,n,s){super(e,n,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Fy=class extends Vn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},By=class extends Vn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Uy=class extends Vn{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Vy=class extends Vn{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=jo(this.code,e,t),this}get names(){return this.code instanceof ye._CodeOrName?this.code.names:{}}},Pc=class extends Vn{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,t)||(bF(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>gi(e,t.names),{})}},Wn=class extends Pc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Wy=class extends Pc{},qo=class extends Wn{};qo.kind="else";var pi=class r extends Wn{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new qo(n):n}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(zR(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=jo(this.condition,e,t),this}get names(){let e=super.names;return xf(e,this.condition),this.else&&gi(e,this.else.names),e}};pi.kind="if";var mi=class extends Wn{};mi.kind="for";var Hy=class extends mi{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=jo(this.iteration,e,t),this}get names(){return gi(super.names,this.iteration.names)}},Ky=class extends mi{constructor(e,t,n,s){super(),this.varKind=e,this.name=t,this.from=n,this.to=s}render(e){let t=e.es5?sn.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${t} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=xf(super.names,this.from);return xf(e,this.to)}},Mf=class extends mi{constructor(e,t,n,s){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=jo(this.iterable,e,t),this}get names(){return gi(super.names,this.iterable.names)}},Rc=class extends Wn{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Rc.kind="func";var Cc=class extends Pc{render(e){return"return "+super.render(e)}};Cc.kind="return";var zy=class extends Wn{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,s;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&gi(e,this.catch.names),this.finally&&gi(e,this.finally.names),e}},Dc=class extends Wn{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Dc.kind="catch";var Oc=class extends Wn{render(e){return"finally"+super.render(e)}};Oc.kind="finally";var Gy=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
176
|
-
`:""},this._extScope=e,this._scope=new sn.Scope({parent:e}),this._nodes=[new Wy]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,s){let i=this._scope.toName(t);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new qy(e,i,n)),i}const(e,t,n){return this._def(sn.varKinds.const,e,t,n)}let(e,t,n){return this._def(sn.varKinds.let,e,t,n)}var(e,t,n){return this._def(sn.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new If(e,t,n))}add(e,t){return this._leafNode(new jy(e,le.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==ye.nil&&this._leafNode(new Vy(e)),this}object(...e){let t=["{"];for(let[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,ye.addCodeArg)(t,s));return t.push("}"),new ye._Code(t)}if(e,t,n){if(this._blockNode(new pi(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new pi(e))}else(){return this._elseNode(new qo)}endIf(){return this._endBlockNode(pi,qo)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new Hy(e),t)}forRange(e,t,n,s,i=this.opts.es5?sn.varKinds.var:sn.varKinds.let){let o=this._scope.toName(e);return this._for(new Ky(i,o,t,n),()=>s(o))}forOf(e,t,n,s=sn.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=t instanceof ye.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,ye._)`${o}.length`,a=>{this.var(i,(0,ye._)`${o}[${a}]`),n(i)})}return this._for(new Mf("of",s,i,t),()=>n(i))}forIn(e,t,n,s=this.opts.es5?sn.varKinds.var:sn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,ye._)`Object.keys(${t})`,n);let i=this._scope.toName(e);return this._for(new Mf("in",s,i,t),()=>n(i))}endFor(){return this._endBlockNode(mi)}label(e){return this._leafNode(new Fy(e))}break(e){return this._leafNode(new By(e))}return(e){let t=new Cc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Cc)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new zy;if(this._blockNode(s),this.code(e),t){let i=this.name("e");this._currNode=s.catch=new Dc(i),t(i)}return n&&(this._currNode=s.finally=new Oc,this.code(n)),this._endBlockNode(Dc,Oc)}throw(e){return this._leafNode(new Uy(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=ye.nil,n,s){return this._blockNode(new Rc(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(Rc)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof pi))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};le.CodeGen=Gy;function gi(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function xf(r,e){return e instanceof ye._CodeOrName?gi(r,e.names):r}function jo(r,e,t){if(r instanceof ye.Name)return n(r);if(!s(r))return r;return new ye._Code(r._items.reduce((i,o)=>(o instanceof ye.Name&&(o=n(o)),o instanceof ye._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=t[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof ye._Code&&i._items.some(o=>o instanceof ye.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function bF(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function zR(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,ye._)`!${Yy(r)}`}le.not=zR;var TF=GR(le.operators.AND);function _F(...r){return r.reduce(TF)}le.and=_F;var SF=GR(le.operators.OR);function kF(...r){return r.reduce(SF)}le.or=kF;function GR(r){return(e,t)=>e===ye.nil?t:t===ye.nil?e:(0,ye._)`${Yy(e)} ${r} ${Yy(t)}`}function Yy(r){return r instanceof ye.Name?r:(0,ye._)`(${r})`}});var he=k(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;var Ve=oe(),wF=Nc();function EF(r){let e={};for(let t of r)e[t]=!0;return e}ue.toHash=EF;function NF(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(XR(r,e),!QR(e,r.self.RULES.all))}ue.alwaysValidSchema=NF;function XR(r,e=r.schema){let{opts:t,self:n}=r;if(!t.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||tC(r,`unknown keyword: "${i}"`)}ue.checkUnknownRules=XR;function QR(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}ue.schemaHasRules=QR;function PF(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}ue.schemaHasRulesButRef=PF;function RF({topSchemaRef:r,schemaPath:e},t,n,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Ve._)`${t}`}return(0,Ve._)`${r}${e}${(0,Ve.getProperty)(n)}`}ue.schemaRefOrVal=RF;function CF(r){return ZR(decodeURIComponent(r))}ue.unescapeFragment=CF;function DF(r){return encodeURIComponent(Xy(r))}ue.escapeFragment=DF;function Xy(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=Xy;function ZR(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=ZR;function OF(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}ue.eachItem=OF;function YR({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:n}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Ve.Name?(i instanceof Ve.Name?r(s,i,o):e(s,i,o),o):i instanceof Ve.Name?(e(s,o,i),i):t(i,o);return a===Ve.Name&&!(c instanceof Ve.Name)?n(s,c):c}}ue.mergeEvaluated={props:YR({mergeNames:(r,e,t)=>r.if((0,Ve._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,Ve._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,Ve._)`${t} || {}`).code((0,Ve._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,Ve._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,Ve._)`${t} || {}`),Qy(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:eC}),items:YR({mergeNames:(r,e,t)=>r.if((0,Ve._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,Ve._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,Ve._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,Ve._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function eC(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,Ve._)`{}`);return e!==void 0&&Qy(r,t,e),t}ue.evaluatedPropsToName=eC;function Qy(r,e,t){Object.keys(t).forEach(n=>r.assign((0,Ve._)`${e}${(0,Ve.getProperty)(n)}`,!0))}ue.setEvaluated=Qy;var JR={};function AF(r,e){return r.scopeValue("func",{ref:e,code:JR[e.code]||(JR[e.code]=new wF._Code(e.code))})}ue.useFunc=AF;var Jy;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(Jy||(ue.Type=Jy={}));function IF(r,e,t){if(r instanceof Ve.Name){let n=e===Jy.Num;return t?n?(0,Ve._)`"[" + ${r} + "]"`:(0,Ve._)`"['" + ${r} + "']"`:n?(0,Ve._)`"/" + ${r}`:(0,Ve._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Ve.getProperty)(r).toString():"/"+Xy(r)}ue.getErrorPath=IF;function tC(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}ue.checkStrictMode=tC});var $r=k(Zy=>{"use strict";Object.defineProperty(Zy,"__esModule",{value:!0});var Gt=oe(),MF={data:new Gt.Name("data"),valCxt:new Gt.Name("valCxt"),instancePath:new Gt.Name("instancePath"),parentData:new Gt.Name("parentData"),parentDataProperty:new Gt.Name("parentDataProperty"),rootData:new Gt.Name("rootData"),dynamicAnchors:new Gt.Name("dynamicAnchors"),vErrors:new Gt.Name("vErrors"),errors:new Gt.Name("errors"),this:new Gt.Name("this"),self:new Gt.Name("self"),scope:new Gt.Name("scope"),json:new Gt.Name("json"),jsonPos:new Gt.Name("jsonPos"),jsonLen:new Gt.Name("jsonLen"),jsonPart:new Gt.Name("jsonPart")};Zy.default=MF});var Ac=k(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.extendErrors=Yt.resetErrorsCount=Yt.reportExtraError=Yt.reportError=Yt.keyword$DataError=Yt.keywordError=void 0;var Te=oe(),$f=he(),nr=$r();Yt.keywordError={message:({keyword:r})=>(0,Te.str)`must pass "${r}" keyword validation`};Yt.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,Te.str)`"${r}" keyword must be ${e} ($data)`:(0,Te.str)`"${r}" keyword is invalid ($data)`};function xF(r,e=Yt.keywordError,t,n){let{it:s}=r,{gen:i,compositeRule:o,allErrors:a}=s,c=sC(r,e,t);n??(o||a)?rC(i,c):nC(s,(0,Te._)`[${c}]`)}Yt.reportError=xF;function LF(r,e=Yt.keywordError,t){let{it:n}=r,{gen:s,compositeRule:i,allErrors:o}=n,a=sC(r,e,t);rC(s,a),i||o||nC(n,nr.default.vErrors)}Yt.reportExtraError=LF;function $F(r,e){r.assign(nr.default.errors,e),r.if((0,Te._)`${nr.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,Te._)`${nr.default.vErrors}.length`,e),()=>r.assign(nr.default.vErrors,null)))}Yt.resetErrorsCount=$F;function qF({gen:r,keyword:e,schemaValue:t,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=r.name("err");r.forRange("i",s,nr.default.errors,a=>{r.const(o,(0,Te._)`${nr.default.vErrors}[${a}]`),r.if((0,Te._)`${o}.instancePath === undefined`,()=>r.assign((0,Te._)`${o}.instancePath`,(0,Te.strConcat)(nr.default.instancePath,i.errorPath))),r.assign((0,Te._)`${o}.schemaPath`,(0,Te.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(r.assign((0,Te._)`${o}.schema`,t),r.assign((0,Te._)`${o}.data`,n))})}Yt.extendErrors=qF;function rC(r,e){let t=r.const("err",e);r.if((0,Te._)`${nr.default.vErrors} === null`,()=>r.assign(nr.default.vErrors,(0,Te._)`[${t}]`),(0,Te._)`${nr.default.vErrors}.push(${t})`),r.code((0,Te._)`${nr.default.errors}++`)}function nC(r,e){let{gen:t,validateName:n,schemaEnv:s}=r;s.$async?t.throw((0,Te._)`new ${r.ValidationError}(${e})`):(t.assign((0,Te._)`${n}.errors`,e),t.return(!1))}var yi={keyword:new Te.Name("keyword"),schemaPath:new Te.Name("schemaPath"),params:new Te.Name("params"),propertyName:new Te.Name("propertyName"),message:new Te.Name("message"),schema:new Te.Name("schema"),parentSchema:new Te.Name("parentSchema")};function sC(r,e,t){let{createErrors:n}=r.it;return n===!1?(0,Te._)`{}`:jF(r,e,t)}function jF(r,e,t={}){let{gen:n,it:s}=r,i=[FF(s,t),BF(r,t)];return UF(r,e,i),n.object(...i)}function FF({errorPath:r},{instancePath:e}){let t=e?(0,Te.str)`${r}${(0,$f.getErrorPath)(e,$f.Type.Str)}`:r;return[nr.default.instancePath,(0,Te.strConcat)(nr.default.instancePath,t)]}function BF({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:n}){let s=n?e:(0,Te.str)`${e}/${r}`;return t&&(s=(0,Te.str)`${s}${(0,$f.getErrorPath)(t,$f.Type.Str)}`),[yi.schemaPath,s]}function UF(r,{params:e,message:t},n){let{keyword:s,data:i,schemaValue:o,it:a}=r,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([yi.keyword,s],[yi.params,typeof e=="function"?e(r):e||(0,Te._)`{}`]),c.messages&&n.push([yi.message,typeof t=="function"?t(r):t]),c.verbose&&n.push([yi.schema,o],[yi.parentSchema,(0,Te._)`${u}${d}`],[nr.default.data,i]),l&&n.push([yi.propertyName,l])}});var oC=k(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.boolOrEmptySchema=Fo.topBoolOrEmptySchema=void 0;var VF=Ac(),WF=oe(),HF=$r(),KF={message:"boolean schema is false"};function zF(r){let{gen:e,schema:t,validateName:n}=r;t===!1?iC(r,!1):typeof t=="object"&&t.$async===!0?e.return(HF.default.data):(e.assign((0,WF._)`${n}.errors`,null),e.return(!0))}Fo.topBoolOrEmptySchema=zF;function GF(r,e){let{gen:t,schema:n}=r;n===!1?(t.var(e,!1),iC(r)):t.var(e,!0)}Fo.boolOrEmptySchema=GF;function iC(r,e){let{gen:t,data:n}=r,s={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,VF.reportError)(s,KF,void 0,e)}});var ev=k(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.getRules=Bo.isJSONType=void 0;var YF=["string","number","integer","boolean","null","object","array"],JF=new Set(YF);function XF(r){return typeof r=="string"&&JF.has(r)}Bo.isJSONType=XF;function QF(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}Bo.getRules=QF});var tv=k(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.shouldUseRule=Ds.shouldUseGroup=Ds.schemaHasRulesForType=void 0;function ZF({schema:r,self:e},t){let n=e.RULES.types[t];return n&&n!==!0&&aC(r,n)}Ds.schemaHasRulesForType=ZF;function aC(r,e){return e.rules.some(t=>cC(r,t))}Ds.shouldUseGroup=aC;function cC(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(n=>r[n]!==void 0))}Ds.shouldUseRule=cC});var Ic=k(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.reportTypeError=Jt.checkDataTypes=Jt.checkDataType=Jt.coerceAndCheckDataType=Jt.getJSONTypes=Jt.getSchemaTypes=Jt.DataType=void 0;var eB=ev(),tB=tv(),rB=Ac(),ae=oe(),lC=he(),Uo;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(Uo||(Jt.DataType=Uo={}));function nB(r){let e=uC(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}Jt.getSchemaTypes=nB;function uC(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(eB.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Jt.getJSONTypes=uC;function sB(r,e){let{gen:t,data:n,opts:s}=r,i=iB(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,tB.schemaHasRulesForType)(r,e[0]));if(o){let a=nv(e,n,s.strictNumbers,Uo.Wrong);t.if(a,()=>{i.length?oB(r,e,i):sv(r)})}return o}Jt.coerceAndCheckDataType=sB;var dC=new Set(["string","number","integer","boolean","null"]);function iB(r,e){return e?r.filter(t=>dC.has(t)||e==="array"&&t==="array"):[]}function oB(r,e,t){let{gen:n,data:s,opts:i}=r,o=n.let("dataType",(0,ae._)`typeof ${s}`),a=n.let("coerced",(0,ae._)`undefined`);i.coerceTypes==="array"&&n.if((0,ae._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,ae._)`${s}[0]`).assign(o,(0,ae._)`typeof ${s}`).if(nv(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,ae._)`${a} !== undefined`);for(let l of t)(dC.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),sv(r),n.endIf(),n.if((0,ae._)`${a} !== undefined`,()=>{n.assign(s,a),aB(r,a)});function c(l){switch(l){case"string":n.elseIf((0,ae._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,ae._)`"" + ${s}`).elseIf((0,ae._)`${s} === null`).assign(a,(0,ae._)`""`);return;case"number":n.elseIf((0,ae._)`${o} == "boolean" || ${s} === null
|
|
177
|
-
|| (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,
|
|
178
|
-
|| (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,
|
|
179
|
-
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,ae._)`[${s}]`)}}}function aB({gen:r,parentData:e,parentDataProperty:t},n){r.if((0,ae._)`${e} !== undefined`,()=>r.assign((0,ae._)`${e}[${t}]`,n))}function rv(r,e,t,n=Uo.Correct){let s=n===Uo.Correct?ae.operators.EQ:ae.operators.NEQ,i;switch(r){case"null":return(0,ae._)`${e} ${s} null`;case"array":i=(0,ae._)`Array.isArray(${e})`;break;case"object":i=(0,ae._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,ae._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,ae._)`typeof ${e} ${s} ${r}`}return n===Uo.Correct?i:(0,ae.not)(i);function o(a=ae.nil){return(0,ae.and)((0,ae._)`typeof ${e} == "number"`,a,t?(0,ae._)`isFinite(${e})`:ae.nil)}}Jt.checkDataType=rv;function nv(r,e,t,n){if(r.length===1)return rv(r[0],e,t,n);let s,i=(0,lC.toHash)(r);if(i.array&&i.object){let o=(0,ae._)`typeof ${e} != "object"`;s=i.null?o:(0,ae._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=ae.nil;i.number&&delete i.integer;for(let o in i)s=(0,ae.and)(s,rv(o,e,t,n));return s}Jt.checkDataTypes=nv;var cB={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,ae._)`{type: ${r}}`:(0,ae._)`{type: ${e}}`};function sv(r){let e=lB(r);(0,rB.reportError)(e,cB)}Jt.reportTypeError=sv;function lB(r){let{gen:e,data:t,schema:n}=r,s=(0,lC.schemaRefOrVal)(r,n,"type");return{gen:e,keyword:"type",data:t,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:r}}});var hC=k(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.assignDefaults=void 0;var Vo=oe(),uB=he();function dB(r,e){let{properties:t,items:n}=r.schema;if(e==="object"&&t)for(let s in t)fC(r,s,t[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>fC(r,i,s.default))}qf.assignDefaults=dB;function fC(r,e,t){let{gen:n,compositeRule:s,data:i,opts:o}=r;if(t===void 0)return;let a=(0,Vo._)`${i}${(0,Vo.getProperty)(e)}`;if(s){(0,uB.checkStrictMode)(r,`default is ignored for: ${a}`);return}let c=(0,Vo._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,Vo._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Vo._)`${a} = ${(0,Vo.stringify)(t)}`)}});var qr=k(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.validateUnion=Fe.validateArray=Fe.usePattern=Fe.callValidateCode=Fe.schemaProperties=Fe.allSchemaProperties=Fe.noPropertyInData=Fe.propertyInData=Fe.isOwnProperty=Fe.hasPropFunc=Fe.reportMissingProp=Fe.checkMissingProp=Fe.checkReportMissingProp=void 0;var Ze=oe(),iv=he(),Os=$r(),fB=he();function hB(r,e){let{gen:t,data:n,it:s}=r;t.if(av(t,n,e,s.opts.ownProperties),()=>{r.setParams({missingProperty:(0,Ze._)`${e}`},!0),r.error()})}Fe.checkReportMissingProp=hB;function pB({gen:r,data:e,it:{opts:t}},n,s){return(0,Ze.or)(...n.map(i=>(0,Ze.and)(av(r,e,i,t.ownProperties),(0,Ze._)`${s} = ${i}`)))}Fe.checkMissingProp=pB;function mB(r,e){r.setParams({missingProperty:e},!0),r.error()}Fe.reportMissingProp=mB;function pC(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ze._)`Object.prototype.hasOwnProperty`})}Fe.hasPropFunc=pC;function ov(r,e,t){return(0,Ze._)`${pC(r)}.call(${e}, ${t})`}Fe.isOwnProperty=ov;function gB(r,e,t,n){let s=(0,Ze._)`${e}${(0,Ze.getProperty)(t)} !== undefined`;return n?(0,Ze._)`${s} && ${ov(r,e,t)}`:s}Fe.propertyInData=gB;function av(r,e,t,n){let s=(0,Ze._)`${e}${(0,Ze.getProperty)(t)} === undefined`;return n?(0,Ze.or)(s,(0,Ze.not)(ov(r,e,t))):s}Fe.noPropertyInData=av;function mC(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}Fe.allSchemaProperties=mC;function yB(r,e){return mC(e).filter(t=>!(0,iv.alwaysValidSchema)(r,e[t]))}Fe.schemaProperties=yB;function vB({schemaCode:r,data:e,it:{gen:t,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,c,l){let u=l?(0,Ze._)`${r}, ${e}, ${n}${s}`:e,d=[[Os.default.instancePath,(0,Ze.strConcat)(Os.default.instancePath,i)],[Os.default.parentData,o.parentData],[Os.default.parentDataProperty,o.parentDataProperty],[Os.default.rootData,Os.default.rootData]];o.opts.dynamicRef&&d.push([Os.default.dynamicAnchors,Os.default.dynamicAnchors]);let f=(0,Ze._)`${u}, ${t.object(...d)}`;return c!==Ze.nil?(0,Ze._)`${a}.call(${c}, ${f})`:(0,Ze._)`${a}(${f})`}Fe.callValidateCode=vB;var bB=(0,Ze._)`new RegExp`;function TB({gen:r,it:{opts:e}},t){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(t,n);return r.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Ze._)`${s.code==="new RegExp"?bB:(0,fB.useFunc)(r,s)}(${t}, ${n})`})}Fe.usePattern=TB;function _B(r){let{gen:e,data:t,keyword:n,it:s}=r,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,Ze._)`${t}.length`);e.forRange("i",0,c,l=>{r.subschema({keyword:n,dataProp:l,dataPropType:iv.Type.Num},i),e.if((0,Ze.not)(i),a)})}}Fe.validateArray=_B;function SB(r){let{gen:e,schema:t,keyword:n,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(c=>(0,iv.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((c,l)=>{let u=r.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,Ze._)`${o} || ${a}`),r.mergeValidEvaluated(u,a)||e.if((0,Ze.not)(o))})),r.result(o,()=>r.reset(),()=>r.error(!0))}Fe.validateUnion=SB});var vC=k(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.validateKeywordUsage=wn.validSchemaType=wn.funcKeywordCode=wn.macroKeywordCode=void 0;var sr=oe(),vi=$r(),kB=qr(),wB=Ac();function EB(r,e){let{gen:t,keyword:n,schema:s,parentSchema:i,it:o}=r,a=e.macro.call(o.self,s,i,o),c=yC(t,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=t.name("valid");r.subschema({schema:a,schemaPath:sr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),r.pass(l,()=>r.error(!0))}wn.macroKeywordCode=EB;function NB(r,e){var t;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=r;RB(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=yC(n,s,l),d=n.let("valid");r.block$data(d,f),r.ok((t=e.valid)!==null&&t!==void 0?t:d);function f(){if(e.errors===!1)g(),e.modifying&&gC(r),_(()=>r.error());else{let w=e.async?p():b();e.modifying&&gC(r),_(()=>PB(r,w))}}function p(){let w=n.let("ruleErrs",null);return n.try(()=>g((0,sr._)`await `),T=>n.assign(d,!1).if((0,sr._)`${T} instanceof ${c.ValidationError}`,()=>n.assign(w,(0,sr._)`${T}.errors`),()=>n.throw(T))),w}function b(){let w=(0,sr._)`${u}.errors`;return n.assign(w,null),g(sr.nil),w}function g(w=e.async?(0,sr._)`await `:sr.nil){let T=c.opts.passContext?vi.default.this:vi.default.self,v=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,sr._)`${w}${(0,kB.callValidateCode)(r,u,T,v)}`,e.modifying)}function _(w){var T;n.if((0,sr.not)((T=e.valid)!==null&&T!==void 0?T:d),w)}}wn.funcKeywordCode=NB;function gC(r){let{gen:e,data:t,it:n}=r;e.if(n.parentData,()=>e.assign(t,(0,sr._)`${n.parentData}[${n.parentDataProperty}]`))}function PB(r,e){let{gen:t}=r;t.if((0,sr._)`Array.isArray(${e})`,()=>{t.assign(vi.default.vErrors,(0,sr._)`${vi.default.vErrors} === null ? ${e} : ${vi.default.vErrors}.concat(${e})`).assign(vi.default.errors,(0,sr._)`${vi.default.vErrors}.length`),(0,wB.extendErrors)(r)},()=>r.error())}function RB({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function yC(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,sr.stringify)(t)})}function CB(r,e,t=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(r):n==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==n||t&&typeof r>"u")}wn.validSchemaType=CB;function DB({schema:r,opts:e,self:t,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(r,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(r[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+t.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(c);else throw new Error(c)}}wn.validateKeywordUsage=DB});var TC=k(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.extendSubschemaMode=As.extendSubschemaData=As.getSubschema=void 0;var En=oe(),bC=he();function OB(r,{keyword:e,schemaProp:t,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=r.schema[e];return t===void 0?{schema:a,schemaPath:(0,En._)`${r.schemaPath}${(0,En.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,En._)`${r.schemaPath}${(0,En.getProperty)(e)}${(0,En.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,bC.escapeFragment)(t)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}As.getSubschema=OB;function AB(r,e,{dataProp:t,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,En._)`${e.data}${(0,En.getProperty)(t)}`,!0);c(f),r.errorPath=(0,En.str)`${l}${(0,bC.getErrorPath)(t,n,d.jsPropertySyntax)}`,r.parentDataProperty=(0,En._)`${t}`,r.dataPathArr=[...u,r.parentDataProperty]}if(s!==void 0){let l=s instanceof En.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(r.propertyName=o)}i&&(r.dataTypes=i);function c(l){r.data=l,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,l]}}As.extendSubschemaData=AB;function IB(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(r.compositeRule=n),s!==void 0&&(r.createErrors=s),i!==void 0&&(r.allErrors=i),r.jtdDiscriminator=e,r.jtdMetadata=t}As.extendSubschemaMode=IB});var cv=k((S7,_C)=>{"use strict";_C.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!r(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var kC=k((k7,SC)=>{"use strict";var Is=SC.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var n=typeof t=="function"?t:t.pre||function(){},s=t.post||function(){};jf(e,n,s,r,"",r)};Is.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Is.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Is.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Is.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 jf(r,e,t,n,s,i,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in Is.arrayKeywords)for(var f=0;f<d.length;f++)jf(r,e,t,d[f],s+"/"+u+"/"+f,i,s,u,n,f)}else if(u in Is.propsKeywords){if(d&&typeof d=="object")for(var p in d)jf(r,e,t,d[p],s+"/"+u+"/"+MB(p),i,s,u,n,p)}else(u in Is.keywords||r.allKeys&&!(u in Is.skipKeywords))&&jf(r,e,t,d,s+"/"+u,i,s,u,n)}t(n,s,i,o,a,c,l)}}function MB(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var Mc=k(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.getSchemaRefs=mr.resolveUrl=mr.normalizeId=mr._getFullPath=mr.getFullPath=mr.inlineRef=void 0;var xB=he(),LB=cv(),$B=kC(),qB=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function jB(r,e=!0){return typeof r=="boolean"?!0:e===!0?!lv(r):e?wC(r)<=e:!1}mr.inlineRef=jB;var FB=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function lv(r){for(let e in r){if(FB.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(lv)||typeof t=="object"&&lv(t))return!0}return!1}function wC(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!qB.has(t)&&(typeof r[t]=="object"&&(0,xB.eachItem)(r[t],n=>e+=wC(n)),e===1/0))return 1/0}return e}function EC(r,e="",t){t!==!1&&(e=Wo(e));let n=r.parse(e);return NC(r,n)}mr.getFullPath=EC;function NC(r,e){return r.serialize(e).split("#")[0]+"#"}mr._getFullPath=NC;var BB=/#\/?$/;function Wo(r){return r?r.replace(BB,""):""}mr.normalizeId=Wo;function UB(r,e,t){return t=Wo(t),r.resolve(e,t)}mr.resolveUrl=UB;var VB=/^[a-z_][-a-z0-9._]*$/i;function WB(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:n}=this.opts,s=Wo(r[t]||e),i={"":s},o=EC(n,s,!1),a={},c=new Set;return $B(r,{allKeys:!0},(d,f,p,b)=>{if(b===void 0)return;let g=o+f,_=i[b];typeof d[t]=="string"&&(_=w.call(this,d[t])),T.call(this,d.$anchor),T.call(this,d.$dynamicAnchor),i[f]=_;function w(v){let R=this.opts.uriResolver.resolve;if(v=Wo(_?R(_,v):v),c.has(v))throw u(v);c.add(v);let A=this.refs[v];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(d,A.schema,v):v!==Wo(g)&&(v[0]==="#"?(l(d,a[v],v),a[v]=d):this.refs[v]=g),v}function T(v){if(typeof v=="string"){if(!VB.test(v))throw new Error(`invalid anchor "${v}"`);w.call(this,`#${v}`)}}}),a;function l(d,f,p){if(f!==void 0&&!LB(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}mr.getSchemaRefs=WB});var $c=k(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.getData=Ms.KeywordCxt=Ms.validateFunctionCode=void 0;var OC=oC(),PC=Ic(),dv=tv(),Ff=Ic(),HB=hC(),Lc=vC(),uv=TC(),Y=oe(),te=$r(),KB=Mc(),Hn=he(),xc=Ac();function zB(r){if(MC(r)&&(xC(r),IC(r))){JB(r);return}AC(r,()=>(0,OC.topBoolOrEmptySchema)(r))}Ms.validateFunctionCode=zB;function AC({gen:r,validateName:e,schema:t,schemaEnv:n,opts:s},i){s.code.es5?r.func(e,(0,Y._)`${te.default.data}, ${te.default.valCxt}`,n.$async,()=>{r.code((0,Y._)`"use strict"; ${RC(t,s)}`),YB(r,s),r.code(i)}):r.func(e,(0,Y._)`${te.default.data}, ${GB(s)}`,n.$async,()=>r.code(RC(t,s)).code(i))}function GB(r){return(0,Y._)`{${te.default.instancePath}="", ${te.default.parentData}, ${te.default.parentDataProperty}, ${te.default.rootData}=${te.default.data}${r.dynamicRef?(0,Y._)`, ${te.default.dynamicAnchors}={}`:Y.nil}}={}`}function YB(r,e){r.if(te.default.valCxt,()=>{r.var(te.default.instancePath,(0,Y._)`${te.default.valCxt}.${te.default.instancePath}`),r.var(te.default.parentData,(0,Y._)`${te.default.valCxt}.${te.default.parentData}`),r.var(te.default.parentDataProperty,(0,Y._)`${te.default.valCxt}.${te.default.parentDataProperty}`),r.var(te.default.rootData,(0,Y._)`${te.default.valCxt}.${te.default.rootData}`),e.dynamicRef&&r.var(te.default.dynamicAnchors,(0,Y._)`${te.default.valCxt}.${te.default.dynamicAnchors}`)},()=>{r.var(te.default.instancePath,(0,Y._)`""`),r.var(te.default.parentData,(0,Y._)`undefined`),r.var(te.default.parentDataProperty,(0,Y._)`undefined`),r.var(te.default.rootData,te.default.data),e.dynamicRef&&r.var(te.default.dynamicAnchors,(0,Y._)`{}`)})}function JB(r){let{schema:e,opts:t,gen:n}=r;AC(r,()=>{t.$comment&&e.$comment&&$C(r),tU(r),n.let(te.default.vErrors,null),n.let(te.default.errors,0),t.unevaluated&&XB(r),LC(r),sU(r)})}function XB(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,Y._)`${t}.evaluated`),e.if((0,Y._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,Y._)`${r.evaluated}.props`,(0,Y._)`undefined`)),e.if((0,Y._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,Y._)`${r.evaluated}.items`,(0,Y._)`undefined`))}function RC(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,Y._)`/*# sourceURL=${t} */`:Y.nil}function QB(r,e){if(MC(r)&&(xC(r),IC(r))){ZB(r,e);return}(0,OC.boolOrEmptySchema)(r,e)}function IC({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function MC(r){return typeof r.schema!="boolean"}function ZB(r,e){let{schema:t,gen:n,opts:s}=r;s.$comment&&t.$comment&&$C(r),rU(r),nU(r);let i=n.const("_errs",te.default.errors);LC(r,i),n.var(e,(0,Y._)`${i} === ${te.default.errors}`)}function xC(r){(0,Hn.checkUnknownRules)(r),eU(r)}function LC(r,e){if(r.opts.jtd)return CC(r,[],!1,e);let t=(0,PC.getSchemaTypes)(r.schema),n=(0,PC.coerceAndCheckDataType)(r,t);CC(r,t,!n,e)}function eU(r){let{schema:e,errSchemaPath:t,opts:n,self:s}=r;e.$ref&&n.ignoreKeywordsWithRef&&(0,Hn.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function tU(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Hn.checkStrictMode)(r,"default is ignored in the schema root")}function rU(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,KB.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function nU(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function $C({gen:r,schemaEnv:e,schema:t,errSchemaPath:n,opts:s}){let i=t.$comment;if(s.$comment===!0)r.code((0,Y._)`${te.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,Y.str)`${n}/$comment`,a=r.scopeValue("root",{ref:e.root});r.code((0,Y._)`${te.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function sU(r){let{gen:e,schemaEnv:t,validateName:n,ValidationError:s,opts:i}=r;t.$async?e.if((0,Y._)`${te.default.errors} === 0`,()=>e.return(te.default.data),()=>e.throw((0,Y._)`new ${s}(${te.default.vErrors})`)):(e.assign((0,Y._)`${n}.errors`,te.default.vErrors),i.unevaluated&&iU(r),e.return((0,Y._)`${te.default.errors} === 0`))}function iU({gen:r,evaluated:e,props:t,items:n}){t instanceof Y.Name&&r.assign((0,Y._)`${e}.props`,t),n instanceof Y.Name&&r.assign((0,Y._)`${e}.items`,n)}function CC(r,e,t,n){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=r,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Hn.schemaHasRulesButRef)(i,u))){s.block(()=>jC(r,"$ref",u.all.$ref.definition));return}c.jtd||oU(r,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,dv.shouldUseGroup)(i,f)&&(f.type?(s.if((0,Ff.checkDataType)(f.type,o,c.strictNumbers)),DC(r,f),e.length===1&&e[0]===f.type&&t&&(s.else(),(0,Ff.reportTypeError)(r)),s.endIf()):DC(r,f),a||s.if((0,Y._)`${te.default.errors} === ${n||0}`))}}function DC(r,e){let{gen:t,schema:n,opts:{useDefaults:s}}=r;s&&(0,HB.assignDefaults)(r,e.type),t.block(()=>{for(let i of e.rules)(0,dv.shouldUseRule)(n,i)&&jC(r,i.keyword,i.definition,e.type)})}function oU(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(aU(r,e),r.opts.allowUnionTypes||cU(r,e),lU(r,r.dataTypes))}function aU(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{qC(r.dataTypes,t)||fv(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),dU(r,e)}}function cU(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&fv(r,"use allowUnionTypes to allow union type keyword")}function lU(r,e){let t=r.self.RULES.all;for(let n in t){let s=t[n];if(typeof s=="object"&&(0,dv.shouldUseRule)(r.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>uU(e,o))&&fv(r,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function uU(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function qC(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function dU(r,e){let t=[];for(let n of r.dataTypes)qC(e,n)?t.push(n):e.includes("integer")&&n==="number"&&t.push("integer");r.dataTypes=t}function fv(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,Hn.checkStrictMode)(r,e,r.opts.strictTypes)}var Bf=class{constructor(e,t,n){if((0,Lc.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Hn.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",FC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Lc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",te.default.errors))}result(e,t,n){this.failResult((0,Y.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,Y.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,Y._)`${t} !== undefined && (${(0,Y.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?xc.reportExtraError:xc.reportError)(this,this.def.error,t)}$dataError(){(0,xc.reportError)(this,this.def.$dataError||xc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,xc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=Y.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=Y.nil,t=Y.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,Y.or)((0,Y._)`${s} === undefined`,t)),e!==Y.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==Y.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:s,it:i}=this;return(0,Y.or)(o(),a());function o(){if(n.length){if(!(t instanceof Y.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,Y._)`${(0,Ff.checkDataTypes)(c,t,i.opts.strictNumbers,Ff.DataType.Wrong)}`}return Y.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,Y._)`!${c}(${t})`}return Y.nil}}subschema(e,t){let n=(0,uv.getSubschema)(this.it,e);(0,uv.extendSubschemaData)(n,this.it,e),(0,uv.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return QB(s,t),s}mergeEvaluated(e,t){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Hn.mergeEvaluated.props(s,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=Hn.mergeEvaluated.items(s,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,Y.Name)),!0}};Ms.KeywordCxt=Bf;function jC(r,e,t,n){let s=new Bf(r,t,e);"code"in t?t.code(s,n):s.$data&&t.validate?(0,Lc.funcKeywordCode)(s,t):"macro"in t?(0,Lc.macroKeywordCode)(s,t):(t.compile||t.validate)&&(0,Lc.funcKeywordCode)(s,t)}var fU=/^\/(?:[^~]|~0|~1)*$/,hU=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function FC(r,{dataLevel:e,dataNames:t,dataPathArr:n}){let s,i;if(r==="")return te.default.rootData;if(r[0]==="/"){if(!fU.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);s=r,i=te.default.rootData}else{let l=hU.exec(r);if(!l)throw new Error(`Invalid JSON-pointer: ${r}`);let u=+l[1];if(s=l[2],s==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(i=t[e-u],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,Y._)`${i}${(0,Y.getProperty)((0,Hn.unescapeJsonPointer)(l))}`,o=(0,Y._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Ms.getData=FC});var Uf=k(pv=>{"use strict";Object.defineProperty(pv,"__esModule",{value:!0});var hv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};pv.default=hv});var qc=k(yv=>{"use strict";Object.defineProperty(yv,"__esModule",{value:!0});var mv=Mc(),gv=class extends Error{constructor(e,t,n,s){super(s||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,mv.resolveUrl)(e,t,n),this.missingSchema=(0,mv.normalizeId)((0,mv.getFullPath)(e,this.missingRef))}};yv.default=gv});var jc=k(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveSchema=jr.getCompilingSchema=jr.resolveRef=jr.compileSchema=jr.SchemaEnv=void 0;var on=oe(),pU=Uf(),bi=$r(),an=Mc(),BC=he(),mU=$c(),Ho=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,an.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};jr.SchemaEnv=Ho;function bv(r){let e=UC.call(this,r);if(e)return e;let t=(0,an.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new on.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;r.$async&&(a=o.scopeValue("Error",{ref:pU.default,code:(0,on._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");r.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:bi.default.data,parentData:bi.default.parentData,parentDataProperty:bi.default.parentDataProperty,dataNames:[bi.default.data],dataPathArr:[on.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,on.stringify)(r.schema)}:{ref:r.schema}),validateName:c,ValidationError:a,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:on.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,on._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(r),(0,mU.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(bi.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,r));let p=new Function(`${bi.default.self}`,`${bi.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=r.schema,p.schemaEnv=r,r.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:b,items:g}=l;p.evaluated={props:b instanceof on.Name?void 0:b,items:g instanceof on.Name?void 0:g,dynamicProps:b instanceof on.Name,dynamicItems:g instanceof on.Name},p.source&&(p.source.evaluated=(0,on.stringify)(p.evaluated))}return r.validate=p,r}catch(d){throw delete r.validate,delete r.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(r)}}jr.compileSchema=bv;function gU(r,e,t){var n;t=(0,an.resolveUrl)(this.opts.uriResolver,e,t);let s=r.refs[t];if(s)return s;let i=bU.call(this,r,t);if(i===void 0){let o=(n=r.localRefs)===null||n===void 0?void 0:n[t],{schemaId:a}=this.opts;o&&(i=new Ho({schema:o,schemaId:a,root:r,baseId:e}))}if(i!==void 0)return r.refs[t]=yU.call(this,i)}jr.resolveRef=gU;function yU(r){return(0,an.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:bv.call(this,r)}function UC(r){for(let e of this._compilations)if(vU(e,r))return e}jr.getCompilingSchema=UC;function vU(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function bU(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Vf.call(this,r,e)}function Vf(r,e){let t=this.opts.uriResolver.parse(e),n=(0,an._getFullPath)(this.opts.uriResolver,t),s=(0,an.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&n===s)return vv.call(this,t,r);let i=(0,an.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Vf.call(this,r,o);return typeof a?.schema!="object"?void 0:vv.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||bv.call(this,o),i===(0,an.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,an.resolveUrl)(this.opts.uriResolver,s,l)),new Ho({schema:a,schemaId:c,root:r,baseId:s})}return vv.call(this,t,o)}}jr.resolveSchema=Vf;var TU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function vv(r,{baseId:e,schema:t,root:n}){var s;if(((s=r.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let c=t[(0,BC.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!TU.has(a)&&l&&(e=(0,an.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,BC.schemaHasRulesButRef)(t,this.RULES)){let a=(0,an.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=Vf.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new Ho({schema:t,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var VC=k((C7,_U)=>{_U.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 HC=k((D7,WC)=>{"use strict";var SU={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};WC.exports={HEX:SU}});var ZC=k((O7,QC)=>{"use strict";var{HEX:kU}=HC(),wU=/^(?:(?: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 YC(r){if(XC(r,".")<3)return{host:r,isIPV4:!1};let e=r.match(wU)||[],[t]=e;return t?{host:NU(t,"."),isIPV4:!0}:{host:r,isIPV4:!1}}function Tv(r,e=!1){let t="",n=!0;for(let s of r){if(kU[s]===void 0)return;s!=="0"&&n===!0&&(n=!1),n||(t+=s)}return e&&t.length===0&&(t="0"),t}function EU(r){let e=0,t={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=!1;function c(){if(s.length){if(i===!1){let l=Tv(s);if(l!==void 0)n.push(l);else return t.error=!0,!1}s.length=0}return!0}for(let l=0;l<r.length;l++){let u=r[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,n.push(":"),e>7){t.error=!0;break}l-1>=0&&r[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;i=!0}else{s.push(u);continue}}return s.length&&(i?t.zone=s.join(""):a?n.push(s.join("")):n.push(Tv(s))),t.address=n.join(""),t}function JC(r){if(XC(r,":")<2)return{host:r,isIPV6:!1};let e=EU(r);if(e.error)return{host:r,isIPV6:!1};{let t=e.address,n=e.address;return e.zone&&(t+="%"+e.zone,n+="%25"+e.zone),{host:t,escapedHost:n,isIPV6:!0}}}function NU(r,e){let t="",n=!0,s=r.length;for(let i=0;i<s;i++){let o=r[i];o==="0"&&n?(i+1<=s&&r[i+1]===e||i+1===s)&&(t+=o,n=!1):(o===e?n=!0:n=!1,t+=o)}return t}function XC(r,e){let t=0;for(let n=0;n<r.length;n++)r[n]===e&&t++;return t}var KC=/^\.\.?\//u,zC=/^\/\.(?:\/|$)/u,GC=/^\/\.\.(?:\/|$)/u,PU=/^\/?(?:.|\n)*?(?=\/|$)/u;function RU(r){let e=[];for(;r.length;)if(r.match(KC))r=r.replace(KC,"");else if(r.match(zC))r=r.replace(zC,"/");else if(r.match(GC))r=r.replace(GC,"/"),e.pop();else if(r==="."||r==="..")r="";else{let t=r.match(PU);if(t){let n=t[0];r=r.slice(n.length),e.push(n)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function CU(r,e){let t=e!==!0?escape:unescape;return r.scheme!==void 0&&(r.scheme=t(r.scheme)),r.userinfo!==void 0&&(r.userinfo=t(r.userinfo)),r.host!==void 0&&(r.host=t(r.host)),r.path!==void 0&&(r.path=t(r.path)),r.query!==void 0&&(r.query=t(r.query)),r.fragment!==void 0&&(r.fragment=t(r.fragment)),r}function DU(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host),n=YC(t);if(n.isIPV4)t=n.host;else{let s=JC(n.host);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=r.host}e.push(t)}return(typeof r.port=="number"||typeof r.port=="string")&&(e.push(":"),e.push(String(r.port))),e.length?e.join(""):void 0}QC.exports={recomposeAuthority:DU,normalizeComponentEncoding:CU,removeDotSegments:RU,normalizeIPv4:YC,normalizeIPv6:JC,stringArrayToHexStripped:Tv}});var iD=k((A7,sD)=>{"use strict";var OU=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,AU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function eD(r){return typeof r.secure=="boolean"?r.secure:String(r.scheme).toLowerCase()==="wss"}function tD(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function rD(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function IU(r){return r.secure=eD(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function MU(r){if((r.port===(eD(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let[e,t]=r.resourceName.split("?");r.path=e&&e!=="/"?e:void 0,r.query=t,r.resourceName=void 0}return r.fragment=void 0,r}function xU(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(AU);if(t){let n=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let s=`${n}:${e.nid||r.nid}`,i=_v[s];r.path=void 0,i&&(r=i.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function LU(r,e){let t=e.scheme||r.scheme||"urn",n=r.nid.toLowerCase(),s=`${t}:${e.nid||n}`,i=_v[s];i&&(r=i.serialize(r,e));let o=r,a=r.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function $U(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!OU.test(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function qU(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var nD={scheme:"http",domainHost:!0,parse:tD,serialize:rD},jU={scheme:"https",domainHost:nD.domainHost,parse:tD,serialize:rD},Wf={scheme:"ws",domainHost:!0,parse:IU,serialize:MU},FU={scheme:"wss",domainHost:Wf.domainHost,parse:Wf.parse,serialize:Wf.serialize},BU={scheme:"urn",parse:xU,serialize:LU,skipNormalize:!0},UU={scheme:"urn:uuid",parse:$U,serialize:qU,skipNormalize:!0},_v={http:nD,https:jU,ws:Wf,wss:FU,urn:BU,"urn:uuid":UU};sD.exports=_v});var aD=k((I7,Kf)=>{"use strict";var{normalizeIPv6:VU,normalizeIPv4:WU,removeDotSegments:Fc,recomposeAuthority:HU,normalizeComponentEncoding:Hf}=ZC(),Sv=iD();function KU(r,e){return typeof r=="string"?r=Nn(Kn(r,e),e):typeof r=="object"&&(r=Kn(Nn(r,e),e)),r}function zU(r,e,t){let n=Object.assign({scheme:"null"},t),s=oD(Kn(r,n),Kn(e,n),n,!0);return Nn(s,{...n,skipEscape:!0})}function oD(r,e,t,n){let s={};return n||(r=Kn(Nn(r,t),t),e=Kn(Nn(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=Fc(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=Fc(e.path||""),s.query=e.query):(e.path?(e.path.charAt(0)==="/"?s.path=Fc(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?s.path="/"+e.path:r.path?s.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=Fc(s.path)),s.query=e.query):(s.path=r.path,e.query!==void 0?s.query=e.query:s.query=r.query),s.userinfo=r.userinfo,s.host=r.host,s.port=r.port),s.scheme=r.scheme),s.fragment=e.fragment,s}function GU(r,e,t){return typeof r=="string"?(r=unescape(r),r=Nn(Hf(Kn(r,t),!0),{...t,skipEscape:!0})):typeof r=="object"&&(r=Nn(Hf(r,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Nn(Hf(Kn(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=Nn(Hf(e,!0),{...t,skipEscape:!0})),r.toLowerCase()===e.toLowerCase()}function Nn(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},n=Object.assign({},e),s=[],i=Sv[(n.scheme||t.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(t,n),t.path!==void 0&&(n.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),n.reference!=="suffix"&&t.scheme&&s.push(t.scheme,":");let o=HU(t);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),t.path&&t.path.charAt(0)!=="/"&&s.push("/")),t.path!==void 0){let a=t.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=Fc(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),s.push(a)}return t.query!==void 0&&s.push("?",t.query),t.fragment!==void 0&&s.push("#",t.fragment),s.join("")}var YU=Array.from({length:127},(r,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function JU(r){let e=0;for(let t=0,n=r.length;t<n;++t)if(e=r.charCodeAt(t),e>126||YU[e])return!0;return!1}var XU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Kn(r,e){let t=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=r.indexOf("%")!==-1,i=!1;t.reference==="suffix"&&(r=(t.scheme?t.scheme+":":"")+"//"+r);let o=r.match(XU);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host){let c=WU(n.host);if(c.isIPV4===!1){let l=VU(c.host);n.host=l.host.toLowerCase(),i=l.isIPV6}else n.host=c.host,i=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");let a=Sv[(t.scheme||n.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(t.domainHost||a&&a.domainHost)&&i===!1&&JU(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(s&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),s&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}var kv={SCHEMES:Sv,normalize:KU,resolve:zU,resolveComponents:oD,equal:GU,serialize:Nn,parse:Kn};Kf.exports=kv;Kf.exports.default=kv;Kf.exports.fastUri=kv});var lD=k(wv=>{"use strict";Object.defineProperty(wv,"__esModule",{value:!0});var cD=aD();cD.code='require("ajv/dist/runtime/uri").default';wv.default=cD});var yD=k(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.CodeGen=Ft.Name=Ft.nil=Ft.stringify=Ft.str=Ft._=Ft.KeywordCxt=void 0;var QU=$c();Object.defineProperty(Ft,"KeywordCxt",{enumerable:!0,get:function(){return QU.KeywordCxt}});var Ko=oe();Object.defineProperty(Ft,"_",{enumerable:!0,get:function(){return Ko._}});Object.defineProperty(Ft,"str",{enumerable:!0,get:function(){return Ko.str}});Object.defineProperty(Ft,"stringify",{enumerable:!0,get:function(){return Ko.stringify}});Object.defineProperty(Ft,"nil",{enumerable:!0,get:function(){return Ko.nil}});Object.defineProperty(Ft,"Name",{enumerable:!0,get:function(){return Ko.Name}});Object.defineProperty(Ft,"CodeGen",{enumerable:!0,get:function(){return Ko.CodeGen}});var ZU=Uf(),pD=qc(),eV=ev(),Bc=jc(),tV=oe(),Uc=Mc(),zf=Ic(),Nv=he(),uD=VC(),rV=lD(),mD=(r,e)=>new RegExp(r,e);mD.code="new RegExp";var nV=["removeAdditional","useDefaults","coerceTypes"],sV=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),iV={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."},oV={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},dD=200;function aV(r){var e,t,n,s,i,o,a,c,l,u,d,f,p,b,g,_,w,T,v,R,A,L,W,j,ne;let Le=r.strict,Tt=(e=r.code)===null||e===void 0?void 0:e.optimize,de=Tt===!0||Tt===void 0?1:Tt||0,kr=(n=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&n!==void 0?n:mD,zn=(s=r.uriResolver)!==null&&s!==void 0?s:rV.default;return{strictSchema:(o=(i=r.strictSchema)!==null&&i!==void 0?i:Le)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=r.strictNumbers)!==null&&a!==void 0?a:Le)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=r.strictTypes)!==null&&l!==void 0?l:Le)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=r.strictTuples)!==null&&d!==void 0?d:Le)!==null&&f!==void 0?f:"log",strictRequired:(b=(p=r.strictRequired)!==null&&p!==void 0?p:Le)!==null&&b!==void 0?b:!1,code:r.code?{...r.code,optimize:de,regExp:kr}:{optimize:de,regExp:kr},loopRequired:(g=r.loopRequired)!==null&&g!==void 0?g:dD,loopEnum:(_=r.loopEnum)!==null&&_!==void 0?_:dD,meta:(w=r.meta)!==null&&w!==void 0?w:!0,messages:(T=r.messages)!==null&&T!==void 0?T:!0,inlineRefs:(v=r.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(R=r.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(A=r.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(L=r.validateSchema)!==null&&L!==void 0?L:!0,validateFormats:(W=r.validateFormats)!==null&&W!==void 0?W:!0,unicodeRegExp:(j=r.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(ne=r.int32range)!==null&&ne!==void 0?ne:!0,uriResolver:zn}}var Vc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...aV(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new tV.ValueScope({scope:{},prefixes:sV,es5:t,lines:n}),this.logger=hV(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,eV.getRules)(),fD.call(this,iV,e,"NOT SUPPORTED"),fD.call(this,oV,e,"DEPRECATED","warn"),this._metaOpts=dV.call(this),e.formats&&lV.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&uV.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),cV.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,s=uD;n==="id"&&(s={...uD},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(t);return"$async"in n||(this.errors=n.errors),s}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,t);async function s(u,d){await i.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function i(u){u&&!this.getSchema(u)&&await s.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof pD.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await i.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,t)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,t,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return t=(0,Uc.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,s,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let t;for(;typeof(t=hD.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:n}=this.opts,s=new Bc.SchemaEnv({schema:{},schemaId:n});if(t=Bc.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=hD.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,Uc.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string")n=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(mV.call(this,n,t),!t)return(0,Nv.eachItem)(n,i=>Ev.call(this,i)),this;yV.call(this,t);let s={...t,type:(0,zf.getJSONTypes)(t.type),schemaType:(0,zf.getJSONTypes)(t.schemaType)};return(0,Nv.eachItem)(n,s.type.length===0?i=>Ev.call(this,i,s):i=>s.type.forEach(o=>Ev.call(this,i,s,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+t+i)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of t){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=gD(u))}}return e}_removeAllSchemas(e,t){for(let n in e){let s=e[n];(!t||t.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,t,n,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,Uc.normalizeId)(o||n);let l=Uc.getSchemaRefs.call(this,e,n);return c=new Bc.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Bc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Bc.compileSchema.call(this,e)}finally{this.opts=t}}};Vc.ValidationError=ZU.default;Vc.MissingRefError=pD.default;Ft.default=Vc;function fD(r,e,t,n="error"){for(let s in r){let i=s;i in e&&this.logger[n](`${t}: option ${s}. ${r[i]}`)}}function hD(r){return r=(0,Uc.normalizeId)(r),this.schemas[r]||this.refs[r]}function cV(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function lV(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function uV(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function dV(){let r={...this.opts};for(let e of nV)delete r[e];return r}var fV={log(){},warn(){},error(){}};function hV(r){if(r===!1)return fV;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var pV=/^[a-z_$][a-z0-9_$:-]*$/i;function mV(r,e){let{RULES:t}=this;if((0,Nv.eachItem)(r,n=>{if(t.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!pV.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Ev(r,e,t){var n;let s=e?.post;if(t&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===t);if(o||(o={type:t,rules:[]},i.rules.push(o)),i.keywords[r]=!0,!e)return;let a={keyword:r,definition:{...e,type:(0,zf.getJSONTypes)(e.type),schemaType:(0,zf.getJSONTypes)(e.schemaType)}};e.before?gV.call(this,o,a,e.before):o.rules.push(a),i.all[r]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function gV(r,e,t){let n=r.rules.findIndex(s=>s.keyword===t);n>=0?r.rules.splice(n,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function yV(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=gD(e)),r.validateSchema=this.compile(e,!0))}var vV={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function gD(r){return{anyOf:[r,vV]}}});var vD=k(Pv=>{"use strict";Object.defineProperty(Pv,"__esModule",{value:!0});var bV={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Pv.default=bV});var Jf=k(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.callRef=Ti.getValidate=void 0;var TV=qc(),bD=qr(),gr=oe(),zo=$r(),TD=jc(),Gf=he(),_V={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:n}=r,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=n,{root:l}=i;if((t==="#"||t==="#/")&&s===l.baseId)return d();let u=TD.resolveRef.call(c,l,s,t);if(u===void 0)throw new TV.default(n.opts.uriResolver,s,t);if(u instanceof TD.SchemaEnv)return f(u);return p(u);function d(){if(i===l)return Yf(r,o,i,i.$async);let b=e.scopeValue("root",{ref:l});return Yf(r,(0,gr._)`${b}.validate`,l,l.$async)}function f(b){let g=_D(r,b);Yf(r,g,b,b.$async)}function p(b){let g=e.scopeValue("schema",a.code.source===!0?{ref:b,code:(0,gr.stringify)(b)}:{ref:b}),_=e.name("valid"),w=r.subschema({schema:b,dataTypes:[],schemaPath:gr.nil,topSchemaRef:g,errSchemaPath:t},_);r.mergeEvaluated(w),r.ok(_)}}};function _D(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,gr._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Ti.getValidate=_D;function Yf(r,e,t,n){let{gen:s,it:i}=r,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?zo.default.this:gr.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let b=s.let("valid");s.try(()=>{s.code((0,gr._)`await ${(0,bD.callValidateCode)(r,e,l)}`),p(e),o||s.assign(b,!0)},g=>{s.if((0,gr._)`!(${g} instanceof ${i.ValidationError})`,()=>s.throw(g)),f(g),o||s.assign(b,!1)}),r.ok(b)}function d(){r.result((0,bD.callValidateCode)(r,e,l),()=>p(e),()=>f(e))}function f(b){let g=(0,gr._)`${b}.errors`;s.assign(zo.default.vErrors,(0,gr._)`${zo.default.vErrors} === null ? ${g} : ${zo.default.vErrors}.concat(${g})`),s.assign(zo.default.errors,(0,gr._)`${zo.default.vErrors}.length`)}function p(b){var g;if(!i.opts.unevaluated)return;let _=(g=t?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(i.props=Gf.mergeEvaluated.props(s,_.props,i.props));else{let w=s.var("props",(0,gr._)`${b}.evaluated.props`);i.props=Gf.mergeEvaluated.props(s,w,i.props,gr.Name)}if(i.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(i.items=Gf.mergeEvaluated.items(s,_.items,i.items));else{let w=s.var("items",(0,gr._)`${b}.evaluated.items`);i.items=Gf.mergeEvaluated.items(s,w,i.items,gr.Name)}}}Ti.callRef=Yf;Ti.default=_V});var SD=k(Rv=>{"use strict";Object.defineProperty(Rv,"__esModule",{value:!0});var SV=vD(),kV=Jf(),wV=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",SV.default,kV.default];Rv.default=wV});var kD=k(Cv=>{"use strict";Object.defineProperty(Cv,"__esModule",{value:!0});var Xf=oe(),xs=Xf.operators,Qf={maximum:{okStr:"<=",ok:xs.LTE,fail:xs.GT},minimum:{okStr:">=",ok:xs.GTE,fail:xs.LT},exclusiveMaximum:{okStr:"<",ok:xs.LT,fail:xs.GTE},exclusiveMinimum:{okStr:">",ok:xs.GT,fail:xs.LTE}},EV={message:({keyword:r,schemaCode:e})=>(0,Xf.str)`must be ${Qf[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Xf._)`{comparison: ${Qf[r].okStr}, limit: ${e}}`},NV={keyword:Object.keys(Qf),type:"number",schemaType:"number",$data:!0,error:EV,code(r){let{keyword:e,data:t,schemaCode:n}=r;r.fail$data((0,Xf._)`${t} ${Qf[e].fail} ${n} || isNaN(${t})`)}};Cv.default=NV});var wD=k(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});var Wc=oe(),PV={message:({schemaCode:r})=>(0,Wc.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,Wc._)`{multipleOf: ${r}}`},RV={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:PV,code(r){let{gen:e,data:t,schemaCode:n,it:s}=r,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,Wc._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Wc._)`${o} !== parseInt(${o})`;r.fail$data((0,Wc._)`(${n} === 0 || (${o} = ${t}/${n}, ${a}))`)}};Dv.default=RV});var ND=k(Ov=>{"use strict";Object.defineProperty(Ov,"__esModule",{value:!0});function ED(r){let e=r.length,t=0,n=0,s;for(;n<e;)t++,s=r.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=r.charCodeAt(n),(s&64512)===56320&&n++);return t}Ov.default=ED;ED.code='require("ajv/dist/runtime/ucs2length").default'});var PD=k(Av=>{"use strict";Object.defineProperty(Av,"__esModule",{value:!0});var _i=oe(),CV=he(),DV=ND(),OV={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,_i.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,_i._)`{limit: ${r}}`},AV={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:OV,code(r){let{keyword:e,data:t,schemaCode:n,it:s}=r,i=e==="maxLength"?_i.operators.GT:_i.operators.LT,o=s.opts.unicode===!1?(0,_i._)`${t}.length`:(0,_i._)`${(0,CV.useFunc)(r.gen,DV.default)}(${t})`;r.fail$data((0,_i._)`${o} ${i} ${n}`)}};Av.default=AV});var RD=k(Iv=>{"use strict";Object.defineProperty(Iv,"__esModule",{value:!0});var IV=qr(),Zf=oe(),MV={message:({schemaCode:r})=>(0,Zf.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,Zf._)`{pattern: ${r}}`},xV={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:MV,code(r){let{data:e,$data:t,schema:n,schemaCode:s,it:i}=r,o=i.opts.unicodeRegExp?"u":"",a=t?(0,Zf._)`(new RegExp(${s}, ${o}))`:(0,IV.usePattern)(r,n);r.fail$data((0,Zf._)`!${a}.test(${e})`)}};Iv.default=xV});var CD=k(Mv=>{"use strict";Object.defineProperty(Mv,"__esModule",{value:!0});var Hc=oe(),LV={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,Hc.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,Hc._)`{limit: ${r}}`},$V={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:LV,code(r){let{keyword:e,data:t,schemaCode:n}=r,s=e==="maxProperties"?Hc.operators.GT:Hc.operators.LT;r.fail$data((0,Hc._)`Object.keys(${t}).length ${s} ${n}`)}};Mv.default=$V});var DD=k(xv=>{"use strict";Object.defineProperty(xv,"__esModule",{value:!0});var Kc=qr(),zc=oe(),qV=he(),jV={message:({params:{missingProperty:r}})=>(0,zc.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,zc._)`{missingProperty: ${r}}`},FV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:jV,code(r){let{gen:e,schema:t,schemaCode:n,data:s,$data:i,it:o}=r,{opts:a}=o;if(!i&&t.length===0)return;let c=t.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let p=r.parentSchema.properties,{definedProperties:b}=r.it;for(let g of t)if(p?.[g]===void 0&&!b.has(g)){let _=o.schemaEnv.baseId+o.errSchemaPath,w=`required property "${g}" is not defined at "${_}" (strictRequired)`;(0,qV.checkStrictMode)(o,w,o.opts.strictRequired)}}function l(){if(c||i)r.block$data(zc.nil,d);else for(let p of t)(0,Kc.checkReportMissingProp)(r,p)}function u(){let p=e.let("missing");if(c||i){let b=e.let("valid",!0);r.block$data(b,()=>f(p,b)),r.ok(b)}else e.if((0,Kc.checkMissingProp)(r,t,p)),(0,Kc.reportMissingProp)(r,p),e.else()}function d(){e.forOf("prop",n,p=>{r.setParams({missingProperty:p}),e.if((0,Kc.noPropertyInData)(e,s,p,a.ownProperties),()=>r.error())})}function f(p,b){r.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(b,(0,Kc.propertyInData)(e,s,p,a.ownProperties)),e.if((0,zc.not)(b),()=>{r.error(),e.break()})},zc.nil)}}};xv.default=FV});var OD=k(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});var Gc=oe(),BV={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,Gc.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,Gc._)`{limit: ${r}}`},UV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:BV,code(r){let{keyword:e,data:t,schemaCode:n}=r,s=e==="maxItems"?Gc.operators.GT:Gc.operators.LT;r.fail$data((0,Gc._)`${t}.length ${s} ${n}`)}};Lv.default=UV});var eh=k($v=>{"use strict";Object.defineProperty($v,"__esModule",{value:!0});var AD=cv();AD.code='require("ajv/dist/runtime/equal").default';$v.default=AD});var ID=k(jv=>{"use strict";Object.defineProperty(jv,"__esModule",{value:!0});var qv=Ic(),Bt=oe(),VV=he(),WV=eh(),HV={message:({params:{i:r,j:e}})=>(0,Bt.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,Bt._)`{i: ${r}, j: ${e}}`},KV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:HV,code(r){let{gen:e,data:t,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=r;if(!n&&!s)return;let c=e.let("valid"),l=i.items?(0,qv.getSchemaTypes)(i.items):[];r.block$data(c,u,(0,Bt._)`${o} === false`),r.ok(c);function u(){let b=e.let("i",(0,Bt._)`${t}.length`),g=e.let("j");r.setParams({i:b,j:g}),e.assign(c,!0),e.if((0,Bt._)`${b} > 1`,()=>(d()?f:p)(b,g))}function d(){return l.length>0&&!l.some(b=>b==="object"||b==="array")}function f(b,g){let _=e.name("item"),w=(0,qv.checkDataTypes)(l,_,a.opts.strictNumbers,qv.DataType.Wrong),T=e.const("indices",(0,Bt._)`{}`);e.for((0,Bt._)`;${b}--;`,()=>{e.let(_,(0,Bt._)`${t}[${b}]`),e.if(w,(0,Bt._)`continue`),l.length>1&&e.if((0,Bt._)`typeof ${_} == "string"`,(0,Bt._)`${_} += "_"`),e.if((0,Bt._)`typeof ${T}[${_}] == "number"`,()=>{e.assign(g,(0,Bt._)`${T}[${_}]`),r.error(),e.assign(c,!1).break()}).code((0,Bt._)`${T}[${_}] = ${b}`)})}function p(b,g){let _=(0,VV.useFunc)(e,WV.default),w=e.name("outer");e.label(w).for((0,Bt._)`;${b}--;`,()=>e.for((0,Bt._)`${g} = ${b}; ${g}--;`,()=>e.if((0,Bt._)`${_}(${t}[${b}], ${t}[${g}])`,()=>{r.error(),e.assign(c,!1).break(w)})))}}};jv.default=KV});var MD=k(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var Fv=oe(),zV=he(),GV=eh(),YV={message:"must be equal to constant",params:({schemaCode:r})=>(0,Fv._)`{allowedValue: ${r}}`},JV={keyword:"const",$data:!0,error:YV,code(r){let{gen:e,data:t,$data:n,schemaCode:s,schema:i}=r;n||i&&typeof i=="object"?r.fail$data((0,Fv._)`!${(0,zV.useFunc)(e,GV.default)}(${t}, ${s})`):r.fail((0,Fv._)`${i} !== ${t}`)}};Bv.default=JV});var xD=k(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var Yc=oe(),XV=he(),QV=eh(),ZV={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,Yc._)`{allowedValues: ${r}}`},eW={keyword:"enum",schemaType:"array",$data:!0,error:ZV,code(r){let{gen:e,data:t,$data:n,schema:s,schemaCode:i,it:o}=r;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,XV.useFunc)(e,QV.default)),u;if(a||n)u=e.let("valid"),r.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let p=e.const("vSchema",i);u=(0,Yc.or)(...s.map((b,g)=>f(p,g)))}r.pass(u);function d(){e.assign(u,!1),e.forOf("v",i,p=>e.if((0,Yc._)`${l()}(${t}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,b){let g=s[b];return typeof g=="object"&&g!==null?(0,Yc._)`${l()}(${t}, ${p}[${b}])`:(0,Yc._)`${t} === ${g}`}}};Uv.default=eW});var LD=k(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var tW=kD(),rW=wD(),nW=PD(),sW=RD(),iW=CD(),oW=DD(),aW=OD(),cW=ID(),lW=MD(),uW=xD(),dW=[tW.default,rW.default,nW.default,sW.default,iW.default,oW.default,aW.default,cW.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},lW.default,uW.default];Vv.default=dW});var Hv=k(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.validateAdditionalItems=void 0;var Si=oe(),Wv=he(),fW={message:({params:{len:r}})=>(0,Si.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Si._)`{limit: ${r}}`},hW={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:fW,code(r){let{parentSchema:e,it:t}=r,{items:n}=e;if(!Array.isArray(n)){(0,Wv.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}$D(r,n)}};function $D(r,e){let{gen:t,schema:n,data:s,keyword:i,it:o}=r;o.items=!0;let a=t.const("len",(0,Si._)`${s}.length`);if(n===!1)r.setParams({len:e.length}),r.pass((0,Si._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,Wv.alwaysValidSchema)(o,n)){let l=t.var("valid",(0,Si._)`${a} <= ${e.length}`);t.if((0,Si.not)(l),()=>c(l)),r.ok(l)}function c(l){t.forRange("i",e.length,a,u=>{r.subschema({keyword:i,dataProp:u,dataPropType:Wv.Type.Num},l),o.allErrors||t.if((0,Si.not)(l),()=>t.break())})}}Jc.validateAdditionalItems=$D;Jc.default=hW});var Kv=k(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.validateTuple=void 0;var qD=oe(),th=he(),pW=qr(),mW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return jD(r,"additionalItems",e);t.items=!0,!(0,th.alwaysValidSchema)(t,e)&&r.ok((0,pW.validateArray)(r))}};function jD(r,e,t=r.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=r;u(s),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=th.mergeEvaluated.items(n,t.length,a.items));let c=n.name("valid"),l=n.const("len",(0,qD._)`${i}.length`);t.forEach((d,f)=>{(0,th.alwaysValidSchema)(a,d)||(n.if((0,qD._)`${l} > ${f}`,()=>r.subschema({keyword:o,schemaProp:f,dataProp:f},c)),r.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,b=t.length,g=b===d.minItems&&(b===d.maxItems||d[e]===!1);if(f.strictTuples&&!g){let _=`"${o}" is ${b}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,th.checkStrictMode)(a,_,f.strictTuples)}}}Xc.validateTuple=jD;Xc.default=mW});var FD=k(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});var gW=Kv(),yW={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,gW.validateTuple)(r,"items")};zv.default=yW});var UD=k(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var BD=oe(),vW=he(),bW=qr(),TW=Hv(),_W={message:({params:{len:r}})=>(0,BD.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,BD._)`{limit: ${r}}`},SW={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_W,code(r){let{schema:e,parentSchema:t,it:n}=r,{prefixItems:s}=t;n.items=!0,!(0,vW.alwaysValidSchema)(n,e)&&(s?(0,TW.validateAdditionalItems)(r,s):r.ok((0,bW.validateArray)(r)))}};Gv.default=SW});var VD=k(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var Fr=oe(),rh=he(),kW={message:({params:{min:r,max:e}})=>e===void 0?(0,Fr.str)`must contain at least ${r} valid item(s)`:(0,Fr.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,Fr._)`{minContains: ${r}}`:(0,Fr._)`{minContains: ${r}, maxContains: ${e}}`},wW={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:kW,code(r){let{gen:e,schema:t,parentSchema:n,data:s,it:i}=r,o,a,{minContains:c,maxContains:l}=n;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,Fr._)`${s}.length`);if(r.setParams({min:o,max:a}),a===void 0&&o===0){(0,rh.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,rh.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,rh.alwaysValidSchema)(i,t)){let g=(0,Fr._)`${u} >= ${o}`;a!==void 0&&(g=(0,Fr._)`${g} && ${u} <= ${a}`),r.pass(g);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?p(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,Fr._)`${s}.length > 0`,f)):(e.let(d,!1),f()),r.result(d,()=>r.reset());function f(){let g=e.name("_valid"),_=e.let("count",0);p(g,()=>e.if(g,()=>b(_)))}function p(g,_){e.forRange("i",0,u,w=>{r.subschema({keyword:"contains",dataProp:w,dataPropType:rh.Type.Num,compositeRule:!0},g),_()})}function b(g){e.code((0,Fr._)`${g}++`),a===void 0?e.if((0,Fr._)`${g} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,Fr._)`${g} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,Fr._)`${g} >= ${o}`,()=>e.assign(d,!0)))}}};Yv.default=wW});var nh=k(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.validateSchemaDeps=Pn.validatePropertyDeps=Pn.error=void 0;var Jv=oe(),EW=he(),Qc=qr();Pn.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let n=e===1?"property":"properties";return(0,Jv.str)`must have ${n} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:n}})=>(0,Jv._)`{property: ${r},
|
|
180
|
-
missingProperty: ${
|
|
175
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=_f(e),r=xo(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=_f(e),r=xo(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Q0.Parser=wy});var rR=w(gc=>{"use strict";var Z0=uy(),ej=ac(),mc=uc(),tj=cg(),nj=Se(),rj=_y(),eR=Ey();function tR(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new rj.LineCounter||null,prettyErrors:e}}function sj(n,e={}){let{lineCounter:t,prettyErrors:r}=tR(e),s=new eR.Parser(t?.addNewLine),i=new Z0.Composer(e),o=Array.from(i.compose(s.parse(n)));if(r&&t)for(let a of o)a.errors.forEach(mc.prettifyError(n,t)),a.warnings.forEach(mc.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function nR(n,e={}){let{lineCounter:t,prettyErrors:r}=tR(e),s=new eR.Parser(t?.addNewLine),i=new Z0.Composer(e),o=null;for(let a of i.compose(s.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new mc.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(o.errors.forEach(mc.prettifyError(n,t)),o.warnings.forEach(mc.prettifyError(n,t))),o}function ij(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=nR(n,t);if(!s)return null;if(s.warnings.forEach(i=>tj.warn(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},t))}function oj(n,e,t){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(n===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return nj.isDocument(n)&&!r?n.toString(t):new ej.Document(n,r,t).toString(t)}gc.parse=ij;gc.parseAllDocuments=sj;gc.parseDocument=nR;gc.stringify=oj});var Ny=w(xe=>{"use strict";var aj=uy(),cj=ac(),lj=Wg(),ky=uc(),uj=Ha(),As=Se(),dj=Rs(),fj=_t(),hj=Ds(),pj=Os(),mj=Tf(),gj=Ty(),yj=_y(),vj=Ey(),wf=rR(),sR=Ba();xe.Composer=aj.Composer;xe.Document=cj.Document;xe.Schema=lj.Schema;xe.YAMLError=ky.YAMLError;xe.YAMLParseError=ky.YAMLParseError;xe.YAMLWarning=ky.YAMLWarning;xe.Alias=uj.Alias;xe.isAlias=As.isAlias;xe.isCollection=As.isCollection;xe.isDocument=As.isDocument;xe.isMap=As.isMap;xe.isNode=As.isNode;xe.isPair=As.isPair;xe.isScalar=As.isScalar;xe.isSeq=As.isSeq;xe.Pair=dj.Pair;xe.Scalar=fj.Scalar;xe.YAMLMap=hj.YAMLMap;xe.YAMLSeq=pj.YAMLSeq;xe.CST=mj;xe.Lexer=gj.Lexer;xe.LineCounter=yj.LineCounter;xe.Parser=vj.Parser;xe.parse=wf.parse;xe.parseAllDocuments=wf.parseAllDocuments;xe.parseDocument=wf.parseDocument;xe.stringify=wf.stringify;xe.visit=sR.visit;xe.visitAsync=sR.visitAsync});var lR=w((H5,cR)=>{"use strict";cR.exports=oR;function oR(n,e,t){n instanceof RegExp&&(n=iR(n,t)),e instanceof RegExp&&(e=iR(e,t));var r=aR(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}function iR(n,e){var t=e.match(n);return t?t[0]:null}oR.range=aR;function aR(n,e,t){var r,s,i,o,a,c=t.indexOf(n),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(n===e)return[c,l];for(r=[],i=t.length;u>=0&&!a;)u==c?(r.push(u),c=t.indexOf(n,u+1)):r.length==1?a=[r.pop(),l]:(s=r.pop(),s<i&&(i=s,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[i,o])}return a}});var yR=w((K5,gR)=>{var uR=lR();gR.exports=Sj;var dR="\0SLASH"+Math.random()+"\0",fR="\0OPEN"+Math.random()+"\0",Ry="\0CLOSE"+Math.random()+"\0",hR="\0COMMA"+Math.random()+"\0",pR="\0PERIOD"+Math.random()+"\0";function Py(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function bj(n){return n.split("\\\\").join(dR).split("\\{").join(fR).split("\\}").join(Ry).split("\\,").join(hR).split("\\.").join(pR)}function Tj(n){return n.split(dR).join("\\").split(fR).join("{").split(Ry).join("}").split(hR).join(",").split(pR).join(".")}function mR(n){if(!n)return[""];var e=[],t=uR("{","}",n);if(!t)return n.split(",");var r=t.pre,s=t.body,i=t.post,o=r.split(",");o[o.length-1]+="{"+s+"}";var a=mR(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Sj(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),yc(bj(n),!0).map(Tj)):[]}function _j(n){return"{"+n+"}"}function wj(n){return/^-?0\d/.test(n)}function Ej(n,e){return n<=e}function kj(n,e){return n>=e}function yc(n,e){var t=[],r=uR("{","}",n);if(!r)return[n];var s=r.pre,i=r.post.length?yc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<i.length;o++){var a=s+"{"+r.body+"}"+i[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=c||l,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,.*\}/)?(n=r.pre+"{"+r.body+Ry+r.post,yc(n)):[n];var f;if(u)f=r.body.split(/\.\./);else if(f=mR(r.body),f.length===1&&(f=yc(f[0],!1).map(_j),f.length===1))return i.map(function(qe){return r.pre+f[0]+qe});var p;if(u){var b=Py(f[0]),g=Py(f[1]),S=Math.max(f[0].length,f[1].length),E=f.length==3?Math.abs(Py(f[2])):1,T=Ej,v=g<b;v&&(E*=-1,T=kj);var R=f.some(wj);p=[];for(var A=b;T(A,g);A+=E){var $;if(l)$=String.fromCharCode(A),$==="\\"&&($="");else if($=String(A),R){var W=S-$.length;if(W>0){var j=new Array(W+1).join("0");A<0?$="-"+j+$.slice(1):$=j+$}}p.push($)}}else{p=[];for(var ie=0;ie<f.length;ie++)p.push.apply(p,yc(f[ie],!1))}for(var ie=0;ie<p.length;ie++)for(var o=0;o<i.length;o++){var a=s+p[ie]+i[o];(!e||u||a)&&t.push(a)}}return t}});var xc=w(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.regexpCode=we.getEsmExportName=we.getProperty=we.safeStringify=we.stringify=we.strConcat=we.addCodeArg=we.str=we._=we.nil=we._Code=we.Name=we.IDENTIFIER=we._CodeOrName=void 0;var Ic=class{};we._CodeOrName=Ic;we.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ti=class extends Ic{constructor(e){if(super(),!we.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}}};we.Name=Ti;var Un=class extends Ic{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>(r instanceof Ti&&(t[r.str]=(t[r.str]||0)+1),t),{})}};we._Code=Un;we.nil=new Un("");function sC(n,...e){let t=[n[0]],r=0;for(;r<e.length;)zy(t,e[r]),t.push(n[++r]);return new Un(t)}we._=sC;var Ky=new Un("+");function iC(n,...e){let t=[Mc(n[0])],r=0;for(;r<e.length;)t.push(Ky),zy(t,e[r]),t.push(Ky,Mc(n[++r]));return IF(t),new Un(t)}we.str=iC;function zy(n,e){e instanceof Un?n.push(...e._items):e instanceof Ti?n.push(e):n.push($F(e))}we.addCodeArg=zy;function IF(n){let e=1;for(;e<n.length-1;){if(n[e]===Ky){let t=MF(n[e-1],n[e+1]);if(t!==void 0){n.splice(e-1,3,t);continue}n[e++]="+"}e++}}function MF(n,e){if(e==='""')return n;if(n==='""')return e;if(typeof n=="string")return e instanceof Ti||n[n.length-1]!=='"'?void 0:typeof e!="string"?`${n.slice(0,-1)}${e}"`:e[0]==='"'?n.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(n instanceof Ti))return`"${n}${e.slice(1)}`}function xF(n,e){return e.emptyStr()?n:n.emptyStr()?e:iC`${n}${e}`}we.strConcat=xF;function $F(n){return typeof n=="number"||typeof n=="boolean"||n===null?n:Mc(Array.isArray(n)?n.join(","):n)}function LF(n){return new Un(Mc(n))}we.stringify=LF;function Mc(n){return JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}we.safeStringify=Mc;function qF(n){return typeof n=="string"&&we.IDENTIFIER.test(n)?new Un(`.${n}`):sC`[${n}]`}we.getProperty=qF;function jF(n){if(typeof n=="string"&&we.IDENTIFIER.test(n))return new Un(`${n}`);throw new Error(`CodeGen: invalid export name: ${n}, use explicit $id name mapping`)}we.getEsmExportName=jF;function FF(n){return new Un(n.toString())}we.regexpCode=FF});var Jy=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ValueScope=vn.ValueScopeName=vn.Scope=vn.varKinds=vn.UsedValueState=void 0;var yn=xc(),Gy=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Vf;(function(n){n[n.Started=0]="Started",n[n.Completed=1]="Completed"})(Vf||(vn.UsedValueState=Vf={}));vn.varKinds={const:new yn.Name("const"),let:new yn.Name("let"),var:new yn.Name("var")};var Wf=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof yn.Name?e:this.name(e)}name(e){return new yn.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(!((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0)&&r.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};vn.Scope=Wf;var Hf=class extends yn.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,yn._)`.${new yn.Name(t)}[${r}]`}};vn.ValueScopeName=Hf;var BF=(0,yn._)`\n`,Yy=class extends Wf{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?BF:yn.nil}}get(){return this._scope}name(e){return new Hf(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(r=t.key)!==null&&r!==void 0?r:t.ref,a=this._values[i];if(a){let u=a.get(o);if(u)return u}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=t.ref,s.setValue(t,{property:i,itemIndex:l}),s}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,yn._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,r)}_reduceValues(e,t,r={},s){let i=yn.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,Vf.Started);let u=t(l);if(u){let d=this.opts.es5?vn.varKinds.var:vn.varKinds.const;i=(0,yn._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=s?.(l))i=(0,yn._)`${i}${u}${this.opts._n}`;else throw new Gy(l);c.set(l,Vf.Completed)})}return i}};vn.ValueScope=Yy});var ce=w(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.or=de.and=de.not=de.CodeGen=de.operators=de.varKinds=de.ValueScopeName=de.ValueScope=de.Scope=de.Name=de.regexpCode=de.stringify=de.getProperty=de.nil=de.strConcat=de.str=de._=void 0;var be=xc(),dr=Jy(),Ls=xc();Object.defineProperty(de,"_",{enumerable:!0,get:function(){return Ls._}});Object.defineProperty(de,"str",{enumerable:!0,get:function(){return Ls.str}});Object.defineProperty(de,"strConcat",{enumerable:!0,get:function(){return Ls.strConcat}});Object.defineProperty(de,"nil",{enumerable:!0,get:function(){return Ls.nil}});Object.defineProperty(de,"getProperty",{enumerable:!0,get:function(){return Ls.getProperty}});Object.defineProperty(de,"stringify",{enumerable:!0,get:function(){return Ls.stringify}});Object.defineProperty(de,"regexpCode",{enumerable:!0,get:function(){return Ls.regexpCode}});Object.defineProperty(de,"Name",{enumerable:!0,get:function(){return Ls.Name}});var Yf=Jy();Object.defineProperty(de,"Scope",{enumerable:!0,get:function(){return Yf.Scope}});Object.defineProperty(de,"ValueScope",{enumerable:!0,get:function(){return Yf.ValueScope}});Object.defineProperty(de,"ValueScopeName",{enumerable:!0,get:function(){return Yf.ValueScopeName}});Object.defineProperty(de,"varKinds",{enumerable:!0,get:function(){return Yf.varKinds}});de.operators={GT:new be._Code(">"),GTE:new be._Code(">="),LT:new be._Code("<"),LTE:new be._Code("<="),EQ:new be._Code("==="),NEQ:new be._Code("!=="),NOT:new be._Code("!"),OR:new be._Code("||"),AND:new be._Code("&&"),ADD:new be._Code("+")};var Xr=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Xy=class extends Xr{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?dr.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=Go(this.rhs,e,t)),this}get names(){return this.rhs instanceof be._CodeOrName?this.rhs.names:{}}},Kf=class extends Xr{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Go(this.rhs,e,t),this}get names(){let e=this.lhs instanceof be.Name?{}:{...this.lhs.names};return Gf(e,this.rhs)}},Qy=class extends Kf{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Zy=class extends Xr{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ev=class extends Xr{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},tv=class extends Xr{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},nv=class extends Xr{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Go(this.code,e,t),this}get names(){return this.code instanceof be._CodeOrName?this.code.names:{}}},$c=class extends Xr{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,s=r.length;for(;s--;){let i=r[s];i.optimizeNames(e,t)||(UF(e,i.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>wi(e,t.names),{})}},Qr=class extends $c{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},rv=class extends $c{},zo=class extends Qr{};zo.kind="else";var Si=class n extends Qr{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new zo(r):r}if(t)return e===!1?t instanceof n?t:t.nodes:this.nodes.length?this:new n(oC(e),t instanceof n?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=Go(this.condition,e,t),this}get names(){let e=super.names;return Gf(e,this.condition),this.else&&wi(e,this.else.names),e}};Si.kind="if";var _i=class extends Qr{};_i.kind="for";var sv=class extends _i{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=Go(this.iteration,e,t),this}get names(){return wi(super.names,this.iteration.names)}},iv=class extends _i{constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){let t=e.es5?dr.varKinds.var:this.varKind,{name:r,from:s,to:i}=this;return`for(${t} ${r}=${s}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=Gf(super.names,this.from);return Gf(e,this.to)}},zf=class extends _i{constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=Go(this.iterable,e,t),this}get names(){return wi(super.names,this.iterable.names)}},Lc=class extends Qr{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Lc.kind="func";var qc=class extends $c{render(e){return"return "+super.render(e)}};qc.kind="return";var ov=class extends Qr{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&wi(e,this.catch.names),this.finally&&wi(e,this.finally.names),e}},jc=class extends Qr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};jc.kind="catch";var Fc=class extends Qr{render(e){return"finally"+super.render(e)}};Fc.kind="finally";var av=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
176
|
+
`:""},this._extScope=e,this._scope=new dr.Scope({parent:e}),this._nodes=[new rv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){let i=this._scope.toName(t);return r!==void 0&&s&&(this._constants[i.str]=r),this._leafNode(new Xy(e,i,r)),i}const(e,t,r){return this._def(dr.varKinds.const,e,t,r)}let(e,t,r){return this._def(dr.varKinds.let,e,t,r)}var(e,t,r){return this._def(dr.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Kf(e,t,r))}add(e,t){return this._leafNode(new Qy(e,de.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==be.nil&&this._leafNode(new nv(e)),this}object(...e){let t=["{"];for(let[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,be.addCodeArg)(t,s));return t.push("}"),new be._Code(t)}if(e,t,r){if(this._blockNode(new Si(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Si(e))}else(){return this._elseNode(new zo)}endIf(){return this._endBlockNode(Si,zo)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new sv(e),t)}forRange(e,t,r,s,i=this.opts.es5?dr.varKinds.var:dr.varKinds.let){let o=this._scope.toName(e);return this._for(new iv(i,o,t,r),()=>s(o))}forOf(e,t,r,s=dr.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=t instanceof be.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,be._)`${o}.length`,a=>{this.var(i,(0,be._)`${o}[${a}]`),r(i)})}return this._for(new zf("of",s,i,t),()=>r(i))}forIn(e,t,r,s=this.opts.es5?dr.varKinds.var:dr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,be._)`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new zf("in",s,i,t),()=>r(i))}endFor(){return this._endBlockNode(_i)}label(e){return this._leafNode(new Zy(e))}break(e){return this._leafNode(new ev(e))}return(e){let t=new qc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(qc)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new ov;if(this._blockNode(s),this.code(e),t){let i=this.name("e");this._currNode=s.catch=new jc(i),t(i)}return r&&(this._currNode=s.finally=new Fc,this.code(r)),this._endBlockNode(jc,Fc)}throw(e){return this._leafNode(new tv(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=be.nil,r,s){return this._blockNode(new Lc(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(Lc)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Si))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};de.CodeGen=av;function wi(n,e){for(let t in e)n[t]=(n[t]||0)+(e[t]||0);return n}function Gf(n,e){return e instanceof be._CodeOrName?wi(n,e.names):n}function Go(n,e,t){if(n instanceof be.Name)return r(n);if(!s(n))return n;return new be._Code(n._items.reduce((i,o)=>(o instanceof be.Name&&(o=r(o)),o instanceof be._Code?i.push(...o._items):i.push(o),i),[]));function r(i){let o=t[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof be._Code&&i._items.some(o=>o instanceof be.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function UF(n,e){for(let t in e)n[t]=(n[t]||0)-(e[t]||0)}function oC(n){return typeof n=="boolean"||typeof n=="number"||n===null?!n:(0,be._)`!${cv(n)}`}de.not=oC;var VF=aC(de.operators.AND);function WF(...n){return n.reduce(VF)}de.and=WF;var HF=aC(de.operators.OR);function KF(...n){return n.reduce(HF)}de.or=KF;function aC(n){return(e,t)=>e===be.nil?t:t===be.nil?e:(0,be._)`${cv(e)} ${n} ${cv(t)}`}function cv(n){return n instanceof be.Name?n:(0,be._)`(${n})`}});var me=w(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.checkStrictMode=fe.getErrorPath=fe.Type=fe.useFunc=fe.setEvaluated=fe.evaluatedPropsToName=fe.mergeEvaluated=fe.eachItem=fe.unescapeJsonPointer=fe.escapeJsonPointer=fe.escapeFragment=fe.unescapeFragment=fe.schemaRefOrVal=fe.schemaHasRulesButRef=fe.schemaHasRules=fe.checkUnknownRules=fe.alwaysValidSchema=fe.toHash=void 0;var Ke=ce(),zF=xc();function GF(n){let e={};for(let t of n)e[t]=!0;return e}fe.toHash=GF;function YF(n,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(uC(n,e),!dC(e,n.self.RULES.all))}fe.alwaysValidSchema=YF;function uC(n,e=n.schema){let{opts:t,self:r}=n;if(!t.strictSchema||typeof e=="boolean")return;let s=r.RULES.keywords;for(let i in e)s[i]||pC(n,`unknown keyword: "${i}"`)}fe.checkUnknownRules=uC;function dC(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(e[t])return!0;return!1}fe.schemaHasRules=dC;function JF(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(t!=="$ref"&&e.all[t])return!0;return!1}fe.schemaHasRulesButRef=JF;function XF({topSchemaRef:n,schemaPath:e},t,r,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Ke._)`${t}`}return(0,Ke._)`${n}${e}${(0,Ke.getProperty)(r)}`}fe.schemaRefOrVal=XF;function QF(n){return fC(decodeURIComponent(n))}fe.unescapeFragment=QF;function ZF(n){return encodeURIComponent(uv(n))}fe.escapeFragment=ZF;function uv(n){return typeof n=="number"?`${n}`:n.replace(/~/g,"~0").replace(/\//g,"~1")}fe.escapeJsonPointer=uv;function fC(n){return n.replace(/~1/g,"/").replace(/~0/g,"~")}fe.unescapeJsonPointer=fC;function eB(n,e){if(Array.isArray(n))for(let t of n)e(t);else e(n)}fe.eachItem=eB;function cC({mergeNames:n,mergeToName:e,mergeValues:t,resultToName:r}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Ke.Name?(i instanceof Ke.Name?n(s,i,o):e(s,i,o),o):i instanceof Ke.Name?(e(s,o,i),i):t(i,o);return a===Ke.Name&&!(c instanceof Ke.Name)?r(s,c):c}}fe.mergeEvaluated={props:cC({mergeNames:(n,e,t)=>n.if((0,Ke._)`${t} !== true && ${e} !== undefined`,()=>{n.if((0,Ke._)`${e} === true`,()=>n.assign(t,!0),()=>n.assign(t,(0,Ke._)`${t} || {}`).code((0,Ke._)`Object.assign(${t}, ${e})`))}),mergeToName:(n,e,t)=>n.if((0,Ke._)`${t} !== true`,()=>{e===!0?n.assign(t,!0):(n.assign(t,(0,Ke._)`${t} || {}`),dv(n,t,e))}),mergeValues:(n,e)=>n===!0?!0:{...n,...e},resultToName:hC}),items:cC({mergeNames:(n,e,t)=>n.if((0,Ke._)`${t} !== true && ${e} !== undefined`,()=>n.assign(t,(0,Ke._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(n,e,t)=>n.if((0,Ke._)`${t} !== true`,()=>n.assign(t,e===!0?!0:(0,Ke._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(n,e)=>n===!0?!0:Math.max(n,e),resultToName:(n,e)=>n.var("items",e)})};function hC(n,e){if(e===!0)return n.var("props",!0);let t=n.var("props",(0,Ke._)`{}`);return e!==void 0&&dv(n,t,e),t}fe.evaluatedPropsToName=hC;function dv(n,e,t){Object.keys(t).forEach(r=>n.assign((0,Ke._)`${e}${(0,Ke.getProperty)(r)}`,!0))}fe.setEvaluated=dv;var lC={};function tB(n,e){return n.scopeValue("func",{ref:e,code:lC[e.code]||(lC[e.code]=new zF._Code(e.code))})}fe.useFunc=tB;var lv;(function(n){n[n.Num=0]="Num",n[n.Str=1]="Str"})(lv||(fe.Type=lv={}));function nB(n,e,t){if(n instanceof Ke.Name){let r=e===lv.Num;return t?r?(0,Ke._)`"[" + ${n} + "]"`:(0,Ke._)`"['" + ${n} + "']"`:r?(0,Ke._)`"/" + ${n}`:(0,Ke._)`"/" + ${n}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Ke.getProperty)(n).toString():"/"+uv(n)}fe.getErrorPath=nB;function pC(n,e,t=n.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);n.self.logger.warn(e)}}fe.checkStrictMode=pC});var Vn=w(fv=>{"use strict";Object.defineProperty(fv,"__esModule",{value:!0});var Jt=ce(),rB={data:new Jt.Name("data"),valCxt:new Jt.Name("valCxt"),instancePath:new Jt.Name("instancePath"),parentData:new Jt.Name("parentData"),parentDataProperty:new Jt.Name("parentDataProperty"),rootData:new Jt.Name("rootData"),dynamicAnchors:new Jt.Name("dynamicAnchors"),vErrors:new Jt.Name("vErrors"),errors:new Jt.Name("errors"),this:new Jt.Name("this"),self:new Jt.Name("self"),scope:new Jt.Name("scope"),json:new Jt.Name("json"),jsonPos:new Jt.Name("jsonPos"),jsonLen:new Jt.Name("jsonLen"),jsonPart:new Jt.Name("jsonPart")};fv.default=rB});var Bc=w(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.extendErrors=Xt.resetErrorsCount=Xt.reportExtraError=Xt.reportError=Xt.keyword$DataError=Xt.keywordError=void 0;var _e=ce(),Jf=me(),an=Vn();Xt.keywordError={message:({keyword:n})=>(0,_e.str)`must pass "${n}" keyword validation`};Xt.keyword$DataError={message:({keyword:n,schemaType:e})=>e?(0,_e.str)`"${n}" keyword must be ${e} ($data)`:(0,_e.str)`"${n}" keyword is invalid ($data)`};function sB(n,e=Xt.keywordError,t,r){let{it:s}=n,{gen:i,compositeRule:o,allErrors:a}=s,c=yC(n,e,t);r??(o||a)?mC(i,c):gC(s,(0,_e._)`[${c}]`)}Xt.reportError=sB;function iB(n,e=Xt.keywordError,t){let{it:r}=n,{gen:s,compositeRule:i,allErrors:o}=r,a=yC(n,e,t);mC(s,a),i||o||gC(r,an.default.vErrors)}Xt.reportExtraError=iB;function oB(n,e){n.assign(an.default.errors,e),n.if((0,_e._)`${an.default.vErrors} !== null`,()=>n.if(e,()=>n.assign((0,_e._)`${an.default.vErrors}.length`,e),()=>n.assign(an.default.vErrors,null)))}Xt.resetErrorsCount=oB;function aB({gen:n,keyword:e,schemaValue:t,data:r,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=n.name("err");n.forRange("i",s,an.default.errors,a=>{n.const(o,(0,_e._)`${an.default.vErrors}[${a}]`),n.if((0,_e._)`${o}.instancePath === undefined`,()=>n.assign((0,_e._)`${o}.instancePath`,(0,_e.strConcat)(an.default.instancePath,i.errorPath))),n.assign((0,_e._)`${o}.schemaPath`,(0,_e.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(n.assign((0,_e._)`${o}.schema`,t),n.assign((0,_e._)`${o}.data`,r))})}Xt.extendErrors=aB;function mC(n,e){let t=n.const("err",e);n.if((0,_e._)`${an.default.vErrors} === null`,()=>n.assign(an.default.vErrors,(0,_e._)`[${t}]`),(0,_e._)`${an.default.vErrors}.push(${t})`),n.code((0,_e._)`${an.default.errors}++`)}function gC(n,e){let{gen:t,validateName:r,schemaEnv:s}=n;s.$async?t.throw((0,_e._)`new ${n.ValidationError}(${e})`):(t.assign((0,_e._)`${r}.errors`,e),t.return(!1))}var Ei={keyword:new _e.Name("keyword"),schemaPath:new _e.Name("schemaPath"),params:new _e.Name("params"),propertyName:new _e.Name("propertyName"),message:new _e.Name("message"),schema:new _e.Name("schema"),parentSchema:new _e.Name("parentSchema")};function yC(n,e,t){let{createErrors:r}=n.it;return r===!1?(0,_e._)`{}`:cB(n,e,t)}function cB(n,e,t={}){let{gen:r,it:s}=n,i=[lB(s,t),uB(n,t)];return dB(n,e,i),r.object(...i)}function lB({errorPath:n},{instancePath:e}){let t=e?(0,_e.str)`${n}${(0,Jf.getErrorPath)(e,Jf.Type.Str)}`:n;return[an.default.instancePath,(0,_e.strConcat)(an.default.instancePath,t)]}function uB({keyword:n,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:r}){let s=r?e:(0,_e.str)`${e}/${n}`;return t&&(s=(0,_e.str)`${s}${(0,Jf.getErrorPath)(t,Jf.Type.Str)}`),[Ei.schemaPath,s]}function dB(n,{params:e,message:t},r){let{keyword:s,data:i,schemaValue:o,it:a}=n,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([Ei.keyword,s],[Ei.params,typeof e=="function"?e(n):e||(0,_e._)`{}`]),c.messages&&r.push([Ei.message,typeof t=="function"?t(n):t]),c.verbose&&r.push([Ei.schema,o],[Ei.parentSchema,(0,_e._)`${u}${d}`],[an.default.data,i]),l&&r.push([Ei.propertyName,l])}});var bC=w(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.boolOrEmptySchema=Yo.topBoolOrEmptySchema=void 0;var fB=Bc(),hB=ce(),pB=Vn(),mB={message:"boolean schema is false"};function gB(n){let{gen:e,schema:t,validateName:r}=n;t===!1?vC(n,!1):typeof t=="object"&&t.$async===!0?e.return(pB.default.data):(e.assign((0,hB._)`${r}.errors`,null),e.return(!0))}Yo.topBoolOrEmptySchema=gB;function yB(n,e){let{gen:t,schema:r}=n;r===!1?(t.var(e,!1),vC(n)):t.var(e,!0)}Yo.boolOrEmptySchema=yB;function vC(n,e){let{gen:t,data:r}=n,s={gen:t,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:n};(0,fB.reportError)(s,mB,void 0,e)}});var hv=w(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.getRules=Jo.isJSONType=void 0;var vB=["string","number","integer","boolean","null","object","array"],bB=new Set(vB);function TB(n){return typeof n=="string"&&bB.has(n)}Jo.isJSONType=TB;function SB(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}Jo.getRules=SB});var pv=w(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.shouldUseRule=qs.shouldUseGroup=qs.schemaHasRulesForType=void 0;function _B({schema:n,self:e},t){let r=e.RULES.types[t];return r&&r!==!0&&TC(n,r)}qs.schemaHasRulesForType=_B;function TC(n,e){return e.rules.some(t=>SC(n,t))}qs.shouldUseGroup=TC;function SC(n,e){var t;return n[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(r=>n[r]!==void 0))}qs.shouldUseRule=SC});var Uc=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.reportTypeError=Qt.checkDataTypes=Qt.checkDataType=Qt.coerceAndCheckDataType=Qt.getJSONTypes=Qt.getSchemaTypes=Qt.DataType=void 0;var wB=hv(),EB=pv(),kB=Bc(),le=ce(),_C=me(),Xo;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(Xo||(Qt.DataType=Xo={}));function NB(n){let e=wC(n.type);if(e.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&e.push("null")}return e}Qt.getSchemaTypes=NB;function wC(n){let e=Array.isArray(n)?n:n?[n]:[];if(e.every(wB.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Qt.getJSONTypes=wC;function PB(n,e){let{gen:t,data:r,opts:s}=n,i=RB(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,EB.schemaHasRulesForType)(n,e[0]));if(o){let a=gv(e,r,s.strictNumbers,Xo.Wrong);t.if(a,()=>{i.length?CB(n,e,i):yv(n)})}return o}Qt.coerceAndCheckDataType=PB;var EC=new Set(["string","number","integer","boolean","null"]);function RB(n,e){return e?n.filter(t=>EC.has(t)||e==="array"&&t==="array"):[]}function CB(n,e,t){let{gen:r,data:s,opts:i}=n,o=r.let("dataType",(0,le._)`typeof ${s}`),a=r.let("coerced",(0,le._)`undefined`);i.coerceTypes==="array"&&r.if((0,le._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>r.assign(s,(0,le._)`${s}[0]`).assign(o,(0,le._)`typeof ${s}`).if(gv(e,s,i.strictNumbers),()=>r.assign(a,s))),r.if((0,le._)`${a} !== undefined`);for(let l of t)(EC.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);r.else(),yv(n),r.endIf(),r.if((0,le._)`${a} !== undefined`,()=>{r.assign(s,a),DB(n,a)});function c(l){switch(l){case"string":r.elseIf((0,le._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,le._)`"" + ${s}`).elseIf((0,le._)`${s} === null`).assign(a,(0,le._)`""`);return;case"number":r.elseIf((0,le._)`${o} == "boolean" || ${s} === null
|
|
177
|
+
|| (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,le._)`+${s}`);return;case"integer":r.elseIf((0,le._)`${o} === "boolean" || ${s} === null
|
|
178
|
+
|| (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,le._)`+${s}`);return;case"boolean":r.elseIf((0,le._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,le._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":r.elseIf((0,le._)`${s} === "" || ${s} === 0 || ${s} === false`),r.assign(a,null);return;case"array":r.elseIf((0,le._)`${o} === "string" || ${o} === "number"
|
|
179
|
+
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,le._)`[${s}]`)}}}function DB({gen:n,parentData:e,parentDataProperty:t},r){n.if((0,le._)`${e} !== undefined`,()=>n.assign((0,le._)`${e}[${t}]`,r))}function mv(n,e,t,r=Xo.Correct){let s=r===Xo.Correct?le.operators.EQ:le.operators.NEQ,i;switch(n){case"null":return(0,le._)`${e} ${s} null`;case"array":i=(0,le._)`Array.isArray(${e})`;break;case"object":i=(0,le._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,le._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,le._)`typeof ${e} ${s} ${n}`}return r===Xo.Correct?i:(0,le.not)(i);function o(a=le.nil){return(0,le.and)((0,le._)`typeof ${e} == "number"`,a,t?(0,le._)`isFinite(${e})`:le.nil)}}Qt.checkDataType=mv;function gv(n,e,t,r){if(n.length===1)return mv(n[0],e,t,r);let s,i=(0,_C.toHash)(n);if(i.array&&i.object){let o=(0,le._)`typeof ${e} != "object"`;s=i.null?o:(0,le._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=le.nil;i.number&&delete i.integer;for(let o in i)s=(0,le.and)(s,mv(o,e,t,r));return s}Qt.checkDataTypes=gv;var OB={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:e})=>typeof n=="string"?(0,le._)`{type: ${n}}`:(0,le._)`{type: ${e}}`};function yv(n){let e=AB(n);(0,kB.reportError)(e,OB)}Qt.reportTypeError=yv;function AB(n){let{gen:e,data:t,schema:r}=n,s=(0,_C.schemaRefOrVal)(n,r,"type");return{gen:e,keyword:"type",data:t,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:n}}});var NC=w(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.assignDefaults=void 0;var Qo=ce(),IB=me();function MB(n,e){let{properties:t,items:r}=n.schema;if(e==="object"&&t)for(let s in t)kC(n,s,t[s].default);else e==="array"&&Array.isArray(r)&&r.forEach((s,i)=>kC(n,i,s.default))}Xf.assignDefaults=MB;function kC(n,e,t){let{gen:r,compositeRule:s,data:i,opts:o}=n;if(t===void 0)return;let a=(0,Qo._)`${i}${(0,Qo.getProperty)(e)}`;if(s){(0,IB.checkStrictMode)(n,`default is ignored for: ${a}`);return}let c=(0,Qo._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,Qo._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,Qo._)`${a} = ${(0,Qo.stringify)(t)}`)}});var Wn=w(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.validateUnion=Ue.validateArray=Ue.usePattern=Ue.callValidateCode=Ue.schemaProperties=Ue.allSchemaProperties=Ue.noPropertyInData=Ue.propertyInData=Ue.isOwnProperty=Ue.hasPropFunc=Ue.reportMissingProp=Ue.checkMissingProp=Ue.checkReportMissingProp=void 0;var rt=ce(),vv=me(),js=Vn(),xB=me();function $B(n,e){let{gen:t,data:r,it:s}=n;t.if(Tv(t,r,e,s.opts.ownProperties),()=>{n.setParams({missingProperty:(0,rt._)`${e}`},!0),n.error()})}Ue.checkReportMissingProp=$B;function LB({gen:n,data:e,it:{opts:t}},r,s){return(0,rt.or)(...r.map(i=>(0,rt.and)(Tv(n,e,i,t.ownProperties),(0,rt._)`${s} = ${i}`)))}Ue.checkMissingProp=LB;function qB(n,e){n.setParams({missingProperty:e},!0),n.error()}Ue.reportMissingProp=qB;function PC(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,rt._)`Object.prototype.hasOwnProperty`})}Ue.hasPropFunc=PC;function bv(n,e,t){return(0,rt._)`${PC(n)}.call(${e}, ${t})`}Ue.isOwnProperty=bv;function jB(n,e,t,r){let s=(0,rt._)`${e}${(0,rt.getProperty)(t)} !== undefined`;return r?(0,rt._)`${s} && ${bv(n,e,t)}`:s}Ue.propertyInData=jB;function Tv(n,e,t,r){let s=(0,rt._)`${e}${(0,rt.getProperty)(t)} === undefined`;return r?(0,rt.or)(s,(0,rt.not)(bv(n,e,t))):s}Ue.noPropertyInData=Tv;function RC(n){return n?Object.keys(n).filter(e=>e!=="__proto__"):[]}Ue.allSchemaProperties=RC;function FB(n,e){return RC(e).filter(t=>!(0,vv.alwaysValidSchema)(n,e[t]))}Ue.schemaProperties=FB;function BB({schemaCode:n,data:e,it:{gen:t,topSchemaRef:r,schemaPath:s,errorPath:i},it:o},a,c,l){let u=l?(0,rt._)`${n}, ${e}, ${r}${s}`:e,d=[[js.default.instancePath,(0,rt.strConcat)(js.default.instancePath,i)],[js.default.parentData,o.parentData],[js.default.parentDataProperty,o.parentDataProperty],[js.default.rootData,js.default.rootData]];o.opts.dynamicRef&&d.push([js.default.dynamicAnchors,js.default.dynamicAnchors]);let f=(0,rt._)`${u}, ${t.object(...d)}`;return c!==rt.nil?(0,rt._)`${a}.call(${c}, ${f})`:(0,rt._)`${a}(${f})`}Ue.callValidateCode=BB;var UB=(0,rt._)`new RegExp`;function VB({gen:n,it:{opts:e}},t){let r=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(t,r);return n.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,rt._)`${s.code==="new RegExp"?UB:(0,xB.useFunc)(n,s)}(${t}, ${r})`})}Ue.usePattern=VB;function WB(n){let{gen:e,data:t,keyword:r,it:s}=n,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,rt._)`${t}.length`);e.forRange("i",0,c,l=>{n.subschema({keyword:r,dataProp:l,dataPropType:vv.Type.Num},i),e.if((0,rt.not)(i),a)})}}Ue.validateArray=WB;function HB(n){let{gen:e,schema:t,keyword:r,it:s}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(c=>(0,vv.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((c,l)=>{let u=n.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,rt._)`${o} || ${a}`),n.mergeValidEvaluated(u,a)||e.if((0,rt.not)(o))})),n.result(o,()=>n.reset(),()=>n.error(!0))}Ue.validateUnion=HB});var OC=w(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.validateKeywordUsage=Or.validSchemaType=Or.funcKeywordCode=Or.macroKeywordCode=void 0;var cn=ce(),ki=Vn(),KB=Wn(),zB=Bc();function GB(n,e){let{gen:t,keyword:r,schema:s,parentSchema:i,it:o}=n,a=e.macro.call(o.self,s,i,o),c=DC(t,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=t.name("valid");n.subschema({schema:a,schemaPath:cn.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),n.pass(l,()=>n.error(!0))}Or.macroKeywordCode=GB;function YB(n,e){var t;let{gen:r,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=n;XB(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=DC(r,s,l),d=r.let("valid");n.block$data(d,f),n.ok((t=e.valid)!==null&&t!==void 0?t:d);function f(){if(e.errors===!1)g(),e.modifying&&CC(n),S(()=>n.error());else{let E=e.async?p():b();e.modifying&&CC(n),S(()=>JB(n,E))}}function p(){let E=r.let("ruleErrs",null);return r.try(()=>g((0,cn._)`await `),T=>r.assign(d,!1).if((0,cn._)`${T} instanceof ${c.ValidationError}`,()=>r.assign(E,(0,cn._)`${T}.errors`),()=>r.throw(T))),E}function b(){let E=(0,cn._)`${u}.errors`;return r.assign(E,null),g(cn.nil),E}function g(E=e.async?(0,cn._)`await `:cn.nil){let T=c.opts.passContext?ki.default.this:ki.default.self,v=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,cn._)`${E}${(0,KB.callValidateCode)(n,u,T,v)}`,e.modifying)}function S(E){var T;r.if((0,cn.not)((T=e.valid)!==null&&T!==void 0?T:d),E)}}Or.funcKeywordCode=YB;function CC(n){let{gen:e,data:t,it:r}=n;e.if(r.parentData,()=>e.assign(t,(0,cn._)`${r.parentData}[${r.parentDataProperty}]`))}function JB(n,e){let{gen:t}=n;t.if((0,cn._)`Array.isArray(${e})`,()=>{t.assign(ki.default.vErrors,(0,cn._)`${ki.default.vErrors} === null ? ${e} : ${ki.default.vErrors}.concat(${e})`).assign(ki.default.errors,(0,cn._)`${ki.default.vErrors}.length`),(0,zB.extendErrors)(n)},()=>n.error())}function XB({schemaEnv:n},e){if(e.async&&!n.$async)throw new Error("async keyword in sync schema")}function DC(n,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return n.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,cn.stringify)(t)})}function QB(n,e,t=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(n):r==="object"?n&&typeof n=="object"&&!Array.isArray(n):typeof n==r||t&&typeof n>"u")}Or.validSchemaType=QB;function ZB({schema:n,opts:e,self:t,errSchemaPath:r},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(n,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(n[i])){let c=`keyword "${i}" value is invalid at path "${r}": `+t.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(c);else throw new Error(c)}}Or.validateKeywordUsage=ZB});var IC=w(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.extendSubschemaMode=Fs.extendSubschemaData=Fs.getSubschema=void 0;var Ar=ce(),AC=me();function eU(n,{keyword:e,schemaProp:t,schema:r,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=n.schema[e];return t===void 0?{schema:a,schemaPath:(0,Ar._)`${n.schemaPath}${(0,Ar.getProperty)(e)}`,errSchemaPath:`${n.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,Ar._)`${n.schemaPath}${(0,Ar.getProperty)(e)}${(0,Ar.getProperty)(t)}`,errSchemaPath:`${n.errSchemaPath}/${e}/${(0,AC.escapeFragment)(t)}`}}if(r!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Fs.getSubschema=eU;function tU(n,e,{dataProp:t,dataPropType:r,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Ar._)`${e.data}${(0,Ar.getProperty)(t)}`,!0);c(f),n.errorPath=(0,Ar.str)`${l}${(0,AC.getErrorPath)(t,r,d.jsPropertySyntax)}`,n.parentDataProperty=(0,Ar._)`${t}`,n.dataPathArr=[...u,n.parentDataProperty]}if(s!==void 0){let l=s instanceof Ar.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(n.propertyName=o)}i&&(n.dataTypes=i);function c(l){n.data=l,n.dataLevel=e.dataLevel+1,n.dataTypes=[],e.definedProperties=new Set,n.parentData=e.data,n.dataNames=[...e.dataNames,l]}}Fs.extendSubschemaData=tU;function nU(n,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:r,createErrors:s,allErrors:i}){r!==void 0&&(n.compositeRule=r),s!==void 0&&(n.createErrors=s),i!==void 0&&(n.allErrors=i),n.jtdDiscriminator=e,n.jtdMetadata=t}Fs.extendSubschemaMode=nU});var Sv=w((iee,MC)=>{"use strict";MC.exports=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var $C=w((oee,xC)=>{"use strict";var Bs=xC.exports=function(n,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var r=typeof t=="function"?t:t.pre||function(){},s=t.post||function(){};Qf(e,r,s,n,"",n)};Bs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Bs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Bs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Bs.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 Qf(n,e,t,r,s,i,o,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,s,i,o,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in Bs.arrayKeywords)for(var f=0;f<d.length;f++)Qf(n,e,t,d[f],s+"/"+u+"/"+f,i,s,u,r,f)}else if(u in Bs.propsKeywords){if(d&&typeof d=="object")for(var p in d)Qf(n,e,t,d[p],s+"/"+u+"/"+rU(p),i,s,u,r,p)}else(u in Bs.keywords||n.allKeys&&!(u in Bs.skipKeywords))&&Qf(n,e,t,d,s+"/"+u,i,s,u,r)}t(r,s,i,o,a,c,l)}}function rU(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}});var Vc=w(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.getSchemaRefs=bn.resolveUrl=bn.normalizeId=bn._getFullPath=bn.getFullPath=bn.inlineRef=void 0;var sU=me(),iU=Sv(),oU=$C(),aU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function cU(n,e=!0){return typeof n=="boolean"?!0:e===!0?!_v(n):e?LC(n)<=e:!1}bn.inlineRef=cU;var lU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _v(n){for(let e in n){if(lU.has(e))return!0;let t=n[e];if(Array.isArray(t)&&t.some(_v)||typeof t=="object"&&_v(t))return!0}return!1}function LC(n){let e=0;for(let t in n){if(t==="$ref")return 1/0;if(e++,!aU.has(t)&&(typeof n[t]=="object"&&(0,sU.eachItem)(n[t],r=>e+=LC(r)),e===1/0))return 1/0}return e}function qC(n,e="",t){t!==!1&&(e=Zo(e));let r=n.parse(e);return jC(n,r)}bn.getFullPath=qC;function jC(n,e){return n.serialize(e).split("#")[0]+"#"}bn._getFullPath=jC;var uU=/#\/?$/;function Zo(n){return n?n.replace(uU,""):""}bn.normalizeId=Zo;function dU(n,e,t){return t=Zo(t),n.resolve(e,t)}bn.resolveUrl=dU;var fU=/^[a-z_][-a-z0-9._]*$/i;function hU(n,e){if(typeof n=="boolean")return{};let{schemaId:t,uriResolver:r}=this.opts,s=Zo(n[t]||e),i={"":s},o=qC(r,s,!1),a={},c=new Set;return oU(n,{allKeys:!0},(d,f,p,b)=>{if(b===void 0)return;let g=o+f,S=i[b];typeof d[t]=="string"&&(S=E.call(this,d[t])),T.call(this,d.$anchor),T.call(this,d.$dynamicAnchor),i[f]=S;function E(v){let R=this.opts.uriResolver.resolve;if(v=Zo(S?R(S,v):v),c.has(v))throw u(v);c.add(v);let A=this.refs[v];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(d,A.schema,v):v!==Zo(g)&&(v[0]==="#"?(l(d,a[v],v),a[v]=d):this.refs[v]=g),v}function T(v){if(typeof v=="string"){if(!fU.test(v))throw new Error(`invalid anchor "${v}"`);E.call(this,`#${v}`)}}}),a;function l(d,f,p){if(f!==void 0&&!iU(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}bn.getSchemaRefs=hU});var Kc=w(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.getData=Us.KeywordCxt=Us.validateFunctionCode=void 0;var WC=bC(),FC=Uc(),Ev=pv(),Zf=Uc(),pU=NC(),Hc=OC(),wv=IC(),Y=ce(),ne=Vn(),mU=Vc(),Zr=me(),Wc=Bc();function gU(n){if(zC(n)&&(GC(n),KC(n))){bU(n);return}HC(n,()=>(0,WC.topBoolOrEmptySchema)(n))}Us.validateFunctionCode=gU;function HC({gen:n,validateName:e,schema:t,schemaEnv:r,opts:s},i){s.code.es5?n.func(e,(0,Y._)`${ne.default.data}, ${ne.default.valCxt}`,r.$async,()=>{n.code((0,Y._)`"use strict"; ${BC(t,s)}`),vU(n,s),n.code(i)}):n.func(e,(0,Y._)`${ne.default.data}, ${yU(s)}`,r.$async,()=>n.code(BC(t,s)).code(i))}function yU(n){return(0,Y._)`{${ne.default.instancePath}="", ${ne.default.parentData}, ${ne.default.parentDataProperty}, ${ne.default.rootData}=${ne.default.data}${n.dynamicRef?(0,Y._)`, ${ne.default.dynamicAnchors}={}`:Y.nil}}={}`}function vU(n,e){n.if(ne.default.valCxt,()=>{n.var(ne.default.instancePath,(0,Y._)`${ne.default.valCxt}.${ne.default.instancePath}`),n.var(ne.default.parentData,(0,Y._)`${ne.default.valCxt}.${ne.default.parentData}`),n.var(ne.default.parentDataProperty,(0,Y._)`${ne.default.valCxt}.${ne.default.parentDataProperty}`),n.var(ne.default.rootData,(0,Y._)`${ne.default.valCxt}.${ne.default.rootData}`),e.dynamicRef&&n.var(ne.default.dynamicAnchors,(0,Y._)`${ne.default.valCxt}.${ne.default.dynamicAnchors}`)},()=>{n.var(ne.default.instancePath,(0,Y._)`""`),n.var(ne.default.parentData,(0,Y._)`undefined`),n.var(ne.default.parentDataProperty,(0,Y._)`undefined`),n.var(ne.default.rootData,ne.default.data),e.dynamicRef&&n.var(ne.default.dynamicAnchors,(0,Y._)`{}`)})}function bU(n){let{schema:e,opts:t,gen:r}=n;HC(n,()=>{t.$comment&&e.$comment&&JC(n),EU(n),r.let(ne.default.vErrors,null),r.let(ne.default.errors,0),t.unevaluated&&TU(n),YC(n),PU(n)})}function TU(n){let{gen:e,validateName:t}=n;n.evaluated=e.const("evaluated",(0,Y._)`${t}.evaluated`),e.if((0,Y._)`${n.evaluated}.dynamicProps`,()=>e.assign((0,Y._)`${n.evaluated}.props`,(0,Y._)`undefined`)),e.if((0,Y._)`${n.evaluated}.dynamicItems`,()=>e.assign((0,Y._)`${n.evaluated}.items`,(0,Y._)`undefined`))}function BC(n,e){let t=typeof n=="object"&&n[e.schemaId];return t&&(e.code.source||e.code.process)?(0,Y._)`/*# sourceURL=${t} */`:Y.nil}function SU(n,e){if(zC(n)&&(GC(n),KC(n))){_U(n,e);return}(0,WC.boolOrEmptySchema)(n,e)}function KC({schema:n,self:e}){if(typeof n=="boolean")return!n;for(let t in n)if(e.RULES.all[t])return!0;return!1}function zC(n){return typeof n.schema!="boolean"}function _U(n,e){let{schema:t,gen:r,opts:s}=n;s.$comment&&t.$comment&&JC(n),kU(n),NU(n);let i=r.const("_errs",ne.default.errors);YC(n,i),r.var(e,(0,Y._)`${i} === ${ne.default.errors}`)}function GC(n){(0,Zr.checkUnknownRules)(n),wU(n)}function YC(n,e){if(n.opts.jtd)return UC(n,[],!1,e);let t=(0,FC.getSchemaTypes)(n.schema),r=(0,FC.coerceAndCheckDataType)(n,t);UC(n,t,!r,e)}function wU(n){let{schema:e,errSchemaPath:t,opts:r,self:s}=n;e.$ref&&r.ignoreKeywordsWithRef&&(0,Zr.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function EU(n){let{schema:e,opts:t}=n;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Zr.checkStrictMode)(n,"default is ignored in the schema root")}function kU(n){let e=n.schema[n.opts.schemaId];e&&(n.baseId=(0,mU.resolveUrl)(n.opts.uriResolver,n.baseId,e))}function NU(n){if(n.schema.$async&&!n.schemaEnv.$async)throw new Error("async schema in sync schema")}function JC({gen:n,schemaEnv:e,schema:t,errSchemaPath:r,opts:s}){let i=t.$comment;if(s.$comment===!0)n.code((0,Y._)`${ne.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,Y.str)`${r}/$comment`,a=n.scopeValue("root",{ref:e.root});n.code((0,Y._)`${ne.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function PU(n){let{gen:e,schemaEnv:t,validateName:r,ValidationError:s,opts:i}=n;t.$async?e.if((0,Y._)`${ne.default.errors} === 0`,()=>e.return(ne.default.data),()=>e.throw((0,Y._)`new ${s}(${ne.default.vErrors})`)):(e.assign((0,Y._)`${r}.errors`,ne.default.vErrors),i.unevaluated&&RU(n),e.return((0,Y._)`${ne.default.errors} === 0`))}function RU({gen:n,evaluated:e,props:t,items:r}){t instanceof Y.Name&&n.assign((0,Y._)`${e}.props`,t),r instanceof Y.Name&&n.assign((0,Y._)`${e}.items`,r)}function UC(n,e,t,r){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=n,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Zr.schemaHasRulesButRef)(i,u))){s.block(()=>QC(n,"$ref",u.all.$ref.definition));return}c.jtd||CU(n,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,Ev.shouldUseGroup)(i,f)&&(f.type?(s.if((0,Zf.checkDataType)(f.type,o,c.strictNumbers)),VC(n,f),e.length===1&&e[0]===f.type&&t&&(s.else(),(0,Zf.reportTypeError)(n)),s.endIf()):VC(n,f),a||s.if((0,Y._)`${ne.default.errors} === ${r||0}`))}}function VC(n,e){let{gen:t,schema:r,opts:{useDefaults:s}}=n;s&&(0,pU.assignDefaults)(n,e.type),t.block(()=>{for(let i of e.rules)(0,Ev.shouldUseRule)(r,i)&&QC(n,i.keyword,i.definition,e.type)})}function CU(n,e){n.schemaEnv.meta||!n.opts.strictTypes||(DU(n,e),n.opts.allowUnionTypes||OU(n,e),AU(n,n.dataTypes))}function DU(n,e){if(e.length){if(!n.dataTypes.length){n.dataTypes=e;return}e.forEach(t=>{XC(n.dataTypes,t)||kv(n,`type "${t}" not allowed by context "${n.dataTypes.join(",")}"`)}),MU(n,e)}}function OU(n,e){e.length>1&&!(e.length===2&&e.includes("null"))&&kv(n,"use allowUnionTypes to allow union type keyword")}function AU(n,e){let t=n.self.RULES.all;for(let r in t){let s=t[r];if(typeof s=="object"&&(0,Ev.shouldUseRule)(n.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>IU(e,o))&&kv(n,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function IU(n,e){return n.includes(e)||e==="number"&&n.includes("integer")}function XC(n,e){return n.includes(e)||e==="integer"&&n.includes("number")}function MU(n,e){let t=[];for(let r of n.dataTypes)XC(e,r)?t.push(r):e.includes("integer")&&r==="number"&&t.push("integer");n.dataTypes=t}function kv(n,e){let t=n.schemaEnv.baseId+n.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,Zr.checkStrictMode)(n,e,n.opts.strictTypes)}var eh=class{constructor(e,t,r){if((0,Hc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Zr.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",ZC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Hc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",ne.default.errors))}result(e,t,r){this.failResult((0,Y.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,Y.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,Y._)`${t} !== undefined && (${(0,Y.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Wc.reportExtraError:Wc.reportError)(this,this.def.error,t)}$dataError(){(0,Wc.reportError)(this,this.def.$dataError||Wc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Wc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=Y.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=Y.nil,t=Y.nil){if(!this.$data)return;let{gen:r,schemaCode:s,schemaType:i,def:o}=this;r.if((0,Y.or)((0,Y._)`${s} === undefined`,t)),e!==Y.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Y.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:s,it:i}=this;return(0,Y.or)(o(),a());function o(){if(r.length){if(!(t instanceof Y.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,Y._)`${(0,Zf.checkDataTypes)(c,t,i.opts.strictNumbers,Zf.DataType.Wrong)}`}return Y.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,Y._)`!${c}(${t})`}return Y.nil}}subschema(e,t){let r=(0,wv.getSubschema)(this.it,e);(0,wv.extendSubschemaData)(r,this.it,e),(0,wv.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return SU(s,t),s}mergeEvaluated(e,t){let{it:r,gen:s}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=Zr.mergeEvaluated.props(s,e.props,r.props,t)),r.items!==!0&&e.items!==void 0&&(r.items=Zr.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:s}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,Y.Name)),!0}};Us.KeywordCxt=eh;function QC(n,e,t,r){let s=new eh(n,t,e);"code"in t?t.code(s,r):s.$data&&t.validate?(0,Hc.funcKeywordCode)(s,t):"macro"in t?(0,Hc.macroKeywordCode)(s,t):(t.compile||t.validate)&&(0,Hc.funcKeywordCode)(s,t)}var xU=/^\/(?:[^~]|~0|~1)*$/,$U=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ZC(n,{dataLevel:e,dataNames:t,dataPathArr:r}){let s,i;if(n==="")return ne.default.rootData;if(n[0]==="/"){if(!xU.test(n))throw new Error(`Invalid JSON-pointer: ${n}`);s=n,i=ne.default.rootData}else{let l=$U.exec(n);if(!l)throw new Error(`Invalid JSON-pointer: ${n}`);let u=+l[1];if(s=l[2],s==="#"){if(u>=e)throw new Error(c("property/index",u));return r[e-u]}if(u>e)throw new Error(c("data",u));if(i=t[e-u],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,Y._)`${i}${(0,Y.getProperty)((0,Zr.unescapeJsonPointer)(l))}`,o=(0,Y._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Us.getData=ZC});var th=w(Pv=>{"use strict";Object.defineProperty(Pv,"__esModule",{value:!0});var Nv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Pv.default=Nv});var zc=w(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});var Rv=Vc(),Cv=class extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Rv.resolveUrl)(e,t,r),this.missingSchema=(0,Rv.normalizeId)((0,Rv.getFullPath)(e,this.missingRef))}};Dv.default=Cv});var Gc=w(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.resolveSchema=Hn.getCompilingSchema=Hn.resolveRef=Hn.compileSchema=Hn.SchemaEnv=void 0;var fr=ce(),LU=th(),Ni=Vn(),hr=Vc(),eD=me(),qU=Kc(),ea=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,hr.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};Hn.SchemaEnv=ea;function Av(n){let e=tD.call(this,n);if(e)return e;let t=(0,hr.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:r,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new fr.CodeGen(this.scope,{es5:r,lines:s,ownProperties:i}),a;n.$async&&(a=o.scopeValue("Error",{ref:LU.default,code:(0,fr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");n.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Ni.default.data,parentData:Ni.default.parentData,parentDataProperty:Ni.default.parentDataProperty,dataNames:[Ni.default.data],dataPathArr:[fr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,fr.stringify)(n.schema)}:{ref:n.schema}),validateName:c,ValidationError:a,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:fr.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,fr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(n),(0,qU.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(Ni.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,n));let p=new Function(`${Ni.default.self}`,`${Ni.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=n.schema,p.schemaEnv=n,n.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:b,items:g}=l;p.evaluated={props:b instanceof fr.Name?void 0:b,items:g instanceof fr.Name?void 0:g,dynamicProps:b instanceof fr.Name,dynamicItems:g instanceof fr.Name},p.source&&(p.source.evaluated=(0,fr.stringify)(p.evaluated))}return n.validate=p,n}catch(d){throw delete n.validate,delete n.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(n)}}Hn.compileSchema=Av;function jU(n,e,t){var r;t=(0,hr.resolveUrl)(this.opts.uriResolver,e,t);let s=n.refs[t];if(s)return s;let i=UU.call(this,n,t);if(i===void 0){let o=(r=n.localRefs)===null||r===void 0?void 0:r[t],{schemaId:a}=this.opts;o&&(i=new ea({schema:o,schemaId:a,root:n,baseId:e}))}if(i!==void 0)return n.refs[t]=FU.call(this,i)}Hn.resolveRef=jU;function FU(n){return(0,hr.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:Av.call(this,n)}function tD(n){for(let e of this._compilations)if(BU(e,n))return e}Hn.getCompilingSchema=tD;function BU(n,e){return n.schema===e.schema&&n.root===e.root&&n.baseId===e.baseId}function UU(n,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||nh.call(this,n,e)}function nh(n,e){let t=this.opts.uriResolver.parse(e),r=(0,hr._getFullPath)(this.opts.uriResolver,t),s=(0,hr.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&r===s)return Ov.call(this,t,n);let i=(0,hr.normalizeId)(r),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=nh.call(this,n,o);return typeof a?.schema!="object"?void 0:Ov.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||Av.call(this,o),i===(0,hr.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,hr.resolveUrl)(this.opts.uriResolver,s,l)),new ea({schema:a,schemaId:c,root:n,baseId:s})}return Ov.call(this,t,o)}}Hn.resolveSchema=nh;var VU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ov(n,{baseId:e,schema:t,root:r}){var s;if(((s=n.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of n.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let c=t[(0,eD.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!VU.has(a)&&l&&(e=(0,hr.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,eD.schemaHasRulesButRef)(t,this.RULES)){let a=(0,hr.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=nh.call(this,r,a)}let{schemaId:o}=this.opts;if(i=i||new ea({schema:t,schemaId:o,root:r,baseId:e}),i.schema!==i.root.schema)return i}});var nD=w((fee,WU)=>{WU.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 sD=w((hee,rD)=>{"use strict";var HU={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};rD.exports={HEX:HU}});var fD=w((pee,dD)=>{"use strict";var{HEX:KU}=sD(),zU=/^(?:(?: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 cD(n){if(uD(n,".")<3)return{host:n,isIPV4:!1};let e=n.match(zU)||[],[t]=e;return t?{host:YU(t,"."),isIPV4:!0}:{host:n,isIPV4:!1}}function Iv(n,e=!1){let t="",r=!0;for(let s of n){if(KU[s]===void 0)return;s!=="0"&&r===!0&&(r=!1),r||(t+=s)}return e&&t.length===0&&(t="0"),t}function GU(n){let e=0,t={error:!1,address:"",zone:""},r=[],s=[],i=!1,o=!1,a=!1;function c(){if(s.length){if(i===!1){let l=Iv(s);if(l!==void 0)r.push(l);else return t.error=!0,!1}s.length=0}return!0}for(let l=0;l<n.length;l++){let u=n[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,r.push(":"),e>7){t.error=!0;break}l-1>=0&&n[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;i=!0}else{s.push(u);continue}}return s.length&&(i?t.zone=s.join(""):a?r.push(s.join("")):r.push(Iv(s))),t.address=r.join(""),t}function lD(n){if(uD(n,":")<2)return{host:n,isIPV6:!1};let e=GU(n);if(e.error)return{host:n,isIPV6:!1};{let t=e.address,r=e.address;return e.zone&&(t+="%"+e.zone,r+="%25"+e.zone),{host:t,escapedHost:r,isIPV6:!0}}}function YU(n,e){let t="",r=!0,s=n.length;for(let i=0;i<s;i++){let o=n[i];o==="0"&&r?(i+1<=s&&n[i+1]===e||i+1===s)&&(t+=o,r=!1):(o===e?r=!0:r=!1,t+=o)}return t}function uD(n,e){let t=0;for(let r=0;r<n.length;r++)n[r]===e&&t++;return t}var iD=/^\.\.?\//u,oD=/^\/\.(?:\/|$)/u,aD=/^\/\.\.(?:\/|$)/u,JU=/^\/?(?:.|\n)*?(?=\/|$)/u;function XU(n){let e=[];for(;n.length;)if(n.match(iD))n=n.replace(iD,"");else if(n.match(oD))n=n.replace(oD,"/");else if(n.match(aD))n=n.replace(aD,"/"),e.pop();else if(n==="."||n==="..")n="";else{let t=n.match(JU);if(t){let r=t[0];n=n.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function QU(n,e){let t=e!==!0?escape:unescape;return n.scheme!==void 0&&(n.scheme=t(n.scheme)),n.userinfo!==void 0&&(n.userinfo=t(n.userinfo)),n.host!==void 0&&(n.host=t(n.host)),n.path!==void 0&&(n.path=t(n.path)),n.query!==void 0&&(n.query=t(n.query)),n.fragment!==void 0&&(n.fragment=t(n.fragment)),n}function ZU(n){let e=[];if(n.userinfo!==void 0&&(e.push(n.userinfo),e.push("@")),n.host!==void 0){let t=unescape(n.host),r=cD(t);if(r.isIPV4)t=r.host;else{let s=lD(r.host);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=n.host}e.push(t)}return(typeof n.port=="number"||typeof n.port=="string")&&(e.push(":"),e.push(String(n.port))),e.length?e.join(""):void 0}dD.exports={recomposeAuthority:ZU,normalizeComponentEncoding:QU,removeDotSegments:XU,normalizeIPv4:cD,normalizeIPv6:lD,stringArrayToHexStripped:Iv}});var vD=w((mee,yD)=>{"use strict";var eV=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,tV=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function hD(n){return typeof n.secure=="boolean"?n.secure:String(n.scheme).toLowerCase()==="wss"}function pD(n){return n.host||(n.error=n.error||"HTTP URIs must have a host."),n}function mD(n){let e=String(n.scheme).toLowerCase()==="https";return(n.port===(e?443:80)||n.port==="")&&(n.port=void 0),n.path||(n.path="/"),n}function nV(n){return n.secure=hD(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n}function rV(n){if((n.port===(hD(n)?443:80)||n.port==="")&&(n.port=void 0),typeof n.secure=="boolean"&&(n.scheme=n.secure?"wss":"ws",n.secure=void 0),n.resourceName){let[e,t]=n.resourceName.split("?");n.path=e&&e!=="/"?e:void 0,n.query=t,n.resourceName=void 0}return n.fragment=void 0,n}function sV(n,e){if(!n.path)return n.error="URN can not be parsed",n;let t=n.path.match(tV);if(t){let r=e.scheme||n.scheme||"urn";n.nid=t[1].toLowerCase(),n.nss=t[2];let s=`${r}:${e.nid||n.nid}`,i=Mv[s];n.path=void 0,i&&(n=i.parse(n,e))}else n.error=n.error||"URN can not be parsed.";return n}function iV(n,e){let t=e.scheme||n.scheme||"urn",r=n.nid.toLowerCase(),s=`${t}:${e.nid||r}`,i=Mv[s];i&&(n=i.serialize(n,e));let o=n,a=n.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function oV(n,e){let t=n;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!eV.test(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function aV(n){let e=n;return e.nss=(n.uuid||"").toLowerCase(),e}var gD={scheme:"http",domainHost:!0,parse:pD,serialize:mD},cV={scheme:"https",domainHost:gD.domainHost,parse:pD,serialize:mD},rh={scheme:"ws",domainHost:!0,parse:nV,serialize:rV},lV={scheme:"wss",domainHost:rh.domainHost,parse:rh.parse,serialize:rh.serialize},uV={scheme:"urn",parse:sV,serialize:iV,skipNormalize:!0},dV={scheme:"urn:uuid",parse:oV,serialize:aV,skipNormalize:!0},Mv={http:gD,https:cV,ws:rh,wss:lV,urn:uV,"urn:uuid":dV};yD.exports=Mv});var TD=w((gee,ih)=>{"use strict";var{normalizeIPv6:fV,normalizeIPv4:hV,removeDotSegments:Yc,recomposeAuthority:pV,normalizeComponentEncoding:sh}=fD(),xv=vD();function mV(n,e){return typeof n=="string"?n=Ir(es(n,e),e):typeof n=="object"&&(n=es(Ir(n,e),e)),n}function gV(n,e,t){let r=Object.assign({scheme:"null"},t),s=bD(es(n,r),es(e,r),r,!0);return Ir(s,{...r,skipEscape:!0})}function bD(n,e,t,r){let s={};return r||(n=es(Ir(n,t),t),e=es(Ir(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=Yc(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=Yc(e.path||""),s.query=e.query):(e.path?(e.path.charAt(0)==="/"?s.path=Yc(e.path):((n.userinfo!==void 0||n.host!==void 0||n.port!==void 0)&&!n.path?s.path="/"+e.path:n.path?s.path=n.path.slice(0,n.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=Yc(s.path)),s.query=e.query):(s.path=n.path,e.query!==void 0?s.query=e.query:s.query=n.query),s.userinfo=n.userinfo,s.host=n.host,s.port=n.port),s.scheme=n.scheme),s.fragment=e.fragment,s}function yV(n,e,t){return typeof n=="string"?(n=unescape(n),n=Ir(sh(es(n,t),!0),{...t,skipEscape:!0})):typeof n=="object"&&(n=Ir(sh(n,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Ir(sh(es(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=Ir(sh(e,!0),{...t,skipEscape:!0})),n.toLowerCase()===e.toLowerCase()}function Ir(n,e){let t={host:n.host,scheme:n.scheme,userinfo:n.userinfo,port:n.port,path:n.path,query:n.query,nid:n.nid,nss:n.nss,uuid:n.uuid,fragment:n.fragment,reference:n.reference,resourceName:n.resourceName,secure:n.secure,error:""},r=Object.assign({},e),s=[],i=xv[(r.scheme||t.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(t,r),t.path!==void 0&&(r.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),r.reference!=="suffix"&&t.scheme&&s.push(t.scheme,":");let o=pV(t);if(o!==void 0&&(r.reference!=="suffix"&&s.push("//"),s.push(o),t.path&&t.path.charAt(0)!=="/"&&s.push("/")),t.path!==void 0){let a=t.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=Yc(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),s.push(a)}return t.query!==void 0&&s.push("?",t.query),t.fragment!==void 0&&s.push("#",t.fragment),s.join("")}var vV=Array.from({length:127},(n,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function bV(n){let e=0;for(let t=0,r=n.length;t<r;++t)if(e=n.charCodeAt(t),e>126||vV[e])return!0;return!1}var TV=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function es(n,e){let t=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=n.indexOf("%")!==-1,i=!1;t.reference==="suffix"&&(n=(t.scheme?t.scheme+":":"")+"//"+n);let o=n.match(TV);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=hV(r.host);if(c.isIPV4===!1){let l=fV(c.host);r.host=l.host.toLowerCase(),i=l.isIPV6}else r.host=c.host,i=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");let a=xv[(t.scheme||r.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(t.domainHost||a&&a.domainHost)&&i===!1&&bV(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(c){r.error=r.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(s&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),s&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var $v={SCHEMES:xv,normalize:mV,resolve:gV,resolveComponents:bD,equal:yV,serialize:Ir,parse:es};ih.exports=$v;ih.exports.default=$v;ih.exports.fastUri=$v});var _D=w(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});var SD=TD();SD.code='require("ajv/dist/runtime/uri").default';Lv.default=SD});var DD=w(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.CodeGen=Bt.Name=Bt.nil=Bt.stringify=Bt.str=Bt._=Bt.KeywordCxt=void 0;var SV=Kc();Object.defineProperty(Bt,"KeywordCxt",{enumerable:!0,get:function(){return SV.KeywordCxt}});var ta=ce();Object.defineProperty(Bt,"_",{enumerable:!0,get:function(){return ta._}});Object.defineProperty(Bt,"str",{enumerable:!0,get:function(){return ta.str}});Object.defineProperty(Bt,"stringify",{enumerable:!0,get:function(){return ta.stringify}});Object.defineProperty(Bt,"nil",{enumerable:!0,get:function(){return ta.nil}});Object.defineProperty(Bt,"Name",{enumerable:!0,get:function(){return ta.Name}});Object.defineProperty(Bt,"CodeGen",{enumerable:!0,get:function(){return ta.CodeGen}});var _V=th(),PD=zc(),wV=hv(),Jc=Gc(),EV=ce(),Xc=Vc(),oh=Uc(),jv=me(),wD=nD(),kV=_D(),RD=(n,e)=>new RegExp(n,e);RD.code="new RegExp";var NV=["removeAdditional","useDefaults","coerceTypes"],PV=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),RV={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."},CV={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ED=200;function DV(n){var e,t,r,s,i,o,a,c,l,u,d,f,p,b,g,S,E,T,v,R,A,$,W,j,ie;let qe=n.strict,wt=(e=n.code)===null||e===void 0?void 0:e.optimize,he=wt===!0||wt===void 0?1:wt||0,Cn=(r=(t=n.code)===null||t===void 0?void 0:t.regExp)!==null&&r!==void 0?r:RD,ts=(s=n.uriResolver)!==null&&s!==void 0?s:kV.default;return{strictSchema:(o=(i=n.strictSchema)!==null&&i!==void 0?i:qe)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=n.strictNumbers)!==null&&a!==void 0?a:qe)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=n.strictTypes)!==null&&l!==void 0?l:qe)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=n.strictTuples)!==null&&d!==void 0?d:qe)!==null&&f!==void 0?f:"log",strictRequired:(b=(p=n.strictRequired)!==null&&p!==void 0?p:qe)!==null&&b!==void 0?b:!1,code:n.code?{...n.code,optimize:he,regExp:Cn}:{optimize:he,regExp:Cn},loopRequired:(g=n.loopRequired)!==null&&g!==void 0?g:ED,loopEnum:(S=n.loopEnum)!==null&&S!==void 0?S:ED,meta:(E=n.meta)!==null&&E!==void 0?E:!0,messages:(T=n.messages)!==null&&T!==void 0?T:!0,inlineRefs:(v=n.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(R=n.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(A=n.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:($=n.validateSchema)!==null&&$!==void 0?$:!0,validateFormats:(W=n.validateFormats)!==null&&W!==void 0?W:!0,unicodeRegExp:(j=n.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(ie=n.int32range)!==null&&ie!==void 0?ie:!0,uriResolver:ts}}var Qc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...DV(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new EV.ValueScope({scope:{},prefixes:PV,es5:t,lines:r}),this.logger=$V(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,wV.getRules)(),kD.call(this,RV,e,"NOT SUPPORTED"),kD.call(this,CV,e,"DEPRECATED","warn"),this._metaOpts=MV.call(this),e.formats&&AV.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&IV.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),OV.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,s=wD;r==="id"&&(s={...wD},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(u,d){await i.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function i(u){u&&!this.getSchema(u)&&await s.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof PD.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await i.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,t)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return t=(0,Xc.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(r,e);if(!s&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let t;for(;typeof(t=ND.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:r}=this.opts,s=new Jc.SchemaEnv({schema:{},schemaId:r});if(t=Jc.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=ND.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,Xc.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string")r=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(qV.call(this,r,t),!t)return(0,jv.eachItem)(r,i=>qv.call(this,i)),this;FV.call(this,t);let s={...t,type:(0,oh.getJSONTypes)(t.type),schemaType:(0,oh.getJSONTypes)(t.schemaType)};return(0,jv.eachItem)(r,s.type.length===0?i=>qv.call(this,i,s):i=>s.type.forEach(o=>qv.call(this,i,s,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let s=r.rules.findIndex(i=>i.keyword===e);s>=0&&r.rules.splice(s,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${r}${s.instancePath} ${s.message}`).reduce((s,i)=>s+t+i)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of t){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in r){let c=r[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=CD(u))}}return e}_removeAllSchemas(e,t){for(let r in e){let s=e[r];(!t||t.test(r))&&(typeof s=="string"?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;r=(0,Xc.normalizeId)(o||r);let l=Xc.getSchemaRefs.call(this,e,r);return c=new Jc.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:l}),this._cache.set(c.schema,c),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Jc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Jc.compileSchema.call(this,e)}finally{this.opts=t}}};Qc.ValidationError=_V.default;Qc.MissingRefError=PD.default;Bt.default=Qc;function kD(n,e,t,r="error"){for(let s in n){let i=s;i in e&&this.logger[r](`${t}: option ${s}. ${n[i]}`)}}function ND(n){return n=(0,Xc.normalizeId)(n),this.schemas[n]||this.refs[n]}function OV(){let n=this.opts.schemas;if(n)if(Array.isArray(n))this.addSchema(n);else for(let e in n)this.addSchema(n[e],e)}function AV(){for(let n in this.opts.formats){let e=this.opts.formats[n];e&&this.addFormat(n,e)}}function IV(n){if(Array.isArray(n)){this.addVocabulary(n);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in n){let t=n[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function MV(){let n={...this.opts};for(let e of NV)delete n[e];return n}var xV={log(){},warn(){},error(){}};function $V(n){if(n===!1)return xV;if(n===void 0)return console;if(n.log&&n.warn&&n.error)return n;throw new Error("logger must implement log, warn and error methods")}var LV=/^[a-z_$][a-z0-9_$:-]*$/i;function qV(n,e){let{RULES:t}=this;if((0,jv.eachItem)(n,r=>{if(t.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!LV.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 qv(n,e,t){var r;let s=e?.post;if(t&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===t);if(o||(o={type:t,rules:[]},i.rules.push(o)),i.keywords[n]=!0,!e)return;let a={keyword:n,definition:{...e,type:(0,oh.getJSONTypes)(e.type),schemaType:(0,oh.getJSONTypes)(e.schemaType)}};e.before?jV.call(this,o,a,e.before):o.rules.push(a),i.all[n]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function jV(n,e,t){let r=n.rules.findIndex(s=>s.keyword===t);r>=0?n.rules.splice(r,0,e):(n.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function FV(n){let{metaSchema:e}=n;e!==void 0&&(n.$data&&this.opts.$data&&(e=CD(e)),n.validateSchema=this.compile(e,!0))}var BV={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function CD(n){return{anyOf:[n,BV]}}});var OD=w(Fv=>{"use strict";Object.defineProperty(Fv,"__esModule",{value:!0});var UV={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Fv.default=UV});var lh=w(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.callRef=Pi.getValidate=void 0;var VV=zc(),AD=Wn(),Tn=ce(),na=Vn(),ID=Gc(),ah=me(),WV={keyword:"$ref",schemaType:"string",code(n){let{gen:e,schema:t,it:r}=n,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=r,{root:l}=i;if((t==="#"||t==="#/")&&s===l.baseId)return d();let u=ID.resolveRef.call(c,l,s,t);if(u===void 0)throw new VV.default(r.opts.uriResolver,s,t);if(u instanceof ID.SchemaEnv)return f(u);return p(u);function d(){if(i===l)return ch(n,o,i,i.$async);let b=e.scopeValue("root",{ref:l});return ch(n,(0,Tn._)`${b}.validate`,l,l.$async)}function f(b){let g=MD(n,b);ch(n,g,b,b.$async)}function p(b){let g=e.scopeValue("schema",a.code.source===!0?{ref:b,code:(0,Tn.stringify)(b)}:{ref:b}),S=e.name("valid"),E=n.subschema({schema:b,dataTypes:[],schemaPath:Tn.nil,topSchemaRef:g,errSchemaPath:t},S);n.mergeEvaluated(E),n.ok(S)}}};function MD(n,e){let{gen:t}=n;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,Tn._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Pi.getValidate=MD;function ch(n,e,t,r){let{gen:s,it:i}=n,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?na.default.this:Tn.nil;r?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let b=s.let("valid");s.try(()=>{s.code((0,Tn._)`await ${(0,AD.callValidateCode)(n,e,l)}`),p(e),o||s.assign(b,!0)},g=>{s.if((0,Tn._)`!(${g} instanceof ${i.ValidationError})`,()=>s.throw(g)),f(g),o||s.assign(b,!1)}),n.ok(b)}function d(){n.result((0,AD.callValidateCode)(n,e,l),()=>p(e),()=>f(e))}function f(b){let g=(0,Tn._)`${b}.errors`;s.assign(na.default.vErrors,(0,Tn._)`${na.default.vErrors} === null ? ${g} : ${na.default.vErrors}.concat(${g})`),s.assign(na.default.errors,(0,Tn._)`${na.default.vErrors}.length`)}function p(b){var g;if(!i.opts.unevaluated)return;let S=(g=t?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(S&&!S.dynamicProps)S.props!==void 0&&(i.props=ah.mergeEvaluated.props(s,S.props,i.props));else{let E=s.var("props",(0,Tn._)`${b}.evaluated.props`);i.props=ah.mergeEvaluated.props(s,E,i.props,Tn.Name)}if(i.items!==!0)if(S&&!S.dynamicItems)S.items!==void 0&&(i.items=ah.mergeEvaluated.items(s,S.items,i.items));else{let E=s.var("items",(0,Tn._)`${b}.evaluated.items`);i.items=ah.mergeEvaluated.items(s,E,i.items,Tn.Name)}}}Pi.callRef=ch;Pi.default=WV});var xD=w(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var HV=OD(),KV=lh(),zV=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",HV.default,KV.default];Bv.default=zV});var $D=w(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var uh=ce(),Vs=uh.operators,dh={maximum:{okStr:"<=",ok:Vs.LTE,fail:Vs.GT},minimum:{okStr:">=",ok:Vs.GTE,fail:Vs.LT},exclusiveMaximum:{okStr:"<",ok:Vs.LT,fail:Vs.GTE},exclusiveMinimum:{okStr:">",ok:Vs.GT,fail:Vs.LTE}},GV={message:({keyword:n,schemaCode:e})=>(0,uh.str)`must be ${dh[n].okStr} ${e}`,params:({keyword:n,schemaCode:e})=>(0,uh._)`{comparison: ${dh[n].okStr}, limit: ${e}}`},YV={keyword:Object.keys(dh),type:"number",schemaType:"number",$data:!0,error:GV,code(n){let{keyword:e,data:t,schemaCode:r}=n;n.fail$data((0,uh._)`${t} ${dh[e].fail} ${r} || isNaN(${t})`)}};Uv.default=YV});var LD=w(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var Zc=ce(),JV={message:({schemaCode:n})=>(0,Zc.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,Zc._)`{multipleOf: ${n}}`},XV={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:JV,code(n){let{gen:e,data:t,schemaCode:r,it:s}=n,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,Zc._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Zc._)`${o} !== parseInt(${o})`;n.fail$data((0,Zc._)`(${r} === 0 || (${o} = ${t}/${r}, ${a}))`)}};Vv.default=XV});var jD=w(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});function qD(n){let e=n.length,t=0,r=0,s;for(;r<e;)t++,s=n.charCodeAt(r++),s>=55296&&s<=56319&&r<e&&(s=n.charCodeAt(r),(s&64512)===56320&&r++);return t}Wv.default=qD;qD.code='require("ajv/dist/runtime/ucs2length").default'});var FD=w(Hv=>{"use strict";Object.defineProperty(Hv,"__esModule",{value:!0});var Ri=ce(),QV=me(),ZV=jD(),e2={message({keyword:n,schemaCode:e}){let t=n==="maxLength"?"more":"fewer";return(0,Ri.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:n})=>(0,Ri._)`{limit: ${n}}`},t2={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:e2,code(n){let{keyword:e,data:t,schemaCode:r,it:s}=n,i=e==="maxLength"?Ri.operators.GT:Ri.operators.LT,o=s.opts.unicode===!1?(0,Ri._)`${t}.length`:(0,Ri._)`${(0,QV.useFunc)(n.gen,ZV.default)}(${t})`;n.fail$data((0,Ri._)`${o} ${i} ${r}`)}};Hv.default=t2});var BD=w(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var n2=Wn(),fh=ce(),r2={message:({schemaCode:n})=>(0,fh.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,fh._)`{pattern: ${n}}`},s2={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:r2,code(n){let{data:e,$data:t,schema:r,schemaCode:s,it:i}=n,o=i.opts.unicodeRegExp?"u":"",a=t?(0,fh._)`(new RegExp(${s}, ${o}))`:(0,n2.usePattern)(n,r);n.fail$data((0,fh._)`!${a}.test(${e})`)}};Kv.default=s2});var UD=w(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});var el=ce(),i2={message({keyword:n,schemaCode:e}){let t=n==="maxProperties"?"more":"fewer";return(0,el.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:n})=>(0,el._)`{limit: ${n}}`},o2={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:i2,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxProperties"?el.operators.GT:el.operators.LT;n.fail$data((0,el._)`Object.keys(${t}).length ${s} ${r}`)}};zv.default=o2});var VD=w(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var tl=Wn(),nl=ce(),a2=me(),c2={message:({params:{missingProperty:n}})=>(0,nl.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,nl._)`{missingProperty: ${n}}`},l2={keyword:"required",type:"object",schemaType:"array",$data:!0,error:c2,code(n){let{gen:e,schema:t,schemaCode:r,data:s,$data:i,it:o}=n,{opts:a}=o;if(!i&&t.length===0)return;let c=t.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let p=n.parentSchema.properties,{definedProperties:b}=n.it;for(let g of t)if(p?.[g]===void 0&&!b.has(g)){let S=o.schemaEnv.baseId+o.errSchemaPath,E=`required property "${g}" is not defined at "${S}" (strictRequired)`;(0,a2.checkStrictMode)(o,E,o.opts.strictRequired)}}function l(){if(c||i)n.block$data(nl.nil,d);else for(let p of t)(0,tl.checkReportMissingProp)(n,p)}function u(){let p=e.let("missing");if(c||i){let b=e.let("valid",!0);n.block$data(b,()=>f(p,b)),n.ok(b)}else e.if((0,tl.checkMissingProp)(n,t,p)),(0,tl.reportMissingProp)(n,p),e.else()}function d(){e.forOf("prop",r,p=>{n.setParams({missingProperty:p}),e.if((0,tl.noPropertyInData)(e,s,p,a.ownProperties),()=>n.error())})}function f(p,b){n.setParams({missingProperty:p}),e.forOf(p,r,()=>{e.assign(b,(0,tl.propertyInData)(e,s,p,a.ownProperties)),e.if((0,nl.not)(b),()=>{n.error(),e.break()})},nl.nil)}}};Gv.default=l2});var WD=w(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var rl=ce(),u2={message({keyword:n,schemaCode:e}){let t=n==="maxItems"?"more":"fewer";return(0,rl.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:n})=>(0,rl._)`{limit: ${n}}`},d2={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:u2,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxItems"?rl.operators.GT:rl.operators.LT;n.fail$data((0,rl._)`${t}.length ${s} ${r}`)}};Yv.default=d2});var hh=w(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});var HD=Sv();HD.code='require("ajv/dist/runtime/equal").default';Jv.default=HD});var KD=w(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var Xv=Uc(),Ut=ce(),f2=me(),h2=hh(),p2={message:({params:{i:n,j:e}})=>(0,Ut.str)`must NOT have duplicate items (items ## ${e} and ${n} are identical)`,params:({params:{i:n,j:e}})=>(0,Ut._)`{i: ${n}, j: ${e}}`},m2={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:p2,code(n){let{gen:e,data:t,$data:r,schema:s,parentSchema:i,schemaCode:o,it:a}=n;if(!r&&!s)return;let c=e.let("valid"),l=i.items?(0,Xv.getSchemaTypes)(i.items):[];n.block$data(c,u,(0,Ut._)`${o} === false`),n.ok(c);function u(){let b=e.let("i",(0,Ut._)`${t}.length`),g=e.let("j");n.setParams({i:b,j:g}),e.assign(c,!0),e.if((0,Ut._)`${b} > 1`,()=>(d()?f:p)(b,g))}function d(){return l.length>0&&!l.some(b=>b==="object"||b==="array")}function f(b,g){let S=e.name("item"),E=(0,Xv.checkDataTypes)(l,S,a.opts.strictNumbers,Xv.DataType.Wrong),T=e.const("indices",(0,Ut._)`{}`);e.for((0,Ut._)`;${b}--;`,()=>{e.let(S,(0,Ut._)`${t}[${b}]`),e.if(E,(0,Ut._)`continue`),l.length>1&&e.if((0,Ut._)`typeof ${S} == "string"`,(0,Ut._)`${S} += "_"`),e.if((0,Ut._)`typeof ${T}[${S}] == "number"`,()=>{e.assign(g,(0,Ut._)`${T}[${S}]`),n.error(),e.assign(c,!1).break()}).code((0,Ut._)`${T}[${S}] = ${b}`)})}function p(b,g){let S=(0,f2.useFunc)(e,h2.default),E=e.name("outer");e.label(E).for((0,Ut._)`;${b}--;`,()=>e.for((0,Ut._)`${g} = ${b}; ${g}--;`,()=>e.if((0,Ut._)`${S}(${t}[${b}], ${t}[${g}])`,()=>{n.error(),e.assign(c,!1).break(E)})))}}};Qv.default=m2});var zD=w(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var Zv=ce(),g2=me(),y2=hh(),v2={message:"must be equal to constant",params:({schemaCode:n})=>(0,Zv._)`{allowedValue: ${n}}`},b2={keyword:"const",$data:!0,error:v2,code(n){let{gen:e,data:t,$data:r,schemaCode:s,schema:i}=n;r||i&&typeof i=="object"?n.fail$data((0,Zv._)`!${(0,g2.useFunc)(e,y2.default)}(${t}, ${s})`):n.fail((0,Zv._)`${i} !== ${t}`)}};eb.default=b2});var GD=w(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var sl=ce(),T2=me(),S2=hh(),_2={message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,sl._)`{allowedValues: ${n}}`},w2={keyword:"enum",schemaType:"array",$data:!0,error:_2,code(n){let{gen:e,data:t,$data:r,schema:s,schemaCode:i,it:o}=n;if(!r&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,T2.useFunc)(e,S2.default)),u;if(a||r)u=e.let("valid"),n.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let p=e.const("vSchema",i);u=(0,sl.or)(...s.map((b,g)=>f(p,g)))}n.pass(u);function d(){e.assign(u,!1),e.forOf("v",i,p=>e.if((0,sl._)`${l()}(${t}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,b){let g=s[b];return typeof g=="object"&&g!==null?(0,sl._)`${l()}(${t}, ${p}[${b}])`:(0,sl._)`${t} === ${g}`}}};tb.default=w2});var YD=w(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var E2=$D(),k2=LD(),N2=FD(),P2=BD(),R2=UD(),C2=VD(),D2=WD(),O2=KD(),A2=zD(),I2=GD(),M2=[E2.default,k2.default,N2.default,P2.default,R2.default,C2.default,D2.default,O2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},A2.default,I2.default];nb.default=M2});var sb=w(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.validateAdditionalItems=void 0;var Ci=ce(),rb=me(),x2={message:({params:{len:n}})=>(0,Ci.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,Ci._)`{limit: ${n}}`},$2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:x2,code(n){let{parentSchema:e,it:t}=n,{items:r}=e;if(!Array.isArray(r)){(0,rb.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}JD(n,r)}};function JD(n,e){let{gen:t,schema:r,data:s,keyword:i,it:o}=n;o.items=!0;let a=t.const("len",(0,Ci._)`${s}.length`);if(r===!1)n.setParams({len:e.length}),n.pass((0,Ci._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,rb.alwaysValidSchema)(o,r)){let l=t.var("valid",(0,Ci._)`${a} <= ${e.length}`);t.if((0,Ci.not)(l),()=>c(l)),n.ok(l)}function c(l){t.forRange("i",e.length,a,u=>{n.subschema({keyword:i,dataProp:u,dataPropType:rb.Type.Num},l),o.allErrors||t.if((0,Ci.not)(l),()=>t.break())})}}il.validateAdditionalItems=JD;il.default=$2});var ib=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.validateTuple=void 0;var XD=ce(),ph=me(),L2=Wn(),q2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){let{schema:e,it:t}=n;if(Array.isArray(e))return QD(n,"additionalItems",e);t.items=!0,!(0,ph.alwaysValidSchema)(t,e)&&n.ok((0,L2.validateArray)(n))}};function QD(n,e,t=n.schema){let{gen:r,parentSchema:s,data:i,keyword:o,it:a}=n;u(s),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=ph.mergeEvaluated.items(r,t.length,a.items));let c=r.name("valid"),l=r.const("len",(0,XD._)`${i}.length`);t.forEach((d,f)=>{(0,ph.alwaysValidSchema)(a,d)||(r.if((0,XD._)`${l} > ${f}`,()=>n.subschema({keyword:o,schemaProp:f,dataProp:f},c)),n.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,b=t.length,g=b===d.minItems&&(b===d.maxItems||d[e]===!1);if(f.strictTuples&&!g){let S=`"${o}" is ${b}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,ph.checkStrictMode)(a,S,f.strictTuples)}}}ol.validateTuple=QD;ol.default=q2});var ZD=w(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var j2=ib(),F2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,j2.validateTuple)(n,"items")};ob.default=F2});var tO=w(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var eO=ce(),B2=me(),U2=Wn(),V2=sb(),W2={message:({params:{len:n}})=>(0,eO.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,eO._)`{limit: ${n}}`},H2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:W2,code(n){let{schema:e,parentSchema:t,it:r}=n,{prefixItems:s}=t;r.items=!0,!(0,B2.alwaysValidSchema)(r,e)&&(s?(0,V2.validateAdditionalItems)(n,s):n.ok((0,U2.validateArray)(n)))}};ab.default=H2});var nO=w(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var Kn=ce(),mh=me(),K2={message:({params:{min:n,max:e}})=>e===void 0?(0,Kn.str)`must contain at least ${n} valid item(s)`:(0,Kn.str)`must contain at least ${n} and no more than ${e} valid item(s)`,params:({params:{min:n,max:e}})=>e===void 0?(0,Kn._)`{minContains: ${n}}`:(0,Kn._)`{minContains: ${n}, maxContains: ${e}}`},z2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:K2,code(n){let{gen:e,schema:t,parentSchema:r,data:s,it:i}=n,o,a,{minContains:c,maxContains:l}=r;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,Kn._)`${s}.length`);if(n.setParams({min:o,max:a}),a===void 0&&o===0){(0,mh.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,mh.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,mh.alwaysValidSchema)(i,t)){let g=(0,Kn._)`${u} >= ${o}`;a!==void 0&&(g=(0,Kn._)`${g} && ${u} <= ${a}`),n.pass(g);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?p(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,Kn._)`${s}.length > 0`,f)):(e.let(d,!1),f()),n.result(d,()=>n.reset());function f(){let g=e.name("_valid"),S=e.let("count",0);p(g,()=>e.if(g,()=>b(S)))}function p(g,S){e.forRange("i",0,u,E=>{n.subschema({keyword:"contains",dataProp:E,dataPropType:mh.Type.Num,compositeRule:!0},g),S()})}function b(g){e.code((0,Kn._)`${g}++`),a===void 0?e.if((0,Kn._)`${g} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,Kn._)`${g} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,Kn._)`${g} >= ${o}`,()=>e.assign(d,!0)))}}};cb.default=z2});var gh=w(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.validateSchemaDeps=Mr.validatePropertyDeps=Mr.error=void 0;var lb=ce(),G2=me(),al=Wn();Mr.error={message:({params:{property:n,depsCount:e,deps:t}})=>{let r=e===1?"property":"properties";return(0,lb.str)`must have ${r} ${t} when property ${n} is present`},params:({params:{property:n,depsCount:e,deps:t,missingProperty:r}})=>(0,lb._)`{property: ${n},
|
|
180
|
+
missingProperty: ${r},
|
|
181
181
|
depsCount: ${e},
|
|
182
|
-
deps: ${t}}`};var NW={keyword:"dependencies",type:"object",schemaType:"object",error:Pn.error,code(r){let[e,t]=PW(r);WD(r,e),HD(r,t)}};function PW({schema:r}){let e={},t={};for(let n in r){if(n==="__proto__")continue;let s=Array.isArray(r[n])?e:t;s[n]=r[n]}return[e,t]}function WD(r,e=r.schema){let{gen:t,data:n,it:s}=r;if(Object.keys(e).length===0)return;let i=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Qc.propertyInData)(t,n,o,s.opts.ownProperties);r.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?t.if(c,()=>{for(let l of a)(0,Qc.checkReportMissingProp)(r,l)}):(t.if((0,Jv._)`${c} && (${(0,Qc.checkMissingProp)(r,a,i)})`),(0,Qc.reportMissingProp)(r,i),t.else())}}Pn.validatePropertyDeps=WD;function HD(r,e=r.schema){let{gen:t,data:n,keyword:s,it:i}=r,o=t.name("valid");for(let a in e)(0,EW.alwaysValidSchema)(i,e[a])||(t.if((0,Qc.propertyInData)(t,n,a,i.opts.ownProperties),()=>{let c=r.subschema({keyword:s,schemaProp:a},o);r.mergeValidEvaluated(c,o)},()=>t.var(o,!0)),r.ok(o))}Pn.validateSchemaDeps=HD;Pn.default=NW});var zD=k(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var KD=oe(),RW=he(),CW={message:"property name must be valid",params:({params:r})=>(0,KD._)`{propertyName: ${r.propertyName}}`},DW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:CW,code(r){let{gen:e,schema:t,data:n,it:s}=r;if((0,RW.alwaysValidSchema)(s,t))return;let i=e.name("valid");e.forIn("key",n,o=>{r.setParams({propertyName:o}),r.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,KD.not)(i),()=>{r.error(!0),s.allErrors||e.break()})}),r.ok(i)}};Xv.default=DW});var Zv=k(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var sh=qr(),cn=oe(),OW=$r(),ih=he(),AW={message:"must NOT have additional properties",params:({params:r})=>(0,cn._)`{additionalProperty: ${r.additionalProperty}}`},IW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:AW,code(r){let{gen:e,schema:t,parentSchema:n,data:s,errsCount:i,it:o}=r;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,ih.alwaysValidSchema)(o,t))return;let l=(0,sh.allSchemaProperties)(n.properties),u=(0,sh.allSchemaProperties)(n.patternProperties);d(),r.ok((0,cn._)`${i} === ${OW.default.errors}`);function d(){e.forIn("key",s,_=>{!l.length&&!u.length?b(_):e.if(f(_),()=>b(_))})}function f(_){let w;if(l.length>8){let T=(0,ih.schemaRefOrVal)(o,n.properties,"properties");w=(0,sh.isOwnProperty)(e,T,_)}else l.length?w=(0,cn.or)(...l.map(T=>(0,cn._)`${_} === ${T}`)):w=cn.nil;return u.length&&(w=(0,cn.or)(w,...u.map(T=>(0,cn._)`${(0,sh.usePattern)(r,T)}.test(${_})`))),(0,cn.not)(w)}function p(_){e.code((0,cn._)`delete ${s}[${_}]`)}function b(_){if(c.removeAdditional==="all"||c.removeAdditional&&t===!1){p(_);return}if(t===!1){r.setParams({additionalProperty:_}),r.error(),a||e.break();return}if(typeof t=="object"&&!(0,ih.alwaysValidSchema)(o,t)){let w=e.name("valid");c.removeAdditional==="failing"?(g(_,w,!1),e.if((0,cn.not)(w),()=>{r.reset(),p(_)})):(g(_,w),a||e.if((0,cn.not)(w),()=>e.break()))}}function g(_,w,T){let v={keyword:"additionalProperties",dataProp:_,dataPropType:ih.Type.Str};T===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(v,w)}}};Qv.default=IW});var JD=k(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var MW=$c(),GD=qr(),eb=he(),YD=Zv(),xW={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:n,data:s,it:i}=r;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&YD.default.code(new MW.KeywordCxt(i,YD.default,"additionalProperties"));let o=(0,GD.allSchemaProperties)(t);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=eb.mergeEvaluated.props(e,(0,eb.toHash)(o),i.props));let a=o.filter(d=>!(0,eb.alwaysValidSchema)(i,t[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,GD.propertyInData)(e,s,d,i.opts.ownProperties)),u(d),i.allErrors||e.else().var(c,!0),e.endIf()),r.it.definedProperties.add(d),r.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&t[d].default!==void 0}function u(d){r.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};tb.default=xW});var eO=k(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var XD=qr(),oh=oe(),QD=he(),ZD=he(),LW={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:n,parentSchema:s,it:i}=r,{opts:o}=i,a=(0,XD.allSchemaProperties)(t),c=a.filter(g=>(0,QD.alwaysValidSchema)(i,t[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,u=e.name("valid");i.props!==!0&&!(i.props instanceof oh.Name)&&(i.props=(0,ZD.evaluatedPropsToName)(e,i.props));let{props:d}=i;f();function f(){for(let g of a)l&&p(g),i.allErrors?b(g):(e.var(u,!0),b(g),e.if(u))}function p(g){for(let _ in l)new RegExp(g).test(_)&&(0,QD.checkStrictMode)(i,`property ${_} matches pattern ${g} (use allowMatchingProperties)`)}function b(g){e.forIn("key",n,_=>{e.if((0,oh._)`${(0,XD.usePattern)(r,g)}.test(${_})`,()=>{let w=c.includes(g);w||r.subschema({keyword:"patternProperties",schemaProp:g,dataProp:_,dataPropType:ZD.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,oh._)`${d}[${_}]`,!0):!w&&!i.allErrors&&e.if((0,oh.not)(u),()=>e.break())})})}}};rb.default=LW});var tO=k(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var $W=he(),qW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:n}=r;if((0,$W.alwaysValidSchema)(n,t)){r.fail();return}let s=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),r.failResult(s,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};nb.default=qW});var rO=k(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var jW=qr(),FW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:jW.validateUnion,error:{message:"must match a schema in anyOf"}};sb.default=FW});var nO=k(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var ah=oe(),BW=he(),UW={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,ah._)`{passingSchemas: ${r.passing}}`},VW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:UW,code(r){let{gen:e,schema:t,parentSchema:n,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=t,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");r.setParams({passing:a}),e.block(l),r.result(o,()=>r.reset(),()=>r.error(!0));function l(){i.forEach((u,d)=>{let f;(0,BW.alwaysValidSchema)(s,u)?e.var(c,!0):f=r.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,ah._)`${c} && ${o}`).assign(o,!1).assign(a,(0,ah._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&r.mergeEvaluated(f,ah.Name)})})}}};ib.default=VW});var sO=k(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var WW=he(),HW={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:n}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let s=e.name("valid");t.forEach((i,o)=>{if((0,WW.alwaysValidSchema)(n,i))return;let a=r.subschema({keyword:"allOf",schemaProp:o},s);r.ok(s),r.mergeEvaluated(a)})}};ob.default=HW});var aO=k(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var ch=oe(),oO=he(),KW={message:({params:r})=>(0,ch.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,ch._)`{failingKeyword: ${r.ifClause}}`},zW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:KW,code(r){let{gen:e,parentSchema:t,it:n}=r;t.then===void 0&&t.else===void 0&&(0,oO.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=iO(n,"then"),i=iO(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),r.reset(),s&&i){let u=e.let("ifClause");r.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else s?e.if(a,l("then")):e.if((0,ch.not)(a),l("else"));r.pass(o,()=>r.error(!0));function c(){let u=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);r.mergeEvaluated(u)}function l(u,d){return()=>{let f=r.subschema({keyword:u},a);e.assign(o,a),r.mergeValidEvaluated(f,o),d?e.assign(d,(0,ch._)`${u}`):r.setParams({ifClause:u})}}}};function iO(r,e){let t=r.schema[e];return t!==void 0&&!(0,oO.alwaysValidSchema)(r,t)}ab.default=zW});var cO=k(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var GW=he(),YW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,GW.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};cb.default=YW});var lO=k(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var JW=Hv(),XW=FD(),QW=Kv(),ZW=UD(),e2=VD(),t2=nh(),r2=zD(),n2=Zv(),s2=JD(),i2=eO(),o2=tO(),a2=rO(),c2=nO(),l2=sO(),u2=aO(),d2=cO();function f2(r=!1){let e=[o2.default,a2.default,c2.default,l2.default,u2.default,d2.default,r2.default,n2.default,t2.default,s2.default,i2.default];return r?e.push(XW.default,ZW.default):e.push(JW.default,QW.default),e.push(e2.default),e}lb.default=f2});var uO=k(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var pt=oe(),h2={message:({schemaCode:r})=>(0,pt.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,pt._)`{format: ${r}}`},p2={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:h2,code(r,e){let{gen:t,data:n,$data:s,schema:i,schemaCode:o,it:a}=r,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;s?f():p();function f(){let b=t.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=t.const("fDef",(0,pt._)`${b}[${o}]`),_=t.let("fType"),w=t.let("format");t.if((0,pt._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>t.assign(_,(0,pt._)`${g}.type || "string"`).assign(w,(0,pt._)`${g}.validate`),()=>t.assign(_,(0,pt._)`"string"`).assign(w,g)),r.fail$data((0,pt.or)(T(),v()));function T(){return c.strictSchema===!1?pt.nil:(0,pt._)`${o} && !${w}`}function v(){let R=u.$async?(0,pt._)`(${g}.async ? await ${w}(${n}) : ${w}(${n}))`:(0,pt._)`${w}(${n})`,A=(0,pt._)`(typeof ${w} == "function" ? ${R} : ${w}.test(${n}))`;return(0,pt._)`${w} && ${w} !== true && ${_} === ${e} && !${A}`}}function p(){let b=d.formats[i];if(!b){T();return}if(b===!0)return;let[g,_,w]=v(b);g===e&&r.pass(R());function T(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function v(A){let L=A instanceof RegExp?(0,pt.regexpCode)(A):c.code.formats?(0,pt._)`${c.code.formats}${(0,pt.getProperty)(i)}`:void 0,W=t.scopeValue("formats",{key:i,ref:A,code:L});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,pt._)`${W}.validate`]:["string",A,W]}function R(){if(typeof b=="object"&&!(b instanceof RegExp)&&b.async){if(!u.$async)throw new Error("async format in sync schema");return(0,pt._)`await ${w}(${n})`}return typeof _=="function"?(0,pt._)`${w}(${n})`:(0,pt._)`${w}.test(${n})`}}}};ub.default=p2});var dO=k(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var m2=uO(),g2=[m2.default];db.default=g2});var fO=k(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.contentVocabulary=Go.metadataVocabulary=void 0;Go.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Go.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var pO=k(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var y2=SD(),v2=LD(),b2=lO(),T2=dO(),hO=fO(),_2=[y2.default,v2.default,(0,b2.default)(),T2.default,hO.metadataVocabulary,hO.contentVocabulary];fb.default=_2});var pb=k(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.dynamicAnchor=void 0;var hb=oe(),S2=$r(),mO=jc(),k2=Jf(),w2={keyword:"$dynamicAnchor",schemaType:"string",code:r=>gO(r,r.schema)};function gO(r,e){let{gen:t,it:n}=r;n.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,hb._)`${S2.default.dynamicAnchors}${(0,hb.getProperty)(e)}`,i=n.errSchemaPath==="#"?n.validateName:E2(r);t.if((0,hb._)`!${s}`,()=>t.assign(s,i))}Zc.dynamicAnchor=gO;function E2(r){let{schemaEnv:e,schema:t,self:n}=r.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=n.opts,l=new mO.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return mO.compileSchema.call(n,l),(0,k2.getValidate)(r,l)}Zc.default=w2});var mb=k(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.dynamicRef=void 0;var yO=oe(),N2=$r(),vO=Jf(),P2={keyword:"$dynamicRef",schemaType:"string",code:r=>bO(r,r.schema)};function bO(r,e){let{gen:t,keyword:n,it:s}=r;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=t.let("valid",!1);o(c),r.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=t.let("_v",(0,yO._)`${N2.default.dynamicAnchors}${(0,yO.getProperty)(i)}`);t.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>t.block(()=>{(0,vO.callRef)(r,c),t.let(l,!0)}):()=>(0,vO.callRef)(r,c)}}el.dynamicRef=bO;el.default=P2});var TO=k(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var R2=pb(),C2=he(),D2={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,R2.dynamicAnchor)(r,""):(0,C2.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};gb.default=D2});var _O=k(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var O2=mb(),A2={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,O2.dynamicRef)(r,r.schema)};yb.default=A2});var SO=k(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var I2=pb(),M2=mb(),x2=TO(),L2=_O(),$2=[I2.default,M2.default,x2.default,L2.default];vb.default=$2});var wO=k(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var kO=nh(),q2={keyword:"dependentRequired",type:"object",schemaType:"object",error:kO.error,code:r=>(0,kO.validatePropertyDeps)(r)};bb.default=q2});var EO=k(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var j2=nh(),F2={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,j2.validateSchemaDeps)(r)};Tb.default=F2});var NO=k(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var B2=he(),U2={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,B2.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};_b.default=U2});var PO=k(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var V2=wO(),W2=EO(),H2=NO(),K2=[V2.default,W2.default,H2.default];Sb.default=K2});var CO=k(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var Ls=oe(),RO=he(),z2=$r(),G2={message:"must NOT have unevaluated properties",params:({params:r})=>(0,Ls._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},Y2={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:G2,code(r){let{gen:e,schema:t,data:n,errsCount:s,it:i}=r;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof Ls.Name?e.if((0,Ls._)`${a} !== true`,()=>e.forIn("key",n,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",n,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),i.props=!0,r.ok((0,Ls._)`${s} === ${z2.default.errors}`);function c(d){if(t===!1){r.setParams({unevaluatedProperty:d}),r.error(),o||e.break();return}if(!(0,RO.alwaysValidSchema)(i,t)){let f=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:RO.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 p=[];for(let b in d)d[b]===!0&&p.push((0,Ls._)`${f} !== ${b}`);return(0,Ls.and)(...p)}}};kb.default=Y2});var OO=k(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var ki=oe(),DO=he(),J2={message:({params:{len:r}})=>(0,ki.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,ki._)`{limit: ${r}}`},X2={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:J2,code(r){let{gen:e,schema:t,data:n,it:s}=r,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,ki._)`${n}.length`);if(t===!1)r.setParams({len:i}),r.fail((0,ki._)`${o} > ${i}`);else if(typeof t=="object"&&!(0,DO.alwaysValidSchema)(s,t)){let c=e.var("valid",(0,ki._)`${o} <= ${i}`);e.if((0,ki.not)(c),()=>a(c,i)),r.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,u=>{r.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:DO.Type.Num},c),s.allErrors||e.if((0,ki.not)(c),()=>e.break())})}}};wb.default=X2});var AO=k(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var Q2=CO(),Z2=OO(),eH=[Q2.default,Z2.default];Eb.default=eH});var MO=k(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.DiscrError=void 0;var IO;(function(r){r.Tag="tag",r.Mapping="mapping"})(IO||(lh.DiscrError=IO={}))});var LO=k(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var Yo=oe(),Nb=MO(),xO=jc(),tH=qc(),rH=he(),nH={message:({params:{discrError:r,tagName:e}})=>r===Nb.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,Yo._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},sH={keyword:"discriminator",type:"object",schemaType:"object",error:nH,code(r){let{gen:e,data:t,schema:n,parentSchema:s,it:i}=r,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Yo._)`${t}${(0,Yo.getProperty)(a)}`);e.if((0,Yo._)`typeof ${l} == "string"`,()=>u(),()=>r.error(!1,{discrError:Nb.DiscrError.Tag,tag:l,tagName:a})),r.ok(c);function u(){let p=f();e.if(!1);for(let b in p)e.elseIf((0,Yo._)`${l} === ${b}`),e.assign(c,d(p[b]));e.else(),r.error(!1,{discrError:Nb.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let b=e.name("valid"),g=r.subschema({keyword:"oneOf",schemaProp:p},b);return r.mergeEvaluated(g,Yo.Name),b}function f(){var p;let b={},g=w(s),_=!0;for(let R=0;R<o.length;R++){let A=o[R];if(A?.$ref&&!(0,rH.schemaHasRulesButRef)(A,i.self.RULES)){let W=A.$ref;if(A=xO.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,W),A instanceof xO.SchemaEnv&&(A=A.schema),A===void 0)throw new tH.default(i.opts.uriResolver,i.baseId,W)}let L=(p=A?.properties)===null||p===void 0?void 0:p[a];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);_=_&&(g||w(A)),T(L,R)}if(!_)throw new Error(`discriminator: "${a}" must be required`);return b;function w({required:R}){return Array.isArray(R)&&R.includes(a)}function T(R,A){if(R.const)v(R.const,A);else if(R.enum)for(let L of R.enum)v(L,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function v(R,A){if(typeof R!="string"||R in b)throw new Error(`discriminator: "${a}" values must be unique strings`);b[R]=A}}}};Pb.default=sH});var $O=k((Iee,iH)=>{iH.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 qO=k((Mee,oH)=>{oH.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 jO=k((xee,aH)=>{aH.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 FO=k((Lee,cH)=>{cH.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 BO=k(($ee,lH)=>{lH.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 UO=k((qee,uH)=>{uH.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 VO=k((jee,dH)=>{dH.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 WO=k(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var fH=$O(),hH=qO(),pH=jO(),mH=FO(),gH=BO(),yH=UO(),vH=VO(),bH=["/properties"];function TH(r){return[fH,hH,pH,mH,e(this,gH),yH,e(this,vH)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,n){return r?t.$dataMetaSchema(n,bH):n}}Rb.default=TH});var HO=k((et,Db)=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.MissingRefError=et.ValidationError=et.CodeGen=et.Name=et.nil=et.stringify=et.str=et._=et.KeywordCxt=et.Ajv2019=void 0;var _H=yD(),SH=pO(),kH=SO(),wH=PO(),EH=AO(),NH=LO(),PH=WO(),Cb="https://json-schema.org/draft/2019-09/schema",Jo=class extends _H.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(kH.default),SH.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(wH.default),this.addVocabulary(EH.default),this.opts.discriminator&&this.addKeyword(NH.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(PH.default.call(this,e),this.refs["http://json-schema.org/schema"]=Cb)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Cb)?Cb:void 0)}};et.Ajv2019=Jo;Db.exports=et=Jo;Db.exports.Ajv2019=Jo;Object.defineProperty(et,"__esModule",{value:!0});et.default=Jo;var RH=$c();Object.defineProperty(et,"KeywordCxt",{enumerable:!0,get:function(){return RH.KeywordCxt}});var Xo=oe();Object.defineProperty(et,"_",{enumerable:!0,get:function(){return Xo._}});Object.defineProperty(et,"str",{enumerable:!0,get:function(){return Xo.str}});Object.defineProperty(et,"stringify",{enumerable:!0,get:function(){return Xo.stringify}});Object.defineProperty(et,"nil",{enumerable:!0,get:function(){return Xo.nil}});Object.defineProperty(et,"Name",{enumerable:!0,get:function(){return Xo.Name}});Object.defineProperty(et,"CodeGen",{enumerable:!0,get:function(){return Xo.CodeGen}});var CH=Uf();Object.defineProperty(et,"ValidationError",{enumerable:!0,get:function(){return CH.default}});var DH=qc();Object.defineProperty(et,"MissingRefError",{enumerable:!0,get:function(){return DH.default}})});var xe=z(Sw());var xu=class r{constructor(e,t,n,s){this._uri=e,this._languageId=t,this._version=n,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(let n of e)if(r.isIncremental(n)){let s=ww(n.range),i=this.offsetAt(s.start),o=this.offsetAt(s.end);this._content=this._content.substring(0,i)+n.text+this._content.substring(o,this._content.length);let a=Math.max(s.start.line,0),c=Math.max(s.end.line,0),l=this._lineOffsets,u=kw(n.text,!1,i);if(c-a===u.length)for(let f=0,p=u.length;f<p;f++)l[f+a+1]=u[f];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=n.text.length-(o-i);if(d!==0)for(let f=a+1+u.length,p=l.length;f<p;f++)l[f]=l[f]+d}else if(r.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=kw(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,s=t.length;if(s===0)return{line:0,character:e};for(;n<s;){let o=Math.floor((n+s)/2);t[o]>e?s=o:n=o+1}let i=n-1;return{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],s=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,s),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},Lu;(function(r){function e(s,i,o,a){return new xu(s,i,o,a)}r.create=e;function t(s,i,o){if(s instanceof xu)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}r.update=t;function n(s,i){let o=s.getText(),a=bm(i.map(FM),(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),c=0,l=[];for(let u of a){let d=s.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=s.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}r.applyEdits=n})(Lu||(Lu={}));function bm(r,e){if(r.length<=1)return r;let t=r.length/2|0,n=r.slice(0,t),s=r.slice(t);bm(n,e),bm(s,e);let i=0,o=0,a=0;for(;i<n.length&&o<s.length;)e(n[i],s[o])<=0?r[a++]=n[i++]:r[a++]=s[o++];for(;i<n.length;)r[a++]=n[i++];for(;o<s.length;)r[a++]=s[o++];return r}function kw(r,e,t=0){let n=e?[t]:[];for(let s=0;s<r.length;s++){let i=r.charCodeAt(s);(i===13||i===10)&&(i===13&&s+1<r.length&&r.charCodeAt(s+1)===10&&s++,n.push(t+s+1))}return n}function ww(r){let e=r.start,t=r.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:r}function FM(r){let e=ww(r.range);return e!==r.range?{newText:r.newText,range:e}:r}var $u=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],qu=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Ew=z(J());var Tm=z(require("url")),Ys=(r,e,t=!0,n=!0)=>({start:{line:r?.pos.line??0,character:t?r?.pos.col??0:(r?.pos.col??0)+(r?.pos.len??0)},end:{line:e?.pos.line??0,character:n?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var Q=r=>Ys(r.tokenIndexes.start,r.tokenIndexes.end),Nw=" ",Pw=r=>{Nw=r},Zi=()=>Nw,Js=r=>$u.findIndex(e=>e===r),Xs=r=>qu.findIndex(e=>e===r),_m=(r,e,t)=>r.uri!==e||t.line<r.pos.line?!1:t.line>r.pos.line?!0:t.character>r.pos.col+r.pos.len,BM=(r,e,t)=>r.uri!==e?!1:t.line<r.pos.line?!0:t.line>r.pos.line?!1:t.character<r.pos.col,Tr=(r,e,t)=>!!(r.uri===e&&r.tokenIndexes?.start&&r.tokenIndexes?.end&&(r.tokenIndexes.start.pos.line<t.line||r.tokenIndexes.start.pos.line===t.line&&r.tokenIndexes.start.pos.col<=t.character)&&(r.tokenIndexes.end.pos.line>t.line||r.tokenIndexes.end.pos.line===t.line&&r.tokenIndexes.end.pos.col+r.tokenIndexes.end.pos.len>=t.character)),Rw=(r,e,t)=>!!(r.uri===e&&r.lastToken.value!==";"&&r.tokenIndexes?.start&&r.tokenIndexes?.end&&(r.tokenIndexes.start.pos.line===t.line||r.tokenIndexes.end.pos.line===t.line)&&t.character>=r.tokenIndexes.end.pos.col+r.tokenIndexes.end.pos.len),Cw=(r,e,t)=>{if(!r)return!1;let s=r.filter(i=>i.pos.line===t.line).at(-1);return s&&s.pos.col>=t.character?!1:e.tokenIndexes?.end===s};var hn=(r,e,t)=>{let n=r,s=r;for(;s;)n=s,s=[...n.children].reverse().find(i=>Tr(i,e,t));return n},_a=(r,e,t)=>{let n=r,s=r;for(;s;)n=s,s=[...n.children].find(i=>BM(i.lastToken,e,t));return n===r?void 0:n},Sa=(r,e,t)=>{let n=r,s=r;for(;s;)n=s,s=[...n.children].reverse().find(i=>_m(i.firstToken,e,t));return n===r?void 0:n},C=(r,e,t=Ew.DiagnosticSeverity.Error,n=[],s=void 0,i=[],o,a)=>({issues:Array.isArray(r)?r:[r],astElement:e,severity:t,linkedTo:n,tags:s,templateStrings:i,edit:o,codeActionTitle:a}),Dw=r=>[...r].sort((t,n)=>{if(t.sortKey===void 0||n.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==n.sortKey)return t.sortKey-n.sortKey;if(!t.tokenIndexes?.end||!n.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==n.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-n.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-n.tokenIndexes.end.pos.col});async function Mt(r,e,t,n,s){let i=xt(r.textDocument.uri),o=Qs(e,i,n,s);if(!o)return[];console.time("search");let c=(await o.context.getRuntime()).getDeepestAstNode(i,r.position),l=c?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(c,d=>{let f=r.position;return d.uri===i?!!(d.tokenIndexes?.end&&(d.tokenIndexes.end.pos.line<f.line||d.tokenIndexes.end.pos.line===f.line&&d.tokenIndexes.end.pos.col+d.tokenIndexes.end.pos.len<=f.character)):l!==void 0&&d.sortKey<=l})}function G(r,e){return{start:r,end:e??r}}var $=(r,e)=>r?.tokens.some(t=>t===e),Je=r=>e=>e?.value&&r===e.value?"yes":UM(r)(e),Pe=r=>e=>e?.tokens.some(t=>t===r)?"yes":"no",UM=r=>e=>e?.value&&r.startsWith(e.value)?"partial":"no",pn=(r,e)=>!!r&&!!e&&r.pos.line===e.pos.line&&r.uri===e.uri,Xt=(r,e)=>!!r&&!!e&&pn(r,e)&&r.pos.col+r.pos.len===e.pos.col,ju=r=>r.map((e,t)=>({index:t,context:e,files:e.getContextFiles()})),Qs=(r,e,t,n)=>t?.getContextFiles().find(i=>i===e)?{context:t}:ju(r).sort(i=>i.context.name===n?-1:0).find(i=>i.files.some(o=>o===e)),Ow=(r,e)=>ju(r).filter(n=>n.files.some(s=>s===e)),Aw=r=>{let e=/^(\w+)\s+(.+)$/,t=/^(\w+)\(([^)]*)\)\s+(.+)$/,n=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,s;if(s=n.exec(r)){let[,,i,o]=s,a=i.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(s=t.exec(r)){let[,,i,o]=s,a=i.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(s=e.exec(r)){let[,,i]=s;return i.trim()}},Iw=(r,e)=>{let t=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),n=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),s=r,i;do i=s,s=t(i),s=n(s),s=s.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(s!==i);return s},ce=r=>Tm.default.pathToFileURL(r).toString(),xt=r=>Tm.default.fileURLToPath(r),Mw=(r,e)=>r===e;var Ln=z(J()),F=class{constructor(e){this._children=[];this._fisrtToken=e?.start,this._lastToken=e?.end}get sortKey(){return this.firstToken.sortKey??this.parentNode?.sortKey??-1}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=Q(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(n=>n.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Ln.SymbolKind.File,Ln.SymbolKind.Class,Ln.SymbolKind.Namespace].some(n=>n===e))return[];let t=Q(this);return[{location:Ln.Location.create(ce(this.uri),t),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(n=>n.getWorkspaceSymbols()??[]).filter(n=>n.kind===Ln.SymbolKind.File||n.kind===Ln.SymbolKind.Class||n.kind===Ln.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(Js(this.semanticTokenType),Xs(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}};var eo=z(J());var jw=z(J());var xw=z(J()),Oe=class extends F{constructor(t,n){super(n);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:xw.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}};var $w=z(J());var Lw=z(J());function VM(r){return r.replace(/'(.)'/g,(e,t)=>t.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function Sm(r){try{return(0,eval)(VM(r))}catch(e){console.log(e)}return r}var zr=class extends F{toJson(){return-1}resolve(e){return Iw(this.toString(),e)}evaluate(e){return Sm(this.resolve(e))}isTrue(e){return Sm(`!!(${this.resolve(e)})`)}},Zs=class extends zr{constructor(t,n,s){super();this.expression=t;this.wrapped=n;this.join=s;this.addChild(t),s&&(this.addChild(s.operator),this.addChild(s.expression))}addExpression(t,n){this.addChild(t),this.addChild(n)}toString(){let t=this.children.map(n=>n.toString()).join(" ");return this.wrapped?`(${t})`:`${t}`}isTrue(t){let n=`(${this.children.map(s=>s instanceof zr?s.resolve(t):s.toString()).join(" ")})`;return Sm(`!!${n}`)}};var _t=class extends zr{constructor(t,n){super(n);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:Lw.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}toJson(){return this.value}};var yt=class extends F{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:$w.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(t=>t.value instanceof _t)){let t=new ArrayBuffer(8),n=new DataView(t);return this.values.map(s=>s.value.value).forEach((s,i)=>{n.setUint32(i*4,s)}),n.getBigUint64(0)}return this.values.map(t=>t.value?.toJson()??NaN)}};var qw=z(J()),as=class extends F{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:qw.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}toJson(){return this.values.map(t=>t.value?.toJson()??NaN)}};var ze=class extends F{constructor(t,n){super(n);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Ae=class extends F{constructor(t,n=[]){super();this.propertyName=t;this.labels=n;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:jw.SymbolKind.Property},this.labels.forEach(s=>this.addChild(s)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof Oe?t.value.value:t.value instanceof yt?t.value.values.map(n=>n.value instanceof _t?n.value.value:NaN):t.value instanceof as?t.value.values.map(n=>n.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(t=>t?.toString()??"NULL").join(", ")??"NULL"}`:""};`}};var Fw=z(J()),Qt=class extends F{constructor(t,n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:t,kind:Fw.SymbolKind.Function}}};var ur=class extends Qt{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Ue=class extends Qt{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var qe=class r extends F{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof dt)return[this.pathName];if(!(this.parentNode instanceof r))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof r)}get deleteNodes(){return this.children.filter(e=>e instanceof ur)}addNodeChild(e){this.addChild(e)}},dt=class extends qe{constructor(){super(),this.docSymbolsMeta={name:"/",kind:eo.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Ae)}get name(){return new je("/",G(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof Ue)}get nodes(){return this.children.filter(e=>e instanceof Re)}get pathName(){return"/"}},Rt=class extends qe{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:eo.SymbolKind.Class},t.forEach(n=>{super.addChild(n)})}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:eo.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof Re)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Ae)}get deleteProperties(){return this.children.filter(t=>t instanceof Ue)}},Re=class r extends qe{constructor(t=[],n){super();this.labels=t;this.omitIfNoRef=n;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:eo.SymbolKind.Class},n&&this.addChild(n),t.forEach(s=>{this.addChild(s)})}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:eo.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof r)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof Ae)}get deleteProperties(){return this.children.filter(t=>t instanceof Ue)}},Fu=class extends F{constructor(t,n){super(n);this.address=t;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address.toString(16)}},je=class extends F{constructor(t,n,s){super(n);this.name=t;this._address=s;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(t){if(this._address)throw new Error("Address can only be set once");t&&(this.lastToken=void 0,this._address=t,t.forEach(n=>this.addChild(n)))}toString(){return this._address!==void 0?`${this.name}@${this._address.map(t=>t.toString()).join(",")}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let n={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};t(Js("type"),Xs("declaration"),{start:n,end:n}),this.address!==void 0&&this.address.forEach(s=>{t(Js("decorator"),Xs("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(t)})}};var Bw=z(J()),_e=class extends F{constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:Bw.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}};var Jr=z(J());var St=r=>r instanceof Qt?!0:r instanceof qe?!1:r.parentNode?St(r.parentNode):!1;var to=r=>[...r.map(e=>{if(e instanceof Re||e instanceof dt)return e.name;if(e instanceof Rt)return e.labelReference})].filter(e=>!!e),km=(r,e)=>e?e.parentNode===r||km(r,e.parentNode):!1;var lt=z(J());var Uw=z(J());var $n=class extends F{constructor(){super();this._pathParts=[]}addPath(t,n){this._pathParts.push(t),n&&this.addChild(n),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},Gr=class extends F{constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:Uw.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}};var it=z(J());var Bu=z(J());var Vw=require("path"),cs=class extends F{constructor(t,n){super();this.keyword=t;this.path=n;this.docSymbolsMeta={name:`Include ${n}`,kind:Bu.SymbolKind.File},this.addChild(t),this.addChild(n)}get resolvedPath(){return this._resolvedPath}set resolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:Bu.SymbolKind.File},this._resolvedPath=t}},ro=class extends F{constructor(t,n,s){super(s);this._path=t;this.relative=n;this.docSymbolsMeta={name:(0,Vw.basename)(this.path),kind:Bu.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var mn=class extends F{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var WM=async(r,e,t)=>{let n=it.Position.create(r.pos.line,r.pos.col),s=t.find(i=>Tr(i,e,n));if(s)return hn(s,e,n)},wm=r=>{if(r)return r instanceof qe?r:wm(r?.parentNode)},so=(r,e,t=0)=>!e||e.uri!==r?t:so(r,wm(e.parentNode),t+1),HM=(r,e)=>async t=>{let n=await WM(t.firstToken,e,r);return!n||n===t||t.allDescendants.some(i=>i===n)?0:n instanceof qe?so(e,wm(n)):void 0};async function Ww(r,e){let t=[],n=xt(r.textDocument.uri),s=(await e.getRuntime()).fileTopMostAst(n);return t.push(...(await Promise.all(s.flatMap(async i=>await Hw(r,i,n,HM(s,n))))).flat()),t}var ei=(r,e=1)=>{if(r.prevToken){let t=r.pos.line-r.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return it.TextEdit.replace(it.Range.create(it.Position.create(r.prevToken.pos.line,r.prevToken.pos.col+r.prevToken.pos.len),it.Position.create(r.pos.line-e,r.pos.col)),"".padEnd(e-1,`
|
|
183
|
-
`))}},
|
|
184
|
-
${
|
|
182
|
+
deps: ${t}}`};var Y2={keyword:"dependencies",type:"object",schemaType:"object",error:Mr.error,code(n){let[e,t]=J2(n);rO(n,e),sO(n,t)}};function J2({schema:n}){let e={},t={};for(let r in n){if(r==="__proto__")continue;let s=Array.isArray(n[r])?e:t;s[r]=n[r]}return[e,t]}function rO(n,e=n.schema){let{gen:t,data:r,it:s}=n;if(Object.keys(e).length===0)return;let i=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,al.propertyInData)(t,r,o,s.opts.ownProperties);n.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?t.if(c,()=>{for(let l of a)(0,al.checkReportMissingProp)(n,l)}):(t.if((0,lb._)`${c} && (${(0,al.checkMissingProp)(n,a,i)})`),(0,al.reportMissingProp)(n,i),t.else())}}Mr.validatePropertyDeps=rO;function sO(n,e=n.schema){let{gen:t,data:r,keyword:s,it:i}=n,o=t.name("valid");for(let a in e)(0,G2.alwaysValidSchema)(i,e[a])||(t.if((0,al.propertyInData)(t,r,a,i.opts.ownProperties),()=>{let c=n.subschema({keyword:s,schemaProp:a},o);n.mergeValidEvaluated(c,o)},()=>t.var(o,!0)),n.ok(o))}Mr.validateSchemaDeps=sO;Mr.default=Y2});var oO=w(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var iO=ce(),X2=me(),Q2={message:"property name must be valid",params:({params:n})=>(0,iO._)`{propertyName: ${n.propertyName}}`},Z2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Q2,code(n){let{gen:e,schema:t,data:r,it:s}=n;if((0,X2.alwaysValidSchema)(s,t))return;let i=e.name("valid");e.forIn("key",r,o=>{n.setParams({propertyName:o}),n.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,iO.not)(i),()=>{n.error(!0),s.allErrors||e.break()})}),n.ok(i)}};ub.default=Z2});var fb=w(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var yh=Wn(),pr=ce(),eW=Vn(),vh=me(),tW={message:"must NOT have additional properties",params:({params:n})=>(0,pr._)`{additionalProperty: ${n.additionalProperty}}`},nW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:tW,code(n){let{gen:e,schema:t,parentSchema:r,data:s,errsCount:i,it:o}=n;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,vh.alwaysValidSchema)(o,t))return;let l=(0,yh.allSchemaProperties)(r.properties),u=(0,yh.allSchemaProperties)(r.patternProperties);d(),n.ok((0,pr._)`${i} === ${eW.default.errors}`);function d(){e.forIn("key",s,S=>{!l.length&&!u.length?b(S):e.if(f(S),()=>b(S))})}function f(S){let E;if(l.length>8){let T=(0,vh.schemaRefOrVal)(o,r.properties,"properties");E=(0,yh.isOwnProperty)(e,T,S)}else l.length?E=(0,pr.or)(...l.map(T=>(0,pr._)`${S} === ${T}`)):E=pr.nil;return u.length&&(E=(0,pr.or)(E,...u.map(T=>(0,pr._)`${(0,yh.usePattern)(n,T)}.test(${S})`))),(0,pr.not)(E)}function p(S){e.code((0,pr._)`delete ${s}[${S}]`)}function b(S){if(c.removeAdditional==="all"||c.removeAdditional&&t===!1){p(S);return}if(t===!1){n.setParams({additionalProperty:S}),n.error(),a||e.break();return}if(typeof t=="object"&&!(0,vh.alwaysValidSchema)(o,t)){let E=e.name("valid");c.removeAdditional==="failing"?(g(S,E,!1),e.if((0,pr.not)(E),()=>{n.reset(),p(S)})):(g(S,E),a||e.if((0,pr.not)(E),()=>e.break()))}}function g(S,E,T){let v={keyword:"additionalProperties",dataProp:S,dataPropType:vh.Type.Str};T===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(v,E)}}};db.default=nW});var lO=w(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var rW=Kc(),aO=Wn(),hb=me(),cO=fb(),sW={keyword:"properties",type:"object",schemaType:"object",code(n){let{gen:e,schema:t,parentSchema:r,data:s,it:i}=n;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&cO.default.code(new rW.KeywordCxt(i,cO.default,"additionalProperties"));let o=(0,aO.allSchemaProperties)(t);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=hb.mergeEvaluated.props(e,(0,hb.toHash)(o),i.props));let a=o.filter(d=>!(0,hb.alwaysValidSchema)(i,t[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,aO.propertyInData)(e,s,d,i.opts.ownProperties)),u(d),i.allErrors||e.else().var(c,!0),e.endIf()),n.it.definedProperties.add(d),n.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&t[d].default!==void 0}function u(d){n.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};pb.default=sW});var hO=w(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var uO=Wn(),bh=ce(),dO=me(),fO=me(),iW={keyword:"patternProperties",type:"object",schemaType:"object",code(n){let{gen:e,schema:t,data:r,parentSchema:s,it:i}=n,{opts:o}=i,a=(0,uO.allSchemaProperties)(t),c=a.filter(g=>(0,dO.alwaysValidSchema)(i,t[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,u=e.name("valid");i.props!==!0&&!(i.props instanceof bh.Name)&&(i.props=(0,fO.evaluatedPropsToName)(e,i.props));let{props:d}=i;f();function f(){for(let g of a)l&&p(g),i.allErrors?b(g):(e.var(u,!0),b(g),e.if(u))}function p(g){for(let S in l)new RegExp(g).test(S)&&(0,dO.checkStrictMode)(i,`property ${S} matches pattern ${g} (use allowMatchingProperties)`)}function b(g){e.forIn("key",r,S=>{e.if((0,bh._)`${(0,uO.usePattern)(n,g)}.test(${S})`,()=>{let E=c.includes(g);E||n.subschema({keyword:"patternProperties",schemaProp:g,dataProp:S,dataPropType:fO.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,bh._)`${d}[${S}]`,!0):!E&&!i.allErrors&&e.if((0,bh.not)(u),()=>e.break())})})}}};mb.default=iW});var pO=w(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var oW=me(),aW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:e,schema:t,it:r}=n;if((0,oW.alwaysValidSchema)(r,t)){n.fail();return}let s=e.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),n.failResult(s,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};gb.default=aW});var mO=w(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var cW=Wn(),lW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cW.validateUnion,error:{message:"must match a schema in anyOf"}};yb.default=lW});var gO=w(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var Th=ce(),uW=me(),dW={message:"must match exactly one schema in oneOf",params:({params:n})=>(0,Th._)`{passingSchemas: ${n.passing}}`},fW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dW,code(n){let{gen:e,schema:t,parentSchema:r,it:s}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(s.opts.discriminator&&r.discriminator)return;let i=t,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");n.setParams({passing:a}),e.block(l),n.result(o,()=>n.reset(),()=>n.error(!0));function l(){i.forEach((u,d)=>{let f;(0,uW.alwaysValidSchema)(s,u)?e.var(c,!0):f=n.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Th._)`${c} && ${o}`).assign(o,!1).assign(a,(0,Th._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&n.mergeEvaluated(f,Th.Name)})})}}};vb.default=fW});var yO=w(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var hW=me(),pW={keyword:"allOf",schemaType:"array",code(n){let{gen:e,schema:t,it:r}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");let s=e.name("valid");t.forEach((i,o)=>{if((0,hW.alwaysValidSchema)(r,i))return;let a=n.subschema({keyword:"allOf",schemaProp:o},s);n.ok(s),n.mergeEvaluated(a)})}};bb.default=pW});var TO=w(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var Sh=ce(),bO=me(),mW={message:({params:n})=>(0,Sh.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,Sh._)`{failingKeyword: ${n.ifClause}}`},gW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:mW,code(n){let{gen:e,parentSchema:t,it:r}=n;t.then===void 0&&t.else===void 0&&(0,bO.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let s=vO(r,"then"),i=vO(r,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),n.reset(),s&&i){let u=e.let("ifClause");n.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else s?e.if(a,l("then")):e.if((0,Sh.not)(a),l("else"));n.pass(o,()=>n.error(!0));function c(){let u=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);n.mergeEvaluated(u)}function l(u,d){return()=>{let f=n.subschema({keyword:u},a);e.assign(o,a),n.mergeValidEvaluated(f,o),d?e.assign(d,(0,Sh._)`${u}`):n.setParams({ifClause:u})}}}};function vO(n,e){let t=n.schema[e];return t!==void 0&&!(0,bO.alwaysValidSchema)(n,t)}Tb.default=gW});var SO=w(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var yW=me(),vW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:e,it:t}){e.if===void 0&&(0,yW.checkStrictMode)(t,`"${n}" without "if" is ignored`)}};Sb.default=vW});var _O=w(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var bW=sb(),TW=ZD(),SW=ib(),_W=tO(),wW=nO(),EW=gh(),kW=oO(),NW=fb(),PW=lO(),RW=hO(),CW=pO(),DW=mO(),OW=gO(),AW=yO(),IW=TO(),MW=SO();function xW(n=!1){let e=[CW.default,DW.default,OW.default,AW.default,IW.default,MW.default,kW.default,NW.default,EW.default,PW.default,RW.default];return n?e.push(TW.default,_W.default):e.push(bW.default,SW.default),e.push(wW.default),e}_b.default=xW});var wO=w(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var yt=ce(),$W={message:({schemaCode:n})=>(0,yt.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,yt._)`{format: ${n}}`},LW={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:$W,code(n,e){let{gen:t,data:r,$data:s,schema:i,schemaCode:o,it:a}=n,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;s?f():p();function f(){let b=t.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=t.const("fDef",(0,yt._)`${b}[${o}]`),S=t.let("fType"),E=t.let("format");t.if((0,yt._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>t.assign(S,(0,yt._)`${g}.type || "string"`).assign(E,(0,yt._)`${g}.validate`),()=>t.assign(S,(0,yt._)`"string"`).assign(E,g)),n.fail$data((0,yt.or)(T(),v()));function T(){return c.strictSchema===!1?yt.nil:(0,yt._)`${o} && !${E}`}function v(){let R=u.$async?(0,yt._)`(${g}.async ? await ${E}(${r}) : ${E}(${r}))`:(0,yt._)`${E}(${r})`,A=(0,yt._)`(typeof ${E} == "function" ? ${R} : ${E}.test(${r}))`;return(0,yt._)`${E} && ${E} !== true && ${S} === ${e} && !${A}`}}function p(){let b=d.formats[i];if(!b){T();return}if(b===!0)return;let[g,S,E]=v(b);g===e&&n.pass(R());function T(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function v(A){let $=A instanceof RegExp?(0,yt.regexpCode)(A):c.code.formats?(0,yt._)`${c.code.formats}${(0,yt.getProperty)(i)}`:void 0,W=t.scopeValue("formats",{key:i,ref:A,code:$});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,yt._)`${W}.validate`]:["string",A,W]}function R(){if(typeof b=="object"&&!(b instanceof RegExp)&&b.async){if(!u.$async)throw new Error("async format in sync schema");return(0,yt._)`await ${E}(${r})`}return typeof S=="function"?(0,yt._)`${E}(${r})`:(0,yt._)`${E}.test(${r})`}}}};wb.default=LW});var EO=w(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var qW=wO(),jW=[qW.default];Eb.default=jW});var kO=w(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.contentVocabulary=ra.metadataVocabulary=void 0;ra.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ra.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var PO=w(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var FW=xD(),BW=YD(),UW=_O(),VW=EO(),NO=kO(),WW=[FW.default,BW.default,(0,UW.default)(),VW.default,NO.metadataVocabulary,NO.contentVocabulary];kb.default=WW});var Pb=w(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.dynamicAnchor=void 0;var Nb=ce(),HW=Vn(),RO=Gc(),KW=lh(),zW={keyword:"$dynamicAnchor",schemaType:"string",code:n=>CO(n,n.schema)};function CO(n,e){let{gen:t,it:r}=n;r.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,Nb._)`${HW.default.dynamicAnchors}${(0,Nb.getProperty)(e)}`,i=r.errSchemaPath==="#"?r.validateName:GW(n);t.if((0,Nb._)`!${s}`,()=>t.assign(s,i))}cl.dynamicAnchor=CO;function GW(n){let{schemaEnv:e,schema:t,self:r}=n.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new RO.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return RO.compileSchema.call(r,l),(0,KW.getValidate)(n,l)}cl.default=zW});var Rb=w(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.dynamicRef=void 0;var DO=ce(),YW=Vn(),OO=lh(),JW={keyword:"$dynamicRef",schemaType:"string",code:n=>AO(n,n.schema)};function AO(n,e){let{gen:t,keyword:r,it:s}=n;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=t.let("valid",!1);o(c),n.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=t.let("_v",(0,DO._)`${YW.default.dynamicAnchors}${(0,DO.getProperty)(i)}`);t.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>t.block(()=>{(0,OO.callRef)(n,c),t.let(l,!0)}):()=>(0,OO.callRef)(n,c)}}ll.dynamicRef=AO;ll.default=JW});var IO=w(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var XW=Pb(),QW=me(),ZW={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,XW.dynamicAnchor)(n,""):(0,QW.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};Cb.default=ZW});var MO=w(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var eH=Rb(),tH={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,eH.dynamicRef)(n,n.schema)};Db.default=tH});var xO=w(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var nH=Pb(),rH=Rb(),sH=IO(),iH=MO(),oH=[nH.default,rH.default,sH.default,iH.default];Ob.default=oH});var LO=w(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var $O=gh(),aH={keyword:"dependentRequired",type:"object",schemaType:"object",error:$O.error,code:n=>(0,$O.validatePropertyDeps)(n)};Ab.default=aH});var qO=w(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var cH=gh(),lH={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,cH.validateSchemaDeps)(n)};Ib.default=lH});var jO=w(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var uH=me(),dH={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:e,it:t}){e.contains===void 0&&(0,uH.checkStrictMode)(t,`"${n}" without "contains" is ignored`)}};Mb.default=dH});var FO=w(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var fH=LO(),hH=qO(),pH=jO(),mH=[fH.default,hH.default,pH.default];xb.default=mH});var UO=w($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var Ws=ce(),BO=me(),gH=Vn(),yH={message:"must NOT have unevaluated properties",params:({params:n})=>(0,Ws._)`{unevaluatedProperty: ${n.unevaluatedProperty}}`},vH={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:yH,code(n){let{gen:e,schema:t,data:r,errsCount:s,it:i}=n;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof Ws.Name?e.if((0,Ws._)`${a} !== true`,()=>e.forIn("key",r,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",r,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),i.props=!0,n.ok((0,Ws._)`${s} === ${gH.default.errors}`);function c(d){if(t===!1){n.setParams({unevaluatedProperty:d}),n.error(),o||e.break();return}if(!(0,BO.alwaysValidSchema)(i,t)){let f=e.name("valid");n.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:BO.Type.Str},f),o||e.if((0,Ws.not)(f),()=>e.break())}}function l(d,f){return(0,Ws._)`!${d} || !${d}[${f}]`}function u(d,f){let p=[];for(let b in d)d[b]===!0&&p.push((0,Ws._)`${f} !== ${b}`);return(0,Ws.and)(...p)}}};$b.default=vH});var WO=w(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var Di=ce(),VO=me(),bH={message:({params:{len:n}})=>(0,Di.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,Di._)`{limit: ${n}}`},TH={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:bH,code(n){let{gen:e,schema:t,data:r,it:s}=n,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,Di._)`${r}.length`);if(t===!1)n.setParams({len:i}),n.fail((0,Di._)`${o} > ${i}`);else if(typeof t=="object"&&!(0,VO.alwaysValidSchema)(s,t)){let c=e.var("valid",(0,Di._)`${o} <= ${i}`);e.if((0,Di.not)(c),()=>a(c,i)),n.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,u=>{n.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:VO.Type.Num},c),s.allErrors||e.if((0,Di.not)(c),()=>e.break())})}}};Lb.default=TH});var HO=w(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var SH=UO(),_H=WO(),wH=[SH.default,_H.default];qb.default=wH});var zO=w(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.DiscrError=void 0;var KO;(function(n){n.Tag="tag",n.Mapping="mapping"})(KO||(_h.DiscrError=KO={}))});var YO=w(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var sa=ce(),jb=zO(),GO=Gc(),EH=zc(),kH=me(),NH={message:({params:{discrError:n,tagName:e}})=>n===jb.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:n,tag:e,tagName:t}})=>(0,sa._)`{error: ${n}, tag: ${t}, tagValue: ${e}}`},PH={keyword:"discriminator",type:"object",schemaType:"object",error:NH,code(n){let{gen:e,data:t,schema:r,parentSchema:s,it:i}=n,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,sa._)`${t}${(0,sa.getProperty)(a)}`);e.if((0,sa._)`typeof ${l} == "string"`,()=>u(),()=>n.error(!1,{discrError:jb.DiscrError.Tag,tag:l,tagName:a})),n.ok(c);function u(){let p=f();e.if(!1);for(let b in p)e.elseIf((0,sa._)`${l} === ${b}`),e.assign(c,d(p[b]));e.else(),n.error(!1,{discrError:jb.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let b=e.name("valid"),g=n.subschema({keyword:"oneOf",schemaProp:p},b);return n.mergeEvaluated(g,sa.Name),b}function f(){var p;let b={},g=E(s),S=!0;for(let R=0;R<o.length;R++){let A=o[R];if(A?.$ref&&!(0,kH.schemaHasRulesButRef)(A,i.self.RULES)){let W=A.$ref;if(A=GO.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,W),A instanceof GO.SchemaEnv&&(A=A.schema),A===void 0)throw new EH.default(i.opts.uriResolver,i.baseId,W)}let $=(p=A?.properties)===null||p===void 0?void 0:p[a];if(typeof $!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);S=S&&(g||E(A)),T($,R)}if(!S)throw new Error(`discriminator: "${a}" must be required`);return b;function E({required:R}){return Array.isArray(R)&&R.includes(a)}function T(R,A){if(R.const)v(R.const,A);else if(R.enum)for(let $ of R.enum)v($,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function v(R,A){if(typeof R!="string"||R in b)throw new Error(`discriminator: "${a}" values must be unique strings`);b[R]=A}}}};Fb.default=PH});var JO=w((gte,RH)=>{RH.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 XO=w((yte,CH)=>{CH.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 QO=w((vte,DH)=>{DH.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 ZO=w((bte,OH)=>{OH.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 eA=w((Tte,AH)=>{AH.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 tA=w((Ste,IH)=>{IH.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 nA=w((_te,MH)=>{MH.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 rA=w(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var xH=JO(),$H=XO(),LH=QO(),qH=ZO(),jH=eA(),FH=tA(),BH=nA(),UH=["/properties"];function VH(n){return[xH,$H,LH,qH,e(this,jH),FH,e(this,BH)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,r){return n?t.$dataMetaSchema(r,UH):r}}Bb.default=VH});var sA=w((st,Vb)=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.MissingRefError=st.ValidationError=st.CodeGen=st.Name=st.nil=st.stringify=st.str=st._=st.KeywordCxt=st.Ajv2019=void 0;var WH=DD(),HH=PO(),KH=xO(),zH=FO(),GH=HO(),YH=YO(),JH=rA(),Ub="https://json-schema.org/draft/2019-09/schema",ia=class extends WH.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(KH.default),HH.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(zH.default),this.addVocabulary(GH.default),this.opts.discriminator&&this.addKeyword(YH.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(JH.default.call(this,e),this.refs["http://json-schema.org/schema"]=Ub)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ub)?Ub:void 0)}};st.Ajv2019=ia;Vb.exports=st=ia;Vb.exports.Ajv2019=ia;Object.defineProperty(st,"__esModule",{value:!0});st.default=ia;var XH=Kc();Object.defineProperty(st,"KeywordCxt",{enumerable:!0,get:function(){return XH.KeywordCxt}});var oa=ce();Object.defineProperty(st,"_",{enumerable:!0,get:function(){return oa._}});Object.defineProperty(st,"str",{enumerable:!0,get:function(){return oa.str}});Object.defineProperty(st,"stringify",{enumerable:!0,get:function(){return oa.stringify}});Object.defineProperty(st,"nil",{enumerable:!0,get:function(){return oa.nil}});Object.defineProperty(st,"Name",{enumerable:!0,get:function(){return oa.Name}});Object.defineProperty(st,"CodeGen",{enumerable:!0,get:function(){return oa.CodeGen}});var QH=th();Object.defineProperty(st,"ValidationError",{enumerable:!0,get:function(){return QH.default}});var ZH=zc();Object.defineProperty(st,"MissingRefError",{enumerable:!0,get:function(){return ZH.default}})});var $e=H(xE());var Gu=class n{constructor(e,t,r,s){this._uri=e,this._languageId=t,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(let r of e)if(n.isIncremental(r)){let s=LE(r.range),i=this.offsetAt(s.start),o=this.offsetAt(s.end);this._content=this._content.substring(0,i)+r.text+this._content.substring(o,this._content.length);let a=Math.max(s.start.line,0),c=Math.max(s.end.line,0),l=this._lineOffsets,u=$E(r.text,!1,i);if(c-a===u.length)for(let f=0,p=u.length;f<p;f++)l[f+a+1]=u[f];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=r.text.length-(o-i);if(d!==0)for(let f=a+1+u.length,p=l.length;f<p;f++)l[f]=l[f]+d}else if(n.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=$E(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,s=t.length;if(s===0)return{line:0,character:e};for(;r<s;){let o=Math.floor((r+s)/2);t[o]>e?s=o:r=o+1}let i=r-1;return{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],s=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,s),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},Yu;(function(n){function e(s,i,o,a){return new Gu(s,i,o,a)}n.create=e;function t(s,i,o){if(s instanceof Gu)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function r(s,i){let o=s.getText(),a=Om(i.map(ax),(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),c=0,l=[];for(let u of a){let d=s.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=s.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}n.applyEdits=r})(Yu||(Yu={}));function Om(n,e){if(n.length<=1)return n;let t=n.length/2|0,r=n.slice(0,t),s=n.slice(t);Om(r,e),Om(s,e);let i=0,o=0,a=0;for(;i<r.length&&o<s.length;)e(r[i],s[o])<=0?n[a++]=r[i++]:n[a++]=s[o++];for(;i<r.length;)n[a++]=r[i++];for(;o<s.length;)n[a++]=s[o++];return n}function $E(n,e,t=0){let r=e?[t]:[];for(let s=0;s<n.length;s++){let i=n.charCodeAt(s);(i===13||i===10)&&(i===13&&s+1<n.length&&n.charCodeAt(s+1)===10&&s++,r.push(t+s+1))}return r}function LE(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function ax(n){let e=LE(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var Ju=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],Xu=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var qE=H(J());var Am=H(require("url")),jE=require("crypto"),FE=require("path"),ri=(n,e,t=!0,r=!0)=>({start:{line:n?.pos.line??0,character:t?n?.pos.col??0:(n?.pos.col??0)+(n?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var Q=n=>ri(n.tokenIndexes.start,n.tokenIndexes.end),BE=" ",UE=n=>{BE=n},co=()=>BE,si=n=>Ju.findIndex(e=>e===n),ii=n=>Xu.findIndex(e=>e===n),Im=(n,e,t)=>!se(n.uri,e)||t.line<n.pos.line?!1:t.line>n.pos.line?!0:t.character>n.pos.colEnd,cx=(n,e,t)=>se(n.uri,e)?t.line<n.pos.line?!0:t.line>n.pos.line?!1:t.character<n.pos.col:!1,En=(n,e,t)=>!!(se(n.uri,e)&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line<t.line||n.tokenIndexes.start.pos.line===t.line&&n.tokenIndexes.start.pos.col<=t.character)&&(n.tokenIndexes.end.pos.line>t.line||n.tokenIndexes.end.pos.line===t.line&&n.tokenIndexes.end.pos.colEnd>=t.character)),VE=(n,e,t)=>!!(se(n.uri,e)&&n.lastToken.value!==";"&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line===t.line||n.tokenIndexes.end.pos.line===t.line)&&t.character>=n.tokenIndexes.end.pos.colEnd),WE=(n,e,t)=>{if(!n)return!1;let s=n.filter(i=>i.pos.line===t.line).at(-1);return s&&s.pos.col>=t.character?!1:e.tokenIndexes?.end===s};var br=(n,e,t)=>{let r=n,s=n;for(;s;)r=s,s=[...r.children].reverse().find(i=>En(i,e,t));return r},Da=(n,e,t)=>{let r=n,s=n;for(;s;)r=s,s=[...r.children].find(i=>cx(i.lastToken,e,t));return r===n?void 0:r},Oa=(n,e,t)=>{let r=n,s=n;for(;s;)r=s,s=[...r.children].reverse().find(i=>Im(i.firstToken,e,t));return r===n?void 0:r},C=(n,e,t=qE.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>({issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a}),HE=(n,e)=>[...n].sort((r,s)=>{let i=e.getSortKey(r),o=e.getSortKey(s);if(i===void 0||o===void 0)throw new Error("Sort keys must be set");if(i!==o)return i-o;if(!r.tokenIndexes?.end||!s.tokenIndexes?.end)throw new Error("Must have token indexes");return r.tokenIndexes.end.pos.line!==s.tokenIndexes.end.pos.line?r.tokenIndexes.end.pos.line-s.tokenIndexes.end.pos.line:r.tokenIndexes.end.pos.col-s.tokenIndexes.end.pos.col});async function Et(n,e,t){let r=tt(n.textDocument.uri);if(!e)return[];console.time("search");let i=(await e.getRuntime()).getDeepestAstNode(r,n.position),o=e.getSortKey(i?.ast);return console.timeEnd("search"),t(i,c=>{let l=n.position;return se(c.uri,r)?!!(c.tokenIndexes?.end&&(c.tokenIndexes.end.pos.line<l.line||c.tokenIndexes.end.pos.line===l.line&&c.tokenIndexes.end.pos.colEnd<=l.character)):o!==void 0&&(e.getSortKey(c)??-1)<=o})}function G(n,e){return{start:n,end:e??n}}var L=(n,e)=>n?.tokens.some(t=>t===e),et=n=>e=>e?.value&&n===e.value?"yes":lx(n)(e),Re=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",lx=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",Tr=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&se(n.uri,e.uri),en=(n,e)=>!!n&&!!e&&Tr(n,e)&&n.pos.colEnd===e.pos.col,Qu=n=>n.map((e,t)=>({index:t,context:e,files:e.getContextFiles()})),Sr=(n,e,t,r)=>{if("id"in e){let i=n?.find(o=>o.id===e.id);return i||void 0}if("name"in e){let i=n?.find(o=>o.ctxNames.includes(e.name));return i||void 0}return t?.getContextFiles().find(i=>se(i,e.uri))?t:Qu(n).sort(i=>i.context.id===r?-1:0).find(i=>i.files.some(o=>se(o,e.uri)))?.context},Mm=(n,e)=>Qu(n).filter(r=>r.files.some(s=>se(s,e))).map(r=>r.context),KE=n=>{let e=/^(\w+)\s+(.+)$/,t=/^(\w+)\(([^)]*)\)\s+(.+)$/,r=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,s;if(s=r.exec(n)){let[,,i,o]=s,a=i.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(s=t.exec(n)){let[,,i,o]=s,a=i.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(s=e.exec(n)){let[,,i]=s;return i.trim()}},zE=(n,e)=>{let t=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),r=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),s=n,i;do i=s,s=t(i),s=r(s),s=s.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(s!==i);return s},ue=n=>Am.default.pathToFileURL(n).toString(),tt=n=>Je(Am.default.fileURLToPath(n)),se=(n,e)=>!n||!e?!1:n===e,Je=n=>(0,FE.normalize)(process.platform==="win32"?n.toLowerCase():n),Vr=n=>(0,jE.createHash)("sha256").update([Je(n.dtsFile),...n.includePaths.map(Je),...n.overlays.map(Je),n.bindingType,...n.zephyrBindings.map(Je),...n.deviceOrgBindingsMetaSchema.map(Je),...n.deviceOrgTreeBindings.map(Je)].join(":")).digest("hex");var Wr=H(J()),F=class{constructor(e){this._children=[];this._fisrtToken=e?.start,this._lastToken=e?.end}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(t=>t.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 t=Q(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Wr.SymbolKind.File,Wr.SymbolKind.Class,Wr.SymbolKind.Namespace].some(r=>r===e))return[];let t=Q(this);return[{location:Wr.Location.create(ue(this.uri),t),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(r=>r.getWorkspaceSymbols()??[]).filter(r=>r.kind===Wr.SymbolKind.File||r.kind===Wr.SymbolKind.Class||r.kind===Wr.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(si(this.semanticTokenType),ii(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}toPrettyString(e){return this.toString()}toString(e){return"TODO"}};var lo=H(J());var QE=H(J());var GE=H(J()),Oe=class extends F{constructor(t,r){super(r);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:GE.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}};var JE=H(J());var YE=H(J());function ux(n){return n.replace(/'(.)'/g,(e,t)=>t.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function xm(n){try{return(0,eval)(ux(n))}catch(e){console.log(e)}return n}var tr=class extends F{toJson(){return-1}resolve(e){return zE(this.toString(),e)}evaluate(e){return xm(this.resolve(e))}isTrue(e){return xm(`!!(${this.resolve(e)})`)}toPrettyString(e){let t=this.evaluate(e);return`${t.toString()} /* ${this.toString()}${typeof t=="number"?` = 0x${t.toString(16)}`:""} */`}},oi=class extends tr{constructor(t,r,s){super();this.expression=t;this.wrapped=r;this.join=s;this.addChild(t),s&&(this.addChild(s.operator),this.addChild(s.expression))}addExpression(t,r){this.addChild(t),this.addChild(r)}toString(){let t=this.children.map(r=>r.toString()).join(" ");return this.wrapped?`(${t})`:`${t}`}isTrue(t){let r=`(${this.children.map(s=>s instanceof tr?s.resolve(t):s.toString()).join(" ")})`;return xm(`!!${r}`)}};var kt=class extends tr{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:YE.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(t){return this.value.toString(t)}toJson(){return this.value}toPrettyString(t){let r=this.evaluate(t);return`${r.toString()} /* ${typeof r=="number"?`0x${r.toString(16)}`:""} */`}};var Tt=class extends F{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:JE.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}toPrettyString(t){return`<${this.values.map(r=>r.toPrettyString(t)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(t=>t.value instanceof kt)){let t=new ArrayBuffer(8),r=new DataView(t);return this.values.map(s=>s.value.value).forEach((s,i)=>{r.setUint32(i*4,s)}),r.getBigUint64(0)}return this.values.map(t=>t.value?.toJson()??NaN)}};var XE=H(J()),ms=class extends F{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:XE.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(t=>t.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(t=>t.value?.toJson()??NaN)}};var Fe=class extends F{constructor(t,r){super(r);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Ae=class extends F{constructor(t,r=[]){super();this.propertyName=t;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:QE.SymbolKind.Property},this.labels.forEach(s=>this.addChild(s)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof Oe?t.value.value:t.value instanceof Tt?t.value.values.map(r=>r.value instanceof kt?r.value.value:NaN):t.value instanceof ms?t.value.values.map(r=>r.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(t=>t?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(t){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toPrettyString(t)??"NULL").join(", ")??"NULL"}`:""};`}};var ZE=H(J()),tn=class extends F{constructor(t,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:t,kind:ZE.SymbolKind.Function}}};var pn=class extends tn{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var We=class extends tn{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var Be=class n extends F{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof pt)return[this.pathName];if(!(this.parentNode instanceof n))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof n)}get deleteNodes(){return this.children.filter(e=>e instanceof pn)}addNodeChild(e){this.addChild(e)}},pt=class extends Be{constructor(){super(),this.docSymbolsMeta={name:"/",kind:lo.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Ae)}get name(){return new Ie("/",G(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof We)}get nodes(){return this.children.filter(e=>e instanceof Ne)}get pathName(){return"/"}},At=class extends Be{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:lo.SymbolKind.Class},t.forEach(r=>{super.addChild(r)})}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:lo.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof Ne)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Ae)}get deleteProperties(){return this.children.filter(t=>t instanceof We)}},Ne=class n extends Be{constructor(t=[],r){super();this.labels=t;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:lo.SymbolKind.Class},r&&this.addChild(r),t.forEach(s=>{this.addChild(s)})}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:lo.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof n)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof Ae)}get deleteProperties(){return this.children.filter(t=>t instanceof We)}},Zu=class extends F{constructor(t,r){super(r);this.address=t;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address.toString(16)}},Ie=class extends F{constructor(t,r,s){super(r);this.name=t;this._address=s;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(t){if(this._address)throw new Error("Address can only be set once");t&&(this.lastToken=void 0,this._address=t,t.forEach(r=>this.addChild(r)))}toString(){return this._address!==void 0?`${this.name}@${this._address.map(t=>t.toString()).join(",")}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};t(si("type"),ii("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(s=>{t(si("decorator"),ii("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(t)})}};var ek=H(J()),ge=class extends F{constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:ek.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}};var rr=H(J());var Nt=n=>n instanceof tn?!0:n instanceof Be?!1:n.parentNode?Nt(n.parentNode):!1;var uo=n=>[...n.map(e=>{if(e instanceof Ne||e instanceof pt)return e.name;if(e instanceof At)return e.labelReference})].filter(e=>!!e),$m=(n,e)=>e?e.parentNode===n||$m(n,e.parentNode):!1;var ft=H(J());var tk=H(J());var Hr=class extends F{constructor(){super();this._pathParts=[]}addPath(t,r){this._pathParts.push(t),r&&this.addChild(r),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},kn=class extends F{constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:tk.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}};var ct=H(J());var ed=H(J());var nk=require("path"),gs=class extends F{constructor(t,r){super();this.keyword=t;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:ed.SymbolKind.File},this.addChild(t),this.addChild(r)}get resolvedPath(){return this._resolvedPath}set resolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:ed.SymbolKind.File},this._resolvedPath=t}},fo=class extends F{constructor(t,r,s){super(s);this._path=t;this.relative=r;this.docSymbolsMeta={name:(0,nk.basename)(this.path),kind:ed.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var _r=class extends F{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var dx=async(n,e,t)=>{let r=ct.Position.create(n.pos.line,n.pos.col),s=t.find(i=>En(i,e,r));if(s)return br(s,e,r)},Lm=n=>{if(n)return n instanceof Be?n:Lm(n?.parentNode)},po=(n,e,t=0)=>!e||!se(e.uri,n)?t:po(n,Lm(e.parentNode),t+1),fx=(n,e)=>async t=>{let r=await dx(t.firstToken,e,n);return!r||r===t||t.allDescendants.some(i=>i===r)?0:r instanceof Be?po(e,Lm(r)):void 0};async function rk(n,e){let t=[],r=tt(n.textDocument.uri),s=(await e.getRuntime()).fileTopMostAst(r);return t.push(...(await Promise.all(s.flatMap(async i=>await sk(n,i,r,fx(s,r))))).flat()),t}var ai=(n,e=1)=>{if(n.prevToken){let t=n.pos.line-n.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return ct.TextEdit.replace(ct.Range.create(ct.Position.create(n.prevToken.pos.line,n.prevToken.pos.colEnd),ct.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
|
|
183
|
+
`))}},ho=(n,e,t,r="")=>{if(n.pos.line===n.prevToken?.pos.line)return ct.TextEdit.replace(ct.Range.create(ct.Position.create(n.pos.line,n.pos.col),ct.Position.create(n.pos.line,n.pos.col)),`
|
|
184
|
+
${r}${"".padStart(e*t.length,t)}`)},ys=(n,e,t,r="")=>ct.TextEdit.replace(ct.Range.create(ct.Position.create(n.pos.line,0),ct.Position.create(n.pos.line,n.pos.col)),`${"".padStart(e*t.length,t)}${r}`),St=(n,e=1)=>{if(!n.nextToken)return[];if(n.nextToken?.pos.line!==n.pos.line){let r=ai(n.nextToken,0);if(!r)throw new Error("remove new LinesEdit must be defined");return[ct.TextEdit.insert(ct.Position.create(n.pos.line,n.pos.colEnd),"".padEnd(e," ")),r]}return n.nextToken.pos.col-n.pos.colEnd===e?[]:[ct.TextEdit.replace(ct.Range.create(ct.Position.create(n.pos.line,n.pos.colEnd),ct.Position.create(n.nextToken.pos.line,n.nextToken.pos.col)),"".padEnd(e," "))]},hx=async(n,e,t,r,s,i)=>{if(!se(e.uri,t))return[];let o=[],a=ho(e.firstToken,r,s);if(a)o.push(a);else{o.push(ys(e.firstToken,r,s));let l=ai(e.firstToken);l&&o.push(l)}if(e instanceof Ne||e instanceof At)if(o.push(...e.labels.flatMap(l=>St(l.lastToken))),e instanceof Ne){let l=e.name&&e.openScope?St(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?St(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>sk(n,l,t,i,r+1)))).flat()),e.closeScope){let l=ho(e.closeScope,r,s);if(l)o.push(l);else{o.push(ys(e.closeScope,r,s));let u=ai(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?St(e.lastToken.prevToken,0):[];return o.push(...c),o},px=(n,e,t,r)=>{let s=[];if(s.push(...St(n.lastToken,r?0:1)),n.firstToken.pos.line!==n.firstToken.prevToken?.pos.line){let i=ai(n.firstToken);i&&s.push(i),s.push(ys(n.firstToken,e+1,t))}return n.value,s},mx=(n,e,t,r)=>{let s=[];return n instanceof Tt||n instanceof ms?(n.openBracket&&s.push(...St(n.openBracket,0)),s.push(...n.values.flatMap((i,o)=>px(i,e,t,o+1===n.values.length&&n.lastToken.nextToken===n.closeBracket))),n.closeBracket&&n.closeBracket?.nextToken?.value!==";"&&n.openBracket&&s.push(...St(n.closeBracket,0))):n?.lastToken&&r&&s.push(...St(n.lastToken,n?.lastToken.nextToken?.value===","?0:1)),s},gx=(n,e,t,r)=>{let s=[];return s.push(...n.startLabels.flatMap((i,o)=>o+1===n.startLabels.length?[]:St(i.lastToken))),s.push(...mx(n.value,e,t,!r||n.endLabels.length>0)),s.push(...n.endLabels.flatMap((i,o)=>o+1===n.endLabels.length?[]:St(i.lastToken))),s},yx=(n,e,t)=>{let r=[],s=i=>{if(i&&En(n,n.uri,ct.Position.create(i.pos.line,i.pos.col)))return i.value===","?i:s(i.nextToken)};return n.values.forEach((i,o)=>{if(!i)return[];let a=s(i.lastToken),c=n.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)r.push(...St(a,1));else if(c?.firstToken){let l=ai(c?.firstToken);l&&r.push(l),r.push(ys(c?.firstToken,e+1,t))}}}),[...r,...n.values.flatMap((i,o)=>i?gx(i,e,t,o+1===n.values.length):[])]},vx=(n,e,t)=>{let r=[],s=ho(n.firstToken,e,t);if(s)r.push(s);else{r.push(ys(n.firstToken,e,t));let o=ai(n.firstToken);o&&r.push(o)}if(r.push(...n.labels.flatMap(o=>St(o.lastToken))),n.values){if(n.propertyName){r.push(...St(n.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(n.propertyName?.lastToken.nextToken);a&&r.push(...St(a))}r.push(...yx(n.values,e,t))}let i=n.lastToken.value===";"&&n.lastToken.prevToken?St(n.lastToken.prevToken,0):[];return r.push(...i),r},bx=(n,e,t)=>{let r=[],s=ho(n.firstToken,e,t);s?r.push(s):r.push(ys(n.firstToken,e,t));let i=St(n.keyword.lastToken);r.push(...i);let o=n.lastToken.value===";"&&n.lastToken.prevToken?St(n.lastToken.prevToken,0):[];return r.push(...o),r},Tx=(n,e,t,r)=>{if(t===void 0)return[];if(!se(n.uri,e))return[];let s=[],i=ho(n.firstToken,t,r);i?s.push(i):s.push(ys(n.firstToken,t,r));let o=St(n.keyword.lastToken);return s.push(...o),s},Sx=(n,e,t)=>{let r=[];if(n.lastToken.pos.line===n.lastToken.nextToken?.pos.line&&n.lastToken.nextToken.value!==";"&&r.push(...St(n.lastToken)),e!==void 0&&n.firstToken.pos.line===n.firstToken.prevToken?.pos.line&&n.firstToken.pos.line===n.lastToken.pos.line)return r.push(...St(n.firstToken.prevToken)),r;if(e===void 0)return r;let s=n.firstToken.value.startsWith("*")?" ":"",i=ho(n.firstToken,e,t,s);if(i)r.push(i);else{r.push(ys(n.firstToken,e,t,s));let o=ai(n.firstToken);o&&r.push(o)}return r},sk=async(n,e,t,r,s=0)=>{let i=n.options.tabSize,a=n.options.insertSpaces?"".padStart(i," "):" ";return UE(a),e instanceof Be?hx(n,e,t,s,a,r):e instanceof Ae?vx(e,s,a):e instanceof tn?bx(e,s,a):e instanceof gs?Tx(e,t,await r(e),a):e instanceof _r?Sx(e,await r(e),a):[]};function _x(n){switch(n){case 0:return"EMPTY";case 1:return"U32";case 2:return"U64";case 3:return"STRING";case 4:return"PROP_ENCODED_ARRAY";case 5:return"STRINGLIST";case 6:return"BYTESTRING";case 8:return"ANY";case 7:return"UNKNOWN"}}function wx(n){switch(n){case 0:return";";case 1:return" = <10>";case 2:return" = <10 20>";case 3:return' = "str"';case 4:return" = <10 20 30 ...>";case 5:return' = "str1" "str2"';case 6:return" = [10 20 .. ..]"}}var K=class{constructor(e,t,r="optional",s=void 0,i=[],o){this.name=e;this.type=t;this.def=s;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:ft.MarkupKind.Markdown,value:["### Type","**DTS native type** ",`${this.type.map(e=>e.types.map(_x).join(" or ")).join(",")}
|
|
185
|
+
|
|
186
|
+
`,...this.bindingType?["**Binding type** ",`${this.bindingType}
|
|
187
|
+
|
|
188
|
+
`]:[],"**Example** ","```",`${typeof this.name=="string"?this.name:"prop"}${this.typeExample?` = ${this.typeExample}`:`${this.type.map(e=>e.types.map(wx).join(" || ")).join(" ")}`};`,"```",...this.description?["### Description",this.description.join(`
|
|
185
189
|
|
|
186
190
|
`)]:[],...this.examples?["### Example",this.examples.join(`
|
|
187
191
|
|
|
188
192
|
`)]:[]].join(`
|
|
189
|
-
`)});typeof
|
|
190
|
-
${"".padEnd(so(u[p].uri,f)*Zi().length,Zi())}${n}${d};`))})]}return[]}let o=tx(s),a=[],c=(l,u,d)=>{if(d??=s.ast,!(l.some(p=>p==u)||l.some(p=>p==5)&&(u===3||u===5)||l.some(p=>p==4)&&(u===1||u===2))){let p=[];l.forEach(b=>{switch(b){case 0:p.push(1);break;case 3:p.push(2);break;case 5:p.push(3);break;case 1:p.push(5);break;case 2:p.push(6);break;case 4:p.push(7);break}}),p.length&&a.push(C(p,d,lt.DiagnosticSeverity.Error,[],[],[s.name]))}};if(this.type[0].types.some(l=>l===8))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(C(4,s.ast.values??s.ast,lt.DiagnosticSeverity.Error,[],[],[n,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push(C(3,s.ast.values?.values[d]??s.ast))})}else{this.type[0].types.some(u=>u===5)?o.some(u=>c([5],u,s.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(u=>u!==0).every(u=>u===4)?o.some(u=>c(this.type[0].types,u,s.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(u=>u!==0)?a.push(C(8,s.ast.propertyName??s.ast,lt.DiagnosticSeverity.Error,(s.ast.values?.values.slice(1)??[]).filter(u=>!!u),[],[s.name])):o.length===1&&c(this.type[0].types,o[0],s.ast.values?.values[0]?.value);let l=this.values(s);if(a.length===0&&(a.push(...this.additionalTypeCheck?.(s)??[]),l.length&&this.type[0].types.some(u=>u===3))){let u=s.ast.values?.values[0]?.value;l.some(d=>u.value===d)||a.push(C(9,s.ast.values?.values[0]?.value??s.ast,lt.DiagnosticSeverity.Error,[],[],[this.values(s).map(d=>`'${d}'`).join(" or ")]))}}return a}getPropertyCompletionItems(e,t,n){let s=this.type.at(t);return s?.types.some(i=>i===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:n?`${i}`:`"${i}"`,kind:lt.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):s?.types.some(i=>i===1||i===2)?this.values(e).map(i=>({label:n?`${i}`:`<${i}>`,kind:lt.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},tx=r=>r.ast.values?r.ast.values.values.map(e=>rx(e)):[0],rx=r=>r?r.value instanceof Oe?3:r.value instanceof yt?r.value.values.length===1?1:r.value.values.length===2?2:4:r.value instanceof _e||r.value instanceof Gr?1:6:7,ka=class{},Dr=class extends ka{constructor(t=()=>[]){super();this.additionalValidations=t;this._properties=[];this.noMismatchPropertiesAllowed=!1}getIssue(t,n){let s=[],i=n.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Oe&&o.value==="disabled")return[...n.definitions,...n.referencedBy].forEach(l=>s.push(C(22,l,lt.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[lt.DiagnosticTag.Unnecessary]))),s;let a=new Set,c=this.properties.flatMap(l=>{if(typeof l.name=="string"){let f=n.getProperty(l.name);return f&&a.add(f),l.validateProperty(t,n,l.name,f)}let u=n.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.filter(f=>d.some(p=>p.getNameMatch(f.name)))?[]:u.flatMap(f=>l.validateProperty(t,n,f.name,f))});return a.size!==n.property.length&&this.noMismatchPropertiesAllowed&&n.property.filter(u=>!a.has(u)).forEach(u=>{s.push(C(28,u.ast,lt.DiagnosticSeverity.Error,[],[],[u.name],lt.TextEdit.del(Ys(u.ast.firstToken.prevToken,u.ast.lastToken,!1))))}),[...s,...c,...this.additionalValidations(t,n)]}get properties(){return this._properties}addProperty(t){Array.isArray(t)?t.forEach(n=>this._properties.push(n)):this._properties.push(t),this._properties.sort(n=>typeof n.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(t){t&&(this._childNodeType=n=>{let s=t(n);return s.bindingsPath=this.bindingsPath,s})}getOnPropertyHover(t){let n=this.properties.find(s=>s.getNameMatch(t));return n?.onHover.bind(n)()}getPropertyListCompletionItems(t){return this.properties.filter(n=>!n.hideAutoComplete&&n.required(t)!=="omitted"&&typeof n.name=="string").map(n=>{let s=t&&n.required(t),i=!!t.property.some(a=>n.getNameMatch(a.name)),o="a";return s?o=i?"Y":"A":o=i?"Z":"B",{label:`${n.name}`,kind:lt.CompletionItemKind.Property,sortText:`${o}${n.name}`}})??[]}};var Zt=class extends F{constructor(t,n,s,i){super();this.startLabels=t;this.value=n;this.endLabels=s;this.bits=i;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(i),this.addChild(n),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var er=r=>{if(!r?.values.some(e=>!(e?.value instanceof yt)))return r?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Ce=(r,e,t)=>{let n=r.ast.values?.values.at(e)?.value;if(n instanceof yt){let s=n.values.at(t);if(s?.value instanceof _t)return s.value.value}},Yr=(r,e,t=0)=>{if(r instanceof Zt){if(r?.value instanceof yt){let n=r.value.values.at(t);if(n?.value instanceof _t)return e.getPhandle(n.value.value);if(n?.value instanceof _e)return n.value.linksTo;if(n?.value instanceof Gr)return n.value.path?.pathParts.at(-1)?.linksTo}}else{if(r instanceof _t)return e.getPhandle(r.value);if(r instanceof _e)return r.linksTo;if(r instanceof Gr)return r.path?.pathParts.at(-1)?.linksTo}},Kw=r=>{let e=r.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof yt){let n=t.values.at(0)?.value;if(n instanceof _t)return{cellsProperty:e,node:r,value:n.value}}return{cellsProperty:e,node:r}},V=r=>Array.isArray(r)?[{types:r}]:[{types:[r]}];var zw=()=>{let r=new H("compatible",V(5));return r.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."],r.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."],r};var io=z(J()),Gw=()=>{let r=new H("device_type",V(3),"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 t=e.ast.values?.values.at(0)?.value;if(t instanceof Oe&&t.value!==e.parent.name)return e.parent.name==="cpu"?[C(12,e.ast,io.DiagnosticSeverity.Error,[],[],[e.name])]:[C(13,e.ast,io.DiagnosticSeverity.Error,[],[],[e.name])]}return r.required(e.parent)!=="required"?[C(14,e.ast,io.DiagnosticSeverity.Hint,[],[io.DiagnosticTag.Deprecated],[e.name])]:[]});return r.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."],r};var Yw=()=>{let r=new H("#interrupt-cells",V(1));return r.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],r};var Jw=()=>{let r=new H("interrupt-controller",V(0),"optional");return r.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],r};var Xw=()=>{let r=new H("interrupt-parent",V(1));return r.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."],r};var Qw=z(J()),Zw=()=>{let r=new H("interrupts",V(4),"optional",void 0,[],e=>{let t=[],n=e.parent,s=n.getProperty("interrupt-parent"),i=n.root;return(s?Yr(s?.ast.values?.values.at(0),i):n.parent)?t:s?(t.push(C(18,s.ast.values?.values.at(0)?.value??s.ast)),t):(t.push(C(16,e.ast,Qw.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return r.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."],r.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```"],r};var oo=z(J()),eE=()=>{let r=new H("interrupts-extended",V(4),"optional",void 0,[],e=>{let t=[],n=e.parent,s=n.getProperty("interrupts");s&&t.push(C(15,s.ast,oo.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let i=n.getProperty("interrupt-parent");i&&t.push(C(15,i.ast,oo.DiagnosticSeverity.Warning,[e.ast],[],[i.name,"is ignored when 'interrupts-extended' is used"]));let o=n.root,a=er(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=Yr(a[c],o);if(!l)return t.push(C(18,a[c],oo.DiagnosticSeverity.Error)),t;let u=Kw(l);if(!u.cellsProperty)return t.push(C(16,e.ast,oo.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(C(17,a[c],oo.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return r.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."],r.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```"],r};var tE=()=>{let r=new H("dma-noncoherent",V(0));return r.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."],r};var rE=()=>{let r=new H("dma-coherent",V(0));return r.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."],r};var nE=z(J()),sE=()=>{let r=new H("dma-ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],n=er(e.ast.values);if(!n?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Ce(s,0,0)??1:1,c=i?Ce(i,0,0)??2:2,l=o?Ce(o,0,0)??2:2;return(n.length===0||n.length%(c+l+a)!==0)&&t.push(C(20,n.at(n.length-n.length%(c+l+a))??e.ast,nE.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return r.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)."],r};var iE=z(J()),Uu=()=>{let r=new H("ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],n=er(e.ast.values);if(!n?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Ce(s,0,0)??1:1,c=i?Ce(i,0,0)??2:2,l=o?Ce(o,0,0)??2:2;return(n.length===0||n.length%(c+l+a)!==0)&&t.push(C(20,n.at(n.length-n.length%(c+l+a))??e.ast,iE.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return r.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."],r.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
193
|
+
`)});typeof r!="function"?this.required=()=>r:this.required=r,typeof i!="function"?this.values=()=>s&&i.indexOf(s)===-1?[s,...i]:i:this.values=i}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name(e)}validateProperty(e,t,r,s){let i=this.required(t);if(s){if(i==="omitted")return[C(11,s.ast,ft.DiagnosticSeverity.Error,void 0,[],[r])]}else{if(i==="required"){let l=e.getOrderedNodeAst(t),u=uo(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case 1:case 2:case 4:d=" = <>";break;case 3:case 5:d=' = ""';break;case 6:d=" = []";break}return[...l.map((f,p)=>{let b=f.openScope??u[p].lastToken;return C(0,u[p],ft.DiagnosticSeverity.Error,[],[],[r],ft.TextEdit.insert(ft.Position.create(b.pos.line,b.pos.col+1),`
|
|
194
|
+
${"".padEnd(po(u[p].uri,f)*co().length,co())}${r}${d};`))})]}return[]}let o=Ex(s),a=[],c=(l,u,d)=>{if(d??=s.ast,!(l.some(p=>p==u)||l.some(p=>p==5)&&(u===3||u===5)||l.some(p=>p==4)&&(u===1||u===2))){let p=[];l.forEach(b=>{switch(b){case 0:p.push(1);break;case 3:p.push(2);break;case 5:p.push(3);break;case 1:p.push(5);break;case 2:p.push(6);break;case 4:p.push(7);break}}),p.length&&a.push(C(p,d,ft.DiagnosticSeverity.Error,[],[],[s.name]))}};if(this.type[0].types.some(l=>l===8))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(C(4,s.ast.values??s.ast,ft.DiagnosticSeverity.Error,[],[],[r,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push(C(3,s.ast.values?.values[d]??s.ast))})}else{this.type[0].types.some(u=>u===5)?o.some(u=>c([5],u,s.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(u=>u!==0).every(u=>u===4)?o.some(u=>c(this.type[0].types,u,s.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(u=>u!==0)?a.push(C(8,s.ast.propertyName??s.ast,ft.DiagnosticSeverity.Error,(s.ast.values?.values.slice(1)??[]).filter(u=>!!u),[],[s.name])):o.length===1&&c(this.type[0].types,o[0],s.ast.values?.values[0]?.value);let l=this.values(s);if(a.length===0&&(a.push(...this.additionalTypeCheck?.(s)??[]),l.length&&this.type[0].types.some(u=>u===3))){let u=s.ast.values?.values[0]?.value;l.some(d=>u.value===d)||a.push(C(9,s.ast.values?.values[0]?.value??s.ast,ft.DiagnosticSeverity.Error,[],[],[this.values(s).map(d=>`'${d}'`).join(" or ")]))}}return a}getPropertyCompletionItems(e,t,r){let s=this.type.at(t);return s?.types.some(i=>i===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:r?`${i}`:`"${i}"`,kind:ft.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):s?.types.some(i=>i===1||i===2)?this.values(e).map(i=>({label:r?`${i}`:`<${i}>`,kind:ft.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},Ex=n=>n.ast.values?n.ast.values.values.map(e=>kx(e)):[0],kx=n=>n?n.value instanceof Oe?3:n.value instanceof Tt?n.value.values.length===1?1:n.value.values.length===2?2:4:n.value instanceof ge||n.value instanceof kn?1:6:7,Aa=class{},$n=class extends Aa{constructor(t=()=>[]){super();this.additionalValidations=t;this._properties=[];this.noMismatchPropertiesAllowed=!1}getIssue(t,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Oe&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(l=>s.push(C(22,l,ft.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[ft.DiagnosticTag.Unnecessary]))),s;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(t,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.filter(f=>d.some(p=>p.getNameMatch(f.name)))?[]:u.flatMap(f=>l.validateProperty(t,r,f.name,f))});return a.size!==r.property.length&&this.noMismatchPropertiesAllowed&&r.property.filter(u=>!a.has(u)).forEach(u=>{s.push(C(28,u.ast,ft.DiagnosticSeverity.Error,[],[],[u.name],ft.TextEdit.del(ri(u.ast.firstToken.prevToken,u.ast.lastToken,!1))))}),[...s,...c,...this.additionalValidations(t,r)]}get properties(){return this._properties}addProperty(t){Array.isArray(t)?t.forEach(r=>this._properties.push(r)):this._properties.push(t),this._properties.sort((r,s)=>typeof r.name=="string"&&typeof s.name=="string"||typeof r.name!="string"&&typeof s.name!="string"?0:typeof r.name=="string"?-1:1)}get childNodeType(){return this._childNodeType}set childNodeType(t){t&&(this._childNodeType=r=>{let s=t(r);return s.bindingsPath=this.bindingsPath,s})}getOnPropertyHover(t){let r=this.properties.find(s=>s.getNameMatch(t));return r?.onHover.bind(r)()}getPropertyListCompletionItems(t){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(t)!=="omitted"&&typeof r.name=="string").map(r=>{let s=t&&r.required(t),i=!!t.property.some(a=>r.getNameMatch(a.name)),o="a";return s?o=i?"Y":"A":o=i?"Z":"B",{label:`${r.name}`,kind:ft.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var nn=class extends F{constructor(t,r,s,i){super();this.startLabels=t;this.value=r;this.endLabels=s;this.bits=i;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(i),this.addChild(r),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}toPrettyString(t){return`${[this.value?.toPrettyString(t)??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var rn=n=>{if(!n?.values.some(e=>!(e?.value instanceof Tt)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Ce=(n,e,t)=>{let r=n.ast.values?.values.at(e)?.value;if(r instanceof Tt){let s=r.values.at(t);if(s?.value instanceof kt)return s.value.value}},nr=(n,e,t=0)=>{if(n instanceof nn){if(n?.value instanceof Tt){let r=n.value.values.at(t);if(r?.value instanceof kt)return e.getPhandle(r.value.value);if(r?.value instanceof ge)return r.value.linksTo;if(r?.value instanceof kn)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof kt)return e.getPhandle(n.value);if(n instanceof ge)return n.linksTo;if(n instanceof kn)return n.path?.pathParts.at(-1)?.linksTo}},ik=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof Tt){let r=t.values.at(0)?.value;if(r instanceof kt)return{cellsProperty:e,node:n,value:r.value}}return{cellsProperty:e,node:n}},V=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var ok=()=>{let n=new K("compatible",V(5));return n.description=["The compatible property value consists of one or more strings that define the specific programming model for the device. This list of strings should be used by a client program for device driver selection. The property value consists of a concatenated list of null terminated strings, from most specific to most general. They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices.",'The recommended format is "manufacturer, model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.',"The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter. A single comma is typically only used following a vendor prefix. Underscores should not be used."],n.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],n};var mo=H(J()),ak=()=>{let n=new K("device_type",V(3),"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 t=e.ast.values?.values.at(0)?.value;if(t instanceof Oe&&t.value!==e.parent.name)return e.parent.name==="cpu"?[C(12,e.ast,mo.DiagnosticSeverity.Error,[],[],[e.name])]:[C(13,e.ast,mo.DiagnosticSeverity.Error,[],[],[e.name])]}return n.required(e.parent)!=="required"?[C(14,e.ast,mo.DiagnosticSeverity.Hint,[],[mo.DiagnosticTag.Deprecated],[e.name])]:[]});return n.description=["The device_type property was used in IEEE 1275 to describe the device's FCode programming model. Because DTSpec does not have FCode, new use of the property is deprecated, and it should be included only on cpu and memory nodes for compatibility with IEEE 1275-derived devicetrees."],n};var ck=()=>{let n=new K("#interrupt-cells",V(1));return n.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var lk=()=>{let n=new K("interrupt-controller",V(0),"optional");return n.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var uk=()=>{let n=new K("interrupt-parent",V(1));return n.description=["Because the hierarchy of the nodes in the interrupt tree might not match the devicetree, the interrupt-parent property is available to make the definition of an interrupt parent explicit. The value is the phandle to the interrupt parent. If this property is missing from a device, its interrupt parent is assumed to be its devicetree parent."],n};var dk=H(J()),fk=()=>{let n=new K("interrupts",V(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=r.getProperty("interrupt-parent"),i=r.root;return(s?nr(s?.ast.values?.values.at(0),i):r.parent)?t:s?(t.push(C(18,s.ast.values?.values.at(0)?.value??s.ast)),t):(t.push(C(16,e.ast,dk.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.description=["The interrupts property of a device node defines the interrupt or interrupts that are generated by the device.The value of the interrupts property consists of an arbitrary number of interrupt specifiers. The format of an interrupt specifier is defined by the binding of the interrupt domain root.","interrupts is overridden by the interrupts-extended property and normally only one or the other should be used."],n.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],n};var go=H(J()),hk=()=>{let n=new K("interrupts-extended",V(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=r.getProperty("interrupts");s&&t.push(C(15,s.ast,go.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let i=r.getProperty("interrupt-parent");i&&t.push(C(15,i.ast,go.DiagnosticSeverity.Warning,[e.ast],[],[i.name,"is ignored when 'interrupts-extended' is used"]));let o=r.root,a=rn(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=nr(a[c],o);if(!l)return t.push(C(18,a[c],go.DiagnosticSeverity.Error)),t;let u=ik(l);if(!u.cellsProperty)return t.push(C(16,e.ast,go.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(C(17,a[c],go.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.description=["The interrupts-extended property lists the interrupts) generated by a device. interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers as it encodes a parent phandle with each interrupt specifier.","The interrupts and interrupts-extended properties are mutually exclusive. A device node should use one or the other, but not both. Using both is only permissible when required for compatibility with software that does not understand interrupts-extended. If both interrupts-extended and interrupts are present then interrupts-extended takes precedence."],n.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],n};var pk=()=>{let n=new K("dma-noncoherent",V(0));return n.description=["For architectures which are by default coherent for 1/O, the dma-noncoherent property is used to indicate a device is not capable of coherent DMA operations. Some architectures have non-coherent DMA by default and this property is not applicable."],n};var mk=()=>{let n=new K("dma-coherent",V(0));return n.description=["For architectures which are by default non-coherent for I/O, the dma-coherent property is used to indicate a device is capable of coherent DMA operations. Some architectures have coherent DMA by default and this property is not applicable."],n};var gk=H(J()),yk=()=>{let n=new K("dma-ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],r=rn(e.ast.values);if(!r?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Ce(s,0,0)??1:1,c=i?Ce(i,0,0)??2:2,l=o?Ce(o,0,0)??2:2;return(r.length===0||r.length%(c+l+a)!==0)&&t.push(C(20,r.at(r.length-r.length%(c+l+a))??e.ast,gk.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.description=["The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus whose devicetree parent can be accessed from DMA operations originating from the bus. It provides a means of defining a mapping or translation between the physical address space of the bus and the physical address space of the parent of the bus.","The format of the value of the dma-ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length). Each triplet specified describes a contiguous DMA address range.","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address depends on the bus and can be determined from the #address-cells of this node (the node in which the dma-ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the dma-ranges property appears)."],n};var vk=H(J()),td=()=>{let n=new K("ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],r=rn(e.ast.values);if(!r?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Ce(s,0,0)??1:1,c=i?Ce(i,0,0)??2:2,l=o?Ce(o,0,0)??2:2;return(r.length===0||r.length%(c+l+a)!==0)&&t.push(C(20,r.at(r.length-r.length%(c+l+a))??e.ast,vk.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.description=["The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node's parent (the parent address space).","The format of the value of the ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length)","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address is bus dependent and can be determined from the #address-cells of this node (the node in which the ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the ranges property appears).","If the property is defined with an < empty> value, it specifies that the parent and child address space is identical, and no address translation is required.","If the property is not present in a bus node, it is assumed that no mapping exists between children of the node and the parent address space."],n.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
191
195
|
compatible = "simple-bus";
|
|
192
196
|
#address-cells = <1>;
|
|
193
197
|
#size-cells = <1>;
|
|
@@ -202,7 +206,7 @@ ${"".padEnd(so(u[p].uri,f)*Zi().length,Zi())}${n}${d};`))})]}return[]}let o=tx(s
|
|
|
202
206
|
};
|
|
203
207
|
};`,"```"].join(`
|
|
204
208
|
`),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
|
|
205
|
-
`),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],
|
|
209
|
+
`),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],n};var bk=()=>{let n=new K("virtual-reg",V(1));return n.description=["The virtual-res property specifies an effective address that maps to the first physical address specified in the reg property of the device node. This property enables boot programs to provide client programs with virtual-to-physical mappings that have been set up."],n};var nd=H(J()),Tk=()=>{let n=new K("reg",V(4),e=>e.address!==void 0?"required":"omitted",void 0,[],e=>{let t=[],r=rn(e.ast.values);if(!r)return[];let s=e.parent.parent?.getProperty("#size-cells"),i=e.parent.parent?.getProperty("#address-cells"),o=s?Ce(s,0,0)??1:1,a=i?Ce(i,0,0)??2:2;if(n.typeExample=`<${[...Array.from({length:a},()=>"address"),...Array.from({length:o},()=>"cell")].join(" ")}>`,r.length===0||r.length%(o+a)!==0)return t.push(C(20,r.at(r.length-r.length%(o+a))??e.ast,nd.DiagnosticSeverity.Error,[],[],[e.name,n.typeExample])),t;for(let c=0;c<r.length;c+=o+a){let l=new ArrayBuffer(a*4),u=new DataView(l);r.slice(0,a).map((d,f)=>Ce(e,0,f)??0).forEach((d,f)=>{u.setUint32(f*4,d)}),e.parent.address&&e.parent.address?.length>1?e.parent.address?.forEach((d,f)=>{u.getUint32(f*4)!==d&&t.push(C(10,e.ast,nd.DiagnosticSeverity.Error,[],[],[e.name]))}):e.parent.address?.length===1&&(a===2&&u.getBigUint64(0)!==BigInt(e.parent.address[0])||a===1&&u.getUint32(0)!==e.parent.address[0])&&t.push(C(10,e.ast,nd.DiagnosticSeverity.Error,[],[],[e.name]))}return t});return n.examples=["Suppose a device within a system-on-a-chip had two blocks of registers, a 32-byte block at offset 0x3000 in the SOC and a 256-byte block at offset OxFE00. The reg property would be encoded as follows (assuming #address-cells and #size-cells values of 1):","```devicetree\nreg = <0x3000 0x20 0xFE00 0x100>;\n```"],n};var rd=()=>new K("#size-cells",V(1),"optional",1);var sd=()=>{let n=new K("#address-cells",V(1),"optional",2);return n.description=["The #address-cells and #size-cells properties may be used in any device node that has children in the devicetree hierarchy and describes how child device nodes should be addressed. The #address-cells property defines the number of <u32> cells used to encode the address field in a child node's reg property. The #size-cells property defines the number of <u32 > cells used to encode the size field in a child node's reg property.","The #address-cells and #size-cells properties are not inherited from ancestors in the devicetree. They shall be explicitly defined.","A DTSpec-compliant boot program shall supply #address-cells and #size-cells on all nodes that have children.","If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."],n.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
|
|
206
210
|
#address-cells = <1>;
|
|
207
211
|
#size-cells = <1>;
|
|
208
212
|
serial@4600 {
|
|
@@ -213,8 +217,8 @@ ${"".padEnd(so(u[p].uri,f)*Zi().length,Zi())}${n}${d};`))})]}return[]}let o=tx(s
|
|
|
213
217
|
interrupt-parent = <&ipic>;
|
|
214
218
|
};
|
|
215
219
|
};`,"```"].join(`
|
|
216
|
-
`),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],
|
|
217
|
-
The lack of a status property should betreated as if the property existed with the value of "okay"`],
|
|
220
|
+
`),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],n};var Sk=()=>{let n=new K("status",V(3),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return n.description=[`The status property indicates the operational status of a device.
|
|
221
|
+
The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var _k=H(J()),wk=()=>{let n=new K("phandle",V(1),"optional",void 0,[],e=>{let t=Ce(e,0,0);if(t){let r=e.parent.root.getAllPhandle(t);if(r.length>1&&r.at(-1)===e.parent)return[C(19,e.ast.values?.values.at(0)??e.ast,_k.DiagnosticSeverity.Error,r.slice(0,-1).flatMap(s=>s.getProperty("phandle")?.ast).filter(s=>!!s),[],[e.name])]}return[]});return n.description=["The phandle property specifies a numerical identifier for a node that is unique within the devicetree. The phandle property value is used by other nodes that need to refer to the node associated with the property."],n.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
|
|
218
222
|
phandle = <1>;
|
|
219
223
|
interrupt-controller;
|
|
220
224
|
reg = <0x10000000 0x100>;
|
|
@@ -222,53 +226,65 @@ ${"".padEnd(so(u[p].uri,f)*Zi().length,Zi())}${n}${d};`))})]}return[]}let o=tx(s
|
|
|
222
226
|
`),"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 {
|
|
223
227
|
interrupt-parent = <1>;
|
|
224
228
|
};`,"```"].join(`
|
|
225
|
-
`)],r};var dE=()=>{let r=new H("model",V(3));return r.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.'],r.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],r};var Ku=z(J()),fE=()=>{let r=new H("name",V(3),"optional",void 0,[],e=>[C(14,e.ast,Ku.DiagnosticSeverity.Warning,[],[Ku.DiagnosticTag.Deprecated],[e.name])]);return r.hideAutoComplete=!0,r};var ao=z(J());var hE=()=>{let r=new H("interrupt-map",V(4),"optional",void 0,[],e=>{let t=[],n=e.parent,s=e.parent.root,i=er(e.ast.values);if(!i?.length)return[];let o=n.getProperty("#address-cells"),a=n.getProperty("#interrupt-cells");if(!a)return t.push(C(16,e.ast,ao.DiagnosticSeverity.Error,[...n.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${n.path.slice(1).join("/")}`])),t;let c=0;for(;c<i.length;){let l=o?Ce(o,0,0):2,u=Ce(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,i.length<c+1){let w=l+u+1;t.push(C(21,i[i.length-1],ao.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((i.length-d)%w===0?w:(i.length-d)%w).join(" ")}`]));break}let f=Yr(i[c],s);if(!f){t.push(C(18,i[c],ao.DiagnosticSeverity.Error));break}let p=f.getProperty("#address-cells"),b=f.getProperty("#interrupt-cells");if(!b){t.push(C(16,i[c],ao.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${n.path.slice(1).join("/")}`]));break}c++;let g=p?Ce(p,0,0):2,_=Ce(b,0,0);if(g==null||_==null)break;if(c+=g+_,i.length<c){let w=l+u+1+g+_;t.push(C(21,i[i.length-1],ao.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:g},()=>"ParentUnitAddress"),...Array.from({length:_},()=>"ParentInterruptSpecifier")].slice((i.length-d)%w===0?w:(i.length-d)%w).join(" ")}`]));break}d=c}if(!e.ast.values)return[];for(let l=0;l<e.ast.values.values.length;l++){let u=e.ast.values.values.at(l);if(!u)continue;if(t.length)return t;let d=Ce(o,0,0),f=Ce(a,0,0);if(d==null||f==null||!(u.value instanceof yt))return t}return t});return r.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."],r};var pE=()=>{let r=new H("interrupt-map-mask",V(4));return r.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."],r};var co=z(J()),mE=()=>{let r=new H(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),V(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],n=[],s=e.parent,i=e.parent.root,o=s.getProperty(`#${t}-cells`);if(!o)return n.push(C(16,e.ast,co.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),n;let a=Ce(o,0,0);if(a==null)return n;let c=er(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,c.length<l+1){let b=a+1;n.push(C(21,c[c.length-1],co.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%b===0?b:(c.length-u)%b).join(" ")}`]));break}let d=Yr(c[l],i);if(!d){n.push(C(18,c[l],co.DiagnosticSeverity.Error));break}let f=d.getProperty(`#${t}-cells`);if(!f)return n.push(C(16,c[l],co.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),n;l++;let p=Ce(f,0,0);if(p==null)break;if(l+=p,c.length<l){let b=a+1+p;n.push(C(21,c[c.length-1],co.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:p},()=>"ParentSpecifier")].slice((c.length-u)%b===0?b:(c.length-u)%b).join(" ")}`]));break}u=l}return n});return r.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."],r.list=!0,r};var gE=()=>{let r=new H(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),V(4));return r.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."],r};var yE=()=>{let r=new H(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),V(4));return r.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."],r};var vE=()=>{let r=new H(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),V(1));return r.list=!0,r.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],r};function Or(){let r=new Dr;return r.addProperty([zw(),dE(),uE(),cE(),Hu(),Wu(),aE(),oE(),Uu(),sE(),rE(),tE(),fE(),Gw(),Zw(),Xw(),eE(),Yw(),Jw(),hE(),pE(),mE(),gE(),yE(),vE()]),r}var bE=()=>{let r=new H("chassis-type",V(3),"optional",void 0,["desktop","laptop","convertible","server","tablet","handset","watch","embedded"]);return r.description=[`Specifiesastringthatidentifiestheform-factor
|
|
226
|
-
of the system.`],
|
|
227
|
-
rialnumber.`],
|
|
229
|
+
`)],n};var Ek=()=>{let n=new K("model",V(3));return n.description=["The model property value is a <string> that specifies the manufacturer's model number of the device.",'The recommended format is: "manufacturer, model" , where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.'],n.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],n};var id=H(J()),kk=()=>{let n=new K("name",V(3),"optional",void 0,[],e=>[C(14,e.ast,id.DiagnosticSeverity.Warning,[],[id.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var yo=H(J());var Nk=()=>{let n=new K("interrupt-map",V(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=e.parent.root,i=rn(e.ast.values);if(!i?.length)return[];let o=r.getProperty("#address-cells"),a=r.getProperty("#interrupt-cells");if(!a)return t.push(C(16,e.ast,yo.DiagnosticSeverity.Error,[...r.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${r.path.slice(1).join("/")}`])),t;let c=0;for(;c<i.length;){let l=o?Ce(o,0,0):2,u=Ce(a,0,0);if(l==null||u==null)return t;let d=0;c+=l+u;let f=l+u+1;if(n.typeExample??="",n.typeExample+=`<${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].join(" ")}> `,i.length<c+1){t.push(C(21,i[i.length-1],yo.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((i.length-d)%f===0?f:(i.length-d)%f).join(" ")}`]));break}let p=nr(i[c],s);if(!p){t.push(C(18,i[c],yo.DiagnosticSeverity.Error));break}let b=p.getProperty("#address-cells"),g=p.getProperty("#interrupt-cells");if(!g){t.push(C(16,i[c],yo.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${r.path.slice(1).join("/")}`]));break}c++;let S=b?Ce(b,0,0):2,E=Ce(g,0,0);if(S==null||E==null)break;if(c+=S+E,i.length<c){let T=l+u+1+S+E;t.push(C(21,i[i.length-1],yo.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:S},()=>"ParentUnitAddress"),...Array.from({length:E},()=>"ParentInterruptSpecifier")].slice((i.length-d)%T===0?T:(i.length-d)%T).join(" ")}`]));break}d=c}if(!e.ast.values)return[];for(let l=0;l<e.ast.values.values.length;l++){let u=e.ast.values.values.at(l);if(!u)continue;if(t.length)return t;let d=Ce(o,0,0),f=Ce(a,0,0);if(d==null||f==null||!(u.value instanceof Tt))return t}return t});return n.description=["An interrupt-map is a property on a nexus node that bridges one interrupt domain with a set of parent interrupt domains and specifies how interrupt specifiers in the child domain are mapped to their respective parent domains.","The interrupt map is a table where each row is a mapping entry consisting of five components: child unit address, child interrupt specifier, interrupt-parent, parent unit address, parent interrupt specifier.","- child unit address: The unit address of the child node being mapped. The number of 32-bit cells required to specify this is described by the #address-cells property of the bus node on which the child is located.","- child interrupt specifier: The interrupt specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of this node-the nexus node containing the interrupt-map property.","- interrupt-parent: A single <phandle > value that points to the interrupt parent to which the child domain is being mapped.","- parent unit address: The unit address in the domain of the interrupt parent. The number of 32-bit cells required to specify this address is described by the #address-cells property of the node pointed to by the interrupt-parent field.","- parent interrupt specifier: The interrupt specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of the node pointed to by the interrupt-parent field.","Lookups are performed on the interrupt mapping table by matching a unit-address/interrupt specifier pair against the child components in the interrupt-map. Because some fields in the unit interrupt specifier may not be relevant, a mask is applied before the lookup is done. This mask is defined in the interrupt-map-mask property","Note: Both the child node and the interrupt parent node are required to have #address-cells and #interrupt-cells properties defined. If a unit address component is not required ,#address-cells shall be explicitly defined to be zero."],n};var Pk=()=>{let n=new K("interrupt-map-mask",V(4));return n.description=["An interrupt-map-mask property is specified for a nexus node in the interrupt tree. This property specifies a mask that is ANDed with the incoming unit interrupt specifier being looked up in the table specified in the interrupt-mapproperty."],n};var vo=H(J()),Rk=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),V(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],r=[],s=e.parent,i=e.parent.root,o=s.getProperty(`#${t}-cells`);if(!o)return r.push(C(16,e.ast,vo.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),r;let a=Ce(o,0,0);if(a==null)return r;let c=rn(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,n.typeExample??="",n.typeExample+=`<${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier"].join(" ")}> `,c.length<l+1){let b=a+1;r.push(C(21,c[c.length-1],vo.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%b===0?b:(c.length-u)%b).join(" ")}`]));break}let d=nr(c[l],i);if(!d){r.push(C(18,c[l],vo.DiagnosticSeverity.Error));break}let f=d.getProperty(`#${t}-cells`);if(!f)return r.push(C(16,c[l],vo.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),r;l++;let p=Ce(f,0,0);if(p==null)break;if(l+=p,c.length<l){let b=a+1+p;r.push(C(21,c[c.length-1],vo.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:p},()=>"ParentSpecifier")].slice((c.length-u)%b===0?b:(c.length-u)%b).join(" ")}`]));break}u=l}return n.typeExample??=`<${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier"].join(" ")}>`,r});return n.description=["A `\u2039specifier>-map` is a property in a nexus node that bridges one specifier domain with a set of parent specifier domains and describes how specifiers in the child domain are mapped to their respective parent domains.","The map is a table where each row is a mapping entry consisting of three components: child specifier, specifier parent, and parent specifier.","- child specifier The specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of this node-the nexus node containing the \u2039specifier>-map property.","- Specifier parent A single <phandle > value that points to the specifier parent to which the child domain is being mapped.","- Parent specifier: The specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of the specifier parent node.","Lookups are performed on the mapping table by matching a specifier against the child specifier in the map. Because some fields in the specifier may not be relevant or need to be modified, a mask is applied before the lookup is done. This mask is defined in the `<specifier>-map-mask` property","Similarly, when the specifier is mapped, some fields in the unit specifier may need to be kept unmodified and passed through from the child node to the parent node. In this case, a `<specifier>-map-pass-thru` property may be specified to apply a mask to the child specifier and copy any bits that match to the parent unit specifier."],n.list=!0,n};var Ck=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),V(4));return n.description=["A `<specifier>-map-mask` property may be specified for a nexus node. This property specifies a mask that is ANDed with the child unit specifier being looked up in the table specified in the `<specifier>-map` property. If this propertyis notspecified, the maskis assumedto be a mask with all bits set."],n};var Dk=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),V(4));return n.description=["A `<specifier>-map-pass-thru` property may be specified for a nexus node. This property specifies a mask that is applied to the child unit specifier being looked up in the table specified in the `<specifier>-map` property. Any matching bits in the child unit specifier are copied over to the parent specifier. If this property is not specified, the mask isassumedtobe amaskwithno bits set."],n};var Ok=()=>{let n=new K(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),V(1));return n.list=!0,n.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function Ln(){let n=new $n;return n.addProperty([ok(),Ek(),wk(),Sk(),sd(),rd(),Tk(),bk(),td(),yk(),mk(),pk(),kk(),ak(),fk(),uk(),hk(),ck(),lk(),Nk(),Pk(),Rk(),Ck(),Dk(),Ok()]),n}var Ak=()=>{let n=new K("chassis-type",V(3),"optional",void 0,["desktop","laptop","convertible","server","tablet","handset","watch","embedded"]);return n.description=[`Specifiesastringthatidentifiestheform-factor
|
|
230
|
+
of the system.`],n};var Ik=()=>{let n=new K("serial-number",V(3),"optional");return n.description=[`Specifies a string representing the device\u2019s se-
|
|
231
|
+
rialnumber.`],n};function Mk(){let n=Ln();n.noMismatchPropertiesAllowed=!0;let e=n.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let t=n.properties.find(i=>i.name==="#size-cells");t.required=()=>"required";let r=n.properties.find(i=>i.name==="model");r.required=()=>"required";let s=n.properties.find(i=>i.name==="compatible");return s.required=()=>"required",n.addProperty([Ak(),Ik()]),n}var vs=H(J());function xk(){let n=new $n((t,r)=>{let s=[];return r.parent?.name!=="/"&&s.push(C(27,r.definitions[0],vs.DiagnosticSeverity.Error,r.definitions.slice(1),[],["Aliases node can only be added to a root node"])),r.nodes.forEach(i=>{i.definitions.forEach(o=>{s.push(C(27,o,vs.DiagnosticSeverity.Error,[],[],["Aliases node can not have child nodes"],vs.TextEdit.del(ri(o.firstToken.prevToken,o.lastToken,!1)),"Delete Node"))})}),s});n.noMismatchPropertiesAllowed=!0;let e=new K(t=>!!t.match(/^[-A-Za-z0-9]+$/),V([3,1]),void 0,void 0,void 0,t=>{let r=[],s=t.ast.quickValues;if(s?.length===1&&typeof s[0]=="string"){if(!s[0].startsWith("/"))return r.push(C(24,t.ast.values??t.ast,vs.DiagnosticSeverity.Error,[],[],[s[0],t.name])),r;if(s[0].trim().endsWith("/"))return r.push(C(24,t.ast.values??t.ast,vs.DiagnosticSeverity.Error,[],[],["",s[0]])),r;let i=t.parent.root,o=s[0].split("/").slice(1);for(;o[0];){let a=i,c=o.splice(0,1)[0],[l,u]=c.split("@"),d=u?.split(",").map(f=>Number.parseInt(f,16));if(i=l?a.getNode(l,d,!1):void 0,!i){r.push(C(24,t.ast.values??t.ast,vs.DiagnosticSeverity.Error,[],[],[l,a.fullName]));break}}}return r});return e.description=["Each property of the /aliases node defines an alias."],n.addProperty([e]),n}function $k(){let n=Ln();n.noMismatchPropertiesAllowed=!0;let e=n.properties.find(t=>t.name==="reg");return e.required=()=>"required",n}var qk=H(J());var Lk=(n,e)=>{let t=n?.(e)??[],r=e.parent.root.getProperty(e.name),s=r?Ce(r,0,0):void 0,i=e.parent.getProperty(e.name);return(i?Ce(i,0,0):void 0)!==s&&t.push(C(29,e.ast,qk.DiagnosticSeverity.Error,[...r?.ast?[r.ast]:[]],void 0,[`${e.name} value in this node must match value of root node`])),t};function jk(){let n=new $n;n.noMismatchPropertiesAllowed=!0;let e=sd(),t=e?.additionalTypeCheck;e.additionalTypeCheck=o=>Lk(t,o),e.required=()=>"required";let r=rd(),s=r?.additionalTypeCheck;r.additionalTypeCheck=o=>Lk(s,o),r.required=()=>"required";let i=td();return i.required=()=>"required",i.type=V(0),i.additionalTypeCheck=void 0,n.addProperty([e,r,i]),n}var Fk=H(J());function Bk(){let n=Ln();n.additionalValidations=(s,i)=>i.parent?.name!=="/"?[C(27,i.definitions[0],Fk.DiagnosticSeverity.Error,i.definitions.slice(1),[],["Chosen node can only be added to a root node"])]:[];let e=new K("bootargs",V(3));e.description=[`A string that specifies the boot arguments for
|
|
228
232
|
theclientprogram. Thevaluecouldpotentially
|
|
229
233
|
be a null string if no boot arguments are re-
|
|
230
|
-
quired.`];let t=new
|
|
234
|
+
quired.`];let t=new K("stdout-path ",V(3));t.description=[`A string that specifies the full path to the node
|
|
231
235
|
representingthedevicetobeusedforbootcon-
|
|
232
236
|
soleoutput. Ifthecharacter\u201C:\u201Dispresentinthe
|
|
233
237
|
valueit terminates thepath. Thevalue maybe
|
|
234
238
|
an alias. If the stdin-path property is not spec-
|
|
235
239
|
ified, stdout-path should be assumed to define
|
|
236
|
-
theinput device.`];let
|
|
240
|
+
theinput device.`];let r=new K("stdin-path ",V(3));return r.description=[`A string that specifies the boot arguments for
|
|
237
241
|
theclientprogram. Thevaluecouldpotentially
|
|
238
242
|
be a null string if no boot arguments are re-
|
|
239
|
-
quired.`],
|
|
243
|
+
quired.`],n.addProperty([e,t,r]),n}var qm=H(J());function Uk(){let n=Ln();n.additionalValidations=(s,i)=>i.parent?.name!=="/"?[C(27,i.definitions[0],qm.DiagnosticSeverity.Error,i.definitions.slice(1),[],["Cpus node can only be added to a root node"])]:[];let e=n.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let t=n.properties.find(s=>s.name==="#size-cells");t.required=()=>"required";let r=t?.additionalTypeCheck;return t.additionalTypeCheck=s=>{let i=r?.(s)??[],o=s.parent.getProperty(s.name);return(o?Ce(o,0,0):void 0)!==0&&i.push(C(29,s.ast,qm.DiagnosticSeverity.Error,void 0,void 0,[`${s.name} value in cpus node must be '0'`])),i},n}var Vk=H(J());function Wk(){let n=Ln();n.additionalValidations=(r,s)=>s.parent?.name!=="cpus"?[C(27,s.definitions[0],Vk.DiagnosticSeverity.Error,s.definitions.slice(1),[],["`cpu` node can only be a child of `cpus` node"])]:[];let e=n.properties.find(r=>r.name==="device_type");e.required=()=>"required";let t=n.properties.find(r=>r.name==="reg");return t.required=()=>"required",t.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
|
|
240
244
|
CP U/threads represented by the CPU node.
|
|
241
245
|
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.
|
|
242
246
|
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.
|
|
243
247
|
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.
|
|
244
248
|
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
|
|
245
249
|
If a CPU/thread's PIR (pending interrupt reg-ister) is modifiable, a client program should modify PIR to match the reg property value.
|
|
246
|
-
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.`],
|
|
247
|
-
`:""}${this.property.map(
|
|
250
|
+
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.`],n}function ci(n){switch(n?.name){case"/":return Mk();case"aliases":return xk();case"memory":return $k();case"reserved-memory":return jk();case"chosen":return Bk();case"cpus":return Uk();case"cpu":return Wk()}return Ln()}var Te=class n{constructor(e,t,r,s=null){this.bindingLoader=e;this.name=t;this.address=r;this.parent=s;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];s?.addNode(this)}static toJson(e){let t={};return e.property.forEach(r=>t[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>t[r.fullName]=n.toJson(r)),t}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=[ci(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(t=>t===e)?this:[...this._nodes,...this._deletedNodes.map(t=>t.node)].map(t=>t.getReferenceBy(e)).find(t=>t)}get nodeNameOrLabelRef(){return uo([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let r=[...this.definitions,...this.referencedBy].find(s=>En(s,e,t));if(r){let s=this.deletes.map(c=>({item:this,ast:br(c,e,t),beforeAst:Oa(c,e,t),afterAst:Da(c,e,t)})).find(c=>En(c.ast,e,t));if(s)return s;let i=[...this._properties.flatMap(c=>[c,...c.allReplaced]),...this._deletedProperties.flatMap(c=>[c.property,...c.property.allReplaced])].map(c=>({item:c,ast:c.ast})).find(c=>En(c.ast,e,t)||c.ast.lastToken.value!==";"&&VE(c.ast,e,t));if(i)return i.item.getDeepestAstNode(e,t);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,t)).find(c=>c);if(o)return o;let a=br(r,e,t);return{item:this,ast:a,beforeAst:Oa(a,e,t),afterAst:Da(a,e,t)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Ne).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(t=>t.issues),...this._nodes.flatMap(t=>t.issues),...this._deletedNodes.flatMap(t=>t.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues];return this.name==="/"&&this.definitions.length&&(this._nodes.some(t=>t.name==="cpus")||e.push(C(9,this.definitions.at(-1),rr.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),e}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[{issues:[6],severity:rr.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[rr.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:rr.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[rr.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof Ne),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:rr.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[rr.DiagnosticTag.Deprecated],templateStrings:[t instanceof Ne?t.name.toString():t.labelReference.label.value]}))])}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,t){return this._nodes.some(r=>r.name===e&&(r.address===t||r.address?.every((s,i)=>t?.at(i)===s)))}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,r){let s=this._nodes.findIndex(i=>i.name===e&&(i.address===r||r?.every((o,a)=>i.address?.at(a)===o)));s!==-1&&(this._deletedNodes.push({node:this._nodes[s],by:t}),this._nodes.splice(s,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Tt){let r=t.values[0].value;if(r instanceof kt&&r.value===e)return[this,...this._nodes.flatMap(s=>s.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Tt){let r=t.values[0].value;if(r instanceof kt&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,t,r=!0){let s=r||!!t||this._nodes.filter(o=>o.name===e).length>1,i=this._nodes.findIndex(o=>o.name===e&&(!s||o.address===t||o.address?.every((a,c)=>t?.at(c)===a)));if(i!==-1)return this._nodes[i]}deleteProperty(e,t){let r=this._properties.findIndex(s=>s.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:t}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(r=>r.name===e.name);if(t===-1)this._properties.push(e);else{let r=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=r,r.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(r=>this._nodeTypes=r):this._nodeTypes=[ci(this)])}getChild(e,t=!0){let r=[...e];r.splice(0,1);let s=r[0].split("@"),i=s[0],o=s[1]!==void 0?s[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(i,o,t);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let r=[...e];return r.splice(0,1),[...this._nodes,...this._deletedNodes.filter(i=>!t(i.by)).map(i=>i.node)].find(i=>i.fullName===r[0])?.getChildFromScope(r,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}toTooltipString(e){return`${this.labels.map(t=>t.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
|
|
251
|
+
`:""}${this.property.map(t=>t.toPrettyString(e)).join(`
|
|
248
252
|
`)}${this.nodes.length?`
|
|
249
|
-
${this.nodes.map(
|
|
253
|
+
${this.nodes.map(t=>`${t.fullName}{ /* ... */ };`).join(`
|
|
250
254
|
`)}`:""}
|
|
251
|
-
};`}toMarkupContent(){return{kind:
|
|
252
|
-
`)}}
|
|
255
|
+
};`}toMarkupContent(e){return{kind:rr.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(`
|
|
256
|
+
`)}}toFullString(e,t=1){let r=this.definitions.some(i=>i instanceof Ne&&i.omitIfNoRef),s=r&&this.linkedRefLabels.length===0&&this.linkedNodeNamePaths.length===0;return s?`/* /omit-if-no-ref/ ${this.labels.map(i=>i.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
|
|
257
|
+
${" ".repeat(t)}`:""}${this.property.map(i=>i.toString()).join(`
|
|
258
|
+
${" ".repeat(t)}`)}${this.nodes.length?`
|
|
259
|
+
${" ".repeat(t)}${this.nodes.map(i=>`${i.fullName}{ ... };`).join(`
|
|
260
|
+
${" ".repeat(t)}`)}`:""}
|
|
261
|
+
${" ".repeat(t-1)}}; */`:`${s?"/* /omit-if-no-ref/ ":r?`/* /omit-if-no-ref/ */
|
|
262
|
+
${" ".repeat(t-1)}`:""}${this.labels.map(i=>i.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
|
|
263
|
+
${" ".repeat(t)}`:""}${this.property.map(i=>i.toPrettyString(e)).join(`
|
|
264
|
+
${" ".repeat(t)}`)}${this.nodes.length?`
|
|
265
|
+
${" ".repeat(t)}${this.nodes.map(i=>i.toFullString(e,t+1)).join(`
|
|
266
|
+
${" ".repeat(t)}`)}`:""}
|
|
267
|
+
${" ".repeat(t-1)}}; ${s?" */":""}`}};var ad=H(J());var jm=H(J());var bs=class extends F{constructor(t,r){super(r);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:jm.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.toString()}:`}},Lt=class extends F{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value,kind:jm.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let r=this.parentNode;if(!(r instanceof ge&&r.linksTo)){super.buildSemanticTokens(t);return}t(si("type"),ii("declaration"),{start:this.firstToken,end:this.lastToken})}toString(){return`${this.value}`}};var He=class{constructor(e,t){this.ast=e;this.parent=t}getDeepestAstNode(e,t){let r=br(this.ast,e,t);return this.ast.assignOperatorToken&&Im(this.ast.assignOperatorToken,e,t)?{item:this,ast:r,beforeAst:Oa(this.ast,e,t),afterAst:Da(this.ast,e,t)}:{item:this,ast:r}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof bs)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(t=>t===e)?this:null}))}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[{issues:[0],severity:ad.DiagnosticSeverity.Hint,astElement:this.replaces.ast,linkedTo:[this.ast],tags:[ad.DiagnosticTag.Unnecessary],templateStrings:[this.name]}]:[]]}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var Jk=H(J());var gd=require("fs");var cd=class n{constructor(e,t){this.text=e;this.uri=t;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this.lineNumberOfEscapedChars=0;this.numberOfEscapedCharsLastString=0;this._tokens=[];this.lines=this.text.replace(`\r
|
|
253
268
|
`,`
|
|
254
|
-
`).split(/\n/).map(
|
|
269
|
+
`).split(/\n/).map(r=>`${r}
|
|
255
270
|
`),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
|
|
256
|
-
`)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!r.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&r.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let n=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,n===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let n=this._tokens.at(-1);return t&&!n?.tokens.some(s=>s===21)&&n&&n.pos.len<e.length?this.process(e.slice(n.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},n=this._tokens.at(-1);t.prevToken=n,n&&(n.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let n=this.lineNumber,s=this.columnNumber,i=this.getString(t[0]);return this.pushToken({tokens:[21],value:i,pos:{col:s-1,line:n,len:i.length+this.numberOfEscapedCharsLastString}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){return{line:this.lineNumber,col:this.columnNumber-e.length+this.lineNumberOfEscapedChars,len:t.length}}};var Qe=class extends F{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var Rm=require("fs"),uo=require("path");var AE=z(J());var $t=class extends zr{constructor(t,n){super(n);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:AE.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Ju=class extends F{constructor(t,n){super(n);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var IE=z(J());var Xu=class extends Qe{toString(){return"..."}},fs=class extends F{constructor(t,n){super();this.functionName=t;this.params=n;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:IE.SymbolKind.Function,range:Q(this),selectionRange:Q(this),children:this.params.flatMap(n=>n.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var Pm=z(J());var gn=class extends zr{constructor(t,n,s){super(n);this.value=t;this.docSymbolsMeta={name:`param${s+1}`,kind:Pm.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},hs=class extends zr{constructor(t,n){super();this.functionName=t;this.params=n;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:Pm.SymbolKind.Function,range:Q(this),selectionRange:Q(this),children:this.params.flatMap(n=>n?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}isTrue(t){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&t.has(this.params[0].value)):super.isTrue(t)}};var ps=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{let n=e.pos.line;if(this.currentToken?.pos.line!==n||this.currentToken?.uri!==e.uri)return;let s=this.currentToken,i=s;for(;this.currentToken?.pos.line===n;)i=this.moveToNextToken;if(t){let o=new F(G(s,i));this._issues.push(C(22,o))}return i};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this._issues=[]}get issues(){return this._issues}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;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(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){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 t=[];return e.every(n=>{let s=this.currentToken,i=n(s),o=!1;return i!=="no"&&s&&(t.push(s),this.moveToNextToken,o=Xt(s,this.currentToken)),i==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],n,s=!0;for(;e.some(i=>i(this.currentToken)==="yes"&&s);)t.push(this.currentToken),n=this.currentToken,this.moveToNextToken,s=Xt(n,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let n=[],s=(i,o,a)=>{if(!a?.start||!a?.end||a.start.uri!==t||a.end.uri!==t)return;let c=a.end.pos.col-a.start.pos.col+a.end.pos.len;n.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:i,tokenModifiers:o})};this.allAstItems.forEach(i=>{i.buildSemanticTokens(s)}),n.sort((i,o)=>i.line===o.line?i.char-o.char:i.line-o.line).forEach(i=>e.push(i.line,i.char,i.length,i.tokenType,i.tokenModifiers))}processCIdentifier(e,t){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));if(!n.length){this.popStack();return}let s=n.map(o=>o.value).join("");if(!s.match(/^[_A-Za-z]/)){this.popStack();return}let i=new $t(s,G(n[0],n.at(-1)));return!t&&i.name!=="defined"&&(e.get(i.name)||this._issues.push(C(42,i))),this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,n;if($(e,40)?(n="&",$(this.currentToken,40)&&(n="&&",t=this.moveToNextToken)):$(e,10)?(n="!",$(this.currentToken,0)&&(n="!=",t=this.moveToNextToken)):$(e,8)?(n="|",$(this.currentToken,8)&&(n="||",t=this.moveToNextToken)):$(e,9)?n="^":$(e,4)?(n=">",$(this.currentToken,4)?(n="<<",t=this.moveToNextToken):$(this.currentToken,0)&&(n=">=",t=this.moveToNextToken)):$(e,5)?(n="<",$(this.currentToken,5)?(n=">>",t=this.moveToNextToken):$(this.currentToken,0)&&(n="<=",t=this.moveToNextToken)):$(e,15)?n="+":$(e,16)?n="-":$(e,17)?n="*":$(e,13)?n="/":$(e,18)?n="%":$(e,46)?$(this.currentToken,46)&&(n="##",t=this.moveToNextToken):$(e,0)&&$(this.currentToken,0)&&(n="==",t=this.moveToNextToken),n){let s=new Ju(n,G(e,t));return this.mergeStack(),s}this.popStack()}parseScopedBlock(e,t,n){this.enqueueToStack();let s=this.moveToNextToken;if(!s||!e(s)){this.popStack();return}let i=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=i},a=p=>p.flatMap(b=>"items"in b?a(b.items):b),c=[s],l=[];l[0]={rewind:o,tokens:[]};let u=this.currentToken;for(;u&&!t(u);){if(n?.(u)){let p=this.peekIndex()+1,b=()=>{this.positionStack[this.positionStack.length-1]=p};c.push(u),l[l.length]={rewind:b,tokens:[]}}else if(e(u)){let p=this.parseScopedBlock(e,t,n);p&&(c.push(p),l[l.length-1].tokens.push(...a(p.items))),u=this.currentToken;continue}else c.push(u),l[l.length-1].tokens.push(u);this.moveToNextToken,u=this.currentToken}let d=u;d&&t(d)&&(this.moveToNextToken,c.push(d));let f={startToken:s,items:c,splitTokens:l,endToken:d};return this.mergeStack(),f}isFunctionCall(e){this.enqueueToStack();let t=this.processCIdentifier(e,!1);if(!t){this.popStack();return}let n=this.processMacroCallParams();if(!n){this.popStack();return}if(t.name==="defined")n.length>1?this._issues.push(C(44,t)):n.length<1&&this._issues.push(C(45,t));else{let i=e.get(t.name)?.macro;i&&(i?.identifier instanceof fs?n.length>i.identifier.params.length?this._issues.push(C(44,t,void 0,[i])):n.length<i.identifier.params.length&&this._issues.push(C(45,t,void 0,[i])):this._issues.push(C(43,t)))}let s=new hs(t,n);return s.lastToken=this.prevToken,this.mergeStack(),s}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([Je("0"),Je("x")]);if(e.length!==2){this.popStack();return}let t=this.consumeAnyConcurrentTokens([19,20].map(Pe));if(!t.length){this.popStack();return}let n=Number.parseInt(t.map(i=>i.value).join(""),16),s=new _t(n,G(e[0],t.at(-1)));return this.mergeStack(),s}processDec(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19].map(Pe));if(!e.length){this.popStack();return}let t=Number.parseInt(e.map(s=>s.value).join(""),10),n=new _t(t,G(e[0],e.at(-1)));return this.mergeStack(),n}processEnclosedExpression(e){this.enqueueToStack();let t,n,s;if($(this.currentToken,42))return t=this.moveToNextToken,n=t,s=this.processExpression(e,!0),s&&(s=new Zs(new Zs(s,!0),!1)),$(this.currentToken,43)?n=this.moveToNextToken:this._issues.push(C(26,new F(G(t)))),this.mergeStack(),s;this.popStack()}processExpression(e,t=!1){this.enqueueToStack();let n;if(n=this.processEnclosedExpression(e)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(),!n){this.popStack();return}if(t){let s=this.isOperator();for(;s;){let i=this.processExpression(e);i?n instanceof Zs?n.addExpression(s,i):n=new Zs(n,!1,{operator:s,expression:i}):this._issues.push(C(27,s)),s=this.isOperator()}}return this.mergeStack(),n}processMacroCallParams(){if(!$(this.currentToken,42))return;let e=this.parseScopedBlock(n=>!!$(n,42),n=>!!$(n,43),n=>!!$(n,24));return e?.items.length===2&&$(e.endToken,43)?[]:e?.splitTokens.map((n,s)=>n.tokens.length===0?null:new gn(n.tokens.map((i,o)=>{let a=i.value;return i.pos.line===n.tokens.at(o+1)?.pos.line&&(a=a.padEnd(n.tokens[o+1].pos.col-i.pos.col," ")),a}).join(""),G(n.tokens[0],n.tokens.at(-1)),s))}};var Zu=class r extends ps{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let n=0;n<this.tokens.length;n++){let s=r.processBlockComments(this.tokens,n)||r.processLineComments(this.tokens,n);s&&(n=s.index,t.push(...s.tokenUsed),this.comments.push(...s.comments))}t.reverse().forEach(n=>this.tokens.splice(n,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=Xr().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,n){let s=[],i=()=>(s.push(n++),t[n]),o=()=>t[n],a=()=>t[n-1],c=o(),l=c;if(!c||!$(c,13)||(l=i(),!$(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!$(a(),17)||!$(o(),13)||!Xt(a(),o())),d=l.pos.line,f=c,p=[];l=i();do{if(o()?.pos.line!==d){let g=new mn(G(f,a()));p.push(g),d=o().pos.line??0,f=o()}l=i()}while(n<t.length&&!u());let b=new mn(G(f,o()));return p.push(b),i(),{comments:p,tokenUsed:s,index:n-1}}static processLineComments(t,n){let s=[];if(!$(t[n],13)||t.length===n+1||!$(t[n+1],13)||!Xt(t[n],t[n+1]))return;let i=[];for(;t[n].pos.line===t.at(n+1)?.pos.line;)s.push(n++);s.push(n++);let o=t[s.at(-1)],a=new mn(G(t[s[0]],t[s.at(-1)]));return i.push(a),{comments:i,tokenUsed:s,index:n-1}}};var ME=z(J()),ed=class extends F{constructor(t,n){super(t);this.content=n}toString(){let t=this.content.filter(n=>!$(n,14));return t.map((n,s)=>{let i=n.value;return n.pos.line===t.at(s+1)?.pos.line?i=i.padEnd(t[s+1].pos.col-n.pos.col," "):t.at(s+1)&&(i=i.padEnd(i.length+1," ")),i}).join("")}},Ea=class extends F{constructor(t,n,s){super();this.keyword=t;this.identifier=n;this.content=s;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof $t?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:ME.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
257
|
-
`)}}};var ri=class extends F{constructor(e){super(e)}},Na=class extends F{constructor(t,n){super();this.keyword=t;this.content=n;this.active=!1;this.addChild(t)}},Pa=class extends Na{constructor(t,n,s){super(t,s);this.identifier=n;this.addChild(n),this.addChild(s)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},td=class extends Na{constructor(t,n,s){super(t,s);this.expression=n;this.addChild(n),this.addChild(s)}useBlock(t){return this.expression instanceof hs?this.expression.functionName.name==="defined"?this.expression&&t.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(t):this.expression?.isTrue(t)}},rd=class extends Pa{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},Ra=class extends Na{};var lo=class extends F{constructor(t,n,s){super();this.ifDef=t;this.endIf=n;this.elseOption=s;this.addChild(t),s&&this.addChild(s),this.addChild(n)}getInValidTokenRange(t,n){let s=[],i=a=>n.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:i(this.tokenIndexes.start),end:i(this.tokenIndexes.end)}];s.push({start:i(this.ifDef.tokenIndexes.start),end:i(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&s.push({start:i(this.ifDef.content.tokenIndexes.start),end:i(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(s.push({start:i(this.elseOption.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)})),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}},ms=class extends F{constructor(t,n,s){super();this.ifBlocks=t;this.endIf=n;this.elseOption=s;t.forEach(i=>this.addChild(i)),s&&this.addChild(s),this.addChild(n)}getInValidTokenRange(t,n){let s=[],i=a=>n.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach((a,c)=>{s.push({start:i(a.tokenIndexes.start),end:i(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(t)?(a.active=!0,o=!0):a.content&&s.push({start:i(a.content.tokenIndexes.start),end:i(a.content.tokenIndexes.end)})}),this.elseOption&&(s.push({start:i(this.elseOption.keyword.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content?s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)}):this.elseOption.active=!0),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}};var Ca=z(J());var fo=class extends ps{constructor(t,n,s){super();this.uri=t;this.incudes=n;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;s&&(Array.from(s).forEach(([i,o])=>this.macroSnapShot.set(i,o)),Array.from(s).forEach(([i,o])=>this.macros.set(i,o)))}get currentToken(){let t=this.prevToken,n=pn(t,this.tokens.at(this.peekIndex()))||!t||$(t,14)&&t.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!n))return this.macroStart&&$(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(t){super.reset(),this.macros.clear(),t?(this.macroSnapShot.clear(),Array.from(t).forEach(([n,s])=>this.macroSnapShot.set(n,s)),Array.from(t).forEach(([n,s])=>this.macros.set(n,s))):Array.from(this.macroSnapShot).forEach(([n,s])=>this.macros.set(n,s)),this.nodes=[],this.dtsIncludes=[]}async reparse(t){let n=this.stable;return this.parsing=new Promise(s=>{n.then(()=>{if(t&&t.size===this.macroSnapShot.size){let i=Array.from(t);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=i[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),s();return}}this.reset(t),this.parse().then(s)})}),this.parsing}async parse(){let t=new Zu(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),!(!this.prevToken||this.prevToken.pos.line!==this.currentToken?.pos.line||this.prevToken.uri!==this.currentToken?.uri)){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let n=this.currentToken,s=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();n&&this.moveEndOfLine(n,!!s),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),n=this.moveToNextToken;if(!n||!$(n,25))return this.popStack(),!1;this.macroStart=!0;let s=new Qe(G(n)),i=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(C(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new ed(G(o[0],o.at(-1)),o));let c=new Ea(s,i,a);this.macros.set(c.name,{macro:c,resolver:Aw(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let t=this.peekIndex(),n=this.moveToNextToken;if(!n||!$(n,28))return this.popStack(),!1;this.macroStart=!0;let s=new Qe(G(n)),i=this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(C(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=new Ea(s,i);this.macros.delete(i.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(t,a-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let t=[];for(;this.currentToken;){let n=this.moveToNextToken;n&&t.push(n)}return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier(this.macros,!0);if(!t){this.popStack();return}let n=this.moveToNextToken;if(!$(n,42)||!Xt(t.lastToken,n)){this.popStack();return}let s=[],i=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;i;)s.push(i),!$(this.currentToken,24)&&!$(this.currentToken,43)?this._issues.push(C(28,i)):$(this.currentToken,43)||(n=this.moveToNextToken),i=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new fs(t,s);return $(this.currentToken,43)?(n=this.moveToNextToken,o.lastToken=n):(o.lastToken=this.prevToken,this._issues.push(C(26,s.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(45),Pe(45),Pe(45)]);if(t.length!==3){this.popStack();return}let n=new Xu(G(t[0],t.at(-1)));return this.mergeStack(),n}processIfDefBlocks(){let t=this.peekIndex(),n=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>$(o,a))&&!pn(o.prevToken,o),o=>!!o&&[37].some(a=>$(o,a))&&!pn(o.prevToken,o),o=>!!o&&[36,35].some(a=>$(o,a))&&!pn(o.prevToken,o));if(!n)return;let s;$(n.startToken,32)?s=this.processIfBlock(n,(o,a,c)=>new td(o,a??null,c)):s=this.processIfDefBlock(n,(o,a,c)=>$(n.startToken,33)?new Pa(o,a??null,c):new rd(o,a??null,c)),this.nodes.push(s),s.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...s instanceof ms?s.ifBlocks:[s.ifDef],...s.elseOption?[s.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(C(47,o.content,Ca.DiagnosticSeverity.Hint,[],[Ca.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=t}processIfDefBlock(t,n){this.enqueueToStack(),this.macroStart=!0;let s=new Qe(G(t.startToken));t.splitTokens[0].rewind();let i=this.processCIdentifier(this.macros,!0);i||this._issues.push(C(31,s)),this.macroStart=!1;let o,a=i?.lastToken.nextToken??s.lastToken.nextToken;a&&t.splitTokens[0].tokens.find(f=>f===a)&&(o=new ri(G(a,t.splitTokens[0].tokens.at(-1))));let c=n(s,i??null,o??null),l;if(t.splitTokens.length>1){let f=t.splitTokens[1].tokens[0].prevToken,p=new Qe(G(f)),b;t.splitTokens[1].tokens.length&&(b=new ri(G(t.splitTokens[1].tokens[0],t.splitTokens[1].tokens.at(-1)))),l=new Ra(p,b??null)}let u;t.endToken?u=new Qe(G(t.endToken)):this._issues.push(C(46,s));let d=new lo(c,u??null,l);return this.mergeStack(),d}processIfBlock(t,n){this.enqueueToStack();let s=new Qe(G(t.startToken)),i=[],o;t.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new Qe(G(d));this.macroStart=!0;let p=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===t.splitTokens.length-1&&$(d,36)){let g=d,_=new Qe(G(g)),w;l.tokens.length&&(w=new ri(G(l.tokens[0],l.tokens.at(-1)))),o=new Ra(_,w??null)}else{p||this._issues.push(C(31,s));let g,_=p?.lastToken.nextToken??s.lastToken.nextToken;_&&l.tokens.find(T=>T===_)&&(g=new ri(G(_,t.splitTokens[u].tokens.at(-1))));let w=n(f,p??null,g??null);i.push(w)}});let a;t.endToken?a=new Qe(G(t.endToken)):this._issues.push(C(46,s));let c=new ms(i,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,uo.resolve)((0,uo.dirname)(t.uri),t.path.path),...this.incudes.map(n=>(0,uo.resolve)(n,t.path.path))].find(n=>(0,Rm.existsSync)(n)):this.incudes.map(n=>(0,uo.resolve)(n,t.path.path)).find(n=>(0,Rm.existsSync)(n))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),n=this.currentToken;if(!n)return this.popStack(),!1;let s=n,i=n;if($(n,26))this.moveToNextToken;else{let g=this.checkConcurrentTokens([Pe(13),Je("include"),Pe(13)]);if(g.length!==3)return this.popStack(),!1;s=g[0],i=g.at(-1)}let o=s,a=new Qe(G(s,i));n=this.moveToNextToken;let c=n,l=!!$(n,21);if(!c||!l&&!$(n,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=n?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!$(this.currentToken,4);)u+=this.currentToken?.value??"",n=this.moveToNextToken;let d=new ro(u,l,G(c,n)),f=new cs(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!$(this.currentToken,4)?this._issues.push(C(12,f)):(n=this.moveToNextToken,d.lastToken=n)),this.mergeStack();let p=this.peekIndex(),b=this.resolveInclude(f);if(f.resolvedPath=b,b||this._issues.push(C(36,f.path,Ca.DiagnosticSeverity.Warning)),b){Xr().requestTokens(b,!0);let g=await Da().getCPreprocessorParser(b,this.incudes,this.macros,this.uri);await g.stable,this._issues.push(...g.issues),this.macros.clear(),Array.from(g.macros).forEach(([_,w])=>this.macros.set(_,w)),b.endsWith(".h")?this.tokens.splice(t,p-t):this.tokens.splice(t,p-t,...g.tokens),this.nodes.push(...g.nodes),this.dtsIncludes.push(...g.dtsIncludes)}else this.tokens.splice(t,p-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var xE,Cm=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,t,n,s){let i=`${Array.from(n).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(i);if(o)return o.reparse(n),o;console.log("No cpreprocess cache",e);let a=new fo(e,t,n),c=this.includeOwners.get(a)??new Set;return c.add(s),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(i,a),a}reset(e){let t=this.headerFiles.get(e);t&&Array.from(t).forEach(n=>{n[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(n[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function Da(){return xE??=new Cm,xE}var LE,Dm=class r{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(n=>({...n}));return t.forEach((n,s)=>{n.prevToken=t[s-1],n.nextToken=t[s+1]}),t}needsRenew(e,t){return this.fileMap.get(e)?.text!==t}renewLexer(e,t){if(Da().reset(e),!e||!(0,nd.existsSync)(e))return[];try{t??=(0,nd.readFileSync)(e).toString();let n=new Yu(t,e);return this.fileMap.set(e,n),r.clone(n.tokens)}catch{}return[]}requestTokens(e,t){let n=this.fileMap.get(e)?.tokens;return!n&&t?[...this.renewLexer(e)]:r.clone(n??[])}reset(e){Da().reset(e),this.fileMap.delete(e)}};function Xr(){return LE??=new Dm,LE}var sd=class r{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new Ee(this.context.bindingLoader,"/");this.labelsUsedCache=new Map}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(n=>r.getFileTopMostAst(n,t))}fileTopMostAst(e){return[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.parser.cPreprocessorParser.allAstItems,...this.context.overlayParsers.flatMap(t=>t.cPreprocessorParser.allAstItems)].flatMap(t=>r.getFileTopMostAst(t,e))}getDeepestAstNode(e,t){let s=this.fileTopMostAst(e).find(i=>Tr(i,e,t)||Cw(Xr().requestTokens(e,!1),i,t));if(s instanceof Rt){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:hn(s,e,t)}}else if(s instanceof dt&&s.path){let i=this.rootNode.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s instanceof Re&&s.path){let i=r.getNodeFromPath(s.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s)return{runtime:this,item:null,ast:hn(s,e,t)}}static getNodeFromPath(e,t,n=!0){if(e.length===0)return t;let s=e[0].split("@"),i=s[0],a=s.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=t.getNode(i,a,n);return l?r.getNodeFromPath(c,l,n):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let n=this.labelsUsedCache.get(e[0].slice(1));return n||(t??=this.rootNode.allDescendantsLabels,t.find(i=>i.label.value===e.at(0)?.slice(1)&&i.parentNode instanceof qe)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(n=>{t.has(n.label.label.value)?t.get(n.label.label.value)?.push(n):t.set(n.label.label.value,[n])}),Array.from(t).forEach(n=>{let s=n[1];if(s.length>1){let i=s.find(a=>a.owner instanceof Ee);(!s.every(a=>a&&a.owner===i?.owner)||!i)&&e.push(C(4,s.at(0).label,$E.DiagnosticSeverity.Error,s.slice(1).map(a=>a.label),[],[s.at(0).label.label.value]))}}),e}get typesIssues(){let e=t=>[...t.nodeType?.getIssue(this,t)??[],...t.nodes.flatMap(n=>e(n))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return Dw([...e.definitions,...e.referencedBy])}};var qE=z(J()),id=class extends F{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:qE.SymbolKind.String},this.values.forEach(n=>this.addChild(n))}toString(){return this.values.map(t=>t?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(t=>t?.toJson())}};var jE=z(J()),od=class extends F{constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:jE.SymbolKind.Function}}};var yn=class extends F{constructor(t,n){super();this.value=t;this.labels=n;this.labels.forEach(s=>{this.addChild(s)}),this.addChild(this.value)}toString(){return`${this.labels.map(t=>t.toString()).join(" ")}${this.value?.toString()??"NULL"}`}};var FE=z(J()),ad=class extends F{constructor(t,n,s){super();this.keyword=t;this.startAddress=n;this.endAddress=s;this.addChild(t),this.docSymbolsMeta={name:"Memreserve",kind:FE.SymbolKind.Function},this.addChild(n),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var BE=z(J()),cd=class extends F{constructor(t,n){super();this.keyword=t;this.bitsSize=n;this.addChild(t),this.docSymbolsMeta={name:"bits",kind:BE.SymbolKind.Function},this.addChild(n)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var UE=z(J()),Oa=class extends ps{constructor(t,n,s){super();this.uri=t;this.incudes=n;this.tokens=[];this.others=[];this.rootDocument=new qe;this.unhandledStatements=new dt;this.cPreprocessorParser=new fo(this.uri,this.incudes,s)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.resolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new qe,this._issues=[],this.unhandledStatements=new dt}async reparse(){let t=performance.now(),n=this.stable;return this.parsing=new Promise(s=>{n.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),s()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,this.uri.endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let n=async()=>{if(!(this.isDtsDocumentVersion()||this.isMemreserve()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let s=this.moveToNextToken;if(s){let i=new F(G(s));this._issues.push(C(22,i)),this.reportExtraEndStatements()}}};for(;!this.done;)await n();if(this.unhandledStatements.properties.forEach(s=>{this._issues.push(C(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(C(33,s))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let n=this.moveToNextToken,s=n,i=13;if(!n||!$(n,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!$(s,i))return this.popStack(),!1;let o=new dt;o.openScope=s,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??s;return o.firstToken=n,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let n=this.currentToken;if($(n,3))this.moveToNextToken;else{let s=this.prevToken;if(s){let i=new F(G(s));this._issues.push(C(3,i))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return $(this.currentToken,3)||$(this.currentToken,1)}endStatement(t=!0){let n=this.currentToken;if(!$(n,1)){let s=this.prevToken;if(s&&t){let i=new F(G(this.prevToken));return this._issues.push(C(1,i)),s}}return this.moveToNextToken,this.reportExtraEndStatements(),n}reportExtraEndStatements(){for(;$(this.currentToken,1);){let t=this.moveToNextToken;if(t){let n=new F(G(t));this._issues.push(C(23,n))}}}processNode(t,n){if(this.done)return!1;let s=!1,i=!1;do{if(i=this.isChildNode(t,n)||this.isProperty(t)||this.isDeleteNode(t,n)||this.isDeleteProperty(t),!i&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new F(G(o));this._issues.push(C(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;s=s||i}while(!this.isNodeEnd());return s}processOptionalLabelAssign(t=!1){let n=[],s=this.isLabelAssign(t);for(;s;)n.push(s),s=this.isLabelAssign(t);return n}isChildNode(t,n){this.enqueueToStack();let s;n==="Name"&&(s=this.isOmitIfNoRefNode());let i=this.processOptionalLabelAssign(),o,a,c=n==="Ref"?new Rt(i):new Re(i,s);if(n==="Ref"?a=this.isLabelRef():n==="Name"&&(o=this.isNodeName()),!a&&!o){if(!$(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(C(n==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof Rt?(c.labelReference=a,l=!0):o&&c instanceof Re&&(l=o.address!==void 0,c.name=o),$(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(C(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let t=this.prevToken,n=this.consumeAnyConcurrentTokens([19,20].map(Pe)),s=n.length?Number.parseInt(n.map(o=>o.value).join(""),16):NaN;if(t){if(Number.isNaN(s)){let o=new F(G(t));this._issues.push(C(8,o))}else if(!Number.isNaN(s)&&!Xt(t,n[0])){let o=new F(G(t,n.at(0)));this._issues.push(C(29,o))}}return new Fu(s,G(n[0]??this.prevToken,n.at(-1)))}processNodeAddresses(t){this.enqueueToStack();let n=this.checkConcurrentTokens([Pe(49)]);if(n.length){if(!Xt(t.lastToken,n[0])){let o=new F(G(t.lastToken,n[0]));this._issues.push(C(29,o))}let s=[],i=()=>{if(s.push(this.processNodeAddress()),$(this.currentToken,24)){if(this.prevToken&&!Xt(this.prevToken,this.currentToken)){let o=new F(G(this.prevToken,this.currentToken));this._issues.push(C(29,o))}this.moveToNextToken,i()}};return i(),this.mergeStack(),s}this.popStack()}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Pe));if(!t.length){this.popStack();return}let n=t.map(o=>o.value).join("");if(!n.match(/^[A-Za-z]/)){this.popStack();return}let s=new je(n,G(t[0],t.at(-1))),i=this.processNodeAddresses(s);return s.address=i,this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Pe));if(!t.length){this.popStack();return}let n=new ze(t.map(s=>s.value).join(""),G(t[0],t.at(-1)));return this.mergeStack(),n}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));if(!t.length){this.popStack();return}let n=t.map(i=>i.value).join("");if(!n.match(/^[A-Za-z]/)){this.popStack();return}let s=new Lt(n,G(t[0],t.at(-1)));return this.mergeStack(),s}isLabelAssign(t){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));if(!n.length){this.popStack();return}let s=n.map(c=>c.value).join("");if(!s.match(/^[A-Za-z]/)){this.popStack();return}let i=this.currentToken,o=i&&$(i,50),a=new ds(new Lt(s,G(n[0],n.at(-1))),G(n[0],o?i:n.at(-1)));if(o){let c=n.at(-1);c&&(i.pos.line!==a.firstToken.pos.line||i.pos.col!==c.pos.col+c.pos.len)&&this._issues.push(C(29,new F(G(c,i)))),this.moveToNextToken}else if(t)this._issues.push(C(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(),s=this.isPropertyName();if(!s)return this.popStack(),!1;if($(this.currentToken,2)||$(this.currentToken,49))return this.popStack(),!1;let i=new Ae(s,n),o;$(this.currentToken,0)?(i.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(i),o?.values.filter(c=>!!c).length||this._issues.push(C(0,i)),i.values=o??null):i.values=void 0;let a=this.endStatement();return i.lastToken=a,t.addNodeChild(i),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Je("d"),Je("ts"),Pe(16),Je("v"),Je("1")]);if(t.length!==6)return this.popStack(),!1;let n=t[0],s=n,i=new Qe;i.firstToken=n;let o=new od(i);if(this.others.push(o),$(this.currentToken,13))s=this.moveToNextToken;else return i.lastToken=t.at(-1),this._issues.push(C(21,o)),this.mergeStack(),!0;return i.lastToken=s,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Je("memreserve")]);if(t.length!==2)return this.popStack(),!1;let n=new Qe;n.firstToken=t[0];let i=t[0];$(this.currentToken,13)?(i=this.moveToNextToken,n.lastToken=i):(n.lastToken=t.at(-1),this._issues.push(C(21,n)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new ad(n,o,a);return this.others.push(c),o||this._issues.push(C(37,n)),a||this._issues.push(C(38,o??n)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Je("b"),Je("its")]);if(t.length!==3){this.popStack();return}let n=new Qe;n.firstToken=t[0];let i=t[0];$(this.currentToken,13)?(i=this.moveToNextToken,n.lastToken=i):(n.lastToken=t.at(-1),this._issues.push(C(21,n)));let o=this.processDec(),a=new cd(n,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(C(40,o)):this._issues.push(C(39,n)),this._issues.push(C(41,a,UE.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Je("omit"),Pe(16),Je("if"),Pe(16),Je("no"),Pe(16),Je("ref"),Pe(13)]);if(t.length!==9){this.popStack();return}let n=new Qe(G(t[0],t.at(-1)));return this.mergeStack(),n}isDeleteNode(t,n){this.enqueueToStack();let s=this.checkConcurrentTokens([Pe(13),Je("d"),Je("e"),Je("lete"),Pe(16),Je("node")]);if(!s.length)return this.popStack(),!1;let i=s[0],o=i,a=new Qe;if(a.firstToken=i,s.length===1&&!$(this.currentToken,2)){this._issues.push(C(25,a)),a.lastToken=s.at(-1);let d=new ur(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=s.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=s.at(-1),c!=="/delete-node"?this._issues.push(C(c.startsWith("/delete-n")?34:25,a)):$(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(C(21,a));let l=new ur(a);if(pn(a.tokenIndexes?.end,i)){let d=this.processNodePathRef();d&&n==="Name"&&this._issues.push(C(7,d));let f=d?void 0:this.isLabelRef();f&&n==="Name"&&this._issues.push(C(7,f));let p=d||f?void 0:this.isNodeName();p&&n==="Ref"&&this._issues.push(C(10,p)),!d&&!p&&!f&&this._issues.push(C([7,10],l)),l.nodeNameOrRef=d??f??p??null}else n==="Name"?this._issues.push(C(7,a)):n==="Ref"&&this._issues.push(C(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let n=this.checkConcurrentTokens([Pe(13),Je("d"),Je("e"),Je("lete"),Pe(16),Je("property")]);if(!n.length)return this.popStack(),!1;let s=n[0],i=s,o=new Qe;if(o.firstToken=s,n.length===1&&!$(this.currentToken,2)){this._issues.push(C(25,o)),o.lastToken=n.at(-1);let u=new Ue(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=n.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=n.at(-1),a!=="/delete-property"?this._issues.push(C(a.startsWith("/delete-p")?35:25,o)):$(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(C(21,o));let c=new Ue(o);if(pn(o.tokenIndexes?.end,s)){let u=this.isPropertyName();u||this._issues.push(C(6,c)),c.propertyName=u??null}else this._issues.push(C(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),n=this.processNodePathRef();if(!n){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let i=new Zt(t,n,s);return this.mergeStack(),i}processValue(t){this.enqueueToStack();let s=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!$(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=$(this.currentToken,24);if(d)this.moveToNextToken;else if(!pn(this.prevToken,this.currentToken))break;let f=o();if(u&&f===null&&d){let p=new F(G(u,this.currentToken));this._issues.push(C(0,p))}if(!d&&f===null)break;if(l&&!d&&f){let p=new F(G(l));this._issues.push(C(28,p))}c.push(f)}return c})();if(s.length===0){this.popStack();return}return this.mergeStack(),new id(s)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),n=this.moveToNextToken;if(!$(n,21)){this.popStack();return}if(!n?.value)throw new Error("Token must have value");let s=n.value;s.match(/["']$/)&&(s=s.slice(1,-1));let i=new Oe(s,G(n));n.value.match(/["']$/)||this._issues.push(C(n.value.startsWith('"')?16:17,i));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new Zt(t,i,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),s=this.processBits(),i=this.currentToken;if($(i,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(t)??null;o.openBracket=i;let a=this.processOptionalLabelAssign(!0)??[],c=new Zt(n,o,a,s);$(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(C(12,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),n=this.moveToNextToken,s=n;if(!$(s,11)){this.popStack();return}let i=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];i.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this._issues.push(C(15,u))});let a=new as(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=n,this._issues.push(C(14,a)));let c=new Zt(t,a,o);$(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(C(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=n,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let n=t(),s=[];if(!n)return this.popStack(),[];for(;n;)s=[...s,n],n=t();if(s){let i=t();i&&(s=[...s,i])}return this.mergeStack(),s}processArrayValues(t){this.enqueueToStack();let n=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),s=new yt(n);return n.length===0&&(s.firstToken=this.currentToken),this.mergeStack(),s}processLabeledHex(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(t),s=this.processHex();if(!s){this.popStack();return}let i=new yn(s,n);return this.mergeStack(),i}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),n=this.checkConcurrentTokens([20,20].map(Pe));if(!n.length){this.popStack();return}let s=Number.parseInt(n.map(a=>a.value).join(""),16),i=new _t(s,G(n[0],n.at(-1))),o=new yn(i,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(t),s=this.processDec();if(!s){this.popStack();return}let i=new yn(s,n);return this.mergeStack(),i}processLabeledExpression(t=!0,n=t){this.enqueueToStack();let s=[];t&&(s=this.processOptionalLabelAssign(n));let i=this.processExpression(this.cPreprocessorParser.macros);if(!i){this.popStack();return}let o=new yn(i,s);return this.mergeStack(),o}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),n=this.processExpression(this.cPreprocessorParser.macros);if(!n){this.popStack();return}let s=this.processOptionalLabelAssign(!0),i=new Zt(t,n,s);return this.mergeStack(),i}isLabelRef(t){this.enqueueToStack();let n=this.currentToken;if($(n,40))this.moveToNextToken;else{this.popStack();return}let s=this.isLabelName();if(!s){let o=new _e(null);return this._issues.push(C(18,t??o)),o.firstToken=n,this.mergeStack(),o}n&&(s.firstToken.pos.line!==n.pos.line||s.firstToken.pos.col!==n.pos.col+n.pos.len)&&this._issues.push(C(29,new F(G(n,s.firstToken))));let i=new _e(s);return i.firstToken=n,this.mergeStack(),i}isLabelRefValue(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),s=this.isLabelRef(t);if(!s){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(i=this.processOptionalLabelAssign(!0));let o=new Zt(n,s,i);return this.mergeStack(),o}processRefValue(t,n){this.enqueueToStack();let s=this.processOptionalLabelAssign(t),i=this.currentToken;if(!$(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new yn(o,s);return this.mergeStack(),l}let a=this.isLabelRef(n);if(a===void 0){this._issues.push(C([18,9],n));let l=new yn(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new yn(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(t=!0,n=new $n){this.enqueueToStack();let s;if($(this.currentToken,13))s=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this._issues.push(C(19,new F(G(this.prevToken))))}let i=this.isNodeName();return i||this._issues.push(C(7,new F(G(s??this.prevToken)))),n.addPath(i??null,s?new F(G(s)):void 0),this.processNodePath(!1,n),this.mergeStack(),n}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,n=t;if(!$(n,40)){this.popStack();return}let s=this.moveToNextToken;if(n=s,!$(n,2)){this.popStack();return}let i=this.processNodePath(),o=new Gr(i??null),a=this.currentToken??this.prevToken,c=a;return i?.children.forEach((l,u)=>{if(u===i?.children.length-1&&l&&c&&!Xt(l.lastToken,c)){this._issues.push(C(29,new F(G(l.lastToken,c))));return}if(u===0&&s&&!Xt(s,l?.firstToken)){this._issues.push(C(29,new F(G(s,l?.firstToken))));return}let d=i?.children[u+1];l&&d&&!Xt(l.lastToken,d.firstToken)&&this._issues.push(C(29,new F(G(l.lastToken,d?.firstToken))))}),$(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(C(3,new F(G(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof cs)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var ho=z(J());var VE=require("fs"),WE=require("path");var po=class{constructor(e,t,n,s=[],i){this.includePaths=t;this.bindingLoader=n;this._issues=[];this.overlayParsers=[];this.overlays=[];this.overlays=Array.isArray(s)?s:[s],this.overlays.filter(VE.existsSync),this.parser=new Oa(e,t),this.name=i??(0,WE.basename)(e),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(o=>new Oa(o,t,this.parser.cPreprocessorParser.macros))??[]})}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.map(e=>e.uri),this.parser.uri,...this.parser.cPreprocessorParser.dtsIncludes.flatMap(e=>e.resolvedPath).filter(e=>!!e)]}isInContext(e){return this.getContextFiles().some(t=>t===e)}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,t){if(!this.isInContext(e))return[];let s=(await this.getRuntime()).rootNode.allBindingsProperties.filter(i=>i.ast.uri===e&&(!t||Tr(i.ast,e,t))).flatMap(i=>i.ast.values?.values.flatMap(o=>{let c=i.parent?.nodeTypes.find(l=>o?.value instanceof Oe&&l.compatible===o.value.value);return c?{range:Q(o.value),target:ce(c.bindingsPath)}:void 0})).filter(i=>i)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(i=>i.uri===e&&(!t||Tr(i,e,t))).map(i=>{let o=this.parser.cPreprocessorParser.resolveInclude(i);if(o)return{range:Q(i.path),target:ce(o)}}).filter(i=>i)??[],...s]}linkPropertiesLabelsAndNodePaths(e){let t=i=>[...i.property,...i.nodes.flatMap(t)],n=t(e.rootNode),s=e.rootNode.allDescendantsLabels;n.forEach(i=>i.ast.allDescendants.forEach(o=>{if(o instanceof _e){let a=e.resolvePath([`&${o.label?.value}`],s);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(C(3,o,ho.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof $n){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let f=a?.getNode(d.name,d.address?.map(p=>p.address),!1);d.linksTo=f,!u&&!f&&(u=!0,this._issues.push(C(8,d,ho.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(p=>p?.linksTo).map(p=>p?.toString()).join("/")}`]))),f?.linkedNodeNamePaths.push(d),a=f}else break}}}))}async reevaluate(e){return this.isInContext(e)?(await this.parser.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}async evaluate(){let e=performance.now();await this.stable();let t=new sd(this);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let n=0;n<this.overlayParsers.length;n++)this.processRoot(this.overlayParsers[n].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(n=>n instanceof mn),(await this.getAllParsers()).flatMap(n=>n.tokens).forEach((n,s)=>n.sortKey=s),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}processRoot(e,t){for(let n=0;n<e.children.length;n++){let s=e.children[n];this.processChild(s,t.rootNode,t)}}processChild(e,t,n){e instanceof qe?this.processDtcBaseNode(e,t,n):e instanceof Ae?this.processDtcProperty(e,t,n):e instanceof ur?this.processDeleteNode(e,t,n):e instanceof Ue&&this.processDeleteProperty(e,t,n)}checkNodeUniqueNames(e,t){let n=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address.every((l,u)=>a.address?.at(u)?.address===l))),s=t.nodes.map(o=>({name:o.name,address:o.address})),i=[];e.children.forEach(o=>{if(o instanceof Re&&o.name)n(i.map(a=>({name:a.name,address:a.address?.map(c=>c.address)})),o.name)&&this._issues.push(C(2,o.name)),i.push(o.name);else if(o instanceof ur&&o.nodeNameOrRef instanceof je){let a=o.nodeNameOrRef;n(s,a)&&(i=i.filter(c=>n(i.map(l=>({name:l.name,address:l.address?.map(u=>u.address)})),c)))}})}processDtcBaseNode(e,t,n){e instanceof dt?this.processDtcRootNode(e,n):e instanceof Re?this.processDtcChildNode(e,t,n):e instanceof Rt&&this.processDtcRefNode(e,n)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((n,s)=>n instanceof Ae&&s instanceof Ue||s instanceof Ae&&n instanceof Ue?0:s instanceof Ae?1:0).forEach(n=>this.processChild(n,t.rootNode,t))}processDtcChildNode(e,t,n){if(e.name?.name){let s=e.path?n.resolvePath(e.path):void 0,o=(s?n.rootNode.getChild(s):void 0)??new Ee(this.bindingLoader,e.name.name,e.name.address?.map(a=>a.address),t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((s,i)=>s instanceof qe&&i instanceof qe?0:s instanceof qe?-1:0).forEach(s=>this.processChild(s,t,n))}processDtcRefNode(e,t){let n;if(e.labelReference){let s=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);s?(e.resolveNodePath??=[...s],n=t.rootNode.getChild(s),e.labelReference.linksTo=n,e.labels.forEach(i=>i.lastLinkedTo=n),n?.linkedRefLabels.push(e.labelReference),n?.referencedBy.push(e),e.labels.forEach(i=>{t.labelsUsedCache.set(i.label.value,s)}),n?(t.references.push(e),this.checkNodeUniqueNames(e,n)):t.unlinkedRefNodes.push(e)):(this._issues.push(C(3,e.labelReference,ho.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((s,i)=>s instanceof qe&&i instanceof qe?0:s instanceof qe?-1:0).forEach(s=>this.processChild(s,n??new Ee(this.bindingLoader,""),t))}processDtcProperty(e,t,n){e.propertyName?.name&&t.addProperty(new Xe(e,t)),e.children.forEach(s=>this.processChild(s,t,n))}processDeleteNode(e,t,n){if(e.nodeNameOrRef instanceof je&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(s=>s.address)))this._issues.push(C(5,e.nodeNameOrRef));else{t.deletes.push(e);let s=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(i=>i.address));e.nodeNameOrRef.linksTo=s,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address?.map(i=>i.address)),s?.labels.forEach(i=>{n.labelsUsedCache.delete(i.label.value)})}}else if(e.nodeNameOrRef instanceof _e&&e.nodeNameOrRef.value){let s=n.resolvePath([`&${e.nodeNameOrRef.value}`]),i;s?(i=n.rootNode.getChild(s),t.deletes.push(e),e.nodeNameOrRef.linksTo=i,i?.labels.forEach(o=>{n.labelsUsedCache.delete(o.label.value)}),i?.linkedRefLabels.push(e.nodeNameOrRef),i?.parent?.deleteNode(i.name,e,i.address),e.parentNode instanceof qe&&!e.parentNode.pathName&&n.globalDeletes.push(e)):(n.unlinkedDeletes.push(e),this._issues.push(C(3,e.nodeNameOrRef,ho.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Gr&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(s=>!s)){let s=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],i=n.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let f=i?.getNode(d.name,d.address?.map(p=>p.address),!1);d.linksTo=f,f?.linkedNodeNamePaths.push(d),i=f}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(n.unlinkedDeletes.push(e),c&&this._issues.push(C(8,c,ho.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{n.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof qe&&!e.parentNode.pathName&&n.globalDeletes.push(e)}else n.unlinkedDeletes.push(e);e.children.forEach(s=>this.processChild(s,t,n))}processDeleteProperty(e,t,n){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(C(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(s=>this.processChild(s,t,n))}};var ft=z(J());var HE=require("fs"),mo=require("path");function nx(r){if(!r||!(r.ast instanceof ro))return[];let e=n=>n.flatMap(s=>(0,HE.readdirSync)(s,{withFileTypes:!0,recursive:!0}).filter(i=>i.name.toLowerCase().endsWith(".dtsi")||i.name.toLowerCase().endsWith(".h")).map(i=>({label:`${(0,mo.join)((0,mo.relative)(s,i.parentPath),i.name)}`,kind:ft.CompletionItemKind.File})));if(r.ast.relative)return e([(0,mo.dirname)(r.ast.uri)]);let t=r.runtime.context.includePaths;return e(t)}var ud=(r,e)=>[...r.labels.filter(e),...r.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>ud(t.node,e)),...r.nodes.flatMap(t=>ud(t,e))],Om=(r,e)=>[...r.labels,...r.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>Om(t.node,e)),...r.nodes.flatMap(t=>Om(t,e))];function sx(r,e){if(!r||!(r.item instanceof Xe)||!(r.ast instanceof _e))return[];let t=n=>Om(n,e);return Array.from(new Set(t(r.runtime.rootNode).map(n=>n.label.value))).map(n=>({label:`${n}`,kind:ft.CompletionItemKind.Method}))}function ix(r,e){if(!r||r.item!==null||!(r.ast instanceof _e)||!(r.ast.parentNode instanceof Rt))return[];let t=n=>ud(n,e).filter(s=>e(s));return[...Array.from(new Set(t(r.runtime.rootNode).map(n=>n.label.value))).map(n=>({label:n,insertText:`${n} {
|
|
271
|
+
`)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!n.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&n.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let r=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,r===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let r=this._tokens.at(-1);return t&&!r?.tokens.some(s=>s===21)&&r&&r.pos.len<e.length?this.process(e.slice(r.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},r=this._tokens.at(-1);t.prevToken=r,r&&(r.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let r=this.lineNumber,s=this.columnNumber-1,i=this.getString(t[0]),o=i.length+this.numberOfEscapedCharsLastString;return this.pushToken({tokens:[21],value:i,pos:{col:s,line:r,len:o,colEnd:s+o}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){let r=this.columnNumber-e.length+this.lineNumberOfEscapedChars;return{line:this.lineNumber,col:r,len:t.length,colEnd:r+t.length}}};var nt=class extends F{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var Bm=require("fs"),To=require("path");var Hk=H(J());var qt=class extends tr{constructor(t,r){super(r);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:Hk.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var ld=class extends F{constructor(t,r){super(r);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var Kk=H(J());var ud=class extends nt{toString(){return"..."}},Ts=class extends F{constructor(t,r){super();this.functionName=t;this.params=r;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return se(this.uri,t)?[{name:this.functionName.name,kind:Kk.SymbolKind.Function,range:Q(this),selectionRange:Q(this),children:this.params.flatMap(r=>r.getDocumentSymbols(t))}]:[]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var Fm=H(J());var wr=class extends tr{constructor(t,r,s){super(r);this.value=t;this.docSymbolsMeta={name:`param${s+1}`,kind:Fm.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Ss=class extends tr{constructor(t,r){super();this.functionName=t;this.params=r;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return se(this.uri,t)?[{name:this.functionName.name,kind:Fm.SymbolKind.Function,range:Q(this),selectionRange:Q(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(t)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}isTrue(t){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&t.has(this.params[0].value)):super.isTrue(t)}};var _s=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||!se(this.currentToken?.uri,e.uri))return;let s=this.currentToken,i=s;for(;this.currentToken?.pos.line===r;)i=this.moveToNextToken;if(t){let o=new F(G(s,i));this._issues.push(C(22,o))}return i};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this._issues=[]}get issues(){return this._issues}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;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(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){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 t=[];return e.every(r=>{let s=this.currentToken,i=r(s),o=!1;return i!=="no"&&s&&(t.push(s),this.moveToNextToken,o=en(s,this.currentToken)),i==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],r,s=!0;for(;e.some(i=>i(this.currentToken)==="yes"&&s);)t.push(this.currentToken),r=this.currentToken,this.moveToNextToken,s=en(r,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let r=[],s=(i,o,a)=>{if(!a?.start||!a?.end||!se(a.start.uri,t)||!se(a.end.uri,t))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:i,tokenModifiers:o})};this.allAstItems.forEach(i=>{i.buildSemanticTokens(s)}),r.sort((i,o)=>i.line===o.line?i.char-o.char:i.line-o.line).forEach(i=>e.push(i.line,i.char,i.length,i.tokenType,i.tokenModifiers))}processCIdentifier(e,t){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Re));if(!r.length){this.popStack();return}let s=r.map(o=>o.value).join("");if(!s.match(/^[_A-Za-z]/)){this.popStack();return}let i=new qt(s,G(r[0],r.at(-1)));return!t&&i.name!=="defined"&&(e.get(i.name)||this._issues.push(C(42,i))),this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,r;if(L(e,40)?(r="&",L(this.currentToken,40)&&(r="&&",t=this.moveToNextToken)):L(e,10)?(r="!",L(this.currentToken,0)&&(r="!=",t=this.moveToNextToken)):L(e,8)?(r="|",L(this.currentToken,8)&&(r="||",t=this.moveToNextToken)):L(e,9)?r="^":L(e,4)?(r=">",L(this.currentToken,4)?(r="<<",t=this.moveToNextToken):L(this.currentToken,0)&&(r=">=",t=this.moveToNextToken)):L(e,5)?(r="<",L(this.currentToken,5)?(r=">>",t=this.moveToNextToken):L(this.currentToken,0)&&(r="<=",t=this.moveToNextToken)):L(e,15)?r="+":L(e,16)?r="-":L(e,17)?r="*":L(e,13)?r="/":L(e,18)?r="%":L(e,46)?L(this.currentToken,46)&&(r="##",t=this.moveToNextToken):L(e,0)&&L(this.currentToken,0)&&(r="==",t=this.moveToNextToken),r){let s=new ld(r,G(e,t));return this.mergeStack(),s}this.popStack()}parseScopedBlock(e,t,r){this.enqueueToStack();let s=this.moveToNextToken;if(!s||!e(s)){this.popStack();return}let i=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=i},a=p=>p.flatMap(b=>"items"in b?a(b.items):b),c=[s],l=[];l[0]={rewind:o,tokens:[]};let u=this.currentToken;for(;u&&!t(u);){if(r?.(u)){let p=this.peekIndex()+1,b=()=>{this.positionStack[this.positionStack.length-1]=p};c.push(u),l[l.length]={rewind:b,tokens:[]}}else if(e(u)){let p=this.parseScopedBlock(e,t,r);p&&(c.push(p),l[l.length-1].tokens.push(...a(p.items))),u=this.currentToken;continue}else c.push(u),l[l.length-1].tokens.push(u);this.moveToNextToken,u=this.currentToken}let d=u;d&&t(d)&&(this.moveToNextToken,c.push(d));let f={startToken:s,items:c,splitTokens:l,endToken:d};return this.mergeStack(),f}isFunctionCall(e){this.enqueueToStack();let t=this.processCIdentifier(e,!1);if(!t){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}if(t.name==="defined")r.length>1?this._issues.push(C(44,t)):r.length<1&&this._issues.push(C(45,t));else{let i=e.get(t.name)?.macro;i&&(i?.identifier instanceof Ts?r.length>i.identifier.params.length?this._issues.push(C(44,t,void 0,[i])):r.length<i.identifier.params.length&&this._issues.push(C(45,t,void 0,[i])):this._issues.push(C(43,t)))}let s=new Ss(t,r);return s.lastToken=this.prevToken,this.mergeStack(),s}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([et("0"),et("x")]);if(e.length!==2){this.popStack();return}let t=this.consumeAnyConcurrentTokens([19,20].map(Re));if(!t.length){this.popStack();return}let r=Number.parseInt(t.map(i=>i.value).join(""),16),s=new kt(r,G(e[0],t.at(-1)));return this.mergeStack(),s}processDec(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19].map(Re));if(!e.length){this.popStack();return}let t=Number.parseInt(e.map(s=>s.value).join(""),10),r=new kt(t,G(e[0],e.at(-1)));return this.mergeStack(),r}processEnclosedExpression(e){this.enqueueToStack();let t,r,s;if(L(this.currentToken,42))return t=this.moveToNextToken,r=t,s=this.processExpression(e,!0),s&&(s=new oi(new oi(s,!0),!1)),L(this.currentToken,43)?r=this.moveToNextToken:this._issues.push(C(26,new F(G(t)))),this.mergeStack(),s;this.popStack()}processExpression(e,t=!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(t){let s=this.isOperator();for(;s;){let i=this.processExpression(e);i?r instanceof oi?r.addExpression(s,i):r=new oi(r,!1,{operator:s,expression:i}):this._issues.push(C(27,s)),s=this.isOperator()}}return this.mergeStack(),r}processMacroCallParams(){if(!L(this.currentToken,42))return;let e=this.parseScopedBlock(r=>!!L(r,42),r=>!!L(r,43),r=>!!L(r,24));return e?.items.length===2&&L(e.endToken,43)?[]:e?.splitTokens.map((r,s)=>r.tokens.length===0?null:new wr(r.tokens.map((i,o)=>{let a=i.value;return i.pos.line===r.tokens.at(o+1)?.pos.line&&(a=a.padEnd(r.tokens[o+1].pos.col-i.pos.col," ")),a}).join(""),G(r.tokens[0],r.tokens.at(-1)),s))}};var fd=class n extends _s{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let r=0;r<this.tokens.length;r++){let s=n.processBlockComments(this.tokens,r)||n.processLineComments(this.tokens,r);s&&(r=s.index,t.push(...s.tokenUsed),this.comments.push(...s.comments))}t.reverse().forEach(r=>this.tokens.splice(r,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=sr().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,r){let s=[],i=()=>(s.push(r++),t[r]),o=()=>t[r],a=()=>t[r-1],c=o(),l=c;if(!c||!L(c,13)||(l=i(),!L(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!L(a(),17)||!L(o(),13)||!en(a(),o())),d=l.pos.line,f=c,p=[];l=i();do{if(o()?.pos.line!==d){let g=new _r(G(f,a()));p.push(g),d=o().pos.line??0,f=o()}l=i()}while(r<t.length&&!u());let b=new _r(G(f,o()));return p.push(b),i(),{comments:p,tokenUsed:s,index:r-1}}static processLineComments(t,r){let s=[];if(!L(t[r],13)||t.length===r+1||!L(t[r+1],13)||!en(t[r],t[r+1]))return;let i=[];for(;t[r].pos.line===t.at(r+1)?.pos.line;)s.push(r++);s.push(r++);let o=t[s.at(-1)],a=new _r(G(t[s[0]],t[s.at(-1)]));return i.push(a),{comments:i,tokenUsed:s,index:r-1}}};var zk=H(J()),hd=class extends F{constructor(t,r){super(t);this.content=r}toString(){let t=this.content.filter(r=>!L(r,14));return t.map((r,s)=>{let i=r.value;return r.pos.line===t.at(s+1)?.pos.line?i=i.padEnd(t[s+1].pos.col-r.pos.col," "):t.at(s+1)&&(i=i.padEnd(i.length+1," ")),i}).join("")}},Ma=class extends F{constructor(t,r,s){super();this.keyword=t;this.identifier=r;this.content=s;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof qt?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:zk.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
272
|
+
`)}}};var li=class extends F{constructor(e){super(e)}},xa=class extends F{constructor(t,r){super();this.keyword=t;this.content=r;this.active=!1;this.addChild(t)}},$a=class extends xa{constructor(t,r,s){super(t,s);this.identifier=r;this.addChild(r),this.addChild(s)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},pd=class extends xa{constructor(t,r,s){super(t,s);this.expression=r;this.addChild(r),this.addChild(s)}useBlock(t){return this.expression instanceof Ss?this.expression.functionName.name==="defined"?this.expression&&t.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(t):this.expression?.isTrue(t)}},md=class extends $a{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},La=class extends xa{};var bo=class extends F{constructor(t,r,s){super();this.ifDef=t;this.endIf=r;this.elseOption=s;this.addChild(t),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(t,r){let s=[],i=a=>r.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:i(this.tokenIndexes.start),end:i(this.tokenIndexes.end)}];s.push({start:i(this.ifDef.tokenIndexes.start),end:i(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&s.push({start:i(this.ifDef.content.tokenIndexes.start),end:i(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(s.push({start:i(this.elseOption.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)})),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}},ws=class extends F{constructor(t,r,s){super();this.ifBlocks=t;this.endIf=r;this.elseOption=s;t.forEach(i=>this.addChild(i)),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(t,r){let s=[],i=a=>r.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach((a,c)=>{s.push({start:i(a.tokenIndexes.start),end:i(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(t)?(a.active=!0,o=!0):a.content&&s.push({start:i(a.content.tokenIndexes.start),end:i(a.content.tokenIndexes.end)})}),this.elseOption&&(s.push({start:i(this.elseOption.keyword.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content?s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)}):this.elseOption.active=!0),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}};var qa=H(J());var So=class extends _s{constructor(t,r,s){super();this.uri=t;this.incudes=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;s&&(Array.from(s).forEach(([i,o])=>this.macroSnapShot.set(i,o)),Array.from(s).forEach(([i,o])=>this.macros.set(i,o)))}get currentToken(){let t=this.prevToken,r=Tr(t,this.tokens.at(this.peekIndex()))||!t||L(t,14)&&t.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!r))return this.macroStart&&L(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(t){super.reset(),this.macros.clear(),t?(this.macroSnapShot.clear(),Array.from(t).forEach(([r,s])=>this.macroSnapShot.set(r,s)),Array.from(t).forEach(([r,s])=>this.macros.set(r,s))):Array.from(this.macroSnapShot).forEach(([r,s])=>this.macros.set(r,s)),this.nodes=[],this.dtsIncludes=[]}async reparse(t){let r=this.stable;return this.parsing=new Promise(s=>{r.then(()=>{if(t&&t.size===this.macroSnapShot.size){let i=Array.from(t);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=i[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),s();return}}this.reset(t),this.parse().then(s)})}),this.parsing}async parse(){let t=new fd(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),!(!this.prevToken||this.prevToken.pos.line!==this.currentToken?.pos.line||!se(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let r=this.currentToken,s=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!s),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),r=this.moveToNextToken;if(!r||!L(r,25))return this.popStack(),!1;this.macroStart=!0;let s=new nt(G(r)),i=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(C(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new hd(G(o[0],o.at(-1)),o));let c=new Ma(s,i,a);this.macros.set(c.name,{macro:c,resolver:KE(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let t=this.peekIndex(),r=this.moveToNextToken;if(!r||!L(r,28))return this.popStack(),!1;this.macroStart=!0;let s=new nt(G(r)),i=this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(C(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=new Ma(s,i);this.macros.delete(i.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(t,a-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let t=[];for(;this.currentToken;){let r=this.moveToNextToken;r&&t.push(r)}return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier(this.macros,!0);if(!t){this.popStack();return}let r=this.moveToNextToken;if(!L(r,42)||!en(t.lastToken,r)){this.popStack();return}let s=[],i=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;i;)s.push(i),!L(this.currentToken,24)&&!L(this.currentToken,43)?this._issues.push(C(28,i)):L(this.currentToken,43)||(r=this.moveToNextToken),i=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new Ts(t,s);return L(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(C(26,s.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([Re(45),Re(45),Re(45)]);if(t.length!==3){this.popStack();return}let r=new ud(G(t[0],t.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let t=this.peekIndex(),r=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>L(o,a))&&!Tr(o.prevToken,o),o=>!!o&&[37].some(a=>L(o,a))&&!Tr(o.prevToken,o),o=>!!o&&[36,35].some(a=>L(o,a))&&!Tr(o.prevToken,o));if(!r)return;let s;L(r.startToken,32)?s=this.processIfBlock(r,(o,a,c)=>new pd(o,a??null,c)):s=this.processIfDefBlock(r,(o,a,c)=>L(r.startToken,33)?new $a(o,a??null,c):new md(o,a??null,c)),this.nodes.push(s),s.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...s instanceof ws?s.ifBlocks:[s.ifDef],...s.elseOption?[s.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(C(47,o.content,qa.DiagnosticSeverity.Hint,[],[qa.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=t}processIfDefBlock(t,r){this.enqueueToStack(),this.macroStart=!0;let s=new nt(G(t.startToken));t.splitTokens[0].rewind();let i=this.processCIdentifier(this.macros,!0);i||this._issues.push(C(31,s)),this.macroStart=!1;let o,a=i?.lastToken.nextToken??s.lastToken.nextToken;a&&t.splitTokens[0].tokens.find(f=>f===a)&&(o=new li(G(a,t.splitTokens[0].tokens.at(-1))));let c=r(s,i??null,o??null),l;if(t.splitTokens.length>1){let f=t.splitTokens[1].tokens[0].prevToken,p=new nt(G(f)),b;t.splitTokens[1].tokens.length&&(b=new li(G(t.splitTokens[1].tokens[0],t.splitTokens[1].tokens.at(-1)))),l=new La(p,b??null)}let u;t.endToken?u=new nt(G(t.endToken)):this._issues.push(C(46,s));let d=new bo(c,u??null,l);return this.mergeStack(),d}processIfBlock(t,r){this.enqueueToStack();let s=new nt(G(t.startToken)),i=[],o;t.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new nt(G(d));this.macroStart=!0;let p=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===t.splitTokens.length-1&&L(d,36)){let g=d,S=new nt(G(g)),E;l.tokens.length&&(E=new li(G(l.tokens[0],l.tokens.at(-1)))),o=new La(S,E??null)}else{p||this._issues.push(C(31,s));let g,S=p?.lastToken.nextToken??s.lastToken.nextToken;S&&l.tokens.find(T=>T===S)&&(g=new li(G(S,t.splitTokens[u].tokens.at(-1))));let E=r(f,p??null,g??null);i.push(E)}});let a;t.endToken?a=new nt(G(t.endToken)):this._issues.push(C(46,s));let c=new ws(i,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,To.resolve)((0,To.dirname)(t.uri),t.path.path),...this.incudes.map(r=>(0,To.resolve)(r,t.path.path))].find(r=>(0,Bm.existsSync)(r)):this.incudes.map(r=>(0,To.resolve)(r,t.path.path)).find(r=>(0,Bm.existsSync)(r))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let s=r,i=r;if(L(r,26))this.moveToNextToken;else{let g=this.checkConcurrentTokens([Re(13),et("include"),Re(13)]);if(g.length!==3)return this.popStack(),!1;s=g[0],i=g.at(-1)}let o=s,a=new nt(G(s,i));r=this.moveToNextToken;let c=r,l=!!L(r,21);if(!c||!l&&!L(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&&!L(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new fo(u,l,G(c,r)),f=new gs(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!L(this.currentToken,4)?this._issues.push(C(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let p=this.peekIndex(),b=this.resolveInclude(f);if(f.resolvedPath=b,b||this._issues.push(C(36,f.path,qa.DiagnosticSeverity.Warning)),b){sr().requestTokens(b,!0);let g=await ja().getCPreprocessorParser(b,this.incudes,this.macros,this.uri);await g.stable,this._issues.push(...g.issues),this.macros.clear(),Array.from(g.macros).forEach(([S,E])=>this.macros.set(S,E)),b.endsWith(".h")?this.tokens.splice(t,p-t):this.tokens.splice(t,p-t,...g.tokens),this.nodes.push(...g.nodes),this.dtsIncludes.push(...g.dtsIncludes)}else this.tokens.splice(t,p-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var Gk,Um=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,t,r,s){e=Je(e);let i=`${Array.from(r).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(i);if(o)return o.reparse(r),o;console.log("No cpreprocess cache",e);let a=new So(e,t,r),c=this.includeOwners.get(a)??new Set;return c.add(s),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(i,a),a}reset(e){e=Je(e);let t=this.headerFiles.get(e);t&&Array.from(t).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 ja(){return Gk??=new Um,Gk}var Yk,Vm=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(r=>({...r}));return t.forEach((r,s)=>{r.prevToken=t[s-1],r.nextToken=t[s+1]}),t}needsRenew(e,t){return e=Je(e),this.fileMap.get(e)?.text!==t}renewLexer(e,t){if(e=Je(e),ja().reset(e),!e||!(0,gd.existsSync)(e))return[];try{t??=(0,gd.readFileSync)(e).toString();let r=new cd(t,e);return this.fileMap.set(e,r),n.clone(r.tokens)}catch{}return[]}requestTokens(e,t){e=Je(e);let r=this.fileMap.get(e)?.tokens;return!r&&t?[...this.renewLexer(e)]:n.clone(r??[])}reset(e){e=Je(e),ja().reset(e),this.fileMap.delete(e)}};function sr(){return Yk??=new Vm,Yk}var _o=class n{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new Te(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAst(e){let t=this.fileTopMostAstCache.get(e);if(t)return t;let r=[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.parser.cPreprocessorParser.allAstItems,...this.context.overlayParsers.flatMap(s=>s.cPreprocessorParser.allAstItems)].flatMap(s=>s.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,r),r}getDeepestAstNode(e,t){let s=this.fileTopMostAst(e).find(i=>En(i,e,t)||WE(sr().requestTokens(e,!1),i,t));if(s instanceof At){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:br(s,e,t)}}else if(s instanceof pt&&s.path){let i=this.rootNode.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s instanceof Ne&&s.path){let i=n.getNodeFromPath(s.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s)return{runtime:this,item:null,ast:br(s,e,t)}}static getNodeFromPath(e,t,r=!0){if(e.length===0)return t;let s=e[0].split("@"),i=s[0],a=s.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=t.getNode(i,a,r);return l?n.getNodeFromPath(c,l,r):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(t??=this.rootNode.allDescendantsLabels,t.find(i=>i.label.value===e.at(0)?.slice(1)&&i.parentNode instanceof Be)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{t.has(r.label.label.value)?t.get(r.label.label.value)?.push(r):t.set(r.label.label.value,[r])}),Array.from(t).forEach(r=>{let s=r[1];if(s.length>1){let i=s.find(a=>a.owner instanceof Te);(!s.every(a=>a&&a.owner===i?.owner)||!i)&&e.push(C(4,s.at(0).label,Jk.DiagnosticSeverity.Error,s.slice(1).map(a=>a.label),[],[s.at(0).label.label.value]))}}),e}get typesIssues(){let e=t=>[...t.nodeType?.getIssue(this,t)??[],...t.nodes.flatMap(r=>e(r))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return HE([...e.definitions,...e.referencedBy],this.context)}};var Xk=H(J()),yd=class extends F{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:Xk.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(t=>t?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(t=>t?.toJson())}};var Qk=H(J()),vd=class extends F{constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:Qk.SymbolKind.Function}}};var Er=class extends F{constructor(t,r){super();this.value=t;this.labels=r;this.labels.forEach(s=>{this.addChild(s)}),this.addChild(this.value)}toString(t){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toString(t)??"NULL"}`}toPrettyString(t){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toPrettyString(t)??"NULL"}`}};var Zk=H(J()),bd=class extends F{constructor(t,r,s){super();this.keyword=t;this.startAddress=r;this.endAddress=s;this.addChild(t),this.docSymbolsMeta={name:"Memreserve",kind:Zk.SymbolKind.Function},this.addChild(r),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var eN=H(J()),Td=class extends F{constructor(t,r){super();this.keyword=t;this.bitsSize=r;this.addChild(t),this.docSymbolsMeta={name:"bits",kind:eN.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var tN=H(J()),Fa=class extends _s{constructor(t,r,s){super();this.uri=t;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new Be;this.unhandledStatements=new pt;this.cPreprocessorParser=new So(this.uri,this.incudes,s)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.resolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new Be,this._issues=[],this.unhandledStatements=new pt}async reparse(){let t=performance.now(),r=this.stable;return this.parsing=new Promise(s=>{r.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),s()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,Je(this.uri).endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let r=async()=>{if(!(this.isDtsDocumentVersion()||this.isMemreserve()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let s=this.moveToNextToken;if(s){let i=new F(G(s));this._issues.push(C(22,i)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(s=>{this._issues.push(C(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(C(33,s))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let r=this.moveToNextToken,s=r,i=13;if(!r||!L(r,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!L(s,i))return this.popStack(),!1;let o=new pt;o.openScope=s,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??s;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let r=this.currentToken;if(L(r,3))this.moveToNextToken;else{let s=this.prevToken;if(s){let i=new F(G(s));this._issues.push(C(3,i))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return L(this.currentToken,3)||L(this.currentToken,1)}endStatement(t=!0){let r=this.currentToken;if(!L(r,1)){let s=this.prevToken;if(s&&t){let i=new F(G(this.prevToken));return this._issues.push(C(1,i)),s}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;L(this.currentToken,1);){let t=this.moveToNextToken;if(t){let r=new F(G(t));this._issues.push(C(23,r))}}}processNode(t,r){if(this.done)return!1;let s=!1,i=!1;do{if(i=this.isChildNode(t,r)||this.isProperty(t)||this.isDeleteNode(t,r)||this.isDeleteProperty(t),!i&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new F(G(o));this._issues.push(C(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;s=s||i}while(!this.isNodeEnd());return s}processOptionalLabelAssign(t=!1){let r=[],s=this.isLabelAssign(t);for(;s;)r.push(s),s=this.isLabelAssign(t);return r}isChildNode(t,r){this.enqueueToStack();let s;r==="Name"&&(s=this.isOmitIfNoRefNode());let i=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new At(i):new Ne(i,s);if(r==="Ref"?a=this.isLabelRef():r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!L(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(C(r==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof At?(c.labelReference=a,l=!0):o&&c instanceof Ne&&(l=o.address!==void 0,c.name=o),L(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(C(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let t=this.prevToken,r=this.consumeAnyConcurrentTokens([19,20].map(Re)),s=r.length?Number.parseInt(r.map(o=>o.value).join(""),16):NaN;if(t){if(Number.isNaN(s)){let o=new F(G(t));this._issues.push(C(8,o))}else if(!Number.isNaN(s)&&!en(t,r[0])){let o=new F(G(t,r.at(0)));this._issues.push(C(29,o))}}return new Zu(s,G(r[0]??this.prevToken,r.at(-1)))}processNodeAddresses(t){this.enqueueToStack();let r=this.checkConcurrentTokens([Re(49)]);if(r.length){if(!en(t.lastToken,r[0])){let o=new F(G(t.lastToken,r[0]));this._issues.push(C(29,o))}let s=[],i=()=>{if(s.push(this.processNodeAddress()),L(this.currentToken,24)){if(this.prevToken&&!en(this.prevToken,this.currentToken)){let o=new F(G(this.prevToken,this.currentToken));this._issues.push(C(29,o))}this.moveToNextToken,i()}};return i(),this.mergeStack(),s}this.popStack()}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Re));if(!t.length){this.popStack();return}let r=t.map(o=>o.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new Ie(r,G(t[0],t.at(-1))),i=this.processNodeAddresses(s);return s.address=i,this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Re));if(!t.length){this.popStack();return}let r=new Fe(t.map(s=>s.value).join(""),G(t[0],t.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(Re));if(!t.length){this.popStack();return}let r=t.map(i=>i.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new Lt(r,G(t[0],t.at(-1)));return this.mergeStack(),s}isLabelAssign(t){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Re));if(!r.length){this.popStack();return}let s=r.map(c=>c.value).join("");if(!s.match(/^[A-Za-z]/)){this.popStack();return}let i=this.currentToken,o=i&&L(i,50),a=new bs(new Lt(s,G(r[0],r.at(-1))),G(r[0],o?i:r.at(-1)));if(o){let c=r.at(-1);c&&(i.pos.line!==a.firstToken.pos.line||i.pos.col!==c.pos.colEnd)&&this._issues.push(C(29,new F(G(c,i)))),this.moveToNextToken}else if(t)this._issues.push(C(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(),s=this.isPropertyName();if(!s)return this.popStack(),!1;if(L(this.currentToken,2)||L(this.currentToken,49))return this.popStack(),!1;let i=new Ae(s,r),o;L(this.currentToken,0)?(i.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(i),o?.values.filter(c=>!!c).length||this._issues.push(C(0,i)),i.values=o??null):i.values=void 0;let a=this.endStatement();return i.lastToken=a,t.addNodeChild(i),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([Re(13),et("d"),et("ts"),Re(16),et("v"),et("1")]);if(t.length!==6)return this.popStack(),!1;let r=t[0],s=r,i=new nt;i.firstToken=r;let o=new vd(i);if(this.others.push(o),L(this.currentToken,13))s=this.moveToNextToken;else return i.lastToken=t.at(-1),this._issues.push(C(21,o)),this.mergeStack(),!0;return i.lastToken=s,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let t=this.checkConcurrentTokens([Re(13),et("memreserve")]);if(t.length!==2)return this.popStack(),!1;let r=new nt;r.firstToken=t[0];let i=t[0];L(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=t.at(-1),this._issues.push(C(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new bd(r,o,a);return this.others.push(c),o||this._issues.push(C(37,r)),a||this._issues.push(C(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let t=this.checkConcurrentTokens([Re(13),et("b"),et("its")]);if(t.length!==3){this.popStack();return}let r=new nt;r.firstToken=t[0];let i=t[0];L(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=t.at(-1),this._issues.push(C(21,r)));let o=this.processDec(),a=new Td(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(C(40,o)):this._issues.push(C(39,r)),this._issues.push(C(41,a,tN.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([Re(13),et("omit"),Re(16),et("if"),Re(16),et("no"),Re(16),et("ref"),Re(13)]);if(t.length!==9){this.popStack();return}let r=new nt(G(t[0],t.at(-1)));return this.mergeStack(),r}isDeleteNode(t,r){this.enqueueToStack();let s=this.checkConcurrentTokens([Re(13),et("d"),et("e"),et("lete"),Re(16),et("node")]);if(!s.length)return this.popStack(),!1;let i=s[0],o=i,a=new nt;if(a.firstToken=i,s.length===1&&!L(this.currentToken,2)){this._issues.push(C(25,a)),a.lastToken=s.at(-1);let d=new pn(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=s.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=s.at(-1),c!=="/delete-node"?this._issues.push(C(c.startsWith("/delete-n")?34:25,a)):L(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(C(21,a));let l=new pn(a);if(Tr(a.tokenIndexes?.end,i)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(C(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(C(7,f));let p=d||f?void 0:this.isNodeName();p&&r==="Ref"&&this._issues.push(C(10,p)),!d&&!p&&!f&&this._issues.push(C([7,10],l)),l.nodeNameOrRef=d??f??p??null}else r==="Name"?this._issues.push(C(7,a)):r==="Ref"&&this._issues.push(C(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let r=this.checkConcurrentTokens([Re(13),et("d"),et("e"),et("lete"),Re(16),et("property")]);if(!r.length)return this.popStack(),!1;let s=r[0],i=s,o=new nt;if(o.firstToken=s,r.length===1&&!L(this.currentToken,2)){this._issues.push(C(25,o)),o.lastToken=r.at(-1);let u=new We(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=r.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=r.at(-1),a!=="/delete-property"?this._issues.push(C(a.startsWith("/delete-p")?35:25,o)):L(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(C(21,o));let c=new We(o);if(Tr(o.tokenIndexes?.end,s)){let u=this.isPropertyName();u||this._issues.push(C(6,c)),c.propertyName=u??null}else this._issues.push(C(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.processNodePathRef();if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let i=new nn(t,r,s);return this.mergeStack(),i}processValue(t){this.enqueueToStack();let s=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!L(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=L(this.currentToken,24);if(d)this.moveToNextToken;else if(!Tr(this.prevToken,this.currentToken))break;let f=o();if(u&&f===null&&d){let p=new F(G(u,this.currentToken));this._issues.push(C(0,p))}if(!d&&f===null)break;if(l&&!d&&f){let p=new F(G(l));this._issues.push(C(28,p))}c.push(f)}return c})();if(s.length===0){this.popStack();return}return this.mergeStack(),new yd(s)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.moveToNextToken;if(!L(r,21)){this.popStack();return}if(!r?.value)throw new Error("Token must have value");let s=r.value;s.match(/["']$/)&&(s=s.slice(1,-1));let i=new Oe(s,G(r));r.value.match(/["']$/)||this._issues.push(C(r.value.startsWith('"')?16:17,i));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new nn(t,i,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.processBits(),i=this.currentToken;if(L(i,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(t)??null;o.openBracket=i;let a=this.processOptionalLabelAssign(!0)??[],c=new nn(r,o,a,s);L(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(C(12,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,s=r;if(!L(s,11)){this.popStack();return}let i=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];i.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this._issues.push(C(15,u))});let a=new ms(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=r,this._issues.push(C(14,a)));let c=new nn(t,a,o);L(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(C(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=r,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let r=t(),s=[];if(!r)return this.popStack(),[];for(;r;)s=[...s,r],r=t();if(s){let i=t();i&&(s=[...s,i])}return this.mergeStack(),s}processArrayValues(t){this.enqueueToStack();let r=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),s=new Tt(r);return r.length===0&&(s.firstToken=this.currentToken),this.mergeStack(),s}processLabeledHex(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.processHex();if(!s){this.popStack();return}let i=new Er(s,r);return this.mergeStack(),i}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(Re));if(!r.length){this.popStack();return}let s=Number.parseInt(r.map(a=>a.value).join(""),16),i=new kt(s,G(r[0],r.at(-1))),o=new Er(i,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.processDec();if(!s){this.popStack();return}let i=new Er(s,r);return this.mergeStack(),i}processLabeledExpression(t=!0,r=t){this.enqueueToStack();let s=[];t&&(s=this.processOptionalLabelAssign(r));let i=this.processExpression(this.cPreprocessorParser.macros);if(!i){this.popStack();return}let o=new Er(i,s);return this.mergeStack(),o}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),r=this.processExpression(this.cPreprocessorParser.macros);if(!r){this.popStack();return}let s=this.processOptionalLabelAssign(!0),i=new nn(t,r,s);return this.mergeStack(),i}isLabelRef(t){this.enqueueToStack();let r=this.currentToken;if(L(r,40))this.moveToNextToken;else{this.popStack();return}let s=this.isLabelName();if(!s){let o=new ge(null);return this._issues.push(C(18,t??o)),o.firstToken=r,this.mergeStack(),o}r&&(s.firstToken.pos.line!==r.pos.line||s.firstToken.pos.col!==r.pos.colEnd)&&this._issues.push(C(29,new F(G(r,s.firstToken))));let i=new ge(s);return i.firstToken=r,this.mergeStack(),i}isLabelRefValue(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.isLabelRef(t);if(!s){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(i=this.processOptionalLabelAssign(!0));let o=new nn(r,s,i);return this.mergeStack(),o}processRefValue(t,r){this.enqueueToStack();let s=this.processOptionalLabelAssign(t),i=this.currentToken;if(!L(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new Er(o,s);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(C([18,9],r));let l=new Er(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new Er(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(t=!0,r=new Hr){this.enqueueToStack();let s;if(L(this.currentToken,13))s=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this._issues.push(C(19,new F(G(this.prevToken))))}let i=this.isNodeName();if(i||this._issues.push(C(7,new F(G(s??this.prevToken)))),r.addPath(i??null,s?new F(G(s)):void 0),t&&!s&&r.children.length===0){this.mergeStack();return}return this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,r=t;if(!L(r,40)){this.popStack();return}let s=this.moveToNextToken;if(r=s,!L(r,2)){this.popStack();return}let i=this.processNodePath(),o=new kn(i??null),a=this.currentToken??this.prevToken,c=a;return i?.children.forEach((l,u)=>{if(u===i?.children.length-1&&l&&c&&!en(l.lastToken,c)){this._issues.push(C(29,new F(G(l.lastToken,c))));return}if(u===0&&s&&!en(s,l?.firstToken)){this._issues.push(C(29,new F(G(s,l?.firstToken))));return}let d=i?.children[u+1];l&&d&&!en(l.lastToken,d.firstToken)&&this._issues.push(C(29,new F(G(l.lastToken,d?.firstToken))))}),L(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(C(3,new F(G(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof gs)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var wo=H(J());var nN=require("fs");var rN=require("path"),Sd=class{constructor(e,t){this.settings=e;this.bindingLoader=t;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,rN.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=r.overlays,this.overlays.filter(nN.existsSync),this.parser=new Fa(r.dtsFile,r.includePaths),this.ctxNames_.add(r.ctxName),this.id=Vr(r),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(s=>new Fa(s,r.includePaths,this.parser.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,t=s=>({file:s,includes:(e.get(s)??[]).map(i=>t(i.resolvedPath??i.path))});return(await this.getRuntime()).includes.forEach(s=>{let i=e.get(s.uri);i||(i=[],e.set(s.uri,i)),i.push({path:s.path.path,resolvedPath:s.resolvedPath})}),{mainDtsPath:t(this.parser.uri),overlays:this.overlays.map(t)}}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(t=>se(t,e))}getUriParser(e){let t=this.overlayParsers.find(r=>r.getFiles().some(s=>se(s,e)));return t??=this.parser.getFiles().some(r=>se(r,e))?this.parser:void 0,t}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,t){if(!this.isInContext(e))return[];let s=(await this.getRuntime()).rootNode.allBindingsProperties.filter(i=>se(i.ast.uri,e)&&(!t||En(i.ast,e,t))).flatMap(i=>i.ast.values?.values.flatMap(o=>{let c=i.parent?.nodeTypes.find(l=>o?.value instanceof Oe&&l.compatible===o.value.value);return c?{range:Q(o.value),target:ue(c.bindingsPath)}:void 0})).filter(i=>i)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(i=>se(i.uri,e)&&(!t||En(i,e,t))).map(i=>{let o=this.parser.cPreprocessorParser.resolveInclude(i);if(o)return{range:Q(i.path),target:ue(o)}}).filter(i=>i)??[],...s]}linkPropertiesLabelsAndNodePaths(e){let t=i=>[...i.property,...i.nodes.flatMap(t)],r=t(e.rootNode),s=e.rootNode.allDescendantsLabels;r.forEach(i=>i.ast.allDescendants.forEach(o=>{if(o instanceof ge){let a=e.resolvePath([`&${o.label?.value}`],s);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(C(3,o,wo.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof Hr){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let f=a?.getNode(d.name,d.address?.map(p=>p.address),!1);d.linksTo=f,!u&&!f&&(u=!0,this._issues.push(C(8,d,wo.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(p=>p?.linksTo).map(p=>p?.toString()).join("/")}`]))),f?.linkedNodeNamePaths.push(d),a=f}else break}}}))}async reevaluate(e){let t=this.getUriParser(e);return t?(this.sortKeys=new WeakMap,await t.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 t=new _o(this);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof _r),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,s)=>this.sortKeys.set(r,s)),this.linkPropertiesLabelsAndNodePaths(t),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),t}processRoot(e,t){for(let r=0;r<e.children.length;r++){let s=e.children[r];this.processChild(s,t.rootNode,t)}}processChild(e,t,r){e instanceof Be?this.processDtcBaseNode(e,t,r):e instanceof Ae?this.processDtcProperty(e,t,r):e instanceof pn?this.processDeleteNode(e,t,r):e instanceof We&&this.processDeleteProperty(e,t,r)}checkNodeUniqueNames(e,t){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address.every((l,u)=>a.address?.at(u)?.address===l))),s=t.nodes.map(o=>({name:o.name,address:o.address})),i=[];e.children.forEach(o=>{if(o instanceof Ne&&o.name)r(i.map(a=>({name:a.name,address:a.address?.map(c=>c.address)})),o.name)&&this._issues.push(C(2,o.name)),i.push(o.name);else if(o instanceof pn&&o.nodeNameOrRef instanceof Ie){let a=o.nodeNameOrRef;r(s,a)&&(i=i.filter(c=>r(i.map(l=>({name:l.name,address:l.address?.map(u=>u.address)})),c)))}})}processDtcBaseNode(e,t,r){e instanceof pt?this.processDtcRootNode(e,r):e instanceof Ne?this.processDtcChildNode(e,t,r):e instanceof At&&this.processDtcRefNode(e,r)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((r,s)=>r instanceof Ae&&s instanceof We||s instanceof Ae&&r instanceof We?0:s instanceof Ae?1:0).forEach(r=>this.processChild(r,t.rootNode,t))}processDtcChildNode(e,t,r){if(e.name?.name){let s=e.path?r.resolvePath(e.path):void 0,o=(s?r.rootNode.getChild(s):void 0)??new Te(this.bindingLoader,e.name.name,e.name.address?.map(a=>a.address),t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((s,i)=>s instanceof Be&&i instanceof Be?0:s instanceof Be?-1:0).forEach(s=>this.processChild(s,t,r))}processDtcRefNode(e,t){let r;if(e.labelReference){let s=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);s?(e.resolveNodePath??=[...s],r=t.rootNode.getChild(s),e.labelReference.linksTo=r,e.labels.forEach(i=>i.lastLinkedTo=r),r?.linkedRefLabels.push(e.labelReference),r?.referencedBy.push(e),e.labels.forEach(i=>{t.labelsUsedCache.set(i.label.value,s)}),r?(t.references.push(e),this.checkNodeUniqueNames(e,r)):t.unlinkedRefNodes.push(e)):(this._issues.push(C(3,e.labelReference,wo.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((s,i)=>s instanceof Be&&i instanceof Be?0:s instanceof Be?-1:0).forEach(s=>this.processChild(s,r??new Te(this.bindingLoader,""),t))}processDtcProperty(e,t,r){e.propertyName?.name&&t.addProperty(new He(e,t)),e.children.forEach(s=>this.processChild(s,t,r))}processDeleteNode(e,t,r){if(e.nodeNameOrRef instanceof Ie&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(s=>s.address)))this._issues.push(C(5,e.nodeNameOrRef));else{t.deletes.push(e);let s=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(i=>i.address));e.nodeNameOrRef.linksTo=s,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address?.map(i=>i.address)),s?.labels.forEach(i=>{r.labelsUsedCache.delete(i.label.value)})}}else if(e.nodeNameOrRef instanceof ge&&e.nodeNameOrRef.value){let s=r.resolvePath([`&${e.nodeNameOrRef.value}`]),i;s?(i=r.rootNode.getChild(s),t.deletes.push(e),e.nodeNameOrRef.linksTo=i,i?.labels.forEach(o=>{r.labelsUsedCache.delete(o.label.value)}),i?.linkedRefLabels.push(e.nodeNameOrRef),i?.parent?.deleteNode(i.name,e,i.address),e.parentNode instanceof Be&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(C(3,e.nodeNameOrRef,wo.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof kn&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(s=>!s)){let s=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],i=r.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let f=i?.getNode(d.name,d.address?.map(p=>p.address),!1);d.linksTo=f,f?.linkedNodeNamePaths.push(d),i=f}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(r.unlinkedDeletes.push(e),c&&this._issues.push(C(8,c,wo.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{r.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof Be&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(s=>this.processChild(s,t,r))}processDeleteProperty(e,t,r){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(C(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(s=>this.processChild(s,t,r))}async toFullString(){return`/dts-v1/;
|
|
273
|
+
${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}};var mt=H(J());var sN=require("fs"),Eo=require("path");function Nx(n){if(!n||!(n.ast instanceof fo))return[];let e=r=>r.flatMap(s=>(0,sN.readdirSync)(s,{withFileTypes:!0,recursive:!0}).filter(i=>i.name.toLowerCase().endsWith(".dtsi")||i.name.toLowerCase().endsWith(".h")).map(i=>({label:`${(0,Eo.join)((0,Eo.relative)(s,i.parentPath),i.name)}`,kind:mt.CompletionItemKind.File})));if(n.ast.relative)return e([(0,Eo.dirname)(n.ast.uri)]);let t=n.runtime.context.settings.includePaths??[];return e(t)}var wd=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>wd(t.node,e)),...n.nodes.flatMap(t=>wd(t,e))],Wm=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>Wm(t.node,e)),...n.nodes.flatMap(t=>Wm(t,e))];function Px(n,e){if(!n||!(n.item instanceof He)||!(n.ast instanceof ge))return[];let t=r=>Wm(r,e);return Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:mt.CompletionItemKind.Method}))}function Rx(n,e){if(!n||n.item!==null||!(n.ast instanceof ge)||!(n.ast.parentNode instanceof At))return[];let t=r=>wd(r,e).filter(s=>e(s));return[...Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:r,insertText:`${r} {
|
|
258
274
|
$1
|
|
259
|
-
};`,kind:ft.CompletionItemKind.Value,insertTextFormat:ft.InsertTextFormat.Snippet}))]}function ox(r,e){let t=s=>s?s.parentNode instanceof Rt||s.parentNode instanceof dt||s.parentNode instanceof Re?!1:t(s.parentNode):!0;if(!r||r.item!==null||!St(r.ast)||!t(r.ast))return[];let n=s=>ud(s,e).filter(i=>e(i));return r.ast instanceof Qe?n(r.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:ft.CompletionItemKind.Keyword,insertTextFormat:ft.InsertTextFormat.Snippet,sortText:"~"}]:r.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:ft.CompletionItemKind.Keyword,insertTextFormat:ft.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(n(r.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:r.ast instanceof _e?`${s}`:`&${s}`,kind:ft.CompletionItemKind.Variable}))}function ax(r,e){if(!r||!(r.item instanceof Ee)||r.item===null||r.beforeAst&&(!(r.beforeAst?.parentNode instanceof Qt)||r.beforeAst?.parentNode instanceof Ue))return[];let t=n=>[...n.nodes,...n.deletedNodes.filter(s=>!e(s.by)).map(s=>s.node)].flatMap(s=>s.definitions.filter(i=>i instanceof Re)).filter(s=>e(s));return r.ast instanceof je||r.ast instanceof ur||r.beforeAst?.parentNode instanceof ur?Array.from(new Set(t(r.item).map(n=>n.name?.toString()))).map(n=>({label:`${n}`,kind:ft.CompletionItemKind.Variable})):t(r.item).length?[{label:"/delete-node/",kind:ft.CompletionItemKind.Keyword,insertTextFormat:ft.InsertTextFormat.Snippet,sortText:"~"}]:[]}function cx(r,e){if(!r||!(r.item instanceof Ee)||r.beforeAst&&(!(r.beforeAst?.parentNode instanceof Qt)||r.beforeAst?.parentNode instanceof ur))return[];let t=n=>[...n.property,...n.deletedProperties.filter(s=>!e(s.by)).map(s=>s.property)].flatMap(s=>[s,...s.allReplaced]).filter(s=>e(s.ast));return r.ast instanceof ze||r.ast instanceof Ue||r.beforeAst?.parentNode instanceof Ue?Array.from(new Set(t(r.item).map(n=>n.name))).map(n=>({label:`${n}`,kind:ft.CompletionItemKind.Variable})):t(r.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:ft.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:ft.InsertTextFormat.Snippet}]:[]}function lx(r,e){let t=r?.ast instanceof $n?r.ast:r?.ast.parentNode;if(!r||!t||!(t instanceof $n))return[];let n=t.pathParts.slice(0,-1);if(n.some(o=>!o))return[];let s=n.map(o=>o.toString());return(()=>{let o=r.runtime.rootNode.getChildFromScope(["/",...s],e);return[...o?.nodes.filter(a=>!St(r.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...s,o].join("/")}`,kind:ft.CompletionItemKind.Variable}))}var ld=r=>!r||r instanceof Ae?!1:r instanceof Zt||ld(r.parentNode);function ux(r){return!r||!(r.item instanceof Xe&&r.item.ast.assignOperatorToken)?[]:!ld(r?.ast)&&!(r.ast instanceof Ae&&r.item.ast.values===null)&&!ld(r.beforeAst)&&!ld(r.afterAst)?[]:r.item.parent.nodeType instanceof Dr?Array.from([r.runtime.context.parser,...r.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([n,s])=>s.macro.identifier instanceof fs?{label:`${s.macro.identifier.toString()} -> ${s.macro.content?.toString()??"__UNSET__"}`,insertText:`${s.macro.name}(${s.macro.identifier.params.map((i,o)=>i instanceof $t?`$${o+1}`:"").join(", ")})`,kind:ft.CompletionItemKind.Function,sortText:`~${s.macro.name}`,insertTextFormat:ft.InsertTextFormat.Snippet}:{label:s.macro.identifier.name,kind:ft.CompletionItemKind.Variable,sortText:`~${s.macro.name}`}):[]}async function KE(r,e,t,n){return Mt(r,e,(s,i)=>[...cx(s,i),...ax(s,i),...ox(s,i),...lx(s,i),...ix(s,i),...sx(s,i),...nx(s),...ux(s)],t,n)}var vn=z(J());function dx(r){if(!r||r.item===null||!(r.ast instanceof ze))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,t=n=>[n.ast,...n.allReplaced.map(s=>s.ast),n.parent.deletedProperties.find(s=>s.property=n)?.by??[]].map(s=>{if(s instanceof Ae)return vn.Location.create(ce(s.uri),Q(s.propertyName??s));if(s instanceof Ue)return vn.Location.create(ce(s.uri),Q(s.propertyName??s))}).filter(s=>s);if(r.item instanceof Xe&&r.ast instanceof ze)return t(e(r.item));if(r.item instanceof Ee&&r.ast instanceof ze&&r.ast.parentNode instanceof Ue){let n=r.item.deletedProperties.find(s=>s.by===r.ast.parentNode)?.property;if(n)return t(n)}return[]}function fx(r){if(!r)return[];let e=t=>{let s=r.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&r.runtime.rootNode.getChild(a[0].split("/"))===t)return!0}).map(o=>o.ast)??[],i=t.parent?.deletedNodes.filter(o=>o.node===t&&(o.by.nodeNameOrRef instanceof je?o.by.nodeNameOrRef!==r.ast:!t.linkedRefLabels.some(a=>a!==r.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...s,...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions,...i].map(o=>{if(o instanceof dt)return vn.Location.create(ce(o.uri),Q(o.name??o));if(o instanceof Re)return vn.Location.create(ce(o.uri),Q(o.name??o));if(o instanceof je)return vn.Location.create(ce(o.uri),Q(o));if(o instanceof je)return vn.Location.create(ce(o.uri),Q(o));if(o instanceof _e)return vn.Location.create(ce(o.uri),Q(o.label??o));if(o instanceof Ae)return vn.Location.create(ce((o.values??o)?.uri),Q(o.values??o))}).filter(o=>o)};if(r.item instanceof Ee&&!St(r.ast))return e(r.item);if(r.ast instanceof Lt&&r.ast.parentNode instanceof _e&&r.ast.parentNode.linksTo)return e(r.ast.parentNode.linksTo);if(r.ast instanceof je&&r.ast.linksTo)return St(r.ast)?[...e(r.ast.linksTo),vn.Location.create(ce(r.ast.uri),Q(r.ast))]:e(r.ast.linksTo);if(r?.ast instanceof Oe&&r.item instanceof Xe&&r.item.parent.name==="aliases"){let t=r.runtime.rootNode.getChild(r.ast.value.split("/"));if(t)return e(t)}return[]}async function zE(r,e,t,n){return Mt(r,e,s=>[...fx(s),...dx(s)],t,n)}var qn=z(J());function GE(r){if(!r||r.item===null||!(r.ast instanceof ze))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,t=n=>[n.ast,...n.allReplaced.map(s=>s.ast),n.parent.deletedProperties.find(s=>s.property=n)?.by??[]].map(s=>{if((s instanceof Ae||s instanceof Ue)&&s.propertyName)return qn.Location.create(ce(s.uri),Q(s.propertyName))}).filter(s=>s);if(r.item instanceof Xe&&r.ast instanceof ze)return t(e(r.item));if(r.item instanceof Ee&&r.ast instanceof ze&&r.ast.parentNode instanceof Ue){let n=r.item.deletedProperties.find(s=>s.by===r.ast.parentNode)?.property;if(n)return t(n)}return[]}function YE(r,e){if(!e||!(e.ast instanceof Lt))return[];"newName"in r&&(e.ast.parentNode instanceof _e&&r.newName.startsWith("&")?r.newName=r.newName.slice(1):e.ast.parentNode instanceof ds&&r.newName.endsWith(":")&&(r.newName=r.newName.slice(0,-1)));let t=e.ast.value,n=s=>[...s.definitions.filter(i=>i instanceof Re).flatMap(i=>i.labels.map(o=>o.label)),...s.linkedRefLabels.map(i=>i.label)].filter(i=>i?.value===t).map(i=>{if(i)return qn.Location.create(ce(i.uri),Q(i))}).filter(i=>i);return e.item instanceof Ee&&!St(e.ast)?n(e.item):e.ast instanceof Lt&&e.ast.parentNode instanceof _e&&e.ast.parentNode.linksTo?n(e.ast.parentNode.linksTo):[]}function JE(r){if(!r||!(r.ast instanceof je))return[];let e=t=>{let s=r.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=r.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(t)||c===t)return!0}}).map(o=>o.ast)??[],i=t.parent?.deletedNodes.filter(o=>o.node===t&&o.by.nodeNameOrRef!==r.ast).map(o=>o.by.nodeNameOrRef)??[];return[...s,...t.linkedNodeNamePaths,...t.definitions,...i].map(o=>{if(o instanceof Re&&o.name)return qn.Location.create(ce(o.uri),Q(o.name));if(o instanceof je)return qn.Location.create(ce(o.uri),Q(o));if(o instanceof Ae&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof Oe){let a=o.values.values[0].value,c=Q(a),l=a.value.split("/"),u=t.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,qn.Location.create(ce(o.values.values[0].uri),c)}}).filter(o=>o)};return r.item instanceof Ee&&!St(r.ast)?e(r.item):r.ast instanceof je&&r.ast.linksTo?St(r.ast)?[...e(r.ast.linksTo),qn.Location.create(ce(r.ast.uri),Q(r.ast))]:e(r.ast.linksTo):[]}async function XE(r,e,t,n){let s={};return(await Mt(r,e,o=>[...JE(o),...YE(r,o),...GE(o)],t,n)).forEach(o=>{s[o.uri]??=[],s[o.uri].push(qn.TextEdit.replace(o.range,r.newName))}),{changes:s}}async function QE(r,e,t,n,s){let i=await Mt(r,e,o=>[...JE(o),...YE(r,o),...GE(o)],n,s);if(i.some(o=>t.some(a=>xt(o.uri).startsWith(a))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!i.length}}var go=z(J());function hx(r){if(!r||r.item===null||!(r.ast instanceof ze))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,t=n=>[n.ast,...n.allReplaced.map(s=>s.ast)].map(s=>{if(s instanceof Ae)return go.Location.create(ce(s.uri),Q(s.propertyName??s))}).filter(s=>s);if(r.item instanceof Xe&&r.ast instanceof ze)return t(e(r.item));if(r.item instanceof Ee&&r.ast instanceof ze&&r.ast.parentNode instanceof Ue){let n=r.item.deletedProperties.find(s=>s.by===r.ast.parentNode)?.property;if(n)return t(n)}return[]}function px(r){if(!r)return[];let e=t=>[...t.definitions,...t.referencedBy].map(n=>{if(n instanceof dt)return go.Location.create(ce(n.uri),Q(n));if(n instanceof Re)return go.Location.create(ce(n.uri),Q(n));if(n instanceof Rt)return go.Location.create(ce(n.uri),Q(n))}).filter(n=>n);if(r.item instanceof Ee&&!St(r.ast))return e(r.item);if(r.ast instanceof Lt&&r.ast.parentNode instanceof _e&&r.ast.parentNode.linksTo)return e(r.ast.parentNode.linksTo);if(r.ast instanceof je&&r.ast.linksTo)return e(r.ast.linksTo);if(r?.ast instanceof Oe&&r.item instanceof Xe&&r.item.parent.name==="aliases"){let t=r.runtime.rootNode.getChild(r.ast.value.split("/"));if(t)return e(t)}return[]}function mx(r){if(r?.ast instanceof $t||r?.ast instanceof gn){let e=r.runtime.context.parser.cPreprocessorParser.macros.get(r.ast instanceof $t?r.ast.name:r.ast.value);if(e)return[go.Location.create(ce(e.macro.uri),Q(e.macro.identifier))]}return[]}async function ZE(r,e,t,n){return Mt(r,e,s=>[...px(s),...hx(s),...mx(s)],t,n)}var dd=z(J());function gx(r){if(!r||r.item===null||!(r.ast instanceof ze))return;let e=n=>n.replaces?e(n.replaces):n,t=n=>dd.Location.create(ce(n.ast.uri),Q(n.ast.propertyName??n.ast));if(r.item instanceof Xe&&r.ast instanceof ze)return t(e(r.item));if(r.item instanceof Ee&&r.ast instanceof ze&&r.ast.parentNode instanceof Ue){let n=r.item.deletedProperties.find(s=>s.by===r.ast.parentNode)?.property;if(n)return t(e(n))}}function yx(r){if(!r)return;let e=t=>{let n=t.definitions.at(0);return n?dd.Location.create(ce(n.uri),Q(n)):void 0};if(r.item instanceof Ee&&!St(r.ast))return e(r.item);if(r.ast instanceof Lt&&r.ast.parentNode instanceof _e&&r.ast.parentNode.linksTo)return e(r.ast.parentNode.linksTo);if(r.ast instanceof je&&r.ast.linksTo)return e(r.ast.linksTo);if(r?.ast instanceof Oe&&r.item instanceof Xe&&r.item.parent.name==="aliases"){let t=r.runtime.rootNode.getChild(r.ast.value.split("/"));if(t)return e(t)}}function vx(r){if(r?.ast instanceof $t||r?.ast instanceof gn){let e=r.runtime.context.parser.cPreprocessorParser.macros.get(r.ast instanceof $t?r.ast.name:r.ast.value);if(e)return dd.Location.create(ce(e.macro.uri),Q(e.macro.identifier))}}async function eN(r,e,t,n){return(await Mt(r,e,s=>[yx(s)||gx(s)||vx(s)],t,n)).at(0)}var ee=z(J());var bx=(r,e,t,n,s)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(ee.Range.create(ee.Position.create(n.range.start.line,r.pos.col+r.pos.len),ee.Position.create(n.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.del(n.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(n.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(n.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(n.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(n.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),">")]}}}];default:return}},Tx=(r,e,t,n,s,i,o)=>{if(!i)return[];switch(t){case 0:return[{title:o??`Add Property "${i.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 28:return[{title:o??"Remove Property",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 27:return[{title:o??"TODO",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 26:return i?[{title:o??"TODO",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}]:[];default:return}};function tN(r){let e=r.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>bx(c.firstToken,c.lastToken,l,a,r.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>Tx(c.firstToken,c.lastToken,l,a,r.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),t=e.filter(a=>a.kind===ee.CodeActionKind.SourceFixAll),n=e.filter(a=>a.title.startsWith("Add Property")),s=e.filter(a=>a.kind!==ee.CodeActionKind.SourceFixAll),i=t.flatMap(a=>a.edit?.changes?.[r.textDocument.uri]??[]),o=new Map;return n.forEach(a=>{let c=a.edit.changes[r.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...s,...t.map(a=>({...a,kind:ee.CodeActionKind.QuickFix})),...i.length?[{title:"Fix All",kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r.textDocument.uri]:i}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r.textDocument.uri]:a}}}:[])]}var fd=r=>!r||r instanceof Ae?!1:r instanceof Zt||fd(r.parentNode);function _x(r){if(!r||!(r.item instanceof Xe&&r.item.ast.assignOperatorToken))return[];let e=fd(r?.ast);if(!e&&!(r.ast instanceof Ae&&r.item.ast.values===null)&&!fd(r.beforeAst)&&!fd(r.afterAst))return[];let t=-1;r.item.ast.values===null?t=0:t=(r.item.ast.values?.values.findIndex(s=>s&&km(s,r.beforeAst))??-1)+1,t===-1&&(t=0);let n=r.item.parent.nodeType;return n instanceof Dr?n.properties.find(s=>s.name===r.item?.name)?.getPropertyCompletionItems(r.item,t,e)??[]:[]}function Sx(r){if(!r||!(r.item instanceof Xe&&r.ast instanceof ze&&r.item.ast.values==null||r.item instanceof Ee)||St(r.ast)||r.beforeAst?.parentNode instanceof Qt)return[];let e=t=>t.nodeType?.getPropertyListCompletionItems(t)??[];return r.item instanceof Xe?e(r.item.parent):e(r.item)}async function rN(r,e,t,n){return Mt(r,e,s=>[..._x(s),...Sx(s)],t,n)}var Am=z(J());function nN(r){return!r||r instanceof hs?r:nN(r.parentNode)}async function kx(r){if(r?.ast instanceof $t||r?.ast instanceof gn){let e=r.runtime.context.parser.cPreprocessorParser.macros.get(r?.ast instanceof $t?r.ast.name:r.ast.value);if(e){let t=nN(r.ast),n=(await r.runtime.context.getAllParsers()).at(-1);return t?{contents:{kind:Am.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${t?.evaluate(n.cPreprocessorParser.macros)}`,"```"].join(`
|
|
260
|
-
`)},range:Q(
|
|
261
|
-
`)},range:Q(r.ast)}}}}function wx(r){if(r?.item instanceof Ee)return{contents:r.item.toMarkupContent(),range:Q(r.ast)};if(r?.ast instanceof je){let e=r.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:Q(r.ast)}}if(r?.ast.parentNode instanceof _e){let e=r.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:Q(r.ast)}}if(r?.ast instanceof Oe&&r.item instanceof Xe&&r.item.parent.name==="aliases"){let e=r.runtime.rootNode.getChild(r.ast.value.split("/"));if(e)return{contents:e.toMarkupContent(),range:Q(r.ast)}}}function Ex(r){if(r?.item instanceof Xe&&r.ast instanceof ze){let e=r.item.parent.nodeType?.getOnPropertyHover(r.item.name);if(e)return{contents:e,range:Q(r.ast)}}}function sN(r,e,t,n){return Mt(r,e,async s=>[wx(s)||Ex(s)||await kx(s)],t,n)}var Ab=z(hy());var fR=z(sR(),1);var lc=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var nj={"[: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]},uc=r=>r.replace(/[[\]\\-]/g,"\\$&"),sj=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),iR=r=>r.join(""),oR=(r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],s=[],i=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;i<r.length;){let g=r.charAt(i);if((g==="!"||g==="^")&&i===t+1){l=!0,i++;continue}if(g==="]"&&o&&!c){u=i+1;break}if(o=!0,g==="\\"&&!c){c=!0,i++;continue}if(g==="["&&!c){for(let[_,[w,T,v]]of Object.entries(nj))if(r.startsWith(_,i)){if(d)return["$.",!1,r.length-t,!0];i+=_.length,v?s.push(w):n.push(w),a=a||T;continue e}}if(c=!1,d){g>d?n.push(uc(d)+"-"+uc(g)):g===d&&n.push(uc(g)),d="",i++;continue}if(r.startsWith("-]",i+1)){n.push(uc(g+"-")),i+=2;continue}if(r.startsWith("-",i+1)){d=g,i+=2;continue}n.push(uc(g)),i++}if(u<i)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,r.length-t,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let g=n[0].length===2?n[0].slice(-1):n[0];return[sj(g),!1,u-t,!1]}let f="["+(l?"^":"")+iR(n)+"]",p="["+(l?"":"^")+iR(s)+"]";return[n.length&&s.length?"("+f+"|"+p+")":n.length?f:p,a,u-t,!0]};var en=(r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var ij=new Set(["!","?","+","*","@"]),aR=r=>ij.has(r),oj="(?!(?:^|/)\\.\\.?(?:$|/))",df="(?!\\.)",aj=new Set(["[","."]),cj=new Set(["..","."]),lj=new Set("().*{}+?[]^$\\!"),uj=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),gy="[^/]",cR=gy+"*?",lR=gy+"+?",Po=class r{type;#e;#t;#i=!1;#n=[];#o;#T;#l;#d=!1;#a;#c;#s=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?n:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#T=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("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,n=t.#o;for(;n;){for(let s=t.#T+1;!n.type&&s<n.#n.length;s++)for(let i of e.#n){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(n.#n[s])}t=n,n=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof r&&t.#o===this))throw new Error("invalid part: "+t);this.#n.push(t)}}toJSON(){let e=this.type===null?this.#n.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#n.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#T===0)return!0;let e=this.#o;for(let t=0;t<this.#T;t++){let n=e.#n[t];if(!(n instanceof r&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#n.length:0;return this.#T===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new r(this.type,e);for(let n of this.#n)t.copyIn(n);return t}static#y(e,t,n,s){let i=!1,o=!1,a=-1,c=!1;if(t.type===null){let p=n,b="";for(;p<e.length;){let g=e.charAt(p++);if(i||g==="\\"){i=!i,b+=g;continue}if(o){p===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(p===a+2&&c)&&(o=!1),b+=g;continue}else if(g==="["){o=!0,a=p,c=!1,b+=g;continue}if(!s.noext&&aR(g)&&e.charAt(p)==="("){t.push(b),b="";let _=new r(g,t);p=r.#y(e,_,p,s),t.push(_);continue}b+=g}return t.push(b),p}let l=n+1,u=new r(null,t),d=[],f="";for(;l<e.length;){let p=e.charAt(l++);if(i||p==="\\"){i=!i,f+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(l===a+2&&c)&&(o=!1),f+=p;continue}else if(p==="["){o=!0,a=l,c=!1,f+=p;continue}if(aR(p)&&e.charAt(l)==="("){u.push(f),f="";let b=new r(p,u);u.push(b),l=r.#y(e,b,l,s);continue}if(p==="|"){u.push(f),f="",d.push(u),u=new r(null,t);continue}if(p===")")return f===""&&t.#n.length===0&&(t.#s=!0),u.push(f),f="",t.push(...d,u),l;f+=p}return t.type=null,t.#t=void 0,t.#n=[e.substring(n-1)],l}static fromGlob(e,t={}){let n=new r(null,void 0,t);return r.#y(e,n,0,t),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,s,i]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#a.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(p=>{let[b,g,_,w]=typeof p=="string"?r.#f(p,this.#t,c):p.toRegExpSource(e);return this.#t=this.#t||_,this.#i=this.#i||w,b}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&cj.has(this.#n[0]))){let b=aj,g=t&&b.has(l.charAt(0))||l.startsWith("\\.")&&b.has(l.charAt(2))||l.startsWith("\\.\\.")&&b.has(l.charAt(4)),_=!t&&!e&&b.has(l.charAt(0));u=g?oj:_?df:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,en(l),this.#t=!!this.#t,this.#i]}let n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#h(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#t=void 0,[c,en(this.toString()),!1,!1]}let o=!n||e||t||!df?"":this.#h(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!t?df:"")+lR;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?df:"")+cR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,en(i),this.#t=!!this.#t,this.#i]}#h(e){return this.#n.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,s,i,o]=t.toRegExpSource(e);return this.#i=this.#i||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#f(e,t,n=!1){let s=!1,i="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,i+=(lj.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=oR(e,a);if(d){i+=l,o=o||u,a+=d-1,t=t||f;continue}}if(c==="*"){n&&e==="*"?i+=lR:i+=cR,t=!0;continue}if(c==="?"){i+=gy,t=!0;continue}i+=uj(c)}return[i,en(e),!!t,o]}};var Ro=(r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var tr=(r,e,t={})=>(lc(e),!t.nocomment&&e.charAt(0)==="#"?!1:new _r(e,t).match(r)),dj=/^\*+([^+@!?\*\[\(]*)$/,fj=r=>e=>!e.startsWith(".")&&e.endsWith(r),hj=r=>e=>e.endsWith(r),pj=r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),mj=r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),gj=/^\*+\.\*+$/,yj=r=>!r.startsWith(".")&&r.includes("."),vj=r=>r!=="."&&r!==".."&&r.includes("."),bj=/^\.\*+$/,Tj=r=>r!=="."&&r!==".."&&r.startsWith("."),_j=/^\*+$/,Sj=r=>r.length!==0&&!r.startsWith("."),kj=r=>r.length!==0&&r!=="."&&r!=="..",wj=/^\?+([^+@!?\*\[\(]*)?$/,Ej=([r,e=""])=>{let t=hR([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Nj=([r,e=""])=>{let t=pR([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Pj=([r,e=""])=>{let t=pR([r]);return e?n=>t(n)&&n.endsWith(e):t},Rj=([r,e=""])=>{let t=hR([r]);return e?n=>t(n)&&n.endsWith(e):t},hR=([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},pR=([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},mR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",uR={win32:{sep:"\\"},posix:{sep:"/"}},Cj=mR==="win32"?uR.win32.sep:uR.posix.sep;tr.sep=Cj;var jt=Symbol("globstar **");tr.GLOBSTAR=jt;var Dj="[^/]",Oj=Dj+"*?",Aj="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ij="(?:(?!(?:\\/|^)\\.).)*?",Mj=(r,e={})=>t=>tr(t,r,e);tr.filter=Mj;var Ir=(r,e={})=>Object.assign({},r,e),xj=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return tr;let e=tr;return Object.assign((n,s,i={})=>e(n,s,Ir(r,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,Ir(r,i))}static defaults(s){return e.defaults(Ir(r,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,Ir(r,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,Ir(r,i))}},unescape:(n,s={})=>e.unescape(n,Ir(r,s)),escape:(n,s={})=>e.escape(n,Ir(r,s)),filter:(n,s={})=>e.filter(n,Ir(r,s)),defaults:n=>e.defaults(Ir(r,n)),makeRe:(n,s={})=>e.makeRe(n,Ir(r,s)),braceExpand:(n,s={})=>e.braceExpand(n,Ir(r,s)),match:(n,s,i={})=>e.match(n,s,Ir(r,i)),sep:e.sep,GLOBSTAR:jt})};tr.defaults=xj;var gR=(r,e={})=>(lc(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,fR.default)(r));tr.braceExpand=gR;var Lj=(r,e={})=>new _r(r,e).makeRe();tr.makeRe=Lj;var $j=(r,e,t={})=>{let n=new _r(e,t);return r=r.filter(s=>n.match(s)),n.options.nonull&&!r.length&&r.push(e),r};tr.match=$j;var dR=/[?*]|[+@!]\(.*?\)|\[|\]/,qj=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_r=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){lc(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||mR,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=i[0]===""&&i[1]===""&&(i[2]==="?"||!dR.test(i[2]))&&!dR.test(i[3]),l=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(l)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let s=0;s<e[n].length;s++)e[n][s]==="**"&&(e[n][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let s=n;for(;t[s+1]==="**";)s++;s!==n&&t.splice(n,s-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,s)=>{let i=n[n.length-1];return s==="**"&&i==="**"?n:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(n.pop(),n):(n.push(s),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let i=e[s];s===1&&i===""&&e[0]===""||(i==="."||i==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let s=e[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let o=s;for(;n[o+1]==="**";)o++;o>s&&n.splice(s+1,o-s);let a=n[s+1],c=n[s+2],l=n[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,n.splice(s,1);let u=n.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf("..",i+1))!==-1;){let o=n[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=i===1&&n[i+1]==="**"?["."]:[];n.splice(i-1,2,...c),n.length===0&&n.push(""),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let s=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(s){e[t]=[],e[n]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let s=0,i=0,o=[],a="";for(;s<e.length&&i<t.length;)if(e[s]===t[i])o.push(a==="b"?t[i]:e[s]),s++,i++;else if(n&&e[s]==="**"&&t[i]===e[s+1])o.push(e[s]),s++;else if(n&&t[i]==="**"&&e[s]===t[i+1])o.push(t[i]),i++;else if(e[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,i++}else if(t[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(t[i]),s++,i++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),_=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),v=_?3:g?0:void 0,R=T?3:w?0:void 0;if(typeof v=="number"&&typeof R=="number"){let[A,L]=[e[v],t[R]];A.toLowerCase()===L.toLowerCase()&&(t[R]=A,R>v?t=t.slice(R):v>R&&(e=e.slice(v)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===jt){this.debug("GLOBSTAR",[t,u,d]);var f=o,p=a+1;if(p===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var b=e[f];if(this.debug(`
|
|
262
|
-
globstar while`,e,f,t,p,b),this.matchOne(e.slice(f),t.slice(p),
|
|
263
|
-
>>> no match, partial?`,e,f,t,p),f===c))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return gR(this.pattern,this.options)}parse(e){lc(e);let t=this.options;if(e==="**")return jt;if(e==="")return"";let n,s=null;(n=e.match(_j))?s=t.dot?kj:Sj:(n=e.match(dj))?s=(t.nocase?t.dot?mj:pj:t.dot?hj:fj)(n[1]):(n=e.match(wj))?s=(t.nocase?t.dot?Nj:Ej:t.dot?Pj:Rj)(n):(n=e.match(gj))?s=t.dot?vj:yj:(n=e.match(bj))&&(s=Tj);let i=Po.fromGlob(e,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Oj:t.dot?Aj:Ij,s=new Set(t.nocase?["i"]:[]),i=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?qj(u):u===jt?jt:u._src});return l.forEach((u,d)=>{let f=l[d+1],p=l[d-1];u!==jt||p===jt||(p===void 0?f!==void 0&&f!==jt?l[d+1]="(?:\\/|"+n+"\\/)?"+f:l[d]=n:f===void 0?l[d-1]=p+"(?:\\/|"+n+")?":f!==jt&&(l[d-1]=p+"(?:\\/|\\/"+n+"\\/)"+f,l[d+1]=jt))}),l.filter(u=>u!==jt).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let i=this.set;this.debug(this.pattern,"set",i);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<i.length;a++){let c=i[a],l=s;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return tr.defaults(e).Minimatch}};tr.AST=Po;tr.Minimatch=_r;tr.escape=Ro;tr.unescape=en;var FR=require("node:url");var Co=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,vR=new Set,yy=typeof process=="object"&&process?process:{},bR=(r,e,t,n)=>{typeof yy.emitWarning=="function"?yy.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},ff=globalThis.AbortController,yR=globalThis.AbortSignal;if(typeof ff>"u"){yR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s)}},ff=class{constructor(){e()}signal=new yR;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n)}}};let r=yy.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=!1,bR("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 jj=r=>!vR.has(r),C5=Symbol("type"),Es=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),TR=r=>Es(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Do:null:null,Do=class extends Array{constructor(e){super(e),this.fill(0)}},vy=class r{heap;length;static#e=!1;static create(e){let t=TR(e);if(!t)return[];r.#e=!0;let n=new r(e,t);return r.#e=!1,n}constructor(e,t){if(!r.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},dc=class r{#e;#t;#i;#n;#o;#T;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#g;#y;#h;#f;#k;#m;#w;#E;#b;#_;#S;#p;static unsafeExposeInternals(e){return{starts:e.#E,ttls:e.#b,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#f},free:e.#k,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,n,s,i)=>e.#q(t,n,s,i),moveToTail:t=>e.#F(t),indexes:t=>e.#P(t),rindexes:t=>e.#R(t),isStale:t=>e.#v(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#T}get dispose(){return this.#i}get disposeAfter(){return this.#n}constructor(e){let{max:t=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:b=0,sizeCalculation:g,fetchMethod:_,memoMethod:w,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:A,ignoreFetchAbort:L}=e;if(t!==0&&!Es(t))throw new TypeError("max option must be a nonnegative integer");let W=t?TR(t):Array;if(!W)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=p,this.maxEntrySize=b||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#T=w,_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=_,this.#S=!!_,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#s=new Array(t).fill(void 0),this.#g=new W(t),this.#y=new W(t),this.#h=0,this.#f=0,this.#k=vy.create(t),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#n=u,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#_=!!this.#i,this.#p=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#t!==0&&!Es(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Es(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Es(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!Es(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 j="LRU_CACHE_UNBOUNDED";jj(j)&&(vR.add(j),bR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,r))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new Do(this.#e),t=new Do(this.#e);this.#b=e,this.#E=t,this.#A=(i,o,a=Co.now())=>{if(t[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#v(i)&&this.#O(this.#c[i],"expire")},o+1);c.unref&&c.unref()}},this.#N=i=>{t[i]=e[i]!==0?Co.now():0},this.#r=(i,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=n||s();let l=i.now-c;i.remainingTTL=a-l}};let n=0,s=()=>{let i=Co.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=this.#a.get(i);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(n||s())-c;return a-l},this.#v=i=>{let o=t[i],a=e[i];return!!a&&!!o&&(n||s())-o>a}}#N=()=>{};#r=()=>{};#A=()=>{};#v=()=>!1;#D(){let e=new Do(this.#e);this.#d=0,this.#w=e,this.#I=t=>{this.#d-=e[t],e[t]=0},this.#x=(t,n,s,i)=>{if(this.#u(n))return 0;if(!Es(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,t),!Es(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#M=(t,n,s)=>{if(e[t]=n,this.#t){let i=this.#t-e[t];for(;this.#d>i;)this.#$(!0)}this.#d+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#d)}}#I=e=>{};#M=(e,t,n)=>{};#x=(e,t,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#f;!(!this.#L(t)||((e||!this.#v(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#L(t)||((e||!this.#v(t))&&(yield t),t===this.#f));)t=this.#g[t]}#L(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*rentries(){for(let e of this.#R())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#s[e])&&(yield t)}}*rkeys(){for(let e of this.#R()){let t=this.#c[e];t!==void 0&&!this.#u(this.#s[e])&&(yield t)}}*values(){for(let e of this.#P())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#R())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#P()){let s=this.#s[n],i=this.#u(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#c[n],this))return this.get(this.#c[n],t)}}forEach(e,t=this){for(let n of this.#P()){let s=this.#s[n],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[n],this)}}rforEach(e,t=this){for(let n of this.#R()){let s=this.#s[n],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[n],this)}}purgeStale(){let e=!1;for(let t of this.#R({allowStale:!0}))this.#v(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let n=this.#s[t],s=this.#u(n)?n.__staleWhileFetching:n;if(s===void 0)return;let i={value:s};if(this.#b&&this.#E){let o=this.#b[t],a=this.#E[t];if(o&&a){let c=o-(Co.now()-a);i.ttl=c,i.start=Date.now()}}return this.#w&&(i.size=this.#w[t]),i}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let n=this.#c[t],s=this.#s[t],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(this.#b&&this.#E){o.ttl=this.#b[t];let a=Co.now()-this.#E[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=Co.now()-s}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#x(e,t,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#f:this.#k.length!==0?this.#k.pop():this.#l===this.#e?this.#$(!1):this.#l,this.#c[d]=e,this.#s[d]=t,this.#a.set(e,d),this.#g[this.#f]=d,this.#y[d]=this.#f,this.#f=d,this.#l++,this.#M(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(t!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=f;p!==void 0&&!o&&(this.#_&&this.#i?.(p,e,"set"),this.#p&&this.#m?.push([p,e,"set"]))}else o||(this.#_&&this.#i?.(f,e,"set"),this.#p&&this.#m?.push([f,e,"set"]));if(this.#I(d),this.#M(d,u,c),this.#s[d]=t,c){c.set="replace";let p=f&&this.#u(f)?f.__staleWhileFetching:f;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(s!==0&&!this.#b&&this.#C(),this.#b&&(l||this.#A(d,s,i),c&&this.#r(c,d)),!o&&this.#p&&this.#m){let f=this.#m,p;for(;p=f?.shift();)this.#n?.(...p)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#h];if(this.#$(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#n?.(...t)}}}#$(e){let t=this.#h,n=this.#c[t],s=this.#s[t];return this.#S&&this.#u(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#p)&&(this.#_&&this.#i?.(s,n,"evict"),this.#p&&this.#m?.push([s,n,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#s[t]=void 0,this.#k.push(t)),this.#l===1?(this.#h=this.#f=0,this.#k.length=0):this.#h=this.#g[t],this.#a.delete(n),this.#l--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=t,i=this.#a.get(e);if(i!==void 0){let o=this.#s[i];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#v(i))s&&(s.has="stale",this.#r(s,i));else return n&&this.#N(i),s&&(s.has="hit",this.#r(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,s=this.#a.get(e);if(s===void 0||!n&&this.#v(s))return;let i=this.#s[s];return this.#u(i)?i.__staleWhileFetching:i}#q(e,t,n,s){let i=t===void 0?void 0:this.#s[t];if(this.#u(i))return i;let o=new ff,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},l=(g,_=!1)=>{let{aborted:w}=o.signal,T=n.ignoreFetchAbort&&g!==void 0;if(n.status&&(w&&!_?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,T&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),w&&!T&&!_)return d(o.signal.reason);let v=p;return this.#s[t]===p&&(g===void 0?v.__staleWhileFetching?this.#s[t]=v.__staleWhileFetching:this.#O(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=g),d(g)),d=g=>{let{aborted:_}=o.signal,w=_&&n.allowStaleOnFetchAbort,T=w||n.allowStaleOnFetchRejection,v=T||n.noDeleteOnFetchRejection,R=p;if(this.#s[t]===p&&(!v||R.__staleWhileFetching===void 0?this.#O(e,"fetch"):w||(this.#s[t]=R.__staleWhileFetching)),T)return n.status&&R.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw g},f=(g,_)=>{let w=this.#o?.(e,i,c);w&&w instanceof Promise&&w.then(T=>g(T===void 0?void 0:T),_),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(g(void 0),n.allowStaleOnFetchAbort&&(g=T=>l(T,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),b=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,b,{...c.options,status:void 0}),t=this.#a.get(e)):this.#s[t]=b,b}#u(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof ff}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:g,forceRefresh:_=!1,status:w,signal:T}=t;if(!this.#S)return w&&(w.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:w});let v={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:b,ignoreFetchAbort:p,status:w,signal:T},R=this.#a.get(e);if(R===void 0){w&&(w.fetch="miss");let A=this.#q(e,R,v,g);return A.__returned=A}else{let A=this.#s[R];if(this.#u(A)){let Le=n&&A.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",Le&&(w.returnedStale=!0)),Le?A.__staleWhileFetching:A.__returned=A}let L=this.#v(R);if(!_&&!L)return w&&(w.fetch="hit"),this.#F(R),s&&this.#N(R),w&&this.#r(w,R),A;let W=this.#q(e,R,v,g),ne=W.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=L?"stale":"refresh",ne&&L&&(w.returnedStale=!0)),ne?W.__staleWhileFetching:W.__returned=W}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#T;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=t,a=this.get(e,o);if(!i&&a!==void 0)return a;let c=n(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#r(o,a),this.#v(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(i||this.#O(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),s&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,t){this.#y[t]=e,this.#g[e]=t}#F(e){e!==this.#f&&(e===this.#h?this.#h=this.#g[e]:this.#j(this.#y[e],this.#g[e]),this.#j(this.#f,e),this.#f=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let n=!1;if(this.#l!==0){let s=this.#a.get(e);if(s!==void 0)if(n=!0,this.#l===1)this.#B(t);else{this.#I(s);let i=this.#s[s];if(this.#u(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#p)&&(this.#_&&this.#i?.(i,e,t),this.#p&&this.#m?.push([i,e,t])),this.#a.delete(e),this.#c[s]=void 0,this.#s[s]=void 0,s===this.#f)this.#f=this.#y[s];else if(s===this.#h)this.#h=this.#g[s];else{let o=this.#y[s];this.#g[o]=this.#g[s];let a=this.#g[s];this.#y[a]=this.#y[s]}this.#l--,this.#k.push(s)}}if(this.#p&&this.#m?.length){let s=this.#m,i;for(;i=s?.shift();)this.#n?.(...i)}return n}clear(){return this.#B("delete")}#B(e){for(let t of this.#R({allowStale:!0})){let n=this.#s[t];if(this.#u(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#_&&this.#i?.(n,s,e),this.#p&&this.#m?.push([n,s,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#b&&this.#E&&(this.#b.fill(0),this.#E.fill(0)),this.#w&&this.#w.fill(0),this.#h=0,this.#f=0,this.#k.length=0,this.#d=0,this.#l=0,this.#p&&this.#m){let t=this.#m,n;for(;n=t?.shift();)this.#n?.(...n)}}};var Io=require("node:path"),DR=require("node:url"),kn=require("fs"),Yj=z(require("node:fs"),1),Rs=require("node:fs/promises");var bf=require("node:events"),Ey=z(require("node:stream"),1),ER=require("node:string_decoder"),_R=typeof process=="object"&&process?process:{stdout:null,stderr:null},Fj=r=>!!r&&typeof r=="object"&&(r instanceof Ps||r instanceof Ey.default||Bj(r)||Uj(r)),Bj=r=>!!r&&typeof r=="object"&&r instanceof bf.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==Ey.default.Writable.prototype.pipe,Uj=r=>!!r&&typeof r=="object"&&r instanceof bf.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",Bn=Symbol("EOF"),Un=Symbol("maybeEmitEnd"),Ns=Symbol("emittedEnd"),hf=Symbol("emittingEnd"),fc=Symbol("emittedError"),pf=Symbol("closed"),SR=Symbol("read"),mf=Symbol("flush"),kR=Symbol("flushChunk"),tn=Symbol("encoding"),Oo=Symbol("decoder"),Ct=Symbol("flowing"),hc=Symbol("paused"),Ao=Symbol("resume"),Dt=Symbol("buffer"),rr=Symbol("pipes"),Ot=Symbol("bufferLength"),by=Symbol("bufferPush"),gf=Symbol("bufferShift"),Kt=Symbol("objectMode"),ht=Symbol("destroyed"),Ty=Symbol("error"),_y=Symbol("emitData"),wR=Symbol("emitEnd"),Sy=Symbol("emitEnd2"),_n=Symbol("async"),ky=Symbol("abort"),yf=Symbol("aborted"),pc=Symbol("signal"),ui=Symbol("dataListeners"),Sr=Symbol("discarded"),mc=r=>Promise.resolve().then(r),Vj=r=>r(),Wj=r=>r==="end"||r==="finish"||r==="prefinish",Hj=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Kj=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),vf=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Ao](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},wy=class extends vf{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},zj=r=>!!r.objectMode,Gj=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",Ps=class extends bf.EventEmitter{[Ct]=!1;[hc]=!1;[rr]=[];[Dt]=[];[Kt];[tn];[_n];[Oo];[Bn]=!1;[Ns]=!1;[hf]=!1;[pf]=!1;[fc]=null;[Ot]=0;[ht]=!1;[pc];[yf]=!1;[ui]=0;[Sr]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");zj(t)?(this[Kt]=!0,this[tn]=null):Gj(t)?(this[tn]=t.encoding,this[Kt]=!1):(this[Kt]=!1,this[tn]=null),this[_n]=!!t.async,this[Oo]=this[tn]?new ER.StringDecoder(this[tn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Dt]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[rr]});let{signal:n}=t;n&&(this[pc]=n,n.aborted?this[ky]():n.addEventListener("abort",()=>this[ky]()))}get bufferLength(){return this[Ot]}get encoding(){return this[tn]}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[Kt]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[_n]}set async(e){this[_n]=this[_n]||!!e}[ky](){this[yf]=!0,this.emit("abort",this[pc]?.reason),this.destroy(this[pc]?.reason)}get aborted(){return this[yf]}set aborted(e){}write(e,t,n){if(this[yf])return!1;if(this[Bn])throw new Error("write after end");if(this[ht])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let s=this[_n]?mc:Vj;if(!this[Kt]&&!Buffer.isBuffer(e)){if(Kj(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Hj(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Kt]?(this[Ct]&&this[Ot]!==0&&this[mf](!0),this[Ct]?this.emit("data",e):this[by](e),this[Ot]!==0&&this.emit("readable"),n&&s(n),this[Ct]):e.length?(typeof e=="string"&&!(t===this[tn]&&!this[Oo]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[tn]&&(e=this[Oo].write(e)),this[Ct]&&this[Ot]!==0&&this[mf](!0),this[Ct]?this.emit("data",e):this[by](e),this[Ot]!==0&&this.emit("readable"),n&&s(n),this[Ct]):(this[Ot]!==0&&this.emit("readable"),n&&s(n),this[Ct])}read(e){if(this[ht])return null;if(this[Sr]=!1,this[Ot]===0||e===0||e&&e>this[Ot])return this[Un](),null;this[Kt]&&(e=null),this[Dt].length>1&&!this[Kt]&&(this[Dt]=[this[tn]?this[Dt].join(""):Buffer.concat(this[Dt],this[Ot])]);let t=this[SR](e||null,this[Dt][0]);return this[Un](),t}[SR](e,t){if(this[Kt])this[gf]();else{let n=t;e===n.length||e===null?this[gf]():typeof n=="string"?(this[Dt][0]=n.slice(e),t=n.slice(0,e),this[Ot]-=e):(this[Dt][0]=n.subarray(e),t=n.subarray(0,e),this[Ot]-=e)}return this.emit("data",t),!this[Dt].length&&!this[Bn]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Bn]=!0,this.writable=!1,(this[Ct]||!this[hc])&&this[Un](),this}[Ao](){this[ht]||(!this[ui]&&!this[rr].length&&(this[Sr]=!0),this[hc]=!1,this[Ct]=!0,this.emit("resume"),this[Dt].length?this[mf]():this[Bn]?this[Un]():this.emit("drain"))}resume(){return this[Ao]()}pause(){this[Ct]=!1,this[hc]=!0,this[Sr]=!1}get destroyed(){return this[ht]}get flowing(){return this[Ct]}get paused(){return this[hc]}[by](e){this[Kt]?this[Ot]+=1:this[Ot]+=e.length,this[Dt].push(e)}[gf](){return this[Kt]?this[Ot]-=1:this[Ot]-=this[Dt][0].length,this[Dt].shift()}[mf](e=!1){do;while(this[kR](this[gf]())&&this[Dt].length);!e&&!this[Dt].length&&!this[Bn]&&this.emit("drain")}[kR](e){return this.emit("data",e),this[Ct]}pipe(e,t){if(this[ht])return e;this[Sr]=!1;let n=this[Ns];return t=t||{},e===_R.stdout||e===_R.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[rr].push(t.proxyErrors?new wy(this,e,t):new vf(this,e,t)),this[_n]?mc(()=>this[Ao]()):this[Ao]()),e}unpipe(e){let t=this[rr].find(n=>n.dest===e);t&&(this[rr].length===1?(this[Ct]&&this[ui]===0&&(this[Ct]=!1),this[rr]=[]):this[rr].splice(this[rr].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Sr]=!1,this[ui]++,!this[rr].length&&!this[Ct]&&this[Ao]();else if(e==="readable"&&this[Ot]!==0)super.emit("readable");else if(Wj(e)&&this[Ns])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[fc]){let s=t;this[_n]?mc(()=>s.call(this,this[fc])):s.call(this,this[fc])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[ui]=this.listeners("data").length,this[ui]===0&&!this[Sr]&&!this[rr].length&&(this[Ct]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[ui]=0,!this[Sr]&&!this[rr].length&&(this[Ct]=!1)),t}get emittedEnd(){return this[Ns]}[Un](){!this[hf]&&!this[Ns]&&!this[ht]&&this[Dt].length===0&&this[Bn]&&(this[hf]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[pf]&&this.emit("close"),this[hf]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==ht&&this[ht])return!1;if(e==="data")return!this[Kt]&&!n?!1:this[_n]?(mc(()=>this[_y](n)),!0):this[_y](n);if(e==="end")return this[wR]();if(e==="close"){if(this[pf]=!0,!this[Ns]&&!this[ht])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[fc]=n,super.emit(Ty,n);let i=!this[pc]||this.listeners("error").length?super.emit("error",n):!1;return this[Un](),i}else if(e==="resume"){let i=super.emit("resume");return this[Un](),i}else if(e==="finish"||e==="prefinish"){let i=super.emit(e);return this.removeAllListeners(e),i}let s=super.emit(e,...t);return this[Un](),s}[_y](e){for(let n of this[rr])n.dest.write(e)===!1&&this.pause();let t=this[Sr]?!1:super.emit("data",e);return this[Un](),t}[wR](){return this[Ns]?!1:(this[Ns]=!0,this.readable=!1,this[_n]?(mc(()=>this[Sy]()),!0):this[Sy]())}[Sy](){if(this[Oo]){let t=this[Oo].end();if(t){for(let n of this[rr])n.dest.write(t);this[Sr]||super.emit("data",t)}}for(let t of this[rr])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Kt]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[Kt]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[Kt])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[tn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(ht,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Sr]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Bn])return t();let i,o,a=d=>{this.off("data",c),this.off("end",l),this.off(ht,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(ht,u),this.pause(),i({value:d,done:!!this[Bn]})},l=()=>{this.off("error",a),this.off("data",c),this.off(ht,u),t(),i({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,i=d,this.once(ht,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Sr]=!1;let e=!1,t=()=>(this.pause(),this.off(Ty,t),this.off(ht,t),this.off("end",t),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once(Ty,t),this.once(ht,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[ht])return e?this.emit("error",e):this.emit(ht),this;this[ht]=!0,this[Sr]=!0,this[Dt].length=0,this[Ot]=0;let t=this;return typeof t.close=="function"&&!this[pf]&&t.close(),e?this.emit("error",e):this.emit(ht),this}static get isStream(){return Fj}};var Jj=kn.realpathSync.native,yc={lstatSync:kn.lstatSync,readdir:kn.readdir,readdirSync:kn.readdirSync,readlinkSync:kn.readlinkSync,realpathSync:Jj,promises:{lstat:Rs.lstat,readdir:Rs.readdir,readlink:Rs.readlink,realpath:Rs.realpath}},OR=r=>!r||r===yc||r===Yj?yc:{...yc,...r,promises:{...yc.promises,...r.promises||{}}},AR=/^\\\\\?\\([a-z]:)\\?$/i,Xj=r=>r.replace(/\//g,"\\").replace(AR,"$1\\"),Qj=/[\\\/]/,xr=0,IR=1,MR=2,Sn=4,xR=6,LR=8,di=10,$R=12,Mr=15,gc=~Mr,Ny=16,NR=32,vc=64,rn=128,Tf=256,Sf=512,PR=vc|rn|Sf,Zj=1023,Py=r=>r.isFile()?LR:r.isDirectory()?Sn:r.isSymbolicLink()?di:r.isCharacterDevice()?MR:r.isBlockDevice()?xR:r.isSocket()?$R:r.isFIFO()?IR:xr,RR=new Map,bc=r=>{let e=RR.get(r);if(e)return e;let t=r.normalize("NFKD");return RR.set(r,t),t},CR=new Map,_f=r=>{let e=CR.get(r);if(e)return e;let t=bc(r.toLowerCase());return CR.set(r,t),t},kf=class extends dc{constructor(){super({max:256})}},Ry=class extends dc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},qR=Symbol("PathScurry setAsCwd"),zt=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}#T;get gid(){return this.#T}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#a;get ino(){return this.#a}#c;get size(){return this.#c}#s;get blocks(){return this.#s}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#f;get birthtimeMs(){return this.#f}#k;get atime(){return this.#k}#m;get mtime(){return this.#m}#w;get ctime(){return this.#w}#E;get birthtime(){return this.#E}#b;#_;#S;#p;#C;#N;#r;#A;#v;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=xr,n,s,i,o,a){this.name=e,this.#b=i?_f(e):bc(e),this.#r=t&Zj,this.nocase=i,this.roots=s,this.root=n||this,this.#A=o,this.#S=a.fullpath,this.#C=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=OR(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(s):this.#I(s)}#I(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#A.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#A.set(this,t),this.#r&=~Ny,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),s=this.nocase?_f(e):bc(e);for(let c of n)if(c.#b===s)return c;let i=this.parent?this.sep:"",o=this.#S?this.#S+i+e:void 0,a=this.newChild(e,xr,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=rn),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,t=this.parent;if(!t)return this.#N=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#p=`//?/${s}`:this.#p=s}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#p=n}isUnknown(){return(this.#r&Mr)===xr}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&Mr)===LR}isDirectory(){return(this.#r&Mr)===Sn}isCharacterDevice(){return(this.#r&Mr)===MR}isBlockDevice(){return(this.#r&Mr)===xR}isFIFO(){return(this.#r&Mr)===IR}isSocket(){return(this.#r&Mr)===$R}isSymbolicLink(){return(this.#r&di)===di}lstatCached(){return this.#r&NR?this:void 0}readlinkCached(){return this.#v}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#v)return!0;if(!this.parent)return!1;let e=this.#r&Mr;return!(e!==xr&&e!==di||this.#r&Tf||this.#r&rn)}calledReaddir(){return!!(this.#r&Ny)}isENOENT(){return!!(this.#r&rn)}isNamed(e){return this.nocase?this.#b===_f(e):this.#b===bc(e)}async readlink(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#v=n}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#v=n}catch(t){this.#u(t.code);return}}#M(e){this.#r|=Ny;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#x()}}#x(){this.#r&rn||(this.#r=(this.#r|rn)&gc,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#x()}#R(){this.#r|=Sf,this.#L()}#L(){if(this.#r&vc)return;let e=this.#r;(e&Mr)===Sn&&(e&=gc),this.#r=e|vc,this.#P()}#$(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#x():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#x()}#u(e=""){let t=this.#r;t|=Tf,e==="ENOENT"&&(t|=rn),(e==="EINVAL"||e==="UNKNOWN")&&(t&=gc),this.#r=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#j(e,t){return this.#O(e,t)||this.#F(e,t)}#F(e,t){let n=Py(e),s=this.newChild(e.name,n,{parent:this}),i=s.#r&Mr;return i!==Sn&&i!==di&&i!==xr&&(s.#r|=vc),t.unshift(s),t.provisional++,s}#O(e,t){for(let n=t.provisional;n<t.length;n++){let s=t[n];if((this.nocase?_f(e.name):bc(e.name))===s.#b)return this.#B(e,s,n,t)}}#B(e,t,n,s){let i=t.name;return t.#r=t.#r&gc|Py(e),i!==e.name&&(t.name=e.name),n!==s.provisional&&(n===s.length-1?s.pop():s.splice(n,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#r&rn)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#r&rn)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#H(e){let{atime:t,atimeMs:n,birthtime:s,birthtimeMs:i,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:p,mtime:b,mtimeMs:g,nlink:_,rdev:w,size:T,uid:v}=e;this.#k=t,this.#g=n,this.#E=s,this.#f=i,this.#d=o,this.#s=a,this.#w=c,this.#h=l,this.#t=u,this.#T=d,this.#a=f,this.#i=p,this.#m=b,this.#y=g,this.#n=_,this.#l=w,this.#c=T,this.#o=v;let R=Py(e);this.#r=this.#r&gc|R|NR,R!==xr&&R!==Sn&&R!==di&&(this.#r|=vc)}#V=[];#W=!1;#K(e){this.#W=!1;let t=this.#V.slice();this.#V.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let i=n.slice(0,n.provisional);t?e(null,i):queueMicrotask(()=>e(null,i));return}if(this.#V.push(e),this.#W)return;this.#W=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(i,o)=>{if(i)this.#$(i.code),n.provisional=0;else{for(let a of o)this.#j(a,n);this.#M(n)}this.#K(n.slice(0,n.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#U)await this.#U;else{let n=()=>{};this.#U=new Promise(s=>n=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#j(s,e);this.#M(e)}catch(s){this.#$(s.code),e.provisional=0}this.#U=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#j(n,e);this.#M(e)}catch(n){this.#$(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&PR)return!1;let e=Mr&this.#r;return e===xr||e===Sn||e===di}shouldWalk(e,t){return(this.#r&Sn)===Sn&&!(this.#r&PR)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#D)return this.#D;if(!((Sf|Tf|rn)&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(!((Sf|Tf|rn)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}[qR](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],s=this;for(;s&&s.parent;)t.add(s),s.#C=n.join(this.sep),s.#N=n.join("/"),s=s.parent,n.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#C=void 0,s.#N=void 0,s=s.parent}},wf=class r extends zt{sep="\\";splitSep=Qj;constructor(e,t=xr,n,s,i,o,a){super(e,t,n,s,i,o,a)}newChild(e,t=xr,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Io.win32.parse(e).root}getRoot(e){if(e=Xj(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Mo(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(AR,"$1\\"),e===t}},Ef=class r extends zt{splitSep="/";sep="/";constructor(e,t=xr,n,s,i,o,a){super(e,t,n,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=xr,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Nf=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#n;constructor(e=process.cwd(),t,n,{nocase:s,childrenCacheSize:i=16*1024,fs:o=yc}={}){this.#n=OR(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,DR.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new kf,this.#t=new kf,this.#i=new Ry(i);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,f=this.rootPath,p=!1;for(let b of c){let g=u--;l=l.child(b,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:f+=(p?"":d)+b}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#e.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#t.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let s=await e.readdir();return n?s:s.map(i=>i.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((p,b)=>{if(p)return f(p);let g=b.length;if(!g)return f();let _=()=>{--g===0&&f()};for(let w of b)(!i||i(w))&&a.push(n?w:w.fullpath()),s&&w.isSymbolicLink()?w.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(c,o)?l(T,_):_()):w.shouldWalk(c,o)?l(w,_):_()},!0)},u=e;return new Promise((d,f)=>{l(u,p=>{if(p)return f(p);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!i||i(d))&&a.push(n?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,o)&&c.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t;(!i||i(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!i||i(u))&&(yield n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new Ps({objectMode:!0});(!i||i(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let b=(_,w,T=!1)=>{if(_)return a.emit("error",_);if(s&&!T){let v=[];for(let R of w)R.isSymbolicLink()&&v.push(R.realpath().then(A=>A?.isUnknown()?A.lstat():A));if(v.length){Promise.all(v).then(()=>b(null,w,!0));return}}for(let v of w)v&&(!i||i(v))&&(a.write(n?v:v.fullpath())||(f=!0));u--;for(let v of w){let R=v.realpathCached()||v;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):g||d()},g=!0;p.readdirCB(b,!0),g=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new Ps({objectMode:!0}),c=new Set;(!i||i(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let b=p.readdirSync();for(let g of b)(!i||i(g))&&(a.write(n?g:g.fullpath())||(f=!0));u--;for(let g of b){let _=g;if(g.isSymbolicLink()){if(!(s&&(_=g.realpathSync())))continue;_.isUnknown()&&_.lstatSync()}_.shouldWalk(c,o)&&l.push(_)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[qR](t)}},Mo=class extends Nf{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,Io.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Io.win32.parse(e).root.toUpperCase()}newRoot(e){return new wf(this.rootPath,Sn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},xo=class extends Nf{sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,Io.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Ef(this.rootPath,Sn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Tc=class extends xo{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},M5=process.platform==="win32"?wf:Ef,jR=process.platform==="win32"?Mo:process.platform==="darwin"?Tc:xo;var eF=r=>r.length>=1,tF=r=>r.length>=1,Lo=class r{#e;#t;#i;length;#n;#o;#T;#l;#d;#a;#c=!0;constructor(e,t,n,s){if(!eF(e))throw new TypeError("empty pattern list");if(!tF(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=n,this.#n=s,this.#i===0){if(this.isUNC()){let[i,o,a,c,...l]=this.#e,[u,d,f,p,...b]=this.#t;l[0]===""&&(l.shift(),b.shift());let g=[i,o,a,c,""].join("/"),_=[u,d,f,p,""].join("/");this.#e=[g,...l],this.#t=[_,...b],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=i+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===jt}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#T=this.#T||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new r(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 rF=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",$o=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:s,noglobstar:i,platform:o=rF}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:s,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new _r(e,this.mmopts);for(let n=0;n<t.set.length;n++){let s=t.set[n],i=t.globParts[n];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new Lo(s,i,0,this.platform),a=new _r(o.globString(),this.mmopts),c=i[i.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),n=`${t}/`,s=e.relative()||".",i=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(i))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(n))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var Cy=class r{store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),s=this.store.get(n);s?s.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Dy=class{store=new Map;add(e,t,n){let s=(t?2:0)|(n?1:0),i=this.store.get(e);this.store.set(e,i===void 0?s:s&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},Oy=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(s=>s.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},_c=class r{hasWalkedCache;matches=new Dy;subwalks=new Oy;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Cy}processPatterns(e,t){this.patterns=t;let n=t.map(s=>[e,s]);for(let[s,i]of n){this.hasWalkedCache.storeWalked(s,i);let o=i.root(),a=i.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=i.rest();if(d)i=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=i.pattern())=="string"&&(l=i.rest());)s=s.resolve(c),i=l,u=!0;if(c=i.pattern(),l=i.rest(),u){if(this.hasWalkedCache.hasWalked(s,i))continue;this.hasWalkedCache.storeWalked(s,i)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===jt){(!s.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(s,i);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(s,a,d===""||d===".");else if(d===".."){let p=s.parent||s;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),s=this.child();for(let i of t)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===jt?s.testGlobstar(i,o,l,a):c instanceof RegExp?s.testRegExp(i,c,l,a):s.testString(i,c,l,a)}return s}testGlobstar(e,t,n,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let i=n.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(e,i,n.rest(),s);else if(i===".."){let o=e.parent||e;this.subwalks.add(o,n)}else i instanceof RegExp&&this.testRegExp(e,i,n.rest(),s)}}testRegExp(e,t,n,s){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}testString(e,t,n,s){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}};var nF=(r,e)=>typeof r=="string"?new $o([r],e):Array.isArray(r)?new $o(r,e):r,Pf=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#i=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=nF(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.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,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let i=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let i=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=i.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,t)}matchFinish(e,t){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let i=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(i+s)}else{let i=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!i.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(i?o+i+s:"."+s)}}async match(e,t,n){let s=await this.matchCheck(e,n);s&&this.matchFinish(s,t)}matchSync(e,t,n){let s=this.matchCheckSync(e,n);s&&this.matchFinish(s,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new _c(this.opts),n)}walkCB2(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,s));return}n.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of n.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,t,n,s){n=n.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of n.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())i++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new _c(this.opts),n)}walkCB2Sync(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,s));return}n.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of n.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,t,n,s){n=n.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of n.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())i++,this.walkCB2Sync(a,c,n.child(),o);o()}},Sc=class extends Pf{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},kc=class extends Pf{results;constructor(e,t,n){super(e,t,n),this.results=new Ps({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var sF=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",nn=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,FR.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||sF,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?Mo:t.platform==="darwin"?Tc:t.platform?xo:jR;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(c=>new _r(c,s)),[o,a]=i.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new Lo(c,u,0,this.platform)})}async walk(){return[...await new Sc(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 Sc(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 kc(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 kc(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 Ay=(r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new _r(t,e).hasMagic())return!0;return!1};function Rf(r,e={}){return new nn(r,e).streamSync()}function UR(r,e={}){return new nn(r,e).stream()}function VR(r,e={}){return new nn(r,e).walkSync()}async function BR(r,e={}){return new nn(r,e).walk()}function Cf(r,e={}){return new nn(r,e).iterateSync()}function WR(r,e={}){return new nn(r,e).iterate()}var iF=Rf,oF=Object.assign(UR,{sync:Rf}),aF=Cf,cF=Object.assign(WR,{sync:Cf}),lF=Object.assign(VR,{stream:Rf,iterate:Cf}),fi=Object.assign(BR,{glob:BR,globSync:VR,sync:lF,globStream:UR,stream:oF,globStreamSync:Rf,streamSync:iF,globIterate:WR,iterate:cF,globIterateSync:Cf,iterateSync:aF,Glob:nn,hasMagic:Ay,escape:Ro,unescape:en});fi.glob=fi;var Ib=require("path"),Mb=require("fs");var GO=z(HO());var Ob={};kA(Ob,{$id:()=>AH,$schema:()=>OH,default:()=>$H,definitions:()=>MH,properties:()=>LH,title:()=>IH,type:()=>xH});var OH="http://json-schema.org/draft-07/schema#",AH="http://json-schema.org/draft-07/schema#",IH="Core schema meta-schema",MH={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:[]}},xH=["object","boolean"],LH={$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:"#"}},$H={$schema:OH,$id:AH,title:IH,definitions:MH,type:xH,properties:LH,default:!0};var Et=z(J());var uh=class extends ka{constructor(t,n){super();this.ajv=t;this.schemaKey=n;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(t,n){let s=[],i=n.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Oe&&o.value==="disabled")return[...n.definitions,...n.referencedBy].forEach(c=>s.push(C(22,c,Et.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[Et.DiagnosticTag.Unnecessary]))),s;let a=Ee.toJson(n);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(...qH(t,c,n,this.schemaKey))),console.log(this.schemaKey,`${n.path.join("/")}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${n.path.join("/")}`,this.schemaKey,c)}return s}getOnPropertyHover(t){let n=(this.validate?.schema).properties?.[t];if(n&&typeof n=="object"&&"description"in n)return{kind:Et.MarkupKind.Markdown,value:[...n.description?["### Description",Array.isArray(n.description)?n.description.join(`
|
|
275
|
+
};`,kind:mt.CompletionItemKind.Value,insertTextFormat:mt.InsertTextFormat.Snippet}))]}function Cx(n,e){let t=s=>s?s.parentNode instanceof At||s.parentNode instanceof pt||s.parentNode instanceof Ne?!1:t(s.parentNode):!0;if(!n||n.item!==null||!Nt(n.ast)||!t(n.ast))return[];let r=s=>wd(s,e).filter(i=>e(i));return n.ast instanceof nt?r(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:mt.CompletionItemKind.Keyword,insertTextFormat:mt.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:mt.CompletionItemKind.Keyword,insertTextFormat:mt.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(n.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:n.ast instanceof ge?`${s}`:`&${s}`,kind:mt.CompletionItemKind.Variable}))}function Dx(n,e){if(!n||!(n.item instanceof Te)||n.item===null||n.beforeAst&&(!(n.beforeAst?.parentNode instanceof tn)||n.beforeAst?.parentNode instanceof We))return[];let t=r=>[...r.nodes,...r.deletedNodes.filter(s=>!e(s.by)).map(s=>s.node)].flatMap(s=>s.definitions.filter(i=>i instanceof Ne)).filter(s=>e(s));return n.ast instanceof Ie||n.ast instanceof pn||n.beforeAst?.parentNode instanceof pn?Array.from(new Set(t(n.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:mt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",kind:mt.CompletionItemKind.Keyword,insertTextFormat:mt.InsertTextFormat.Snippet,sortText:"~"}]:[]}function Ox(n,e){if(!n||!(n.item instanceof Te)||n.beforeAst&&(!(n.beforeAst?.parentNode instanceof tn)||n.beforeAst?.parentNode instanceof pn))return[];let t=r=>[...r.property,...r.deletedProperties.filter(s=>!e(s.by)).map(s=>s.property)].flatMap(s=>[s,...s.allReplaced]).filter(s=>e(s.ast));return n.ast instanceof Fe||n.ast instanceof We||n.beforeAst?.parentNode instanceof We?Array.from(new Set(t(n.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:mt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:mt.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:mt.InsertTextFormat.Snippet}]:[]}function Ax(n,e){let t=n?.ast instanceof Hr?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof Hr))return[];let r=t.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let s=r.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...s],e);return[...o?.nodes.filter(a=>!Nt(n.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...s,o].join("/")}`,kind:mt.CompletionItemKind.Variable}))}var _d=n=>!n||n instanceof Ae?!1:n instanceof nn||_d(n.parentNode);function Ix(n){return!n||!(n.item instanceof He&&n.item.ast.assignOperatorToken)?[]:!_d(n?.ast)&&!(n.ast instanceof Ae&&n.item.ast.values===null)&&!_d(n.beforeAst)&&!_d(n.afterAst)?[]:n.item.parent.nodeType instanceof $n?Array.from([n.runtime.context.parser,...n.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([r,s])=>s.macro.identifier instanceof Ts?{label:`${s.macro.identifier.toString()} -> ${s.macro.content?.toString()??"__UNSET__"}`,insertText:`${s.macro.name}(${s.macro.identifier.params.map((i,o)=>i instanceof qt?`$${o+1}`:"").join(", ")})`,kind:mt.CompletionItemKind.Function,sortText:`~${s.macro.name}`,insertTextFormat:mt.InsertTextFormat.Snippet}:{label:s.macro.identifier.name,kind:mt.CompletionItemKind.Variable,sortText:`~${s.macro.name}`}):[]}async function iN(n,e){return Et(n,e,(t,r)=>[...Ox(t,r),...Dx(t,r),...Cx(t,r),...Ax(t,r),...Rx(t,r),...Px(t,r),...Nx(t),...Ix(t)])}var kr=H(J());function Mx(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if(s instanceof Ae)return kr.Location.create(ue(s.uri),Q(s.propertyName??s));if(s instanceof We)return kr.Location.create(ue(s.uri),Q(s.propertyName??s))}).filter(s=>s);if(n.item instanceof He&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof Te&&n.ast instanceof Fe&&n.ast.parentNode instanceof We){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function xx(n){if(!n)return[];let e=t=>{let s=n.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&n.runtime.rootNode.getChild(a[0].split("/"))===t)return!0}).map(o=>o.ast)??[],i=t.parent?.deletedNodes.filter(o=>o.node===t&&(o.by.nodeNameOrRef instanceof Ie?o.by.nodeNameOrRef!==n.ast:!t.linkedRefLabels.some(a=>a!==n.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...s,...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions,...i].map(o=>{if(o instanceof pt)return kr.Location.create(ue(o.uri),Q(o.name??o));if(o instanceof Ne)return kr.Location.create(ue(o.uri),Q(o.name??o));if(o instanceof Ie)return kr.Location.create(ue(o.uri),Q(o));if(o instanceof Ie)return kr.Location.create(ue(o.uri),Q(o));if(o instanceof ge)return kr.Location.create(ue(o.uri),Q(o.label??o));if(o instanceof Ae)return kr.Location.create(ue((o.values??o)?.uri),Q(o.values??o))}).filter(o=>o)};if(n.item instanceof Te&&!Nt(n.ast))return e(n.item);if(n.ast instanceof Lt&&n.ast.parentNode instanceof ge&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Ie&&n.ast.linksTo)return Nt(n.ast)?[...e(n.ast.linksTo),kr.Location.create(ue(n.ast.uri),Q(n.ast))]:e(n.ast.linksTo);if(n?.ast instanceof Oe&&n.item instanceof He&&n.item.parent.name==="aliases"){let t=n.runtime.rootNode.getChild(n.ast.value.split("/"));if(t)return e(t)}return[]}async function oN(n,e){return Et(n,e,t=>[...xx(t),...Mx(t)])}var Kr=H(J());function aN(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if((s instanceof Ae||s instanceof We)&&s.propertyName)return Kr.Location.create(ue(s.uri),Q(s.propertyName))}).filter(s=>s);if(n.item instanceof He&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof Te&&n.ast instanceof Fe&&n.ast.parentNode instanceof We){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function cN(n,e){if(!e||!(e.ast instanceof Lt))return[];"newName"in n&&(e.ast.parentNode instanceof ge&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof bs&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,r=s=>[...s.definitions.filter(i=>i instanceof Ne).flatMap(i=>i.labels.map(o=>o.label)),...s.linkedRefLabels.map(i=>i.label)].filter(i=>i?.value===t).map(i=>{if(i)return Kr.Location.create(ue(i.uri),Q(i))}).filter(i=>i);return e.item instanceof Te&&!Nt(e.ast)?r(e.item):e.ast instanceof Lt&&e.ast.parentNode instanceof ge&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function lN(n){if(!n||!(n.ast instanceof Ie))return[];let e=t=>{let s=n.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=n.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(t)||c===t)return!0}}).map(o=>o.ast)??[],i=t.parent?.deletedNodes.filter(o=>o.node===t&&o.by.nodeNameOrRef!==n.ast).map(o=>o.by.nodeNameOrRef)??[];return[...s,...t.linkedNodeNamePaths,...t.definitions,...i].map(o=>{if(o instanceof Ne&&o.name)return Kr.Location.create(ue(o.uri),Q(o.name));if(o instanceof Ie)return Kr.Location.create(ue(o.uri),Q(o));if(o instanceof Ae&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof Oe){let a=o.values.values[0].value,c=Q(a),l=a.value.split("/"),u=t.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,Kr.Location.create(ue(o.values.values[0].uri),c)}}).filter(o=>o)};return n.item instanceof Te&&!Nt(n.ast)?e(n.item):n.ast instanceof Ie&&n.ast.linksTo?Nt(n.ast)?[...e(n.ast.linksTo),Kr.Location.create(ue(n.ast.uri),Q(n.ast))]:e(n.ast.linksTo):[]}async function uN(n,e){let t={};return(await Et(n,e,s=>[...lN(s),...cN(n,s),...aN(s)])).forEach(s=>{t[s.uri]??=[],t[s.uri].push(Kr.TextEdit.replace(s.range,n.newName))}),{changes:t}}async function dN(n,e){let t=await Et(n,e,r=>[...lN(r),...cN(n,r),...aN(r)]);if(t.some(r=>e?.settings.lockRenameEdits?.some(s=>tt(r.uri).startsWith(s))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!t.length}}var ko=H(J());function $x(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast)].map(s=>{if(s instanceof Ae)return ko.Location.create(ue(s.uri),Q(s.propertyName??s))}).filter(s=>s);if(n.item instanceof He&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof Te&&n.ast instanceof Fe&&n.ast.parentNode instanceof We){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function Lx(n){if(!n)return[];let e=t=>[...t.definitions,...t.referencedBy].map(r=>{if(r instanceof pt)return ko.Location.create(ue(r.uri),Q(r));if(r instanceof Ne)return ko.Location.create(ue(r.uri),Q(r));if(r instanceof At)return ko.Location.create(ue(r.uri),Q(r))}).filter(r=>r);if(n.item instanceof Te&&!Nt(n.ast))return e(n.item);if(n.ast instanceof Lt&&n.ast.parentNode instanceof ge&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Ie&&n.ast.linksTo)return e(n.ast.linksTo);if(n?.ast instanceof Oe&&n.item instanceof He&&n.item.parent.name==="aliases"){let t=n.runtime.rootNode.getChild(n.ast.value.split("/"));if(t)return e(t)}return[]}function qx(n){if(n?.ast instanceof qt||n?.ast instanceof wr){let e=n.runtime.context.parser.cPreprocessorParser.macros.get(n.ast instanceof qt?n.ast.name:n.ast.value);if(e)return[ko.Location.create(ue(e.macro.uri),Q(e.macro.identifier))]}return[]}async function fN(n,e){return Et(n,e,t=>[...Lx(t),...$x(t),...qx(t)])}var Ed=H(J());function jx(n){if(!n||n.item===null||!(n.ast instanceof Fe))return;let e=r=>r.replaces?e(r.replaces):r,t=r=>Ed.Location.create(ue(r.ast.uri),Q(r.ast.propertyName??r.ast));if(n.item instanceof He&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof Te&&n.ast instanceof Fe&&n.ast.parentNode instanceof We){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(e(r))}}function Fx(n){if(!n)return;let e=t=>{let r=t.definitions.at(0);return r?Ed.Location.create(ue(r.uri),Q(r)):void 0};if(n.item instanceof Te&&!Nt(n.ast))return e(n.item);if(n.ast instanceof Lt&&n.ast.parentNode instanceof ge&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Ie&&n.ast.linksTo)return e(n.ast.linksTo);if(n?.ast instanceof Oe&&n.item instanceof He&&n.item.parent.name==="aliases"){let t=n.runtime.rootNode.getChild(n.ast.value.split("/"));if(t)return e(t)}}function Bx(n){if(n?.ast instanceof qt||n?.ast instanceof wr){let e=n.runtime.context.parser.cPreprocessorParser.macros.get(n.ast instanceof qt?n.ast.name:n.ast.value);if(e)return Ed.Location.create(ue(e.macro.uri),Q(e.macro.identifier))}}async function hN(n,e){return(await Et(n,e,t=>[Fx(t)||jx(t)||Bx(t)])).at(0)}var te=H(J());var Ux=(n,e,t,r,s)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.insert(te.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.insert(te.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.replace(te.Range.create(te.Position.create(r.range.start.line,n.pos.colEnd),te.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.insert(te.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.insert(te.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.insert(te.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.insert(te.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[te.TextEdit.insert(te.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},Vx=(n,e,t,r,s,i,o)=>{if(!i)return[];switch(t){case 0:return[{title:o??`Add Property "${i.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[r],kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 28:return[{title:o??"Remove Property",diagnostics:[r],kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 27:return[{title:o??"TODO",diagnostics:[r],kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 26:return i?[{title:o??"TODO",diagnostics:[r],kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}]:[];default:return}};function pN(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>Ux(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>Vx(c.firstToken,c.lastToken,l,a,n.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),t=e.filter(a=>a.kind===te.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),s=e.filter(a=>a.kind!==te.CodeActionKind.SourceFixAll),i=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return r.forEach(a=>{let c=a.edit.changes[n.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...s,...t.map(a=>({...a,kind:te.CodeActionKind.QuickFix})),...i.length?[{title:"Fix All",kind:te.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:i}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:te.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}var kd=n=>!n||n instanceof Ae?!1:n instanceof nn||kd(n.parentNode);function Wx(n){if(!n||!(n.item instanceof He&&n.item.ast.assignOperatorToken))return[];let e=kd(n?.ast);if(!e&&!(n.ast instanceof Ae&&n.item.ast.values===null)&&!kd(n.beforeAst)&&!kd(n.afterAst))return[];let t=-1;n.item.ast.values===null?t=0:t=(n.item.ast.values?.values.findIndex(s=>s&&$m(s,n.beforeAst))??-1)+1,t===-1&&(t=0);let r=n.item.parent.nodeType;return r instanceof $n?r.properties.find(s=>s.name===n.item?.name)?.getPropertyCompletionItems(n.item,t,e)??[]:[]}function Hx(n){if(!n||!(n.item instanceof He&&n.ast instanceof Fe&&n.item.ast.values==null||n.item instanceof Te)||Nt(n.ast)||n.beforeAst?.parentNode instanceof tn)return[];let e=t=>t.nodeType?.getPropertyListCompletionItems(t)??[];return n.item instanceof He?e(n.item.parent):e(n.item)}async function mN(n,e){return Et(n,e,t=>[...Wx(t),...Hx(t)])}var Hm=H(J());function gN(n){return!n||n instanceof Ss?n:gN(n.parentNode)}async function Kx(n){if(n?.ast instanceof qt||n?.ast instanceof wr){let e=n.runtime.context.parser.cPreprocessorParser.macros.get(n?.ast instanceof qt?n.ast.name:n.ast.value);if(e){let t=gN(n.ast),r=(await n.runtime.context.getAllParsers()).at(-1);if(t){let s=t?.evaluate(r.cPreprocessorParser.macros);return{contents:{kind:Hm.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${s}${typeof s=="number"?` (0x${s.toString(16)})`:""}`,"```"].join(`
|
|
276
|
+
`)},range:Q(n.ast)}}return{contents:{kind:Hm.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${n.ast?.evaluate(r.cPreprocessorParser.macros)}`,"```"].join(`
|
|
277
|
+
`)},range:Q(n.ast)}}}}async function zx(n){if(!n)return;let e=(await n.runtime.context.getAllParsers()).at(-1);if(n?.item instanceof Te)return{contents:n.item.toMarkupContent(e.cPreprocessorParser.macros),range:Q(n.ast)};if(n?.ast instanceof Ie){let t=n.ast.linksTo;if(t)return{contents:t.toMarkupContent(e.cPreprocessorParser.macros),range:Q(n.ast)}}if(n?.ast.parentNode instanceof ge){let t=n.ast.parentNode.linksTo;if(t)return{contents:t.toMarkupContent(e.cPreprocessorParser.macros),range:Q(n.ast)}}if(n?.ast instanceof Oe&&n.item instanceof He&&n.item.parent.name==="aliases"){let t=n.runtime.rootNode.getChild(n.ast.value.split("/"));if(t)return{contents:t.toMarkupContent(e.cPreprocessorParser.macros),range:Q(n.ast)}}}function Gx(n){if(n?.item instanceof He&&n.ast instanceof Fe){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:Q(n.ast)}}}function yN(n,e){return Et(n,e,async t=>[await zx(t)||Gx(t)||await Kx(t)])}var Hb=H(Ny());var kR=H(yR(),1);var vc=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var Nj={"[: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]},bc=n=>n.replace(/[[\]\\-]/g,"\\$&"),Pj=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),vR=n=>n.join(""),bR=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],i=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;i<n.length;){let g=n.charAt(i);if((g==="!"||g==="^")&&i===t+1){l=!0,i++;continue}if(g==="]"&&o&&!c){u=i+1;break}if(o=!0,g==="\\"&&!c){c=!0,i++;continue}if(g==="["&&!c){for(let[S,[E,T,v]]of Object.entries(Nj))if(n.startsWith(S,i)){if(d)return["$.",!1,n.length-t,!0];i+=S.length,v?s.push(E):r.push(E),a=a||T;continue e}}if(c=!1,d){g>d?r.push(bc(d)+"-"+bc(g)):g===d&&r.push(bc(g)),d="",i++;continue}if(n.startsWith("-]",i+1)){r.push(bc(g+"-")),i+=2;continue}if(n.startsWith("-",i+1)){d=g,i+=2;continue}r.push(bc(g)),i++}if(u<i)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,n.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[Pj(g),!1,u-t,!1]}let f="["+(l?"^":"")+vR(r)+"]",p="["+(l?"":"^")+vR(s)+"]";return[r.length&&s.length?"("+f+"|"+p+")":r.length?f:p,a,u-t,!0]};var ar=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Rj=new Set(["!","?","+","*","@"]),TR=n=>Rj.has(n),Cj="(?!(?:^|/)\\.\\.?(?:$|/))",Ef="(?!\\.)",Dj=new Set(["[","."]),Oj=new Set(["..","."]),Aj=new Set("().*{}+?[]^$\\!"),Ij=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Cy="[^/]",SR=Cy+"*?",_R=Cy+"+?",$o=class n{type;#e;#t;#i=!1;#r=[];#o;#T;#l;#d=!1;#a;#c;#s=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#T=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#c=this.#r.map(e=>String(e)).join("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,r=t.#o;for(;r;){for(let s=t.#T+1;!r.type&&s<r.#r.length;s++)for(let i of e.#r){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#r[s])}t=r,r=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof n&&t.#o===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#T===0)return!0;let e=this.#o;for(let t=0;t<this.#T;t++){let r=e.#r[t];if(!(r instanceof n&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#r.length:0;return this.#T===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new n(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#y(e,t,r,s){let i=!1,o=!1,a=-1,c=!1;if(t.type===null){let p=r,b="";for(;p<e.length;){let g=e.charAt(p++);if(i||g==="\\"){i=!i,b+=g;continue}if(o){p===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(p===a+2&&c)&&(o=!1),b+=g;continue}else if(g==="["){o=!0,a=p,c=!1,b+=g;continue}if(!s.noext&&TR(g)&&e.charAt(p)==="("){t.push(b),b="";let S=new n(g,t);p=n.#y(e,S,p,s),t.push(S);continue}b+=g}return t.push(b),p}let l=r+1,u=new n(null,t),d=[],f="";for(;l<e.length;){let p=e.charAt(l++);if(i||p==="\\"){i=!i,f+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(l===a+2&&c)&&(o=!1),f+=p;continue}else if(p==="["){o=!0,a=l,c=!1,f+=p;continue}if(TR(p)&&e.charAt(l)==="("){u.push(f),f="";let b=new n(p,u);u.push(b),l=n.#y(e,b,l,s);continue}if(p==="|"){u.push(f),f="",d.push(u),u=new n(null,t);continue}if(p===")")return f===""&&t.#r.length===0&&(t.#s=!0),u.push(f),f="",t.push(...d,u),l;f+=p}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new n(null,void 0,t);return n.#y(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,i]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#r.map(p=>{let[b,g,S,E]=typeof p=="string"?n.#f(p,this.#t,c):p.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,b}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&Oj.has(this.#r[0]))){let b=Dj,g=t&&b.has(l.charAt(0))||l.startsWith("\\.")&&b.has(l.charAt(2))||l.startsWith("\\.\\.")&&b.has(l.charAt(4)),S=!t&&!e&&b.has(l.charAt(0));u=g?Cj:S?Ef:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,ar(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#h(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return this.#r=[c],this.type=null,this.#t=void 0,[c,ar(this.toString()),!1,!1]}let o=!r||e||t||!Ef?"":this.#h(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!t?Ef:"")+_R;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Ef:"")+SR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,ar(i),this.#t=!!this.#t,this.#i]}#h(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,i,o]=t.toRegExpSource(e);return this.#i=this.#i||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#f(e,t,r=!1){let s=!1,i="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,i+=(Aj.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=bR(e,a);if(d){i+=l,o=o||u,a+=d-1,t=t||f;continue}}if(c==="*"){r&&e==="*"?i+=_R:i+=SR,t=!0;continue}if(c==="?"){i+=Cy,t=!0;continue}i+=Ij(c)}return[i,ar(e),!!t,o]}};var Lo=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var sn=(n,e,t={})=>(vc(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Nn(e,t).match(n)),Mj=/^\*+([^+@!?\*\[\(]*)$/,xj=n=>e=>!e.startsWith(".")&&e.endsWith(n),$j=n=>e=>e.endsWith(n),Lj=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),qj=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),jj=/^\*+\.\*+$/,Fj=n=>!n.startsWith(".")&&n.includes("."),Bj=n=>n!=="."&&n!==".."&&n.includes("."),Uj=/^\.\*+$/,Vj=n=>n!=="."&&n!==".."&&n.startsWith("."),Wj=/^\*+$/,Hj=n=>n.length!==0&&!n.startsWith("."),Kj=n=>n.length!==0&&n!=="."&&n!=="..",zj=/^\?+([^+@!?\*\[\(]*)?$/,Gj=([n,e=""])=>{let t=NR([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},Yj=([n,e=""])=>{let t=PR([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},Jj=([n,e=""])=>{let t=PR([n]);return e?r=>t(r)&&r.endsWith(e):t},Xj=([n,e=""])=>{let t=NR([n]);return e?r=>t(r)&&r.endsWith(e):t},NR=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},PR=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},RR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",wR={win32:{sep:"\\"},posix:{sep:"/"}},Qj=RR==="win32"?wR.win32.sep:wR.posix.sep;sn.sep=Qj;var Ft=Symbol("globstar **");sn.GLOBSTAR=Ft;var Zj="[^/]",eF=Zj+"*?",tF="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",nF="(?:(?!(?:\\/|^)\\.).)*?",rF=(n,e={})=>t=>sn(t,n,e);sn.filter=rF;var jn=(n,e={})=>Object.assign({},n,e),sF=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return sn;let e=sn;return Object.assign((r,s,i={})=>e(r,s,jn(n,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,jn(n,i))}static defaults(s){return e.defaults(jn(n,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,jn(n,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,jn(n,i))}},unescape:(r,s={})=>e.unescape(r,jn(n,s)),escape:(r,s={})=>e.escape(r,jn(n,s)),filter:(r,s={})=>e.filter(r,jn(n,s)),defaults:r=>e.defaults(jn(n,r)),makeRe:(r,s={})=>e.makeRe(r,jn(n,s)),braceExpand:(r,s={})=>e.braceExpand(r,jn(n,s)),match:(r,s,i={})=>e.match(r,s,jn(n,i)),sep:e.sep,GLOBSTAR:Ft})};sn.defaults=sF;var CR=(n,e={})=>(vc(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,kR.default)(n));sn.braceExpand=CR;var iF=(n,e={})=>new Nn(n,e).makeRe();sn.makeRe=iF;var oF=(n,e,t={})=>{let r=new Nn(e,t);return n=n.filter(s=>r.match(s)),r.options.nonull&&!n.length&&n.push(e),n};sn.match=oF;var ER=/[?*]|[+@!]\(.*?\)|\[|\]/,aF=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Nn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){vc(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||RR,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=i[0]===""&&i[1]===""&&(i[2]==="?"||!ER.test(i[2]))&&!ER.test(i[3]),l=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(l)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let i=e[s];s===1&&i===""&&e[0]===""||(i==="."||i==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let o=s;for(;r[o+1]==="**";)o++;o>s&&r.splice(s+1,o-s);let a=r[s+1],c=r[s+2],l=r[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let u=r.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let o=r[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...c),r.length===0&&r.push(""),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let s=0,i=0,o=[],a="";for(;s<e.length&&i<t.length;)if(e[s]===t[i])o.push(a==="b"?t[i]:e[s]),s++,i++;else if(r&&e[s]==="**"&&t[i]===e[s+1])o.push(e[s]),s++;else if(r&&t[i]==="**"&&e[s]===t[i+1])o.push(t[i]),i++;else if(e[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,i++}else if(t[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(t[i]),s++,i++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),v=S?3:g?0:void 0,R=T?3:E?0:void 0;if(typeof v=="number"&&typeof R=="number"){let[A,$]=[e[v],t[R]];A.toLowerCase()===$.toLowerCase()&&(t[R]=A,R>v?t=t.slice(R):v>R&&(e=e.slice(v)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===Ft){this.debug("GLOBSTAR",[t,u,d]);var f=o,p=a+1;if(p===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var b=e[f];if(this.debug(`
|
|
278
|
+
globstar while`,e,f,t,p,b),this.matchOne(e.slice(f),t.slice(p),r))return this.debug("globstar found match!",f,c,b),!0;if(b==="."||b===".."||!s.dot&&b.charAt(0)==="."){this.debug("dot detected!",e,f,t,p);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
|
|
279
|
+
>>> no match, partial?`,e,f,t,p),f===c))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return CR(this.pattern,this.options)}parse(e){vc(e);let t=this.options;if(e==="**")return Ft;if(e==="")return"";let r,s=null;(r=e.match(Wj))?s=t.dot?Kj:Hj:(r=e.match(Mj))?s=(t.nocase?t.dot?qj:Lj:t.dot?$j:xj)(r[1]):(r=e.match(zj))?s=(t.nocase?t.dot?Yj:Gj:t.dot?Jj:Xj)(r):(r=e.match(jj))?s=t.dot?Bj:Fj:(r=e.match(Uj))&&(s=Vj);let i=$o.fromGlob(e,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?eF:t.dot?tF:nF,s=new Set(t.nocase?["i"]:[]),i=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?aF(u):u===Ft?Ft:u._src});return l.forEach((u,d)=>{let f=l[d+1],p=l[d-1];u!==Ft||p===Ft||(p===void 0?f!==void 0&&f!==Ft?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=p+"(?:\\/|"+r+")?":f!==Ft&&(l[d-1]=p+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=Ft))}),l.filter(u=>u!==Ft).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let i=this.set;this.debug(this.pattern,"set",i);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<i.length;a++){let c=i[a],l=s;if(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return sn.defaults(e).Minimatch}};sn.AST=$o;sn.Minimatch=Nn;sn.escape=Lo;sn.unescape=ar;var ZR=require("node:url");var qo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,OR=new Set,Dy=typeof process=="object"&&process?process:{},AR=(n,e,t,r)=>{typeof Dy.emitWarning=="function"?Dy.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},kf=globalThis.AbortController,DR=globalThis.AbortSignal;if(typeof kf>"u"){DR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},kf=class{constructor(){e()}signal=new DR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let n=Dy.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,AR("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 cF=n=>!OR.has(n),f7=Symbol("type"),Is=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),IR=n=>Is(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?jo:null:null,jo=class extends Array{constructor(e){super(e),this.fill(0)}},Oy=class n{heap;length;static#e=!1;static create(e){let t=IR(e);if(!t)return[];n.#e=!0;let r=new n(e,t);return n.#e=!1,r}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Tc=class n{#e;#t;#i;#r;#o;#T;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#g;#y;#h;#f;#w;#m;#E;#k;#b;#S;#_;#p;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#b,sizes:e.#E,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#f},free:e.#w,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,r,s,i)=>e.#q(t,r,s,i),moveToTail:t=>e.#F(t),indexes:t=>e.#P(t),rindexes:t=>e.#R(t),isStale:t=>e.#v(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#T}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:b=0,sizeCalculation:g,fetchMethod:S,memoMethod:E,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:A,ignoreFetchAbort:$}=e;if(t!==0&&!Is(t))throw new TypeError("max option must be a nonnegative integer");let W=t?IR(t):Array;if(!W)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=p,this.maxEntrySize=b||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#T=E,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=S,this.#_=!!S,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#s=new Array(t).fill(void 0),this.#g=new W(t),this.#y=new W(t),this.#h=0,this.#f=0,this.#w=Oy.create(t),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#r=u,this.#m=[]):(this.#r=void 0,this.#m=void 0),this.#S=!!this.#i,this.#p=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!$,this.maxEntrySize!==0){if(this.#t!==0&&!Is(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Is(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Is(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!Is(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 j="LRU_CACHE_UNBOUNDED";cF(j)&&(OR.add(j),AR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,n))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new jo(this.#e),t=new jo(this.#e);this.#b=e,this.#k=t,this.#A=(i,o,a=qo.now())=>{if(t[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#v(i)&&this.#O(this.#c[i],"expire")},o+1);c.unref&&c.unref()}},this.#N=i=>{t[i]=e[i]!==0?qo.now():0},this.#n=(i,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=r||s();let l=i.now-c;i.remainingTTL=a-l}};let r=0,s=()=>{let i=qo.now();if(this.ttlResolution>0){r=i;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=this.#a.get(i);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(r||s())-c;return a-l},this.#v=i=>{let o=t[i],a=e[i];return!!a&&!!o&&(r||s())-o>a}}#N=()=>{};#n=()=>{};#A=()=>{};#v=()=>!1;#D(){let e=new jo(this.#e);this.#d=0,this.#E=e,this.#I=t=>{this.#d-=e[t],e[t]=0},this.#x=(t,r,s,i)=>{if(this.#u(r))return 0;if(!Is(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(r,t),!Is(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#M=(t,r,s)=>{if(e[t]=r,this.#t){let i=this.#t-e[t];for(;this.#d>i;)this.#L(!0)}this.#d+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#d)}}#I=e=>{};#M=(e,t,r)=>{};#x=(e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#f;!(!this.#$(t)||((e||!this.#v(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#$(t)||((e||!this.#v(t))&&(yield t),t===this.#f));)t=this.#g[t]}#$(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*rentries(){for(let e of this.#R())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#s[e])&&(yield t)}}*rkeys(){for(let e of this.#R()){let t=this.#c[e];t!==void 0&&!this.#u(this.#s[e])&&(yield t)}}*values(){for(let e of this.#P())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#R())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#P()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#c[r],this))return this.get(this.#c[r],t)}}forEach(e,t=this){for(let r of this.#P()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[r],this)}}rforEach(e,t=this){for(let r of this.#R()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[r],this)}}purgeStale(){let e=!1;for(let t of this.#R({allowStale:!0}))this.#v(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let r=this.#s[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0)return;let i={value:s};if(this.#b&&this.#k){let o=this.#b[t],a=this.#k[t];if(o&&a){let c=o-(qo.now()-a);i.ttl=c,i.start=Date.now()}}return this.#E&&(i.size=this.#E[t]),i}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let r=this.#c[t],s=this.#s[t],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0||r===void 0)continue;let o={value:i};if(this.#b&&this.#k){o.ttl=this.#b[t];let a=qo.now()-this.#k[t];o.start=Math.floor(Date.now()-a)}this.#E&&(o.size=this.#E[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=qo.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#x(e,t,r.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#f:this.#w.length!==0?this.#w.pop():this.#l===this.#e?this.#L(!1):this.#l,this.#c[d]=e,this.#s[d]=t,this.#a.set(e,d),this.#g[this.#f]=d,this.#y[d]=this.#f,this.#f=d,this.#l++,this.#M(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(t!==f){if(this.#_&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=f;p!==void 0&&!o&&(this.#S&&this.#i?.(p,e,"set"),this.#p&&this.#m?.push([p,e,"set"]))}else o||(this.#S&&this.#i?.(f,e,"set"),this.#p&&this.#m?.push([f,e,"set"]));if(this.#I(d),this.#M(d,u,c),this.#s[d]=t,c){c.set="replace";let p=f&&this.#u(f)?f.__staleWhileFetching:f;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(s!==0&&!this.#b&&this.#C(),this.#b&&(l||this.#A(d,s,i),c&&this.#n(c,d)),!o&&this.#p&&this.#m){let f=this.#m,p;for(;p=f?.shift();)this.#r?.(...p)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#h];if(this.#L(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#r?.(...t)}}}#L(e){let t=this.#h,r=this.#c[t],s=this.#s[t];return this.#_&&this.#u(s)?s.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#i?.(s,r,"evict"),this.#p&&this.#m?.push([s,r,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#s[t]=void 0,this.#w.push(t)),this.#l===1?(this.#h=this.#f=0,this.#w.length=0):this.#h=this.#g[t],this.#a.delete(r),this.#l--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,i=this.#a.get(e);if(i!==void 0){let o=this.#s[i];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#v(i))s&&(s.has="stale",this.#n(s,i));else return r&&this.#N(i),s&&(s.has="hit",this.#n(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#a.get(e);if(s===void 0||!r&&this.#v(s))return;let i=this.#s[s];return this.#u(i)?i.__staleWhileFetching:i}#q(e,t,r,s){let i=t===void 0?void 0:this.#s[t];if(this.#u(i))return i;let o=new kf,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:s},l=(g,S=!1)=>{let{aborted:E}=o.signal,T=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!T&&!S)return d(o.signal.reason);let v=p;return this.#s[t]===p&&(g===void 0?v.__staleWhileFetching?this.#s[t]=v.__staleWhileFetching:this.#O(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),d(g)),d=g=>{let{aborted:S}=o.signal,E=S&&r.allowStaleOnFetchAbort,T=E||r.allowStaleOnFetchRejection,v=T||r.noDeleteOnFetchRejection,R=p;if(this.#s[t]===p&&(!v||R.__staleWhileFetching===void 0?this.#O(e,"fetch"):E||(this.#s[t]=R.__staleWhileFetching)),T)return r.status&&R.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw g},f=(g,S)=>{let E=this.#o?.(e,i,c);E&&E instanceof Promise&&E.then(T=>g(T===void 0?void 0:T),S),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=T=>l(T,!0)))})};r.status&&(r.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),b=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,b,{...c.options,status:void 0}),t=this.#a.get(e)):this.#s[t]=b,b}#u(e){if(!this.#_)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof kf}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:T}=t;if(!this.#_)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:E});let v={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:b,ignoreFetchAbort:p,status:E,signal:T},R=this.#a.get(e);if(R===void 0){E&&(E.fetch="miss");let A=this.#q(e,R,v,g);return A.__returned=A}else{let A=this.#s[R];if(this.#u(A)){let qe=r&&A.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",qe&&(E.returnedStale=!0)),qe?A.__staleWhileFetching:A.__returned=A}let $=this.#v(R);if(!S&&!$)return E&&(E.fetch="hit"),this.#F(R),s&&this.#N(R),E&&this.#n(E,R),A;let W=this.#q(e,R,v,g),ie=W.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=$?"stale":"refresh",ie&&$&&(E.returnedStale=!0)),ie?W.__staleWhileFetching:W.__returned=W}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#T;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=t,a=this.get(e,o);if(!i&&a!==void 0)return a;let c=r(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#n(o,a),this.#v(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(i||this.#O(e,"expire"),o&&r&&(o.returnedStale=!0),r?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),s&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,t){this.#y[t]=e,this.#g[e]=t}#F(e){e!==this.#f&&(e===this.#h?this.#h=this.#g[e]:this.#j(this.#y[e],this.#g[e]),this.#j(this.#f,e),this.#f=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let r=!1;if(this.#l!==0){let s=this.#a.get(e);if(s!==void 0)if(r=!0,this.#l===1)this.#B(t);else{this.#I(s);let i=this.#s[s];if(this.#u(i)?i.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#i?.(i,e,t),this.#p&&this.#m?.push([i,e,t])),this.#a.delete(e),this.#c[s]=void 0,this.#s[s]=void 0,s===this.#f)this.#f=this.#y[s];else if(s===this.#h)this.#h=this.#g[s];else{let o=this.#y[s];this.#g[o]=this.#g[s];let a=this.#g[s];this.#y[a]=this.#y[s]}this.#l--,this.#w.push(s)}}if(this.#p&&this.#m?.length){let s=this.#m,i;for(;i=s?.shift();)this.#r?.(...i)}return r}clear(){return this.#B("delete")}#B(e){for(let t of this.#R({allowStale:!0})){let r=this.#s[t];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#S&&this.#i?.(r,s,e),this.#p&&this.#m?.push([r,s,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#b&&this.#k&&(this.#b.fill(0),this.#k.fill(0)),this.#E&&this.#E.fill(0),this.#h=0,this.#f=0,this.#w.length=0,this.#d=0,this.#l=0,this.#p&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#r?.(...r)}}};var Uo=require("node:path"),VR=require("node:url"),Dr=require("fs"),vF=H(require("node:fs"),1),$s=require("node:fs/promises");var Af=require("node:events"),qy=H(require("node:stream"),1),qR=require("node:string_decoder"),MR=typeof process=="object"&&process?process:{stdout:null,stderr:null},lF=n=>!!n&&typeof n=="object"&&(n instanceof xs||n instanceof qy.default||uF(n)||dF(n)),uF=n=>!!n&&typeof n=="object"&&n instanceof Af.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==qy.default.Writable.prototype.pipe,dF=n=>!!n&&typeof n=="object"&&n instanceof Af.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Yr=Symbol("EOF"),Jr=Symbol("maybeEmitEnd"),Ms=Symbol("emittedEnd"),Nf=Symbol("emittingEnd"),Sc=Symbol("emittedError"),Pf=Symbol("closed"),xR=Symbol("read"),Rf=Symbol("flush"),$R=Symbol("flushChunk"),cr=Symbol("encoding"),Fo=Symbol("decoder"),It=Symbol("flowing"),_c=Symbol("paused"),Bo=Symbol("resume"),Mt=Symbol("buffer"),on=Symbol("pipes"),xt=Symbol("bufferLength"),Ay=Symbol("bufferPush"),Cf=Symbol("bufferShift"),Gt=Symbol("objectMode"),gt=Symbol("destroyed"),Iy=Symbol("error"),My=Symbol("emitData"),LR=Symbol("emitEnd"),xy=Symbol("emitEnd2"),Rr=Symbol("async"),$y=Symbol("abort"),Df=Symbol("aborted"),wc=Symbol("signal"),yi=Symbol("dataListeners"),Pn=Symbol("discarded"),Ec=n=>Promise.resolve().then(n),fF=n=>n(),hF=n=>n==="end"||n==="finish"||n==="prefinish",pF=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,mF=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Of=class{src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[Bo](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ly=class extends Of{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},gF=n=>!!n.objectMode,yF=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",xs=class extends Af.EventEmitter{[It]=!1;[_c]=!1;[on]=[];[Mt]=[];[Gt];[cr];[Rr];[Fo];[Yr]=!1;[Ms]=!1;[Nf]=!1;[Pf]=!1;[Sc]=null;[xt]=0;[gt]=!1;[wc];[Df]=!1;[yi]=0;[Pn]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");gF(t)?(this[Gt]=!0,this[cr]=null):yF(t)?(this[cr]=t.encoding,this[Gt]=!1):(this[Gt]=!1,this[cr]=null),this[Rr]=!!t.async,this[Fo]=this[cr]?new qR.StringDecoder(this[cr]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Mt]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[on]});let{signal:r}=t;r&&(this[wc]=r,r.aborted?this[$y]():r.addEventListener("abort",()=>this[$y]()))}get bufferLength(){return this[xt]}get encoding(){return this[cr]}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[Gt]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Rr]}set async(e){this[Rr]=this[Rr]||!!e}[$y](){this[Df]=!0,this.emit("abort",this[wc]?.reason),this.destroy(this[wc]?.reason)}get aborted(){return this[Df]}set aborted(e){}write(e,t,r){if(this[Df])return!1;if(this[Yr])throw new Error("write after end");if(this[gt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[Rr]?Ec:fF;if(!this[Gt]&&!Buffer.isBuffer(e)){if(mF(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(pF(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Gt]?(this[It]&&this[xt]!==0&&this[Rf](!0),this[It]?this.emit("data",e):this[Ay](e),this[xt]!==0&&this.emit("readable"),r&&s(r),this[It]):e.length?(typeof e=="string"&&!(t===this[cr]&&!this[Fo]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[cr]&&(e=this[Fo].write(e)),this[It]&&this[xt]!==0&&this[Rf](!0),this[It]?this.emit("data",e):this[Ay](e),this[xt]!==0&&this.emit("readable"),r&&s(r),this[It]):(this[xt]!==0&&this.emit("readable"),r&&s(r),this[It])}read(e){if(this[gt])return null;if(this[Pn]=!1,this[xt]===0||e===0||e&&e>this[xt])return this[Jr](),null;this[Gt]&&(e=null),this[Mt].length>1&&!this[Gt]&&(this[Mt]=[this[cr]?this[Mt].join(""):Buffer.concat(this[Mt],this[xt])]);let t=this[xR](e||null,this[Mt][0]);return this[Jr](),t}[xR](e,t){if(this[Gt])this[Cf]();else{let r=t;e===r.length||e===null?this[Cf]():typeof r=="string"?(this[Mt][0]=r.slice(e),t=r.slice(0,e),this[xt]-=e):(this[Mt][0]=r.subarray(e),t=r.subarray(0,e),this[xt]-=e)}return this.emit("data",t),!this[Mt].length&&!this[Yr]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[Yr]=!0,this.writable=!1,(this[It]||!this[_c])&&this[Jr](),this}[Bo](){this[gt]||(!this[yi]&&!this[on].length&&(this[Pn]=!0),this[_c]=!1,this[It]=!0,this.emit("resume"),this[Mt].length?this[Rf]():this[Yr]?this[Jr]():this.emit("drain"))}resume(){return this[Bo]()}pause(){this[It]=!1,this[_c]=!0,this[Pn]=!1}get destroyed(){return this[gt]}get flowing(){return this[It]}get paused(){return this[_c]}[Ay](e){this[Gt]?this[xt]+=1:this[xt]+=e.length,this[Mt].push(e)}[Cf](){return this[Gt]?this[xt]-=1:this[xt]-=this[Mt][0].length,this[Mt].shift()}[Rf](e=!1){do;while(this[$R](this[Cf]())&&this[Mt].length);!e&&!this[Mt].length&&!this[Yr]&&this.emit("drain")}[$R](e){return this.emit("data",e),this[It]}pipe(e,t){if(this[gt])return e;this[Pn]=!1;let r=this[Ms];return t=t||{},e===MR.stdout||e===MR.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[on].push(t.proxyErrors?new Ly(this,e,t):new Of(this,e,t)),this[Rr]?Ec(()=>this[Bo]()):this[Bo]()),e}unpipe(e){let t=this[on].find(r=>r.dest===e);t&&(this[on].length===1?(this[It]&&this[yi]===0&&(this[It]=!1),this[on]=[]):this[on].splice(this[on].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[Pn]=!1,this[yi]++,!this[on].length&&!this[It]&&this[Bo]();else if(e==="readable"&&this[xt]!==0)super.emit("readable");else if(hF(e)&&this[Ms])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Sc]){let s=t;this[Rr]?Ec(()=>s.call(this,this[Sc])):s.call(this,this[Sc])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[yi]=this.listeners("data").length,this[yi]===0&&!this[Pn]&&!this[on].length&&(this[It]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[yi]=0,!this[Pn]&&!this[on].length&&(this[It]=!1)),t}get emittedEnd(){return this[Ms]}[Jr](){!this[Nf]&&!this[Ms]&&!this[gt]&&this[Mt].length===0&&this[Yr]&&(this[Nf]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Pf]&&this.emit("close"),this[Nf]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==gt&&this[gt])return!1;if(e==="data")return!this[Gt]&&!r?!1:this[Rr]?(Ec(()=>this[My](r)),!0):this[My](r);if(e==="end")return this[LR]();if(e==="close"){if(this[Pf]=!0,!this[Ms]&&!this[gt])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[Sc]=r,super.emit(Iy,r);let i=!this[wc]||this.listeners("error").length?super.emit("error",r):!1;return this[Jr](),i}else if(e==="resume"){let i=super.emit("resume");return this[Jr](),i}else if(e==="finish"||e==="prefinish"){let i=super.emit(e);return this.removeAllListeners(e),i}let s=super.emit(e,...t);return this[Jr](),s}[My](e){for(let r of this[on])r.dest.write(e)===!1&&this.pause();let t=this[Pn]?!1:super.emit("data",e);return this[Jr](),t}[LR](){return this[Ms]?!1:(this[Ms]=!0,this.readable=!1,this[Rr]?(Ec(()=>this[xy]()),!0):this[xy]())}[xy](){if(this[Fo]){let t=this[Fo].end();if(t){for(let r of this[on])r.dest.write(t);this[Pn]||super.emit("data",t)}}for(let t of this[on])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Gt]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Gt]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Gt])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[cr]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(gt,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Pn]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Yr])return t();let i,o,a=d=>{this.off("data",c),this.off("end",l),this.off(gt,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(gt,u),this.pause(),i({value:d,done:!!this[Yr]})},l=()=>{this.off("error",a),this.off("data",c),this.off(gt,u),t(),i({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,i=d,this.once(gt,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Pn]=!1;let e=!1,t=()=>(this.pause(),this.off(Iy,t),this.off(gt,t),this.off("end",t),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once(Iy,t),this.once(gt,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[gt])return e?this.emit("error",e):this.emit(gt),this;this[gt]=!0,this[Pn]=!0,this[Mt].length=0,this[xt]=0;let t=this;return typeof t.close=="function"&&!this[Pf]&&t.close(),e?this.emit("error",e):this.emit(gt),this}static get isStream(){return lF}};var bF=Dr.realpathSync.native,Nc={lstatSync:Dr.lstatSync,readdir:Dr.readdir,readdirSync:Dr.readdirSync,readlinkSync:Dr.readlinkSync,realpathSync:bF,promises:{lstat:$s.lstat,readdir:$s.readdir,readlink:$s.readlink,realpath:$s.realpath}},WR=n=>!n||n===Nc||n===vF?Nc:{...Nc,...n,promises:{...Nc.promises,...n.promises||{}}},HR=/^\\\\\?\\([a-z]:)\\?$/i,TF=n=>n.replace(/\//g,"\\").replace(HR,"$1\\"),SF=/[\\\/]/,Bn=0,KR=1,zR=2,Cr=4,GR=6,YR=8,vi=10,JR=12,Fn=15,kc=~Fn,jy=16,jR=32,Pc=64,lr=128,If=256,xf=512,FR=Pc|lr|xf,_F=1023,Fy=n=>n.isFile()?YR:n.isDirectory()?Cr:n.isSymbolicLink()?vi:n.isCharacterDevice()?zR:n.isBlockDevice()?GR:n.isSocket()?JR:n.isFIFO()?KR:Bn,BR=new Map,Rc=n=>{let e=BR.get(n);if(e)return e;let t=n.normalize("NFKD");return BR.set(n,t),t},UR=new Map,Mf=n=>{let e=UR.get(n);if(e)return e;let t=Rc(n.toLowerCase());return UR.set(n,t),t},$f=class extends Tc{constructor(){super({max:256})}},By=class extends Tc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},XR=Symbol("PathScurry setAsCwd"),Yt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#T;get gid(){return this.#T}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#a;get ino(){return this.#a}#c;get size(){return this.#c}#s;get blocks(){return this.#s}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#f;get birthtimeMs(){return this.#f}#w;get atime(){return this.#w}#m;get mtime(){return this.#m}#E;get ctime(){return this.#E}#k;get birthtime(){return this.#k}#b;#S;#_;#p;#C;#N;#n;#A;#v;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Bn,r,s,i,o,a){this.name=e,this.#b=i?Mf(e):Rc(e),this.#n=t&_F,this.nocase=i,this.roots=s,this.root=r||this,this.#A=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=WR(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(s):this.#I(s)}#I(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#A.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#A.set(this,t),this.#n&=~jy,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?Mf(e):Rc(e);for(let c of r)if(c.#b===s)return c;let i=this.parent?this.sep:"",o=this.#_?this.#_+i+e:void 0,a=this.newChild(e,Bn,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=lr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,t=this.parent;if(!t)return this.#N=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#_!==void 0)return this.#_;let e=this.name,t=this.parent;if(!t)return this.#_=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#_=s}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#p=`//?/${s}`:this.#p=s}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&Fn)===Bn}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&Fn)===YR}isDirectory(){return(this.#n&Fn)===Cr}isCharacterDevice(){return(this.#n&Fn)===zR}isBlockDevice(){return(this.#n&Fn)===GR}isFIFO(){return(this.#n&Fn)===KR}isSocket(){return(this.#n&Fn)===JR}isSymbolicLink(){return(this.#n&vi)===vi}lstatCached(){return this.#n&jR?this:void 0}readlinkCached(){return this.#v}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#v)return!0;if(!this.parent)return!1;let e=this.#n&Fn;return!(e!==Bn&&e!==vi||this.#n&If||this.#n&lr)}calledReaddir(){return!!(this.#n&jy)}isENOENT(){return!!(this.#n&lr)}isNamed(e){return this.nocase?this.#b===Mf(e):this.#b===Rc(e)}async readlink(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#v=r}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#v=r}catch(t){this.#u(t.code);return}}#M(e){this.#n|=jy;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#x()}}#x(){this.#n&lr||(this.#n=(this.#n|lr)&kc,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#x()}#R(){this.#n|=xf,this.#$()}#$(){if(this.#n&Pc)return;let e=this.#n;(e&Fn)===Cr&&(e&=kc),this.#n=e|Pc,this.#P()}#L(e=""){e==="ENOTDIR"||e==="EPERM"?this.#$():e==="ENOENT"?this.#x():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#$():e==="ENOENT"&&this.#x()}#u(e=""){let t=this.#n;t|=If,e==="ENOENT"&&(t|=lr),(e==="EINVAL"||e==="UNKNOWN")&&(t&=kc),this.#n=t,e==="ENOTDIR"&&this.parent&&this.parent.#$()}#j(e,t){return this.#O(e,t)||this.#F(e,t)}#F(e,t){let r=Fy(e),s=this.newChild(e.name,r,{parent:this}),i=s.#n&Fn;return i!==Cr&&i!==vi&&i!==Bn&&(s.#n|=Pc),t.unshift(s),t.provisional++,s}#O(e,t){for(let r=t.provisional;r<t.length;r++){let s=t[r];if((this.nocase?Mf(e.name):Rc(e.name))===s.#b)return this.#B(e,s,r,t)}}#B(e,t,r,s){let i=t.name;return t.#n=t.#n&kc|Fy(e),i!==e.name&&(t.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#n&lr)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#n&lr)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#H(e){let{atime:t,atimeMs:r,birthtime:s,birthtimeMs:i,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:p,mtime:b,mtimeMs:g,nlink:S,rdev:E,size:T,uid:v}=e;this.#w=t,this.#g=r,this.#k=s,this.#f=i,this.#d=o,this.#s=a,this.#E=c,this.#h=l,this.#t=u,this.#T=d,this.#a=f,this.#i=p,this.#m=b,this.#y=g,this.#r=S,this.#l=E,this.#c=T,this.#o=v;let R=Fy(e);this.#n=this.#n&kc|R|jR,R!==Bn&&R!==Cr&&R!==vi&&(this.#n|=Pc)}#V=[];#W=!1;#K(e){this.#W=!1;let t=this.#V.slice();this.#V.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let i=r.slice(0,r.provisional);t?e(null,i):queueMicrotask(()=>e(null,i));return}if(this.#V.push(e),this.#W)return;this.#W=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(i,o)=>{if(i)this.#L(i.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#M(r)}this.#K(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#j(s,e);this.#M(e)}catch(s){this.#L(s.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#j(r,e);this.#M(e)}catch(r){this.#L(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&FR)return!1;let e=Fn&this.#n;return e===Bn||e===Cr||e===vi}shouldWalk(e,t){return(this.#n&Cr)===Cr&&!(this.#n&FR)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#D)return this.#D;if(!((xf|If|lr)&this.#n))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(!((xf|If|lr)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}[XR](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],s=this;for(;s&&s.parent;)t.add(s),s.#C=r.join(this.sep),s.#N=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#C=void 0,s.#N=void 0,s=s.parent}},Lf=class n extends Yt{sep="\\";splitSep=SF;constructor(e,t=Bn,r,s,i,o,a){super(e,t,r,s,i,o,a)}newChild(e,t=Bn,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Uo.win32.parse(e).root}getRoot(e){if(e=TF(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new Vo(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(HR,"$1\\"),e===t}},qf=class n extends Yt{splitSep="/";sep="/";constructor(e,t=Bn,r,s,i,o,a){super(e,t,r,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Bn,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},jf=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:s,childrenCacheSize:i=16*1024,fs:o=Nc}={}){this.#r=WR(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,VR.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new $f,this.#t=new $f,this.#i=new By(i);let c=a.substring(this.rootPath.length).split(r);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,f=this.rootPath,p=!1;for(let b of c){let g=u--;l=l.child(b,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:f+=(p?"":d)+b}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#e.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#t.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(i=>i.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((p,b)=>{if(p)return f(p);let g=b.length;if(!g)return f();let S=()=>{--g===0&&f()};for(let E of b)(!i||i(E))&&a.push(r?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(c,o)?l(T,S):S()):E.shouldWalk(c,o)?l(E,S):S()},!0)},u=e;return new Promise((d,f)=>{l(u,p=>{if(p)return f(p);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!i||i(d))&&a.push(r?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,o)&&c.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t;(!i||i(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!i||i(u))&&(yield r?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new xs({objectMode:!0});(!i||i(e))&&a.write(r?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let b=(S,E,T=!1)=>{if(S)return a.emit("error",S);if(s&&!T){let v=[];for(let R of E)R.isSymbolicLink()&&v.push(R.realpath().then(A=>A?.isUnknown()?A.lstat():A));if(v.length){Promise.all(v).then(()=>b(null,E,!0));return}}for(let v of E)v&&(!i||i(v))&&(a.write(r?v:v.fullpath())||(f=!0));u--;for(let v of E){let R=v.realpathCached()||v;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):g||d()},g=!0;p.readdirCB(b,!0),g=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new xs({objectMode:!0}),c=new Set;(!i||i(e))&&a.write(r?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let b=p.readdirSync();for(let g of b)(!i||i(g))&&(a.write(r?g:g.fullpath())||(f=!0));u--;for(let g of b){let S=g;if(g.isSymbolicLink()){if(!(s&&(S=g.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(c,o)&&l.push(S)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[XR](t)}},Vo=class extends jf{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Uo.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Uo.win32.parse(e).root.toUpperCase()}newRoot(e){return new Lf(this.rootPath,Cr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Wo=class extends jf{sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Uo.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new qf(this.rootPath,Cr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Cc=class extends Wo{constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},y7=process.platform==="win32"?Lf:qf,QR=process.platform==="win32"?Vo:process.platform==="darwin"?Cc:Wo;var wF=n=>n.length>=1,EF=n=>n.length>=1,Ho=class n{#e;#t;#i;length;#r;#o;#T;#l;#d;#a;#c=!0;constructor(e,t,r,s){if(!wF(e))throw new TypeError("empty pattern list");if(!EF(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=r,this.#r=s,this.#i===0){if(this.isUNC()){let[i,o,a,c,...l]=this.#e,[u,d,f,p,...b]=this.#t;l[0]===""&&(l.shift(),b.shift());let g=[i,o,a,c,""].join("/"),S=[u,d,f,p,""].join("/");this.#e=[g,...l],this.#t=[S,...b],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=i+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===Ft}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#T=this.#T||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#e,this.#t,this.#i+1,this.#r),this.#o.#a=this.#a,this.#o.#d=this.#d,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#r==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var kF=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ko=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:s,noglobstar:i,platform:o=kF}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:s,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Nn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let s=t.set[r],i=t.globParts[r];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new Ho(s,i,0,this.platform),a=new Nn(o.globString(),this.mmopts),c=i[i.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),r=`${t}/`,s=e.relative()||".",i=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(i))return!0;for(let o of this.absolute)if(o.match(t)||o.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var Uy=class n{store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),s=this.store.get(r);s?s.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},Vy=class{store=new Map;add(e,t,r){let s=(t?2:0)|(r?1:0),i=this.store.get(e);this.store.set(e,i===void 0?s:s&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},Wy=class{store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Dc=class n{hasWalkedCache;matches=new Vy;subwalks=new Wy;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Uy}processPatterns(e,t){this.patterns=t;let r=t.map(s=>[e,s]);for(let[s,i]of r){this.hasWalkedCache.storeWalked(s,i);let o=i.root(),a=i.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=i.rest();if(d)i=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=i.pattern())=="string"&&(l=i.rest());)s=s.resolve(c),i=l,u=!0;if(c=i.pattern(),l=i.rest(),u){if(this.hasWalkedCache.hasWalked(s,i))continue;this.hasWalkedCache.storeWalked(s,i)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===Ft){(!s.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(s,i);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(s,a,d===""||d===".");else if(d===".."){let p=s.parent||s;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),s=this.child();for(let i of t)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Ft?s.testGlobstar(i,o,l,a):c instanceof RegExp?s.testRegExp(i,c,l,a):s.testString(i,c,l,a)}return s}testGlobstar(e,t,r,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let i=r.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(e,i,r.rest(),s);else if(i===".."){let o=e.parent||e;this.subwalks.add(o,r)}else i instanceof RegExp&&this.testRegExp(e,i,r.rest(),s)}}testRegExp(e,t,r,s){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,t,r,s){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};var NF=(n,e)=>typeof n=="string"?new Ko([n],e):Array.isArray(n)?new Ko(n,e):n,Ff=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=NF(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=i.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let i=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(i+s)}else{let i=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!i.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(i?o+i+s:"."+s)}}async match(e,t,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,t)}matchSync(e,t,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new Dc(this.opts),r)}walkCB2(e,t,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,s));return}r.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,r,o):a.readdirCB((l,u)=>this.walkCB3(a,u,r,o),!0)}o()}walkCB3(e,t,r,s){r=r.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||(i++,this.match(a,c,l).then(()=>o()));for(let[a,c]of r.subwalks.entries())i++,this.walkCB2(a,c,r.child(),o);o()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new Dc(this.opts),r)}walkCB2Sync(e,t,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,s));return}r.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,r,o)}o()}walkCB3Sync(e,t,r,s){r=r.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())i++,this.walkCB2Sync(a,c,r.child(),o);o()}},Oc=class extends Ff{matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Ac=class extends Ff{results;constructor(e,t,r){super(e,t,r),this.results=new xs({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 PF=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ur=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,ZR.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||PF,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?Vo:t.platform==="darwin"?Cc:t.platform?Wo:QR;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(c=>new Nn(c,s)),[o,a]=i.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new Ho(c,u,0,this.platform)})}async walk(){return[...await new Oc(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 Oc(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 Ac(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 Ac(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 Hy=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new Nn(t,e).hasMagic())return!0;return!1};function Bf(n,e={}){return new ur(n,e).streamSync()}function tC(n,e={}){return new ur(n,e).stream()}function nC(n,e={}){return new ur(n,e).walkSync()}async function eC(n,e={}){return new ur(n,e).walk()}function Uf(n,e={}){return new ur(n,e).iterateSync()}function rC(n,e={}){return new ur(n,e).iterate()}var RF=Bf,CF=Object.assign(tC,{sync:Bf}),DF=Uf,OF=Object.assign(rC,{sync:Uf}),AF=Object.assign(nC,{stream:Bf,iterate:Uf}),bi=Object.assign(eC,{glob:eC,globSync:nC,sync:AF,globStream:tC,stream:CF,globStreamSync:Bf,streamSync:RF,globIterate:rC,iterate:OF,globIterateSync:Uf,iterateSync:DF,Glob:ur,hasMagic:Hy,escape:Lo,unescape:ar});bi.glob=bi;var Kb=require("path"),zb=require("fs");var aA=H(sA());var Wb={};WA(Wb,{$id:()=>tK,$schema:()=>eK,default:()=>oK,definitions:()=>rK,properties:()=>iK,title:()=>nK,type:()=>sK});var eK="http://json-schema.org/draft-07/schema#",tK="http://json-schema.org/draft-07/schema#",nK="Core schema meta-schema",rK={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:[]}},sK=["object","boolean"],iK={$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:"#"}},oK={$schema:eK,$id:tK,title:nK,definitions:rK,type:sK,properties:iK,default:!0};var Ct=H(J());var wh=class extends Aa{constructor(t,r){super();this.ajv=t;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(t,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Oe&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>s.push(C(22,c,Ct.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[Ct.DiagnosticTag.Unnecessary]))),s;let a=Te.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(...aK(t,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.path.join("/")}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.path.join("/")}`,this.schemaKey,c)}return s}getOnPropertyHover(t){let r=(this.validate?.schema).properties?.[t];if(r&&typeof r=="object"&&"description"in r)return{kind:Ct.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
|
|
264
280
|
|
|
265
|
-
`):
|
|
266
|
-
`)}}getPropertyListCompletionItems(t){let
|
|
267
|
-
${"".padEnd(
|
|
281
|
+
`):r.description]:[]].join(`
|
|
282
|
+
`)}}getPropertyListCompletionItems(t){let r=Object.keys((this.validate?.schema).properties),s=(this.validate?.schema).required;return r.map(i=>{let o=t&&s.some(l=>l===i),a=!!t.property.some(l=>i===l.name),c="a";return o?c=a?"Y":"A":c=a?"Z":"B",{label:`${i}`,kind:Ct.CompletionItemKind.Property,sortText:`${c}${i}`}})??[]}},aK=(n,e,t,r)=>{let s=cK(t,e.instancePath),i=s.node;if(e.keyword==="additionalProperties"){let o=i.getProperty(e.params.additionalProperty);return o?[C(26,o.ast,Ct.DiagnosticSeverity.Error,[],[],[`Node "${i.name}" ${e.message}: ${o.name}`],Ct.TextEdit.del(ri(o.ast.firstToken.prevToken,o.ast.lastToken,!1)),"Remove property")]:[]}else if(e.keyword==="type"){let o=i.getProperty(e.instancePath.split("/")[1]);return o?[C(26,o.ast,Ct.DiagnosticSeverity.Error,[],[],[`"${o.name}" ${e.message??"NO MESSAGE"}`])]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let o=e.params.missingProperty,a=n.getOrderedNodeAst(i),c=uo(a);return a.map((l,u)=>{let d=l.openScope??c[u].lastToken;return C(0,c[u],Ct.DiagnosticSeverity.Error,[],[],[o],Ct.TextEdit.insert(Ct.Position.create(d.pos.line,d.pos.col+1),`
|
|
283
|
+
${"".padEnd(po(c[u].uri,l)*co().length,co())}${o};`))})}else if(e.keyword==="const"){let o=s.property;return o?[C(26,o.ast,Ct.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}: ${e.params.allowedValue}`])]:[]}else if(e.keyword==="enum"){let o=s.property;return o?[C(26,o.ast,Ct.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}:
|
|
268
284
|
${e.params.allowedValues.join(`
|
|
269
285
|
`)}
|
|
270
|
-
${
|
|
286
|
+
${r}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=i.getProperty(e.instancePath.split("/").at(-1)??"");return o?[C(26,o.ast,Ct.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}`])]:[]}return s.property?[C(26,s.property.ast,void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
271
287
|
${JSON.stringify(e)}
|
|
272
|
-
${
|
|
288
|
+
${r}`])]:[C(26,s.node.definitions[0]instanceof pt?s.node.definitions[0]:s.node.definitions[0].name??s.node.definitions[0],void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
273
289
|
${JSON.stringify(e)}
|
|
274
|
-
${n}`])]},jH=(r,e)=>KO(r,e.split("/").filter(t=>t)),KO=(r,e)=>{if(e.length===0)return{node:r,remainingInstancePath:""};let t=e[0].split("@"),n=t[0],s=t.at(1)?.split(",").map(o=>Number.parseInt(o,16)),i=r.getNode(n,s);return i?KO(i,e.slice(1)):{node:r,property:r.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var xb=class r{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let n=e.getProperty("compatible")?.ast.values;if(!n?.values.some(s=>!(s?.value instanceof Oe)))return n?.values.map(s=>(s?.value).value)}parseMetaSchema(e,t){fi.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,Ib.resolve)(e,s);try{let i=Ab.default.parse((0,Mb.readFileSync)(s,"utf-8"));t.addMetaSchema(i),this.schemaIdValidators.set(i.$id,s)}catch{}})}parseBindings(e,t){fi.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,Ib.resolve)(e,s);try{let i=Ab.default.parse((0,Mb.readFileSync)(s,"utf-8"));t.addSchema(i),this.schemaIdValidators.set(i.$id,s)}catch(i){console.warn(s,i.message)}})}getNodeTypes(e,t,n){let s=`${e.join(";")}::${t.join(";")}`,i=this.ajvMap.get(s);return i||(i=new GO.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(Ob),this.ajvMap.set(s,i),e.forEach(c=>this.parseMetaSchema(c,i)),t.forEach(c=>this.parseBindings(c,i))),r.getNodeCompatible(n)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new uh(i,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=i.getSchema(l);return u.description=(d?.schema).description,u.examples=(d?.schema).examples,u.maintainers=(d?.schema).maintainers,u}catch(l){console.warn(l.message)}}).filter(c=>c)??[]}},zO,YO=()=>(zO??=new xb,zO);var ZO=z(hy());var Qo=require("path"),eA=require("fs");var Rn=z(J()),FH=r=>{switch(r){case"string":return V(3);case"int":return V(1);case"boolean":return V(0);case"array":return V(4);case"uint8-array":return V(6);case"string-array":return V(5);case"phandle":return V(1);case"phandles":return V(4);case"phandle-array":return V(4);case"path":return V([3,1]);case"compound":return V(8)}},JO=(r,e)=>{switch(r){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},dh=(r,e)=>{if(e=e.include.reduce((t,n)=>{let s=r.find(i=>(0,Qo.basename)(i.filePath)===n.name);if(s){let i=n["property-blocklist"];return t.include=t.include.filter(o=>o!==n),BH(r,s,t,i)??t}return console.warn(`Unable to find ${n}`),t},e),e["child-binding"]&&(e["child-binding"].include=tA(e["child-binding"].include),e["child-binding"]=dh(r,e["child-binding"])),!e.include.length)return e},BH=(r,e,t,n=[])=>{let s=dh(r,e),i=dh(r,t);if(!s||!i)return;let o=new Set;Object.keys(s?.properties??{}).forEach(d=>o.add(d)),Object.keys(i?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=n?.some(b=>b===d)?{}:s.properties?.[d]??{},p=i.properties?.[d]??{};a={...a,[d]:{...f,...p}}}),i.properties=a;let c=new Set;return Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=s[d]??[],p=i[d]??[];i[d]=Array.from([...f,...p])}),i},tA=r=>r?typeof r=="string"?[{name:r}]:r.map(e=>typeof e!="string"?e:{name:e}):[],Lb=class r{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let n=e.getProperty("compatible")?.ast.values;if(!n?.values.some(s=>!(s?.value instanceof Oe)))return n?.values.map(s=>(s?.value).value)}getNodeTypes(e,t){let n=r.getNodeCompatible(t);if(!n)return[ti(t)];let s=n.map(o=>this.typeCache.get(o)?.(t)).filter(o=>o);if(s.length)return s;this.loadTypeAndCache(e);let i=n.map(o=>this.typeCache.get(o)?.(t)).filter(o=>o);return i.length?i:[ti(t)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let s=fi.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,Qo.resolve)(t,o);try{let a=ZO.default.parse((0,eA.readFileSync)(o,"utf-8"));return{...a,include:tA(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),i=s.map(o=>dh(s,o)).filter(o=>!!o&&!o.include.length);UH(i,this.typeCache)})}},XO,rA=()=>(XO??=new Lb,XO),UH=(r,e)=>r.forEach(t=>{let n=t.compatible??(t.filePath?(0,Qo.basename)(t.filePath,"yaml"):void 0);n&&e.set(n,s=>nA(t,s))}),nA=(r,e)=>{let t=ti(e);t.compatible=r.compatible??(r.filePath?(0,Qo.basename)(r.filePath,"yaml"):void 0),t.description=r.description,t.bindingsPath=r.filePath,t.bus=typeof r.bus=="string"?[r.bus]:r.bus,t.onBus=r["on-bus"];let s=Object.keys(r).filter(i=>i.endsWith("-cells")).map(i=>({specifier:i.replace(/-cells$/,""),values:r[i]}));if(r.properties&&Object.keys(r.properties).forEach(i=>{let o=r.properties[i];VH(t,i,o),t.cellsValues=s}),r["child-binding"]){let i=r["child-binding"];t.childNodeType=o=>nA(i,o)}return t},VH=(r,e,t)=>{let n=r.properties.find(s=>typeof s.name=="string"&&s.getNameMatch(e));if(n){n.required=()=>t.required?"required":"optional",n.values=()=>t.enum??[],n.constValue=JO(t.type,t.const);let s=n.additionalTypeCheck;n.additionalTypeCheck=i=>[...QO(t,e)(i),...s?.(i)??[]]}else{let s=new H(e,FH(t.type),t.required?"required":"optional",void 0,t.enum,QO(t,e));s.description=t.description?[t.description]:void 0,s.constValue=JO(t.type,t.const),r.addProperty(s)}},QO=(r,e)=>{let t=r;return n=>{let s=n.parent.root,i=[];if(t.const){let o=n.ast.quickValues;if(o?.length==1){let a=Array.isArray(t.const)?t.const:[t.const];Array.isArray(o[0])&&a.length===o[0].length&&o[0].every((l,u)=>typeof l=="number"&&Number.isNaN(l)||a[u]===l)||i.push(C(25,n.ast.values??n.ast,Rn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&i.push(C(14,n.ast,Rn.DiagnosticSeverity.Warning,[],[Rn.DiagnosticTag.Deprecated],[n.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&er(n.ast.values)?.forEach(a=>{Yr(a,s)||i.push(C(23,a,Rn.DiagnosticSeverity.Error))}),t.type==="path"&&n.ast.values?.values.at(0)?.value instanceof Oe){let o=n.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=s.getNode(c);return l?a.push(c):i.push(C(24,o,Rn.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=er(n.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=Yr(c,s);if(!l){i.push(C(23,c??n.ast,Rn.DiagnosticSeverity.Error));break}let u="";e.endsWith("-gpios")?u="gpio":u=t["specifier-space"]??e.slice(0,-1);let d=l.getProperty(`#${u}-cells`);if(!d){i.push(C(16,n.ast,Rn.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[n.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let f=d?Ce(d,0,0)??0:0;if(1+f>o.length-a){let p=l.nodeType?.cellsValues?.find(b=>b.specifier===u)?.values;i.push(C(20,c??n.ast,Rn.DiagnosticSeverity.Error,[],[],[n.name,`<${["phandel",...p??[],...Array.from({length:f-(p?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+f}}return i}};var fh=(r,e)=>({getNodeTypes:async t=>{switch(e){case"Zephyr":return rA().getNodeTypes(r.zephyrBindings,t);case"DevicetreeOrg":return YO().getNodeTypes(r.deviceOrgBindingsMetaSchema,r.deviceOrgTreeBindings,t)}}});var qb=z(J());var $b=r=>!r.openScope||!r.closeScope?.prevToken?r.nodes.flatMap($b):[{startLine:r.openScope.pos.line,startCharacter:r.openScope.pos.col,endLine:r.closeScope.prevToken.pos.line,endCharacter:r.closeScope.prevToken.pos.col,kind:qb.FoldingRangeKind.Region},...r.nodes.flatMap($b)],sA=r=>{let e=[];return[...r instanceof ms?r.ifBlocks.map(t=>({start:(t.expression??t.keyword).lastToken,end:t.content?.lastToken??(t.expression??t.keyword).lastToken})):[{start:(r.ifDef.identifier??r.ifDef.keyword).lastToken,end:r.ifDef.content?.lastToken}],r.elseOption?{start:r.elseOption.keyword.lastToken,end:r.elseOption.content?.lastToken}:null].forEach(t=>{!t||!t.end||e.push({startLine:t.start.pos.line,startCharacter:t.start.pos.col,endLine:t.end.pos.line,endCharacter:t.end.pos.col+t.end.pos.len,kind:qb.FoldingRangeKind.Region})}),e},WH=r=>r instanceof qe?$b(r):r instanceof lo||r instanceof ms?sA(r):[];function iA(r,e){return e.allAstItems.flatMap(t=>[t,...t.allDescendants]).filter(t=>t.uri===r).flatMap(WH)}var Ei=z(J());function HH(r){if(!r||!(r.ast instanceof je)&&!(r.ast instanceof Lt))return[];let e=t=>t.nodeType?.bindingsPath?[Ei.Location.create(ce(t.nodeType.bindingsPath),Ei.Range.create(Ei.Position.create(0,0),Ei.Position.create(0,0)))]:[];return r.item instanceof Ee&&!St(r.ast)?e(r.item):r.ast instanceof Lt&&r.ast.parentNode instanceof _e&&r.ast.parentNode.linksTo?e(r.ast.parentNode.linksTo):r.ast instanceof je&&r.ast.linksTo?e(r.ast.linksTo):[]}async function oA(r,e,t,n){return Mt(r,e,s=>[...HH(s)],t,n)}var Cn=require("path");var ph=require("fs");var KH=(r,e)=>{Xr().reset(r),Xr().requestTokens(r,!0),e(r)},hh=class{constructor(e,t,n){this.file=e;this.cb=t;this.hasDocumentOpen=n;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,t=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),KH(e,t)},(0,ph.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,ph.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var We=[],nt,jb,tl=new WeakMap,mh=new Map,Fb=r=>{We.some(e=>e===r)||(We.push(r),aA(r))},aA=async r=>{await r.stable(),r.getContextFiles().forEach(e=>{mh.has(e)||mh.set(e,new hh(e,zb,t=>!!yh(t))),mh.get(e)?.watch()})},Wb=async r=>{let e=We.indexOf(r);e!==-1&&(vh(r),tl.delete(r),console.log(`cleaning up context with ID ${r.name} and uri ${r.parser.uri}`),We.splice(e,1),cA(r))},cA=async r=>{await r.stable(),r.getContextFiles().forEach(e=>mh.get(e)?.unwatch())},zH=r=>{let e=tl.get(r);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,r.getRuntime()])},At=async()=>{await Kb,await Promise.all(We.map(zH))},gh=r=>{let e=lA(r);return We.filter(t=>!e.some(n=>n===t))},lA=r=>We.filter(e=>{let t=r.contexts?.find(n=>n.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(n=>e.overlays.some(s=>s===n))}),GH=async(r,e)=>{if(r===e)return!0;let t=(await r.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes),n=(await e.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes);return t.length?t.every(s=>n.some(i=>i.resolvedPath===s.resolvedPath&&i.firstToken.pos.col===s.firstToken.pos.col&&i.firstToken.pos.len===s.firstToken.pos.len&&i.firstToken.pos.line===s.firstToken.pos.line&&i.lastToken.pos.col===s.lastToken.pos.col&&i.lastToken.pos.len===s.lastToken.pos.len&&i.lastToken.pos.line===s.lastToken.pos.line)):e.getContextFiles().some(s=>s===r.parser.uri)},uA=r=>gh(pe).indexOf(r)!==-1,dA=async r=>{if(!uA(r))return;let e=gh(pe),t=await lA(pe),n=await ju(e),s=[...r.overlayParsers.map(a=>a.uri),r.parser.uri,...r.parser.includes.map(a=>a.resolvedPath)];if(We.indexOf(r)===-1)return;let i=await Promise.all(n.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await GH(a.context,c)})))),o=n.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==r&&a.context.parser.uri===r.parser.uri&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(Wb)},ve=(0,xe.createConnection)(xe.ProposedFeatures.all),$s=new xe.TextDocuments(Lu),Hb=!1,Bb=!1,fA=!1,Ub;ve.onInitialize(r=>{Ub=r.workspaceFolders,ve.console.log(`[Server(${process.pid}) ${Ub?.[0].uri}] Started and initialize received`);let e=r.capabilities;Hb=!!(e.workspace&&e.workspace.configuration),Bb=!!(e.workspace&&e.workspace.workspaceFolders),fA=!!e.workspace?.diagnostics?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:xe.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[xe.CodeActionKind.QuickFix,xe.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:$u,tokenModifiers:qu},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return Bb&&(t.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),t});ve.onInitialized(()=>{Hb&&ve.client.register(xe.DidChangeConfigurationNotification.type,{}),Bb&&ve.workspace.onDidChangeWorkspaceFolders(async r=>{ve.console.log("Workspace folder change event received"),await Kb,await mA(pe,pe)})});var hA={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},pe=hA,pA=new Map,Vb=!1,Kb=new Promise(r=>{let e=setInterval(()=>{Vb&&(r(),clearInterval(e))},100)}),Zo=async r=>{let e=(await ve.workspace.getWorkspaceFolders()??Ub)?.map(t=>xt(t.uri));return e?.length&&(r=r.replaceAll("${workspaceFolder}",e[0])),r},YH=r=>{if(r.cwd||pe.cwd){let e=r.cwd??pe.cwd;r.includePaths??=pe.defaultIncludePaths,r.zephyrBindings??=pe.defaultIncludePaths,r.bindingType??=pe.defaultBindingType,r.deviceOrgTreeBindings??=pe.defaultDeviceOrgTreeBindings,r.deviceOrgBindingsMetaSchema??=pe.defaultDeviceOrgBindingsMetaSchema,e&&r.bindingType==="Zephyr"&&(!r.zephyrBindings||r.zephyrBindings.length===0)&&(r.zephyrBindings=["./zephyr/dts/bindings"]),r.zephyrBindings=r.zephyrBindings?.map(t=>(0,Cn.resolve)(e,t)),r.deviceOrgTreeBindings=r.deviceOrgTreeBindings?.map(t=>(0,Cn.resolve)(e,t)),r.deviceOrgBindingsMetaSchema=r.deviceOrgBindingsMetaSchema?.map(t=>(0,Cn.resolve)(e,t)),r.includePaths=r.includePaths?.map(t=>(0,Cn.resolve)(e,t)),r.dtsFile=(0,Cn.resolve)(e,r.dtsFile)}},JH=async r=>{r.cwd=r.cwd?await Zo(r.cwd):void 0,r.defaultDeviceOrgBindingsMetaSchema=await Promise.all((r.defaultDeviceOrgBindingsMetaSchema??[]).map(Zo)),r.defaultDeviceOrgTreeBindings=await Promise.all((r.defaultDeviceOrgTreeBindings??[]).map(Zo)),r.defaultIncludePaths=await Promise.all((r.defaultIncludePaths??[]).map(Zo)),r.defaultZephyrBindings=await Promise.all((r.defaultZephyrBindings??[]).map(Zo)),r.lockRenameEdits=await Promise.all((r.lockRenameEdits??[]).map(Zo)),r.defaultIncludePaths=(r.defaultIncludePaths??[]).map(e=>r.cwd?(0,Cn.resolve)(r.cwd,e):e),r.cwd&&r.defaultBindingType==="Zephyr"&&!r.defaultZephyrBindings&&(r.defaultZephyrBindings=["./zephyr/dts/bindings"]),r.defaultZephyrBindings=(r.defaultZephyrBindings??[]).map(e=>r.cwd?(0,Cn.resolve)(r.cwd,e):e),r.defaultDeviceOrgBindingsMetaSchema=(r.defaultDeviceOrgBindingsMetaSchema??[]).map(e=>r.cwd?(0,Cn.resolve)(r.cwd,e):e),r.defaultDeviceOrgTreeBindings=(r.defaultDeviceOrgTreeBindings??[]).map(e=>r.cwd?(0,Cn.resolve)(r.cwd,e):e),r.contexts?.forEach(YH)},mA=async(r,e)=>{await JH(e),console.log("Resolve settings",JSON.stringify(e,void 0," ")),We.forEach(Wb),tl=new WeakMap,e.contexts?.forEach((n,s)=>{let i=n.bindingType,o=new po(n.dtsFile,n.includePaths??[],i?fh({zephyrBindings:n.zephyrBindings??[],deviceOrgBindingsMetaSchema:n.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:n.deviceOrgTreeBindings??[]},i):void 0,n.overlays,n.ctxName);Fb(o),console.log(`New context with ID ${o.name} for ${n.dtsFile}`)});let t=r?gh(r):[];t.map(n=>{let s=e.defaultBindingType,i=new po(n.parser.uri,e.defaultIncludePaths??[],s?fh({zephyrBindings:e.defaultZephyrBindings??[],deviceOrgBindingsMetaSchema:e.defaultDeviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:e.defaultDeviceOrgTreeBindings??[]},s):void 0);return console.log(`New context with ID ${i.name} for ${n.parser.uri}`),i}).forEach(Fb),t=gh(e),t.forEach(dA),jb&&rl(jb,!0),fA&&ve.languages.diagnostics.refresh()};ve.onDidChangeConfiguration(async r=>{let e;Vb&&(e=pe),r.settings&&(console.log("Configuration changed",JSON.stringify(r,void 0," ")),Hb&&pA.clear(),pe={...hA,...r.settings?.devicetree},await mA(e,pe),Vb=!0)});$s.onDidClose(r=>{let e=xt(r.document.uri),t=nt;if(!t)return;(t?.getContextFiles()??[]).filter(i=>i!==e).some(i=>yh(i))||(uA(t)?Wb(t):vh(t),nt=void 0),pA.delete(r.document.uri)});$s.onDidOpen(async r=>{await At();let e=nt,t=xt(r.document.uri);e||ve.sendDiagnostics({uri:r.document.uri,version:$s.get(r.document.uri)?.version,diagnostics:[{severity:xe.DiagnosticSeverity.Warning,range:xe.Range.create(xe.Position.create(0,0),xe.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}),zb(t)});var XH=r=>{switch(r){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include";case 37:return"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"}},QH=r=>r.issues.map(e=>{switch(e){case 0:return`Property "${r.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 "${r.templateStrings[0]}" has been defined`;case 8:return`No node with name "${r.templateStrings[0]}" could be found in "/${r.templateStrings[1]}".`;case 4:return`Label name "${r.templateStrings[0]}" already defined`;case 6:return`Property "${r.templateStrings[0]}" was deleted`;case 7:return`Node "${r.templateStrings[0]}" was deleted`;case 9:return`The following node "${r.templateStrings[1]}" shall be present in "${r.templateStrings[0]}" node.`}}).join(" or "),ZH=r=>{switch(r){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"}},eK=r=>r.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${r.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 ${r.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 28:return"INTRO name is not permitted under this node";case 10:return"INTRO first value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${r.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${r.templateStrings[1]}`;case 16:return`INTRO requires property "${r.templateStrings[1]}" in node path "${r.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${r.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${r.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${r.templateStrings[0]}" in ${r.templateStrings[1]}`;case 25:return r.templateStrings[0];case 26:return r.templateStrings[0];case 27:return r.templateStrings[0];case 29:return r.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${r.templateStrings[0]}"`).replaceAll("INTRO ",""),tK=r=>{switch(r){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";default:return"TODO"}},zb=async r=>{await Kb;let e=Ow(We,r);if(e.length)e.forEach(t=>{tl.get(t.context)?.abort.abort();let n=new AbortController,s=new Promise(i=>{setTimeout(async()=>{if(n.signal.aborted){i();return}let o=performance.now(),a=gA(t.context);cA(t.context),await t.context.reevaluate(r),aA(t.context),Gb(t.context).then(c=>{vh(t.context,a),c.items.map(l=>({uri:l.uri,version:l.version??void 0,diagnostics:l.items})).forEach(l=>{ve.sendDiagnostics(l)})}),i(),console.log("reevaluate",performance.now()-o)},50)});tl.set(t.context,{abort:n,promise:s})});else{if(pe.allowAdhocContexts===!1)return;let t=pe.defaultBindingType,n=new po(r,pe.defaultIncludePaths??[],t?fh({zephyrBindings:pe.defaultZephyrBindings??[],deviceOrgBindingsMetaSchema:pe.defaultDeviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:pe.defaultDeviceOrgTreeBindings??[]},t):void 0);console.log(`New ad hoc context with ID ${n.name} for ${r}`),Fb(n),rl(r),await n.parser.stable,dA(n)}};$s.onDidChangeContent(async r=>{let e=xt(r.document.uri),t=r.document.getText(),n=Xr();n.needsRenew(e,t)&&(console.log("Content changed"),n.renewLexer(e,t),zb(e))});var rK=r=>$s.keys().find(e=>Mw(xt(e),r)),yh=r=>{let e=rK(r);if(e)return $s.get(e)},gA=r=>r.getContextFiles().map(e=>({uri:ce(e),version:yh(e)?.version,diagnostics:[]})),vh=async(r,e=gA(r))=>await Promise.all(e.map(t=>ve.sendDiagnostics({uri:t.uri,version:$s.get(t.uri)?.version,diagnostics:[]}))),Gb=async r=>{await r.stable();let e=performance.now(),t=await Promise.all(r.getContextFiles().map(async n=>{let s=await nK(r,n);return{uri:ce(n),kind:xe.DocumentDiagnosticReportKind.Full,items:s,version:yh(n)?.version??null}}));return console.log("workspace diagnostics",r.name,performance.now()-e),{items:[...t]}};ve.languages.diagnostics.onWorkspace(async()=>{await At();let r=nt;return r?Gb(r):{items:[]}});async function nK(r,e){try{let t=[];return r.isInContext(e)?(r.parser.issues.filter(i=>i.astElement.uri===e).forEach(i=>{let o={severity:i.severity,range:Q(i.astElement),message:i.issues?i.issues.map(XH).join(" or "):"",source:"devicetree",tags:i.tags,data:{firstToken:{pos:i.astElement.firstToken.pos,tokens:i.astElement.firstToken.tokens,value:i.astElement.firstToken.value},lastToken:{pos:i.astElement.lastToken.pos,tokens:i.astElement.lastToken.tokens,value:i.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:i.issues,edit:i.edit,codeActionTitle:i.codeActionTitle}}};t.push(o)}),(await r.getContextIssues()??[]).filter(i=>i.astElement.uri===e).forEach(i=>{let o={severity:i.severity,range:Q(i.astElement),message:QH(i),source:"devicetree",tags:i.tags,relatedInformation:[...i.linkedTo.map(a=>({message:i.issues.map(ZH).join(" or "),location:{uri:ce(a.uri),range:Q(a)}}))]};t.push(o)}),(await r.getRuntime())?.typesIssues.filter(i=>i.astElement.uri===e).forEach(i=>{let o={severity:i.severity,range:Q(i.astElement),message:eK(i),relatedInformation:[...i.linkedTo.map(a=>({message:i.issues.map(tK).join(" or "),location:{uri:ce(a.uri),range:Q(a)}}))],source:"devicetree",tags:i.tags,data:{firstToken:{pos:i.astElement.firstToken.pos,tokens:i.astElement.firstToken.tokens,value:i.astElement.firstToken.value},lastToken:{pos:i.astElement.lastToken.pos,tokens:i.astElement.lastToken.tokens,value:i.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:i.issues,edit:i.edit,codeActionTitle:i.codeActionTitle}}};t.push(o)}),t):[{severity:xe.DiagnosticSeverity.Warning,range:xe.Range.create(xe.Position.create(0,0),xe.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(t){throw console.error(t),t}}ve.onDidChangeWatchedFiles(r=>{ve.console.log("We received a file change event")});ve.onCompletion(async r=>(await At(),We?[...await KE(r,We,nt,pe.preferredContext),...await rN(r,We,nt,pe.preferredContext)]:[]));ve.onCompletionResolve(r=>r);$s.listen(ve);ve.listen();var rl=async(r,e=!1)=>{if(!e&&pe.autoChangeContext===!1||(jb=r,await At(),nt?.getContextFiles().find(s=>s===r)))return;let t=nt;nt=Qs(We,r,void 0,pe.preferredContext)?.context;let n=nt;t!==n&&(t&&await vh(t),n&&Gb(n).then(s=>{s.items.map(i=>({uri:i.uri,version:i.version??void 0,diagnostics:i.items})).forEach(i=>{ve.sendDiagnostics(i)})}),console.log(`(ID: ${n?.name??-1}) activeContext:`,n?.parser.uri),We.forEach((s,i)=>{console.log(`Context with ID ${s.name} for ${s.parser.uri}`)}))};ve.onDocumentSymbol(async r=>{await At();let e=xt(r.textDocument.uri);await rl(e);let n=await nt?.parser;return n?n.getDocumentSymbols(e):[]});ve.onWorkspaceSymbol(async()=>{await At();let r=nt;return r?(await r.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ve.languages.semanticTokens.on(async r=>{try{await At();let e=xt(r.textDocument.uri);await rl(e);let t=new xe.SemanticTokensBuilder,n=await Qs(We,e,nt,pe.preferredContext),s=n?.context.isInContext(e);return!n||!s?{data:[]}:(n.context.parser.buildSemanticTokens(t,e),t.build())}catch(e){throw console.log(e),e}});ve.onDocumentLinks(async r=>{let e=xt(r.textDocument.uri);return await At(),(await Qs(We,e,nt,pe.preferredContext))?.context.getDocumentLinks(e)});ve.onPrepareRename(async r=>(await At(),QE(r,We,pe.lockRenameEdits??[],nt,pe.preferredContext)));ve.onRenameRequest(async r=>(await At(),XE(r,We,nt,pe.preferredContext)));ve.onReferences(async r=>(await At(),zE(r,We,nt,pe.preferredContext)));ve.onDefinition(async r=>{let e=xt(r.textDocument.uri);await At();let n=(await(await Qs(We,e,nt,pe.preferredContext))?.context.getDocumentLinks(e,r.position))?.filter(s=>s.target).map(s=>xe.Location.create(s.target,s.range))??[];return n.length?n:ZE(r,We,nt,pe.preferredContext)});ve.onDeclaration(async r=>(await At(),eN(r,We,nt,pe.preferredContext)));ve.onCodeAction(async r=>tN(r));ve.onDocumentFormatting(async r=>{let e=xt(r.textDocument.uri);await At();let t=await Qs(We,e,nt,pe.preferredContext);return t?Ww(r,t.context):[]});ve.onHover(async r=>(await At(),(await sN(r,We,nt,pe.preferredContext)).at(0)));ve.onRequest("devicetree/contexts",async()=>(await At(),We.map(r=>r.parser.uri)));ve.onFoldingRanges(async r=>{await At();let e=xt(r.textDocument.uri);await rl(e);let t=nt,n=t?.isInContext(e);if(!t||!n)return[];let s=(await t.getAllParsers()).find(i=>i.getFiles().some(o=>o===e));return s?iA(e,s):[]});ve.onTypeDefinition(async r=>(await At(),oA(r,We,nt)));
|
|
290
|
+
${r}`])]},cK=(n,e)=>iA(n,e.split("/").filter(t=>t)),iA=(n,e)=>{if(e.length===0)return{node:n,remainingInstancePath:""};let t=e[0].split("@"),r=t[0],s=t.at(1)?.split(",").map(o=>Number.parseInt(o,16)),i=n.getNode(r,s);return i?iA(i,e.slice(1)):{node:n,property:n.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var Gb=class n{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof Oe)))return r?.values.map(s=>(s?.value).value)}parseMetaSchema(e,t){bi.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,Kb.resolve)(e,s);try{let i=Hb.default.parse((0,zb.readFileSync)(s,"utf-8"));t.addMetaSchema(i),this.schemaIdValidators.set(i.$id,s)}catch{}})}parseBindings(e,t){bi.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,Kb.resolve)(e,s);try{let i=Hb.default.parse((0,zb.readFileSync)(s,"utf-8"));t.addSchema(i),this.schemaIdValidators.set(i.$id,s)}catch(i){console.warn(s,i.message)}})}getNodeTypes(e,t,r){let s=`${e.join(";")}::${t.join(";")}`,i=this.ajvMap.get(s);return i||(i=new aA.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(Wb),this.ajvMap.set(s,i),e.forEach(c=>this.parseMetaSchema(c,i)),t.forEach(c=>this.parseBindings(c,i))),n.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new wh(i,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=i.getSchema(l);return u.description=(d?.schema).description,u.examples=(d?.schema).examples,u.maintainers=(d?.schema).maintainers,u}catch(l){console.warn(l.message)}}).filter(c=>c)??[]}},oA,cA=()=>(oA??=new Gb,oA);var hA=H(Ny());var aa=require("path"),pA=require("fs");var xr=H(J()),lA=n=>{switch(n){case"string":return V(3);case"int":return V(1);case"boolean":return V(0);case"array":return V(4);case"uint8-array":return V(6);case"string-array":return V(5);case"phandle":return V(1);case"phandles":return V(4);case"phandle-array":return V(4);case"path":return V([3,1]);case"compound":return V(8)}},uA=(n,e)=>{switch(n){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},Eh=(n,e)=>{if(e=e.include.reduce((t,r)=>{let s=n.find(i=>(0,aa.basename)(i.filePath)===r.name);if(s){let i=r["property-blocklist"];return t.include=t.include.filter(o=>o!==r),lK(n,s,t,i)??t}return console.warn(`Unable to find ${r}`),t},e),e["child-binding"]&&(e["child-binding"].include=mA(e["child-binding"].include),e["child-binding"]=Eh(n,e["child-binding"])),!e.include.length)return e},lK=(n,e,t,r=[])=>{let s=Eh(n,e),i=Eh(n,t);if(!s||!i)return;let o=new Set;Object.keys(s?.properties??{}).forEach(d=>o.add(d)),Object.keys(i?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=r?.some(b=>b===d)?{}:s.properties?.[d]??{},p=i.properties?.[d]??{};a={...a,[d]:{...f,...p}}}),i.properties=a;let c=new Set;return Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=s[d]??[],p=i[d]??[];i[d]=Array.from([...f,...p])}),i},mA=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],Yb=class n{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof Oe)))return r?.values.map(s=>(s?.value).value)}getNodeTypes(e,t){let r=n.getNodeCompatible(t);if(!r)return[ci(t)];let s=r.map(o=>this.typeCache.get(o)?.(t)).filter(o=>o);if(s.length)return s;this.loadTypeAndCache(e);let i=r.map(o=>this.typeCache.get(o)?.(t)).filter(o=>o);return i.length?i:[ci(t)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let s=bi.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,aa.resolve)(t,o);try{let a=hA.default.parse((0,pA.readFileSync)(o,"utf-8"));return{...a,include:mA(a?.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),i=s.map(o=>Eh(s,o)).filter(o=>!!o&&!o.include.length);uK(i,this.typeCache)})}},dA,gA=()=>(dA??=new Yb,dA),uK=(n,e)=>n.forEach(t=>{let r=t.compatible??(t.filePath?(0,aa.basename)(t.filePath,"yaml"):void 0);r&&e.set(r,s=>yA(t,s))}),yA=(n,e)=>{let t=ci(e);t.compatible=n.compatible??(n.filePath?(0,aa.basename)(n.filePath,"yaml"):void 0),t.description=n.description,t.bindingsPath=n.filePath,t.bus=typeof n.bus=="string"?[n.bus]:n.bus,t.onBus=n["on-bus"];let s=Object.keys(n).filter(i=>i.endsWith("-cells")).map(i=>({specifier:i.replace(/-cells$/,""),values:n[i]}));if(n.properties&&Object.keys(n.properties).forEach(i=>{let o=n.properties[i];dK(t,i,o),t.cellsValues=s}),n["child-binding"]){let i=n["child-binding"];t.childNodeType=o=>yA(i,o)}return t},dK=(n,e,t)=>{let r=n.properties.find(s=>s.getNameMatch(e));if(r&&typeof r.name=="string"){r.required=()=>t.required?"required":"optional",r.values=()=>t.enum??[],r.constValue=uA(t.type,t.const),r.bindingType=t.type;let s=r.additionalTypeCheck;r.additionalTypeCheck=i=>[...fA(t,e,r)(i),...s?.(i)??[]]}else{let s=t.type==="compound"?r?.type:lA(t.type);s??=lA(t.type);let i=new K(e,s,t.required?"required":"optional",void 0,t.enum);i.additionalTypeCheck=o=>{let a=[...r?.additionalTypeCheck?.(o)??[],...fA(t,e,i)(o)];return i.typeExample??=r?.typeExample,a},i.description=t.description?[t.description]:r?.description,i.bindingType=t.type,i.constValue=uA(t.type,t.const),n.addProperty(i)}},fA=(n,e,t)=>{let r=n;return s=>{let i=s.parent.root,o=[];if(r.const){let a=s.ast.quickValues;if(a?.length==1){let c=Array.isArray(r.const)?r.const:[r.const];Array.isArray(a[0])&&c.length===a[0].length&&a[0].every((u,d)=>typeof u=="number"&&Number.isNaN(u)||c[d]===u)||o.push(C(25,s.ast.values??s.ast,xr.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${r.type}" with value: ${r.const}`]))}}if(r.deprecated&&o.push(C(14,s.ast,xr.DiagnosticSeverity.Warning,[],[xr.DiagnosticTag.Deprecated],[s.name])),(r.type==="phandle"||r.type==="phandles"||r.type==="path")&&rn(s.ast.values)?.forEach(c=>{nr(c,i)||o.push(C(23,c,xr.DiagnosticSeverity.Error))}),r.type==="path"&&s.ast.values?.values.at(0)?.value instanceof Oe){let a=s.ast.values?.values.at(0)?.value,c=[];a.value.split("/").every(l=>{let u=i.getNode(l);return u?c.push(l):o.push(C(24,a,xr.DiagnosticSeverity.Error,[],[],[l,`/${c.join("/")}`])),!u})}if(r.type==="phandle-array"){let a=rn(s.ast.values),c=0;for(;a&&c<a.length;){let l=a.at(c),u=nr(l,i);if(!u){o.push(C(23,l??s.ast,xr.DiagnosticSeverity.Error));break}let d="";e.endsWith("-gpios")?d="gpio":d=r["specifier-space"]??e.slice(0,-1);let f=u.getProperty(`#${d}-cells`);if(!f){o.push(C(16,s.ast,xr.DiagnosticSeverity.Error,[...u.nodeNameOrLabelRef],[],[s.name,`#${d}-cells`,`/${u.path.slice(1).join("/")}`]));break}let p=f?Ce(f,0,0)??0:0,b=u.nodeType?.cellsValues?.find(g=>g.specifier===d)?.values;if(t.typeExample=`<${["phandel",...b??[],...Array.from({length:p-(b?.length??0)},()=>"cell")].join(" ")}>`,1+p>a.length-c){o.push(C(20,l??s.ast,xr.DiagnosticSeverity.Error,[],[],[s.name,t.typeExample]));break}c+=1+p}}return o}};var vA=(n,e)=>({files:n,type:e,getNodeTypes:async t=>{switch(e){case"Zephyr":return gA().getNodeTypes(n.zephyrBindings,t);case"DevicetreeOrg":return cA().getNodeTypes(n.deviceOrgBindingsMetaSchema,n.deviceOrgTreeBindings,t)}}});var Xb=H(J());var Jb=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(Jb):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:Xb.FoldingRangeKind.Region},...n.nodes.flatMap(Jb)],bA=n=>{let e=[];return[...n instanceof ws?n.ifBlocks.map(t=>({start:(t.expression??t.keyword).lastToken,end:t.content?.lastToken??(t.expression??t.keyword).lastToken})):[{start:(n.ifDef.identifier??n.ifDef.keyword).lastToken,end:n.ifDef.content?.lastToken}],n.elseOption?{start:n.elseOption.keyword.lastToken,end:n.elseOption.content?.lastToken}:null].forEach(t=>{!t||!t.end||e.push({startLine:t.start.pos.line,startCharacter:t.start.pos.col,endLine:t.end.pos.line,endCharacter:t.end.pos.colEnd,kind:Xb.FoldingRangeKind.Region})}),e},fK=n=>n instanceof Be?Jb(n):n instanceof bo||n instanceof ws?bA(n):[];function TA(n,e){return e.allAstItems.flatMap(t=>[t,...t.allDescendants]).filter(t=>se(t.uri,n)).flatMap(fK)}var Ai=H(J());function hK(n){if(!n||!(n.ast instanceof Ie)&&!(n.ast instanceof Lt))return[];let e=t=>t.nodeType?.bindingsPath?[Ai.Location.create(ue(t.nodeType.bindingsPath),Ai.Range.create(Ai.Position.create(0,0),Ai.Position.create(0,0)))]:[];return n.item instanceof Te&&!Nt(n.ast)?e(n.item):n.ast instanceof Lt&&n.ast.parentNode instanceof ge&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Ie&&n.ast.linksTo?e(n.ast.linksTo):[]}async function SA(n,e){return Et(n,e,t=>[...hK(t)])}var Nh=require("fs");var pK=(n,e)=>{sr().reset(n),sr().requestTokens(n,!0),e(n)},kh=class{constructor(e,t,r){this.file=e;this.cb=t;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,t=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),pK(e,t)},(0,Nh.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,Nh.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var Zt=H(require("path")),Qb=require("fs");var zn=async(n,e)=>(e&&(n=n.replaceAll("${workspaceFolder}",e)),n),Ii={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},Zb=async(n,e,t)=>{let r=(n.cwd?await zn(n.cwd,t):void 0)??e.cwd,s=await Promise.all((n.includePaths??e.defaultIncludePaths).map(f=>zn(f,t))),i=await Promise.all((n.zephyrBindings??e.defaultZephyrBindings).map(f=>zn(f,t))),o=n.bindingType??e.defaultBindingType,a=await Promise.all((n.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(f=>zn(f,t))),c=await Promise.all((n.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(f=>zn(f,t))),l=await Promise.all((n.lockRenameEdits??e.defaultLockRenameEdits).map(f=>zn(f,t)));r&&o==="Zephyr"&&(!i||i.length===0)&&(i=["./zephyr/dts/bindings"]);let u=n.dtsFile,d=n.overlays??[];return r&&(i=i.map(f=>(0,Zt.resolve)(r,f)).filter(f=>(0,Qb.existsSync)(f)),a=a?.map(f=>(0,Zt.resolve)(r,f)),c=c.map(f=>(0,Zt.resolve)(r,f)),s=s.map(f=>(0,Zt.resolve)(r,f)),u=(0,Zt.resolve)(r,u),d=d.map(f=>(0,Zt.resolve)(r,f)),l=l.map(f=>(0,Zt.resolve)(r,f))),{ctxName:n.ctxName??(0,Zt.basename)(u),cwd:r?Je(r):void 0,includePaths:s.map(Je),zephyrBindings:i.map(Je),bindingType:o,deviceOrgTreeBindings:a.map(Je),deviceOrgBindingsMetaSchema:c.map(Je),dtsFile:Je(u),overlays:d.map(Je),lockRenameEdits:l.map(Je)}},ul=async(n,e)=>{let t=n.cwd?await zn(n.cwd,e):void 0,r=n.defaultBindingType,s=n.defaultDeviceOrgBindingsMetaSchema=await Promise.all((n.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>zn(d,e))),i=n.defaultDeviceOrgTreeBindings=await Promise.all((n.defaultDeviceOrgTreeBindings??[]).map(d=>zn(d,e))),o=n.defaultIncludePaths=await Promise.all((n.defaultIncludePaths??[]).map(d=>zn(d,e))),a=n.defaultZephyrBindings=await Promise.all((n.defaultZephyrBindings??[]).map(d=>zn(d,e))),c=n.defaultLockRenameEdits=await Promise.all((n.defaultLockRenameEdits??[]).map(d=>zn(d,e)));t&&(o=n.defaultIncludePaths=(n.defaultIncludePaths??[]).map(d=>(0,Zt.resolve)(t,d)),r==="Zephyr"&&!n.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,Zt.resolve)(t,d)),s=s.map(d=>(0,Zt.resolve)(t,d))),n.defaultDeviceOrgTreeBindings=(n.defaultDeviceOrgTreeBindings??[]).map(d=>n.cwd?(0,Zt.resolve)(n.cwd,d):d);let l={cwd:t,defaultDeviceOrgBindingsMetaSchema:s,defaultDeviceOrgTreeBindings:i,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:r,autoChangeContext:n.autoChangeContext??Ii.autoChangeContext,allowAdhocContexts:n.allowAdhocContexts??Ii.allowAdhocContexts},u=(await Promise.all(n.contexts?.map(d=>Zb(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,Qb.existsSync)(f)&&Zt.default.isAbsolute(f)));return{...l,contexts:u}};var kA=require("path");function mK(n,e){if(!n||!(n.item instanceof He)||!(n.ast instanceof Fe))return[];let t=[];if(e.settings.bindingType==="Zephyr"){t.push({type:"dt_zephyr_macro_prop_node_path",data:`DT_PROP(${_A(n.item.parent)}, ${n.item.name.replaceAll("-","_")}))`});let r=n.item;n.item.parent.labels.forEach(s=>t.push({type:"dt_zephyr_macro_prop_node_label",data:`DT_PROP(DT_NODELABEL(${s.label.toString()}), ${r.name.replaceAll("-","_")})`}))}return t}var _A=n=>`DT_PATH(${n.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`;function gK(n,e){if(!n||n.item===null)return[];let t;if(n.item instanceof Te?t=n.item:n.ast.parentNode instanceof ge&&n.ast.parentNode.linksTo?t=n.ast.parentNode.linksTo:n.ast instanceof Ie&&n.ast.linksTo&&(t=n.ast.linksTo),!t)return[];let r=[{type:"path",data:t.pathString}];if(e.settings.bindingType==="Zephyr"){t.labels.forEach(o=>{r.push({type:"dt_zephyr_macro_node_label",data:`DT_NODELABEL(${o.label.toString()})`})}),r.push({type:"dt_zephyr_macro_node_path",data:_A(t)});let i=_o.getNodeFromPath(["aliases"],t.root)?.property.find(o=>{if(o.ast.quickValues?.at(0)===t.pathString)return!0;let a=o.ast.values?.values.at(0)?.value;if(a instanceof ge&&a.linksTo===t||a instanceof kn&&a.path?.pathParts.at(-1)?.linksTo===t)return!0});i&&r.push({type:"dt_zephyr_macro_prop_node_alias",data:`DT_ALIAS(${i.name.replaceAll("-","_")})`})}return r}async function wA(n,e){return e?Et(n,e,t=>[...gK(t,e),...mK(t,e)]):[]}var Le=[],ze,dl,Rh=new WeakMap,Ph=new Map,NA=async n=>{await n.stable(),n.getContextFiles().forEach(e=>{Ph.has(e)||Ph.set(e,new kh(e,iT,t=>!!Ch(t))),Ph.get(e)?.watch()})},rT=async n=>{let e=Le.indexOf(n);if(e===-1)return;Dh(n),Rh.delete(n),console.log(`(ID: ${n.id}) cleaning Context for [${n.ctxNames.join(",")}]`);let t=await Mi(n);if(Z.sendNotification("devicetree/contextDeleted",{ctxNames:n.ctxNames.map(r=>r.toString()),id:n.id,...await n.getFileTree(),settings:n.settings,active:ze===n,type:t.type}),Le.splice(e,1),await aT(),n===ze&&(ze=void 0,Le.length)){let r=dl?Sr(Le,{uri:dl}):void 0;r??=Le[0],console.log("Active context was deleted. Forcing active to",r.id),await Vt({id:r.id},!0)}PA(n)},PA=async n=>{await n.stable(),n.getContextFiles().forEach(e=>Ph.get(e)?.unwatch())},yK=n=>{let e=Rh.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},Xe=async()=>{await Promise.all(Le.map(yK))},sT=async n=>(await RA()).indexOf(n)!==-1,RA=async()=>{let n=await CA();return Le.filter(e=>!n.some(t=>t===e))},CA=async()=>{let n=await nT();return Le.filter(e=>n.contexts.find(t=>Vr(t)===e.id))},vK=async()=>{let n=await wK();return Le.filter(e=>n.contexts.find(t=>Vr(t)===e.id))},bK=async n=>(await vK()).indexOf(n)!==-1,TK=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes).filter(s=>s.resolvedPath),r=(await e.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes).filter(s=>s.resolvedPath);return r.some(s=>se(s.resolvedPath,n.parser.uri))&&t.length?t.every(s=>r.some(i=>i.resolvedPath===s.resolvedPath&&i.firstToken.pos.col===s.firstToken.pos.col&&i.firstToken.pos.len===s.firstToken.pos.len&&i.firstToken.pos.line===s.firstToken.pos.line&&i.lastToken.pos.col===s.lastToken.pos.col&&i.lastToken.pos.len===s.lastToken.pos.len&&i.lastToken.pos.line===s.lastToken.pos.line)):e.getContextFiles().some(s=>se(s,n.parser.uri))},SK=async n=>{if(!await sT(n))return;let e=await RA(),t=await CA(),r=await Qu(e);if(Le.indexOf(n)===-1)return;let s=await Promise.all(r.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await TK(a.context,c)})))),i=n.getContextFiles(),o=r.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==n&&se(a.context.parser.uri,n.parser.uri)&&i.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(rT)},Z=(0,$e.createConnection)($e.ProposedFeatures.all),$r=new $e.TextDocuments(Yu),DA=!1,eT=!1,OA=!1,AA=!1,IA=!1,tT;Z.onInitialize(n=>{tT=n.workspaceFolders,Z.console.log(`[Server(${process.pid}) ${tT?.[0].uri} Version 0.3.1 ] Started and initialize received`);let e=n.capabilities;DA=!!(e.workspace&&e.workspace.configuration),eT=!!(e.workspace&&e.workspace.workspaceFolders),OA=!!e.workspace?.diagnostics?.refreshSupport,AA=!!e.workspace?.semanticTokens?.refreshSupport,IA=!!e.workspace?.foldingRange?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:$e.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[$e.CodeActionKind.QuickFix,$e.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:Ju,tokenModifiers:Xu},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return eT&&(t.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),t});Z.onInitialized(()=>{DA&&Z.client.register($e.DidChangeConfigurationNotification.type,{}),eT&&Z.workspace.onDidChangeWorkspaceFolders(async n=>{Z.console.log("Workspace folder change event received"),await ml()})});var _K=async()=>{let n=MA();return n={...Ii,...n},ul(n,await pl())},nT=async()=>{let n=NK();return n={...Ii,...n},ul(n,await pl())},wK=async()=>{let n=PK();return n={...Ii,...n},ul(n,await pl())},hl=async()=>{let n=kK();return n={...Ii,...n},ul(n,await pl())},EK=new Map,pl=async()=>(await Z.workspace.getWorkspaceFolders()??tT)?.map(e=>tt(e.uri))?.at(0),EA=async n=>{let e=Sr(Le,{id:Vr(n)});if(e)return e.ctxNames.includes(n.ctxName)||console.log(`(ID: ${e.id}) Adding name ${n.ctxName} for [${e.ctxNames.join(",")}]`),e.addCtxName(n.ctxName),e;let t=Vr(n);console.log(`(ID: ${t}) New context [${n.ctxName}]`),console.log(`(ID: ${t}) Settings: ${JSON.stringify(n,void 0," ")}`);let r=new Sd(n,n.bindingType?vA({zephyrBindings:n.zephyrBindings??[],deviceOrgBindingsMetaSchema:n.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:n.deviceOrgTreeBindings??[]},n.bindingType):void 0);Le.push(r),NA(r),await r.stable();let s=await Mi(r);return Z.sendNotification("devicetree/contextCreated",{ctxNames:r.ctxNames.map(i=>i.toString()),id:r.id,...await r.getFileTree(),settings:r.settings,active:r===ze,type:s.type}),await SK(r),await aT(),r},ml=async()=>{let n=await nT(),e=await hl();e.allowAdhocContexts||(e=await nT());let t=e.contexts.map(Vr);Le.filter(s=>!t.includes(s.id)).forEach(rT),await n.contexts?.reduce((s,i)=>s.then(async()=>{await EA(i)}),Promise.resolve()),e.allowAdhocContexts&&await(await _K()).contexts?.reduce((i,o)=>i.then(async()=>{Sr(Le,{uri:o.dtsFile})||await EA(o)}),Promise.resolve()),dl?await Vt({uri:dl}):!ze&&Le.length&&(console.log(`No active context using first context (ID: ${Le[0].id}) [${Le[0].ctxNames.join(",")}]`),await Vt({id:Le[0].id}))},Gn,Hs,fl=new Map,ca=new Map,kK=()=>!Hs&&!Gn?void 0:{...Hs,...Gn,contexts:[...Gn?.contexts??[],...Array.from(ca.values()),...Array.from(fl.values())]},MA=()=>!Hs&&!Gn?void 0:{...Hs,...Gn,contexts:[...Array.from(fl.values())]},NK=()=>!Hs&&!Gn?void 0:{...Hs,...Gn,contexts:[...Gn?.contexts??[],...Array.from(ca.values())]},PK=()=>!Hs&&!Gn?void 0:{...Gn,contexts:[...Gn?.contexts??[]]};function RK(n){let e={...n};for(let t in e)e[t]===null&&delete e[t];return e}var xA=async()=>{let n=await hl();console.log("Resolved settings",JSON.stringify(n,void 0," ")),Z.sendNotification("devicetree/settingsChanged",n),await ml(),Xe().then(()=>{OA&&Z.languages.diagnostics.refresh()})};Z.onDidChangeConfiguration(async n=>{n?.settings?.devicetree&&(Gn=RK(n.settings.devicetree),console.log("Configuration changed",JSON.stringify(n,void 0," ")),await xA())});var CK=n=>{switch(n){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include";case 37:return"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"}},DK=n=>n.issues.map(e=>{switch(e){case 0:return`Property "${n.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${n.templateStrings[0]}" has been defined`;case 8:return`No node with name "${n.templateStrings[0]}" could be found in "/${n.templateStrings[1]}".`;case 4:return`Label name "${n.templateStrings[0]}" already defined`;case 6:return`Property "${n.templateStrings[0]}" was deleted`;case 7:return`Node "${n.templateStrings[0]}" was deleted`;case 9:return`The following node "${n.templateStrings[1]}" shall be present in "${n.templateStrings[0]}" node.`}}).join(" or "),OK=n=>{switch(n){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";case 9:return"Node";default:return"TODO"}},AK=n=>n.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${n.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${n.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 28:return"INTRO name is not permitted under this node";case 10:return"INTRO first value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${n.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${n.templateStrings[1]}`;case 16:return`INTRO requires property "${n.templateStrings[1]}" in node path "${n.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${n.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${n.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${n.templateStrings[0]}" in ${n.templateStrings[1]}`;case 25:return n.templateStrings[0];case 26:return n.templateStrings[0];case 27:return n.templateStrings[0];case 29:return n.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),IK=n=>{switch(n){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";default:return"TODO"}},$A=()=>{let n=ze?.getContextFiles();Array.from($r.keys()).forEach(e=>{n?.some(t=>se(t,tt(e)))||Z.sendDiagnostics({uri:e,version:$r.get(e)?.version,diagnostics:[{severity:$e.DiagnosticSeverity.Warning,range:$e.Range.create($e.Position.create(0,0),$e.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})})},iT=async n=>{let e=Mm(Le,n);if(e.length)e.forEach(t=>{Rh.get(t)?.abort.abort();let r=new AbortController,s=new Promise(i=>{setTimeout(async()=>{if(r.signal.aborted){i();return}let o=performance.now(),a=ze===t,c=a?LA(t):[];PA(t),await t.reevaluate(n),NA(t),a&&oT(t).then(l=>{let u=l.items.map(d=>({uri:d.uri,version:d.version??void 0,diagnostics:d.items}));Dh(t,c.filter(d=>u.every(f=>f.uri!==d.uri))),u.forEach(d=>{Z.sendDiagnostics(d)})}),i(),console.log("reevaluate",performance.now()-o)},50)});Rh.set(t,{abort:r,promise:s})});else{if((await hl()).allowAdhocContexts===!1)return;await ml(),await Vt({uri:n})}},MK=n=>$r.keys().find(e=>se(tt(e),n)),Ch=n=>{let e=MK(n);if(e)return $r.get(e)},LA=n=>n.getContextFiles().map(e=>({uri:ue(e),version:Ch(e)?.version,diagnostics:[]})),Dh=async(n,e=LA(n))=>{n===ze&&await Promise.all(e.map(t=>Z.sendDiagnostics({uri:t.uri,version:$r.get(t.uri)?.version,diagnostics:[]})))},oT=async n=>{await n.stable();let e=performance.now(),t=await Promise.all(n.getContextFiles().map(async r=>{let s=await xK(n,r);return{uri:ue(r),kind:$e.DocumentDiagnosticReportKind.Full,items:s,version:Ch(r)?.version??null}}));return console.log(`(ID: ${n.id})`,"workspace diagnostics",`[${n.ctxNames.join(",")}]`,performance.now()-e),{items:[...t]}};async function xK(n,e){try{let t=[];return n.isInContext(e)?((await n.getAllParsers()).forEach(i=>{i.issues.filter(o=>se(o.astElement.uri,e)).forEach(o=>{let a={severity:o.severity,range:Q(o.astElement),message:o.issues?o.issues.map(CK).join(" or "):"",source:"devicetree",tags:o.tags,data:{firstToken:{pos:o.astElement.firstToken.pos,tokens:o.astElement.firstToken.tokens,value:o.astElement.firstToken.value},lastToken:{pos:o.astElement.lastToken.pos,tokens:o.astElement.lastToken.tokens,value:o.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:o.issues,edit:o.edit,codeActionTitle:o.codeActionTitle}}};t.push(a)})}),(await n.getContextIssues()??[]).filter(i=>se(i.astElement.uri,e)).forEach(i=>{let o={severity:i.severity,range:Q(i.astElement),message:DK(i),source:"devicetree",tags:i.tags,relatedInformation:[...i.linkedTo.map(a=>({message:i.issues.map(OK).join(" or "),location:{uri:ue(a.uri),range:Q(a)}}))]};t.push(o)}),(await n.getRuntime())?.typesIssues.filter(i=>se(i.astElement.uri,e)).forEach(i=>{let o={severity:i.severity,range:Q(i.astElement),message:AK(i),relatedInformation:[...i.linkedTo.map(a=>({message:i.issues.map(IK).join(" or "),location:{uri:ue(a.uri),range:Q(a)}}))],source:"devicetree",tags:i.tags,data:{firstToken:{pos:i.astElement.firstToken.pos,tokens:i.astElement.firstToken.tokens,value:i.astElement.firstToken.value},lastToken:{pos:i.astElement.lastToken.pos,tokens:i.astElement.lastToken.tokens,value:i.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:i.issues,edit:i.edit,codeActionTitle:i.codeActionTitle}}};t.push(o)}),t):[{severity:$e.DiagnosticSeverity.Warning,range:$e.Range.create($e.Position.create(0,0),$e.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(t){throw console.error(t),t}}var aT=async()=>{let n=await Promise.all(Le.map(Mi));console.log("======== Context List ========"),n.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,ze===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Mi=async n=>{let e=await sT(n),t=!e&&await bK(n);return{ctx:n,type:e?"Ad Hoc":t?"User":"3rd Party"}},Vt=async(n,e=!1)=>{"uri"in n&&(dl=n.uri);let t=await hl();if(await Xe(),ze&&!e&&!t.autoChangeContext||!e&&ze?.getContextFiles().find(i=>"uri"in n&&se(i,n.uri)))return!1;let r=ze,s=Sr(Le,n);return r!==s&&(r&&Dh(r),ze=s,s?(Mi(s).then(async i=>{let o=await s.getFileTree();s===ze&&Z.sendNotification("devicetree/newActiveContext",{ctxNames:s.ctxNames.map(a=>a.toString()),id:s.id,...o,settings:s.settings,active:ze===s,type:i.type})}),oT(s).then(i=>{i.items.map(o=>({uri:o.uri,version:o.version??void 0,diagnostics:o.items})).forEach(o=>{Z.sendDiagnostics(o)})}),await aT()):Z.sendNotification("devicetree/newActiveContext",void 0)),IA&&Z.languages.foldingRange.refresh(),AA&&Z.languages.semanticTokens.refresh(),$A(),!0};$r.listen(Z);$r.onDidClose(async n=>{let e=tt(n.document.uri),t=Mm(Le,e);if(t.length===0){fl.delete(e),Z.sendDiagnostics({uri:n.document.uri,version:$r.get(n.document.uri)?.version,diagnostics:[]});return}await Promise.all(t.map(async r=>{(r?.getContextFiles()??[]).filter(o=>o!==e).some(o=>Ch(o))||(await sT(r)?(rT(r),fl.delete(r.settings.dtsFile)):Dh(r))})),EK.delete(n.document.uri)});$r.onDidOpen(async n=>{await Xe(),$A();let e=tt(n.document.uri),t=Sr(Le,{uri:e});if(t)t!==ze&&await Vt({id:t.id});else{let r={ctxName:(0,kA.basename)(e),dtsFile:e};fl.set(e,r),await iT(e)}});$r.onDidChangeContent(async n=>{let e=tt(n.document.uri),t=n.document.getText(),r=sr();r.needsRenew(e,t)&&(console.log("Content changed"),r.renewLexer(e,t),await iT(e))});Z.listen();Z.languages.diagnostics.onWorkspace(async()=>{await Xe();let n=ze;return n?oT(n):{items:[]}});Z.onDidChangeWatchedFiles(n=>{Z.console.log("We received a file change event")});Z.onCompletion(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e);return t?[...await iN(n,t),...await mN(n,t)]:[]});Z.onCompletionResolve(n=>n);var Rn=n=>{let e=MA();return Sr(Le,{uri:n},ze,e?.preferredContext)};Z.onDocumentSymbol(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e);return t?t.getUriParser(e)?.getDocumentSymbols(e):[]});Z.onWorkspaceSymbol(async()=>{await Xe();let n=ze;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});Z.languages.semanticTokens.on(async n=>{try{await Xe();let e=tt(n.textDocument.uri),t=Rn(e),r=new $e.SemanticTokensBuilder,s=t?.isInContext(e);return!t||!s?{data:[]}:((await t.getAllParsers()).forEach(i=>i.buildSemanticTokens(r,e)),r.build())}catch(e){throw console.log(e),e}});Z.onDocumentLinks(async n=>{await Xe();let e=tt(n.textDocument.uri);return Vt({uri:e}),Rn(e)?.getDocumentLinks(e)});Z.onPrepareRename(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e);return dN(n,t)});Z.onRenameRequest(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e);return uN(n,t)});Z.onReferences(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e);return oN(n,t)});Z.onDefinition(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e),r=(await t?.getDocumentLinks(e,n.position))?.filter(s=>s.target).map(s=>$e.Location.create(s.target,s.range))??[];return r.length?r:fN(n,t)});Z.onDeclaration(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e);return hN(n,t)});Z.onCodeAction(async n=>pN(n));Z.onDocumentFormatting(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e);return t?rk(n,t):[]});Z.onHover(async n=>{await Xe();let e=tt(n.textDocument.uri),t=Rn(e);return(await yN(n,t)).at(0)});Z.onFoldingRanges(async n=>{await Xe();let e=tt(n.textDocument.uri),t=Rn(e),r=t?.isInContext(e);if(!t||!r)return[];let s=(await t.getAllParsers()).find(i=>i.getFiles().some(o=>o===e));return s?TA(e,s):[]});Z.onTypeDefinition(async n=>{await Xe();let e=tt(n.textDocument.uri);Vt({uri:e});let t=Rn(e);return SA(n,t)});Z.onRequest("devicetree/getContexts",async()=>(await Xe(),Promise.all(Le.map(async n=>{let e=await Mi(n);return{ctxNames:n.ctxNames.map(t=>t.toString()),id:n.id,...await n.getFileTree(),settings:n.settings,active:ze===n,type:e.type}}))));Z.onRequest("devicetree/setActive",async n=>(await Xe(),console.log("devicetree/setActive",n),await Vt(n,!0)));Z.onRequest("devicetree/getActiveContext",async n=>{if(await Xe(),console.log("devicetree/getActiveContext",n),await Vt({id:n},!0),!ze)return;let e=await Mi(ze);return ze?{ctxNames:ze.ctxNames.map(t=>t.toString()),id:n,...await ze.getFileTree(),settings:ze.settings,active:!0,type:e.type}:void 0});Z.onRequest("devicetree/setDefaultSettings",async n=>{await Xe(),Hs=n,console.log("Integration Settings",n),await xA()});Z.onRequest("devicetree/requestContext",async n=>{await Xe();let e=await hl(),t=await Zb(n,e,await pl());console.log("devicetree/requestContext",t);let r=Vr(t),s=Array.from(ca).find(([,a])=>a.ctxName===n.ctxName);if(s){let a=s[0].split(":",1)[0];Sr(Le,{name:n.ctxName.toString()})?.removeCtxName(n.ctxName),console.log(`Removing integration context with ID ${a} and name ${n.ctxName}`),ca.delete(s[0])}ca.set(`${r}:${n.ctxName}`,n),await ml();let i=Le.find(a=>a.id===r);if(!i)throw new Error("Failed to create context");let o=await Mi(i);return{ctxNames:i.ctxNames.map(a=>a.toString()),id:r,...await i.getFileTree(),settings:i.settings,active:!0,type:o.type}});Z.onRequest("devicetree/removeContext",async({id:n,name:e})=>{await Xe(),ca.delete(`${n}:${e}`);let t=Sr(Le,{id:n});if(t){if(t.removeCtxName(e),t.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await ml()}});Z.onRequest("devicetree/compiledDtsOutput",async n=>(await Xe(),n?Sr(Le,{id:n})?.toFullString():void 0));Z.onRequest("devicetree/customActions",async n=>(await Xe(),wA(n,ze)));
|