miniscript-languageserver 1.10.4 → 1.11.0
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/index.js +61 -61
- package/package.json +4 -4
package/index.js
CHANGED
@@ -1,89 +1,89 @@
|
|
1
|
-
"use strict";var Np=Object.defineProperty;var VP=Object.getOwnPropertyDescriptor;var KP=Object.getOwnPropertyNames;var XP=Object.prototype.hasOwnProperty;var YP=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),JP=(t,e)=>{for(var n in e)Np(t,n,{get:e[n],enumerable:!0})},QP=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of KP(e))!XP.call(t,i)&&i!==n&&Np(t,i,{get:()=>e[i],enumerable:!(r=VP(e,i))||r.enumerable});return t};var ZP=t=>QP(Np({},"__esModule",{value:!0}),t);var Fc=m(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.thenable=kt.typedArray=kt.stringArray=kt.array=kt.func=kt.error=kt.number=kt.string=kt.boolean=void 0;function eD(t){return t===!0||t===!1}kt.boolean=eD;function MT(t){return typeof t=="string"||t instanceof String}kt.string=MT;function tD(t){return typeof t=="number"||t instanceof Number}kt.number=tD;function nD(t){return t instanceof Error}kt.error=nD;function LT(t){return typeof t=="function"}kt.func=LT;function NT(t){return Array.isArray(t)}kt.array=NT;function rD(t){return NT(t)&&t.every(e=>MT(e))}kt.stringArray=rD;function iD(t,e){return Array.isArray(t)&&t.every(e)}kt.typedArray=iD;function sD(t){return t&<(t.then)}kt.thenable=sD});var uo=m(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.stringArray=Qt.array=Qt.func=Qt.error=Qt.number=Qt.string=Qt.boolean=void 0;function oD(t){return t===!0||t===!1}Qt.boolean=oD;function qT(t){return typeof t=="string"||t instanceof String}Qt.string=qT;function aD(t){return typeof t=="number"||t instanceof Number}Qt.number=aD;function uD(t){return t instanceof Error}Qt.error=uD;function cD(t){return typeof t=="function"}Qt.func=cD;function jT(t){return Array.isArray(t)}Qt.array=jT;function lD(t){return jT(t)&&t.every(e=>qT(e))}Qt.stringArray=lD});var ag=m(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.Message=ne.NotificationType9=ne.NotificationType8=ne.NotificationType7=ne.NotificationType6=ne.NotificationType5=ne.NotificationType4=ne.NotificationType3=ne.NotificationType2=ne.NotificationType1=ne.NotificationType0=ne.NotificationType=ne.RequestType9=ne.RequestType8=ne.RequestType7=ne.RequestType6=ne.RequestType5=ne.RequestType4=ne.RequestType3=ne.RequestType2=ne.RequestType1=ne.RequestType=ne.RequestType0=ne.AbstractMessageSignature=ne.ParameterStructures=ne.ResponseError=ne.ErrorCodes=void 0;var ps=uo(),qp;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(qp||(ne.ErrorCodes=qp={}));var jp=class t extends Error{constructor(e,n,r){super(n),this.code=ps.number(e)?e:qp.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ne.ResponseError=jp;var _n=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ne.ParameterStructures=_n;_n.auto=new _n("auto");_n.byPosition=new _n("byPosition");_n.byName=new _n("byName");var Xe=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return _n.auto}};ne.AbstractMessageSignature=Xe;var Fp=class extends Xe{constructor(e){super(e,0)}};ne.RequestType0=Fp;var $p=class extends Xe{constructor(e,n=_n.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.RequestType=$p;var Bp=class extends Xe{constructor(e,n=_n.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.RequestType1=Bp;var Wp=class extends Xe{constructor(e){super(e,2)}};ne.RequestType2=Wp;var Up=class extends Xe{constructor(e){super(e,3)}};ne.RequestType3=Up;var Hp=class extends Xe{constructor(e){super(e,4)}};ne.RequestType4=Hp;var Gp=class extends Xe{constructor(e){super(e,5)}};ne.RequestType5=Gp;var zp=class extends Xe{constructor(e){super(e,6)}};ne.RequestType6=zp;var Vp=class extends Xe{constructor(e){super(e,7)}};ne.RequestType7=Vp;var Kp=class extends Xe{constructor(e){super(e,8)}};ne.RequestType8=Kp;var Xp=class extends Xe{constructor(e){super(e,9)}};ne.RequestType9=Xp;var Yp=class extends Xe{constructor(e,n=_n.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.NotificationType=Yp;var Jp=class extends Xe{constructor(e){super(e,0)}};ne.NotificationType0=Jp;var Qp=class extends Xe{constructor(e,n=_n.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.NotificationType1=Qp;var Zp=class extends Xe{constructor(e){super(e,2)}};ne.NotificationType2=Zp;var eg=class extends Xe{constructor(e){super(e,3)}};ne.NotificationType3=eg;var tg=class extends Xe{constructor(e){super(e,4)}};ne.NotificationType4=tg;var ng=class extends Xe{constructor(e){super(e,5)}};ne.NotificationType5=ng;var rg=class extends Xe{constructor(e){super(e,6)}};ne.NotificationType6=rg;var ig=class extends Xe{constructor(e){super(e,7)}};ne.NotificationType7=ig;var sg=class extends Xe{constructor(e){super(e,8)}};ne.NotificationType8=sg;var og=class extends Xe{constructor(e){super(e,9)}};ne.NotificationType9=og;var FT;(function(t){function e(i){let s=i;return s&&ps.string(s.method)&&(ps.string(s.id)||ps.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&ps.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(ps.string(s.id)||ps.number(s.id)||s.id===null)}t.isResponse=r})(FT||(ne.Message=FT={}))});var cg=m(Ai=>{"use strict";var $T;Object.defineProperty(Ai,"__esModule",{value:!0});Ai.LRUCache=Ai.LinkedMap=Ai.Touch=void 0;var Zt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Zt||(Ai.Touch=Zt={}));var $c=class{constructor(){this[$T]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=Zt.None){let r=this._map.get(e);if(r)return n!==Zt.None&&this.touch(r,n),r.value}set(e,n,r=Zt.None){let i=this._map.get(e);if(i)i.value=n,r!==Zt.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Zt.None:this.addItemLast(i);break;case Zt.First:this.addItemFirst(i);break;case Zt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[($T=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Zt.First&&n!==Zt.Last)){if(n===Zt.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Zt.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Ai.LinkedMap=$c;var ug=class extends $c{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=Zt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Zt.None)}set(e,n){return super.set(e,n,Zt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ai.LRUCache=ug});var WT=m(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.Disposable=void 0;var BT;(function(t){function e(n){return{dispose:n}}t.create=e})(BT||(Bc.Disposable=BT={}))});var ki=m(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});var lg;function hg(){if(lg===void 0)throw new Error("No runtime abstraction layer installed");return lg}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");lg=n}t.install=e})(hg||(hg={}));dg.default=hg});var lo=m(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.Emitter=co.Event=void 0;var hD=ki(),UT;(function(t){let e={dispose(){}};t.None=function(){return e}})(UT||(co.Event=UT={}));var fg=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,hD.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Wc=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new fg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};co.Emitter=Wc;Wc._noop=function(){}});var Gc=m(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.CancellationTokenSource=ho.CancellationToken=void 0;var dD=ki(),fD=uo(),pg=lo(),Uc;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:pg.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:pg.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||fD.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Uc||(ho.CancellationToken=Uc={}));var pD=Object.freeze(function(t,e){let n=(0,dD.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),Hc=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?pD:(this._emitter||(this._emitter=new pg.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},gg=class{get token(){return this._token||(this._token=new Hc),this._token}cancel(){this._token?this._token.cancel():this._token=Uc.Cancelled}dispose(){this._token?this._token instanceof Hc&&this._token.dispose():this._token=Uc.None}};ho.CancellationTokenSource=gg});var HT=m(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.SharedArrayReceiverStrategy=fo.SharedArraySenderStrategy=void 0;var gD=Gc(),Da;(function(t){t.Continue=0,t.Cancelled=1})(Da||(Da={}));var mg=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Da.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Da.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};fo.SharedArraySenderStrategy=mg;var yg=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Da.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},bg=class{constructor(e){this.token=new yg(e)}cancel(){}dispose(){}},_g=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new gD.CancellationTokenSource:new bg(n)}};fo.SharedArrayReceiverStrategy=_g});var Sg=m(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.Semaphore=void 0;var mD=ki(),vg=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,mD.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};zc.Semaphore=vg});var zT=m(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.ReadableStreamMessageReader=Ci.AbstractMessageReader=Ci.MessageReader=void 0;var wg=ki(),po=uo(),Tg=lo(),yD=Sg(),GT;(function(t){function e(n){let r=n;return r&&po.func(r.listen)&&po.func(r.dispose)&&po.func(r.onError)&&po.func(r.onClose)&&po.func(r.onPartialMessage)}t.is=e})(GT||(Ci.MessageReader=GT={}));var Vc=class{constructor(){this.errorEmitter=new Tg.Emitter,this.closeEmitter=new Tg.Emitter,this.partialMessageEmitter=new Tg.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${po.string(e.message)?e.message:"unknown"}`)}};Ci.AbstractMessageReader=Vc;var Eg;(function(t){function e(n){let r,i,s,o=new Map,a,u=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return a===void 0&&(a=(0,wg.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(Eg||(Eg={}));var xg=class extends Vc{constructor(e,n){super(),this.readable=e,this.options=Eg.fromOptions(n),this.buffer=(0,wg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new yD.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
2
|
-
${JSON.stringify(Object.fromEntries(r))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,
|
3
|
-
`,
|
4
|
-
`,
|
5
|
-
${l}`);let d=l.substr(0,h),g=l.substr(h+1).trim();a.set(e?d.toLowerCase():d,g)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};
|
6
|
-
${JSON.stringify(E.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let F=E.id,G=C.get(F);if(
|
7
|
-
${JSON.stringify(E,null,4)}`);let F=E;if(ut.string(F.id)||ut.number(F.id)){let G=F.id,Y=C.get(G);Y&&Y.reject(new Error("The received response has neither a result nor an error property."))}}function
|
1
|
+
"use strict";var Bp=Object.defineProperty;var cP=Object.getOwnPropertyDescriptor;var lP=Object.getOwnPropertyNames;var hP=Object.prototype.hasOwnProperty;var dP=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fP=(t,e)=>{for(var n in e)Bp(t,n,{get:e[n],enumerable:!0})},pP=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of lP(e))!hP.call(t,i)&&i!==n&&Bp(t,i,{get:()=>e[i],enumerable:!(r=cP(e,i))||r.enumerable});return t};var gP=t=>pP(Bp({},"__esModule",{value:!0}),t);var $c=m(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.thenable=kt.typedArray=kt.stringArray=kt.array=kt.func=kt.error=kt.number=kt.string=kt.boolean=void 0;function mP(t){return t===!0||t===!1}kt.boolean=mP;function $T(t){return typeof t=="string"||t instanceof String}kt.string=$T;function yP(t){return typeof t=="number"||t instanceof Number}kt.number=yP;function bP(t){return t instanceof Error}kt.error=bP;function BT(t){return typeof t=="function"}kt.func=BT;function WT(t){return Array.isArray(t)}kt.array=WT;function _P(t){return WT(t)&&t.every(e=>$T(e))}kt.stringArray=_P;function vP(t,e){return Array.isArray(t)&&t.every(e)}kt.typedArray=vP;function SP(t){return t&&BT(t.then)}kt.thenable=SP});var lo=m(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.stringArray=Qt.array=Qt.func=Qt.error=Qt.number=Qt.string=Qt.boolean=void 0;function TP(t){return t===!0||t===!1}Qt.boolean=TP;function UT(t){return typeof t=="string"||t instanceof String}Qt.string=UT;function wP(t){return typeof t=="number"||t instanceof Number}Qt.number=wP;function EP(t){return t instanceof Error}Qt.error=EP;function xP(t){return typeof t=="function"}Qt.func=xP;function HT(t){return Array.isArray(t)}Qt.array=HT;function AP(t){return HT(t)&&t.every(e=>UT(e))}Qt.stringArray=AP});var dg=m(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.Message=re.NotificationType9=re.NotificationType8=re.NotificationType7=re.NotificationType6=re.NotificationType5=re.NotificationType4=re.NotificationType3=re.NotificationType2=re.NotificationType1=re.NotificationType0=re.NotificationType=re.RequestType9=re.RequestType8=re.RequestType7=re.RequestType6=re.RequestType5=re.RequestType4=re.RequestType3=re.RequestType2=re.RequestType1=re.RequestType=re.RequestType0=re.AbstractMessageSignature=re.ParameterStructures=re.ResponseError=re.ErrorCodes=void 0;var ms=lo(),Wp;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Wp||(re.ErrorCodes=Wp={}));var Up=class t extends Error{constructor(e,n,r){super(n),this.code=ms.number(e)?e:Wp.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};re.ResponseError=Up;var vn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};re.ParameterStructures=vn;vn.auto=new vn("auto");vn.byPosition=new vn("byPosition");vn.byName=new vn("byName");var Xe=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return vn.auto}};re.AbstractMessageSignature=Xe;var Hp=class extends Xe{constructor(e){super(e,0)}};re.RequestType0=Hp;var Gp=class extends Xe{constructor(e,n=vn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};re.RequestType=Gp;var zp=class extends Xe{constructor(e,n=vn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};re.RequestType1=zp;var Kp=class extends Xe{constructor(e){super(e,2)}};re.RequestType2=Kp;var Vp=class extends Xe{constructor(e){super(e,3)}};re.RequestType3=Vp;var Xp=class extends Xe{constructor(e){super(e,4)}};re.RequestType4=Xp;var Yp=class extends Xe{constructor(e){super(e,5)}};re.RequestType5=Yp;var Jp=class extends Xe{constructor(e){super(e,6)}};re.RequestType6=Jp;var Qp=class extends Xe{constructor(e){super(e,7)}};re.RequestType7=Qp;var Zp=class extends Xe{constructor(e){super(e,8)}};re.RequestType8=Zp;var eg=class extends Xe{constructor(e){super(e,9)}};re.RequestType9=eg;var tg=class extends Xe{constructor(e,n=vn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};re.NotificationType=tg;var ng=class extends Xe{constructor(e){super(e,0)}};re.NotificationType0=ng;var rg=class extends Xe{constructor(e,n=vn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};re.NotificationType1=rg;var ig=class extends Xe{constructor(e){super(e,2)}};re.NotificationType2=ig;var sg=class extends Xe{constructor(e){super(e,3)}};re.NotificationType3=sg;var og=class extends Xe{constructor(e){super(e,4)}};re.NotificationType4=og;var ag=class extends Xe{constructor(e){super(e,5)}};re.NotificationType5=ag;var ug=class extends Xe{constructor(e){super(e,6)}};re.NotificationType6=ug;var cg=class extends Xe{constructor(e){super(e,7)}};re.NotificationType7=cg;var lg=class extends Xe{constructor(e){super(e,8)}};re.NotificationType8=lg;var hg=class extends Xe{constructor(e){super(e,9)}};re.NotificationType9=hg;var GT;(function(t){function e(i){let s=i;return s&&ms.string(s.method)&&(ms.string(s.id)||ms.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&ms.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(ms.string(s.id)||ms.number(s.id)||s.id===null)}t.isResponse=r})(GT||(re.Message=GT={}))});var pg=m(Ci=>{"use strict";var zT;Object.defineProperty(Ci,"__esModule",{value:!0});Ci.LRUCache=Ci.LinkedMap=Ci.Touch=void 0;var Zt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Zt||(Ci.Touch=Zt={}));var Bc=class{constructor(){this[zT]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=Zt.None){let r=this._map.get(e);if(r)return n!==Zt.None&&this.touch(r,n),r.value}set(e,n,r=Zt.None){let i=this._map.get(e);if(i)i.value=n,r!==Zt.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Zt.None:this.addItemLast(i);break;case Zt.First:this.addItemFirst(i);break;case Zt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(zT=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Zt.First&&n!==Zt.Last)){if(n===Zt.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Zt.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Ci.LinkedMap=Bc;var fg=class extends Bc{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=Zt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Zt.None)}set(e,n){return super.set(e,n,Zt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ci.LRUCache=fg});var VT=m(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.Disposable=void 0;var KT;(function(t){function e(n){return{dispose:n}}t.create=e})(KT||(Wc.Disposable=KT={}))});var Oi=m(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});var gg;function mg(){if(gg===void 0)throw new Error("No runtime abstraction layer installed");return gg}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");gg=n}t.install=e})(mg||(mg={}));yg.default=mg});var fo=m(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.Emitter=ho.Event=void 0;var kP=Oi(),XT;(function(t){let e={dispose(){}};t.None=function(){return e}})(XT||(ho.Event=XT={}));var bg=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,kP.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Uc=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new bg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ho.Emitter=Uc;Uc._noop=function(){}});var zc=m(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.CancellationTokenSource=po.CancellationToken=void 0;var CP=Oi(),OP=lo(),_g=fo(),Hc;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:_g.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:_g.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||OP.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Hc||(po.CancellationToken=Hc={}));var RP=Object.freeze(function(t,e){let n=(0,CP.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),Gc=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?RP:(this._emitter||(this._emitter=new _g.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},vg=class{get token(){return this._token||(this._token=new Gc),this._token}cancel(){this._token?this._token.cancel():this._token=Hc.Cancelled}dispose(){this._token?this._token instanceof Gc&&this._token.dispose():this._token=Hc.None}};po.CancellationTokenSource=vg});var YT=m(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.SharedArrayReceiverStrategy=go.SharedArraySenderStrategy=void 0;var DP=zc(),Ma;(function(t){t.Continue=0,t.Cancelled=1})(Ma||(Ma={}));var Sg=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Ma.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Ma.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};go.SharedArraySenderStrategy=Sg;var Tg=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")}},wg=class{constructor(e){this.token=new Tg(e)}cancel(){}dispose(){}},Eg=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new DP.CancellationTokenSource:new wg(n)}};go.SharedArrayReceiverStrategy=Eg});var Ag=m(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.Semaphore=void 0;var PP=Oi(),xg=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,PP.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};Kc.Semaphore=xg});var QT=m(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ReadableStreamMessageReader=Ri.AbstractMessageReader=Ri.MessageReader=void 0;var Cg=Oi(),mo=lo(),kg=fo(),IP=Ag(),JT;(function(t){function e(n){let r=n;return r&&mo.func(r.listen)&&mo.func(r.dispose)&&mo.func(r.onError)&&mo.func(r.onClose)&&mo.func(r.onPartialMessage)}t.is=e})(JT||(Ri.MessageReader=JT={}));var Vc=class{constructor(){this.errorEmitter=new kg.Emitter,this.closeEmitter=new kg.Emitter,this.partialMessageEmitter=new kg.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: ${mo.string(e.message)?e.message:"unknown"}`)}};Ri.AbstractMessageReader=Vc;var Og;(function(t){function e(n){let r,i,s,o=new Map,a,u=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return a===void 0&&(a=(0,Cg.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(Og||(Og={}));var Rg=class extends Vc{constructor(e,n){super(),this.readable=e,this.options=Og.fromOptions(n),this.buffer=(0,Cg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new IP.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
2
|
+
${JSON.stringify(Object.fromEntries(r))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Cg.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ri.ReadableStreamMessageReader=Rg});var rw=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.WriteableStreamMessageWriter=Di.AbstractMessageWriter=Di.MessageWriter=void 0;var ZT=Oi(),La=lo(),MP=Ag(),ew=fo(),LP="Content-Length: ",tw=`\r
|
3
|
+
`,nw;(function(t){function e(n){let r=n;return r&&La.func(r.dispose)&&La.func(r.onClose)&&La.func(r.onError)&&La.func(r.write)}t.is=e})(nw||(Di.MessageWriter=nw={}));var Xc=class{constructor(){this.errorEmitter=new ew.Emitter,this.closeEmitter=new ew.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${La.string(e.message)?e.message:"unknown"}`)}};Di.AbstractMessageWriter=Xc;var Dg;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,ZT.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,ZT.default)().applicationJson.encoder}}t.fromOptions=e})(Dg||(Dg={}));var Pg=class extends Xc{constructor(e,n){super(),this.writable=e,this.options=Dg.fromOptions(n),this.errorCount=0,this.writeSemaphore=new MP.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(LP,r.byteLength.toString(),tw),i.push(tw),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};Di.WriteableStreamMessageWriter=Pg});var iw=m(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.AbstractMessageBuffer=void 0;var NP=13,qP=10,jP=`\r
|
4
|
+
`,Ig=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,s=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(i=0;i<c.length;){switch(c[i]){case NP:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case qP:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=c.byteLength,r++}if(n!==4)return;let o=this._read(s+i),a=new Map,u=this.toString(o,"ascii").split(jP);if(u.length<2)return a;for(let c=0;c<u.length-2;c++){let l=u[c],h=l.indexOf(":");if(h===-1)throw new Error(`Message header must separate key and value using ':'
|
5
|
+
${l}`);let d=l.substr(0,h),g=l.substr(h+1).trim();a.set(e?d.toLowerCase():d,g)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};Yc.AbstractMessageBuffer=Ig});var cw=m(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.createMessageConnection=me.ConnectionOptions=me.MessageStrategy=me.CancellationStrategy=me.CancellationSenderStrategy=me.CancellationReceiverStrategy=me.RequestCancellationReceiverStrategy=me.IdCancellationReceiverStrategy=me.ConnectionStrategy=me.ConnectionError=me.ConnectionErrors=me.LogTraceNotification=me.SetTraceNotification=me.TraceFormat=me.TraceValues=me.Trace=me.NullLogger=me.ProgressType=me.ProgressToken=void 0;var sw=Oi(),ut=lo(),ue=dg(),ow=pg(),Na=fo(),Mg=zc(),Fa;(function(t){t.type=new ue.NotificationType("$/cancelRequest")})(Fa||(Fa={}));var Lg;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(Lg||(me.ProgressToken=Lg={}));var qa;(function(t){t.type=new ue.NotificationType("$/progress")})(qa||(qa={}));var Ng=class{constructor(){}};me.ProgressType=Ng;var qg;(function(t){function e(n){return ut.func(n)}t.is=e})(qg||(qg={}));me.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Le;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Le||(me.Trace=Le={}));var aw;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(aw||(me.TraceValues=aw={}));(function(t){function e(r){if(!ut.string(r))return t.Off;switch(r=r.toLowerCase(),r){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function n(r){switch(r){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=n})(Le||(me.Trace=Le={}));var Rn;(function(t){t.Text="text",t.JSON="json"})(Rn||(me.TraceFormat=Rn={}));(function(t){function e(n){return ut.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Rn||(me.TraceFormat=Rn={}));var jg;(function(t){t.type=new ue.NotificationType("$/setTrace")})(jg||(me.SetTraceNotification=jg={}));var Jc;(function(t){t.type=new ue.NotificationType("$/logTrace")})(Jc||(me.LogTraceNotification=Jc={}));var ja;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ja||(me.ConnectionErrors=ja={}));var yo=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};me.ConnectionError=yo;var Fg;(function(t){function e(n){let r=n;return r&&ut.func(r.cancelUndispatched)}t.is=e})(Fg||(me.ConnectionStrategy=Fg={}));var Qc;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&ut.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ut.func(r.dispose))}t.is=e})(Qc||(me.IdCancellationReceiverStrategy=Qc={}));var $g;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&ut.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ut.func(r.dispose))}t.is=e})($g||(me.RequestCancellationReceiverStrategy=$g={}));var Zc;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new Mg.CancellationTokenSource}});function e(n){return Qc.is(n)||$g.is(n)}t.is=e})(Zc||(me.CancellationReceiverStrategy=Zc={}));var el;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Fa.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&ut.func(r.sendCancellation)&&ut.func(r.cleanup)}t.is=e})(el||(me.CancellationSenderStrategy=el={}));var tl;(function(t){t.Message=Object.freeze({receiver:Zc.Message,sender:el.Message});function e(n){let r=n;return r&&Zc.is(r.receiver)&&el.is(r.sender)}t.is=e})(tl||(me.CancellationStrategy=tl={}));var nl;(function(t){function e(n){let r=n;return r&&ut.func(r.handleMessage)}t.is=e})(nl||(me.MessageStrategy=nl={}));var uw;(function(t){function e(n){let r=n;return r&&(tl.is(r.cancellationStrategy)||Fg.is(r.connectionStrategy)||nl.is(r.messageStrategy))}t.is=e})(uw||(me.ConnectionOptions=uw={}));var mr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(mr||(mr={}));function FP(t,e,n,r){let i=n!==void 0?n:me.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,h,d=new Map,g=new Map,_,b=new ow.LinkedMap,C=new Map,A=new Set,w=new Map,T=Le.Off,v=Rn.Text,L,R=mr.New,B=new Na.Emitter,ee=new Na.Emitter,ie=new Na.Emitter,W=new Na.Emitter,O=new Na.Emitter,M=r&&r.cancellationStrategy?r.cancellationStrategy:tl.Message;function N(E){if(E===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E.toString()}function j(E){return E===null?"res-unknown-"+(++a).toString():"res-"+E.toString()}function de(){return"not-"+(++o).toString()}function ce(E,F){ue.Message.isRequest(F)?E.set(N(F.id),F):ue.Message.isResponse(F)?E.set(j(F.id),F):E.set(de(),F)}function jt(E){}function _t(){return R===mr.Listening}function Fe(){return R===mr.Closed}function _n(){return R===mr.Disposed}function so(){(R===mr.New||R===mr.Listening)&&(R=mr.Closed,ee.fire(void 0))}function ps(E){B.fire([E,void 0,void 0])}function Ac(E){B.fire(E)}t.onClose(so),t.onError(ps),e.onClose(so),e.onError(Ac);function Oa(){_||b.size===0||(_=(0,sw.default)().timer.setImmediate(()=>{_=void 0,kc()}))}function Ra(E){ue.Message.isRequest(E)?Oc(E):ue.Message.isNotification(E)?Dc(E):ue.Message.isResponse(E)?Rc(E):oo(E)}function kc(){if(b.size===0)return;let E=b.shift();try{let F=r?.messageStrategy;nl.is(F)?F.handleMessage(E,Ra):Ra(E)}finally{Oa()}}let Cc=E=>{try{if(ue.Message.isNotification(E)&&E.method===Fa.type.method){let F=E.params.id,G=N(F),Y=b.get(G);if(ue.Message.isRequest(Y)){let Ne=r?.connectionStrategy,Ve=Ne&&Ne.cancelUndispatched?Ne.cancelUndispatched(Y,jt):void 0;if(Ve&&(Ve.error!==void 0||Ve.result!==void 0)){b.delete(G),w.delete(F),Ve.id=Y.id,gs(Ve,E.method,Date.now()),e.write(Ve).catch(()=>i.error("Sending response for canceled message failed."));return}}let Ue=w.get(F);if(Ue!==void 0){Ue.cancel(),ao(E);return}else A.add(F)}ce(b,E)}finally{Oa()}};function Oc(E){if(_n())return;function F(we,He,Pe){let dt={jsonrpc:u,id:E.id};we instanceof ue.ResponseError?dt.error=we.toJson():dt.result=we===void 0?null:we,gs(dt,He,Pe),e.write(dt).catch(()=>i.error("Sending response failed."))}function G(we,He,Pe){let dt={jsonrpc:u,id:E.id,error:we.toJson()};gs(dt,He,Pe),e.write(dt).catch(()=>i.error("Sending response failed."))}function Y(we,He,Pe){we===void 0&&(we=null);let dt={jsonrpc:u,id:E.id,result:we};gs(dt,He,Pe),e.write(dt).catch(()=>i.error("Sending response failed."))}Mc(E);let Ue=l.get(E.method),Ne,Ve;Ue&&(Ne=Ue.type,Ve=Ue.handler);let et=Date.now();if(Ve||c){let we=E.id??String(Date.now()),He=Qc.is(M.receiver)?M.receiver.createCancellationTokenSource(we):M.receiver.createCancellationTokenSource(E);E.id!==null&&A.has(E.id)&&He.cancel(),E.id!==null&&w.set(we,He);try{let Pe;if(Ve)if(E.params===void 0){if(Ne!==void 0&&Ne.numberOfParams!==0){G(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${E.method} defines ${Ne.numberOfParams} params but received none.`),E.method,et);return}Pe=Ve(He.token)}else if(Array.isArray(E.params)){if(Ne!==void 0&&Ne.parameterStructures===ue.ParameterStructures.byName){G(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by name but received parameters by position`),E.method,et);return}Pe=Ve(...E.params,He.token)}else{if(Ne!==void 0&&Ne.parameterStructures===ue.ParameterStructures.byPosition){G(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by position but received parameters by name`),E.method,et);return}Pe=Ve(E.params,He.token)}else c&&(Pe=c(E.method,E.params,He.token));let dt=Pe;Pe?dt.then?dt.then(Ft=>{w.delete(we),F(Ft,E.method,et)},Ft=>{w.delete(we),Ft instanceof ue.ResponseError?G(Ft,E.method,et):Ft&&ut.string(Ft.message)?G(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${Ft.message}`),E.method,et):G(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,et)}):(w.delete(we),F(Pe,E.method,et)):(w.delete(we),Y(Pe,E.method,et))}catch(Pe){w.delete(we),Pe instanceof ue.ResponseError?F(Pe,E.method,et):Pe&&ut.string(Pe.message)?G(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${Pe.message}`),E.method,et):G(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,et)}}else G(new ue.ResponseError(ue.ErrorCodes.MethodNotFound,`Unhandled method ${E.method}`),E.method,et)}function Rc(E){if(!_n())if(E.id===null)E.error?i.error(`Received response message without id: Error is:
|
6
|
+
${JSON.stringify(E.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let F=E.id,G=C.get(F);if(Lc(E,G),G!==void 0){C.delete(F);try{if(E.error){let Y=E.error;G.reject(new ue.ResponseError(Y.code,Y.message,Y.data))}else if(E.result!==void 0)G.resolve(E.result);else throw new Error("Should never happen.")}catch(Y){Y.message?i.error(`Response handler '${G.method}' failed with message: ${Y.message}`):i.error(`Response handler '${G.method}' failed unexpectedly.`)}}}}function Dc(E){if(_n())return;let F,G;if(E.method===Fa.type.method){let Y=E.params.id;A.delete(Y),ao(E);return}else{let Y=d.get(E.method);Y&&(G=Y.handler,F=Y.type)}if(G||h)try{if(ao(E),G)if(E.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==ue.ParameterStructures.byName&&i.error(`Notification ${E.method} defines ${F.numberOfParams} params but received none.`),G();else if(Array.isArray(E.params)){let Y=E.params;E.method===qa.type.method&&Y.length===2&&Lg.is(Y[0])?G({token:Y[0],value:Y[1]}):(F!==void 0&&(F.parameterStructures===ue.ParameterStructures.byName&&i.error(`Notification ${E.method} defines parameters by name but received parameters by position`),F.numberOfParams!==E.params.length&&i.error(`Notification ${E.method} defines ${F.numberOfParams} params but received ${Y.length} arguments`)),G(...Y))}else F!==void 0&&F.parameterStructures===ue.ParameterStructures.byPosition&&i.error(`Notification ${E.method} defines parameters by position but received parameters by name`),G(E.params);else h&&h(E.method,E.params)}catch(Y){Y.message?i.error(`Notification handler '${E.method}' failed with message: ${Y.message}`):i.error(`Notification handler '${E.method}' failed unexpectedly.`)}else ie.fire(E)}function oo(E){if(!E){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
7
|
+
${JSON.stringify(E,null,4)}`);let F=E;if(ut.string(F.id)||ut.number(F.id)){let G=F.id,Y=C.get(G);Y&&Y.reject(new Error("The received response has neither a result nor an error property."))}}function fr(E){if(E!=null)switch(T){case Le.Verbose:return JSON.stringify(E,null,4);case Le.Compact:return JSON.stringify(E);default:return}}function Pc(E){if(!(T===Le.Off||!L))if(v===Rn.Text){let F;(T===Le.Verbose||T===Le.Compact)&&E.params&&(F=`Params: ${fr(E.params)}
|
8
8
|
|
9
|
-
`),L.log(`Sending request '${E.method} - (${E.id})'.`,F)}else
|
9
|
+
`),L.log(`Sending request '${E.method} - (${E.id})'.`,F)}else si("send-request",E)}function Ic(E){if(!(T===Le.Off||!L))if(v===Rn.Text){let F;(T===Le.Verbose||T===Le.Compact)&&(E.params?F=`Params: ${fr(E.params)}
|
10
10
|
|
11
11
|
`:F=`No parameters provided.
|
12
12
|
|
13
|
-
`),L.log(`Sending notification '${E.method}'.`,F)}else
|
13
|
+
`),L.log(`Sending notification '${E.method}'.`,F)}else si("send-notification",E)}function gs(E,F,G){if(!(T===Le.Off||!L))if(v===Rn.Text){let Y;(T===Le.Verbose||T===Le.Compact)&&(E.error&&E.error.data?Y=`Error data: ${fr(E.error.data)}
|
14
14
|
|
15
|
-
`:E.result?Y=`Result: ${
|
15
|
+
`:E.result?Y=`Result: ${fr(E.result)}
|
16
16
|
|
17
17
|
`:E.error===void 0&&(Y=`No result returned.
|
18
18
|
|
19
|
-
`)),L.log(`Sending response '${F} - (${E.id})'. Processing request took ${Date.now()-G}ms`,Y)}else
|
19
|
+
`)),L.log(`Sending response '${F} - (${E.id})'. Processing request took ${Date.now()-G}ms`,Y)}else si("send-response",E)}function Mc(E){if(!(T===Le.Off||!L))if(v===Rn.Text){let F;(T===Le.Verbose||T===Le.Compact)&&E.params&&(F=`Params: ${fr(E.params)}
|
20
20
|
|
21
|
-
`),L.log(`Received request '${E.method} - (${E.id})'.`,F)}else
|
21
|
+
`),L.log(`Received request '${E.method} - (${E.id})'.`,F)}else si("receive-request",E)}function ao(E){if(!(T===Le.Off||!L||E.method===Jc.type.method))if(v===Rn.Text){let F;(T===Le.Verbose||T===Le.Compact)&&(E.params?F=`Params: ${fr(E.params)}
|
22
22
|
|
23
23
|
`:F=`No parameters provided.
|
24
24
|
|
25
|
-
`),L.log(`Received notification '${E.method}'.`,F)}else
|
25
|
+
`),L.log(`Received notification '${E.method}'.`,F)}else si("receive-notification",E)}function Lc(E,F){if(!(T===Le.Off||!L))if(v===Rn.Text){let G;if((T===Le.Verbose||T===Le.Compact)&&(E.error&&E.error.data?G=`Error data: ${fr(E.error.data)}
|
26
26
|
|
27
|
-
`:E.result?G=`Result: ${
|
27
|
+
`:E.result?G=`Result: ${fr(E.result)}
|
28
28
|
|
29
29
|
`:E.error===void 0&&(G=`No result returned.
|
30
30
|
|
31
|
-
`)),F){let Y=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";L.log(`Received response '${F.method} - (${E.id})' in ${Date.now()-F.timerStart}ms.${Y}`,G)}else L.log(`Received response ${E.id} without active response promise.`,G)}else ri("receive-response",E)}function ri(E,F){if(!L||T===Le.Off)return;let G={isLSPMessage:!0,type:E,message:F,timestamp:Date.now()};L.log(G)}function xi(){if(Fe())throw new go(Na.Closed,"Connection is closed.");if(bn())throw new go(Na.Disposed,"Connection is disposed.")}function Lc(){if(_t())throw new go(Na.AlreadyListening,"Connection is already listening")}function Nc(){if(!_t())throw new Error("Call listen() first.")}function Dr(E){return E===void 0?null:E}function Oa(E){if(E!==null)return E}function Ra(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function oo(E,F){switch(E){case ue.ParameterStructures.auto:return Ra(F)?Oa(F):[Dr(F)];case ue.ParameterStructures.byName:if(!Ra(F))throw new Error("Received parameters by name but param is not an object literal.");return Oa(F);case ue.ParameterStructures.byPosition:return[Dr(F)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function Pa(E,F){let G,Y=E.numberOfParams;switch(Y){case 0:G=void 0;break;case 1:G=oo(E.parameterStructures,F[0]);break;default:G=[];for(let Ue=0;Ue<F.length&&Ue<Y;Ue++)G.push(Dr(F[Ue]));if(F.length<Y)for(let Ue=F.length;Ue<Y;Ue++)G.push(null);break}return G}let ii={sendNotification:(E,...F)=>{xi();let G,Y;if(ut.string(E)){G=E;let Ne=F[0],Ke=0,et=ue.ParameterStructures.auto;ue.ParameterStructures.is(Ne)&&(Ke=1,et=Ne);let we=F.length,He=we-Ke;switch(He){case 0:Y=void 0;break;case 1:Y=oo(et,F[Ke]);break;default:if(et===ue.ParameterStructures.byName)throw new Error(`Received ${He} parameters for 'by Name' notification parameter structure.`);Y=F.slice(Ke,we).map(De=>Dr(De));break}}else{let Ne=F;G=E.method,Y=Pa(E,Ne)}let Ue={jsonrpc:u,method:G,params:Y};return Dc(Ue),e.write(Ue).catch(Ne=>{throw i.error("Sending notification failed."),Ne})},onNotification:(E,F)=>{xi();let G;return ut.func(E)?h=E:F&&(ut.string(E)?(G=E,d.set(E,{type:void 0,handler:F})):(G=E.method,d.set(E.method,{type:E,handler:F}))),{dispose:()=>{G!==void 0?d.delete(G):h=void 0}}},onProgress:(E,F,G)=>{if(g.has(F))throw new Error(`Progress handler for token ${F} already registered`);return g.set(F,G),{dispose:()=>{g.delete(F)}}},sendProgress:(E,F,G)=>ii.sendNotification(La.type,{token:F,value:G}),onUnhandledProgress:W.event,sendRequest:(E,...F)=>{xi(),Nc();let G,Y,Ue;if(ut.string(E)){G=E;let we=F[0],He=F[F.length-1],De=0,dt=ue.ParameterStructures.auto;ue.ParameterStructures.is(we)&&(De=1,dt=we);let Ft=F.length;Og.CancellationToken.is(He)&&(Ft=Ft-1,Ue=He);let On=Ft-De;switch(On){case 0:Y=void 0;break;case 1:Y=oo(dt,F[De]);break;default:if(dt===ue.ParameterStructures.byName)throw new Error(`Received ${On} parameters for 'by Name' request parameter structure.`);Y=F.slice(De,Ft).map(qc=>Dr(qc));break}}else{let we=F;G=E.method,Y=Pa(E,we);let He=E.numberOfParams;Ue=Og.CancellationToken.is(we[He])?we[He]:void 0}let Ne=s++,Ke;Ue&&(Ke=Ue.onCancellationRequested(()=>{let we=M.sender.sendCancellation(ii,Ne);return we===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Ne}`),Promise.resolve()):we.catch(()=>{i.log(`Sending cancellation messages for id ${Ne} failed`)})}));let et={jsonrpc:u,id:Ne,method:G,params:Y};return Pc(et),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(et),new Promise(async(we,He)=>{let De=On=>{we(On),M.sender.cleanup(Ne),Ke?.dispose()},dt=On=>{He(On),M.sender.cleanup(Ne),Ke?.dispose()},Ft={method:G,timerStart:Date.now(),resolve:De,reject:dt};try{await e.write(et),C.set(Ne,Ft)}catch(On){throw i.error("Sending request failed."),Ft.reject(new ue.ResponseError(ue.ErrorCodes.MessageWriteError,On.message?On.message:"Unknown reason")),On}})},onRequest:(E,F)=>{xi();let G=null;return Dg.is(E)?(G=void 0,c=E):ut.string(E)?(G=null,F!==void 0&&(G=E,l.set(E,{handler:F,type:void 0}))):F!==void 0&&(G=E.method,l.set(E.method,{type:E,handler:F})),{dispose:()=>{G!==null&&(G!==void 0?l.delete(G):c=void 0)}}},hasPendingResponse:()=>C.size>0,trace:async(E,F,G)=>{let Y=!1,Ue=Rn.Text;G!==void 0&&(ut.boolean(G)?Y=G:(Y=G.sendNotification||!1,Ue=G.traceFormat||Rn.Text)),T=E,v=Ue,T===Le.Off?L=void 0:L=F,Y&&!Fe()&&!bn()&&await ii.sendNotification(Ig.type,{value:Le.toString(E)})},onError:B.event,onClose:ee.event,onUnhandledNotification:re.event,onDispose:O.event,end:()=>{e.end()},dispose:()=>{if(bn())return;R=gr.Disposed,O.fire(void 0);let E=new ue.ResponseError(ue.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of C.values())F.reject(E);C=new Map,w=new Map,A=new Set,b=new ew.LinkedMap,ut.func(e.dispose)&&e.dispose(),ut.func(t.dispose)&&t.dispose()},listen:()=>{xi(),Lc(),R=gr.Listening,t.listen(kc)},inspect:()=>{(0,ZT.default)().console.log("inspect")}};return ii.onNotification(Yc.type,E=>{if(T===Le.Off||!L)return;let F=T===Le.Verbose||T===Le.Compact;L.log(E.message,F?E.verbose:void 0)}),ii.onNotification(La.type,E=>{let F=g.get(E.token);F?F(E.value):W.fire(E)}),ii}me.createMessageConnection=wD});var nl=m(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.ProgressType=q.ProgressToken=q.createMessageConnection=q.NullLogger=q.ConnectionOptions=q.ConnectionStrategy=q.AbstractMessageBuffer=q.WriteableStreamMessageWriter=q.AbstractMessageWriter=q.MessageWriter=q.ReadableStreamMessageReader=q.AbstractMessageReader=q.MessageReader=q.SharedArrayReceiverStrategy=q.SharedArraySenderStrategy=q.CancellationToken=q.CancellationTokenSource=q.Emitter=q.Event=q.Disposable=q.LRUCache=q.Touch=q.LinkedMap=q.ParameterStructures=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.ErrorCodes=q.ResponseError=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType0=q.RequestType=q.Message=q.RAL=void 0;q.MessageStrategy=q.CancellationStrategy=q.CancellationSenderStrategy=q.CancellationReceiverStrategy=q.ConnectionError=q.ConnectionErrors=q.LogTraceNotification=q.SetTraceNotification=q.TraceFormat=q.TraceValues=q.Trace=void 0;var Ve=ag();Object.defineProperty(q,"Message",{enumerable:!0,get:function(){return Ve.Message}});Object.defineProperty(q,"RequestType",{enumerable:!0,get:function(){return Ve.RequestType}});Object.defineProperty(q,"RequestType0",{enumerable:!0,get:function(){return Ve.RequestType0}});Object.defineProperty(q,"RequestType1",{enumerable:!0,get:function(){return Ve.RequestType1}});Object.defineProperty(q,"RequestType2",{enumerable:!0,get:function(){return Ve.RequestType2}});Object.defineProperty(q,"RequestType3",{enumerable:!0,get:function(){return Ve.RequestType3}});Object.defineProperty(q,"RequestType4",{enumerable:!0,get:function(){return Ve.RequestType4}});Object.defineProperty(q,"RequestType5",{enumerable:!0,get:function(){return Ve.RequestType5}});Object.defineProperty(q,"RequestType6",{enumerable:!0,get:function(){return Ve.RequestType6}});Object.defineProperty(q,"RequestType7",{enumerable:!0,get:function(){return Ve.RequestType7}});Object.defineProperty(q,"RequestType8",{enumerable:!0,get:function(){return Ve.RequestType8}});Object.defineProperty(q,"RequestType9",{enumerable:!0,get:function(){return Ve.RequestType9}});Object.defineProperty(q,"ResponseError",{enumerable:!0,get:function(){return Ve.ResponseError}});Object.defineProperty(q,"ErrorCodes",{enumerable:!0,get:function(){return Ve.ErrorCodes}});Object.defineProperty(q,"NotificationType",{enumerable:!0,get:function(){return Ve.NotificationType}});Object.defineProperty(q,"NotificationType0",{enumerable:!0,get:function(){return Ve.NotificationType0}});Object.defineProperty(q,"NotificationType1",{enumerable:!0,get:function(){return Ve.NotificationType1}});Object.defineProperty(q,"NotificationType2",{enumerable:!0,get:function(){return Ve.NotificationType2}});Object.defineProperty(q,"NotificationType3",{enumerable:!0,get:function(){return Ve.NotificationType3}});Object.defineProperty(q,"NotificationType4",{enumerable:!0,get:function(){return Ve.NotificationType4}});Object.defineProperty(q,"NotificationType5",{enumerable:!0,get:function(){return Ve.NotificationType5}});Object.defineProperty(q,"NotificationType6",{enumerable:!0,get:function(){return Ve.NotificationType6}});Object.defineProperty(q,"NotificationType7",{enumerable:!0,get:function(){return Ve.NotificationType7}});Object.defineProperty(q,"NotificationType8",{enumerable:!0,get:function(){return Ve.NotificationType8}});Object.defineProperty(q,"NotificationType9",{enumerable:!0,get:function(){return Ve.NotificationType9}});Object.defineProperty(q,"ParameterStructures",{enumerable:!0,get:function(){return Ve.ParameterStructures}});var Ng=cg();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return Ng.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return Ng.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return Ng.Touch}});var ED=WT();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return ED.Disposable}});var iw=lo();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return iw.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return iw.Emitter}});var sw=Gc();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return sw.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return sw.CancellationToken}});var ow=HT();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return ow.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return ow.SharedArrayReceiverStrategy}});var qg=zT();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return qg.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return qg.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return qg.ReadableStreamMessageReader}});var jg=JT();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return jg.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return jg.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return jg.WriteableStreamMessageWriter}});var xD=QT();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return xD.AbstractMessageBuffer}});var Vt=rw();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return Vt.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return Vt.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return Vt.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return Vt.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return Vt.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return Vt.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return Vt.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return Vt.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return Vt.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return Vt.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return Vt.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return Vt.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return Vt.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Vt.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Vt.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return Vt.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return Vt.MessageStrategy}});var AD=ki();q.RAL=AD.default});var cw=m(Wg=>{"use strict";Object.defineProperty(Wg,"__esModule",{value:!0});var aw=require("util"),oi=nl(),rl=class t extends oi.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new aw.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};rl.emptyBuffer=Buffer.allocUnsafe(0);var Fg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),oi.Disposable.create(()=>this.stream.off("data",e))}},$g=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},uw=Object.freeze({messageBuffer:Object.freeze({create:t=>new rl(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new aw.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Fg(t),asWritableStream:t=>new $g(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function Bg(){return uw}(function(t){function e(){oi.RAL.install(uw)}t.install=e})(Bg||(Bg={}));Wg.default=Bg});var ys=m(ke=>{"use strict";var kD=ke&&ke.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),CD=ke&&ke.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&kD(e,t,n)};Object.defineProperty(ke,"__esModule",{value:!0});ke.createMessageConnection=ke.createServerSocketTransport=ke.createClientSocketTransport=ke.createServerPipeTransport=ke.createClientPipeTransport=ke.generateRandomPipeName=ke.StreamMessageWriter=ke.StreamMessageReader=ke.SocketMessageWriter=ke.SocketMessageReader=ke.PortMessageWriter=ke.PortMessageReader=ke.IPCMessageWriter=ke.IPCMessageReader=void 0;var mo=cw();mo.default.install();var lw=require("path"),OD=require("os"),RD=require("crypto"),ol=require("net"),Pn=nl();CD(nl(),ke);var Ug=class extends Pn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Pn.Disposable.create(()=>this.process.off("message",e))}};ke.IPCMessageReader=Ug;var Hg=class extends Pn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};ke.IPCMessageWriter=Hg;var Gg=class extends Pn.AbstractMessageReader{constructor(e){super(),this.onData=new Pn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};ke.PortMessageReader=Gg;var zg=class extends Pn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};ke.PortMessageWriter=zg;var gs=class extends Pn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,mo.default)().stream.asReadableStream(e),n)}};ke.SocketMessageReader=gs;var ms=class extends Pn.WriteableStreamMessageWriter{constructor(e,n){super((0,mo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ke.SocketMessageWriter=ms;var il=class extends Pn.ReadableStreamMessageReader{constructor(e,n){super((0,mo.default)().stream.asReadableStream(e),n)}};ke.StreamMessageReader=il;var sl=class extends Pn.WriteableStreamMessageWriter{constructor(e,n){super((0,mo.default)().stream.asWritableStream(e),n)}};ke.StreamMessageWriter=sl;var hw=process.env.XDG_RUNTIME_DIR,PD=new Map([["linux",107],["darwin",103]]);function DD(){let t=(0,RD.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;hw?e=lw.join(hw,`vscode-ipc-${t}.sock`):e=lw.join(OD.tmpdir(),`vscode-${t}.sock`);let n=PD.get(process.platform);return n!==void 0&&e.length>n&&(0,mo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}ke.generateRandomPipeName=DD;function ID(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,ol.createServer)(a=>{o.close(),n([new gs(a,e),new ms(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}ke.createClientPipeTransport=ID;function MD(t,e="utf-8"){let n=(0,ol.createConnection)(t);return[new gs(n,e),new ms(n,e)]}ke.createServerPipeTransport=MD;function LD(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,ol.createServer)(a=>{o.close(),n([new gs(a,e),new ms(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}ke.createClientSocketTransport=LD;function ND(t,e="utf-8"){let n=(0,ol.createConnection)(t,"127.0.0.1");return[new gs(n,e),new ms(n,e)]}ke.createServerSocketTransport=ND;function qD(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function jD(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function FD(t,e,n,r){n||(n=Pn.NullLogger);let i=qD(t)?new il(t):t,s=jD(e)?new sl(e):e;return Pn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Pn.createMessageConnection)(i,s,n,r)}ke.createMessageConnection=FD});var Vg=m((HG,dw)=>{"use strict";dw.exports=ys()});var ul=m((fw,al)=>{(function(t){if(typeof al=="object"&&typeof al.exports=="object"){var e=t(require,fw);e!==void 0&&(al.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var n;(function(p){function x(k){return typeof k=="string"}p.is=x})(n||(e.DocumentUri=n={}));var r;(function(p){function x(k){return typeof k=="string"}p.is=x})(r||(e.URI=r={}));var i;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function x(k){return typeof k=="number"&&p.MIN_VALUE<=k&&k<=p.MAX_VALUE}p.is=x})(i||(e.integer=i={}));var s;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function x(k){return typeof k=="number"&&p.MIN_VALUE<=k&&k<=p.MAX_VALUE}p.is=x})(s||(e.uinteger=s={}));var o;(function(p){function x(_,f){return _===Number.MAX_VALUE&&(_=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:_,character:f}}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&I.uinteger(f.line)&&I.uinteger(f.character)}p.is=k})(o||(e.Position=o={}));var a;(function(p){function x(_,f,D,$){if(I.uinteger(_)&&I.uinteger(f)&&I.uinteger(D)&&I.uinteger($))return{start:o.create(_,f),end:o.create(D,$)};if(o.is(_)&&o.is(f))return{start:_,end:f};throw new Error("Range#create called with invalid arguments[".concat(_,", ").concat(f,", ").concat(D,", ").concat($,"]"))}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}p.is=k})(a||(e.Range=a={}));var u;(function(p){function x(_,f){return{uri:_,range:f}}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&a.is(f.range)&&(I.string(f.uri)||I.undefined(f.uri))}p.is=k})(u||(e.Location=u={}));var c;(function(p){function x(_,f,D,$){return{targetUri:_,targetRange:f,targetSelectionRange:D,originSelectionRange:$}}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&a.is(f.targetRange)&&I.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||I.undefined(f.originSelectionRange))}p.is=k})(c||(e.LocationLink=c={}));var l;(function(p){function x(_,f,D,$){return{red:_,green:f,blue:D,alpha:$}}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&I.numberRange(f.red,0,1)&&I.numberRange(f.green,0,1)&&I.numberRange(f.blue,0,1)&&I.numberRange(f.alpha,0,1)}p.is=k})(l||(e.Color=l={}));var h;(function(p){function x(_,f){return{range:_,color:f}}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&a.is(f.range)&&l.is(f.color)}p.is=k})(h||(e.ColorInformation=h={}));var d;(function(p){function x(_,f,D){return{label:_,textEdit:f,additionalTextEdits:D}}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&I.string(f.label)&&(I.undefined(f.textEdit)||L.is(f))&&(I.undefined(f.additionalTextEdits)||I.typedArray(f.additionalTextEdits,L.is))}p.is=k})(d||(e.ColorPresentation=d={}));var g;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(g||(e.FoldingRangeKind=g={}));var y;(function(p){function x(_,f,D,$,ge,ft){var ze={startLine:_,endLine:f};return I.defined(D)&&(ze.startCharacter=D),I.defined($)&&(ze.endCharacter=$),I.defined(ge)&&(ze.kind=ge),I.defined(ft)&&(ze.collapsedText=ft),ze}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&I.uinteger(f.startLine)&&I.uinteger(f.startLine)&&(I.undefined(f.startCharacter)||I.uinteger(f.startCharacter))&&(I.undefined(f.endCharacter)||I.uinteger(f.endCharacter))&&(I.undefined(f.kind)||I.string(f.kind))}p.is=k})(y||(e.FoldingRange=y={}));var b;(function(p){function x(_,f){return{location:_,message:f}}p.create=x;function k(_){var f=_;return I.defined(f)&&u.is(f.location)&&I.string(f.message)}p.is=k})(b||(e.DiagnosticRelatedInformation=b={}));var C;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(C||(e.DiagnosticSeverity=C={}));var A;(function(p){p.Unnecessary=1,p.Deprecated=2})(A||(e.DiagnosticTag=A={}));var w;(function(p){function x(k){var _=k;return I.objectLiteral(_)&&I.string(_.href)}p.is=x})(w||(e.CodeDescription=w={}));var T;(function(p){function x(_,f,D,$,ge,ft){var ze={range:_,message:f};return I.defined(D)&&(ze.severity=D),I.defined($)&&(ze.code=$),I.defined(ge)&&(ze.source=ge),I.defined(ft)&&(ze.relatedInformation=ft),ze}p.create=x;function k(_){var f,D=_;return I.defined(D)&&a.is(D.range)&&I.string(D.message)&&(I.number(D.severity)||I.undefined(D.severity))&&(I.integer(D.code)||I.string(D.code)||I.undefined(D.code))&&(I.undefined(D.codeDescription)||I.string((f=D.codeDescription)===null||f===void 0?void 0:f.href))&&(I.string(D.source)||I.undefined(D.source))&&(I.undefined(D.relatedInformation)||I.typedArray(D.relatedInformation,b.is))}p.is=k})(T||(e.Diagnostic=T={}));var v;(function(p){function x(_,f){for(var D=[],$=2;$<arguments.length;$++)D[$-2]=arguments[$];var ge={title:_,command:f};return I.defined(D)&&D.length>0&&(ge.arguments=D),ge}p.create=x;function k(_){var f=_;return I.defined(f)&&I.string(f.title)&&I.string(f.command)}p.is=k})(v||(e.Command=v={}));var L;(function(p){function x(D,$){return{range:D,newText:$}}p.replace=x;function k(D,$){return{range:{start:D,end:D},newText:$}}p.insert=k;function _(D){return{range:D,newText:""}}p.del=_;function f(D){var $=D;return I.objectLiteral($)&&I.string($.newText)&&a.is($.range)}p.is=f})(L||(e.TextEdit=L={}));var R;(function(p){function x(_,f,D){var $={label:_};return f!==void 0&&($.needsConfirmation=f),D!==void 0&&($.description=D),$}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&I.string(f.label)&&(I.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(I.string(f.description)||f.description===void 0)}p.is=k})(R||(e.ChangeAnnotation=R={}));var B;(function(p){function x(k){var _=k;return I.string(_)}p.is=x})(B||(e.ChangeAnnotationIdentifier=B={}));var ee;(function(p){function x(D,$,ge){return{range:D,newText:$,annotationId:ge}}p.replace=x;function k(D,$,ge){return{range:{start:D,end:D},newText:$,annotationId:ge}}p.insert=k;function _(D,$){return{range:D,newText:"",annotationId:$}}p.del=_;function f(D){var $=D;return L.is($)&&(R.is($.annotationId)||B.is($.annotationId))}p.is=f})(ee||(e.AnnotatedTextEdit=ee={}));var re;(function(p){function x(_,f){return{textDocument:_,edits:f}}p.create=x;function k(_){var f=_;return I.defined(f)&&Fe.is(f.textDocument)&&Array.isArray(f.edits)}p.is=k})(re||(e.TextDocumentEdit=re={}));var W;(function(p){function x(_,f,D){var $={kind:"create",uri:_};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&($.options=f),D!==void 0&&($.annotationId=D),$}p.create=x;function k(_){var f=_;return f&&f.kind==="create"&&I.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||I.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||I.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||B.is(f.annotationId))}p.is=k})(W||(e.CreateFile=W={}));var O;(function(p){function x(_,f,D,$){var ge={kind:"rename",oldUri:_,newUri:f};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ge.options=D),$!==void 0&&(ge.annotationId=$),ge}p.create=x;function k(_){var f=_;return f&&f.kind==="rename"&&I.string(f.oldUri)&&I.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||I.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||I.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||B.is(f.annotationId))}p.is=k})(O||(e.RenameFile=O={}));var M;(function(p){function x(_,f,D){var $={kind:"delete",uri:_};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&($.options=f),D!==void 0&&($.annotationId=D),$}p.create=x;function k(_){var f=_;return f&&f.kind==="delete"&&I.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||I.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||I.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||B.is(f.annotationId))}p.is=k})(M||(e.DeleteFile=M={}));var N;(function(p){function x(k){var _=k;return _&&(_.changes!==void 0||_.documentChanges!==void 0)&&(_.documentChanges===void 0||_.documentChanges.every(function(f){return I.string(f.kind)?W.is(f)||O.is(f)||M.is(f):re.is(f)}))}p.is=x})(N||(e.WorkspaceEdit=N={}));var j=function(){function p(x,k){this.edits=x,this.changeAnnotations=k}return p.prototype.insert=function(x,k,_){var f,D;if(_===void 0?f=L.insert(x,k):B.is(_)?(D=_,f=ee.insert(x,k,_)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(_),f=ee.insert(x,k,D)),this.edits.push(f),D!==void 0)return D},p.prototype.replace=function(x,k,_){var f,D;if(_===void 0?f=L.replace(x,k):B.is(_)?(D=_,f=ee.replace(x,k,_)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(_),f=ee.replace(x,k,D)),this.edits.push(f),D!==void 0)return D},p.prototype.delete=function(x,k){var _,f;if(k===void 0?_=L.del(x):B.is(k)?(f=k,_=ee.del(x,k)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(k),_=ee.del(x,f)),this.edits.push(_),f!==void 0)return f},p.prototype.add=function(x){this.edits.push(x)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),de=function(){function p(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(x,k){var _;if(B.is(x)?_=x:(_=this.nextId(),k=x),this._annotations[_]!==void 0)throw new Error("Id ".concat(_," is already in use."));if(k===void 0)throw new Error("No annotation provided for id ".concat(_));return this._annotations[_]=k,this._size++,_},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),ce=function(){function p(x){var k=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new de(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(_){if(re.is(_)){var f=new j(_.edits,k._changeAnnotations);k._textEditChanges[_.textDocument.uri]=f}})):x.changes&&Object.keys(x.changes).forEach(function(_){var f=new j(x.changes[_]);k._textEditChanges[_]=f})):this._workspaceEdit={}}return Object.defineProperty(p.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),p.prototype.getTextEditChange=function(x){if(Fe.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var k={uri:x.uri,version:x.version},_=this._textEditChanges[k.uri];if(!_){var f=[],D={textDocument:k,edits:f};this._workspaceEdit.documentChanges.push(D),_=new j(f,this._changeAnnotations),this._textEditChanges[k.uri]=_}return _}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var _=this._textEditChanges[x];if(!_){var f=[];this._workspaceEdit.changes[x]=f,_=new j(f),this._textEditChanges[x]=_}return _}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new de,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(x,k,_){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;R.is(k)||B.is(k)?f=k:_=k;var D,$;if(f===void 0?D=W.create(x,_):($=B.is(f)?f:this._changeAnnotations.manage(f),D=W.create(x,_,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p.prototype.renameFile=function(x,k,_,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;R.is(_)||B.is(_)?D=_:f=_;var $,ge;if(D===void 0?$=O.create(x,k,f):(ge=B.is(D)?D:this._changeAnnotations.manage(D),$=O.create(x,k,f,ge)),this._workspaceEdit.documentChanges.push($),ge!==void 0)return ge},p.prototype.deleteFile=function(x,k,_){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;R.is(k)||B.is(k)?f=k:_=k;var D,$;if(f===void 0?D=M.create(x,_):($=B.is(f)?f:this._changeAnnotations.manage(f),D=M.create(x,_,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p}();e.WorkspaceChange=ce;var jt;(function(p){function x(_){return{uri:_}}p.create=x;function k(_){var f=_;return I.defined(f)&&I.string(f.uri)}p.is=k})(jt||(e.TextDocumentIdentifier=jt={}));var _t;(function(p){function x(_,f){return{uri:_,version:f}}p.create=x;function k(_){var f=_;return I.defined(f)&&I.string(f.uri)&&I.integer(f.version)}p.is=k})(_t||(e.VersionedTextDocumentIdentifier=_t={}));var Fe;(function(p){function x(_,f){return{uri:_,version:f}}p.create=x;function k(_){var f=_;return I.defined(f)&&I.string(f.uri)&&(f.version===null||I.integer(f.version))}p.is=k})(Fe||(e.OptionalVersionedTextDocumentIdentifier=Fe={}));var bn;(function(p){function x(_,f,D,$){return{uri:_,languageId:f,version:D,text:$}}p.create=x;function k(_){var f=_;return I.defined(f)&&I.string(f.uri)&&I.string(f.languageId)&&I.integer(f.version)&&I.string(f.text)}p.is=k})(bn||(e.TextDocumentItem=bn={}));var ro;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function x(k){var _=k;return _===p.PlainText||_===p.Markdown}p.is=x})(ro||(e.MarkupKind=ro={}));var ds;(function(p){function x(k){var _=k;return I.objectLiteral(k)&&ro.is(_.kind)&&I.string(_.value)}p.is=x})(ds||(e.MarkupContent=ds={}));var xc;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(xc||(e.CompletionItemKind=xc={}));var ka;(function(p){p.PlainText=1,p.Snippet=2})(ka||(e.InsertTextFormat=ka={}));var Ca;(function(p){p.Deprecated=1})(Ca||(e.CompletionItemTag=Ca={}));var Ac;(function(p){function x(_,f,D){return{newText:_,insert:f,replace:D}}p.create=x;function k(_){var f=_;return f&&I.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}p.is=k})(Ac||(e.InsertReplaceEdit=Ac={}));var kc;(function(p){p.asIs=1,p.adjustIndentation=2})(kc||(e.InsertTextMode=kc={}));var Cc;(function(p){function x(k){var _=k;return _&&(I.string(_.detail)||_.detail===void 0)&&(I.string(_.description)||_.description===void 0)}p.is=x})(Cc||(e.CompletionItemLabelDetails=Cc={}));var Oc;(function(p){function x(k){return{label:k}}p.create=x})(Oc||(e.CompletionItem=Oc={}));var Rc;(function(p){function x(k,_){return{items:k||[],isIncomplete:!!_}}p.create=x})(Rc||(e.CompletionList=Rc={}));var io;(function(p){function x(_){return _.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=x;function k(_){var f=_;return I.string(f)||I.objectLiteral(f)&&I.string(f.language)&&I.string(f.value)}p.is=k})(io||(e.MarkedString=io={}));var dr;(function(p){function x(k){var _=k;return!!_&&I.objectLiteral(_)&&(ds.is(_.contents)||io.is(_.contents)||I.typedArray(_.contents,io.is))&&(k.range===void 0||a.is(k.range))}p.is=x})(dr||(e.Hover=dr={}));var Pc;(function(p){function x(k,_){return _?{label:k,documentation:_}:{label:k}}p.create=x})(Pc||(e.ParameterInformation=Pc={}));var Dc;(function(p){function x(k,_){for(var f=[],D=2;D<arguments.length;D++)f[D-2]=arguments[D];var $={label:k};return I.defined(_)&&($.documentation=_),I.defined(f)?$.parameters=f:$.parameters=[],$}p.create=x})(Dc||(e.SignatureInformation=Dc={}));var fs;(function(p){p.Text=1,p.Read=2,p.Write=3})(fs||(e.DocumentHighlightKind=fs={}));var Ic;(function(p){function x(k,_){var f={range:k};return I.number(_)&&(f.kind=_),f}p.create=x})(Ic||(e.DocumentHighlight=Ic={}));var so;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(so||(e.SymbolKind=so={}));var Mc;(function(p){p.Deprecated=1})(Mc||(e.SymbolTag=Mc={}));var ri;(function(p){function x(k,_,f,D,$){var ge={name:k,kind:_,location:{uri:D,range:f}};return $&&(ge.containerName=$),ge}p.create=x})(ri||(e.SymbolInformation=ri={}));var xi;(function(p){function x(k,_,f,D){return D!==void 0?{name:k,kind:_,location:{uri:f,range:D}}:{name:k,kind:_,location:{uri:f}}}p.create=x})(xi||(e.WorkspaceSymbol=xi={}));var Lc;(function(p){function x(_,f,D,$,ge,ft){var ze={name:_,detail:f,kind:D,range:$,selectionRange:ge};return ft!==void 0&&(ze.children=ft),ze}p.create=x;function k(_){var f=_;return f&&I.string(f.name)&&I.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||I.string(f.detail))&&(f.deprecated===void 0||I.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}p.is=k})(Lc||(e.DocumentSymbol=Lc={}));var Nc;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(Nc||(e.CodeActionKind=Nc={}));var Dr;(function(p){p.Invoked=1,p.Automatic=2})(Dr||(e.CodeActionTriggerKind=Dr={}));var Oa;(function(p){function x(_,f,D){var $={diagnostics:_};return f!=null&&($.only=f),D!=null&&($.triggerKind=D),$}p.create=x;function k(_){var f=_;return I.defined(f)&&I.typedArray(f.diagnostics,T.is)&&(f.only===void 0||I.typedArray(f.only,I.string))&&(f.triggerKind===void 0||f.triggerKind===Dr.Invoked||f.triggerKind===Dr.Automatic)}p.is=k})(Oa||(e.CodeActionContext=Oa={}));var Ra;(function(p){function x(_,f,D){var $={title:_},ge=!0;return typeof f=="string"?(ge=!1,$.kind=f):v.is(f)?$.command=f:$.edit=f,ge&&D!==void 0&&($.kind=D),$}p.create=x;function k(_){var f=_;return f&&I.string(f.title)&&(f.diagnostics===void 0||I.typedArray(f.diagnostics,T.is))&&(f.kind===void 0||I.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||v.is(f.command))&&(f.isPreferred===void 0||I.boolean(f.isPreferred))&&(f.edit===void 0||N.is(f.edit))}p.is=k})(Ra||(e.CodeAction=Ra={}));var oo;(function(p){function x(_,f){var D={range:_};return I.defined(f)&&(D.data=f),D}p.create=x;function k(_){var f=_;return I.defined(f)&&a.is(f.range)&&(I.undefined(f.command)||v.is(f.command))}p.is=k})(oo||(e.CodeLens=oo={}));var Pa;(function(p){function x(_,f){return{tabSize:_,insertSpaces:f}}p.create=x;function k(_){var f=_;return I.defined(f)&&I.uinteger(f.tabSize)&&I.boolean(f.insertSpaces)}p.is=k})(Pa||(e.FormattingOptions=Pa={}));var ii;(function(p){function x(_,f,D){return{range:_,target:f,data:D}}p.create=x;function k(_){var f=_;return I.defined(f)&&a.is(f.range)&&(I.undefined(f.target)||I.string(f.target))}p.is=k})(ii||(e.DocumentLink=ii={}));var E;(function(p){function x(_,f){return{range:_,parent:f}}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||p.is(f.parent))}p.is=k})(E||(e.SelectionRange=E={}));var F;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})(F||(e.SemanticTokenTypes=F={}));var G;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(G||(e.SemanticTokenModifiers=G={}));var Y;(function(p){function x(k){var _=k;return I.objectLiteral(_)&&(_.resultId===void 0||typeof _.resultId=="string")&&Array.isArray(_.data)&&(_.data.length===0||typeof _.data[0]=="number")}p.is=x})(Y||(e.SemanticTokens=Y={}));var Ue;(function(p){function x(_,f){return{range:_,text:f}}p.create=x;function k(_){var f=_;return f!=null&&a.is(f.range)&&I.string(f.text)}p.is=k})(Ue||(e.InlineValueText=Ue={}));var Ne;(function(p){function x(_,f,D){return{range:_,variableName:f,caseSensitiveLookup:D}}p.create=x;function k(_){var f=_;return f!=null&&a.is(f.range)&&I.boolean(f.caseSensitiveLookup)&&(I.string(f.variableName)||f.variableName===void 0)}p.is=k})(Ne||(e.InlineValueVariableLookup=Ne={}));var Ke;(function(p){function x(_,f){return{range:_,expression:f}}p.create=x;function k(_){var f=_;return f!=null&&a.is(f.range)&&(I.string(f.expression)||f.expression===void 0)}p.is=k})(Ke||(e.InlineValueEvaluatableExpression=Ke={}));var et;(function(p){function x(_,f){return{frameId:_,stoppedLocation:f}}p.create=x;function k(_){var f=_;return I.defined(f)&&a.is(_.stoppedLocation)}p.is=k})(et||(e.InlineValueContext=et={}));var we;(function(p){p.Type=1,p.Parameter=2;function x(k){return k===1||k===2}p.is=x})(we||(e.InlayHintKind=we={}));var He;(function(p){function x(_){return{value:_}}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&(f.tooltip===void 0||I.string(f.tooltip)||ds.is(f.tooltip))&&(f.location===void 0||u.is(f.location))&&(f.command===void 0||v.is(f.command))}p.is=k})(He||(e.InlayHintLabelPart=He={}));var De;(function(p){function x(_,f,D){var $={position:_,label:f};return D!==void 0&&($.kind=D),$}p.create=x;function k(_){var f=_;return I.objectLiteral(f)&&o.is(f.position)&&(I.string(f.label)||I.typedArray(f.label,He.is))&&(f.kind===void 0||we.is(f.kind))&&f.textEdits===void 0||I.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||I.string(f.tooltip)||ds.is(f.tooltip))&&(f.paddingLeft===void 0||I.boolean(f.paddingLeft))&&(f.paddingRight===void 0||I.boolean(f.paddingRight))}p.is=k})(De||(e.InlayHint=De={}));var dt;(function(p){function x(k){return{kind:"snippet",value:k}}p.createSnippet=x})(dt||(e.StringValue=dt={}));var Ft;(function(p){function x(k,_,f,D){return{insertText:k,filterText:_,range:f,command:D}}p.create=x})(Ft||(e.InlineCompletionItem=Ft={}));var On;(function(p){function x(k){return{items:k}}p.create=x})(On||(e.InlineCompletionList=On={}));var qc;(function(p){p.Invoked=0,p.Automatic=1})(qc||(e.InlineCompletionTriggerKind=qc={}));var OT;(function(p){function x(k,_){return{range:k,text:_}}p.create=x})(OT||(e.SelectedCompletionInfo=OT={}));var RT;(function(p){function x(k,_){return{triggerKind:k,selectedCompletionInfo:_}}p.create=x})(RT||(e.InlineCompletionContext=RT={}));var PT;(function(p){function x(k){var _=k;return I.objectLiteral(_)&&r.is(_.uri)&&I.string(_.name)}p.is=x})(PT||(e.WorkspaceFolder=PT={})),e.EOL=[`
|
31
|
+
`)),F){let Y=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";L.log(`Received response '${F.method} - (${E.id})' in ${Date.now()-F.timerStart}ms.${Y}`,G)}else L.log(`Received response ${E.id} without active response promise.`,G)}else si("receive-response",E)}function si(E,F){if(!L||T===Le.Off)return;let G={isLSPMessage:!0,type:E,message:F,timestamp:Date.now()};L.log(G)}function ki(){if(Fe())throw new yo(ja.Closed,"Connection is closed.");if(_n())throw new yo(ja.Disposed,"Connection is disposed.")}function Nc(){if(_t())throw new yo(ja.AlreadyListening,"Connection is already listening")}function qc(){if(!_t())throw new Error("Call listen() first.")}function Mr(E){return E===void 0?null:E}function Da(E){if(E!==null)return E}function Pa(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function uo(E,F){switch(E){case ue.ParameterStructures.auto:return Pa(F)?Da(F):[Mr(F)];case ue.ParameterStructures.byName:if(!Pa(F))throw new Error("Received parameters by name but param is not an object literal.");return Da(F);case ue.ParameterStructures.byPosition:return[Mr(F)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function Ia(E,F){let G,Y=E.numberOfParams;switch(Y){case 0:G=void 0;break;case 1:G=uo(E.parameterStructures,F[0]);break;default:G=[];for(let Ue=0;Ue<F.length&&Ue<Y;Ue++)G.push(Mr(F[Ue]));if(F.length<Y)for(let Ue=F.length;Ue<Y;Ue++)G.push(null);break}return G}let oi={sendNotification:(E,...F)=>{ki();let G,Y;if(ut.string(E)){G=E;let Ne=F[0],Ve=0,et=ue.ParameterStructures.auto;ue.ParameterStructures.is(Ne)&&(Ve=1,et=Ne);let we=F.length,He=we-Ve;switch(He){case 0:Y=void 0;break;case 1:Y=uo(et,F[Ve]);break;default:if(et===ue.ParameterStructures.byName)throw new Error(`Received ${He} parameters for 'by Name' notification parameter structure.`);Y=F.slice(Ve,we).map(Pe=>Mr(Pe));break}}else{let Ne=F;G=E.method,Y=Ia(E,Ne)}let Ue={jsonrpc:u,method:G,params:Y};return Ic(Ue),e.write(Ue).catch(Ne=>{throw i.error("Sending notification failed."),Ne})},onNotification:(E,F)=>{ki();let G;return ut.func(E)?h=E:F&&(ut.string(E)?(G=E,d.set(E,{type:void 0,handler:F})):(G=E.method,d.set(E.method,{type:E,handler:F}))),{dispose:()=>{G!==void 0?d.delete(G):h=void 0}}},onProgress:(E,F,G)=>{if(g.has(F))throw new Error(`Progress handler for token ${F} already registered`);return g.set(F,G),{dispose:()=>{g.delete(F)}}},sendProgress:(E,F,G)=>oi.sendNotification(qa.type,{token:F,value:G}),onUnhandledProgress:W.event,sendRequest:(E,...F)=>{ki(),qc();let G,Y,Ue;if(ut.string(E)){G=E;let we=F[0],He=F[F.length-1],Pe=0,dt=ue.ParameterStructures.auto;ue.ParameterStructures.is(we)&&(Pe=1,dt=we);let Ft=F.length;Mg.CancellationToken.is(He)&&(Ft=Ft-1,Ue=He);let On=Ft-Pe;switch(On){case 0:Y=void 0;break;case 1:Y=uo(dt,F[Pe]);break;default:if(dt===ue.ParameterStructures.byName)throw new Error(`Received ${On} parameters for 'by Name' request parameter structure.`);Y=F.slice(Pe,Ft).map(jc=>Mr(jc));break}}else{let we=F;G=E.method,Y=Ia(E,we);let He=E.numberOfParams;Ue=Mg.CancellationToken.is(we[He])?we[He]:void 0}let Ne=s++,Ve;Ue&&(Ve=Ue.onCancellationRequested(()=>{let we=M.sender.sendCancellation(oi,Ne);return we===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Ne}`),Promise.resolve()):we.catch(()=>{i.log(`Sending cancellation messages for id ${Ne} failed`)})}));let et={jsonrpc:u,id:Ne,method:G,params:Y};return Pc(et),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(et),new Promise(async(we,He)=>{let Pe=On=>{we(On),M.sender.cleanup(Ne),Ve?.dispose()},dt=On=>{He(On),M.sender.cleanup(Ne),Ve?.dispose()},Ft={method:G,timerStart:Date.now(),resolve:Pe,reject:dt};try{await e.write(et),C.set(Ne,Ft)}catch(On){throw i.error("Sending request failed."),Ft.reject(new ue.ResponseError(ue.ErrorCodes.MessageWriteError,On.message?On.message:"Unknown reason")),On}})},onRequest:(E,F)=>{ki();let G=null;return qg.is(E)?(G=void 0,c=E):ut.string(E)?(G=null,F!==void 0&&(G=E,l.set(E,{handler:F,type:void 0}))):F!==void 0&&(G=E.method,l.set(E.method,{type:E,handler:F})),{dispose:()=>{G!==null&&(G!==void 0?l.delete(G):c=void 0)}}},hasPendingResponse:()=>C.size>0,trace:async(E,F,G)=>{let Y=!1,Ue=Rn.Text;G!==void 0&&(ut.boolean(G)?Y=G:(Y=G.sendNotification||!1,Ue=G.traceFormat||Rn.Text)),T=E,v=Ue,T===Le.Off?L=void 0:L=F,Y&&!Fe()&&!_n()&&await oi.sendNotification(jg.type,{value:Le.toString(E)})},onError:B.event,onClose:ee.event,onUnhandledNotification:ie.event,onDispose:O.event,end:()=>{e.end()},dispose:()=>{if(_n())return;R=mr.Disposed,O.fire(void 0);let E=new ue.ResponseError(ue.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of C.values())F.reject(E);C=new Map,w=new Map,A=new Set,b=new ow.LinkedMap,ut.func(e.dispose)&&e.dispose(),ut.func(t.dispose)&&t.dispose()},listen:()=>{ki(),Nc(),R=mr.Listening,t.listen(Cc)},inspect:()=>{(0,sw.default)().console.log("inspect")}};return oi.onNotification(Jc.type,E=>{if(T===Le.Off||!L)return;let F=T===Le.Verbose||T===Le.Compact;L.log(E.message,F?E.verbose:void 0)}),oi.onNotification(qa.type,E=>{let F=g.get(E.token);F?F(E.value):W.fire(E)}),oi}me.createMessageConnection=FP});var rl=m(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.ProgressType=q.ProgressToken=q.createMessageConnection=q.NullLogger=q.ConnectionOptions=q.ConnectionStrategy=q.AbstractMessageBuffer=q.WriteableStreamMessageWriter=q.AbstractMessageWriter=q.MessageWriter=q.ReadableStreamMessageReader=q.AbstractMessageReader=q.MessageReader=q.SharedArrayReceiverStrategy=q.SharedArraySenderStrategy=q.CancellationToken=q.CancellationTokenSource=q.Emitter=q.Event=q.Disposable=q.LRUCache=q.Touch=q.LinkedMap=q.ParameterStructures=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.ErrorCodes=q.ResponseError=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType0=q.RequestType=q.Message=q.RAL=void 0;q.MessageStrategy=q.CancellationStrategy=q.CancellationSenderStrategy=q.CancellationReceiverStrategy=q.ConnectionError=q.ConnectionErrors=q.LogTraceNotification=q.SetTraceNotification=q.TraceFormat=q.TraceValues=q.Trace=void 0;var Ke=dg();Object.defineProperty(q,"Message",{enumerable:!0,get:function(){return Ke.Message}});Object.defineProperty(q,"RequestType",{enumerable:!0,get:function(){return Ke.RequestType}});Object.defineProperty(q,"RequestType0",{enumerable:!0,get:function(){return Ke.RequestType0}});Object.defineProperty(q,"RequestType1",{enumerable:!0,get:function(){return Ke.RequestType1}});Object.defineProperty(q,"RequestType2",{enumerable:!0,get:function(){return Ke.RequestType2}});Object.defineProperty(q,"RequestType3",{enumerable:!0,get:function(){return Ke.RequestType3}});Object.defineProperty(q,"RequestType4",{enumerable:!0,get:function(){return Ke.RequestType4}});Object.defineProperty(q,"RequestType5",{enumerable:!0,get:function(){return Ke.RequestType5}});Object.defineProperty(q,"RequestType6",{enumerable:!0,get:function(){return Ke.RequestType6}});Object.defineProperty(q,"RequestType7",{enumerable:!0,get:function(){return Ke.RequestType7}});Object.defineProperty(q,"RequestType8",{enumerable:!0,get:function(){return Ke.RequestType8}});Object.defineProperty(q,"RequestType9",{enumerable:!0,get:function(){return Ke.RequestType9}});Object.defineProperty(q,"ResponseError",{enumerable:!0,get:function(){return Ke.ResponseError}});Object.defineProperty(q,"ErrorCodes",{enumerable:!0,get:function(){return Ke.ErrorCodes}});Object.defineProperty(q,"NotificationType",{enumerable:!0,get:function(){return Ke.NotificationType}});Object.defineProperty(q,"NotificationType0",{enumerable:!0,get:function(){return Ke.NotificationType0}});Object.defineProperty(q,"NotificationType1",{enumerable:!0,get:function(){return Ke.NotificationType1}});Object.defineProperty(q,"NotificationType2",{enumerable:!0,get:function(){return Ke.NotificationType2}});Object.defineProperty(q,"NotificationType3",{enumerable:!0,get:function(){return Ke.NotificationType3}});Object.defineProperty(q,"NotificationType4",{enumerable:!0,get:function(){return Ke.NotificationType4}});Object.defineProperty(q,"NotificationType5",{enumerable:!0,get:function(){return Ke.NotificationType5}});Object.defineProperty(q,"NotificationType6",{enumerable:!0,get:function(){return Ke.NotificationType6}});Object.defineProperty(q,"NotificationType7",{enumerable:!0,get:function(){return Ke.NotificationType7}});Object.defineProperty(q,"NotificationType8",{enumerable:!0,get:function(){return Ke.NotificationType8}});Object.defineProperty(q,"NotificationType9",{enumerable:!0,get:function(){return Ke.NotificationType9}});Object.defineProperty(q,"ParameterStructures",{enumerable:!0,get:function(){return Ke.ParameterStructures}});var Bg=pg();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return Bg.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return Bg.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return Bg.Touch}});var $P=VT();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return $P.Disposable}});var lw=fo();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return lw.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return lw.Emitter}});var hw=zc();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return hw.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return hw.CancellationToken}});var dw=YT();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return dw.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return dw.SharedArrayReceiverStrategy}});var Wg=QT();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return Wg.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return Wg.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Wg.ReadableStreamMessageReader}});var Ug=rw();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return Ug.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return Ug.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Ug.WriteableStreamMessageWriter}});var BP=iw();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return BP.AbstractMessageBuffer}});var Kt=cw();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return Kt.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return Kt.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return Kt.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return Kt.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return Kt.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return Kt.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return Kt.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return Kt.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return Kt.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return Kt.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return Kt.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return Kt.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return Kt.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Kt.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Kt.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return Kt.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return Kt.MessageStrategy}});var WP=Oi();q.RAL=WP.default});var gw=m(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});var fw=require("util"),ui=rl(),il=class t extends ui.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new fw.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};il.emptyBuffer=Buffer.allocUnsafe(0);var Hg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ui.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ui.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ui.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ui.Disposable.create(()=>this.stream.off("data",e))}},Gg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ui.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ui.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ui.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},pw=Object.freeze({messageBuffer:Object.freeze({create:t=>new il(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new fw.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Hg(t),asWritableStream:t=>new Gg(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function zg(){return pw}(function(t){function e(){ui.RAL.install(pw)}t.install=e})(zg||(zg={}));Kg.default=zg});var _s=m(ke=>{"use strict";var UP=ke&&ke.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),HP=ke&&ke.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&UP(e,t,n)};Object.defineProperty(ke,"__esModule",{value:!0});ke.createMessageConnection=ke.createServerSocketTransport=ke.createClientSocketTransport=ke.createServerPipeTransport=ke.createClientPipeTransport=ke.generateRandomPipeName=ke.StreamMessageWriter=ke.StreamMessageReader=ke.SocketMessageWriter=ke.SocketMessageReader=ke.PortMessageWriter=ke.PortMessageReader=ke.IPCMessageWriter=ke.IPCMessageReader=void 0;var bo=gw();bo.default.install();var mw=require("path"),GP=require("os"),zP=require("crypto"),al=require("net"),Dn=rl();HP(rl(),ke);var Vg=class extends Dn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Dn.Disposable.create(()=>this.process.off("message",e))}};ke.IPCMessageReader=Vg;var Xg=class extends Dn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};ke.IPCMessageWriter=Xg;var Yg=class extends Dn.AbstractMessageReader{constructor(e){super(),this.onData=new Dn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};ke.PortMessageReader=Yg;var Jg=class extends Dn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};ke.PortMessageWriter=Jg;var ys=class extends Dn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,bo.default)().stream.asReadableStream(e),n)}};ke.SocketMessageReader=ys;var bs=class extends Dn.WriteableStreamMessageWriter{constructor(e,n){super((0,bo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ke.SocketMessageWriter=bs;var sl=class extends Dn.ReadableStreamMessageReader{constructor(e,n){super((0,bo.default)().stream.asReadableStream(e),n)}};ke.StreamMessageReader=sl;var ol=class extends Dn.WriteableStreamMessageWriter{constructor(e,n){super((0,bo.default)().stream.asWritableStream(e),n)}};ke.StreamMessageWriter=ol;var yw=process.env.XDG_RUNTIME_DIR,KP=new Map([["linux",107],["darwin",103]]);function VP(){let t=(0,zP.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;yw?e=mw.join(yw,`vscode-ipc-${t}.sock`):e=mw.join(GP.tmpdir(),`vscode-${t}.sock`);let n=KP.get(process.platform);return n!==void 0&&e.length>n&&(0,bo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}ke.generateRandomPipeName=VP;function XP(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,al.createServer)(a=>{o.close(),n([new ys(a,e),new bs(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}ke.createClientPipeTransport=XP;function YP(t,e="utf-8"){let n=(0,al.createConnection)(t);return[new ys(n,e),new bs(n,e)]}ke.createServerPipeTransport=YP;function JP(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,al.createServer)(a=>{o.close(),n([new ys(a,e),new bs(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}ke.createClientSocketTransport=JP;function QP(t,e="utf-8"){let n=(0,al.createConnection)(t,"127.0.0.1");return[new ys(n,e),new bs(n,e)]}ke.createServerSocketTransport=QP;function ZP(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function eI(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function tI(t,e,n,r){n||(n=Dn.NullLogger);let i=ZP(t)?new sl(t):t,s=eI(e)?new ol(e):e;return Dn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Dn.createMessageConnection)(i,s,n,r)}ke.createMessageConnection=tI});var Qg=m((_G,bw)=>{"use strict";bw.exports=_s()});var cl=m((_w,ul)=>{(function(t){if(typeof ul=="object"&&typeof ul.exports=="object"){var e=t(require,_w);e!==void 0&&(ul.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var n;(function(p){function x(k){return typeof k=="string"}p.is=x})(n||(e.DocumentUri=n={}));var r;(function(p){function x(k){return typeof k=="string"}p.is=x})(r||(e.URI=r={}));var i;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function x(k){return typeof k=="number"&&p.MIN_VALUE<=k&&k<=p.MAX_VALUE}p.is=x})(i||(e.integer=i={}));var s;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function x(k){return typeof k=="number"&&p.MIN_VALUE<=k&&k<=p.MAX_VALUE}p.is=x})(s||(e.uinteger=s={}));var o;(function(p){function x(y,f){return y===Number.MAX_VALUE&&(y=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:y,character:f}}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&I.uinteger(f.line)&&I.uinteger(f.character)}p.is=k})(o||(e.Position=o={}));var a;(function(p){function x(y,f,P,$){if(I.uinteger(y)&&I.uinteger(f)&&I.uinteger(P)&&I.uinteger($))return{start:o.create(y,f),end:o.create(P,$)};if(o.is(y)&&o.is(f))return{start:y,end:f};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(f,", ").concat(P,", ").concat($,"]"))}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}p.is=k})(a||(e.Range=a={}));var u;(function(p){function x(y,f){return{uri:y,range:f}}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&a.is(f.range)&&(I.string(f.uri)||I.undefined(f.uri))}p.is=k})(u||(e.Location=u={}));var c;(function(p){function x(y,f,P,$){return{targetUri:y,targetRange:f,targetSelectionRange:P,originSelectionRange:$}}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&a.is(f.targetRange)&&I.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||I.undefined(f.originSelectionRange))}p.is=k})(c||(e.LocationLink=c={}));var l;(function(p){function x(y,f,P,$){return{red:y,green:f,blue:P,alpha:$}}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&I.numberRange(f.red,0,1)&&I.numberRange(f.green,0,1)&&I.numberRange(f.blue,0,1)&&I.numberRange(f.alpha,0,1)}p.is=k})(l||(e.Color=l={}));var h;(function(p){function x(y,f){return{range:y,color:f}}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&a.is(f.range)&&l.is(f.color)}p.is=k})(h||(e.ColorInformation=h={}));var d;(function(p){function x(y,f,P){return{label:y,textEdit:f,additionalTextEdits:P}}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&I.string(f.label)&&(I.undefined(f.textEdit)||L.is(f))&&(I.undefined(f.additionalTextEdits)||I.typedArray(f.additionalTextEdits,L.is))}p.is=k})(d||(e.ColorPresentation=d={}));var g;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(g||(e.FoldingRangeKind=g={}));var _;(function(p){function x(y,f,P,$,ge,ft){var ze={startLine:y,endLine:f};return I.defined(P)&&(ze.startCharacter=P),I.defined($)&&(ze.endCharacter=$),I.defined(ge)&&(ze.kind=ge),I.defined(ft)&&(ze.collapsedText=ft),ze}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&I.uinteger(f.startLine)&&I.uinteger(f.startLine)&&(I.undefined(f.startCharacter)||I.uinteger(f.startCharacter))&&(I.undefined(f.endCharacter)||I.uinteger(f.endCharacter))&&(I.undefined(f.kind)||I.string(f.kind))}p.is=k})(_||(e.FoldingRange=_={}));var b;(function(p){function x(y,f){return{location:y,message:f}}p.create=x;function k(y){var f=y;return I.defined(f)&&u.is(f.location)&&I.string(f.message)}p.is=k})(b||(e.DiagnosticRelatedInformation=b={}));var C;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(C||(e.DiagnosticSeverity=C={}));var A;(function(p){p.Unnecessary=1,p.Deprecated=2})(A||(e.DiagnosticTag=A={}));var w;(function(p){function x(k){var y=k;return I.objectLiteral(y)&&I.string(y.href)}p.is=x})(w||(e.CodeDescription=w={}));var T;(function(p){function x(y,f,P,$,ge,ft){var ze={range:y,message:f};return I.defined(P)&&(ze.severity=P),I.defined($)&&(ze.code=$),I.defined(ge)&&(ze.source=ge),I.defined(ft)&&(ze.relatedInformation=ft),ze}p.create=x;function k(y){var f,P=y;return I.defined(P)&&a.is(P.range)&&I.string(P.message)&&(I.number(P.severity)||I.undefined(P.severity))&&(I.integer(P.code)||I.string(P.code)||I.undefined(P.code))&&(I.undefined(P.codeDescription)||I.string((f=P.codeDescription)===null||f===void 0?void 0:f.href))&&(I.string(P.source)||I.undefined(P.source))&&(I.undefined(P.relatedInformation)||I.typedArray(P.relatedInformation,b.is))}p.is=k})(T||(e.Diagnostic=T={}));var v;(function(p){function x(y,f){for(var P=[],$=2;$<arguments.length;$++)P[$-2]=arguments[$];var ge={title:y,command:f};return I.defined(P)&&P.length>0&&(ge.arguments=P),ge}p.create=x;function k(y){var f=y;return I.defined(f)&&I.string(f.title)&&I.string(f.command)}p.is=k})(v||(e.Command=v={}));var L;(function(p){function x(P,$){return{range:P,newText:$}}p.replace=x;function k(P,$){return{range:{start:P,end:P},newText:$}}p.insert=k;function y(P){return{range:P,newText:""}}p.del=y;function f(P){var $=P;return I.objectLiteral($)&&I.string($.newText)&&a.is($.range)}p.is=f})(L||(e.TextEdit=L={}));var R;(function(p){function x(y,f,P){var $={label:y};return f!==void 0&&($.needsConfirmation=f),P!==void 0&&($.description=P),$}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&I.string(f.label)&&(I.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(I.string(f.description)||f.description===void 0)}p.is=k})(R||(e.ChangeAnnotation=R={}));var B;(function(p){function x(k){var y=k;return I.string(y)}p.is=x})(B||(e.ChangeAnnotationIdentifier=B={}));var ee;(function(p){function x(P,$,ge){return{range:P,newText:$,annotationId:ge}}p.replace=x;function k(P,$,ge){return{range:{start:P,end:P},newText:$,annotationId:ge}}p.insert=k;function y(P,$){return{range:P,newText:"",annotationId:$}}p.del=y;function f(P){var $=P;return L.is($)&&(R.is($.annotationId)||B.is($.annotationId))}p.is=f})(ee||(e.AnnotatedTextEdit=ee={}));var ie;(function(p){function x(y,f){return{textDocument:y,edits:f}}p.create=x;function k(y){var f=y;return I.defined(f)&&Fe.is(f.textDocument)&&Array.isArray(f.edits)}p.is=k})(ie||(e.TextDocumentEdit=ie={}));var W;(function(p){function x(y,f,P){var $={kind:"create",uri:y};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&($.options=f),P!==void 0&&($.annotationId=P),$}p.create=x;function k(y){var f=y;return f&&f.kind==="create"&&I.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||I.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||I.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||B.is(f.annotationId))}p.is=k})(W||(e.CreateFile=W={}));var O;(function(p){function x(y,f,P,$){var ge={kind:"rename",oldUri:y,newUri:f};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(ge.options=P),$!==void 0&&(ge.annotationId=$),ge}p.create=x;function k(y){var f=y;return f&&f.kind==="rename"&&I.string(f.oldUri)&&I.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||I.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||I.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||B.is(f.annotationId))}p.is=k})(O||(e.RenameFile=O={}));var M;(function(p){function x(y,f,P){var $={kind:"delete",uri:y};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&($.options=f),P!==void 0&&($.annotationId=P),$}p.create=x;function k(y){var f=y;return f&&f.kind==="delete"&&I.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||I.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||I.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||B.is(f.annotationId))}p.is=k})(M||(e.DeleteFile=M={}));var N;(function(p){function x(k){var y=k;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(f){return I.string(f.kind)?W.is(f)||O.is(f)||M.is(f):ie.is(f)}))}p.is=x})(N||(e.WorkspaceEdit=N={}));var j=function(){function p(x,k){this.edits=x,this.changeAnnotations=k}return p.prototype.insert=function(x,k,y){var f,P;if(y===void 0?f=L.insert(x,k):B.is(y)?(P=y,f=ee.insert(x,k,y)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(y),f=ee.insert(x,k,P)),this.edits.push(f),P!==void 0)return P},p.prototype.replace=function(x,k,y){var f,P;if(y===void 0?f=L.replace(x,k):B.is(y)?(P=y,f=ee.replace(x,k,y)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(y),f=ee.replace(x,k,P)),this.edits.push(f),P!==void 0)return P},p.prototype.delete=function(x,k){var y,f;if(k===void 0?y=L.del(x):B.is(k)?(f=k,y=ee.del(x,k)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(k),y=ee.del(x,f)),this.edits.push(y),f!==void 0)return f},p.prototype.add=function(x){this.edits.push(x)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),de=function(){function p(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(x,k){var y;if(B.is(x)?y=x:(y=this.nextId(),k=x),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(k===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=k,this._size++,y},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),ce=function(){function p(x){var k=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new de(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(y){if(ie.is(y)){var f=new j(y.edits,k._changeAnnotations);k._textEditChanges[y.textDocument.uri]=f}})):x.changes&&Object.keys(x.changes).forEach(function(y){var f=new j(x.changes[y]);k._textEditChanges[y]=f})):this._workspaceEdit={}}return Object.defineProperty(p.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),p.prototype.getTextEditChange=function(x){if(Fe.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var k={uri:x.uri,version:x.version},y=this._textEditChanges[k.uri];if(!y){var f=[],P={textDocument:k,edits:f};this._workspaceEdit.documentChanges.push(P),y=new j(f,this._changeAnnotations),this._textEditChanges[k.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[x];if(!y){var f=[];this._workspaceEdit.changes[x]=f,y=new j(f),this._textEditChanges[x]=y}return y}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new de,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(x,k,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;R.is(k)||B.is(k)?f=k:y=k;var P,$;if(f===void 0?P=W.create(x,y):($=B.is(f)?f:this._changeAnnotations.manage(f),P=W.create(x,y,$)),this._workspaceEdit.documentChanges.push(P),$!==void 0)return $},p.prototype.renameFile=function(x,k,y,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;R.is(y)||B.is(y)?P=y:f=y;var $,ge;if(P===void 0?$=O.create(x,k,f):(ge=B.is(P)?P:this._changeAnnotations.manage(P),$=O.create(x,k,f,ge)),this._workspaceEdit.documentChanges.push($),ge!==void 0)return ge},p.prototype.deleteFile=function(x,k,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;R.is(k)||B.is(k)?f=k:y=k;var P,$;if(f===void 0?P=M.create(x,y):($=B.is(f)?f:this._changeAnnotations.manage(f),P=M.create(x,y,$)),this._workspaceEdit.documentChanges.push(P),$!==void 0)return $},p}();e.WorkspaceChange=ce;var jt;(function(p){function x(y){return{uri:y}}p.create=x;function k(y){var f=y;return I.defined(f)&&I.string(f.uri)}p.is=k})(jt||(e.TextDocumentIdentifier=jt={}));var _t;(function(p){function x(y,f){return{uri:y,version:f}}p.create=x;function k(y){var f=y;return I.defined(f)&&I.string(f.uri)&&I.integer(f.version)}p.is=k})(_t||(e.VersionedTextDocumentIdentifier=_t={}));var Fe;(function(p){function x(y,f){return{uri:y,version:f}}p.create=x;function k(y){var f=y;return I.defined(f)&&I.string(f.uri)&&(f.version===null||I.integer(f.version))}p.is=k})(Fe||(e.OptionalVersionedTextDocumentIdentifier=Fe={}));var _n;(function(p){function x(y,f,P,$){return{uri:y,languageId:f,version:P,text:$}}p.create=x;function k(y){var f=y;return I.defined(f)&&I.string(f.uri)&&I.string(f.languageId)&&I.integer(f.version)&&I.string(f.text)}p.is=k})(_n||(e.TextDocumentItem=_n={}));var so;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function x(k){var y=k;return y===p.PlainText||y===p.Markdown}p.is=x})(so||(e.MarkupKind=so={}));var ps;(function(p){function x(k){var y=k;return I.objectLiteral(k)&&so.is(y.kind)&&I.string(y.value)}p.is=x})(ps||(e.MarkupContent=ps={}));var Ac;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(Ac||(e.CompletionItemKind=Ac={}));var Oa;(function(p){p.PlainText=1,p.Snippet=2})(Oa||(e.InsertTextFormat=Oa={}));var Ra;(function(p){p.Deprecated=1})(Ra||(e.CompletionItemTag=Ra={}));var kc;(function(p){function x(y,f,P){return{newText:y,insert:f,replace:P}}p.create=x;function k(y){var f=y;return f&&I.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}p.is=k})(kc||(e.InsertReplaceEdit=kc={}));var Cc;(function(p){p.asIs=1,p.adjustIndentation=2})(Cc||(e.InsertTextMode=Cc={}));var Oc;(function(p){function x(k){var y=k;return y&&(I.string(y.detail)||y.detail===void 0)&&(I.string(y.description)||y.description===void 0)}p.is=x})(Oc||(e.CompletionItemLabelDetails=Oc={}));var Rc;(function(p){function x(k){return{label:k}}p.create=x})(Rc||(e.CompletionItem=Rc={}));var Dc;(function(p){function x(k,y){return{items:k||[],isIncomplete:!!y}}p.create=x})(Dc||(e.CompletionList=Dc={}));var oo;(function(p){function x(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=x;function k(y){var f=y;return I.string(f)||I.objectLiteral(f)&&I.string(f.language)&&I.string(f.value)}p.is=k})(oo||(e.MarkedString=oo={}));var fr;(function(p){function x(k){var y=k;return!!y&&I.objectLiteral(y)&&(ps.is(y.contents)||oo.is(y.contents)||I.typedArray(y.contents,oo.is))&&(k.range===void 0||a.is(k.range))}p.is=x})(fr||(e.Hover=fr={}));var Pc;(function(p){function x(k,y){return y?{label:k,documentation:y}:{label:k}}p.create=x})(Pc||(e.ParameterInformation=Pc={}));var Ic;(function(p){function x(k,y){for(var f=[],P=2;P<arguments.length;P++)f[P-2]=arguments[P];var $={label:k};return I.defined(y)&&($.documentation=y),I.defined(f)?$.parameters=f:$.parameters=[],$}p.create=x})(Ic||(e.SignatureInformation=Ic={}));var gs;(function(p){p.Text=1,p.Read=2,p.Write=3})(gs||(e.DocumentHighlightKind=gs={}));var Mc;(function(p){function x(k,y){var f={range:k};return I.number(y)&&(f.kind=y),f}p.create=x})(Mc||(e.DocumentHighlight=Mc={}));var ao;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(ao||(e.SymbolKind=ao={}));var Lc;(function(p){p.Deprecated=1})(Lc||(e.SymbolTag=Lc={}));var si;(function(p){function x(k,y,f,P,$){var ge={name:k,kind:y,location:{uri:P,range:f}};return $&&(ge.containerName=$),ge}p.create=x})(si||(e.SymbolInformation=si={}));var ki;(function(p){function x(k,y,f,P){return P!==void 0?{name:k,kind:y,location:{uri:f,range:P}}:{name:k,kind:y,location:{uri:f}}}p.create=x})(ki||(e.WorkspaceSymbol=ki={}));var Nc;(function(p){function x(y,f,P,$,ge,ft){var ze={name:y,detail:f,kind:P,range:$,selectionRange:ge};return ft!==void 0&&(ze.children=ft),ze}p.create=x;function k(y){var f=y;return f&&I.string(f.name)&&I.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||I.string(f.detail))&&(f.deprecated===void 0||I.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}p.is=k})(Nc||(e.DocumentSymbol=Nc={}));var qc;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(qc||(e.CodeActionKind=qc={}));var Mr;(function(p){p.Invoked=1,p.Automatic=2})(Mr||(e.CodeActionTriggerKind=Mr={}));var Da;(function(p){function x(y,f,P){var $={diagnostics:y};return f!=null&&($.only=f),P!=null&&($.triggerKind=P),$}p.create=x;function k(y){var f=y;return I.defined(f)&&I.typedArray(f.diagnostics,T.is)&&(f.only===void 0||I.typedArray(f.only,I.string))&&(f.triggerKind===void 0||f.triggerKind===Mr.Invoked||f.triggerKind===Mr.Automatic)}p.is=k})(Da||(e.CodeActionContext=Da={}));var Pa;(function(p){function x(y,f,P){var $={title:y},ge=!0;return typeof f=="string"?(ge=!1,$.kind=f):v.is(f)?$.command=f:$.edit=f,ge&&P!==void 0&&($.kind=P),$}p.create=x;function k(y){var f=y;return f&&I.string(f.title)&&(f.diagnostics===void 0||I.typedArray(f.diagnostics,T.is))&&(f.kind===void 0||I.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||v.is(f.command))&&(f.isPreferred===void 0||I.boolean(f.isPreferred))&&(f.edit===void 0||N.is(f.edit))}p.is=k})(Pa||(e.CodeAction=Pa={}));var uo;(function(p){function x(y,f){var P={range:y};return I.defined(f)&&(P.data=f),P}p.create=x;function k(y){var f=y;return I.defined(f)&&a.is(f.range)&&(I.undefined(f.command)||v.is(f.command))}p.is=k})(uo||(e.CodeLens=uo={}));var Ia;(function(p){function x(y,f){return{tabSize:y,insertSpaces:f}}p.create=x;function k(y){var f=y;return I.defined(f)&&I.uinteger(f.tabSize)&&I.boolean(f.insertSpaces)}p.is=k})(Ia||(e.FormattingOptions=Ia={}));var oi;(function(p){function x(y,f,P){return{range:y,target:f,data:P}}p.create=x;function k(y){var f=y;return I.defined(f)&&a.is(f.range)&&(I.undefined(f.target)||I.string(f.target))}p.is=k})(oi||(e.DocumentLink=oi={}));var E;(function(p){function x(y,f){return{range:y,parent:f}}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||p.is(f.parent))}p.is=k})(E||(e.SelectionRange=E={}));var F;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})(F||(e.SemanticTokenTypes=F={}));var G;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(G||(e.SemanticTokenModifiers=G={}));var Y;(function(p){function x(k){var y=k;return I.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}p.is=x})(Y||(e.SemanticTokens=Y={}));var Ue;(function(p){function x(y,f){return{range:y,text:f}}p.create=x;function k(y){var f=y;return f!=null&&a.is(f.range)&&I.string(f.text)}p.is=k})(Ue||(e.InlineValueText=Ue={}));var Ne;(function(p){function x(y,f,P){return{range:y,variableName:f,caseSensitiveLookup:P}}p.create=x;function k(y){var f=y;return f!=null&&a.is(f.range)&&I.boolean(f.caseSensitiveLookup)&&(I.string(f.variableName)||f.variableName===void 0)}p.is=k})(Ne||(e.InlineValueVariableLookup=Ne={}));var Ve;(function(p){function x(y,f){return{range:y,expression:f}}p.create=x;function k(y){var f=y;return f!=null&&a.is(f.range)&&(I.string(f.expression)||f.expression===void 0)}p.is=k})(Ve||(e.InlineValueEvaluatableExpression=Ve={}));var et;(function(p){function x(y,f){return{frameId:y,stoppedLocation:f}}p.create=x;function k(y){var f=y;return I.defined(f)&&a.is(y.stoppedLocation)}p.is=k})(et||(e.InlineValueContext=et={}));var we;(function(p){p.Type=1,p.Parameter=2;function x(k){return k===1||k===2}p.is=x})(we||(e.InlayHintKind=we={}));var He;(function(p){function x(y){return{value:y}}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&(f.tooltip===void 0||I.string(f.tooltip)||ps.is(f.tooltip))&&(f.location===void 0||u.is(f.location))&&(f.command===void 0||v.is(f.command))}p.is=k})(He||(e.InlayHintLabelPart=He={}));var Pe;(function(p){function x(y,f,P){var $={position:y,label:f};return P!==void 0&&($.kind=P),$}p.create=x;function k(y){var f=y;return I.objectLiteral(f)&&o.is(f.position)&&(I.string(f.label)||I.typedArray(f.label,He.is))&&(f.kind===void 0||we.is(f.kind))&&f.textEdits===void 0||I.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||I.string(f.tooltip)||ps.is(f.tooltip))&&(f.paddingLeft===void 0||I.boolean(f.paddingLeft))&&(f.paddingRight===void 0||I.boolean(f.paddingRight))}p.is=k})(Pe||(e.InlayHint=Pe={}));var dt;(function(p){function x(k){return{kind:"snippet",value:k}}p.createSnippet=x})(dt||(e.StringValue=dt={}));var Ft;(function(p){function x(k,y,f,P){return{insertText:k,filterText:y,range:f,command:P}}p.create=x})(Ft||(e.InlineCompletionItem=Ft={}));var On;(function(p){function x(k){return{items:k}}p.create=x})(On||(e.InlineCompletionList=On={}));var jc;(function(p){p.Invoked=0,p.Automatic=1})(jc||(e.InlineCompletionTriggerKind=jc={}));var LT;(function(p){function x(k,y){return{range:k,text:y}}p.create=x})(LT||(e.SelectedCompletionInfo=LT={}));var NT;(function(p){function x(k,y){return{triggerKind:k,selectedCompletionInfo:y}}p.create=x})(NT||(e.InlineCompletionContext=NT={}));var qT;(function(p){function x(k){var y=k;return I.objectLiteral(y)&&r.is(y.uri)&&I.string(y.name)}p.is=x})(qT||(e.WorkspaceFolder=qT={})),e.EOL=[`
|
32
32
|
`,`\r
|
33
|
-
`,"\r"];var
|
34
|
-
`,
|
35
|
-
`&&f++}_&&k.length>0&&x.push(k.length),this._lineOffsets=x}return this._lineOffsets},p.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var k=this.getLineOffsets(),_=0,f=k.length;if(f===0)return o.create(0,x);for(;_<f;){var D=Math.floor((_+f)/2);k[D]>x?f=D:_=D+1}var $=_-1;return o.create($,x-k[$])},p.prototype.offsetAt=function(x){var k=this.getLineOffsets();if(x.line>=k.length)return this._content.length;if(x.line<0)return 0;var _=k[x.line],f=x.line+1<k.length?k[x.line+1]:this._content.length;return Math.max(Math.min(_+x.character,f),_)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),I;(function(p){var x=Object.prototype.toString;function k(Ae){return typeof Ae<"u"}p.defined=k;function _(Ae){return typeof Ae>"u"}p.undefined=_;function f(Ae){return Ae===!0||Ae===!1}p.boolean=f;function D(Ae){return x.call(Ae)==="[object String]"}p.string=D;function $(Ae){return x.call(Ae)==="[object Number]"}p.number=$;function ge(Ae,ao,jc){return x.call(Ae)==="[object Number]"&&ao<=Ae&&Ae<=jc}p.numberRange=ge;function ft(Ae){return x.call(Ae)==="[object Number]"&&-2147483648<=Ae&&Ae<=2147483647}p.integer=ft;function ze(Ae){return x.call(Ae)==="[object Number]"&&0<=Ae&&Ae<=2147483647}p.uinteger=ze;function fr(Ae){return x.call(Ae)==="[object Function]"}p.func=fr;function pr(Ae){return Ae!==null&&typeof Ae=="object"}p.objectLiteral=pr;function si(Ae,ao){return Array.isArray(Ae)&&Ae.every(ao)}p.typedArray=si})(I||(I={}))})});var tt=m(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ProtocolNotificationType=vn.ProtocolNotificationType0=vn.ProtocolRequestType=vn.ProtocolRequestType0=vn.RegistrationType=vn.MessageDirection=void 0;var yo=ys(),pw;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(pw||(vn.MessageDirection=pw={}));var Kg=class{constructor(e){this.method=e}};vn.RegistrationType=Kg;var Xg=class extends yo.RequestType0{constructor(e){super(e)}};vn.ProtocolRequestType0=Xg;var Yg=class extends yo.RequestType{constructor(e){super(e,yo.ParameterStructures.byName)}};vn.ProtocolRequestType=Yg;var Jg=class extends yo.NotificationType0{constructor(e){super(e)}};vn.ProtocolNotificationType0=Jg;var Qg=class extends yo.NotificationType{constructor(e){super(e,yo.ParameterStructures.byName)}};vn.ProtocolNotificationType=Qg});var cl=m(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.objectLiteral=Ct.typedArray=Ct.stringArray=Ct.array=Ct.func=Ct.error=Ct.number=Ct.string=Ct.boolean=void 0;function $D(t){return t===!0||t===!1}Ct.boolean=$D;function gw(t){return typeof t=="string"||t instanceof String}Ct.string=gw;function BD(t){return typeof t=="number"||t instanceof Number}Ct.number=BD;function WD(t){return t instanceof Error}Ct.error=WD;function UD(t){return typeof t=="function"}Ct.func=UD;function mw(t){return Array.isArray(t)}Ct.array=mw;function HD(t){return mw(t)&&t.every(e=>gw(e))}Ct.stringArray=HD;function GD(t,e){return Array.isArray(t)&&t.every(e)}Ct.typedArray=GD;function zD(t){return t!==null&&typeof t=="object"}Ct.objectLiteral=zD});var _w=m(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.ImplementationRequest=void 0;var yw=tt(),bw;(function(t){t.method="textDocument/implementation",t.messageDirection=yw.MessageDirection.clientToServer,t.type=new yw.ProtocolRequestType(t.method)})(bw||(ll.ImplementationRequest=bw={}))});var Tw=m(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.TypeDefinitionRequest=void 0;var vw=tt(),Sw;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=vw.MessageDirection.clientToServer,t.type=new vw.ProtocolRequestType(t.method)})(Sw||(hl.TypeDefinitionRequest=Sw={}))});var xw=m(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.DidChangeWorkspaceFoldersNotification=bo.WorkspaceFoldersRequest=void 0;var dl=tt(),ww;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=dl.MessageDirection.serverToClient,t.type=new dl.ProtocolRequestType0(t.method)})(ww||(bo.WorkspaceFoldersRequest=ww={}));var Ew;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=dl.MessageDirection.clientToServer,t.type=new dl.ProtocolNotificationType(t.method)})(Ew||(bo.DidChangeWorkspaceFoldersNotification=Ew={}))});var Cw=m(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.ConfigurationRequest=void 0;var Aw=tt(),kw;(function(t){t.method="workspace/configuration",t.messageDirection=Aw.MessageDirection.serverToClient,t.type=new Aw.ProtocolRequestType(t.method)})(kw||(fl.ConfigurationRequest=kw={}))});var Pw=m(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.ColorPresentationRequest=_o.DocumentColorRequest=void 0;var pl=tt(),Ow;(function(t){t.method="textDocument/documentColor",t.messageDirection=pl.MessageDirection.clientToServer,t.type=new pl.ProtocolRequestType(t.method)})(Ow||(_o.DocumentColorRequest=Ow={}));var Rw;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=pl.MessageDirection.clientToServer,t.type=new pl.ProtocolRequestType(t.method)})(Rw||(_o.ColorPresentationRequest=Rw={}))});var Mw=m(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.FoldingRangeRefreshRequest=vo.FoldingRangeRequest=void 0;var gl=tt(),Dw;(function(t){t.method="textDocument/foldingRange",t.messageDirection=gl.MessageDirection.clientToServer,t.type=new gl.ProtocolRequestType(t.method)})(Dw||(vo.FoldingRangeRequest=Dw={}));var Iw;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=gl.MessageDirection.serverToClient,t.type=new gl.ProtocolRequestType0(t.method)})(Iw||(vo.FoldingRangeRefreshRequest=Iw={}))});var qw=m(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});ml.DeclarationRequest=void 0;var Lw=tt(),Nw;(function(t){t.method="textDocument/declaration",t.messageDirection=Lw.MessageDirection.clientToServer,t.type=new Lw.ProtocolRequestType(t.method)})(Nw||(ml.DeclarationRequest=Nw={}))});var $w=m(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.SelectionRangeRequest=void 0;var jw=tt(),Fw;(function(t){t.method="textDocument/selectionRange",t.messageDirection=jw.MessageDirection.clientToServer,t.type=new jw.ProtocolRequestType(t.method)})(Fw||(yl.SelectionRangeRequest=Fw={}))});var Hw=m(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.WorkDoneProgressCancelNotification=Ri.WorkDoneProgressCreateRequest=Ri.WorkDoneProgress=void 0;var VD=ys(),bl=tt(),Bw;(function(t){t.type=new VD.ProgressType;function e(n){return n===t.type}t.is=e})(Bw||(Ri.WorkDoneProgress=Bw={}));var Ww;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=bl.MessageDirection.serverToClient,t.type=new bl.ProtocolRequestType(t.method)})(Ww||(Ri.WorkDoneProgressCreateRequest=Ww={}));var Uw;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=bl.MessageDirection.clientToServer,t.type=new bl.ProtocolNotificationType(t.method)})(Uw||(Ri.WorkDoneProgressCancelNotification=Uw={}))});var Kw=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.CallHierarchyOutgoingCallsRequest=Pi.CallHierarchyIncomingCallsRequest=Pi.CallHierarchyPrepareRequest=void 0;var So=tt(),Gw;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=So.MessageDirection.clientToServer,t.type=new So.ProtocolRequestType(t.method)})(Gw||(Pi.CallHierarchyPrepareRequest=Gw={}));var zw;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=So.MessageDirection.clientToServer,t.type=new So.ProtocolRequestType(t.method)})(zw||(Pi.CallHierarchyIncomingCallsRequest=zw={}));var Vw;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=So.MessageDirection.clientToServer,t.type=new So.ProtocolRequestType(t.method)})(Vw||(Pi.CallHierarchyOutgoingCallsRequest=Vw={}))});var e0=m(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.SemanticTokensRefreshRequest=Sn.SemanticTokensRangeRequest=Sn.SemanticTokensDeltaRequest=Sn.SemanticTokensRequest=Sn.SemanticTokensRegistrationType=Sn.TokenFormat=void 0;var ai=tt(),Xw;(function(t){t.Relative="relative"})(Xw||(Sn.TokenFormat=Xw={}));var ja;(function(t){t.method="textDocument/semanticTokens",t.type=new ai.RegistrationType(t.method)})(ja||(Sn.SemanticTokensRegistrationType=ja={}));var Yw;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=ja.method})(Yw||(Sn.SemanticTokensRequest=Yw={}));var Jw;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=ja.method})(Jw||(Sn.SemanticTokensDeltaRequest=Jw={}));var Qw;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=ja.method})(Qw||(Sn.SemanticTokensRangeRequest=Qw={}));var Zw;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=ai.MessageDirection.serverToClient,t.type=new ai.ProtocolRequestType0(t.method)})(Zw||(Sn.SemanticTokensRefreshRequest=Zw={}))});var r0=m(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.ShowDocumentRequest=void 0;var t0=tt(),n0;(function(t){t.method="window/showDocument",t.messageDirection=t0.MessageDirection.serverToClient,t.type=new t0.ProtocolRequestType(t.method)})(n0||(_l.ShowDocumentRequest=n0={}))});var o0=m(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.LinkedEditingRangeRequest=void 0;var i0=tt(),s0;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=i0.MessageDirection.clientToServer,t.type=new i0.ProtocolRequestType(t.method)})(s0||(vl.LinkedEditingRangeRequest=s0={}))});var p0=m(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.WillDeleteFilesRequest=en.DidDeleteFilesNotification=en.DidRenameFilesNotification=en.WillRenameFilesRequest=en.DidCreateFilesNotification=en.WillCreateFilesRequest=en.FileOperationPatternKind=void 0;var Wn=tt(),a0;(function(t){t.file="file",t.folder="folder"})(a0||(en.FileOperationPatternKind=a0={}));var u0;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(u0||(en.WillCreateFilesRequest=u0={}));var c0;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(c0||(en.DidCreateFilesNotification=c0={}));var l0;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(l0||(en.WillRenameFilesRequest=l0={}));var h0;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(h0||(en.DidRenameFilesNotification=h0={}));var d0;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(d0||(en.DidDeleteFilesNotification=d0={}));var f0;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(f0||(en.WillDeleteFilesRequest=f0={}))});var _0=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MonikerRequest=Di.MonikerKind=Di.UniquenessLevel=void 0;var g0=tt(),m0;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(m0||(Di.UniquenessLevel=m0={}));var y0;(function(t){t.$import="import",t.$export="export",t.local="local"})(y0||(Di.MonikerKind=y0={}));var b0;(function(t){t.method="textDocument/moniker",t.messageDirection=g0.MessageDirection.clientToServer,t.type=new g0.ProtocolRequestType(t.method)})(b0||(Di.MonikerRequest=b0={}))});var w0=m(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.TypeHierarchySubtypesRequest=Ii.TypeHierarchySupertypesRequest=Ii.TypeHierarchyPrepareRequest=void 0;var To=tt(),v0;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=To.MessageDirection.clientToServer,t.type=new To.ProtocolRequestType(t.method)})(v0||(Ii.TypeHierarchyPrepareRequest=v0={}));var S0;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=To.MessageDirection.clientToServer,t.type=new To.ProtocolRequestType(t.method)})(S0||(Ii.TypeHierarchySupertypesRequest=S0={}));var T0;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=To.MessageDirection.clientToServer,t.type=new To.ProtocolRequestType(t.method)})(T0||(Ii.TypeHierarchySubtypesRequest=T0={}))});var A0=m(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.InlineValueRefreshRequest=wo.InlineValueRequest=void 0;var Sl=tt(),E0;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Sl.MessageDirection.clientToServer,t.type=new Sl.ProtocolRequestType(t.method)})(E0||(wo.InlineValueRequest=E0={}));var x0;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Sl.MessageDirection.serverToClient,t.type=new Sl.ProtocolRequestType0(t.method)})(x0||(wo.InlineValueRefreshRequest=x0={}))});var R0=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.InlayHintRefreshRequest=Mi.InlayHintResolveRequest=Mi.InlayHintRequest=void 0;var Eo=tt(),k0;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Eo.MessageDirection.clientToServer,t.type=new Eo.ProtocolRequestType(t.method)})(k0||(Mi.InlayHintRequest=k0={}));var C0;(function(t){t.method="inlayHint/resolve",t.messageDirection=Eo.MessageDirection.clientToServer,t.type=new Eo.ProtocolRequestType(t.method)})(C0||(Mi.InlayHintResolveRequest=C0={}));var O0;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Eo.MessageDirection.serverToClient,t.type=new Eo.ProtocolRequestType0(t.method)})(O0||(Mi.InlayHintRefreshRequest=O0={}))});var q0=m(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.DiagnosticRefreshRequest=Un.WorkspaceDiagnosticRequest=Un.DocumentDiagnosticRequest=Un.DocumentDiagnosticReportKind=Un.DiagnosticServerCancellationData=void 0;var N0=ys(),KD=cl(),xo=tt(),P0;(function(t){function e(n){let r=n;return r&&KD.boolean(r.retriggerRequest)}t.is=e})(P0||(Un.DiagnosticServerCancellationData=P0={}));var D0;(function(t){t.Full="full",t.Unchanged="unchanged"})(D0||(Un.DocumentDiagnosticReportKind=D0={}));var I0;(function(t){t.method="textDocument/diagnostic",t.messageDirection=xo.MessageDirection.clientToServer,t.type=new xo.ProtocolRequestType(t.method),t.partialResult=new N0.ProgressType})(I0||(Un.DocumentDiagnosticRequest=I0={}));var M0;(function(t){t.method="workspace/diagnostic",t.messageDirection=xo.MessageDirection.clientToServer,t.type=new xo.ProtocolRequestType(t.method),t.partialResult=new N0.ProgressType})(M0||(Un.WorkspaceDiagnosticRequest=M0={}));var L0;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=xo.MessageDirection.serverToClient,t.type=new xo.ProtocolRequestType0(t.method)})(L0||(Un.DiagnosticRefreshRequest=L0={}))});var H0=m(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.DidCloseNotebookDocumentNotification=pt.DidSaveNotebookDocumentNotification=pt.DidChangeNotebookDocumentNotification=pt.NotebookCellArrayChange=pt.DidOpenNotebookDocumentNotification=pt.NotebookDocumentSyncRegistrationType=pt.NotebookDocument=pt.NotebookCell=pt.ExecutionSummary=pt.NotebookCellKind=void 0;var Fa=ul(),mr=cl(),Ir=tt(),Zg;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Zg||(pt.NotebookCellKind=Zg={}));var em;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return mr.objectLiteral(s)&&Fa.uinteger.is(s.executionOrder)&&(s.success===void 0||mr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(em||(pt.ExecutionSummary=em={}));var Tl;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return mr.objectLiteral(o)&&Zg.is(o.kind)&&Fa.DocumentUri.is(o.document)&&(o.metadata===void 0||mr.objectLiteral(o.metadata))}t.is=n;function r(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!em.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function i(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),u=Array.isArray(o);if(a!==u)return!1;if(a&&u){if(s.length!==o.length)return!1;for(let c=0;c<s.length;c++)if(!i(s[c],o[c]))return!1}if(mr.objectLiteral(s)&&mr.objectLiteral(o)){let c=Object.keys(s),l=Object.keys(o);if(c.length!==l.length||(c.sort(),l.sort(),!i(c,l)))return!1;for(let h=0;h<c.length;h++){let d=c[h];if(!i(s[d],o[d]))return!1}}return!0}})(Tl||(pt.NotebookCell=Tl={}));var j0;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return mr.objectLiteral(i)&&mr.string(i.uri)&&Fa.integer.is(i.version)&&mr.typedArray(i.cells,Tl.is)}t.is=n})(j0||(pt.NotebookDocument=j0={}));var Ao;(function(t){t.method="notebookDocument/sync",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.RegistrationType(t.method)})(Ao||(pt.NotebookDocumentSyncRegistrationType=Ao={}));var F0;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=Ao.method})(F0||(pt.DidOpenNotebookDocumentNotification=F0={}));var $0;(function(t){function e(r){let i=r;return mr.objectLiteral(i)&&Fa.uinteger.is(i.start)&&Fa.uinteger.is(i.deleteCount)&&(i.cells===void 0||mr.typedArray(i.cells,Tl.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})($0||(pt.NotebookCellArrayChange=$0={}));var B0;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=Ao.method})(B0||(pt.DidChangeNotebookDocumentNotification=B0={}));var W0;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=Ao.method})(W0||(pt.DidSaveNotebookDocumentNotification=W0={}));var U0;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=Ao.method})(U0||(pt.DidCloseNotebookDocumentNotification=U0={}))});var V0=m(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.InlineCompletionRequest=void 0;var G0=tt(),z0;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=G0.MessageDirection.clientToServer,t.type=new G0.ProtocolRequestType(t.method)})(z0||(wl.InlineCompletionRequest=z0={}))});var ox=m(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 U=tt(),K0=ul(),$t=cl(),XD=_w();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return XD.ImplementationRequest}});var YD=Tw();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return YD.TypeDefinitionRequest}});var nx=xw();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return nx.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return nx.DidChangeWorkspaceFoldersNotification}});var JD=Cw();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return JD.ConfigurationRequest}});var rx=Pw();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return rx.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return rx.ColorPresentationRequest}});var ix=Mw();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return ix.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return ix.FoldingRangeRefreshRequest}});var QD=qw();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return QD.DeclarationRequest}});var ZD=$w();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return ZD.SelectionRangeRequest}});var sm=Hw();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return sm.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return sm.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return sm.WorkDoneProgressCancelNotification}});var om=Kw();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return om.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return om.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return om.CallHierarchyPrepareRequest}});var ko=e0();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return ko.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return ko.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ko.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ko.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ko.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ko.SemanticTokensRegistrationType}});var eI=r0();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return eI.ShowDocumentRequest}});var tI=o0();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return tI.LinkedEditingRangeRequest}});var bs=p0();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return bs.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return bs.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return bs.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return bs.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return bs.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return bs.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return bs.WillDeleteFilesRequest}});var am=_0();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return am.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return am.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return am.MonikerRequest}});var um=w0();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return um.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return um.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return um.TypeHierarchySupertypesRequest}});var sx=A0();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return sx.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return sx.InlineValueRefreshRequest}});var cm=R0();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return cm.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return cm.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return cm.InlayHintRefreshRequest}});var $a=q0();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return $a.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return $a.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return $a.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return $a.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return $a.DiagnosticRefreshRequest}});var Mr=H0();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return Mr.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return Mr.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return Mr.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return Mr.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Mr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Mr.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidCloseNotebookDocumentNotification}});var nI=V0();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return nI.InlineCompletionRequest}});var tm;(function(t){function e(n){let r=n;return $t.string(r)||$t.string(r.language)||$t.string(r.scheme)||$t.string(r.pattern)}t.is=e})(tm||(S.TextDocumentFilter=tm={}));var nm;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebookType)||$t.string(r.scheme)||$t.string(r.pattern))}t.is=e})(nm||(S.NotebookDocumentFilter=nm={}));var rm;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebook)||nm.is(r.notebook))&&(r.language===void 0||$t.string(r.language))}t.is=e})(rm||(S.NotebookCellTextDocumentFilter=rm={}));var im;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!$t.string(r)&&!tm.is(r)&&!rm.is(r))return!1;return!0}t.is=e})(im||(S.DocumentSelector=im={}));var X0;(function(t){t.method="client/registerCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(X0||(S.RegistrationRequest=X0={}));var Y0;(function(t){t.method="client/unregisterCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(Y0||(S.UnregistrationRequest=Y0={}));var J0;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(J0||(S.ResourceOperationKind=J0={}));var Q0;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(Q0||(S.FailureHandlingKind=Q0={}));var Z0;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(Z0||(S.PositionEncodingKind=Z0={}));var eE;(function(t){function e(n){let r=n;return r&&$t.string(r.id)&&r.id.length>0}t.hasId=e})(eE||(S.StaticRegistrationOptions=eE={}));var tE;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||im.is(r.documentSelector))}t.is=e})(tE||(S.TextDocumentRegistrationOptions=tE={}));var nE;(function(t){function e(r){let i=r;return $t.objectLiteral(i)&&(i.workDoneProgress===void 0||$t.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&$t.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(nE||(S.WorkDoneProgressOptions=nE={}));var rE;(function(t){t.method="initialize",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(rE||(S.InitializeRequest=rE={}));var iE;(function(t){t.unknownProtocolVersion=1})(iE||(S.InitializeErrorCodes=iE={}));var sE;(function(t){t.method="initialized",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(sE||(S.InitializedNotification=sE={}));var oE;(function(t){t.method="shutdown",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType0(t.method)})(oE||(S.ShutdownRequest=oE={}));var aE;(function(t){t.method="exit",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType0(t.method)})(aE||(S.ExitNotification=aE={}));var uE;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(uE||(S.DidChangeConfigurationNotification=uE={}));var cE;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(cE||(S.MessageType=cE={}));var lE;(function(t){t.method="window/showMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(lE||(S.ShowMessageNotification=lE={}));var hE;(function(t){t.method="window/showMessageRequest",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(hE||(S.ShowMessageRequest=hE={}));var dE;(function(t){t.method="window/logMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(dE||(S.LogMessageNotification=dE={}));var fE;(function(t){t.method="telemetry/event",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(fE||(S.TelemetryEventNotification=fE={}));var pE;(function(t){t.None=0,t.Full=1,t.Incremental=2})(pE||(S.TextDocumentSyncKind=pE={}));var gE;(function(t){t.method="textDocument/didOpen",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(gE||(S.DidOpenTextDocumentNotification=gE={}));var mE;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(mE||(S.TextDocumentContentChangeEvent=mE={}));var yE;(function(t){t.method="textDocument/didChange",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(yE||(S.DidChangeTextDocumentNotification=yE={}));var bE;(function(t){t.method="textDocument/didClose",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(bE||(S.DidCloseTextDocumentNotification=bE={}));var _E;(function(t){t.method="textDocument/didSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(_E||(S.DidSaveTextDocumentNotification=_E={}));var vE;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(vE||(S.TextDocumentSaveReason=vE={}));var SE;(function(t){t.method="textDocument/willSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(SE||(S.WillSaveTextDocumentNotification=SE={}));var TE;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(TE||(S.WillSaveTextDocumentWaitUntilRequest=TE={}));var wE;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(wE||(S.DidChangeWatchedFilesNotification=wE={}));var EE;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(EE||(S.FileChangeType=EE={}));var xE;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&(K0.URI.is(r.baseUri)||K0.WorkspaceFolder.is(r.baseUri))&&$t.string(r.pattern)}t.is=e})(xE||(S.RelativePattern=xE={}));var AE;(function(t){t.Create=1,t.Change=2,t.Delete=4})(AE||(S.WatchKind=AE={}));var kE;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(kE||(S.PublishDiagnosticsNotification=kE={}));var CE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(CE||(S.CompletionTriggerKind=CE={}));var OE;(function(t){t.method="textDocument/completion",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(OE||(S.CompletionRequest=OE={}));var RE;(function(t){t.method="completionItem/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(RE||(S.CompletionResolveRequest=RE={}));var PE;(function(t){t.method="textDocument/hover",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(PE||(S.HoverRequest=PE={}));var DE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(DE||(S.SignatureHelpTriggerKind=DE={}));var IE;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(IE||(S.SignatureHelpRequest=IE={}));var ME;(function(t){t.method="textDocument/definition",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ME||(S.DefinitionRequest=ME={}));var LE;(function(t){t.method="textDocument/references",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(LE||(S.ReferencesRequest=LE={}));var NE;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(NE||(S.DocumentHighlightRequest=NE={}));var qE;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(qE||(S.DocumentSymbolRequest=qE={}));var jE;(function(t){t.method="textDocument/codeAction",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(jE||(S.CodeActionRequest=jE={}));var FE;(function(t){t.method="codeAction/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(FE||(S.CodeActionResolveRequest=FE={}));var $E;(function(t){t.method="workspace/symbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})($E||(S.WorkspaceSymbolRequest=$E={}));var BE;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(BE||(S.WorkspaceSymbolResolveRequest=BE={}));var WE;(function(t){t.method="textDocument/codeLens",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(WE||(S.CodeLensRequest=WE={}));var UE;(function(t){t.method="codeLens/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(UE||(S.CodeLensResolveRequest=UE={}));var HE;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType0(t.method)})(HE||(S.CodeLensRefreshRequest=HE={}));var GE;(function(t){t.method="textDocument/documentLink",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(GE||(S.DocumentLinkRequest=GE={}));var zE;(function(t){t.method="documentLink/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(zE||(S.DocumentLinkResolveRequest=zE={}));var VE;(function(t){t.method="textDocument/formatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(VE||(S.DocumentFormattingRequest=VE={}));var KE;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(KE||(S.DocumentRangeFormattingRequest=KE={}));var XE;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(XE||(S.DocumentRangesFormattingRequest=XE={}));var YE;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(YE||(S.DocumentOnTypeFormattingRequest=YE={}));var JE;(function(t){t.Identifier=1})(JE||(S.PrepareSupportDefaultBehavior=JE={}));var QE;(function(t){t.method="textDocument/rename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(QE||(S.RenameRequest=QE={}));var ZE;(function(t){t.method="textDocument/prepareRename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ZE||(S.PrepareRenameRequest=ZE={}));var ex;(function(t){t.method="workspace/executeCommand",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ex||(S.ExecuteCommandRequest=ex={}));var tx;(function(t){t.method="workspace/applyEdit",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType("workspace/applyEdit")})(tx||(S.ApplyWorkspaceEditRequest=tx={}))});var ux=m(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.createProtocolConnection=void 0;var ax=ys();function rI(t,e,n,r){return ax.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,ax.createMessageConnection)(t,e,n,r)}El.createProtocolConnection=rI});var lx=m(Tn=>{"use strict";var iI=Tn&&Tn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),xl=Tn&&Tn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&iI(e,t,n)};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.LSPErrorCodes=Tn.createProtocolConnection=void 0;xl(ys(),Tn);xl(ul(),Tn);xl(tt(),Tn);xl(ox(),Tn);var sI=ux();Object.defineProperty(Tn,"createProtocolConnection",{enumerable:!0,get:function(){return sI.createProtocolConnection}});var cx;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(cx||(Tn.LSPErrorCodes=cx={}))});var vt=m(Lr=>{"use strict";var oI=Lr&&Lr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),hx=Lr&&Lr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&oI(e,t,n)};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.createProtocolConnection=void 0;var aI=Vg();hx(Vg(),Lr);hx(lx(),Lr);function uI(t,e,n,r){return(0,aI.createMessageConnection)(t,e,n,r)}Lr.createProtocolConnection=uI});var lm=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.generateUuid=Hn.parse=Hn.isUUID=Hn.v4=Hn.empty=void 0;var Ba=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Wa=class t extends Ba{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};Wa._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Wa._timeHighBits=["8","9","a","b"];Hn.empty=new Ba("00000000-0000-0000-0000-000000000000");function dx(){return new Wa}Hn.v4=dx;var cI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function fx(t){return cI.test(t)}Hn.isUUID=fx;function lI(t){if(!fx(t))throw new Error("invalid uuid");return new Ba(t)}Hn.parse=lI;function hI(){return dx().asHex()}Hn.generateUuid=hI});var px=m(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.attachPartialResult=Ni.ProgressFeature=Ni.attachWorkDone=void 0;var Li=vt(),dI=lm(),_s=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Li.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(Li.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Li.WorkDoneProgress.type,this._token,{kind:"end"})}};_s.Instances=new Map;var Al=class extends _s{constructor(e,n){super(e,n),this._source=new Li.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ua=class{constructor(){}begin(){}report(){}done(){}},kl=class extends Ua{constructor(){super(),this._source=new Li.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function fI(t,e){if(e===void 0||e.workDoneToken===void 0)return new Ua;let n=e.workDoneToken;return delete e.workDoneToken,new _s(t,n)}Ni.attachWorkDone=fI;var pI=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Li.WorkDoneProgressCancelNotification.type,n=>{let r=_s.Instances.get(n.token);(r instanceof Al||r instanceof kl)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ua:new _s(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,dI.generateUuid)();return this.connection.sendRequest(Li.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Al(this.connection,e))}else return Promise.resolve(new kl)}};Ni.ProgressFeature=pI;var hm;(function(t){t.type=new Li.ProgressType})(hm||(hm={}));var dm=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(hm.type,this._token,e)}};function gI(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new dm(t,n)}Ni.attachPartialResult=gI});var gx=m(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.ConfigurationFeature=void 0;var mI=vt(),yI=Fc(),bI=t=>class extends t{getConfiguration(e){return e?yI.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(mI.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Cl.ConfigurationFeature=bI});var mx=m(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.WorkspaceFoldersFeature=void 0;var Ol=vt(),_I=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Ol.Emitter,this.connection.onNotification(Ol.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Ol.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(Ol.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Rl.WorkspaceFoldersFeature=_I});var yx=m(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.CallHierarchyFeature=void 0;var fm=vt(),vI=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(fm.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=fm.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=fm.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Pl.CallHierarchyFeature=vI});var gm=m(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.SemanticTokensBuilder=qi.SemanticTokensDiff=qi.SemanticTokensFeature=void 0;var Dl=vt(),SI=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Dl.SemanticTokensRefreshRequest.type),on:e=>{let n=Dl.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Dl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Dl.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};qi.SemanticTokensFeature=SI;var Il=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};qi.SemanticTokensDiff=Il;var pm=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Il(this._prevData,this._data).computeDiff()}:this.build()}};qi.SemanticTokensBuilder=pm});var bx=m(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.ShowDocumentFeature=void 0;var TI=vt(),wI=t=>class extends t{showDocument(e){return this.connection.sendRequest(TI.ShowDocumentRequest.type,e)}};Ml.ShowDocumentFeature=wI});var _x=m(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.FileOperationsFeature=void 0;var Co=vt(),EI=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Co.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Co.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Co.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Co.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Co.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Co.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Ll.FileOperationsFeature=EI});var vx=m(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.LinkedEditingRangeFeature=void 0;var xI=vt(),AI=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(xI.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Nl.LinkedEditingRangeFeature=AI});var Sx=m(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.TypeHierarchyFeature=void 0;var mm=vt(),kI=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(mm.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=mm.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=mm.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ql.TypeHierarchyFeature=kI});var wx=m(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.InlineValueFeature=void 0;var Tx=vt(),CI=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Tx.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(Tx.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};jl.InlineValueFeature=CI});var xx=m(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.FoldingRangeFeature=void 0;var Ex=vt(),OI=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Ex.FoldingRangeRefreshRequest.type),on:e=>{let n=Ex.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Fl.FoldingRangeFeature=OI});var Ax=m($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.InlayHintFeature=void 0;var ym=vt(),RI=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(ym.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(ym.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(ym.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};$l.InlayHintFeature=RI});var kx=m(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.DiagnosticFeature=void 0;var Ha=vt(),PI=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Ha.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Ha.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ha.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Ha.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ha.WorkspaceDiagnosticRequest.partialResult,n)))}}};Bl.DiagnosticFeature=PI});var _m=m(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.TextDocuments=void 0;var vs=vt(),bm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new vs.Emitter,this._onDidOpen=new vs.Emitter,this._onDidClose=new vs.Emitter,this._onDidSave=new vs.Emitter,this._onWillSave=new vs.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=vs.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),vs.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Wl.TextDocuments=bm});var Sm=m(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.NotebookDocuments=Oo.NotebookSyncFeature=void 0;var Gn=vt(),Cx=_m(),DI=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Gn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Gn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Gn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Gn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Oo.NotebookSyncFeature=DI;var Ul=class t{onDidOpenTextDocument(e){return this.openHandler=e,Gn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Gn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Gn.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Ul.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var vm=class{constructor(e){e instanceof Cx.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Cx.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Gn.Emitter,this._onDidChange=new Gn.Emitter,this._onDidSave=new Gn.Emitter,this._onDidClose=new Gn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new Ul,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,u=i.change;u.metadata!==void 0&&(a=!0,s.metadata=u.metadata);let c=[],l=[],h=[],d=[];if(u.cells!==void 0){let A=u.cells;if(A.structure!==void 0){let w=A.structure.array;if(s.cells.splice(w.start,w.deleteCount,...w.cells!==void 0?w.cells:[]),A.structure.didOpen!==void 0)for(let T of A.structure.didOpen)n.openTextDocument({textDocument:T}),c.push(T.uri);if(A.structure.didClose)for(let T of A.structure.didClose)n.closeTextDocument({textDocument:T}),l.push(T.uri)}if(A.data!==void 0){let w=new Map(A.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let v=w.get(s.cells[T].document);if(v!==void 0){let L=s.cells.splice(T,1,v);if(h.push({old:L[0],new:v}),w.delete(v.document),w.size===0)break}}}if(A.textContent!==void 0)for(let w of A.textContent)n.changeTextDocument({textDocument:w.document,contentChanges:w.changes}),d.push(w.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let y=[];for(let A of c)y.push(this.getNotebookCell(A));let b=[];for(let A of l)b.push(this.getNotebookCell(A));let C=[];for(let A of d)C.push(this.getNotebookCell(A));(y.length>0||b.length>0||h.length>0||C.length>0)&&(g.cells={added:y,removed:b,changed:{data:h,textContent:C}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Gn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};Oo.NotebookDocuments=vm});var Ox=m(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.MonikerFeature=void 0;var II=vt(),MI=t=>class extends t{get moniker(){return{on:e=>{let n=II.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Hl.MonikerFeature=MI});var km=m(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createConnection=Ie.combineFeatures=Ie.combineNotebooksFeatures=Ie.combineLanguagesFeatures=Ie.combineWorkspaceFeatures=Ie.combineWindowFeatures=Ie.combineClientFeatures=Ie.combineTracerFeatures=Ie.combineTelemetryFeatures=Ie.combineConsoleFeatures=Ie._NotebooksImpl=Ie._LanguagesImpl=Ie.BulkUnregistration=Ie.BulkRegistration=Ie.ErrorMessageTracker=void 0;var V=vt(),zn=Fc(),wm=lm(),fe=px(),LI=gx(),NI=mx(),qI=yx(),jI=gm(),FI=bx(),$I=_x(),BI=vx(),WI=Sx(),UI=wx(),HI=xx(),GI=Ax(),zI=kx(),VI=Sm(),KI=Ox();function Tm(t){if(t!==null)return t}var Em=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Ie.ErrorMessageTracker=Em;var Gl=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(V.MessageType.Error,e)}warn(e){this.send(V.MessageType.Warning,e)}info(e){this.send(V.MessageType.Info,e)}log(e){this.send(V.MessageType.Log,e)}debug(e){this.send(V.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(V.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,V.RAL)().console.error("Sending log message failed")})}},xm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:V.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(Tm)}showWarningMessage(e,...n){let r={type:V.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(Tm)}showInformationMessage(e,...n){let r={type:V.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(Tm)}},Rx=(0,FI.ShowDocumentFeature)((0,fe.ProgressFeature)(xm)),Px;(function(t){function e(){return new zl}t.create=e})(Px||(Ie.BulkRegistration=Px={}));var zl=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=zn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=wm.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},Dx;(function(t){function e(){return new Ga(void 0,[])}t.create=e})(Dx||(Ie.BulkUnregistration=Dx={}));var Ga=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(V.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=zn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(V.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Vl=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof zl?this.registerMany(e):e instanceof Ga?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=zn.string(n)?n:n.method,s=wm.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(V.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=zn.string(e)?e:e.method,i=wm.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(V.RegistrationRequest.type,s).then(o=>V.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(V.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(V.RegistrationRequest.type,n).then(()=>new Ga(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Am=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(V.ApplyWorkspaceEditRequest.type,r)}},Ix=(0,$I.FileOperationsFeature)((0,NI.WorkspaceFoldersFeature)((0,LI.ConfigurationFeature)(Am))),Kl=class{constructor(){this._trace=V.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==V.Trace.Off&&this.connection.sendNotification(V.LogTraceNotification.type,{message:e,verbose:this._trace===V.Trace.Verbose?n:void 0}).catch(()=>{})}},Xl=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(V.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Yl=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,fe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,fe.attachPartialResult)(this.connection,n)}};Ie._LanguagesImpl=Yl;var Mx=(0,HI.FoldingRangeFeature)((0,KI.MonikerFeature)((0,zI.DiagnosticFeature)((0,GI.InlayHintFeature)((0,UI.InlineValueFeature)((0,WI.TypeHierarchyFeature)((0,BI.LinkedEditingRangeFeature)((0,jI.SemanticTokensFeature)((0,qI.CallHierarchyFeature)(Yl))))))))),Jl=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,fe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,fe.attachPartialResult)(this.connection,n)}};Ie._NotebooksImpl=Jl;var Lx=(0,VI.NotebookSyncFeature)(Jl);function Nx(t,e){return function(n){return e(t(n))}}Ie.combineConsoleFeatures=Nx;function qx(t,e){return function(n){return e(t(n))}}Ie.combineTelemetryFeatures=qx;function jx(t,e){return function(n){return e(t(n))}}Ie.combineTracerFeatures=jx;function Fx(t,e){return function(n){return e(t(n))}}Ie.combineClientFeatures=Fx;function $x(t,e){return function(n){return e(t(n))}}Ie.combineWindowFeatures=$x;function Bx(t,e){return function(n){return e(t(n))}}Ie.combineWorkspaceFeatures=Bx;function Wx(t,e){return function(n){return e(t(n))}}Ie.combineLanguagesFeatures=Wx;function Ux(t,e){return function(n){return e(t(n))}}Ie.combineNotebooksFeatures=Ux;function XI(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Nx),tracer:n(t.tracer,e.tracer,jx),telemetry:n(t.telemetry,e.telemetry,qx),client:n(t.client,e.client,Fx),window:n(t.window,e.window,$x),workspace:n(t.workspace,e.workspace,Bx),languages:n(t.languages,e.languages,Wx),notebooks:n(t.notebooks,e.notebooks,Ux)}}Ie.combineFeatures=XI;function YI(t,e,n){let r=n&&n.console?new(n.console(Gl)):new Gl,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Kl)):new Kl,o=n&&n.telemetry?new(n.telemetry(Xl)):new Xl,a=n&&n.client?new(n.client(Vl)):new Vl,u=n&&n.window?new(n.window(Rx)):new Rx,c=n&&n.workspace?new(n.workspace(Ix)):new Ix,l=n&&n.languages?new(n.languages(Mx)):new Mx,h=n&&n.notebooks?new(n.notebooks(Lx)):new Lx,d=[r,s,o,a,u,c,l,h];function g(w){return w instanceof Promise?w:zn.thenable(w)?new Promise((T,v)=>{w.then(L=>T(L),L=>v(L))}):Promise.resolve(w)}let y,b,C,A={listen:()=>i.listen(),sendRequest:(w,...T)=>i.sendRequest(zn.string(w)?w:w.method,...T),onRequest:(w,T)=>i.onRequest(w,T),sendNotification:(w,T)=>{let v=zn.string(w)?w:w.method;return i.sendNotification(v,T)},onNotification:(w,T)=>i.onNotification(w,T),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:w=>(b=w,{dispose:()=>{b=void 0}}),onInitialized:w=>i.onNotification(V.InitializedNotification.type,w),onShutdown:w=>(y=w,{dispose:()=>{y=void 0}}),onExit:w=>(C=w,{dispose:()=>{C=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return u},get workspace(){return c},get languages(){return l},get notebooks(){return h},onDidChangeConfiguration:w=>i.onNotification(V.DidChangeConfigurationNotification.type,w),onDidChangeWatchedFiles:w=>i.onNotification(V.DidChangeWatchedFilesNotification.type,w),__textDocumentSync:void 0,onDidOpenTextDocument:w=>i.onNotification(V.DidOpenTextDocumentNotification.type,w),onDidChangeTextDocument:w=>i.onNotification(V.DidChangeTextDocumentNotification.type,w),onDidCloseTextDocument:w=>i.onNotification(V.DidCloseTextDocumentNotification.type,w),onWillSaveTextDocument:w=>i.onNotification(V.WillSaveTextDocumentNotification.type,w),onWillSaveTextDocumentWaitUntil:w=>i.onRequest(V.WillSaveTextDocumentWaitUntilRequest.type,w),onDidSaveTextDocument:w=>i.onNotification(V.DidSaveTextDocumentNotification.type,w),sendDiagnostics:w=>i.sendNotification(V.PublishDiagnosticsNotification.type,w),onHover:w=>i.onRequest(V.HoverRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onCompletion:w=>i.onRequest(V.CompletionRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onCompletionResolve:w=>i.onRequest(V.CompletionResolveRequest.type,w),onSignatureHelp:w=>i.onRequest(V.SignatureHelpRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onDeclaration:w=>i.onRequest(V.DeclarationRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onDefinition:w=>i.onRequest(V.DefinitionRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onTypeDefinition:w=>i.onRequest(V.TypeDefinitionRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onImplementation:w=>i.onRequest(V.ImplementationRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onReferences:w=>i.onRequest(V.ReferencesRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onDocumentHighlight:w=>i.onRequest(V.DocumentHighlightRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onDocumentSymbol:w=>i.onRequest(V.DocumentSymbolRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onWorkspaceSymbol:w=>i.onRequest(V.WorkspaceSymbolRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onWorkspaceSymbolResolve:w=>i.onRequest(V.WorkspaceSymbolResolveRequest.type,w),onCodeAction:w=>i.onRequest(V.CodeActionRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onCodeActionResolve:w=>i.onRequest(V.CodeActionResolveRequest.type,(T,v)=>w(T,v)),onCodeLens:w=>i.onRequest(V.CodeLensRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onCodeLensResolve:w=>i.onRequest(V.CodeLensResolveRequest.type,(T,v)=>w(T,v)),onDocumentFormatting:w=>i.onRequest(V.DocumentFormattingRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onDocumentRangeFormatting:w=>i.onRequest(V.DocumentRangeFormattingRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onDocumentOnTypeFormatting:w=>i.onRequest(V.DocumentOnTypeFormattingRequest.type,(T,v)=>w(T,v)),onRenameRequest:w=>i.onRequest(V.RenameRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onPrepareRename:w=>i.onRequest(V.PrepareRenameRequest.type,(T,v)=>w(T,v)),onDocumentLinks:w=>i.onRequest(V.DocumentLinkRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onDocumentLinkResolve:w=>i.onRequest(V.DocumentLinkResolveRequest.type,(T,v)=>w(T,v)),onDocumentColor:w=>i.onRequest(V.DocumentColorRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onColorPresentation:w=>i.onRequest(V.ColorPresentationRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onFoldingRanges:w=>i.onRequest(V.FoldingRangeRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onSelectionRanges:w=>i.onRequest(V.SelectionRangeRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onExecuteCommand:w=>i.onRequest(V.ExecuteCommandRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),dispose:()=>i.dispose()};for(let w of d)w.attach(A);return i.onRequest(V.InitializeRequest.type,w=>{e.initialize(w),zn.string(w.trace)&&(s.trace=V.Trace.fromString(w.trace));for(let T of d)T.initialize(w.capabilities);if(b){let T=b(w,new V.CancellationTokenSource().token,(0,fe.attachWorkDone)(i,w),void 0);return g(T).then(v=>{if(v instanceof V.ResponseError)return v;let L=v;L||(L={capabilities:{}});let R=L.capabilities;R||(R={},L.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=zn.number(A.__textDocumentSync)?A.__textDocumentSync:V.TextDocumentSyncKind.None:!zn.number(R.textDocumentSync)&&!zn.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=zn.number(A.__textDocumentSync)?A.__textDocumentSync:V.TextDocumentSyncKind.None);for(let B of d)B.fillServerCapabilities(R);return L})}else{let T={capabilities:{textDocumentSync:V.TextDocumentSyncKind.None}};for(let v of d)v.fillServerCapabilities(T.capabilities);return T}}),i.onRequest(V.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new V.CancellationTokenSource().token)}),i.onNotification(V.ExitNotification.type,()=>{try{C&&C()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(V.SetTraceNotification.type,w=>{s.trace=V.Trace.fromString(w.value)}),A}Ie.createConnection=YI});var Hx=m(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.resolveModulePath=wn.FileSystem=wn.resolveGlobalYarnPath=wn.resolveGlobalNodePath=wn.resolve=wn.uriToFilePath=void 0;var JI=require("url"),yr=require("path"),Cm=require("fs"),Dm=require("child_process");function QI(t){let e=JI.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return yr.normalize(n.join("/"))}wn.uriToFilePath=QI;function Om(){return process.platform==="win32"}function Ql(t,e,n,r){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let u=process.env,c=Object.create(null);Object.keys(u).forEach(l=>c[l]=u[l]),e&&Cm.existsSync(e)&&(c[i]?c[i]=e+yr.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,Dm.fork)("",[],{cwd:n,env:c,execArgv:["-e",s]});if(l.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}l.on("error",d=>{a(d)}),l.on("message",d=>{d.c==="r"&&(l.send({c:"e"}),d.s?o(d.r):a(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};l.send(h)}catch(l){a(l)}})}wn.resolve=Ql;function Rm(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Om()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,Dm.spawnSync)(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?Om()?yr.join(o,"node_modules"):yr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}wn.resolveGlobalNodePath=Rm;function ZI(t){let e="yarn",n={encoding:"utf8"};Om()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,Dm.spawnSync)(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let u=JSON.parse(a);if(u.type==="log")return yr.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}wn.resolveGlobalYarnPath=ZI;var Pm;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Cm.existsSync(__filename.toUpperCase())||!Cm.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?yr.normalize(s).indexOf(yr.normalize(i))===0:yr.normalize(s).toLowerCase().indexOf(yr.normalize(i).toLowerCase())===0}t.isParent=r})(Pm||(wn.FileSystem=Pm={}));function eM(t,e,n,r){return n?(yr.isAbsolute(n)||(n=yr.join(t,n)),Ql(e,n,n,r).then(i=>Pm.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Ql(e,Rm(r),t,r))):Ql(e,Rm(r),t,r)}wn.resolveModulePath=eM});var Im=m((Q3,Gx)=>{"use strict";Gx.exports=vt()});var zx=m(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.InlineCompletionFeature=void 0;var tM=vt(),nM=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(tM.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Zl.InlineCompletionFeature=nM});var Xx=m(tn=>{"use strict";var rM=tn&&tn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Kx=tn&&tn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&rM(e,t,n)};Object.defineProperty(tn,"__esModule",{value:!0});tn.ProposedFeatures=tn.NotebookDocuments=tn.TextDocuments=tn.SemanticTokensBuilder=void 0;var iM=gm();Object.defineProperty(tn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return iM.SemanticTokensBuilder}});var sM=zx();Kx(vt(),tn);var oM=_m();Object.defineProperty(tn,"TextDocuments",{enumerable:!0,get:function(){return oM.TextDocuments}});var aM=Sm();Object.defineProperty(tn,"NotebookDocuments",{enumerable:!0,get:function(){return aM.NotebookDocuments}});Kx(km(),tn);var Vx;(function(t){t.all={__brand:"features",languages:sM.InlineCompletionFeature}})(Vx||(tn.ProposedFeatures=Vx={}))});var Lm=m(Vn=>{"use strict";var uM=Vn&&Vn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Zx=Vn&&Vn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&uM(e,t,n)};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.createConnection=Vn.Files=void 0;var Yx=require("node:util"),Mm=Fc(),cM=km(),za=Hx(),Ss=Im();Zx(Im(),Vn);Zx(Xx(),Vn);var Jx;(function(t){t.uriToFilePath=za.uriToFilePath,t.resolveGlobalNodePath=za.resolveGlobalNodePath,t.resolveGlobalYarnPath=za.resolveGlobalYarnPath,t.resolve=za.resolve,t.resolveModulePath=za.resolveModulePath})(Jx||(Vn.Files=Jx={}));var Qx;function eh(){if(Qx!==void 0)try{Qx.end()}catch{}}var Ro=!1,eA;function lM(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(eA=setInterval(()=>{try{process.kill(r,0)}catch{eh(),process.exit(Ro?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}lM();var hM={initialize:t=>{let e=t.processId;Mm.number(e)&&eA===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Ro?0:1)}},3e3)},get shutdownReceived(){return Ro},set shutdownReceived(t){Ro=t},exit:t=>{eh(),process.exit(t)}};function dM(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Ss.ConnectionStrategy.is(t)||Ss.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),fM(s,o,a,i)}Vn.createConnection=dM;function fM(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let h=0;h<l.length;h++){let d=l[h];if(d==="--node-ipc"){t=new Ss.IPCMessageReader(process),e=new Ss.IPCMessageWriter(process);break}else if(d==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(d==="--socket"){u=parseInt(l[h+1]);break}else if(d==="--pipe"){c=l[h+1];break}else{var s=d.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let h=(0,Ss.createServerSocketTransport)(u);t=h[0],e=h[1]}else if(c){let h=(0,Ss.createServerPipeTransport)(c);t=h[0],e=h[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Mm.func(t.read)&&Mm.func(t.on)){let u=t;u.on("end",()=>{eh(),process.exit(Ro?0:1)}),u.on("close",()=>{eh(),process.exit(Ro?0:1)})}let a=u=>{let c=(0,Ss.createProtocolConnection)(t,e,u,n);return i&&pM(u),c};return(0,cM.createConnection)(a,hM,r)}function pM(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,Yx.inspect)(i)).join(" ")}let n=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,Yx.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
|
36
|
-
${s}`)},console.warn=function(...i){t.warn(e(i))}}});var Nm=m((rz,tA)=>{"use strict";tA.exports=Lm()});var ji=m(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.parseDependencyRawLocation=St.parseDependencyLocation=St.DependencyType=St.TypeAnalyzerStrategy=St.IndentationType=St.DefaultFileExtensions=St.ConfigurationNamespace=St.LanguageId=void 0;St.LanguageId="miniscript";St.ConfigurationNamespace="miniscript";St.DefaultFileExtensions=["ms"];var gM;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(gM=St.IndentationType||(St.IndentationType={}));var mM;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(mM=St.TypeAnalyzerStrategy||(St.TypeAnalyzerStrategy={}));var yM;(function(t){t.Include="include",t.Import="import"})(yM=St.DependencyType||(St.DependencyType={}));function bM(t){return t.args&&t.args.length>0?`${t.type}:${t.args.join(":")}!${t.location}`:`${t.type}!${t.location}`}St.parseDependencyLocation=bM;function _M(t){let e=t.indexOf("!"),[n,...r]=t.substring(0,e).split(":"),i=t.substring(e+1);return{type:n,location:i,args:r}}St.parseDependencyRawLocation=_M});var Va=m(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.Position=void 0;var qm=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};th.Position=qm});var Fi=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.LiteralToken=Dn.Token=Dn.BaseToken=Dn.BaseTokenOptions=Dn.TokenType=void 0;var nA=Va(),vM;(function(t){t.EOF="EOF",t.StringLiteral="StringLiteral",t.Keyword="Keyword",t.Identifier="Identifier",t.NumericLiteral="NumericLiteral",t.Punctuator="Punctuator",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.EOL="EOL",t.SliceOperator="SliceOperator",t.Comment="Comment",t.Invalid="Invalid"})(vM=Dn.TokenType||(Dn.TokenType={}));var jm=class{};Dn.BaseTokenOptions=jm;var Ka=class{constructor(e){this.type=e.type,this.value=e.value,this.line=e.line,this.lineStart=e.lineStart,this.range=e.range,this.lastLine=e.lastLine,this.lastLineStart=e.lastLineStart,this.afterSpace=e.afterSpace;let n=e.offsetRange,r=e.range;this.start=new nA.Position(this.line,r[0]-n[0]+1),this.end=new nA.Position(this.lastLine||this.line,r[1]-n[1]+1)}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = '${this.value}']`}};Dn.BaseToken=Ka;var Fm=class extends Ka{};Dn.Token=Fm;var $m=class extends Ka{constructor(e){super(e),this.raw=e.raw}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = ${this.raw}]`}};Dn.LiteralToken=$m});var nh=m(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.CharacterCode=void 0;var SM;(function(t){t[t.WHITESPACE=32]="WHITESPACE",t[t.QUOTE=34]="QUOTE",t[t.NUMBER_0=48]="NUMBER_0",t[t.NUMBER_1=49]="NUMBER_1",t[t.NUMBER_2=50]="NUMBER_2",t[t.NUMBER_3=51]="NUMBER_3",t[t.NUMBER_4=52]="NUMBER_4",t[t.NUMBER_5=53]="NUMBER_5",t[t.NUMBER_6=54]="NUMBER_6",t[t.NUMBER_7=55]="NUMBER_7",t[t.NUMBER_8=56]="NUMBER_8",t[t.NUMBER_9=57]="NUMBER_9",t[t.TAB=9]="TAB",t[t.NEW_LINE=10]="NEW_LINE",t[t.RETURN_LINE=13]="RETURN_LINE",t[t.SLASH=47]="SLASH",t[t.DOT=46]="DOT",t[t.EQUAL=61]="EQUAL",t[t.ASTERISK=42]="ASTERISK",t[t.CARET=94]="CARET",t[t.PERCENT=37]="PERCENT",t[t.COMMA=44]="COMMA",t[t.CURLY_BRACKET_LEFT=123]="CURLY_BRACKET_LEFT",t[t.CURLY_BRACKET_RIGHT=125]="CURLY_BRACKET_RIGHT",t[t.SQUARE_BRACKETS_LEFT=91]="SQUARE_BRACKETS_LEFT",t[t.SQUARE_BRACKETS_RIGHT=93]="SQUARE_BRACKETS_RIGHT",t[t.PARENTHESIS_LEFT=40]="PARENTHESIS_LEFT",t[t.PARENTHESIS_RIGHT=41]="PARENTHESIS_RIGHT",t[t.SEMICOLON=59]="SEMICOLON",t[t.HASH=35]="HASH",t[t.MINUS=45]="MINUS",t[t.PLUS=43]="PLUS",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.AT_SIGN=64]="AT_SIGN",t[t.COLON=58]="COLON",t[t.ARROW_LEFT=60]="ARROW_LEFT",t[t.ARROW_RIGHT=62]="ARROW_RIGHT",t[t.LETTER_E=69]="LETTER_E",t[t.LETTER_e=101]="LETTER_e"})(SM=Xa.CharacterCode||(Xa.CharacterCode={}))});var Po=m(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.Keyword=void 0;var TM;(function(t){t.If="if",t.In="in",t.Or="or",t.And="and",t.Isa="isa",t.For="for",t.Not="not",t.New="new",t.End="end",t.EndFor="end for",t.EndWhile="end while",t.EndFunction="end function",t.EndIf="end if",t.Then="then",t.Else="else",t.Break="break",t.While="while",t.ElseIf="else if",t.Return="return",t.Function="function",t.Continue="continue",t.Repeat="repeat"})(TM=Ya.Keyword||(Ya.Keyword={}))});var Um=m(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});var Kn=nh(),wM=Po(),Bm=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(wM.Keyword)))}isWhitespace(e){return Kn.CharacterCode.WHITESPACE===e||Kn.CharacterCode.TAB===e}isEndOfLine(e){return Kn.CharacterCode.NEW_LINE===e||Kn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Kn.CharacterCode.SLASH===e&&Kn.CharacterCode.SLASH===n}isIdentifierStart(e){return(e|32)>=97&&(e|32)<=122||e>=128||e===95}isIdentifierPart(e){return(e|32)>=97&&(e|32)<=122||e>=48&&e<=57||e>=128||e===95}isDecDigit(e){return e>=Kn.CharacterCode.NUMBER_0&&e<=Kn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Kn.CharacterCode.RETURN_LINE:return Kn.CharacterCode.NEW_LINE===n;case Kn.CharacterCode.NEW_LINE:return Kn.CharacterCode.RETURN_LINE===n}return!1}};Wm.default=Bm});var rh=m(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.ParserException=Do.LexerException=void 0;var Hm=class extends Error{constructor(e,n){super(e),this.range=n}};Do.LexerException=Hm;var Gm=class extends Error{constructor(e,n){super(e),this.range=n}};Do.ParserException=Gm});var zm=m(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.Literal=void 0;var EM;(function(t){t.True="true",t.False="false",t.Null="null"})(EM=Ja.Literal||(Ja.Literal={}))});var Io=m(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Operator=void 0;var xM;(function(t){t.Plus="+",t.Asterik="*",t.Minus="-",t.Slash="/",t.Power="^",t.Modulo="%",t.LessThan="<",t.GreaterThan=">",t.LessThanOrEqual="<=",t.GreaterThanOrEqual=">=",t.NotEqual="!=",t.Equal="==",t.Or="or",t.And="and",t.Not="not",t.Isa="isa",t.AddShorthand="+=",t.SubtractShorthand="-=",t.MultiplyShorthand="*=",t.DivideShorthand="/=",t.PowerShorthand="^=",t.ModuloShorthand="%=",t.Member=".",t.Assign="=",t.EndOfLine=";",t.EndOfFile="<eof>",t.SliceSeperator=":",t.Comma=",",t.Escape='"',t.SLBracket="[",t.SRBracket="]",t.CLBracket="{",t.CRBracket="}",t.LParenthesis="(",t.RParenthesis=")",t.Reference="@",t.New="new"})(xM=Qa.Operator||(Qa.Operator={}))});var Za=m(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.Range=void 0;var Vm=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};ih.Range=Vm});var Ym=m(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});var Km=class{constructor(){this._head=null,this._tail=null,this._size=0}enqueue(e){let n={value:e};this._head?this._tail.next=n:this._head=n,this._tail=n,this._size++}dequeue(){let e=this._head.value;if(e)return this._head=this._head.next,this._size--,e}peek(){var e;return((e=this._head)===null||e===void 0?void 0:e.value)||null}clear(){this._head=null,this._tail=null,this._size=0}copyInto(e){this._head=e._head,this._tail=e._tail,this._size=e._size}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e,e=e.next}};Xm.default=Km});var Zm=m(tu=>{"use strict";var iA=tu&&tu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tu,"__esModule",{value:!0});var nt=Fi(),AM=iA(Um()),ye=nh(),kM=rh(),Jm=Po(),eu=zm(),rt=Io(),Mo=Va(),Qm=Za(),rA=iA(Ym());function $i(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var sh=class t{constructor(e,n={}){let r=this;r.content=e,r.length=e.length,r.index=0,r.tokenStart=null,r.tabWidth=n.tabWidth||1,r.line=1,r.lineStart=0,r.offset=0,r.validator=n.validator||new AM.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new rA.default,r.snapshot=new rA.default}scan(e,n){let r=t.scanHandlers[e];return r?r.call(this,n):this.validator.isDecDigit(e)?this.scanNumericLiteral(n):(this.index++,null)}isAtWhitespace(){return this.validator.isWhitespace(this.codeAt())}codeAt(e=0){let n=this.index+e;return n<this.length?this.content.charCodeAt(n):0}createEOL(e){let n=this,r=new nt.Token({type:nt.TokenType.EOL,value:rt.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new nt.Token({type:nt.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new nt.Token({type:nt.TokenType.EOF,value:rt.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new nt.LiteralToken({type:nt.TokenType.BooleanLiteral,value:e===eu.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new nt.LiteralToken({type:nt.TokenType.NilLiteral,value:null,raw:eu.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new nt.Token({type:nt.TokenType.SliceOperator,value:rt.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new nt.Token({type:nt.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new nt.LiteralToken({type:nt.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:r});return this.snapshot.enqueue(i),i}scanStringLiteral(e){let n=this,r=n.validator,i=n.line,s=n.lineStart,o=n.index,a=n.offset,u=n.offset,c=!1;for(;n.index<n.length;){n.index++;let g=n.codeAt();if(n.validator.isEndOfLine(g))r.isWinNewline(g,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(ye.CharacterCode.QUOTE===g){if(ye.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Qm.Range(new Mo.Position(i,o-a+1),new Mo.Position(n.line,n.index-u+2)));n.index++;let l=n.content.slice(n.tokenStart,n.index),h=l.slice(1,-1).replace(/""/g,rt.Operator.Escape),d=new nt.LiteralToken({type:nt.TokenType.StringLiteral,value:h,raw:l,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[a,u],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=u,n.snapshot.enqueue(d),d}scanComment(e){let n=this,r=n.validator,i=n.line,s=n.lineStart;for(;this.index<this.length&&!r.isEndOfLine(n.codeAt());n.index++);r.isWinNewline(n.codeAt(),n.codeAt(1))&&n.index++;let o=n.content.slice(n.tokenStart+2,n.index),a=new nt.Token({type:nt.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(a),a}scanNumericLiteral(e){let n=this.validator,r,i;for(;this.index<this.length&&(r=i,i=this.codeAt(),n.isDecDigit(i)||ye.CharacterCode.DOT===i||ye.CharacterCode.LETTER_E===i||ye.CharacterCode.LETTER_e===i||(ye.CharacterCode.MINUS===i||ye.CharacterCode.PLUS===i)&&(ye.CharacterCode.LETTER_E===r||ye.CharacterCode.LETTER_e===r));)this.index++;let s=this.content.slice(this.tokenStart,this.index),o=Number(s);return isNaN(o)?this.raise(`Invalid numeric literal: ${s}`,new Qm.Range(new Mo.Position(this.line,this.tokenStart-this.offset+1),new Mo.Position(this.line,this.index-this.offset+1))):this.createNumericLiteral(o,s,e)}scanPunctuator(e,n){return this.index+=e.length,this.createPunctuator(e,n)}skipWhiteSpace(){let e=this;for(;e.index<e.length;e.index++){let n=e.content[e.index];if(n===" ")e.offset-=e.tabWidth-1;else if(n!==" ")return}}scanKeyword(e,n){let r=this,i=r.validator,s=e;switch(e){case Jm.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Jm.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Jm.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new nt.Token({type:nt.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(o),o}scanIdentifierOrKeyword(e){let n=this,r=n.validator;for(n.index++;r.isIdentifierPart(n.codeAt());n.index++);let i=n.content.slice(n.tokenStart,n.index);if(r.isKeyword(i))return n.scanKeyword(i,e);switch(i){case eu.Literal.True:case eu.Literal.False:return n.createBoolean(i,e);case eu.Literal.Null:return n.createNull(e)}return n.createIdentifier(i,e)}next(){let e=this;if(e.backlog.size)return e.backlog.dequeue();let n=e.index;e.skipWhiteSpace();let r=n<e.index,i=e.codeAt();if(e.validator.isComment(i,e.codeAt(1)))return e.tokenStart=e.index,e.scanComment(r);if(this.index>=this.length)return e.createEOF(r);if(e.tokenStart=e.index,e.validator.isEndOfLine(i)){e.validator.isWinNewline(i,e.codeAt(1))&&e.index++;let a=e.createEOL(r);return e.line++,e.offset=e.index+1,e.lineStart=++e.index,a}if(e.validator.isIdentifierStart(i))return e.scanIdentifierOrKeyword(r);let s=e.line,o=e.scan(i,r);return o||e.raise(`Invalid character ${i} (Code: ${String.fromCharCode(i)})`,new Qm.Range(new Mo.Position(s,e.tokenStart-e.offset+1),new Mo.Position(e.line,e.index-e.offset+1)))}recordSnapshot(){this.snapshot.clear()}recoverFromSnapshot(){this.backlog.copyInto(this.snapshot)}raise(e,n){let r=this,i=new kM.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new nt.Token({type:nt.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};tu.default=sh;sh.scanHandlers={[ye.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[ye.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(rt.Operator.Member,e))},[ye.CharacterCode.EQUAL]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.Equal,e):this.scanPunctuator(rt.Operator.Assign,e)},[ye.CharacterCode.ARROW_LEFT]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.LessThanOrEqual,e):this.scanPunctuator(rt.Operator.LessThan,e)},[ye.CharacterCode.ARROW_RIGHT]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.GreaterThanOrEqual,e):this.scanPunctuator(rt.Operator.GreaterThan,e)},[ye.CharacterCode.EXCLAMATION_MARK]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.NotEqual,e):(this.index++,null)},[ye.CharacterCode.MINUS]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.SubtractShorthand,e):this.scanPunctuator(rt.Operator.Minus,e)},[ye.CharacterCode.PLUS]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.AddShorthand,e):this.scanPunctuator(rt.Operator.Plus,e)},[ye.CharacterCode.ASTERISK]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.MultiplyShorthand,e):this.scanPunctuator(rt.Operator.Asterik,e)},[ye.CharacterCode.SLASH]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.DivideShorthand,e):this.scanPunctuator(rt.Operator.Slash,e)},[ye.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[ye.CharacterCode.CARET]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.PowerShorthand,e):this.scanPunctuator(rt.Operator.Power,e)},[ye.CharacterCode.PERCENT]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.ModuloShorthand,e):this.scanPunctuator(rt.Operator.Modulo,e)},[ye.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[ye.CharacterCode.COMMA]:$i,[ye.CharacterCode.CURLY_BRACKET_LEFT]:$i,[ye.CharacterCode.CURLY_BRACKET_RIGHT]:$i,[ye.CharacterCode.SQUARE_BRACKETS_LEFT]:$i,[ye.CharacterCode.SQUARE_BRACKETS_RIGHT]:$i,[ye.CharacterCode.PARENTHESIS_LEFT]:$i,[ye.CharacterCode.PARENTHESIS_RIGHT]:$i,[ye.CharacterCode.AT_SIGN]:$i}});var it=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.ASTComment=In.ASTBaseBlockWithScope=In.ASTBaseBlock=In.ASTBase=In.ASTType=void 0;var sA;(function(t){t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.ReturnStatement="ReturnStatement",t.IfShortcutStatement="IfShortcutStatement",t.IfShortcutClause="IfShortcutClause",t.ElseifShortcutClause="ElseifShortcutClause",t.ElseShortcutClause="ElseShortcutClause",t.IfStatement="IfStatement",t.IfClause="IfClause",t.ElseifClause="ElseifClause",t.ElseClause="ElseClause",t.WhileStatement="WhileStatement",t.AssignmentStatement="AssignmentStatement",t.CallStatement="CallStatement",t.FunctionDeclaration="FunctionDeclaration",t.ForGenericStatement="ForGenericStatement",t.Chunk="Chunk",t.Identifier="Identifier",t.StringLiteral="StringLiteral",t.NumericLiteral="NumericLiteral",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.Unknown="Unknown",t.MemberExpression="MemberExpression",t.CallExpression="CallExpression",t.Comment="Comment",t.NegationExpression="NegationExpression",t.BinaryNegatedExpression="BinaryNegatedExpression",t.UnaryExpression="UnaryExpression",t.MapKeyString="MapKeyString",t.MapValue="MapValue",t.MapConstructorExpression="MapConstructorExpression",t.MapCallExpression="MapCallExpression",t.ListValue="ListValue",t.ListConstructorExpression="ListConstructorExpression",t.EmptyExpression="EmptyExpression",t.IndexExpression="IndexExpression",t.BinaryExpression="BinaryExpression",t.LogicalExpression="LogicalExpression",t.IsaExpression="IsaExpression",t.SliceExpression="SliceExpression",t.ImportCodeExpression="ImportCodeExpression",t.InvalidCodeExpression="InvalidCodeExpression",t.ParenthesisExpression="ParenthesisExpression",t.ComparisonGroupExpression="ComparisonGroupExpression"})(sA=In.ASTType||(In.ASTType={}));var nu=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,this.range=n.range,this.scope=n.scope||null}toString(){return`${this.type}[${this.start}-${this.end}][]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTBase=nu;var oh=class t extends nu{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
|
33
|
+
`,"\r"];var jT;(function(p){function x(P,$,ge,ft){return new uP(P,$,ge,ft)}p.create=x;function k(P){var $=P;return!!(I.defined($)&&I.string($.uri)&&(I.undefined($.languageId)||I.string($.languageId))&&I.uinteger($.lineCount)&&I.func($.getText)&&I.func($.positionAt)&&I.func($.offsetAt))}p.is=k;function y(P,$){for(var ge=P.getText(),ft=f($,function(co,Fc){var FT=co.range.start.line-Fc.range.start.line;return FT===0?co.range.start.character-Fc.range.start.character:FT}),ze=ge.length,pr=ft.length-1;pr>=0;pr--){var gr=ft[pr],ai=P.offsetAt(gr.range.start),Ae=P.offsetAt(gr.range.end);if(Ae<=ze)ge=ge.substring(0,ai)+gr.newText+ge.substring(Ae,ge.length);else throw new Error("Overlapping edit");ze=ai}return ge}p.applyEdits=y;function f(P,$){if(P.length<=1)return P;var ge=P.length/2|0,ft=P.slice(0,ge),ze=P.slice(ge);f(ft,$),f(ze,$);for(var pr=0,gr=0,ai=0;pr<ft.length&&gr<ze.length;){var Ae=$(ft[pr],ze[gr]);Ae<=0?P[ai++]=ft[pr++]:P[ai++]=ze[gr++]}for(;pr<ft.length;)P[ai++]=ft[pr++];for(;gr<ze.length;)P[ai++]=ze[gr++];return P}})(jT||(e.TextDocument=jT={}));var uP=function(){function p(x,k,y,f){this._uri=x,this._languageId=k,this._version=y,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(p.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),p.prototype.getText=function(x){if(x){var k=this.offsetAt(x.start),y=this.offsetAt(x.end);return this._content.substring(k,y)}return this._content},p.prototype.update=function(x,k){this._content=x.text,this._version=k,this._lineOffsets=void 0},p.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var x=[],k=this._content,y=!0,f=0;f<k.length;f++){y&&(x.push(f),y=!1);var P=k.charAt(f);y=P==="\r"||P===`
|
34
|
+
`,P==="\r"&&f+1<k.length&&k.charAt(f+1)===`
|
35
|
+
`&&f++}y&&k.length>0&&x.push(k.length),this._lineOffsets=x}return this._lineOffsets},p.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var k=this.getLineOffsets(),y=0,f=k.length;if(f===0)return o.create(0,x);for(;y<f;){var P=Math.floor((y+f)/2);k[P]>x?f=P:y=P+1}var $=y-1;return o.create($,x-k[$])},p.prototype.offsetAt=function(x){var k=this.getLineOffsets();if(x.line>=k.length)return this._content.length;if(x.line<0)return 0;var y=k[x.line],f=x.line+1<k.length?k[x.line+1]:this._content.length;return Math.max(Math.min(y+x.character,f),y)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),I;(function(p){var x=Object.prototype.toString;function k(Ae){return typeof Ae<"u"}p.defined=k;function y(Ae){return typeof Ae>"u"}p.undefined=y;function f(Ae){return Ae===!0||Ae===!1}p.boolean=f;function P(Ae){return x.call(Ae)==="[object String]"}p.string=P;function $(Ae){return x.call(Ae)==="[object Number]"}p.number=$;function ge(Ae,co,Fc){return x.call(Ae)==="[object Number]"&&co<=Ae&&Ae<=Fc}p.numberRange=ge;function ft(Ae){return x.call(Ae)==="[object Number]"&&-2147483648<=Ae&&Ae<=2147483647}p.integer=ft;function ze(Ae){return x.call(Ae)==="[object Number]"&&0<=Ae&&Ae<=2147483647}p.uinteger=ze;function pr(Ae){return x.call(Ae)==="[object Function]"}p.func=pr;function gr(Ae){return Ae!==null&&typeof Ae=="object"}p.objectLiteral=gr;function ai(Ae,co){return Array.isArray(Ae)&&Ae.every(co)}p.typedArray=ai})(I||(I={}))})});var tt=m(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.ProtocolNotificationType=Sn.ProtocolNotificationType0=Sn.ProtocolRequestType=Sn.ProtocolRequestType0=Sn.RegistrationType=Sn.MessageDirection=void 0;var _o=_s(),vw;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(vw||(Sn.MessageDirection=vw={}));var Zg=class{constructor(e){this.method=e}};Sn.RegistrationType=Zg;var em=class extends _o.RequestType0{constructor(e){super(e)}};Sn.ProtocolRequestType0=em;var tm=class extends _o.RequestType{constructor(e){super(e,_o.ParameterStructures.byName)}};Sn.ProtocolRequestType=tm;var nm=class extends _o.NotificationType0{constructor(e){super(e)}};Sn.ProtocolNotificationType0=nm;var rm=class extends _o.NotificationType{constructor(e){super(e,_o.ParameterStructures.byName)}};Sn.ProtocolNotificationType=rm});var ll=m(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.objectLiteral=Ct.typedArray=Ct.stringArray=Ct.array=Ct.func=Ct.error=Ct.number=Ct.string=Ct.boolean=void 0;function nI(t){return t===!0||t===!1}Ct.boolean=nI;function Sw(t){return typeof t=="string"||t instanceof String}Ct.string=Sw;function rI(t){return typeof t=="number"||t instanceof Number}Ct.number=rI;function iI(t){return t instanceof Error}Ct.error=iI;function sI(t){return typeof t=="function"}Ct.func=sI;function Tw(t){return Array.isArray(t)}Ct.array=Tw;function oI(t){return Tw(t)&&t.every(e=>Sw(e))}Ct.stringArray=oI;function aI(t,e){return Array.isArray(t)&&t.every(e)}Ct.typedArray=aI;function uI(t){return t!==null&&typeof t=="object"}Ct.objectLiteral=uI});var xw=m(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.ImplementationRequest=void 0;var ww=tt(),Ew;(function(t){t.method="textDocument/implementation",t.messageDirection=ww.MessageDirection.clientToServer,t.type=new ww.ProtocolRequestType(t.method)})(Ew||(hl.ImplementationRequest=Ew={}))});var Cw=m(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.TypeDefinitionRequest=void 0;var Aw=tt(),kw;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Aw.MessageDirection.clientToServer,t.type=new Aw.ProtocolRequestType(t.method)})(kw||(dl.TypeDefinitionRequest=kw={}))});var Dw=m(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.DidChangeWorkspaceFoldersNotification=vo.WorkspaceFoldersRequest=void 0;var fl=tt(),Ow;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=fl.MessageDirection.serverToClient,t.type=new fl.ProtocolRequestType0(t.method)})(Ow||(vo.WorkspaceFoldersRequest=Ow={}));var Rw;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=fl.MessageDirection.clientToServer,t.type=new fl.ProtocolNotificationType(t.method)})(Rw||(vo.DidChangeWorkspaceFoldersNotification=Rw={}))});var Mw=m(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.ConfigurationRequest=void 0;var Pw=tt(),Iw;(function(t){t.method="workspace/configuration",t.messageDirection=Pw.MessageDirection.serverToClient,t.type=new Pw.ProtocolRequestType(t.method)})(Iw||(pl.ConfigurationRequest=Iw={}))});var qw=m(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.ColorPresentationRequest=So.DocumentColorRequest=void 0;var gl=tt(),Lw;(function(t){t.method="textDocument/documentColor",t.messageDirection=gl.MessageDirection.clientToServer,t.type=new gl.ProtocolRequestType(t.method)})(Lw||(So.DocumentColorRequest=Lw={}));var Nw;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=gl.MessageDirection.clientToServer,t.type=new gl.ProtocolRequestType(t.method)})(Nw||(So.ColorPresentationRequest=Nw={}))});var $w=m(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.FoldingRangeRefreshRequest=To.FoldingRangeRequest=void 0;var ml=tt(),jw;(function(t){t.method="textDocument/foldingRange",t.messageDirection=ml.MessageDirection.clientToServer,t.type=new ml.ProtocolRequestType(t.method)})(jw||(To.FoldingRangeRequest=jw={}));var Fw;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=ml.MessageDirection.serverToClient,t.type=new ml.ProtocolRequestType0(t.method)})(Fw||(To.FoldingRangeRefreshRequest=Fw={}))});var Uw=m(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.DeclarationRequest=void 0;var Bw=tt(),Ww;(function(t){t.method="textDocument/declaration",t.messageDirection=Bw.MessageDirection.clientToServer,t.type=new Bw.ProtocolRequestType(t.method)})(Ww||(yl.DeclarationRequest=Ww={}))});var zw=m(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.SelectionRangeRequest=void 0;var Hw=tt(),Gw;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Hw.MessageDirection.clientToServer,t.type=new Hw.ProtocolRequestType(t.method)})(Gw||(bl.SelectionRangeRequest=Gw={}))});var Yw=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.WorkDoneProgressCancelNotification=Pi.WorkDoneProgressCreateRequest=Pi.WorkDoneProgress=void 0;var cI=_s(),_l=tt(),Kw;(function(t){t.type=new cI.ProgressType;function e(n){return n===t.type}t.is=e})(Kw||(Pi.WorkDoneProgress=Kw={}));var Vw;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=_l.MessageDirection.serverToClient,t.type=new _l.ProtocolRequestType(t.method)})(Vw||(Pi.WorkDoneProgressCreateRequest=Vw={}));var Xw;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=_l.MessageDirection.clientToServer,t.type=new _l.ProtocolNotificationType(t.method)})(Xw||(Pi.WorkDoneProgressCancelNotification=Xw={}))});var e0=m(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.CallHierarchyOutgoingCallsRequest=Ii.CallHierarchyIncomingCallsRequest=Ii.CallHierarchyPrepareRequest=void 0;var wo=tt(),Jw;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=wo.MessageDirection.clientToServer,t.type=new wo.ProtocolRequestType(t.method)})(Jw||(Ii.CallHierarchyPrepareRequest=Jw={}));var Qw;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=wo.MessageDirection.clientToServer,t.type=new wo.ProtocolRequestType(t.method)})(Qw||(Ii.CallHierarchyIncomingCallsRequest=Qw={}));var Zw;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=wo.MessageDirection.clientToServer,t.type=new wo.ProtocolRequestType(t.method)})(Zw||(Ii.CallHierarchyOutgoingCallsRequest=Zw={}))});var o0=m(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.SemanticTokensRefreshRequest=Tn.SemanticTokensRangeRequest=Tn.SemanticTokensDeltaRequest=Tn.SemanticTokensRequest=Tn.SemanticTokensRegistrationType=Tn.TokenFormat=void 0;var ci=tt(),t0;(function(t){t.Relative="relative"})(t0||(Tn.TokenFormat=t0={}));var $a;(function(t){t.method="textDocument/semanticTokens",t.type=new ci.RegistrationType(t.method)})($a||(Tn.SemanticTokensRegistrationType=$a={}));var n0;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=ci.MessageDirection.clientToServer,t.type=new ci.ProtocolRequestType(t.method),t.registrationMethod=$a.method})(n0||(Tn.SemanticTokensRequest=n0={}));var r0;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=ci.MessageDirection.clientToServer,t.type=new ci.ProtocolRequestType(t.method),t.registrationMethod=$a.method})(r0||(Tn.SemanticTokensDeltaRequest=r0={}));var i0;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=ci.MessageDirection.clientToServer,t.type=new ci.ProtocolRequestType(t.method),t.registrationMethod=$a.method})(i0||(Tn.SemanticTokensRangeRequest=i0={}));var s0;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=ci.MessageDirection.serverToClient,t.type=new ci.ProtocolRequestType0(t.method)})(s0||(Tn.SemanticTokensRefreshRequest=s0={}))});var c0=m(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.ShowDocumentRequest=void 0;var a0=tt(),u0;(function(t){t.method="window/showDocument",t.messageDirection=a0.MessageDirection.serverToClient,t.type=new a0.ProtocolRequestType(t.method)})(u0||(vl.ShowDocumentRequest=u0={}))});var d0=m(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.LinkedEditingRangeRequest=void 0;var l0=tt(),h0;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=l0.MessageDirection.clientToServer,t.type=new l0.ProtocolRequestType(t.method)})(h0||(Sl.LinkedEditingRangeRequest=h0={}))});var v0=m(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.WillDeleteFilesRequest=en.DidDeleteFilesNotification=en.DidRenameFilesNotification=en.WillRenameFilesRequest=en.DidCreateFilesNotification=en.WillCreateFilesRequest=en.FileOperationPatternKind=void 0;var Wn=tt(),f0;(function(t){t.file="file",t.folder="folder"})(f0||(en.FileOperationPatternKind=f0={}));var p0;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(p0||(en.WillCreateFilesRequest=p0={}));var g0;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(g0||(en.DidCreateFilesNotification=g0={}));var m0;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(m0||(en.WillRenameFilesRequest=m0={}));var y0;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(y0||(en.DidRenameFilesNotification=y0={}));var b0;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(b0||(en.DidDeleteFilesNotification=b0={}));var _0;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(_0||(en.WillDeleteFilesRequest=_0={}))});var x0=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.MonikerRequest=Mi.MonikerKind=Mi.UniquenessLevel=void 0;var S0=tt(),T0;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(T0||(Mi.UniquenessLevel=T0={}));var w0;(function(t){t.$import="import",t.$export="export",t.local="local"})(w0||(Mi.MonikerKind=w0={}));var E0;(function(t){t.method="textDocument/moniker",t.messageDirection=S0.MessageDirection.clientToServer,t.type=new S0.ProtocolRequestType(t.method)})(E0||(Mi.MonikerRequest=E0={}))});var O0=m(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.TypeHierarchySubtypesRequest=Li.TypeHierarchySupertypesRequest=Li.TypeHierarchyPrepareRequest=void 0;var Eo=tt(),A0;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Eo.MessageDirection.clientToServer,t.type=new Eo.ProtocolRequestType(t.method)})(A0||(Li.TypeHierarchyPrepareRequest=A0={}));var k0;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Eo.MessageDirection.clientToServer,t.type=new Eo.ProtocolRequestType(t.method)})(k0||(Li.TypeHierarchySupertypesRequest=k0={}));var C0;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Eo.MessageDirection.clientToServer,t.type=new Eo.ProtocolRequestType(t.method)})(C0||(Li.TypeHierarchySubtypesRequest=C0={}))});var P0=m(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.InlineValueRefreshRequest=xo.InlineValueRequest=void 0;var Tl=tt(),R0;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Tl.MessageDirection.clientToServer,t.type=new Tl.ProtocolRequestType(t.method)})(R0||(xo.InlineValueRequest=R0={}));var D0;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Tl.MessageDirection.serverToClient,t.type=new Tl.ProtocolRequestType0(t.method)})(D0||(xo.InlineValueRefreshRequest=D0={}))});var N0=m(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.InlayHintRefreshRequest=Ni.InlayHintResolveRequest=Ni.InlayHintRequest=void 0;var Ao=tt(),I0;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Ao.MessageDirection.clientToServer,t.type=new Ao.ProtocolRequestType(t.method)})(I0||(Ni.InlayHintRequest=I0={}));var M0;(function(t){t.method="inlayHint/resolve",t.messageDirection=Ao.MessageDirection.clientToServer,t.type=new Ao.ProtocolRequestType(t.method)})(M0||(Ni.InlayHintResolveRequest=M0={}));var L0;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Ao.MessageDirection.serverToClient,t.type=new Ao.ProtocolRequestType0(t.method)})(L0||(Ni.InlayHintRefreshRequest=L0={}))});var U0=m(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.DiagnosticRefreshRequest=Un.WorkspaceDiagnosticRequest=Un.DocumentDiagnosticRequest=Un.DocumentDiagnosticReportKind=Un.DiagnosticServerCancellationData=void 0;var W0=_s(),lI=ll(),ko=tt(),q0;(function(t){function e(n){let r=n;return r&&lI.boolean(r.retriggerRequest)}t.is=e})(q0||(Un.DiagnosticServerCancellationData=q0={}));var j0;(function(t){t.Full="full",t.Unchanged="unchanged"})(j0||(Un.DocumentDiagnosticReportKind=j0={}));var F0;(function(t){t.method="textDocument/diagnostic",t.messageDirection=ko.MessageDirection.clientToServer,t.type=new ko.ProtocolRequestType(t.method),t.partialResult=new W0.ProgressType})(F0||(Un.DocumentDiagnosticRequest=F0={}));var $0;(function(t){t.method="workspace/diagnostic",t.messageDirection=ko.MessageDirection.clientToServer,t.type=new ko.ProtocolRequestType(t.method),t.partialResult=new W0.ProgressType})($0||(Un.WorkspaceDiagnosticRequest=$0={}));var B0;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=ko.MessageDirection.serverToClient,t.type=new ko.ProtocolRequestType0(t.method)})(B0||(Un.DiagnosticRefreshRequest=B0={}))});var Y0=m(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.DidCloseNotebookDocumentNotification=pt.DidSaveNotebookDocumentNotification=pt.DidChangeNotebookDocumentNotification=pt.NotebookCellArrayChange=pt.DidOpenNotebookDocumentNotification=pt.NotebookDocumentSyncRegistrationType=pt.NotebookDocument=pt.NotebookCell=pt.ExecutionSummary=pt.NotebookCellKind=void 0;var Ba=cl(),yr=ll(),Lr=tt(),im;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(im||(pt.NotebookCellKind=im={}));var sm;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return yr.objectLiteral(s)&&Ba.uinteger.is(s.executionOrder)&&(s.success===void 0||yr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(sm||(pt.ExecutionSummary=sm={}));var wl;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return yr.objectLiteral(o)&&im.is(o.kind)&&Ba.DocumentUri.is(o.document)&&(o.metadata===void 0||yr.objectLiteral(o.metadata))}t.is=n;function r(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!sm.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function i(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),u=Array.isArray(o);if(a!==u)return!1;if(a&&u){if(s.length!==o.length)return!1;for(let c=0;c<s.length;c++)if(!i(s[c],o[c]))return!1}if(yr.objectLiteral(s)&&yr.objectLiteral(o)){let c=Object.keys(s),l=Object.keys(o);if(c.length!==l.length||(c.sort(),l.sort(),!i(c,l)))return!1;for(let h=0;h<c.length;h++){let d=c[h];if(!i(s[d],o[d]))return!1}}return!0}})(wl||(pt.NotebookCell=wl={}));var H0;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return yr.objectLiteral(i)&&yr.string(i.uri)&&Ba.integer.is(i.version)&&yr.typedArray(i.cells,wl.is)}t.is=n})(H0||(pt.NotebookDocument=H0={}));var Co;(function(t){t.method="notebookDocument/sync",t.messageDirection=Lr.MessageDirection.clientToServer,t.type=new Lr.RegistrationType(t.method)})(Co||(pt.NotebookDocumentSyncRegistrationType=Co={}));var G0;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Lr.MessageDirection.clientToServer,t.type=new Lr.ProtocolNotificationType(t.method),t.registrationMethod=Co.method})(G0||(pt.DidOpenNotebookDocumentNotification=G0={}));var z0;(function(t){function e(r){let i=r;return yr.objectLiteral(i)&&Ba.uinteger.is(i.start)&&Ba.uinteger.is(i.deleteCount)&&(i.cells===void 0||yr.typedArray(i.cells,wl.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(z0||(pt.NotebookCellArrayChange=z0={}));var K0;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Lr.MessageDirection.clientToServer,t.type=new Lr.ProtocolNotificationType(t.method),t.registrationMethod=Co.method})(K0||(pt.DidChangeNotebookDocumentNotification=K0={}));var V0;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Lr.MessageDirection.clientToServer,t.type=new Lr.ProtocolNotificationType(t.method),t.registrationMethod=Co.method})(V0||(pt.DidSaveNotebookDocumentNotification=V0={}));var X0;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Lr.MessageDirection.clientToServer,t.type=new Lr.ProtocolNotificationType(t.method),t.registrationMethod=Co.method})(X0||(pt.DidCloseNotebookDocumentNotification=X0={}))});var Z0=m(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.InlineCompletionRequest=void 0;var J0=tt(),Q0;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=J0.MessageDirection.clientToServer,t.type=new J0.ProtocolRequestType(t.method)})(Q0||(El.InlineCompletionRequest=Q0={}))});var dx=m(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 U=tt(),eE=cl(),$t=ll(),hI=xw();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return hI.ImplementationRequest}});var dI=Cw();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return dI.TypeDefinitionRequest}});var ux=Dw();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return ux.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return ux.DidChangeWorkspaceFoldersNotification}});var fI=Mw();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return fI.ConfigurationRequest}});var cx=qw();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return cx.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return cx.ColorPresentationRequest}});var lx=$w();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return lx.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return lx.FoldingRangeRefreshRequest}});var pI=Uw();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return pI.DeclarationRequest}});var gI=zw();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return gI.SelectionRangeRequest}});var lm=Yw();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return lm.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return lm.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return lm.WorkDoneProgressCancelNotification}});var hm=e0();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return hm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return hm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return hm.CallHierarchyPrepareRequest}});var Oo=o0();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return Oo.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return Oo.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Oo.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Oo.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Oo.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Oo.SemanticTokensRegistrationType}});var mI=c0();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return mI.ShowDocumentRequest}});var yI=d0();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return yI.LinkedEditingRangeRequest}});var vs=v0();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return vs.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return vs.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return vs.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return vs.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return vs.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return vs.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return vs.WillDeleteFilesRequest}});var dm=x0();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return dm.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return dm.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return dm.MonikerRequest}});var fm=O0();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return fm.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return fm.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return fm.TypeHierarchySupertypesRequest}});var hx=P0();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return hx.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return hx.InlineValueRefreshRequest}});var pm=N0();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return pm.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return pm.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return pm.InlayHintRefreshRequest}});var Wa=U0();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Wa.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Wa.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Wa.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Wa.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Wa.DiagnosticRefreshRequest}});var Nr=Y0();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return Nr.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return Nr.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return Nr.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return Nr.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Nr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Nr.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Nr.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Nr.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Nr.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Nr.DidCloseNotebookDocumentNotification}});var bI=Z0();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return bI.InlineCompletionRequest}});var om;(function(t){function e(n){let r=n;return $t.string(r)||$t.string(r.language)||$t.string(r.scheme)||$t.string(r.pattern)}t.is=e})(om||(S.TextDocumentFilter=om={}));var am;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebookType)||$t.string(r.scheme)||$t.string(r.pattern))}t.is=e})(am||(S.NotebookDocumentFilter=am={}));var um;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebook)||am.is(r.notebook))&&(r.language===void 0||$t.string(r.language))}t.is=e})(um||(S.NotebookCellTextDocumentFilter=um={}));var cm;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!$t.string(r)&&!om.is(r)&&!um.is(r))return!1;return!0}t.is=e})(cm||(S.DocumentSelector=cm={}));var tE;(function(t){t.method="client/registerCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(tE||(S.RegistrationRequest=tE={}));var nE;(function(t){t.method="client/unregisterCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(nE||(S.UnregistrationRequest=nE={}));var rE;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(rE||(S.ResourceOperationKind=rE={}));var iE;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(iE||(S.FailureHandlingKind=iE={}));var sE;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(sE||(S.PositionEncodingKind=sE={}));var oE;(function(t){function e(n){let r=n;return r&&$t.string(r.id)&&r.id.length>0}t.hasId=e})(oE||(S.StaticRegistrationOptions=oE={}));var aE;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||cm.is(r.documentSelector))}t.is=e})(aE||(S.TextDocumentRegistrationOptions=aE={}));var uE;(function(t){function e(r){let i=r;return $t.objectLiteral(i)&&(i.workDoneProgress===void 0||$t.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&$t.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(uE||(S.WorkDoneProgressOptions=uE={}));var cE;(function(t){t.method="initialize",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(cE||(S.InitializeRequest=cE={}));var lE;(function(t){t.unknownProtocolVersion=1})(lE||(S.InitializeErrorCodes=lE={}));var hE;(function(t){t.method="initialized",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(hE||(S.InitializedNotification=hE={}));var dE;(function(t){t.method="shutdown",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType0(t.method)})(dE||(S.ShutdownRequest=dE={}));var fE;(function(t){t.method="exit",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType0(t.method)})(fE||(S.ExitNotification=fE={}));var pE;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(pE||(S.DidChangeConfigurationNotification=pE={}));var gE;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(gE||(S.MessageType=gE={}));var mE;(function(t){t.method="window/showMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(mE||(S.ShowMessageNotification=mE={}));var yE;(function(t){t.method="window/showMessageRequest",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(yE||(S.ShowMessageRequest=yE={}));var bE;(function(t){t.method="window/logMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(bE||(S.LogMessageNotification=bE={}));var _E;(function(t){t.method="telemetry/event",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(_E||(S.TelemetryEventNotification=_E={}));var vE;(function(t){t.None=0,t.Full=1,t.Incremental=2})(vE||(S.TextDocumentSyncKind=vE={}));var SE;(function(t){t.method="textDocument/didOpen",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(SE||(S.DidOpenTextDocumentNotification=SE={}));var TE;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(TE||(S.TextDocumentContentChangeEvent=TE={}));var wE;(function(t){t.method="textDocument/didChange",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(wE||(S.DidChangeTextDocumentNotification=wE={}));var EE;(function(t){t.method="textDocument/didClose",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(EE||(S.DidCloseTextDocumentNotification=EE={}));var xE;(function(t){t.method="textDocument/didSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(xE||(S.DidSaveTextDocumentNotification=xE={}));var AE;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(AE||(S.TextDocumentSaveReason=AE={}));var kE;(function(t){t.method="textDocument/willSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(kE||(S.WillSaveTextDocumentNotification=kE={}));var CE;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(CE||(S.WillSaveTextDocumentWaitUntilRequest=CE={}));var OE;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(OE||(S.DidChangeWatchedFilesNotification=OE={}));var RE;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(RE||(S.FileChangeType=RE={}));var DE;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&(eE.URI.is(r.baseUri)||eE.WorkspaceFolder.is(r.baseUri))&&$t.string(r.pattern)}t.is=e})(DE||(S.RelativePattern=DE={}));var PE;(function(t){t.Create=1,t.Change=2,t.Delete=4})(PE||(S.WatchKind=PE={}));var IE;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(IE||(S.PublishDiagnosticsNotification=IE={}));var ME;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(ME||(S.CompletionTriggerKind=ME={}));var LE;(function(t){t.method="textDocument/completion",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(LE||(S.CompletionRequest=LE={}));var NE;(function(t){t.method="completionItem/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(NE||(S.CompletionResolveRequest=NE={}));var qE;(function(t){t.method="textDocument/hover",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(qE||(S.HoverRequest=qE={}));var jE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(jE||(S.SignatureHelpTriggerKind=jE={}));var FE;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(FE||(S.SignatureHelpRequest=FE={}));var $E;(function(t){t.method="textDocument/definition",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})($E||(S.DefinitionRequest=$E={}));var BE;(function(t){t.method="textDocument/references",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(BE||(S.ReferencesRequest=BE={}));var WE;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(WE||(S.DocumentHighlightRequest=WE={}));var UE;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(UE||(S.DocumentSymbolRequest=UE={}));var HE;(function(t){t.method="textDocument/codeAction",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(HE||(S.CodeActionRequest=HE={}));var GE;(function(t){t.method="codeAction/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(GE||(S.CodeActionResolveRequest=GE={}));var zE;(function(t){t.method="workspace/symbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(zE||(S.WorkspaceSymbolRequest=zE={}));var KE;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(KE||(S.WorkspaceSymbolResolveRequest=KE={}));var VE;(function(t){t.method="textDocument/codeLens",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(VE||(S.CodeLensRequest=VE={}));var XE;(function(t){t.method="codeLens/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(XE||(S.CodeLensResolveRequest=XE={}));var YE;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType0(t.method)})(YE||(S.CodeLensRefreshRequest=YE={}));var JE;(function(t){t.method="textDocument/documentLink",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(JE||(S.DocumentLinkRequest=JE={}));var QE;(function(t){t.method="documentLink/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(QE||(S.DocumentLinkResolveRequest=QE={}));var ZE;(function(t){t.method="textDocument/formatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ZE||(S.DocumentFormattingRequest=ZE={}));var ex;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ex||(S.DocumentRangeFormattingRequest=ex={}));var tx;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(tx||(S.DocumentRangesFormattingRequest=tx={}));var nx;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(nx||(S.DocumentOnTypeFormattingRequest=nx={}));var rx;(function(t){t.Identifier=1})(rx||(S.PrepareSupportDefaultBehavior=rx={}));var ix;(function(t){t.method="textDocument/rename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ix||(S.RenameRequest=ix={}));var sx;(function(t){t.method="textDocument/prepareRename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(sx||(S.PrepareRenameRequest=sx={}));var ox;(function(t){t.method="workspace/executeCommand",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ox||(S.ExecuteCommandRequest=ox={}));var ax;(function(t){t.method="workspace/applyEdit",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType("workspace/applyEdit")})(ax||(S.ApplyWorkspaceEditRequest=ax={}))});var px=m(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.createProtocolConnection=void 0;var fx=_s();function _I(t,e,n,r){return fx.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,fx.createMessageConnection)(t,e,n,r)}xl.createProtocolConnection=_I});var mx=m(wn=>{"use strict";var vI=wn&&wn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Al=wn&&wn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&vI(e,t,n)};Object.defineProperty(wn,"__esModule",{value:!0});wn.LSPErrorCodes=wn.createProtocolConnection=void 0;Al(_s(),wn);Al(cl(),wn);Al(tt(),wn);Al(dx(),wn);var SI=px();Object.defineProperty(wn,"createProtocolConnection",{enumerable:!0,get:function(){return SI.createProtocolConnection}});var gx;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(gx||(wn.LSPErrorCodes=gx={}))});var vt=m(qr=>{"use strict";var TI=qr&&qr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),yx=qr&&qr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TI(e,t,n)};Object.defineProperty(qr,"__esModule",{value:!0});qr.createProtocolConnection=void 0;var wI=Qg();yx(Qg(),qr);yx(mx(),qr);function EI(t,e,n,r){return(0,wI.createMessageConnection)(t,e,n,r)}qr.createProtocolConnection=EI});var gm=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.generateUuid=Hn.parse=Hn.isUUID=Hn.v4=Hn.empty=void 0;var Ua=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Ha=class t extends Ua{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};Ha._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Ha._timeHighBits=["8","9","a","b"];Hn.empty=new Ua("00000000-0000-0000-0000-000000000000");function bx(){return new Ha}Hn.v4=bx;var xI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function _x(t){return xI.test(t)}Hn.isUUID=_x;function AI(t){if(!_x(t))throw new Error("invalid uuid");return new Ua(t)}Hn.parse=AI;function kI(){return bx().asHex()}Hn.generateUuid=kI});var vx=m(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.attachPartialResult=ji.ProgressFeature=ji.attachWorkDone=void 0;var qi=vt(),CI=gm(),Ss=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(qi.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(qi.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(qi.WorkDoneProgress.type,this._token,{kind:"end"})}};Ss.Instances=new Map;var kl=class extends Ss{constructor(e,n){super(e,n),this._source=new qi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ga=class{constructor(){}begin(){}report(){}done(){}},Cl=class extends Ga{constructor(){super(),this._source=new qi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function OI(t,e){if(e===void 0||e.workDoneToken===void 0)return new Ga;let n=e.workDoneToken;return delete e.workDoneToken,new Ss(t,n)}ji.attachWorkDone=OI;var RI=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(qi.WorkDoneProgressCancelNotification.type,n=>{let r=Ss.Instances.get(n.token);(r instanceof kl||r instanceof Cl)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ga:new Ss(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,CI.generateUuid)();return this.connection.sendRequest(qi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new kl(this.connection,e))}else return Promise.resolve(new Cl)}};ji.ProgressFeature=RI;var mm;(function(t){t.type=new qi.ProgressType})(mm||(mm={}));var ym=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(mm.type,this._token,e)}};function DI(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new ym(t,n)}ji.attachPartialResult=DI});var Sx=m(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.ConfigurationFeature=void 0;var PI=vt(),II=$c(),MI=t=>class extends t{getConfiguration(e){return e?II.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(PI.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Ol.ConfigurationFeature=MI});var Tx=m(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.WorkspaceFoldersFeature=void 0;var Rl=vt(),LI=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Rl.Emitter,this.connection.onNotification(Rl.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Rl.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(Rl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Dl.WorkspaceFoldersFeature=LI});var wx=m(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.CallHierarchyFeature=void 0;var bm=vt(),NI=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(bm.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=bm.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=bm.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Pl.CallHierarchyFeature=NI});var vm=m(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.SemanticTokensBuilder=Fi.SemanticTokensDiff=Fi.SemanticTokensFeature=void 0;var Il=vt(),qI=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Il.SemanticTokensRefreshRequest.type),on:e=>{let n=Il.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Il.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Il.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Fi.SemanticTokensFeature=qI;var Ml=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Fi.SemanticTokensDiff=Ml;var _m=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Ml(this._prevData,this._data).computeDiff()}:this.build()}};Fi.SemanticTokensBuilder=_m});var Ex=m(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.ShowDocumentFeature=void 0;var jI=vt(),FI=t=>class extends t{showDocument(e){return this.connection.sendRequest(jI.ShowDocumentRequest.type,e)}};Ll.ShowDocumentFeature=FI});var xx=m(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.FileOperationsFeature=void 0;var Ro=vt(),$I=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ro.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Ro.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Ro.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Ro.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Ro.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Ro.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Nl.FileOperationsFeature=$I});var Ax=m(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.LinkedEditingRangeFeature=void 0;var BI=vt(),WI=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(BI.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};ql.LinkedEditingRangeFeature=WI});var kx=m(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.TypeHierarchyFeature=void 0;var Sm=vt(),UI=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Sm.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=Sm.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=Sm.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};jl.TypeHierarchyFeature=UI});var Ox=m(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.InlineValueFeature=void 0;var Cx=vt(),HI=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Cx.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(Cx.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Fl.InlineValueFeature=HI});var Dx=m($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.FoldingRangeFeature=void 0;var Rx=vt(),GI=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Rx.FoldingRangeRefreshRequest.type),on:e=>{let n=Rx.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};$l.FoldingRangeFeature=GI});var Px=m(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.InlayHintFeature=void 0;var Tm=vt(),zI=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Tm.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Tm.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(Tm.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Bl.InlayHintFeature=zI});var Ix=m(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.DiagnosticFeature=void 0;var za=vt(),KI=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(za.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(za.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(za.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(za.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(za.WorkspaceDiagnosticRequest.partialResult,n)))}}};Wl.DiagnosticFeature=KI});var Em=m(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.TextDocuments=void 0;var Ts=vt(),wm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Ts.Emitter,this._onDidOpen=new Ts.Emitter,this._onDidClose=new Ts.Emitter,this._onDidSave=new Ts.Emitter,this._onWillSave=new Ts.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Ts.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Ts.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Ul.TextDocuments=wm});var Am=m(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.NotebookDocuments=Do.NotebookSyncFeature=void 0;var Gn=vt(),Mx=Em(),VI=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Gn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Gn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Gn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Gn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Do.NotebookSyncFeature=VI;var Hl=class t{onDidOpenTextDocument(e){return this.openHandler=e,Gn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Gn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Gn.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Hl.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var xm=class{constructor(e){e instanceof Mx.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Mx.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Gn.Emitter,this._onDidChange=new Gn.Emitter,this._onDidSave=new Gn.Emitter,this._onDidClose=new Gn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new Hl,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,u=i.change;u.metadata!==void 0&&(a=!0,s.metadata=u.metadata);let c=[],l=[],h=[],d=[];if(u.cells!==void 0){let A=u.cells;if(A.structure!==void 0){let w=A.structure.array;if(s.cells.splice(w.start,w.deleteCount,...w.cells!==void 0?w.cells:[]),A.structure.didOpen!==void 0)for(let T of A.structure.didOpen)n.openTextDocument({textDocument:T}),c.push(T.uri);if(A.structure.didClose)for(let T of A.structure.didClose)n.closeTextDocument({textDocument:T}),l.push(T.uri)}if(A.data!==void 0){let w=new Map(A.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let v=w.get(s.cells[T].document);if(v!==void 0){let L=s.cells.splice(T,1,v);if(h.push({old:L[0],new:v}),w.delete(v.document),w.size===0)break}}}if(A.textContent!==void 0)for(let w of A.textContent)n.changeTextDocument({textDocument:w.document,contentChanges:w.changes}),d.push(w.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let _=[];for(let A of c)_.push(this.getNotebookCell(A));let b=[];for(let A of l)b.push(this.getNotebookCell(A));let C=[];for(let A of d)C.push(this.getNotebookCell(A));(_.length>0||b.length>0||h.length>0||C.length>0)&&(g.cells={added:_,removed:b,changed:{data:h,textContent:C}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Gn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};Do.NotebookDocuments=xm});var Lx=m(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.MonikerFeature=void 0;var XI=vt(),YI=t=>class extends t{get moniker(){return{on:e=>{let n=XI.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Gl.MonikerFeature=YI});var Pm=m(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createConnection=Ie.combineFeatures=Ie.combineNotebooksFeatures=Ie.combineLanguagesFeatures=Ie.combineWorkspaceFeatures=Ie.combineWindowFeatures=Ie.combineClientFeatures=Ie.combineTracerFeatures=Ie.combineTelemetryFeatures=Ie.combineConsoleFeatures=Ie._NotebooksImpl=Ie._LanguagesImpl=Ie.BulkUnregistration=Ie.BulkRegistration=Ie.ErrorMessageTracker=void 0;var K=vt(),zn=$c(),Cm=gm(),fe=vx(),JI=Sx(),QI=Tx(),ZI=wx(),eM=vm(),tM=Ex(),nM=xx(),rM=Ax(),iM=kx(),sM=Ox(),oM=Dx(),aM=Px(),uM=Ix(),cM=Am(),lM=Lx();function km(t){if(t!==null)return t}var Om=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Ie.ErrorMessageTracker=Om;var zl=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(K.MessageType.Error,e)}warn(e){this.send(K.MessageType.Warning,e)}info(e){this.send(K.MessageType.Info,e)}log(e){this.send(K.MessageType.Log,e)}debug(e){this.send(K.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(K.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,K.RAL)().console.error("Sending log message failed")})}},Rm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:K.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(K.ShowMessageRequest.type,r).then(km)}showWarningMessage(e,...n){let r={type:K.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(K.ShowMessageRequest.type,r).then(km)}showInformationMessage(e,...n){let r={type:K.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(K.ShowMessageRequest.type,r).then(km)}},Nx=(0,tM.ShowDocumentFeature)((0,fe.ProgressFeature)(Rm)),qx;(function(t){function e(){return new Kl}t.create=e})(qx||(Ie.BulkRegistration=qx={}));var Kl=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=zn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=Cm.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},jx;(function(t){function e(){return new Ka(void 0,[])}t.create=e})(jx||(Ie.BulkUnregistration=jx={}));var Ka=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(K.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=zn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(K.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Vl=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Kl?this.registerMany(e):e instanceof Ka?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=zn.string(n)?n:n.method,s=Cm.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(K.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=zn.string(e)?e:e.method,i=Cm.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(K.RegistrationRequest.type,s).then(o=>K.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(K.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(K.RegistrationRequest.type,n).then(()=>new Ka(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Dm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(K.ApplyWorkspaceEditRequest.type,r)}},Fx=(0,nM.FileOperationsFeature)((0,QI.WorkspaceFoldersFeature)((0,JI.ConfigurationFeature)(Dm))),Xl=class{constructor(){this._trace=K.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==K.Trace.Off&&this.connection.sendNotification(K.LogTraceNotification.type,{message:e,verbose:this._trace===K.Trace.Verbose?n:void 0}).catch(()=>{})}},Yl=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(K.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Jl=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,fe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,fe.attachPartialResult)(this.connection,n)}};Ie._LanguagesImpl=Jl;var $x=(0,oM.FoldingRangeFeature)((0,lM.MonikerFeature)((0,uM.DiagnosticFeature)((0,aM.InlayHintFeature)((0,sM.InlineValueFeature)((0,iM.TypeHierarchyFeature)((0,rM.LinkedEditingRangeFeature)((0,eM.SemanticTokensFeature)((0,ZI.CallHierarchyFeature)(Jl))))))))),Ql=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,fe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,fe.attachPartialResult)(this.connection,n)}};Ie._NotebooksImpl=Ql;var Bx=(0,cM.NotebookSyncFeature)(Ql);function Wx(t,e){return function(n){return e(t(n))}}Ie.combineConsoleFeatures=Wx;function Ux(t,e){return function(n){return e(t(n))}}Ie.combineTelemetryFeatures=Ux;function Hx(t,e){return function(n){return e(t(n))}}Ie.combineTracerFeatures=Hx;function Gx(t,e){return function(n){return e(t(n))}}Ie.combineClientFeatures=Gx;function zx(t,e){return function(n){return e(t(n))}}Ie.combineWindowFeatures=zx;function Kx(t,e){return function(n){return e(t(n))}}Ie.combineWorkspaceFeatures=Kx;function Vx(t,e){return function(n){return e(t(n))}}Ie.combineLanguagesFeatures=Vx;function Xx(t,e){return function(n){return e(t(n))}}Ie.combineNotebooksFeatures=Xx;function hM(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Wx),tracer:n(t.tracer,e.tracer,Hx),telemetry:n(t.telemetry,e.telemetry,Ux),client:n(t.client,e.client,Gx),window:n(t.window,e.window,zx),workspace:n(t.workspace,e.workspace,Kx),languages:n(t.languages,e.languages,Vx),notebooks:n(t.notebooks,e.notebooks,Xx)}}Ie.combineFeatures=hM;function dM(t,e,n){let r=n&&n.console?new(n.console(zl)):new zl,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Xl)):new Xl,o=n&&n.telemetry?new(n.telemetry(Yl)):new Yl,a=n&&n.client?new(n.client(Vl)):new Vl,u=n&&n.window?new(n.window(Nx)):new Nx,c=n&&n.workspace?new(n.workspace(Fx)):new Fx,l=n&&n.languages?new(n.languages($x)):new $x,h=n&&n.notebooks?new(n.notebooks(Bx)):new Bx,d=[r,s,o,a,u,c,l,h];function g(w){return w instanceof Promise?w:zn.thenable(w)?new Promise((T,v)=>{w.then(L=>T(L),L=>v(L))}):Promise.resolve(w)}let _,b,C,A={listen:()=>i.listen(),sendRequest:(w,...T)=>i.sendRequest(zn.string(w)?w:w.method,...T),onRequest:(w,T)=>i.onRequest(w,T),sendNotification:(w,T)=>{let v=zn.string(w)?w:w.method;return i.sendNotification(v,T)},onNotification:(w,T)=>i.onNotification(w,T),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:w=>(b=w,{dispose:()=>{b=void 0}}),onInitialized:w=>i.onNotification(K.InitializedNotification.type,w),onShutdown:w=>(_=w,{dispose:()=>{_=void 0}}),onExit:w=>(C=w,{dispose:()=>{C=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return u},get workspace(){return c},get languages(){return l},get notebooks(){return h},onDidChangeConfiguration:w=>i.onNotification(K.DidChangeConfigurationNotification.type,w),onDidChangeWatchedFiles:w=>i.onNotification(K.DidChangeWatchedFilesNotification.type,w),__textDocumentSync:void 0,onDidOpenTextDocument:w=>i.onNotification(K.DidOpenTextDocumentNotification.type,w),onDidChangeTextDocument:w=>i.onNotification(K.DidChangeTextDocumentNotification.type,w),onDidCloseTextDocument:w=>i.onNotification(K.DidCloseTextDocumentNotification.type,w),onWillSaveTextDocument:w=>i.onNotification(K.WillSaveTextDocumentNotification.type,w),onWillSaveTextDocumentWaitUntil:w=>i.onRequest(K.WillSaveTextDocumentWaitUntilRequest.type,w),onDidSaveTextDocument:w=>i.onNotification(K.DidSaveTextDocumentNotification.type,w),sendDiagnostics:w=>i.sendNotification(K.PublishDiagnosticsNotification.type,w),onHover:w=>i.onRequest(K.HoverRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onCompletion:w=>i.onRequest(K.CompletionRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onCompletionResolve:w=>i.onRequest(K.CompletionResolveRequest.type,w),onSignatureHelp:w=>i.onRequest(K.SignatureHelpRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onDeclaration:w=>i.onRequest(K.DeclarationRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onDefinition:w=>i.onRequest(K.DefinitionRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onTypeDefinition:w=>i.onRequest(K.TypeDefinitionRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onImplementation:w=>i.onRequest(K.ImplementationRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onReferences:w=>i.onRequest(K.ReferencesRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onDocumentHighlight:w=>i.onRequest(K.DocumentHighlightRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onDocumentSymbol:w=>i.onRequest(K.DocumentSymbolRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onWorkspaceSymbol:w=>i.onRequest(K.WorkspaceSymbolRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onWorkspaceSymbolResolve:w=>i.onRequest(K.WorkspaceSymbolResolveRequest.type,w),onCodeAction:w=>i.onRequest(K.CodeActionRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onCodeActionResolve:w=>i.onRequest(K.CodeActionResolveRequest.type,(T,v)=>w(T,v)),onCodeLens:w=>i.onRequest(K.CodeLensRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onCodeLensResolve:w=>i.onRequest(K.CodeLensResolveRequest.type,(T,v)=>w(T,v)),onDocumentFormatting:w=>i.onRequest(K.DocumentFormattingRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onDocumentRangeFormatting:w=>i.onRequest(K.DocumentRangeFormattingRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onDocumentOnTypeFormatting:w=>i.onRequest(K.DocumentOnTypeFormattingRequest.type,(T,v)=>w(T,v)),onRenameRequest:w=>i.onRequest(K.RenameRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),onPrepareRename:w=>i.onRequest(K.PrepareRenameRequest.type,(T,v)=>w(T,v)),onDocumentLinks:w=>i.onRequest(K.DocumentLinkRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onDocumentLinkResolve:w=>i.onRequest(K.DocumentLinkResolveRequest.type,(T,v)=>w(T,v)),onDocumentColor:w=>i.onRequest(K.DocumentColorRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onColorPresentation:w=>i.onRequest(K.ColorPresentationRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onFoldingRanges:w=>i.onRequest(K.FoldingRangeRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onSelectionRanges:w=>i.onRequest(K.SelectionRangeRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),(0,fe.attachPartialResult)(i,T))),onExecuteCommand:w=>i.onRequest(K.ExecuteCommandRequest.type,(T,v)=>w(T,v,(0,fe.attachWorkDone)(i,T),void 0)),dispose:()=>i.dispose()};for(let w of d)w.attach(A);return i.onRequest(K.InitializeRequest.type,w=>{e.initialize(w),zn.string(w.trace)&&(s.trace=K.Trace.fromString(w.trace));for(let T of d)T.initialize(w.capabilities);if(b){let T=b(w,new K.CancellationTokenSource().token,(0,fe.attachWorkDone)(i,w),void 0);return g(T).then(v=>{if(v instanceof K.ResponseError)return v;let L=v;L||(L={capabilities:{}});let R=L.capabilities;R||(R={},L.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=zn.number(A.__textDocumentSync)?A.__textDocumentSync:K.TextDocumentSyncKind.None:!zn.number(R.textDocumentSync)&&!zn.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=zn.number(A.__textDocumentSync)?A.__textDocumentSync:K.TextDocumentSyncKind.None);for(let B of d)B.fillServerCapabilities(R);return L})}else{let T={capabilities:{textDocumentSync:K.TextDocumentSyncKind.None}};for(let v of d)v.fillServerCapabilities(T.capabilities);return T}}),i.onRequest(K.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,_)return _(new K.CancellationTokenSource().token)}),i.onNotification(K.ExitNotification.type,()=>{try{C&&C()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(K.SetTraceNotification.type,w=>{s.trace=K.Trace.fromString(w.value)}),A}Ie.createConnection=dM});var Yx=m(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.resolveModulePath=En.FileSystem=En.resolveGlobalYarnPath=En.resolveGlobalNodePath=En.resolve=En.uriToFilePath=void 0;var fM=require("url"),br=require("path"),Im=require("fs"),qm=require("child_process");function pM(t){let e=fM.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return br.normalize(n.join("/"))}En.uriToFilePath=pM;function Mm(){return process.platform==="win32"}function Zl(t,e,n,r){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let u=process.env,c=Object.create(null);Object.keys(u).forEach(l=>c[l]=u[l]),e&&Im.existsSync(e)&&(c[i]?c[i]=e+br.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,qm.fork)("",[],{cwd:n,env:c,execArgv:["-e",s]});if(l.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}l.on("error",d=>{a(d)}),l.on("message",d=>{d.c==="r"&&(l.send({c:"e"}),d.s?o(d.r):a(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};l.send(h)}catch(l){a(l)}})}En.resolve=Zl;function Lm(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Mm()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,qm.spawnSync)(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?Mm()?br.join(o,"node_modules"):br.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}En.resolveGlobalNodePath=Lm;function gM(t){let e="yarn",n={encoding:"utf8"};Mm()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,qm.spawnSync)(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let u=JSON.parse(a);if(u.type==="log")return br.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}En.resolveGlobalYarnPath=gM;var Nm;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Im.existsSync(__filename.toUpperCase())||!Im.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?br.normalize(s).indexOf(br.normalize(i))===0:br.normalize(s).toLowerCase().indexOf(br.normalize(i).toLowerCase())===0}t.isParent=r})(Nm||(En.FileSystem=Nm={}));function mM(t,e,n,r){return n?(br.isAbsolute(n)||(n=br.join(t,n)),Zl(e,n,n,r).then(i=>Nm.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Zl(e,Lm(r),t,r))):Zl(e,Lm(r),t,r)}En.resolveModulePath=mM});var jm=m((kz,Jx)=>{"use strict";Jx.exports=vt()});var Qx=m(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.InlineCompletionFeature=void 0;var yM=vt(),bM=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(yM.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};eh.InlineCompletionFeature=bM});var tA=m(tn=>{"use strict";var _M=tn&&tn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),eA=tn&&tn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&_M(e,t,n)};Object.defineProperty(tn,"__esModule",{value:!0});tn.ProposedFeatures=tn.NotebookDocuments=tn.TextDocuments=tn.SemanticTokensBuilder=void 0;var vM=vm();Object.defineProperty(tn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return vM.SemanticTokensBuilder}});var SM=Qx();eA(vt(),tn);var TM=Em();Object.defineProperty(tn,"TextDocuments",{enumerable:!0,get:function(){return TM.TextDocuments}});var wM=Am();Object.defineProperty(tn,"NotebookDocuments",{enumerable:!0,get:function(){return wM.NotebookDocuments}});eA(Pm(),tn);var Zx;(function(t){t.all={__brand:"features",languages:SM.InlineCompletionFeature}})(Zx||(tn.ProposedFeatures=Zx={}))});var $m=m(Kn=>{"use strict";var EM=Kn&&Kn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),sA=Kn&&Kn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&EM(e,t,n)};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.createConnection=Kn.Files=void 0;var nA=require("node:util"),Fm=$c(),xM=Pm(),Va=Yx(),ws=jm();sA(jm(),Kn);sA(tA(),Kn);var rA;(function(t){t.uriToFilePath=Va.uriToFilePath,t.resolveGlobalNodePath=Va.resolveGlobalNodePath,t.resolveGlobalYarnPath=Va.resolveGlobalYarnPath,t.resolve=Va.resolve,t.resolveModulePath=Va.resolveModulePath})(rA||(Kn.Files=rA={}));var iA;function th(){if(iA!==void 0)try{iA.end()}catch{}}var Po=!1,oA;function AM(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(oA=setInterval(()=>{try{process.kill(r,0)}catch{th(),process.exit(Po?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}AM();var kM={initialize:t=>{let e=t.processId;Fm.number(e)&&oA===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Po?0:1)}},3e3)},get shutdownReceived(){return Po},set shutdownReceived(t){Po=t},exit:t=>{th(),process.exit(t)}};function CM(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),ws.ConnectionStrategy.is(t)||ws.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),OM(s,o,a,i)}Kn.createConnection=CM;function OM(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let h=0;h<l.length;h++){let d=l[h];if(d==="--node-ipc"){t=new ws.IPCMessageReader(process),e=new ws.IPCMessageWriter(process);break}else if(d==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(d==="--socket"){u=parseInt(l[h+1]);break}else if(d==="--pipe"){c=l[h+1];break}else{var s=d.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let h=(0,ws.createServerSocketTransport)(u);t=h[0],e=h[1]}else if(c){let h=(0,ws.createServerPipeTransport)(c);t=h[0],e=h[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Fm.func(t.read)&&Fm.func(t.on)){let u=t;u.on("end",()=>{th(),process.exit(Po?0:1)}),u.on("close",()=>{th(),process.exit(Po?0:1)})}let a=u=>{let c=(0,ws.createProtocolConnection)(t,e,u,n);return i&&RM(u),c};return(0,xM.createConnection)(a,kM,r)}function RM(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,nA.inspect)(i)).join(" ")}let n=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,nA.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
|
36
|
+
${s}`)},console.warn=function(...i){t.warn(e(i))}}});var Bm=m((Pz,aA)=>{"use strict";aA.exports=$m()});var $i=m(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.parseDependencyRawLocation=St.parseDependencyLocation=St.DependencyType=St.TypeAnalyzerStrategy=St.IndentationType=St.DefaultFileExtensions=St.ConfigurationNamespace=St.LanguageId=void 0;St.LanguageId="miniscript";St.ConfigurationNamespace="miniscript";St.DefaultFileExtensions=["ms"];var DM;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(DM=St.IndentationType||(St.IndentationType={}));var PM;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(PM=St.TypeAnalyzerStrategy||(St.TypeAnalyzerStrategy={}));var IM;(function(t){t.Include="include",t.Import="import"})(IM=St.DependencyType||(St.DependencyType={}));function MM(t){return t.args&&t.args.length>0?`${t.type}:${t.args.join(":")}!${t.location}`:`${t.type}!${t.location}`}St.parseDependencyLocation=MM;function LM(t){let e=t.indexOf("!"),[n,...r]=t.substring(0,e).split(":"),i=t.substring(e+1);return{type:n,location:i,args:r}}St.parseDependencyRawLocation=LM});var Xa=m(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.Position=void 0;var Wm=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};nh.Position=Wm});var Bi=m(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.LiteralToken=Pn.Token=Pn.BaseToken=Pn.BaseTokenOptions=Pn.TokenType=void 0;var uA=Xa(),NM;(function(t){t.EOF="EOF",t.StringLiteral="StringLiteral",t.Keyword="Keyword",t.Identifier="Identifier",t.NumericLiteral="NumericLiteral",t.Punctuator="Punctuator",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.EOL="EOL",t.SliceOperator="SliceOperator",t.Comment="Comment",t.Invalid="Invalid"})(NM=Pn.TokenType||(Pn.TokenType={}));var Um=class{};Pn.BaseTokenOptions=Um;var Ya=class{constructor(e){this.type=e.type,this.value=e.value,this.line=e.line,this.lineStart=e.lineStart,this.range=e.range,this.lastLine=e.lastLine,this.lastLineStart=e.lastLineStart,this.afterSpace=e.afterSpace;let n=e.offsetRange,r=e.range;this.start=new uA.Position(this.line,r[0]-n[0]+1),this.end=new uA.Position(this.lastLine||this.line,r[1]-n[1]+1)}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = '${this.value}']`}};Pn.BaseToken=Ya;var Hm=class extends Ya{};Pn.Token=Hm;var Gm=class extends Ya{constructor(e){super(e),this.raw=e.raw}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = ${this.raw}]`}};Pn.LiteralToken=Gm});var rh=m(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.CharacterCode=void 0;var qM;(function(t){t[t.WHITESPACE=32]="WHITESPACE",t[t.QUOTE=34]="QUOTE",t[t.NUMBER_0=48]="NUMBER_0",t[t.NUMBER_1=49]="NUMBER_1",t[t.NUMBER_2=50]="NUMBER_2",t[t.NUMBER_3=51]="NUMBER_3",t[t.NUMBER_4=52]="NUMBER_4",t[t.NUMBER_5=53]="NUMBER_5",t[t.NUMBER_6=54]="NUMBER_6",t[t.NUMBER_7=55]="NUMBER_7",t[t.NUMBER_8=56]="NUMBER_8",t[t.NUMBER_9=57]="NUMBER_9",t[t.TAB=9]="TAB",t[t.NEW_LINE=10]="NEW_LINE",t[t.RETURN_LINE=13]="RETURN_LINE",t[t.SLASH=47]="SLASH",t[t.DOT=46]="DOT",t[t.EQUAL=61]="EQUAL",t[t.ASTERISK=42]="ASTERISK",t[t.CARET=94]="CARET",t[t.PERCENT=37]="PERCENT",t[t.COMMA=44]="COMMA",t[t.CURLY_BRACKET_LEFT=123]="CURLY_BRACKET_LEFT",t[t.CURLY_BRACKET_RIGHT=125]="CURLY_BRACKET_RIGHT",t[t.SQUARE_BRACKETS_LEFT=91]="SQUARE_BRACKETS_LEFT",t[t.SQUARE_BRACKETS_RIGHT=93]="SQUARE_BRACKETS_RIGHT",t[t.PARENTHESIS_LEFT=40]="PARENTHESIS_LEFT",t[t.PARENTHESIS_RIGHT=41]="PARENTHESIS_RIGHT",t[t.SEMICOLON=59]="SEMICOLON",t[t.HASH=35]="HASH",t[t.MINUS=45]="MINUS",t[t.PLUS=43]="PLUS",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.AT_SIGN=64]="AT_SIGN",t[t.COLON=58]="COLON",t[t.ARROW_LEFT=60]="ARROW_LEFT",t[t.ARROW_RIGHT=62]="ARROW_RIGHT",t[t.LETTER_E=69]="LETTER_E",t[t.LETTER_e=101]="LETTER_e"})(qM=Ja.CharacterCode||(Ja.CharacterCode={}))});var Io=m(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Keyword=void 0;var jM;(function(t){t.If="if",t.In="in",t.Or="or",t.And="and",t.Isa="isa",t.For="for",t.Not="not",t.New="new",t.End="end",t.EndFor="end for",t.EndWhile="end while",t.EndFunction="end function",t.EndIf="end if",t.Then="then",t.Else="else",t.Break="break",t.While="while",t.ElseIf="else if",t.Return="return",t.Function="function",t.Continue="continue",t.Repeat="repeat"})(jM=Qa.Keyword||(Qa.Keyword={}))});var Vm=m(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var Vn=rh(),FM=Io(),zm=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(FM.Keyword)))}isWhitespace(e){return Vn.CharacterCode.WHITESPACE===e||Vn.CharacterCode.TAB===e}isEndOfLine(e){return Vn.CharacterCode.NEW_LINE===e||Vn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Vn.CharacterCode.SLASH===e&&Vn.CharacterCode.SLASH===n}isIdentifierStart(e){return(e|32)>=97&&(e|32)<=122||e>=128||e===95}isIdentifierPart(e){return(e|32)>=97&&(e|32)<=122||e>=48&&e<=57||e>=128||e===95}isDecDigit(e){return e>=Vn.CharacterCode.NUMBER_0&&e<=Vn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Vn.CharacterCode.RETURN_LINE:return Vn.CharacterCode.NEW_LINE===n;case Vn.CharacterCode.NEW_LINE:return Vn.CharacterCode.RETURN_LINE===n}return!1}};Km.default=zm});var ih=m(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.ParserException=Mo.LexerException=void 0;var Xm=class extends Error{constructor(e,n){super(e),this.range=n}};Mo.LexerException=Xm;var Ym=class extends Error{constructor(e,n){super(e),this.range=n}};Mo.ParserException=Ym});var Jm=m(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.Literal=void 0;var $M;(function(t){t.True="true",t.False="false",t.Null="null"})($M=Za.Literal||(Za.Literal={}))});var Lo=m(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.Operator=void 0;var BM;(function(t){t.Plus="+",t.Asterik="*",t.Minus="-",t.Slash="/",t.Power="^",t.Modulo="%",t.LessThan="<",t.GreaterThan=">",t.LessThanOrEqual="<=",t.GreaterThanOrEqual=">=",t.NotEqual="!=",t.Equal="==",t.Or="or",t.And="and",t.Not="not",t.Isa="isa",t.AddShorthand="+=",t.SubtractShorthand="-=",t.MultiplyShorthand="*=",t.DivideShorthand="/=",t.PowerShorthand="^=",t.ModuloShorthand="%=",t.Member=".",t.Assign="=",t.EndOfLine=";",t.EndOfFile="<eof>",t.SliceSeperator=":",t.Comma=",",t.Escape='"',t.SLBracket="[",t.SRBracket="]",t.CLBracket="{",t.CRBracket="}",t.LParenthesis="(",t.RParenthesis=")",t.Reference="@",t.New="new"})(BM=eu.Operator||(eu.Operator={}))});var tu=m(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.Range=void 0;var Qm=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};sh.Range=Qm});var ty=m(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});var Zm=class{constructor(){this._head=null,this._tail=null,this._size=0}enqueue(e){let n={value:e};this._head?this._tail.next=n:this._head=n,this._tail=n,this._size++}dequeue(){let e=this._head.value;if(e)return this._head=this._head.next,this._size--,e}peek(){var e;return((e=this._head)===null||e===void 0?void 0:e.value)||null}clear(){this._head=null,this._tail=null,this._size=0}copyInto(e){this._head=e._head,this._tail=e._tail,this._size=e._size}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e,e=e.next}};ey.default=Zm});var iy=m(ru=>{"use strict";var lA=ru&&ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ru,"__esModule",{value:!0});var nt=Bi(),WM=lA(Vm()),ye=rh(),UM=ih(),ny=Io(),nu=Jm(),rt=Lo(),No=Xa(),ry=tu(),cA=lA(ty());function Wi(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var oh=class t{constructor(e,n={}){let r=this;r.content=e,r.length=e.length,r.index=0,r.tokenStart=null,r.tabWidth=n.tabWidth||1,r.line=1,r.lineStart=0,r.offset=0,r.validator=n.validator||new WM.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new cA.default,r.snapshot=new cA.default}scan(e,n){let r=t.scanHandlers[e];return r?r.call(this,n):this.validator.isDecDigit(e)?this.scanNumericLiteral(n):(this.index++,null)}isAtWhitespace(){return this.validator.isWhitespace(this.codeAt())}codeAt(e=0){let n=this.index+e;return n<this.length?this.content.charCodeAt(n):0}createEOL(e){let n=this,r=new nt.Token({type:nt.TokenType.EOL,value:rt.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new nt.Token({type:nt.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new nt.Token({type:nt.TokenType.EOF,value:rt.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new nt.LiteralToken({type:nt.TokenType.BooleanLiteral,value:e===nu.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new nt.LiteralToken({type:nt.TokenType.NilLiteral,value:null,raw:nu.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new nt.Token({type:nt.TokenType.SliceOperator,value:rt.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new nt.Token({type:nt.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new nt.LiteralToken({type:nt.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:r});return this.snapshot.enqueue(i),i}scanStringLiteral(e){let n=this,r=n.validator,i=n.line,s=n.lineStart,o=n.index,a=n.offset,u=n.offset,c=!1;for(;n.index<n.length;){n.index++;let g=n.codeAt();if(n.validator.isEndOfLine(g))r.isWinNewline(g,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(ye.CharacterCode.QUOTE===g){if(ye.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new ry.Range(new No.Position(i,o-a+1),new No.Position(n.line,n.index-u+2)));n.index++;let l=n.content.slice(n.tokenStart,n.index),h=l.slice(1,-1).replace(/""/g,rt.Operator.Escape),d=new nt.LiteralToken({type:nt.TokenType.StringLiteral,value:h,raw:l,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[a,u],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=u,n.snapshot.enqueue(d),d}scanComment(e){let n=this,r=n.validator,i=n.line,s=n.lineStart;for(;this.index<this.length&&!r.isEndOfLine(n.codeAt());n.index++);r.isWinNewline(n.codeAt(),n.codeAt(1))&&n.index++;let o=n.content.slice(n.tokenStart+2,n.index),a=new nt.Token({type:nt.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(a),a}scanNumericLiteral(e){let n=this.validator,r,i;for(;this.index<this.length&&(r=i,i=this.codeAt(),n.isDecDigit(i)||ye.CharacterCode.DOT===i||ye.CharacterCode.LETTER_E===i||ye.CharacterCode.LETTER_e===i||(ye.CharacterCode.MINUS===i||ye.CharacterCode.PLUS===i)&&(ye.CharacterCode.LETTER_E===r||ye.CharacterCode.LETTER_e===r));)this.index++;let s=this.content.slice(this.tokenStart,this.index),o=Number(s);return isNaN(o)?this.raise(`Invalid numeric literal: ${s}`,new ry.Range(new No.Position(this.line,this.tokenStart-this.offset+1),new No.Position(this.line,this.index-this.offset+1))):this.createNumericLiteral(o,s,e)}scanPunctuator(e,n){return this.index+=e.length,this.createPunctuator(e,n)}skipWhiteSpace(){let e=this;for(;e.index<e.length;e.index++){let n=e.content[e.index];if(n===" ")e.offset-=e.tabWidth-1;else if(n!==" ")return}}scanKeyword(e,n){let r=this,i=r.validator,s=e;switch(e){case ny.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case ny.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===ny.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new nt.Token({type:nt.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(o),o}scanIdentifierOrKeyword(e){let n=this,r=n.validator;for(n.index++;r.isIdentifierPart(n.codeAt());n.index++);let i=n.content.slice(n.tokenStart,n.index);if(r.isKeyword(i))return n.scanKeyword(i,e);switch(i){case nu.Literal.True:case nu.Literal.False:return n.createBoolean(i,e);case nu.Literal.Null:return n.createNull(e)}return n.createIdentifier(i,e)}next(){let e=this;if(e.backlog.size)return e.backlog.dequeue();let n=e.index;e.skipWhiteSpace();let r=n<e.index,i=e.codeAt();if(e.validator.isComment(i,e.codeAt(1)))return e.tokenStart=e.index,e.scanComment(r);if(this.index>=this.length)return e.createEOF(r);if(e.tokenStart=e.index,e.validator.isEndOfLine(i)){e.validator.isWinNewline(i,e.codeAt(1))&&e.index++;let a=e.createEOL(r);return e.line++,e.offset=e.index+1,e.lineStart=++e.index,a}if(e.validator.isIdentifierStart(i))return e.scanIdentifierOrKeyword(r);let s=e.line,o=e.scan(i,r);return o||e.raise(`Invalid character ${i} (Code: ${String.fromCharCode(i)})`,new ry.Range(new No.Position(s,e.tokenStart-e.offset+1),new No.Position(e.line,e.index-e.offset+1)))}recordSnapshot(){this.snapshot.clear()}recoverFromSnapshot(){this.backlog.copyInto(this.snapshot)}raise(e,n){let r=this,i=new UM.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new nt.Token({type:nt.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};ru.default=oh;oh.scanHandlers={[ye.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[ye.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(rt.Operator.Member,e))},[ye.CharacterCode.EQUAL]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.Equal,e):this.scanPunctuator(rt.Operator.Assign,e)},[ye.CharacterCode.ARROW_LEFT]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.LessThanOrEqual,e):this.scanPunctuator(rt.Operator.LessThan,e)},[ye.CharacterCode.ARROW_RIGHT]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.GreaterThanOrEqual,e):this.scanPunctuator(rt.Operator.GreaterThan,e)},[ye.CharacterCode.EXCLAMATION_MARK]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.NotEqual,e):(this.index++,null)},[ye.CharacterCode.MINUS]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.SubtractShorthand,e):this.scanPunctuator(rt.Operator.Minus,e)},[ye.CharacterCode.PLUS]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.AddShorthand,e):this.scanPunctuator(rt.Operator.Plus,e)},[ye.CharacterCode.ASTERISK]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.MultiplyShorthand,e):this.scanPunctuator(rt.Operator.Asterik,e)},[ye.CharacterCode.SLASH]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.DivideShorthand,e):this.scanPunctuator(rt.Operator.Slash,e)},[ye.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[ye.CharacterCode.CARET]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.PowerShorthand,e):this.scanPunctuator(rt.Operator.Power,e)},[ye.CharacterCode.PERCENT]:function(e){return ye.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(rt.Operator.ModuloShorthand,e):this.scanPunctuator(rt.Operator.Modulo,e)},[ye.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[ye.CharacterCode.COMMA]:Wi,[ye.CharacterCode.CURLY_BRACKET_LEFT]:Wi,[ye.CharacterCode.CURLY_BRACKET_RIGHT]:Wi,[ye.CharacterCode.SQUARE_BRACKETS_LEFT]:Wi,[ye.CharacterCode.SQUARE_BRACKETS_RIGHT]:Wi,[ye.CharacterCode.PARENTHESIS_LEFT]:Wi,[ye.CharacterCode.PARENTHESIS_RIGHT]:Wi,[ye.CharacterCode.AT_SIGN]:Wi}});var it=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.ASTComment=In.ASTBaseBlockWithScope=In.ASTBaseBlock=In.ASTBase=In.ASTType=void 0;var hA;(function(t){t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.ReturnStatement="ReturnStatement",t.IfShortcutStatement="IfShortcutStatement",t.IfShortcutClause="IfShortcutClause",t.ElseifShortcutClause="ElseifShortcutClause",t.ElseShortcutClause="ElseShortcutClause",t.IfStatement="IfStatement",t.IfClause="IfClause",t.ElseifClause="ElseifClause",t.ElseClause="ElseClause",t.WhileStatement="WhileStatement",t.AssignmentStatement="AssignmentStatement",t.CallStatement="CallStatement",t.FunctionDeclaration="FunctionDeclaration",t.ForGenericStatement="ForGenericStatement",t.Chunk="Chunk",t.Identifier="Identifier",t.StringLiteral="StringLiteral",t.NumericLiteral="NumericLiteral",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.Unknown="Unknown",t.MemberExpression="MemberExpression",t.CallExpression="CallExpression",t.Comment="Comment",t.NegationExpression="NegationExpression",t.BinaryNegatedExpression="BinaryNegatedExpression",t.UnaryExpression="UnaryExpression",t.MapKeyString="MapKeyString",t.MapValue="MapValue",t.MapConstructorExpression="MapConstructorExpression",t.MapCallExpression="MapCallExpression",t.ListValue="ListValue",t.ListConstructorExpression="ListConstructorExpression",t.EmptyExpression="EmptyExpression",t.IndexExpression="IndexExpression",t.BinaryExpression="BinaryExpression",t.LogicalExpression="LogicalExpression",t.IsaExpression="IsaExpression",t.SliceExpression="SliceExpression",t.ImportCodeExpression="ImportCodeExpression",t.InvalidCodeExpression="InvalidCodeExpression",t.ParenthesisExpression="ParenthesisExpression",t.ComparisonGroupExpression="ComparisonGroupExpression"})(hA=In.ASTType||(In.ASTType={}));var iu=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,this.range=n.range,this.scope=n.scope||null}toString(){return`${this.type}[${this.start}-${this.end}][]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTBase=iu;var ah=class t extends iu{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
|
37
37
|
`).split(`
|
38
38
|
`).map(n=>` ${n}`).join(`
|
39
39
|
`);return`${this.type}[${this.start}-${this.end}][${e.length>0?`
|
40
40
|
${e}
|
41
|
-
`:""}]`}clone(){return new t(this.type,{body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTBaseBlock=
|
41
|
+
`:""}]`}clone(){return new t(this.type,{body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTBaseBlock=ah;var sy=class t extends ah{constructor(e,n){super(e,n),this.namespaces=n.namespaces||[],this.definitions=n.definitions||[],this.returns=n.returns||[]}clone(){return new t(this.type,{namespaces:this.namespaces,definitions:this.definitions.map(e=>e.clone()),returns:this.returns.map(e=>e.clone()),body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTBaseBlockWithScope=sy;var oy=class t extends iu{constructor(e){super(hA.Comment,e),this.value=e.value,this.isStatement=e.isStatement,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,isStatement:this.isStatement,start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTComment=oy});var uy=m(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.ASTAssignmentStatement=void 0;var dA=it(),ay=class t extends dA.ASTBase{constructor(e){super(dA.ASTType.AssignmentStatement,e),this.variable=e.variable,this.init=e.init}toString(){return`AssignmentStatement[${this.start}-${this.end}][${this.variable} = ${this.init}]`}clone(){return new t({variable:this.variable.clone(),init:this.init.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};uh.ASTAssignmentStatement=ay});var ly=m(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.ASTBinaryExpression=void 0;var fA=it(),cy=class t extends fA.ASTBase{constructor(e){super(fA.ASTType.BinaryExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ch.ASTBinaryExpression=cy});var fy=m(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.ASTCallExpression=qo.ASTCallStatement=void 0;var lh=it(),hy=class t extends lh.ASTBase{constructor(e){super(lh.ASTType.CallStatement,e),this.expression=e.expression}toString(){return`CallStatment[${this.start}-${this.end}][${this.expression}]`}clone(){return new t({expression:this.expression,start:this.start,end:this.end,range:this.range,scope:this.scope})}};qo.ASTCallStatement=hy;var dy=class t extends lh.ASTBase{constructor(e){super(lh.ASTType.CallExpression,e),this.base=e.base,this.arguments=e.arguments||[]}toString(){return`CallExpression[${this.start}-${this.end}][${this.base}(${this.arguments.map(e=>e.toString()).join(", ")})]`}clone(){return new t({base:this.base.clone(),arguments:this.arguments.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};qo.ASTCallExpression=dy});var gy=m(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.ASTChunk=void 0;var pA=it(),py=class t extends pA.ASTBaseBlockWithScope{constructor(e){super(pA.ASTType.Chunk,e),this.literals=e.literals||[],this.scopes=e.scopes||[],this.lines=e.lines||{}}toString(){if(this.body.length===0)return`Chunk[${this.start}-${this.end}][]`;let e=this.body.map(n=>`${n}`).join(`
|
42
42
|
`).split(`
|
43
43
|
`).map(n=>` ${n}`).join(`
|
44
44
|
`);return`Chunk[${this.start}-${this.end}][
|
45
45
|
${e}
|
46
|
-
]`}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};
|
46
|
+
]`}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};hh.ASTChunk=py});var yy=m(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh.ASTComparisonGroupExpression=void 0;var gA=it(),my=class t extends gA.ASTBase{constructor(e){super(gA.ASTType.ComparisonGroupExpression,e),this.operators=e.operators,this.expressions=e.expressions}toString(){let e=[this.expressions[0].toString()];for(let n=1;n<this.expressions.length;n++)e.push(this.operators[n-1],this.expressions[n].toString());return`${this.type}[${this.start}-${this.end}][${e.join(" ")}]`}clone(){return new t({operators:this.operators,expressions:this.expressions,start:this.start,end:this.end,range:this.range,scope:this.scope})}};dh.ASTComparisonGroupExpression=my});var _y=m(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.ASTForGenericStatement=void 0;var mA=it(),by=class t extends mA.ASTBaseBlock{constructor(e){super(mA.ASTType.ForGenericStatement,e),this.variable=e.variable,this.iterator=e.iterator}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.variable} in ${this.iterator}]`;let e=this.body.map(n=>`${n}`).join(`
|
47
47
|
`).split(`
|
48
48
|
`).map(n=>` ${n}`).join(`
|
49
49
|
`);return`For[${this.start}-${this.end}][${this.variable} in ${this.iterator}
|
50
50
|
${e}
|
51
|
-
]`}clone(){return new t({variable:this.variable.clone(),iterator:this.iterator.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};
|
51
|
+
]`}clone(){return new t({variable:this.variable.clone(),iterator:this.iterator.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};fh.ASTForGenericStatement=by});var Sy=m(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.ASTFunctionStatement=void 0;var yA=it(),vy=class t extends yA.ASTBaseBlockWithScope{constructor(e){super(yA.ASTType.FunctionDeclaration,e),this.parameters=e.parameters||[],this.assignment=e.assignment}toString(){let e=this.parameters.map(r=>r).join(", ");if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${e}]`;let n=this.body.map(r=>`${r}`).join(`
|
52
52
|
`).split(`
|
53
53
|
`).map(r=>` ${r}`).join(`
|
54
54
|
`);return`Function[${this.start}-${this.end}][${e} =>
|
55
55
|
${n}
|
56
|
-
]`}clone(){return new t({parameters:this.parameters.map(e=>e.clone()),assignment:this.assignment.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};
|
56
|
+
]`}clone(){return new t({parameters:this.parameters.map(e=>e.clone()),assignment:this.assignment.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ph.ASTFunctionStatement=vy});var xy=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.ASTIndexExpression=_r.ASTMemberExpression=_r.ASTIdentifier=_r.ASTIdentifierKind=void 0;var jo=it(),HM;(function(t){t.Variable="variable",t.Argument="argument",t.ForInVariable="for-in-variable",t.Property="property"})(HM=_r.ASTIdentifierKind||(_r.ASTIdentifierKind={}));var Ty=class t extends jo.ASTBase{constructor(e){super(jo.ASTType.Identifier,e),this.name=e.name,this.kind=e.kind}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,kind:this.kind,start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTIdentifier=Ty;var wy=class t extends jo.ASTBase{constructor(e){super(jo.ASTType.MemberExpression,e),this.indexer=e.indexer,this.identifier=e.identifier,this.base=e.base}toString(){return`MemberExpression[${this.start}-${this.end}][${this.base}.${this.identifier}]`}clone(){return new t({indexer:this.indexer,identifier:this.identifier.clone(),base:this.base,start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTMemberExpression=wy;var Ey=class t extends jo.ASTBase{constructor(e){super(jo.ASTType.IndexExpression,e),this.base=e.base,this.index=e.index,this.isStatementStart=e.isStatementStart}toString(){return`IndexExpression[${this.start}-${this.end}]${this.isStatementStart?"[isStatementStart]":""}[${this.base}[${this.index}]]`}clone(){return new t({base:this.base.clone(),index:this.index.clone(),isStatementStart:this.isStatementStart,start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTIndexExpression=Ey});var Oy=m(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.ASTElseClause=jr.ASTIfClause=jr.ASTIfStatement=jr.ASTClause=void 0;var bA=it(),su=class extends bA.ASTBaseBlock{};jr.ASTClause=su;var Ay=class t extends bA.ASTBase{constructor(e,n){super(e,n),this.clauses=n.clauses||[]}toString(){if(this.clauses.length===0)return`IfStatement[${this.start}-${this.end}][]`;let e=this.clauses.map(n=>`${n}`).join(`
|
57
57
|
`).split(`
|
58
58
|
`).map(n=>` ${n}`).join(`
|
59
59
|
`);return`IfStatement[${this.start}-${this.end}][
|
60
60
|
${e}
|
61
|
-
]`}clone(){return new t(this.type,{clauses:this.clauses.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};
|
61
|
+
]`}clone(){return new t(this.type,{clauses:this.clauses.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};jr.ASTIfStatement=Ay;var ky=class t extends su{constructor(e,n){super(e,n),this.condition=n.condition}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(`
|
62
62
|
`).split(`
|
63
63
|
`).map(n=>` ${n}`).join(`
|
64
64
|
`);return`${this.type}[${this.start}-${this.end}][${this.condition}
|
65
65
|
${e}
|
66
|
-
]`}clone(){return new t(this.type,{condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};
|
66
|
+
]`}clone(){return new t(this.type,{condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};jr.ASTIfClause=ky;var Cy=class t extends su{constructor(e,n){super(e,n)}toString(){if(this.body.length===0)return`${this.type}[]`;let e=this.body.map(n=>`${n}`).join(`
|
67
67
|
`).split(`
|
68
68
|
`).map(n=>` ${n}`).join(`
|
69
69
|
`);return`${this.type}[${this.start}-${this.end}][
|
70
70
|
${e}
|
71
|
-
}]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};
|
71
|
+
}]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};jr.ASTElseClause=Cy});var Dy=m(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.ASTIsaExpression=void 0;var _A=it(),Ry=class t extends _A.ASTBase{constructor(e){super(_A.ASTType.IsaExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};gh.ASTIsaExpression=Ry});var My=m(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ASTListConstructorExpression=Fo.ASTListValue=void 0;var mh=it(),Py=class t extends mh.ASTBase{constructor(e){super(mh.ASTType.ListValue,e),this.value=e.value}toString(){return`ListValue[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Fo.ASTListValue=Py;var Iy=class t extends mh.ASTBase{constructor(e){super(mh.ASTType.ListConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`ListConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(`
|
72
72
|
`).split(`
|
73
73
|
`).map(n=>` ${n}`).join(`
|
74
74
|
`);return`ListConstructor[${this.start}-${this.end}][
|
75
75
|
${e}
|
76
|
-
]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};
|
76
|
+
]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Fo.ASTListConstructorExpression=Iy});var $y=m(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.ASTNilLiteral=Xn.ASTStringLiteral=Xn.ASTBooleanLiteral=Xn.ASTNumericLiteral=Xn.ASTLiteral=void 0;var vA=Bi(),Fy=it(),Es=class extends Fy.ASTBase{};Xn.ASTLiteral=Es;var Ly=class t extends Es{constructor(e){super(vA.TokenType.NumericLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Xn.ASTNumericLiteral=Ly;var Ny=class t extends Es{constructor(e){super(vA.TokenType.BooleanLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Xn.ASTBooleanLiteral=Ny;var qy=class t extends Es{constructor(e){super(Fy.ASTType.StringLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Xn.ASTStringLiteral=qy;var jy=class t extends Es{constructor(e){super(Fy.ASTType.NilLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Xn.ASTNilLiteral=jy});var Wy=m(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.ASTLogicalExpression=void 0;var SA=it(),By=class t extends SA.ASTBase{constructor(e){super(SA.ASTType.LogicalExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};yh.ASTLogicalExpression=By});var Gy=m($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.ASTMapConstructorExpression=$o.ASTMapKeyString=void 0;var bh=it(),Uy=class t extends bh.ASTBase{constructor(e){super(bh.ASTType.MapKeyString,e),this.key=e.key,this.value=e.value}toString(){return`MapKeyString[${this.start}-${this.end}][${this.key}: ${this.value}]`}clone(){return new t({key:this.key.clone(),value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};$o.ASTMapKeyString=Uy;var Hy=class t extends bh.ASTBase{constructor(e){super(bh.ASTType.MapConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`MapConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(`
|
77
77
|
`).split(`
|
78
78
|
`).map(n=>` ${n}`).join(`
|
79
79
|
`);return`MapConstructor[${this.start}-${this.end}][
|
80
80
|
${e}
|
81
|
-
]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}}
|
81
|
+
]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};$o.ASTMapConstructorExpression=Hy});var Ky=m(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.ASTParenthesisExpression=void 0;var TA=it(),zy=class t extends TA.ASTBase{constructor(e){super(TA.ASTType.ParenthesisExpression,e),this.expression=e.expression}toString(){return this.expression.toString()}clone(){return new t({expression:this.expression.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};_h.ASTParenthesisExpression=zy});var Xy=m(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.ASTReturnStatement=void 0;var wA=it(),Vy=class t extends wA.ASTBase{constructor(e){super(wA.ASTType.ReturnStatement,e),this.argument=e.argument}toString(){return`ReturnStatement[${this.start}-${this.end}][${this.argument}]`}clone(){return new t({argument:this.argument.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};vh.ASTReturnStatement=Vy});var Jy=m(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.ASTSliceExpression=void 0;var EA=it(),Yy=class t extends EA.ASTBase{constructor(e){super(EA.ASTType.SliceExpression,e),this.left=e.left,this.right=e.right,this.base=e.base}toString(){return`SliceExpression[${this.start}-${this.end}][${this.base}[${this.left}:${this.right}]]`}clone(){return new t({base:this.base.clone(),left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Sh.ASTSliceExpression=Yy});var eb=m(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.ASTUnaryExpression=void 0;var Qy=Lo(),Th=it(),Zy=class t extends Th.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case Qy.Operator.Not:return Th.ASTType.NegationExpression;case Qy.Operator.Plus:case Qy.Operator.Minus:return Th.ASTType.BinaryNegatedExpression;default:return Th.ASTType.UnaryExpression}}toString(){return`${this.type}[${this.start}-${this.end}][${this.operator} ${this.argument}]`}clone(){return new t({argument:this.argument.clone(),operator:this.operator,start:this.start,end:this.end,range:this.range,scope:this.scope})}};wh.ASTUnaryExpression=Zy});var nb=m(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.ASTWhileStatement=void 0;var xA=it(),tb=class t extends xA.ASTBaseBlock{constructor(e){super(xA.ASTType.WhileStatement,e),this.condition=e.condition}toString(){if(this.body.length===0)return`WhileStatement[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(`
|
82
82
|
`).split(`
|
83
83
|
`).map(n=>` ${n}`).join(`
|
84
84
|
`);return`WhileStatement[${this.start}-${this.end}][${this.condition}
|
85
85
|
${e}
|
86
|
-
]`}clone(){return new t({condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};wh.ASTWhileStatement=Yy});var SA=m(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.ASTBreakStatement=void 0;var vA=it(),Qy=class t extends vA.ASTBase{constructor(e){super(vA.ASTType.BreakStatement,e),this.iterator=e.iterator}toString(){return`BreakStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Eh.ASTBreakStatement=Qy});var wA=m(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.ASTContinueStatement=void 0;var TA=it(),Zy=class t extends TA.ASTBase{constructor(e){super(TA.ASTType.ContinueStatement,e),this.iterator=e.iterator}toString(){return`ContinueStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};xh.ASTContinueStatement=Zy});var Rh=m(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.ASTWhileStatement=H.ASTUnaryExpression=H.ASTSliceExpression=H.ASTReturnStatement=H.ASTParenthesisExpression=H.ASTMapKeyString=H.ASTMapConstructorExpression=H.ASTLogicalExpression=H.ASTStringLiteral=H.ASTNumericLiteral=H.ASTNilLiteral=H.ASTLiteral=H.ASTBooleanLiteral=H.ASTListValue=H.ASTListConstructorExpression=H.ASTIsaExpression=H.ASTIfStatement=H.ASTIfClause=H.ASTElseClause=H.ASTClause=H.ASTMemberExpression=H.ASTIndexExpression=H.ASTIdentifierKind=H.ASTIdentifier=H.ASTFunctionStatement=H.ASTForGenericStatement=H.ASTContinueStatement=H.ASTComparisonGroupExpression=H.ASTChunk=H.ASTCallStatement=H.ASTCallExpression=H.ASTBreakStatement=H.ASTBinaryExpression=H.ASTType=H.ASTComment=H.ASTBaseBlockWithScope=H.ASTBaseBlock=H.ASTBase=H.ASTAssignmentStatement=H.ASTProvider=void 0;var Ah=Fi(),EA=Rh(),OM=ry(),cn=it(),RM=sy(),xA=uy(),PM=ly(),DM=dy(),IM=py(),MM=my(),eb=vy(),Bi=Ey(),LM=Ay(),AA=Oy(),kh=Ly(),NM=qy(),kA=$y(),qM=Wy(),jM=Hy(),FM=zy(),$M=Xy(),BM=Jy(),tb=class{returnStatement(e){return new jM.ASTReturnStatement(e)}ifShortcutStatement(e){return new Bi.ASTIfStatement(cn.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new Bi.ASTIfClause(cn.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new Bi.ASTIfClause(cn.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new Bi.ASTElseClause(cn.ASTType.ElseShortcutClause,e)}ifStatement(e){return new Bi.ASTIfStatement(cn.ASTType.IfStatement,e)}ifClause(e){return new Bi.ASTIfClause(cn.ASTType.IfClause,e)}elseifClause(e){return new Bi.ASTIfClause(cn.ASTType.ElseifClause,e)}elseClause(e){return new Bi.ASTElseClause(cn.ASTType.ElseClause,e)}whileStatement(e){return new BM.ASTWhileStatement(e)}assignmentStatement(e){return new OM.ASTAssignmentStatement(e)}callStatement(e){return new xA.ASTCallStatement(e)}functionStatement(e){return new MM.ASTFunctionStatement(e)}forGenericStatement(e){return new IM.ASTForGenericStatement(e)}chunk(e){return new PM.ASTChunk(e)}identifier(e){return new eb.ASTIdentifier(e)}literal(e,n){switch(e){case Ah.TokenType.StringLiteral:return new kh.ASTStringLiteral(n);case Ah.TokenType.NumericLiteral:return new kh.ASTNumericLiteral(n);case Ah.TokenType.BooleanLiteral:return new kh.ASTBooleanLiteral(n);case Ah.TokenType.NilLiteral:return new kh.ASTNilLiteral(n)}}memberExpression(e){return new eb.ASTMemberExpression(e)}callExpression(e){return new xA.ASTCallExpression(e)}comment(e){return new cn.ASTComment(e)}unaryExpression(e){return new $M.ASTUnaryExpression(e)}mapKeyString(e){return new kA.ASTMapKeyString(e)}mapConstructorExpression(e){return new kA.ASTMapConstructorExpression(e)}listValue(e){return new AA.ASTListValue(e)}listConstructorExpression(e){return new AA.ASTListConstructorExpression(e)}unknown(e){return new cn.ASTBase(cn.ASTType.Unknown,e)}emptyExpression(e){return new cn.ASTBase(cn.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new cn.ASTBase(cn.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new eb.ASTIndexExpression(e)}logicalExpression(e){return new NM.ASTLogicalExpression(e)}isaExpression(e){return new LM.ASTIsaExpression(e)}binaryExpression(e){return new RM.ASTBinaryExpression(e)}sliceExpression(e){return new FM.ASTSliceExpression(e)}parenthesisExpression(e){return new qM.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new DM.ASTComparisonGroupExpression(e)}breakStatement(e){return new EA.ASTBreakStatement(e)}continueStatement(e){return new EA.ASTContinueStatement(e)}};H.ASTProvider=tb;var WM=ry();Object.defineProperty(H,"ASTAssignmentStatement",{enumerable:!0,get:function(){return WM.ASTAssignmentStatement}});var iu=it();Object.defineProperty(H,"ASTBase",{enumerable:!0,get:function(){return iu.ASTBase}});Object.defineProperty(H,"ASTBaseBlock",{enumerable:!0,get:function(){return iu.ASTBaseBlock}});Object.defineProperty(H,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return iu.ASTBaseBlockWithScope}});Object.defineProperty(H,"ASTComment",{enumerable:!0,get:function(){return iu.ASTComment}});Object.defineProperty(H,"ASTType",{enumerable:!0,get:function(){return iu.ASTType}});var UM=sy();Object.defineProperty(H,"ASTBinaryExpression",{enumerable:!0,get:function(){return UM.ASTBinaryExpression}});var HM=SA();Object.defineProperty(H,"ASTBreakStatement",{enumerable:!0,get:function(){return HM.ASTBreakStatement}});var CA=uy();Object.defineProperty(H,"ASTCallExpression",{enumerable:!0,get:function(){return CA.ASTCallExpression}});Object.defineProperty(H,"ASTCallStatement",{enumerable:!0,get:function(){return CA.ASTCallStatement}});var GM=ly();Object.defineProperty(H,"ASTChunk",{enumerable:!0,get:function(){return GM.ASTChunk}});var zM=dy();Object.defineProperty(H,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return zM.ASTComparisonGroupExpression}});var VM=wA();Object.defineProperty(H,"ASTContinueStatement",{enumerable:!0,get:function(){return VM.ASTContinueStatement}});var KM=py();Object.defineProperty(H,"ASTForGenericStatement",{enumerable:!0,get:function(){return KM.ASTForGenericStatement}});var XM=my();Object.defineProperty(H,"ASTFunctionStatement",{enumerable:!0,get:function(){return XM.ASTFunctionStatement}});var Ch=vy();Object.defineProperty(H,"ASTIdentifier",{enumerable:!0,get:function(){return Ch.ASTIdentifier}});Object.defineProperty(H,"ASTIdentifierKind",{enumerable:!0,get:function(){return Ch.ASTIdentifierKind}});Object.defineProperty(H,"ASTIndexExpression",{enumerable:!0,get:function(){return Ch.ASTIndexExpression}});Object.defineProperty(H,"ASTMemberExpression",{enumerable:!0,get:function(){return Ch.ASTMemberExpression}});var Oh=Ey();Object.defineProperty(H,"ASTClause",{enumerable:!0,get:function(){return Oh.ASTClause}});Object.defineProperty(H,"ASTElseClause",{enumerable:!0,get:function(){return Oh.ASTElseClause}});Object.defineProperty(H,"ASTIfClause",{enumerable:!0,get:function(){return Oh.ASTIfClause}});Object.defineProperty(H,"ASTIfStatement",{enumerable:!0,get:function(){return Oh.ASTIfStatement}});var YM=Ay();Object.defineProperty(H,"ASTIsaExpression",{enumerable:!0,get:function(){return YM.ASTIsaExpression}});var OA=Oy();Object.defineProperty(H,"ASTListConstructorExpression",{enumerable:!0,get:function(){return OA.ASTListConstructorExpression}});Object.defineProperty(H,"ASTListValue",{enumerable:!0,get:function(){return OA.ASTListValue}});var su=Ly();Object.defineProperty(H,"ASTBooleanLiteral",{enumerable:!0,get:function(){return su.ASTBooleanLiteral}});Object.defineProperty(H,"ASTLiteral",{enumerable:!0,get:function(){return su.ASTLiteral}});Object.defineProperty(H,"ASTNilLiteral",{enumerable:!0,get:function(){return su.ASTNilLiteral}});Object.defineProperty(H,"ASTNumericLiteral",{enumerable:!0,get:function(){return su.ASTNumericLiteral}});Object.defineProperty(H,"ASTStringLiteral",{enumerable:!0,get:function(){return su.ASTStringLiteral}});var JM=qy();Object.defineProperty(H,"ASTLogicalExpression",{enumerable:!0,get:function(){return JM.ASTLogicalExpression}});var RA=$y();Object.defineProperty(H,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return RA.ASTMapConstructorExpression}});Object.defineProperty(H,"ASTMapKeyString",{enumerable:!0,get:function(){return RA.ASTMapKeyString}});var QM=Wy();Object.defineProperty(H,"ASTParenthesisExpression",{enumerable:!0,get:function(){return QM.ASTParenthesisExpression}});var ZM=Hy();Object.defineProperty(H,"ASTReturnStatement",{enumerable:!0,get:function(){return ZM.ASTReturnStatement}});var eL=zy();Object.defineProperty(H,"ASTSliceExpression",{enumerable:!0,get:function(){return eL.ASTSliceExpression}});var tL=Xy();Object.defineProperty(H,"ASTUnaryExpression",{enumerable:!0,get:function(){return tL.ASTUnaryExpression}});var nL=Jy();Object.defineProperty(H,"ASTWhileStatement",{enumerable:!0,get:function(){return nL.ASTWhileStatement}})});var ib=m(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var Wi=Fi(),nb=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([Wi.TokenType.StringLiteral,Wi.TokenType.NumericLiteral,Wi.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([Wi.TokenType.StringLiteral,Wi.TokenType.NumericLiteral,Wi.TokenType.BooleanLiteral,Wi.TokenType.NilLiteral]))}isComment(e){return e===Wi.TokenType.Comment}};rb.default=nb});var ob=m(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.SelectorGroups=oe.SelectorGroupType=oe.getSelectorsFromGroup=oe.createSelectorGroup=oe.Selectors=oe.getSelectorValue=oe.createSelector=oe.createSelectorOptions=oe.SelectorType=void 0;var ae=Fi(),_r=Po(),be=Io(),rL;(function(t){t.EndOfLine="EndOfLine",t.EndOfFile="EndOfFile",t.LParenthesis="LParenthesis",t.RParenthesis="RParenthesis",t.CLBracket="CLBracket",t.CRBracket="CRBracket",t.SLBracket="SLBracket",t.SRBracket="SRBracket",t.Assign="Assign",t.AddShorthand="AddShorthand",t.SubtractShorthand="SubtractShorthand",t.MultiplyShorthand="MultiplyShorthand",t.DivideShorthand="DivideShorthand",t.PowerShorthand="PowerShorthand",t.ModuloShorthand="ModuloShorthand",t.Seperator="Seperator",t.Function="Function",t.EndFunction="EndFunction",t.EndWhile="EndWhile",t.EndFor="EndFor",t.EndIf="EndIf",t.SliceSeperator="SliceSeperator",t.MapKeyValueSeperator="MapKeyValueSeperator",t.MapSeperator="MapSeperator",t.ListSeperator="ListSeperator",t.CallSeperator="CallSeperator",t.ArgumentSeperator="ArgumentSeperator",t.ImportCodeSeperator="ImportCodeSeperator",t.ElseIf="ElseIf",t.Then="Then",t.Else="Else",t.In="In",t.MemberSeperator="MemberSeperator",t.NumberSeperator="NumberSeperator",t.Reference="Reference",t.Isa="Isa",t.Or="Or",t.And="And",t.Minus="Minus",t.Plus="Plus",t.Times="Times",t.Divide="Divide",t.Power="Power",t.Mod="Mod",t.Equal="Equal",t.NotEqual="NotEqual",t.Greater="Greater",t.GreaterEqual="GreaterEqual",t.Lesser="Lesser",t.LessEqual="LessEqual",t.New="New",t.Not="Not",t.Comment="Comment"})(rL=oe.SelectorType||(oe.SelectorType={}));var sb=class{};oe.createSelectorOptions=sb;function se(t){let e;return t.value===void 0?(e=new Function("token",`if (token == null) return false;return token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}`,writable:!1})):(e=new Function("token",`if (token == null) return false;return token.value === '${t.value}' && token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}_${t.value}`,writable:!1})),e.data=t,e}oe.createSelector=se;function iL(t){return t.data.value}oe.getSelectorValue=iL;oe.Selectors={EndOfLine:se({type:ae.TokenType.EOL,value:be.Operator.EndOfLine}),EndOfFile:se({type:ae.TokenType.EOF,value:be.Operator.EndOfFile}),LParenthesis:se({type:ae.TokenType.Punctuator,value:be.Operator.LParenthesis}),RParenthesis:se({type:ae.TokenType.Punctuator,value:be.Operator.RParenthesis}),CLBracket:se({type:ae.TokenType.Punctuator,value:be.Operator.CLBracket}),CRBracket:se({type:ae.TokenType.Punctuator,value:be.Operator.CRBracket}),SLBracket:se({type:ae.TokenType.Punctuator,value:be.Operator.SLBracket}),SRBracket:se({type:ae.TokenType.Punctuator,value:be.Operator.SRBracket}),Assign:se({type:ae.TokenType.Punctuator,value:be.Operator.Assign}),AddShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.AddShorthand}),SubtractShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.SubtractShorthand}),MultiplyShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.MultiplyShorthand}),DivideShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.DivideShorthand}),PowerShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.PowerShorthand}),ModuloShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.ModuloShorthand}),Seperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),Function:se({type:ae.TokenType.Keyword,value:_r.Keyword.Function}),EndFunction:se({type:ae.TokenType.Keyword,value:_r.Keyword.EndFunction}),EndWhile:se({type:ae.TokenType.Keyword,value:_r.Keyword.EndWhile}),EndFor:se({type:ae.TokenType.Keyword,value:_r.Keyword.EndFor}),EndIf:se({type:ae.TokenType.Keyword,value:_r.Keyword.EndIf}),SliceSeperator:se({type:ae.TokenType.SliceOperator,value:be.Operator.SliceSeperator}),MapKeyValueSeperator:se({type:ae.TokenType.SliceOperator,value:be.Operator.SliceSeperator}),MapSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),ListSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),CallSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),ArgumentSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),ImportCodeSeperator:se({type:ae.TokenType.SliceOperator,value:be.Operator.SliceSeperator}),ElseIf:se({type:ae.TokenType.Keyword,value:_r.Keyword.ElseIf}),Then:se({type:ae.TokenType.Keyword,value:_r.Keyword.Then}),Else:se({type:ae.TokenType.Keyword,value:_r.Keyword.Else}),In:se({type:ae.TokenType.Keyword,value:_r.Keyword.In}),MemberSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Member}),NumberSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Member}),Reference:se({type:ae.TokenType.Punctuator,value:be.Operator.Reference}),Isa:se({type:ae.TokenType.Keyword,value:be.Operator.Isa}),Or:se({type:ae.TokenType.Keyword,value:be.Operator.Or}),And:se({type:ae.TokenType.Keyword,value:be.Operator.And}),Minus:se({type:ae.TokenType.Punctuator,value:be.Operator.Minus}),Plus:se({type:ae.TokenType.Punctuator,value:be.Operator.Plus}),Times:se({type:ae.TokenType.Punctuator,value:be.Operator.Asterik}),Power:se({type:ae.TokenType.Punctuator,value:be.Operator.Power}),Divide:se({type:ae.TokenType.Punctuator,value:be.Operator.Slash}),Mod:se({type:ae.TokenType.Punctuator,value:be.Operator.Modulo}),Equal:se({type:ae.TokenType.Punctuator,value:be.Operator.Equal}),NotEqual:se({type:ae.TokenType.Punctuator,value:be.Operator.NotEqual}),Greater:se({type:ae.TokenType.Punctuator,value:be.Operator.GreaterThan}),GreaterEqual:se({type:ae.TokenType.Punctuator,value:be.Operator.GreaterThanOrEqual}),Lesser:se({type:ae.TokenType.Punctuator,value:be.Operator.LessThan}),LessEqual:se({type:ae.TokenType.Punctuator,value:be.Operator.LessThanOrEqual}),New:se({type:ae.TokenType.Keyword,value:_r.Keyword.New}),Not:se({type:ae.TokenType.Keyword,value:_r.Keyword.Not}),Comment:se({type:ae.TokenType.Comment})};function qr(t,e){let r=e.filter(a=>a.data.value!==void 0).map(a=>`case '${a.data.value}': return token.type === '${a.data.type}';`).join(`
|
86
|
+
]`}clone(){return new t({condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Eh.ASTWhileStatement=tb});var kA=m(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.ASTBreakStatement=void 0;var AA=it(),rb=class t extends AA.ASTBase{constructor(e){super(AA.ASTType.BreakStatement,e),this.iterator=e.iterator}toString(){return`BreakStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};xh.ASTBreakStatement=rb});var OA=m(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.ASTContinueStatement=void 0;var CA=it(),ib=class t extends CA.ASTBase{constructor(e){super(CA.ASTType.ContinueStatement,e),this.iterator=e.iterator}toString(){return`ContinueStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ah.ASTContinueStatement=ib});var Dh=m(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.ASTWhileStatement=H.ASTUnaryExpression=H.ASTSliceExpression=H.ASTReturnStatement=H.ASTParenthesisExpression=H.ASTMapKeyString=H.ASTMapConstructorExpression=H.ASTLogicalExpression=H.ASTStringLiteral=H.ASTNumericLiteral=H.ASTNilLiteral=H.ASTLiteral=H.ASTBooleanLiteral=H.ASTListValue=H.ASTListConstructorExpression=H.ASTIsaExpression=H.ASTIfStatement=H.ASTIfClause=H.ASTElseClause=H.ASTClause=H.ASTMemberExpression=H.ASTIndexExpression=H.ASTIdentifierKind=H.ASTIdentifier=H.ASTFunctionStatement=H.ASTForGenericStatement=H.ASTContinueStatement=H.ASTComparisonGroupExpression=H.ASTChunk=H.ASTCallStatement=H.ASTCallExpression=H.ASTBreakStatement=H.ASTBinaryExpression=H.ASTType=H.ASTComment=H.ASTBaseBlockWithScope=H.ASTBaseBlock=H.ASTBase=H.ASTAssignmentStatement=H.ASTProvider=void 0;var kh=Bi(),RA=Dh(),GM=uy(),cn=it(),zM=ly(),DA=fy(),KM=gy(),VM=yy(),XM=_y(),YM=Sy(),sb=xy(),Ui=Oy(),JM=Dy(),PA=My(),Ch=$y(),QM=Wy(),IA=Gy(),ZM=Ky(),eL=Xy(),tL=Jy(),nL=eb(),rL=nb(),ob=class{returnStatement(e){return new eL.ASTReturnStatement(e)}ifShortcutStatement(e){return new Ui.ASTIfStatement(cn.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new Ui.ASTIfClause(cn.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new Ui.ASTIfClause(cn.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new Ui.ASTElseClause(cn.ASTType.ElseShortcutClause,e)}ifStatement(e){return new Ui.ASTIfStatement(cn.ASTType.IfStatement,e)}ifClause(e){return new Ui.ASTIfClause(cn.ASTType.IfClause,e)}elseifClause(e){return new Ui.ASTIfClause(cn.ASTType.ElseifClause,e)}elseClause(e){return new Ui.ASTElseClause(cn.ASTType.ElseClause,e)}whileStatement(e){return new rL.ASTWhileStatement(e)}assignmentStatement(e){return new GM.ASTAssignmentStatement(e)}callStatement(e){return new DA.ASTCallStatement(e)}functionStatement(e){return new YM.ASTFunctionStatement(e)}forGenericStatement(e){return new XM.ASTForGenericStatement(e)}chunk(e){return new KM.ASTChunk(e)}identifier(e){return new sb.ASTIdentifier(e)}literal(e,n){switch(e){case kh.TokenType.StringLiteral:return new Ch.ASTStringLiteral(n);case kh.TokenType.NumericLiteral:return new Ch.ASTNumericLiteral(n);case kh.TokenType.BooleanLiteral:return new Ch.ASTBooleanLiteral(n);case kh.TokenType.NilLiteral:return new Ch.ASTNilLiteral(n)}}memberExpression(e){return new sb.ASTMemberExpression(e)}callExpression(e){return new DA.ASTCallExpression(e)}comment(e){return new cn.ASTComment(e)}unaryExpression(e){return new nL.ASTUnaryExpression(e)}mapKeyString(e){return new IA.ASTMapKeyString(e)}mapConstructorExpression(e){return new IA.ASTMapConstructorExpression(e)}listValue(e){return new PA.ASTListValue(e)}listConstructorExpression(e){return new PA.ASTListConstructorExpression(e)}unknown(e){return new cn.ASTBase(cn.ASTType.Unknown,e)}emptyExpression(e){return new cn.ASTBase(cn.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new cn.ASTBase(cn.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new sb.ASTIndexExpression(e)}logicalExpression(e){return new QM.ASTLogicalExpression(e)}isaExpression(e){return new JM.ASTIsaExpression(e)}binaryExpression(e){return new zM.ASTBinaryExpression(e)}sliceExpression(e){return new tL.ASTSliceExpression(e)}parenthesisExpression(e){return new ZM.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new VM.ASTComparisonGroupExpression(e)}breakStatement(e){return new RA.ASTBreakStatement(e)}continueStatement(e){return new RA.ASTContinueStatement(e)}};H.ASTProvider=ob;var iL=uy();Object.defineProperty(H,"ASTAssignmentStatement",{enumerable:!0,get:function(){return iL.ASTAssignmentStatement}});var ou=it();Object.defineProperty(H,"ASTBase",{enumerable:!0,get:function(){return ou.ASTBase}});Object.defineProperty(H,"ASTBaseBlock",{enumerable:!0,get:function(){return ou.ASTBaseBlock}});Object.defineProperty(H,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return ou.ASTBaseBlockWithScope}});Object.defineProperty(H,"ASTComment",{enumerable:!0,get:function(){return ou.ASTComment}});Object.defineProperty(H,"ASTType",{enumerable:!0,get:function(){return ou.ASTType}});var sL=ly();Object.defineProperty(H,"ASTBinaryExpression",{enumerable:!0,get:function(){return sL.ASTBinaryExpression}});var oL=kA();Object.defineProperty(H,"ASTBreakStatement",{enumerable:!0,get:function(){return oL.ASTBreakStatement}});var MA=fy();Object.defineProperty(H,"ASTCallExpression",{enumerable:!0,get:function(){return MA.ASTCallExpression}});Object.defineProperty(H,"ASTCallStatement",{enumerable:!0,get:function(){return MA.ASTCallStatement}});var aL=gy();Object.defineProperty(H,"ASTChunk",{enumerable:!0,get:function(){return aL.ASTChunk}});var uL=yy();Object.defineProperty(H,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return uL.ASTComparisonGroupExpression}});var cL=OA();Object.defineProperty(H,"ASTContinueStatement",{enumerable:!0,get:function(){return cL.ASTContinueStatement}});var lL=_y();Object.defineProperty(H,"ASTForGenericStatement",{enumerable:!0,get:function(){return lL.ASTForGenericStatement}});var hL=Sy();Object.defineProperty(H,"ASTFunctionStatement",{enumerable:!0,get:function(){return hL.ASTFunctionStatement}});var Oh=xy();Object.defineProperty(H,"ASTIdentifier",{enumerable:!0,get:function(){return Oh.ASTIdentifier}});Object.defineProperty(H,"ASTIdentifierKind",{enumerable:!0,get:function(){return Oh.ASTIdentifierKind}});Object.defineProperty(H,"ASTIndexExpression",{enumerable:!0,get:function(){return Oh.ASTIndexExpression}});Object.defineProperty(H,"ASTMemberExpression",{enumerable:!0,get:function(){return Oh.ASTMemberExpression}});var Rh=Oy();Object.defineProperty(H,"ASTClause",{enumerable:!0,get:function(){return Rh.ASTClause}});Object.defineProperty(H,"ASTElseClause",{enumerable:!0,get:function(){return Rh.ASTElseClause}});Object.defineProperty(H,"ASTIfClause",{enumerable:!0,get:function(){return Rh.ASTIfClause}});Object.defineProperty(H,"ASTIfStatement",{enumerable:!0,get:function(){return Rh.ASTIfStatement}});var dL=Dy();Object.defineProperty(H,"ASTIsaExpression",{enumerable:!0,get:function(){return dL.ASTIsaExpression}});var LA=My();Object.defineProperty(H,"ASTListConstructorExpression",{enumerable:!0,get:function(){return LA.ASTListConstructorExpression}});Object.defineProperty(H,"ASTListValue",{enumerable:!0,get:function(){return LA.ASTListValue}});var au=$y();Object.defineProperty(H,"ASTBooleanLiteral",{enumerable:!0,get:function(){return au.ASTBooleanLiteral}});Object.defineProperty(H,"ASTLiteral",{enumerable:!0,get:function(){return au.ASTLiteral}});Object.defineProperty(H,"ASTNilLiteral",{enumerable:!0,get:function(){return au.ASTNilLiteral}});Object.defineProperty(H,"ASTNumericLiteral",{enumerable:!0,get:function(){return au.ASTNumericLiteral}});Object.defineProperty(H,"ASTStringLiteral",{enumerable:!0,get:function(){return au.ASTStringLiteral}});var fL=Wy();Object.defineProperty(H,"ASTLogicalExpression",{enumerable:!0,get:function(){return fL.ASTLogicalExpression}});var NA=Gy();Object.defineProperty(H,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return NA.ASTMapConstructorExpression}});Object.defineProperty(H,"ASTMapKeyString",{enumerable:!0,get:function(){return NA.ASTMapKeyString}});var pL=Ky();Object.defineProperty(H,"ASTParenthesisExpression",{enumerable:!0,get:function(){return pL.ASTParenthesisExpression}});var gL=Xy();Object.defineProperty(H,"ASTReturnStatement",{enumerable:!0,get:function(){return gL.ASTReturnStatement}});var mL=Jy();Object.defineProperty(H,"ASTSliceExpression",{enumerable:!0,get:function(){return mL.ASTSliceExpression}});var yL=eb();Object.defineProperty(H,"ASTUnaryExpression",{enumerable:!0,get:function(){return yL.ASTUnaryExpression}});var bL=nb();Object.defineProperty(H,"ASTWhileStatement",{enumerable:!0,get:function(){return bL.ASTWhileStatement}})});var cb=m(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var Hi=Bi(),ab=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([Hi.TokenType.StringLiteral,Hi.TokenType.NumericLiteral,Hi.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([Hi.TokenType.StringLiteral,Hi.TokenType.NumericLiteral,Hi.TokenType.BooleanLiteral,Hi.TokenType.NilLiteral]))}isComment(e){return e===Hi.TokenType.Comment}};ub.default=ab});var hb=m(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.SelectorGroups=oe.SelectorGroupType=oe.getSelectorsFromGroup=oe.createSelectorGroup=oe.Selectors=oe.getSelectorValue=oe.createSelector=oe.createSelectorOptions=oe.SelectorType=void 0;var ae=Bi(),vr=Io(),be=Lo(),_L;(function(t){t.EndOfLine="EndOfLine",t.EndOfFile="EndOfFile",t.LParenthesis="LParenthesis",t.RParenthesis="RParenthesis",t.CLBracket="CLBracket",t.CRBracket="CRBracket",t.SLBracket="SLBracket",t.SRBracket="SRBracket",t.Assign="Assign",t.AddShorthand="AddShorthand",t.SubtractShorthand="SubtractShorthand",t.MultiplyShorthand="MultiplyShorthand",t.DivideShorthand="DivideShorthand",t.PowerShorthand="PowerShorthand",t.ModuloShorthand="ModuloShorthand",t.Seperator="Seperator",t.Function="Function",t.EndFunction="EndFunction",t.EndWhile="EndWhile",t.EndFor="EndFor",t.EndIf="EndIf",t.SliceSeperator="SliceSeperator",t.MapKeyValueSeperator="MapKeyValueSeperator",t.MapSeperator="MapSeperator",t.ListSeperator="ListSeperator",t.CallSeperator="CallSeperator",t.ArgumentSeperator="ArgumentSeperator",t.ImportCodeSeperator="ImportCodeSeperator",t.ElseIf="ElseIf",t.Then="Then",t.Else="Else",t.In="In",t.MemberSeperator="MemberSeperator",t.NumberSeperator="NumberSeperator",t.Reference="Reference",t.Isa="Isa",t.Or="Or",t.And="And",t.Minus="Minus",t.Plus="Plus",t.Times="Times",t.Divide="Divide",t.Power="Power",t.Mod="Mod",t.Equal="Equal",t.NotEqual="NotEqual",t.Greater="Greater",t.GreaterEqual="GreaterEqual",t.Lesser="Lesser",t.LessEqual="LessEqual",t.New="New",t.Not="Not",t.Comment="Comment"})(_L=oe.SelectorType||(oe.SelectorType={}));var lb=class{};oe.createSelectorOptions=lb;function se(t){let e;return t.value===void 0?(e=new Function("token",`if (token == null) return false;return token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}`,writable:!1})):(e=new Function("token",`if (token == null) return false;return token.value === '${t.value}' && token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}_${t.value}`,writable:!1})),e.data=t,e}oe.createSelector=se;function vL(t){return t.data.value}oe.getSelectorValue=vL;oe.Selectors={EndOfLine:se({type:ae.TokenType.EOL,value:be.Operator.EndOfLine}),EndOfFile:se({type:ae.TokenType.EOF,value:be.Operator.EndOfFile}),LParenthesis:se({type:ae.TokenType.Punctuator,value:be.Operator.LParenthesis}),RParenthesis:se({type:ae.TokenType.Punctuator,value:be.Operator.RParenthesis}),CLBracket:se({type:ae.TokenType.Punctuator,value:be.Operator.CLBracket}),CRBracket:se({type:ae.TokenType.Punctuator,value:be.Operator.CRBracket}),SLBracket:se({type:ae.TokenType.Punctuator,value:be.Operator.SLBracket}),SRBracket:se({type:ae.TokenType.Punctuator,value:be.Operator.SRBracket}),Assign:se({type:ae.TokenType.Punctuator,value:be.Operator.Assign}),AddShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.AddShorthand}),SubtractShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.SubtractShorthand}),MultiplyShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.MultiplyShorthand}),DivideShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.DivideShorthand}),PowerShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.PowerShorthand}),ModuloShorthand:se({type:ae.TokenType.Punctuator,value:be.Operator.ModuloShorthand}),Seperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),Function:se({type:ae.TokenType.Keyword,value:vr.Keyword.Function}),EndFunction:se({type:ae.TokenType.Keyword,value:vr.Keyword.EndFunction}),EndWhile:se({type:ae.TokenType.Keyword,value:vr.Keyword.EndWhile}),EndFor:se({type:ae.TokenType.Keyword,value:vr.Keyword.EndFor}),EndIf:se({type:ae.TokenType.Keyword,value:vr.Keyword.EndIf}),SliceSeperator:se({type:ae.TokenType.SliceOperator,value:be.Operator.SliceSeperator}),MapKeyValueSeperator:se({type:ae.TokenType.SliceOperator,value:be.Operator.SliceSeperator}),MapSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),ListSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),CallSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),ArgumentSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Comma}),ImportCodeSeperator:se({type:ae.TokenType.SliceOperator,value:be.Operator.SliceSeperator}),ElseIf:se({type:ae.TokenType.Keyword,value:vr.Keyword.ElseIf}),Then:se({type:ae.TokenType.Keyword,value:vr.Keyword.Then}),Else:se({type:ae.TokenType.Keyword,value:vr.Keyword.Else}),In:se({type:ae.TokenType.Keyword,value:vr.Keyword.In}),MemberSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Member}),NumberSeperator:se({type:ae.TokenType.Punctuator,value:be.Operator.Member}),Reference:se({type:ae.TokenType.Punctuator,value:be.Operator.Reference}),Isa:se({type:ae.TokenType.Keyword,value:be.Operator.Isa}),Or:se({type:ae.TokenType.Keyword,value:be.Operator.Or}),And:se({type:ae.TokenType.Keyword,value:be.Operator.And}),Minus:se({type:ae.TokenType.Punctuator,value:be.Operator.Minus}),Plus:se({type:ae.TokenType.Punctuator,value:be.Operator.Plus}),Times:se({type:ae.TokenType.Punctuator,value:be.Operator.Asterik}),Power:se({type:ae.TokenType.Punctuator,value:be.Operator.Power}),Divide:se({type:ae.TokenType.Punctuator,value:be.Operator.Slash}),Mod:se({type:ae.TokenType.Punctuator,value:be.Operator.Modulo}),Equal:se({type:ae.TokenType.Punctuator,value:be.Operator.Equal}),NotEqual:se({type:ae.TokenType.Punctuator,value:be.Operator.NotEqual}),Greater:se({type:ae.TokenType.Punctuator,value:be.Operator.GreaterThan}),GreaterEqual:se({type:ae.TokenType.Punctuator,value:be.Operator.GreaterThanOrEqual}),Lesser:se({type:ae.TokenType.Punctuator,value:be.Operator.LessThan}),LessEqual:se({type:ae.TokenType.Punctuator,value:be.Operator.LessThanOrEqual}),New:se({type:ae.TokenType.Keyword,value:vr.Keyword.New}),Not:se({type:ae.TokenType.Keyword,value:vr.Keyword.Not}),Comment:se({type:ae.TokenType.Comment})};function Fr(t,e){let r=e.filter(a=>a.data.value!==void 0).map(a=>`case '${a.data.value}': return token.type === '${a.data.type}';`).join(`
|
87
87
|
`),s=e.filter(a=>a.data.value===void 0).map(a=>`case '${a.data.type}':`).join(`
|
88
88
|
`),o=new Function("token",`
|
89
89
|
${s.length>0?`switch(token.type) {
|
@@ -93,32 +93,32 @@ ${e}
|
|
93
93
|
${r.length>0?`switch(token.value) {
|
94
94
|
${r}
|
95
95
|
}`:""}
|
96
|
-
return false;`);return Object.defineProperty(o,"name",{value:`selector_group_${t}`,writable:!1}),o.selectors=e,o}oe.createSelectorGroup=qr;function sL(t){return t.selectors}oe.getSelectorsFromGroup=sL;var jr;(function(t){t.BlockEndOfLine="BlockEndOfLine",t.AssignmentEndOfExpr="AssignmentEndOfExpr",t.AssignmentShorthand="AssignmentShorthand",t.AssignmentCommandArgs="AssignmentCommandArgs",t.ReturnStatementEnd="ReturnStatementEnd",t.FunctionDeclarationArgEnd="FunctionDeclarationArgEnd",t.ComparisonOperators="ComparisonOperators",t.MultiDivOperators="MultiDivOperators",t.CallArgsEnd="CallArgsEnd"})(jr=oe.SelectorGroupType||(oe.SelectorGroupType={}));oe.SelectorGroups={BlockEndOfLine:qr(jr.AssignmentEndOfExpr,[oe.Selectors.EndOfLine,oe.Selectors.Comment]),AssignmentEndOfExpr:qr(jr.AssignmentEndOfExpr,[oe.Selectors.EndOfFile,oe.Selectors.EndOfLine,oe.Selectors.Else,oe.Selectors.Comment]),AssignmentShorthand:qr(jr.AssignmentShorthand,[oe.Selectors.AddShorthand,oe.Selectors.SubtractShorthand,oe.Selectors.MultiplyShorthand,oe.Selectors.DivideShorthand,oe.Selectors.PowerShorthand,oe.Selectors.ModuloShorthand]),AssignmentCommandArgs:qr(jr.AssignmentCommandArgs,[oe.Selectors.ArgumentSeperator,oe.Selectors.EndOfLine,oe.Selectors.EndOfFile]),ReturnStatementEnd:qr(jr.ReturnStatementEnd,[oe.Selectors.EndOfLine,oe.Selectors.Else,oe.Selectors.Comment]),FunctionDeclarationArgEnd:qr(jr.FunctionDeclarationArgEnd,[oe.Selectors.RParenthesis,oe.Selectors.EndOfFile,oe.Selectors.EndOfLine]),ComparisonOperators:qr(jr.ComparisonOperators,[oe.Selectors.Equal,oe.Selectors.NotEqual,oe.Selectors.Greater,oe.Selectors.GreaterEqual,oe.Selectors.Lesser,oe.Selectors.LessEqual]),MultiDivOperators:qr(jr.MultiDivOperators,[oe.Selectors.Times,oe.Selectors.Divide,oe.Selectors.Mod]),CallArgsEnd:qr(jr.CallArgsEnd,[oe.Selectors.ArgumentSeperator,oe.Selectors.RParenthesis])}});var ub=m(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.Stack=void 0;var ab=class{constructor(){this._items=[],this._last=null,this._default=null}setDefault(e){this._default=e}push(e){return this._items.push(this._last=e)}pop(){switch(this._items.length){case 0:return this._default;case 1:return this._last=null,this._items.pop()}let e=this._items.pop();return this._last=this._items[this._items.length-1],e}peek(){return this._last||this._default}};Ph.Stack=ab});var pb=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.PendingWhile=Ye.isPendingWhile=Ye.PendingIf=Ye.isPendingIf=Ye.PendingFunction=Ye.isPendingFunction=Ye.PendingFor=Ye.isPendingFor=Ye.PendingChunk=Ye.isPendingChunk=Ye.PendingBlockType=void 0;var vr;(function(t){t[t.Chunk=0]="Chunk",t[t.For=1]="For",t[t.Function=2]="Function",t[t.If=3]="If",t[t.While=4]="While"})(vr=Ye.PendingBlockType||(Ye.PendingBlockType={}));var ws=class{constructor(e,n,r){this.lineRegistry=r,this.block=e,this.body=[],this.type=n,this.onComplete=null}complete(e){var n;(n=this.onComplete)===null||n===void 0||n.call(this,this)}};function oL(t){return t.type===vr.Chunk}Ye.isPendingChunk=oL;var cb=class extends ws{constructor(e,n){super(e,vr.Chunk,n)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],super.complete(e)}};Ye.PendingChunk=cb;function aL(t){return t.type===vr.For}Ye.isPendingFor=aL;var lb=class extends ws{constructor(e,n){super(e,vr.For,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(e.end.line,this.block),super.complete(e)}};Ye.PendingFor=lb;function uL(t){return t.type===vr.Function}Ye.isPendingFunction=uL;var hb=class extends ws{constructor(e,n,r){super(e,vr.Function,r),this.base=n,this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.base!==null?(this.base.end=this.block.end,this.base.range[1]=this.block.range[1],this.lineRegistry.addItemToLine(this.base.end.line,this.base)):this.lineRegistry.addItemToLine(this.block.end.line,this.block),super.complete(e)}};Ye.PendingFunction=hb;function cL(t){return t.type===vr.If}Ye.isPendingIf=cL;var db=class extends ws{constructor(e,n,r){super(e,vr.If,r),this.lineRegistry.addItemToLine(this.block.start.line,this.block),this.currentClause=n}addCurrentClauseToLineRegistry(){this.currentClause.start.line!==this.block.start.line&&this.lineRegistry.addItemToLine(this.currentClause.start.line,this.block)}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],this.addCurrentClauseToLineRegistry(),this.block.clauses.push(this.currentClause),super.complete(e),this.body=[]}complete(e){this.body.length>0&&this.next(e),this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(this.block.end.line,this.block),super.complete(e)}};Ye.PendingIf=db;function lL(t){return t.type===vr.While}Ye.isPendingWhile=lL;var fb=class extends ws{constructor(e,n){super(e,vr.While,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(e.end.line,this.block),super.complete(e)}};Ye.PendingWhile=fb});var mb=m(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.LineRegistry=void 0;var gb=class{constructor(){this._lines={}}get lines(){return this._lines}addItemToLines(e){this.addItemToRange(e.start.line,e.end.line,e)}addItemToLine(e,n){this.addItemToRange(e,e,n)}addItemToRange(e,n,r){let i=this._lines;for(let s=e;s<=n;s++){let o=i[s];o?o.push(r):i[s]=[r]}}};Dh.LineRegistry=gb});var DA=m(ou=>{"use strict";var PA=ou&&ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ou,"__esModule",{value:!0});var hL=PA(Zm()),Fo=Fi(),Mn=Rh(),dL=PA(ib()),fL=rh(),Kt=Po(),ui=Io(),Rt=Za(),K=ob(),pL=ub(),Fr=pb(),gL=mb(),yb=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new pL.Stack,r.statementErrors=[],r.lexer=n.lexer||new hL.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lineRegistry=new gL.LineRegistry,r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.iteratorStack=[],r.literals=[],r.validator=n.validator||new dL.default,r.astProvider=n.astProvider||new Mn.ASTProvider,r.unsafe=n.unsafe||!1,r.errors=[]}next(){this.previousToken=this.token,this.token=this.lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e,n){let r=this.token;return this.token.type!==e?(this.raise(`got ${r} where ${e} is required`,new Rt.Range(n||r.start,r.end)),null):(this.next(),r)}requireToken(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where "${(0,K.getSelectorValue)(e)}" is required`,new Rt.Range(n||r.start,r.end)),null)}requireTokenOfAny(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where any of ${(0,K.getSelectorsFromGroup)(e).map(i=>`"${(0,K.getSelectorValue)(i)}"`).join(", ")} is required`,new Rt.Range(n||r.start,r.end)),null)}skipNewlines(){var e;let n=this,r=0;for(;;){if(K.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.lineRegistry.addItemToLines(s)}else if(K.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}pushScope(e){let n=this;n.currentScope!==null&&(n.scopes.push(e),n.outerScopes.push(n.currentScope)),n.currentScope=e}popScope(){let e=this;e.currentScope=e.outerScopes.pop()}tryToRecover(){let e=this,n=e.statementErrors[0];if(e.errors.push(n),!e.unsafe)throw n;for(e.lexer.recoverFromSnapshot(),e.next();e.token.type!==Fo.TokenType.EOL&&e.token.type!==Fo.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,Fr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new Rt.Range(n.block.start,n.block.start));if(n.complete(e.previousToken),e.errors.push(r),!e.unsafe)throw r;n=e.backpatches.pop()}}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunk({start:n,end:null,range:[e.token.range[0],null]}),i=new Fr.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!K.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!K.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r}parseStatement(){let e=this;if(Fo.TokenType.Keyword===e.token.type&&Kt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.lineRegistry.addItemToLines(r),n.body.push(r)}parseContinueStatement(){let e=this,n=e.backpatches.peek();e.iteratorStack.length===0&&e.raise("'continue' without open loop block",new Rt.Range(e.previousToken.start,e.previousToken.end));let r=e.astProvider.continueStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(r),n.body.push(r)}parseBreakStatement(){let e=this,n=e.backpatches.peek();e.iteratorStack.length===0&&e.raise("'break' without open loop block",new Rt.Range(e.previousToken.start,e.previousToken.end));let r=e.astProvider.breakStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Kt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.lineRegistry.addItemToLines(i),r.body.push(i);return}case Kt.Keyword.If:{e.next(),e.parseIfStatement();return}case Kt.Keyword.ElseIf:{e.next(),e.nextIfClause(Mn.ASTType.ElseifClause);return}case Kt.Keyword.Else:{e.next(),e.nextIfClause(Mn.ASTType.ElseClause);return}case Kt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Kt.Keyword.For:{e.next(),e.parseForStatement();return}case Kt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Kt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Kt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Kt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Kt.Keyword.Continue:{e.next(),e.parseContinueStatement();return}case Kt.Keyword.Break:{e.next(),e.parseBreakStatement();return}}e.raise(`unexpected keyword ${e.token} at start of line`,new Rt.Range(e.token.start,e.token.end))}parseShortcutContinueStatement(){let e=this;return e.iteratorStack.length===0&&e.raise("'continue' without open loop block",new Rt.Range(e.previousToken.start,e.previousToken.end)),e.astProvider.continueStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope})}parseShortcutBreakStatement(){let e=this;return e.iteratorStack.length===0&&e.raise("'break' without open loop block",new Rt.Range(e.previousToken.start,e.previousToken.end)),e.astProvider.breakStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope})}parseShortcutStatement(){let e=this;if(Fo.TokenType.Keyword===e.token.type&&Kt.Keyword.Not!==e.token.value)switch(e.token.value){case Kt.Keyword.Return:return e.next(),e.parseReturnStatement();case Kt.Keyword.Continue:return e.next(),e.parseShortcutContinueStatement();case Kt.Keyword.Break:return e.next(),e.parseShortcutBreakStatement();default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new Rt.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token,i=e.parseExpr(null,!0,!0);if(K.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(K.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),a=e.currentAssignment;return e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],e.currentAssignment=a,n.definitions.push(o),o}else if(K.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let c=e.token,l=o.value.charAt(0),h=e.parseExpr(a),d=e.astProvider.parenthesisExpression({start:h.start,end:h.end,range:h.range,expression:h});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:d,start:c.start,end:e.previousToken.end,range:[c.range[0],e.previousToken.range[1]],scope:n}),a.end=e.previousToken.end,a.range[1]=e.previousToken.range[1],e.currentAssignment=u,n.definitions.push(a),a}let s=[];for(;!K.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),K.SelectorGroups.BlockEndOfLine(e.token)||K.Selectors.Else(e.token))break;if(K.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(K.SelectorGroups.AssignmentCommandArgs,r.start);if(K.Selectors.EndOfLine(a)||K.Selectors.EndOfFile(a))break}return s.length===0?e.astProvider.callStatement({expression:i,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}):e.astProvider.callStatement({expression:e.astProvider.callExpression({base:i,arguments:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n})}parseReturnStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=null,s=e.astProvider.returnStatement({argument:null,start:r.start,end:null,range:[r.range[0],null],scope:n});return K.SelectorGroups.ReturnStatementEnd(e.token)?(s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1]):(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],s.argument=i),n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.lineRegistry.addItemToLines(r),e.requireToken(K.Selectors.Then,n.start),!K.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let i=e.astProvider.ifStatement({clauses:[],start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=e.astProvider.ifClause({condition:r,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope}),o=new Fr.PendingIf(i,s,e.lineRegistry);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,Fr.isPendingIf)(r)){n.raise("no matching open if block",new Rt.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case Mn.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(K.Selectors.Then,i.start),r.currentClause=n.astProvider.elseifClause({condition:s,start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}case Mn.ASTType.ElseClause:{let i=n.token;r.currentClause=n.astProvider.elseClause({start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}}e===null&&(r.complete(n.previousToken),n.backpatches.pop(),n.backpatches.peek().body.push(r.block))}parseIfShortcutStatement(e,n){let r=this,i=[],s=r.backpatches.peek(),o=r.astProvider.ifShortcutStatement({clauses:i,start:n.start,end:null,range:[n.range[0],null],scope:r.currentScope}),a=r.parseShortcutStatement();if(i.push(r.astProvider.ifShortcutClause({condition:e,body:[a],start:n.start,end:r.token.end,range:[n.range[0],r.token.range[1]],scope:r.currentScope})),K.Selectors.Else(r.token)){r.next();let u=r.token,c=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[c],start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:r.currentScope}))}o.end=r.token.end,o.range[1]=r.token.range[1],r.lineRegistry.addItemToLines(o),s.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new Rt.Range(n.start,e.token.end));return}if(!K.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let i=e.astProvider.whileStatement({condition:r,start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=new Fr.PendingWhile(i,e.lineRegistry);e.backpatches.push(s),e.iteratorStack.push(i)}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingWhile)(n)){e.raise("no matching open while block",new Rt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.iteratorStack.pop(),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseWhileShortcutStatement(e,n){let r=this,i=r.backpatches.peek(),s=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[s],start:n.start,end:r.previousToken.end,range:[n.range[0],r.previousToken.range[1]],scope:r.currentScope});r.lineRegistry.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(Mn.ASTIdentifierKind.ForInVariable);e.requireToken(K.Selectors.In,r.start);let s=e.parseExpr(null);if(!s){e.raise("sequence expression expected for 'for' loop",new Rt.Range(r.start,e.token.end));return}if(!K.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,s,r);let o=e.astProvider.forGenericStatement({variable:i,iterator:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n});n.definitions.push(o);let a=new Fr.PendingFor(o,e.lineRegistry);e.backpatches.push(a),e.iteratorStack.push(o)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingFor)(n)){e.raise("no matching open for block",new Rt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.iteratorStack.pop(),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.currentScope,o=i.backpatches.peek(),a=i.parseShortcutStatement(),u=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[a],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});s.definitions.push(u),i.lineRegistry.addItemToLines(u),o.body.push(u)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!K.Selectors.Function(i.token))return i.parseOr(n,r);i.next();let s=i.previousToken,o=i.astProvider.functionStatement({start:s.start,end:null,range:[s.range[0],null],scope:i.currentScope,parent:i.outerScopes[i.outerScopes.length-1],assignment:i.currentAssignment}),a=[];if(i.pushScope(o),!K.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(K.Selectors.LParenthesis,s.start);!K.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(Mn.ASTIdentifierKind.Argument),l=c;if(i.consume(K.Selectors.Assign)){let h=i.parseExpr(null);if(h instanceof Mn.ASTLiteral){let d=i.astProvider.assignmentStatement({variable:c,init:h,start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(d),a.push(d)}else i.raise("parameter default value must be a literal value",new Rt.Range(l.start,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]]}))}else{let h=i.astProvider.assignmentStatement({variable:c,init:i.astProvider.unknown({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope}),start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(h),a.push(c)}if(K.Selectors.RParenthesis(i.token))break;if(i.requireToken(K.Selectors.ArgumentSeperator,s.start),K.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new Rt.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(K.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new Fr.PendingFunction(o,e,i.lineRegistry);return i.backpatches.push(u),o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingFunction)(n)){e.raise("no matching open function block",new Rt.Range(e.token.start,e.token.end));return}e.popScope(),n.complete(e.previousToken),e.backpatches.pop()}parseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseAnd(e,n);for(;K.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:ui.Operator.Or,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseNot(e,n);for(;K.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:ui.Operator.And,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,i=r.token;if(K.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:ui.Operator.Not,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseComparisons(e,n);if(K.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:ui.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseComparisons(e=!1,n=!1){let r=this,i=r.token,s=r.parseAddSub(e,n);if(!K.SelectorGroups.ComparisonOperators(r.token))return s;let o=[s],a=[];do{let u=r.token;r.next(),r.skipNewlines();let c=r.parseAddSub();a.push(u.value),o.push(c)}while(K.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;K.Selectors.Plus(r.token)||K.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,i=r.token,o=r.parseUnaryMinus(e,n);for(;K.SelectorGroups.MultiDivOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseUnaryMinus();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!K.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof Mn.ASTNumericLiteral||s instanceof Mn.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:ui.Operator.Minus,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!K.Selectors.New(r.token))return r.parseAddressOf(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return r.astProvider.unaryExpression({operator:ui.Operator.New,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!K.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower(!0,n);return r.astProvider.unaryExpression({operator:ui.Operator.Reference,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,i=r.token,s=r.parseCallExpr(e,n);if(K.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:ui.Operator.Power,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseCallExpr(e=!1,n=!1){let r=this,i=r.token,s=r.parseMap(e,n);for(;!K.Selectors.EndOfFile(r.token);)if(K.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier(Mn.ASTIdentifierKind.Property),a=r.astProvider.memberExpression({base:s,indexer:ui.Operator.Member,identifier:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope});r.currentScope.namespaces.push(a),s=a}else if(K.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),K.Selectors.SliceSeperator(r.token)){let o=r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope});r.next(),r.skipNewlines();let a=K.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else{let o=r.parseExpr(null);if(K.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=K.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else s=r.astProvider.indexExpression({base:s,index:o,isStatementStart:n,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(K.Selectors.SRBracket,i.start)}else if(K.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();s=r.astProvider.callExpression({base:s,arguments:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}else break;return s}parseCallArgs(){let e=this,n=[];if(K.Selectors.LParenthesis(e.token))if(e.next(),K.Selectors.RParenthesis(e.token))e.next();else for(;!K.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),K.Selectors.RParenthesis(e.requireTokenOfAny(K.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!K.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),K.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!K.Selectors.EndOfFile(r.token);){if(K.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.key=r.parseExpr(null),r.requireToken(K.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),K.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),K.Selectors.CRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!K.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),K.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!K.Selectors.EndOfFile(r.token);){if(K.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),K.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),K.Selectors.SRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseQuantity(e=!1,n=!1){let r=this;if(!K.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseExpr(null);return r.requireToken(K.Selectors.RParenthesis,i.start),r.astProvider.parenthesisExpression({expression:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAtom(e=!1,n=!1){let r=this;return r.validator.isLiteral(r.token.type)?r.parseLiteral():r.isType(Fo.TokenType.Identifier)?r.parseIdentifier(Mn.ASTIdentifierKind.Variable):(r.raise(`got ${r.token} where number, string, or identifier is required`,new Rt.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token,r=e.token.type,i=e.astProvider.literal(r,{value:e.token.value,raw:e.token.raw,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope});return e.literals.push(i),e.next(),i}parseIdentifier(e){let n=this,r=n.requireType(Fo.TokenType.Identifier);if(r===null)return n.parseInvalidCode();let i=n.astProvider.identifier({kind:e,name:r.value,start:r.start,end:r.end,range:r.range,scope:n.currentScope});return e!==Mn.ASTIdentifierKind.Property&&n.currentScope.namespaces.push(i),i}parseInvalidCode(){let e=this,n=e.token,r=e.astProvider.invalidCodeExpression({start:n.start,end:n.end,range:n.range});return e.next(),r}raise(e,n){let r=this,i=new fL.ParserException(e,n);return r.statementErrors.push(i),i}};ou.default=yb});var Ee=m(Oe=>{"use strict";var mL=Oe&&Oe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Sr=Oe&&Oe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&mL(e,t,n)},Ih=Oe&&Oe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ASTRange=Oe.ASTPosition=Oe.LineRegistry=Oe.ParserValidatorm=Oe.Parser=Oe.LexerValidator=Oe.Lexer=void 0;var yL=Zm();Object.defineProperty(Oe,"Lexer",{enumerable:!0,get:function(){return Ih(yL).default}});Sr(Fi(),Oe);var bL=Um();Object.defineProperty(Oe,"LexerValidator",{enumerable:!0,get:function(){return Ih(bL).default}});var _L=DA();Object.defineProperty(Oe,"Parser",{enumerable:!0,get:function(){return Ih(_L).default}});Sr(Rh(),Oe);var vL=ib();Object.defineProperty(Oe,"ParserValidatorm",{enumerable:!0,get:function(){return Ih(vL).default}});var SL=mb();Object.defineProperty(Oe,"LineRegistry",{enumerable:!0,get:function(){return SL.LineRegistry}});Sr(pb(),Oe);Sr(ub(),Oe);Sr(Ym(),Oe);Sr(nh(),Oe);Sr(rh(),Oe);Sr(Po(),Oe);Sr(zm(),Oe);Sr(Io(),Oe);var TL=Va();Object.defineProperty(Oe,"ASTPosition",{enumerable:!0,get:function(){return TL.Position}});var wL=Za();Object.defineProperty(Oe,"ASTRange",{enumerable:!0,get:function(){return wL.Range}});Sr(ob(),Oe)});var au=m(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.isValidIdentifierLiteral=void 0;var EL=Ee(),xL=t=>{if(t.type!==EL.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};Mh.isValidIdentifierLiteral=xL});var bb=m(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.getStringHashCode=Ui.getHashCode=Ui.rotateBits=void 0;function AL(t){return t>>1|t<<31}Ui.rotateBits=AL;function kL(t,e=0){let n=t>>>0;return n=(n>>16^n)*73244475,n=(n>>16^n)*73244475,n=n>>16^n,(e<<5)-e+n|0}Ui.getHashCode=kL;Ui.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var IA=m(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.createExpressionHash=void 0;var Ge=Ee(),Tt=bb(),CL=au(),Xt=(t,e)=>t.$$hash=e,OL=t=>t.$$hash??null;function st(t){let e=OL(t);if(e!==null)return e;let n=(0,Tt.getStringHashCode)(t.type);switch(t.type){case Ge.ASTType.BinaryExpression:{let r=t;return n^=(0,Tt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Xt(t,n)}case Ge.ASTType.LogicalExpression:{let r=t;return n^=(0,Tt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Xt(t,n)}case Ge.ASTType.IsaExpression:{let r=t;return n^=(0,Tt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Xt(t,n)}case Ge.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=st(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,Tt.getStringHashCode)(r.operators[i]);return Xt(t,n)}case Ge.ASTType.FunctionDeclaration:{let r=t;n^=(0,Tt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===Ge.ASTType.Identifier){n^=(0,Tt.getStringHashCode)(s.name);continue}let o=s;n^=(0,Tt.getStringHashCode)(o.variable.name),n^=st(o.init)}return Xt(t,n)}case Ge.ASTType.ParenthesisExpression:return st(t.expression);case Ge.ASTType.MemberExpression:{let r=t;if(r.base.type===Ge.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,Tt.getStringHashCode)(Ge.ASTType.Identifier),n^=(0,Tt.getStringHashCode)(r.identifier.name),Xt(t,n)}return n^=st(r.base),n^=st(r.identifier),Xt(t,n)}case Ge.ASTType.IndexExpression:{let r=t;if((0,CL.isValidIdentifierLiteral)(r.index)){if(r.base.type===Ge.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,Tt.getStringHashCode)(Ge.ASTType.Identifier),n^=(0,Tt.getStringHashCode)(r.index.value.toString()),Xt(t,n)}n=(0,Tt.getStringHashCode)(Ge.ASTType.MemberExpression),n^=st(r.base);let i=(0,Tt.getStringHashCode)(Ge.ASTType.Identifier);i^=(0,Tt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=st(r.base),n^=st(r.index);return Xt(t,n)}case Ge.ASTType.CallExpression:{let r=t;n^=st(r.base),n^=(0,Tt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=st(s)}return Xt(t,n)}case Ge.ASTType.NegationExpression:case Ge.ASTType.BinaryNegatedExpression:case Ge.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,Tt.getStringHashCode)(r.operator):1,n^=st(r.argument),Xt(t,n)}case Ge.ASTType.Identifier:{let r=t;return n^=(0,Tt.getStringHashCode)(r.name),Xt(t,n)}case Ge.ASTType.BooleanLiteral:case Ge.ASTType.NumericLiteral:case Ge.ASTType.StringLiteral:case Ge.ASTType.NilLiteral:return n^=(0,Tt.getStringHashCode)(t.value.toString()),Xt(t,n);case Ge.ASTType.MapConstructorExpression:{let r=t;n^=(0,Tt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=st(s.key),n^=st(s.value)}return Xt(t,n)}case Ge.ASTType.ListConstructorExpression:{let r=t;n^=(0,Tt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=st(s.value)}return Xt(t,n)}case Ge.ASTType.SliceExpression:{let r=t;return n^=st(r.base),n^=st(r.left),n^=st(r.right),Xt(t,n)}}return Xt(t,n)}function RL(t){return st(t)}Lh.createExpressionHash=RL});var _b=m(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.createExpressionId=void 0;var wt=Ee(),PL=au(),Pt=(t,e)=>t.$$id=e,DL=t=>t.$$id??null;function Je(t){let e=DL(t);if(e!==null)return e;switch(t.type){case wt.ASTType.BinaryExpression:{let n=t;return Pt(t,Je(n.left)+n.operator+Je(n.right))}case wt.ASTType.LogicalExpression:{let n=t;return Pt(t,Je(n.left)+n.operator+Je(n.right))}case wt.ASTType.IsaExpression:{let n=t;return Pt(t,Je(n.left)+n.operator+Je(n.right))}case wt.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>Je(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return Pt(t,i.join(" "))}case wt.ASTType.FunctionDeclaration:{let n=t,r="function",i=[];for(let s=0;s<n.parameters.length;s++){let o=n.parameters[s];if(o.type===wt.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+Je(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),Pt(t,r)}case wt.ASTType.ParenthesisExpression:return Pt(t,Je(t.expression));case wt.ASTType.MemberExpression:{let n=t;return Pt(t,Je(n.base)+"."+n.identifier.name)}case wt.ASTType.IndexExpression:{let n=t;return(0,PL.isValidIdentifierLiteral)(n.index)?Pt(t,Je(n.base)+"."+n.index.value.toString()):Pt(t,Je(n.base)+"["+Je(n.index)+"]")}case wt.ASTType.CallExpression:{let n=t,r=Je(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(Je(o))}return i.length>0&&(r+="("+i.join(",")+")"),Pt(t,r)}case wt.ASTType.NegationExpression:case wt.ASTType.BinaryNegatedExpression:case wt.ASTType.UnaryExpression:{let n=t;return n.operator==null?Pt(t,Je(n.argument)):n.operator==="@"?Pt(t,n.operator+Je(n.argument)):Pt(t,n.operator+" "+Je(n.argument))}case wt.ASTType.Identifier:return Pt(t,t.name);case wt.ASTType.NumericLiteral:case wt.ASTType.BooleanLiteral:case wt.ASTType.StringLiteral:case wt.ASTType.NilLiteral:return Pt(t,t.raw.toString());case wt.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Je(s.key)+":"+Je(s.value))}return Pt(t,"{"+r.join(",")+"}")}case wt.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Je(s.value))}return Pt(t,"["+r.join(",")+"]")}case wt.ASTType.SliceExpression:{let n=t;return Pt(t,Je(n.base)+"["+Je(n.left)+":"+Je(n.right)+"]")}}return Pt(t,"")}function IL(t){return Je(t)}Nh.createExpressionId=IL});var $o=m(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.Markers=void 0;var ML;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(ML=uu.Markers||(uu.Markers={}))});var Tr=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.rewireSpecs=gt.rewireSource=gt.seedTokens=gt.seedSpec=gt.seedBlock=gt.splitLines=gt.splitSpace=gt.splitCR=gt.hasCR=gt.isSpace=void 0;function LL(t){return/^\s+$/.test(t)}gt.isSpace=LL;function NL(t){return/\r$/.test(t)}gt.hasCR=NL;function qL(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}gt.splitCR=qL;function jL(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}gt.splitSpace=jL;function FL(t){return t.split(/\n/)}gt.splitLines=FL;function $L(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}gt.seedBlock=$L;function BL(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}gt.seedSpec=BL;function WL(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}gt.seedTokens=WL;function UL(t){let e=t.source.reduce((n,r)=>n.set(r.number,r),new Map);for(let n of t.tags)n.source=n.source.map(r=>e.get(r.number));return t}gt.rewireSource=UL;function HL(t){let e=t.tags.reduce((n,r)=>r.source.reduce((i,s)=>i.set(s.number,s),n),new Map);return t.source=t.source.map(n=>e.get(n.number)||n),t}gt.rewireSpecs=HL});var MA=m(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var GL=/^@\S+/;function zL({fence:t="```"}={}){let e=VL(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)GL.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}vb.default=zL;function VL(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var LA=m(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var KL=$o(),cu=Tr();function XL({startLine:t=0,markers:e=KL.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,cu.seedTokens)();if([a.lineEnd,o]=(0,cu.splitCR)(o),[a.start,o]=(0,cu.splitSpace)(o),n===null&&o.startsWith(e.start)&&!o.startsWith(e.nostart)&&(n=[],a.delimiter=o.slice(0,e.start.length),o=o.slice(e.start.length),[a.postDelimiter,o]=(0,cu.splitSpace)(o)),n===null)return r++,null;let u=o.trimRight().endsWith(e.end);if(a.delimiter===""&&o.startsWith(e.delim)&&!o.startsWith(e.end)&&(a.delimiter=e.delim,o=o.slice(e.delim.length),[a.postDelimiter,o]=(0,cu.splitSpace)(o)),u){let c=o.trimRight();a.end=o.slice(c.length-e.end.length),o=c.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:s,tokens:a}),r++,u){let c=n.slice();return n=null,c}return null}}Sb.default=XL});var NA=m(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var YL=Tr();function JL({tokenizers:t}){return function(n){var r;let i=(0,YL.seedSpec)({source:n});for(let s of t)if(i=s(i),!((r=i.problems[i.problems.length-1])===null||r===void 0)&&r.critical)break;return i}}Tb.default=JL});var Eb=m(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});function QL(){return t=>{let{tokens:e}=t.source[0],n=e.description.match(/\s*(@(\S+))(\s*)/);return n===null?(t.problems.push({code:"spec:tag:prefix",message:'tag should start with "@" symbol',line:t.source[0].number,critical:!0}),t):(e.tag=n[1],e.postTag=n[3],e.description=e.description.slice(n[0].length),t.tag=n[2],t)}}wb.default=QL});var Ab=m(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var ZL=Tr();function eN(t="compact"){let e=nN(t);return n=>{let r=0,i=[];for(let[a,{tokens:u}]of n.source.entries()){let c="";if(a===0&&u.description[0]!=="{")return n;for(let l of u.description)if(l==="{"&&r++,l==="}"&&r--,c+=l,r===0)break;if(i.push([u,c]),r===0)break}if(r!==0)return n.problems.push({code:"spec:type:unpaired-curlies",message:"unpaired curlies",line:n.source[0].number,critical:!0}),n;let s=[],o=i[0][0].postDelimiter.length;for(let[a,[u,c]]of i.entries())u.type=c,a>0&&(u.type=u.postDelimiter.slice(o)+c,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,ZL.splitSpace)(u.description.slice(c.length)),s.push(u.type);return s[0]=s[0].slice(1),s[s.length-1]=s[s.length-1].slice(0,-1),n.type=e(s),n}}xb.default=eN;var tN=t=>t.trim();function nN(t){return t==="compact"?e=>e.map(tN).join(""):t==="preserve"?e=>e.join(`
|
97
|
-
`):t}});var Ob=m(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var kb=Tr(),rN=t=>t&&t.startsWith('"')&&t.endsWith('"');function iN(){let t=(e,{tokens:n},r)=>n.type===""?e:r;return e=>{let{tokens:n}=e.source[e.source.reduce(t,0)],r=n.description.trimLeft(),i=r.split('"');if(i.length>1&&i[0]===""&&i.length%2===1)return e.name=i[1],n.name=`"${i[1]}"`,[n.postName,n.description]=(0,kb.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,kb.isSpace)(l))break;l==="["&&s++,l==="]"&&s--,o+=l}if(s!==0)return e.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:e.source[0].number,critical:!0}),e;let c=o;if(o[0]==="["&&o[o.length-1]==="]"){a=!0,o=o.slice(1,-1);let l=o.split("=");if(o=l[0].trim(),l[1]!==void 0&&(u=l.slice(1).join("=").trim()),o==="")return e.problems.push({code:"spec:name:empty-name",message:"empty name",line:e.source[0].number,critical:!0}),e;if(u==="")return e.problems.push({code:"spec:name:empty-default",message:"empty default value",line:e.source[0].number,critical:!0}),e;if(!rN(u)&&/=(?!>)/.test(u))return e.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:e.source[0].number,critical:!0}),e}return e.optional=a,e.name=o,n.name=c,u!==void 0&&(e.default=u),[n.postName,n.description]=(0,kb.splitSpace)(r.slice(n.name.length)),e}}Cb.default=iN});var Pb=m(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.getJoiner=void 0;var Rb=$o();function sN(t="compact",e=Rb.Markers){let n=qA(t);return r=>(r.description=n(r.source,e),r)}lu.default=sN;function qA(t){return t==="compact"?oN:t==="preserve"?cN:t}lu.getJoiner=qA;function oN(t,e=Rb.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var aN=(t,{tokens:e},n)=>e.type===""?t:n,uN=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function cN(t,e=Rb.Markers){if(t.length===0)return"";t[0].tokens.description===""&&t[0].tokens.delimiter===e.start&&(t=t.slice(1));let n=t[t.length-1];return n!==void 0&&n.tokens.description===""&&n.tokens.end.endsWith(e.end)&&(t=t.slice(0,-1)),t=t.slice(t.reduce(aN,0)),t.map(uN).join(`
|
98
|
-
`)}});var FA=m(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var lN=$o(),hN=Tr(),dN=MA(),fN=LA(),pN=NA(),gN=Eb(),mN=Ab(),yN=Ob(),jA=Pb();function bN({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=lN.Markers,tokenizers:i=[(0,gN.default)(),(0,mN.default)(n),(0,yN.default)(),(0,jA.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,fN.default)({startLine:t,markers:r}),o=(0,dN.default)({fence:e}),a=(0,pN.default)({tokenizers:i}),u=(0,jA.getJoiner)(n);return function(c){let l=[];for(let h of(0,hN.splitLines)(c)){let d=s(h);if(d===null)continue;let g=o(d),y=g.slice(1).map(a);l.push({description:u(g[0],r),tags:y,source:d,problems:y.reduce((b,C)=>b.concat(C.problems),[])})}return l}}Db.default=bN});var $A=m(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});function _N(t){return t.start+t.delimiter+t.postDelimiter+t.tag+t.postTag+t.type+t.postType+t.name+t.postName+t.description+t.end+t.lineEnd}function vN(){return t=>t.source.map(({tokens:e})=>_N(e)).join(`
|
99
|
-
`)}Ib.default=vN});var WA=m(hu=>{"use strict";var SN=hu&&hu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(hu,"__esModule",{value:!0});var BA=$o(),TN=Tr(),wN={start:0,tag:0,type:0,name:0},EN=(t=BA.Markers)=>(e,{tokens:n})=>({start:n.delimiter===t.start?n.start.length:e.start,tag:Math.max(e.tag,n.tag.length),type:Math.max(e.type,n.type.length),name:Math.max(e.name,n.name.length)}),Es=t=>"".padStart(t," ");function xN(t=BA.Markers){let e=!1,n;function r(i){let s=Object.assign({},i.tokens);s.tag!==""&&(e=!0);let o=s.tag===""&&s.name===""&&s.type===""&&s.description==="";if(s.end===t.end&&o)return s.start=Es(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=Es(n.start);break;case t.delim:s.start=Es(n.start+1);break;default:s.delimiter="",s.start=Es(n.start+2)}if(!e)return s.postDelimiter=s.description===""?"":" ",Object.assign(Object.assign({},i),{tokens:s});let a={delim:!1,tag:!1,type:!1,name:!1};return s.description===""&&(a.name=!0,s.postName="",s.name===""&&(a.type=!0,s.postType="",s.type===""&&(a.tag=!0,s.postTag="",s.tag===""&&(a.delim=!0)))),s.postDelimiter=a.delim?"":" ",a.tag||(s.postTag=Es(n.tag-s.tag.length+1)),a.type||(s.postType=Es(n.type-s.type.length+1)),a.name||(s.postName=Es(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=SN(i,["source"]);return n=s.reduce(EN(t),Object.assign({},wN)),(0,TN.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}hu.default=xN});var UA=m(du=>{"use strict";var AN=du&&du.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(du,"__esModule",{value:!0});var kN=Tr(),CN=t=>e=>e.slice(t),ON=t=>{let e="".padStart(t," ");return n=>n+e};function RN(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?ON(s):CN(-s)}return e(i)},r=i=>Object.assign(Object.assign({},i),{tokens:Object.assign(Object.assign({},i.tokens),{start:n(i.tokens.start)})});return i=>{var{source:s}=i,o=AN(i,["source"]);return(0,kN.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}du.default=RN});var HA=m(fu=>{"use strict";var PN=fu&&fu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(fu,"__esModule",{value:!0});var DN=Tr();function IN(t){function e(n){return Object.assign(Object.assign({},n),{tokens:Object.assign(Object.assign({},n.tokens),{lineEnd:t==="LF"?"":"\r"})})}return n=>{var{source:r}=n,i=PN(n,["source"]);return(0,DN.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}fu.default=IN});var GA=m(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.flow=void 0;function MN(...t){return e=>t.reduce((n,r)=>r(n),e)}qh.flow=MN});var XA=m(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var LN=Tr(),VA={line:0,start:0,delimiter:0,postDelimiter:0,tag:0,postTag:0,name:0,postName:0,type:0,postType:0,description:0,end:0,lineEnd:0},zA={lineEnd:"CR"},Mb=Object.keys(VA),KA=t=>(0,LN.isSpace)(t)?`{${t.length}}`:t,NN=t=>"|"+t.join("|")+"|",qN=(t,e)=>Object.keys(e).map(n=>KA(e[n]).padEnd(t[n]));function jN({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},VA);for(let s of Mb)r[s]=((e=zA[s])!==null&&e!==void 0?e:s).length;for(let{number:s,tokens:o}of t){r.line=Math.max(r.line,s.toString().length);for(let a in o)r[a]=Math.max(r[a],KA(o[a]).length)}let i=[[],[]];for(let s of Mb)i[0].push(((n=zA[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of Mb)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...qN(r,o)])}return i.map(NN).join(`
|
100
|
-
`)}Lb.default=jN});var Fh=m(Dt=>{"use strict";var FN=Dt&&Dt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),$N=Dt&&Dt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&FN(e,t,n)};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.util=Dt.tokenizers=Dt.transforms=Dt.inspect=Dt.stringify=Dt.parse=void 0;var BN=FA(),WN=Pb(),UN=Ob(),HN=Eb(),GN=Ab(),zN=$A(),VN=WA(),KN=UA(),XN=HA(),YN=GA(),jh=Tr();$N($o(),Dt);function JN(t,e={}){return(0,BN.default)(e)(t)}Dt.parse=JN;Dt.stringify=(0,zN.default)();var QN=XA();Object.defineProperty(Dt,"inspect",{enumerable:!0,get:function(){return QN.default}});Dt.transforms={flow:YN.flow,align:VN.default,indent:KN.default,crlf:XN.default};Dt.tokenizers={tag:HN.default,type:GN.default,name:UN.default,description:WN.default};Dt.util={rewireSpecs:jh.rewireSpecs,rewireSource:jh.rewireSource,seedBlock:jh.seedBlock,seedTokens:jh.seedTokens}});var Nb=m($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.getSignaturePayloadDefinitionType=void 0;function ZN(t){return t==null?null:typeof t=="object"?t.type:t}$h.getSignaturePayloadDefinitionType=ZN});var Hi=m(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.SignatureDefinitionBaseType=void 0;var eq;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(eq=pu.SignatureDefinitionBaseType||(pu.SignatureDefinitionBaseType={}))});var qb=m(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.TypeParser=void 0;var Bh=Hi(),tq=function(){function t(e){this._input=e,this._rx=/(\w+|<|>|,)/g,this._lastMatch=null}return t.prototype.next=function(){return this._lastMatch=this._rx.exec(this._input),this._lastMatch?this._lastMatch[0]:null},t.prototype.createDefault=function(){return{type:Bh.SignatureDefinitionBaseType.Any}},t.prototype.parseList=function(e){var n={type:e,valueType:Bh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.valueType=r,this.next()!==">")return this.createDefault()}return n},t.prototype.parseMap=function(e){var n={type:e,keyType:Bh.SignatureDefinitionBaseType.Any,valueType:Bh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.keyType=r,this.next()!==",")return this.createDefault();var i=this.parse();if(n.valueType=i,this.next()!==">")return this.createDefault()}return n},t.prototype.parse=function(){var e=this.next();if(!e)return this.createDefault();switch(e){case"list":return this.parseList(e);case"map":return this.parseMap(e)}return{type:e}},t}();Wh.TypeParser=tq});var gu=m(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.SignatureDefinitionTypeMeta=void 0;var jb=Nb(),nn=Hi(),nq=qb(),rq=function(){function t(e){var n,r;this.type=e.type,this.keyType=(n=e.keyType)!==null&&n!==void 0?n:null,this.valueType=(r=e.valueType)!==null&&r!==void 0?r:null}return t.fromString=function(e){var n=new nq.TypeParser(e),r=n.parse();return t.parse(r)},t.parseValueString=function(e){var n=e,r=null,i=null;return n===nn.SignatureDefinitionBaseType.Map?(r=new t({type:nn.SignatureDefinitionBaseType.Any}),i=new t({type:nn.SignatureDefinitionBaseType.Any})):n===nn.SignatureDefinitionBaseType.List&&(r=new t({type:nn.SignatureDefinitionBaseType.Any})),new t({type:n,valueType:r,keyType:i})},t.parseValueObject=function(e){var n,r,i,s=e.type,o=null,a=null;if(s===nn.SignatureDefinitionBaseType.Map){var u=(n=(0,jb.getSignaturePayloadDefinitionType)(e.keyType))!==null&&n!==void 0?n:nn.SignatureDefinitionBaseType.Any,c=(r=(0,jb.getSignaturePayloadDefinitionType)(e.valueType))!==null&&r!==void 0?r:nn.SignatureDefinitionBaseType.Any;u===nn.SignatureDefinitionBaseType.Map||u===nn.SignatureDefinitionBaseType.List?a=t.parse(e.keyType):a=new t({type:u}),c===nn.SignatureDefinitionBaseType.Map||c===nn.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}else if(s===nn.SignatureDefinitionBaseType.List){var c=(i=(0,jb.getSignaturePayloadDefinitionType)(e.valueType))!==null&&i!==void 0?i:nn.SignatureDefinitionBaseType.Any;c===nn.SignatureDefinitionBaseType.Map||c===nn.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}return new t({type:s,valueType:o,keyType:a})},t.parse=function(e){if(typeof e=="string")return t.parseValueString(e);if(typeof e=="object")return t.parseValueObject(e);throw new Error("Unable to parse type definition!")},t.prototype.isEqual=function(e){return this.type===e.type},t.prototype.isEqualSafe=function(e){return this.type===e.type&&this.keyType.type===e.keyType.type&&this.valueType.type===e.valueType.type},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType.toString(),">"):"".concat(this.type,"<").concat(this.keyType.toString(),",").concat(this.valueType.toString(),">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType.toJSON()}:{type:this.type,keyType:this.keyType.toJSON(),valueType:this.valueType.toJSON()}},t.prototype.copy=function(){var e,n;return new t({type:this.type,keyType:(e=this.keyType)===null||e===void 0?void 0:e.copy(),valueType:(n=this.valueType)===null||n===void 0?void 0:n.copy()})},t}();Uh.SignatureDefinitionTypeMeta=rq});var Fb=m(Gi=>{"use strict";var YA=Gi&&Gi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},JA=Gi&&Gi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.SignatureDefinitionFunctionArg=void 0;var QA=gu(),iq=function(){function t(e){this._label=e.label,this._types=e.types.reduce(function(n,r){return n.set(r.type,r)},new Map),this._opt=e.opt,this._default=e.default}return t.parse=function(e){var n,r,i=[];if(e.type)i.push(QA.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,JA([],YA(e.types.map(QA.SignatureDefinitionTypeMeta.parse)),!1));else throw new Error("Invalid signature definition function arg payload!");return new t({label:e.label,types:i,opt:(n=e.opt)!==null&&n!==void 0?n:!1,default:(r=e.default)!==null&&r!==void 0?r:null})},t.prototype.getLabel=function(){return this._label},t.prototype.isOptional=function(){return this._opt},t.prototype.getDefault=function(){return this._default},t.prototype.getTypes=function(){return JA([],YA(this._types.values()),!1)},t.prototype.isValidType=function(e){return this._types.has(e.type)},t.prototype.isValidTypeSafe=function(e){var n;return!!(!((n=this._types.get(e.type))===null||n===void 0)&&n.isEqualSafe(e))},t.prototype.toJSON=function(){return{label:this._label,types:this.getTypes().map(function(e){return e.toJSON()}),opt:this._opt,default:this._default}},t.prototype.copy=function(){return new t({label:this._label,types:this.getTypes().map(function(e){return e.copy()}),opt:this._opt,default:this._default})},t}();Gi.SignatureDefinitionFunctionArg=iq});var Hh=m($r=>{"use strict";var xs=$r&&$r.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},As=$r&&$r.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},sq=$r&&$r.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty($r,"__esModule",{value:!0});$r.VariationRegistry=void 0;var oq=function(){function t(e){this._name=e,this._variations=new Set}return t.prototype.getName=function(){return this._name},t.prototype.push=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._variations=new Set(As(As([],xs(e),!1),xs(this._variations),!1)),this},t.prototype.getAll=function(){return As([],xs(this._variations),!1)},t}(),aq=function(){function t(){}return t.add=function(e,n){var r=new oq(e);return r.push.apply(r,As([],xs(n),!1)),this.variationContainers.set(e,r),this},t.get=function(e){var n;return(n=this.variationContainers.get(e))!==null&&n!==void 0?n:null},t.resolve=function(e){var n,r,i=new Set;try{for(var s=sq(e),o=s.next();!o.done;o=s.next()){var a=o.value;if(typeof a=="string"&&a.startsWith("!")){var u=a.slice(1),c=this.get(u);if(c!==null)i=new Set(As(As([],xs(c.getAll()),!1),xs(i),!1));else throw new Error("Cannot find variation container for ".concat(u));continue}i.add(a)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return As([],xs(i),!1)},t.variationContainers=new Map,t}();$r.VariationRegistry=aq});var Gh=m(zi=>{"use strict";var uq=zi&&zi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},cq=zi&&zi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(zi,"__esModule",{value:!0});zi.SignatureDefinition=void 0;var lq=Hh(),hq=gu(),dq=function(){function t(e){this._type=e.type,this._isProtected=e.isProtected,this._description=e.description,this._example=e.example,this._variations=e.variations}return t.parse=function(e){var n,r,i;return new t({type:hq.SignatureDefinitionTypeMeta.parse(e.type),isProtected:!!e.isProtected,description:(n=e.description)!==null&&n!==void 0?n:null,example:(r=e.example)!==null&&r!==void 0?r:null,variations:(i=e.variations)!==null&&i!==void 0?i:null})},t.prototype.getType=function(){return this._type},t.prototype.isProtected=function(){return this._isProtected},t.prototype.getDescription=function(){return this._description},t.prototype.getExample=function(){return this._example},t.prototype.setDescription=function(e){var n;return this._description=e.description,this._example=(n=e.example)!==null&&n!==void 0?n:null,this},t.prototype.addVariation=function(e){return this._variations==null&&(this._variations=[]),this._variations.push(e),this},t.prototype.getVariations=function(){return lq.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?cq([],uq(this._example),!1):null}},t.prototype.withDescription=function(e){var n,r;return new t({type:this._type,isProtected:this._isProtected,description:(n=e?.description)!==null&&n!==void 0?n:this._description,example:(r=e?.example)!==null&&r!==void 0?r:this._example,variations:this._variations})},t.prototype.copy=function(){return new t({type:this._type.copy(),isProtected:this._isProtected,description:this._description,example:this._example,variations:this._variations})},t}();zi.SignatureDefinition=dq});var $b=m(Yn=>{"use strict";var fq=Yn&&Yn.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zh=Yn&&Yn.__assign||function(){return zh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zh.apply(this,arguments)},pq=Yn&&Yn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},gq=Yn&&Yn.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.SignatureDefinitionFunction=void 0;var mq=Hi(),yq=Hh(),bq=Gh(),_q=Fb(),ZA=gu(),vq=function(t){fq(e,t);function e(n){var r=t.call(this,{type:n.type,isProtected:n.isProtected,description:n.description,example:n.example,variations:n.variations})||this;return r._argList=n.arguments.map(function(i){return i.getLabel()}),r._argRefs=n.arguments.reduce(function(i,s){return i.set(s.getLabel(),s)},new Map),r._returns=n.returns.reduce(function(i,s){return i.set(s.type,s)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n){var r,i,s,o,a,u;return new e({type:new ZA.SignatureDefinitionTypeMeta({type:mq.SignatureDefinitionBaseType.Function}),isProtected:(r=n.isProtected)!==null&&r!==void 0?r:!1,description:(i=n.description)!==null&&i!==void 0?i:null,example:(s=n.example)!==null&&s!==void 0?s:null,arguments:(a=(o=n.arguments)===null||o===void 0?void 0:o.map(_q.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(ZA.SignatureDefinitionTypeMeta.parse),variations:n.variations,returnVariations:(u=n.returnVariations)!==null&&u!==void 0?u:null})},e.prototype.getArguments=function(){var n=this;return this._argList.map(function(r){return n._argRefs.get(r)})},e.prototype.getArgument=function(n){var r;return(r=this._argRefs.get(n))!==null&&r!==void 0?r:null},e.prototype.getReturns=function(){return gq([],pq(this._returns.values()),!1)},e.prototype.addReturnVariation=function(n){return this._returnVariations==null&&(this._returnVariations=[]),this._returnVariations.push(n),this},e.prototype.getReturnVariations=function(){return this._returnVariations==null&&(this._returnVariations=[]),yq.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return zh(zh({},t.prototype.toJSON.call(this)),{arguments:this.getArguments().map(function(n){return n.toJSON()}),returns:this.getReturns().map(function(n){return n.toJSON()})})},e.prototype.withDescription=function(n){var r,i;return new e({type:this._type,isProtected:this._isProtected,arguments:this.getArguments(),returns:this.getReturns(),description:(r=n?.description)!==null&&r!==void 0?r:this._description,example:(i=n?.example)!==null&&i!==void 0?i:this._example,variations:this._variations,returnVariations:this._returnVariations})},e.prototype.copy=function(){return new e({type:this._type.copy(),isProtected:this._isProtected,arguments:this.getArguments().map(function(n){return n.copy()}),returns:this.getReturns().map(function(n){return n.copy()}),description:this._description,example:this._example,variations:this._variations,returnVariations:this._returnVariations})},e}(bq.SignatureDefinition);Yn.SignatureDefinitionFunction=vq});var tk=m((S4,ek)=>{"use strict";ek.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var Bb=m((nk,rk)=>{"use strict";var Sq=tk();rk.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:Sq(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,nk.assert)}}});var Me=m((w4,ik)=>{"use strict";var Tq=Bb();ik.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new Tq(e)}});var ks=m((E4,ok)=>{"use strict";var Wb=Me(),sk={};ok.exports=function(t,e,n){if(e===!1||e===null||e===void 0)return t;n=n||{},typeof n=="string"&&(n={separator:n});let r=Array.isArray(e);Wb(!r||!n.separator,"Separator option is not valid for array-based chain");let i=r?e:e.split(n.separator||"."),s=t;for(let o=0;o<i.length;++o){let a=i[o],u=n.iterables&&sk.iterables(s);if(Array.isArray(s)||u==="set"){let c=Number(a);Number.isInteger(c)&&(a=c<0?s.length+c:c)}if(!s||typeof s=="function"&&n.functions===!1||!u&&s[a]===void 0){Wb(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),Wb(typeof s=="object"||n.functions===!0||typeof s!="function","Invalid segment",a,"in reach path ",e),s=n.default;break}u?u==="set"?s=[...s][a]:s=s.get(a):s=s[a]}return s};sk.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Ub=m((ln,uk)=>{"use strict";var ak={};ln=uk.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};ak.typeMap=new Map([["[object Error]",ln.error],["[object Map]",ln.map],["[object Promise]",ln.promise],["[object Set]",ln.set],["[object WeakMap]",ln.weakMap],["[object WeakSet]",ln.weakSet]]);ln.getInternalProto=function(t){if(Array.isArray(t))return ln.array;if(Buffer&&t instanceof Buffer)return ln.buffer;if(t instanceof Date)return ln.date;if(t instanceof RegExp)return ln.regex;if(t instanceof Error)return ln.error;let e=Object.prototype.toString.call(t);return ak.typeMap.get(e)||ln.generic}});var Hb=m(ck=>{"use strict";ck.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var hn=m((A4,lk)=>{"use strict";var wq=ks(),Ln=Ub(),Eq=Hb(),ci={needsProtoHack:new Set([Ln.set,Ln.map,Ln.weakSet,Ln.weakMap])};lk.exports=ci.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=ci.clone,i=n;if(e.shallow){if(e.shallow!==!0)return ci.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=Ln.getInternalProto(t);if(s===Ln.buffer)return Buffer&&Buffer.from(t);if(s===Ln.date)return new Date(t.getTime());if(s===Ln.regex)return new RegExp(t);let o=ci.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===Ln.set)for(let u of t)o.add(r(u,e,i));else if(s===Ln.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=Eq.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===Ln.array&&u==="length"){o.length=t.length;continue}let c=Object.getOwnPropertyDescriptor(t,u);c?c.get||c.set?Object.defineProperty(o,u,c):c.enumerable?o[u]=r(t[u],e,i):Object.defineProperty(o,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],e,i)}):Object.defineProperty(o,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],e,i)})}return o};ci.cloneWithShallow=function(t,e){let n=e.shallow;e=Object.assign({},e),e.shallow=!1;let r=new Map;for(let i of n){let s=wq(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return ci.clone(t,e,r)};ci.base=function(t,e,n){if(n.prototype===!1)return ci.needsProtoHack.has(e)?new e.constructor:e===Ln.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===Ln.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(ci.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var hk=m((k4,xq)=>{xq.exports={name:"joi",description:"Object schema validation",version:"17.13.3",repository:"git://github.com/hapijs/joi",main:"lib/index.js",types:"lib/index.d.ts",browser:"dist/joi-browser.min.js",files:["lib/**/*","dist/*"],keywords:["schema","validation"],dependencies:{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},devDependencies:{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63",typescript:"4.3.x"},scripts:{prepublishOnly:"cd browser && npm install && npm run build",test:"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},license:"BSD-3-Clause"}});var Vh=m(mu=>{"use strict";var P=Kh(),pe={};pe.wrap=P.string().min(1).max(2).allow(!1);mu.preferences=P.object({allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),context:P.object(),convert:P.boolean(),dateFormat:P.valid("date","iso","string","time","utc"),debug:P.boolean(),errors:{escapeHtml:P.boolean(),label:P.valid("path","key",!1),language:[P.string(),P.object().ref()],render:P.boolean(),stack:P.boolean(),wrap:{label:pe.wrap,array:pe.wrap,string:pe.wrap}},externals:P.boolean(),messages:P.object(),noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:P.valid("required","optional","forbidden"),skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()}).strict();pe.nameRx=/^[a-zA-Z0-9]\w*$/;pe.rule=P.object({alias:P.array().items(P.string().pattern(pe.nameRx)).single(),args:P.array().items(P.string(),P.object({name:P.string().pattern(pe.nameRx).required(),ref:P.boolean(),assert:P.alternatives([P.function(),P.object().schema()]).conditional("ref",{is:!0,then:P.required()}),normalize:P.function(),message:P.string().when("assert",{is:P.function(),then:P.required()})})),convert:P.boolean(),manifest:P.boolean(),method:P.function().allow(!1),multi:P.boolean(),validate:P.function()});mu.extension=P.object({type:P.alternatives([P.string(),P.object().regex()]).required(),args:P.function(),cast:P.object().pattern(pe.nameRx,P.object({from:P.function().maxArity(1).required(),to:P.function().minArity(1).maxArity(2).required()})),base:P.object().schema().when("type",{is:P.object().regex(),then:P.forbidden()}),coerce:[P.function().maxArity(3),P.object({method:P.function().maxArity(3).required(),from:P.array().items(P.string()).single()})],flags:P.object().pattern(pe.nameRx,P.object({setter:P.string(),default:P.any()})),manifest:{build:P.function().arity(2)},messages:[P.object(),P.string()],modifiers:P.object().pattern(pe.nameRx,P.function().minArity(1).maxArity(2)),overrides:P.object().pattern(pe.nameRx,P.function()),prepare:P.function().maxArity(3),rebuild:P.function().arity(1),rules:P.object().pattern(pe.nameRx,pe.rule),terms:P.object().pattern(pe.nameRx,P.object({init:P.array().allow(null).required(),manifest:P.object().pattern(/.+/,[P.valid("schema","single"),P.object({mapped:P.object({from:P.string().required(),to:P.string().required()}).required()})])})),validate:P.function().maxArity(3)}).strict();mu.extensions=P.array().items(P.object(),P.function().arity(1)).strict();pe.desc={buffer:P.object({buffer:P.string()}),func:P.object({function:P.function().required(),options:{literal:!0}}),override:P.object({override:!0}),ref:P.object({ref:P.object({type:P.valid("value","global","local"),path:P.array().required(),separator:P.string().length(1).allow(!1),ancestor:P.number().min(0).integer().allow("root"),map:P.array().items(P.array().length(2)).min(1),adjust:P.function(),iterables:P.boolean(),in:P.boolean(),render:P.boolean()}).required()}),regex:P.object({regex:P.string().min(3)}),special:P.object({special:P.valid("deep").required()}),template:P.object({template:P.string().required(),options:P.object()}),value:P.object({value:P.alternatives([P.object(),P.array()]).required()})};pe.desc.entity=P.alternatives([P.array().items(P.link("...")),P.boolean(),P.function(),P.number(),P.string(),pe.desc.buffer,pe.desc.func,pe.desc.ref,pe.desc.regex,pe.desc.special,pe.desc.template,pe.desc.value,P.link("/")]);pe.desc.values=P.array().items(null,P.boolean(),P.function(),P.number().allow(1/0,-1/0),P.string().allow(""),P.symbol(),pe.desc.buffer,pe.desc.func,pe.desc.override,pe.desc.ref,pe.desc.regex,pe.desc.template,pe.desc.value);pe.desc.messages=P.object().pattern(/.+/,[P.string(),pe.desc.template,P.object().pattern(/.+/,[P.string(),pe.desc.template])]);mu.description=P.object({type:P.string().required(),flags:P.object({cast:P.string(),default:P.any(),description:P.string(),empty:P.link("/"),failover:pe.desc.entity,id:P.string(),label:P.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:P.boolean(),unit:P.string()}).unknown(),preferences:{allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),convert:P.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:P.boolean(),label:["path","key"],language:[P.string(),pe.desc.ref],wrap:{label:pe.wrap,array:pe.wrap}},externals:P.boolean(),messages:pe.desc.messages,noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:["required","optional","forbidden"],skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()},allow:pe.desc.values,invalid:pe.desc.values,rules:P.array().min(1).items({name:P.string().required(),args:P.object().min(1),keep:P.boolean(),message:[P.string(),pe.desc.messages],warn:P.boolean()}),keys:P.object().pattern(/.*/,P.link("/")),link:pe.desc.ref}).pattern(/^[a-z]\w*$/,P.any())});var fk=m((O4,dk)=>{"use strict";var Vi={};dk.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);Vi.isSafe(r)?e+=t[n]:e+=Vi.escapeHtmlChar(r)}return e};Vi.escapeHtmlChar=function(t){let e=Vi.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};Vi.isSafe=function(t){return Vi.safeCharCodes.has(t)};Vi.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);Vi.safeCharCodes=function(){let t=new Set;for(let e=32;e<123;++e)(e>=97||e>=65&&e<=90||e>=48&&e<=57||e===32||e===46||e===44||e===45||e===58||e===95)&&t.add(e);return t}()});var pk=m(yu=>{"use strict";var Re={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};yu.Parser=class{constructor(t,e={}){if(!e[Re.settings]&&e.constants)for(let n in e.constants){let r=e.constants[n];if(r!==null&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${n} contains invalid ${typeof r} value type`)}this.settings=e[Re.settings]?e:Object.assign({[Re.settings]:!0,constants:{},functions:{}},e),this.single=null,this._parts=null,this._parse(t)}_parse(t){let e=[],n="",r=0,i=!1,s=a=>{if(r)throw new Error("Formula missing closing parenthesis");let u=e.length?e[e.length-1]:null;if(!(!i&&!n&&!a)){if(u&&u.type==="reference"&&a===")"){u.type="function",u.value=this._subFormula(n,u.value),n="";return}if(a===")"){let c=new yu.Parser(n,this.settings);e.push({type:"segment",value:c})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(Re.operatorCharacters.includes(n))u&&u.type==="operator"&&Re.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Re.numberRx))e.push({type:"constant",value:parseFloat(n)});else if(this.settings.constants[n]!==void 0)e.push({type:"constant",value:this.settings.constants[n]});else{if(!n.match(Re.tokenRx))throw new Error(`Formula contains invalid token: ${n}`);e.push({type:"reference",value:n})}n=""}};for(let a of t)i?a===i?(s(),i=!1):n+=a:r?a==="("?(n+=a,++r):a===")"?(--r,r?n+=a:s(a)):n+=a:a in Re.literals?i=Re.literals[a]:a==="("?(s(),++r):Re.operatorCharacters.includes(a)?(s(),n=a,s()):a!==" "?n+=a:s();s(),e=e.map((a,u)=>a.type!=="operator"||a.value!=="-"||u&&e[u-1].type!=="operator"?a:{type:"operator",value:"n"});let o=!1;for(let a of e){if(a.type==="operator"){if(Re.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Re.operators.includes(a.value))throw new Error(`Formula contains an unknown operator ${a.value}`)}else if(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");e.length===1&&["reference","literal","constant"].includes(e[0].type)&&(this.single={type:e[0].type==="reference"?"reference":"value",value:e[0].value}),this._parts=e.map(a=>{if(a.type==="operator")return Re.operatorsPrefix.includes(a.value)?a:a.value;if(a.type!=="reference")return a.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(a.value))throw new Error(`Formula contains invalid reference ${a.value}`);return this.settings.reference?this.settings.reference(a.value):Re.reference(a.value)})}_subFormula(t,e){let n=this.settings.functions[e];if(typeof n!="function")throw new Error(`Formula contains unknown function ${e}`);let r=[];if(t){let i="",s=0,o=!1,a=()=>{if(!i)throw new Error(`Formula contains function ${e} with invalid arguments ${t}`);r.push(i),i=""};for(let u=0;u<t.length;++u){let c=t[u];o?(i+=c,c===o&&(o=!1)):c in Re.literals&&!s?(i+=c,o=Re.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new yu.Parser(i,this.settings)),function(i){let s=[];for(let o of r)s.push(o.evaluate(i));return n.call(i,...s)}}evaluate(t){let e=this._parts.slice();for(let n=e.length-2;n>=0;--n){let r=e[n];if(r&&r.type==="operator"){let i=e[n+1];e.splice(n+1,1);let s=Re.evaluate(i,t);e[n]=Re.single(r.value,s)}}return Re.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Re.evaluate(e[r-1],t),o=Re.evaluate(e[r+1],t);e.splice(r,2);let a=Re.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Re.evaluate(e[0],t)}};yu.Parser.prototype[Re.symbol]=!0;Re.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Re.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Re.symbol]?t.evaluate(e):t};Re.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Re.calculate=function(t,e,n){if(t==="??")return Re.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Re.exists(e)?e:"",n=Re.exists(n)?n:"",e+n}else switch(t){case"^":return Math.pow(e,n);case"*":return e*n;case"/":return e/n;case"%":return e%n;case"+":return e+n;case"-":return e-n}switch(t){case"<":return e<n;case"<=":return e<=n;case">":return e>n;case">=":return e>=n;case"==":return e===n;case"!=":return e!==n;case"&&":return e&&n;case"||":return e||n}return null};Re.exists=function(t){return t!=null}});var mk=m(gk=>{"use strict";var Aq=hn(),kq=Qe(),Cs={annotations:Symbol("annotations")};gk.error=function(t){if(!this._original||typeof this._original!="object")return this.details[0].message;let e=t?"":"\x1B[31m",n=t?"":"\x1B[41m",r=t?"":"\x1B[0m",i=Aq(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,h=i;for(let d=0;;++d){let g=l[d];if(kq.isSchema(h)&&(h=h.clone()),d+1<l.length&&typeof h[g]!="string")h=h[g];else{let y=h[Cs.annotations]||{errors:{},missing:{}};h[Cs.annotations]=y;let b=g||c.context.key;h[g]!==void 0?(y.errors[b]=y.errors[b]||[],y.errors[b].push(u)):y.missing[b]=u;break}}}let s={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g},o=Cs.safeStringify(i,2).replace(s.key,(a,u)=>`" ${e}[${u}]${r}`).replace(s.missing,(a,u,c)=>`${n}"${u}"${r}${e} [${c}]: -- missing --${r}`).replace(s.arrayIndex,(a,u,c)=>`
|
96
|
+
return false;`);return Object.defineProperty(o,"name",{value:`selector_group_${t}`,writable:!1}),o.selectors=e,o}oe.createSelectorGroup=Fr;function SL(t){return t.selectors}oe.getSelectorsFromGroup=SL;var $r;(function(t){t.BlockEndOfLine="BlockEndOfLine",t.AssignmentEndOfExpr="AssignmentEndOfExpr",t.AssignmentShorthand="AssignmentShorthand",t.AssignmentCommandArgs="AssignmentCommandArgs",t.ReturnStatementEnd="ReturnStatementEnd",t.FunctionDeclarationArgEnd="FunctionDeclarationArgEnd",t.ComparisonOperators="ComparisonOperators",t.MultiDivOperators="MultiDivOperators",t.CallArgsEnd="CallArgsEnd"})($r=oe.SelectorGroupType||(oe.SelectorGroupType={}));oe.SelectorGroups={BlockEndOfLine:Fr($r.AssignmentEndOfExpr,[oe.Selectors.EndOfLine,oe.Selectors.Comment]),AssignmentEndOfExpr:Fr($r.AssignmentEndOfExpr,[oe.Selectors.EndOfFile,oe.Selectors.EndOfLine,oe.Selectors.Else,oe.Selectors.Comment]),AssignmentShorthand:Fr($r.AssignmentShorthand,[oe.Selectors.AddShorthand,oe.Selectors.SubtractShorthand,oe.Selectors.MultiplyShorthand,oe.Selectors.DivideShorthand,oe.Selectors.PowerShorthand,oe.Selectors.ModuloShorthand]),AssignmentCommandArgs:Fr($r.AssignmentCommandArgs,[oe.Selectors.ArgumentSeperator,oe.Selectors.EndOfLine,oe.Selectors.EndOfFile]),ReturnStatementEnd:Fr($r.ReturnStatementEnd,[oe.Selectors.EndOfLine,oe.Selectors.Else,oe.Selectors.Comment]),FunctionDeclarationArgEnd:Fr($r.FunctionDeclarationArgEnd,[oe.Selectors.RParenthesis,oe.Selectors.EndOfFile,oe.Selectors.EndOfLine]),ComparisonOperators:Fr($r.ComparisonOperators,[oe.Selectors.Equal,oe.Selectors.NotEqual,oe.Selectors.Greater,oe.Selectors.GreaterEqual,oe.Selectors.Lesser,oe.Selectors.LessEqual]),MultiDivOperators:Fr($r.MultiDivOperators,[oe.Selectors.Times,oe.Selectors.Divide,oe.Selectors.Mod]),CallArgsEnd:Fr($r.CallArgsEnd,[oe.Selectors.ArgumentSeperator,oe.Selectors.RParenthesis])}});var fb=m(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.Stack=void 0;var db=class{constructor(){this._items=[],this._last=null,this._default=null}setDefault(e){this._default=e}push(e){return this._items.push(this._last=e)}pop(){switch(this._items.length){case 0:return this._default;case 1:return this._last=null,this._items.pop()}let e=this._items.pop();return this._last=this._items[this._items.length-1],e}peek(){return this._last||this._default}};Ph.Stack=db});var _b=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.PendingWhile=Ye.isPendingWhile=Ye.PendingIf=Ye.isPendingIf=Ye.PendingFunction=Ye.isPendingFunction=Ye.PendingFor=Ye.isPendingFor=Ye.PendingChunk=Ye.isPendingChunk=Ye.PendingBlockType=void 0;var Sr;(function(t){t[t.Chunk=0]="Chunk",t[t.For=1]="For",t[t.Function=2]="Function",t[t.If=3]="If",t[t.While=4]="While"})(Sr=Ye.PendingBlockType||(Ye.PendingBlockType={}));var xs=class{constructor(e,n,r){this.lineRegistry=r,this.block=e,this.body=[],this.type=n,this.onComplete=null}complete(e){var n;(n=this.onComplete)===null||n===void 0||n.call(this,this)}};function TL(t){return t.type===Sr.Chunk}Ye.isPendingChunk=TL;var pb=class extends xs{constructor(e,n){super(e,Sr.Chunk,n)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],super.complete(e)}};Ye.PendingChunk=pb;function wL(t){return t.type===Sr.For}Ye.isPendingFor=wL;var gb=class extends xs{constructor(e,n){super(e,Sr.For,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(e.end.line,this.block),super.complete(e)}};Ye.PendingFor=gb;function EL(t){return t.type===Sr.Function}Ye.isPendingFunction=EL;var mb=class extends xs{constructor(e,n,r){super(e,Sr.Function,r),this.base=n,this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.base!==null?(this.base.end=this.block.end,this.base.range[1]=this.block.range[1],this.lineRegistry.addItemToLine(this.base.end.line,this.base)):this.lineRegistry.addItemToLine(this.block.end.line,this.block),super.complete(e)}};Ye.PendingFunction=mb;function xL(t){return t.type===Sr.If}Ye.isPendingIf=xL;var yb=class extends xs{constructor(e,n,r){super(e,Sr.If,r),this.lineRegistry.addItemToLine(this.block.start.line,this.block),this.currentClause=n}addCurrentClauseToLineRegistry(){this.currentClause.start.line!==this.block.start.line&&this.lineRegistry.addItemToLine(this.currentClause.start.line,this.block)}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],this.addCurrentClauseToLineRegistry(),this.block.clauses.push(this.currentClause),super.complete(e),this.body=[]}complete(e){this.body.length>0&&this.next(e),this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(this.block.end.line,this.block),super.complete(e)}};Ye.PendingIf=yb;function AL(t){return t.type===Sr.While}Ye.isPendingWhile=AL;var bb=class extends xs{constructor(e,n){super(e,Sr.While,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(e.end.line,this.block),super.complete(e)}};Ye.PendingWhile=bb});var Sb=m(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});Ih.LineRegistry=void 0;var vb=class{constructor(){this._lines={}}get lines(){return this._lines}addItemToLines(e){this.addItemToRange(e.start.line,e.end.line,e)}addItemToLine(e,n){this.addItemToRange(e,e,n)}addItemToRange(e,n,r){let i=this._lines;for(let s=e;s<=n;s++){let o=i[s];o?o.push(r):i[s]=[r]}}};Ih.LineRegistry=vb});var jA=m(uu=>{"use strict";var qA=uu&&uu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uu,"__esModule",{value:!0});var kL=qA(iy()),Bo=Bi(),Mn=Dh(),CL=qA(cb()),OL=ih(),Vt=Io(),li=Lo(),Rt=tu(),V=hb(),RL=fb(),Br=_b(),DL=Sb(),Tb=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new RL.Stack,r.statementErrors=[],r.lexer=n.lexer||new kL.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lineRegistry=new DL.LineRegistry,r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.iteratorStack=[],r.literals=[],r.validator=n.validator||new CL.default,r.astProvider=n.astProvider||new Mn.ASTProvider,r.unsafe=n.unsafe||!1,r.errors=[]}next(){this.previousToken=this.token,this.token=this.lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e,n){let r=this.token;return this.token.type!==e?(this.raise(`got ${r} where ${e} is required`,new Rt.Range(n||r.start,r.end)),null):(this.next(),r)}requireToken(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where "${(0,V.getSelectorValue)(e)}" is required`,new Rt.Range(n||r.start,r.end)),null)}requireTokenOfAny(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where any of ${(0,V.getSelectorsFromGroup)(e).map(i=>`"${(0,V.getSelectorValue)(i)}"`).join(", ")} is required`,new Rt.Range(n||r.start,r.end)),null)}skipNewlines(){var e;let n=this,r=0;for(;;){if(V.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.lineRegistry.addItemToLines(s)}else if(V.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}pushScope(e){let n=this;n.currentScope!==null&&(n.scopes.push(e),n.outerScopes.push(n.currentScope)),n.currentScope=e}popScope(){let e=this;e.currentScope=e.outerScopes.pop()}tryToRecover(){let e=this,n=e.statementErrors[0];if(e.errors.push(n),!e.unsafe)throw n;for(e.lexer.recoverFromSnapshot(),e.next();e.token.type!==Bo.TokenType.EOL&&e.token.type!==Bo.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,Br.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new Rt.Range(n.block.start,n.block.start));if(n.complete(e.previousToken),e.errors.push(r),!e.unsafe)throw r;n=e.backpatches.pop()}}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunk({start:n,end:null,range:[e.token.range[0],null]}),i=new Br.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!V.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!V.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r}parseStatement(){let e=this;if(Bo.TokenType.Keyword===e.token.type&&Vt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.lineRegistry.addItemToLines(r),n.body.push(r)}parseContinueStatement(){let e=this,n=e.backpatches.peek();e.iteratorStack.length===0&&e.raise("'continue' without open loop block",new Rt.Range(e.previousToken.start,e.previousToken.end));let r=e.astProvider.continueStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(r),n.body.push(r)}parseBreakStatement(){let e=this,n=e.backpatches.peek();e.iteratorStack.length===0&&e.raise("'break' without open loop block",new Rt.Range(e.previousToken.start,e.previousToken.end));let r=e.astProvider.breakStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Vt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.lineRegistry.addItemToLines(i),r.body.push(i);return}case Vt.Keyword.If:{e.next(),e.parseIfStatement();return}case Vt.Keyword.ElseIf:{e.next(),e.nextIfClause(Mn.ASTType.ElseifClause);return}case Vt.Keyword.Else:{e.next(),e.nextIfClause(Mn.ASTType.ElseClause);return}case Vt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Vt.Keyword.For:{e.next(),e.parseForStatement();return}case Vt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Vt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Vt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Vt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Vt.Keyword.Continue:{e.next(),e.parseContinueStatement();return}case Vt.Keyword.Break:{e.next(),e.parseBreakStatement();return}}e.raise(`unexpected keyword ${e.token} at start of line`,new Rt.Range(e.token.start,e.token.end))}parseShortcutContinueStatement(){let e=this;return e.iteratorStack.length===0&&e.raise("'continue' without open loop block",new Rt.Range(e.previousToken.start,e.previousToken.end)),e.astProvider.continueStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope})}parseShortcutBreakStatement(){let e=this;return e.iteratorStack.length===0&&e.raise("'break' without open loop block",new Rt.Range(e.previousToken.start,e.previousToken.end)),e.astProvider.breakStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope})}parseShortcutStatement(){let e=this;if(Bo.TokenType.Keyword===e.token.type&&Vt.Keyword.Not!==e.token.value)switch(e.token.value){case Vt.Keyword.Return:return e.next(),e.parseReturnStatement();case Vt.Keyword.Continue:return e.next(),e.parseShortcutContinueStatement();case Vt.Keyword.Break:return e.next(),e.parseShortcutBreakStatement();default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new Rt.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token,i=e.parseExpr(null,!0,!0);if(V.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(V.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),a=e.currentAssignment;return e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],e.currentAssignment=a,n.definitions.push(o),o}else if(V.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let c=e.token,l=o.value.charAt(0),h=e.parseExpr(a),d=e.astProvider.parenthesisExpression({start:h.start,end:h.end,range:h.range,expression:h});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:d,start:c.start,end:e.previousToken.end,range:[c.range[0],e.previousToken.range[1]],scope:n}),a.end=e.previousToken.end,a.range[1]=e.previousToken.range[1],e.currentAssignment=u,n.definitions.push(a),a}let s=[];for(;!V.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),V.SelectorGroups.BlockEndOfLine(e.token)||V.Selectors.Else(e.token))break;if(V.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(V.SelectorGroups.AssignmentCommandArgs,r.start);if(V.Selectors.EndOfLine(a)||V.Selectors.EndOfFile(a))break}return s.length===0?e.astProvider.callStatement({expression:i,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}):e.astProvider.callStatement({expression:e.astProvider.callExpression({base:i,arguments:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n})}parseReturnStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=null,s=e.astProvider.returnStatement({argument:null,start:r.start,end:null,range:[r.range[0],null],scope:n});return V.SelectorGroups.ReturnStatementEnd(e.token)?(s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1]):(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],s.argument=i),n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.lineRegistry.addItemToLines(r),e.requireToken(V.Selectors.Then,n.start),!V.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let i=e.astProvider.ifStatement({clauses:[],start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=e.astProvider.ifClause({condition:r,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope}),o=new Br.PendingIf(i,s,e.lineRegistry);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,Br.isPendingIf)(r)){n.raise("no matching open if block",new Rt.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case Mn.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(V.Selectors.Then,i.start),r.currentClause=n.astProvider.elseifClause({condition:s,start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}case Mn.ASTType.ElseClause:{let i=n.token;r.currentClause=n.astProvider.elseClause({start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}}e===null&&(r.complete(n.previousToken),n.backpatches.pop(),n.backpatches.peek().body.push(r.block))}parseIfShortcutStatement(e,n){let r=this,i=[],s=r.backpatches.peek(),o=r.astProvider.ifShortcutStatement({clauses:i,start:n.start,end:null,range:[n.range[0],null],scope:r.currentScope}),a=r.parseShortcutStatement();if(i.push(r.astProvider.ifShortcutClause({condition:e,body:[a],start:n.start,end:r.token.end,range:[n.range[0],r.token.range[1]],scope:r.currentScope})),V.Selectors.Else(r.token)){r.next();let u=r.token,c=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[c],start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:r.currentScope}))}o.end=r.token.end,o.range[1]=r.token.range[1],r.lineRegistry.addItemToLines(o),s.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new Rt.Range(n.start,e.token.end));return}if(!V.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let i=e.astProvider.whileStatement({condition:r,start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=new Br.PendingWhile(i,e.lineRegistry);e.backpatches.push(s),e.iteratorStack.push(i)}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,Br.isPendingWhile)(n)){e.raise("no matching open while block",new Rt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.iteratorStack.pop(),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseWhileShortcutStatement(e,n){let r=this,i=r.backpatches.peek(),s=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[s],start:n.start,end:r.previousToken.end,range:[n.range[0],r.previousToken.range[1]],scope:r.currentScope});r.lineRegistry.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(Mn.ASTIdentifierKind.ForInVariable);e.requireToken(V.Selectors.In,r.start);let s=e.parseExpr(null);if(!s){e.raise("sequence expression expected for 'for' loop",new Rt.Range(r.start,e.token.end));return}if(!V.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,s,r);let o=e.astProvider.forGenericStatement({variable:i,iterator:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n});n.definitions.push(o);let a=new Br.PendingFor(o,e.lineRegistry);e.backpatches.push(a),e.iteratorStack.push(o)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,Br.isPendingFor)(n)){e.raise("no matching open for block",new Rt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.iteratorStack.pop(),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.currentScope,o=i.backpatches.peek(),a=i.parseShortcutStatement(),u=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[a],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});s.definitions.push(u),i.lineRegistry.addItemToLines(u),o.body.push(u)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!V.Selectors.Function(i.token))return i.parseOr(n,r);i.next();let s=i.previousToken,o=i.astProvider.functionStatement({start:s.start,end:null,range:[s.range[0],null],scope:i.currentScope,parent:i.outerScopes[i.outerScopes.length-1],assignment:i.currentAssignment}),a=[];if(i.pushScope(o),!V.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(V.Selectors.LParenthesis,s.start);!V.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(Mn.ASTIdentifierKind.Argument),l=c;if(i.consume(V.Selectors.Assign)){let h=i.parseExpr(null);if(h instanceof Mn.ASTLiteral){let d=i.astProvider.assignmentStatement({variable:c,init:h,start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(d),a.push(d)}else i.raise("parameter default value must be a literal value",new Rt.Range(l.start,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]]}))}else{let h=i.astProvider.assignmentStatement({variable:c,init:i.astProvider.unknown({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope}),start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(h),a.push(c)}if(V.Selectors.RParenthesis(i.token))break;if(i.requireToken(V.Selectors.ArgumentSeperator,s.start),V.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new Rt.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(V.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new Br.PendingFunction(o,e,i.lineRegistry);return i.backpatches.push(u),o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,Br.isPendingFunction)(n)){e.raise("no matching open function block",new Rt.Range(e.token.start,e.token.end));return}e.popScope(),n.complete(e.previousToken),e.backpatches.pop()}parseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseAnd(e,n);for(;V.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:li.Operator.Or,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseNot(e,n);for(;V.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:li.Operator.And,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,i=r.token;if(V.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:li.Operator.Not,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseComparisons(e,n);if(V.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:li.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseComparisons(e=!1,n=!1){let r=this,i=r.token,s=r.parseAddSub(e,n);if(!V.SelectorGroups.ComparisonOperators(r.token))return s;let o=[s],a=[];do{let u=r.token;r.next(),r.skipNewlines();let c=r.parseAddSub();a.push(u.value),o.push(c)}while(V.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;V.Selectors.Plus(r.token)||V.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,i=r.token,o=r.parseUnaryMinus(e,n);for(;V.SelectorGroups.MultiDivOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseUnaryMinus();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!V.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof Mn.ASTNumericLiteral||s instanceof Mn.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:li.Operator.Minus,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!V.Selectors.New(r.token))return r.parseAddressOf(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return r.astProvider.unaryExpression({operator:li.Operator.New,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!V.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower(!0,n);return r.astProvider.unaryExpression({operator:li.Operator.Reference,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,i=r.token,s=r.parseCallExpr(e,n);if(V.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:li.Operator.Power,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseCallExpr(e=!1,n=!1){let r=this,i=r.token,s=r.parseMap(e,n);for(;!V.Selectors.EndOfFile(r.token);)if(V.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier(Mn.ASTIdentifierKind.Property),a=r.astProvider.memberExpression({base:s,indexer:li.Operator.Member,identifier:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope});r.currentScope.namespaces.push(a),s=a}else if(V.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),V.Selectors.SliceSeperator(r.token)){let o=r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope});r.next(),r.skipNewlines();let a=V.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else{let o=r.parseExpr(null);if(V.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=V.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else s=r.astProvider.indexExpression({base:s,index:o,isStatementStart:n,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(V.Selectors.SRBracket,i.start)}else if(V.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();s=r.astProvider.callExpression({base:s,arguments:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}else break;return s}parseCallArgs(){let e=this,n=[];if(V.Selectors.LParenthesis(e.token))if(e.next(),V.Selectors.RParenthesis(e.token))e.next();else for(;!V.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),V.Selectors.RParenthesis(e.requireTokenOfAny(V.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!V.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),V.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!V.Selectors.EndOfFile(r.token);){if(V.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.key=r.parseExpr(null),r.requireToken(V.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),V.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),V.Selectors.CRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!V.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),V.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!V.Selectors.EndOfFile(r.token);){if(V.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),V.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),V.Selectors.SRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseQuantity(e=!1,n=!1){let r=this;if(!V.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseExpr(null);return r.requireToken(V.Selectors.RParenthesis,i.start),r.astProvider.parenthesisExpression({expression:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAtom(e=!1,n=!1){let r=this;return r.validator.isLiteral(r.token.type)?r.parseLiteral():r.isType(Bo.TokenType.Identifier)?r.parseIdentifier(Mn.ASTIdentifierKind.Variable):(r.raise(`got ${r.token} where number, string, or identifier is required`,new Rt.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token,r=e.token.type,i=e.astProvider.literal(r,{value:e.token.value,raw:e.token.raw,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope});return e.literals.push(i),e.next(),i}parseIdentifier(e){let n=this,r=n.requireType(Bo.TokenType.Identifier);if(r===null)return n.parseInvalidCode();let i=n.astProvider.identifier({kind:e,name:r.value,start:r.start,end:r.end,range:r.range,scope:n.currentScope});return e!==Mn.ASTIdentifierKind.Property&&n.currentScope.namespaces.push(i),i}parseInvalidCode(){let e=this,n=e.token,r=e.astProvider.invalidCodeExpression({start:n.start,end:n.end,range:n.range});return e.next(),r}raise(e,n){let r=this,i=new OL.ParserException(e,n);return r.statementErrors.push(i),i}};uu.default=Tb});var Ee=m(Oe=>{"use strict";var PL=Oe&&Oe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Tr=Oe&&Oe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&PL(e,t,n)},Mh=Oe&&Oe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ASTRange=Oe.ASTPosition=Oe.LineRegistry=Oe.ParserValidatorm=Oe.Parser=Oe.LexerValidator=Oe.Lexer=void 0;var IL=iy();Object.defineProperty(Oe,"Lexer",{enumerable:!0,get:function(){return Mh(IL).default}});Tr(Bi(),Oe);var ML=Vm();Object.defineProperty(Oe,"LexerValidator",{enumerable:!0,get:function(){return Mh(ML).default}});var LL=jA();Object.defineProperty(Oe,"Parser",{enumerable:!0,get:function(){return Mh(LL).default}});Tr(Dh(),Oe);var NL=cb();Object.defineProperty(Oe,"ParserValidatorm",{enumerable:!0,get:function(){return Mh(NL).default}});var qL=Sb();Object.defineProperty(Oe,"LineRegistry",{enumerable:!0,get:function(){return qL.LineRegistry}});Tr(_b(),Oe);Tr(fb(),Oe);Tr(ty(),Oe);Tr(rh(),Oe);Tr(ih(),Oe);Tr(Io(),Oe);Tr(Jm(),Oe);Tr(Lo(),Oe);var jL=Xa();Object.defineProperty(Oe,"ASTPosition",{enumerable:!0,get:function(){return jL.Position}});var FL=tu();Object.defineProperty(Oe,"ASTRange",{enumerable:!0,get:function(){return FL.Range}});Tr(hb(),Oe)});var cu=m(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.isValidIdentifierLiteral=void 0;var $L=Ee(),BL=t=>{if(t.type!==$L.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};Lh.isValidIdentifierLiteral=BL});var wb=m(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.getSignaturePayloadDefinitionType=void 0;function WL(t){return t==null?null:typeof t=="object"?t.type:t}Nh.getSignaturePayloadDefinitionType=WL});var Gi=m(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.SignatureDefinitionBaseType=void 0;var UL;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(UL=lu.SignatureDefinitionBaseType||(lu.SignatureDefinitionBaseType={}))});var Eb=m(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.TypeParser=void 0;var qh=Gi(),HL=function(){function t(e){this._input=e,this._rx=/(\w+|<|>|,)/g,this._lastMatch=null}return t.prototype.next=function(){return this._lastMatch=this._rx.exec(this._input),this._lastMatch?this._lastMatch[0]:null},t.prototype.createDefault=function(){return{type:qh.SignatureDefinitionBaseType.Any}},t.prototype.parseList=function(e){var n={type:e,valueType:qh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.valueType=r,this.next()!==">")return this.createDefault()}return n},t.prototype.parseMap=function(e){var n={type:e,keyType:qh.SignatureDefinitionBaseType.Any,valueType:qh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.keyType=r,this.next()!==",")return this.createDefault();var i=this.parse();if(n.valueType=i,this.next()!==">")return this.createDefault()}return n},t.prototype.parse=function(){var e=this.next();if(!e)return this.createDefault();switch(e){case"list":return this.parseList(e);case"map":return this.parseMap(e)}return{type:e}},t}();jh.TypeParser=HL});var hu=m(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.SignatureDefinitionTypeMeta=void 0;var xb=wb(),nn=Gi(),GL=Eb(),zL=function(){function t(e){var n,r;this.type=e.type,this.keyType=(n=e.keyType)!==null&&n!==void 0?n:null,this.valueType=(r=e.valueType)!==null&&r!==void 0?r:null}return t.fromString=function(e){var n=new GL.TypeParser(e),r=n.parse();return t.parse(r)},t.parseValueString=function(e){var n=e,r=null,i=null;return n===nn.SignatureDefinitionBaseType.Map?(r=new t({type:nn.SignatureDefinitionBaseType.Any}),i=new t({type:nn.SignatureDefinitionBaseType.Any})):n===nn.SignatureDefinitionBaseType.List&&(r=new t({type:nn.SignatureDefinitionBaseType.Any})),new t({type:n,valueType:r,keyType:i})},t.parseValueObject=function(e){var n,r,i,s=e.type,o=null,a=null;if(s===nn.SignatureDefinitionBaseType.Map){var u=(n=(0,xb.getSignaturePayloadDefinitionType)(e.keyType))!==null&&n!==void 0?n:nn.SignatureDefinitionBaseType.Any,c=(r=(0,xb.getSignaturePayloadDefinitionType)(e.valueType))!==null&&r!==void 0?r:nn.SignatureDefinitionBaseType.Any;u===nn.SignatureDefinitionBaseType.Map||u===nn.SignatureDefinitionBaseType.List?a=t.parse(e.keyType):a=new t({type:u}),c===nn.SignatureDefinitionBaseType.Map||c===nn.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}else if(s===nn.SignatureDefinitionBaseType.List){var c=(i=(0,xb.getSignaturePayloadDefinitionType)(e.valueType))!==null&&i!==void 0?i:nn.SignatureDefinitionBaseType.Any;c===nn.SignatureDefinitionBaseType.Map||c===nn.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}return new t({type:s,valueType:o,keyType:a})},t.parse=function(e){if(typeof e=="string")return t.parseValueString(e);if(typeof e=="object")return t.parseValueObject(e);throw new Error("Unable to parse type definition!")},t.prototype.isEqual=function(e){return this.type===e.type},t.prototype.isEqualSafe=function(e){return this.type===e.type&&this.keyType.type===e.keyType.type&&this.valueType.type===e.valueType.type},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType.toString(),">"):"".concat(this.type,"<").concat(this.keyType.toString(),",").concat(this.valueType.toString(),">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType.toJSON()}:{type:this.type,keyType:this.keyType.toJSON(),valueType:this.valueType.toJSON()}},t.prototype.copy=function(){var e,n;return new t({type:this.type,keyType:(e=this.keyType)===null||e===void 0?void 0:e.copy(),valueType:(n=this.valueType)===null||n===void 0?void 0:n.copy()})},t}();Fh.SignatureDefinitionTypeMeta=zL});var Ab=m(zi=>{"use strict";var FA=zi&&zi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},$A=zi&&zi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(zi,"__esModule",{value:!0});zi.SignatureDefinitionFunctionArg=void 0;var BA=hu(),KL=function(){function t(e){this._label=e.label,this._types=e.types.reduce(function(n,r){return n.set(r.type,r)},new Map),this._opt=e.opt,this._default=e.default}return t.parse=function(e){var n,r,i=[];if(e.type)i.push(BA.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,$A([],FA(e.types.map(BA.SignatureDefinitionTypeMeta.parse)),!1));else throw new Error("Invalid signature definition function arg payload!");return new t({label:e.label,types:i,opt:(n=e.opt)!==null&&n!==void 0?n:!1,default:(r=e.default)!==null&&r!==void 0?r:null})},t.prototype.getLabel=function(){return this._label},t.prototype.isOptional=function(){return this._opt},t.prototype.getDefault=function(){return this._default},t.prototype.getTypes=function(){return $A([],FA(this._types.values()),!1)},t.prototype.isValidType=function(e){return this._types.has(e.type)},t.prototype.isValidTypeSafe=function(e){var n;return!!(!((n=this._types.get(e.type))===null||n===void 0)&&n.isEqualSafe(e))},t.prototype.toJSON=function(){return{label:this._label,types:this.getTypes().map(function(e){return e.toJSON()}),opt:this._opt,default:this._default}},t.prototype.copy=function(){return new t({label:this._label,types:this.getTypes().map(function(e){return e.copy()}),opt:this._opt,default:this._default})},t}();zi.SignatureDefinitionFunctionArg=KL});var UA=m((k4,WA)=>{var VL="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";WA.exports={urlAlphabet:VL}});var $h=m((C4,XA)=>{var HA=require("crypto"),{urlAlphabet:GA}=UA(),XL=128,Ki,Vi,zA=t=>{!Ki||Ki.length<t?(Ki=Buffer.allocUnsafe(t*XL),HA.randomFillSync(Ki),Vi=0):Vi+t>Ki.length&&(HA.randomFillSync(Ki),Vi=0),Vi+=t},KA=t=>(zA(t|=0),Ki.subarray(Vi-t,Vi)),VA=(t,e,n)=>{let r=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*r*e/t.length);return(s=e)=>{let o="";for(;;){let a=n(i),u=i;for(;u--;)if(o+=t[a[u]&r]||"",o.length===s)return o}}},YL=(t,e=21)=>VA(t,e,KA),JL=(t=21)=>{zA(t|=0);let e="";for(let n=Vi-t;n<Vi;n++)e+=GA[Ki[n]&63];return e};XA.exports={nanoid:JL,customAlphabet:YL,customRandom:VA,urlAlphabet:GA,random:KA}});var Bh=m(Xi=>{"use strict";var As=Xi&&Xi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},ks=Xi&&Xi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.VariationRegistry=void 0;var QL=function(){function t(e){this._name=e,this._variations=new Set}return t.prototype.getName=function(){return this._name},t.prototype.push=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._variations=new Set(ks(ks([],As(e),!1),As(this._variations),!1)),this},t.prototype.getAll=function(){return ks([],As(this._variations),!1)},t}(),ZL=function(){function t(){}return t.add=function(e,n){var r=new QL(e);return r.push.apply(r,ks([],As(n),!1)),this.variationContainers.set(e,r),this},t.get=function(e){var n;return(n=this.variationContainers.get(e))!==null&&n!==void 0?n:null},t.resolve=function(e){for(var n=new Set,r=0;r<e.length;r++){var i=e[r];if(typeof i=="string"&&i.startsWith("!")){var s=i.slice(1),o=this.get(s);if(o!==null)n=new Set(ks(ks([],As(o.getAll()),!1),As(n),!1));else throw new Error("Cannot find variation container for ".concat(s));continue}n.add(i)}return ks([],As(n),!1)},t.variationContainers=new Map,t}();Xi.VariationRegistry=ZL});var Wh=m(Yi=>{"use strict";var eN=Yi&&Yi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},tN=Yi&&Yi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.SignatureDefinition=void 0;var nN=Bh(),rN=hu(),iN=function(){function t(e){this._origin=e.origin,this._type=e.type,this._isProtected=e.isProtected,this._description=e.description,this._example=e.example,this._variations=e.variations,this._tags=e.tags}return t.parse=function(e,n){var r,i,s,o;return new t({origin:e,type:rN.SignatureDefinitionTypeMeta.parse(n.type),isProtected:!!n.isProtected,description:(r=n.description)!==null&&r!==void 0?r:null,example:(i=n.example)!==null&&i!==void 0?i:null,variations:(s=n.variations)!==null&&s!==void 0?s:null,tags:(o=n.tags)!==null&&o!==void 0?o:null})},t.prototype.getOrigin=function(){return this._origin},t.prototype.getType=function(){return this._type},t.prototype.isProtected=function(){return this._isProtected},t.prototype.getDescription=function(){return this._description},t.prototype.getExample=function(){return this._example},t.prototype.getTags=function(){return this._tags},t.prototype.setDescription=function(e){var n;return this._description=e.description,this._example=(n=e.example)!==null&&n!==void 0?n:null,this},t.prototype.addVariation=function(e){return this._variations==null&&(this._variations=[]),this._variations.push(e),this},t.prototype.getVariations=function(){return nN.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?tN([],eN(this._example),!1):null}},t.prototype.withDescription=function(e){var n,r;return new t({origin:this._origin,type:this._type,isProtected:this._isProtected,description:(n=e?.description)!==null&&n!==void 0?n:this._description,example:(r=e?.example)!==null&&r!==void 0?r:this._example,variations:this._variations,tags:this._tags})},t.prototype.copy=function(){return new t({origin:this._origin,type:this._type.copy(),isProtected:this._isProtected,description:this._description,example:this._example,variations:this._variations,tags:this._tags})},t}();Yi.SignatureDefinition=iN});var Hh=m(Yn=>{"use strict";var sN=Yn&&Yn.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uh=Yn&&Yn.__assign||function(){return Uh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uh.apply(this,arguments)},oN=Yn&&Yn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},aN=Yn&&Yn.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.SignatureDefinitionFunction=void 0;var uN=$h(),cN=Gi(),lN=Bh(),hN=Wh(),dN=Ab(),YA=hu(),fN=function(t){sN(e,t);function e(n){var r=this,i;return r=t.call(this,{type:n.type,origin:n.origin,isProtected:n.isProtected,description:n.description,example:n.example,variations:n.variations,tags:n.tags})||this,r._id=(i=n.id)!==null&&i!==void 0?i:(0,uN.nanoid)(),r._argList=n.arguments.map(function(s){return s.getLabel()}),r._argRefs=n.arguments.reduce(function(s,o){return s.set(o.getLabel(),o)},new Map),r._returns=n.returns.reduce(function(s,o){return s.set(o.type,o)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n,r){var i,s,o,a,u,c,l;return new e({id:r.id,origin:n,type:new YA.SignatureDefinitionTypeMeta({type:cN.SignatureDefinitionBaseType.Function}),isProtected:(i=r.isProtected)!==null&&i!==void 0?i:!1,description:(s=r.description)!==null&&s!==void 0?s:null,example:(o=r.example)!==null&&o!==void 0?o:null,arguments:(u=(a=r.arguments)===null||a===void 0?void 0:a.map(dN.SignatureDefinitionFunctionArg.parse))!==null&&u!==void 0?u:[],returns:r.returns.map(YA.SignatureDefinitionTypeMeta.parse),variations:r.variations,returnVariations:(c=r.returnVariations)!==null&&c!==void 0?c:null,tags:(l=r.tags)!==null&&l!==void 0?l:null})},e.prototype.getId=function(){return this._id},e.prototype.getArguments=function(){var n=this;return this._argList.map(function(r){return n._argRefs.get(r)})},e.prototype.getArgument=function(n){var r;return(r=this._argRefs.get(n))!==null&&r!==void 0?r:null},e.prototype.getReturns=function(){return aN([],oN(this._returns.values()),!1)},e.prototype.addReturnVariation=function(n){return this._returnVariations==null&&(this._returnVariations=[]),this._returnVariations.push(n),this},e.prototype.getReturnVariations=function(){return this._returnVariations==null&&(this._returnVariations=[]),lN.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Uh(Uh({},t.prototype.toJSON.call(this)),{arguments:this.getArguments().map(function(n){return n.toJSON()}),returns:this.getReturns().map(function(n){return n.toJSON()})})},e.prototype.withDescription=function(n){var r,i;return new e({id:this._id,origin:this._origin,type:this._type,isProtected:this._isProtected,arguments:this.getArguments(),returns:this.getReturns(),description:(r=n?.description)!==null&&r!==void 0?r:this._description,example:(i=n?.example)!==null&&i!==void 0?i:this._example,variations:this._variations,returnVariations:this._returnVariations,tags:this._tags})},e.prototype.copy=function(){return new e({id:this._id,origin:this._origin,type:this._type.copy(),isProtected:this._isProtected,arguments:this.getArguments().map(function(n){return n.copy()}),returns:this.getReturns().map(function(n){return n.copy()}),description:this._description,example:this._example,variations:this._variations,returnVariations:this._returnVariations,tags:this._tags})},e}(hN.SignatureDefinition);Yn.SignatureDefinitionFunction=fN});var QA=m((P4,JA)=>{"use strict";JA.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var kb=m((ZA,ek)=>{"use strict";var pN=QA();ek.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:pN(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ZA.assert)}}});var Me=m((M4,tk)=>{"use strict";var gN=kb();tk.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new gN(e)}});var Cs=m((L4,rk)=>{"use strict";var Cb=Me(),nk={};rk.exports=function(t,e,n){if(e===!1||e===null||e===void 0)return t;n=n||{},typeof n=="string"&&(n={separator:n});let r=Array.isArray(e);Cb(!r||!n.separator,"Separator option is not valid for array-based chain");let i=r?e:e.split(n.separator||"."),s=t;for(let o=0;o<i.length;++o){let a=i[o],u=n.iterables&&nk.iterables(s);if(Array.isArray(s)||u==="set"){let c=Number(a);Number.isInteger(c)&&(a=c<0?s.length+c:c)}if(!s||typeof s=="function"&&n.functions===!1||!u&&s[a]===void 0){Cb(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),Cb(typeof s=="object"||n.functions===!0||typeof s!="function","Invalid segment",a,"in reach path ",e),s=n.default;break}u?u==="set"?s=[...s][a]:s=s.get(a):s=s[a]}return s};nk.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Ob=m((ln,sk)=>{"use strict";var ik={};ln=sk.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};ik.typeMap=new Map([["[object Error]",ln.error],["[object Map]",ln.map],["[object Promise]",ln.promise],["[object Set]",ln.set],["[object WeakMap]",ln.weakMap],["[object WeakSet]",ln.weakSet]]);ln.getInternalProto=function(t){if(Array.isArray(t))return ln.array;if(Buffer&&t instanceof Buffer)return ln.buffer;if(t instanceof Date)return ln.date;if(t instanceof RegExp)return ln.regex;if(t instanceof Error)return ln.error;let e=Object.prototype.toString.call(t);return ik.typeMap.get(e)||ln.generic}});var Rb=m(ok=>{"use strict";ok.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var hn=m((q4,ak)=>{"use strict";var mN=Cs(),Ln=Ob(),yN=Rb(),hi={needsProtoHack:new Set([Ln.set,Ln.map,Ln.weakSet,Ln.weakMap])};ak.exports=hi.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=hi.clone,i=n;if(e.shallow){if(e.shallow!==!0)return hi.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=Ln.getInternalProto(t);if(s===Ln.buffer)return Buffer&&Buffer.from(t);if(s===Ln.date)return new Date(t.getTime());if(s===Ln.regex)return new RegExp(t);let o=hi.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===Ln.set)for(let u of t)o.add(r(u,e,i));else if(s===Ln.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=yN.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===Ln.array&&u==="length"){o.length=t.length;continue}let c=Object.getOwnPropertyDescriptor(t,u);c?c.get||c.set?Object.defineProperty(o,u,c):c.enumerable?o[u]=r(t[u],e,i):Object.defineProperty(o,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],e,i)}):Object.defineProperty(o,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],e,i)})}return o};hi.cloneWithShallow=function(t,e){let n=e.shallow;e=Object.assign({},e),e.shallow=!1;let r=new Map;for(let i of n){let s=mN(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return hi.clone(t,e,r)};hi.base=function(t,e,n){if(n.prototype===!1)return hi.needsProtoHack.has(e)?new e.constructor:e===Ln.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===Ln.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(hi.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var uk=m((j4,bN)=>{bN.exports={name:"joi",description:"Object schema validation",version:"17.13.3",repository:"git://github.com/hapijs/joi",main:"lib/index.js",types:"lib/index.d.ts",browser:"dist/joi-browser.min.js",files:["lib/**/*","dist/*"],keywords:["schema","validation"],dependencies:{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},devDependencies:{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63",typescript:"4.3.x"},scripts:{prepublishOnly:"cd browser && npm install && npm run build",test:"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},license:"BSD-3-Clause"}});var Gh=m(du=>{"use strict";var D=zh(),pe={};pe.wrap=D.string().min(1).max(2).allow(!1);du.preferences=D.object({allowUnknown:D.boolean(),abortEarly:D.boolean(),artifacts:D.boolean(),cache:D.boolean(),context:D.object(),convert:D.boolean(),dateFormat:D.valid("date","iso","string","time","utc"),debug:D.boolean(),errors:{escapeHtml:D.boolean(),label:D.valid("path","key",!1),language:[D.string(),D.object().ref()],render:D.boolean(),stack:D.boolean(),wrap:{label:pe.wrap,array:pe.wrap,string:pe.wrap}},externals:D.boolean(),messages:D.object(),noDefaults:D.boolean(),nonEnumerables:D.boolean(),presence:D.valid("required","optional","forbidden"),skipFunctions:D.boolean(),stripUnknown:D.object({arrays:D.boolean(),objects:D.boolean()}).or("arrays","objects").allow(!0,!1),warnings:D.boolean()}).strict();pe.nameRx=/^[a-zA-Z0-9]\w*$/;pe.rule=D.object({alias:D.array().items(D.string().pattern(pe.nameRx)).single(),args:D.array().items(D.string(),D.object({name:D.string().pattern(pe.nameRx).required(),ref:D.boolean(),assert:D.alternatives([D.function(),D.object().schema()]).conditional("ref",{is:!0,then:D.required()}),normalize:D.function(),message:D.string().when("assert",{is:D.function(),then:D.required()})})),convert:D.boolean(),manifest:D.boolean(),method:D.function().allow(!1),multi:D.boolean(),validate:D.function()});du.extension=D.object({type:D.alternatives([D.string(),D.object().regex()]).required(),args:D.function(),cast:D.object().pattern(pe.nameRx,D.object({from:D.function().maxArity(1).required(),to:D.function().minArity(1).maxArity(2).required()})),base:D.object().schema().when("type",{is:D.object().regex(),then:D.forbidden()}),coerce:[D.function().maxArity(3),D.object({method:D.function().maxArity(3).required(),from:D.array().items(D.string()).single()})],flags:D.object().pattern(pe.nameRx,D.object({setter:D.string(),default:D.any()})),manifest:{build:D.function().arity(2)},messages:[D.object(),D.string()],modifiers:D.object().pattern(pe.nameRx,D.function().minArity(1).maxArity(2)),overrides:D.object().pattern(pe.nameRx,D.function()),prepare:D.function().maxArity(3),rebuild:D.function().arity(1),rules:D.object().pattern(pe.nameRx,pe.rule),terms:D.object().pattern(pe.nameRx,D.object({init:D.array().allow(null).required(),manifest:D.object().pattern(/.+/,[D.valid("schema","single"),D.object({mapped:D.object({from:D.string().required(),to:D.string().required()}).required()})])})),validate:D.function().maxArity(3)}).strict();du.extensions=D.array().items(D.object(),D.function().arity(1)).strict();pe.desc={buffer:D.object({buffer:D.string()}),func:D.object({function:D.function().required(),options:{literal:!0}}),override:D.object({override:!0}),ref:D.object({ref:D.object({type:D.valid("value","global","local"),path:D.array().required(),separator:D.string().length(1).allow(!1),ancestor:D.number().min(0).integer().allow("root"),map:D.array().items(D.array().length(2)).min(1),adjust:D.function(),iterables:D.boolean(),in:D.boolean(),render:D.boolean()}).required()}),regex:D.object({regex:D.string().min(3)}),special:D.object({special:D.valid("deep").required()}),template:D.object({template:D.string().required(),options:D.object()}),value:D.object({value:D.alternatives([D.object(),D.array()]).required()})};pe.desc.entity=D.alternatives([D.array().items(D.link("...")),D.boolean(),D.function(),D.number(),D.string(),pe.desc.buffer,pe.desc.func,pe.desc.ref,pe.desc.regex,pe.desc.special,pe.desc.template,pe.desc.value,D.link("/")]);pe.desc.values=D.array().items(null,D.boolean(),D.function(),D.number().allow(1/0,-1/0),D.string().allow(""),D.symbol(),pe.desc.buffer,pe.desc.func,pe.desc.override,pe.desc.ref,pe.desc.regex,pe.desc.template,pe.desc.value);pe.desc.messages=D.object().pattern(/.+/,[D.string(),pe.desc.template,D.object().pattern(/.+/,[D.string(),pe.desc.template])]);du.description=D.object({type:D.string().required(),flags:D.object({cast:D.string(),default:D.any(),description:D.string(),empty:D.link("/"),failover:pe.desc.entity,id:D.string(),label:D.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:D.boolean(),unit:D.string()}).unknown(),preferences:{allowUnknown:D.boolean(),abortEarly:D.boolean(),artifacts:D.boolean(),cache:D.boolean(),convert:D.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:D.boolean(),label:["path","key"],language:[D.string(),pe.desc.ref],wrap:{label:pe.wrap,array:pe.wrap}},externals:D.boolean(),messages:pe.desc.messages,noDefaults:D.boolean(),nonEnumerables:D.boolean(),presence:["required","optional","forbidden"],skipFunctions:D.boolean(),stripUnknown:D.object({arrays:D.boolean(),objects:D.boolean()}).or("arrays","objects").allow(!0,!1),warnings:D.boolean()},allow:pe.desc.values,invalid:pe.desc.values,rules:D.array().min(1).items({name:D.string().required(),args:D.object().min(1),keep:D.boolean(),message:[D.string(),pe.desc.messages],warn:D.boolean()}),keys:D.object().pattern(/.*/,D.link("/")),link:pe.desc.ref}).pattern(/^[a-z]\w*$/,D.any())});var lk=m(($4,ck)=>{"use strict";var Ji={};ck.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);Ji.isSafe(r)?e+=t[n]:e+=Ji.escapeHtmlChar(r)}return e};Ji.escapeHtmlChar=function(t){let e=Ji.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};Ji.isSafe=function(t){return Ji.safeCharCodes.has(t)};Ji.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);Ji.safeCharCodes=function(){let t=new Set;for(let e=32;e<123;++e)(e>=97||e>=65&&e<=90||e>=48&&e<=57||e===32||e===46||e===44||e===45||e===58||e===95)&&t.add(e);return t}()});var hk=m(fu=>{"use strict";var Re={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};fu.Parser=class{constructor(t,e={}){if(!e[Re.settings]&&e.constants)for(let n in e.constants){let r=e.constants[n];if(r!==null&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${n} contains invalid ${typeof r} value type`)}this.settings=e[Re.settings]?e:Object.assign({[Re.settings]:!0,constants:{},functions:{}},e),this.single=null,this._parts=null,this._parse(t)}_parse(t){let e=[],n="",r=0,i=!1,s=a=>{if(r)throw new Error("Formula missing closing parenthesis");let u=e.length?e[e.length-1]:null;if(!(!i&&!n&&!a)){if(u&&u.type==="reference"&&a===")"){u.type="function",u.value=this._subFormula(n,u.value),n="";return}if(a===")"){let c=new fu.Parser(n,this.settings);e.push({type:"segment",value:c})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(Re.operatorCharacters.includes(n))u&&u.type==="operator"&&Re.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Re.numberRx))e.push({type:"constant",value:parseFloat(n)});else if(this.settings.constants[n]!==void 0)e.push({type:"constant",value:this.settings.constants[n]});else{if(!n.match(Re.tokenRx))throw new Error(`Formula contains invalid token: ${n}`);e.push({type:"reference",value:n})}n=""}};for(let a of t)i?a===i?(s(),i=!1):n+=a:r?a==="("?(n+=a,++r):a===")"?(--r,r?n+=a:s(a)):n+=a:a in Re.literals?i=Re.literals[a]:a==="("?(s(),++r):Re.operatorCharacters.includes(a)?(s(),n=a,s()):a!==" "?n+=a:s();s(),e=e.map((a,u)=>a.type!=="operator"||a.value!=="-"||u&&e[u-1].type!=="operator"?a:{type:"operator",value:"n"});let o=!1;for(let a of e){if(a.type==="operator"){if(Re.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Re.operators.includes(a.value))throw new Error(`Formula contains an unknown operator ${a.value}`)}else if(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");e.length===1&&["reference","literal","constant"].includes(e[0].type)&&(this.single={type:e[0].type==="reference"?"reference":"value",value:e[0].value}),this._parts=e.map(a=>{if(a.type==="operator")return Re.operatorsPrefix.includes(a.value)?a:a.value;if(a.type!=="reference")return a.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(a.value))throw new Error(`Formula contains invalid reference ${a.value}`);return this.settings.reference?this.settings.reference(a.value):Re.reference(a.value)})}_subFormula(t,e){let n=this.settings.functions[e];if(typeof n!="function")throw new Error(`Formula contains unknown function ${e}`);let r=[];if(t){let i="",s=0,o=!1,a=()=>{if(!i)throw new Error(`Formula contains function ${e} with invalid arguments ${t}`);r.push(i),i=""};for(let u=0;u<t.length;++u){let c=t[u];o?(i+=c,c===o&&(o=!1)):c in Re.literals&&!s?(i+=c,o=Re.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new fu.Parser(i,this.settings)),function(i){let s=[];for(let o of r)s.push(o.evaluate(i));return n.call(i,...s)}}evaluate(t){let e=this._parts.slice();for(let n=e.length-2;n>=0;--n){let r=e[n];if(r&&r.type==="operator"){let i=e[n+1];e.splice(n+1,1);let s=Re.evaluate(i,t);e[n]=Re.single(r.value,s)}}return Re.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Re.evaluate(e[r-1],t),o=Re.evaluate(e[r+1],t);e.splice(r,2);let a=Re.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Re.evaluate(e[0],t)}};fu.Parser.prototype[Re.symbol]=!0;Re.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Re.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Re.symbol]?t.evaluate(e):t};Re.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Re.calculate=function(t,e,n){if(t==="??")return Re.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Re.exists(e)?e:"",n=Re.exists(n)?n:"",e+n}else switch(t){case"^":return Math.pow(e,n);case"*":return e*n;case"/":return e/n;case"%":return e%n;case"+":return e+n;case"-":return e-n}switch(t){case"<":return e<n;case"<=":return e<=n;case">":return e>n;case">=":return e>=n;case"==":return e===n;case"!=":return e!==n;case"&&":return e&&n;case"||":return e||n}return null};Re.exists=function(t){return t!=null}});var fk=m(dk=>{"use strict";var _N=hn(),vN=Je(),Os={annotations:Symbol("annotations")};dk.error=function(t){if(!this._original||typeof this._original!="object")return this.details[0].message;let e=t?"":"\x1B[31m",n=t?"":"\x1B[41m",r=t?"":"\x1B[0m",i=_N(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,h=i;for(let d=0;;++d){let g=l[d];if(vN.isSchema(h)&&(h=h.clone()),d+1<l.length&&typeof h[g]!="string")h=h[g];else{let _=h[Os.annotations]||{errors:{},missing:{}};h[Os.annotations]=_;let b=g||c.context.key;h[g]!==void 0?(_.errors[b]=_.errors[b]||[],_.errors[b].push(u)):_.missing[b]=u;break}}}let s={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g},o=Os.safeStringify(i,2).replace(s.key,(a,u)=>`" ${e}[${u}]${r}`).replace(s.missing,(a,u,c)=>`${n}"${u}"${r}${e} [${c}]: -- missing --${r}`).replace(s.arrayIndex,(a,u,c)=>`
|
101
97
|
${c} ${e}[${u}]${r}`).replace(s.specials,(a,u)=>u);o=`${o}
|
102
98
|
${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
103
|
-
[${u}] ${this.details[a].message}`}return o=o+r,o};Cs.safeStringify=function(t,e){return JSON.stringify(t,Cs.serializer(),e)};Cs.serializer=function(){let t=[],e=[],n=(r,i)=>e[0]===i?"[Circular ~]":"[Circular ~."+t.slice(0,e.indexOf(i)).join(".")+"]";return function(r,i){if(e.length>0){let s=e.indexOf(this);~s?(e.length=s+1,t.length=s+1,t[s]=r):(e.push(this),t.push(r)),~e.indexOf(i)&&(i=n.call(this,r,i))}else e.push(i);if(i){let s=i[Cs.annotations];if(s){if(Array.isArray(i)){let o=[];for(let a=0;a<i.length;++a)s.errors[a]&&o.push(`_$idx$_${s.errors[a].sort().join(", ")}_$end$_`),o.push(i[a]);i=o}else{for(let o in s.errors)i[`${o}_$key$_${s.errors[o].sort().join(", ")}_$end$_`]=i[o],i[o]=void 0;for(let o in s.missing)i[`_$miss$_${o}|${s.missing[o]}_$end$_`]="__missing__"}return i}}return i===1/0||i===-1/0||Number.isNaN(i)||typeof i=="function"||typeof i=="symbol"?"["+i.toString()+"]":i}}});var li=m(Ot=>{"use strict";var Cq=mk(),Oq=Qe(),Rq=Ki();Ot.Report=class{constructor(t,e,n,r,i,s,o){if(this.code=t,this.flags=r,this.messages=i,this.path=s.path,this.prefs=o,this.state=s,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=Ot.label(this.flags,this.state,this.prefs,this.messages),this.value!==void 0&&!this.local.hasOwnProperty("value")&&(this.local.value=this.value),this.path.length){let a=this.path[this.path.length-1];typeof a!="object"&&(this.local.key=a)}}_setTemplate(t){if(this.template=t,!this.flags.label&&this.path.length===0){let e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;let t=this.code;if(!this.prefs.errors.render)return this.code;let e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${t}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(t,e){return Ot.template(this.value,t,e||this.code,this.state,this.prefs)}};Ot.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};Ot.template=function(t,e,n,r,i){if(!e)return;if(Rq.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(Oq.isResolvable(s)&&(s=s.resolve(t,r,i)),s&&e[s]){if(e[s][n]!==void 0)return e[s][n];if(e[s]["*"]!==void 0)return e[s]["*"]}return e[n]?e[n]:e["*"]};Ot.label=function(t,e,n,r){if(!n.errors.label)return"";if(t.label)return t.label;let i=e.path;n.errors.label==="key"&&e.path.length>1&&(i=e.path.slice(-1));let s=Ot.path(i);return s||Ot.template(null,n.messages,"root",e,n)||r&&Ot.template(null,r,"root",e,n)||"value"};Ot.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=Ot.details(t);if(r)return r;if(n.errors.stack)return new Ot.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new Ot.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};Ot.details=function(t,e={}){let n=[],r=[];for(let i of t){if(i instanceof Error){if(e.override!==!1)return{override:i};let o=i.toString();n.push(o),r.push({message:o,type:"override",context:{error:i}});continue}let s=i.toString();n.push(s),r.push({message:s,path:i.path.filter(o=>typeof o!="object"),type:i.code,context:i.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}};Ot.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof Ot.ValidationError}};Ot.ValidationError.prototype.isJoi=!0;Ot.ValidationError.prototype.name="ValidationError";Ot.ValidationError.prototype.annotate=Cq.error});var hi=m(Zn=>{"use strict";var Jn=Me(),Pq=hn(),Dq=ks(),bu=Qe(),Gb,Qn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};Zn.create=function(t,e={}){Jn(typeof t=="string","Invalid reference key:",t),bu.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Jn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Qn.defaults,e);delete n.prefix;let r=n.separator,i=Qn.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(Jn(!r||t[0]!==r,"Cannot specify relative path with root prefix"),n.ancestor="root",t||(t=null)),r&&r===t)t=null,n.ancestor=0;else if(n.ancestor!==void 0)Jn(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=Qn.ancestor(t,r);o&&(t=t.slice(o),t===""&&(t=null)),n.ancestor=s}return n.path=r?t===null?[]:t.split(r):[t],new Qn.Ref(n)};Zn.in=function(t,e={}){return Zn.create(t,{...e,in:!0})};Zn.isRef=function(t){return t?!!t[bu.symbols.ref]:!1};Qn.Ref=class{constructor(t){Jn(typeof t=="object","Invalid reference construction"),bu.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Jn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Jn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Jn(!t.map||Array.isArray(t.map),"options.map must be an array"),Jn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Qn.defaults,t),Jn(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(t,e,n,r,i={}){return Jn(!this.in||i.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(n.context,e,i):this.type==="local"?this._resolve(r,e,i):this.ancestor?this.ancestor==="root"?this._resolve(e.ancestors[e.ancestors.length-1],e,i):(Jn(this.ancestor<=e.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(e.ancestors[this.ancestor-1],e,i)):this._resolve(t,e,i)}_resolve(t,e,n){let r;if(this.type==="value"&&e.mainstay.shadow&&n.shadow!==!1&&(r=e.mainstay.shadow.get(this.absolute(e))),r===void 0&&(r=Dq(t,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){let i=this.map.get(r);i!==void 0&&(r=i)}return e.mainstay&&e.mainstay.tracer.resolve(e,this,r),r}toString(){return this.display}absolute(t){return[...t.path.slice(0,-this.ancestor),...this.path]}clone(){return new Qn.Ref(this)}describe(){let t={path:this.path};this.type!=="value"&&(t.type=this.type),this.separator!=="."&&(t.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(t.ancestor=this.ancestor),this.map&&(t.map=[...this.map]);for(let e of["adjust","iterables","render"])this[e]!==null&&this[e]!==void 0&&(t[e]=this[e]);return this.in!==!1&&(t.in=!0),{ref:t}}updateDisplay(){let t=this.key!==null?this.key:"";if(this.type!=="value"){this.display=`ref:${this.type}:${t}`;return}if(!this.separator){this.display=`ref:${t}`;return}if(!this.ancestor){this.display=`ref:${this.separator}${t}`;return}if(this.ancestor==="root"){this.display=`ref:root:${t}`;return}if(this.ancestor===1){this.display=`ref:${t||".."}`;return}let e=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${e}${t||""}`}};Qn.Ref.prototype[bu.symbols.ref]=!0;Zn.build=function(t){return t=Object.assign({},Qn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Qn.Ref(t)};Qn.context=function(t,e,n={}){if(t=t.trim(),n){let r=n.global===void 0?"$":n.global;if(r!==e&&t.startsWith(r))return{key:t.slice(r.length),type:"global"};let i=n.local===void 0?"#":n.local;if(i!==e&&t.startsWith(i))return{key:t.slice(i.length),type:"local"};let s=n.root===void 0?"/":n.root;if(s!==e&&t.startsWith(s))return{key:t.slice(s.length),type:"value",root:!0}}return{key:t,type:"value"}};Qn.ancestor=function(t,e){if(!e)return[1,0];if(t[0]!==e)return[1,0];if(t[1]!==e)return[0,1];let n=2;for(;t[n]===e;)++n;return[n-1,n]};Zn.toSibling=0;Zn.toParent=1;Zn.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?Zn.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(bu.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}Zn.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),Gb=Gb||Ki(),Gb.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new Zn.Manager;return t.refs=Pq(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Ki=m((vk,Sk)=>{"use strict";var Xh=Me(),Iq=hn(),Mq=fk(),Lq=pk(),bk=Qe(),yk=li(),_k=hi(),$e={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};Sk.exports=vk=$e.Template=class{constructor(t,e){if(Xh(typeof t=="string","Template source must be a string"),Xh(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,e){let{functions:n,...r}=e;this._settings=Object.keys(r).length?Iq(r):void 0,this._functions=n,this._functions&&(Xh(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),Xh(Object.values(this._functions).every(i=>typeof i=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;let t=$e.encode(this.source),e=$e.split(t),n=!1,r=[],i=e.shift();i&&r.push(i);for(let s of e){let o=s[0]!=="{",a=o?"}":"}}",u=s.indexOf(a);if(u===-1||s[1]==="{"){r.push(`{${$e.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let h=this._ref($e.decode(c),{raw:o,wrapped:l});r.push(h),typeof h!="string"&&(n=!0);let d=s.slice(u+a.length);d&&r.push($e.decode(d))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return $e.dateFormat[e.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;let e={template:this.source};return this._settings&&(e.options=this._settings),this._functions&&(e.functions=this._functions),e}static build(t){return new $e.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[bk.symbols.template]:!1}refs(){if(!this._template)return;let t=[];for(let e of this._template)typeof e!="string"&&t.push(...e.refs);return t}resolve(t,e,n,r){return this._template&&this._template.length===1?this._part(this._template[0],t,e,n,r,{}):this.render(t,e,n,r)}_part(t,...e){return t.ref?t.ref.resolve(...e):t.formula.evaluate(e)}render(t,e,n,r,i={}){if(!this.isDynamic())return this.rendered;let s=[];for(let o of this._template)if(typeof o=="string")s.push(o);else{let a=this._part(o,t,e,n,r,i),u=$e.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:Mq(u);s.push($e.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=_k.create(o,this._settings);return r.push(a),u=>{let c=a.resolve(...u);return c!==void 0?c:null}};try{let o=this._functions?{...$e.functions,...this._functions}:$e.functions;var s=new Lq.Parser(t,{reference:i,functions:o,constants:$e.constants})}catch(o){throw o.message=`Invalid template variable "${t}" fails due to: ${o.message}`,o}if(s.single){if(s.single.type==="reference"){let o=r[0];return{ref:o,raw:e,refs:r,wrapped:n||o.type==="local"&&o.key==="label"}}return $e.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};$e.Template.prototype[bk.symbols.template]=!0;$e.Template.prototype.isImmutable=!0;$e.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>$e.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>$e.closes.slice(0,n.length))};$e.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};$e.split=function(t){let e=[],n="";for(let r=0;r<t.length;++r){let i=t[r];if(i==="{"){let s="";for(;r+1<t.length&&t[r+1]==="{";)s+="{",++r;e.push(n),n=s}else n+=i}return e.push(n),e};$e.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};$e.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(_k.isRef(t)&&t.render&&(u=t.in,t=t.resolve(e,n,r,i,{in:t.in,...s})),t===null)return"null";if(o==="string")return $e.wrap(t,s.arrayItems&&a.string);if(o==="number"||o==="function"||o==="symbol")return t.toString();if(o!=="object")return JSON.stringify(t);if(t instanceof Date)return $e.Template.date(t,r);if(t instanceof Map){let l=[];for(let[h,d]of t.entries())l.push(`${h.toString()} -> ${d.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push($e.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return $e.wrap(c.join(", "),!u&&a.array)};$e.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};$e.functions={if(t,e,n){return t?e:n},length(t){return typeof t=="string"?t.length:!t||typeof t!="object"?null:Array.isArray(t)?t.length:Object.keys(t).length},msg(t){let[e,n,r,i,s]=this,o=s.messages;if(!o)return"";let a=yk.template(e,o[0],t,n,r)||yk.template(e,o[1],t,n,r);return a?a.render(e,n,r,i,s):""},number(t){return typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}}});var Bo=m(_u=>{"use strict";var Os=Me(),Tk=hn(),Nn=Ki();_u.compile=function(t,e){if(typeof t=="string")return Os(!e,"Cannot set single message string"),new Nn(t);if(Nn.isTemplate(t))return Os(!e,"Cannot set single message template"),t;Os(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?Tk(e):{};for(let n in t){let r=t[n];if(n==="root"||Nn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new Nn(r);continue}Os(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);let i=n;e[i]=e[i]||{};for(n in r){let s=r[n];if(n==="root"||Nn.isTemplate(s)){e[i][n]=s;continue}Os(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new Nn(s)}}return e};_u.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(Nn.isTemplate(r)){e[n]=r.describe({compact:!0});continue}let i=n;e[i]={};for(n in r){let s=r[n];if(n==="root"){e[i].root=s;continue}e[i][n]=s.describe({compact:!0})}}return e};_u.merge=function(t,e){if(!t)return _u.compile(e);if(!e)return t;if(typeof e=="string")return new Nn(e);if(Nn.isTemplate(e))return e;let n=Tk(t);for(let r in e){let i=e[r];if(r==="root"||Nn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new Nn(i);continue}Os(typeof i=="object"&&!Array.isArray(i),"Invalid message for",r);let s=r;n[s]=n[s]||{};for(r in i){let o=i[r];if(r==="root"||Nn.isTemplate(o)){n[s][r]=o;continue}Os(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new Nn(o)}}return n}});var Qe=m(Ze=>{"use strict";var Yh=Me(),Nq=Bb(),qq=hk(),zb,Vb,jq={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};Ze.version=qq.version;Ze.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1};Ze.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")};Ze.assertOptions=function(t,e,n="Options"){Yh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));Yh(r.length===0,`${n} contain unknown keys: ${r}`)};Ze.checkPreferences=function(t){Vb=Vb||Vh();let e=Vb.preferences.validate(t);if(e.error)throw new Nq([e.error.details[0].message])};Ze.compare=function(t,e,n){switch(n){case"=":return t===e;case">":return t>e;case"<":return t<e;case">=":return t>=e;case"<=":return t<=e}};Ze.default=function(t,e){return t===void 0?e:t};Ze.isIsoDate=function(t){return jq.isoDate.test(t)};Ze.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};Ze.isResolvable=function(t){return t?t[Ze.symbols.ref]||t[Ze.symbols.template]:!1};Ze.isSchema=function(t,e={}){let n=t&&t[Ze.symbols.any];return n?(Yh(e.legacy||n.version===Ze.version,"Cannot mix different versions of joi schemas"),!0):!1};Ze.isValues=function(t){return t[Ze.symbols.values]};Ze.limit=function(t){return Number.isSafeInteger(t)&&t>=0};Ze.preferences=function(t,e){zb=zb||Bo(),t=t||{},e=e||{};let n=Object.assign({},t,e);return e.errors&&t.errors&&(n.errors=Object.assign({},t.errors,e.errors),n.errors.wrap=Object.assign({},t.errors.wrap,e.errors.wrap)),e.messages&&(n.messages=zb.compile(e.messages,t.messages)),delete n[Ze.symbols.prefs],n};Ze.tryWithPath=function(t,e,n={}){try{return t()}catch(r){throw r.path!==void 0?r.path=e+"."+r.path:r.path=e,n.append&&(r.message=`${r.message} (${r.path})`),r}};Ze.validateArg=function(t,e,{assert:n,message:r}){if(Ze.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};Ze.verifyFlat=function(t,e){for(let n of t)Yh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Kb=m(wk=>{"use strict";var Fq=Me(),$q=hn(),Bq=Qe(),Wo={max:1e3,supported:new Set(["undefined","boolean","number","string"])};wk.provider={provision(t){return new Wo.Cache(t)}};Wo.Cache=class{constructor(t={}){Bq.assertOptions(t,["max"]),Fq(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||Wo.max,this._map=new Map,this._list=new Wo.List}get length(){return this._map.size}set(t,e){if(t!==null&&!Wo.supported.has(typeof t))return;let n=this._map.get(t);if(n){n.value=e,this._list.first(n);return}n=this._list.unshift({key:t,value:e}),this._map.set(t,n),this._compact()}get(t){let e=this._map.get(t);if(e)return this._list.first(e),$q(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};Wo.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){let{next:e,prev:n}=t;return e.prev=n,n&&(n.next=e),t===this.tail&&(this.tail=e),t.prev=null,t.next=null,t}}});var Rs=m(di=>{"use strict";var mt=Me(),qn=Qe(),Uo=hi(),er={};di.schema=function(t,e,n={}){qn.assertOptions(n,["appendPath","override"]);try{return er.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};er.schema=function(t,e,n){mt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(mt(e.length,"Invalid empty array schema"),e.length===1&&(e=e[0]));let r=(i,...s)=>n.override!==!1?i.valid(t.override,...s):i.valid(...s);if(er.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(mt(typeof e=="object","Invalid schema content:",typeof e),qn.isResolvable(e))return r(t,e);if(qn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!er.simple(i))return t.alternatives().try(...e);return r(t,...e)}return e instanceof RegExp?t.string().regex(e):e instanceof Date?r(t.date(),e):(mt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};di.ref=function(t,e){return Uo.isRef(t)?t:Uo.create(t,e)};di.compile=function(t,e,n={}){qn.assertOptions(n,["legacy"]);let r=e&&e[qn.symbols.any];if(r)return mt(n.legacy||r.version===qn.version,"Cannot mix different versions of joi schemas:",r.version,qn.version),e;if(typeof e!="object"||!n.legacy)return di.schema(t,e,{appendPath:!0});let i=er.walk(e);return i?i.compile(i.root,e):di.schema(t,e,{appendPath:!0})};er.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=er.walk(n);if(r)return r}return null}let e=t[qn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};mt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=er.walk(t[n]);if(r)return r}return null};er.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};di.when=function(t,e,n){if(n===void 0&&(mt(e&&typeof e=="object","Missing options"),n=e,e=Uo.create(".")),Array.isArray(n)&&(n={switch:n}),qn.assertOptions(n,["is","not","then","otherwise","switch","break"]),qn.isSchema(e))return mt(n.is===void 0,'"is" can not be used with a schema condition'),mt(n.not===void 0,'"not" can not be used with a schema condition'),mt(n.switch===void 0,'"switch" can not be used with a schema condition'),er.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(mt(Uo.isRef(e)||typeof e=="string","Invalid condition:",e),mt(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let i=n;n.not!==void 0&&(i={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let s=i.is!==void 0?t.$_compile(i.is):t.$_root.invalid(null,!1,0,"").required();return mt(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),mt(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!Uo.isRef(n.is)&&!qn.isSchema(n.is)&&(s=s.required()),er.condition(t,{ref:di.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}mt(Array.isArray(n.switch),'"switch" must be an array'),mt(n.is===void 0,'Cannot combine "switch" with "is"'),mt(n.not===void 0,'Cannot combine "switch" with "not"'),mt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:di.ref(e),switch:[],break:n.break};for(let i=0;i<n.switch.length;++i){let s=n.switch[i],o=i===n.switch.length-1;qn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),mt(s.is!==void 0,'Switch statement missing "is"'),mt(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!Uo.isRef(s.is)&&!qn.isSchema(s.is)&&(a.is=a.is.required()),o){mt(n.otherwise===void 0||s.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');let u=n.otherwise!==void 0?n.otherwise:s.otherwise;u!==void 0&&(mt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};er.condition=function(t,e){for(let n of["then","otherwise"])e[n]===void 0?delete e[n]:e[n]=t.$_compile(e[n]);return e}});var Xb=m(xk=>{"use strict";var Xi=Me(),Wq=hn(),Ek=Qe(),Uq=Bo(),Br={};xk.type=function(t,e){let n=Object.getPrototypeOf(t),r=Wq(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=Uq.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),i.type=s.type,s.flags=Object.assign({},o.flags,s.flags);let a=Object.assign({},o.terms);if(s.terms)for(let h in s.terms){let d=s.terms[h];Xi(i.$_terms[h]===void 0,"Invalid term override for",s.type,h),i.$_terms[h]=d.init,a[h]=d}s.terms=a,s.args||(s.args=o.args),s.prepare=Br.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=Br.coerce(s.coerce,o.coerce),s.validate=Br.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let h in s.rules){let d=s.rules[h];Xi(typeof d=="object","Invalid rule definition for",s.type,h);let g=d.method;if(g===void 0&&(g=function(){return this.$_addRule(h)}),g&&(Xi(!r[h],"Rule conflict in",s.type,h),r[h]=g),Xi(!u[h],"Rule conflict in",s.type,h),u[h]=d,d.alias){let y=[].concat(d.alias);for(let b of y)r[b]=d.method}d.args&&(d.argsByName=new Map,d.args=d.args.map(y=>(typeof y=="string"&&(y={name:y}),Xi(!d.argsByName.has(y.name),"Duplicated argument name",y.name),Ek.isSchema(y.assert)&&(y.assert=y.assert.strict().label(y.name)),d.argsByName.set(y.name,y),y)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let h in s.modifiers){Xi(!r[h],"Rule conflict in",s.type,h);let d=s.modifiers[h];Xi(typeof d=="function","Invalid modifier definition for",s.type,h);let g=function(y){return this.rule({[h]:y})};r[h]=g,c[h]=d}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let h in s.overrides)Xi(n[h],"Cannot override missing",h),s.overrides[h][Ek.symbols.parent]=n[h],i.$_super[h]=n[h].bind(i);Object.assign(r,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);let l=Object.assign({},o.manifest,s.manifest);return l.build=Br.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=Br.rebuild(s.rebuild,o.rebuild),i};Br.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};Br.coerce=function(t,e){return!t||!e?t||e:{from:t.from&&e.from?[...new Set([...t.from,...e.from])]:null,method(n,r){let i;if((!e.from||e.from.includes(typeof n))&&(i=e.method(n,r),i)){if(i.errors||i.value===void 0)return i;n=i.value}if(!t.from||t.from.includes(typeof n)){let s=t.method(n,r);if(s)return s}return i}}};Br.prepare=function(t,e){return!t||!e?t||e:function(n,r){let i=t(n,r);if(i){if(i.errors||i.value===void 0)return i;n=i.value}return e(n,r)||i}};Br.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};Br.validate=function(t,e){return!t||!e?t||e:function(n,r){let i=e(n,r);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;n=i.value}return t(n,r)||i}}});var Qb=m(Jb=>{"use strict";var Wr=Me(),Jh=hn(),Ps=Qe(),Hq=Bo(),Ak=hi(),Gq=Ki(),Yb,dn={};Jb.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=dn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=Jh(t._preferences,{shallow:["messages"]}),delete n.preferences[Ps.symbols.prefs],n.preferences.messages&&(n.preferences.messages=Hq.decompile(n.preferences.messages))),t._valids&&(n.allow=t._valids.describe()),t._invalids&&(n.invalid=t._invalids.describe());for(let r of t._rules){if(e.rules[r.name].manifest===!1)continue;let s={name:r.name};for(let o in e.modifiers)r[o]!==void 0&&(s[o]=dn.describe(r[o]));if(r.args){s.args={};for(let o in r.args){let a=r.args[o];o==="options"&&!Object.keys(a).length||(s.args[o]=dn.describe(a,{assign:o}))}Object.keys(s.args).length||delete s.args}n.rules.push(s)}n.rules.length||delete n.rules;for(let r in t.$_terms){if(r[0]==="_")continue;Wr(!n[r],"Cannot describe schema due to internal name conflict with",r);let i=t.$_terms[r];if(!i)continue;if(i instanceof Map){i.size&&(n[r]=[...i.entries()]);continue}if(Ps.isValues(i)){n[r]=i.describe();continue}Wr(e.terms[r],"Term",r,"missing configuration");let s=e.terms[r].manifest,o=typeof s=="object";if(!i.length&&!o)continue;let a=[];for(let u of i)a.push(dn.describe(u));if(o){let{from:u,to:c}=s.mapped;n[r]={};for(let l of a)n[r][l[c]]=l[u];continue}if(s==="single"){Wr(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return dn.validate(t.$_root,n),n};dn.describe=function(t,e={}){if(Array.isArray(t))return t.map(dn.describe);if(t===Ps.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return Jh(t);if(Buffer&&Buffer.isBuffer(t))return{buffer:t.toString("binary")};if(t instanceof Date)return t.toISOString();if(t instanceof Error)return t;if(t instanceof RegExp)return e.assign==="regex"?t.toString():{regex:t.toString()};if(t[Ps.symbols.literal])return{function:t.literal};if(typeof t.describe=="function")return e.assign==="ref"?t.describe().ref:t.describe();let n={};for(let r in t){let i=t[r];i!==void 0&&(n[r]=dn.describe(i,{assign:r}))}return n};Jb.build=function(t,e){return new dn.Builder(t).parse(e)};dn.Builder=class{constructor(t){this.joi=t}parse(t){dn.validate(this.joi,t);let e=this.joi[t.type]()._bare(),n=e._definition;if(t.flags)for(let i in t.flags){let s=n.flags[i]&&n.flags[i].setter||i;Wr(typeof e[s]=="function","Invalid flag",i,"for type",t.type),e=e[s](this.build(t.flags[i]))}if(t.preferences&&(e=e.preferences(this.build(t.preferences))),t.allow&&(e=e.allow(...this.build(t.allow))),t.invalid&&(e=e.invalid(...this.build(t.invalid))),t.rules)for(let i of t.rules){Wr(typeof e[i.name]=="function","Invalid rule",i.name,"for type",t.type);let s=[];if(i.args){let a={};for(let l in i.args)a[l]=this.build(i.args[l],{assign:l});let u=Object.keys(a),c=n.rules[i.name].args;if(c){Wr(u.length<=c.length,"Invalid number of arguments for",t.type,i.name,"(expected up to",c.length,", found",u.length,")");for(let{name:l}of c)s.push(a[l])}else Wr(u.length===1,"Invalid number of arguments for",t.type,i.name,"(expected up to 1, found",u.length,")"),s.push(a[u[0]])}e=e[i.name](...s);let o={};for(let a in n.modifiers)i[a]!==void 0&&(o[a]=this.build(i[a]));Object.keys(o).length&&(e=e.rule(o))}let r={};for(let i in t){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(i))continue;Wr(n.terms[i],"Term",i,"missing configuration");let s=n.terms[i].manifest;if(s==="schema"){r[i]=t[i].map(o=>this.parse(o));continue}if(s==="values"){r[i]=t[i].map(o=>this.build(o));continue}if(s==="single"){r[i]=this.build(t[i]);continue}if(typeof s=="object"){r[i]={};for(let o in t[i]){let a=t[i][o];r[i][o]=this.parse(a)}continue}r[i]=this.build(t[i])}return t.whens&&(r.whens=t.whens.map(i=>this.build(i))),e=n.manifest.build(e,r),e.$_temp.ruleset=!1,e}build(t,e={}){if(t===null)return null;if(Array.isArray(t))return t.map(r=>this.build(r));if(t instanceof Error)return t;if(e.assign==="options")return Jh(t);if(e.assign==="regex")return dn.regex(t);if(e.assign==="ref")return Ak.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return Wr(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[Ps.symbols.literal]:!0,literal:t.function};if(t.override)return Ps.symbols.override;if(t.ref)return Ak.build(t.ref);if(t.regex)return dn.regex(t.regex);if(t.special)return Wr(["deep"].includes(t.special),"Unknown special value",t.special),Ps.symbols.deepDefault;if(t.value)return Jh(t.value)}if(t.type)return this.parse(t);if(t.template)return Gq.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};dn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};dn.validate=function(t,e){Yb=Yb||Vh(),t.assert(e,Yb.description)}});var vu=m((X4,kk)=>{"use strict";var Ur=Ub(),rn={mismatched:null};kk.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!rn.isDeepEqual(t,e,n,[])};rn.isDeepEqual=function(t,e,n,r){if(t===e)return t!==0||1/t===1/e;let i=typeof t;if(i!==typeof e||t===null||e===null)return!1;if(i==="function"){if(!n.deepFunction||t.toString()!==e.toString())return!1}else if(i!=="object")return t!==t&&e!==e;let s=rn.getSharedType(t,e,!!n.prototype);switch(s){case Ur.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Ur.promise:return t===e;case Ur.regex:return t.toString()===e.toString();case rn.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new rn.SeenEntry(t,e));try{return!!rn.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};rn.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?rn.mismatched:Ur.getInternalProto(t);let r=Ur.getInternalProto(t);return r!==Ur.getInternalProto(e)?rn.mismatched:r};rn.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};rn.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};rn.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};rn.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=rn,{keys:u,getOwnPropertySymbols:c}=Object;if(t===Ur.array)if(r.part){for(let y of e)for(let b of n)if(s(y,b,r,i))return!0}else{if(e.length!==n.length)return!1;for(let y=0;y<e.length;++y)if(!s(e[y],n[y],r,i))return!1;return!0}else if(t===Ur.set){if(e.size!==n.size)return!1;if(!rn.isSetSimpleEqual(e,n)){let y=new Set(Set.prototype.values.call(n));for(let b of Set.prototype.values.call(e)){if(y.delete(b))continue;let C=!1;for(let A of y)if(s(b,A,r,i)){y.delete(A),C=!0;break}if(!C)return!1}}}else if(t===Ur.map){if(e.size!==n.size)return!1;for(let[y,b]of Map.prototype.entries.call(e))if(b===void 0&&!Map.prototype.has.call(n,y)||!s(b,Map.prototype.get.call(n,y),r,i))return!1}else if(t===Ur.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),h=o(n);if((e!==l||n!==h)&&!s(l,h,r,i))return!1;let d=u(e);if(!r.part&&d.length!==u(n).length&&!r.skip)return!1;let g=0;for(let y of d){if(r.skip&&r.skip.includes(y)){n[y]===void 0&&++g;continue}if(!a(n,y)||!s(e[y],n[y],r,i))return!1}if(!r.part&&d.length-g!==u(n).length)return!1;if(r.symbols!==!1){let y=c(e),b=new Set(c(n));for(let C of y){if(!r.skip||!r.skip.includes(C)){if(a(e,C)){if(!a(n,C)||!s(e[C],n[C],r,i))return!1}else if(a(n,C))return!1}b.delete(C)}for(let C of b)if(a(n,C))return!1}return!0};rn.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var Ok=m(Ck=>{"use strict";Ck.location=function(t=0){let e=Error.prepareStackTrace;Error.prepareStackTrace=(i,s)=>s;let n={};Error.captureStackTrace(n,this);let r=n.stack[t+1];return Error.prepareStackTrace=e,{filename:r.getFileName(),line:r.getLineNumber()}}});var e_=m(Zb=>{"use strict";var Rk=vu(),Pk=Ok(),zq=li(),sn={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Zb.setup=function(t){let e=function(){return t._tracer=t._tracer||new sn.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Zb.location=function(t){return t.$_setFlag("_tracerLocation",Pk.location(2))};sn.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(t){let e=this._schemas.get(t);if(e)return e.store;let n=new sn.Store(t),{filename:r,line:i}=t._flags._tracerLocation||Pk.location(5);return this._schemas.set(t,{filename:r,line:i,store:n}),n}_combine(t,e){for(let{store:n}of this._schemas.values())n._combine(t,e)}report(t){let e=[];for(let{filename:n,line:r,store:i}of this._schemas.values()){if(t&&t!==n)continue;let s=[],o=[];for(let[a,u]of i._sources.entries()){if(sn.sub(u.paths,o))continue;if(!u.entry){s.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let l of["valid","invalid"]){let h=a[`_${l}s`];if(!h)continue;let d=new Set(h._values),g=new Set(h._refs);for(let{value:y,ref:b}of u[l])d.delete(y),g.delete(b);(d.size||g.size)&&s.push({status:[...d,...[...g].map(y=>y.display)],rule:`${l}s`})}let c=a._rules.map(l=>l.name);for(let l of["default","failover"])a._flags[l]!==void 0&&c.push(l);for(let l of c){let h=sn.labels[u.rule[l]||0];if(h){let d={rule:l,status:h};u.paths.size&&(d.paths=[...u.paths]),s.push(d)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(sn.message).join(", ")}`})}return e.length?e:null}};sn.Store=class{constructor(t){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(t)}debug(t,e,n,r){t.mainstay.debug&&t.mainstay.debug.push({type:e,name:n,result:r,path:t.path})}entry(t,e){sn.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){sn.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){sn.debug(e,{type:n,name:r,result:i==="full"?"pass":i}),this._record(t,s=>{s[n][r]=s[n][r]||0,s[n][r]|=sn.codes[i]})}resolve(t,e,n){if(!t.mainstay.debug)return;let r={type:"resolve",ref:e.display,to:n,path:t.path};t.mainstay.debug.push(r)}value(t,e,n,r,i){if(!t.mainstay.debug||Rk(n,r))return;let s={type:"value",by:e,from:n,to:r,path:t.path};i&&(s.name=i),t.mainstay.debug.push(s)}_record(t,e){let n=this._sources.get(t);if(n){e(n);return}let r=this._combos.get(t);for(let i of r)this._record(i,e)}_scan(t,e){let n=e||[],r=this._sources.get(t);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(t,r)),n.length&&r.paths.add(n);let i=(s,o)=>{let a=sn.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};sn.message=function(t){return`${t.paths?zq.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};sn.id=function(t,{source:e,name:n,path:r,key:i}){return t._flags.id?t._flags.id:i||(n=`@${n}`,e==="terms"?[n,r[Math.min(r.length-1,1)]]:n)};sn.sub=function(t,e){for(let n of t)for(let r of e)if(Rk(n.slice(0,r.length),r))return!0;return!1};sn.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Qh=m((tV,Mk)=>{"use strict";var t_=Me(),Dk=hn(),Vq=Hb(),Ik={};Mk.exports=Ik.merge=function(t,e,n){if(t_(t&&typeof t=="object","Invalid target value: must be an object"),t_(e==null||typeof e=="object","Invalid source value: must be null, undefined, or an object"),!e)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(e)){t_(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(Dk(e[i],{symbols:n.symbols}));return t}let r=Vq.keys(e,n);for(let i=0;i<r.length;++i){let s=r[i];if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(e,s))continue;let o=e[s];if(o&&typeof o=="object"){if(t[s]===o)continue;!t[s]||typeof t[s]!="object"||Array.isArray(t[s])!==Array.isArray(o)||o instanceof Date||Buffer&&Buffer.isBuffer(o)||o instanceof RegExp?t[s]=Dk(o,{symbols:n.symbols}):Ik.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var Lk=m(Zh=>{"use strict";var fi=Me(),n_=Qe(),Kq=hi(),Hr={};Zh.Ids=Hr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new Hr.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(let[e,n]of t._byId.entries())fi(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())fi(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,n)}fork(t,e,n){let r=this._collect(t);r.push({schema:n});let i=r.shift(),s={id:i.id,schema:e(i.schema)};fi(n_.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:Hr.fork(o.schema,s.id,s.schema)};return s.schema}labels(t,e=[]){let n=t[0],r=this._get(n);if(!r)return[...e,...t].join(".");let i=t.slice(1);return e=[...e,r.schema._flags.label||n],i.length?r.schema._ids.labels(i,e):e.join(".")}reach(t,e=[]){let n=t[0],r=this._get(n);fi(r,"Schema does not contain path",[...e,...t].join("."));let i=t.slice(1);return i.length?r.schema._ids.reach(i,[...e,n]):r.schema}register(t,{key:e}={}){if(!t||!n_.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);let n=t._flags.id;if(n){let r=this._byId.get(n);fi(!r||r.schema===t,"Cannot add different schemas with the same id:",n),fi(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(fi(!this._byKey.has(e),"Schema already contains key:",e),fi(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,{schema:t,id:e}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,e=[],n=[]){let r=t[0],i=this._get(r);fi(i,"Schema does not contain path",[...e,...t].join(".")),n=[i,...n];let s=t.slice(1);return s.length?i.schema._ids._collect(s,[...e,r],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}};Hr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=Zh.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};Zh.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=Hr.scan(t._flags[r],{source:"flags",name:r},e);i!==void 0&&(n=n||t.clone(),n._flags[r]=i)}for(let r=0;r<t._rules.length;++r){let i=t._rules[r],s=Hr.scan(i.args,{source:"rules",name:i.name},e);if(s!==void 0){n=n||t.clone();let o=Object.assign({},i);o.args=s,n._rules[r]=o,n._singleRules.get(i.name)===i&&n._singleRules.set(i.name,o)}}for(let r in t.$_terms){if(r[0]==="_")continue;let i=Hr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};Hr.scan=function(t,e,n,r,i){let s=r||[];if(t===null||typeof t!="object")return;let o;if(Array.isArray(t)){for(let a=0;a<t.length;++a){let u=e.source==="terms"&&e.name==="keys"&&t[a].key,c=Hr.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&n_.isSchema(t)||n.ref!==!1&&Kq.isRef(t)){let a=n.each(t,{...e,path:s,key:i});return a===t?void 0:a}for(let a in t){if(a[0]==="_")continue;let u=Hr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var qk=m((iV,Nk)=>{"use strict";Nk.exports=function(){}});var $k=m((sV,Fk)=>{"use strict";var Xq=hn(),jk=ks(),Yq=Qe(),Gr={value:Symbol("value")};Fk.exports=Gr.State=class{constructor(t,e,n){this.path=t,this.ancestors=e,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,e=null,n=null){let r=new Gr.State(t,e,this);return n&&r.schemas&&(r.schemas=[Gr.schemas(n),...r.schemas]),r}nest(t,e){let n=new Gr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[Gr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new Gr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=Xq(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}};Gr.schemas=function(t){return Yq.isSchema(t)?{schema:t}:t};Gr.Shadow=class{constructor(){this._values=null}set(t,e,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let i=0;i<t.length;++i){let s=t[i],o=r.get(s);o||(o=new Map,r.set(s,o)),r=o}r[Gr.value]=e}get(t){let e=this.node(t);if(e)return e[Gr.value]}node(t){if(this._values)return jk(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=jk(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var Wk=m(Tu=>{"use strict";var Su=Me(),Bk=hn(),Ho=qk(),Jq=ks(),It=Qe(),Yi=li(),Qq=$k(),_e={result:Symbol("result")};Tu.entry=function(t,e,n){let r=It.defaults;n&&(Su(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),Su(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=It.preferences(It.defaults,n));let i=_e.entry(t,e,r);Su(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");let s={value:i.value};return i.error&&(s.error=i.error),i.mainstay.warnings.length&&(s.warning=Yi.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};Tu.entryAsync=async function(t,e,n){let r=It.defaults;n&&(r=It.preferences(It.defaults,n));let i=_e.entry(t,e,r),s=i.mainstay;if(i.error)throw s.debug&&(i.error.debug=s.debug),i.error;if(s.externals.length){let a=i.value,u=[];for(let c of s.externals){let l=c.state.path,h=c.schema.type==="link"?s.links.get(c.schema):null,d=a,g,y,b=l.length?[a]:[],C=l.length?Jq(t,l):t;if(l.length){g=l[l.length-1];let A=a;for(let w of l.slice(0,-1))A=A[w],b.unshift(A);y=b[0],d=y[g]}try{let A=(T,v)=>(h||c.schema).$_createError(T,d,v,c.state,r),w=await c.method(d,{schema:c.schema,linked:h,state:c.state,prefs:n,original:C,error:A,errorsArray:_e.errorsArray,warn:(T,v)=>s.warnings.push((h||c.schema).$_createError(T,d,v,c.state,r)),message:(T,v)=>(h||c.schema).$_createError("external",d,v,c.state,r,{messages:T})});if(w===void 0||w===d)continue;if(w instanceof Yi.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(w),r.abortEarly)break;continue}if(Array.isArray(w)&&w[It.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...w),r.abortEarly)break;continue}y?(s.tracer.value(c.state,"rule",d,w,"external"),y[g]=w):(s.tracer.value(c.state,"rule",a,w,"external"),a=w)}catch(A){throw r.errors.label&&(A.message+=` (${c.label})`),A}}if(i.value=a,u.length)throw i.error=Yi.process(u,t,r),s.debug&&(i.error.debug=s.debug),i.error}if(!r.warnings&&!r.debug&&!r.artifacts)return i.value;let o={value:i.value};return s.warnings.length&&(o.warning=Yi.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};_e.Mainstay=class{constructor(t,e,n){this.externals=[],this.warnings=[],this.tracer=t,this.debug=e,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){let t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}};_e.entry=function(t,e,n){let{tracer:r,cleanup:i}=_e.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new _e.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new Qq([],[],{mainstay:a,schemas:u}),l=Tu.validate(t,e,c,n);i&&e.$_root.untrace();let h=Yi.process(l.errors,t,n);return{value:l.value,error:h,mainstay:a}};_e.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(Su(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:_e.ignore}};Tu.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=_e.prefs(e,r)),e._cache&&r.cache){let h=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!h),h)return h}let s=(h,d,g)=>e.$_createError(h,t,d,g||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:_e.errorsArray,warn:(h,d,g)=>n.mainstay.warnings.push(s(h,d,g)),message:(h,d)=>e.$_createError("custom",t,d,n,r,{messages:h})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let h=a.prepare(t,o);if(h){if(n.mainstay.tracer.value(n,"prepare",t,h.value),h.errors)return _e.finalize(h.value,[].concat(h.errors),o);t=h.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let h=a.coerce.method(t,o);if(h){if(n.mainstay.tracer.value(n,"coerced",t,h.value),h.errors)return _e.finalize(h.value,[].concat(h.errors),o);t=h.value}}let u=e._flags.empty;u&&u.$_match(_e.trim(t,e),n.nest(u),It.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let c=i.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(c==="forbidden")return _e.finalize(t,null,o);if(c==="required")return _e.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==It.symbols.deepDefault)return _e.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return _e.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let h=e._valids.get(t,n,r,e._flags.insensitive);if(h)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,h.value),t=h.value),n.mainstay.tracer.filter(e,n,"valid",h),_e.finalize(t,null,o);if(e._flags.only){let d=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return _e.finalize(t,[d],o);l.push(d)}}if(e._invalids){let h=e._invalids.get(t,n,r,e._flags.insensitive);if(h){n.mainstay.tracer.filter(e,n,"invalid",h);let d=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return _e.finalize(t,[d],o);l.push(d)}}if(a.validate){let h=a.validate(t,o);if(h&&(n.mainstay.tracer.value(n,"base",t,h.value),t=h.value,h.errors)){if(!Array.isArray(h.errors))return l.push(h.errors),_e.finalize(t,l,o);if(h.errors.length)return l.push(...h.errors),_e.finalize(t,l,o)}}return e._rules.length?_e.rules(t,l,o):_e.finalize(t,l,o)};_e.rules=function(t,e,n){let{schema:r,state:i,prefs:s}=n;for(let o of r._rules){let a=r._definition.rules[o.method];if(a.convert&&s.convert){i.mainstay.tracer.log(r,i,"rule",o.name,"full");continue}let u,c=o.args;if(o._resolve.length){c=Object.assign({},c);for(let h of o._resolve){let d=a.argsByName.get(h),g=c[h].resolve(t,i,s),y=d.normalize?d.normalize(g):g,b=It.validateArg(y,null,d);if(b){u=r.$_createError("any.ref",g,{arg:h,ref:c[h],reason:b},i,s);break}c[h]=y}}u=u||a.validate(t,n,c,o);let l=_e.rule(u,o);if(l.errors){if(i.mainstay.tracer.log(r,i,"rule",o.name,"error"),o.warn){i.mainstay.warnings.push(...l.errors);continue}if(s.abortEarly)return _e.finalize(t,l.errors,n);e.push(...l.errors)}else i.mainstay.tracer.log(r,i,"rule",o.name,"pass"),i.mainstay.tracer.value(i,"rule",t,l.value,o.name),t=l.value}return _e.finalize(t,e,n)};_e.rule=function(t,e){return t instanceof Yi.Report?(_e.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[It.symbols.errors]?(t.forEach(n=>_e.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};_e.error=function(t,e){return e.message&&t._setTemplate(e.message),t};_e.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=_e.default("failover",void 0,e,n);a!==void 0&&(i.mainstay.tracer.value(i,"failover",t,a),t=a,e=[])}if(e.length&&r._flags.error)if(typeof r._flags.error=="function"){e=r._flags.error(e),Array.isArray(e)||(e=[e]);for(let a of e)Su(a instanceof Error||a instanceof Yi.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=_e.default("default",t,e,n);i.mainstay.tracer.value(i,"default",t,a),t=a}if(r._flags.cast&&t!==void 0){let a=r._definition.cast[r._flags.cast];if(a.from(t)){let u=a.to(t,n);i.mainstay.tracer.value(i,"cast",t,u,r._flags.cast),t=u}}if(r.$_terms.externals&&s.externals&&s._externals!==!1)for(let{method:a}of r.$_terms.externals)i.mainstay.externals.push({method:a,schema:r,state:i,label:Yi.label(r._flags,i,s)});let o={value:t,errors:e.length?e:null};return r._flags.result&&(o.value=r._flags.result==="strip"?void 0:n.original,i.mainstay.tracer.value(i,r._flags.result,t,o.value),i.shadow(t,r._flags.result)),r._cache&&s.cache!==!1&&!r._refs.length&&r._cache.set(n.original,o),t!==void 0&&!o.errors&&r._flags.artifact!==void 0&&(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(r._flags.artifact)||i.mainstay.artifacts.set(r._flags.artifact,[]),i.mainstay.artifacts.get(r._flags.artifact).push(i.path)),o};_e.prefs=function(t,e){let n=e===It.defaults;return n&&t._preferences[It.symbols.prefs]?t._preferences[It.symbols.prefs]:(e=It.preferences(e,t._preferences),n&&(t._preferences[It.symbols.prefs]=e),e)};_e.default=function(t,e,n,r){let{schema:i,state:s,prefs:o}=r,a=i._flags[t];if(o.noDefaults||a===void 0)return e;if(s.mainstay.tracer.log(i,s,"rule",t,"full"),!a)return a;if(typeof a=="function"){let u=a.length?[Bk(s.ancestors[0]),r]:[];try{return a(...u)}catch(c){n.push(i.$_createError(`any.${t}`,null,{error:c},s,o));return}}return typeof a!="object"?a:a[It.symbols.literal]?a.literal:It.isResolvable(a)?a.resolve(e,s,o):Bk(a)};_e.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};_e.ignore={active:!1,debug:Ho,entry:Ho,filter:Ho,log:Ho,resolve:Ho,value:Ho};_e.errorsArray=function(){let t=[];return t[It.symbols.errors]=!0,t}});var i_=m((lV,Hk)=>{"use strict";var Zq=Me(),Uk=vu(),r_=Qe(),pi={};Hk.exports=pi.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=pi.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(r_.isResolvable(t)){this._refs.has(t)||(this._refs.add(t),e&&e.register(t));return}this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,e,n){if(t=t||new pi.Values,e){if(e._override)return e.clone();for(let r of[...e._values,...e._refs])t.add(r)}if(n)for(let r of[...n._values,...n._refs])t.remove(r);return t.length?t:null}remove(t){if(r_.isResolvable(t)){this._refs.delete(t);return}this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase())}has(t,e,n,r){return!!this.get(t,e,n,r)}get(t,e,n,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){let i=this._lowercase.get(t.toLowerCase());if(i)return{value:i}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(let i of this._values)if(Uk(i,t))return{value:i}}if(e)for(let i of this._refs){let s=i.resolve(t,e,n,null,{in:!0});if(s===void 0)continue;let o=!i.in||typeof s!="object"?[s]:Array.isArray(s)?s:Object.keys(s);for(let a of o)if(typeof a==typeof t){if(r&&t&&typeof t=="string"){if(a.toLowerCase()===t.toLowerCase())return{value:a,ref:i}}else if(Uk(a,t))return{value:a,ref:i}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){let e=[];for(let n of[...this._values,...this._refs])n!==void 0&&e.push(n);return e}return Array.from([...this._values,...this._refs])}clone(){let t=new pi.Values(this._values,this._refs);return t._override=this._override,t}concat(t){Zq(!t._override,"Cannot concat override set of values");let e=new pi.Values([...this._values,...t._values],[...this._refs,...t._refs]);return e._override=this._override,e}describe(){let t=[];this._override&&t.push({override:!0});for(let e of this._values.values())t.push(e&&typeof e=="object"?{value:e}:e);for(let e of this._refs.values())t.push(e.describe());return t}};pi.Values.prototype[r_.symbols.values]=!0;pi.Values.prototype.slice=pi.Values.prototype.clone;pi.lowercases=function(t){let e=new Map;if(t)for(let n of t)typeof n=="string"&&e.set(n.toLowerCase(),n);return e}});var Qk=m((dV,Jk)=>{"use strict";var J=Me(),Gk=hn(),zk=vu(),s_=Qh(),ej=Kb(),Et=Qe(),o_=Rs(),tj=li(),nj=Xb(),Vk=Qb(),rj=Bo(),Kk=Lk(),Xk=hi(),Yk=e_(),ed=Wk(),td=i_(),Bt={};Bt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new Kk.Ids,this._preferences=null,this._refs=new Xk.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return J(typeof Vk.describe=="function","Manifest functionality disabled"),Vk.describe(this)}allow(...t){return Et.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){J(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),J(!this._inRuleset(),"Cannot set alterations inside a ruleset");let e=this.clone();e.$_terms.alterations=e.$_terms.alterations||[];for(let n in t){let r=t[n];J(typeof r=="function","Alteration adjuster for",n,"must be a function"),e.$_terms.alterations.push({target:n,adjuster:r})}return e.$_temp.ruleset=!1,e}artifact(t){return J(t!==void 0,"Artifact cannot be undefined"),J(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return J(t===!1||typeof t=="string","Invalid to value"),J(t===!1||this._definition.cast[t],"Type",this.type,"does not support casting to",t),this.$_setFlag("cast",t===!1?void 0:t)}default(t,e){return this._default("default",t,e)}description(t){return J(t&&typeof t=="string","Description must be a non-empty string"),this.$_setFlag("description",t)}empty(t){let e=this.clone();return t!==void 0&&(t=e.$_compile(t,{override:!1})),e.$_setFlag("empty",t,{clone:!1})}error(t){return J(t,"Missing error"),J(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return J(t!==void 0,"Missing example"),Et.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(J(!e,"Cannot combine options with description"),e=t.description,t=t.method),J(typeof t=="function","Method must be a function"),J(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this._inner("externals",{method:t,description:e},{single:!0})}failover(t,e){return this._default("failover",t,e)}forbidden(){return this.presence("forbidden")}id(t){return t?(J(typeof t=="string","id must be a non-empty string"),J(/^[^\.]+$/.test(t),"id cannot contain period character"),this.$_setFlag("id",t)):this.$_setFlag("id",void 0)}invalid(...t){return this._values(t,"_invalids")}label(t){return J(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return J(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){J(t.length,"Missing notes");for(let e of t)J(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return J(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){J(t,"Missing preferences"),J(t.context===void 0,"Cannot override context"),J(t.externals===void 0,"Cannot override externals"),J(t.warnings===void 0,"Cannot override warnings"),J(t.debug===void 0,"Cannot override debug"),Et.checkPreferences(t);let e=this.clone();return e._preferences=Et.preferences(e._preferences,t),e}presence(t){return J(["optional","required","forbidden"].includes(t),"Unknown presence mode",t),this.$_setFlag("presence",t)}raw(t=!0){return this.$_setFlag("result",t?"raw":void 0)}result(t){return J(["raw","strip"].includes(t),"Unknown result mode",t),this.$_setFlag("result",t)}required(){return this.presence("required")}strict(t){let e=this.clone(),n=t===void 0?!1:!t;return e._preferences=Et.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){J(t.length,"Missing tags");for(let e of t)J(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return J(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){Et.verifyFlat(t,"valid");let e=this.allow(...t);return e.$_setFlag("only",!!e._valids,{clone:!1}),e}when(t,e){let n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);let r=o_.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)J(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),J(!s.otherwise||s.otherwise.type==="any"||s.otherwise.type===n.type,"Cannot combine",n.type,"with",s.otherwise&&s.otherwise.type)}return n.$_terms.whens.push(r),n.$_mutateRebuild()}cache(t){J(!this._inRuleset(),"Cannot set caching inside a ruleset"),J(!this._cache,"Cannot override schema cache"),J(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||ej.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){J(Et.isSchema(t),"Invalid schema object"),J(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),J(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),J(!t._inRuleset(),"Cannot concatenate a schema with open ruleset");let e=this.clone();if(this.type==="any"&&t.type!=="any"){let n=t.clone();for(let r of Object.keys(e))r!=="type"&&(n[r]=e[r]);e=n}e._ids.concat(t._ids),e._refs.register(t,Xk.toSibling),e._preferences=e._preferences?Et.preferences(e._preferences,t._preferences):t._preferences,e._valids=td.merge(e._valids,t._valids,t._invalids),e._invalids=td.merge(e._invalids,t._invalids,t._valids);for(let n of t._singleRules.keys())e._singleRules.has(n)&&(e._rules=e._rules.filter(r=>r.keep||r.name!==n),e._singleRules.delete(n));for(let n of t._rules)t._definition.rules[n.method].multi||e._singleRules.set(n.name,n),e._rules.push(n);if(e._flags.empty&&t._flags.empty){e._flags.empty=e._flags.empty.concat(t._flags.empty);let n=Object.assign({},t._flags);delete n.empty,s_(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,s_(e._flags,n)}else s_(e._flags,t._flags);for(let n in t.$_terms){let r=t.$_terms[n];if(!r){e.$_terms[n]||(e.$_terms[n]=r);continue}if(!e.$_terms[n]){e.$_terms[n]=r.slice();continue}e.$_terms[n]=e.$_terms[n].concat(r)}return this.$_root._tracer&&this.$_root._tracer._combine(e,[this,t]),e.$_mutateRebuild()}extend(t){return J(!t.base,"Cannot extend type with another base"),nj.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){J(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(t))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,e,n);return n.$_temp.ruleset=!1,n}rule(t){let e=this._definition;Et.assertOptions(t,Object.keys(e.modifiers)),J(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");let n=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;J(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");let r=this.clone();for(let i=n;i<r._rules.length;++i){let s=r._rules[i],o=Gk(s);for(let a in t)e.modifiers[a](o,t[a]),J(o.name===s.name,"Cannot change rule name");r._rules[i]=o,r._singleRules.get(o.name)===s&&r._singleRules.set(o.name,o)}return r.$_temp.ruleset=!1,r.$_mutateRebuild()}get ruleset(){J(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");let t=this.clone();return t.$_temp.ruleset=t._rules.length,t}get $(){return this.ruleset}tailor(t){t=[].concat(t),J(!this._inRuleset(),"Cannot tailor inside a ruleset");let e=this;if(this.$_terms.alterations)for(let{target:n,adjuster:r}of this.$_terms.alterations)t.includes(n)&&(e=r(e),J(Et.isSchema(e),"Alteration adjuster for",n,"failed to return a schema object"));return e=e.$_modify({each:n=>n.tailor(t),ref:!1}),e.$_temp.ruleset=!1,e.$_mutateRebuild()}tracer(){return Yk.location?Yk.location(this):this}validate(t,e){return ed.entry(t,this,e)}validateAsync(t,e){return ed.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),J(t&&typeof t=="object","Invalid options"),J(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)J(s[0]!=="_","Cannot set private rule properties");let e=Object.assign({},t);e._resolve=[],e.method=e.method||e.name;let n=this._definition.rules[e.method],r=e.args;J(n,"Unknown rule",e.method);let i=this.clone();if(r){J(Object.keys(r).length===1||Object.keys(r).length===this._definition.rules[e.name].args.length,"Invalid rule definition for",this.type,e.name);for(let s in r){let o=r[s];if(n.argsByName){let a=n.argsByName.get(s);if(a.ref&&Et.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=Et.validateArg(o,s,a);J(!u,u,"or reference")}}if(o===void 0){delete r[s];continue}r[s]=o}}return n.multi||(i._ruleRemove(e.name,{clone:!1}),i._singleRules.set(e.name,e)),i.$_temp.ruleset===!1&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(e):i._rules.push(e),i}$_compile(t,e){return o_.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?rj.merge(this._definition.messages,s.messages):this._definition.messages;return new tj.Report(t,e,n,o,a,r,i)}$_getFlag(t){return this._flags[t]}$_getRule(t){return this._singleRules.get(t)}$_mapLabels(t){return t=Array.isArray(t)?t:t.split("."),this._ids.labels(t)}$_match(t,e,n,r){n=Object.assign({},n),n.abortEarly=!0,n._externals=!1,e.snapshot();let i=!ed.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return Et.assertOptions(t,["each","once","ref","schema"]),Kk.schema(this,t)||this}$_mutateRebuild(){J(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset();let t=(e,{source:n,name:r,path:i,key:s})=>{let o=this._definition[n][r]&&this._definition[n][r].register;o!==!1&&this.$_mutateRegister(e,{family:o,key:s})};return this.$_modify({each:t}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(t,{family:e,key:n}={}){this._refs.register(t,e),this._ids.register(t,{key:n})}$_property(t){return this._definition.properties[t]}$_reach(t){return this._ids.reach(t)}$_rootReferences(){return this._refs.roots()}$_setFlag(t,e,n={}){J(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(zk(e,r.default)&&(e=void 0),zk(e,this._flags[t]))return this;let i=n.clone!==!1?this.clone():this;return e!==void 0?(i._flags[t]=e,i.$_mutateRegister(e)):delete i._flags[t],t[0]!=="_"&&(i.$_temp.ruleset=!1),i}$_parent(t,...e){return this[t][Et.symbols.parent].call(this,...e)}$_validate(t,e,n){return ed.validate(t,this,e,n)}_assign(t){t.type=this.type,t.$_root=this.$_root,t.$_temp=Object.assign({},this.$_temp),t.$_temp.whens={},t._ids=this._ids.clone(),t._preferences=this._preferences,t._valids=this._valids&&this._valids.clone(),t._invalids=this._invalids&&this._invalids.clone(),t._rules=this._rules.slice(),t._singleRules=Gk(this._singleRules,{shallow:!0}),t._refs=this._refs.clone(),t._flags=Object.assign({},this._flags),t._cache=null,t.$_terms={};for(let e in this.$_terms)t.$_terms[e]=this.$_terms[e]?this.$_terms[e].slice():null;t.$_super={};for(let e in this.$_super)t.$_super[e]=this._super[e].bind(t);return t}_bare(){let t=this.clone();t._reset();let e=t._definition.terms;for(let n in e){let r=e[n];t.$_terms[n]=r.init}return t.$_mutateRebuild()}_default(t,e,n={}){return Et.assertOptions(n,"literal"),J(e!==void 0,"Missing",t,"value"),J(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[Et.symbols.literal]:!0,literal:e}),this.$_setFlag(t,e)}_generate(t,e,n){if(!this.$_terms.whens)return{schema:this};let r=[],i=[];for(let a=0;a<this.$_terms.whens.length;++a){let u=this.$_terms.whens[a];if(u.concat){r.push(u.concat),i.push(`${a}.concat`);continue}let c=u.ref?u.ref.resolve(t,e,n):t,l=u.is?[u]:u.switch,h=i.length;for(let d=0;d<l.length;++d){let{is:g,then:y,otherwise:b}=l[d],C=`${a}${u.switch?"."+d:""}`;if(g.$_match(c,e.nest(g,`${C}.is`),n)){if(y){let A=e.localize([...e.path,`${C}.then`],e.ancestors,e.schemas),{schema:w,id:T}=y._generate(t,A,n);r.push(w),i.push(`${C}.then${T?`(${T})`:""}`);break}}else if(b){let A=e.localize([...e.path,`${C}.otherwise`],e.ancestors,e.schemas),{schema:w,id:T}=b._generate(t,A,n);r.push(w),i.push(`${C}.otherwise${T?`(${T})`:""}`);break}}if(u.break&&i.length>h)break}let s=i.join(", ");if(e.mainstay.tracer.debug(e,"rule","when",s),!s)return{schema:this};if(!e.mainstay.tracer.active&&this.$_temp.whens[s])return{schema:this.$_temp.whens[s],id:s};let o=this;this._definition.generate&&(o=this._definition.generate(this,t,e,n));for(let a of r)o=o.concat(a);return this.$_root._tracer&&this.$_root._tracer._combine(o,[this,...r]),this.$_temp.whens[s]=o,{schema:o,id:s}}_inner(t,e,n={}){J(!this._inRuleset(),`Cannot set ${t} inside a ruleset`);let r=this.clone();return(!r.$_terms[t]||n.override)&&(r.$_terms[t]=[]),n.single?r.$_terms[t].push(e):r.$_terms[t].push(...e),r.$_temp.ruleset=!1,r}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(t,e={}){if(!this._singleRules.has(t))return this;let n=e.clone!==!1?this.clone():this;n._singleRules.delete(t);let r=[];for(let i=0;i<n._rules.length;++i){let s=n._rules[i];if(s.name===t&&!s.keep){n._inRuleset()&&i<n.$_temp.ruleset&&--n.$_temp.ruleset;continue}r.push(s)}return n._rules=r,n}_values(t,e){Et.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===Et.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new td:r&&(n[e]=t.length?new td:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){J(i!==void 0,"Cannot call allow/valid/invalid with undefined"),J(i!==Et.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(J(e==="_valids"||!n._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),n[s]=null)),n[e].add(i,n._refs)}return n}};Bt.Base.prototype[Et.symbols.any]={version:Et.version,compile:o_.compile,root:"$_root"};Bt.Base.prototype.isImmutable=!0;Bt.Base.prototype.deny=Bt.Base.prototype.invalid;Bt.Base.prototype.disallow=Bt.Base.prototype.invalid;Bt.Base.prototype.equal=Bt.Base.prototype.valid;Bt.Base.prototype.exist=Bt.Base.prototype.required;Bt.Base.prototype.not=Bt.Base.prototype.invalid;Bt.Base.prototype.options=Bt.Base.prototype.prefs;Bt.Base.prototype.preferences=Bt.Base.prototype.prefs;Jk.exports=new Bt.Base});var tr=m((pV,Zk)=>{"use strict";var nd=Me(),ij=Qk(),sj=Qe(),oj=Bo();Zk.exports=ij.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,e){return nd(typeof t=="function","Method must be a function"),nd(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:e}})},validate(t,e,{method:n}){try{return n(t,e)}catch(r){return e.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){nd(sj.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");let e=this.clone();return e.$_terms.shared=e.$_terms.shared||[],e.$_terms.shared.push(t),e.$_mutateRegister(t),e}},warning:{method(t,e){return nd(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:e},warn:!0})},validate(t,e,{code:n,local:r}){return e.error(n,r)},args:["code","local"],multi:!0}},modifiers:{keep(t,e=!0){t.keep=e},message(t,e){t.message=oj.compile(e)},warn(t,e=!0){t.warn=e}},manifest:{build(t,e){for(let n in e){let r=e[n];if(["examples","externals","metas","notes","tags"].includes(n)){for(let i of r)t=t[n.slice(0,-1)](i);continue}if(n==="alterations"){let i={};for(let{target:s,adjuster:o}of r)i[s]=o;t=t.alter(i);continue}if(n==="whens"){for(let i of r){let{ref:s,is:o,not:a,then:u,otherwise:c,concat:l}=i;l?t=t.concat(l):s?t=t.when(s,{is:o,not:a,then:u,otherwise:c,switch:i.switch,break:i.break}):t=t.when(o,{then:u,otherwise:c,break:i.break})}continue}if(n==="shared")for(let i of r)t=t.shared(i)}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})});var nC=m((gV,tC)=>{"use strict";var Ds=Me(),aj=Qh(),uj=tr(),eC=Qe(),cj=Rs(),rd=li(),lj=hi(),Go={};tC.exports=uj.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:lj.toSibling}},args(t,...e){return e.length===1&&Array.isArray(e[0])?t.try(...e[0]):t.try(...e)},validate(t,e){let{schema:n,error:r,state:i,prefs:s}=e;if(n._flags.match){let a=[],u=[];for(let l=0;l<n.$_terms.matches.length;++l){let h=n.$_terms.matches[l],d=i.nest(h.schema,`match.${l}`);d.snapshot();let g=h.schema.$_validate(t,d,s);g.errors?(u.push(g.errors),d.restore()):(a.push(g.value),d.commit())}if(a.length===0){let l={details:u.map(h=>rd.details(h,{override:!1}))};return{errors:r("alternatives.any",l)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let l={details:u.map(h=>rd.details(h,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(h=>h.schema.type==="object"||h.schema.type==="alternatives"&&c(h.schema));return c(n)?{value:a.reduce((l,h)=>aj(l,h,{mergeArrays:!1}))}:{value:a[a.length-1]}}let o=[];for(let a=0;a<n.$_terms.matches.length;++a){let u=n.$_terms.matches[a];if(u.schema){let h=i.nest(u.schema,`match.${a}`);h.snapshot();let d=u.schema.$_validate(t,h,s);if(!d.errors)return h.commit(),d;h.restore(),o.push({schema:u.schema,reports:d.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let h=0;h<l.length;++h){let d=l[h],{is:g,then:y,otherwise:b}=d,C=`match.${a}${u.switch?"."+h:""}`;if(g.$_match(c,i.nest(g,`${C}.is`),s)){if(y)return y.$_validate(t,i.nest(y,`${C}.then`),s)}else if(b)return b.$_validate(t,i.nest(b,`${C}.otherwise`),s)}}return Go.errors(o,e)},rules:{conditional:{method(t,e){Ds(!this._flags._endedSwitch,"Unreachable condition"),Ds(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Ds(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=cj.when(n,t,e),i=r.is?[r]:r.switch;for(let s of i)if(s.then&&s.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(r),n.$_mutateRebuild()}},match:{method(t){if(Ds(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Ds(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Ds(t.length,"Missing alternative schemas"),eC.verifyFlat(t,"try"),Ds(!this._flags._endedSwitch,"Unreachable condition");let e=this.clone();for(let n of t)e.$_terms.matches.push({schema:e.$_compile(n)});return e.$_mutateRebuild()}}},overrides:{label(t){let e=this.$_parent("label",t),n=(r,i)=>i.path[0]!=="is"&&typeof r._flags.label!="string"?r.label(t):void 0;return e.$_modify({each:n,ref:!1})}},rebuild(t){let e=n=>{eC.isSchema(n)&&n.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})};t.$_modify({each:e})},manifest:{build(t,e){if(e.matches)for(let n of e.matches){let{schema:r,ref:i,is:s,not:o,then:a,otherwise:u}=n;r?t=t.try(r):i?t=t.conditional(i,{is:s,then:a,not:o,otherwise:u,switch:n.switch}):t=t.conditional(s,{then:a,otherwise:u})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}});Go.errors=function(t,{error:e,state:n}){if(!t.length)return{errors:e("alternatives.any")};if(t.length===1)return{errors:t[0].reports};let r=new Set,i=[];for(let{reports:s,schema:o}of t){if(s.length>1)return Go.unmatched(t,e);let a=s[0];if(!(a instanceof rd.Report))return Go.unmatched(t,e);if(a.state.path.length!==n.path.length){i.push({type:o.type,report:a});continue}if(a.code==="any.only"){for(let l of a.local.valids)r.add(l);continue}let[u,c]=a.code.split(".");c!=="base"?i.push({type:o.type,report:a}):a.code==="object.base"?r.add(a.local.type):r.add(u)}return i.length?i.length===1?{errors:i[0].report}:Go.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};Go.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",rd.details(n,{override:!1}))}}});var iC=m((mV,rC)=>{"use strict";var wu=Me(),hj=vu(),dj=ks(),fj=tr(),nr=Qe(),pj=Rs(),ct={};rC.exports=fj.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(t,{schema:e,state:n,prefs:r}){if(!Array.isArray(t))return;let i=e.$_getRule("sort");if(i)return ct.sort(e,t,i.args.options,n,r)}},validate(t,{schema:e,error:n}){if(!Array.isArray(t)){if(e._flags.single){let r=[t];return r[nr.symbols.arraySingle]=!0,{value:r}}return{errors:n("array.base")}}if(!(!e.$_getRule("items")&&!e.$_terms.externals))return{value:t.slice()}},rules:{has:{method(t){t=this.$_compile(t,{appendPath:!0});let e=this.$_addRule({name:"has",args:{schema:t}});return e.$_mutateRegister(t),e},validate(t,{state:e,prefs:n,error:r},{schema:i}){let s=[t,...e.ancestors];for(let a=0;a<t.length;++a){let u=e.localize([...e.path,a],s,i);if(i.$_match(t[a],u,n))return t}let o=i._flags.label;return o?r("array.hasKnown",{patternLabel:o}):r("array.hasUnknown",null)},multi:!0},items:{method(...t){nr.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=nr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});e.$_terms.items.push(r)}return e.$_mutateRebuild()},validate(t,{schema:e,error:n,state:r,prefs:i,errorsArray:s}){let o=e.$_terms._requireds.slice(),a=e.$_terms.ordered.slice(),u=[...e.$_terms._inclusions,...o],c=!t[nr.symbols.arraySingle];delete t[nr.symbols.arraySingle];let l=s(),h=t.length;for(let d=0;d<h;++d){let g=t[d],y=!1,b=!1,C=c?d:new Number(d),A=[...r.path,C];if(!e._flags.sparse&&g===void 0){if(l.push(n("array.sparse",{key:C,path:A,pos:d,value:void 0},r.localize(A))),i.abortEarly)return l;a.shift();continue}let w=[t,...r.ancestors];for(let R of e.$_terms._exclusions)if(R.$_match(g,r.localize(A,w,R),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:d,value:g},r.localize(A))),i.abortEarly)return l;y=!0,a.shift();break}if(y)continue;if(e.$_terms.ordered.length){if(a.length){let R=a.shift(),B=R.$_validate(g,r.localize(A,w,R),i);if(B.errors){if(l.push(...B.errors),i.abortEarly)return l}else if(R._flags.result==="strip")ct.fastSplice(t,d),--d,--h;else if(!e._flags.sparse&&B.value===void 0){if(l.push(n("array.sparse",{key:C,path:A,pos:d,value:void 0},r.localize(A))),i.abortEarly)return l;continue}else t[d]=B.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:d,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let T=[],v=o.length;for(let R=0;R<v;++R){let B=r.localize(A,w,o[R]);B.snapshot();let ee=o[R].$_validate(g,B,i);if(T[R]=ee,!ee.errors){if(B.commit(),t[d]=ee.value,b=!0,ct.fastSplice(o,R),--R,--v,!e._flags.sparse&&ee.value===void 0&&(l.push(n("array.sparse",{key:C,path:A,pos:d,value:void 0},r.localize(A))),i.abortEarly))return l;break}B.restore()}if(b)continue;let L=i.stripUnknown&&!!i.stripUnknown.arrays||!1;v=u.length;for(let R of u){let B,ee=o.indexOf(R);if(ee!==-1)B=T[ee];else{let re=r.localize(A,w,R);if(re.snapshot(),B=R.$_validate(g,re,i),!B.errors){re.commit(),R._flags.result==="strip"?(ct.fastSplice(t,d),--d,--h):!e._flags.sparse&&B.value===void 0?(l.push(n("array.sparse",{key:C,path:A,pos:d,value:void 0},r.localize(A))),y=!0):t[d]=B.value,b=!0;break}re.restore()}if(v===1){if(L){ct.fastSplice(t,d),--d,--h,b=!0;break}if(l.push(...B.errors),i.abortEarly)return l;y=!0;break}}if(!y&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!b){if(L){ct.fastSplice(t,d),--d,--h;continue}if(l.push(n("array.includes",{pos:d,value:g},r.localize(A))),i.abortEarly)return l}}return o.length&&ct.fillMissedErrors(e,l,o,t,r,i),a.length&&(ct.fillOrderedErrors(e,l,a,t,r,i),l.length||ct.fillDefault(a,t,r,i)),l.length?l:t},priority:!0,manifest:!1},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return nr.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:nr.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},ordered:{method(...t){nr.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=nr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});ct.validateSingle(r,e),e.$_mutateRegister(r),e.$_terms.ordered.push(r)}return e.$_mutateRebuild()}},single:{method(t){let e=t===void 0?!0:!!t;return wu(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){nr.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=pj.ref(t.by,{ancestor:0}),wu(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(t,{error:e,state:n,prefs:r,schema:i},{options:s}){let{value:o,errors:a}=ct.sort(i,t,s,n,r);if(a)return a;for(let u=0;u<t.length;++u)if(t[u]!==o[u])return e("array.sort",{order:s.order,by:s.by?s.by.key:"value"});return t},convert:!0},sparse:{method(t){let e=t===void 0?!0:!!t;return this._flags.sparse===e?this:(e?this.clone():this.$_addRule("items")).$_setFlag("sparse",e,{clone:!1})}},unique:{method(t,e={}){wu(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),nr.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=nr.default(e.separator,".");n.path=r?t.split(r):[t]}else n.comparator=t;return this.$_addRule(n)},validate(t,{state:e,error:n,schema:r},{comparator:i,options:s},{comparator:o,path:a}){let u={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},c=o||hj,l=s.ignoreUndefined;for(let h=0;h<t.length;++h){let d=a?dj(t[h],a):t[h],g=o?u.custom:u[typeof d];if(wu(g,"Failed to find unique map container for type",typeof d),g instanceof Map){let y=g.entries(),b;for(;!(b=y.next()).done;)if(c(b.value[0],d)){let C=e.localize([...e.path,h],[t,...e.ancestors]),A={pos:h,value:t[h],dupePos:b.value[1],dupeValue:t[b.value[1]]};return a&&(A.path=i),n("array.unique",A,C)}g.set(d,h)}else{if((!l||d!==void 0)&&g[d]!==void 0){let y={pos:h,value:t[h],dupePos:g[d],dupeValue:t[g[d]]};a&&(y.path=i);let b=e.localize([...e.path,h],[t,...e.ancestors]);return n("array.unique",y,b)}g[d]=h}}return t},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to(t,e){return new Set(t)}}},rebuild(t){t.$_terms._inclusions=[],t.$_terms._exclusions=[],t.$_terms._requireds=[];for(let e of t.$_terms.items)ct.validateSingle(e,t),e._flags.presence==="required"?t.$_terms._requireds.push(e):e._flags.presence==="forbidden"?t.$_terms._exclusions.push(e):t.$_terms._inclusions.push(e);for(let e of t.$_terms.ordered)ct.validateSingle(e,t)},manifest:{build(t,e){return e.items&&(t=t.items(...e.items)),e.ordered&&(t=t.ordered(...e.ordered)),t}},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}});ct.fillMissedErrors=function(t,e,n,r,i,s){let o=[],a=0;for(let u of n){let c=u._flags.label;c?o.push(c):++a}o.length?a?e.push(t.$_createError("array.includesRequiredBoth",r,{knownMisses:o,unknownMisses:a},i,s)):e.push(t.$_createError("array.includesRequiredKnowns",r,{knownMisses:o},i,s)):e.push(t.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},i,s))};ct.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&ct.fillMissedErrors(t,e,o,r,i,s)};ct.fillDefault=function(t,e,n,r){let i=[],s=!0;for(let o=t.length-1;o>=0;--o){let a=t[o],u=[e,...n.ancestors],c=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(s){if(c===void 0)continue;s=!1}i.unshift(c)}i.length&&e.push(...i)};ct.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};ct.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(wu(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};ct.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let h=ct.compare(c,l,o,a);if(h!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),h=ct.compare(c,l,o,a),h!==null))return h;let d=typeof c;if(d!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(d!=="number"&&d!=="string")throw t.$_createError("array.sort.unsupported",e,{type:d},r,i);return d==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};ct.compare=function(t,e,n,r){return t===e?0:t===void 0?1:e===void 0?-1:t===null?r:e===null?n:null}});var cC=m((yV,uC)=>{"use strict";var sC=Me(),gj=tr(),oC=Qe(),aC=i_(),a_={};a_.isBool=function(t){return typeof t=="boolean"};uC.exports=gj.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(t,{schema:e}){if(typeof t!="boolean"){if(typeof t=="string"){let n=e._flags.sensitive?t:t.toLowerCase();t=n==="true"?!0:n==="false"?!1:t}return typeof t!="boolean"&&(t=e.$_terms.truthy&&e.$_terms.truthy.has(t,null,null,!e._flags.sensitive)||(e.$_terms.falsy&&e.$_terms.falsy.has(t,null,null,!e._flags.sensitive)?!1:t)),{value:t}}},validate(t,{error:e}){if(typeof t!="boolean")return{value:t,errors:e("boolean.base")}},rules:{truthy:{method(...t){oC.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new aC;for(let n=0;n<t.length;++n){let r=t[n];sC(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){oC.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new aC;for(let n=0;n<t.length;++n){let r=t[n];sC(r!==void 0,"Cannot call falsy with undefined"),e.$_terms.falsy.add(r)}return e}},sensitive:{method(t=!0){return this.$_setFlag("sensitive",t)}}},cast:{number:{from:a_.isBool,to(t,e){return t?1:0}},string:{from:a_.isBool,to(t,e){return t?"true":"false"}}},manifest:{build(t,e){return e.truthy&&(t=t.truthy(...e.truthy)),e.falsy&&(t=t.falsy(...e.falsy)),t}},messages:{"boolean.base":"{{#label}} must be a boolean"}})});var fC=m((bV,dC)=>{"use strict";var lC=Me(),mj=tr(),hC=Qe(),yj=Ki(),wr={};wr.isDate=function(t){return t instanceof Date};dC.exports=mj.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:wr.parse(t,e._flags.format)||t}}},validate(t,{schema:e,error:n,prefs:r}){if(t instanceof Date&&!isNaN(t.getTime()))return;let i=e._flags.format;return!r.convert||!i||typeof t!="string"?{value:t,errors:n("date.base")}:{value:t,errors:n("date.format",{format:i})}},rules:{compare:{method:!1,validate(t,e,{date:n},{name:r,operator:i,args:s}){let o=n==="now"?Date.now():n.getTime();return hC.compare(t.getTime(),o,i)?t:e.error("date."+r,{limit:s.date,value:t})},args:[{name:"date",ref:!0,normalize:t=>t==="now"?t:wr.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return lC(["iso","javascript","unix"].includes(t),"Unknown date format",t),this.$_setFlag("format",t)}},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{date:t},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{date:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{date:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{date:t},operator:">="})}},timestamp:{method(t="javascript"){return lC(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:wr.isDate,to(t,e){return t.getTime()}},string:{from:wr.isDate,to(t,{prefs:e}){return yj.date(t,e)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}});wr.parse=function(t,e){if(t instanceof Date)return t;if(typeof t!="string"&&(isNaN(t)||!isFinite(t))||/^\s*$/.test(t))return null;if(e==="iso")return hC.isIsoDate(t)?wr.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return wr.date(1*t);if(e==="unix")return wr.date(1e3*t);if(typeof n=="string")return null}return wr.date(t)};wr.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var bC=m((_V,yC)=>{"use strict";var id=Me(),gC=hn(),mC=Qh(),pC=ks(),sd={};yC.exports=function(t,e,n={}){if(id(t&&typeof t=="object","Invalid defaults value: must be an object"),id(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),id(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return sd.applyToDefaultsWithShallow(t,e,n);let r=gC(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return mC(r,e,{nullOverride:i,mergeArrays:!1})};sd.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;id(Array.isArray(r),"Invalid keys");let i=new Map,s=e===!0?null:new Set;for(let u of r){u=Array.isArray(u)?u:u.split(".");let c=pC(t,u);c&&typeof c=="object"?i.set(c,s&&pC(e,u)||c):s&&s.add(u)}let o=gC(t,{},i);if(!s)return o;for(let u of s)sd.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return mC(o,e,{nullOverride:a,mergeArrays:!1})};sd.reachCopy=function(t,e,n){for(let s of n){if(!(s in e))return;let o=e[s];if(typeof o!="object"||o===null)return;e=o}let r=e,i=t;for(let s=0;s<n.length-1;++s){let o=n[s];typeof i[o]!="object"&&(i[o]={}),i=i[o]}i[n[n.length-1]]=r}});var SC=m(vC=>{"use strict";var Is=Me(),_C={};vC.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(t,e){e=e||{};let n=[].concat(e.before||[]),r=[].concat(e.after||[]),i=e.group||"?",s=e.sort||0;Is(!n.includes(i),`Item cannot come before itself: ${i}`),Is(!n.includes("?"),"Item cannot come before unassociated items"),Is(!r.includes(i),`Item cannot come after itself: ${i}`),Is(!r.includes("?"),"Item cannot come after unassociated items"),Array.isArray(t)||(t=[t]);for(let o of t){let a={seq:this._items.length,sort:s,before:n,after:r,group:i,node:o};this._items.push(a)}if(!e.manual){let o=this._sort();Is(o,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(t){Array.isArray(t)||(t=[t]);for(let n of t)if(n)for(let r of n._items)this._items.push(Object.assign({},r));this._items.sort(_C.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Is(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Is(t,"sort created a dependencies error"),this.nodes}_sort(){let t={},e=Object.create(null),n=Object.create(null);for(let a of this._items){let u=a.seq,c=a.group;n[c]=n[c]||[],n[c].push(u),t[u]=a.before;for(let l of a.after)e[l]=e[l]||[],e[l].push(u)}for(let a in t){let u=[];for(let c in t[a]){let l=t[a][c];n[l]=n[l]||[],u.push(...n[l])}t[a]=u}for(let a in e)if(n[a])for(let u of n[a])t[u].push(...e[a]);let r={};for(let a in t){let u=t[a];for(let c of u)r[c]=r[c]||[],r[c].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let c=0;c<this._items.length;++c){if(i[c]===!0)continue;r[c]||(r[c]=[]);let l=r[c].length,h=0;for(let d=0;d<l;++d)i[r[c][d]]&&++h;if(h===l){u=c;break}}}u!==null&&(i[u]=!0,s.push(u))}if(s.length!==this._items.length)return!1;let o={};for(let a of this._items)o[a.seq]=a;this._items=[],this.nodes=[];for(let a of s){let u=o[a];this.nodes.push(u.node),this._items.push(u)}return!0}};_C.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var c_=m((TV,EC)=>{"use strict";var bj=bC(),rr=Me(),TC=hn(),_j=SC(),vj=tr(),on=Qe(),u_=Rs(),Sj=li(),wC=hi(),od=Ki(),le={renameDefaults:{alias:!1,multiple:!1,override:!1}};EC.exports=vj.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args(t,e){return t.keys(e)},validate(t,{schema:e,error:n,state:r,prefs:i}){if(!t||typeof t!==e.$_property("typeof")||Array.isArray(t))return{value:t,errors:n("object.base",{type:e.$_property("typeof")})};if(!e.$_terms.renames&&!e.$_terms.dependencies&&!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.externals)return;t=le.clone(t,i);let s=[];if(e.$_terms.renames&&!le.rename(e,t,r,i,s))return{value:t,errors:s};if(!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.dependencies)return{value:t,errors:s};let o=new Set(Object.keys(t));if(e.$_terms.keys){let a=[t,...r.ancestors];for(let u of e.$_terms.keys){let c=u.key,l=t[c];o.delete(c);let h=r.localize([...r.path,c],a,u),d=u.schema.$_validate(l,h,i);if(d.errors){if(i.abortEarly)return{value:t,errors:d.errors};d.value!==void 0&&(t[c]=d.value),s.push(...d.errors)}else u.schema._flags.result==="strip"||d.value===void 0&&l!==void 0?delete t[c]:d.value!==void 0&&(t[c]=d.value)}}if(o.size||e._flags._hasPatternMatch){let a=le.unknown(e,t,o,s,r,i);if(a)return a}if(e.$_terms.dependencies)for(let a of e.$_terms.dependencies){if(a.key!==null&&le.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=le.dependencies[a.rel](e,a,t,r,i);if(u){let c=e.$_createError(u.code,t,u.context,r,i);if(i.abortEarly)return{value:t,errors:c};s.push(c)}}return{value:t,errors:s}},rules:{and:{method(...t){return on.verifyFlat(t,"and"),le.dependency(this,"and",null,t)}},append:{method(t){return t==null||Object.keys(t).length===0?this:this.keys(t)}},assert:{method(t,e,n){od.isTemplate(t)||(t=u_.ref(t)),rr(n===void 0||typeof n=="string","Message must be a string"),e=this.$_compile(e,{appendPath:!0});let r=this.$_addRule({name:"assert",args:{subject:t,schema:e,message:n}});return r.$_mutateRegister(t),r.$_mutateRegister(e),r},validate(t,{error:e,prefs:n,state:r},{subject:i,schema:s,message:o}){let a=i.resolve(t,r,n),u=wC.isRef(i)?i.absolute(r):[];return s.$_match(a,r.localize(u,[t,...r.ancestors],s),n)?t:e("object.assert",{subject:i,message:o})},args:["subject","schema","message"],multi:!0},instance:{method(t,e){return rr(typeof t=="function","constructor must be a function"),e=e||t.name,this.$_addRule({name:"instance",args:{constructor:t,name:e}})},validate(t,e,{constructor:n,name:r}){return t instanceof n?t:e.error("object.instance",{type:r,value:t})},args:["constructor","name"]},keys:{method(t){rr(t===void 0||typeof t=="object","Object schema must be a valid object"),rr(!on.isSchema(t),"Object schema cannot be a joi schema");let e=this.clone();if(!t)e.$_terms.keys=null;else if(!Object.keys(t).length)e.$_terms.keys=new le.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new le.Keys;for(let n in t)on.tryWithPath(()=>e.$_terms.keys.push({key:n,schema:this.$_compile(t[n])}),n)}return e.$_mutateRebuild()}},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return on.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:on.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},nand:{method(...t){return on.verifyFlat(t,"nand"),le.dependency(this,"nand",null,t)}},or:{method(...t){return on.verifyFlat(t,"or"),le.dependency(this,"or",null,t)}},oxor:{method(...t){return le.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),rr(e!==void 0,"Invalid rule"),on.assertOptions(n,["fallthrough","matches"]),r&&rr(!t.flags.includes("g")&&!t.flags.includes("y"),"pattern should not use global or sticky mode"),e=this.$_compile(e,{appendPath:!0});let i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];let s={[r?"regex":"schema"]:t,rule:e};return n.matches&&(s.matches=this.$_compile(n.matches),s.matches.type!=="array"&&(s.matches=s.matches.$_root.array().items(s.matches)),i.$_mutateRegister(s.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(s.fallthrough=!0),i.$_terms.patterns.push(s),i.$_mutateRegister(e),i}},ref:{method(){return this.$_addRule("ref")},validate(t,e){return wC.isRef(t)?t:e.error("object.refType",{value:t})}},regex:{method(){return this.$_addRule("regex")},validate(t,e){return t instanceof RegExp?t:e.error("object.regex",{value:t})}},rename:{method(t,e,n={}){rr(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),rr(typeof e=="string"||e instanceof od,"Invalid rename to argument"),rr(e!==t,"Cannot rename key to same name:",t),on.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)rr(i.from!==t,"Cannot rename the same key multiple times");return e instanceof od&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:bj(le.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return on.isSchema(t)&&(n==="any"||t.type===n)?t:e.error("object.schema",{type:n})}},unknown:{method(t){return this.$_setFlag("unknown",t!==!1)}},with:{method(t,e,n={}){return le.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return le.dependency(this,"without",t,e,n)}},xor:{method(...t){return on.verifyFlat(t,"xor"),le.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=on.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new _j.Sorter;for(let n of t.$_terms.keys)on.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new le.Keys(...e.nodes)}},manifest:{build(t,e){if(e.keys&&(t=t.keys(e.keys)),e.dependencies)for(let{rel:n,key:r=null,peers:i,options:s}of e.dependencies)t=le.dependency(t,n,r,i,s);if(e.patterns)for(let{regex:n,schema:r,rule:i,fallthrough:s,matches:o}of e.patterns)t=t.pattern(n||r,i,{fallthrough:s,matches:o});if(e.renames)for(let{from:n,to:r,options:i}of e.renames)t=t.rename(n,r,i);return t}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}});le.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return TC(t,{shallow:!0});let r=Object.create(Object.getPrototypeOf(t));return Object.assign(r,t),r}let n=function(...r){return t.apply(this,r)};return n.prototype=TC(t.prototype),Object.defineProperty(n,"name",{value:t.name,writable:!1}),Object.defineProperty(n,"length",{value:t.length,writable:!1}),Object.assign(n,t),n};le.dependency=function(t,e,n,r,i){rr(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),on.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=on.default(i.separator,"."),o=[];for(let u of r)rr(typeof u=="string",e,"peers must be strings"),o.push(u_.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=u_.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new le.Dependency(e,n,o,r,i)),a};le.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=le.isPresent(e.options);for(let c of e.peers)u(c.resolve(n,r,i,null,{shadow:!1}))===!1?s.push(c.key):o.push(c.key);if(s.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:le.keysToLabels(t,o),missing:s,missingWithLabels:le.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let c of e.peers)o(c.resolve(n,r,i,null,{shadow:!1}))&&s.push(c.key);if(s.length!==e.peers.length)return;let a=e.paths[0],u=e.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:le.keysToLabels(t,a),peers:u,peersWithLabels:le.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(!s.length||s.length===1)return;let a={peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=le.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:e.key.key,mainWithLabel:le.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:le.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return{code:"object.without",context:{main:e.key.key,mainWithLabel:le.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:le.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(s.length===1)return;let a={peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=le.keysToLabels(t,s),{code:"object.xor",context:a})}};le.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};le.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};le.rename=function(t,e,n,r,i){let s={};for(let o of t.$_terms.renames){let a=[],u=typeof o.from!="string";if(!u)Object.prototype.hasOwnProperty.call(e,o.from)&&(e[o.from]!==void 0||!o.options.ignoreUndefined)&&a.push(o);else for(let c in e){if(e[c]===void 0&&o.options.ignoreUndefined||c===o.to)continue;let l=o.from.exec(c);l&&a.push({from:c,to:o.to,match:l})}for(let c of a){let l=c.from,h=c.to;if(h instanceof od&&(h=h.render(e,n,r,c.match)),l!==h){if(!o.options.multiple&&s[h]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:h,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,h)&&!o.options.override&&!s[h]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:h,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[h]:e[h]=e[l],s[h]=!0,o.options.alias||delete e[l]}}}return!0};le.unknown=function(t,e,n,r,i,s){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(l=>{if(l.matches)return a=!0,[]}),c=[e,...i.ancestors];for(let l of n){let h=e[l],d=[...i.path,l];for(let g=0;g<t.$_terms.patterns.length;++g){let y=t.$_terms.patterns[g];if(y.regex){let A=y.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${g}`,A?"pass":"error"),!A)continue}else if(!y.schema.$_match(l,i.nest(y.schema,`pattern.${g}`),s))continue;n.delete(l);let b=i.localize(d,c,{schema:y.rule,key:l}),C=y.rule.$_validate(h,b,s);if(C.errors){if(s.abortEarly)return{value:e,errors:C.errors};r.push(...C.errors)}if(y.matches&&u[g].push(l),e[l]=C.value,!y.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let h=u[l];if(!h)continue;let d=t.$_terms.patterns[l].matches,g=i.localize(i.path,c,d),y=d.$_validate(h,g,s);if(y.errors){let b=Sj.details(y.errors,{override:!1});b.matches=h;let C=t.$_createError("object.pattern.match",e,b,i,s);if(s.abortEarly)return{value:e,errors:C};r.push(C)}}}if(!n.size||!t.$_terms.keys&&!t.$_terms.patterns)return;if(s.stripUnknown&&typeof t._flags.unknown>"u"||s.skipFunctions){let a=s.stripUnknown?s.stripUnknown===!0?!0:!!s.stripUnknown.objects:!1;for(let u of n)a?(delete e[u],n.delete(u)):typeof e[u]=="function"&&n.delete(u)}if(!on.default(t._flags.unknown,s.allowUnknown))for(let a of n){let u=i.localize([...i.path,a],[]),c=t.$_createError("object.unknown",e[a],{child:a},u,s,{flags:!1});if(s.abortEarly)return{value:e,errors:c};r.push(c)}};le.Dependency=class{constructor(t,e,n,r,i){this.rel=t,this.key=e,this.peers=n,this.paths=r,this.options=i}describe(){let t={rel:this.rel,peers:this.paths};return this.key!==null&&(t.key=this.key.key),this.peers[0].separator!=="."&&(t.options={...t.options,separator:this.peers[0].separator}),this.options.isPresent&&(t.options={...t.options,isPresent:this.options.isPresent}),t}};le.Keys=class extends Array{concat(t){let e=this.slice(),n=new Map;for(let r=0;r<e.length;++r)n.set(e[r].key,r);for(let r of t){let i=r.key,s=n.get(i);s!==void 0?e[s]={key:i,schema:e[s].schema.concat(r.schema)}:e.push(r)}return e}}});var AC=m((xV,xC)=>{"use strict";var l_=Me(),Tj=c_();xC.exports=Tj.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return l_(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:t}})},validate(t,e,{n}){return t.length===n?t:e.error("function.arity",{n})}},class:{method(){return this.$_addRule("class")},validate(t,e){return/^\s*class\s/.test(t.toString())?t:e.error("function.class",{value:t})}},minArity:{method(t){return l_(Number.isSafeInteger(t)&&t>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:t}})},validate(t,e,{n}){return t.length>=n?t:e.error("function.minArity",{n})}},maxArity:{method(t){return l_(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:t}})},validate(t,e,{n}){return t.length<=n?t:e.error("function.maxArity",{n})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})});var CC=m((AV,kC)=>{"use strict";var gi=Me(),wj=tr(),Ej=Qe(),xj=Rs(),Aj=li(),mi={};kC.exports=wj.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args(t,e){return t.ref(e)},validate(t,{schema:e,state:n,prefs:r}){gi(e.$_terms.link,"Uninitialized link schema");let i=mi.generate(e,t,n,r),s=e.$_terms.link[0].ref;return i.$_validate(t,n.nest(i,`link:${s.display}:${i.type}`),r)},generate(t,e,n,r){return mi.generate(t,e,n,r)},rules:{ref:{method(t){gi(!this.$_terms.link,"Cannot reinitialize schema"),t=xj.ref(t),gi(t.type==="value"||t.type==="local","Invalid reference type:",t.type),gi(t.type==="local"||t.ancestor==="root"||t.ancestor>0,"Link cannot reference itself");let e=this.clone();return e.$_terms.link=[{ref:t}],e}},relative:{method(t=!0){return this.$_setFlag("relative",t)}}},overrides:{concat(t){gi(this.$_terms.link,"Uninitialized link schema"),gi(Ej.isSchema(t),"Invalid schema object"),gi(t.type!=="link","Cannot merge type link with another link");let e=this.clone();return e.$_terms.whens||(e.$_terms.whens=[]),e.$_terms.whens.push({concat:t}),e.$_mutateRebuild()}},manifest:{build(t,e){return gi(e.link,"Invalid link description missing link"),t.ref(e.link)}}});mi.generate=function(t,e,n,r){let i=n.mainstay.links.get(t);if(i)return i._generate(e,n,r).schema;let s=t.$_terms.link[0].ref,{perspective:o,path:a}=mi.perspective(s,n);mi.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{mi.assert(!1,"to non-existing schema",s,t,n,r)}return mi.assert(i.type!=="link","which is another link",s,t,n,r),t._flags.relative||n.mainstay.links.set(t,i),i._generate(e,n,r).schema};mi.perspective=function(t,e){if(t.type==="local"){for(let{schema:n,key:r}of e.schemas){if((n._flags.id||r)===t.path[0])return{perspective:n,path:t.path.slice(1)};if(n.$_terms.shared){for(let s of n.$_terms.shared)if(s._flags.id===t.path[0])return{perspective:s,path:t.path.slice(1)}}}return{perspective:null,path:null}}return t.ancestor==="root"?{perspective:e.schemas[e.schemas.length-1].schema,path:t.path}:{perspective:e.schemas[t.ancestor]&&e.schemas[t.ancestor].schema,path:t.path}};mi.assert=function(t,e,n,r,i,s){t||gi(!1,`"${Aj.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var RC=m((kV,OC)=>{"use strict";var h_=Me(),kj=tr(),d_=Qe(),jn={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){let e=t.toString(),n=e.indexOf("."),r=e.indexOf("e");return(n<0?0:(r<0?e.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(e.slice(r+1))))}};OC.exports=kj.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(jn.numberRx))return;t=t.trim();let i={value:parseFloat(t)};if(i.value===0&&(i.value=0),!e._flags.unsafe)if(t.match(/e/i)){if(jn.extractSignificantDigits(t)!==jn.extractSignificantDigits(String(i.value)))return i.errors=n("number.unsafe"),i}else{let s=i.value.toString();if(s.match(/e/i))return i;if(s!==jn.normalizeDecimal(t))return i.errors=n("number.unsafe"),i}return i}},validate(t,{schema:e,error:n,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!d_.isNumber(t))return{value:t,errors:n("number.base")};let i={value:t};if(r.convert){let s=e.$_getRule("precision");if(s){let o=Math.pow(10,s.args.limit);i.value=Math.round(i.value*o)/o}}return i.value===0&&(i.value=0),!e._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(i.errors=n("number.unsafe")),i},rules:{compare:{method:!1,validate(t,e,{limit:n},{name:r,operator:i,args:s}){return d_.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:d_.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate(t,e){return Math.trunc(t)-t===0?t:e.error("number.integer")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){let e=typeof t=="number"?jn.decimalPlaces(t):null,n=Math.pow(10,e);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:e,pfactor:n}})},validate(t,e,{base:n,baseDecimalPlace:r,pfactor:i},s){return jn.decimalPlaces(t)>r?e.error("number.multiple",{multiple:s.args.base,value:t}):Math.round(i*t)%Math.round(i*n)===0?t:e.error("number.multiple",{multiple:s.args.base,value:t})},args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate(t,e){return Number.isSafeInteger(t)&&t>=0&&t<=65535?t:e.error("number.port")}},positive:{method(){return this.sign("positive")}},precision:{method(t){return h_(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,e,{limit:n}){let r=t.toString().match(jn.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?t:e.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return h_(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate(t,e,{sign:n}){return n==="negative"&&t<0||n==="positive"&&t>0?t:e.error(`number.${n}`)}},unsafe:{method(t=!0){return h_(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to(t,e){return t.toString()}}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}});jn.extractSignificantDigits=function(t){return t.replace(jn.exponentialPartRegex,"").replace(jn.dotRegex,"").replace(jn.trailingZerosRegex,"").replace(jn.leadingSignAndZerosRegex,"")};jn.normalizeDecimal=function(t){return t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2"),t.includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}});var DC=m((CV,PC)=>{"use strict";var Cj=c_();PC.exports=Cj.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var f_=m(ad=>{"use strict";ad.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"};ad.code=function(t){return{code:t,error:ad.codes[t]}}});var p_=m(ud=>{"use strict";var Oj=require("url"),Er=f_(),Ji={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:Oj.URL||URL};ud.analyze=function(t,e={}){if(!t)return Er.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return Er.code("DOMAIN_TOO_LONG");if(!!Ji.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return Er.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(Ji.domainControlRx.test(t))return Er.code("DOMAIN_INVALID_CHARS");t=Ji.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||Ji.minDomainSegments,i=t.split(".");if(i.length<r)return Er.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return Er.code("DOMAIN_SEGMENTS_COUNT_MAX");let s=e.tlds;if(s){let o=i[i.length-1].toLowerCase();if(s.deny&&s.deny.has(o)||s.allow&&!s.allow.has(o))return Er.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return Er.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return Er.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!Ji.domainSegmentRx.test(a))return Er.code("DOMAIN_INVALID_CHARS")}else if(!Ji.tldSegmentRx.test(a))return Er.code("DOMAIN_INVALID_TLDS_CHARS")}return null};ud.isValid=function(t,e){return!ud.analyze(t,e)};Ji.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new Ji.URL(`http://${t}`).host}catch{return t}}});var IC=m(g_=>{"use strict";var Rj=require("util"),Pj=p_(),zr=f_(),fn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(Rj.TextEncoder||TextEncoder)};g_.analyze=function(t,e){return fn.email(t,e)};g_.isValid=function(t,e){return!fn.email(t,e)};fn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return zr.code("EMPTY_STRING");let n=!fn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return zr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?zr.code("MULTIPLE_AT_CHAR"):zr.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return zr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return zr.code("ADDRESS_TOO_LONG");if(fn.encoder.encode(i).length>64)return zr.code("LOCAL_TOO_LONG")}return fn.local(i,n)||Pj.analyze(s,e)};fn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return zr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!fn.atextRx.test(r))return zr.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(fn.atextRx.test(i))continue;let s=fn.binary(i);if(!fn.atomRx.test(s))return zr.code("INVALID_LOCAL_CHARS")}}};fn.binary=function(t){return Array.from(fn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};fn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;fn.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))});var m_=m((DV,MC)=>{"use strict";MC.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var b_=m(y_=>{"use strict";var cd=Me(),Dj=m_(),Yt={};Yt.generate=function(){let t={},e="\\dA-Fa-f",n="["+e+"]",r="\\w-\\.~",i="!\\$&'\\(\\)\\*\\+,;=",s="%"+e,o=r+s+i+":@",a="["+o+"]",u="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";t.ipv4address="(?:"+u+"\\.){3}"+u;let c=n+"{1,4}",l="(?:"+c+":"+c+"|"+t.ipv4address+")",h="(?:"+c+":){6}"+l,d="::(?:"+c+":){5}"+l,g="(?:"+c+")?::(?:"+c+":){4}"+l,y="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,b="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,C="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,A="(?:(?:"+c+":){0,4}"+c+")?::"+l,w="(?:(?:"+c+":){0,5}"+c+")?::"+c,T="(?:(?:"+c+":){0,6}"+c+")?::";t.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",t.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",t.ipv6address="(?:"+h+"|"+d+"|"+g+"|"+y+"|"+b+"|"+C+"|"+A+"|"+w+"|"+T+")",t.ipvFuture="v"+n+"+\\.["+r+i+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let v="["+r+s+i+":]*",L="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",R="["+r+s+i+"]{1,255}",B="(?:"+L+"|"+t.ipv4address+"|"+R+")",ee="\\d*",re="(?:"+v+"@)?"+B+"(?::"+ee+")?",W="(?:"+v+"@)?("+B+")(?::"+ee+")?",O=a+"*",M=a+"+",N="["+r+s+i+"@]+",j="",de="(?:\\/"+O+")*",ce="\\/(?:"+M+de+")?",jt=M+de,_t=N+de,Fe="(?:\\/\\/\\/"+O+de+")";return t.hierPart="(?:(?:\\/\\/"+re+de+")|"+ce+"|"+jt+"|"+Fe+")",t.hierPartCapture="(?:(?:\\/\\/"+W+de+")|"+ce+"|"+jt+")",t.relativeRef="(?:(?:\\/\\/"+re+de+")|"+ce+"|"+_t+"|"+j+")",t.relativeRefCapture="(?:(?:\\/\\/"+W+de+")|"+ce+"|"+_t+"|"+j+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};Yt.rfc3986=Yt.generate();y_.ip={v4Cidr:Yt.rfc3986.ipv4Cidr,v6Cidr:Yt.rfc3986.ipv6Cidr,ipv4:Yt.rfc3986.ipv4address,ipv6:Yt.rfc3986.ipv6address,ipvfuture:Yt.rfc3986.ipvFuture};Yt.createRegex=function(t){let e=Yt.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Yt.wrap(i+r);let s="";if(t.scheme){cd(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let c=[].concat(t.scheme);cd(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let h=0;h<c.length;++h){let d=c[h];cd(d instanceof RegExp||typeof d=="string","scheme at position "+h+" must be a RegExp or String"),d instanceof RegExp?l.push(d.source.toString()):(cd(e.schemeRegex.test(d),"scheme at position "+h+" must be a valid scheme"),l.push(Dj(d)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return Yt.wrap(u+r,s)};Yt.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Yt.uriRegex=Yt.createRegex({});y_.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Yt.createRegex(t):Yt.uriRegex}});var NC=m(LC=>{"use strict";var zo=Me(),Eu=b_();LC.regex=function(t={}){zo(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";zo(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),zo(t.version===void 0||typeof t.version=="string"||Array.isArray(t.version),"options.version must be a string or an array of string");let n=t.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),zo(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)zo(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),zo(["ipv4","ipv6","ipvfuture"].includes(n[o]),"options.version contains unknown version "+n[o]+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));let i=`(?:${n.map(o=>{if(e==="forbidden")return Eu.ip[o];let a=`\\/${o==="ipv4"?Eu.ip.v4Cidr:Eu.ip.v6Cidr}`;return e==="required"?`${Eu.ip[o]}${a}`:`${Eu.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var FC=m((LV,jC)=>{"use strict";var qC={};qC.tlds=["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"];jC.exports=new Set(qC.tlds.map(t=>t.toLowerCase()))});var HC=m((NV,UC)=>{"use strict";var Be=Me(),ld=p_(),Ij=IC(),WC=NC(),$C=m_(),BC=FC(),Mj=b_(),Lj=tr(),pn=Qe(),Pe={tlds:BC instanceof Set?{tlds:{allow:BC,deny:null}}:!1,base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:WC.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};UC.exports=Lj.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(t,{schema:e,state:n,prefs:r}){let i=e.$_getRule("normalize");i&&(t=t.normalize(i.args.form));let s=e.$_getRule("case");s&&(t=s.args.direction==="upper"?t.toLocaleUpperCase():t.toLocaleLowerCase());let o=e.$_getRule("trim");if(o&&o.args.enabled&&(t=t.trim()),e.$_terms.replacements)for(let u of e.$_terms.replacements)t=t.replace(u.pattern,u.replacement);let a=e.$_getRule("hex");if(a&&a.args.options.byteAligned&&t.length%2!==0&&(t=`0${t}`),e.$_getRule("isoDate")){let u=Pe.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(pn.isResolvable(c)&&(c=c.resolve(t,n,r),!pn.limit(c)))return{value:t,errors:e.$_createError("any.ref",c,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,c)}}return{value:t}}},validate(t,{schema:e,error:n}){if(typeof t!="string")return{value:t,errors:n("string.base")};if(t===""){let r=e.$_getRule("min");return r&&r.args.limit===0?void 0:{value:t,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate(t,e){return/^[a-zA-Z0-9]+$/.test(t)?t:e.error("string.alphanum")}},base64:{method(t={}){return pn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Be(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Be(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Pe.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Be(["lower","upper"].includes(t),"Invalid case:",t),this.$_addRule({name:"case",args:{direction:t}})},validate(t,e,{direction:n}){return n==="lower"&&t===t.toLocaleLowerCase()||n==="upper"&&t===t.toLocaleUpperCase()?t:e.error(`string.${n}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(t,e){let n=t.length,r=0,i=1;for(;n--;){let s=t.charAt(n)*i;r=r+(s-(s>9)*9),i=i^3}return r>0&&r%10===0?t:e.error("string.creditCard")}},dataUri:{method(t={}){return pn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Be(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Pe.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Pe.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&pn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Pe.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return ld.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){pn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Be(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Pe.addressOptions(t),n=new RegExp(`\\s*[${t.separator?$C(t.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:t},regex:n,address:e})},validate(t,e,{options:n},{regex:r,address:i}){let s=n.multiple?t.split(r):[t],o=[];for(let a of s)Ij.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){pn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Be(i.length>=1,"version must have at least 1 valid version specified");let s=new Set;for(let o=0;o<i.length;++o){let a=i[o];Be(typeof a=="string","version at position "+o+" must be a string");let u=Pe.guidVersions[a.toLowerCase()];Be(u,"version at position "+o+" must be one of "+Object.keys(Pe.guidVersions).join(", ")),Be(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Be(Pe.guidSeparators.has(t.separator),'separator must be one of true, false, "-", or ":"');let n=t.separator===void 0?"[:-]?":t.separator===!0?"[:-]":t.separator===!1?"[]?":`\\${t.separator}`,r=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${e||"0-9A-F"}][0-9A-F]{3}\\2?[${e?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:t},regex:r})},validate(t,e,n,{regex:r}){let i=r.exec(t);return!i||Pe.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return pn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Be(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Be(typeof t.prefix=="boolean"||t.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:t}})},validate(t,e,{options:n}){return(n.prefix==="optional"?Pe.hexRegex.withOptionalPrefix:n.prefix===!0?Pe.hexRegex.withPrefix:Pe.hexRegex.withoutPrefix).test(t)?n.byteAligned&&t.length%2!==0?e.error("string.hexAlign"):t:e.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate(t,e){return ld.isValid(t,{minDomainSegments:1})||Pe.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){pn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=WC.regex(t),i=t.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:e,version:i}},regex:r})},validate(t,e,{options:n},{regex:r}){return r.test(t)?t:n.version?e.error("string.ipVersion",{value:t,cidr:n.cidr,version:n.version}):e.error("string.ip",{value:t,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(t,{error:e}){return Pe.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Pe.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Pe.length(this,"length",t,"=",e)},validate(t,e,{limit:n,encoding:r},{name:i,operator:s,args:o}){let a=r?Buffer&&Buffer.byteLength(t,r):t.length;return pn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:pn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Pe.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Pe.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Be(Pe.normalizationForms.includes(t),"normalization form must be one of "+Pe.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:t}})},validate(t,{error:e},{form:n}){return t===t.normalize(n)?t:e("string.normalize",{value:t,form:n})},convert:!0},pattern:{alias:"regex",method(t,e={}){Be(t instanceof RegExp,"regex must be a RegExp"),Be(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),pn.assertOptions(e,["invert","name"]);let n=["string.pattern",e.invert?".invert":"",e.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:t,options:e},errorCode:n})},validate(t,e,{regex:n,options:r},{errorCode:i}){return n.test(t)^r.invert?t:e.error(i,{name:r.name,regex:n,value:t})},args:["regex","options"],multi:!0},replace:{method(t,e){typeof t=="string"&&(t=new RegExp($C(t),"g")),Be(t instanceof RegExp,"pattern must be a RegExp"),Be(typeof e=="string","replacement must be a String");let n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:t,replacement:e}),n}},token:{method(){return this.$_addRule("token")},validate(t,e){return/^\w+$/.test(t)?t:e.error("string.token")}},trim:{method(t=!0){return Be(typeof t=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:t}})},validate(t,e,{enabled:n}){return!n||t===t.trim()?t:e.error("string.trim")},convert:!0},truncate:{method(t=!0){return Be(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){pn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&pn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=Mj.regex(t),r=t.domain?Pe.addressOptions(t.domain):null;return this.$_addRule({name:"uri",args:{options:t},regex:e,domain:r,scheme:n})},validate(t,e,{options:n},{regex:r,domain:i,scheme:s}){if(["http:/","https:/"].includes(t))return e.error("string.uri");let o=r.exec(t);if(!o&&e.prefs.convert&&n.encodeUri){let a=encodeURI(t);o=r.exec(a),o&&(t=a)}if(o){let a=o[1]||o[2];return i&&(!n.allowRelative||a)&&!ld.isValid(a,i)?e.error("string.domain",{value:a}):t}return n.relativeOnly?e.error("string.uriRelativeOnly"):n.scheme?e.error("string.uriCustomScheme",{scheme:s,value:t}):e.error("string.uri")}}},manifest:{build(t,e){if(e.replacements)for(let{pattern:n,replacement:r}of e.replacements)t=t.replace(n,r);return t}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}});Pe.addressOptions=function(t){if(!t)return Pe.tlds||t;if(Be(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Be(t.maxDomainSegments===void 0||Number.isSafeInteger(t.maxDomainSegments)&&t.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),t.tlds===!1)return t;if(t.tlds===!0||t.tlds===void 0)return Be(Pe.tlds,"Built-in TLD list disabled"),Object.assign({},t,Pe.tlds);Be(typeof t.tlds=="object","tlds must be true, false, or an object");let e=t.tlds.deny;if(e)return Array.isArray(e)&&(t=Object.assign({},t,{tlds:{deny:new Set(e)}})),Be(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Be(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Pe.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Be(Pe.tlds,"Built-in TLD list disabled"),Object.assign({},t,Pe.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Be(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Pe.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Pe.validateTlds=function(t,e){for(let n of t)Be(ld.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Pe.isoDate=function(t){if(!pn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Pe.length=function(t,e,n,r,i){return Be(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var zC=m((qV,GC)=>{"use strict";var hd=Me(),Nj=tr(),__={};__.Map=class extends Map{slice(){return new __.Map(this)}};GC.exports=Nj.extend({type:"symbol",terms:{map:{init:new __.Map}},coerce:{method(t,{schema:e,error:n}){let r=e.$_terms.map.get(t);return r&&(t=r),!e._flags.only||typeof t=="symbol"?{value:t}:{value:t,errors:n("symbol.map",{map:e.$_terms.map})}}},validate(t,{error:e}){if(typeof t!="symbol")return{value:t,errors:e("symbol.base")}},rules:{map:{method(t){t&&!t[Symbol.iterator]&&typeof t=="object"&&(t=Object.entries(t)),hd(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){hd(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;hd(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),hd(typeof s=="symbol","Value must be a Symbol"),e.$_terms.map.set(i,s),n.push(s)}return e.valid(...n)}}},manifest:{build(t,e){return e.map&&(t=t.map(e.map)),t}},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})});var XC=m((FV,KC)=>{"use strict";var qj=Me(),jj=tr(),VC=Qe();KC.exports=jj.extend({type:"binary",coerce:{from:["string","object"],method(t,{schema:e}){if(typeof t=="string"||t!==null&&t.type==="Buffer")try{return{value:Buffer.from(t,e._flags.encoding)}}catch{}}},validate(t,{error:e}){if(!Buffer.isBuffer(t))return{value:t,errors:e("binary.base")}},rules:{encoding:{method(t){return qj(Buffer.isEncoding(t),"Invalid encoding:",t),this.$_setFlag("encoding",t)}},length:{method(t){return this.$_addRule({name:"length",method:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return VC.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:VC.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}}},cast:{string:{from:t=>Buffer.isBuffer(t),to(t,e){return t.toString()}}},messages:{"binary.base":"{{#label}} must be a buffer or a string","binary.length":"{{#label}} must be {{#limit}} bytes","binary.max":"{{#label}} must be less than or equal to {{#limit}} bytes","binary.min":"{{#label}} must be at least {{#limit}} bytes"}})});var Kh=m(($V,ZC)=>{"use strict";var Ls=Me(),Fj=hn(),$j=Kb(),Ms=Qe(),Bj=Rs(),S_=li(),Wj=Xb(),YC=Qb(),v_=hi(),JC=Ki(),QC=e_(),dd,Mt={types:{alternatives:nC(),any:tr(),array:iC(),boolean:cC(),date:fC(),function:AC(),link:CC(),number:RC(),object:DC(),string:HC(),symbol:zC()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Mt.types.binary=XC());Mt.root=function(){let t={_types:new Set(Object.keys(Mt.types))};for(let e of t._types)t[e]=function(...n){return Ls(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Mt.generate(this,Mt.types[e],n)};for(let e of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])t[e]=function(...n){return this.any()[e](...n)};Object.assign(t,Mt.methods);for(let e in Mt.aliases){let n=Mt.aliases[e];t[e]=t[n]}return t.x=t.expression,QC.setup&&QC.setup(t),t};Mt.methods={ValidationError:S_.ValidationError,version:Ms.version,cache:$j.provider,assert(t,e,...n){Mt.assert(t,e,!0,n)},attempt(t,e,...n){return Mt.assert(t,e,!1,n)},build(t){return Ls(typeof YC.build=="function","Manifest functionality disabled"),YC.build(this,t)},checkPreferences(t){Ms.checkPreferences(t)},compile(t,e){return Bj.compile(this,t,e)},defaults(t){Ls(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Ls(Ms.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return Mt.generate(this,r,i)}}return e},expression(...t){return new JC(...t)},extend(...t){Ms.verifyFlat(t,"extend"),dd=dd||Vh(),Ls(t.length,"You need to provide at least one extension"),this.assert(t,dd.extensions);let e=Object.assign({},this);e._types=new Set(e._types);for(let n of t){typeof n=="function"&&(n=n(e)),this.assert(n,dd.extension);let r=Mt.expandExtension(n,e);for(let i of r){Ls(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=Wj.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Mt.generate(this,o,a)}}}return e},isError:S_.ValidationError.isError,isExpression:JC.isTemplate,isRef:v_.isRef,isSchema:Ms.isSchema,in(...t){return v_.in(...t)},override:Ms.symbols.override,ref(...t){return v_.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Mt.aliases)t[e]=this[e]();return t}};Mt.assert=function(t,e,n,r){let i=r[0]instanceof Error||typeof r[0]=="string"?r[0]:null,s=i!==null?r[1]:r[0],o=e.validate(t,Ms.preferences({errors:{stack:!0}},s||{})),a=o.error;if(!a)return o.value;if(i instanceof Error)throw i;let u=n&&typeof a.annotate=="function"?a.annotate():a.message;throw a instanceof S_.ValidationError||(a=Fj(a)),a.message=i?`${i} ${u}`:u,a};Mt.generate=function(t,e,n){return Ls(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Mt.expandExtension=function(t,e){if(typeof t.type=="string")return[t];let n=[];for(let r of e._types)if(t.type.test(r)){let i=Object.assign({},t);i.type=r,i.base=e[r](),n.push(i)}return n};ZC.exports=Mt.root()});var eO=m(ve=>{"use strict";var Uj=ve&&ve.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ve,"__esModule",{value:!0});ve.descriptionContainerSchema=ve.signatureSchema=ve.signatureDefinitionContainerSchema=ve.signatureDefinitionSchema=ve.signatureDefinitionFunctionSchema=ve.signatureDefinitionFunctionSchemaArg=ve.signatureDefinitionFunctionSchemaArgMultiTypes=ve.signatureDefinitionFunctionSchemaArgDefaultNumber=ve.signatureDefinitionFunctionSchemaArgDefaultString=ve.signatureDefinitionTypeSchema=ve.variationsSchema=void 0;var ie=Uj(Kh()),fd=Hi();ve.variationsSchema=ie.default.array().items(ie.default.alternatives(ie.default.string(),ie.default.number()));ve.signatureDefinitionTypeSchema=ie.default.alternatives(ie.default.string(),ie.default.object({type:ie.default.string().required(),keyType:ie.default.link("#SignatureDefinitionTypeSchema").optional(),valueType:ie.default.link("#SignatureDefinitionTypeSchema").optional()})).id("SignatureDefinitionTypeSchema");ve.signatureDefinitionFunctionSchemaArgDefaultString=ie.default.object({type:ie.default.string().valid(fd.SignatureDefinitionBaseType.String).required(),value:ie.default.string().allow("").required()});ve.signatureDefinitionFunctionSchemaArgDefaultNumber=ie.default.object({type:ie.default.string().valid(fd.SignatureDefinitionBaseType.Number).required(),value:ie.default.number().required()});ve.signatureDefinitionFunctionSchemaArgMultiTypes=ie.default.object({label:ie.default.string().required(),types:ie.default.array().items(ve.signatureDefinitionTypeSchema).required(),opt:ie.default.boolean().optional(),default:ie.default.alternatives(ve.signatureDefinitionFunctionSchemaArgDefaultString,ve.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});ve.signatureDefinitionFunctionSchemaArg=ie.default.object({label:ie.default.string().required(),type:ve.signatureDefinitionTypeSchema.required(),opt:ie.default.boolean().optional(),default:ie.default.alternatives(ve.signatureDefinitionFunctionSchemaArgDefaultString,ve.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});ve.signatureDefinitionFunctionSchema=ie.default.object({type:ie.default.string().valid(fd.SignatureDefinitionBaseType.Function).required(),description:ie.default.string().optional(),example:ie.default.string().optional(),isProtected:ie.default.boolean().optional(),arguments:ie.default.array().items(ie.default.alternatives(ve.signatureDefinitionFunctionSchemaArg,ve.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:ie.default.array().items(ve.signatureDefinitionTypeSchema).required(),variations:ve.variationsSchema.optional(),returnVariations:ve.variationsSchema.optional()});ve.signatureDefinitionSchema=ie.default.object({type:ve.signatureDefinitionTypeSchema.invalid(fd.SignatureDefinitionBaseType.Function).required(),description:ie.default.string().optional(),example:ie.default.string().optional(),isProtected:ie.default.boolean().optional(),variations:ve.variationsSchema.optional()});ve.signatureDefinitionContainerSchema=ie.default.object().pattern(ie.default.string(),ie.default.alternatives(ve.signatureDefinitionFunctionSchema,ve.signatureDefinitionSchema));ve.signatureSchema=ie.default.object({type:ie.default.string().required(),hidden:ie.default.boolean().optional(),extends:ie.default.string().optional(),definitions:ie.default.object().required()});ve.descriptionContainerSchema=ie.default.object({$meta:ie.default.object({description:ie.default.string().required(),example:ie.default.array().items(ie.default.string().allow("")).optional()}).optional()}).pattern(ie.default.string(),ie.default.object({description:ie.default.string().required(),example:ie.default.array().items(ie.default.string().allow("")).optional()}))});var x_=m(En=>{"use strict";var Vo=En&&En.__assign||function(){return Vo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Vo.apply(this,arguments)},Hj=En&&En.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Qi=En&&En.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},T_=En&&En.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Gj=En&&En.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(En,"__esModule",{value:!0});En.Signature=void 0;var w_=Gj(Kh()),E_=eO(),zj=Hi(),Vj=Gh(),Kj=$b(),Xj=function(){function t(e){var n,r,i;this._type=e.type,this._extends=(n=e.extends)!==null&&n!==void 0?n:null,this._descriptions={},this._definitions=(r=e.definitions)!==null&&r!==void 0?r:{},this._hidden=(i=e.hidden)!==null&&i!==void 0?i:!1}return t.parseDefinitions=function(e){var n,r;w_.default.assert(e,E_.signatureDefinitionContainerSchema);var i={};try{for(var s=Qi(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=T_(o.value,2),u=a[0],c=a[1],l=c.type===zj.SignatureDefinitionBaseType.Function?Kj.SignatureDefinitionFunction.parse(c):Vj.SignatureDefinition.parse(c);i[u]=l}}catch(h){n={error:h}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},t.parseDescriptions=function(e){var n,r,i,s,o;w_.default.assert(e,E_.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=Hj(e,["$meta"]);u=c,a=l}var h={};try{for(var d=Qi(Object.entries(a)),g=d.next();!g.done;g=d.next()){var y=T_(g.value,2),b=y[0],C=y[1];h[b]={description:C.description,example:(i=C.example)!==null&&i!==void 0?i:null}}}catch(A){n={error:A}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return Vo({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},h)},t.parse=function(e,n){var r,i;w_.default.assert(e,E_.signatureSchema);var s=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.definitions);if(s.setDefinition(o),n!=null)try{for(var a=Qi(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=T_(u.value,2),l=c[0],h=c[1],d=t.parseDescriptions(h);s.addDescriptions(l,d)}}catch(g){r={error:g}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s},t.prototype.getType=function(){return this._type},t.prototype.getExtendedType=function(){return this._extends},t.prototype.getDefinitions=function(){return this._definitions},t.prototype.getAllDescriptions=function(){return this._descriptions},t.prototype.isHidden=function(){return this._hidden},t.prototype.setExtend=function(e){return this._extends=e,this},t.prototype.setDefinition=function(e){return this._definitions=e,this},t.prototype.mergeDefinitions=function(e){var n,r,i=Object.keys(e);try{for(var s=Qi(i),o=s.next();!o.done;o=s.next()){var a=o.value;this._definitions[a]=e[a]}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return this},t.prototype.getDefinition=function(e,n){if(!Object.prototype.hasOwnProperty.call(this._definitions,e))return null;var r=this._definitions[e],i=this.getDescriptions(n),s=i[e];return r.withDescription(s)},t.prototype.setDescriptions=function(e,n){return this._descriptions[e]=n,this},t.prototype.addDescriptions=function(e,n){var r,i,s=this._descriptions[e];s==null&&(s={},this._descriptions[e]=s);var o=Object.keys(n);try{for(var a=Qi(o),u=a.next();!u.done;u=a.next()){var c=u.value;s[c]=Vo(Vo({},s[c]),n[c])}}catch(l){r={error:l}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this},t.prototype.getDescriptions=function(e){e===void 0&&(e="en");var n=this._descriptions[e];return n??{}},t.prototype.toJSON=function(){var e,n,r={},i=Object.keys(this._definitions);try{for(var s=Qi(i),o=s.next();!o.done;o=s.next()){var a=o.value;r[a]=this._definitions[a].toJSON()}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return{type:this._type,extend:this._extends,hidden:this._hidden,definitions:r}},t.prototype.copy=function(){var e,n,r,i,s=new t({type:this._type,hidden:this._hidden,extends:this._extends}),o={},a=Object.keys(this._definitions);try{for(var u=Qi(a),c=u.next();!c.done;c=u.next()){var l=c.value;o[l]=this._definitions[l].copy()}}catch(b){e={error:b}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var h={},d=Object.keys(this._descriptions);try{for(var g=Qi(d),y=g.next();!y.done;y=g.next()){var l=y.value;h[l]=Vo({},h[l])}}catch(b){r={error:b}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}return s._descriptions=h,s._definitions=o,s},t}();En.Signature=Xj});var tO=m(Kr=>{"use strict";var Zi=Kr&&Kr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Ko=Kr&&Kr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},xu=Kr&&Kr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.Container=void 0;var Vr=x_(),xt=Hi(),Yj=function(){function t(){this._primitives=new Map([[xt.SignatureDefinitionBaseType.Any,new Vr.Signature({type:xt.SignatureDefinitionBaseType.Any})],[xt.SignatureDefinitionBaseType.General,new Vr.Signature({type:xt.SignatureDefinitionBaseType.General})],[xt.SignatureDefinitionBaseType.String,new Vr.Signature({type:xt.SignatureDefinitionBaseType.String})],[xt.SignatureDefinitionBaseType.Function,new Vr.Signature({type:xt.SignatureDefinitionBaseType.Function})],[xt.SignatureDefinitionBaseType.Number,new Vr.Signature({type:xt.SignatureDefinitionBaseType.Number})],[xt.SignatureDefinitionBaseType.List,new Vr.Signature({type:xt.SignatureDefinitionBaseType.List})],[xt.SignatureDefinitionBaseType.Map,new Vr.Signature({type:xt.SignatureDefinitionBaseType.Map})]]),this._types=new Map,this._excludeFromSearch=new Set}return t.prototype.getOrCreateTypeSignature=function(e){var n=this.getTypeSignature(e);return n==null&&(n=new Vr.Signature({type:e}),this._types.set(e,n)),n},t.prototype.getPrimitives=function(){return this._primitives},t.prototype.getTypes=function(){return this._types},t.prototype.getAllVisibleTypes=function(){var e=this;return Ko(Ko([],Zi(this._primitives.keys()),!1),Zi(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==xt.SignatureDefinitionBaseType.Any&&n!==xt.SignatureDefinitionBaseType.General})},t.prototype.excludeFromSearch=function(e){return this._excludeFromSearch.add(e),this},t.prototype.includeToSearch=function(e){return this._excludeFromSearch.delete(e),this},t.prototype.getTypeSignature=function(e){var n,r;return(r=(n=this._primitives.get(e))!==null&&n!==void 0?n:this._types.get(e))!==null&&r!==void 0?r:null},t.prototype.getAllPrimitiveSignatures=function(){return Array.from(this._primitives.values())},t.prototype.getAllTypeSignatures=function(){return Array.from(this._types.values())},t.prototype.getAllSignatures=function(){return Ko(Ko([],Zi(this.getAllPrimitiveSignatures()),!1),Zi(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return Ko(Ko([],Zi(this.getAllPrimitiveSignatures()),!1),Zi(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=Vr.Signature.parse(e);return this.addTypeSignature({type:n.getType(),extends:n.getExtendedType(),hidden:n.isHidden(),definitions:n.getDefinitions()}),this},t.prototype.addTypeSignature=function(e){var n=this.getOrCreateTypeSignature(e.type);return e.extends!==void 0&&n.setExtend(e.extends),n.mergeDefinitions(e.definitions),this},t.prototype.addMetaFromPayload=function(e,n){var r,i,s={},o=Object.keys(n);try{for(var a=xu(o),u=a.next();!u.done;u=a.next()){var c=u.value,l=Vr.Signature.parseDescriptions(n[c]);s[c]=l}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this.addMeta(e,s),this},t.prototype.addMeta=function(e,n){var r,i,s=Object.keys(n);try{for(var o=xu(s),a=o.next();!a.done;a=o.next()){var u=a.value,c=this.getOrCreateTypeSignature(u);c.addDescriptions(e,n[u])}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return this},t.prototype.searchDefinitionMatches=function(e,n,r){var i,s;if(r===void 0&&(r="en"),typeof e=="string")return this.searchDefinitionMatches([e],n,r);var o=e.includes(xt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=xu(o),l=c.next();!l.done;l=c.next()){var h=l.value;if(!this._excludeFromSearch.has(h)){for(var d=h,g=this.getTypeSignature(h),y=null;g!==null&&!a.has(g.getType())&&(a.add(g.getType()),g.isHidden()||(y=g.getDefinition(n,r)),y===null);)d=g.getExtendedType(),g=this.getTypeSignature(d);y!==null&&u.set(d,y)}}}catch(b){i={error:b}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return u},t.prototype.getDefinition=function(e,n,r){if(r===void 0&&(r="en"),typeof e=="string")return this.getDefinition([e],n,r);var i=this._primitives.get(xt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(xt.SignatureDefinitionBaseType.Any)&&i)return i;var s=this.searchDefinitionMatches(e,n,r);return s.size===0?null:s.size===1?s.values().next().value:s.has(xt.SignatureDefinitionBaseType.Any)?s.get(xt.SignatureDefinitionBaseType.Any):i!==null?i:s.values().next().value},t.prototype.fork=function(){var e,n,r,i,s=new t;try{for(var o=xu(this._primitives),a=o.next();!a.done;a=o.next()){var u=Zi(a.value,2),c=u[0],l=u[1];s._primitives.set(c,l.copy())}}catch(y){e={error:y}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var h=xu(this._types),d=h.next();!d.done;d=h.next()){var g=Zi(d.value,2),c=g[0],l=g[1];s._types.set(c,l.copy())}}catch(y){r={error:y}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();Kr.Container=Yj});var xn=m(ot=>{"use strict";var Jj=ot&&ot.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),nO=ot&&ot.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Jj(e,t,n)};Object.defineProperty(ot,"__esModule",{value:!0});ot.TypeParser=ot.VariationRegistry=ot.Container=ot.Signature=ot.SignatureDefinition=ot.SignatureDefinitionTypeMeta=ot.SignatureDefinitionFunction=ot.SignatureDefinitionFunctionArg=void 0;var Qj=Fb();Object.defineProperty(ot,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return Qj.SignatureDefinitionFunctionArg}});var Zj=$b();Object.defineProperty(ot,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return Zj.SignatureDefinitionFunction}});var eF=gu();Object.defineProperty(ot,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return eF.SignatureDefinitionTypeMeta}});var tF=Gh();Object.defineProperty(ot,"SignatureDefinition",{enumerable:!0,get:function(){return tF.SignatureDefinition}});var nF=x_();Object.defineProperty(ot,"Signature",{enumerable:!0,get:function(){return nF.Signature}});var rF=tO();Object.defineProperty(ot,"Container",{enumerable:!0,get:function(){return rF.Container}});var iF=Hh();Object.defineProperty(ot,"VariationRegistry",{enumerable:!0,get:function(){return iF.VariationRegistry}});var sF=qb();Object.defineProperty(ot,"TypeParser",{enumerable:!0,get:function(){return sF.TypeParser}});nO(Nb(),ot);nO(Hi(),ot)});var A_=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.normalizeText=void 0;var oF=t=>t.trimLeft().replace(/\r$/,"");pd.normalizeText=oF});var md=m(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.createCommentBlock=void 0;var aF=A_(),uF=t=>`/**
|
99
|
+
[${u}] ${this.details[a].message}`}return o=o+r,o};Os.safeStringify=function(t,e){return JSON.stringify(t,Os.serializer(),e)};Os.serializer=function(){let t=[],e=[],n=(r,i)=>e[0]===i?"[Circular ~]":"[Circular ~."+t.slice(0,e.indexOf(i)).join(".")+"]";return function(r,i){if(e.length>0){let s=e.indexOf(this);~s?(e.length=s+1,t.length=s+1,t[s]=r):(e.push(this),t.push(r)),~e.indexOf(i)&&(i=n.call(this,r,i))}else e.push(i);if(i){let s=i[Os.annotations];if(s){if(Array.isArray(i)){let o=[];for(let a=0;a<i.length;++a)s.errors[a]&&o.push(`_$idx$_${s.errors[a].sort().join(", ")}_$end$_`),o.push(i[a]);i=o}else{for(let o in s.errors)i[`${o}_$key$_${s.errors[o].sort().join(", ")}_$end$_`]=i[o],i[o]=void 0;for(let o in s.missing)i[`_$miss$_${o}|${s.missing[o]}_$end$_`]="__missing__"}return i}}return i===1/0||i===-1/0||Number.isNaN(i)||typeof i=="function"||typeof i=="symbol"?"["+i.toString()+"]":i}}});var di=m(Ot=>{"use strict";var SN=fk(),TN=Je(),wN=Qi();Ot.Report=class{constructor(t,e,n,r,i,s,o){if(this.code=t,this.flags=r,this.messages=i,this.path=s.path,this.prefs=o,this.state=s,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=Ot.label(this.flags,this.state,this.prefs,this.messages),this.value!==void 0&&!this.local.hasOwnProperty("value")&&(this.local.value=this.value),this.path.length){let a=this.path[this.path.length-1];typeof a!="object"&&(this.local.key=a)}}_setTemplate(t){if(this.template=t,!this.flags.label&&this.path.length===0){let e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;let t=this.code;if(!this.prefs.errors.render)return this.code;let e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${t}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(t,e){return Ot.template(this.value,t,e||this.code,this.state,this.prefs)}};Ot.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};Ot.template=function(t,e,n,r,i){if(!e)return;if(wN.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(TN.isResolvable(s)&&(s=s.resolve(t,r,i)),s&&e[s]){if(e[s][n]!==void 0)return e[s][n];if(e[s]["*"]!==void 0)return e[s]["*"]}return e[n]?e[n]:e["*"]};Ot.label=function(t,e,n,r){if(!n.errors.label)return"";if(t.label)return t.label;let i=e.path;n.errors.label==="key"&&e.path.length>1&&(i=e.path.slice(-1));let s=Ot.path(i);return s||Ot.template(null,n.messages,"root",e,n)||r&&Ot.template(null,r,"root",e,n)||"value"};Ot.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=Ot.details(t);if(r)return r;if(n.errors.stack)return new Ot.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new Ot.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};Ot.details=function(t,e={}){let n=[],r=[];for(let i of t){if(i instanceof Error){if(e.override!==!1)return{override:i};let o=i.toString();n.push(o),r.push({message:o,type:"override",context:{error:i}});continue}let s=i.toString();n.push(s),r.push({message:s,path:i.path.filter(o=>typeof o!="object"),type:i.code,context:i.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}};Ot.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof Ot.ValidationError}};Ot.ValidationError.prototype.isJoi=!0;Ot.ValidationError.prototype.name="ValidationError";Ot.ValidationError.prototype.annotate=SN.error});var fi=m(Zn=>{"use strict";var Jn=Me(),EN=hn(),xN=Cs(),pu=Je(),Db,Qn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};Zn.create=function(t,e={}){Jn(typeof t=="string","Invalid reference key:",t),pu.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Jn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Qn.defaults,e);delete n.prefix;let r=n.separator,i=Qn.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(Jn(!r||t[0]!==r,"Cannot specify relative path with root prefix"),n.ancestor="root",t||(t=null)),r&&r===t)t=null,n.ancestor=0;else if(n.ancestor!==void 0)Jn(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=Qn.ancestor(t,r);o&&(t=t.slice(o),t===""&&(t=null)),n.ancestor=s}return n.path=r?t===null?[]:t.split(r):[t],new Qn.Ref(n)};Zn.in=function(t,e={}){return Zn.create(t,{...e,in:!0})};Zn.isRef=function(t){return t?!!t[pu.symbols.ref]:!1};Qn.Ref=class{constructor(t){Jn(typeof t=="object","Invalid reference construction"),pu.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Jn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Jn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Jn(!t.map||Array.isArray(t.map),"options.map must be an array"),Jn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Qn.defaults,t),Jn(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(t,e,n,r,i={}){return Jn(!this.in||i.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(n.context,e,i):this.type==="local"?this._resolve(r,e,i):this.ancestor?this.ancestor==="root"?this._resolve(e.ancestors[e.ancestors.length-1],e,i):(Jn(this.ancestor<=e.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(e.ancestors[this.ancestor-1],e,i)):this._resolve(t,e,i)}_resolve(t,e,n){let r;if(this.type==="value"&&e.mainstay.shadow&&n.shadow!==!1&&(r=e.mainstay.shadow.get(this.absolute(e))),r===void 0&&(r=xN(t,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){let i=this.map.get(r);i!==void 0&&(r=i)}return e.mainstay&&e.mainstay.tracer.resolve(e,this,r),r}toString(){return this.display}absolute(t){return[...t.path.slice(0,-this.ancestor),...this.path]}clone(){return new Qn.Ref(this)}describe(){let t={path:this.path};this.type!=="value"&&(t.type=this.type),this.separator!=="."&&(t.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(t.ancestor=this.ancestor),this.map&&(t.map=[...this.map]);for(let e of["adjust","iterables","render"])this[e]!==null&&this[e]!==void 0&&(t[e]=this[e]);return this.in!==!1&&(t.in=!0),{ref:t}}updateDisplay(){let t=this.key!==null?this.key:"";if(this.type!=="value"){this.display=`ref:${this.type}:${t}`;return}if(!this.separator){this.display=`ref:${t}`;return}if(!this.ancestor){this.display=`ref:${this.separator}${t}`;return}if(this.ancestor==="root"){this.display=`ref:root:${t}`;return}if(this.ancestor===1){this.display=`ref:${t||".."}`;return}let e=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${e}${t||""}`}};Qn.Ref.prototype[pu.symbols.ref]=!0;Zn.build=function(t){return t=Object.assign({},Qn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Qn.Ref(t)};Qn.context=function(t,e,n={}){if(t=t.trim(),n){let r=n.global===void 0?"$":n.global;if(r!==e&&t.startsWith(r))return{key:t.slice(r.length),type:"global"};let i=n.local===void 0?"#":n.local;if(i!==e&&t.startsWith(i))return{key:t.slice(i.length),type:"local"};let s=n.root===void 0?"/":n.root;if(s!==e&&t.startsWith(s))return{key:t.slice(s.length),type:"value",root:!0}}return{key:t,type:"value"}};Qn.ancestor=function(t,e){if(!e)return[1,0];if(t[0]!==e)return[1,0];if(t[1]!==e)return[0,1];let n=2;for(;t[n]===e;)++n;return[n-1,n]};Zn.toSibling=0;Zn.toParent=1;Zn.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?Zn.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(pu.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}Zn.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),Db=Db||Qi(),Db.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new Zn.Manager;return t.refs=EN(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Qi=m((yk,bk)=>{"use strict";var Kh=Me(),AN=hn(),kN=lk(),CN=hk(),gk=Je(),pk=di(),mk=fi(),$e={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};bk.exports=yk=$e.Template=class{constructor(t,e){if(Kh(typeof t=="string","Template source must be a string"),Kh(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,e){let{functions:n,...r}=e;this._settings=Object.keys(r).length?AN(r):void 0,this._functions=n,this._functions&&(Kh(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),Kh(Object.values(this._functions).every(i=>typeof i=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;let t=$e.encode(this.source),e=$e.split(t),n=!1,r=[],i=e.shift();i&&r.push(i);for(let s of e){let o=s[0]!=="{",a=o?"}":"}}",u=s.indexOf(a);if(u===-1||s[1]==="{"){r.push(`{${$e.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let h=this._ref($e.decode(c),{raw:o,wrapped:l});r.push(h),typeof h!="string"&&(n=!0);let d=s.slice(u+a.length);d&&r.push($e.decode(d))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return $e.dateFormat[e.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;let e={template:this.source};return this._settings&&(e.options=this._settings),this._functions&&(e.functions=this._functions),e}static build(t){return new $e.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[gk.symbols.template]:!1}refs(){if(!this._template)return;let t=[];for(let e of this._template)typeof e!="string"&&t.push(...e.refs);return t}resolve(t,e,n,r){return this._template&&this._template.length===1?this._part(this._template[0],t,e,n,r,{}):this.render(t,e,n,r)}_part(t,...e){return t.ref?t.ref.resolve(...e):t.formula.evaluate(e)}render(t,e,n,r,i={}){if(!this.isDynamic())return this.rendered;let s=[];for(let o of this._template)if(typeof o=="string")s.push(o);else{let a=this._part(o,t,e,n,r,i),u=$e.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:kN(u);s.push($e.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=mk.create(o,this._settings);return r.push(a),u=>{let c=a.resolve(...u);return c!==void 0?c:null}};try{let o=this._functions?{...$e.functions,...this._functions}:$e.functions;var s=new CN.Parser(t,{reference:i,functions:o,constants:$e.constants})}catch(o){throw o.message=`Invalid template variable "${t}" fails due to: ${o.message}`,o}if(s.single){if(s.single.type==="reference"){let o=r[0];return{ref:o,raw:e,refs:r,wrapped:n||o.type==="local"&&o.key==="label"}}return $e.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};$e.Template.prototype[gk.symbols.template]=!0;$e.Template.prototype.isImmutable=!0;$e.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>$e.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>$e.closes.slice(0,n.length))};$e.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};$e.split=function(t){let e=[],n="";for(let r=0;r<t.length;++r){let i=t[r];if(i==="{"){let s="";for(;r+1<t.length&&t[r+1]==="{";)s+="{",++r;e.push(n),n=s}else n+=i}return e.push(n),e};$e.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};$e.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(mk.isRef(t)&&t.render&&(u=t.in,t=t.resolve(e,n,r,i,{in:t.in,...s})),t===null)return"null";if(o==="string")return $e.wrap(t,s.arrayItems&&a.string);if(o==="number"||o==="function"||o==="symbol")return t.toString();if(o!=="object")return JSON.stringify(t);if(t instanceof Date)return $e.Template.date(t,r);if(t instanceof Map){let l=[];for(let[h,d]of t.entries())l.push(`${h.toString()} -> ${d.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push($e.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return $e.wrap(c.join(", "),!u&&a.array)};$e.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};$e.functions={if(t,e,n){return t?e:n},length(t){return typeof t=="string"?t.length:!t||typeof t!="object"?null:Array.isArray(t)?t.length:Object.keys(t).length},msg(t){let[e,n,r,i,s]=this,o=s.messages;if(!o)return"";let a=pk.template(e,o[0],t,n,r)||pk.template(e,o[1],t,n,r);return a?a.render(e,n,r,i,s):""},number(t){return typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}}});var Wo=m(gu=>{"use strict";var Rs=Me(),_k=hn(),Nn=Qi();gu.compile=function(t,e){if(typeof t=="string")return Rs(!e,"Cannot set single message string"),new Nn(t);if(Nn.isTemplate(t))return Rs(!e,"Cannot set single message template"),t;Rs(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?_k(e):{};for(let n in t){let r=t[n];if(n==="root"||Nn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new Nn(r);continue}Rs(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);let i=n;e[i]=e[i]||{};for(n in r){let s=r[n];if(n==="root"||Nn.isTemplate(s)){e[i][n]=s;continue}Rs(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new Nn(s)}}return e};gu.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(Nn.isTemplate(r)){e[n]=r.describe({compact:!0});continue}let i=n;e[i]={};for(n in r){let s=r[n];if(n==="root"){e[i].root=s;continue}e[i][n]=s.describe({compact:!0})}}return e};gu.merge=function(t,e){if(!t)return gu.compile(e);if(!e)return t;if(typeof e=="string")return new Nn(e);if(Nn.isTemplate(e))return e;let n=_k(t);for(let r in e){let i=e[r];if(r==="root"||Nn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new Nn(i);continue}Rs(typeof i=="object"&&!Array.isArray(i),"Invalid message for",r);let s=r;n[s]=n[s]||{};for(r in i){let o=i[r];if(r==="root"||Nn.isTemplate(o)){n[s][r]=o;continue}Rs(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new Nn(o)}}return n}});var Je=m(Qe=>{"use strict";var Vh=Me(),ON=kb(),RN=uk(),Pb,Ib,DN={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};Qe.version=RN.version;Qe.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1};Qe.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")};Qe.assertOptions=function(t,e,n="Options"){Vh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));Vh(r.length===0,`${n} contain unknown keys: ${r}`)};Qe.checkPreferences=function(t){Ib=Ib||Gh();let e=Ib.preferences.validate(t);if(e.error)throw new ON([e.error.details[0].message])};Qe.compare=function(t,e,n){switch(n){case"=":return t===e;case">":return t>e;case"<":return t<e;case">=":return t>=e;case"<=":return t<=e}};Qe.default=function(t,e){return t===void 0?e:t};Qe.isIsoDate=function(t){return DN.isoDate.test(t)};Qe.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};Qe.isResolvable=function(t){return t?t[Qe.symbols.ref]||t[Qe.symbols.template]:!1};Qe.isSchema=function(t,e={}){let n=t&&t[Qe.symbols.any];return n?(Vh(e.legacy||n.version===Qe.version,"Cannot mix different versions of joi schemas"),!0):!1};Qe.isValues=function(t){return t[Qe.symbols.values]};Qe.limit=function(t){return Number.isSafeInteger(t)&&t>=0};Qe.preferences=function(t,e){Pb=Pb||Wo(),t=t||{},e=e||{};let n=Object.assign({},t,e);return e.errors&&t.errors&&(n.errors=Object.assign({},t.errors,e.errors),n.errors.wrap=Object.assign({},t.errors.wrap,e.errors.wrap)),e.messages&&(n.messages=Pb.compile(e.messages,t.messages)),delete n[Qe.symbols.prefs],n};Qe.tryWithPath=function(t,e,n={}){try{return t()}catch(r){throw r.path!==void 0?r.path=e+"."+r.path:r.path=e,n.append&&(r.message=`${r.message} (${r.path})`),r}};Qe.validateArg=function(t,e,{assert:n,message:r}){if(Qe.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};Qe.verifyFlat=function(t,e){for(let n of t)Vh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Mb=m(vk=>{"use strict";var PN=Me(),IN=hn(),MN=Je(),Uo={max:1e3,supported:new Set(["undefined","boolean","number","string"])};vk.provider={provision(t){return new Uo.Cache(t)}};Uo.Cache=class{constructor(t={}){MN.assertOptions(t,["max"]),PN(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||Uo.max,this._map=new Map,this._list=new Uo.List}get length(){return this._map.size}set(t,e){if(t!==null&&!Uo.supported.has(typeof t))return;let n=this._map.get(t);if(n){n.value=e,this._list.first(n);return}n=this._list.unshift({key:t,value:e}),this._map.set(t,n),this._compact()}get(t){let e=this._map.get(t);if(e)return this._list.first(e),IN(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};Uo.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){let{next:e,prev:n}=t;return e.prev=n,n&&(n.next=e),t===this.tail&&(this.tail=e),t.prev=null,t.next=null,t}}});var Ds=m(pi=>{"use strict";var gt=Me(),qn=Je(),Ho=fi(),er={};pi.schema=function(t,e,n={}){qn.assertOptions(n,["appendPath","override"]);try{return er.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};er.schema=function(t,e,n){gt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(gt(e.length,"Invalid empty array schema"),e.length===1&&(e=e[0]));let r=(i,...s)=>n.override!==!1?i.valid(t.override,...s):i.valid(...s);if(er.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(gt(typeof e=="object","Invalid schema content:",typeof e),qn.isResolvable(e))return r(t,e);if(qn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!er.simple(i))return t.alternatives().try(...e);return r(t,...e)}return e instanceof RegExp?t.string().regex(e):e instanceof Date?r(t.date(),e):(gt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};pi.ref=function(t,e){return Ho.isRef(t)?t:Ho.create(t,e)};pi.compile=function(t,e,n={}){qn.assertOptions(n,["legacy"]);let r=e&&e[qn.symbols.any];if(r)return gt(n.legacy||r.version===qn.version,"Cannot mix different versions of joi schemas:",r.version,qn.version),e;if(typeof e!="object"||!n.legacy)return pi.schema(t,e,{appendPath:!0});let i=er.walk(e);return i?i.compile(i.root,e):pi.schema(t,e,{appendPath:!0})};er.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=er.walk(n);if(r)return r}return null}let e=t[qn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};gt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=er.walk(t[n]);if(r)return r}return null};er.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};pi.when=function(t,e,n){if(n===void 0&&(gt(e&&typeof e=="object","Missing options"),n=e,e=Ho.create(".")),Array.isArray(n)&&(n={switch:n}),qn.assertOptions(n,["is","not","then","otherwise","switch","break"]),qn.isSchema(e))return gt(n.is===void 0,'"is" can not be used with a schema condition'),gt(n.not===void 0,'"not" can not be used with a schema condition'),gt(n.switch===void 0,'"switch" can not be used with a schema condition'),er.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(gt(Ho.isRef(e)||typeof e=="string","Invalid condition:",e),gt(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let i=n;n.not!==void 0&&(i={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let s=i.is!==void 0?t.$_compile(i.is):t.$_root.invalid(null,!1,0,"").required();return gt(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),gt(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!Ho.isRef(n.is)&&!qn.isSchema(n.is)&&(s=s.required()),er.condition(t,{ref:pi.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}gt(Array.isArray(n.switch),'"switch" must be an array'),gt(n.is===void 0,'Cannot combine "switch" with "is"'),gt(n.not===void 0,'Cannot combine "switch" with "not"'),gt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:pi.ref(e),switch:[],break:n.break};for(let i=0;i<n.switch.length;++i){let s=n.switch[i],o=i===n.switch.length-1;qn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),gt(s.is!==void 0,'Switch statement missing "is"'),gt(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!Ho.isRef(s.is)&&!qn.isSchema(s.is)&&(a.is=a.is.required()),o){gt(n.otherwise===void 0||s.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');let u=n.otherwise!==void 0?n.otherwise:s.otherwise;u!==void 0&&(gt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};er.condition=function(t,e){for(let n of["then","otherwise"])e[n]===void 0?delete e[n]:e[n]=t.$_compile(e[n]);return e}});var Lb=m(Tk=>{"use strict";var Zi=Me(),LN=hn(),Sk=Je(),NN=Wo(),Wr={};Tk.type=function(t,e){let n=Object.getPrototypeOf(t),r=LN(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=NN.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),i.type=s.type,s.flags=Object.assign({},o.flags,s.flags);let a=Object.assign({},o.terms);if(s.terms)for(let h in s.terms){let d=s.terms[h];Zi(i.$_terms[h]===void 0,"Invalid term override for",s.type,h),i.$_terms[h]=d.init,a[h]=d}s.terms=a,s.args||(s.args=o.args),s.prepare=Wr.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=Wr.coerce(s.coerce,o.coerce),s.validate=Wr.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let h in s.rules){let d=s.rules[h];Zi(typeof d=="object","Invalid rule definition for",s.type,h);let g=d.method;if(g===void 0&&(g=function(){return this.$_addRule(h)}),g&&(Zi(!r[h],"Rule conflict in",s.type,h),r[h]=g),Zi(!u[h],"Rule conflict in",s.type,h),u[h]=d,d.alias){let _=[].concat(d.alias);for(let b of _)r[b]=d.method}d.args&&(d.argsByName=new Map,d.args=d.args.map(_=>(typeof _=="string"&&(_={name:_}),Zi(!d.argsByName.has(_.name),"Duplicated argument name",_.name),Sk.isSchema(_.assert)&&(_.assert=_.assert.strict().label(_.name)),d.argsByName.set(_.name,_),_)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let h in s.modifiers){Zi(!r[h],"Rule conflict in",s.type,h);let d=s.modifiers[h];Zi(typeof d=="function","Invalid modifier definition for",s.type,h);let g=function(_){return this.rule({[h]:_})};r[h]=g,c[h]=d}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let h in s.overrides)Zi(n[h],"Cannot override missing",h),s.overrides[h][Sk.symbols.parent]=n[h],i.$_super[h]=n[h].bind(i);Object.assign(r,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);let l=Object.assign({},o.manifest,s.manifest);return l.build=Wr.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=Wr.rebuild(s.rebuild,o.rebuild),i};Wr.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};Wr.coerce=function(t,e){return!t||!e?t||e:{from:t.from&&e.from?[...new Set([...t.from,...e.from])]:null,method(n,r){let i;if((!e.from||e.from.includes(typeof n))&&(i=e.method(n,r),i)){if(i.errors||i.value===void 0)return i;n=i.value}if(!t.from||t.from.includes(typeof n)){let s=t.method(n,r);if(s)return s}return i}}};Wr.prepare=function(t,e){return!t||!e?t||e:function(n,r){let i=t(n,r);if(i){if(i.errors||i.value===void 0)return i;n=i.value}return e(n,r)||i}};Wr.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};Wr.validate=function(t,e){return!t||!e?t||e:function(n,r){let i=e(n,r);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;n=i.value}return t(n,r)||i}}});var jb=m(qb=>{"use strict";var Ur=Me(),Xh=hn(),Ps=Je(),qN=Wo(),wk=fi(),jN=Qi(),Nb,dn={};qb.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=dn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=Xh(t._preferences,{shallow:["messages"]}),delete n.preferences[Ps.symbols.prefs],n.preferences.messages&&(n.preferences.messages=qN.decompile(n.preferences.messages))),t._valids&&(n.allow=t._valids.describe()),t._invalids&&(n.invalid=t._invalids.describe());for(let r of t._rules){if(e.rules[r.name].manifest===!1)continue;let s={name:r.name};for(let o in e.modifiers)r[o]!==void 0&&(s[o]=dn.describe(r[o]));if(r.args){s.args={};for(let o in r.args){let a=r.args[o];o==="options"&&!Object.keys(a).length||(s.args[o]=dn.describe(a,{assign:o}))}Object.keys(s.args).length||delete s.args}n.rules.push(s)}n.rules.length||delete n.rules;for(let r in t.$_terms){if(r[0]==="_")continue;Ur(!n[r],"Cannot describe schema due to internal name conflict with",r);let i=t.$_terms[r];if(!i)continue;if(i instanceof Map){i.size&&(n[r]=[...i.entries()]);continue}if(Ps.isValues(i)){n[r]=i.describe();continue}Ur(e.terms[r],"Term",r,"missing configuration");let s=e.terms[r].manifest,o=typeof s=="object";if(!i.length&&!o)continue;let a=[];for(let u of i)a.push(dn.describe(u));if(o){let{from:u,to:c}=s.mapped;n[r]={};for(let l of a)n[r][l[c]]=l[u];continue}if(s==="single"){Ur(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return dn.validate(t.$_root,n),n};dn.describe=function(t,e={}){if(Array.isArray(t))return t.map(dn.describe);if(t===Ps.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return Xh(t);if(Buffer&&Buffer.isBuffer(t))return{buffer:t.toString("binary")};if(t instanceof Date)return t.toISOString();if(t instanceof Error)return t;if(t instanceof RegExp)return e.assign==="regex"?t.toString():{regex:t.toString()};if(t[Ps.symbols.literal])return{function:t.literal};if(typeof t.describe=="function")return e.assign==="ref"?t.describe().ref:t.describe();let n={};for(let r in t){let i=t[r];i!==void 0&&(n[r]=dn.describe(i,{assign:r}))}return n};qb.build=function(t,e){return new dn.Builder(t).parse(e)};dn.Builder=class{constructor(t){this.joi=t}parse(t){dn.validate(this.joi,t);let e=this.joi[t.type]()._bare(),n=e._definition;if(t.flags)for(let i in t.flags){let s=n.flags[i]&&n.flags[i].setter||i;Ur(typeof e[s]=="function","Invalid flag",i,"for type",t.type),e=e[s](this.build(t.flags[i]))}if(t.preferences&&(e=e.preferences(this.build(t.preferences))),t.allow&&(e=e.allow(...this.build(t.allow))),t.invalid&&(e=e.invalid(...this.build(t.invalid))),t.rules)for(let i of t.rules){Ur(typeof e[i.name]=="function","Invalid rule",i.name,"for type",t.type);let s=[];if(i.args){let a={};for(let l in i.args)a[l]=this.build(i.args[l],{assign:l});let u=Object.keys(a),c=n.rules[i.name].args;if(c){Ur(u.length<=c.length,"Invalid number of arguments for",t.type,i.name,"(expected up to",c.length,", found",u.length,")");for(let{name:l}of c)s.push(a[l])}else Ur(u.length===1,"Invalid number of arguments for",t.type,i.name,"(expected up to 1, found",u.length,")"),s.push(a[u[0]])}e=e[i.name](...s);let o={};for(let a in n.modifiers)i[a]!==void 0&&(o[a]=this.build(i[a]));Object.keys(o).length&&(e=e.rule(o))}let r={};for(let i in t){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(i))continue;Ur(n.terms[i],"Term",i,"missing configuration");let s=n.terms[i].manifest;if(s==="schema"){r[i]=t[i].map(o=>this.parse(o));continue}if(s==="values"){r[i]=t[i].map(o=>this.build(o));continue}if(s==="single"){r[i]=this.build(t[i]);continue}if(typeof s=="object"){r[i]={};for(let o in t[i]){let a=t[i][o];r[i][o]=this.parse(a)}continue}r[i]=this.build(t[i])}return t.whens&&(r.whens=t.whens.map(i=>this.build(i))),e=n.manifest.build(e,r),e.$_temp.ruleset=!1,e}build(t,e={}){if(t===null)return null;if(Array.isArray(t))return t.map(r=>this.build(r));if(t instanceof Error)return t;if(e.assign==="options")return Xh(t);if(e.assign==="regex")return dn.regex(t);if(e.assign==="ref")return wk.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return Ur(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[Ps.symbols.literal]:!0,literal:t.function};if(t.override)return Ps.symbols.override;if(t.ref)return wk.build(t.ref);if(t.regex)return dn.regex(t.regex);if(t.special)return Ur(["deep"].includes(t.special),"Unknown special value",t.special),Ps.symbols.deepDefault;if(t.value)return Xh(t.value)}if(t.type)return this.parse(t);if(t.template)return jN.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};dn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};dn.validate=function(t,e){Nb=Nb||Gh(),t.assert(e,Nb.description)}});var mu=m((oK,Ek)=>{"use strict";var Hr=Ob(),rn={mismatched:null};Ek.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!rn.isDeepEqual(t,e,n,[])};rn.isDeepEqual=function(t,e,n,r){if(t===e)return t!==0||1/t===1/e;let i=typeof t;if(i!==typeof e||t===null||e===null)return!1;if(i==="function"){if(!n.deepFunction||t.toString()!==e.toString())return!1}else if(i!=="object")return t!==t&&e!==e;let s=rn.getSharedType(t,e,!!n.prototype);switch(s){case Hr.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Hr.promise:return t===e;case Hr.regex:return t.toString()===e.toString();case rn.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new rn.SeenEntry(t,e));try{return!!rn.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};rn.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?rn.mismatched:Hr.getInternalProto(t);let r=Hr.getInternalProto(t);return r!==Hr.getInternalProto(e)?rn.mismatched:r};rn.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};rn.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};rn.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};rn.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=rn,{keys:u,getOwnPropertySymbols:c}=Object;if(t===Hr.array)if(r.part){for(let _ of e)for(let b of n)if(s(_,b,r,i))return!0}else{if(e.length!==n.length)return!1;for(let _=0;_<e.length;++_)if(!s(e[_],n[_],r,i))return!1;return!0}else if(t===Hr.set){if(e.size!==n.size)return!1;if(!rn.isSetSimpleEqual(e,n)){let _=new Set(Set.prototype.values.call(n));for(let b of Set.prototype.values.call(e)){if(_.delete(b))continue;let C=!1;for(let A of _)if(s(b,A,r,i)){_.delete(A),C=!0;break}if(!C)return!1}}}else if(t===Hr.map){if(e.size!==n.size)return!1;for(let[_,b]of Map.prototype.entries.call(e))if(b===void 0&&!Map.prototype.has.call(n,_)||!s(b,Map.prototype.get.call(n,_),r,i))return!1}else if(t===Hr.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),h=o(n);if((e!==l||n!==h)&&!s(l,h,r,i))return!1;let d=u(e);if(!r.part&&d.length!==u(n).length&&!r.skip)return!1;let g=0;for(let _ of d){if(r.skip&&r.skip.includes(_)){n[_]===void 0&&++g;continue}if(!a(n,_)||!s(e[_],n[_],r,i))return!1}if(!r.part&&d.length-g!==u(n).length)return!1;if(r.symbols!==!1){let _=c(e),b=new Set(c(n));for(let C of _){if(!r.skip||!r.skip.includes(C)){if(a(e,C)){if(!a(n,C)||!s(e[C],n[C],r,i))return!1}else if(a(n,C))return!1}b.delete(C)}for(let C of b)if(a(n,C))return!1}return!0};rn.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var Ak=m(xk=>{"use strict";xk.location=function(t=0){let e=Error.prepareStackTrace;Error.prepareStackTrace=(i,s)=>s;let n={};Error.captureStackTrace(n,this);let r=n.stack[t+1];return Error.prepareStackTrace=e,{filename:r.getFileName(),line:r.getLineNumber()}}});var $b=m(Fb=>{"use strict";var kk=mu(),Ck=Ak(),FN=di(),sn={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Fb.setup=function(t){let e=function(){return t._tracer=t._tracer||new sn.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Fb.location=function(t){return t.$_setFlag("_tracerLocation",Ck.location(2))};sn.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(t){let e=this._schemas.get(t);if(e)return e.store;let n=new sn.Store(t),{filename:r,line:i}=t._flags._tracerLocation||Ck.location(5);return this._schemas.set(t,{filename:r,line:i,store:n}),n}_combine(t,e){for(let{store:n}of this._schemas.values())n._combine(t,e)}report(t){let e=[];for(let{filename:n,line:r,store:i}of this._schemas.values()){if(t&&t!==n)continue;let s=[],o=[];for(let[a,u]of i._sources.entries()){if(sn.sub(u.paths,o))continue;if(!u.entry){s.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let l of["valid","invalid"]){let h=a[`_${l}s`];if(!h)continue;let d=new Set(h._values),g=new Set(h._refs);for(let{value:_,ref:b}of u[l])d.delete(_),g.delete(b);(d.size||g.size)&&s.push({status:[...d,...[...g].map(_=>_.display)],rule:`${l}s`})}let c=a._rules.map(l=>l.name);for(let l of["default","failover"])a._flags[l]!==void 0&&c.push(l);for(let l of c){let h=sn.labels[u.rule[l]||0];if(h){let d={rule:l,status:h};u.paths.size&&(d.paths=[...u.paths]),s.push(d)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(sn.message).join(", ")}`})}return e.length?e:null}};sn.Store=class{constructor(t){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(t)}debug(t,e,n,r){t.mainstay.debug&&t.mainstay.debug.push({type:e,name:n,result:r,path:t.path})}entry(t,e){sn.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){sn.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){sn.debug(e,{type:n,name:r,result:i==="full"?"pass":i}),this._record(t,s=>{s[n][r]=s[n][r]||0,s[n][r]|=sn.codes[i]})}resolve(t,e,n){if(!t.mainstay.debug)return;let r={type:"resolve",ref:e.display,to:n,path:t.path};t.mainstay.debug.push(r)}value(t,e,n,r,i){if(!t.mainstay.debug||kk(n,r))return;let s={type:"value",by:e,from:n,to:r,path:t.path};i&&(s.name=i),t.mainstay.debug.push(s)}_record(t,e){let n=this._sources.get(t);if(n){e(n);return}let r=this._combos.get(t);for(let i of r)this._record(i,e)}_scan(t,e){let n=e||[],r=this._sources.get(t);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(t,r)),n.length&&r.paths.add(n);let i=(s,o)=>{let a=sn.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};sn.message=function(t){return`${t.paths?FN.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};sn.id=function(t,{source:e,name:n,path:r,key:i}){return t._flags.id?t._flags.id:i||(n=`@${n}`,e==="terms"?[n,r[Math.min(r.length-1,1)]]:n)};sn.sub=function(t,e){for(let n of t)for(let r of e)if(kk(n.slice(0,r.length),r))return!0;return!1};sn.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Yh=m((dK,Dk)=>{"use strict";var Bb=Me(),Ok=hn(),$N=Rb(),Rk={};Dk.exports=Rk.merge=function(t,e,n){if(Bb(t&&typeof t=="object","Invalid target value: must be an object"),Bb(e==null||typeof e=="object","Invalid source value: must be null, undefined, or an object"),!e)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(e)){Bb(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(Ok(e[i],{symbols:n.symbols}));return t}let r=$N.keys(e,n);for(let i=0;i<r.length;++i){let s=r[i];if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(e,s))continue;let o=e[s];if(o&&typeof o=="object"){if(t[s]===o)continue;!t[s]||typeof t[s]!="object"||Array.isArray(t[s])!==Array.isArray(o)||o instanceof Date||Buffer&&Buffer.isBuffer(o)||o instanceof RegExp?t[s]=Ok(o,{symbols:n.symbols}):Rk.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var Pk=m(Jh=>{"use strict";var gi=Me(),Wb=Je(),BN=fi(),Gr={};Jh.Ids=Gr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new Gr.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(let[e,n]of t._byId.entries())gi(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())gi(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,n)}fork(t,e,n){let r=this._collect(t);r.push({schema:n});let i=r.shift(),s={id:i.id,schema:e(i.schema)};gi(Wb.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:Gr.fork(o.schema,s.id,s.schema)};return s.schema}labels(t,e=[]){let n=t[0],r=this._get(n);if(!r)return[...e,...t].join(".");let i=t.slice(1);return e=[...e,r.schema._flags.label||n],i.length?r.schema._ids.labels(i,e):e.join(".")}reach(t,e=[]){let n=t[0],r=this._get(n);gi(r,"Schema does not contain path",[...e,...t].join("."));let i=t.slice(1);return i.length?r.schema._ids.reach(i,[...e,n]):r.schema}register(t,{key:e}={}){if(!t||!Wb.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);let n=t._flags.id;if(n){let r=this._byId.get(n);gi(!r||r.schema===t,"Cannot add different schemas with the same id:",n),gi(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(gi(!this._byKey.has(e),"Schema already contains key:",e),gi(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,{schema:t,id:e}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,e=[],n=[]){let r=t[0],i=this._get(r);gi(i,"Schema does not contain path",[...e,...t].join(".")),n=[i,...n];let s=t.slice(1);return s.length?i.schema._ids._collect(s,[...e,r],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}};Gr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=Jh.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};Jh.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=Gr.scan(t._flags[r],{source:"flags",name:r},e);i!==void 0&&(n=n||t.clone(),n._flags[r]=i)}for(let r=0;r<t._rules.length;++r){let i=t._rules[r],s=Gr.scan(i.args,{source:"rules",name:i.name},e);if(s!==void 0){n=n||t.clone();let o=Object.assign({},i);o.args=s,n._rules[r]=o,n._singleRules.get(i.name)===i&&n._singleRules.set(i.name,o)}}for(let r in t.$_terms){if(r[0]==="_")continue;let i=Gr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};Gr.scan=function(t,e,n,r,i){let s=r||[];if(t===null||typeof t!="object")return;let o;if(Array.isArray(t)){for(let a=0;a<t.length;++a){let u=e.source==="terms"&&e.name==="keys"&&t[a].key,c=Gr.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&Wb.isSchema(t)||n.ref!==!1&&BN.isRef(t)){let a=n.each(t,{...e,path:s,key:i});return a===t?void 0:a}for(let a in t){if(a[0]==="_")continue;let u=Gr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var Mk=m((gK,Ik)=>{"use strict";Ik.exports=function(){}});var qk=m((mK,Nk)=>{"use strict";var WN=hn(),Lk=Cs(),UN=Je(),zr={value:Symbol("value")};Nk.exports=zr.State=class{constructor(t,e,n){this.path=t,this.ancestors=e,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,e=null,n=null){let r=new zr.State(t,e,this);return n&&r.schemas&&(r.schemas=[zr.schemas(n),...r.schemas]),r}nest(t,e){let n=new zr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[zr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new zr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=WN(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}};zr.schemas=function(t){return UN.isSchema(t)?{schema:t}:t};zr.Shadow=class{constructor(){this._values=null}set(t,e,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let i=0;i<t.length;++i){let s=t[i],o=r.get(s);o||(o=new Map,r.set(s,o)),r=o}r[zr.value]=e}get(t){let e=this.node(t);if(e)return e[zr.value]}node(t){if(this._values)return Lk(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=Lk(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var Fk=m(bu=>{"use strict";var yu=Me(),jk=hn(),Go=Mk(),HN=Cs(),Dt=Je(),es=di(),GN=qk(),_e={result:Symbol("result")};bu.entry=function(t,e,n){let r=Dt.defaults;n&&(yu(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),yu(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Dt.preferences(Dt.defaults,n));let i=_e.entry(t,e,r);yu(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");let s={value:i.value};return i.error&&(s.error=i.error),i.mainstay.warnings.length&&(s.warning=es.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};bu.entryAsync=async function(t,e,n){let r=Dt.defaults;n&&(r=Dt.preferences(Dt.defaults,n));let i=_e.entry(t,e,r),s=i.mainstay;if(i.error)throw s.debug&&(i.error.debug=s.debug),i.error;if(s.externals.length){let a=i.value,u=[];for(let c of s.externals){let l=c.state.path,h=c.schema.type==="link"?s.links.get(c.schema):null,d=a,g,_,b=l.length?[a]:[],C=l.length?HN(t,l):t;if(l.length){g=l[l.length-1];let A=a;for(let w of l.slice(0,-1))A=A[w],b.unshift(A);_=b[0],d=_[g]}try{let A=(T,v)=>(h||c.schema).$_createError(T,d,v,c.state,r),w=await c.method(d,{schema:c.schema,linked:h,state:c.state,prefs:n,original:C,error:A,errorsArray:_e.errorsArray,warn:(T,v)=>s.warnings.push((h||c.schema).$_createError(T,d,v,c.state,r)),message:(T,v)=>(h||c.schema).$_createError("external",d,v,c.state,r,{messages:T})});if(w===void 0||w===d)continue;if(w instanceof es.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(w),r.abortEarly)break;continue}if(Array.isArray(w)&&w[Dt.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...w),r.abortEarly)break;continue}_?(s.tracer.value(c.state,"rule",d,w,"external"),_[g]=w):(s.tracer.value(c.state,"rule",a,w,"external"),a=w)}catch(A){throw r.errors.label&&(A.message+=` (${c.label})`),A}}if(i.value=a,u.length)throw i.error=es.process(u,t,r),s.debug&&(i.error.debug=s.debug),i.error}if(!r.warnings&&!r.debug&&!r.artifacts)return i.value;let o={value:i.value};return s.warnings.length&&(o.warning=es.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};_e.Mainstay=class{constructor(t,e,n){this.externals=[],this.warnings=[],this.tracer=t,this.debug=e,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){let t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}};_e.entry=function(t,e,n){let{tracer:r,cleanup:i}=_e.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new _e.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new GN([],[],{mainstay:a,schemas:u}),l=bu.validate(t,e,c,n);i&&e.$_root.untrace();let h=es.process(l.errors,t,n);return{value:l.value,error:h,mainstay:a}};_e.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(yu(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:_e.ignore}};bu.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=_e.prefs(e,r)),e._cache&&r.cache){let h=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!h),h)return h}let s=(h,d,g)=>e.$_createError(h,t,d,g||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:_e.errorsArray,warn:(h,d,g)=>n.mainstay.warnings.push(s(h,d,g)),message:(h,d)=>e.$_createError("custom",t,d,n,r,{messages:h})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let h=a.prepare(t,o);if(h){if(n.mainstay.tracer.value(n,"prepare",t,h.value),h.errors)return _e.finalize(h.value,[].concat(h.errors),o);t=h.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let h=a.coerce.method(t,o);if(h){if(n.mainstay.tracer.value(n,"coerced",t,h.value),h.errors)return _e.finalize(h.value,[].concat(h.errors),o);t=h.value}}let u=e._flags.empty;u&&u.$_match(_e.trim(t,e),n.nest(u),Dt.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let c=i.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(c==="forbidden")return _e.finalize(t,null,o);if(c==="required")return _e.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==Dt.symbols.deepDefault)return _e.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return _e.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let h=e._valids.get(t,n,r,e._flags.insensitive);if(h)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,h.value),t=h.value),n.mainstay.tracer.filter(e,n,"valid",h),_e.finalize(t,null,o);if(e._flags.only){let d=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return _e.finalize(t,[d],o);l.push(d)}}if(e._invalids){let h=e._invalids.get(t,n,r,e._flags.insensitive);if(h){n.mainstay.tracer.filter(e,n,"invalid",h);let d=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return _e.finalize(t,[d],o);l.push(d)}}if(a.validate){let h=a.validate(t,o);if(h&&(n.mainstay.tracer.value(n,"base",t,h.value),t=h.value,h.errors)){if(!Array.isArray(h.errors))return l.push(h.errors),_e.finalize(t,l,o);if(h.errors.length)return l.push(...h.errors),_e.finalize(t,l,o)}}return e._rules.length?_e.rules(t,l,o):_e.finalize(t,l,o)};_e.rules=function(t,e,n){let{schema:r,state:i,prefs:s}=n;for(let o of r._rules){let a=r._definition.rules[o.method];if(a.convert&&s.convert){i.mainstay.tracer.log(r,i,"rule",o.name,"full");continue}let u,c=o.args;if(o._resolve.length){c=Object.assign({},c);for(let h of o._resolve){let d=a.argsByName.get(h),g=c[h].resolve(t,i,s),_=d.normalize?d.normalize(g):g,b=Dt.validateArg(_,null,d);if(b){u=r.$_createError("any.ref",g,{arg:h,ref:c[h],reason:b},i,s);break}c[h]=_}}u=u||a.validate(t,n,c,o);let l=_e.rule(u,o);if(l.errors){if(i.mainstay.tracer.log(r,i,"rule",o.name,"error"),o.warn){i.mainstay.warnings.push(...l.errors);continue}if(s.abortEarly)return _e.finalize(t,l.errors,n);e.push(...l.errors)}else i.mainstay.tracer.log(r,i,"rule",o.name,"pass"),i.mainstay.tracer.value(i,"rule",t,l.value,o.name),t=l.value}return _e.finalize(t,e,n)};_e.rule=function(t,e){return t instanceof es.Report?(_e.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Dt.symbols.errors]?(t.forEach(n=>_e.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};_e.error=function(t,e){return e.message&&t._setTemplate(e.message),t};_e.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=_e.default("failover",void 0,e,n);a!==void 0&&(i.mainstay.tracer.value(i,"failover",t,a),t=a,e=[])}if(e.length&&r._flags.error)if(typeof r._flags.error=="function"){e=r._flags.error(e),Array.isArray(e)||(e=[e]);for(let a of e)yu(a instanceof Error||a instanceof es.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=_e.default("default",t,e,n);i.mainstay.tracer.value(i,"default",t,a),t=a}if(r._flags.cast&&t!==void 0){let a=r._definition.cast[r._flags.cast];if(a.from(t)){let u=a.to(t,n);i.mainstay.tracer.value(i,"cast",t,u,r._flags.cast),t=u}}if(r.$_terms.externals&&s.externals&&s._externals!==!1)for(let{method:a}of r.$_terms.externals)i.mainstay.externals.push({method:a,schema:r,state:i,label:es.label(r._flags,i,s)});let o={value:t,errors:e.length?e:null};return r._flags.result&&(o.value=r._flags.result==="strip"?void 0:n.original,i.mainstay.tracer.value(i,r._flags.result,t,o.value),i.shadow(t,r._flags.result)),r._cache&&s.cache!==!1&&!r._refs.length&&r._cache.set(n.original,o),t!==void 0&&!o.errors&&r._flags.artifact!==void 0&&(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(r._flags.artifact)||i.mainstay.artifacts.set(r._flags.artifact,[]),i.mainstay.artifacts.get(r._flags.artifact).push(i.path)),o};_e.prefs=function(t,e){let n=e===Dt.defaults;return n&&t._preferences[Dt.symbols.prefs]?t._preferences[Dt.symbols.prefs]:(e=Dt.preferences(e,t._preferences),n&&(t._preferences[Dt.symbols.prefs]=e),e)};_e.default=function(t,e,n,r){let{schema:i,state:s,prefs:o}=r,a=i._flags[t];if(o.noDefaults||a===void 0)return e;if(s.mainstay.tracer.log(i,s,"rule",t,"full"),!a)return a;if(typeof a=="function"){let u=a.length?[jk(s.ancestors[0]),r]:[];try{return a(...u)}catch(c){n.push(i.$_createError(`any.${t}`,null,{error:c},s,o));return}}return typeof a!="object"?a:a[Dt.symbols.literal]?a.literal:Dt.isResolvable(a)?a.resolve(e,s,o):jk(a)};_e.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};_e.ignore={active:!1,debug:Go,entry:Go,filter:Go,log:Go,resolve:Go,value:Go};_e.errorsArray=function(){let t=[];return t[Dt.symbols.errors]=!0,t}});var Hb=m((SK,Bk)=>{"use strict";var zN=Me(),$k=mu(),Ub=Je(),mi={};Bk.exports=mi.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=mi.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(Ub.isResolvable(t)){this._refs.has(t)||(this._refs.add(t),e&&e.register(t));return}this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,e,n){if(t=t||new mi.Values,e){if(e._override)return e.clone();for(let r of[...e._values,...e._refs])t.add(r)}if(n)for(let r of[...n._values,...n._refs])t.remove(r);return t.length?t:null}remove(t){if(Ub.isResolvable(t)){this._refs.delete(t);return}this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase())}has(t,e,n,r){return!!this.get(t,e,n,r)}get(t,e,n,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){let i=this._lowercase.get(t.toLowerCase());if(i)return{value:i}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(let i of this._values)if($k(i,t))return{value:i}}if(e)for(let i of this._refs){let s=i.resolve(t,e,n,null,{in:!0});if(s===void 0)continue;let o=!i.in||typeof s!="object"?[s]:Array.isArray(s)?s:Object.keys(s);for(let a of o)if(typeof a==typeof t){if(r&&t&&typeof t=="string"){if(a.toLowerCase()===t.toLowerCase())return{value:a,ref:i}}else if($k(a,t))return{value:a,ref:i}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){let e=[];for(let n of[...this._values,...this._refs])n!==void 0&&e.push(n);return e}return Array.from([...this._values,...this._refs])}clone(){let t=new mi.Values(this._values,this._refs);return t._override=this._override,t}concat(t){zN(!t._override,"Cannot concat override set of values");let e=new mi.Values([...this._values,...t._values],[...this._refs,...t._refs]);return e._override=this._override,e}describe(){let t=[];this._override&&t.push({override:!0});for(let e of this._values.values())t.push(e&&typeof e=="object"?{value:e}:e);for(let e of this._refs.values())t.push(e.describe());return t}};mi.Values.prototype[Ub.symbols.values]=!0;mi.Values.prototype.slice=mi.Values.prototype.clone;mi.lowercases=function(t){let e=new Map;if(t)for(let n of t)typeof n=="string"&&e.set(n.toLowerCase(),n);return e}});var Xk=m((wK,Vk)=>{"use strict";var J=Me(),Wk=hn(),Uk=mu(),Gb=Yh(),KN=Mb(),Tt=Je(),zb=Ds(),VN=di(),XN=Lb(),Hk=jb(),YN=Wo(),Gk=Pk(),zk=fi(),Kk=$b(),Qh=Fk(),Zh=Hb(),Bt={};Bt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new Gk.Ids,this._preferences=null,this._refs=new zk.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return J(typeof Hk.describe=="function","Manifest functionality disabled"),Hk.describe(this)}allow(...t){return Tt.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){J(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),J(!this._inRuleset(),"Cannot set alterations inside a ruleset");let e=this.clone();e.$_terms.alterations=e.$_terms.alterations||[];for(let n in t){let r=t[n];J(typeof r=="function","Alteration adjuster for",n,"must be a function"),e.$_terms.alterations.push({target:n,adjuster:r})}return e.$_temp.ruleset=!1,e}artifact(t){return J(t!==void 0,"Artifact cannot be undefined"),J(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return J(t===!1||typeof t=="string","Invalid to value"),J(t===!1||this._definition.cast[t],"Type",this.type,"does not support casting to",t),this.$_setFlag("cast",t===!1?void 0:t)}default(t,e){return this._default("default",t,e)}description(t){return J(t&&typeof t=="string","Description must be a non-empty string"),this.$_setFlag("description",t)}empty(t){let e=this.clone();return t!==void 0&&(t=e.$_compile(t,{override:!1})),e.$_setFlag("empty",t,{clone:!1})}error(t){return J(t,"Missing error"),J(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return J(t!==void 0,"Missing example"),Tt.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(J(!e,"Cannot combine options with description"),e=t.description,t=t.method),J(typeof t=="function","Method must be a function"),J(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this._inner("externals",{method:t,description:e},{single:!0})}failover(t,e){return this._default("failover",t,e)}forbidden(){return this.presence("forbidden")}id(t){return t?(J(typeof t=="string","id must be a non-empty string"),J(/^[^\.]+$/.test(t),"id cannot contain period character"),this.$_setFlag("id",t)):this.$_setFlag("id",void 0)}invalid(...t){return this._values(t,"_invalids")}label(t){return J(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return J(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){J(t.length,"Missing notes");for(let e of t)J(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return J(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){J(t,"Missing preferences"),J(t.context===void 0,"Cannot override context"),J(t.externals===void 0,"Cannot override externals"),J(t.warnings===void 0,"Cannot override warnings"),J(t.debug===void 0,"Cannot override debug"),Tt.checkPreferences(t);let e=this.clone();return e._preferences=Tt.preferences(e._preferences,t),e}presence(t){return J(["optional","required","forbidden"].includes(t),"Unknown presence mode",t),this.$_setFlag("presence",t)}raw(t=!0){return this.$_setFlag("result",t?"raw":void 0)}result(t){return J(["raw","strip"].includes(t),"Unknown result mode",t),this.$_setFlag("result",t)}required(){return this.presence("required")}strict(t){let e=this.clone(),n=t===void 0?!1:!t;return e._preferences=Tt.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){J(t.length,"Missing tags");for(let e of t)J(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return J(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){Tt.verifyFlat(t,"valid");let e=this.allow(...t);return e.$_setFlag("only",!!e._valids,{clone:!1}),e}when(t,e){let n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);let r=zb.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)J(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),J(!s.otherwise||s.otherwise.type==="any"||s.otherwise.type===n.type,"Cannot combine",n.type,"with",s.otherwise&&s.otherwise.type)}return n.$_terms.whens.push(r),n.$_mutateRebuild()}cache(t){J(!this._inRuleset(),"Cannot set caching inside a ruleset"),J(!this._cache,"Cannot override schema cache"),J(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||KN.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){J(Tt.isSchema(t),"Invalid schema object"),J(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),J(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),J(!t._inRuleset(),"Cannot concatenate a schema with open ruleset");let e=this.clone();if(this.type==="any"&&t.type!=="any"){let n=t.clone();for(let r of Object.keys(e))r!=="type"&&(n[r]=e[r]);e=n}e._ids.concat(t._ids),e._refs.register(t,zk.toSibling),e._preferences=e._preferences?Tt.preferences(e._preferences,t._preferences):t._preferences,e._valids=Zh.merge(e._valids,t._valids,t._invalids),e._invalids=Zh.merge(e._invalids,t._invalids,t._valids);for(let n of t._singleRules.keys())e._singleRules.has(n)&&(e._rules=e._rules.filter(r=>r.keep||r.name!==n),e._singleRules.delete(n));for(let n of t._rules)t._definition.rules[n.method].multi||e._singleRules.set(n.name,n),e._rules.push(n);if(e._flags.empty&&t._flags.empty){e._flags.empty=e._flags.empty.concat(t._flags.empty);let n=Object.assign({},t._flags);delete n.empty,Gb(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,Gb(e._flags,n)}else Gb(e._flags,t._flags);for(let n in t.$_terms){let r=t.$_terms[n];if(!r){e.$_terms[n]||(e.$_terms[n]=r);continue}if(!e.$_terms[n]){e.$_terms[n]=r.slice();continue}e.$_terms[n]=e.$_terms[n].concat(r)}return this.$_root._tracer&&this.$_root._tracer._combine(e,[this,t]),e.$_mutateRebuild()}extend(t){return J(!t.base,"Cannot extend type with another base"),XN.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){J(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(t))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,e,n);return n.$_temp.ruleset=!1,n}rule(t){let e=this._definition;Tt.assertOptions(t,Object.keys(e.modifiers)),J(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");let n=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;J(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");let r=this.clone();for(let i=n;i<r._rules.length;++i){let s=r._rules[i],o=Wk(s);for(let a in t)e.modifiers[a](o,t[a]),J(o.name===s.name,"Cannot change rule name");r._rules[i]=o,r._singleRules.get(o.name)===s&&r._singleRules.set(o.name,o)}return r.$_temp.ruleset=!1,r.$_mutateRebuild()}get ruleset(){J(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");let t=this.clone();return t.$_temp.ruleset=t._rules.length,t}get $(){return this.ruleset}tailor(t){t=[].concat(t),J(!this._inRuleset(),"Cannot tailor inside a ruleset");let e=this;if(this.$_terms.alterations)for(let{target:n,adjuster:r}of this.$_terms.alterations)t.includes(n)&&(e=r(e),J(Tt.isSchema(e),"Alteration adjuster for",n,"failed to return a schema object"));return e=e.$_modify({each:n=>n.tailor(t),ref:!1}),e.$_temp.ruleset=!1,e.$_mutateRebuild()}tracer(){return Kk.location?Kk.location(this):this}validate(t,e){return Qh.entry(t,this,e)}validateAsync(t,e){return Qh.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),J(t&&typeof t=="object","Invalid options"),J(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)J(s[0]!=="_","Cannot set private rule properties");let e=Object.assign({},t);e._resolve=[],e.method=e.method||e.name;let n=this._definition.rules[e.method],r=e.args;J(n,"Unknown rule",e.method);let i=this.clone();if(r){J(Object.keys(r).length===1||Object.keys(r).length===this._definition.rules[e.name].args.length,"Invalid rule definition for",this.type,e.name);for(let s in r){let o=r[s];if(n.argsByName){let a=n.argsByName.get(s);if(a.ref&&Tt.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=Tt.validateArg(o,s,a);J(!u,u,"or reference")}}if(o===void 0){delete r[s];continue}r[s]=o}}return n.multi||(i._ruleRemove(e.name,{clone:!1}),i._singleRules.set(e.name,e)),i.$_temp.ruleset===!1&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(e):i._rules.push(e),i}$_compile(t,e){return zb.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?YN.merge(this._definition.messages,s.messages):this._definition.messages;return new VN.Report(t,e,n,o,a,r,i)}$_getFlag(t){return this._flags[t]}$_getRule(t){return this._singleRules.get(t)}$_mapLabels(t){return t=Array.isArray(t)?t:t.split("."),this._ids.labels(t)}$_match(t,e,n,r){n=Object.assign({},n),n.abortEarly=!0,n._externals=!1,e.snapshot();let i=!Qh.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return Tt.assertOptions(t,["each","once","ref","schema"]),Gk.schema(this,t)||this}$_mutateRebuild(){J(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset();let t=(e,{source:n,name:r,path:i,key:s})=>{let o=this._definition[n][r]&&this._definition[n][r].register;o!==!1&&this.$_mutateRegister(e,{family:o,key:s})};return this.$_modify({each:t}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(t,{family:e,key:n}={}){this._refs.register(t,e),this._ids.register(t,{key:n})}$_property(t){return this._definition.properties[t]}$_reach(t){return this._ids.reach(t)}$_rootReferences(){return this._refs.roots()}$_setFlag(t,e,n={}){J(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(Uk(e,r.default)&&(e=void 0),Uk(e,this._flags[t]))return this;let i=n.clone!==!1?this.clone():this;return e!==void 0?(i._flags[t]=e,i.$_mutateRegister(e)):delete i._flags[t],t[0]!=="_"&&(i.$_temp.ruleset=!1),i}$_parent(t,...e){return this[t][Tt.symbols.parent].call(this,...e)}$_validate(t,e,n){return Qh.validate(t,this,e,n)}_assign(t){t.type=this.type,t.$_root=this.$_root,t.$_temp=Object.assign({},this.$_temp),t.$_temp.whens={},t._ids=this._ids.clone(),t._preferences=this._preferences,t._valids=this._valids&&this._valids.clone(),t._invalids=this._invalids&&this._invalids.clone(),t._rules=this._rules.slice(),t._singleRules=Wk(this._singleRules,{shallow:!0}),t._refs=this._refs.clone(),t._flags=Object.assign({},this._flags),t._cache=null,t.$_terms={};for(let e in this.$_terms)t.$_terms[e]=this.$_terms[e]?this.$_terms[e].slice():null;t.$_super={};for(let e in this.$_super)t.$_super[e]=this._super[e].bind(t);return t}_bare(){let t=this.clone();t._reset();let e=t._definition.terms;for(let n in e){let r=e[n];t.$_terms[n]=r.init}return t.$_mutateRebuild()}_default(t,e,n={}){return Tt.assertOptions(n,"literal"),J(e!==void 0,"Missing",t,"value"),J(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[Tt.symbols.literal]:!0,literal:e}),this.$_setFlag(t,e)}_generate(t,e,n){if(!this.$_terms.whens)return{schema:this};let r=[],i=[];for(let a=0;a<this.$_terms.whens.length;++a){let u=this.$_terms.whens[a];if(u.concat){r.push(u.concat),i.push(`${a}.concat`);continue}let c=u.ref?u.ref.resolve(t,e,n):t,l=u.is?[u]:u.switch,h=i.length;for(let d=0;d<l.length;++d){let{is:g,then:_,otherwise:b}=l[d],C=`${a}${u.switch?"."+d:""}`;if(g.$_match(c,e.nest(g,`${C}.is`),n)){if(_){let A=e.localize([...e.path,`${C}.then`],e.ancestors,e.schemas),{schema:w,id:T}=_._generate(t,A,n);r.push(w),i.push(`${C}.then${T?`(${T})`:""}`);break}}else if(b){let A=e.localize([...e.path,`${C}.otherwise`],e.ancestors,e.schemas),{schema:w,id:T}=b._generate(t,A,n);r.push(w),i.push(`${C}.otherwise${T?`(${T})`:""}`);break}}if(u.break&&i.length>h)break}let s=i.join(", ");if(e.mainstay.tracer.debug(e,"rule","when",s),!s)return{schema:this};if(!e.mainstay.tracer.active&&this.$_temp.whens[s])return{schema:this.$_temp.whens[s],id:s};let o=this;this._definition.generate&&(o=this._definition.generate(this,t,e,n));for(let a of r)o=o.concat(a);return this.$_root._tracer&&this.$_root._tracer._combine(o,[this,...r]),this.$_temp.whens[s]=o,{schema:o,id:s}}_inner(t,e,n={}){J(!this._inRuleset(),`Cannot set ${t} inside a ruleset`);let r=this.clone();return(!r.$_terms[t]||n.override)&&(r.$_terms[t]=[]),n.single?r.$_terms[t].push(e):r.$_terms[t].push(...e),r.$_temp.ruleset=!1,r}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(t,e={}){if(!this._singleRules.has(t))return this;let n=e.clone!==!1?this.clone():this;n._singleRules.delete(t);let r=[];for(let i=0;i<n._rules.length;++i){let s=n._rules[i];if(s.name===t&&!s.keep){n._inRuleset()&&i<n.$_temp.ruleset&&--n.$_temp.ruleset;continue}r.push(s)}return n._rules=r,n}_values(t,e){Tt.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===Tt.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new Zh:r&&(n[e]=t.length?new Zh:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){J(i!==void 0,"Cannot call allow/valid/invalid with undefined"),J(i!==Tt.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(J(e==="_valids"||!n._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),n[s]=null)),n[e].add(i,n._refs)}return n}};Bt.Base.prototype[Tt.symbols.any]={version:Tt.version,compile:zb.compile,root:"$_root"};Bt.Base.prototype.isImmutable=!0;Bt.Base.prototype.deny=Bt.Base.prototype.invalid;Bt.Base.prototype.disallow=Bt.Base.prototype.invalid;Bt.Base.prototype.equal=Bt.Base.prototype.valid;Bt.Base.prototype.exist=Bt.Base.prototype.required;Bt.Base.prototype.not=Bt.Base.prototype.invalid;Bt.Base.prototype.options=Bt.Base.prototype.prefs;Bt.Base.prototype.preferences=Bt.Base.prototype.prefs;Vk.exports=new Bt.Base});var tr=m((xK,Yk)=>{"use strict";var ed=Me(),JN=Xk(),QN=Je(),ZN=Wo();Yk.exports=JN.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,e){return ed(typeof t=="function","Method must be a function"),ed(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:e}})},validate(t,e,{method:n}){try{return n(t,e)}catch(r){return e.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){ed(QN.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");let e=this.clone();return e.$_terms.shared=e.$_terms.shared||[],e.$_terms.shared.push(t),e.$_mutateRegister(t),e}},warning:{method(t,e){return ed(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:e},warn:!0})},validate(t,e,{code:n,local:r}){return e.error(n,r)},args:["code","local"],multi:!0}},modifiers:{keep(t,e=!0){t.keep=e},message(t,e){t.message=ZN.compile(e)},warn(t,e=!0){t.warn=e}},manifest:{build(t,e){for(let n in e){let r=e[n];if(["examples","externals","metas","notes","tags"].includes(n)){for(let i of r)t=t[n.slice(0,-1)](i);continue}if(n==="alterations"){let i={};for(let{target:s,adjuster:o}of r)i[s]=o;t=t.alter(i);continue}if(n==="whens"){for(let i of r){let{ref:s,is:o,not:a,then:u,otherwise:c,concat:l}=i;l?t=t.concat(l):s?t=t.when(s,{is:o,not:a,then:u,otherwise:c,switch:i.switch,break:i.break}):t=t.when(o,{then:u,otherwise:c,break:i.break})}continue}if(n==="shared")for(let i of r)t=t.shared(i)}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})});var Zk=m((AK,Qk)=>{"use strict";var Is=Me(),eq=Yh(),tq=tr(),Jk=Je(),nq=Ds(),td=di(),rq=fi(),zo={};Qk.exports=tq.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:rq.toSibling}},args(t,...e){return e.length===1&&Array.isArray(e[0])?t.try(...e[0]):t.try(...e)},validate(t,e){let{schema:n,error:r,state:i,prefs:s}=e;if(n._flags.match){let a=[],u=[];for(let l=0;l<n.$_terms.matches.length;++l){let h=n.$_terms.matches[l],d=i.nest(h.schema,`match.${l}`);d.snapshot();let g=h.schema.$_validate(t,d,s);g.errors?(u.push(g.errors),d.restore()):(a.push(g.value),d.commit())}if(a.length===0){let l={details:u.map(h=>td.details(h,{override:!1}))};return{errors:r("alternatives.any",l)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let l={details:u.map(h=>td.details(h,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(h=>h.schema.type==="object"||h.schema.type==="alternatives"&&c(h.schema));return c(n)?{value:a.reduce((l,h)=>eq(l,h,{mergeArrays:!1}))}:{value:a[a.length-1]}}let o=[];for(let a=0;a<n.$_terms.matches.length;++a){let u=n.$_terms.matches[a];if(u.schema){let h=i.nest(u.schema,`match.${a}`);h.snapshot();let d=u.schema.$_validate(t,h,s);if(!d.errors)return h.commit(),d;h.restore(),o.push({schema:u.schema,reports:d.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let h=0;h<l.length;++h){let d=l[h],{is:g,then:_,otherwise:b}=d,C=`match.${a}${u.switch?"."+h:""}`;if(g.$_match(c,i.nest(g,`${C}.is`),s)){if(_)return _.$_validate(t,i.nest(_,`${C}.then`),s)}else if(b)return b.$_validate(t,i.nest(b,`${C}.otherwise`),s)}}return zo.errors(o,e)},rules:{conditional:{method(t,e){Is(!this._flags._endedSwitch,"Unreachable condition"),Is(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Is(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=nq.when(n,t,e),i=r.is?[r]:r.switch;for(let s of i)if(s.then&&s.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(r),n.$_mutateRebuild()}},match:{method(t){if(Is(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Is(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Is(t.length,"Missing alternative schemas"),Jk.verifyFlat(t,"try"),Is(!this._flags._endedSwitch,"Unreachable condition");let e=this.clone();for(let n of t)e.$_terms.matches.push({schema:e.$_compile(n)});return e.$_mutateRebuild()}}},overrides:{label(t){let e=this.$_parent("label",t),n=(r,i)=>i.path[0]!=="is"&&typeof r._flags.label!="string"?r.label(t):void 0;return e.$_modify({each:n,ref:!1})}},rebuild(t){let e=n=>{Jk.isSchema(n)&&n.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})};t.$_modify({each:e})},manifest:{build(t,e){if(e.matches)for(let n of e.matches){let{schema:r,ref:i,is:s,not:o,then:a,otherwise:u}=n;r?t=t.try(r):i?t=t.conditional(i,{is:s,then:a,not:o,otherwise:u,switch:n.switch}):t=t.conditional(s,{then:a,otherwise:u})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}});zo.errors=function(t,{error:e,state:n}){if(!t.length)return{errors:e("alternatives.any")};if(t.length===1)return{errors:t[0].reports};let r=new Set,i=[];for(let{reports:s,schema:o}of t){if(s.length>1)return zo.unmatched(t,e);let a=s[0];if(!(a instanceof td.Report))return zo.unmatched(t,e);if(a.state.path.length!==n.path.length){i.push({type:o.type,report:a});continue}if(a.code==="any.only"){for(let l of a.local.valids)r.add(l);continue}let[u,c]=a.code.split(".");c!=="base"?i.push({type:o.type,report:a}):a.code==="object.base"?r.add(a.local.type):r.add(u)}return i.length?i.length===1?{errors:i[0].report}:zo.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};zo.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",td.details(n,{override:!1}))}}});var t1=m((kK,e1)=>{"use strict";var _u=Me(),iq=mu(),sq=Cs(),oq=tr(),nr=Je(),aq=Ds(),ct={};e1.exports=oq.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(t,{schema:e,state:n,prefs:r}){if(!Array.isArray(t))return;let i=e.$_getRule("sort");if(i)return ct.sort(e,t,i.args.options,n,r)}},validate(t,{schema:e,error:n}){if(!Array.isArray(t)){if(e._flags.single){let r=[t];return r[nr.symbols.arraySingle]=!0,{value:r}}return{errors:n("array.base")}}if(!(!e.$_getRule("items")&&!e.$_terms.externals))return{value:t.slice()}},rules:{has:{method(t){t=this.$_compile(t,{appendPath:!0});let e=this.$_addRule({name:"has",args:{schema:t}});return e.$_mutateRegister(t),e},validate(t,{state:e,prefs:n,error:r},{schema:i}){let s=[t,...e.ancestors];for(let a=0;a<t.length;++a){let u=e.localize([...e.path,a],s,i);if(i.$_match(t[a],u,n))return t}let o=i._flags.label;return o?r("array.hasKnown",{patternLabel:o}):r("array.hasUnknown",null)},multi:!0},items:{method(...t){nr.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=nr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});e.$_terms.items.push(r)}return e.$_mutateRebuild()},validate(t,{schema:e,error:n,state:r,prefs:i,errorsArray:s}){let o=e.$_terms._requireds.slice(),a=e.$_terms.ordered.slice(),u=[...e.$_terms._inclusions,...o],c=!t[nr.symbols.arraySingle];delete t[nr.symbols.arraySingle];let l=s(),h=t.length;for(let d=0;d<h;++d){let g=t[d],_=!1,b=!1,C=c?d:new Number(d),A=[...r.path,C];if(!e._flags.sparse&&g===void 0){if(l.push(n("array.sparse",{key:C,path:A,pos:d,value:void 0},r.localize(A))),i.abortEarly)return l;a.shift();continue}let w=[t,...r.ancestors];for(let R of e.$_terms._exclusions)if(R.$_match(g,r.localize(A,w,R),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:d,value:g},r.localize(A))),i.abortEarly)return l;_=!0,a.shift();break}if(_)continue;if(e.$_terms.ordered.length){if(a.length){let R=a.shift(),B=R.$_validate(g,r.localize(A,w,R),i);if(B.errors){if(l.push(...B.errors),i.abortEarly)return l}else if(R._flags.result==="strip")ct.fastSplice(t,d),--d,--h;else if(!e._flags.sparse&&B.value===void 0){if(l.push(n("array.sparse",{key:C,path:A,pos:d,value:void 0},r.localize(A))),i.abortEarly)return l;continue}else t[d]=B.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:d,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let T=[],v=o.length;for(let R=0;R<v;++R){let B=r.localize(A,w,o[R]);B.snapshot();let ee=o[R].$_validate(g,B,i);if(T[R]=ee,!ee.errors){if(B.commit(),t[d]=ee.value,b=!0,ct.fastSplice(o,R),--R,--v,!e._flags.sparse&&ee.value===void 0&&(l.push(n("array.sparse",{key:C,path:A,pos:d,value:void 0},r.localize(A))),i.abortEarly))return l;break}B.restore()}if(b)continue;let L=i.stripUnknown&&!!i.stripUnknown.arrays||!1;v=u.length;for(let R of u){let B,ee=o.indexOf(R);if(ee!==-1)B=T[ee];else{let ie=r.localize(A,w,R);if(ie.snapshot(),B=R.$_validate(g,ie,i),!B.errors){ie.commit(),R._flags.result==="strip"?(ct.fastSplice(t,d),--d,--h):!e._flags.sparse&&B.value===void 0?(l.push(n("array.sparse",{key:C,path:A,pos:d,value:void 0},r.localize(A))),_=!0):t[d]=B.value,b=!0;break}ie.restore()}if(v===1){if(L){ct.fastSplice(t,d),--d,--h,b=!0;break}if(l.push(...B.errors),i.abortEarly)return l;_=!0;break}}if(!_&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!b){if(L){ct.fastSplice(t,d),--d,--h;continue}if(l.push(n("array.includes",{pos:d,value:g},r.localize(A))),i.abortEarly)return l}}return o.length&&ct.fillMissedErrors(e,l,o,t,r,i),a.length&&(ct.fillOrderedErrors(e,l,a,t,r,i),l.length||ct.fillDefault(a,t,r,i)),l.length?l:t},priority:!0,manifest:!1},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return nr.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:nr.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},ordered:{method(...t){nr.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=nr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});ct.validateSingle(r,e),e.$_mutateRegister(r),e.$_terms.ordered.push(r)}return e.$_mutateRebuild()}},single:{method(t){let e=t===void 0?!0:!!t;return _u(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){nr.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=aq.ref(t.by,{ancestor:0}),_u(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(t,{error:e,state:n,prefs:r,schema:i},{options:s}){let{value:o,errors:a}=ct.sort(i,t,s,n,r);if(a)return a;for(let u=0;u<t.length;++u)if(t[u]!==o[u])return e("array.sort",{order:s.order,by:s.by?s.by.key:"value"});return t},convert:!0},sparse:{method(t){let e=t===void 0?!0:!!t;return this._flags.sparse===e?this:(e?this.clone():this.$_addRule("items")).$_setFlag("sparse",e,{clone:!1})}},unique:{method(t,e={}){_u(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),nr.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=nr.default(e.separator,".");n.path=r?t.split(r):[t]}else n.comparator=t;return this.$_addRule(n)},validate(t,{state:e,error:n,schema:r},{comparator:i,options:s},{comparator:o,path:a}){let u={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},c=o||iq,l=s.ignoreUndefined;for(let h=0;h<t.length;++h){let d=a?sq(t[h],a):t[h],g=o?u.custom:u[typeof d];if(_u(g,"Failed to find unique map container for type",typeof d),g instanceof Map){let _=g.entries(),b;for(;!(b=_.next()).done;)if(c(b.value[0],d)){let C=e.localize([...e.path,h],[t,...e.ancestors]),A={pos:h,value:t[h],dupePos:b.value[1],dupeValue:t[b.value[1]]};return a&&(A.path=i),n("array.unique",A,C)}g.set(d,h)}else{if((!l||d!==void 0)&&g[d]!==void 0){let _={pos:h,value:t[h],dupePos:g[d],dupeValue:t[g[d]]};a&&(_.path=i);let b=e.localize([...e.path,h],[t,...e.ancestors]);return n("array.unique",_,b)}g[d]=h}}return t},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to(t,e){return new Set(t)}}},rebuild(t){t.$_terms._inclusions=[],t.$_terms._exclusions=[],t.$_terms._requireds=[];for(let e of t.$_terms.items)ct.validateSingle(e,t),e._flags.presence==="required"?t.$_terms._requireds.push(e):e._flags.presence==="forbidden"?t.$_terms._exclusions.push(e):t.$_terms._inclusions.push(e);for(let e of t.$_terms.ordered)ct.validateSingle(e,t)},manifest:{build(t,e){return e.items&&(t=t.items(...e.items)),e.ordered&&(t=t.ordered(...e.ordered)),t}},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}});ct.fillMissedErrors=function(t,e,n,r,i,s){let o=[],a=0;for(let u of n){let c=u._flags.label;c?o.push(c):++a}o.length?a?e.push(t.$_createError("array.includesRequiredBoth",r,{knownMisses:o,unknownMisses:a},i,s)):e.push(t.$_createError("array.includesRequiredKnowns",r,{knownMisses:o},i,s)):e.push(t.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},i,s))};ct.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&ct.fillMissedErrors(t,e,o,r,i,s)};ct.fillDefault=function(t,e,n,r){let i=[],s=!0;for(let o=t.length-1;o>=0;--o){let a=t[o],u=[e,...n.ancestors],c=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(s){if(c===void 0)continue;s=!1}i.unshift(c)}i.length&&e.push(...i)};ct.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};ct.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(_u(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};ct.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let h=ct.compare(c,l,o,a);if(h!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),h=ct.compare(c,l,o,a),h!==null))return h;let d=typeof c;if(d!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(d!=="number"&&d!=="string")throw t.$_createError("array.sort.unsupported",e,{type:d},r,i);return d==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};ct.compare=function(t,e,n,r){return t===e?0:t===void 0?1:e===void 0?-1:t===null?r:e===null?n:null}});var o1=m((CK,s1)=>{"use strict";var n1=Me(),uq=tr(),r1=Je(),i1=Hb(),Kb={};Kb.isBool=function(t){return typeof t=="boolean"};s1.exports=uq.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(t,{schema:e}){if(typeof t!="boolean"){if(typeof t=="string"){let n=e._flags.sensitive?t:t.toLowerCase();t=n==="true"?!0:n==="false"?!1:t}return typeof t!="boolean"&&(t=e.$_terms.truthy&&e.$_terms.truthy.has(t,null,null,!e._flags.sensitive)||(e.$_terms.falsy&&e.$_terms.falsy.has(t,null,null,!e._flags.sensitive)?!1:t)),{value:t}}},validate(t,{error:e}){if(typeof t!="boolean")return{value:t,errors:e("boolean.base")}},rules:{truthy:{method(...t){r1.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new i1;for(let n=0;n<t.length;++n){let r=t[n];n1(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){r1.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new i1;for(let n=0;n<t.length;++n){let r=t[n];n1(r!==void 0,"Cannot call falsy with undefined"),e.$_terms.falsy.add(r)}return e}},sensitive:{method(t=!0){return this.$_setFlag("sensitive",t)}}},cast:{number:{from:Kb.isBool,to(t,e){return t?1:0}},string:{from:Kb.isBool,to(t,e){return t?"true":"false"}}},manifest:{build(t,e){return e.truthy&&(t=t.truthy(...e.truthy)),e.falsy&&(t=t.falsy(...e.falsy)),t}},messages:{"boolean.base":"{{#label}} must be a boolean"}})});var l1=m((OK,c1)=>{"use strict";var a1=Me(),cq=tr(),u1=Je(),lq=Qi(),wr={};wr.isDate=function(t){return t instanceof Date};c1.exports=cq.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:wr.parse(t,e._flags.format)||t}}},validate(t,{schema:e,error:n,prefs:r}){if(t instanceof Date&&!isNaN(t.getTime()))return;let i=e._flags.format;return!r.convert||!i||typeof t!="string"?{value:t,errors:n("date.base")}:{value:t,errors:n("date.format",{format:i})}},rules:{compare:{method:!1,validate(t,e,{date:n},{name:r,operator:i,args:s}){let o=n==="now"?Date.now():n.getTime();return u1.compare(t.getTime(),o,i)?t:e.error("date."+r,{limit:s.date,value:t})},args:[{name:"date",ref:!0,normalize:t=>t==="now"?t:wr.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return a1(["iso","javascript","unix"].includes(t),"Unknown date format",t),this.$_setFlag("format",t)}},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{date:t},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{date:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{date:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{date:t},operator:">="})}},timestamp:{method(t="javascript"){return a1(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:wr.isDate,to(t,e){return t.getTime()}},string:{from:wr.isDate,to(t,{prefs:e}){return lq.date(t,e)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}});wr.parse=function(t,e){if(t instanceof Date)return t;if(typeof t!="string"&&(isNaN(t)||!isFinite(t))||/^\s*$/.test(t))return null;if(e==="iso")return u1.isIsoDate(t)?wr.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return wr.date(1*t);if(e==="unix")return wr.date(1e3*t);if(typeof n=="string")return null}return wr.date(t)};wr.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var g1=m((RK,p1)=>{"use strict";var nd=Me(),d1=hn(),f1=Yh(),h1=Cs(),rd={};p1.exports=function(t,e,n={}){if(nd(t&&typeof t=="object","Invalid defaults value: must be an object"),nd(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),nd(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return rd.applyToDefaultsWithShallow(t,e,n);let r=d1(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return f1(r,e,{nullOverride:i,mergeArrays:!1})};rd.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;nd(Array.isArray(r),"Invalid keys");let i=new Map,s=e===!0?null:new Set;for(let u of r){u=Array.isArray(u)?u:u.split(".");let c=h1(t,u);c&&typeof c=="object"?i.set(c,s&&h1(e,u)||c):s&&s.add(u)}let o=d1(t,{},i);if(!s)return o;for(let u of s)rd.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return f1(o,e,{nullOverride:a,mergeArrays:!1})};rd.reachCopy=function(t,e,n){for(let s of n){if(!(s in e))return;let o=e[s];if(typeof o!="object"||o===null)return;e=o}let r=e,i=t;for(let s=0;s<n.length-1;++s){let o=n[s];typeof i[o]!="object"&&(i[o]={}),i=i[o]}i[n[n.length-1]]=r}});var b1=m(y1=>{"use strict";var Ms=Me(),m1={};y1.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(t,e){e=e||{};let n=[].concat(e.before||[]),r=[].concat(e.after||[]),i=e.group||"?",s=e.sort||0;Ms(!n.includes(i),`Item cannot come before itself: ${i}`),Ms(!n.includes("?"),"Item cannot come before unassociated items"),Ms(!r.includes(i),`Item cannot come after itself: ${i}`),Ms(!r.includes("?"),"Item cannot come after unassociated items"),Array.isArray(t)||(t=[t]);for(let o of t){let a={seq:this._items.length,sort:s,before:n,after:r,group:i,node:o};this._items.push(a)}if(!e.manual){let o=this._sort();Ms(o,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(t){Array.isArray(t)||(t=[t]);for(let n of t)if(n)for(let r of n._items)this._items.push(Object.assign({},r));this._items.sort(m1.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Ms(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Ms(t,"sort created a dependencies error"),this.nodes}_sort(){let t={},e=Object.create(null),n=Object.create(null);for(let a of this._items){let u=a.seq,c=a.group;n[c]=n[c]||[],n[c].push(u),t[u]=a.before;for(let l of a.after)e[l]=e[l]||[],e[l].push(u)}for(let a in t){let u=[];for(let c in t[a]){let l=t[a][c];n[l]=n[l]||[],u.push(...n[l])}t[a]=u}for(let a in e)if(n[a])for(let u of n[a])t[u].push(...e[a]);let r={};for(let a in t){let u=t[a];for(let c of u)r[c]=r[c]||[],r[c].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let c=0;c<this._items.length;++c){if(i[c]===!0)continue;r[c]||(r[c]=[]);let l=r[c].length,h=0;for(let d=0;d<l;++d)i[r[c][d]]&&++h;if(h===l){u=c;break}}}u!==null&&(i[u]=!0,s.push(u))}if(s.length!==this._items.length)return!1;let o={};for(let a of this._items)o[a.seq]=a;this._items=[],this.nodes=[];for(let a of s){let u=o[a];this.nodes.push(u.node),this._items.push(u)}return!0}};m1.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var Xb=m((IK,S1)=>{"use strict";var hq=g1(),rr=Me(),_1=hn(),dq=b1(),fq=tr(),on=Je(),Vb=Ds(),pq=di(),v1=fi(),id=Qi(),le={renameDefaults:{alias:!1,multiple:!1,override:!1}};S1.exports=fq.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args(t,e){return t.keys(e)},validate(t,{schema:e,error:n,state:r,prefs:i}){if(!t||typeof t!==e.$_property("typeof")||Array.isArray(t))return{value:t,errors:n("object.base",{type:e.$_property("typeof")})};if(!e.$_terms.renames&&!e.$_terms.dependencies&&!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.externals)return;t=le.clone(t,i);let s=[];if(e.$_terms.renames&&!le.rename(e,t,r,i,s))return{value:t,errors:s};if(!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.dependencies)return{value:t,errors:s};let o=new Set(Object.keys(t));if(e.$_terms.keys){let a=[t,...r.ancestors];for(let u of e.$_terms.keys){let c=u.key,l=t[c];o.delete(c);let h=r.localize([...r.path,c],a,u),d=u.schema.$_validate(l,h,i);if(d.errors){if(i.abortEarly)return{value:t,errors:d.errors};d.value!==void 0&&(t[c]=d.value),s.push(...d.errors)}else u.schema._flags.result==="strip"||d.value===void 0&&l!==void 0?delete t[c]:d.value!==void 0&&(t[c]=d.value)}}if(o.size||e._flags._hasPatternMatch){let a=le.unknown(e,t,o,s,r,i);if(a)return a}if(e.$_terms.dependencies)for(let a of e.$_terms.dependencies){if(a.key!==null&&le.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=le.dependencies[a.rel](e,a,t,r,i);if(u){let c=e.$_createError(u.code,t,u.context,r,i);if(i.abortEarly)return{value:t,errors:c};s.push(c)}}return{value:t,errors:s}},rules:{and:{method(...t){return on.verifyFlat(t,"and"),le.dependency(this,"and",null,t)}},append:{method(t){return t==null||Object.keys(t).length===0?this:this.keys(t)}},assert:{method(t,e,n){id.isTemplate(t)||(t=Vb.ref(t)),rr(n===void 0||typeof n=="string","Message must be a string"),e=this.$_compile(e,{appendPath:!0});let r=this.$_addRule({name:"assert",args:{subject:t,schema:e,message:n}});return r.$_mutateRegister(t),r.$_mutateRegister(e),r},validate(t,{error:e,prefs:n,state:r},{subject:i,schema:s,message:o}){let a=i.resolve(t,r,n),u=v1.isRef(i)?i.absolute(r):[];return s.$_match(a,r.localize(u,[t,...r.ancestors],s),n)?t:e("object.assert",{subject:i,message:o})},args:["subject","schema","message"],multi:!0},instance:{method(t,e){return rr(typeof t=="function","constructor must be a function"),e=e||t.name,this.$_addRule({name:"instance",args:{constructor:t,name:e}})},validate(t,e,{constructor:n,name:r}){return t instanceof n?t:e.error("object.instance",{type:r,value:t})},args:["constructor","name"]},keys:{method(t){rr(t===void 0||typeof t=="object","Object schema must be a valid object"),rr(!on.isSchema(t),"Object schema cannot be a joi schema");let e=this.clone();if(!t)e.$_terms.keys=null;else if(!Object.keys(t).length)e.$_terms.keys=new le.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new le.Keys;for(let n in t)on.tryWithPath(()=>e.$_terms.keys.push({key:n,schema:this.$_compile(t[n])}),n)}return e.$_mutateRebuild()}},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return on.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:on.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},nand:{method(...t){return on.verifyFlat(t,"nand"),le.dependency(this,"nand",null,t)}},or:{method(...t){return on.verifyFlat(t,"or"),le.dependency(this,"or",null,t)}},oxor:{method(...t){return le.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),rr(e!==void 0,"Invalid rule"),on.assertOptions(n,["fallthrough","matches"]),r&&rr(!t.flags.includes("g")&&!t.flags.includes("y"),"pattern should not use global or sticky mode"),e=this.$_compile(e,{appendPath:!0});let i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];let s={[r?"regex":"schema"]:t,rule:e};return n.matches&&(s.matches=this.$_compile(n.matches),s.matches.type!=="array"&&(s.matches=s.matches.$_root.array().items(s.matches)),i.$_mutateRegister(s.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(s.fallthrough=!0),i.$_terms.patterns.push(s),i.$_mutateRegister(e),i}},ref:{method(){return this.$_addRule("ref")},validate(t,e){return v1.isRef(t)?t:e.error("object.refType",{value:t})}},regex:{method(){return this.$_addRule("regex")},validate(t,e){return t instanceof RegExp?t:e.error("object.regex",{value:t})}},rename:{method(t,e,n={}){rr(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),rr(typeof e=="string"||e instanceof id,"Invalid rename to argument"),rr(e!==t,"Cannot rename key to same name:",t),on.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)rr(i.from!==t,"Cannot rename the same key multiple times");return e instanceof id&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:hq(le.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return on.isSchema(t)&&(n==="any"||t.type===n)?t:e.error("object.schema",{type:n})}},unknown:{method(t){return this.$_setFlag("unknown",t!==!1)}},with:{method(t,e,n={}){return le.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return le.dependency(this,"without",t,e,n)}},xor:{method(...t){return on.verifyFlat(t,"xor"),le.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=on.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new dq.Sorter;for(let n of t.$_terms.keys)on.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new le.Keys(...e.nodes)}},manifest:{build(t,e){if(e.keys&&(t=t.keys(e.keys)),e.dependencies)for(let{rel:n,key:r=null,peers:i,options:s}of e.dependencies)t=le.dependency(t,n,r,i,s);if(e.patterns)for(let{regex:n,schema:r,rule:i,fallthrough:s,matches:o}of e.patterns)t=t.pattern(n||r,i,{fallthrough:s,matches:o});if(e.renames)for(let{from:n,to:r,options:i}of e.renames)t=t.rename(n,r,i);return t}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}});le.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return _1(t,{shallow:!0});let r=Object.create(Object.getPrototypeOf(t));return Object.assign(r,t),r}let n=function(...r){return t.apply(this,r)};return n.prototype=_1(t.prototype),Object.defineProperty(n,"name",{value:t.name,writable:!1}),Object.defineProperty(n,"length",{value:t.length,writable:!1}),Object.assign(n,t),n};le.dependency=function(t,e,n,r,i){rr(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),on.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=on.default(i.separator,"."),o=[];for(let u of r)rr(typeof u=="string",e,"peers must be strings"),o.push(Vb.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=Vb.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new le.Dependency(e,n,o,r,i)),a};le.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=le.isPresent(e.options);for(let c of e.peers)u(c.resolve(n,r,i,null,{shadow:!1}))===!1?s.push(c.key):o.push(c.key);if(s.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:le.keysToLabels(t,o),missing:s,missingWithLabels:le.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let c of e.peers)o(c.resolve(n,r,i,null,{shadow:!1}))&&s.push(c.key);if(s.length!==e.peers.length)return;let a=e.paths[0],u=e.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:le.keysToLabels(t,a),peers:u,peersWithLabels:le.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(!s.length||s.length===1)return;let a={peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=le.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:e.key.key,mainWithLabel:le.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:le.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return{code:"object.without",context:{main:e.key.key,mainWithLabel:le.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:le.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(s.length===1)return;let a={peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=le.keysToLabels(t,s),{code:"object.xor",context:a})}};le.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};le.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};le.rename=function(t,e,n,r,i){let s={};for(let o of t.$_terms.renames){let a=[],u=typeof o.from!="string";if(!u)Object.prototype.hasOwnProperty.call(e,o.from)&&(e[o.from]!==void 0||!o.options.ignoreUndefined)&&a.push(o);else for(let c in e){if(e[c]===void 0&&o.options.ignoreUndefined||c===o.to)continue;let l=o.from.exec(c);l&&a.push({from:c,to:o.to,match:l})}for(let c of a){let l=c.from,h=c.to;if(h instanceof id&&(h=h.render(e,n,r,c.match)),l!==h){if(!o.options.multiple&&s[h]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:h,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,h)&&!o.options.override&&!s[h]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:h,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[h]:e[h]=e[l],s[h]=!0,o.options.alias||delete e[l]}}}return!0};le.unknown=function(t,e,n,r,i,s){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(l=>{if(l.matches)return a=!0,[]}),c=[e,...i.ancestors];for(let l of n){let h=e[l],d=[...i.path,l];for(let g=0;g<t.$_terms.patterns.length;++g){let _=t.$_terms.patterns[g];if(_.regex){let A=_.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${g}`,A?"pass":"error"),!A)continue}else if(!_.schema.$_match(l,i.nest(_.schema,`pattern.${g}`),s))continue;n.delete(l);let b=i.localize(d,c,{schema:_.rule,key:l}),C=_.rule.$_validate(h,b,s);if(C.errors){if(s.abortEarly)return{value:e,errors:C.errors};r.push(...C.errors)}if(_.matches&&u[g].push(l),e[l]=C.value,!_.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let h=u[l];if(!h)continue;let d=t.$_terms.patterns[l].matches,g=i.localize(i.path,c,d),_=d.$_validate(h,g,s);if(_.errors){let b=pq.details(_.errors,{override:!1});b.matches=h;let C=t.$_createError("object.pattern.match",e,b,i,s);if(s.abortEarly)return{value:e,errors:C};r.push(C)}}}if(!n.size||!t.$_terms.keys&&!t.$_terms.patterns)return;if(s.stripUnknown&&typeof t._flags.unknown>"u"||s.skipFunctions){let a=s.stripUnknown?s.stripUnknown===!0?!0:!!s.stripUnknown.objects:!1;for(let u of n)a?(delete e[u],n.delete(u)):typeof e[u]=="function"&&n.delete(u)}if(!on.default(t._flags.unknown,s.allowUnknown))for(let a of n){let u=i.localize([...i.path,a],[]),c=t.$_createError("object.unknown",e[a],{child:a},u,s,{flags:!1});if(s.abortEarly)return{value:e,errors:c};r.push(c)}};le.Dependency=class{constructor(t,e,n,r,i){this.rel=t,this.key=e,this.peers=n,this.paths=r,this.options=i}describe(){let t={rel:this.rel,peers:this.paths};return this.key!==null&&(t.key=this.key.key),this.peers[0].separator!=="."&&(t.options={...t.options,separator:this.peers[0].separator}),this.options.isPresent&&(t.options={...t.options,isPresent:this.options.isPresent}),t}};le.Keys=class extends Array{concat(t){let e=this.slice(),n=new Map;for(let r=0;r<e.length;++r)n.set(e[r].key,r);for(let r of t){let i=r.key,s=n.get(i);s!==void 0?e[s]={key:i,schema:e[s].schema.concat(r.schema)}:e.push(r)}return e}}});var w1=m((NK,T1)=>{"use strict";var Yb=Me(),gq=Xb();T1.exports=gq.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return Yb(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:t}})},validate(t,e,{n}){return t.length===n?t:e.error("function.arity",{n})}},class:{method(){return this.$_addRule("class")},validate(t,e){return/^\s*class\s/.test(t.toString())?t:e.error("function.class",{value:t})}},minArity:{method(t){return Yb(Number.isSafeInteger(t)&&t>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:t}})},validate(t,e,{n}){return t.length>=n?t:e.error("function.minArity",{n})}},maxArity:{method(t){return Yb(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:t}})},validate(t,e,{n}){return t.length<=n?t:e.error("function.maxArity",{n})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})});var x1=m((qK,E1)=>{"use strict";var yi=Me(),mq=tr(),yq=Je(),bq=Ds(),_q=di(),bi={};E1.exports=mq.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args(t,e){return t.ref(e)},validate(t,{schema:e,state:n,prefs:r}){yi(e.$_terms.link,"Uninitialized link schema");let i=bi.generate(e,t,n,r),s=e.$_terms.link[0].ref;return i.$_validate(t,n.nest(i,`link:${s.display}:${i.type}`),r)},generate(t,e,n,r){return bi.generate(t,e,n,r)},rules:{ref:{method(t){yi(!this.$_terms.link,"Cannot reinitialize schema"),t=bq.ref(t),yi(t.type==="value"||t.type==="local","Invalid reference type:",t.type),yi(t.type==="local"||t.ancestor==="root"||t.ancestor>0,"Link cannot reference itself");let e=this.clone();return e.$_terms.link=[{ref:t}],e}},relative:{method(t=!0){return this.$_setFlag("relative",t)}}},overrides:{concat(t){yi(this.$_terms.link,"Uninitialized link schema"),yi(yq.isSchema(t),"Invalid schema object"),yi(t.type!=="link","Cannot merge type link with another link");let e=this.clone();return e.$_terms.whens||(e.$_terms.whens=[]),e.$_terms.whens.push({concat:t}),e.$_mutateRebuild()}},manifest:{build(t,e){return yi(e.link,"Invalid link description missing link"),t.ref(e.link)}}});bi.generate=function(t,e,n,r){let i=n.mainstay.links.get(t);if(i)return i._generate(e,n,r).schema;let s=t.$_terms.link[0].ref,{perspective:o,path:a}=bi.perspective(s,n);bi.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{bi.assert(!1,"to non-existing schema",s,t,n,r)}return bi.assert(i.type!=="link","which is another link",s,t,n,r),t._flags.relative||n.mainstay.links.set(t,i),i._generate(e,n,r).schema};bi.perspective=function(t,e){if(t.type==="local"){for(let{schema:n,key:r}of e.schemas){if((n._flags.id||r)===t.path[0])return{perspective:n,path:t.path.slice(1)};if(n.$_terms.shared){for(let s of n.$_terms.shared)if(s._flags.id===t.path[0])return{perspective:s,path:t.path.slice(1)}}}return{perspective:null,path:null}}return t.ancestor==="root"?{perspective:e.schemas[e.schemas.length-1].schema,path:t.path}:{perspective:e.schemas[t.ancestor]&&e.schemas[t.ancestor].schema,path:t.path}};bi.assert=function(t,e,n,r,i,s){t||yi(!1,`"${_q.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var k1=m((jK,A1)=>{"use strict";var Jb=Me(),vq=tr(),Qb=Je(),jn={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){let e=t.toString(),n=e.indexOf("."),r=e.indexOf("e");return(n<0?0:(r<0?e.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(e.slice(r+1))))}};A1.exports=vq.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(jn.numberRx))return;t=t.trim();let i={value:parseFloat(t)};if(i.value===0&&(i.value=0),!e._flags.unsafe)if(t.match(/e/i)){if(jn.extractSignificantDigits(t)!==jn.extractSignificantDigits(String(i.value)))return i.errors=n("number.unsafe"),i}else{let s=i.value.toString();if(s.match(/e/i))return i;if(s!==jn.normalizeDecimal(t))return i.errors=n("number.unsafe"),i}return i}},validate(t,{schema:e,error:n,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!Qb.isNumber(t))return{value:t,errors:n("number.base")};let i={value:t};if(r.convert){let s=e.$_getRule("precision");if(s){let o=Math.pow(10,s.args.limit);i.value=Math.round(i.value*o)/o}}return i.value===0&&(i.value=0),!e._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(i.errors=n("number.unsafe")),i},rules:{compare:{method:!1,validate(t,e,{limit:n},{name:r,operator:i,args:s}){return Qb.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Qb.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate(t,e){return Math.trunc(t)-t===0?t:e.error("number.integer")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){let e=typeof t=="number"?jn.decimalPlaces(t):null,n=Math.pow(10,e);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:e,pfactor:n}})},validate(t,e,{base:n,baseDecimalPlace:r,pfactor:i},s){return jn.decimalPlaces(t)>r?e.error("number.multiple",{multiple:s.args.base,value:t}):Math.round(i*t)%Math.round(i*n)===0?t:e.error("number.multiple",{multiple:s.args.base,value:t})},args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate(t,e){return Number.isSafeInteger(t)&&t>=0&&t<=65535?t:e.error("number.port")}},positive:{method(){return this.sign("positive")}},precision:{method(t){return Jb(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,e,{limit:n}){let r=t.toString().match(jn.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?t:e.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return Jb(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate(t,e,{sign:n}){return n==="negative"&&t<0||n==="positive"&&t>0?t:e.error(`number.${n}`)}},unsafe:{method(t=!0){return Jb(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to(t,e){return t.toString()}}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}});jn.extractSignificantDigits=function(t){return t.replace(jn.exponentialPartRegex,"").replace(jn.dotRegex,"").replace(jn.trailingZerosRegex,"").replace(jn.leadingSignAndZerosRegex,"")};jn.normalizeDecimal=function(t){return t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2"),t.includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}});var O1=m((FK,C1)=>{"use strict";var Sq=Xb();C1.exports=Sq.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var Zb=m(sd=>{"use strict";sd.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"};sd.code=function(t){return{code:t,error:sd.codes[t]}}});var e_=m(od=>{"use strict";var Tq=require("url"),Er=Zb(),ts={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:Tq.URL||URL};od.analyze=function(t,e={}){if(!t)return Er.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return Er.code("DOMAIN_TOO_LONG");if(!!ts.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return Er.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(ts.domainControlRx.test(t))return Er.code("DOMAIN_INVALID_CHARS");t=ts.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||ts.minDomainSegments,i=t.split(".");if(i.length<r)return Er.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return Er.code("DOMAIN_SEGMENTS_COUNT_MAX");let s=e.tlds;if(s){let o=i[i.length-1].toLowerCase();if(s.deny&&s.deny.has(o)||s.allow&&!s.allow.has(o))return Er.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return Er.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return Er.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!ts.domainSegmentRx.test(a))return Er.code("DOMAIN_INVALID_CHARS")}else if(!ts.tldSegmentRx.test(a))return Er.code("DOMAIN_INVALID_TLDS_CHARS")}return null};od.isValid=function(t,e){return!od.analyze(t,e)};ts.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new ts.URL(`http://${t}`).host}catch{return t}}});var R1=m(t_=>{"use strict";var wq=require("util"),Eq=e_(),Kr=Zb(),fn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(wq.TextEncoder||TextEncoder)};t_.analyze=function(t,e){return fn.email(t,e)};t_.isValid=function(t,e){return!fn.email(t,e)};fn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return Kr.code("EMPTY_STRING");let n=!fn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return Kr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?Kr.code("MULTIPLE_AT_CHAR"):Kr.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return Kr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return Kr.code("ADDRESS_TOO_LONG");if(fn.encoder.encode(i).length>64)return Kr.code("LOCAL_TOO_LONG")}return fn.local(i,n)||Eq.analyze(s,e)};fn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return Kr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!fn.atextRx.test(r))return Kr.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(fn.atextRx.test(i))continue;let s=fn.binary(i);if(!fn.atomRx.test(s))return Kr.code("INVALID_LOCAL_CHARS")}}};fn.binary=function(t){return Array.from(fn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};fn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;fn.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))});var n_=m((UK,D1)=>{"use strict";D1.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var i_=m(r_=>{"use strict";var ad=Me(),xq=n_(),Xt={};Xt.generate=function(){let t={},e="\\dA-Fa-f",n="["+e+"]",r="\\w-\\.~",i="!\\$&'\\(\\)\\*\\+,;=",s="%"+e,o=r+s+i+":@",a="["+o+"]",u="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";t.ipv4address="(?:"+u+"\\.){3}"+u;let c=n+"{1,4}",l="(?:"+c+":"+c+"|"+t.ipv4address+")",h="(?:"+c+":){6}"+l,d="::(?:"+c+":){5}"+l,g="(?:"+c+")?::(?:"+c+":){4}"+l,_="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,b="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,C="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,A="(?:(?:"+c+":){0,4}"+c+")?::"+l,w="(?:(?:"+c+":){0,5}"+c+")?::"+c,T="(?:(?:"+c+":){0,6}"+c+")?::";t.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",t.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",t.ipv6address="(?:"+h+"|"+d+"|"+g+"|"+_+"|"+b+"|"+C+"|"+A+"|"+w+"|"+T+")",t.ipvFuture="v"+n+"+\\.["+r+i+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let v="["+r+s+i+":]*",L="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",R="["+r+s+i+"]{1,255}",B="(?:"+L+"|"+t.ipv4address+"|"+R+")",ee="\\d*",ie="(?:"+v+"@)?"+B+"(?::"+ee+")?",W="(?:"+v+"@)?("+B+")(?::"+ee+")?",O=a+"*",M=a+"+",N="["+r+s+i+"@]+",j="",de="(?:\\/"+O+")*",ce="\\/(?:"+M+de+")?",jt=M+de,_t=N+de,Fe="(?:\\/\\/\\/"+O+de+")";return t.hierPart="(?:(?:\\/\\/"+ie+de+")|"+ce+"|"+jt+"|"+Fe+")",t.hierPartCapture="(?:(?:\\/\\/"+W+de+")|"+ce+"|"+jt+")",t.relativeRef="(?:(?:\\/\\/"+ie+de+")|"+ce+"|"+_t+"|"+j+")",t.relativeRefCapture="(?:(?:\\/\\/"+W+de+")|"+ce+"|"+_t+"|"+j+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};Xt.rfc3986=Xt.generate();r_.ip={v4Cidr:Xt.rfc3986.ipv4Cidr,v6Cidr:Xt.rfc3986.ipv6Cidr,ipv4:Xt.rfc3986.ipv4address,ipv6:Xt.rfc3986.ipv6address,ipvfuture:Xt.rfc3986.ipvFuture};Xt.createRegex=function(t){let e=Xt.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Xt.wrap(i+r);let s="";if(t.scheme){ad(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let c=[].concat(t.scheme);ad(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let h=0;h<c.length;++h){let d=c[h];ad(d instanceof RegExp||typeof d=="string","scheme at position "+h+" must be a RegExp or String"),d instanceof RegExp?l.push(d.source.toString()):(ad(e.schemeRegex.test(d),"scheme at position "+h+" must be a valid scheme"),l.push(xq(d)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return Xt.wrap(u+r,s)};Xt.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Xt.uriRegex=Xt.createRegex({});r_.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Xt.createRegex(t):Xt.uriRegex}});var I1=m(P1=>{"use strict";var Ko=Me(),vu=i_();P1.regex=function(t={}){Ko(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";Ko(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),Ko(t.version===void 0||typeof t.version=="string"||Array.isArray(t.version),"options.version must be a string or an array of string");let n=t.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),Ko(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)Ko(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),Ko(["ipv4","ipv6","ipvfuture"].includes(n[o]),"options.version contains unknown version "+n[o]+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));let i=`(?:${n.map(o=>{if(e==="forbidden")return vu.ip[o];let a=`\\/${o==="ipv4"?vu.ip.v4Cidr:vu.ip.v6Cidr}`;return e==="required"?`${vu.ip[o]}${a}`:`${vu.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var N1=m((zK,L1)=>{"use strict";var M1={};M1.tlds=["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"];L1.exports=new Set(M1.tlds.map(t=>t.toLowerCase()))});var B1=m((KK,$1)=>{"use strict";var Be=Me(),ud=e_(),Aq=R1(),F1=I1(),q1=n_(),j1=N1(),kq=i_(),Cq=tr(),pn=Je(),De={tlds:j1 instanceof Set?{tlds:{allow:j1,deny:null}}:!1,base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:F1.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};$1.exports=Cq.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(t,{schema:e,state:n,prefs:r}){let i=e.$_getRule("normalize");i&&(t=t.normalize(i.args.form));let s=e.$_getRule("case");s&&(t=s.args.direction==="upper"?t.toLocaleUpperCase():t.toLocaleLowerCase());let o=e.$_getRule("trim");if(o&&o.args.enabled&&(t=t.trim()),e.$_terms.replacements)for(let u of e.$_terms.replacements)t=t.replace(u.pattern,u.replacement);let a=e.$_getRule("hex");if(a&&a.args.options.byteAligned&&t.length%2!==0&&(t=`0${t}`),e.$_getRule("isoDate")){let u=De.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(pn.isResolvable(c)&&(c=c.resolve(t,n,r),!pn.limit(c)))return{value:t,errors:e.$_createError("any.ref",c,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,c)}}return{value:t}}},validate(t,{schema:e,error:n}){if(typeof t!="string")return{value:t,errors:n("string.base")};if(t===""){let r=e.$_getRule("min");return r&&r.args.limit===0?void 0:{value:t,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate(t,e){return/^[a-zA-Z0-9]+$/.test(t)?t:e.error("string.alphanum")}},base64:{method(t={}){return pn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Be(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Be(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return De.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Be(["lower","upper"].includes(t),"Invalid case:",t),this.$_addRule({name:"case",args:{direction:t}})},validate(t,e,{direction:n}){return n==="lower"&&t===t.toLocaleLowerCase()||n==="upper"&&t===t.toLocaleUpperCase()?t:e.error(`string.${n}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(t,e){let n=t.length,r=0,i=1;for(;n--;){let s=t.charAt(n)*i;r=r+(s-(s>9)*9),i=i^3}return r>0&&r%10===0?t:e.error("string.creditCard")}},dataUri:{method(t={}){return pn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Be(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(De.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||De.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&pn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=De.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return ud.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){pn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Be(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=De.addressOptions(t),n=new RegExp(`\\s*[${t.separator?q1(t.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:t},regex:n,address:e})},validate(t,e,{options:n},{regex:r,address:i}){let s=n.multiple?t.split(r):[t],o=[];for(let a of s)Aq.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){pn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Be(i.length>=1,"version must have at least 1 valid version specified");let s=new Set;for(let o=0;o<i.length;++o){let a=i[o];Be(typeof a=="string","version at position "+o+" must be a string");let u=De.guidVersions[a.toLowerCase()];Be(u,"version at position "+o+" must be one of "+Object.keys(De.guidVersions).join(", ")),Be(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Be(De.guidSeparators.has(t.separator),'separator must be one of true, false, "-", or ":"');let n=t.separator===void 0?"[:-]?":t.separator===!0?"[:-]":t.separator===!1?"[]?":`\\${t.separator}`,r=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${e||"0-9A-F"}][0-9A-F]{3}\\2?[${e?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:t},regex:r})},validate(t,e,n,{regex:r}){let i=r.exec(t);return!i||De.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return pn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Be(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Be(typeof t.prefix=="boolean"||t.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:t}})},validate(t,e,{options:n}){return(n.prefix==="optional"?De.hexRegex.withOptionalPrefix:n.prefix===!0?De.hexRegex.withPrefix:De.hexRegex.withoutPrefix).test(t)?n.byteAligned&&t.length%2!==0?e.error("string.hexAlign"):t:e.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate(t,e){return ud.isValid(t,{minDomainSegments:1})||De.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){pn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=F1.regex(t),i=t.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:e,version:i}},regex:r})},validate(t,e,{options:n},{regex:r}){return r.test(t)?t:n.version?e.error("string.ipVersion",{value:t,cidr:n.cidr,version:n.version}):e.error("string.ip",{value:t,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(t,{error:e}){return De.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return De.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return De.length(this,"length",t,"=",e)},validate(t,e,{limit:n,encoding:r},{name:i,operator:s,args:o}){let a=r?Buffer&&Buffer.byteLength(t,r):t.length;return pn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:pn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return De.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return De.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Be(De.normalizationForms.includes(t),"normalization form must be one of "+De.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:t}})},validate(t,{error:e},{form:n}){return t===t.normalize(n)?t:e("string.normalize",{value:t,form:n})},convert:!0},pattern:{alias:"regex",method(t,e={}){Be(t instanceof RegExp,"regex must be a RegExp"),Be(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),pn.assertOptions(e,["invert","name"]);let n=["string.pattern",e.invert?".invert":"",e.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:t,options:e},errorCode:n})},validate(t,e,{regex:n,options:r},{errorCode:i}){return n.test(t)^r.invert?t:e.error(i,{name:r.name,regex:n,value:t})},args:["regex","options"],multi:!0},replace:{method(t,e){typeof t=="string"&&(t=new RegExp(q1(t),"g")),Be(t instanceof RegExp,"pattern must be a RegExp"),Be(typeof e=="string","replacement must be a String");let n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:t,replacement:e}),n}},token:{method(){return this.$_addRule("token")},validate(t,e){return/^\w+$/.test(t)?t:e.error("string.token")}},trim:{method(t=!0){return Be(typeof t=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:t}})},validate(t,e,{enabled:n}){return!n||t===t.trim()?t:e.error("string.trim")},convert:!0},truncate:{method(t=!0){return Be(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){pn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&pn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=kq.regex(t),r=t.domain?De.addressOptions(t.domain):null;return this.$_addRule({name:"uri",args:{options:t},regex:e,domain:r,scheme:n})},validate(t,e,{options:n},{regex:r,domain:i,scheme:s}){if(["http:/","https:/"].includes(t))return e.error("string.uri");let o=r.exec(t);if(!o&&e.prefs.convert&&n.encodeUri){let a=encodeURI(t);o=r.exec(a),o&&(t=a)}if(o){let a=o[1]||o[2];return i&&(!n.allowRelative||a)&&!ud.isValid(a,i)?e.error("string.domain",{value:a}):t}return n.relativeOnly?e.error("string.uriRelativeOnly"):n.scheme?e.error("string.uriCustomScheme",{scheme:s,value:t}):e.error("string.uri")}}},manifest:{build(t,e){if(e.replacements)for(let{pattern:n,replacement:r}of e.replacements)t=t.replace(n,r);return t}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}});De.addressOptions=function(t){if(!t)return De.tlds||t;if(Be(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Be(t.maxDomainSegments===void 0||Number.isSafeInteger(t.maxDomainSegments)&&t.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),t.tlds===!1)return t;if(t.tlds===!0||t.tlds===void 0)return Be(De.tlds,"Built-in TLD list disabled"),Object.assign({},t,De.tlds);Be(typeof t.tlds=="object","tlds must be true, false, or an object");let e=t.tlds.deny;if(e)return Array.isArray(e)&&(t=Object.assign({},t,{tlds:{deny:new Set(e)}})),Be(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Be(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),De.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Be(De.tlds,"Built-in TLD list disabled"),Object.assign({},t,De.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Be(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),De.validateTlds(t.tlds.allow,"tlds.allow"),t):t};De.validateTlds=function(t,e){for(let n of t)Be(ud.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};De.isoDate=function(t){if(!pn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};De.length=function(t,e,n,r,i){return Be(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var U1=m((VK,W1)=>{"use strict";var cd=Me(),Oq=tr(),s_={};s_.Map=class extends Map{slice(){return new s_.Map(this)}};W1.exports=Oq.extend({type:"symbol",terms:{map:{init:new s_.Map}},coerce:{method(t,{schema:e,error:n}){let r=e.$_terms.map.get(t);return r&&(t=r),!e._flags.only||typeof t=="symbol"?{value:t}:{value:t,errors:n("symbol.map",{map:e.$_terms.map})}}},validate(t,{error:e}){if(typeof t!="symbol")return{value:t,errors:e("symbol.base")}},rules:{map:{method(t){t&&!t[Symbol.iterator]&&typeof t=="object"&&(t=Object.entries(t)),cd(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){cd(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;cd(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),cd(typeof s=="symbol","Value must be a Symbol"),e.$_terms.map.set(i,s),n.push(s)}return e.valid(...n)}}},manifest:{build(t,e){return e.map&&(t=t.map(e.map)),t}},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})});var z1=m((YK,G1)=>{"use strict";var Rq=Me(),Dq=tr(),H1=Je();G1.exports=Dq.extend({type:"binary",coerce:{from:["string","object"],method(t,{schema:e}){if(typeof t=="string"||t!==null&&t.type==="Buffer")try{return{value:Buffer.from(t,e._flags.encoding)}}catch{}}},validate(t,{error:e}){if(!Buffer.isBuffer(t))return{value:t,errors:e("binary.base")}},rules:{encoding:{method(t){return Rq(Buffer.isEncoding(t),"Invalid encoding:",t),this.$_setFlag("encoding",t)}},length:{method(t){return this.$_addRule({name:"length",method:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return H1.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:H1.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}}},cast:{string:{from:t=>Buffer.isBuffer(t),to(t,e){return t.toString()}}},messages:{"binary.base":"{{#label}} must be a buffer or a string","binary.length":"{{#label}} must be {{#limit}} bytes","binary.max":"{{#label}} must be less than or equal to {{#limit}} bytes","binary.min":"{{#label}} must be at least {{#limit}} bytes"}})});var zh=m((JK,Y1)=>{"use strict";var Ns=Me(),Pq=hn(),Iq=Mb(),Ls=Je(),Mq=Ds(),a_=di(),Lq=Lb(),K1=jb(),o_=fi(),V1=Qi(),X1=$b(),ld,Pt={types:{alternatives:Zk(),any:tr(),array:t1(),boolean:o1(),date:l1(),function:w1(),link:x1(),number:k1(),object:O1(),string:B1(),symbol:U1()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Pt.types.binary=z1());Pt.root=function(){let t={_types:new Set(Object.keys(Pt.types))};for(let e of t._types)t[e]=function(...n){return Ns(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Pt.generate(this,Pt.types[e],n)};for(let e of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])t[e]=function(...n){return this.any()[e](...n)};Object.assign(t,Pt.methods);for(let e in Pt.aliases){let n=Pt.aliases[e];t[e]=t[n]}return t.x=t.expression,X1.setup&&X1.setup(t),t};Pt.methods={ValidationError:a_.ValidationError,version:Ls.version,cache:Iq.provider,assert(t,e,...n){Pt.assert(t,e,!0,n)},attempt(t,e,...n){return Pt.assert(t,e,!1,n)},build(t){return Ns(typeof K1.build=="function","Manifest functionality disabled"),K1.build(this,t)},checkPreferences(t){Ls.checkPreferences(t)},compile(t,e){return Mq.compile(this,t,e)},defaults(t){Ns(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Ns(Ls.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return Pt.generate(this,r,i)}}return e},expression(...t){return new V1(...t)},extend(...t){Ls.verifyFlat(t,"extend"),ld=ld||Gh(),Ns(t.length,"You need to provide at least one extension"),this.assert(t,ld.extensions);let e=Object.assign({},this);e._types=new Set(e._types);for(let n of t){typeof n=="function"&&(n=n(e)),this.assert(n,ld.extension);let r=Pt.expandExtension(n,e);for(let i of r){Ns(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=Lq.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Pt.generate(this,o,a)}}}return e},isError:a_.ValidationError.isError,isExpression:V1.isTemplate,isRef:o_.isRef,isSchema:Ls.isSchema,in(...t){return o_.in(...t)},override:Ls.symbols.override,ref(...t){return o_.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Pt.aliases)t[e]=this[e]();return t}};Pt.assert=function(t,e,n,r){let i=r[0]instanceof Error||typeof r[0]=="string"?r[0]:null,s=i!==null?r[1]:r[0],o=e.validate(t,Ls.preferences({errors:{stack:!0}},s||{})),a=o.error;if(!a)return o.value;if(i instanceof Error)throw i;let u=n&&typeof a.annotate=="function"?a.annotate():a.message;throw a instanceof a_.ValidationError||(a=Pq(a)),a.message=i?`${i} ${u}`:u,a};Pt.generate=function(t,e,n){return Ns(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Pt.expandExtension=function(t,e){if(typeof t.type=="string")return[t];let n=[];for(let r of e._types)if(t.type.test(r)){let i=Object.assign({},t);i.type=r,i.base=e[r](),n.push(i)}return n};Y1.exports=Pt.root()});var J1=m(ve=>{"use strict";var Nq=ve&&ve.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ve,"__esModule",{value:!0});ve.descriptionContainerSchema=ve.signatureSchema=ve.signatureDefinitionContainerSchema=ve.signatureDefinitionSchema=ve.signatureDefinitionFunctionSchema=ve.signatureDefinitionFunctionSchemaArg=ve.signatureDefinitionFunctionSchemaArgMultiTypes=ve.signatureDefinitionFunctionSchemaArgDefaultNumber=ve.signatureDefinitionFunctionSchemaArgDefaultString=ve.signatureDefinitionTypeSchema=ve.variationsSchema=void 0;var ne=Nq(zh()),hd=Gi();ve.variationsSchema=ne.default.array().items(ne.default.alternatives(ne.default.string(),ne.default.number()));ve.signatureDefinitionTypeSchema=ne.default.alternatives(ne.default.string(),ne.default.object({type:ne.default.string().required(),keyType:ne.default.link("#SignatureDefinitionTypeSchema").optional(),valueType:ne.default.link("#SignatureDefinitionTypeSchema").optional()})).id("SignatureDefinitionTypeSchema");ve.signatureDefinitionFunctionSchemaArgDefaultString=ne.default.object({type:ne.default.string().valid(hd.SignatureDefinitionBaseType.String).required(),value:ne.default.string().allow("").required()});ve.signatureDefinitionFunctionSchemaArgDefaultNumber=ne.default.object({type:ne.default.string().valid(hd.SignatureDefinitionBaseType.Number).required(),value:ne.default.number().required()});ve.signatureDefinitionFunctionSchemaArgMultiTypes=ne.default.object({label:ne.default.string().required(),types:ne.default.array().items(ve.signatureDefinitionTypeSchema).required(),opt:ne.default.boolean().optional(),default:ne.default.alternatives(ve.signatureDefinitionFunctionSchemaArgDefaultString,ve.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});ve.signatureDefinitionFunctionSchemaArg=ne.default.object({label:ne.default.string().required(),type:ve.signatureDefinitionTypeSchema.required(),opt:ne.default.boolean().optional(),default:ne.default.alternatives(ve.signatureDefinitionFunctionSchemaArgDefaultString,ve.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});ve.signatureDefinitionFunctionSchema=ne.default.object({id:ne.default.string().required(),type:ne.default.string().valid(hd.SignatureDefinitionBaseType.Function).required(),description:ne.default.string().optional(),example:ne.default.string().optional(),isProtected:ne.default.boolean().optional(),arguments:ne.default.array().items(ne.default.alternatives(ve.signatureDefinitionFunctionSchemaArg,ve.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:ne.default.array().items(ve.signatureDefinitionTypeSchema).required(),tags:ne.default.array().items(ne.default.string()).optional(),variations:ve.variationsSchema.optional(),returnVariations:ve.variationsSchema.optional()});ve.signatureDefinitionSchema=ne.default.object({type:ve.signatureDefinitionTypeSchema.invalid(hd.SignatureDefinitionBaseType.Function).required(),description:ne.default.string().optional(),example:ne.default.string().optional(),isProtected:ne.default.boolean().optional(),variations:ve.variationsSchema.optional(),tags:ne.default.array().items(ne.default.string()).optional()});ve.signatureDefinitionContainerSchema=ne.default.object().pattern(ne.default.string(),ne.default.alternatives(ve.signatureDefinitionFunctionSchema,ve.signatureDefinitionSchema));ve.signatureSchema=ne.default.object({type:ne.default.string().required(),hidden:ne.default.boolean().optional(),extends:ne.default.string().optional(),definitions:ne.default.object().required()});ve.descriptionContainerSchema=ne.default.object({$meta:ne.default.object({description:ne.default.string().required(),example:ne.default.array().items(ne.default.string().allow("")).optional()}).optional()}).pattern(ne.default.string(),ne.default.object({description:ne.default.string().required(),example:ne.default.array().items(ne.default.string().allow("")).optional()}))});var d_=m(xn=>{"use strict";var Vo=xn&&xn.__assign||function(){return Vo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Vo.apply(this,arguments)},qq=xn&&xn.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},u_=xn&&xn.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},c_=xn&&xn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},jq=xn&&xn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xn,"__esModule",{value:!0});xn.Signature=void 0;var l_=jq(zh()),h_=J1(),Fq=Gi(),$q=Wh(),Bq=Hh(),Wq=function(){function t(e){var n,r,i;this._type=e.type,this._extends=(n=e.extends)!==null&&n!==void 0?n:null,this._descriptions={},this._definitions=(r=e.definitions)!==null&&r!==void 0?r:{},this._hidden=(i=e.hidden)!==null&&i!==void 0?i:!1}return t.parseDefinitions=function(e,n){var r,i;l_.default.assert(n,h_.signatureDefinitionContainerSchema);var s={};try{for(var o=u_(Object.entries(n)),a=o.next();!a.done;a=o.next()){var u=c_(a.value,2),c=u[0],l=u[1],h=l.type===Fq.SignatureDefinitionBaseType.Function?Bq.SignatureDefinitionFunction.parse(e,l):$q.SignatureDefinition.parse(e,l);s[c]=h}}catch(d){r={error:d}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},t.parseDescriptions=function(e){var n,r,i,s,o;l_.default.assert(e,h_.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=qq(e,["$meta"]);u=c,a=l}var h={};try{for(var d=u_(Object.entries(a)),g=d.next();!g.done;g=d.next()){var _=c_(g.value,2),b=_[0],C=_[1];h[b]={description:C.description,example:(i=C.example)!==null&&i!==void 0?i:null}}}catch(A){n={error:A}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return Vo({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},h)},t.parse=function(e,n){var r,i;l_.default.assert(e,h_.signatureSchema);var s=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.type,e.definitions);if(s.setDefinitions(o),n!=null)try{for(var a=u_(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=c_(u.value,2),l=c[0],h=c[1],d=t.parseDescriptions(h);s.addDescriptions(l,d)}}catch(g){r={error:g}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s},t.prototype.getType=function(){return this._type},t.prototype.getExtendedType=function(){return this._extends},t.prototype.getDefinitions=function(){return this._definitions},t.prototype.getAllDescriptions=function(){return this._descriptions},t.prototype.isHidden=function(){return this._hidden},t.prototype.setExtend=function(e){return this._extends=e,this},t.prototype.setDefinitions=function(e){return this._definitions=e,this},t.prototype.mergeDefinitions=function(e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];this._definitions[i]=e[i]}return this},t.prototype.getDefinition=function(e,n){if(!Object.prototype.hasOwnProperty.call(this._definitions,e))return null;var r=this._definitions[e],i=this.getDescriptions(n),s=i[e];return r.withDescription(s)},t.prototype.setDescriptions=function(e,n){return this._descriptions[e]=n,this},t.prototype.addDescriptions=function(e,n){var r=this._descriptions[e];r==null&&(r={},this._descriptions[e]=r);for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s];r[o]=Vo(Vo({},r[o]),n[o])}return this},t.prototype.getDescriptions=function(e){e===void 0&&(e="en");var n=this._descriptions[e];return n??{}},t.prototype.toJSON=function(){for(var e={},n=Object.keys(this._definitions),r=0;r<n.length;r++){var i=n[r];e[i]=this._definitions[i].toJSON()}return{type:this._type,extend:this._extends,hidden:this._hidden,definitions:e}},t.prototype.copy=function(){for(var e=new t({type:this._type,hidden:this._hidden,extends:this._extends}),n={},r=Object.keys(this._definitions),i=0;i<r.length;i++){var s=r[i];n[s]=this._definitions[s].copy()}for(var o={},a=Object.keys(this._descriptions),i=0;i<a.length;i++){var s=a[i];o[s]=Vo({},o[s])}return e._descriptions=o,e._definitions=n,e},t}();xn.Signature=Wq});var Q1=m(Yr=>{"use strict";var ir=Yr&&Yr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Vr=Yr&&Yr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},f_=Yr&&Yr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.Container=void 0;var Xr=d_(),Uq=Hh(),wt=Gi(),Hq=function(){function t(){this._primitives=new Map([[wt.SignatureDefinitionBaseType.Any,new Xr.Signature({type:wt.SignatureDefinitionBaseType.Any})],[wt.SignatureDefinitionBaseType.General,new Xr.Signature({type:wt.SignatureDefinitionBaseType.General})],[wt.SignatureDefinitionBaseType.String,new Xr.Signature({type:wt.SignatureDefinitionBaseType.String})],[wt.SignatureDefinitionBaseType.Function,new Xr.Signature({type:wt.SignatureDefinitionBaseType.Function})],[wt.SignatureDefinitionBaseType.Number,new Xr.Signature({type:wt.SignatureDefinitionBaseType.Number})],[wt.SignatureDefinitionBaseType.List,new Xr.Signature({type:wt.SignatureDefinitionBaseType.List})],[wt.SignatureDefinitionBaseType.Map,new Xr.Signature({type:wt.SignatureDefinitionBaseType.Map})]]),this._types=new Map,this._excludeFromSearch=new Set}return t.prototype.getOrCreateTypeSignature=function(e){var n=this.getTypeSignature(e);return n==null&&(n=new Xr.Signature({type:e}),this._types.set(e,n)),n},t.prototype.getPrimitives=function(){return this._primitives},t.prototype.getTypes=function(){return this._types},t.prototype.getAvailableTags=function(){var e=this,n=Vr(Vr([],ir(this._primitives.keys()),!1),ir(this._types.keys()),!1).flatMap(function(r){var i=e.getTypeSignature(r);return Object.values(i.getDefinitions()).flatMap(function(s){return s.getTags()})});return Array.from(new Set(n))},t.prototype.getAllVisibleTypes=function(){var e=this;return Vr(Vr([],ir(this._primitives.keys()),!1),ir(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==wt.SignatureDefinitionBaseType.Any&&n!==wt.SignatureDefinitionBaseType.General})},t.prototype.excludeFromSearch=function(e){return this._excludeFromSearch.add(e),this},t.prototype.includeToSearch=function(e){return this._excludeFromSearch.delete(e),this},t.prototype.getTypeSignature=function(e){var n,r;return(r=(n=this._primitives.get(e))!==null&&n!==void 0?n:this._types.get(e))!==null&&r!==void 0?r:null},t.prototype.getAllPrimitiveSignatures=function(){return Array.from(this._primitives.values())},t.prototype.getAllTypeSignatures=function(){return Array.from(this._types.values())},t.prototype.getAllSignatures=function(){return Vr(Vr([],ir(this.getAllPrimitiveSignatures()),!1),ir(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return Vr(Vr([],ir(this.getAllPrimitiveSignatures()),!1),ir(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=Xr.Signature.parse(e);return this.addTypeSignature({type:n.getType(),extends:n.getExtendedType(),hidden:n.isHidden(),definitions:n.getDefinitions()}),this},t.prototype.addTypeSignature=function(e){var n=this.getOrCreateTypeSignature(e.type);return e.extends!==void 0&&n.setExtend(e.extends),n.mergeDefinitions(e.definitions),this},t.prototype.addMetaFromPayload=function(e,n){for(var r={},i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],a=Xr.Signature.parseDescriptions(n[o]);r[o]=a}return this.addMeta(e,r),this},t.prototype.addMeta=function(e,n){for(var r=Object.keys(n),i=0;i<r.length;i++){var s=r[i],o=this.getOrCreateTypeSignature(s);o.addDescriptions(e,n[s])}return this},t.prototype.searchDefinitionMatches=function(e,n,r){var i,s;if(r===void 0&&(r="en"),typeof e=="string")return this.searchDefinitionMatches([e],n,r);var o=e.includes(wt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=f_(o),l=c.next();!l.done;l=c.next()){var h=l.value;if(!this._excludeFromSearch.has(h)){for(var d=h,g=this.getTypeSignature(h),_=null;g!==null&&!a.has(g.getType())&&(a.add(g.getType()),g.isHidden()||(_=g.getDefinition(n,r)),_===null);)d=g.getExtendedType(),g=this.getTypeSignature(d);_!==null&&u.set(d,_)}}}catch(b){i={error:b}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return u},t.prototype.getDefinition=function(e,n,r){if(r===void 0&&(r="en"),typeof e=="string")return this.getDefinition([e],n,r);var i=this._primitives.get(wt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(wt.SignatureDefinitionBaseType.Any)&&i)return i;var s=this.searchDefinitionMatches(e,n,r);return s.size===0?null:s.size===1?s.values().next().value:s.has(wt.SignatureDefinitionBaseType.Any)?s.get(wt.SignatureDefinitionBaseType.Any):i!==null?i:s.values().next().value},t.prototype.getDefinitionsById=function(e){var n=this;return Vr(Vr([],ir(this._primitives.keys()),!1),ir(this._types.keys()),!1).flatMap(function(r){var i=n.getTypeSignature(r);return Object.values(i.getDefinitions()).filter(function(s){return s instanceof Uq.SignatureDefinitionFunction&&s.getId()===e})})},t.prototype.fork=function(){var e,n,r,i,s=new t;try{for(var o=f_(this._primitives),a=o.next();!a.done;a=o.next()){var u=ir(a.value,2),c=u[0],l=u[1];s._primitives.set(c,l.copy())}}catch(_){e={error:_}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var h=f_(this._types),d=h.next();!d.done;d=h.next()){var g=ir(d.value,2),c=g[0],l=g[1];s._types.set(c,l.copy())}}catch(_){r={error:_}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();Yr.Container=Hq});var gn=m(st=>{"use strict";var Gq=st&&st.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Z1=st&&st.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Gq(e,t,n)};Object.defineProperty(st,"__esModule",{value:!0});st.TypeParser=st.VariationRegistry=st.Container=st.Signature=st.SignatureDefinition=st.SignatureDefinitionTypeMeta=st.SignatureDefinitionFunction=st.SignatureDefinitionFunctionArg=void 0;var zq=Ab();Object.defineProperty(st,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return zq.SignatureDefinitionFunctionArg}});var Kq=Hh();Object.defineProperty(st,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return Kq.SignatureDefinitionFunction}});var Vq=hu();Object.defineProperty(st,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return Vq.SignatureDefinitionTypeMeta}});var Xq=Wh();Object.defineProperty(st,"SignatureDefinition",{enumerable:!0,get:function(){return Xq.SignatureDefinition}});var Yq=d_();Object.defineProperty(st,"Signature",{enumerable:!0,get:function(){return Yq.Signature}});var Jq=Q1();Object.defineProperty(st,"Container",{enumerable:!0,get:function(){return Jq.Container}});var Qq=Bh();Object.defineProperty(st,"VariationRegistry",{enumerable:!0,get:function(){return Qq.VariationRegistry}});var Zq=Eb();Object.defineProperty(st,"TypeParser",{enumerable:!0,get:function(){return Zq.TypeParser}});Z1(wb(),st);Z1(Gi(),st)});var tC=m(p_=>{function eC(t,e){return t>e?1:-1}p_.hash=function t(e,n){var r=5381;if(typeof e=="object"&&e!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){n||(n=new WeakSet);for(var i=Object.keys(e).sort(eC),s=0;s<i.length;s++){var o=i[s],a=e[o];if(r=33*r^t(o,n),typeof a=="object"&&a!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){if(n.has(a))continue;n.add(a)}r=33*r^t(a,n)}return 33*r^t(e.constructor,n)}var u=typeof e;try{e instanceof Date?u+=e.getTime():u+=String(e)}catch{u+=String(Object.assign({},e))}for(var c=0;c<u.length;c++)r=33*r^u.charCodeAt(c);return r},p_.sortNumbers=eC});var nC=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.LRUCache=Xo.CacheNode=void 0;var dd=class{constructor(e,n){this.prev=null,this.next=null,this.key=e,this.value=n}};Xo.CacheNode=dd;var g_=class{constructor(e=50){this.head=null,this.tail=null,this.capacity=e,this.cache=new Map}removeNode(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev}addNodeToFront(e){e.next=this.head,e.prev=null,this.head&&(this.head.prev=e),this.head=e,this.tail||(this.tail=e)}get(e){let n=this.cache.get(e);return n==null?null:(this.removeNode(n),this.addNodeToFront(n),n.value)}set(e,n){let r=this.cache.get(e);if(r!=null){this.removeNode(r),r.value=n,this.addNodeToFront(r);return}this.cache.size>this.capacity&&this.tail&&(this.cache.delete(this.tail.key),this.removeNode(this.tail));let i=new dd(e,n);this.cache.set(e,i),this.addNodeToFront(i)}};Xo.LRUCache=g_});var fd=m(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.objectHash=xr.getStringHashCode=xr.getHashCode=xr.rotateBits=void 0;var ej=gn(),tj=tC(),nj=nC();function rj(t){return t>>1|t<<31}xr.rotateBits=rj;function ij(t,e=0){let n=t>>>0;return n=(n>>16^n)*73244475,n=(n>>16^n)*73244475,n=n>>16^n,(e<<5)-e+n|0}xr.getHashCode=ij;xr.getStringHashCode=function(){let t=new nj.LRUCache,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!=null)return r;let i=e(n);return t.set(n,i),i}}();function sj(t){return t instanceof ej.SignatureDefinitionFunction?(0,xr.getStringHashCode)(t.getId()):(0,tj.hash)(t)}xr.objectHash=sj});var rC=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.createExpressionHash=void 0;var Ge=Ee(),Et=fd(),oj=cu(),Yt=(t,e)=>t.$$hash=e,aj=t=>t.$$hash??null;function ot(t){let e=aj(t);if(e!==null)return e;let n=(0,Et.getStringHashCode)(t.type);switch(t.type){case Ge.ASTType.BinaryExpression:{let r=t;return n^=(0,Et.getStringHashCode)(r.operator),n^=ot(r.left),n^=ot(r.right),Yt(t,n)}case Ge.ASTType.LogicalExpression:{let r=t;return n^=(0,Et.getStringHashCode)(r.operator),n^=ot(r.left),n^=ot(r.right),Yt(t,n)}case Ge.ASTType.IsaExpression:{let r=t;return n^=(0,Et.getStringHashCode)(r.operator),n^=ot(r.left),n^=ot(r.right),Yt(t,n)}case Ge.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=ot(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,Et.getStringHashCode)(r.operators[i]);return Yt(t,n)}case Ge.ASTType.FunctionDeclaration:{let r=t;n^=(0,Et.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===Ge.ASTType.Identifier){n^=(0,Et.getStringHashCode)(s.name);continue}let o=s;n^=(0,Et.getStringHashCode)(o.variable.name),n^=ot(o.init)}return Yt(t,n)}case Ge.ASTType.ParenthesisExpression:return ot(t.expression);case Ge.ASTType.MemberExpression:{let r=t;if(r.base.type===Ge.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,Et.getStringHashCode)(Ge.ASTType.Identifier),n^=(0,Et.getStringHashCode)(r.identifier.name),Yt(t,n)}return n^=ot(r.base),n^=ot(r.identifier),Yt(t,n)}case Ge.ASTType.IndexExpression:{let r=t;if((0,oj.isValidIdentifierLiteral)(r.index)){if(r.base.type===Ge.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,Et.getStringHashCode)(Ge.ASTType.Identifier),n^=(0,Et.getStringHashCode)(r.index.value.toString()),Yt(t,n)}n=(0,Et.getStringHashCode)(Ge.ASTType.MemberExpression),n^=ot(r.base);let i=(0,Et.getStringHashCode)(Ge.ASTType.Identifier);i^=(0,Et.getStringHashCode)(r.index.value.toString()),n^=i}else n^=ot(r.base),n^=ot(r.index);return Yt(t,n)}case Ge.ASTType.CallExpression:{let r=t;n^=ot(r.base),n^=(0,Et.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=ot(s)}return Yt(t,n)}case Ge.ASTType.NegationExpression:case Ge.ASTType.BinaryNegatedExpression:case Ge.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,Et.getStringHashCode)(r.operator):1,n^=ot(r.argument),Yt(t,n)}case Ge.ASTType.Identifier:{let r=t;return n^=(0,Et.getStringHashCode)(r.name),Yt(t,n)}case Ge.ASTType.BooleanLiteral:case Ge.ASTType.NumericLiteral:case Ge.ASTType.StringLiteral:case Ge.ASTType.NilLiteral:return n^=(0,Et.getStringHashCode)(t.value.toString()),Yt(t,n);case Ge.ASTType.MapConstructorExpression:{let r=t;n^=(0,Et.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=ot(s.key),n^=ot(s.value)}return Yt(t,n)}case Ge.ASTType.ListConstructorExpression:{let r=t;n^=(0,Et.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=ot(s.value)}return Yt(t,n)}case Ge.ASTType.SliceExpression:{let r=t;return n^=ot(r.base),n^=ot(r.left),n^=ot(r.right),Yt(t,n)}}return Yt(t,n)}function uj(t){return ot(t)}pd.createExpressionHash=uj});var m_=m(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.createExpressionId=void 0;var xt=Ee(),cj=cu(),It=(t,e)=>t.$$id=e,lj=t=>t.$$id??null;function Ze(t){let e=lj(t);if(e!==null)return e;switch(t.type){case xt.ASTType.BinaryExpression:{let n=t;return It(t,Ze(n.left)+n.operator+Ze(n.right))}case xt.ASTType.LogicalExpression:{let n=t;return It(t,Ze(n.left)+n.operator+Ze(n.right))}case xt.ASTType.IsaExpression:{let n=t;return It(t,Ze(n.left)+n.operator+Ze(n.right))}case xt.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>Ze(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return It(t,i.join(" "))}case xt.ASTType.FunctionDeclaration:{let n=t,r="function",i=[];for(let s=0;s<n.parameters.length;s++){let o=n.parameters[s];if(o.type===xt.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+Ze(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),It(t,r)}case xt.ASTType.ParenthesisExpression:return It(t,Ze(t.expression));case xt.ASTType.MemberExpression:{let n=t;return It(t,Ze(n.base)+"."+n.identifier.name)}case xt.ASTType.IndexExpression:{let n=t;return(0,cj.isValidIdentifierLiteral)(n.index)?It(t,Ze(n.base)+"."+n.index.value.toString()):It(t,Ze(n.base)+"["+Ze(n.index)+"]")}case xt.ASTType.CallExpression:{let n=t,r=Ze(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(Ze(o))}return i.length>0&&(r+="("+i.join(",")+")"),It(t,r)}case xt.ASTType.NegationExpression:case xt.ASTType.BinaryNegatedExpression:case xt.ASTType.UnaryExpression:{let n=t;return n.operator==null?It(t,Ze(n.argument)):n.operator==="@"?It(t,n.operator+Ze(n.argument)):It(t,n.operator+" "+Ze(n.argument))}case xt.ASTType.Identifier:return It(t,t.name);case xt.ASTType.NumericLiteral:case xt.ASTType.BooleanLiteral:case xt.ASTType.StringLiteral:case xt.ASTType.NilLiteral:return It(t,t.raw.toString());case xt.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Ze(s.key)+":"+Ze(s.value))}return It(t,"{"+r.join(",")+"}")}case xt.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Ze(s.value))}return It(t,"["+r.join(",")+"]")}case xt.ASTType.SliceExpression:{let n=t;return It(t,Ze(n.base)+"["+Ze(n.left)+":"+Ze(n.right)+"]")}}return It(t,"")}function hj(t){return Ze(t)}gd.createExpressionId=hj});var Yo=m(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.Markers=void 0;var dj;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(dj=Su.Markers||(Su.Markers={}))});var Ar=m(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.rewireSpecs=mt.rewireSource=mt.seedTokens=mt.seedSpec=mt.seedBlock=mt.splitLines=mt.splitSpace=mt.splitCR=mt.hasCR=mt.isSpace=void 0;function fj(t){return/^\s+$/.test(t)}mt.isSpace=fj;function pj(t){return/\r$/.test(t)}mt.hasCR=pj;function gj(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}mt.splitCR=gj;function mj(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}mt.splitSpace=mj;function yj(t){return t.split(/\n/)}mt.splitLines=yj;function bj(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}mt.seedBlock=bj;function _j(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}mt.seedSpec=_j;function vj(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}mt.seedTokens=vj;function Sj(t){let e=t.source.reduce((n,r)=>n.set(r.number,r),new Map);for(let n of t.tags)n.source=n.source.map(r=>e.get(r.number));return t}mt.rewireSource=Sj;function Tj(t){let e=t.tags.reduce((n,r)=>r.source.reduce((i,s)=>i.set(s.number,s),n),new Map);return t.source=t.source.map(n=>e.get(n.number)||n),t}mt.rewireSpecs=Tj});var iC=m(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var wj=/^@\S+/;function Ej({fence:t="```"}={}){let e=xj(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)wj.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}y_.default=Ej;function xj(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var sC=m(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});var Aj=Yo(),Tu=Ar();function kj({startLine:t=0,markers:e=Aj.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,Tu.seedTokens)();if([a.lineEnd,o]=(0,Tu.splitCR)(o),[a.start,o]=(0,Tu.splitSpace)(o),n===null&&o.startsWith(e.start)&&!o.startsWith(e.nostart)&&(n=[],a.delimiter=o.slice(0,e.start.length),o=o.slice(e.start.length),[a.postDelimiter,o]=(0,Tu.splitSpace)(o)),n===null)return r++,null;let u=o.trimRight().endsWith(e.end);if(a.delimiter===""&&o.startsWith(e.delim)&&!o.startsWith(e.end)&&(a.delimiter=e.delim,o=o.slice(e.delim.length),[a.postDelimiter,o]=(0,Tu.splitSpace)(o)),u){let c=o.trimRight();a.end=o.slice(c.length-e.end.length),o=c.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:s,tokens:a}),r++,u){let c=n.slice();return n=null,c}return null}}b_.default=kj});var oC=m(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var Cj=Ar();function Oj({tokenizers:t}){return function(n){var r;let i=(0,Cj.seedSpec)({source:n});for(let s of t)if(i=s(i),!((r=i.problems[i.problems.length-1])===null||r===void 0)&&r.critical)break;return i}}__.default=Oj});var S_=m(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});function Rj(){return t=>{let{tokens:e}=t.source[0],n=e.description.match(/\s*(@(\S+))(\s*)/);return n===null?(t.problems.push({code:"spec:tag:prefix",message:'tag should start with "@" symbol',line:t.source[0].number,critical:!0}),t):(e.tag=n[1],e.postTag=n[3],e.description=e.description.slice(n[0].length),t.tag=n[2],t)}}v_.default=Rj});var w_=m(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});var Dj=Ar();function Pj(t="compact"){let e=Mj(t);return n=>{let r=0,i=[];for(let[a,{tokens:u}]of n.source.entries()){let c="";if(a===0&&u.description[0]!=="{")return n;for(let l of u.description)if(l==="{"&&r++,l==="}"&&r--,c+=l,r===0)break;if(i.push([u,c]),r===0)break}if(r!==0)return n.problems.push({code:"spec:type:unpaired-curlies",message:"unpaired curlies",line:n.source[0].number,critical:!0}),n;let s=[],o=i[0][0].postDelimiter.length;for(let[a,[u,c]]of i.entries())u.type=c,a>0&&(u.type=u.postDelimiter.slice(o)+c,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,Dj.splitSpace)(u.description.slice(c.length)),s.push(u.type);return s[0]=s[0].slice(1),s[s.length-1]=s[s.length-1].slice(0,-1),n.type=e(s),n}}T_.default=Pj;var Ij=t=>t.trim();function Mj(t){return t==="compact"?e=>e.map(Ij).join(""):t==="preserve"?e=>e.join(`
|
100
|
+
`):t}});var A_=m(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});var E_=Ar(),Lj=t=>t&&t.startsWith('"')&&t.endsWith('"');function Nj(){let t=(e,{tokens:n},r)=>n.type===""?e:r;return e=>{let{tokens:n}=e.source[e.source.reduce(t,0)],r=n.description.trimLeft(),i=r.split('"');if(i.length>1&&i[0]===""&&i.length%2===1)return e.name=i[1],n.name=`"${i[1]}"`,[n.postName,n.description]=(0,E_.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,E_.isSpace)(l))break;l==="["&&s++,l==="]"&&s--,o+=l}if(s!==0)return e.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:e.source[0].number,critical:!0}),e;let c=o;if(o[0]==="["&&o[o.length-1]==="]"){a=!0,o=o.slice(1,-1);let l=o.split("=");if(o=l[0].trim(),l[1]!==void 0&&(u=l.slice(1).join("=").trim()),o==="")return e.problems.push({code:"spec:name:empty-name",message:"empty name",line:e.source[0].number,critical:!0}),e;if(u==="")return e.problems.push({code:"spec:name:empty-default",message:"empty default value",line:e.source[0].number,critical:!0}),e;if(!Lj(u)&&/=(?!>)/.test(u))return e.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:e.source[0].number,critical:!0}),e}return e.optional=a,e.name=o,n.name=c,u!==void 0&&(e.default=u),[n.postName,n.description]=(0,E_.splitSpace)(r.slice(n.name.length)),e}}x_.default=Nj});var C_=m(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.getJoiner=void 0;var k_=Yo();function qj(t="compact",e=k_.Markers){let n=aC(t);return r=>(r.description=n(r.source,e),r)}wu.default=qj;function aC(t){return t==="compact"?jj:t==="preserve"?Bj:t}wu.getJoiner=aC;function jj(t,e=k_.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var Fj=(t,{tokens:e},n)=>e.type===""?t:n,$j=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function Bj(t,e=k_.Markers){if(t.length===0)return"";t[0].tokens.description===""&&t[0].tokens.delimiter===e.start&&(t=t.slice(1));let n=t[t.length-1];return n!==void 0&&n.tokens.description===""&&n.tokens.end.endsWith(e.end)&&(t=t.slice(0,-1)),t=t.slice(t.reduce(Fj,0)),t.map($j).join(`
|
101
|
+
`)}});var cC=m(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});var Wj=Yo(),Uj=Ar(),Hj=iC(),Gj=sC(),zj=oC(),Kj=S_(),Vj=w_(),Xj=A_(),uC=C_();function Yj({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=Wj.Markers,tokenizers:i=[(0,Kj.default)(),(0,Vj.default)(n),(0,Xj.default)(),(0,uC.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,Gj.default)({startLine:t,markers:r}),o=(0,Hj.default)({fence:e}),a=(0,zj.default)({tokenizers:i}),u=(0,uC.getJoiner)(n);return function(c){let l=[];for(let h of(0,Uj.splitLines)(c)){let d=s(h);if(d===null)continue;let g=o(d),_=g.slice(1).map(a);l.push({description:u(g[0],r),tags:_,source:d,problems:_.reduce((b,C)=>b.concat(C.problems),[])})}return l}}O_.default=Yj});var lC=m(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});function Jj(t){return t.start+t.delimiter+t.postDelimiter+t.tag+t.postTag+t.type+t.postType+t.name+t.postName+t.description+t.end+t.lineEnd}function Qj(){return t=>t.source.map(({tokens:e})=>Jj(e)).join(`
|
102
|
+
`)}R_.default=Qj});var dC=m(Eu=>{"use strict";var Zj=Eu&&Eu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(Eu,"__esModule",{value:!0});var hC=Yo(),eF=Ar(),tF={start:0,tag:0,type:0,name:0},nF=(t=hC.Markers)=>(e,{tokens:n})=>({start:n.delimiter===t.start?n.start.length:e.start,tag:Math.max(e.tag,n.tag.length),type:Math.max(e.type,n.type.length),name:Math.max(e.name,n.name.length)}),qs=t=>"".padStart(t," ");function rF(t=hC.Markers){let e=!1,n;function r(i){let s=Object.assign({},i.tokens);s.tag!==""&&(e=!0);let o=s.tag===""&&s.name===""&&s.type===""&&s.description==="";if(s.end===t.end&&o)return s.start=qs(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=qs(n.start);break;case t.delim:s.start=qs(n.start+1);break;default:s.delimiter="",s.start=qs(n.start+2)}if(!e)return s.postDelimiter=s.description===""?"":" ",Object.assign(Object.assign({},i),{tokens:s});let a={delim:!1,tag:!1,type:!1,name:!1};return s.description===""&&(a.name=!0,s.postName="",s.name===""&&(a.type=!0,s.postType="",s.type===""&&(a.tag=!0,s.postTag="",s.tag===""&&(a.delim=!0)))),s.postDelimiter=a.delim?"":" ",a.tag||(s.postTag=qs(n.tag-s.tag.length+1)),a.type||(s.postType=qs(n.type-s.type.length+1)),a.name||(s.postName=qs(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=Zj(i,["source"]);return n=s.reduce(nF(t),Object.assign({},tF)),(0,eF.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}Eu.default=rF});var fC=m(xu=>{"use strict";var iF=xu&&xu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(xu,"__esModule",{value:!0});var sF=Ar(),oF=t=>e=>e.slice(t),aF=t=>{let e="".padStart(t," ");return n=>n+e};function uF(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?aF(s):oF(-s)}return e(i)},r=i=>Object.assign(Object.assign({},i),{tokens:Object.assign(Object.assign({},i.tokens),{start:n(i.tokens.start)})});return i=>{var{source:s}=i,o=iF(i,["source"]);return(0,sF.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}xu.default=uF});var pC=m(Au=>{"use strict";var cF=Au&&Au.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(Au,"__esModule",{value:!0});var lF=Ar();function hF(t){function e(n){return Object.assign(Object.assign({},n),{tokens:Object.assign(Object.assign({},n.tokens),{lineEnd:t==="LF"?"":"\r"})})}return n=>{var{source:r}=n,i=cF(n,["source"]);return(0,lF.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}Au.default=hF});var gC=m(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.flow=void 0;function dF(...t){return e=>t.reduce((n,r)=>r(n),e)}md.flow=dF});var _C=m(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var fF=Ar(),yC={line:0,start:0,delimiter:0,postDelimiter:0,tag:0,postTag:0,name:0,postName:0,type:0,postType:0,description:0,end:0,lineEnd:0},mC={lineEnd:"CR"},D_=Object.keys(yC),bC=t=>(0,fF.isSpace)(t)?`{${t.length}}`:t,pF=t=>"|"+t.join("|")+"|",gF=(t,e)=>Object.keys(e).map(n=>bC(e[n]).padEnd(t[n]));function mF({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},yC);for(let s of D_)r[s]=((e=mC[s])!==null&&e!==void 0?e:s).length;for(let{number:s,tokens:o}of t){r.line=Math.max(r.line,s.toString().length);for(let a in o)r[a]=Math.max(r[a],bC(o[a]).length)}let i=[[],[]];for(let s of D_)i[0].push(((n=mC[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of D_)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...gF(r,o)])}return i.map(pF).join(`
|
103
|
+
`)}P_.default=mF});var bd=m(Mt=>{"use strict";var yF=Mt&&Mt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),bF=Mt&&Mt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&yF(e,t,n)};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.util=Mt.tokenizers=Mt.transforms=Mt.inspect=Mt.stringify=Mt.parse=void 0;var _F=cC(),vF=C_(),SF=A_(),TF=S_(),wF=w_(),EF=lC(),xF=dC(),AF=fC(),kF=pC(),CF=gC(),yd=Ar();bF(Yo(),Mt);function OF(t,e={}){return(0,_F.default)(e)(t)}Mt.parse=OF;Mt.stringify=(0,EF.default)();var RF=_C();Object.defineProperty(Mt,"inspect",{enumerable:!0,get:function(){return RF.default}});Mt.transforms={flow:CF.flow,align:xF.default,indent:AF.default,crlf:kF.default};Mt.tokenizers={tag:TF.default,type:wF.default,name:SF.default,description:vF.default};Mt.util={rewireSpecs:yd.rewireSpecs,rewireSource:yd.rewireSource,seedBlock:yd.seedBlock,seedTokens:yd.seedTokens}});var I_=m(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.normalizeText=void 0;var DF=t=>t.trimLeft().replace(/\r$/,"");_d.normalizeText=DF});var Sd=m(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.createCommentBlock=void 0;var PF=I_(),IF=t=>`/**
|
104
104
|
${t.split(`
|
105
|
-
`).map(e=>`*${(0,
|
105
|
+
`).map(e=>`*${(0,PF.normalizeText)(e)}`).join(`
|
106
106
|
`)}
|
107
|
-
*/`;
|
107
|
+
*/`;vd.createCommentBlock=IF});var M_=m(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.enrichWithMetaInformation=js.FunctionBlockTag=void 0;var MF=bd(),Td=gn(),LF=$h(),NF=Sd(),ns;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Returns="returns",t.Example="example"})(ns=js.FunctionBlockTag||(js.FunctionBlockTag={}));var qF=new Set(Object.values(ns));function jF(t){return t.tag===ns.Description?[t.name,t.description].filter(e=>e!==void 0).join(" "):[`@${t.tag}`,t.name,t.description].filter(e=>e!==void 0).join(" ")}function FF(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}function SC(t){return new Td.TypeParser(t).parse()}function vC(t){return t.type.split("|").map(SC)}function $F(t){return{types:t.type.split("|").map(SC),label:t.name,opt:t.optional}}function BF(t){let e=[t.description??"",...t.tags.filter(s=>s.tag===ns.Description||!TC(s)).map(jF)].join(`
|
108
108
|
|
109
|
-
`),n=t.tags.filter(s=>s.tag===es.Param).map(pF),r=t.tags.filter(s=>s.tag===es.Return||s.tag===es.Returns).flatMap(rO),i=t.tags.filter(s=>s.tag===es.Example).map(fF);return r.length===0&&(r=rO({type:yd.SignatureDefinitionBaseType.Any})),{descriptions:e,args:n,returns:r,examples:i}}function sO(t){return hF.has(t.tag)}function mF(t){let e=(0,cF.parse)((0,lF.createCommentBlock)(t.getDescription())),[n]=e;if(n.tags.filter(sO).length>0){let{descriptions:i,args:s,returns:o,examples:a}=gF(n);return yd.SignatureDefinitionFunction.parse({type:yd.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((u,c)=>{let l=u.getLabel(),h=u.getTypes().map(g=>g.toString()),d=u.isOptional();return{types:h,opt:d,...s[c],label:l}}),returns:o,description:i,example:a})}return t}Ns.enrichWithMetaInformation=mF});var C_=m(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.createResolveChain=void 0;var Lt=Ee();function ts(t,e,n=null,r=!1){switch(t.type){case Lt.ASTType.ParenthesisExpression:{ts(t.expression,e,n);return}case Lt.ASTType.MemberExpression:{let i=t;ts(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case Lt.ASTType.IndexExpression:{let i=t;ts(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case Lt.ASTType.CallStatement:{ts(t.expression,e,n,!0);return}case Lt.ASTType.CallExpression:{ts(t.base,e,n,!0);return}case Lt.ASTType.NegationExpression:case Lt.ASTType.BinaryNegatedExpression:case Lt.ASTType.UnaryExpression:{let i=t;ts(i.argument,e,i);return}case Lt.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case Lt.ASTType.NumericLiteral:case Lt.ASTType.StringLiteral:case Lt.ASTType.NilLiteral:case Lt.ASTType.BooleanLiteral:case Lt.ASTType.MapConstructorExpression:case Lt.ASTType.ListConstructorExpression:case Lt.ASTType.BinaryExpression:case Lt.ASTType.LogicalExpression:case Lt.ASTType.ComparisonGroupExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case Lt.ASTType.SliceExpression:ts(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function yF(t){let e=[];return ts(t,e),e}bd.createResolveChain=yF});var aO=m(O_=>{function oO(t,e){return t>e?1:-1}O_.hash=function t(e,n){var r=5381;if(typeof e=="object"&&e!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){n||(n=new WeakSet);for(var i=Object.keys(e).sort(oO),s=0;s<i.length;s++){var o=i[s],a=e[o];if(r=33*r^t(o,n),typeof a=="object"&&a!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){if(n.has(a))continue;n.add(a)}r=33*r^t(a,n)}return 33*r^t(e.constructor,n)}var u=typeof e;try{e instanceof Date?u+=e.getTime():u+=String(e)}catch{u+=String(Object.assign({},e))}for(var c=0;c<u.length;c++)r=33*r^u.charCodeAt(c);return r},O_.sortNumbers=oO});var D_=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.ObjectSet=Xo.ObjectSetIterator=void 0;var R_=aO(),_d=class{constructor(e){let n=this;n.value=e,n.index=0}next(){let e=this;return e.index>=e.value.length?{value:null,done:!0}:{value:e.value[e.index++],done:!1}}};Xo.ObjectSetIterator=_d;var P_=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,R_.hash)(i),i]);this._map=new Map(r),this._first=null,this._last=null,r.length>0&&(this._first=r[0][0],this._last=r[r.length-1][0])}[Symbol.iterator](){return new _d(Array.from(this._map.values()))}first(){return this._first!=null?this._map.get(this._first)??null:null}last(){return this._last!=null?this._map.get(this._last)??null:null}toArray(){return Array.from(this._map.values())}add(e){let n=(0,R_.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,R_.hash)(e);return this._map.delete(n)}extend(e){return e._map.forEach((n,r)=>{this._map.set(r,n),this._first??(this._first=r),this._last=r}),this}toJSON(){return Array.from(this._map.values())}clear(){this._map.clear()}};Xo.ObjectSet=P_});var I_=m(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;vd.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION="This is a custom method. You can add a description for this method by adding a comment above or after the function.\n```\nmyFunction = function(a, b, c) // This function does xyz\n```\nor\n```\n/*\n This function does xyz\n*/\nmyFunction = function(a, b, c)\n```"});var qs=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.CompletionItemKind=void 0;var bF;(function(t){t.Variable="var",t.Property="property",t.Function="function",t.Literal="literal",t.Constant="constant",t.Internal="internal",t.InternalFunction="internal-function",t.InternalProperty="internal-property",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(bF=Au.CompletionItemKind||(Au.CompletionItemKind={}))});var js=m(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.IsaPropertyPattern=yi.IdentifierPropertyPattern=yi.PropertyType=void 0;var M_;(function(t){t.Type="t",t.Identifier="i"})(M_=yi.PropertyType||(yi.PropertyType={}));yi.IdentifierPropertyPattern=`${M_.Identifier}:`;yi.IsaPropertyPattern=`${M_.Identifier}:__isa`});var L_=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.isResolveChainItemWithValue=Xr.isResolveChainItemWithIdentifier=Xr.isResolveChainItemWithMember=Xr.isResolveChainItemWithIndex=void 0;var ir=Ee(),_F=t=>t!=null&&t.ref.type===ir.ASTType.IndexExpression;Xr.isResolveChainItemWithIndex=_F;var vF=t=>t!=null&&t.ref.type===ir.ASTType.MemberExpression;Xr.isResolveChainItemWithMember=vF;var SF=t=>t!=null&&t.ref.type===ir.ASTType.Identifier;Xr.isResolveChainItemWithIdentifier=SF;var TF=new Set([ir.ASTType.NumericLiteral,ir.ASTType.StringLiteral,ir.ASTType.NilLiteral,ir.ASTType.BooleanLiteral,ir.ASTType.MapConstructorExpression,ir.ASTType.ListConstructorExpression,ir.ASTType.BinaryExpression,ir.ASTType.LogicalExpression,ir.ASTType.ComparisonGroupExpression]),wF=t=>t!=null&&TF.has(t.ref.type);Xr.isResolveChainItemWithValue=wF});var N_=m(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.isSignatureDefinitionFunction=void 0;var EF=xn(),xF=t=>t.getType().type===EF.SignatureDefinitionBaseType.Function;Sd.isSignatureDefinitionFunction=xF});var q_=m(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.aggregateEntity=void 0;var AF=t=>{let e=new Set,n=t;for(;n!=null&&!e.has(n);)e.add(n),n=n.getIsa();return Array.from(e)};Td.aggregateEntity=AF});var ku=m(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.injectIdentifers=void 0;var kF=js(),CF=q_(),OF=(t,e)=>{let n=(0,CF.aggregateEntity)(e);for(let r=0;r<n.length;r++)n[r].values.forEach((s,o)=>{if(o.startsWith(kF.IdentifierPropertyPattern)){let a=o.slice(2);if(t.has(a))return;t.set(a,{kind:s.kind,line:s.source===e.source?s.line:-1})}})};wd.injectIdentifers=OF});var xd=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.isEligibleForProperties=void 0;var j_=xn(),RF=t=>t.types.has(j_.SignatureDefinitionBaseType.Map)||t.types.has(j_.SignatureDefinitionBaseType.List)||t.types.has(j_.SignatureDefinitionBaseType.Any);Ed.isEligibleForProperties=RF});var kd=m(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.lookupProperty=void 0;var PF=xd(),DF=(t,e,n)=>{let r=e,i=new Set([r]);for(;(0,PF.isEligibleForProperties)(r);){let s=r.values.get(`${t}:${n}`);if(s!=null)return s;let o=r.getIsa();if(o==null||i.has(o))break;i.add(o),r=o}return null};Ad.lookupProperty=DF});var F_=m(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.mergeUnique=void 0;function IF(t,e,n=1e4){let r=Array.from(new Set([...t,...e]));if(t.length=0,r.length<=n){Array.prototype.push.apply(t,r);return}for(let i=0;i<r.length;i+=n)Array.prototype.push.apply(t,r.slice(i,i+n))}Cd.mergeUnique=IF});var Yo=m(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.Entity=void 0;var yt=xn(),Fs=qs(),sr=js(),MF=N_(),LF=ku(),Cu=xd(),Od=kd(),NF=F_(),uO=D_(),bi=class t{static resolveEntity(e,n,r=!1){if(n.isCallable()&&!r){let i=n.getReturnEntity();if(i!==null)return i;let s=n.getCallableReturnTypes();return s?new t({source:n.source,kind:Fs.CompletionItemKind.Variable,container:e,label:n.label,context:n.context}).addTypesWithMeta(s):new t({source:n.source,kind:Fs.CompletionItemKind.Variable,container:e,label:n.label,context:n.context}).addType(yt.SignatureDefinitionBaseType.Any)}return n}get source(){return this._source}get definitions(){return this._definitions}get kind(){return this._kind}get line(){return this._line}get signatureDefinitions(){return this._signatureDefinitions}get context(){return this._context}get label(){return this._label}get types(){return this._types}get values(){return this._values}constructor(e){this._source=e.source,this._isAPI=e.isAPI??!1,this._isFromSignature=e.isFromSignature??!1,this._kind=e.kind,this._line=e.line??-1,this._label=e.label??"anonymous",this._signatureDefinitions=e.signatureDefinitions??new uO.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._definitions=e.definitions??[],this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}getIsa(){return this._values.get(sr.IsaPropertyPattern)??null}hasIsa(){return this._values.has(sr.IsaPropertyPattern)}isAPI(){return this._isAPI}isCallable(){return this._types.has(yt.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,MF.isSignatureDefinitionFunction)(n));return e.length===0?null:e.flatMap(n=>n.getReturns())}addSignatureType(e){return this._signatureDefinitions.add(e),this.addType(e.getType().type),this}setReturnEntity(e){return this._returnEntity=e,this}getReturnEntity(){return this._returnEntity}setKind(e){return this._kind=e,this}setLine(e){return this._line=e,this}setLabel(e){return this._label=e,this}setContext(e){return this._context=e,this}addType(e){return this._types.add(e),this}addTypes(e){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}addTypeWithMeta(e){if(this._types.add(e.type),e.type===yt.SignatureDefinitionBaseType.Map||e.type===yt.SignatureDefinitionBaseType.List){let n=e.type===yt.SignatureDefinitionBaseType.Map?e.keyType.type??yt.SignatureDefinitionBaseType.Any:yt.SignatureDefinitionBaseType.Number,r=new t({source:this._source,kind:Fs.CompletionItemKind.Property,container:this._container,context:this});e.valueType.type===yt.SignatureDefinitionBaseType.Map||e.valueType.type===yt.SignatureDefinitionBaseType.List?r.addTypeWithMeta(e.valueType):r.addType(e.valueType.type??yt.SignatureDefinitionBaseType.Any),t.handlers.type.setProperty(this,this._container,n,r)}return this}addTypesWithMeta(e){for(let n=0;n<e.length;n++)this.addTypeWithMeta(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return t.handlers.entity.hasProperty(this,this._container,e);default:return t.handlers.identifier.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return t.handlers.entity.resolveProperty(this,this._container,e,n);default:return t.handlers.identifier.resolveProperty(this,this._container,e,n)}}setProperty(e,n,r=!1){switch(typeof e){case"object":return t.handlers.entity.setProperty(this,this._container,e,n,r);default:return t.handlers.identifier.setProperty(this,this._container,e,n,r)}}extend(e,n=!1,r=!1){if(e===this)return this;let i=new WeakSet([e]),s=[{target:this,source:e}];for(;s.length>0;){let o=s.pop(),a=o.target,u=o.source;a._isFromSignature=!1,a._signatureDefinitions.extend(u._signatureDefinitions),n&&(r?a._definitions=[...a._definitions,...u._definitions]:(0,NF.mergeUnique)(a._definitions,u._definitions)),a.addTypes(Array.from(u.types)),u.values.forEach((c,l)=>{let h=a._values.get(l);h==null?a._values.set(l,c.copy({container:a._container,context:a,deepCopy:r})):i.has(c)||(i.add(c),s.push({target:h,source:c}))})}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(yt.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({source:this._source,label:i,kind:s.getType().type===yt.SignatureDefinitionBaseType.Function?Fs.CompletionItemKind.InternalFunction:Fs.CompletionItemKind.InternalProperty,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getPropertyTypes(){let e=new Set;return this._values.forEach((n,r)=>{let[i,s]=r.split(":");i===sr.PropertyType.Type?e.add(s):e.add(yt.SignatureDefinitionBaseType.String)}),Array.from(e)}getValueTypes(){let e=new Set;return this._values.forEach(n=>{n.types.forEach(r=>{e.add(r)})}),Array.from(e)}getAvailableIdentifier(){let e=new Map;return this._types.forEach(n=>{this._container.getAvailableIdentifier(n).forEach((i,s)=>{e.set(s,i)})}),(0,LF.injectIdentifers)(e,this),e}toJSON(e=new WeakMap){if(e.has(this))return e.get(this);let n={};return e.set(this,n),n.kind=this.kind,n.signatureDefinitions=this._signatureDefinitions.toJSON(),n.types=Array.from(this._types),n.values=Array.from(this._values).reduce((r,[i,s])=>(r[i]=s?.toJSON(e),r),{}),n}toMeta(){let e=[];return this.types.forEach(n=>{let r={type:n};switch(n){case yt.SignatureDefinitionBaseType.Map:{let i=this.getPropertyTypes();i.length===1?r.keyType=i[0]:r.keyType=yt.SignatureDefinitionBaseType.Any;let s=this.getValueTypes();s.length===1?r.valueType=s[0]:r.valueType=yt.SignatureDefinitionBaseType.Any;break}case yt.SignatureDefinitionBaseType.List:{let i=t.handlers.type.resolveProperty(this,this._container,yt.SignatureDefinitionBaseType.Number);i!=null&&i.types.size===1?r.valueType=i.types.values().next().value:r.valueType=yt.SignatureDefinitionBaseType.Any;break}}e.push(r)}),e}copy(e={}){let n=new t({source:e.source??this._source,kind:e.kind??this._kind,line:e.line??this._line,isFromSignature:e.isFromSignature??this._isFromSignature,isAPI:e.isAPI??this._isAPI,container:e.container??this._container,label:e.label??this._label,context:e.context??this._context,signatureDefinitions:new uO.ObjectSet(Array.from(this._signatureDefinitions,s=>s.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values,definitions:e.definitions??this._definitions});if(!e.deepCopy)return n;let r=new WeakMap;function i(s,o){let a=r.get(o);if(a)return a;let u=o.copy({container:e.container,line:e.line,context:s,values:new Map});return r.set(o,u),o.values.forEach((c,l)=>{u._values.set(l,i(u,c))}),u._definitions=[...o.definitions],u}return n._values=new Map,this._values.forEach((s,o)=>{n._values.set(o,i(n,s))}),n._definitions=[...this._definitions],n}};Rd.Entity=bi;bi.handlers={identifier:{hasProperty(t,e,n){return!!(0,Od.lookupProperty)(sr.PropertyType.Identifier,t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,Od.lookupProperty)(sr.PropertyType.Identifier,t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):bi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){if(!(0,Cu.isEligibleForProperties)(t))return!1;let s=`${sr.PropertyType.Identifier}:${n}`,o=t.values.get(s);return o?o.extend(r,i):t.values.set(s,r.copy({container:e,label:n,context:t,definitions:i?r.definitions:[]})),!0}},entity:{hasProperty(t,e,n){if(!(0,Cu.isEligibleForProperties)(t))return!1;for(let r of n.types)if(t.values.has(`${sr.PropertyType.Type}:${r}`))return!0;return!1},resolveProperty(t,e,n,r=!1){if(!(0,Cu.isEligibleForProperties)(t))return new bi({source:t.source,kind:Fs.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(yt.SignatureDefinitionBaseType.Any);let i=new bi({source:n.source,kind:Fs.CompletionItemKind.Variable,container:e,label:n.label,context:t});return n.types.has(yt.SignatureDefinitionBaseType.Any)?t.values.forEach(s=>{i.extend(s)}):n.types.forEach(s=>{let o=t.values.get(`${sr.PropertyType.Type}:${s}`);o&&i.extend(o)}),i.types.size===0&&i.addType(yt.SignatureDefinitionBaseType.Any),bi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){return(0,Cu.isEligibleForProperties)(t)?(n.types.forEach(s=>{let o=`${sr.PropertyType.Type}:${s}`,a=t.values.get(o);a?a.extend(r,i):t.values.set(o,r.copy({container:e,label:s,context:t,definitions:i?r.definitions:[]}))}),!0):!1}},type:{hasProperty(t,e,n){return!!(0,Od.lookupProperty)(sr.PropertyType.Type,t,n)},resolveProperty(t,e,n,r=!1){let i=(0,Od.lookupProperty)(sr.PropertyType.Type,t,n)??null;return i==null?null:bi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){if(!(0,Cu.isEligibleForProperties)(t))return!1;let s=`${sr.PropertyType.Type}:${n}`,o=t.values.get(s);return o?o.extend(r,i):t.values.set(s,r.copy({container:e,label:n,context:t,definitions:i?r.definitions:[]})),!0}}}});var W_=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.Scope=void 0;var Pd=xn(),$s=qs(),qF=js(),$_=ku(),Dd=Yo(),B_=class t{get source(){return this._source}get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return $s.CompletionItemKind.Constant}get line(){return this._locals.line}get label(){return this._locals.label}get context(){return this._locals.context}get types(){return new Set(Pd.SignatureDefinitionBaseType.Map)}get values(){return this._locals.values}get globals(){return this._globals}get outer(){return this._parent?.locals??null}get locals(){return this._locals}constructor(e){this._source=e.source,this._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new Dd.Entity({source:this._source,kind:$s.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(Pd.SignatureDefinitionBaseType.Map)}getIsa(){return null}hasIsa(){return!1}setCustomType(e,n){this._container.setCustomType(e,n)}addSignatureType(){throw new Error("Cannot add signature type to scope!")}hasProperty(e){return this._locals.hasProperty(e)}resolveProperty(e,n){return this._locals.resolveProperty(e,n)}resolveNamespace(e,n=!1){if(typeof e!="string")throw new Error("Invalid property type for scope!");if(e==="locals")return this._locals;if(e==="outer")return this._parent?.locals??this._globals;if(e==="globals")return this._globals;let r=`${qF.PropertyType.Identifier}:${e}`;if(this._locals.values.has(r)){let i=this._locals.values.get(r);return Dd.Entity.resolveEntity(this._container,i,n)}else if(this._parent?.locals.values.has(r)){let i=this._parent.locals.values.get(r);return Dd.Entity.resolveEntity(this._container,i,n)}else if(this._globals.values.has(r)){let i=this._globals.values.get(r);return Dd.Entity.resolveEntity(this._container,i,n)}return this._container.getGeneralDefinition(e,n)}setProperty(e,n){return this._locals.setProperty(e,n)}extend(e){return this._locals.extend(e),this}addType(){throw new Error("Scope cannot get type assigned!")}addTypes(){throw new Error("Scope cannot get types assigned!")}addTypeWithMeta(){throw new Error("Scope cannot get meta type assigned!")}addTypesWithMeta(){throw new Error("Scope cannot get meta types assigned!")}setReturnEntity(){throw new Error("Scope cannot set return entity!")}getReturnEntity(){throw new Error("Scope cannot get return entity!")}setKind(e){return this._locals.setKind(e),this}setLine(e){return this._locals.setLine(e),this}setLabel(e){return this._locals.setLabel(e),this}setContext(e){return this._locals.setContext(e),this}insertSignature(e){return this._locals.insertSignature(e),this}isAPI(){return!1}hasContext(){return!1}isFromSignature(){return!1}isCallable(){return!1}getCallableReturnTypes(){return null}getPropertyTypes(){return this._locals.getPropertyTypes()}getValueTypes(){return this._locals.getValueTypes()}getAvailableIdentifier(){let e=new Map([["globals",{kind:$s.CompletionItemKind.Constant,line:-1}],["locals",{kind:$s.CompletionItemKind.Constant,line:-1}],["outer",{kind:$s.CompletionItemKind.Constant,line:-1}],...this._container.getAvailableIdentifier(Pd.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,$_.injectIdentifers)(e,this._globals),this._parent&&(0,$_.injectIdentifers)(e,this._parent.locals),(0,$_.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:$s.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:$s.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(Pd.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}toMeta(){return this._locals.toMeta()}copy(e={}){return new t({source:this._source,container:e.container??this._container,parent:this._parent.copy({container:e.container,deepCopy:!0}),globals:this._globals.copy({container:e.container,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};Id.Scope=B_});var Jo=m(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.GreybelKeyword=void 0;var jF;(function(t){t.Envar="#envar",t.Import="#import",t.Include="#include",t.ImportWithComment="//import",t.IncludeWithComment="//include",t.Debugger="debugger",t.Line="#line",t.File="#filename",t.Inject="#inject"})(jF=Ou.GreybelKeyword||(Ou.GreybelKeyword={}))});var G_=m(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var Bs=Ee(),FF=Jo(),U_=class extends Bs.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(Bs.Keyword),...Object.values(FF.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===Bs.CharacterCode.HASH}isMultilineComment(e,n){return Bs.CharacterCode.SLASH===e&&Bs.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return Bs.CharacterCode.ASTERISK===e&&Bs.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};H_.default=U_});var z_=m(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.CharacterCode=void 0;var $F;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})($F=Ru.CharacterCode||(Ru.CharacterCode={}))});var Qo=m(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.Operator=void 0;var BF;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(BF=Pu.Operator||(Pu.Operator={}))});var K_=m(Du=>{"use strict";var WF=Du&&Du.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Du,"__esModule",{value:!0});var xr=Ee(),UF=WF(G_()),cO=z_(),lO=Jo(),V_=Qo();function hO(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Md=class t extends xr.Lexer{constructor(e,n={}){n.validator=n.validator||new UF.default,super(e,n)}scan(e,n){let r=t.greybelScanHandlers[e];return r?r.call(this,n)||super.scan(e,n):super.scan(e,n)}scanMultilineComment(e){let n=this,r=n.line,i=n.lineStart,s=n.index,o=n.offset,a=n.offset,u=!1;for(;n.index<n.length;){let h=n.codeAt();if(n.validator.isEndOfLine(h))n.validator.isWinNewline(h,n.codeAt(1))&&n.index++,n.line++,a=n.index+1;else if(n.validator.isMultilineCommentEnd(n.codeAt(),n.codeAt(1))){u=!0;break}n.index++}if(!u)return n.raise("Unexpected end of file in multiline comment.",new xr.ASTRange(new xr.ASTPosition(r,s-o+1),new xr.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new xr.Token({type:xr.TokenType.Comment,value:c,line:r,lineStart:i,range:[n.tokenStart,n.index],offsetRange:[o,a],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,n.snapshot.enqueue(l),l}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(lO.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(lO.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Du.default=Md;Md.greybelScanHandlers={[xr.CharacterCode.ARROW_LEFT]:function(e){if(xr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(V_.Operator.LeftShift,e)},[xr.CharacterCode.ARROW_RIGHT]:function(e){if(xr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return xr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(V_.Operator.UnsignedRightShift,e):this.scanPunctuator(V_.Operator.RightShift,e)},[cO.CharacterCode.AMPERSAND]:hO,[cO.CharacterCode.VERTICAL_LINE]:hO}});var Ld=m(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.ASTType=void 0;var HF;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(HF=Iu.ASTType||(Iu.ASTType={}))});var Y_=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.ASTChunkGreybel=void 0;var GF=Ee(),X_=class t extends GF.ASTChunk{constructor(e){super(e),this.imports=e.imports||[],this.includes=e.includes||[],this.injects=e.injects||[]}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),imports:this.imports.map(e=>e.clone()),includes:this.includes.map(e=>e.clone()),injects:this.injects.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nd.ASTChunkGreybel=X_});var nv=m(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.ASTFeatureFileExpression=or.ASTFeatureInjectExpression=or.ASTFeatureEnvarExpression=or.ASTFeatureIncludeExpression=or.ASTFeatureImportExpression=void 0;var Mu=Ee(),Lu=Ld(),J_=class t extends Mu.ASTBase{constructor(e){super(Lu.ASTType.FeatureImportExpression,e),this.name=e.name,this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureImportExpression[${this.start}-${this.end}][name = ${this.name}, path = ${this.path}]`}clone(){return new t({name:this.name.clone(),path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureImportExpression=J_;var Q_=class t extends Mu.ASTBase{constructor(e){super(Lu.ASTType.FeatureIncludeExpression,e),this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureIncludeExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureIncludeExpression=Q_;var Z_=class t extends Mu.ASTBase{constructor(e){super(Lu.ASTType.FeatureEnvarExpression,e),this.name=e.name}toString(){return`FeatureEnvarExpression[${this.start}-${this.end}][name = ${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureEnvarExpression=Z_;var ev=class t extends Mu.ASTBase{constructor(e){super(Lu.ASTType.FeatureInjectExpression,e),this.path=e.path}toString(){return`FeatureInjectExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureInjectExpression=ev;var tv=class t extends Mu.ASTBase{constructor(e){super(Lu.ASTType.FeatureFileExpression,e),this.filename=e.filename}toString(){return`FeatureFileExpression[${this.start}-${this.end}][path = ${this.filename}]`}clone(){return new t({filename:this.filename,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureFileExpression=tv});var sv=m(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.ASTFeatureInjectExpression=Wt.ASTFeatureIncludeExpression=Wt.ASTFeatureImportExpression=Wt.ASTFeatureFileExpression=Wt.ASTFeatureEnvarExpression=Wt.ASTChunkGreybel=Wt.ASTType=Wt.ASTProvider=void 0;var rv=Ee(),dO=Ld(),zF=Y_(),Nu=nv(),iv=class extends rv.ASTProvider{featureImportExpression(e){return new Nu.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Nu.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Nu.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Nu.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new rv.ASTBase(dO.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new rv.ASTBase(dO.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Nu.ASTFeatureFileExpression(e)}chunk(e){return new zF.ASTChunkGreybel(e)}};Wt.ASTProvider=iv;var VF=Ld();Object.defineProperty(Wt,"ASTType",{enumerable:!0,get:function(){return VF.ASTType}});var KF=Y_();Object.defineProperty(Wt,"ASTChunkGreybel",{enumerable:!0,get:function(){return KF.ASTChunkGreybel}});var qu=nv();Object.defineProperty(Wt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return qu.ASTFeatureEnvarExpression}});Object.defineProperty(Wt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return qu.ASTFeatureFileExpression}});Object.defineProperty(Wt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return qu.ASTFeatureImportExpression}});Object.defineProperty(Wt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return qu.ASTFeatureIncludeExpression}});Object.defineProperty(Wt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return qu.ASTFeatureInjectExpression}})});var ov=m(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.SelectorGroups=bt.SelectorGroupType=bt.Selectors=bt.SelectorTypes=void 0;var We=Ee(),qd=Jo(),ju=Qo(),XF;(function(t){t.From="From",t.Envar="Envar",t.Inject="Inject",t.Line="Line",t.File="File",t.LeftShift="LeftShift",t.RightShift="RightShift",t.UnsignedRightShift="UnsignedRightShift",t.BitwiseOr="BitwiseOr",t.BitwiseAnd="BitwiseAnd",t.Escape="Escape"})(XF=bt.SelectorTypes||(bt.SelectorTypes={}));bt.Selectors=Object.assign(Object.assign({},We.Selectors),{From:(0,We.createSelector)({type:We.TokenType.Identifier,value:"from"}),Envar:(0,We.createSelector)({type:We.TokenType.Keyword,value:qd.GreybelKeyword.Envar}),Inject:(0,We.createSelector)({type:We.TokenType.Keyword,value:qd.GreybelKeyword.Inject}),Line:(0,We.createSelector)({type:We.TokenType.Keyword,value:qd.GreybelKeyword.Line}),File:(0,We.createSelector)({type:We.TokenType.Keyword,value:qd.GreybelKeyword.File}),LeftShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:ju.Operator.LeftShift}),RightShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:ju.Operator.RightShift}),UnsignedRightShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:ju.Operator.UnsignedRightShift}),BitwiseOr:(0,We.createSelector)({type:We.TokenType.Punctuator,value:ju.Operator.BitwiseOr}),BitwiseAnd:(0,We.createSelector)({type:We.TokenType.Punctuator,value:ju.Operator.BitwiseAnd}),Escape:(0,We.createSelector)({type:We.TokenType.Punctuator,value:We.Operator.Escape})});var _i;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(_i=bt.SelectorGroupType||(bt.SelectorGroupType={}));bt.SelectorGroups=Object.assign(Object.assign({},We.SelectorGroups),{[_i.MapSeparator]:(0,We.createSelectorGroup)(_i.MapSeparator,[bt.Selectors.MapSeperator,bt.Selectors.CRBracket]),[_i.ListSeparator]:(0,We.createSelectorGroup)(_i.ListSeparator,[bt.Selectors.MapSeperator,bt.Selectors.SRBracket]),[_i.PathSegmentEnd]:(0,We.createSelectorGroup)(_i.PathSegmentEnd,[bt.Selectors.EndOfLine,bt.Selectors.Comment,bt.Selectors.EndOfFile]),[_i.BitwiseOperators]:(0,We.createSelectorGroup)(_i.BitwiseOperators,[bt.Selectors.LeftShift,bt.Selectors.RightShift,bt.Selectors.UnsignedRightShift])})});var gO=m(Fu=>{"use strict";var YF=Fu&&Fu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fu,"__esModule",{value:!0});var Fn=Ee(),JF=Va(),fO=Za(),QF=YF(K_()),ZF=sv(),Ws=Jo(),pO=Qo(),qe=ov(),av=class extends Fn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new QF.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new ZF.ASTProvider,super(e,n);let i=this;i.filename=(r=n.filename)!==null&&r!==void 0?r:"unknown",i.imports=[],i.includes=[],i.injects=[]}skipNewlines(){var e;let n=this,r=0;for(;;){if(qe.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,isMultiline:n.token.value.indexOf(`
|
110
|
-
`)!==-1,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.lineRegistry.addItemToLines(s)}else if(qe.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}parseMap(e=!1,n=!1){let r=this;if(!qe.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),qe.Selectors.CRBracket(r.token))r.next();else for(;!qe.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),qe.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.key=r.parseExpr(null),r.requireToken(qe.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(qe.SelectorGroups.MapSeparator,s.start);if(qe.Selectors.CRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!qe.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),qe.Selectors.SRBracket(r.token))r.next();else for(;!qe.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),qe.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(qe.SelectorGroups.ListSeparator,s.start);if(qe.Selectors.SRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===Fn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!qe.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(qe.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken,r=e.parsePathSegment(),i=e.astProvider.featureIncludeExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.includes.push(i),i}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken,i=n.parseIdentifier(Fn.ASTIdentifierKind.Variable);if(!n.consume(qe.Selectors.From))return n.raise("expected from keyword",new fO.Range(r.start,new JF.Position((e=n.token.lastLine)!==null&&e!==void 0?e:n.token.line,n.token.end.character))),n.parseInvalidCode();let s=n.parsePathSegment(),o=n.astProvider.featureImportExpression({name:i,path:s,start:r.start,end:n.previousToken.end,range:[r.range[0],n.previousToken.range[1]],scope:n.currentScope});return n.imports.push(o),n.currentScope.definitions.push(o),o}parseFeatureEnvarExpression(){let e=this,n=e.previousToken,r=e.token.value;return e.next(),e.astProvider.featureEnvarExpression({name:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope})}parseFeatureInjectExpression(){let e=this,n=e.previousToken,r=this.parsePathSegment();e.next();let i=e.astProvider.featureInjectExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.injects.push(i),i}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseBitwiseOr(e,n);if(qe.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:Fn.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseBitwiseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwiseAnd(e,n);for(;qe.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:pO.Operator.BitwiseOr,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseComparisons(e,n);for(;qe.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:pO.Operator.BitwiseAnd,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwise(e,n);for(;qe.Selectors.Plus(r.token)||qe.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseBitwise();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;qe.SelectorGroups.BitwiseOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAtom(){let e=this;return qe.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):qe.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):qe.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):qe.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):super.parseAtom()}parseStatement(){let e=this,n=e.backpatches.peek();if(e.isType(Fn.TokenType.Keyword))switch(e.token.value){case Ws.GreybelKeyword.Include:case Ws.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case Ws.GreybelKeyword.Import:case Ws.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case Ws.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case Ws.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case Ws.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunk({start:n.start,end:null,range:[n.range[0],null]}),i=new Fn.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!qe.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!qe.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,Fn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new fO.Range(s.block.start,s.block.start));if(s.complete(e.previousToken),e.errors.push(o),!e.unsafe)throw o;s=e.backpatches.pop()}return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};Fu.default=av});var Yr=m(Nt=>{"use strict";var e$=Nt&&Nt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),$u=Nt&&Nt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&e$(e,t,n)},uv=Nt&&Nt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.Parser=Nt.LexerValidator=Nt.Lexer=void 0;var t$=K_();Object.defineProperty(Nt,"Lexer",{enumerable:!0,get:function(){return uv(t$).default}});var n$=G_();Object.defineProperty(Nt,"LexerValidator",{enumerable:!0,get:function(){return uv(n$).default}});var r$=gO();Object.defineProperty(Nt,"Parser",{enumerable:!0,get:function(){return uv(r$).default}});$u(sv(),Nt);$u(z_(),Nt);$u(Jo(),Nt);$u(Qo(),Nt);$u(ov(),Nt)});var cv=m(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.merge=void 0;function i$(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}jd.merge=i$});var mO=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.parseAssignDescription=Us.AssignTag=void 0;var s$=Fh(),o$=xn(),a$=md(),lv;(function(t){t.Define="define"})(lv=Us.AssignTag||(Us.AssignTag={}));var u$=new Set(Object.values(lv));function c$(t){return o$.SignatureDefinitionTypeMeta.fromString(t)}function l$(t){let e=t.tags.find(n=>n.tag===lv.Define);return e?{type:e.type.split("|").map(c$)}:null}function h$(t){return u$.has(t.tag)}function d$(t){let e=(0,s$.parse)((0,a$.createCommentBlock)(t)),[n]=e;return n.tags.filter(h$).length>0?l$(n):null}Us.parseAssignDescription=d$});var yO=m(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.parseMapDescription=Hs.MapTag=void 0;var f$=Fh(),p$=xn(),g$=md(),Fd;(function(t){t.Type="type",t.Property="property"})(Fd=Hs.MapTag||(Hs.MapTag={}));var m$=new Set(Object.values(Fd));function y$(t){return p$.SignatureDefinitionTypeMeta.fromString(t)}function b$(t){return{path:t.name,type:t.type.split("|").map(y$)}}function _$(t){let e=t.tags.find(r=>r.tag===Fd.Type);if(!e)return null;let n=t.tags.filter(r=>r.tag===Fd.Property);return{type:e.name,properties:n.map(b$)}}function v$(t){return m$.has(t.tag)}function S$(t){let e=(0,f$.parse)((0,g$.createCommentBlock)(t)),[n]=e;return n.tags.filter(v$).length>0?_$(n):null}Hs.parseMapDescription=S$});var dv=m(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.Aggregator=Zo.ASTChainIterator=void 0;var Bu=Yr(),Te=xn(),Ce=Ee(),T$=I_(),Se=qs(),bO=js(),Gs=L_(),_O=_b(),vO=C_(),w$=k_(),wO=au(),SO=cv(),E$=F_(),TO=A_(),x$=mO(),A$=yO(),k$=Yo(),$d=class{constructor(e,n,r=!1,i=!1){this.aggregator=e,this.chain=n,this.noInvoke=r,this.assume=i,this.index=0,this.endIndex=this.chain.length-1,this.current=null}defineAssumedProperty(e,n){let r=this.aggregator.factory(this.index===0?Se.CompletionItemKind.Variable:Se.CompletionItemKind.Property);return typeof n=="string"&&r.setLabel(n),this.assume?(r.addType(Te.SignatureDefinitionBaseType.Map),e.setProperty(n,r),e.resolveProperty(n,!0)):(r.addType(Te.SignatureDefinitionBaseType.Any),r)}getInitial(){let e=null,n=this.aggregator.scope,r=this.aggregator.document,i=this.chain[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,Gs.isResolveChainItemWithIdentifier)(i))if(i.getter.name==="globals")e=n.globals;else if(i.getter.name==="outer")e=n.outer;else if(i.getter.name==="locals")e=n.locals;else if(i.getter.name==="super"){let o=r.getScopeContext(i.ref.scope)?.scope.context?.getIsa();o==null?e=this.aggregator.factory(Se.CompletionItemKind.Constant).addType("null").setLabel("super"):e=o.copy({kind:Se.CompletionItemKind.Constant,label:"super",values:o.values})}else if(i.getter.name==="self"){let o=r.getScopeContext(i.ref.scope)?.scope.context;o==null?e=this.aggregator.factory(Se.CompletionItemKind.Constant).addType("null").setLabel("self"):e=o.copy({kind:Se.CompletionItemKind.Constant,label:"self",values:o.values})}else{let o=n.resolveNamespace(i.getter.name,s);o==null&&(o=this.defineAssumedProperty(n.globals,i.getter.name)),e=o}else if((0,Gs.isResolveChainItemWithValue)(i))e=this.aggregator.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator===Ce.Keyword.New&&e!==null){let o=this.aggregator.factory(Se.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Map).setLabel(e.label);o.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(i.unary,o),e=o}return e}getNext(){let e=this.current,n=this.chain[this.index];if((0,Gs.isResolveChainItemWithMember)(n)){let r=n.unary?.operator==="@"&&!n.isInCallExpression||this.noInvoke&&this.index===this.endIndex,i=e.resolveProperty(n.getter.name,r);i==null&&(i=this.defineAssumedProperty(e,n.getter.name)),e=i}else if((0,Gs.isResolveChainItemWithIndex)(n)){let r=n.unary?.operator==="@"&&!n.isInCallExpression||this.noInvoke&&this.index===this.endIndex||!n.ref.isStatementStart&&!n.isInCallExpression;if((0,wO.isValidIdentifierLiteral)(n.getter)){let i=n.getter.value.toString(),s=e.resolveProperty(i,r);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}else{let i=this.aggregator.resolveTypeWithDefault(n.getter),s=e.resolveProperty(i,r);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}}else if(n.ref.type===Ce.ASTType.SliceExpression)e=e.copy();else return null;if(n.unary?.operator===Ce.Keyword.New&&this.current!==null){let r=this.aggregator.factory(Se.CompletionItemKind.Property).addType(Te.SignatureDefinitionBaseType.Map).setLabel(e.label);r.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(n.unary,r),e=r}return e}next(){if(this.index>=this.chain.length)return{value:null,done:!0};let e=this.index===0?this.getInitial():this.getNext();return e==null?{value:null,done:!0}:(this.index++,this.current=e,{value:e,done:!1})}};Zo.ASTChainIterator=$d;var hv=class{get definitions(){return this._definitions}get parent(){return this._parent}get scope(){return this._scope}get document(){return this._document}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map,this._lastModifiedProperty=null}factory(e){return new k$.Entity({source:this._document.source,kind:e,container:this._document.container})}resolveRelatedCommentLines(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Ce.ASTType.Comment);if(n instanceof Ce.ASTComment){let i=new Set,s=[],o=e.start.line-1;for(;o>=0;){let a=this._document.getLastASTItemOfLine(o--);if(!i.has(a))if(a instanceof Ce.ASTComment)i.add(a),s.unshift((0,TO.normalizeText)(a.value));else break}return s}else if(r instanceof Ce.ASTComment)return[(0,TO.normalizeText)(r.value)];return null}createCustomTypeFromMap(e,n){let r=this.resolveRelatedCommentLines(e);if(r==null)return;let i=r.join(`
|
111
|
-
`),s=(0,
|
109
|
+
`),n=t.tags.filter(s=>s.tag===ns.Param).map($F),r=t.tags.filter(s=>s.tag===ns.Return||s.tag===ns.Returns).flatMap(vC),i=t.tags.filter(s=>s.tag===ns.Example).map(FF);return r.length===0&&(r=vC({type:Td.SignatureDefinitionBaseType.Any})),{descriptions:e,args:n,returns:r,examples:i}}function TC(t){return qF.has(t.tag)}function WF(t){let e=(0,MF.parse)((0,NF.createCommentBlock)(t.getDescription())),[n]=e;if(n.tags.filter(TC).length>0){let{descriptions:i,args:s,returns:o,examples:a}=BF(n);return Td.SignatureDefinitionFunction.parse("custom",{id:(0,LF.nanoid)(),type:Td.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((u,c)=>{let l=u.getLabel(),h=u.getTypes().map(g=>g.toString()),d=u.isOptional();return{types:h,opt:d,...s[c],label:l}}),returns:o,description:i,example:a})}return t}js.enrichWithMetaInformation=WF});var L_=m(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.createResolveChain=void 0;var Lt=Ee();function rs(t,e,n=null,r=!1){switch(t.type){case Lt.ASTType.ParenthesisExpression:{rs(t.expression,e,n);return}case Lt.ASTType.MemberExpression:{let i=t;rs(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case Lt.ASTType.IndexExpression:{let i=t;rs(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case Lt.ASTType.CallStatement:{rs(t.expression,e,n,!0);return}case Lt.ASTType.CallExpression:{rs(t.base,e,n,!0);return}case Lt.ASTType.NegationExpression:case Lt.ASTType.BinaryNegatedExpression:case Lt.ASTType.UnaryExpression:{let i=t;rs(i.argument,e,i);return}case Lt.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case Lt.ASTType.NumericLiteral:case Lt.ASTType.StringLiteral:case Lt.ASTType.NilLiteral:case Lt.ASTType.BooleanLiteral:case Lt.ASTType.MapConstructorExpression:case Lt.ASTType.ListConstructorExpression:case Lt.ASTType.BinaryExpression:case Lt.ASTType.LogicalExpression:case Lt.ASTType.ComparisonGroupExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case Lt.ASTType.SliceExpression:rs(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function UF(t){let e=[];return rs(t,e),e}wd.createResolveChain=UF});var j_=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ObjectSet=Jo.ObjectSetIterator=void 0;var N_=fd(),Ed=class{constructor(e){let n=this;n.value=e,n.index=0}next(){let e=this;return e.index>=e.value.length?{value:null,done:!0}:{value:e.value[e.index++],done:!1}}};Jo.ObjectSetIterator=Ed;var q_=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,N_.objectHash)(i),i]);this._map=new Map(r),this._first=null,this._last=null,r.length>0&&(this._first=r[0][0],this._last=r[r.length-1][0])}[Symbol.iterator](){return new Ed(Array.from(this._map.values()))}first(){return this._first!=null?this._map.get(this._first)??null:null}last(){return this._last!=null?this._map.get(this._last)??null:null}toArray(){return Array.from(this._map.values())}add(e){let n=(0,N_.objectHash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,N_.objectHash)(e);return this._map.delete(n)}extend(e){return e._map.forEach((n,r)=>{this._map.set(r,n),this._first??(this._first=r),this._last=r}),this}toJSON(){return Array.from(this._map.values())}clear(){this._map.clear()}};Jo.ObjectSet=q_});var F_=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;xd.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION="This is a custom method. You can add a description for this method by adding a comment above or after the function.\n```\nmyFunction = function(a, b, c) // This function does xyz\n```\nor\n```\n/*\n This function does xyz\n*/\nmyFunction = function(a, b, c)\n```"});var Fs=m(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.CompletionItemKind=void 0;var HF;(function(t){t.Variable="var",t.Property="property",t.Function="function",t.Literal="literal",t.Constant="constant",t.Internal="internal",t.InternalFunction="internal-function",t.InternalProperty="internal-property",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(HF=ku.CompletionItemKind||(ku.CompletionItemKind={}))});var $s=m(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.IsaPropertyPattern=_i.IdentifierPropertyPattern=_i.PropertyType=void 0;var $_;(function(t){t.Type="t",t.Identifier="i"})($_=_i.PropertyType||(_i.PropertyType={}));_i.IdentifierPropertyPattern=`${$_.Identifier}:`;_i.IsaPropertyPattern=`${$_.Identifier}:__isa`});var B_=m(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isResolveChainItemWithValue=Jr.isResolveChainItemWithIdentifier=Jr.isResolveChainItemWithMember=Jr.isResolveChainItemWithIndex=void 0;var sr=Ee(),GF=t=>t!=null&&t.ref.type===sr.ASTType.IndexExpression;Jr.isResolveChainItemWithIndex=GF;var zF=t=>t!=null&&t.ref.type===sr.ASTType.MemberExpression;Jr.isResolveChainItemWithMember=zF;var KF=t=>t!=null&&t.ref.type===sr.ASTType.Identifier;Jr.isResolveChainItemWithIdentifier=KF;var VF=new Set([sr.ASTType.NumericLiteral,sr.ASTType.StringLiteral,sr.ASTType.NilLiteral,sr.ASTType.BooleanLiteral,sr.ASTType.MapConstructorExpression,sr.ASTType.ListConstructorExpression,sr.ASTType.BinaryExpression,sr.ASTType.LogicalExpression,sr.ASTType.ComparisonGroupExpression]),XF=t=>t!=null&&VF.has(t.ref.type);Jr.isResolveChainItemWithValue=XF});var W_=m(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.isSignatureDefinitionFunction=void 0;var YF=gn(),JF=t=>t.getType().type===YF.SignatureDefinitionBaseType.Function;Ad.isSignatureDefinitionFunction=JF});var U_=m(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.aggregateEntity=void 0;var QF=t=>{let e=new Set,n=t;for(;n!=null&&!e.has(n);)e.add(n),n=n.getIsa();return Array.from(e)};kd.aggregateEntity=QF});var Cu=m(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.injectIdentifers=void 0;var ZF=$s(),e$=U_(),t$=(t,e)=>{let n=(0,e$.aggregateEntity)(e);for(let r=0;r<n.length;r++)n[r].values.forEach((s,o)=>{if(o.startsWith(ZF.IdentifierPropertyPattern)){let a=o.slice(2);if(t.has(a))return;t.set(a,{kind:s.kind,line:s.source===e.source?s.line:-1})}})};Cd.injectIdentifers=t$});var Rd=m(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.isEligibleForProperties=void 0;var H_=gn(),n$=t=>t.types.has(H_.SignatureDefinitionBaseType.Map)||t.types.has(H_.SignatureDefinitionBaseType.List)||t.types.has(H_.SignatureDefinitionBaseType.Any);Od.isEligibleForProperties=n$});var Pd=m(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.lookupProperty=void 0;var r$=Rd(),i$=(t,e,n)=>{let r=e,i=new Set([r]);for(;(0,r$.isEligibleForProperties)(r);){let s=r.values.get(`${t}:${n}`);if(s!=null)return s;let o=r.getIsa();if(o==null||i.has(o))break;i.add(o),r=o}return null};Dd.lookupProperty=i$});var G_=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.mergeUnique=void 0;function s$(t,e,n=1e4){let r=Array.from(new Set([...t,...e]));if(t.length=0,r.length<=n){Array.prototype.push.apply(t,r);return}for(let i=0;i<r.length;i+=n)Array.prototype.push.apply(t,r.slice(i,i+n))}Id.mergeUnique=s$});var Qo=m(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.Entity=void 0;var yt=gn(),Bs=Fs(),or=$s(),o$=W_(),a$=Cu(),Ou=Rd(),Md=Pd(),u$=G_(),wC=j_(),vi=class t{static resolveEntity(e,n,r=!1){if(n.isCallable()&&!r){let i=n.getReturnEntity();if(i!==null)return i;let s=n.getCallableReturnTypes();return s?new t({source:n.source,kind:Bs.CompletionItemKind.Variable,container:e,label:n.label,context:n.context}).addTypesWithMeta(s):new t({source:n.source,kind:Bs.CompletionItemKind.Variable,container:e,label:n.label,context:n.context}).addType(yt.SignatureDefinitionBaseType.Any)}return n}get source(){return this._source}get definitions(){return this._definitions}get kind(){return this._kind}get line(){return this._line}get signatureDefinitions(){return this._signatureDefinitions}get context(){return this._context}get label(){return this._label}get types(){return this._types}get values(){return this._values}constructor(e){this._source=e.source,this._isAPI=e.isAPI??!1,this._isFromSignature=e.isFromSignature??!1,this._kind=e.kind,this._line=e.line??-1,this._label=e.label??"anonymous",this._signatureDefinitions=e.signatureDefinitions??new wC.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._definitions=e.definitions??[],this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}getIsa(){return this._values.get(or.IsaPropertyPattern)??null}hasIsa(){return this._values.has(or.IsaPropertyPattern)}isAPI(){return this._isAPI}isCallable(){return this._types.has(yt.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,o$.isSignatureDefinitionFunction)(n));return e.length===0?null:e.flatMap(n=>n.getReturns())}addSignatureType(e){return this._signatureDefinitions.add(e),this.addType(e.getType().type),this}setReturnEntity(e){return this._returnEntity=e,this}getReturnEntity(){return this._returnEntity}setKind(e){return this._kind=e,this}setLine(e){return this._line=e,this}setLabel(e){return this._label=e,this}setContext(e){return this._context=e,this}addType(e){return this._types.add(e),this}addTypes(e){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}addTypeWithMeta(e){if(this._types.add(e.type),e.type===yt.SignatureDefinitionBaseType.Map||e.type===yt.SignatureDefinitionBaseType.List){let n=e.type===yt.SignatureDefinitionBaseType.Map?e.keyType.type??yt.SignatureDefinitionBaseType.Any:yt.SignatureDefinitionBaseType.Number,r=new t({source:this._source,kind:Bs.CompletionItemKind.Property,container:this._container,context:this});e.valueType.type===yt.SignatureDefinitionBaseType.Map||e.valueType.type===yt.SignatureDefinitionBaseType.List?r.addTypeWithMeta(e.valueType):r.addType(e.valueType.type??yt.SignatureDefinitionBaseType.Any),t.handlers.type.setProperty(this,this._container,n,r)}return this}addTypesWithMeta(e){for(let n=0;n<e.length;n++)this.addTypeWithMeta(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return t.handlers.entity.hasProperty(this,this._container,e);default:return t.handlers.identifier.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return t.handlers.entity.resolveProperty(this,this._container,e,n);default:return t.handlers.identifier.resolveProperty(this,this._container,e,n)}}setProperty(e,n,r=!1){switch(typeof e){case"object":return t.handlers.entity.setProperty(this,this._container,e,n,r);default:return t.handlers.identifier.setProperty(this,this._container,e,n,r)}}extend(e,n=!1,r=!1){if(e===this)return this;let i=new WeakSet([e]),s=[{target:this,source:e}];for(;s.length>0;){let o=s.pop(),a=o.target,u=o.source;a._isFromSignature=!1,a._signatureDefinitions.extend(u._signatureDefinitions),n&&(r?a._definitions=[...a._definitions,...u._definitions]:(0,u$.mergeUnique)(a._definitions,u._definitions)),a.addTypes(Array.from(u.types)),u.values.forEach((c,l)=>{let h=a._values.get(l);h==null?a._values.set(l,c.copy({container:a._container,context:a,deepCopy:r})):i.has(c)||(i.add(c),s.push({target:h,source:c}))})}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(yt.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({source:this._source,label:i,kind:s.getType().type===yt.SignatureDefinitionBaseType.Function?Bs.CompletionItemKind.InternalFunction:Bs.CompletionItemKind.InternalProperty,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getPropertyTypes(){let e=new Set;return this._values.forEach((n,r)=>{let[i,s]=r.split(":");i===or.PropertyType.Type?e.add(s):e.add(yt.SignatureDefinitionBaseType.String)}),Array.from(e)}getValueTypes(){let e=new Set;return this._values.forEach(n=>{n.types.forEach(r=>{e.add(r)})}),Array.from(e)}getAvailableIdentifier(){let e=new Map;return this._types.forEach(n=>{this._container.getAvailableIdentifier(n).forEach((i,s)=>{e.set(s,i)})}),(0,a$.injectIdentifers)(e,this),e}toJSON(e=new WeakMap){if(e.has(this))return e.get(this);let n={};return e.set(this,n),n.kind=this.kind,n.signatureDefinitions=this._signatureDefinitions.toJSON(),n.types=Array.from(this._types),n.values=Array.from(this._values).reduce((r,[i,s])=>(r[i]=s?.toJSON(e),r),{}),n}toMeta(){let e=[];return this.types.forEach(n=>{let r={type:n};switch(n){case yt.SignatureDefinitionBaseType.Map:{let i=this.getPropertyTypes();i.length===1?r.keyType=i[0]:r.keyType=yt.SignatureDefinitionBaseType.Any;let s=this.getValueTypes();s.length===1?r.valueType=s[0]:r.valueType=yt.SignatureDefinitionBaseType.Any;break}case yt.SignatureDefinitionBaseType.List:{let i=t.handlers.type.resolveProperty(this,this._container,yt.SignatureDefinitionBaseType.Number);i!=null&&i.types.size===1?r.valueType=i.types.values().next().value:r.valueType=yt.SignatureDefinitionBaseType.Any;break}}e.push(r)}),e}copy(e={}){let n=new t({source:e.source??this._source,kind:e.kind??this._kind,line:e.line??this._line,isFromSignature:e.isFromSignature??this._isFromSignature,isAPI:e.isAPI??this._isAPI,container:e.container??this._container,label:e.label??this._label,context:e.context??this._context,signatureDefinitions:new wC.ObjectSet(Array.from(this._signatureDefinitions,s=>s.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values,definitions:e.definitions??this._definitions});if(!e.deepCopy)return n;let r=new WeakMap;function i(s,o){let a=r.get(o);if(a)return a;let u=o.copy({container:e.container,line:e.line,context:s,values:new Map});return r.set(o,u),o.values.forEach((c,l)=>{u._values.set(l,i(u,c))}),u._definitions=[...o.definitions],u}return n._values=new Map,this._values.forEach((s,o)=>{n._values.set(o,i(n,s))}),n._definitions=[...this._definitions],n}};Ld.Entity=vi;vi.handlers={identifier:{hasProperty(t,e,n){return!!(0,Md.lookupProperty)(or.PropertyType.Identifier,t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,Md.lookupProperty)(or.PropertyType.Identifier,t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):vi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){if(!(0,Ou.isEligibleForProperties)(t))return!1;let s=`${or.PropertyType.Identifier}:${n}`,o=t.values.get(s);return o?o.extend(r,i):t.values.set(s,r.copy({container:e,label:n,context:t,definitions:i?r.definitions:[]})),!0}},entity:{hasProperty(t,e,n){if(!(0,Ou.isEligibleForProperties)(t))return!1;for(let r of n.types)if(t.values.has(`${or.PropertyType.Type}:${r}`))return!0;return!1},resolveProperty(t,e,n,r=!1){if(!(0,Ou.isEligibleForProperties)(t))return new vi({source:t.source,kind:Bs.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(yt.SignatureDefinitionBaseType.Any);let i=new vi({source:n.source,kind:Bs.CompletionItemKind.Variable,container:e,label:n.label,context:t});return n.types.has(yt.SignatureDefinitionBaseType.Any)?t.values.forEach(s=>{i.extend(s)}):n.types.forEach(s=>{let o=t.values.get(`${or.PropertyType.Type}:${s}`);o&&i.extend(o)}),i.types.size===0&&i.addType(yt.SignatureDefinitionBaseType.Any),vi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){return(0,Ou.isEligibleForProperties)(t)?(n.types.forEach(s=>{let o=`${or.PropertyType.Type}:${s}`,a=t.values.get(o);a?a.extend(r,i):t.values.set(o,r.copy({container:e,label:s,context:t,definitions:i?r.definitions:[]}))}),!0):!1}},type:{hasProperty(t,e,n){return!!(0,Md.lookupProperty)(or.PropertyType.Type,t,n)},resolveProperty(t,e,n,r=!1){let i=(0,Md.lookupProperty)(or.PropertyType.Type,t,n)??null;return i==null?null:vi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){if(!(0,Ou.isEligibleForProperties)(t))return!1;let s=`${or.PropertyType.Type}:${n}`,o=t.values.get(s);return o?o.extend(r,i):t.values.set(s,r.copy({container:e,label:n,context:t,definitions:i?r.definitions:[]})),!0}}}});var V_=m(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.Scope=void 0;var Nd=gn(),Ws=Fs(),c$=$s(),z_=Cu(),qd=Qo(),K_=class t{get source(){return this._source}get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return Ws.CompletionItemKind.Constant}get line(){return this._locals.line}get label(){return this._locals.label}get context(){return this._locals.context}get types(){return new Set(Nd.SignatureDefinitionBaseType.Map)}get values(){return this._locals.values}get globals(){return this._globals}get outer(){return this._parent?.locals??null}get locals(){return this._locals}constructor(e){this._source=e.source,this._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new qd.Entity({source:this._source,kind:Ws.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(Nd.SignatureDefinitionBaseType.Map)}getIsa(){return null}hasIsa(){return!1}setCustomType(e,n){this._container.setCustomType(e,n)}addSignatureType(){throw new Error("Cannot add signature type to scope!")}hasProperty(e){return this._locals.hasProperty(e)}resolveProperty(e,n){return this._locals.resolveProperty(e,n)}resolveNamespace(e,n=!1){if(typeof e!="string")throw new Error("Invalid property type for scope!");if(e==="locals")return this._locals;if(e==="outer")return this._parent?.locals??this._globals;if(e==="globals")return this._globals;let r=`${c$.PropertyType.Identifier}:${e}`;if(this._locals.values.has(r)){let i=this._locals.values.get(r);return qd.Entity.resolveEntity(this._container,i,n)}else if(this._parent?.locals.values.has(r)){let i=this._parent.locals.values.get(r);return qd.Entity.resolveEntity(this._container,i,n)}else if(this._globals.values.has(r)){let i=this._globals.values.get(r);return qd.Entity.resolveEntity(this._container,i,n)}return this._container.getGeneralDefinition(e,n)}setProperty(e,n){return this._locals.setProperty(e,n)}extend(e){return this._locals.extend(e),this}addType(){throw new Error("Scope cannot get type assigned!")}addTypes(){throw new Error("Scope cannot get types assigned!")}addTypeWithMeta(){throw new Error("Scope cannot get meta type assigned!")}addTypesWithMeta(){throw new Error("Scope cannot get meta types assigned!")}setReturnEntity(){throw new Error("Scope cannot set return entity!")}getReturnEntity(){throw new Error("Scope cannot get return entity!")}setKind(e){return this._locals.setKind(e),this}setLine(e){return this._locals.setLine(e),this}setLabel(e){return this._locals.setLabel(e),this}setContext(e){return this._locals.setContext(e),this}insertSignature(e){return this._locals.insertSignature(e),this}isAPI(){return!1}hasContext(){return!1}isFromSignature(){return!1}isCallable(){return!1}getCallableReturnTypes(){return null}getPropertyTypes(){return this._locals.getPropertyTypes()}getValueTypes(){return this._locals.getValueTypes()}getAvailableIdentifier(){let e=new Map([["globals",{kind:Ws.CompletionItemKind.Constant,line:-1}],["locals",{kind:Ws.CompletionItemKind.Constant,line:-1}],["outer",{kind:Ws.CompletionItemKind.Constant,line:-1}],...this._container.getAvailableIdentifier(Nd.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,z_.injectIdentifers)(e,this._globals),this._parent&&(0,z_.injectIdentifers)(e,this._parent.locals),(0,z_.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:Ws.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:Ws.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(Nd.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}toMeta(){return this._locals.toMeta()}copy(e={}){return new t({source:this._source,container:e.container??this._container,parent:this._parent.copy({container:e.container,deepCopy:!0}),globals:this._globals.copy({container:e.container,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};jd.Scope=K_});var Zo=m(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.GreybelKeyword=void 0;var l$;(function(t){t.Envar="#envar",t.Import="#import",t.Include="#include",t.ImportWithComment="//import",t.IncludeWithComment="//include",t.Debugger="debugger",t.Line="#line",t.File="#filename",t.Inject="#inject"})(l$=Ru.GreybelKeyword||(Ru.GreybelKeyword={}))});var J_=m(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});var Us=Ee(),h$=Zo(),X_=class extends Us.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(Us.Keyword),...Object.values(h$.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===Us.CharacterCode.HASH}isMultilineComment(e,n){return Us.CharacterCode.SLASH===e&&Us.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return Us.CharacterCode.ASTERISK===e&&Us.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};Y_.default=X_});var Q_=m(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.CharacterCode=void 0;var d$;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(d$=Du.CharacterCode||(Du.CharacterCode={}))});var ea=m(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.Operator=void 0;var f$;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(f$=Pu.Operator||(Pu.Operator={}))});var ev=m(Iu=>{"use strict";var p$=Iu&&Iu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Iu,"__esModule",{value:!0});var kr=Ee(),g$=p$(J_()),EC=Q_(),xC=Zo(),Z_=ea();function AC(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Fd=class t extends kr.Lexer{constructor(e,n={}){n.validator=n.validator||new g$.default,super(e,n)}scan(e,n){let r=t.greybelScanHandlers[e];return r?r.call(this,n)||super.scan(e,n):super.scan(e,n)}scanMultilineComment(e){let n=this,r=n.line,i=n.lineStart,s=n.index,o=n.offset,a=n.offset,u=!1;for(;n.index<n.length;){let h=n.codeAt();if(n.validator.isEndOfLine(h))n.validator.isWinNewline(h,n.codeAt(1))&&n.index++,n.line++,a=n.index+1;else if(n.validator.isMultilineCommentEnd(n.codeAt(),n.codeAt(1))){u=!0;break}n.index++}if(!u)return n.raise("Unexpected end of file in multiline comment.",new kr.ASTRange(new kr.ASTPosition(r,s-o+1),new kr.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new kr.Token({type:kr.TokenType.Comment,value:c,line:r,lineStart:i,range:[n.tokenStart,n.index],offsetRange:[o,a],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,n.snapshot.enqueue(l),l}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(xC.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(xC.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Iu.default=Fd;Fd.greybelScanHandlers={[kr.CharacterCode.ARROW_LEFT]:function(e){if(kr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(Z_.Operator.LeftShift,e)},[kr.CharacterCode.ARROW_RIGHT]:function(e){if(kr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return kr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(Z_.Operator.UnsignedRightShift,e):this.scanPunctuator(Z_.Operator.RightShift,e)},[EC.CharacterCode.AMPERSAND]:AC,[EC.CharacterCode.VERTICAL_LINE]:AC}});var $d=m(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.ASTType=void 0;var m$;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(m$=Mu.ASTType||(Mu.ASTType={}))});var nv=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.ASTChunkGreybel=void 0;var y$=Ee(),tv=class t extends y$.ASTChunk{constructor(e){super(e),this.imports=e.imports||[],this.includes=e.includes||[],this.injects=e.injects||[]}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),imports:this.imports.map(e=>e.clone()),includes:this.includes.map(e=>e.clone()),injects:this.injects.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Bd.ASTChunkGreybel=tv});var uv=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.ASTFeatureFileExpression=ar.ASTFeatureInjectExpression=ar.ASTFeatureEnvarExpression=ar.ASTFeatureIncludeExpression=ar.ASTFeatureImportExpression=void 0;var Lu=Ee(),Nu=$d(),rv=class t extends Lu.ASTBase{constructor(e){super(Nu.ASTType.FeatureImportExpression,e),this.name=e.name,this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureImportExpression[${this.start}-${this.end}][name = ${this.name}, path = ${this.path}]`}clone(){return new t({name:this.name.clone(),path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ar.ASTFeatureImportExpression=rv;var iv=class t extends Lu.ASTBase{constructor(e){super(Nu.ASTType.FeatureIncludeExpression,e),this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureIncludeExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ar.ASTFeatureIncludeExpression=iv;var sv=class t extends Lu.ASTBase{constructor(e){super(Nu.ASTType.FeatureEnvarExpression,e),this.name=e.name}toString(){return`FeatureEnvarExpression[${this.start}-${this.end}][name = ${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ar.ASTFeatureEnvarExpression=sv;var ov=class t extends Lu.ASTBase{constructor(e){super(Nu.ASTType.FeatureInjectExpression,e),this.path=e.path}toString(){return`FeatureInjectExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ar.ASTFeatureInjectExpression=ov;var av=class t extends Lu.ASTBase{constructor(e){super(Nu.ASTType.FeatureFileExpression,e),this.filename=e.filename}toString(){return`FeatureFileExpression[${this.start}-${this.end}][path = ${this.filename}]`}clone(){return new t({filename:this.filename,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ar.ASTFeatureFileExpression=av});var hv=m(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.ASTFeatureInjectExpression=Wt.ASTFeatureIncludeExpression=Wt.ASTFeatureImportExpression=Wt.ASTFeatureFileExpression=Wt.ASTFeatureEnvarExpression=Wt.ASTChunkGreybel=Wt.ASTType=Wt.ASTProvider=void 0;var cv=Ee(),kC=$d(),b$=nv(),qu=uv(),lv=class extends cv.ASTProvider{featureImportExpression(e){return new qu.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new qu.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new qu.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new qu.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new cv.ASTBase(kC.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new cv.ASTBase(kC.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new qu.ASTFeatureFileExpression(e)}chunk(e){return new b$.ASTChunkGreybel(e)}};Wt.ASTProvider=lv;var _$=$d();Object.defineProperty(Wt,"ASTType",{enumerable:!0,get:function(){return _$.ASTType}});var v$=nv();Object.defineProperty(Wt,"ASTChunkGreybel",{enumerable:!0,get:function(){return v$.ASTChunkGreybel}});var ju=uv();Object.defineProperty(Wt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return ju.ASTFeatureEnvarExpression}});Object.defineProperty(Wt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return ju.ASTFeatureFileExpression}});Object.defineProperty(Wt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return ju.ASTFeatureImportExpression}});Object.defineProperty(Wt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return ju.ASTFeatureIncludeExpression}});Object.defineProperty(Wt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return ju.ASTFeatureInjectExpression}})});var dv=m(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.SelectorGroups=bt.SelectorGroupType=bt.Selectors=bt.SelectorTypes=void 0;var We=Ee(),Wd=Zo(),Fu=ea(),S$;(function(t){t.From="From",t.Envar="Envar",t.Inject="Inject",t.Line="Line",t.File="File",t.LeftShift="LeftShift",t.RightShift="RightShift",t.UnsignedRightShift="UnsignedRightShift",t.BitwiseOr="BitwiseOr",t.BitwiseAnd="BitwiseAnd",t.Escape="Escape"})(S$=bt.SelectorTypes||(bt.SelectorTypes={}));bt.Selectors=Object.assign(Object.assign({},We.Selectors),{From:(0,We.createSelector)({type:We.TokenType.Identifier,value:"from"}),Envar:(0,We.createSelector)({type:We.TokenType.Keyword,value:Wd.GreybelKeyword.Envar}),Inject:(0,We.createSelector)({type:We.TokenType.Keyword,value:Wd.GreybelKeyword.Inject}),Line:(0,We.createSelector)({type:We.TokenType.Keyword,value:Wd.GreybelKeyword.Line}),File:(0,We.createSelector)({type:We.TokenType.Keyword,value:Wd.GreybelKeyword.File}),LeftShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Fu.Operator.LeftShift}),RightShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Fu.Operator.RightShift}),UnsignedRightShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Fu.Operator.UnsignedRightShift}),BitwiseOr:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Fu.Operator.BitwiseOr}),BitwiseAnd:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Fu.Operator.BitwiseAnd}),Escape:(0,We.createSelector)({type:We.TokenType.Punctuator,value:We.Operator.Escape})});var Si;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(Si=bt.SelectorGroupType||(bt.SelectorGroupType={}));bt.SelectorGroups=Object.assign(Object.assign({},We.SelectorGroups),{[Si.MapSeparator]:(0,We.createSelectorGroup)(Si.MapSeparator,[bt.Selectors.MapSeperator,bt.Selectors.CRBracket]),[Si.ListSeparator]:(0,We.createSelectorGroup)(Si.ListSeparator,[bt.Selectors.MapSeperator,bt.Selectors.SRBracket]),[Si.PathSegmentEnd]:(0,We.createSelectorGroup)(Si.PathSegmentEnd,[bt.Selectors.EndOfLine,bt.Selectors.Comment,bt.Selectors.EndOfFile]),[Si.BitwiseOperators]:(0,We.createSelectorGroup)(Si.BitwiseOperators,[bt.Selectors.LeftShift,bt.Selectors.RightShift,bt.Selectors.UnsignedRightShift])})});var RC=m($u=>{"use strict";var T$=$u&&$u.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($u,"__esModule",{value:!0});var Fn=Ee(),w$=Xa(),CC=tu(),E$=T$(ev()),x$=hv(),Hs=Zo(),OC=ea(),qe=dv(),fv=class extends Fn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new E$.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new x$.ASTProvider,super(e,n);let i=this;i.filename=(r=n.filename)!==null&&r!==void 0?r:"unknown",i.imports=[],i.includes=[],i.injects=[]}skipNewlines(){var e;let n=this,r=0;for(;;){if(qe.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,isMultiline:n.token.value.indexOf(`
|
110
|
+
`)!==-1,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.lineRegistry.addItemToLines(s)}else if(qe.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}parseMap(e=!1,n=!1){let r=this;if(!qe.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),qe.Selectors.CRBracket(r.token))r.next();else for(;!qe.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),qe.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.key=r.parseExpr(null),r.requireToken(qe.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(qe.SelectorGroups.MapSeparator,s.start);if(qe.Selectors.CRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!qe.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),qe.Selectors.SRBracket(r.token))r.next();else for(;!qe.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),qe.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(qe.SelectorGroups.ListSeparator,s.start);if(qe.Selectors.SRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===Fn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!qe.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(qe.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken,r=e.parsePathSegment(),i=e.astProvider.featureIncludeExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.includes.push(i),i}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken,i=n.parseIdentifier(Fn.ASTIdentifierKind.Variable);if(!n.consume(qe.Selectors.From))return n.raise("expected from keyword",new CC.Range(r.start,new w$.Position((e=n.token.lastLine)!==null&&e!==void 0?e:n.token.line,n.token.end.character))),n.parseInvalidCode();let s=n.parsePathSegment(),o=n.astProvider.featureImportExpression({name:i,path:s,start:r.start,end:n.previousToken.end,range:[r.range[0],n.previousToken.range[1]],scope:n.currentScope});return n.imports.push(o),n.currentScope.definitions.push(o),o}parseFeatureEnvarExpression(){let e=this,n=e.previousToken,r=e.token.value;return e.next(),e.astProvider.featureEnvarExpression({name:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope})}parseFeatureInjectExpression(){let e=this,n=e.previousToken,r=this.parsePathSegment();e.next();let i=e.astProvider.featureInjectExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.injects.push(i),i}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseBitwiseOr(e,n);if(qe.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:Fn.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseBitwiseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwiseAnd(e,n);for(;qe.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:OC.Operator.BitwiseOr,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseComparisons(e,n);for(;qe.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:OC.Operator.BitwiseAnd,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwise(e,n);for(;qe.Selectors.Plus(r.token)||qe.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseBitwise();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;qe.SelectorGroups.BitwiseOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAtom(){let e=this;return qe.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):qe.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):qe.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):qe.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):super.parseAtom()}parseStatement(){let e=this,n=e.backpatches.peek();if(e.isType(Fn.TokenType.Keyword))switch(e.token.value){case Hs.GreybelKeyword.Include:case Hs.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case Hs.GreybelKeyword.Import:case Hs.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case Hs.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case Hs.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case Hs.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunk({start:n.start,end:null,range:[n.range[0],null]}),i=new Fn.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!qe.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!qe.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,Fn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new CC.Range(s.block.start,s.block.start));if(s.complete(e.previousToken),e.errors.push(o),!e.unsafe)throw o;s=e.backpatches.pop()}return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};$u.default=fv});var Qr=m(Nt=>{"use strict";var A$=Nt&&Nt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Bu=Nt&&Nt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&A$(e,t,n)},pv=Nt&&Nt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.Parser=Nt.LexerValidator=Nt.Lexer=void 0;var k$=ev();Object.defineProperty(Nt,"Lexer",{enumerable:!0,get:function(){return pv(k$).default}});var C$=J_();Object.defineProperty(Nt,"LexerValidator",{enumerable:!0,get:function(){return pv(C$).default}});var O$=RC();Object.defineProperty(Nt,"Parser",{enumerable:!0,get:function(){return pv(O$).default}});Bu(hv(),Nt);Bu(Q_(),Nt);Bu(Zo(),Nt);Bu(ea(),Nt);Bu(dv(),Nt)});var gv=m(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.merge=void 0;function R$(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}Ud.merge=R$});var DC=m(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.parseAssignDescription=Gs.AssignTag=void 0;var D$=bd(),P$=gn(),I$=Sd(),mv;(function(t){t.Define="define"})(mv=Gs.AssignTag||(Gs.AssignTag={}));var M$=new Set(Object.values(mv));function L$(t){return P$.SignatureDefinitionTypeMeta.fromString(t)}function N$(t){let e=t.tags.find(n=>n.tag===mv.Define);return e?{type:e.type.split("|").map(L$)}:null}function q$(t){return M$.has(t.tag)}function j$(t){let e=(0,D$.parse)((0,I$.createCommentBlock)(t)),[n]=e;return n.tags.filter(q$).length>0?N$(n):null}Gs.parseAssignDescription=j$});var PC=m(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.parseMapDescription=zs.MapTag=void 0;var F$=bd(),$$=gn(),B$=Sd(),Hd;(function(t){t.Type="type",t.Property="property"})(Hd=zs.MapTag||(zs.MapTag={}));var W$=new Set(Object.values(Hd));function U$(t){return $$.SignatureDefinitionTypeMeta.fromString(t)}function H$(t){return{path:t.name,type:t.type.split("|").map(U$)}}function G$(t){let e=t.tags.find(r=>r.tag===Hd.Type);if(!e)return null;let n=t.tags.filter(r=>r.tag===Hd.Property);return{type:e.name,properties:n.map(H$)}}function z$(t){return W$.has(t.tag)}function K$(t){let e=(0,F$.parse)((0,B$.createCommentBlock)(t)),[n]=e;return n.tags.filter(z$).length>0?G$(n):null}zs.parseMapDescription=K$});var bv=m(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.Aggregator=ta.ASTChainIterator=void 0;var Wu=Qr(),Se=gn(),Ce=Ee(),V$=$h(),X$=F_(),Te=Fs(),IC=$s(),Ks=B_(),MC=m_(),LC=L_(),Y$=M_(),jC=cu(),NC=gv(),J$=G_(),qC=I_(),Q$=DC(),Z$=PC(),eB=Qo(),Gd=class{constructor(e,n,r=!1,i=!1){this.aggregator=e,this.chain=n,this.noInvoke=r,this.assume=i,this.index=0,this.endIndex=this.chain.length-1,this.current=null}defineAssumedProperty(e,n){let r=this.aggregator.factory(this.index===0?Te.CompletionItemKind.Variable:Te.CompletionItemKind.Property);return typeof n=="string"&&r.setLabel(n),this.assume?(r.addType(Se.SignatureDefinitionBaseType.Map),e.setProperty(n,r),e.resolveProperty(n,!0)):(r.addType(Se.SignatureDefinitionBaseType.Any),r)}getInitial(){let e=null,n=this.aggregator.scope,r=this.aggregator.document,i=this.chain[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,Ks.isResolveChainItemWithIdentifier)(i)){let o=r.getScopeContext(i.ref.scope)?.scope.context,a=o?.getIsa();if(i.getter.name==="globals")e=n.globals;else if(i.getter.name==="outer")e=n.outer;else if(i.getter.name==="locals")e=n.locals;else if(i.getter.name==="super"&&a!=null)e=a.copy({kind:Te.CompletionItemKind.Constant,label:"super",values:o.values});else if(i.getter.name==="self"&&o!=null)e=o.copy({kind:Te.CompletionItemKind.Constant,label:"self",values:o.values});else{let u=n.resolveNamespace(i.getter.name,s);u==null&&(u=this.defineAssumedProperty(n.globals,i.getter.name)),e=u}}else if((0,Ks.isResolveChainItemWithValue)(i))e=this.aggregator.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator===Ce.Keyword.New&&e!==null){let o=this.aggregator.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Map).setLabel(e.label);o.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(i.unary,o),e=o}return e}getNext(){let e=this.current,n=this.chain[this.index];if((0,Ks.isResolveChainItemWithMember)(n)){let r=n.unary?.operator==="@"&&!n.isInCallExpression||this.noInvoke&&this.index===this.endIndex,i=e.resolveProperty(n.getter.name,r);i==null&&(i=this.defineAssumedProperty(e,n.getter.name)),e=i}else if((0,Ks.isResolveChainItemWithIndex)(n)){let r=n.unary?.operator==="@"&&!n.isInCallExpression||this.noInvoke&&this.index===this.endIndex||!n.ref.isStatementStart&&!n.isInCallExpression;if((0,jC.isValidIdentifierLiteral)(n.getter)){let i=n.getter.value.toString(),s=e.resolveProperty(i,r);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}else{let i=this.aggregator.resolveTypeWithDefault(n.getter),s=e.resolveProperty(i,r);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}}else if(n.ref.type===Ce.ASTType.SliceExpression)e=e.copy();else return null;if(n.unary?.operator===Ce.Keyword.New&&this.current!==null){let r=this.aggregator.factory(Te.CompletionItemKind.Property).addType(Se.SignatureDefinitionBaseType.Map).setLabel(e.label);r.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(n.unary,r),e=r}return e}next(){if(this.index>=this.chain.length)return{value:null,done:!0};let e=this.index===0?this.getInitial():this.getNext();return e==null?{value:null,done:!0}:(this.index++,this.current=e,{value:e,done:!1})}};ta.ASTChainIterator=Gd;var yv=class{get definitions(){return this._definitions}get parent(){return this._parent}get scope(){return this._scope}get document(){return this._document}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map,this._lastModifiedProperty=null}factory(e){return new eB.Entity({source:this._document.source,kind:e,container:this._document.container})}resolveRelatedCommentLines(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Ce.ASTType.Comment);if(n instanceof Ce.ASTComment){let i=new Set,s=[],o=e.start.line-1;for(;o>=0;){let a=this._document.getLastASTItemOfLine(o--);if(!i.has(a))if(a instanceof Ce.ASTComment)i.add(a),s.unshift((0,qC.normalizeText)(a.value));else break}return s}else if(r instanceof Ce.ASTComment)return[(0,qC.normalizeText)(r.value)];return null}createCustomTypeFromMap(e,n){let r=this.resolveRelatedCommentLines(e);if(r==null)return;let i=r.join(`
|
111
|
+
`),s=(0,Z$.parseMapDescription)(i);s!=null&&(s.properties.forEach(o=>{if(o.path==="__isa")return;let a=o.path.split("."),u=this.factory(Te.CompletionItemKind.Property).addTypesWithMeta(o.type).setLabel(a[a.length-1]);this.setEntityInPath(n,a,u)}),this._scope.setCustomType(s.type,n))}createFunctionDescription(e,n=X$.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this.resolveRelatedCommentLines(e);return r==null?n:r.join(`
|
112
112
|
|
113
|
-
`)}resolveFunctionStatement(e){let n=this.createFunctionDescription(e),r=
|
114
|
-
`),i=(0,x$.parseAssignDescription)(r);if(i!=null)return this.factory(Se.CompletionItemKind.Variable).addTypesWithMeta(i.type)}return null}analyzeAssignmentDefinition(e){let n=this.resolveCommentDefinition(e.init)?.setLine(e.start.line)??this.resolveType(e.init)?.copy({source:this._document.source}).setLine(e.start.line)??this.factory(Se.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line);this.defineNamespace(e.variable,n),this.addDefinition(e,e.variable)}analyzeForDefinition(e){let n=this.resolveType(e.iterator)?.copy({source:this._document.source}).setLine(e.start.line)??this.factory(Se.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line),r=this.factory(Se.CompletionItemKind.Variable).setLine(e.start.line);if(n.types.has(Te.SignatureDefinitionBaseType.List)){let o=n.values.get(`${bO.PropertyType.Type}:number`);o!=null&&r.extend(o)}if(n.types.has(Te.SignatureDefinitionBaseType.String)&&r.addType(Te.SignatureDefinitionBaseType.String),n.types.has(Te.SignatureDefinitionBaseType.Map)){let o=this.factory(Se.CompletionItemKind.Variable).addTypes(n.getPropertyTypes()).setLine(e.start.line),a=this.factory(Se.CompletionItemKind.Property).addTypes(n.getValueTypes()).setLine(e.start.line);r.addType(Te.SignatureDefinitionBaseType.Map),r.setProperty("key",o),r.setProperty("value",a)}r.types.size===0&&r.addType(Te.SignatureDefinitionBaseType.Any),this.defineNamespace(e.variable,r),this.addDefinition(e,e.variable);let i=this.factory(Se.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Number).setLine(e.start.line),s=new Ce.ASTIdentifier({name:`__${e.variable.name}_idx`,kind:Ce.ASTIdentifierKind.Variable,range:e.range,start:e.start,end:e.end});this.defineNamespace(s,i),this.addDefinition(e,s)}analyzeImportDefinition(e){let n=e.name,r=this.scope.resolveProperty(n.name,!0);if(r!=null){this._lastModifiedProperty=r,this.addDefinition(e,e.name);return}let i=this.factory(Se.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line);this.defineNamespace(e.name,i),this.addDefinition(e,e.name)}analyze(){for(let e=0;e<this._root.definitions.length;e++){let n=this._root.definitions[e];switch(n.type){case Ce.ASTType.AssignmentStatement:{this.analyzeAssignmentDefinition(n);break}case Ce.ASTType.ForGenericStatement:{this.analyzeForDefinition(n);break}case Bu.ASTType.FeatureImportExpression:{this.analyzeImportDefinition(n);break}}}}extend(e){e.definitions.forEach((n,r)=>{let i=this.definitions.get(r);i?(0,E$.mergeUnique)(i,n):this.definitions.set(r,n)})}};Zo.Aggregator=hv});var pv=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.Document=void 0;var vi=xn(),C$=Ee(),EO=qs(),O$=cv(),xO=dv(),AO=Yo(),kO=W_(),fv=class t{get source(){return this._source}get root(){return this._root}get container(){return this._container}get intrinsics(){return this._intrinscis}get globals(){return this._globals}get api(){return this._api}constructor(e){this._source=e.source,this._root=e.root,this._container=e.container,this._scopeMapping=e.scopeMapping??new WeakMap,this._intrinscis=e.intrinsics??this.createIntrinscis(),this._api=e.api??this.initApi(),this._globals=e.globals??this.initGlobals()}createIntrinscis(){return{map:this._container.primitives.get(vi.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(vi.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(vi.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(vi.SignatureDefinitionBaseType.String),list:this._container.primitives.get(vi.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(vi.SignatureDefinitionBaseType.General);return e.resolveProperty("map",!0).setReturnEntity(this._intrinscis.map),e.resolveProperty("funcRef",!0).setReturnEntity(this._intrinscis.funcRef),e.resolveProperty("number",!0).setReturnEntity(this._intrinscis.number),e.resolveProperty("string",!0).setReturnEntity(this._intrinscis.string),e.resolveProperty("list",!0).setReturnEntity(this._intrinscis.list),e}initGlobals(){return new AO.Entity({source:this._source,kind:EO.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(vi.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new kO.Scope({source:this._source,container:this._container,parent:n?.scope,globals:this._globals}),i=new xO.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof C$.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(vi.SignatureDefinitionBaseType.Map)&&o!==this._globals&&r.setContext(o)}if(i.analyze(),s!==null){let o=s.signatureDefinitions.last();if(o!=null){let a=o.getArguments();for(let u=0;u<a.length;u++){let c=a[u],l=r.resolveProperty(c.getLabel(),!0),h=c.getTypes();l===null?r.setProperty(c.getLabel(),new AO.Entity({source:this._source,kind:EO.CompletionItemKind.Variable,container:this._container}).addTypesWithMeta(h)):(l.types.delete(vi.SignatureDefinitionBaseType.Any),l.addTypesWithMeta(h))}}}}analyze(){let e=new kO.Scope({source:this._source,container:this._container,globals:this._globals,locals:this._globals}),n=new xO.Aggregator({scope:e,root:this._root,document:this});this._scopeMapping.set(this._root,{scope:e,aggregator:n}),n.analyze();for(let r=0;r<this._root.scopes.length;r++){let i=this._root.scopes[r];this.analyzeScope(i)}}getRootScopeContext(){return this._scopeMapping.get(this._root)}getAllScopeContexts(){return[this._root,...this._root.scopes].map(e=>this._scopeMapping.get(e))}getScopeContext(e){return this._scopeMapping.get(e)??null}getLastASTItemOfLine(e){let n=this._root.lines[e];if(!n||n.length===0)return null;let r=n[0];for(let i=1;i<n.length;i++){let s=n[i];(s.start.line>r.start.line||s.start.line===r.start.line&&s.start.character>r.start.character)&&(r=s)}return r}findASTItemInLine(e,n){let r=this._root.lines[e];if(r&&r.length>0){let i=r.find(s=>s.type===n);if(i)return i}return null}resolveAllAssignmentsWithQuery(e){let n=[],r=[this._root,...this._root.scopes];for(let i=0;i<r.length;i++){let o=this._scopeMapping.get(r[i]).aggregator.definitions;o.forEach((a,u)=>{if(u.includes(e)){let c=o.get(u);(0,O$.merge)(n,c)}})}return n}resolveAvailableAssignments(e){return this._scopeMapping.get(e.scope)?.aggregator.resolveAvailableAssignments(e)??[]}resolveType(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveType(e,n)??null}resolveTypeWithDefault(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveTypeWithDefault(e,n)}resolveNamespace(e,n=!1){return this._scopeMapping.get(e.scope)?.aggregator.resolveNamespace(e,n)??null}merge(...e){let n=new t({source:this._source,root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals,!0,!0),n._intrinscis.map.extend(i._intrinscis.map,!0,!0),n._intrinscis.funcRef.extend(i._intrinscis.funcRef,!0,!0),n._intrinscis.number.extend(i._intrinscis.number,!0,!0),n._intrinscis.string.extend(i._intrinscis.string,!0,!0),n._intrinscis.list.extend(i._intrinscis.list,!0,!0),n._container.mergeCustomTypes(i._container)}n.analyze();for(let r=0;r<e.length;r++){let i=e[r];n.getRootScopeContext().aggregator.extend(i.getRootScopeContext().aggregator)}return n}};Bd.Document=fv});var bv=m(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.ContainerProxy=void 0;var Ar=xn(),gv=js(),Si=Yo(),CO=qs(),OO=ku(),mv=kd(),yv=class t{get primitives(){return this._primitives}get types(){return this._types}constructor(e){this._container=e.container,this._primitives=e.primitives??this.createPrimitives(),this._types=e.types??this.createTypes(),this._customTypes=new Set}createPrimitives(){let e=new Map;return this._container.getPrimitives().forEach((n,r)=>{let i=new Si.Entity({source:"internal",kind:CO.CompletionItemKind.Internal,container:this,isAPI:r===Ar.SignatureDefinitionBaseType.General}).addType(Ar.SignatureDefinitionBaseType.Map).insertSignature(n);e.set(r,i)}),e}createTypes(){let e=new Map;return this._container.getTypes().forEach((n,r)=>{let i=new Si.Entity({source:"internal",kind:CO.CompletionItemKind.Internal,container:this}).addType(Ar.SignatureDefinitionBaseType.Map).insertSignature(n);e.set(r,i)}),e}setCustomType(e,n){this._types.has(e)||(this._types.set(e,n),this._customTypes.add(e))}mergeCustomTypes(e){e._customTypes.forEach(n=>{let r=e._types.get(n);r!=null&&this.setCustomType(n,r.copy({deepCopy:!0}))})}getTypeSignature(e){return this._primitives.get(e)??this._types.get(e)??null}searchDefinitionMatches(e,n){if(typeof e=="string")return this.searchDefinitionMatches([e],n);let r=e.includes(Ar.SignatureDefinitionBaseType.Any)?new Set(this._container.getAllVisibleTypes()):new Set(e),i=new Map;return r.forEach(s=>{let o=this.getTypeSignature(s);if(o===null)return;let a=(0,mv.lookupProperty)(gv.PropertyType.Identifier,o,n);a!==null&&i.set(s,a)}),i}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let i=(0,mv.lookupProperty)(gv.PropertyType.Identifier,this._primitives.get(Ar.SignatureDefinitionBaseType.Any),n);if(e.includes(Ar.SignatureDefinitionBaseType.Any)&&i)return Si.Entity.resolveEntity(this,i,r);let s=this.searchDefinitionMatches(e,n);if(s.size===0)return null;if(s.size===1)return Si.Entity.resolveEntity(this,s.values().next().value,r);if(s.has(Ar.SignatureDefinitionBaseType.Any))return Si.Entity.resolveEntity(this,s.get(Ar.SignatureDefinitionBaseType.Any),r);if(i!==null)return Si.Entity.resolveEntity(this,i,r);let o=s.values().next().value,a=new Si.Entity({source:"internal",label:n,kind:o.kind,container:this});return s.forEach(u=>{let c=Si.Entity.resolveEntity(this,u,r);a.extend(c,!0,!0)}),a}getGeneralDefinition(e,n=!1){let r=(0,mv.lookupProperty)(gv.PropertyType.Identifier,this._primitives.get(Ar.SignatureDefinitionBaseType.General),e);return r==null?null:Si.Entity.resolveEntity(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,OO.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(Ar.SignatureDefinitionBaseType.Map);(0,OO.injectIdentifers)(e,i)}}getAvailableIdentifier(e){let n=new Map;if(e===Ar.SignatureDefinitionBaseType.Any){let r=this._container.getAllVisibleTypes();for(let i=0;i<r.length;i++)this.injectTypeIdentifiers(n,r[i]);return n}return this.injectTypeIdentifiers(n,e),n}copy(){return new t({container:this._container})}};Wd.ContainerProxy=yv});var RO=m(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.TypeManager=void 0;var R$=pv(),P$=bv(),_v=class{constructor(e){this._container=new P$.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new R$.Document({source:e,container:this._container.copy(),root:n});try{r.analyze()}catch(i){console.error(i)}return this._types.set(e,r),r}get(e){return this._types.get(e)??null}};Ud.TypeManager=_v});var ea=m(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.TypeManager=Q.ContainerProxy=Q.Document=Q.Aggregator=Q.Scope=Q.Entity=Q.aggregateEntity=Q.lookupProperty=Q.isEligibleForProperties=Q.injectIdentifers=Q.isSignatureDefinitionFunction=Q.isResolveChainItemWithValue=Q.isResolveChainItemWithMember=Q.isResolveChainItemWithIndex=Q.isResolveChainItemWithIdentifier=Q.IsaPropertyPattern=Q.IdentifierPropertyPattern=Q.PropertyType=Q.CompletionItemKind=Q.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=Q.ObjectSetIterator=Q.ObjectSet=Q.rotateBits=Q.getStringHashCode=Q.getHashCode=Q.createResolveChain=Q.enrichWithMetaInformation=Q.createExpressionId=Q.createExpressionHash=Q.isValidIdentifierLiteral=void 0;var D$=au();Object.defineProperty(Q,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return D$.isValidIdentifierLiteral}});var I$=IA();Object.defineProperty(Q,"createExpressionHash",{enumerable:!0,get:function(){return I$.createExpressionHash}});var M$=_b();Object.defineProperty(Q,"createExpressionId",{enumerable:!0,get:function(){return M$.createExpressionId}});var L$=k_();Object.defineProperty(Q,"enrichWithMetaInformation",{enumerable:!0,get:function(){return L$.enrichWithMetaInformation}});var N$=C_();Object.defineProperty(Q,"createResolveChain",{enumerable:!0,get:function(){return N$.createResolveChain}});var vv=bb();Object.defineProperty(Q,"getHashCode",{enumerable:!0,get:function(){return vv.getHashCode}});Object.defineProperty(Q,"getStringHashCode",{enumerable:!0,get:function(){return vv.getStringHashCode}});Object.defineProperty(Q,"rotateBits",{enumerable:!0,get:function(){return vv.rotateBits}});var PO=D_();Object.defineProperty(Q,"ObjectSet",{enumerable:!0,get:function(){return PO.ObjectSet}});Object.defineProperty(Q,"ObjectSetIterator",{enumerable:!0,get:function(){return PO.ObjectSetIterator}});var q$=I_();Object.defineProperty(Q,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return q$.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var j$=qs();Object.defineProperty(Q,"CompletionItemKind",{enumerable:!0,get:function(){return j$.CompletionItemKind}});var Sv=js();Object.defineProperty(Q,"PropertyType",{enumerable:!0,get:function(){return Sv.PropertyType}});Object.defineProperty(Q,"IdentifierPropertyPattern",{enumerable:!0,get:function(){return Sv.IdentifierPropertyPattern}});Object.defineProperty(Q,"IsaPropertyPattern",{enumerable:!0,get:function(){return Sv.IsaPropertyPattern}});var Hd=L_();Object.defineProperty(Q,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Hd.isResolveChainItemWithIdentifier}});Object.defineProperty(Q,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Hd.isResolveChainItemWithIndex}});Object.defineProperty(Q,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Hd.isResolveChainItemWithMember}});Object.defineProperty(Q,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Hd.isResolveChainItemWithValue}});var F$=N_();Object.defineProperty(Q,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return F$.isSignatureDefinitionFunction}});var $$=ku();Object.defineProperty(Q,"injectIdentifers",{enumerable:!0,get:function(){return $$.injectIdentifers}});var B$=xd();Object.defineProperty(Q,"isEligibleForProperties",{enumerable:!0,get:function(){return B$.isEligibleForProperties}});var W$=kd();Object.defineProperty(Q,"lookupProperty",{enumerable:!0,get:function(){return W$.lookupProperty}});var U$=q_();Object.defineProperty(Q,"aggregateEntity",{enumerable:!0,get:function(){return U$.aggregateEntity}});var H$=Yo();Object.defineProperty(Q,"Entity",{enumerable:!0,get:function(){return H$.Entity}});var G$=W_();Object.defineProperty(Q,"Scope",{enumerable:!0,get:function(){return G$.Scope}});var z$=dv();Object.defineProperty(Q,"Aggregator",{enumerable:!0,get:function(){return z$.Aggregator}});var V$=pv();Object.defineProperty(Q,"Document",{enumerable:!0,get:function(){return V$.Document}});var K$=bv();Object.defineProperty(Q,"ContainerProxy",{enumerable:!0,get:function(){return K$.ContainerProxy}});var X$=RO();Object.defineProperty(Q,"TypeManager",{enumerable:!0,get:function(){return X$.TypeManager}})});var Tv=m(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.getSymbolItemKind=ta.getCompletionItemKind=void 0;var at=ea(),Y$={[at.CompletionItemKind.Constant]:21,[at.CompletionItemKind.Internal]:21,[at.CompletionItemKind.InternalFunction]:21,[at.CompletionItemKind.InternalProperty]:21,[at.CompletionItemKind.Property]:6,[at.CompletionItemKind.Variable]:6,[at.CompletionItemKind.Expression]:6,[at.CompletionItemKind.Function]:3,[at.CompletionItemKind.ListConstructor]:12,[at.CompletionItemKind.MapConstructor]:12,[at.CompletionItemKind.Literal]:12,[at.CompletionItemKind.Unknown]:12},J$=t=>Y$[t]??6;ta.getCompletionItemKind=J$;var Q$={[at.CompletionItemKind.Constant]:14,[at.CompletionItemKind.Internal]:14,[at.CompletionItemKind.InternalFunction]:14,[at.CompletionItemKind.InternalProperty]:14,[at.CompletionItemKind.Variable]:13,[at.CompletionItemKind.Property]:13,[at.CompletionItemKind.Expression]:13,[at.CompletionItemKind.Function]:12,[at.CompletionItemKind.ListConstructor]:18,[at.CompletionItemKind.MapConstructor]:19,[at.CompletionItemKind.Literal]:13,[at.CompletionItemKind.Unknown]:13},Z$=t=>Q$[t]??13;ta.getSymbolItemKind=Z$});var DO=m(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.CompletionListBuilder=void 0;var eB=Tv(),wv=class{constructor(){this.collection=new Map,this.default=[]}setDefault(e){this.default=e}addCollection(e){e!=null&&(this.collection=new Map([...this.collection,...e]))}build(){let e=[];for(let[n,r]of this.collection)e.push({label:n,kind:(0,eB.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};Gd.CompletionListBuilder=wv});var Vd=m(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.findEx=na.ScraperWalker=void 0;var tB=Ee(),nB=function(t){return{ParenthesisExpression:(e,n)=>{t(e.expression,n)},AssignmentStatement:function(e,n){t(e.init,n),t(e.variable,n)},MemberExpression:function(e,n){t(e.base,n),t(e.identifier,n)},FunctionDeclaration:function(e,n){for(let r=0;r<e.parameters.length;r++)t(e.parameters[r],n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},MapConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},ReturnStatement:function(e,n){e.argument&&t(e.argument,n)},WhileStatement:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IndexExpression:function(e,n){t(e.base,n),t(e.index,n)},SliceExpression:function(e,n){t(e.base,n),t(e.left,n),t(e.right,n)},ListValue:function(e,n){t(e.value,n)},MapKeyString:function(e,n){t(e.key,n),t(e.value,n)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseShortcutClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ForGenericStatement:function(e,n){t(e.variable,n),t(e.iterator,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IfStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},NegationExpression:function(e,n){t(e.argument,n)},CallExpression:function(e,n){t(e.base,n);for(let r=0;r<e.arguments.length;r++)t(e.arguments[r],n)},CallStatement:function(e,n){t(e.expression,n)},ListConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},BinaryExpression:function(e,n){t(e.left,n),t(e.right,n)},BinaryNegatedExpression:function(e,n){t(e.argument,n)},IsaExpression:function(e,n){t(e.left,n),t(e.right,n)},LogicalExpression:function(e,n){t(e.left,n),t(e.right,n)},ComparisonGroupExpression:function(e,n){for(let r=0;r<e.expressions.length;r++)t(e.expressions[r],n)},UnaryExpression:function(e,n){t(e.argument,n)},Chunk:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},InvalidCodeExpression:()=>{}}},zd=class{constructor(e,n={}){this.map=Object.assign(nB(this.visit.bind(this)),n),this.callback=e,this.state={exit:!1,skip:!1}}visit(e,n=0){if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");let r=this.callback(e,n);if(r!=null&&Object.assign(this.state,r),this.state.exit||this.state.skip){this.state.skip=!1;return}let i=this.map[e.type];i?.call(this,e,n+1)}};na.ScraperWalker=zd;function rB(t,e){let n=[];return new zd((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==tB.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}na.findEx=rB});var Ev=m(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.lookupBase=gn.lookupIdentifier=gn.lookupScopes=gn.lookupRootScope=void 0;var Ti=Ee(),iB=t=>{let e=t;for(;e.scope;)e=e.scope;return e};gn.lookupRootScope=iB;var sB=t=>{if(!t.scope)return[t];let e=(0,gn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};gn.lookupScopes=sB;var oB=t=>{switch(t.type){case Ti.ASTType.CallStatement:return(0,gn.lookupIdentifier)(t.expression);case Ti.ASTType.CallExpression:return(0,gn.lookupIdentifier)(t.base);case Ti.ASTType.Identifier:return t;case Ti.ASTType.MemberExpression:return(0,gn.lookupIdentifier)(t.identifier);case Ti.ASTType.IndexExpression:return(0,gn.lookupIdentifier)(t.index);default:return null}};gn.lookupIdentifier=oB;var aB=(t=null)=>{switch(t?.type){case Ti.ASTType.MemberExpression:return t.base;case Ti.ASTType.IndexExpression:return t.base;case Ti.ASTType.CallExpression:return t.base;case Ti.ASTType.SliceExpression:return t.base;default:return null}};gn.lookupBase=aB});var ia=m(Jr=>{"use strict";var uB=Jr&&Jr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),cB=Jr&&Jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lB=Jr&&Jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&uB(e,t,n);return cB(e,t),e};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.LookupHelper=void 0;var hB=xn(),IO=Ee(),ra=ea(),dB=lB(Vd()),fB=Ev(),xv=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null}async getTypeMap(){return this.mergedTypeMap==null&&(this.mergedTypeMap=await this.context.documentMerger.build(this.document,this.context)),this.mergedTypeMap}async findAllAssignmentsOfIdentifier(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignmentsWithQuery(e)}async findAllAssignmentsOfItem(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignments(e)}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.getRootScopeContext().scope.getAvailableIdentifier()}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAvailableIdentifier()}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;for(let a of n.container.getAvailableIdentifier(hB.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:ra.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:ra.CompletionItemKind.Constant,line:-1});let s=new Map;(0,ra.injectIdentifers)(s,i.scope);let o=Array.from(s.entries()).map(([a,u])=>({identifier:a,...u})).sort((a,u)=>a.line-u.line);for(let a=0;a<o.length;a++){let u=o[a];if(u.line>=e.end.line)break;r.set(u.identifier,{kind:u.kind,line:u.line})}return i.scope.locals!==i.scope.globals&&(0,ra.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,ra.injectIdentifers)(r,i.scope.outer),r}async lookupAST(e){let n=this,s=(await this.context.documentManager.getLatest(n.document)).document.lines[e.line+1];if(!s)return null;for(let o=0;o<s.length;o++){let a=s[o],u=dB.findEx((l,h)=>{let d=l.start.line-1,g=l.start.character-1,y=l.end.line-1,b=l.end.character-1;return d>e.line?{exit:!0}:d<y?{valid:e.line>d&&e.line<y||e.line===d&&g<=e.character||e.line===y&&b>=e.character}:{valid:d<=e.line&&g<=e.character&&y>=e.line&&b>=e.character}},a),c=u.pop();if(c)return{closest:c,outer:u}}return null}async lookupBasePath(e){let n=await this.getTypeMap();if(n===null)return null;let r=(0,fB.lookupBase)(e);return r?n.resolveNamespace(r):null}async lookupTypeInfo({closest:e,outer:n}){let r=await this.getTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===IO.ASTType.MemberExpression&&e===i.identifier||i?.type===IO.ASTType.IndexExpression&&e===i.index&&(0,ra.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}async lookupType(e){let n=this,r=await n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Jr.LookupHelper=xv});var MO=m(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.AVAILABLE_CONSTANTS=void 0;Kd.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var LO=m(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.AVAILABLE_KEYWORDS=void 0;var sa=Yr(),an=Ee();Xd.AVAILABLE_KEYWORDS=[an.Keyword.If,an.Keyword.In,an.Keyword.Or,an.Keyword.And,an.Keyword.Isa,an.Keyword.For,an.Keyword.New,an.Keyword.Not,an.Keyword.End,an.Keyword.Then,an.Keyword.Else,an.Keyword.Break,an.Keyword.While,an.Keyword.Return,an.Keyword.Function,an.Keyword.Continue,sa.GreybelKeyword.Envar,sa.GreybelKeyword.Import,sa.GreybelKeyword.Include,sa.GreybelKeyword.Debugger,sa.GreybelKeyword.Line,sa.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var NO=m(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.AVAILABLE_OPERATORS=void 0;var Wu=Qo(),Ut=Ee();Yd.AVAILABLE_OPERATORS=[Ut.Operator.Plus,Ut.Operator.Asterik,Ut.Operator.Minus,Ut.Operator.Slash,Ut.Operator.Power,Ut.Operator.Modulo,Ut.Operator.LessThan,Ut.Operator.GreaterThan,Ut.Operator.LessThanOrEqual,Ut.Operator.GreaterThanOrEqual,Ut.Operator.NotEqual,Ut.Operator.Equal,Ut.Operator.AddShorthand,Ut.Operator.SubtractShorthand,Ut.Operator.MultiplyShorthand,Ut.Operator.DivideShorthand,Wu.Operator.BitwiseAnd,Wu.Operator.BitwiseOr,Wu.Operator.LeftShift,Wu.Operator.RightShift,Wu.Operator.UnsignedRightShift,Ut.Operator.Assign,Ut.Operator.Reference].map(t=>({label:t,kind:24}))});var jO=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.activate=ar.getDefaultCompletionList=ar.getPropertyCompletionList=void 0;var qO=Ee(),pB=DO(),gB=ia(),mB=MO(),yB=LO(),bB=NO(),_B=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.getAvailableIdentifier()};ar.getPropertyCompletionList=_B;var vB=()=>[...yB.AVAILABLE_KEYWORDS,...bB.AVAILABLE_OPERATORS,...mB.AVAILABLE_CONSTANTS];ar.getDefaultCompletionList=vB;function SB(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new gB.LookupHelper(r.textDocument,t),s=await i.lookupAST(e.position),o=new pB.CompletionListBuilder;if(s){let{closest:a}=s;a instanceof qO.ASTMemberExpression?o.addCollection(await(0,ar.getPropertyCompletionList)(i,a)):a instanceof qO.ASTIndexExpression?o.addCollection(await(0,ar.getPropertyCompletionList)(i,a)):(o.setDefault((0,ar.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,ar.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}ar.activate=SB});var $O=m((jK,FO)=>{"use strict";FO.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Av=m((FK,WO)=>{var Uu=$O(),BO={};for(let t of Object.keys(Uu))BO[Uu[t]]=t;var te={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};WO.exports=te;for(let t of Object.keys(te)){if(!("channels"in te[t]))throw new Error("missing channels property: "+t);if(!("labels"in te[t]))throw new Error("missing channel labels property: "+t);if(te[t].labels.length!==te[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=te[t];delete te[t].channels,delete te[t].labels,Object.defineProperty(te[t],"channels",{value:e}),Object.defineProperty(te[t],"labels",{value:n})}te.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=s-i,a,u;s===i?a=0:e===s?a=(n-r)/o:n===s?a=2+(r-e)/o:r===s&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};te.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),h=function(d){return(c-d)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=h(o),n=h(a),r=h(u),o===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};te.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=te.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};te.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function TB(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}te.rgb.keyword=function(t){let e=BO[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Uu)){let s=Uu[i],o=TB(t,s);o<n&&(n=o,r=i)}return r};te.keyword.rgb=function(t){return Uu[t]};te.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};te.rgb.lab=function(t){let e=te.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};te.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};te.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[e,a*100,o*100]};te.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};te.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};te.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*e),a=1-r;s=6*e-o,o&1&&(s=1-s);let u=n+s*(a-n),c,l,h;switch(o){default:case 6:case 0:c=a,l=u,h=n;break;case 1:c=u,l=a,h=n;break;case 2:c=n,l=a,h=u;break;case 3:c=n,l=u,h=a;break;case 4:c=u,l=n,h=a;break;case 5:c=a,l=n,h=u;break}return[c*255,l*255,h*255]};te.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};te.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,o;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};te.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),o=200*(n-r);return[i,s,o]};te.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,o;s=(e+16)/116,i=n/500+s,o=s-r/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};te.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[e,o,i]};te.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[e,s,o]};te.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?te.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};te.hsv.ansi16=function(t){return te.rgb.ansi16(te.hsv.rgb(t),t[2])};te.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};te.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};te.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};te.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};te.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};te.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(n-r)/o%6:i===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};te.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};te.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};te.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-n)*r,[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};te.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};te.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};te.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};te.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};te.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};te.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};te.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};te.gray.hsl=function(t){return[0,0,t[0]]};te.gray.hsv=te.gray.hsl;te.gray.hwb=function(t){return[0,100,t[0]]};te.gray.cmyk=function(t){return[0,0,0,t[0]]};te.gray.lab=function(t){return[t[0],0,0]};te.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};te.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var HO=m(($K,UO)=>{var Jd=Av();function wB(){let t={},e=Object.keys(Jd);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function EB(t){let e=wB(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Jd[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function xB(t,e){return function(n){return e(t(n))}}function AB(t,e){let n=[e[t].parent,t],r=Jd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=xB(Jd[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}UO.exports=function(t){let e=EB(t),n={},r=Object.keys(e);for(let i=r.length,s=0;s<i;s++){let o=r[s];e[o].parent!==null&&(n[o]=AB(o,e))}return n}});var zO=m((BK,GO)=>{var kv=Av(),kB=HO(),oa={},CB=Object.keys(kv);function OB(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function RB(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}CB.forEach(t=>{oa[t]={},Object.defineProperty(oa[t],"channels",{value:kv[t].channels}),Object.defineProperty(oa[t],"labels",{value:kv[t].labels});let e=kB(t);Object.keys(e).forEach(r=>{let i=e[r];oa[t][r]=RB(i),oa[t][r].raw=OB(i)})});GO.exports=oa});var KO=m(aa=>{"use strict";var PB=aa&&aa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(aa,"__esModule",{value:!0});aa.activate=void 0;var Cv=PB(zO()),DB=Ee(),VO;(function(t){t.Black="black",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple",t.Red="red",t.White="white",t.Yellow="yellow"})(VO||(VO={}));var Ov={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},IB=()=>new RegExp(`(?:mark|color)=(${Object.keys(Ov).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),MB=Object.prototype.hasOwnProperty;function LB(t){t.connection.onColorPresentation(e=>[{label:`#${Cv.default.rgb.hex(e.color.red*255,e.color.green*255,e.color.blue*255)}`}]),t.connection.onDocumentColor(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let s=(await t.documentManager.getLatest(n)).document.literals.filter(u=>u.type===DB.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:h,lineIndex:d})=>{let g=u.index+c.indexOf("=")+1,y=g+l.length,b=h.line-1+d,C=g,A=y;return d===0&&(C+=h.character,A+=h.character),{start:{line:b,character:C},end:{line:b,character:A}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,h=c.value.toString().split(`
|
115
|
-
`);for(let d=0;d<h.length;d++){let g=h[d],
|
116
|
-
`);h.forEach((d,g)=>{let y=o+g;n.has(y)||n.set(y,[]);let C=e.lines[y].filter(L=>L.type!==Ks.ASTType.Comment).map(L=>L.start.character),A=C.length>0?Math.min(...C):-1,w=y===o,T=y===o+h.length-1,v=T?l.end.character<A:!1;n.get(y).push({isMultiline:!0,isStart:w,isEnd:T,isBefore:v,value:d})})}else n.has(o)||n.set(o,[]),n.get(o).push({isMultiline:!1,isStart:!1,isEnd:!1,isBefore:!1,value:l.value})}}return{commentBuckets:n}}getChunkContext(e){return this._contexts.get(e)}getCurrentChunk(){return this._stack[this._stack.length-1]}pushStack(e){this._stack.push(e),this._contexts.set(e,this.buildChunkContext(e))}popStack(){this._stack.pop()}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof Ks.ASTIfClause||e instanceof Ks.ASTWhileStatement?e.condition.end.line:e instanceof Ks.ASTForGenericStatement?e.iterator.end.line:e instanceof Ks.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Ks.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){let n=new e1.BeautifyBodyIterator(e,e.body),r=n.next();for(;!r.done;){let i=r.value;if(i.type===e1.FILLER_TYPE){this.factory.pushSegment(this.getIndent()),this.factory.pushComment(i.start.line),this.factory.eol(),r=n.next();continue}this.factory.pushSegment(this.getIndent()),this.factory.process(i,{isCommand:!0}),this.factory.eol(),r=n.next()}}};Xs.BeautifyContext=Iv});var Lv=m(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.commentToText=qt.hasEmptyBody=qt.containsMultilineItemInShortcutClauses=qt.getLastComment=qt.unwrap=qt.countRightBinaryExpressions=qt.SHORTHAND_OPERATORS=void 0;var An=Ee();qt.SHORTHAND_OPERATORS=[An.Operator.Plus,An.Operator.Minus,An.Operator.Asterik,An.Operator.Slash,An.Operator.Modulo,An.Operator.Power];var VB=t=>{if(t=(0,qt.unwrap)(t),t instanceof An.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof An.ASTBinaryExpression&&n++,(r instanceof An.ASTBinaryExpression||r instanceof An.ASTLogicalExpression||r instanceof An.ASTIsaExpression)&&(e.push((0,qt.unwrap)(r.left)),e.push((0,qt.unwrap)(r.right)))}return n};qt.countRightBinaryExpressions=VB;var KB=t=>{for(;t instanceof An.ASTParenthesisExpression;)t=t.expression;return t};qt.unwrap=KB;var XB=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===An.ASTType.Comment)return n}return null};qt.getLastComment=XB;var YB=(t,e)=>e.some(n=>t.line<n.body[0].end.line);qt.containsMultilineItemInShortcutClauses=YB;var JB=t=>!t.some(e=>!(e instanceof An.ASTComment));qt.hasEmptyBody=JB;var QB=t=>t.isMultiline?t.isStart&&!t.isEnd?"/* "+t.value.trim():!t.isStart&&t.isEnd?t.value.trim()+" */":t.isStart&&t.isEnd?"/* "+t.value.trim()+" */":t.value.trim():"// "+t.value.trim();qt.commentToText=QB});var qv=m(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.Stack=void 0;var Nv=class{constructor(){let e=this;e.currentStack=[]}get(e){let r=this.currentStack;e==null&&(e=0);let i=r.length-e-1;return i<0?null:r[i]}depth(){return this.currentStack.filter(function(e){return Object.prototype.hasOwnProperty.call(e,"body")}).length}lookup(e){let n=this;for(let r=n.currentStack.length-2;r>=0;r--)if(e(n.currentStack[r]))return!0;return!1}push(e){let n=this;return n.currentStack.push(e),n}pop(){let e=this;return e.currentStack.pop(),e}};sf.Stack=Nv});var Hu=m(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.Factory=void 0;var ZB=qv(),jv=class{get activeLine(){return this._activeLine}get lines(){return this._lines}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}constructor(e){this.transformer=e,this._activeLine=this.createLine(),this._lines=[],this._currentDependency=null,this._currentStack=new ZB.Stack}pushSegment(e,n){this._activeLine.segments.push(e)}pushComment(e){throw new Error("Not implemented")}createLine(){return{segments:[]}}eol(e){this._lines.push(this._activeLine),this._activeLine=this.createLine()}reset(){this._activeLine=this.createLine(),this._lines=[]}process(e,n={}){let r=this,i=r._currentStack;if(e==null)return;if(e.type==null)throw console.error("Error AST type:",e),new Error("Unexpected AST type");let s=r.handlers[e.type];if(s==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);i.push(e),s.call(this,e,n),i.pop()}};of.Factory=jv});var $v=m(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.BeautifyFactory=void 0;var Gu=Ee(),e2=require("path"),n1=Rv(),af=ha(),uf=Dv(),r1=Mv(),kr=Lv(),t2=Hu(),Fv=class extends t2.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.pushSegment("(",o),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(")",o)},Comment:function(o,a){},AssignmentStatement:function(o,a){let u=o.variable,c=o.init;if(this.process(u),(u instanceof Gu.ASTIdentifier||u instanceof Gu.ASTMemberExpression)&&c instanceof Gu.ASTBinaryExpression&&(c.left instanceof Gu.ASTIdentifier||c.left instanceof Gu.ASTMemberExpression)&&kr.SHORTHAND_OPERATORS.includes(c.operator)&&(0,n1.createExpressionHash)(u)===(0,n1.createExpressionHash)(c.left)){this.pushSegment(" "+c.operator+"= ",o),this.process((0,kr.unwrap)(c.right));return}this.pushSegment(" = ",o),this.process(c)},MemberExpression:function(o,a){this.process(o.base),this.pushSegment(o.indexer,o),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.pushSegment("function",{start:o.start,end:o.start});else{this.context.disableMultiline(),this.pushSegment("function(",{start:o.start,end:o.start});for(let u=0;u<o.parameters.length;u++){let c=o.parameters[u];this.process(c),u!==o.parameters.length-1&&this.pushSegment(", ",c)}this.pushSegment(")",{start:o.start,end:o.start}),this.context.enableMultiline()}this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end function",{start:o.end,end:o.end})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("{}",o);return}if(o.fields.length===1){this.pushSegment("{ ",o),this.process(o.fields[0]),this.pushSegment(" }",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("{",{start:o.start,end:o.start}),this.eol();let u=new uf.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===uf.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"}",{start:o.end,end:o.end});return}this.pushSegment("{ ",{start:o.start,end:o.start});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.context.decIndent(),this.pushSegment(" }",{start:o.end,end:o.end})},MapKeyString:function(o,a){this.process(o.key),this.pushSegment(": ",o),this.process(o.value)},Identifier:function(o,a){this.pushSegment(o.name,o)},ReturnStatement:function(o,a){this.pushSegment("return ",o),o.argument&&this.process(o.argument)},NumericLiteral:function(o,a){this.pushSegment((0,af.getLiteralValue)(o),o)},WhileStatement:function(o,a){this.pushSegment("while ",{start:o.start,end:o.start}),this.context.disableMultiline(),this.process(o.condition),this.context.enableMultiline(),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end while",{start:o.end,end:o.end})},CallExpression:function(o,a){let u=this.lines.length-1;if(this.process(o.base),o.arguments.length===0)return;if(o.arguments.length>3&&this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("(",{start:o.start,end:o.start}),this.eol();for(let l=0;l<o.arguments.length;l++){let h=o.arguments[l];this.pushSegment(this.context.getIndent(),h),this.process(h),l!==o.arguments.length-1&&(this.pushSegment(",",h),this.eol())}this.context.decIndent(),this.pushSegment(")",{start:o.end,end:o.end});return}a.isCommand&&!this.transformer.buildOptions.keepParentheses?this.pushSegment(" ",{start:o.start,end:o.start}):this.pushSegment("(",{start:o.start,end:o.start});let c=this.lines.length;for(let l=0;l<o.arguments.length;l++){let h=o.arguments[l];this.process(h),l!==o.arguments.length-1&&this.pushSegment(", ",h)}a.isCommand&&!this.transformer.buildOptions.keepParentheses||this.pushSegment(")",{start:o.end,end:o.end})},StringLiteral:function(o,a){this.pushSegment((0,af.getLiteralRawValue)(o),{start:o.end,end:o.end})},SliceExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.left),this.pushSegment(" : ",o),this.process(o.right),this.pushSegment("]",o)},IndexExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.index),this.pushSegment("]",o)},UnaryExpression:function(o,a){o.operator==="new"?this.pushSegment(o.operator+" ",o):this.pushSegment(o.operator,o),this.process(o.argument)},NegationExpression:function(o,a){this.pushSegment("not ",o),this.process(o.argument)},FeatureEnvarExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${o.name}`,o);return}let u=this.transformer.environmentVariables.get(o.name);if(!u){this.pushSegment("null",o);return}this.pushSegment(`"${u}"`,o)},IfShortcutStatement:function(o,a){for(let u=0;u<o.clauses.length;u++){let c=o.clauses[u];this.process(c),u!==o.clauses.length-1&&this.pushSegment(" ",o)}},IfShortcutClause:function(o,a){this.pushSegment("if ",o),this.process((0,kr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseifShortcutClause:function(o,a){this.pushSegment("else if ",o),this.process((0,kr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseShortcutClause:function(o,a){this.pushSegment("else ",o),this.process(o.body[0])},NilLiteral:function(o,a){this.pushSegment((0,af.getLiteralRawValue)(o),o)},ForGenericStatement:function(o,a){this.pushSegment("for ",{start:o.start,end:o.start}),this.process((0,kr.unwrap)(o.variable)),this.pushSegment(" in ",{start:o.start,end:o.start}),this.process((0,kr.unwrap)(o.iterator)),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end for",{start:o.end,end:o.end})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.pushSegment(this.context.getIndent()+"end if",{start:o.end,end:o.end})},IfClause:function(o,a){this.pushSegment("if ",{start:o.start,end:o.start}),this.process((0,kr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.pushSegment(this.context.getIndent()+"else if ",{start:o.start,end:o.start}),this.process((0,kr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.pushSegment(this.context.getIndent()+"else",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.pushSegment("continue",o)},BreakStatement:function(o,a){this.pushSegment("break",o)},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${o.path}";`,o);return}if(this.currentDependency===null){this.pushSegment(`#inject "${o.path}";`,o);return}let u=this.currentDependency.injections.get(o.path);if(u==null){this.pushSegment("null",o);return}this.pushSegment(`"${u.replace(/"/g,()=>'""')}"`,o)},FeatureImportExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}if(!o.chunk){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}this.process(o.name),this.pushSegment(' = __REQUIRE("'+o.namespace+'")',o)},FeatureIncludeExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${o.path}";`,o);return}if(!o.chunk){this.pushSegment(`#include "${o.path}";`,o);return}this.process(o.chunk)},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger",o);return}this.pushSegment("//debugger",o)},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line",o);return}this.pushSegment(`${o.start.line}`,o)},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename",o);return}this.pushSegment(`"${(0,e2.basename)(o.filename).replace(/"/g,()=>'"')}"`,o)},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("[]",o);return}if(o.fields.length===1){this.pushSegment("[ ",o),this.process(o.fields[0]),this.pushSegment(" ]",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("[",{start:o.start,end:o.start}),this.eol();let u=new uf.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===uf.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"]",{start:o.end,end:o.end});return}this.pushSegment("[ ",o);for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.pushSegment(" ]",o)},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.pushSegment((0,af.getLiteralRawValue)(o),o)},EmptyExpression:function(o,a){this.pushSegment("",o)},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,kr.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.pushSegment(" "+o.operator+" ",o),this.eol(),this.pushSegment(this.context.getIndent(),o),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.pushSegment("bitOr(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="&"){this.pushSegment("bitAnd(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="<<"||o.operator===">>"||o.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(o.left),this.pushSegment(" "+o.operator+" ",o),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.pushSegment(o.operator,o),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.pushSegment(" "+o.operators[u]+" ",o),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.pushStack(o),this.context.buildBlock(o),this.context.popStack()}};let{keepParentheses:n=!1,indentation:r=r1.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new r1.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}createLine(){return{segments:[],comments:[]}}pushSegment(e,n){this._activeLine.segments.push(e),n!=null&&this.pushComment(n.start.line)}pushComment(e){let n=this.context.getCurrentChunk(),r=this.context.getChunkContext(n),i=r.commentBuckets.get(e);i&&(this._activeLine.comments.push(...i),r.commentBuckets.delete(e))}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>{let i=r.segments.join(""),s=i.trim();if(r.comments.length===0)return s.length===0?"":i;let o=r.comments.filter(l=>l.isBefore),a=o.map(kr.commentToText).join(""),u=r.comments.filter(l=>!l.isBefore),c=u.map(kr.commentToText).join("");return s.length===0&&o.length===0&&u.length===0?"":(s.length>0&&o.length>0&&(i=" "+i),s.length>0&&u.length>0&&(i=i+" "),a+i+c)}).join(`
|
117
|
-
`)}generateOptimizations(){return[]}};
|
113
|
+
`)}resolveFunctionStatement(e){let n=this.createFunctionDescription(e),r=Se.SignatureDefinitionFunction.parse("custom",{id:(0,V$.nanoid)(),type:Se.SignatureDefinitionBaseType.Function,description:n,arguments:e.parameters.map(i=>{if(i.type===Ce.ASTType.Identifier)return{label:i.name??"unknown",type:Se.SignatureDefinitionBaseType.Any};let s=i;return{label:s.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(s.init).types)}}),returns:["any"]});return this.factory(Te.CompletionItemKind.Function).addType(Se.SignatureDefinitionBaseType.Function).addSignatureType((0,Y$.enrichWithMetaInformation)(r)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(Te.CompletionItemKind.Expression).setLabel("Binary Expr").setLine(e.start.line),r=this.resolveTypeWithDefault(e.left),i=this.resolveTypeWithDefault(e.right);return n.extend(r),n.extend(i),n}resolveLogicalExpression(e){return this.factory(Te.CompletionItemKind.Expression).setLabel("Logical Expr").addType(Se.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(Te.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Se.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(Te.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Se.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(Te.CompletionItemKind.MapConstructor).addType(Se.SignatureDefinitionBaseType.Map);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.resolveTypeWithDefault(i.value).setLine(i.start.line);if(i.key.type===Ce.ASTType.StringLiteral){let o=i.key.value.toString();n.setProperty(o,s),n.values.get(`${IC.PropertyType.Identifier}:${o}`)?.definitions.push({source:this._document.source,node:i})}else{let o=this.resolveTypeWithDefault(i.key).setLine(i.start.line);n.setProperty(o,s)}}return this.createCustomTypeFromMap(e,n),n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(Te.CompletionItemKind.ListConstructor).addType(Se.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Number).setLine(i.start.line),o=this.resolveTypeWithDefault(i.value).setLine(i.start.line);n.setProperty(s,o)}return n.setLabel("[]").setLine(e.start.line)}resolveSliceExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any).setLine(e.start.line):n.setLine(e.start.line)}resolveIndexExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Te.CompletionItemKind.Property).addType(Se.SignatureDefinitionBaseType.Any).setLabel(e.identifier.name).setLine(e.start.line):r}resolveIdentifier(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Te.CompletionItemKind.Property).addType(Se.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Ce.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Ce.ASTType.CallStatement:return this.resolveCallStatement(e);case Ce.ASTType.CallExpression:return this.resolveCallExpression(e);case Ce.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Ce.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Ce.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Ce.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Ce.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Ce.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Ce.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Ce.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Ce.ASTType.Identifier:return this.resolveIdentifier(e,n);case Ce.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Ce.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Ce.ASTType.NegationExpression:case Ce.ASTType.BinaryNegatedExpression:case Ce.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Ce.ASTType.NilLiteral:return this.factory(Te.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Ce.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(Te.CompletionItemKind.Literal).addType(Se.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Ce.ASTType.NumericLiteral:case Ce.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(Te.CompletionItemKind.Literal).addType(Se.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case Wu.ASTType.FeatureFileExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Se.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case Wu.ASTType.FeatureLineExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Se.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case Wu.ASTType.FeatureEnvarExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Se.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case Wu.ASTType.FeatureInjectExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Se.SignatureDefinitionBaseType.String).setLabel("Inject Expr").setLine(e.start.line);default:return null}}resolveTypeWithDefault(e=null,n=!1){let r=this.resolveType(e,n);if(r==null){let i=this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any);return e!=null&&i.setLine(e.start.line),i}return r}resolveChain(e,n=!1,r=!1){if(e.length===0)return null;let i=new Gd(this,e,n,r),s=null,o=i.next();for(;!o.done;)s=o.value,o=i.next();return s}setEntityInPath(e,n,r){let i=e;for(let s=0;s<n.length-1;s++){let o=n[s],a=i.resolveProperty(o);if(a==null){let u=this.factory(Te.CompletionItemKind.Property).addType(Se.SignatureDefinitionBaseType.Map).setLabel(o);i.setProperty(o,u),a=u}i=a}return i.setProperty(n[n.length-1],r)}getEntityInPath(e,n){let r=e;for(let i=0;i<n.length;i++){let s=n[i],o=r.resolveProperty(s);if(o==null)return null;r=o}return r}resolveNamespace(e,n=!1){let r=(0,LC.createResolveChain)(e);return this.resolveChain(r,n)}defineProperty(e,n,r){let i=e.setProperty(n,r);return this._lastModifiedProperty=e.resolveProperty(n,!0),i}defineNamespace(e,n){let r=(0,LC.createResolveChain)(e),i=r.pop();if(this._lastModifiedProperty=null,r.length>0){let o=this.resolveChain(r,!1,!0);if(o===null)return!1;if((0,Ks.isResolveChainItemWithMember)(i))return this.defineProperty(o,i.getter.name,n);if((0,Ks.isResolveChainItemWithIndex)(i)){if((0,jC.isValidIdentifierLiteral)(i.getter))return this.defineProperty(o,i.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(i.getter);return this.defineProperty(o,a,n)}}return!1}let s=this._scope;return(0,Ks.isResolveChainItemWithIdentifier)(i)?this.defineProperty(s,i.getter.name,n):!1}addDefinition(e,n){this._lastModifiedProperty?.definitions.push({source:this._document.source,node:e});let r=(0,MC.createExpressionId)(n),i=this._definitions;r.startsWith("globals.")?(i=this._document.getRootScopeContext().aggregator.definitions,r=r.slice(8)):r.startsWith("locals.")?(i=this._definitions,r=r.slice(7)):r.startsWith("outer.")&&(i=this.parent.definitions,r=r.slice(6));let s=i.get(r);s?s.push({source:this._document.source,node:e}):i.set(r,[{source:this._document.source,node:e}])}resolveAvailableAssignmentsWithQuery(e){let n=[];return new Set([this,this._parent,this._document.getRootScopeContext().aggregator]).forEach(i=>{let s=i.definitions;s.forEach((o,a)=>{if(a.includes(e)){let u=s.get(a);(0,NC.merge)(n,u)}})}),n}resolveAvailableAssignments(e){let n=(0,MC.createExpressionId)(e),r=this;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator,n=n.slice(8)):n.startsWith("locals.")?(r=this,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent,n=n.slice(6));let i=[];return new Set([r,r._parent,r._document.getRootScopeContext().aggregator]).forEach(o=>{if(o==null)return;let a=o.resolveNamespace(e,!0);a!=null&&(0,NC.merge)(i,a.definitions)}),i}resolveCommentDefinition(e){let n=this.resolveRelatedCommentLines(e);if(n!=null){let r=n.join(`
|
114
|
+
`),i=(0,Q$.parseAssignDescription)(r);if(i!=null)return this.factory(Te.CompletionItemKind.Variable).addTypesWithMeta(i.type)}return null}analyzeAssignmentDefinition(e){let n=this.resolveCommentDefinition(e.init)?.setLine(e.start.line)??this.resolveType(e.init)?.copy({source:this._document.source}).setLine(e.start.line)??this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any).setLine(e.start.line);this.defineNamespace(e.variable,n),this.addDefinition(e,e.variable)}analyzeForDefinition(e){let n=this.resolveType(e.iterator)?.copy({source:this._document.source}).setLine(e.start.line)??this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any).setLine(e.start.line),r=this.factory(Te.CompletionItemKind.Variable).setLine(e.start.line);if(n.types.has(Se.SignatureDefinitionBaseType.List)){let o=n.values.get(`${IC.PropertyType.Type}:number`);o!=null&&r.extend(o)}if(n.types.has(Se.SignatureDefinitionBaseType.String)&&r.addType(Se.SignatureDefinitionBaseType.String),n.types.has(Se.SignatureDefinitionBaseType.Map)){let o=this.factory(Te.CompletionItemKind.Variable).addTypes(n.getPropertyTypes()).setLine(e.start.line),a=this.factory(Te.CompletionItemKind.Property).addTypes(n.getValueTypes()).setLine(e.start.line);r.addType(Se.SignatureDefinitionBaseType.Map),r.setProperty("key",o),r.setProperty("value",a)}r.types.size===0&&r.addType(Se.SignatureDefinitionBaseType.Any),this.defineNamespace(e.variable,r),this.addDefinition(e,e.variable);let i=this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Number).setLine(e.start.line),s=new Ce.ASTIdentifier({name:`__${e.variable.name}_idx`,kind:Ce.ASTIdentifierKind.Variable,range:e.range,start:e.start,end:e.end});this.defineNamespace(s,i),this.addDefinition(e,s)}analyzeImportDefinition(e){let n=e.name,r=this.scope.resolveProperty(n.name,!0);if(r!=null){this._lastModifiedProperty=r,this.addDefinition(e,e.name);return}let i=this.factory(Te.CompletionItemKind.Variable).addType(Se.SignatureDefinitionBaseType.Any).setLine(e.start.line);this.defineNamespace(e.name,i),this.addDefinition(e,e.name)}analyze(){for(let e=0;e<this._root.definitions.length;e++){let n=this._root.definitions[e];switch(n.type){case Ce.ASTType.AssignmentStatement:{this.analyzeAssignmentDefinition(n);break}case Ce.ASTType.ForGenericStatement:{this.analyzeForDefinition(n);break}case Wu.ASTType.FeatureImportExpression:{this.analyzeImportDefinition(n);break}}}}extend(e){e.definitions.forEach((n,r)=>{let i=this.definitions.get(r);i?(0,J$.mergeUnique)(i,n):this.definitions.set(r,n)})}};ta.Aggregator=yv});var vv=m(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.Document=void 0;var Ti=gn(),tB=Ee(),FC=Fs(),nB=gv(),$C=bv(),BC=Qo(),WC=V_(),_v=class t{get source(){return this._source}get root(){return this._root}get container(){return this._container}get intrinsics(){return this._intrinscis}get globals(){return this._globals}get api(){return this._api}constructor(e){this._source=e.source,this._root=e.root,this._container=e.container,this._scopeMapping=e.scopeMapping??new WeakMap,this._intrinscis=e.intrinsics??this.createIntrinscis(),this._api=e.api??this.initApi(),this._globals=e.globals??this.initGlobals()}createIntrinscis(){return{map:this._container.primitives.get(Ti.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(Ti.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(Ti.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(Ti.SignatureDefinitionBaseType.String),list:this._container.primitives.get(Ti.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(Ti.SignatureDefinitionBaseType.General);return e.resolveProperty("map",!0).setReturnEntity(this._intrinscis.map),e.resolveProperty("funcRef",!0).setReturnEntity(this._intrinscis.funcRef),e.resolveProperty("number",!0).setReturnEntity(this._intrinscis.number),e.resolveProperty("string",!0).setReturnEntity(this._intrinscis.string),e.resolveProperty("list",!0).setReturnEntity(this._intrinscis.list),e}initGlobals(){return new BC.Entity({source:this._source,kind:FC.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(Ti.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new WC.Scope({source:this._source,container:this._container,parent:n?.scope,globals:this._globals}),i=new $C.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof tB.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(Ti.SignatureDefinitionBaseType.Map)&&o!==this._globals&&r.setContext(o)}if(i.analyze(),s!==null){let o=s.signatureDefinitions.last();if(o!=null){let a=o.getArguments();for(let u=0;u<a.length;u++){let c=a[u],l=r.resolveProperty(c.getLabel(),!0),h=c.getTypes();l===null?r.setProperty(c.getLabel(),new BC.Entity({source:this._source,kind:FC.CompletionItemKind.Variable,container:this._container}).addTypesWithMeta(h)):(l.types.delete(Ti.SignatureDefinitionBaseType.Any),l.addTypesWithMeta(h))}}}}analyze(){let e=new WC.Scope({source:this._source,container:this._container,globals:this._globals,locals:this._globals}),n=new $C.Aggregator({scope:e,root:this._root,document:this});this._scopeMapping.set(this._root,{scope:e,aggregator:n}),n.analyze();for(let r=0;r<this._root.scopes.length;r++){let i=this._root.scopes[r];this.analyzeScope(i)}}getRootScopeContext(){return this._scopeMapping.get(this._root)}getAllScopeContexts(){return[this._root,...this._root.scopes].map(e=>this._scopeMapping.get(e))}getScopeContext(e){return this._scopeMapping.get(e)??null}getLastASTItemOfLine(e){let n=this._root.lines[e];if(!n||n.length===0)return null;let r=n[0];for(let i=1;i<n.length;i++){let s=n[i];(s.start.line>r.start.line||s.start.line===r.start.line&&s.start.character>r.start.character)&&(r=s)}return r}findASTItemInLine(e,n){let r=this._root.lines[e];if(r&&r.length>0){let i=r.find(s=>s.type===n);if(i)return i}return null}resolveAllAssignmentsWithQuery(e){let n=[],r=[this._root,...this._root.scopes];for(let i=0;i<r.length;i++){let o=this._scopeMapping.get(r[i]).aggregator.definitions;o.forEach((a,u)=>{if(u.includes(e)){let c=o.get(u);(0,nB.merge)(n,c)}})}return n}resolveAvailableAssignments(e){return this._scopeMapping.get(e.scope)?.aggregator.resolveAvailableAssignments(e)??[]}resolveType(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveType(e,n)??null}resolveTypeWithDefault(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveTypeWithDefault(e,n)}resolveNamespace(e,n=!1){return this._scopeMapping.get(e.scope)?.aggregator.resolveNamespace(e,n)??null}merge(...e){let n=new t({source:this._source,root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals,!0,!0),n._intrinscis.map.extend(i._intrinscis.map,!0,!0),n._intrinscis.funcRef.extend(i._intrinscis.funcRef,!0,!0),n._intrinscis.number.extend(i._intrinscis.number,!0,!0),n._intrinscis.string.extend(i._intrinscis.string,!0,!0),n._intrinscis.list.extend(i._intrinscis.list,!0,!0),n._container.mergeCustomTypes(i._container)}n.analyze();for(let r=0;r<e.length;r++){let i=e[r];n.getRootScopeContext().aggregator.extend(i.getRootScopeContext().aggregator)}return n}};zd.Document=_v});var Ev=m(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.ContainerProxy=void 0;var Cr=gn(),Sv=$s(),wi=Qo(),UC=Fs(),HC=Cu(),Tv=Pd(),wv=class t{get primitives(){return this._primitives}get types(){return this._types}constructor(e){this._container=e.container,this._primitives=e.primitives??this.createPrimitives(),this._types=e.types??this.createTypes(),this._customTypes=new Set}createPrimitives(){let e=new Map;return this._container.getPrimitives().forEach((n,r)=>{let i=new wi.Entity({source:"internal",kind:UC.CompletionItemKind.Internal,container:this,isAPI:r===Cr.SignatureDefinitionBaseType.General}).addType(Cr.SignatureDefinitionBaseType.Map).insertSignature(n);e.set(r,i)}),e}createTypes(){let e=new Map;return this._container.getTypes().forEach((n,r)=>{let i=new wi.Entity({source:"internal",kind:UC.CompletionItemKind.Internal,container:this}).addType(Cr.SignatureDefinitionBaseType.Map).insertSignature(n);e.set(r,i)}),e}setCustomType(e,n){this._types.has(e)||(this._types.set(e,n),this._customTypes.add(e))}mergeCustomTypes(e){e._customTypes.forEach(n=>{let r=e._types.get(n);r!=null&&this.setCustomType(n,r.copy({deepCopy:!0}))})}getTypeSignature(e){return this._primitives.get(e)??this._types.get(e)??null}searchDefinitionMatches(e,n){if(typeof e=="string")return this.searchDefinitionMatches([e],n);let r=e.includes(Cr.SignatureDefinitionBaseType.Any)?new Set(this._container.getAllVisibleTypes()):new Set(e),i=new Map;return r.forEach(s=>{let o=this.getTypeSignature(s);if(o===null)return;let a=(0,Tv.lookupProperty)(Sv.PropertyType.Identifier,o,n);a!==null&&i.set(s,a)}),i}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let i=(0,Tv.lookupProperty)(Sv.PropertyType.Identifier,this._primitives.get(Cr.SignatureDefinitionBaseType.Any),n);if(e.includes(Cr.SignatureDefinitionBaseType.Any)&&i)return wi.Entity.resolveEntity(this,i,r);let s=this.searchDefinitionMatches(e,n);if(s.size===0)return null;if(s.size===1)return wi.Entity.resolveEntity(this,s.values().next().value,r);if(s.has(Cr.SignatureDefinitionBaseType.Any))return wi.Entity.resolveEntity(this,s.get(Cr.SignatureDefinitionBaseType.Any),r);if(i!==null)return wi.Entity.resolveEntity(this,i,r);let o=s.values().next().value,a=new wi.Entity({source:"internal",label:n,kind:o.kind,container:this});return s.forEach(u=>{let c=wi.Entity.resolveEntity(this,u,r);a.extend(c,!0,!0)}),a}getGeneralDefinition(e,n=!1){let r=(0,Tv.lookupProperty)(Sv.PropertyType.Identifier,this._primitives.get(Cr.SignatureDefinitionBaseType.General),e);return r==null?null:wi.Entity.resolveEntity(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,HC.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(Cr.SignatureDefinitionBaseType.Map);(0,HC.injectIdentifers)(e,i)}}getAvailableIdentifier(e){let n=new Map;if(e===Cr.SignatureDefinitionBaseType.Any){let r=this._container.getAllVisibleTypes();for(let i=0;i<r.length;i++)this.injectTypeIdentifiers(n,r[i]);return n}return this.injectTypeIdentifiers(n,e),n}copy(){return new t({container:this._container})}};Kd.ContainerProxy=wv});var GC=m(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.TypeManager=void 0;var rB=vv(),iB=Ev(),xv=class{constructor(e){this._container=new iB.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new rB.Document({source:e,container:this._container.copy(),root:n});try{r.analyze()}catch(i){console.error(i)}return this._types.set(e,r),r}get(e){return this._types.get(e)??null}};Vd.TypeManager=xv});var na=m(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.TypeManager=Q.ContainerProxy=Q.Document=Q.Aggregator=Q.Scope=Q.Entity=Q.aggregateEntity=Q.lookupProperty=Q.isEligibleForProperties=Q.injectIdentifers=Q.isSignatureDefinitionFunction=Q.isResolveChainItemWithValue=Q.isResolveChainItemWithMember=Q.isResolveChainItemWithIndex=Q.isResolveChainItemWithIdentifier=Q.IsaPropertyPattern=Q.IdentifierPropertyPattern=Q.PropertyType=Q.CompletionItemKind=Q.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=Q.ObjectSetIterator=Q.ObjectSet=Q.rotateBits=Q.getStringHashCode=Q.getHashCode=Q.createResolveChain=Q.enrichWithMetaInformation=Q.createExpressionId=Q.createExpressionHash=Q.isValidIdentifierLiteral=void 0;var sB=cu();Object.defineProperty(Q,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return sB.isValidIdentifierLiteral}});var oB=rC();Object.defineProperty(Q,"createExpressionHash",{enumerable:!0,get:function(){return oB.createExpressionHash}});var aB=m_();Object.defineProperty(Q,"createExpressionId",{enumerable:!0,get:function(){return aB.createExpressionId}});var uB=M_();Object.defineProperty(Q,"enrichWithMetaInformation",{enumerable:!0,get:function(){return uB.enrichWithMetaInformation}});var cB=L_();Object.defineProperty(Q,"createResolveChain",{enumerable:!0,get:function(){return cB.createResolveChain}});var Av=fd();Object.defineProperty(Q,"getHashCode",{enumerable:!0,get:function(){return Av.getHashCode}});Object.defineProperty(Q,"getStringHashCode",{enumerable:!0,get:function(){return Av.getStringHashCode}});Object.defineProperty(Q,"rotateBits",{enumerable:!0,get:function(){return Av.rotateBits}});var zC=j_();Object.defineProperty(Q,"ObjectSet",{enumerable:!0,get:function(){return zC.ObjectSet}});Object.defineProperty(Q,"ObjectSetIterator",{enumerable:!0,get:function(){return zC.ObjectSetIterator}});var lB=F_();Object.defineProperty(Q,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return lB.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var hB=Fs();Object.defineProperty(Q,"CompletionItemKind",{enumerable:!0,get:function(){return hB.CompletionItemKind}});var kv=$s();Object.defineProperty(Q,"PropertyType",{enumerable:!0,get:function(){return kv.PropertyType}});Object.defineProperty(Q,"IdentifierPropertyPattern",{enumerable:!0,get:function(){return kv.IdentifierPropertyPattern}});Object.defineProperty(Q,"IsaPropertyPattern",{enumerable:!0,get:function(){return kv.IsaPropertyPattern}});var Xd=B_();Object.defineProperty(Q,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Xd.isResolveChainItemWithIdentifier}});Object.defineProperty(Q,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Xd.isResolveChainItemWithIndex}});Object.defineProperty(Q,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Xd.isResolveChainItemWithMember}});Object.defineProperty(Q,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Xd.isResolveChainItemWithValue}});var dB=W_();Object.defineProperty(Q,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return dB.isSignatureDefinitionFunction}});var fB=Cu();Object.defineProperty(Q,"injectIdentifers",{enumerable:!0,get:function(){return fB.injectIdentifers}});var pB=Rd();Object.defineProperty(Q,"isEligibleForProperties",{enumerable:!0,get:function(){return pB.isEligibleForProperties}});var gB=Pd();Object.defineProperty(Q,"lookupProperty",{enumerable:!0,get:function(){return gB.lookupProperty}});var mB=U_();Object.defineProperty(Q,"aggregateEntity",{enumerable:!0,get:function(){return mB.aggregateEntity}});var yB=Qo();Object.defineProperty(Q,"Entity",{enumerable:!0,get:function(){return yB.Entity}});var bB=V_();Object.defineProperty(Q,"Scope",{enumerable:!0,get:function(){return bB.Scope}});var _B=bv();Object.defineProperty(Q,"Aggregator",{enumerable:!0,get:function(){return _B.Aggregator}});var vB=vv();Object.defineProperty(Q,"Document",{enumerable:!0,get:function(){return vB.Document}});var SB=Ev();Object.defineProperty(Q,"ContainerProxy",{enumerable:!0,get:function(){return SB.ContainerProxy}});var TB=GC();Object.defineProperty(Q,"TypeManager",{enumerable:!0,get:function(){return TB.TypeManager}})});var Cv=m(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.getSymbolItemKind=ra.getCompletionItemKind=void 0;var at=na(),wB={[at.CompletionItemKind.Constant]:21,[at.CompletionItemKind.Internal]:21,[at.CompletionItemKind.InternalFunction]:21,[at.CompletionItemKind.InternalProperty]:21,[at.CompletionItemKind.Property]:6,[at.CompletionItemKind.Variable]:6,[at.CompletionItemKind.Expression]:6,[at.CompletionItemKind.Function]:3,[at.CompletionItemKind.ListConstructor]:12,[at.CompletionItemKind.MapConstructor]:12,[at.CompletionItemKind.Literal]:12,[at.CompletionItemKind.Unknown]:12},EB=t=>wB[t]??6;ra.getCompletionItemKind=EB;var xB={[at.CompletionItemKind.Constant]:14,[at.CompletionItemKind.Internal]:14,[at.CompletionItemKind.InternalFunction]:14,[at.CompletionItemKind.InternalProperty]:14,[at.CompletionItemKind.Variable]:13,[at.CompletionItemKind.Property]:13,[at.CompletionItemKind.Expression]:13,[at.CompletionItemKind.Function]:12,[at.CompletionItemKind.ListConstructor]:18,[at.CompletionItemKind.MapConstructor]:19,[at.CompletionItemKind.Literal]:13,[at.CompletionItemKind.Unknown]:13},AB=t=>xB[t]??13;ra.getSymbolItemKind=AB});var KC=m(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.CompletionListBuilder=void 0;var kB=Cv(),Ov=class{constructor(){this.collection=new Map,this.default=[]}setDefault(e){this.default=e}addCollection(e){e!=null&&(this.collection=new Map([...this.collection,...e]))}build(){let e=[];for(let[n,r]of this.collection)e.push({label:n,kind:(0,kB.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};Yd.CompletionListBuilder=Ov});var Qd=m(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.findEx=ia.ScraperWalker=void 0;var CB=Ee(),OB=function(t){return{ParenthesisExpression:(e,n)=>{t(e.expression,n)},AssignmentStatement:function(e,n){t(e.init,n),t(e.variable,n)},MemberExpression:function(e,n){t(e.base,n),t(e.identifier,n)},FunctionDeclaration:function(e,n){for(let r=0;r<e.parameters.length;r++)t(e.parameters[r],n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},MapConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},ReturnStatement:function(e,n){e.argument&&t(e.argument,n)},WhileStatement:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IndexExpression:function(e,n){t(e.base,n),t(e.index,n)},SliceExpression:function(e,n){t(e.base,n),t(e.left,n),t(e.right,n)},ListValue:function(e,n){t(e.value,n)},MapKeyString:function(e,n){t(e.key,n),t(e.value,n)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseShortcutClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ForGenericStatement:function(e,n){t(e.variable,n),t(e.iterator,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IfStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},NegationExpression:function(e,n){t(e.argument,n)},CallExpression:function(e,n){t(e.base,n);for(let r=0;r<e.arguments.length;r++)t(e.arguments[r],n)},CallStatement:function(e,n){t(e.expression,n)},ListConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},BinaryExpression:function(e,n){t(e.left,n),t(e.right,n)},BinaryNegatedExpression:function(e,n){t(e.argument,n)},IsaExpression:function(e,n){t(e.left,n),t(e.right,n)},LogicalExpression:function(e,n){t(e.left,n),t(e.right,n)},ComparisonGroupExpression:function(e,n){for(let r=0;r<e.expressions.length;r++)t(e.expressions[r],n)},UnaryExpression:function(e,n){t(e.argument,n)},Chunk:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},InvalidCodeExpression:()=>{}}},Jd=class{constructor(e,n={}){this.map=Object.assign(OB(this.visit.bind(this)),n),this.callback=e,this.state={exit:!1,skip:!1}}visit(e,n=0){if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");let r=this.callback(e,n);if(r!=null&&Object.assign(this.state,r),this.state.exit||this.state.skip){this.state.skip=!1;return}let i=this.map[e.type];i?.call(this,e,n+1)}};ia.ScraperWalker=Jd;function RB(t,e){let n=[];return new Jd((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==CB.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}ia.findEx=RB});var Rv=m(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.lookupBase=mn.lookupIdentifier=mn.lookupScopes=mn.lookupRootScope=void 0;var Ei=Ee(),DB=t=>{let e=t;for(;e.scope;)e=e.scope;return e};mn.lookupRootScope=DB;var PB=t=>{if(!t.scope)return[t];let e=(0,mn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};mn.lookupScopes=PB;var IB=t=>{switch(t.type){case Ei.ASTType.CallStatement:return(0,mn.lookupIdentifier)(t.expression);case Ei.ASTType.CallExpression:return(0,mn.lookupIdentifier)(t.base);case Ei.ASTType.Identifier:return t;case Ei.ASTType.MemberExpression:return(0,mn.lookupIdentifier)(t.identifier);case Ei.ASTType.IndexExpression:return(0,mn.lookupIdentifier)(t.index);default:return null}};mn.lookupIdentifier=IB;var MB=(t=null)=>{switch(t?.type){case Ei.ASTType.MemberExpression:return t.base;case Ei.ASTType.IndexExpression:return t.base;case Ei.ASTType.CallExpression:return t.base;case Ei.ASTType.SliceExpression:return t.base;default:return null}};mn.lookupBase=MB});var oa=m(Zr=>{"use strict";var LB=Zr&&Zr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),NB=Zr&&Zr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qB=Zr&&Zr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&LB(e,t,n);return NB(e,t),e};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.LookupHelper=void 0;var jB=gn(),VC=Ee(),sa=na(),FB=qB(Qd()),$B=Rv(),Dv=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null}async getTypeMap(){return this.mergedTypeMap==null&&(this.mergedTypeMap=await this.context.documentMerger.build(this.document,this.context)),this.mergedTypeMap}async findAllAssignmentsOfIdentifier(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignmentsWithQuery(e)}async findAllAssignmentsOfItem(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignments(e)}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.getRootScopeContext().scope.getAvailableIdentifier()}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAvailableIdentifier()}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;for(let a of n.container.getAvailableIdentifier(jB.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:sa.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:sa.CompletionItemKind.Constant,line:-1});let s=new Map;(0,sa.injectIdentifers)(s,i.scope);let o=Array.from(s.entries()).map(([a,u])=>({identifier:a,...u})).sort((a,u)=>a.line-u.line);for(let a=0;a<o.length;a++){let u=o[a];if(u.line>=e.end.line)break;r.set(u.identifier,{kind:u.kind,line:u.line})}return i.scope.locals!==i.scope.globals&&(0,sa.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,sa.injectIdentifers)(r,i.scope.outer),r}async lookupAST(e){let n=this,s=(await this.context.documentManager.getLatest(n.document)).document.lines[e.line+1];if(!s)return null;for(let o=0;o<s.length;o++){let a=s[o],u=FB.findEx((l,h)=>{let d=l.start.line-1,g=l.start.character-1,_=l.end.line-1,b=l.end.character-1;return d>e.line?{exit:!0}:d<_?{valid:e.line>d&&e.line<_||e.line===d&&g<=e.character||e.line===_&&b>=e.character}:{valid:d<=e.line&&g<=e.character&&_>=e.line&&b>=e.character}},a),c=u.pop();if(c)return{closest:c,outer:u}}return null}async lookupBasePath(e){let n=await this.getTypeMap();if(n===null)return null;let r=(0,$B.lookupBase)(e);return r?n.resolveNamespace(r):null}async lookupTypeInfo({closest:e,outer:n}){let r=await this.getTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===VC.ASTType.MemberExpression&&e===i.identifier||i?.type===VC.ASTType.IndexExpression&&e===i.index&&(0,sa.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}async lookupType(e){let n=this,r=await n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Zr.LookupHelper=Dv});var XC=m(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.AVAILABLE_CONSTANTS=void 0;Zd.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var YC=m(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.AVAILABLE_KEYWORDS=void 0;var aa=Qr(),an=Ee();ef.AVAILABLE_KEYWORDS=[an.Keyword.If,an.Keyword.In,an.Keyword.Or,an.Keyword.And,an.Keyword.Isa,an.Keyword.For,an.Keyword.New,an.Keyword.Not,an.Keyword.End,an.Keyword.Then,an.Keyword.Else,an.Keyword.Break,an.Keyword.While,an.Keyword.Return,an.Keyword.Function,an.Keyword.Continue,aa.GreybelKeyword.Envar,aa.GreybelKeyword.Import,aa.GreybelKeyword.Include,aa.GreybelKeyword.Debugger,aa.GreybelKeyword.Line,aa.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var JC=m(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.AVAILABLE_OPERATORS=void 0;var Uu=ea(),Ut=Ee();tf.AVAILABLE_OPERATORS=[Ut.Operator.Plus,Ut.Operator.Asterik,Ut.Operator.Minus,Ut.Operator.Slash,Ut.Operator.Power,Ut.Operator.Modulo,Ut.Operator.LessThan,Ut.Operator.GreaterThan,Ut.Operator.LessThanOrEqual,Ut.Operator.GreaterThanOrEqual,Ut.Operator.NotEqual,Ut.Operator.Equal,Ut.Operator.AddShorthand,Ut.Operator.SubtractShorthand,Ut.Operator.MultiplyShorthand,Ut.Operator.DivideShorthand,Uu.Operator.BitwiseAnd,Uu.Operator.BitwiseOr,Uu.Operator.LeftShift,Uu.Operator.RightShift,Uu.Operator.UnsignedRightShift,Ut.Operator.Assign,Ut.Operator.Reference].map(t=>({label:t,kind:24}))});var ZC=m(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.activate=ur.getDefaultCompletionList=ur.getPropertyCompletionList=void 0;var QC=Ee(),BB=KC(),WB=oa(),UB=XC(),HB=YC(),GB=JC(),zB=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.getAvailableIdentifier()};ur.getPropertyCompletionList=zB;var KB=()=>[...HB.AVAILABLE_KEYWORDS,...GB.AVAILABLE_OPERATORS,...UB.AVAILABLE_CONSTANTS];ur.getDefaultCompletionList=KB;function VB(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new WB.LookupHelper(r.textDocument,t),s=await i.lookupAST(e.position),o=new BB.CompletionListBuilder;if(s){let{closest:a}=s;a instanceof QC.ASTMemberExpression?o.addCollection(await(0,ur.getPropertyCompletionList)(i,a)):a instanceof QC.ASTIndexExpression?o.addCollection(await(0,ur.getPropertyCompletionList)(i,a)):(o.setDefault((0,ur.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,ur.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}ur.activate=VB});var tO=m((m6,eO)=>{"use strict";eO.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Pv=m((y6,rO)=>{var Hu=tO(),nO={};for(let t of Object.keys(Hu))nO[Hu[t]]=t;var te={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};rO.exports=te;for(let t of Object.keys(te)){if(!("channels"in te[t]))throw new Error("missing channels property: "+t);if(!("labels"in te[t]))throw new Error("missing channel labels property: "+t);if(te[t].labels.length!==te[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=te[t];delete te[t].channels,delete te[t].labels,Object.defineProperty(te[t],"channels",{value:e}),Object.defineProperty(te[t],"labels",{value:n})}te.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=s-i,a,u;s===i?a=0:e===s?a=(n-r)/o:n===s?a=2+(r-e)/o:r===s&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};te.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),h=function(d){return(c-d)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=h(o),n=h(a),r=h(u),o===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};te.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=te.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};te.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function XB(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}te.rgb.keyword=function(t){let e=nO[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Hu)){let s=Hu[i],o=XB(t,s);o<n&&(n=o,r=i)}return r};te.keyword.rgb=function(t){return Hu[t]};te.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};te.rgb.lab=function(t){let e=te.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};te.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};te.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[e,a*100,o*100]};te.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};te.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};te.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*e),a=1-r;s=6*e-o,o&1&&(s=1-s);let u=n+s*(a-n),c,l,h;switch(o){default:case 6:case 0:c=a,l=u,h=n;break;case 1:c=u,l=a,h=n;break;case 2:c=n,l=a,h=u;break;case 3:c=n,l=u,h=a;break;case 4:c=u,l=n,h=a;break;case 5:c=a,l=n,h=u;break}return[c*255,l*255,h*255]};te.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};te.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,o;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};te.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),o=200*(n-r);return[i,s,o]};te.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,o;s=(e+16)/116,i=n/500+s,o=s-r/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};te.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[e,o,i]};te.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[e,s,o]};te.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?te.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};te.hsv.ansi16=function(t){return te.rgb.ansi16(te.hsv.rgb(t),t[2])};te.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};te.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};te.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};te.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};te.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};te.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(n-r)/o%6:i===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};te.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};te.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};te.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-n)*r,[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};te.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};te.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};te.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};te.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};te.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};te.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};te.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};te.gray.hsl=function(t){return[0,0,t[0]]};te.gray.hsv=te.gray.hsl;te.gray.hwb=function(t){return[0,100,t[0]]};te.gray.cmyk=function(t){return[0,0,0,t[0]]};te.gray.lab=function(t){return[t[0],0,0]};te.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};te.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var sO=m((b6,iO)=>{var nf=Pv();function YB(){let t={},e=Object.keys(nf);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function JB(t){let e=YB(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(nf[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function QB(t,e){return function(n){return e(t(n))}}function ZB(t,e){let n=[e[t].parent,t],r=nf[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=QB(nf[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}iO.exports=function(t){let e=JB(t),n={},r=Object.keys(e);for(let i=r.length,s=0;s<i;s++){let o=r[s];e[o].parent!==null&&(n[o]=ZB(o,e))}return n}});var aO=m((_6,oO)=>{var Iv=Pv(),e2=sO(),ua={},t2=Object.keys(Iv);function n2(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function r2(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}t2.forEach(t=>{ua[t]={},Object.defineProperty(ua[t],"channels",{value:Iv[t].channels}),Object.defineProperty(ua[t],"labels",{value:Iv[t].labels});let e=e2(t);Object.keys(e).forEach(r=>{let i=e[r];ua[t][r]=r2(i),ua[t][r].raw=n2(i)})});oO.exports=ua});var cO=m(ca=>{"use strict";var i2=ca&&ca.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ca,"__esModule",{value:!0});ca.activate=void 0;var Mv=i2(aO()),s2=Ee(),uO;(function(t){t.Black="black",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple",t.Red="red",t.White="white",t.Yellow="yellow"})(uO||(uO={}));var Lv={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},o2=()=>new RegExp(`(?:mark|color)=(${Object.keys(Lv).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),a2=Object.prototype.hasOwnProperty;function u2(t){t.connection.onColorPresentation(e=>[{label:`#${Mv.default.rgb.hex(e.color.red*255,e.color.green*255,e.color.blue*255)}`}]),t.connection.onDocumentColor(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let s=(await t.documentManager.getLatest(n)).document.literals.filter(u=>u.type===s2.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:h,lineIndex:d})=>{let g=u.index+c.indexOf("=")+1,_=g+l.length,b=h.line-1+d,C=g,A=_;return d===0&&(C+=h.character,A+=h.character),{start:{line:b,character:C},end:{line:b,character:A}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,h=c.value.toString().split(`
|
115
|
+
`);for(let d=0;d<h.length;d++){let g=h[d],_=o2(),b;for(;b=_.exec(g);){let[C,A]=b,w=a({match:b,markup:C,value:A,astPosition:l,lineIndex:d});if(A.startsWith("#")){let[T,v,L]=Mv.default.hex.rgb(A.slice(1));o.push({range:w,color:{red:T/255,green:v/255,blue:L/255,alpha:1}})}else if(a2.call(Lv,A)){let[T,v,L]=Mv.default.hex.rgb(Lv[A].slice(1));o.push({range:w,color:{red:T/255,green:v/255,blue:L/255,alpha:1}})}else o.push({range:w,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}ca.activate=u2});var hO=m(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.activate=void 0;var lO=Ee(),c2=oa(),l2=t=>`${t.targetUri}:${t.targetRange.start.line}:${t.targetRange.start.character}-${t.targetRange.end.line}:${t.targetRange.end.character}`,h2=t=>{let e=t.node,n,r;switch(e.type){case lO.ASTType.ForGenericStatement:{let i=e;n={line:i.variable.start.line-1,character:i.variable.start.character-1},r={line:i.variable.end.line-1,character:i.variable.end.character-1};break}default:n={line:e.start.line-1,character:e.start.character-1},r={line:e.end.line-1,character:e.end.character-1}}return{targetUri:t.source,targetRange:{start:n,end:r},targetSelectionRange:{start:n,end:r}}},d2=async(t,e,n)=>{let r=await t.findAllAssignmentsOfItem(e,n),i=[],s=new Set;for(let o of r){let a=o.node;if(!a.start||!a.end)continue;let u=h2(o),c=l2(u);s.has(c)||(s.add(c),i.push(u))}return i};function f2(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new c2.LookupHelper(n,t),i=await r.lookupAST(e.position);if(!i)return;let{outer:s,closest:o}=i,a=s.length>0?s[s.length-1]:void 0,u=o;return a&&a instanceof lO.ASTMemberExpression&&a.identifier===o&&(u=a),await d2(r,u,u.scope)})}rf.activate=f2});var dO=m(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.activate=void 0;async function p2(t,e){let n=await e.documentManager.getLatest(t);return n.errors.map(r=>{if(r?.range){let i=r.range;return{range:{start:{line:i.start.line-1,character:i.start.character-1},end:{line:i.end.line-1,character:i.end.character-1}},message:r.message,severity:1}}return{range:{start:n.document.start,end:n.document.end},message:r.message,severity:1}})}function g2(t){t.connection.languages.diagnostics.on(async e=>{if(!t.getConfiguration().diagnostic)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await p2(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}sf.activate=g2});var fO=m(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.getStringHashCode=void 0;of.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var Nv=m(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.createExpressionHash=void 0;var af=Ee(),pO=fO(),uf=(t,e)=>t.$$hash=e,m2=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function la(t){let e=m2(t);if(e!==null)return e;let n=(0,pO.getStringHashCode)(t.type);switch(t.type){case af.ASTType.ParenthesisExpression:return la(t.expression);case af.ASTType.MemberExpression:{let r=t;return n^=la(r.base),n^=la(r.identifier),uf(t,n)}case af.ASTType.IndexExpression:{let r=t;return n^=la(r.base),n^=la(r.index),uf(t,n)}case af.ASTType.Identifier:{let r=t;return n^=(0,pO.getStringHashCode)(r.name),uf(t,n)}}return uf(t,n)}function y2(t){return la(t)}cf.createExpressionHash=y2});var fa=m(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.getLiteralValue=da.getLiteralRawValue=void 0;var ha=Ee(),b2=t=>{switch(t.type){case ha.ASTType.NilLiteral:return"null";case ha.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}case ha.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}default:return t.raw.toString()}};da.getLiteralRawValue=b2;var _2=t=>{switch(t.type){case ha.ASTType.NilLiteral:return"null";case ha.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}case ha.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}default:return t.value.toString()}};da.getLiteralValue=_2});var jv=m(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.BeautifyBodyIterator=Xs.FILLER_TYPE=void 0;var Vs=Ee();Xs.FILLER_TYPE="FILLER";var qv=class{constructor(e,n){this._base=e,this._items=n.sort((r,i)=>r.range[0]-i.range[0]),this._index=0,this._freeSpaceIndex=0,this._freeSpace=0,this._lastEndLine=0,this._checkedIndexes=new Set,this._previous=null}getBlockOpenerEndLine(e){switch(e.type){case Vs.ASTType.IfClause:return e.condition.end.line;case Vs.ASTType.WhileStatement:return e.condition.end.line;case Vs.ASTType.ForGenericStatement:return e.iterator.end.line;case Vs.ASTType.Chunk:return e.start.line-1}return e.start.line}getBlockCloseEndLine(e){switch(e.type){case Vs.ASTType.Chunk:return e.end.line+1}return e.end.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Vs.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}getFreeSpaceItem(){let e={line:this._lastEndLine+this._freeSpaceIndex+1,character:0};return this._freeSpaceIndex++,this._freeSpace===this._freeSpaceIndex&&(this._lastEndLine=0,this._freeSpaceIndex=0,this._freeSpace=0),new Vs.ASTBase(Xs.FILLER_TYPE,{start:e,end:e,range:[0,0],scope:this._base.scope})}next(){if(this._freeSpace>this._freeSpaceIndex)return{value:this.getFreeSpaceItem(),done:!1};if(this._index>=this._items.length){if(!this._checkedIndexes.has(this._items.length)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(this.getBlockCloseEndLine(this._base)-n-1,0);if(r>0)return this._checkedIndexes.add(this._items.length),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return{value:null,done:!0}}let e=this._items[this._index];if(!this._checkedIndexes.has(this._index)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(e.start.line-n-1,0);if(r>0)return this._checkedIndexes.add(this._index),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return this._index++,this._previous=e,{value:e,done:!1}}};Xs.BeautifyBodyIterator=qv});var $v=m(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.BeautifyContext=Js.IndentationType=void 0;var Ys=Ee(),gO=jv(),mO;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(mO=Js.IndentationType||(Js.IndentationType={}));var Fv=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}constructor(e,n){this.factory=e,this.options=n,this._indent=0,this._stack=[],this._contexts=new Map,this._isMultilineAllowed=!0,this.getIndent=n.indentation===mO.Tab?(r=0)=>" ".repeat(this._indent+r):(r=0)=>" ".repeat(n.indentationSpaces).repeat(this._indent+r)}buildChunkContext(e){let n=new Map,r=Object.keys(e.lines),i=new Set;for(let s=0;s<r.length;s++){let o=Number(r[s]),u=e.lines[o].filter(c=>c.type===Ys.ASTType.Comment);for(let c=0;c<u.length;c++){let l=u[c];if(!i.has(l))if(i.add(l),l.isMultiline){let h=l.value.split(`
|
116
|
+
`);h.forEach((d,g)=>{let _=o+g;n.has(_)||n.set(_,[]);let C=e.lines[_].filter(L=>L.type!==Ys.ASTType.Comment).map(L=>L.start.character),A=C.length>0?Math.min(...C):-1,w=_===o,T=_===o+h.length-1,v=T?l.end.character<A:!1;n.get(_).push({isMultiline:!0,isStart:w,isEnd:T,isBefore:v,value:d})})}else n.has(o)||n.set(o,[]),n.get(o).push({isMultiline:!1,isStart:!1,isEnd:!1,isBefore:!1,value:l.value})}}return{commentBuckets:n}}getChunkContext(e){return this._contexts.get(e)}getCurrentChunk(){return this._stack[this._stack.length-1]}pushStack(e){this._stack.push(e),this._contexts.set(e,this.buildChunkContext(e))}popStack(){this._stack.pop()}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof Ys.ASTIfClause||e instanceof Ys.ASTWhileStatement?e.condition.end.line:e instanceof Ys.ASTForGenericStatement?e.iterator.end.line:e instanceof Ys.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Ys.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){let n=new gO.BeautifyBodyIterator(e,e.body),r=n.next();for(;!r.done;){let i=r.value;if(i.type===gO.FILLER_TYPE){this.factory.pushSegment(this.getIndent()),this.factory.pushComment(i.start.line),this.factory.eol(),r=n.next();continue}this.factory.pushSegment(this.getIndent()),this.factory.process(i,{isCommand:!0}),this.factory.eol(),r=n.next()}}};Js.BeautifyContext=Fv});var Bv=m(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.commentToText=qt.hasEmptyBody=qt.containsMultilineItemInShortcutClauses=qt.getLastComment=qt.unwrap=qt.countRightBinaryExpressions=qt.SHORTHAND_OPERATORS=void 0;var An=Ee();qt.SHORTHAND_OPERATORS=[An.Operator.Plus,An.Operator.Minus,An.Operator.Asterik,An.Operator.Slash,An.Operator.Modulo,An.Operator.Power];var v2=t=>{if(t=(0,qt.unwrap)(t),t instanceof An.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof An.ASTBinaryExpression&&n++,(r instanceof An.ASTBinaryExpression||r instanceof An.ASTLogicalExpression||r instanceof An.ASTIsaExpression)&&(e.push((0,qt.unwrap)(r.left)),e.push((0,qt.unwrap)(r.right)))}return n};qt.countRightBinaryExpressions=v2;var S2=t=>{for(;t instanceof An.ASTParenthesisExpression;)t=t.expression;return t};qt.unwrap=S2;var T2=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===An.ASTType.Comment)return n}return null};qt.getLastComment=T2;var w2=(t,e)=>e.some(n=>t.line<n.body[0].end.line);qt.containsMultilineItemInShortcutClauses=w2;var E2=t=>!t.some(e=>!(e instanceof An.ASTComment));qt.hasEmptyBody=E2;var x2=t=>t.isMultiline?t.isStart&&!t.isEnd?"/* "+t.value.trim():!t.isStart&&t.isEnd?t.value.trim()+" */":t.isStart&&t.isEnd?"/* "+t.value.trim()+" */":t.value.trim():"// "+t.value.trim();qt.commentToText=x2});var Uv=m(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.Stack=void 0;var Wv=class{constructor(){let e=this;e.currentStack=[]}get(e){let r=this.currentStack;e==null&&(e=0);let i=r.length-e-1;return i<0?null:r[i]}depth(){return this.currentStack.filter(function(e){return Object.prototype.hasOwnProperty.call(e,"body")}).length}lookup(e){let n=this;for(let r=n.currentStack.length-2;r>=0;r--)if(e(n.currentStack[r]))return!0;return!1}push(e){let n=this;return n.currentStack.push(e),n}pop(){let e=this;return e.currentStack.pop(),e}};lf.Stack=Wv});var Gu=m(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.Factory=void 0;var A2=Uv(),Hv=class{get activeLine(){return this._activeLine}get lines(){return this._lines}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}constructor(e){this.transformer=e,this._activeLine=this.createLine(),this._lines=[],this._currentDependency=null,this._currentStack=new A2.Stack}pushSegment(e,n){this._activeLine.segments.push(e)}pushComment(e){throw new Error("Not implemented")}createLine(){return{segments:[]}}eol(e){this._lines.push(this._activeLine),this._activeLine=this.createLine()}reset(){this._activeLine=this.createLine(),this._lines=[]}process(e,n={}){let r=this,i=r._currentStack;if(e==null)return;if(e.type==null)throw console.error("Error AST type:",e),new Error("Unexpected AST type");let s=r.handlers[e.type];if(s==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);i.push(e),s.call(this,e,n),i.pop()}};hf.Factory=Hv});var zv=m(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.BeautifyFactory=void 0;var zu=Ee(),k2=require("path"),yO=Nv(),df=fa(),ff=jv(),bO=$v(),Or=Bv(),C2=Gu(),Gv=class extends C2.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.pushSegment("(",o),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(")",o)},Comment:function(o,a){},AssignmentStatement:function(o,a){let u=o.variable,c=o.init;if(this.process(u),(u instanceof zu.ASTIdentifier||u instanceof zu.ASTMemberExpression)&&c instanceof zu.ASTBinaryExpression&&(c.left instanceof zu.ASTIdentifier||c.left instanceof zu.ASTMemberExpression)&&Or.SHORTHAND_OPERATORS.includes(c.operator)&&(0,yO.createExpressionHash)(u)===(0,yO.createExpressionHash)(c.left)){this.pushSegment(" "+c.operator+"= ",o),this.process((0,Or.unwrap)(c.right));return}this.pushSegment(" = ",o),this.process(c)},MemberExpression:function(o,a){this.process(o.base),this.pushSegment(o.indexer,o),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.pushSegment("function",{start:o.start,end:o.start});else{this.context.disableMultiline(),this.pushSegment("function(",{start:o.start,end:o.start});for(let u=0;u<o.parameters.length;u++){let c=o.parameters[u];this.process(c),u!==o.parameters.length-1&&this.pushSegment(", ",c)}this.pushSegment(")",{start:o.start,end:o.start}),this.context.enableMultiline()}this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end function",{start:o.end,end:o.end})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("{}",o);return}if(o.fields.length===1){this.pushSegment("{ ",o),this.process(o.fields[0]),this.pushSegment(" }",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("{",{start:o.start,end:o.start}),this.eol();let u=new ff.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===ff.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"}",{start:o.end,end:o.end});return}this.pushSegment("{ ",{start:o.start,end:o.start});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.context.decIndent(),this.pushSegment(" }",{start:o.end,end:o.end})},MapKeyString:function(o,a){this.process(o.key),this.pushSegment(": ",o),this.process(o.value)},Identifier:function(o,a){this.pushSegment(o.name,o)},ReturnStatement:function(o,a){this.pushSegment("return ",o),o.argument&&this.process(o.argument)},NumericLiteral:function(o,a){this.pushSegment((0,df.getLiteralValue)(o),o)},WhileStatement:function(o,a){this.pushSegment("while ",{start:o.start,end:o.start}),this.context.disableMultiline(),this.process(o.condition),this.context.enableMultiline(),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end while",{start:o.end,end:o.end})},CallExpression:function(o,a){let u=this.lines.length-1;if(this.process(o.base),o.arguments.length===0)return;if(o.arguments.length>3&&this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("(",{start:o.start,end:o.start}),this.eol();for(let l=0;l<o.arguments.length;l++){let h=o.arguments[l];this.pushSegment(this.context.getIndent(),h),this.process(h),l!==o.arguments.length-1&&(this.pushSegment(",",h),this.eol())}this.context.decIndent(),this.pushSegment(")",{start:o.end,end:o.end});return}a.isCommand&&!this.transformer.buildOptions.keepParentheses?this.pushSegment(" ",{start:o.start,end:o.start}):this.pushSegment("(",{start:o.start,end:o.start});let c=this.lines.length;for(let l=0;l<o.arguments.length;l++){let h=o.arguments[l];this.process(h),l!==o.arguments.length-1&&this.pushSegment(", ",h)}a.isCommand&&!this.transformer.buildOptions.keepParentheses||this.pushSegment(")",{start:o.end,end:o.end})},StringLiteral:function(o,a){this.pushSegment((0,df.getLiteralRawValue)(o),{start:o.end,end:o.end})},SliceExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.left),this.pushSegment(" : ",o),this.process(o.right),this.pushSegment("]",o)},IndexExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.index),this.pushSegment("]",o)},UnaryExpression:function(o,a){o.operator==="new"?this.pushSegment(o.operator+" ",o):this.pushSegment(o.operator,o),this.process(o.argument)},NegationExpression:function(o,a){this.pushSegment("not ",o),this.process(o.argument)},FeatureEnvarExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${o.name}`,o);return}let u=this.transformer.environmentVariables.get(o.name);if(!u){this.pushSegment("null",o);return}this.pushSegment(`"${u}"`,o)},IfShortcutStatement:function(o,a){for(let u=0;u<o.clauses.length;u++){let c=o.clauses[u];this.process(c),u!==o.clauses.length-1&&this.pushSegment(" ",o)}},IfShortcutClause:function(o,a){this.pushSegment("if ",o),this.process((0,Or.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseifShortcutClause:function(o,a){this.pushSegment("else if ",o),this.process((0,Or.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseShortcutClause:function(o,a){this.pushSegment("else ",o),this.process(o.body[0])},NilLiteral:function(o,a){this.pushSegment((0,df.getLiteralRawValue)(o),o)},ForGenericStatement:function(o,a){this.pushSegment("for ",{start:o.start,end:o.start}),this.process((0,Or.unwrap)(o.variable)),this.pushSegment(" in ",{start:o.start,end:o.start}),this.process((0,Or.unwrap)(o.iterator)),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end for",{start:o.end,end:o.end})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.pushSegment(this.context.getIndent()+"end if",{start:o.end,end:o.end})},IfClause:function(o,a){this.pushSegment("if ",{start:o.start,end:o.start}),this.process((0,Or.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.pushSegment(this.context.getIndent()+"else if ",{start:o.start,end:o.start}),this.process((0,Or.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.pushSegment(this.context.getIndent()+"else",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.pushSegment("continue",o)},BreakStatement:function(o,a){this.pushSegment("break",o)},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${o.path}";`,o);return}if(this.currentDependency===null){this.pushSegment(`#inject "${o.path}";`,o);return}let u=this.currentDependency.injections.get(o.path);if(u==null){this.pushSegment("null",o);return}this.pushSegment(`"${u.replace(/"/g,()=>'""')}"`,o)},FeatureImportExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}if(!o.chunk){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}this.process(o.name),this.pushSegment(' = __REQUIRE("'+o.namespace+'")',o)},FeatureIncludeExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${o.path}";`,o);return}if(!o.chunk){this.pushSegment(`#include "${o.path}";`,o);return}this.process(o.chunk)},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger",o);return}this.pushSegment("//debugger",o)},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line",o);return}this.pushSegment(`${o.start.line}`,o)},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename",o);return}this.pushSegment(`"${(0,k2.basename)(o.filename).replace(/"/g,()=>'"')}"`,o)},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("[]",o);return}if(o.fields.length===1){this.pushSegment("[ ",o),this.process(o.fields[0]),this.pushSegment(" ]",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("[",{start:o.start,end:o.start}),this.eol();let u=new ff.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===ff.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"]",{start:o.end,end:o.end});return}this.pushSegment("[ ",o);for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.pushSegment(" ]",o)},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.pushSegment((0,df.getLiteralRawValue)(o),o)},EmptyExpression:function(o,a){this.pushSegment("",o)},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,Or.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.pushSegment(" "+o.operator+" ",o),this.eol(),this.pushSegment(this.context.getIndent(),o),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.pushSegment("bitOr(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="&"){this.pushSegment("bitAnd(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="<<"||o.operator===">>"||o.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(o.left),this.pushSegment(" "+o.operator+" ",o),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.pushSegment(o.operator,o),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.pushSegment(" "+o.operators[u]+" ",o),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.pushStack(o),this.context.buildBlock(o),this.context.popStack()}};let{keepParentheses:n=!1,indentation:r=bO.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new bO.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}createLine(){return{segments:[],comments:[]}}pushSegment(e,n){this._activeLine.segments.push(e),n!=null&&this.pushComment(n.start.line)}pushComment(e){let n=this.context.getCurrentChunk(),r=this.context.getChunkContext(n),i=r.commentBuckets.get(e);i&&(this._activeLine.comments.push(...i),r.commentBuckets.delete(e))}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>{let i=r.segments.join(""),s=i.trim();if(r.comments.length===0)return s.length===0?"":i;let o=r.comments.filter(l=>l.isBefore),a=o.map(Or.commentToText).join(""),u=r.comments.filter(l=>!l.isBefore),c=u.map(Or.commentToText).join("");return s.length===0&&o.length===0&&u.length===0?"":(s.length>0&&o.length>0&&(i=" "+i),s.length>0&&u.length>0&&(i=i+" "),a+i+c)}).join(`
|
117
|
+
`)}generateOptimizations(){return[]}};pf.BeautifyFactory=Gv});var Vv=m(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.DefaultFactory=void 0;var O2=require("path"),gf=fa(),R2=Gu(),Kv=class extends R2.Factory{constructor(){super(...arguments),this.handlers={ParenthesisExpression:function(e,n){this.pushSegment("("),this.process(e.expression),this.pushSegment(")")},Comment:function(e,n){if(e.isMultiline){this.pushSegment(e.value.split(`
|
118
118
|
`).map(r=>`//${r}`).join(`
|
119
|
-
`));return}this.pushSegment("//"+e.value)},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.pushSegment("="),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.pushSegment(e.indexer),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function(");for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.pushSegment(",")}this.pushSegment(")")}this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end function")},MapConstructorExpression:function(e,n){this.pushSegment("{");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(e,n){this.process(e.key),this.pushSegment(":"),this.process(e.value)},Identifier:function(e,n){this.pushSegment(e.name)},ReturnStatement:function(e,n){this.pushSegment("return "),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.pushSegment((0,
|
120
|
-
`)}generateOptimizations(){return[]}};hf.DefaultFactory=Bv});var Uv=m(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.createExpressionString=void 0;var df=Ee();function zu(t){switch(t.type){case df.ASTType.ParenthesisExpression:return zu(t.expression);case df.ASTType.MemberExpression:{let e=t;return`${zu(e.base)}.${zu(e.identifier)}`}case df.ASTType.IndexExpression:return`${zu(t.base)}[]`;case df.ASTType.Identifier:return t.name}}function i2(t){return zu(t)}ff.createExpressionString=i2});var Vu=m(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.merge=void 0;function s2(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}pf.merge=s2});var Gv=m(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.UglifyFactory=void 0;var o2=require("path"),i1=Uv(),Qr=ha(),a2=Vu(),u2=Hu(),Hv=class extends u2.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.pushSegment("("),this.process(i.expression),this.pushSegment(")")},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.pushSegment("="),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.pushSegment(i.indexer);let o=(0,i1.createExpressionString)(i.base);this.process(i.identifier,{usesNativeVar:o==="globals"||o==="locals"||o==="outer",isMember:!0})},FunctionDeclaration:function(i,s){if(i.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function("),this.isWithinArgument=!0;for(let o=0;o<i.parameters.length;o++){let a=i.parameters[o];this.process(a),o!==i.parameters.length-1&&this.pushSegment(",")}this.isWithinArgument=!1,this.pushSegment(")")}this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end function")},MapConstructorExpression:function(i,s){this.pushSegment("{");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(i,s){this.process(i.key),this.pushSegment(":"),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.pushSegment(o);return}if(s.isMember&&s.usesNativeVar?o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o:s.isMember||(o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o),s.isForVariable&&i.name!==o){let a=`__${i.name}_idx`,u=`__${o}_idx`;this.forIdxMapping.set(a,u)}this.pushSegment(o)},ReturnStatement:function(i,s){this.pushSegment("return "),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Qr.getLiteralValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Qr.getLiteralValue)(i))},WhileStatement:function(i,s){this.pushSegment("while "),this.process(i.condition),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end while")},CallExpression:function(i,s){let o=(0,i1.createExpressionString)(i.base),a=o==="globals.hasIndex"||o==="locals.hasIndex"||o==="outer.hasIndex",u;if(this.process(i.base),a){if(u=i.arguments[0],u.type==="StringLiteral"){let c=(0,Qr.getLiteralValue)(u),l=this.transformer.context.variables.get(c);this.pushSegment('("'+(l??c)+'")');return}this.pushSegment("("),this.process(u),this.pushSegment(")");return}if(i.arguments.length!==0){this.pushSegment("(");for(let c=0;c<i.arguments.length;c++){let l=i.arguments[c];this.process(l),c!==i.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Qr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Qr.getLiteralRawValue)(i))},SliceExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.left),this.pushSegment(":"),this.process(i.right),this.pushSegment("]")},IndexExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.index),this.pushSegment("]")},UnaryExpression:function(i,s){i.operator==="new"?this.pushSegment(i.operator+" "):this.pushSegment(i.operator),this.process(i.argument)},NegationExpression:function(i,s){this.pushSegment(i.operator+" "),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${i.name}`);return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.pushSegment("null");return}this.pushSegment(`"${o}"`)},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${i.start.line}`)},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,o2.basename)(i.filename).replace(/"/g,()=>'"')}"`)},IfShortcutStatement:function(i,s){for(let o=0;o<i.clauses.length;o++){let a=i.clauses[o];this.process(a),o!==i.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then "),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.pushSegment(" else if "),this.process(i.condition),this.pushSegment(" then"),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.pushSegment("else "),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Qr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Qr.getLiteralRawValue)(i))},ForGenericStatement:function(i,s){this.pushSegment("for "),this.process(i.variable,{isForVariable:!0}),this.pushSegment(" in "),this.process(i.iterator),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end for")},IfStatement:function(i,s){for(let o of i.clauses)this.process(o);this.pushSegment("end if")},IfClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseifClause:function(i,s){this.pushSegment("else if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseClause:function(i,s){this.pushSegment("else"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ContinueStatement:function(i,s){this.pushSegment("continue")},BreakStatement:function(i,s){this.pushSegment("break")},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${i.path}"`);return}if(this.currentDependency===null){this.pushSegment(`#inject "${i.path}";`);return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.pushSegment("null");return}this.pushSegment(`"${o.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(!i.chunk){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(this.process(i.name),this.disableNamespacesOptimization){this.pushSegment(`=__REQUIRE("${i.namespace}")`);return}let o=this.transformer.context.variables.get("__REQUIRE");this.pushSegment(`=${o}("${i.namespace}")`)},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${i.path}";`);return}if(!i.chunk){this.pushSegment(`#include "${i.path}";`);return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.pushSegment("[");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Qr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Qr.getLiteralRawValue)(i))},EmptyExpression:function(i,s){this.pushSegment("")},IsaExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.pushSegment("bitOr("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="&"){this.pushSegment("bitAnd("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.pushSegment(i.operator),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.pushSegment(i.operator),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.pushSegment(i.operators[o]),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()}},this.disableLiteralsOptimization=(n=e.buildOptions.disableLiteralsOptimization)!==null&&n!==void 0?n:!1,this.disableNamespacesOptimization=(r=e.buildOptions.disableNamespacesOptimization)!==null&&r!==void 0?r:!1,this.forIdxMapping=new Map,this.isWithinArgument=!1}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
|
121
|
-
`)}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];if((!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0){let s=n.map(o=>`${r}.${o.namespace}=${(0,Qr.getLiteralRawValue)(o.literal)}`);(0,a2.merge)(i,s)}return i}};gf.UglifyFactory=Hv});var mf=m(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.getFactory=Ys.BuildType=void 0;var c2=$v(),l2=Wv(),h2=Gv(),Ku;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Ku=Ys.BuildType||(Ys.BuildType={}));var d2={[Ku.DEFAULT]:l2.DefaultFactory,[Ku.UGLIFY]:h2.UglifyFactory,[Ku.BEAUTIFY]:c2.BeautifyFactory};function f2(t=Ku.DEFAULT){let e=d2[t];if(!e)throw new Error("Unknown build type.");return e}Ys.getFactory=f2});var zv=m((s1,yf)=>{(function(t){"use strict";function e(v,L){var R=(v&65535)+(L&65535),B=(v>>16)+(L>>16)+(R>>16);return B<<16|R&65535}function n(v,L){return v<<L|v>>>32-L}function r(v,L,R,B,ee,re){return e(n(e(e(L,v),e(B,re)),ee),R)}function i(v,L,R,B,ee,re,W){return r(L&R|~L&B,v,L,ee,re,W)}function s(v,L,R,B,ee,re,W){return r(L&B|R&~B,v,L,ee,re,W)}function o(v,L,R,B,ee,re,W){return r(L^R^B,v,L,ee,re,W)}function a(v,L,R,B,ee,re,W){return r(R^(L|~B),v,L,ee,re,W)}function u(v,L){v[L>>5]|=128<<L%32,v[(L+64>>>9<<4)+14]=L;var R,B,ee,re,W,O=1732584193,M=-271733879,N=-1732584194,j=271733878;for(R=0;R<v.length;R+=16)B=O,ee=M,re=N,W=j,O=i(O,M,N,j,v[R],7,-680876936),j=i(j,O,M,N,v[R+1],12,-389564586),N=i(N,j,O,M,v[R+2],17,606105819),M=i(M,N,j,O,v[R+3],22,-1044525330),O=i(O,M,N,j,v[R+4],7,-176418897),j=i(j,O,M,N,v[R+5],12,1200080426),N=i(N,j,O,M,v[R+6],17,-1473231341),M=i(M,N,j,O,v[R+7],22,-45705983),O=i(O,M,N,j,v[R+8],7,1770035416),j=i(j,O,M,N,v[R+9],12,-1958414417),N=i(N,j,O,M,v[R+10],17,-42063),M=i(M,N,j,O,v[R+11],22,-1990404162),O=i(O,M,N,j,v[R+12],7,1804603682),j=i(j,O,M,N,v[R+13],12,-40341101),N=i(N,j,O,M,v[R+14],17,-1502002290),M=i(M,N,j,O,v[R+15],22,1236535329),O=s(O,M,N,j,v[R+1],5,-165796510),j=s(j,O,M,N,v[R+6],9,-1069501632),N=s(N,j,O,M,v[R+11],14,643717713),M=s(M,N,j,O,v[R],20,-373897302),O=s(O,M,N,j,v[R+5],5,-701558691),j=s(j,O,M,N,v[R+10],9,38016083),N=s(N,j,O,M,v[R+15],14,-660478335),M=s(M,N,j,O,v[R+4],20,-405537848),O=s(O,M,N,j,v[R+9],5,568446438),j=s(j,O,M,N,v[R+14],9,-1019803690),N=s(N,j,O,M,v[R+3],14,-187363961),M=s(M,N,j,O,v[R+8],20,1163531501),O=s(O,M,N,j,v[R+13],5,-1444681467),j=s(j,O,M,N,v[R+2],9,-51403784),N=s(N,j,O,M,v[R+7],14,1735328473),M=s(M,N,j,O,v[R+12],20,-1926607734),O=o(O,M,N,j,v[R+5],4,-378558),j=o(j,O,M,N,v[R+8],11,-2022574463),N=o(N,j,O,M,v[R+11],16,1839030562),M=o(M,N,j,O,v[R+14],23,-35309556),O=o(O,M,N,j,v[R+1],4,-1530992060),j=o(j,O,M,N,v[R+4],11,1272893353),N=o(N,j,O,M,v[R+7],16,-155497632),M=o(M,N,j,O,v[R+10],23,-1094730640),O=o(O,M,N,j,v[R+13],4,681279174),j=o(j,O,M,N,v[R],11,-358537222),N=o(N,j,O,M,v[R+3],16,-722521979),M=o(M,N,j,O,v[R+6],23,76029189),O=o(O,M,N,j,v[R+9],4,-640364487),j=o(j,O,M,N,v[R+12],11,-421815835),N=o(N,j,O,M,v[R+15],16,530742520),M=o(M,N,j,O,v[R+2],23,-995338651),O=a(O,M,N,j,v[R],6,-198630844),j=a(j,O,M,N,v[R+7],10,1126891415),N=a(N,j,O,M,v[R+14],15,-1416354905),M=a(M,N,j,O,v[R+5],21,-57434055),O=a(O,M,N,j,v[R+12],6,1700485571),j=a(j,O,M,N,v[R+3],10,-1894986606),N=a(N,j,O,M,v[R+10],15,-1051523),M=a(M,N,j,O,v[R+1],21,-2054922799),O=a(O,M,N,j,v[R+8],6,1873313359),j=a(j,O,M,N,v[R+15],10,-30611744),N=a(N,j,O,M,v[R+6],15,-1560198380),M=a(M,N,j,O,v[R+13],21,1309151649),O=a(O,M,N,j,v[R+4],6,-145523070),j=a(j,O,M,N,v[R+11],10,-1120210379),N=a(N,j,O,M,v[R+2],15,718787259),M=a(M,N,j,O,v[R+9],21,-343485551),O=e(O,B),M=e(M,ee),N=e(N,re),j=e(j,W);return[O,M,N,j]}function c(v){var L,R="",B=v.length*32;for(L=0;L<B;L+=8)R+=String.fromCharCode(v[L>>5]>>>L%32&255);return R}function l(v){var L,R=[];for(R[(v.length>>2)-1]=void 0,L=0;L<R.length;L+=1)R[L]=0;var B=v.length*8;for(L=0;L<B;L+=8)R[L>>5]|=(v.charCodeAt(L/8)&255)<<L%32;return R}function h(v){return c(u(l(v),v.length*8))}function d(v,L){var R,B=l(v),ee=[],re=[],W;for(ee[15]=re[15]=void 0,B.length>16&&(B=u(B,v.length*8)),R=0;R<16;R+=1)ee[R]=B[R]^909522486,re[R]=B[R]^1549556828;return W=u(ee.concat(l(L)),512+L.length*8),c(u(re.concat(W),640))}function g(v){var L="0123456789abcdef",R="",B,ee;for(ee=0;ee<v.length;ee+=1)B=v.charCodeAt(ee),R+=L.charAt(B>>>4&15)+L.charAt(B&15);return R}function y(v){return unescape(encodeURIComponent(v))}function b(v){return h(y(v))}function C(v){return g(b(v))}function A(v,L){return d(y(v),y(L))}function w(v,L){return g(A(v,L))}function T(v,L,R){return L?R?A(L,v):w(L,v):R?b(v):C(v)}typeof define=="function"&&define.amd?define(function(){return T}):typeof yf=="object"&&yf.exports?yf.exports=T:t.md5=T})(s1)});var Kv=m(da=>{"use strict";var p2=da&&da.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(da,"__esModule",{value:!0});da.LiteralsMapper=void 0;var g2=p2(zv()),o1=ha(),Vv=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=(0,o1.getLiteralRawValue)(e);if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,g2.default)(r)))}return n}get(e){let n=this,r=(0,o1.getLiteralRawValue)(e);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};da.LiteralsMapper=Vv});var Yv=m(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.NamespaceGenerator=void 0;var Xv=class{constructor(e){let n=this;n.buffer=[0],n.mapping=new Map,n.rmapping=new Map,n.forbidden=e.forbidden||[],n.characters=e.characters||null,n.defaultNamespaces=e.defaultNamespaces||[];for(let r of n.defaultNamespaces)n.createNamespace(r)}exclude(e){let n=this;return Array.isArray(e)?n.forbidden=n.forbidden.concat(e):n.forbidden.push(e),n}setCharset(e){let n=this;return n.characters=e,n}reset(){let e=this;return e.buffer=[0],e.mapping=new Map,e.rmapping=new Map,e}get(e){let n=this.mapping;return n.has(e)?n.get(e):null}increaseBuffer(e){let n=this,r=n.buffer,i=n.characters.length;e==null&&(e=r.length-1);let s=r[e];return s=s+1,r[e]=s,s===i&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,i=e.forbidden,s="",o=0,a;for(;o<n.length;)a=n[o],s=s+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return i.indexOf(s)!==-1||e.mapping.has(s)?e.generateNamespace():s}createNamespace(e,n=!1){let r=this,i=r.mapping,s=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(i.has(e)&&!n)return i.get(e);let a=r.generateNamespace();if(i.set(e,a),s.set(a,e),s.has(e)){let u=s.get(e);s.delete(e),a=r.createNamespace(u,!0)}return a}};bf.NamespaceGenerator=Xv});var Xu=m(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.Context=Js.ContextDataProperty=void 0;var m2=Ee(),y2=Kv(),a1=Yv(),b2;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(b2=Js.ContextDataProperty||(Js.ContextDataProperty={}));var Jv=class{constructor(e){let n=this;n.modules=new a1.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new a1.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...Object.values(m2.Keyword),...e.variablesExcluded||[]]}),n.literals=new y2.LiteralsMapper(n.variables),n.data=new Map}createModuleNamespace(e){return this.modules.createNamespace(e)}getOrCreateData(e,n){let r=this;if(r.data.has(e))return r.data.get(e);let i=n();return r.data.set(e,i),i}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};Js.Context=Jv});var Qv=m(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.DependencyType=void 0;var _2;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(_2=Yu.DependencyType||(Yu.DependencyType={}))});var vf=m(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.BuildError=void 0;var Zv=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};_f.BuildError=Zv});var Tf=m(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.fetchNamespaces=void 0;var eS=Ee();function u1(t){if(t.type===eS.ASTType.MemberExpression){let e=t;return e.identifier.type===eS.ASTType.Identifier?e.identifier.name:null}else if(t.type===eS.ASTType.Identifier)return t.name;return null}function v2(t){let e=new Set(t.namespaces.map(u1).filter(n=>n!==null));return t.scopes.reduce((n,r)=>(r.namespaces.map(u1).filter(s=>s!==null).forEach(s=>e.add(s)),n),e),Array.from(e)}Sf.fetchNamespaces=v2});var iS=m(ns=>{"use strict";var tS=ns&&ns.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},f1=ns&&ns.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ns,"__esModule",{value:!0});ns.Dependency=void 0;var c1=f1(zv()),S2=f1(require("events")),l1=Yr(),wf=Xu(),nS=Qv(),h1=vf(),T2=Tf(),d1=Vu(),rS=class t extends S2.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,c1.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||nS.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(wf.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(wf.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return tS(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(wf.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,c1.default)(c),h=o.get(l);if(a.has(h))return a.get(h);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let d=yield u.get(c);i.emit("parse-before",c);try{let y=new l1.Parser(d,{filename:c}).parseChunk(),b=new t({target:c,resourceHandler:u,chunk:y,type:n,context:s,ref:r});return i.emit("parse-after",b),b}catch(g){throw g instanceof h1.BuildError?g:new h1.BuildError(g.message,{target:c,range:g.range})}})}findInjections(){return tS(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=yield e.resourceHandler.getTargetRelativeTo(e.target,i.path);if(!(yield e.resourceHandler.has(s)))throw new Error("Injection "+s+" does not exist...");let o=yield e.resourceHandler.get(s);r.set(i.path,o)}return e.injections=r,r})}findDependencies(){return tS(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(wf.ContextDataProperty.DependencyCallStack),o=[...(0,T2.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let h of c){let d=h instanceof l1.ASTFeatureIncludeExpression?nS.DependencyType.Include:nS.DependencyType.Import,g=yield e.resolve(h.path,d,h),y=g.getNamespace();if(s.includes(y))throw new Error(`Circular dependency from ${e.target} to ${g.target} detected.`);let b=g.chunk;h.chunk=b,h.namespace=y;let C=yield g.findDependencies();(0,d1.merge)(o,C.namespaces),(0,d1.merge)(a,C.literals),u.push(g)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};ns.Dependency=rS});var xf=m(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.Transformer=void 0;var sS=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};Ef.Transformer=sS});var Cf=m(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.generateCharsetMap=void 0;function Af(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function w2(t=!1){let e=Af(65,90),n=Af(97,122),r=Af(48,57),i="_";return t&&(i=i+Af(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}kf.generateCharsetMap=w2});var aS=m(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.MAIN_BOILERPLATE=rs.MODULE_BOILERPLATE=rs.HEADER_BOILERPLATE=void 0;var oS=Yr();rs.HEADER_BOILERPLATE=new oS.Parser(`MODULES={}
|
119
|
+
`));return}this.pushSegment("//"+e.value)},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.pushSegment("="),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.pushSegment(e.indexer),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function(");for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.pushSegment(",")}this.pushSegment(")")}this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end function")},MapConstructorExpression:function(e,n){this.pushSegment("{");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(e,n){this.process(e.key),this.pushSegment(":"),this.process(e.value)},Identifier:function(e,n){this.pushSegment(e.name)},ReturnStatement:function(e,n){this.pushSegment("return "),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.pushSegment((0,gf.getLiteralValue)(e))},WhileStatement:function(e,n){this.pushSegment("while "),this.process(e.condition),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end while")},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.pushSegment("(");for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(e,n){this.pushSegment((0,gf.getLiteralRawValue)(e))},SliceExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.left),this.pushSegment(":"),this.process(e.right),this.pushSegment("]")},IndexExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.index),this.pushSegment("]")},UnaryExpression:function(e,n){e.operator==="new"?this.pushSegment(e.operator+" "):this.pushSegment(e.operator),this.process(e.argument)},NegationExpression:function(e,n){this.pushSegment(e.operator+" "),this.process(e.argument)},FeatureEnvarExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${e.name}`);return}let r=this.transformer.environmentVariables.get(e.name);if(!r){this.pushSegment("null");return}this.pushSegment(`"${r}"`)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++){let i=e.clauses[r];this.process(i),r!==e.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseifShortcutClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseShortcutClause:function(e,n){this.pushSegment("else "),this.process(e.body[0])},NilLiteral:function(e,n){this.pushSegment((0,gf.getLiteralRawValue)(e))},ForGenericStatement:function(e,n){this.pushSegment("for "),this.process(e.variable),this.pushSegment(" in "),this.process(e.iterator),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end for")},IfStatement:function(e,n){for(let r of e.clauses)this.process(r);this.pushSegment("end if")},IfClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseifClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseClause:function(e,n){this.pushSegment("else"),this.eol();for(let r of e.body)this.process(r),this.eol()},ContinueStatement:function(e,n){this.pushSegment("continue")},BreakStatement:function(e,n){this.pushSegment("break")},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${e.path}"`);return}if(this.currentDependency===null){this.pushSegment(`#inject "${e.path}";`);return}let r=this.currentDependency.injections.get(e.path);if(r==null){this.pushSegment("null");return}this.pushSegment(`"${r.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}if(!e.chunk){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}this.process(e.name),this.pushSegment(' = __REQUIRE("'+e.namespace+'")')},FeatureIncludeExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${e.path}";`);return}if(!e.chunk){this.pushSegment(`#include "${e.path}";`);return}this.process(e.chunk)},FeatureDebuggerExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${e.start.line}`)},FeatureFileExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,O2.basename)(e.filename).replace(/"/g,()=>'"')}"`)},ListConstructorExpression:function(e,n){this.pushSegment("[");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(e,n){this.process(e.value)},BooleanLiteral:function(e,n){this.pushSegment((0,gf.getLiteralRawValue)(e))},EmptyExpression:function(e,n){this.pushSegment("")},IsaExpression:function(e,n){this.process(e.left),this.pushSegment(" "+e.operator+" "),this.process(e.right)},LogicalExpression:function(e,n){this.process(e.left),this.pushSegment(" "+e.operator+" "),this.process(e.right)},BinaryExpression:function(e,n){if(e.operator==="|"){this.pushSegment("bitOr("),this.process(e.left),this.pushSegment(","),this.process(e.right),this.pushSegment(")");return}else if(e.operator==="&"){this.pushSegment("bitAnd("),this.process(e.left),this.pushSegment(","),this.process(e.right),this.pushSegment(")");return}else if(e.operator==="<<"||e.operator===">>"||e.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(e.left),this.pushSegment(e.operator),this.process(e.right)},BinaryNegatedExpression:function(e,n){this.pushSegment(e.operator),this.process(e.argument)},ComparisonGroupExpression:function(e,n){this.process(e.expressions[0]);for(let r=0;r<e.operators.length;r++)this.pushSegment(e.operators[r]),this.process(e.expressions[r+1])},Chunk:function(e,n){for(let r of e.body)this.process(r),this.eol()}}}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
|
120
|
+
`)}generateOptimizations(){return[]}};mf.DefaultFactory=Kv});var Xv=m(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.createExpressionString=void 0;var yf=Ee();function Ku(t){switch(t.type){case yf.ASTType.ParenthesisExpression:return Ku(t.expression);case yf.ASTType.MemberExpression:{let e=t;return`${Ku(e.base)}.${Ku(e.identifier)}`}case yf.ASTType.IndexExpression:return`${Ku(t.base)}[]`;case yf.ASTType.Identifier:return t.name}}function D2(t){return Ku(t)}bf.createExpressionString=D2});var Vu=m(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.merge=void 0;function P2(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}_f.merge=P2});var Jv=m(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.UglifyFactory=void 0;var I2=require("path"),_O=Xv(),ei=fa(),M2=Vu(),L2=Gu(),Yv=class extends L2.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.pushSegment("("),this.process(i.expression),this.pushSegment(")")},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.pushSegment("="),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.pushSegment(i.indexer);let o=(0,_O.createExpressionString)(i.base);this.process(i.identifier,{usesNativeVar:o==="globals"||o==="locals"||o==="outer",isMember:!0})},FunctionDeclaration:function(i,s){if(i.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function("),this.isWithinArgument=!0;for(let o=0;o<i.parameters.length;o++){let a=i.parameters[o];this.process(a),o!==i.parameters.length-1&&this.pushSegment(",")}this.isWithinArgument=!1,this.pushSegment(")")}this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end function")},MapConstructorExpression:function(i,s){this.pushSegment("{");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(i,s){this.process(i.key),this.pushSegment(":"),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.pushSegment(o);return}if(s.isMember&&s.usesNativeVar?o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o:s.isMember||(o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o),s.isForVariable&&i.name!==o){let a=`__${i.name}_idx`,u=`__${o}_idx`;this.forIdxMapping.set(a,u)}this.pushSegment(o)},ReturnStatement:function(i,s){this.pushSegment("return "),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,ei.getLiteralValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,ei.getLiteralValue)(i))},WhileStatement:function(i,s){this.pushSegment("while "),this.process(i.condition),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end while")},CallExpression:function(i,s){let o=(0,_O.createExpressionString)(i.base),a=o==="globals.hasIndex"||o==="locals.hasIndex"||o==="outer.hasIndex",u;if(this.process(i.base),a){if(u=i.arguments[0],u.type==="StringLiteral"){let c=(0,ei.getLiteralValue)(u),l=this.transformer.context.variables.get(c);this.pushSegment('("'+(l??c)+'")');return}this.pushSegment("("),this.process(u),this.pushSegment(")");return}if(i.arguments.length!==0){this.pushSegment("(");for(let c=0;c<i.arguments.length;c++){let l=i.arguments[c];this.process(l),c!==i.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,ei.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,ei.getLiteralRawValue)(i))},SliceExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.left),this.pushSegment(":"),this.process(i.right),this.pushSegment("]")},IndexExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.index),this.pushSegment("]")},UnaryExpression:function(i,s){i.operator==="new"?this.pushSegment(i.operator+" "):this.pushSegment(i.operator),this.process(i.argument)},NegationExpression:function(i,s){this.pushSegment(i.operator+" "),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${i.name}`);return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.pushSegment("null");return}this.pushSegment(`"${o}"`)},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${i.start.line}`)},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,I2.basename)(i.filename).replace(/"/g,()=>'"')}"`)},IfShortcutStatement:function(i,s){for(let o=0;o<i.clauses.length;o++){let a=i.clauses[o];this.process(a),o!==i.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then "),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.pushSegment(" else if "),this.process(i.condition),this.pushSegment(" then"),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.pushSegment("else "),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,ei.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,ei.getLiteralRawValue)(i))},ForGenericStatement:function(i,s){this.pushSegment("for "),this.process(i.variable,{isForVariable:!0}),this.pushSegment(" in "),this.process(i.iterator),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end for")},IfStatement:function(i,s){for(let o of i.clauses)this.process(o);this.pushSegment("end if")},IfClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseifClause:function(i,s){this.pushSegment("else if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseClause:function(i,s){this.pushSegment("else"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ContinueStatement:function(i,s){this.pushSegment("continue")},BreakStatement:function(i,s){this.pushSegment("break")},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${i.path}"`);return}if(this.currentDependency===null){this.pushSegment(`#inject "${i.path}";`);return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.pushSegment("null");return}this.pushSegment(`"${o.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(!i.chunk){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(this.process(i.name),this.disableNamespacesOptimization){this.pushSegment(`=__REQUIRE("${i.namespace}")`);return}let o=this.transformer.context.variables.get("__REQUIRE");this.pushSegment(`=${o}("${i.namespace}")`)},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${i.path}";`);return}if(!i.chunk){this.pushSegment(`#include "${i.path}";`);return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.pushSegment("[");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,ei.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,ei.getLiteralRawValue)(i))},EmptyExpression:function(i,s){this.pushSegment("")},IsaExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.pushSegment("bitOr("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="&"){this.pushSegment("bitAnd("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.pushSegment(i.operator),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.pushSegment(i.operator),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.pushSegment(i.operators[o]),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()}},this.disableLiteralsOptimization=(n=e.buildOptions.disableLiteralsOptimization)!==null&&n!==void 0?n:!1,this.disableNamespacesOptimization=(r=e.buildOptions.disableNamespacesOptimization)!==null&&r!==void 0?r:!1,this.forIdxMapping=new Map,this.isWithinArgument=!1}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
|
121
|
+
`)}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];if((!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0){let s=n.map(o=>`${r}.${o.namespace}=${(0,ei.getLiteralRawValue)(o.literal)}`);(0,M2.merge)(i,s)}return i}};vf.UglifyFactory=Yv});var Sf=m(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.getFactory=Qs.BuildType=void 0;var N2=zv(),q2=Vv(),j2=Jv(),Xu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Xu=Qs.BuildType||(Qs.BuildType={}));var F2={[Xu.DEFAULT]:q2.DefaultFactory,[Xu.UGLIFY]:j2.UglifyFactory,[Xu.BEAUTIFY]:N2.BeautifyFactory};function $2(t=Xu.DEFAULT){let e=F2[t];if(!e)throw new Error("Unknown build type.");return e}Qs.getFactory=$2});var Qv=m((vO,Tf)=>{(function(t){"use strict";function e(v,L){var R=(v&65535)+(L&65535),B=(v>>16)+(L>>16)+(R>>16);return B<<16|R&65535}function n(v,L){return v<<L|v>>>32-L}function r(v,L,R,B,ee,ie){return e(n(e(e(L,v),e(B,ie)),ee),R)}function i(v,L,R,B,ee,ie,W){return r(L&R|~L&B,v,L,ee,ie,W)}function s(v,L,R,B,ee,ie,W){return r(L&B|R&~B,v,L,ee,ie,W)}function o(v,L,R,B,ee,ie,W){return r(L^R^B,v,L,ee,ie,W)}function a(v,L,R,B,ee,ie,W){return r(R^(L|~B),v,L,ee,ie,W)}function u(v,L){v[L>>5]|=128<<L%32,v[(L+64>>>9<<4)+14]=L;var R,B,ee,ie,W,O=1732584193,M=-271733879,N=-1732584194,j=271733878;for(R=0;R<v.length;R+=16)B=O,ee=M,ie=N,W=j,O=i(O,M,N,j,v[R],7,-680876936),j=i(j,O,M,N,v[R+1],12,-389564586),N=i(N,j,O,M,v[R+2],17,606105819),M=i(M,N,j,O,v[R+3],22,-1044525330),O=i(O,M,N,j,v[R+4],7,-176418897),j=i(j,O,M,N,v[R+5],12,1200080426),N=i(N,j,O,M,v[R+6],17,-1473231341),M=i(M,N,j,O,v[R+7],22,-45705983),O=i(O,M,N,j,v[R+8],7,1770035416),j=i(j,O,M,N,v[R+9],12,-1958414417),N=i(N,j,O,M,v[R+10],17,-42063),M=i(M,N,j,O,v[R+11],22,-1990404162),O=i(O,M,N,j,v[R+12],7,1804603682),j=i(j,O,M,N,v[R+13],12,-40341101),N=i(N,j,O,M,v[R+14],17,-1502002290),M=i(M,N,j,O,v[R+15],22,1236535329),O=s(O,M,N,j,v[R+1],5,-165796510),j=s(j,O,M,N,v[R+6],9,-1069501632),N=s(N,j,O,M,v[R+11],14,643717713),M=s(M,N,j,O,v[R],20,-373897302),O=s(O,M,N,j,v[R+5],5,-701558691),j=s(j,O,M,N,v[R+10],9,38016083),N=s(N,j,O,M,v[R+15],14,-660478335),M=s(M,N,j,O,v[R+4],20,-405537848),O=s(O,M,N,j,v[R+9],5,568446438),j=s(j,O,M,N,v[R+14],9,-1019803690),N=s(N,j,O,M,v[R+3],14,-187363961),M=s(M,N,j,O,v[R+8],20,1163531501),O=s(O,M,N,j,v[R+13],5,-1444681467),j=s(j,O,M,N,v[R+2],9,-51403784),N=s(N,j,O,M,v[R+7],14,1735328473),M=s(M,N,j,O,v[R+12],20,-1926607734),O=o(O,M,N,j,v[R+5],4,-378558),j=o(j,O,M,N,v[R+8],11,-2022574463),N=o(N,j,O,M,v[R+11],16,1839030562),M=o(M,N,j,O,v[R+14],23,-35309556),O=o(O,M,N,j,v[R+1],4,-1530992060),j=o(j,O,M,N,v[R+4],11,1272893353),N=o(N,j,O,M,v[R+7],16,-155497632),M=o(M,N,j,O,v[R+10],23,-1094730640),O=o(O,M,N,j,v[R+13],4,681279174),j=o(j,O,M,N,v[R],11,-358537222),N=o(N,j,O,M,v[R+3],16,-722521979),M=o(M,N,j,O,v[R+6],23,76029189),O=o(O,M,N,j,v[R+9],4,-640364487),j=o(j,O,M,N,v[R+12],11,-421815835),N=o(N,j,O,M,v[R+15],16,530742520),M=o(M,N,j,O,v[R+2],23,-995338651),O=a(O,M,N,j,v[R],6,-198630844),j=a(j,O,M,N,v[R+7],10,1126891415),N=a(N,j,O,M,v[R+14],15,-1416354905),M=a(M,N,j,O,v[R+5],21,-57434055),O=a(O,M,N,j,v[R+12],6,1700485571),j=a(j,O,M,N,v[R+3],10,-1894986606),N=a(N,j,O,M,v[R+10],15,-1051523),M=a(M,N,j,O,v[R+1],21,-2054922799),O=a(O,M,N,j,v[R+8],6,1873313359),j=a(j,O,M,N,v[R+15],10,-30611744),N=a(N,j,O,M,v[R+6],15,-1560198380),M=a(M,N,j,O,v[R+13],21,1309151649),O=a(O,M,N,j,v[R+4],6,-145523070),j=a(j,O,M,N,v[R+11],10,-1120210379),N=a(N,j,O,M,v[R+2],15,718787259),M=a(M,N,j,O,v[R+9],21,-343485551),O=e(O,B),M=e(M,ee),N=e(N,ie),j=e(j,W);return[O,M,N,j]}function c(v){var L,R="",B=v.length*32;for(L=0;L<B;L+=8)R+=String.fromCharCode(v[L>>5]>>>L%32&255);return R}function l(v){var L,R=[];for(R[(v.length>>2)-1]=void 0,L=0;L<R.length;L+=1)R[L]=0;var B=v.length*8;for(L=0;L<B;L+=8)R[L>>5]|=(v.charCodeAt(L/8)&255)<<L%32;return R}function h(v){return c(u(l(v),v.length*8))}function d(v,L){var R,B=l(v),ee=[],ie=[],W;for(ee[15]=ie[15]=void 0,B.length>16&&(B=u(B,v.length*8)),R=0;R<16;R+=1)ee[R]=B[R]^909522486,ie[R]=B[R]^1549556828;return W=u(ee.concat(l(L)),512+L.length*8),c(u(ie.concat(W),640))}function g(v){var L="0123456789abcdef",R="",B,ee;for(ee=0;ee<v.length;ee+=1)B=v.charCodeAt(ee),R+=L.charAt(B>>>4&15)+L.charAt(B&15);return R}function _(v){return unescape(encodeURIComponent(v))}function b(v){return h(_(v))}function C(v){return g(b(v))}function A(v,L){return d(_(v),_(L))}function w(v,L){return g(A(v,L))}function T(v,L,R){return L?R?A(L,v):w(L,v):R?b(v):C(v)}typeof define=="function"&&define.amd?define(function(){return T}):typeof Tf=="object"&&Tf.exports?Tf.exports=T:t.md5=T})(vO)});var eS=m(pa=>{"use strict";var B2=pa&&pa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pa,"__esModule",{value:!0});pa.LiteralsMapper=void 0;var W2=B2(Qv()),SO=fa(),Zv=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=(0,SO.getLiteralRawValue)(e);if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,W2.default)(r)))}return n}get(e){let n=this,r=(0,SO.getLiteralRawValue)(e);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};pa.LiteralsMapper=Zv});var nS=m(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.NamespaceGenerator=void 0;var tS=class{constructor(e){let n=this;n.buffer=[0],n.mapping=new Map,n.rmapping=new Map,n.forbidden=e.forbidden||[],n.characters=e.characters||null,n.defaultNamespaces=e.defaultNamespaces||[];for(let r of n.defaultNamespaces)n.createNamespace(r)}exclude(e){let n=this;return Array.isArray(e)?n.forbidden=n.forbidden.concat(e):n.forbidden.push(e),n}setCharset(e){let n=this;return n.characters=e,n}reset(){let e=this;return e.buffer=[0],e.mapping=new Map,e.rmapping=new Map,e}get(e){let n=this.mapping;return n.has(e)?n.get(e):null}increaseBuffer(e){let n=this,r=n.buffer,i=n.characters.length;e==null&&(e=r.length-1);let s=r[e];return s=s+1,r[e]=s,s===i&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,i=e.forbidden,s="",o=0,a;for(;o<n.length;)a=n[o],s=s+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return i.indexOf(s)!==-1||e.mapping.has(s)?e.generateNamespace():s}createNamespace(e,n=!1){let r=this,i=r.mapping,s=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(i.has(e)&&!n)return i.get(e);let a=r.generateNamespace();if(i.set(e,a),s.set(a,e),s.has(e)){let u=s.get(e);s.delete(e),a=r.createNamespace(u,!0)}return a}};wf.NamespaceGenerator=tS});var Yu=m(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.Context=Zs.ContextDataProperty=void 0;var U2=Ee(),H2=eS(),TO=nS(),G2;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(G2=Zs.ContextDataProperty||(Zs.ContextDataProperty={}));var rS=class{constructor(e){let n=this;n.modules=new TO.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new TO.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...Object.values(U2.Keyword),...e.variablesExcluded||[]]}),n.literals=new H2.LiteralsMapper(n.variables),n.data=new Map}createModuleNamespace(e){return this.modules.createNamespace(e)}getOrCreateData(e,n){let r=this;if(r.data.has(e))return r.data.get(e);let i=n();return r.data.set(e,i),i}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};Zs.Context=rS});var iS=m(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.DependencyType=void 0;var z2;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(z2=Ju.DependencyType||(Ju.DependencyType={}))});var xf=m(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.BuildError=void 0;var sS=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Ef.BuildError=sS});var kf=m(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.fetchNamespaces=void 0;var oS=Ee();function wO(t){if(t.type===oS.ASTType.MemberExpression){let e=t;return e.identifier.type===oS.ASTType.Identifier?e.identifier.name:null}else if(t.type===oS.ASTType.Identifier)return t.name;return null}function K2(t){let e=new Set(t.namespaces.map(wO).filter(n=>n!==null));return t.scopes.reduce((n,r)=>(r.namespaces.map(wO).filter(s=>s!==null).forEach(s=>e.add(s)),n),e),Array.from(e)}Af.fetchNamespaces=K2});var lS=m(is=>{"use strict";var aS=is&&is.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},CO=is&&is.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(is,"__esModule",{value:!0});is.Dependency=void 0;var EO=CO(Qv()),V2=CO(require("events")),xO=Qr(),Cf=Yu(),uS=iS(),AO=xf(),X2=kf(),kO=Vu(),cS=class t extends V2.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,EO.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||uS.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(Cf.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(Cf.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return aS(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(Cf.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,EO.default)(c),h=o.get(l);if(a.has(h))return a.get(h);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let d=yield u.get(c);i.emit("parse-before",c);try{let _=new xO.Parser(d,{filename:c}).parseChunk(),b=new t({target:c,resourceHandler:u,chunk:_,type:n,context:s,ref:r});return i.emit("parse-after",b),b}catch(g){throw g instanceof AO.BuildError?g:new AO.BuildError(g.message,{target:c,range:g.range})}})}findInjections(){return aS(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=yield e.resourceHandler.getTargetRelativeTo(e.target,i.path);if(!(yield e.resourceHandler.has(s)))throw new Error("Injection "+s+" does not exist...");let o=yield e.resourceHandler.get(s);r.set(i.path,o)}return e.injections=r,r})}findDependencies(){return aS(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(Cf.ContextDataProperty.DependencyCallStack),o=[...(0,X2.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let h of c){let d=h instanceof xO.ASTFeatureIncludeExpression?uS.DependencyType.Include:uS.DependencyType.Import,g=yield e.resolve(h.path,d,h),_=g.getNamespace();if(s.includes(_))throw new Error(`Circular dependency from ${e.target} to ${g.target} detected.`);let b=g.chunk;h.chunk=b,h.namespace=_;let C=yield g.findDependencies();(0,kO.merge)(o,C.namespaces),(0,kO.merge)(a,C.literals),u.push(g)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};is.Dependency=cS});var Rf=m(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.Transformer=void 0;var hS=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};Of.Transformer=hS});var If=m(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.generateCharsetMap=void 0;function Df(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function Y2(t=!1){let e=Df(65,90),n=Df(97,122),r=Df(48,57),i="_";return t&&(i=i+Df(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}Pf.generateCharsetMap=Y2});var fS=m(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.MAIN_BOILERPLATE=ss.MODULE_BOILERPLATE=ss.HEADER_BOILERPLATE=void 0;var dS=Qr();ss.HEADER_BOILERPLATE=new dS.Parser(`MODULES={}
|
122
122
|
EXPORTED={}
|
123
123
|
__REQUIRE=function(r)
|
124
124
|
if (not MODULES.hasIndex(r)) then
|
@@ -127,7 +127,7 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
|
127
127
|
end if
|
128
128
|
module=@MODULES[r]
|
129
129
|
return @module(r).exports
|
130
|
-
end function`).parseChunk();
|
130
|
+
end function`).parseChunk();ss.MODULE_BOILERPLATE=new dS.Parser(`MODULES["$0"]=function(r)
|
131
131
|
module={}
|
132
132
|
if (EXPORTED.hasIndex(r)) then
|
133
133
|
module=EXPORTED[r]
|
@@ -137,21 +137,21 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
|
137
137
|
end if
|
138
138
|
EXPORTED[r]=module
|
139
139
|
return EXPORTED[r]
|
140
|
-
end function`).parseChunk();
|
141
|
-
`)}};Of.OutputProcessor=uS});var m1=m(fa=>{"use strict";var x2=fa&&fa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fa,"__esModule",{value:!0});fa.DirectTranspiler=void 0;var A2=x2(require("events")),k2=Yr(),g1=mf(),C2=Xu(),O2=xf(),R2=Cf(),P2=Tf(),D2=Rf(),I2=Object.prototype.hasOwnProperty,cS=class extends A2.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=I2.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||g1.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,g1.getFactory)(e.buildType),i=new k2.Parser(e.code).parseChunk(),s=(0,P2.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,R2.generateCharsetMap)(e.obfuscation),u=new C2.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(g=>u.variables.createNamespace(g)),o.forEach(g=>u.literals.add(g));let l=new O2.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),h=new D2.OutputProcessor(u,l);h.addOptimizations();let d=l.transform(i);return h.addCode(d),h.build()}};fa.DirectTranspiler=cS});var hS=m(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.ResourceProvider=void 0;var lS=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,i)=>{let s=n.resolve(r,".."),o=n.resolve(s,i);return Promise.resolve(e.existsSync(o)?o:o+".src")},has:r=>Promise.resolve(e.existsSync(r)),get:r=>Promise.resolve(e.readFileSync(r,"utf8")),resolve:r=>Promise.resolve(n.resolve(r))}}};Pf.ResourceProvider=lS});var fS=m(is=>{"use strict";var M2=is&&is.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},L2=is&&is.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(is,"__esModule",{value:!0});is.Target=void 0;var N2=L2(require("events")),q2=Yr(),j2=iS(),y1=vf(),dS=class extends N2.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return M2(this,void 0,void 0,function*(){let e=this,n=e.resourceHandler,r=yield n.resolve(e.target);if(!(yield n.has(r)))throw new Error("Target "+r+" does not exist...");let i=e.context,s=yield n.get(r);e.emit("parse-before",r);try{let a=new q2.Parser(s,{filename:r}).parseChunk(),u=new j2.Dependency({target:r,resourceHandler:n,chunk:a,context:i}),{namespaces:c,literals:l}=yield u.findDependencies(),h=new Set(c);for(let d of h)i.variables.createNamespace(d);for(let d of l)i.literals.add(d);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof y1.BuildError?o:new y1.BuildError(o.message,{target:this.target,range:o.range})}})}};is.Target=dS});var _1=m(pa=>{"use strict";var F2=pa&&pa.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(pa,"__esModule",{value:!0});pa.Transpiler=void 0;var $2=gS(),B2=aS(),b1=mf(),W2=Xu(),U2=hS(),H2=fS(),G2=xf(),z2=Cf(),V2=Rf(),K2=Object.prototype.hasOwnProperty,pS=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new U2.ResourceProvider().getHandler(),n.obfuscation=K2.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,z2.generateCharsetMap)(n.obfuscation);n.context=new W2.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||b1.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return F2(this,void 0,void 0,function*(){let e=this,n=(0,b1.getFactory)(e.buildType),r=e.context,s=yield new H2.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new G2.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(B2.MODULE_BOILERPLATE),c=l=>{let h=r.modules.get(l.getId()),d={},g=0,y=function(A){let w=A.getNamespace();if(!(w in d)){if(w!==h&&A.type===$2.DependencyType.Import){let T=o.transform(A.chunk,A);d[w]=u.replace('"$0"',()=>'"'+w+'"').replace('"$1"',()=>T),g++}for(let T of A.dependencies)y(T)}};y(l);let b=new V2.OutputProcessor(r,o);b.addOptimizations(),g>0&&b.addHeader(),Object.keys(d).forEach(A=>b.addCode(d[A]));let C=o.transform(l.chunk,l);return b.addCode(C,!0),b.build()};return{[e.target]:c(a.dependency)}})}};pa.Transpiler=pS});var v1=m(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.unwrap=void 0;var X2=Ee();function Y2(t){for(;t instanceof X2.ASTParenthesisExpression;)t=t.expression;return t}Df.unwrap=Y2});var gS=m(X=>{"use strict";var S1=X&&X.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),J2=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Q2=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&S1(e,t,n);return J2(e,t),e},Z2=X&&X.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&S1(e,t,n)};Object.defineProperty(X,"__esModule",{value:!0});X.unwrap=X.Stack=X.OutputProcessor=X.NamespaceGenerator=X.merge=X.LiteralsMapper=X.getLiteralValue=X.getLiteralRawValue=X.fetchNamespaces=X.BuildError=X.createExpressionString=X.createExpressionHash=X.generateCharsetMap=X.DependencyType=X.Transpiler=X.Transformer=X.Target=X.DirectTranspiler=X.Dependency=X.ContextDataProperty=X.Context=X.UglifyFactory=X.Factory=X.DefaultFactory=X.BeautifyUtils=X.BeautifyContext=X.BeautifyFactory=X.getFactory=X.BuildType=void 0;var T1=mf();Object.defineProperty(X,"BuildType",{enumerable:!0,get:function(){return T1.BuildType}});Object.defineProperty(X,"getFactory",{enumerable:!0,get:function(){return T1.getFactory}});var eW=$v();Object.defineProperty(X,"BeautifyFactory",{enumerable:!0,get:function(){return eW.BeautifyFactory}});var tW=Mv();Object.defineProperty(X,"BeautifyContext",{enumerable:!0,get:function(){return tW.BeautifyContext}});X.BeautifyUtils=Q2(Lv());var nW=Wv();Object.defineProperty(X,"DefaultFactory",{enumerable:!0,get:function(){return nW.DefaultFactory}});var rW=Hu();Object.defineProperty(X,"Factory",{enumerable:!0,get:function(){return rW.Factory}});var iW=Gv();Object.defineProperty(X,"UglifyFactory",{enumerable:!0,get:function(){return iW.UglifyFactory}});var w1=Xu();Object.defineProperty(X,"Context",{enumerable:!0,get:function(){return w1.Context}});Object.defineProperty(X,"ContextDataProperty",{enumerable:!0,get:function(){return w1.ContextDataProperty}});var sW=iS();Object.defineProperty(X,"Dependency",{enumerable:!0,get:function(){return sW.Dependency}});var oW=m1();Object.defineProperty(X,"DirectTranspiler",{enumerable:!0,get:function(){return oW.DirectTranspiler}});Z2(hS(),X);var aW=fS();Object.defineProperty(X,"Target",{enumerable:!0,get:function(){return aW.Target}});var uW=xf();Object.defineProperty(X,"Transformer",{enumerable:!0,get:function(){return uW.Transformer}});var cW=_1();Object.defineProperty(X,"Transpiler",{enumerable:!0,get:function(){return cW.Transpiler}});var lW=Qv();Object.defineProperty(X,"DependencyType",{enumerable:!0,get:function(){return lW.DependencyType}});var hW=Cf();Object.defineProperty(X,"generateCharsetMap",{enumerable:!0,get:function(){return hW.generateCharsetMap}});var dW=Rv();Object.defineProperty(X,"createExpressionHash",{enumerable:!0,get:function(){return dW.createExpressionHash}});var fW=Uv();Object.defineProperty(X,"createExpressionString",{enumerable:!0,get:function(){return fW.createExpressionString}});var pW=vf();Object.defineProperty(X,"BuildError",{enumerable:!0,get:function(){return pW.BuildError}});var gW=Tf();Object.defineProperty(X,"fetchNamespaces",{enumerable:!0,get:function(){return gW.fetchNamespaces}});var E1=ha();Object.defineProperty(X,"getLiteralRawValue",{enumerable:!0,get:function(){return E1.getLiteralRawValue}});Object.defineProperty(X,"getLiteralValue",{enumerable:!0,get:function(){return E1.getLiteralValue}});var mW=Kv();Object.defineProperty(X,"LiteralsMapper",{enumerable:!0,get:function(){return mW.LiteralsMapper}});var yW=Vu();Object.defineProperty(X,"merge",{enumerable:!0,get:function(){return yW.merge}});var bW=Yv();Object.defineProperty(X,"NamespaceGenerator",{enumerable:!0,get:function(){return bW.NamespaceGenerator}});var _W=Rf();Object.defineProperty(X,"OutputProcessor",{enumerable:!0,get:function(){return _W.OutputProcessor}});var vW=qv();Object.defineProperty(X,"Stack",{enumerable:!0,get:function(){return vW.Stack}});var SW=v1();Object.defineProperty(X,"unwrap",{enumerable:!0,get:function(){return SW.unwrap}})});var A1=m(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.activate=void 0;var x1=gS();function TW(t){async function e(n){try{let r=t.getConfiguration();return new x1.DirectTranspiler({code:n,buildType:x1.BuildType.BEAUTIFY,buildOptions:{isDevMode:!0,keepParentheses:r.transpiler.beautify.keepParentheses,indentation:r.transpiler.beautify.indentation==="Tab"?0:1,indentationSpaces:r.transpiler.beautify.indentationSpaces}}).parse()}catch{return null}}t.connection.onDocumentFormatting(async n=>{if(!t.getConfiguration().formatter)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=await t.documentManager.getLatest(r),s=await e(r.getText());return s===null?[]:[{range:{start:{line:0,character:0},end:i.document.end},newText:s}]})}If.activate=TW});var Lf=m(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.MarkdownString=void 0;var mS=class{constructor(e=""){this.sanitize=!0,this.value=e}appendText(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
|
142
|
-
`,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};
|
143
|
-
`)};lt.appendTooltipHeader=
|
140
|
+
end function`).parseChunk();ss.MAIN_BOILERPLATE=new dS.Parser('"$0"').parseChunk()});var Lf=m(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.OutputProcessor=void 0;var OO=fS(),J2=Vu(),pS=class{constructor(e,n,{header:r=OO.HEADER_BOILERPLATE,main:i=OO.MAIN_BOILERPLATE}={}){this.context=e,this.transformer=n,this.processed=[],this.headerBoilerplate=this.transformer.transform(r),this.mainBoilerplate=this.transformer.transform(i)}addOptimizations(){return(0,J2.merge)(this.processed,this.transformer.factory.generateOptimizations()),this}addHeader(){return this.processed.push(this.headerBoilerplate),this}addCode(e,n=!1){if(n){let r=this.mainBoilerplate.replace('"$0"',()=>e);this.processed.push(r)}else this.processed.push(e);return this}build(){return this.processed.join(`
|
141
|
+
`)}};Mf.OutputProcessor=pS});var DO=m(ga=>{"use strict";var Q2=ga&&ga.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ga,"__esModule",{value:!0});ga.DirectTranspiler=void 0;var Z2=Q2(require("events")),eW=Qr(),RO=Sf(),tW=Yu(),nW=Rf(),rW=If(),iW=kf(),sW=Lf(),oW=Object.prototype.hasOwnProperty,gS=class extends Z2.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=oW.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||RO.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,RO.getFactory)(e.buildType),i=new eW.Parser(e.code).parseChunk(),s=(0,iW.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,rW.generateCharsetMap)(e.obfuscation),u=new tW.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(g=>u.variables.createNamespace(g)),o.forEach(g=>u.literals.add(g));let l=new nW.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),h=new sW.OutputProcessor(u,l);h.addOptimizations();let d=l.transform(i);return h.addCode(d),h.build()}};ga.DirectTranspiler=gS});var yS=m(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.ResourceProvider=void 0;var mS=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,i)=>{let s=n.resolve(r,".."),o=n.resolve(s,i);return Promise.resolve(e.existsSync(o)?o:o+".src")},has:r=>Promise.resolve(e.existsSync(r)),get:r=>Promise.resolve(e.readFileSync(r,"utf8")),resolve:r=>Promise.resolve(n.resolve(r))}}};Nf.ResourceProvider=mS});var _S=m(os=>{"use strict";var aW=os&&os.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},uW=os&&os.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(os,"__esModule",{value:!0});os.Target=void 0;var cW=uW(require("events")),lW=Qr(),hW=lS(),PO=xf(),bS=class extends cW.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return aW(this,void 0,void 0,function*(){let e=this,n=e.resourceHandler,r=yield n.resolve(e.target);if(!(yield n.has(r)))throw new Error("Target "+r+" does not exist...");let i=e.context,s=yield n.get(r);e.emit("parse-before",r);try{let a=new lW.Parser(s,{filename:r}).parseChunk(),u=new hW.Dependency({target:r,resourceHandler:n,chunk:a,context:i}),{namespaces:c,literals:l}=yield u.findDependencies(),h=new Set(c);for(let d of h)i.variables.createNamespace(d);for(let d of l)i.literals.add(d);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof PO.BuildError?o:new PO.BuildError(o.message,{target:this.target,range:o.range})}})}};os.Target=bS});var MO=m(ma=>{"use strict";var dW=ma&&ma.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(ma,"__esModule",{value:!0});ma.Transpiler=void 0;var fW=SS(),pW=fS(),IO=Sf(),gW=Yu(),mW=yS(),yW=_S(),bW=Rf(),_W=If(),vW=Lf(),SW=Object.prototype.hasOwnProperty,vS=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new mW.ResourceProvider().getHandler(),n.obfuscation=SW.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,_W.generateCharsetMap)(n.obfuscation);n.context=new gW.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||IO.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return dW(this,void 0,void 0,function*(){let e=this,n=(0,IO.getFactory)(e.buildType),r=e.context,s=yield new yW.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new bW.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(pW.MODULE_BOILERPLATE),c=l=>{let h=r.modules.get(l.getId()),d={},g=0,_=function(A){let w=A.getNamespace();if(!(w in d)){if(w!==h&&A.type===fW.DependencyType.Import){let T=o.transform(A.chunk,A);d[w]=u.replace('"$0"',()=>'"'+w+'"').replace('"$1"',()=>T),g++}for(let T of A.dependencies)_(T)}};_(l);let b=new vW.OutputProcessor(r,o);b.addOptimizations(),g>0&&b.addHeader(),Object.keys(d).forEach(A=>b.addCode(d[A]));let C=o.transform(l.chunk,l);return b.addCode(C,!0),b.build()};return{[e.target]:c(a.dependency)}})}};ma.Transpiler=vS});var LO=m(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.unwrap=void 0;var TW=Ee();function wW(t){for(;t instanceof TW.ASTParenthesisExpression;)t=t.expression;return t}qf.unwrap=wW});var SS=m(X=>{"use strict";var NO=X&&X.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),EW=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xW=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&NO(e,t,n);return EW(e,t),e},AW=X&&X.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&NO(e,t,n)};Object.defineProperty(X,"__esModule",{value:!0});X.unwrap=X.Stack=X.OutputProcessor=X.NamespaceGenerator=X.merge=X.LiteralsMapper=X.getLiteralValue=X.getLiteralRawValue=X.fetchNamespaces=X.BuildError=X.createExpressionString=X.createExpressionHash=X.generateCharsetMap=X.DependencyType=X.Transpiler=X.Transformer=X.Target=X.DirectTranspiler=X.Dependency=X.ContextDataProperty=X.Context=X.UglifyFactory=X.Factory=X.DefaultFactory=X.BeautifyUtils=X.BeautifyContext=X.BeautifyFactory=X.getFactory=X.BuildType=void 0;var qO=Sf();Object.defineProperty(X,"BuildType",{enumerable:!0,get:function(){return qO.BuildType}});Object.defineProperty(X,"getFactory",{enumerable:!0,get:function(){return qO.getFactory}});var kW=zv();Object.defineProperty(X,"BeautifyFactory",{enumerable:!0,get:function(){return kW.BeautifyFactory}});var CW=$v();Object.defineProperty(X,"BeautifyContext",{enumerable:!0,get:function(){return CW.BeautifyContext}});X.BeautifyUtils=xW(Bv());var OW=Vv();Object.defineProperty(X,"DefaultFactory",{enumerable:!0,get:function(){return OW.DefaultFactory}});var RW=Gu();Object.defineProperty(X,"Factory",{enumerable:!0,get:function(){return RW.Factory}});var DW=Jv();Object.defineProperty(X,"UglifyFactory",{enumerable:!0,get:function(){return DW.UglifyFactory}});var jO=Yu();Object.defineProperty(X,"Context",{enumerable:!0,get:function(){return jO.Context}});Object.defineProperty(X,"ContextDataProperty",{enumerable:!0,get:function(){return jO.ContextDataProperty}});var PW=lS();Object.defineProperty(X,"Dependency",{enumerable:!0,get:function(){return PW.Dependency}});var IW=DO();Object.defineProperty(X,"DirectTranspiler",{enumerable:!0,get:function(){return IW.DirectTranspiler}});AW(yS(),X);var MW=_S();Object.defineProperty(X,"Target",{enumerable:!0,get:function(){return MW.Target}});var LW=Rf();Object.defineProperty(X,"Transformer",{enumerable:!0,get:function(){return LW.Transformer}});var NW=MO();Object.defineProperty(X,"Transpiler",{enumerable:!0,get:function(){return NW.Transpiler}});var qW=iS();Object.defineProperty(X,"DependencyType",{enumerable:!0,get:function(){return qW.DependencyType}});var jW=If();Object.defineProperty(X,"generateCharsetMap",{enumerable:!0,get:function(){return jW.generateCharsetMap}});var FW=Nv();Object.defineProperty(X,"createExpressionHash",{enumerable:!0,get:function(){return FW.createExpressionHash}});var $W=Xv();Object.defineProperty(X,"createExpressionString",{enumerable:!0,get:function(){return $W.createExpressionString}});var BW=xf();Object.defineProperty(X,"BuildError",{enumerable:!0,get:function(){return BW.BuildError}});var WW=kf();Object.defineProperty(X,"fetchNamespaces",{enumerable:!0,get:function(){return WW.fetchNamespaces}});var FO=fa();Object.defineProperty(X,"getLiteralRawValue",{enumerable:!0,get:function(){return FO.getLiteralRawValue}});Object.defineProperty(X,"getLiteralValue",{enumerable:!0,get:function(){return FO.getLiteralValue}});var UW=eS();Object.defineProperty(X,"LiteralsMapper",{enumerable:!0,get:function(){return UW.LiteralsMapper}});var HW=Vu();Object.defineProperty(X,"merge",{enumerable:!0,get:function(){return HW.merge}});var GW=nS();Object.defineProperty(X,"NamespaceGenerator",{enumerable:!0,get:function(){return GW.NamespaceGenerator}});var zW=Lf();Object.defineProperty(X,"OutputProcessor",{enumerable:!0,get:function(){return zW.OutputProcessor}});var KW=Uv();Object.defineProperty(X,"Stack",{enumerable:!0,get:function(){return KW.Stack}});var VW=LO();Object.defineProperty(X,"unwrap",{enumerable:!0,get:function(){return VW.unwrap}})});var BO=m(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.activate=void 0;var $O=SS();function XW(t){async function e(n){try{let r=t.getConfiguration();return new $O.DirectTranspiler({code:n,buildType:$O.BuildType.BEAUTIFY,buildOptions:{isDevMode:!0,keepParentheses:r.transpiler.beautify.keepParentheses,indentation:r.transpiler.beautify.indentation==="Tab"?0:1,indentationSpaces:r.transpiler.beautify.indentationSpaces}}).parse()}catch{return null}}t.connection.onDocumentFormatting(async n=>{if(!t.getConfiguration().formatter)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=await t.documentManager.getLatest(r),s=await e(r.getText());return s===null?[]:[{range:{start:{line:0,character:0},end:i.document.end},newText:s}]})}jf.activate=XW});var $f=m(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.MarkdownString=void 0;var TS=class{constructor(e=""){this.sanitize=!0,this.value=e}appendText(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
|
142
|
+
`,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};Ff.MarkdownString=TS});var Bf=m(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.createHover=lt.createSignatureInfo=lt.appendTooltipBody=lt.appendTooltipHeader=lt.createTooltipHeader=lt.formatDefaultValue=lt.formatTypes=lt.formatKind=void 0;var cr=na(),WO=$i(),UO=$f(),YW={[cr.CompletionItemKind.Constant]:"constant",[cr.CompletionItemKind.Expression]:"expr",[cr.CompletionItemKind.Function]:"function",[cr.CompletionItemKind.Internal]:"internal",[cr.CompletionItemKind.InternalFunction]:"function",[cr.CompletionItemKind.InternalProperty]:"var",[cr.CompletionItemKind.ListConstructor]:"list",[cr.CompletionItemKind.Literal]:"literal",[cr.CompletionItemKind.MapConstructor]:"map",[cr.CompletionItemKind.Property]:"var",[cr.CompletionItemKind.Unknown]:"unknown",[cr.CompletionItemKind.Variable]:"var"};function wS(t){return YW[t]||"unknown"}lt.formatKind=wS;function ES(t){return t==null?"":t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}lt.formatTypes=ES;function HO(t){return typeof t=="string"?`"${t}"`:t.toString()}lt.formatDefaultValue=HO;var JW=(t,e)=>{let n=e.getArguments()||[],r=ES(e.getReturns())||"null";if(n.length===0)return`(${wS(t.kind)}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${ES(s.getTypes())}${s.getDefault()?` = ${HO(s.getDefault().value)}`:""}`).join(", ");return`(${wS(t.kind)}) ${t.label} (${i}): ${r}`};lt.createTooltipHeader=JW;var QW=(t,e,n)=>{t.appendCodeblock(WO.LanguageId,(0,lt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
|
143
|
+
`)};lt.appendTooltipHeader=QW;var ZW=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
|
144
144
|
`),n.length>0&&(t.appendMarkdown(`#### Examples:
|
145
|
-
`),t.appendCodeblock(
|
146
|
-
`)))};lt.appendTooltipBody=AW;var kW=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,lt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new C1.MarkdownString("");(0,lt.appendTooltipBody)(a,r),s.parameters=o.map(u=>({label:`${u.getLabel()}${u.isOptional()?"?":""}: ${u.getTypes().join(" or ")}`})),s.documentation=a.toString(),e.push(s)}return e};lt.createSignatureInfo=kW;var CW=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new C1.MarkdownString(""),i=n;(0,lt.appendTooltipHeader)(r,t,i),(0,lt.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};lt.createHover=CW});var Ff=m((k6,I1)=>{var Ju=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,OW=typeof AbortController=="function",qf=OW?AbortController:class{constructor(){this.signal=new R1}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},RW=typeof AbortSignal=="function",PW=typeof qf.AbortSignal=="function",R1=RW?AbortSignal:PW?qf.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},TS=new Set,_S=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;jf(n)&&wS(n,`${t} option`,`options.${e}`,ma)},vS=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(jf(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);wS(n,`${t} method`,`cache.${e}()`,i)}},DW=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(jf(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);wS(n,`${t} property`,`cache.${e}`,i)}},P1=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},jf=t=>!TS.has(t),wS=(t,e,n,r)=>{TS.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;P1(i,"DeprecationWarning",t,r)},ss=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),D1=t=>ss(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ga:null:null,ga=class extends Array{constructor(e){super(e),this.fill(0)}},SS=class{constructor(e){if(e===0)return[];let n=D1(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ma=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:d,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:b,fetchMethod:C,fetchContext:A,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:L,ignoreFetchAbort:R}=e,{length:B,maxAge:ee,stale:re}=e instanceof t?{}:e;if(n!==0&&!ss(n))throw new TypeError("max option must be a nonnegative integer");let W=n?D1(n):Array;if(!W)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=y||this.maxSize,this.sizeCalculation=b||B,this.sizeCalculation){if(!this.maxSize&&!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(this.fetchMethod=C||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=A,!this.fetchMethod&&A!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new W(n),this.prev=new W(n),this.head=0,this.tail=0,this.free=new SS(n),this.initialFill=1,this.size=0,typeof c=="function"&&(this.dispose=c),typeof l=="function"?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!ss(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!ss(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!re,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ss(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ee||0,this.ttl){if(!ss(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let O="LRU_CACHE_UNBOUNDED";jf(O)&&(TS.add(O),P1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,t))}re&&_S("stale","allowStale"),ee&&_S("maxAge","ttl"),B&&_S("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ga(this.max),this.starts=new ga(this.max),this.setItemTTL=(r,i,s=Ju.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Ju.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Ju.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ga(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!ss(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!ss(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return vS("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Ju.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Ju.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:c}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=n,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,o,c),c&&(c.set="add"),u=!1;else{this.moveToTail(l);let h=this.valList[l];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):s||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let d=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;d!==void 0&&(c.oldValue=d)}}else c&&(c.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(l,r,i),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new qf;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(g,y=!1)=>{let{aborted:b}=o.signal,C=r.ignoreFetchAbort&&g!==void 0;return r.status&&(b&&!y?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,C&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!C&&!y?l(o.signal.reason):(this.valList[n]===d&&(g===void 0?d.__staleWhileFetching?this.valList[n]=d.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},c=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),l(g)),l=g=>{let{aborted:y}=o.signal,b=y&&r.allowStaleOnFetchAbort,C=b||r.allowStaleOnFetchRejection,A=C||r.noDeleteOnFetchRejection;if(this.valList[n]===d&&(!A||d.__staleWhileFetching===void 0?this.delete(e):b||(this.valList[n]=d.__staleWhileFetching)),C)return r.status&&d.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw g},h=(g,y)=>{this.fetchMethod(e,s,a).then(b=>g(b),y),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=b=>u(b,!0)))})};r.status&&(r.status.fetchDispatched=!0);let d=new Promise(h).then(u,c);return d.__abortController=o,d.__staleWhileFetching=s,d.__returned=null,n===void 0?(this.set(e,d,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=d,d}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:y=this.fetchContext,forceRefresh:b=!1,status:C,signal:A}={}){if(!this.fetchMethod)return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:C});let w={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:C,signal:A},T=this.keyMap.get(e);if(T===void 0){C&&(C.fetch="miss");let v=this.backgroundFetch(e,T,w,y);return v.__returned=v}else{let v=this.valList[T];if(this.isBackgroundFetch(v)){let re=n&&v.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",re&&(C.returnedStale=!0)),re?v.__staleWhileFetching:v.__returned=v}let L=this.isStale(T);if(!b&&!L)return C&&(C.fetch="hit"),this.moveToTail(T),r&&this.updateItemAge(T),this.statusTTL(C,T),v;let R=this.backgroundFetch(e,T,w,y),B=R.__staleWhileFetching!==void 0,ee=B&&n;return C&&(C.fetch=B&&L?"stale":"refresh",ee&&L&&(C.returnedStale=!0)),ee?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return vS("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return vS("reset","clear"),this.clear}get length(){return DW("length","size"),this.size}static get AbortController(){return qf}static get AbortSignal(){return R1}};I1.exports=ma});var $1=m((C6,F1)=>{var kS=Object.defineProperty,IW=Object.getOwnPropertyDescriptor,MW=Object.getOwnPropertyNames,LW=Object.prototype.hasOwnProperty,NW=(t,e)=>{for(var n in e)kS(t,n,{get:e[n],enumerable:!0})},qW=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of MW(e))!LW.call(t,i)&&i!==n&&kS(t,i,{get:()=>e[i],enumerable:!(r=IW(e,i))||r.enumerable});return t},jW=t=>qW(kS({},"__esModule",{value:!0}),t),M1={};NW(M1,{ScheduleIntervalHelper:()=>ES,SchedulePostMessageHelper:()=>xS,ScheduleSetImmmediateHelper:()=>AS,schedule:()=>BW,scheduleProvider:()=>j1});F1.exports=jW(M1);var FW=Promise.prototype.then.bind(Promise.resolve()),CS=class $f{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,$f.QUEUE_LIMIT);this.queue=this.queue.slice($f.QUEUE_LIMIT);for(let r=0;r<n;FW(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=$f.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},ES=class L1 extends CS{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new L1;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},$W=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},xS=class N1 extends CS{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!$W()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new N1;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},AS=class q1 extends CS{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new q1;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function j1(){if(AS.isApplicable())return AS.createCallback();if(xS.isApplicable())return xS.createCallback();if(ES.isApplicable())return ES.createCallback();throw new Error("No schedule helper fulfills requirements!")}var BW=j1()});var RS=m((Qu,OS)=>{(function(t,e){if(typeof Qu=="object"&&typeof OS=="object")OS.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Qu=="object"?Qu:t)[r]=n[r]}})(Qu,()=>(()=>{"use strict";var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,c){for(var l,h="",d=0,g=-1,y=0,b=0;b<=u.length;++b){if(b<u.length)l=u.charCodeAt(b);else{if(l===47)break;l=47}if(l===47){if(!(g===b-1||y===1))if(g!==b-1&&y===2){if(h.length<2||d!==2||h.charCodeAt(h.length-1)!==46||h.charCodeAt(h.length-2)!==46){if(h.length>2){var C=h.lastIndexOf("/");if(C!==h.length-1){C===-1?(h="",d=0):d=(h=h.slice(0,C)).length-1-h.lastIndexOf("/"),g=b,y=0;continue}}else if(h.length===2||h.length===1){h="",d=0,g=b,y=0;continue}}c&&(h.length>0?h+="/..":h="..",d=2)}else h.length>0?h+="/"+u.slice(g+1,b):h=u.slice(g+1,b),d=b-g-1;g=b,y=0}else l===46&&y!==-1?++y:y=-1}return h}var a={resolve:function(){for(var u,c="",l=!1,h=arguments.length-1;h>=-1&&!l;h--){var d;h>=0?d=arguments[h]:(u===void 0&&(u=process.cwd()),d=u),s(d),d.length!==0&&(c=d+"/"+c,l=d.charCodeAt(0)===47)}return c=o(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=o(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":a.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=a.resolve(u))===(c=a.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var h=u.length,d=h-l,g=1;g<c.length&&c.charCodeAt(g)===47;++g);for(var y=c.length-g,b=d<y?d:y,C=-1,A=0;A<=b;++A){if(A===b){if(y>b){if(c.charCodeAt(g+A)===47)return c.slice(g+A+1);if(A===0)return c.slice(g+A)}else d>b&&(u.charCodeAt(l+A)===47?C=A:A===0&&(C=0));break}var w=u.charCodeAt(l+A);if(w!==c.charCodeAt(g+A))break;w===47&&(C=A)}var T="";for(A=l+C+1;A<=h;++A)A!==h&&u.charCodeAt(A)!==47||(T.length===0?T+="..":T+="/..");return T.length>0?T+c.slice(g+C):(g+=C,c.charCodeAt(g)===47&&++g,c.slice(g))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,h=-1,d=!0,g=u.length-1;g>=1;--g)if((c=u.charCodeAt(g))===47){if(!d){h=g;break}}else d=!1;return h===-1?l?"/":".":l&&h===1?"//":u.slice(0,h)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,h=0,d=-1,g=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var y=c.length-1,b=-1;for(l=u.length-1;l>=0;--l){var C=u.charCodeAt(l);if(C===47){if(!g){h=l+1;break}}else b===-1&&(g=!1,b=l+1),y>=0&&(C===c.charCodeAt(y)?--y==-1&&(d=l):(y=-1,d=b))}return h===d?d=b:d===-1&&(d=u.length),u.slice(h,d)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!g){h=l+1;break}}else d===-1&&(g=!1,d=l+1);return d===-1?"":u.slice(h,d)},extname:function(u){s(u);for(var c=-1,l=0,h=-1,d=!0,g=0,y=u.length-1;y>=0;--y){var b=u.charCodeAt(y);if(b!==47)h===-1&&(d=!1,h=y+1),b===46?c===-1?c=y:g!==1&&(g=1):c!==-1&&(g=-1);else if(!d){l=y+1;break}}return c===-1||h===-1||g===0||g===1&&c===h-1&&c===l+1?"":u.slice(c,h)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var h=l.dir||l.root,d=l.base||(l.name||"")+(l.ext||"");return h?h===l.root?h+d:h+"/"+d:d}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,h=u.charCodeAt(0),d=h===47;d?(c.root="/",l=1):l=0;for(var g=-1,y=0,b=-1,C=!0,A=u.length-1,w=0;A>=l;--A)if((h=u.charCodeAt(A))!==47)b===-1&&(C=!1,b=A+1),h===46?g===-1?g=A:w!==1&&(w=1):g!==-1&&(w=-1);else if(!C){y=A+1;break}return g===-1||b===-1||w===0||w===1&&g===b-1&&g===y+1?b!==-1&&(c.base=c.name=y===0&&d?u.slice(1,b):u.slice(y,b)):(y===0&&d?(c.name=u.slice(1,g),c.base=u.slice(1,b)):(c.name=u.slice(y,g),c.base=u.slice(y,b)),c.ext=u.slice(g,b)),y>0?c.dir=u.slice(0,y-1):d&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a},674:(i,s)=>{if(Object.defineProperty(s,"__esModule",{value:!0}),s.isWindows=void 0,typeof process=="object")s.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;s.isWindows=o.indexOf("Windows")>=0}},796:(i,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.uriToFsPath=s.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function h(W,O){if(!W.scheme&&O)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${W.authority}", path: "${W.path}", query: "${W.query}", fragment: "${W.fragment}"}`);if(W.scheme&&!u.test(W.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(W.path){if(W.authority){if(!c.test(W.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(W.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let d="",g="/",y=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class b{static isUri(O){return O instanceof b||!!O&&typeof O.authority=="string"&&typeof O.fragment=="string"&&typeof O.path=="string"&&typeof O.query=="string"&&typeof O.scheme=="string"&&typeof O.fsPath=="string"&&typeof O.with=="function"&&typeof O.toString=="function"}scheme;authority;path;query;fragment;constructor(O,M,N,j,de,ce=!1){typeof O=="object"?(this.scheme=O.scheme||d,this.authority=O.authority||d,this.path=O.path||d,this.query=O.query||d,this.fragment=O.fragment||d):(this.scheme=function(jt,_t){return jt||_t?jt:"file"}(O,ce),this.authority=M||d,this.path=function(jt,_t){switch(jt){case"https":case"http":case"file":_t?_t[0]!==g&&(_t=g+_t):_t=g}return _t}(this.scheme,N||d),this.query=j||d,this.fragment=de||d,h(this,ce))}get fsPath(){return L(this,!1)}with(O){if(!O)return this;let{scheme:M,authority:N,path:j,query:de,fragment:ce}=O;return M===void 0?M=this.scheme:M===null&&(M=d),N===void 0?N=this.authority:N===null&&(N=d),j===void 0?j=this.path:j===null&&(j=d),de===void 0?de=this.query:de===null&&(de=d),ce===void 0?ce=this.fragment:ce===null&&(ce=d),M===this.scheme&&N===this.authority&&j===this.path&&de===this.query&&ce===this.fragment?this:new A(M,N,j,de,ce)}static parse(O,M=!1){let N=y.exec(O);return N?new A(N[2]||d,re(N[4]||d),re(N[5]||d),re(N[7]||d),re(N[9]||d),M):new A(d,d,d,d,d)}static file(O){let M=d;if(a.isWindows&&(O=O.replace(/\\/g,g)),O[0]===g&&O[1]===g){let N=O.indexOf(g,2);N===-1?(M=O.substring(2),O=g):(M=O.substring(2,N),O=O.substring(N)||g)}return new A("file",M,O,d,d)}static from(O){let M=new A(O.scheme,O.authority,O.path,O.query,O.fragment);return h(M,!0),M}toString(O=!1){return R(this,O)}toJSON(){return this}static revive(O){if(O){if(O instanceof b)return O;{let M=new A(O);return M._formatted=O.external,M._fsPath=O._sep===C?O.fsPath:null,M}}return O}}s.URI=b;let C=a.isWindows?1:void 0;class A extends b{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=L(this,!1)),this._fsPath}toString(O=!1){return O?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){let O={$mid:1};return this._fsPath&&(O.fsPath=this._fsPath,O._sep=C),this._formatted&&(O.external=this._formatted),this.path&&(O.path=this.path),this.scheme&&(O.scheme=this.scheme),this.authority&&(O.authority=this.authority),this.query&&(O.query=this.query),this.fragment&&(O.fragment=this.fragment),O}}let w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function T(W,O,M){let N,j=-1;for(let de=0;de<W.length;de++){let ce=W.charCodeAt(de);if(ce>=97&&ce<=122||ce>=65&&ce<=90||ce>=48&&ce<=57||ce===45||ce===46||ce===95||ce===126||O&&ce===47||M&&ce===91||M&&ce===93||M&&ce===58)j!==-1&&(N+=encodeURIComponent(W.substring(j,de)),j=-1),N!==void 0&&(N+=W.charAt(de));else{N===void 0&&(N=W.substr(0,de));let jt=w[ce];jt!==void 0?(j!==-1&&(N+=encodeURIComponent(W.substring(j,de)),j=-1),N+=jt):j===-1&&(j=de)}}return j!==-1&&(N+=encodeURIComponent(W.substring(j))),N!==void 0?N:W}function v(W){let O;for(let M=0;M<W.length;M++){let N=W.charCodeAt(M);N===35||N===63?(O===void 0&&(O=W.substr(0,M)),O+=w[N]):O!==void 0&&(O+=W[M])}return O!==void 0?O:W}function L(W,O){let M;return M=W.authority&&W.path.length>1&&W.scheme==="file"?`//${W.authority}${W.path}`:W.path.charCodeAt(0)===47&&(W.path.charCodeAt(1)>=65&&W.path.charCodeAt(1)<=90||W.path.charCodeAt(1)>=97&&W.path.charCodeAt(1)<=122)&&W.path.charCodeAt(2)===58?O?W.path.substr(1):W.path[1].toLowerCase()+W.path.substr(2):W.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function R(W,O){let M=O?v:T,N="",{scheme:j,authority:de,path:ce,query:jt,fragment:_t}=W;if(j&&(N+=j,N+=":"),(de||j==="file")&&(N+=g,N+=g),de){let Fe=de.indexOf("@");if(Fe!==-1){let bn=de.substr(0,Fe);de=de.substr(Fe+1),Fe=bn.lastIndexOf(":"),Fe===-1?N+=M(bn,!1,!1):(N+=M(bn.substr(0,Fe),!1,!1),N+=":",N+=M(bn.substr(Fe+1),!1,!0)),N+="@"}de=de.toLowerCase(),Fe=de.lastIndexOf(":"),Fe===-1?N+=M(de,!1,!0):(N+=M(de.substr(0,Fe),!1,!0),N+=de.substr(Fe))}if(ce){if(ce.length>=3&&ce.charCodeAt(0)===47&&ce.charCodeAt(2)===58){let Fe=ce.charCodeAt(1);Fe>=65&&Fe<=90&&(ce=`/${String.fromCharCode(Fe+32)}:${ce.substr(3)}`)}else if(ce.length>=2&&ce.charCodeAt(1)===58){let Fe=ce.charCodeAt(0);Fe>=65&&Fe<=90&&(ce=`${String.fromCharCode(Fe+32)}:${ce.substr(2)}`)}N+=M(ce,!0,!1)}return jt&&(N+="?",N+=M(jt,!1,!1)),_t&&(N+="#",N+=O?_t:T(_t,!1,!1)),N}function B(W){try{return decodeURIComponent(W)}catch{return W.length>3?W.substr(0,3)+B(W.substr(3)):W}}s.uriToFsPath=L;let ee=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function re(W){return W.match(ee)?W.replace(ee,O=>B(O)):W}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(y,b,C,A){A===void 0&&(A=C);var w=Object.getOwnPropertyDescriptor(b,C);w&&!("get"in w?!b.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return b[C]}}),Object.defineProperty(y,A,w)}:function(y,b,C,A){A===void 0&&(A=C),y[A]=b[C]}),u=this&&this.__setModuleDefault||(Object.create?function(y,b){Object.defineProperty(y,"default",{enumerable:!0,value:b})}:function(y,b){y.default=b}),c=this&&this.__importStar||function(y){if(y&&y.__esModule)return y;var b={};if(y!=null)for(var C in y)C!=="default"&&Object.prototype.hasOwnProperty.call(y,C)&&a(b,y,C);return u(b,y),b};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),h=l.posix||l,d="/";var g;(function(y){y.joinPath=function(b,...C){return b.with({path:h.join(b.path,...C)})},y.resolvePath=function(b,...C){let A=b.path,w=!1;A[0]!==d&&(A=d+A,w=!0);let T=h.resolve(A,...C);return w&&T[0]===d&&!b.authority&&(T=T.substring(1)),b.with({path:T})},y.dirname=function(b){if(b.path.length===0||b.path===d)return b;let C=h.dirname(b.path);return C.length===1&&C.charCodeAt(0)===46&&(C=""),b.with({path:C})},y.basename=function(b){return h.basename(b.path)},y.extname=function(b){return h.extname(b.path)}})(g||(s.Utils=g={}))}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;let s=n(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return s.URI}});let o=n(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var B1=m((O6,WW)=>{WW.exports={insert:{description:"Depending on the data type this method will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","list.insert(2, 42)",'print("List with inserted item: " + list.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = "test".indexOf("e")','print("e is at: " + index)']},hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + [1, 2, 3].hasIndex(2)']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","list.remove(5)",'print("List after removal: " + list.join(", "))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.push(42)",'print("The answer to everything is: " + list.pop)']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + list.pop)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.shuffle",'print("And the winner is: " + list[0])']},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + list.sum)']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".indexes','print("Following indexes are available: " + indexesOfStr.join(", "))']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = "test".len','print("Length of string is: " + length)']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".values','print("Following values are available: " + indexesOfStr.join(", "))']}}});var W1=m((R6,UW)=>{UW.exports={hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + hasIndex([1, 2, 3], 2)']},print:{description:"Print a message on the Terminal.",example:['print("hello world")']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = indexes("test")','print("Following indexes are available: " + indexesOfStr.join(", "))']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = values("test")','print("Following values are available: " + indexesOfStr.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = indexOf("test", "e")','print("e is at: " + index)']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = len("test")','print("Length of string is: " + length)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","shuffle(list)",'print("And the winner is: " + list[0])']},val:{description:"Casts a `string` to a `number`. In case the provided `string` does not represent a valid `number` the `number` zero will get returned.",example:['num = val("1.25")','print("Number in string is: " + num)']},lower:{description:"Returns a `string` which is the lowercase transformed version of the provided `string`.",example:['myString = lower("HELLO WORLD")',"print(myString)"]},upper:{description:"Returns a `string` which is the uppercase transformed version of the provided `string`.",example:['myString = upper("hello world")',"print(myString)"]},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + sum(list))']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + pop(list))']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the first item and therefore mutates the object. To get a better idea about the behaviour look into the `pull` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The first item is: " + pull(list))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","push(list, 42)",'print("The answer to everything is: " + pop(list))']},sort:{description:"Depending on the data type this function will sort the values in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `sort` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","sort(list)",'print("Sorted list: " + list.join(", "))']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","remove(list, 5)",'print("List after removal: " + list.join(", "))']},wait:{description:"Puts script execution on hold. Optionally the duration can be provided via the time argument. By default, the duration will be 1 second. The duration cannot be below 0.01 or above 300.",example:["start = time","wait(5)","elapsed = time - start",'print("Waited: " + elapsed)']},bitwise:{description:'Enables to perform bitwise operations. Supported operators are: `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `">>>"`. Returns a `number`.',example:["num = params[0].to_int",'isOdd = bitwise("&", num, 1) == 1',"if isOdd then",' print("Number is odd.")',"else",' print("Number is even.")',"end if"]},abs:{description:"Returns the absolute value of `number`.",example:["a = 1","b = 5","difference = abs(a - b)",'print("Difference between a and b is: " + difference)']},acos:{description:"Returns the inverse cosine (in radians) of a `number`.",example:["adjacent = 8","hypotenuse = 10","calcAngle = acos(adjacent / hypotenuse)",'print("Angle: " + calcAngle)']},asin:{description:"Returns the inverse sine (in radians) of a `number`.",example:["opposite = 6","hypotenuse = 10","calcAngle = acos(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},atan:{description:"Returns the inverse tangent (in radians) of a `number`.",example:["opposite = 8","hypotenuse = 10","calcAngle = atan(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},tan:{description:"Returns the tangent of a `number` in radians.",example:["degrees = 90","tanFromDegrees = tan(degress * pi / 180)",'print("Tan from degrees: " + tanFromDegrees)']},cos:{description:"Returns the cosine of a `number` in radians.",example:["radians = 1","radius = 10","circleX = cos(radians) * radius","print(circleX)"]},code:{description:"Returns the Unicode `number` of the first character of the string. In case an empty `string` is provided the script execution will crash.",example:['key = user_input("Press a key!", false, true)',"isA = key.code == 97","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},char:{description:"Returns the Unicode character `string` related to the provided unicode `number`. The provided `number` needs to be between 0 and 65535. Any `number` which is outside this range will cause the script to throw a runtime error.",example:['key = user_input("Press a key!", false, true)',"isA = key == char(97)","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},sin:{description:"Returns the sine of a `number` in radians.",example:["radians = 1","radius = 10","circleY = sin(radians) * radius","print(circleY)"]},floor:{description:"Returns `number` rounded down to the integer value of the provided `number`.",example:["price = 25.43467","floored = floor(price * 100) / 100",'print("Floored price: " + floored)']},range:{description:"Generates a `list` where each item is a `number`. By default, if only one argument is provided, the list starts at the given value and decrements by one for each item. You can optionally define a start and end value, as well as customize the incremental value. In case the incremental value is zero this function will throw a runtime error.",example:['print("Countdown:")',"for num in range(10)"," print(num)","end for",'print("Done!")']},round:{description:"Returns `number` rounded to the integer value of the provided `number`.",example:["price = 25.43467","rounded = round(price * 100) / 100",'print("Price: " + rounded)']},rnd:{description:"Returns a random `number` between 0 and 1. Optionally a seed `number` can be provided.",example:["min = 10","max = 20","output = floor(rnd * (max - min + 1) + min)",'input = user_input("Guess a number between 10 and 20!").to_int',"if (input == output) then",' print("You guessed right!")',"else",' print("You failed! The number was " + output)',"end if"]},sign:{description:"Returns a one or minus one, indicating the sign of the number passed as argument. If the input is zero, it will be returned as-is.",example:["print(sign(40))","print(sign(-40))","print(sign(0))"]},sqrt:{description:"Returns the square root of a `number`.",example:["a = 3","b = 4","calcHypotenuse = sqrt((a * a) + (b * b))",'print("Hypotenuse: " + calcHypotenuse)']},str:{description:"Returns the `string` value of provided data. Can be used to turn a `number` into a `string` or to get the signature of a `function`.",example:["signature = str(@user_input)","argSegment = signature[9:signature.len - 1]",'args = argSegment.split(",")','print("Function has " + args.len + " arguments.")']},ceil:{description:"Returns `number` rounded up to the integer value of the provided `number`.",example:["price = 25.43467","upperPrice = ceil(price * 100) / 100",'print("Upper price: " + upperPrice)']},pi:{description:"Returns the `number` PI to the precision of six.",example:["radius = 10","circumference = 2 * pi * radius",'print("Circumference: " + circumference)']},slice:{description:"Returns a sliced `list`. Valid data types for slicing are `string` and `list`. The returned `list` will contain all elements related to the provided start and end index.",example:['myString = "not your text"','print("my " + slice(myString, 9))']},hash:{description:"Returns numeric hash for the provided data.",example:['hashA = hash({ "a": 2, "b": 1 })','hashB = hash({ "b": 1, "a": 2 })',"if (hashA == hashB) then",' print("Objects are alike!")',"else",' print("Objects are different!")',"end if"]},time:{description:"Returns a `number` of seconds representing the elapsed time since the script got started.",example:["start = time","for i in range(10000)"," var = i * 100","end for","endTime = time - start",'print("Script execution done within: " + endTime)']},bitAnd:{description:"Performs a bitwise AND for the provided values. Returns a `number`.",example:['print("Result of bitwise AND: " + bitAnd(1, 2))']},bitOr:{description:"Performs a bitwise OR for the provided values. Returns a `number`.",example:['print("Result of bitwise OR: " + bitOr(1, 2))']},bitXor:{description:"Permorms a bitwise XOR for the provided values. Returns a `number`.",example:['print("Result of bitwise XOR: " + bitXor(1, 2))']},log:{description:"Returns the natural logarithm of a `number`. By default, the base is 10. Optionally the base can be changed.",example:["a = 2","b = 8","baseLog = log(a) / log(b)",'print("Base log is: " + baseLog)']},yield:{description:"Waits for the next tick.",example:["while (true)"," yield",' print("tick")',"end while"]},get_custom_object:{description:"Returns `map` which is shared throughout all script executions. Can be helpful in case forwarding an entity is desired.",example:["get_custom_object.shouldEndScript = false","while (get_custom_object.shouldEndScript)",' print("Waiting...")'," wait(2)","end while"]},insert:{description:"Depending on the data type this function will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","insert(list, 2, 42)",'print("List with inserted item: " + list.join(", "))']},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(join(myList, " .-*'*-. "))`]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = split(myString, " ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Depending on the data type this function will replace a value in the provided object. Due to the replacement, the object might get mutated. To get a better idea about the behaviour look into the `replace` method related to `map`, `list` or `string`.",example:['myString = "42 as an answer is wrong"','newString = replace(myString, "wrong", "right")',"print(newString)"]},refEquals:{description:"Tests whether two values refer to the very same object (rather than merely representing the same value). For numbers, this is the same as ==, but for strings, lists, and maps, it is reference equality."},version:{description:`Get a map with information about the version of MiniScript and the host environment that you're currently running. This will include at least the following keys:
|
145
|
+
`),t.appendCodeblock(WO.LanguageId,n.join(`
|
146
|
+
`)))};lt.appendTooltipBody=ZW;var eU=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,lt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new UO.MarkdownString("");(0,lt.appendTooltipBody)(a,r),s.parameters=o.map(u=>({label:`${u.getLabel()}${u.isOptional()?"?":""}: ${u.getTypes().join(" or ")}`})),s.documentation=a.toString(),e.push(s)}return e};lt.createSignatureInfo=eU;var tU=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new UO.MarkdownString(""),i=n;(0,lt.appendTooltipHeader)(r,t,i),(0,lt.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};lt.createHover=tU});var Hf=m((s8,VO)=>{var Qu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,nU=typeof AbortController=="function",Wf=nU?AbortController:class{constructor(){this.signal=new GO}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},rU=typeof AbortSignal=="function",iU=typeof Wf.AbortSignal=="function",GO=rU?AbortSignal:iU?Wf.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},CS=new Set,xS=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Uf(n)&&OS(n,`${t} option`,`options.${e}`,ba)},AS=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Uf(n)){let{prototype:r}=ba,{get:i}=Object.getOwnPropertyDescriptor(r,t);OS(n,`${t} method`,`cache.${e}()`,i)}},sU=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Uf(n)){let{prototype:r}=ba,{get:i}=Object.getOwnPropertyDescriptor(r,t);OS(n,`${t} property`,`cache.${e}`,i)}},zO=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Uf=t=>!CS.has(t),OS=(t,e,n,r)=>{CS.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;zO(i,"DeprecationWarning",t,r)},as=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),KO=t=>as(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ya:null:null,ya=class extends Array{constructor(e){super(e),this.fill(0)}},kS=class{constructor(e){if(e===0)return[];let n=KO(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ba=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:d,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:C,fetchContext:A,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:L,ignoreFetchAbort:R}=e,{length:B,maxAge:ee,stale:ie}=e instanceof t?{}:e;if(n!==0&&!as(n))throw new TypeError("max option must be a nonnegative integer");let W=n?KO(n):Array;if(!W)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=_||this.maxSize,this.sizeCalculation=b||B,this.sizeCalculation){if(!this.maxSize&&!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(this.fetchMethod=C||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=A,!this.fetchMethod&&A!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new W(n),this.prev=new W(n),this.head=0,this.tail=0,this.free=new kS(n),this.initialFill=1,this.size=0,typeof c=="function"&&(this.dispose=c),typeof l=="function"?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!as(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!as(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!ie,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=as(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ee||0,this.ttl){if(!as(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let O="LRU_CACHE_UNBOUNDED";Uf(O)&&(CS.add(O),zO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,t))}ie&&xS("stale","allowStale"),ee&&xS("maxAge","ttl"),B&&xS("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ya(this.max),this.starts=new ya(this.max),this.setItemTTL=(r,i,s=Qu.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Qu.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Qu.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ya(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!as(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!as(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return AS("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Qu.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Qu.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:c}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=n,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,o,c),c&&(c.set="add"),u=!1;else{this.moveToTail(l);let h=this.valList[l];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):s||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let d=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;d!==void 0&&(c.oldValue=d)}}else c&&(c.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(l,r,i),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Wf;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(g,_=!1)=>{let{aborted:b}=o.signal,C=r.ignoreFetchAbort&&g!==void 0;return r.status&&(b&&!_?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,C&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!C&&!_?l(o.signal.reason):(this.valList[n]===d&&(g===void 0?d.__staleWhileFetching?this.valList[n]=d.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},c=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),l(g)),l=g=>{let{aborted:_}=o.signal,b=_&&r.allowStaleOnFetchAbort,C=b||r.allowStaleOnFetchRejection,A=C||r.noDeleteOnFetchRejection;if(this.valList[n]===d&&(!A||d.__staleWhileFetching===void 0?this.delete(e):b||(this.valList[n]=d.__staleWhileFetching)),C)return r.status&&d.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw g},h=(g,_)=>{this.fetchMethod(e,s,a).then(b=>g(b),_),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=b=>u(b,!0)))})};r.status&&(r.status.fetchDispatched=!0);let d=new Promise(h).then(u,c);return d.__abortController=o,d.__staleWhileFetching=s,d.__returned=null,n===void 0?(this.set(e,d,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=d,d}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:_=this.fetchContext,forceRefresh:b=!1,status:C,signal:A}={}){if(!this.fetchMethod)return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:C});let w={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:C,signal:A},T=this.keyMap.get(e);if(T===void 0){C&&(C.fetch="miss");let v=this.backgroundFetch(e,T,w,_);return v.__returned=v}else{let v=this.valList[T];if(this.isBackgroundFetch(v)){let ie=n&&v.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",ie&&(C.returnedStale=!0)),ie?v.__staleWhileFetching:v.__returned=v}let L=this.isStale(T);if(!b&&!L)return C&&(C.fetch="hit"),this.moveToTail(T),r&&this.updateItemAge(T),this.statusTTL(C,T),v;let R=this.backgroundFetch(e,T,w,_),B=R.__staleWhileFetching!==void 0,ee=B&&n;return C&&(C.fetch=B&&L?"stale":"refresh",ee&&L&&(C.returnedStale=!0)),ee?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return AS("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return AS("reset","clear"),this.clear}get length(){return sU("length","size"),this.size}static get AbortController(){return Wf}static get AbortSignal(){return GO}};VO.exports=ba});var tR=m((o8,eR)=>{var IS=Object.defineProperty,oU=Object.getOwnPropertyDescriptor,aU=Object.getOwnPropertyNames,uU=Object.prototype.hasOwnProperty,cU=(t,e)=>{for(var n in e)IS(t,n,{get:e[n],enumerable:!0})},lU=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of aU(e))!uU.call(t,i)&&i!==n&&IS(t,i,{get:()=>e[i],enumerable:!(r=oU(e,i))||r.enumerable});return t},hU=t=>lU(IS({},"__esModule",{value:!0}),t),XO={};cU(XO,{ScheduleIntervalHelper:()=>RS,SchedulePostMessageHelper:()=>DS,ScheduleSetImmmediateHelper:()=>PS,schedule:()=>pU,scheduleProvider:()=>ZO});eR.exports=hU(XO);var dU=Promise.prototype.then.bind(Promise.resolve()),MS=class Gf{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Gf.QUEUE_LIMIT);this.queue=this.queue.slice(Gf.QUEUE_LIMIT);for(let r=0;r<n;dU(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Gf.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},RS=class YO extends MS{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new YO;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},fU=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},DS=class JO extends MS{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!fU()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new JO;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},PS=class QO extends MS{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new QO;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function ZO(){if(PS.isApplicable())return PS.createCallback();if(DS.isApplicable())return DS.createCallback();if(RS.isApplicable())return RS.createCallback();throw new Error("No schedule helper fulfills requirements!")}var pU=ZO()});var NS=m((Zu,LS)=>{(function(t,e){if(typeof Zu=="object"&&typeof LS=="object")LS.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Zu=="object"?Zu:t)[r]=n[r]}})(Zu,()=>(()=>{"use strict";var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,c){for(var l,h="",d=0,g=-1,_=0,b=0;b<=u.length;++b){if(b<u.length)l=u.charCodeAt(b);else{if(l===47)break;l=47}if(l===47){if(!(g===b-1||_===1))if(g!==b-1&&_===2){if(h.length<2||d!==2||h.charCodeAt(h.length-1)!==46||h.charCodeAt(h.length-2)!==46){if(h.length>2){var C=h.lastIndexOf("/");if(C!==h.length-1){C===-1?(h="",d=0):d=(h=h.slice(0,C)).length-1-h.lastIndexOf("/"),g=b,_=0;continue}}else if(h.length===2||h.length===1){h="",d=0,g=b,_=0;continue}}c&&(h.length>0?h+="/..":h="..",d=2)}else h.length>0?h+="/"+u.slice(g+1,b):h=u.slice(g+1,b),d=b-g-1;g=b,_=0}else l===46&&_!==-1?++_:_=-1}return h}var a={resolve:function(){for(var u,c="",l=!1,h=arguments.length-1;h>=-1&&!l;h--){var d;h>=0?d=arguments[h]:(u===void 0&&(u=process.cwd()),d=u),s(d),d.length!==0&&(c=d+"/"+c,l=d.charCodeAt(0)===47)}return c=o(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=o(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":a.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=a.resolve(u))===(c=a.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var h=u.length,d=h-l,g=1;g<c.length&&c.charCodeAt(g)===47;++g);for(var _=c.length-g,b=d<_?d:_,C=-1,A=0;A<=b;++A){if(A===b){if(_>b){if(c.charCodeAt(g+A)===47)return c.slice(g+A+1);if(A===0)return c.slice(g+A)}else d>b&&(u.charCodeAt(l+A)===47?C=A:A===0&&(C=0));break}var w=u.charCodeAt(l+A);if(w!==c.charCodeAt(g+A))break;w===47&&(C=A)}var T="";for(A=l+C+1;A<=h;++A)A!==h&&u.charCodeAt(A)!==47||(T.length===0?T+="..":T+="/..");return T.length>0?T+c.slice(g+C):(g+=C,c.charCodeAt(g)===47&&++g,c.slice(g))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,h=-1,d=!0,g=u.length-1;g>=1;--g)if((c=u.charCodeAt(g))===47){if(!d){h=g;break}}else d=!1;return h===-1?l?"/":".":l&&h===1?"//":u.slice(0,h)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,h=0,d=-1,g=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var _=c.length-1,b=-1;for(l=u.length-1;l>=0;--l){var C=u.charCodeAt(l);if(C===47){if(!g){h=l+1;break}}else b===-1&&(g=!1,b=l+1),_>=0&&(C===c.charCodeAt(_)?--_==-1&&(d=l):(_=-1,d=b))}return h===d?d=b:d===-1&&(d=u.length),u.slice(h,d)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!g){h=l+1;break}}else d===-1&&(g=!1,d=l+1);return d===-1?"":u.slice(h,d)},extname:function(u){s(u);for(var c=-1,l=0,h=-1,d=!0,g=0,_=u.length-1;_>=0;--_){var b=u.charCodeAt(_);if(b!==47)h===-1&&(d=!1,h=_+1),b===46?c===-1?c=_:g!==1&&(g=1):c!==-1&&(g=-1);else if(!d){l=_+1;break}}return c===-1||h===-1||g===0||g===1&&c===h-1&&c===l+1?"":u.slice(c,h)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var h=l.dir||l.root,d=l.base||(l.name||"")+(l.ext||"");return h?h===l.root?h+d:h+"/"+d:d}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,h=u.charCodeAt(0),d=h===47;d?(c.root="/",l=1):l=0;for(var g=-1,_=0,b=-1,C=!0,A=u.length-1,w=0;A>=l;--A)if((h=u.charCodeAt(A))!==47)b===-1&&(C=!1,b=A+1),h===46?g===-1?g=A:w!==1&&(w=1):g!==-1&&(w=-1);else if(!C){_=A+1;break}return g===-1||b===-1||w===0||w===1&&g===b-1&&g===_+1?b!==-1&&(c.base=c.name=_===0&&d?u.slice(1,b):u.slice(_,b)):(_===0&&d?(c.name=u.slice(1,g),c.base=u.slice(1,b)):(c.name=u.slice(_,g),c.base=u.slice(_,b)),c.ext=u.slice(g,b)),_>0?c.dir=u.slice(0,_-1):d&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a},674:(i,s)=>{if(Object.defineProperty(s,"__esModule",{value:!0}),s.isWindows=void 0,typeof process=="object")s.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;s.isWindows=o.indexOf("Windows")>=0}},796:(i,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.uriToFsPath=s.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function h(W,O){if(!W.scheme&&O)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${W.authority}", path: "${W.path}", query: "${W.query}", fragment: "${W.fragment}"}`);if(W.scheme&&!u.test(W.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(W.path){if(W.authority){if(!c.test(W.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(W.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let d="",g="/",_=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class b{static isUri(O){return O instanceof b||!!O&&typeof O.authority=="string"&&typeof O.fragment=="string"&&typeof O.path=="string"&&typeof O.query=="string"&&typeof O.scheme=="string"&&typeof O.fsPath=="string"&&typeof O.with=="function"&&typeof O.toString=="function"}scheme;authority;path;query;fragment;constructor(O,M,N,j,de,ce=!1){typeof O=="object"?(this.scheme=O.scheme||d,this.authority=O.authority||d,this.path=O.path||d,this.query=O.query||d,this.fragment=O.fragment||d):(this.scheme=function(jt,_t){return jt||_t?jt:"file"}(O,ce),this.authority=M||d,this.path=function(jt,_t){switch(jt){case"https":case"http":case"file":_t?_t[0]!==g&&(_t=g+_t):_t=g}return _t}(this.scheme,N||d),this.query=j||d,this.fragment=de||d,h(this,ce))}get fsPath(){return L(this,!1)}with(O){if(!O)return this;let{scheme:M,authority:N,path:j,query:de,fragment:ce}=O;return M===void 0?M=this.scheme:M===null&&(M=d),N===void 0?N=this.authority:N===null&&(N=d),j===void 0?j=this.path:j===null&&(j=d),de===void 0?de=this.query:de===null&&(de=d),ce===void 0?ce=this.fragment:ce===null&&(ce=d),M===this.scheme&&N===this.authority&&j===this.path&&de===this.query&&ce===this.fragment?this:new A(M,N,j,de,ce)}static parse(O,M=!1){let N=_.exec(O);return N?new A(N[2]||d,ie(N[4]||d),ie(N[5]||d),ie(N[7]||d),ie(N[9]||d),M):new A(d,d,d,d,d)}static file(O){let M=d;if(a.isWindows&&(O=O.replace(/\\/g,g)),O[0]===g&&O[1]===g){let N=O.indexOf(g,2);N===-1?(M=O.substring(2),O=g):(M=O.substring(2,N),O=O.substring(N)||g)}return new A("file",M,O,d,d)}static from(O){let M=new A(O.scheme,O.authority,O.path,O.query,O.fragment);return h(M,!0),M}toString(O=!1){return R(this,O)}toJSON(){return this}static revive(O){if(O){if(O instanceof b)return O;{let M=new A(O);return M._formatted=O.external,M._fsPath=O._sep===C?O.fsPath:null,M}}return O}}s.URI=b;let C=a.isWindows?1:void 0;class A extends b{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=L(this,!1)),this._fsPath}toString(O=!1){return O?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){let O={$mid:1};return this._fsPath&&(O.fsPath=this._fsPath,O._sep=C),this._formatted&&(O.external=this._formatted),this.path&&(O.path=this.path),this.scheme&&(O.scheme=this.scheme),this.authority&&(O.authority=this.authority),this.query&&(O.query=this.query),this.fragment&&(O.fragment=this.fragment),O}}let w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function T(W,O,M){let N,j=-1;for(let de=0;de<W.length;de++){let ce=W.charCodeAt(de);if(ce>=97&&ce<=122||ce>=65&&ce<=90||ce>=48&&ce<=57||ce===45||ce===46||ce===95||ce===126||O&&ce===47||M&&ce===91||M&&ce===93||M&&ce===58)j!==-1&&(N+=encodeURIComponent(W.substring(j,de)),j=-1),N!==void 0&&(N+=W.charAt(de));else{N===void 0&&(N=W.substr(0,de));let jt=w[ce];jt!==void 0?(j!==-1&&(N+=encodeURIComponent(W.substring(j,de)),j=-1),N+=jt):j===-1&&(j=de)}}return j!==-1&&(N+=encodeURIComponent(W.substring(j))),N!==void 0?N:W}function v(W){let O;for(let M=0;M<W.length;M++){let N=W.charCodeAt(M);N===35||N===63?(O===void 0&&(O=W.substr(0,M)),O+=w[N]):O!==void 0&&(O+=W[M])}return O!==void 0?O:W}function L(W,O){let M;return M=W.authority&&W.path.length>1&&W.scheme==="file"?`//${W.authority}${W.path}`:W.path.charCodeAt(0)===47&&(W.path.charCodeAt(1)>=65&&W.path.charCodeAt(1)<=90||W.path.charCodeAt(1)>=97&&W.path.charCodeAt(1)<=122)&&W.path.charCodeAt(2)===58?O?W.path.substr(1):W.path[1].toLowerCase()+W.path.substr(2):W.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function R(W,O){let M=O?v:T,N="",{scheme:j,authority:de,path:ce,query:jt,fragment:_t}=W;if(j&&(N+=j,N+=":"),(de||j==="file")&&(N+=g,N+=g),de){let Fe=de.indexOf("@");if(Fe!==-1){let _n=de.substr(0,Fe);de=de.substr(Fe+1),Fe=_n.lastIndexOf(":"),Fe===-1?N+=M(_n,!1,!1):(N+=M(_n.substr(0,Fe),!1,!1),N+=":",N+=M(_n.substr(Fe+1),!1,!0)),N+="@"}de=de.toLowerCase(),Fe=de.lastIndexOf(":"),Fe===-1?N+=M(de,!1,!0):(N+=M(de.substr(0,Fe),!1,!0),N+=de.substr(Fe))}if(ce){if(ce.length>=3&&ce.charCodeAt(0)===47&&ce.charCodeAt(2)===58){let Fe=ce.charCodeAt(1);Fe>=65&&Fe<=90&&(ce=`/${String.fromCharCode(Fe+32)}:${ce.substr(3)}`)}else if(ce.length>=2&&ce.charCodeAt(1)===58){let Fe=ce.charCodeAt(0);Fe>=65&&Fe<=90&&(ce=`${String.fromCharCode(Fe+32)}:${ce.substr(2)}`)}N+=M(ce,!0,!1)}return jt&&(N+="?",N+=M(jt,!1,!1)),_t&&(N+="#",N+=O?_t:T(_t,!1,!1)),N}function B(W){try{return decodeURIComponent(W)}catch{return W.length>3?W.substr(0,3)+B(W.substr(3)):W}}s.uriToFsPath=L;let ee=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ie(W){return W.match(ee)?W.replace(ee,O=>B(O)):W}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(_,b,C,A){A===void 0&&(A=C);var w=Object.getOwnPropertyDescriptor(b,C);w&&!("get"in w?!b.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return b[C]}}),Object.defineProperty(_,A,w)}:function(_,b,C,A){A===void 0&&(A=C),_[A]=b[C]}),u=this&&this.__setModuleDefault||(Object.create?function(_,b){Object.defineProperty(_,"default",{enumerable:!0,value:b})}:function(_,b){_.default=b}),c=this&&this.__importStar||function(_){if(_&&_.__esModule)return _;var b={};if(_!=null)for(var C in _)C!=="default"&&Object.prototype.hasOwnProperty.call(_,C)&&a(b,_,C);return u(b,_),b};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),h=l.posix||l,d="/";var g;(function(_){_.joinPath=function(b,...C){return b.with({path:h.join(b.path,...C)})},_.resolvePath=function(b,...C){let A=b.path,w=!1;A[0]!==d&&(A=d+A,w=!0);let T=h.resolve(A,...C);return w&&T[0]===d&&!b.authority&&(T=T.substring(1)),b.with({path:T})},_.dirname=function(b){if(b.path.length===0||b.path===d)return b;let C=h.dirname(b.path);return C.length===1&&C.charCodeAt(0)===46&&(C=""),b.with({path:C})},_.basename=function(b){return h.basename(b.path)},_.extname=function(b){return h.extname(b.path)}})(g||(s.Utils=g={}))}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;let s=n(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return s.URI}});let o=n(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var nR=m((a8,gU)=>{gU.exports={insert:{description:"Depending on the data type this method will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","list.insert(2, 42)",'print("List with inserted item: " + list.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = "test".indexOf("e")','print("e is at: " + index)']},hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + [1, 2, 3].hasIndex(2)']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","list.remove(5)",'print("List after removal: " + list.join(", "))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.push(42)",'print("The answer to everything is: " + list.pop)']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + list.pop)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.shuffle",'print("And the winner is: " + list[0])']},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + list.sum)']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".indexes','print("Following indexes are available: " + indexesOfStr.join(", "))']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = "test".len','print("Length of string is: " + length)']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".values','print("Following values are available: " + indexesOfStr.join(", "))']}}});var rR=m((u8,mU)=>{mU.exports={hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + hasIndex([1, 2, 3], 2)']},print:{description:"Print a message on the Terminal.",example:['print("hello world")']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = indexes("test")','print("Following indexes are available: " + indexesOfStr.join(", "))']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = values("test")','print("Following values are available: " + indexesOfStr.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = indexOf("test", "e")','print("e is at: " + index)']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = len("test")','print("Length of string is: " + length)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","shuffle(list)",'print("And the winner is: " + list[0])']},val:{description:"Casts a `string` to a `number`. In case the provided `string` does not represent a valid `number` the `number` zero will get returned.",example:['num = val("1.25")','print("Number in string is: " + num)']},lower:{description:"Returns a `string` which is the lowercase transformed version of the provided `string`.",example:['myString = lower("HELLO WORLD")',"print(myString)"]},upper:{description:"Returns a `string` which is the uppercase transformed version of the provided `string`.",example:['myString = upper("hello world")',"print(myString)"]},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + sum(list))']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + pop(list))']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the first item and therefore mutates the object. To get a better idea about the behaviour look into the `pull` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The first item is: " + pull(list))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","push(list, 42)",'print("The answer to everything is: " + pop(list))']},sort:{description:"Depending on the data type this function will sort the values in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `sort` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","sort(list)",'print("Sorted list: " + list.join(", "))']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","remove(list, 5)",'print("List after removal: " + list.join(", "))']},wait:{description:"Puts script execution on hold. Optionally the duration can be provided via the time argument. By default, the duration will be 1 second. The duration cannot be below 0.01 or above 300.",example:["start = time","wait(5)","elapsed = time - start",'print("Waited: " + elapsed)']},bitwise:{description:'Enables to perform bitwise operations. Supported operators are: `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `">>>"`. Returns a `number`.',example:["num = params[0].to_int",'isOdd = bitwise("&", num, 1) == 1',"if isOdd then",' print("Number is odd.")',"else",' print("Number is even.")',"end if"]},abs:{description:"Returns the absolute value of `number`.",example:["a = 1","b = 5","difference = abs(a - b)",'print("Difference between a and b is: " + difference)']},acos:{description:"Returns the inverse cosine (in radians) of a `number`.",example:["adjacent = 8","hypotenuse = 10","calcAngle = acos(adjacent / hypotenuse)",'print("Angle: " + calcAngle)']},asin:{description:"Returns the inverse sine (in radians) of a `number`.",example:["opposite = 6","hypotenuse = 10","calcAngle = acos(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},atan:{description:"Returns the inverse tangent (in radians) of a `number`.",example:["opposite = 8","hypotenuse = 10","calcAngle = atan(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},tan:{description:"Returns the tangent of a `number` in radians.",example:["degrees = 90","tanFromDegrees = tan(degress * pi / 180)",'print("Tan from degrees: " + tanFromDegrees)']},cos:{description:"Returns the cosine of a `number` in radians.",example:["radians = 1","radius = 10","circleX = cos(radians) * radius","print(circleX)"]},code:{description:"Returns the Unicode `number` of the first character of the string. In case an empty `string` is provided the script execution will crash.",example:['key = user_input("Press a key!", false, true)',"isA = key.code == 97","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},char:{description:"Returns the Unicode character `string` related to the provided unicode `number`. The provided `number` needs to be between 0 and 65535. Any `number` which is outside this range will cause the script to throw a runtime error.",example:['key = user_input("Press a key!", false, true)',"isA = key == char(97)","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},sin:{description:"Returns the sine of a `number` in radians.",example:["radians = 1","radius = 10","circleY = sin(radians) * radius","print(circleY)"]},floor:{description:"Returns `number` rounded down to the integer value of the provided `number`.",example:["price = 25.43467","floored = floor(price * 100) / 100",'print("Floored price: " + floored)']},range:{description:"Generates a `list` where each item is a `number`. By default, if only one argument is provided, the list starts at the given value and decrements by one for each item. You can optionally define a start and end value, as well as customize the incremental value. In case the incremental value is zero this function will throw a runtime error.",example:['print("Countdown:")',"for num in range(10)"," print(num)","end for",'print("Done!")']},round:{description:"Returns `number` rounded to the integer value of the provided `number`.",example:["price = 25.43467","rounded = round(price * 100) / 100",'print("Price: " + rounded)']},rnd:{description:"Returns a random `number` between 0 and 1. Optionally a seed `number` can be provided.",example:["min = 10","max = 20","output = floor(rnd * (max - min + 1) + min)",'input = user_input("Guess a number between 10 and 20!").to_int',"if (input == output) then",' print("You guessed right!")',"else",' print("You failed! The number was " + output)',"end if"]},sign:{description:"Returns a one or minus one, indicating the sign of the number passed as argument. If the input is zero, it will be returned as-is.",example:["print(sign(40))","print(sign(-40))","print(sign(0))"]},sqrt:{description:"Returns the square root of a `number`.",example:["a = 3","b = 4","calcHypotenuse = sqrt((a * a) + (b * b))",'print("Hypotenuse: " + calcHypotenuse)']},str:{description:"Returns the `string` value of provided data. Can be used to turn a `number` into a `string` or to get the signature of a `function`.",example:["signature = str(@user_input)","argSegment = signature[9:signature.len - 1]",'args = argSegment.split(",")','print("Function has " + args.len + " arguments.")']},ceil:{description:"Returns `number` rounded up to the integer value of the provided `number`.",example:["price = 25.43467","upperPrice = ceil(price * 100) / 100",'print("Upper price: " + upperPrice)']},pi:{description:"Returns the `number` PI to the precision of six.",example:["radius = 10","circumference = 2 * pi * radius",'print("Circumference: " + circumference)']},slice:{description:"Returns a sliced `list`. Valid data types for slicing are `string` and `list`. The returned `list` will contain all elements related to the provided start and end index.",example:['myString = "not your text"','print("my " + slice(myString, 9))']},hash:{description:"Returns numeric hash for the provided data.",example:['hashA = hash({ "a": 2, "b": 1 })','hashB = hash({ "b": 1, "a": 2 })',"if (hashA == hashB) then",' print("Objects are alike!")',"else",' print("Objects are different!")',"end if"]},time:{description:"Returns a `number` of seconds representing the elapsed time since the script got started.",example:["start = time","for i in range(10000)"," var = i * 100","end for","endTime = time - start",'print("Script execution done within: " + endTime)']},bitAnd:{description:"Performs a bitwise AND for the provided values. Returns a `number`.",example:['print("Result of bitwise AND: " + bitAnd(1, 2))']},bitOr:{description:"Performs a bitwise OR for the provided values. Returns a `number`.",example:['print("Result of bitwise OR: " + bitOr(1, 2))']},bitXor:{description:"Permorms a bitwise XOR for the provided values. Returns a `number`.",example:['print("Result of bitwise XOR: " + bitXor(1, 2))']},log:{description:"Returns the natural logarithm of a `number`. By default, the base is 10. Optionally the base can be changed.",example:["a = 2","b = 8","baseLog = log(a) / log(b)",'print("Base log is: " + baseLog)']},yield:{description:"Waits for the next tick.",example:["while (true)"," yield",' print("tick")',"end while"]},get_custom_object:{description:"Returns `map` which is shared throughout all script executions. Can be helpful in case forwarding an entity is desired.",example:["get_custom_object.shouldEndScript = false","while (get_custom_object.shouldEndScript)",' print("Waiting...")'," wait(2)","end while"]},insert:{description:"Depending on the data type this function will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","insert(list, 2, 42)",'print("List with inserted item: " + list.join(", "))']},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(join(myList, " .-*'*-. "))`]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = split(myString, " ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Depending on the data type this function will replace a value in the provided object. Due to the replacement, the object might get mutated. To get a better idea about the behaviour look into the `replace` method related to `map`, `list` or `string`.",example:['myString = "42 as an answer is wrong"','newString = replace(myString, "wrong", "right")',"print(newString)"]},refEquals:{description:"Tests whether two values refer to the very same object (rather than merely representing the same value). For numbers, this is the same as ==, but for strings, lists, and maps, it is reference equality."},version:{description:`Get a map with information about the version of MiniScript and the host environment that you're currently running. This will include at least the following keys:
|
147
147
|
miniscript: a string such as "1.5"
|
148
148
|
buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
|
149
149
|
host: a number for the host major and minor version, like 0.9
|
150
150
|
hostName: name of the host application, e.g. "Mini Micro"
|
151
|
-
hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."},funcRef:{description:"Returns a `map` which enables to extend function references with custom methods.",example:["funcRef.signature = function"," return str(@self)","end function","print (@print).signature"]},list:{description:"Returns a `map` which enables to extend list types with custom methods.",example:["list.map = function(callback)"," newList = []"," for item in self"," newList.push(callback(item, __item_idx))"," end for"," return newList","end function","myMapFunction = function(item, index)",' print "Mapping value at index: " + index'," return item.myValue","end function",'print [{ "myValue": 24 }].map(@myMapFunction)']},number:{description:"Returns a `map` which enables to extend number types with custom methods.",example:["number.add = function(right)"," return self + right","end function","print (1234).add(1)"]},string:{description:"Returns a `map` which enables to extend string types with custom methods.",example:['string.color = function(colorValue = "red")',' return "<color=" + colorValue + ">" + self + "</color>"',"end function",'print "My text: ".color + "Hello world".color("yellow")']},map:{description:"Returns a `map` which enables to extend map types with custom methods.",example:["map.extend = function(value)"," for item in value"," self[item.key] = item.value"," end for"," return self","end function",'test = {"123":123}','test.extend({"bar": "foo"})','print "My extended value: " + test.bar']}}});var U1=m((P6,HW)=>{HW.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var H1=m((D6,GW)=>{GW.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var G1=m((I6,zW)=>{zW.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var z1=m((M6,VW)=>{VW.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var V1=m(Zu=>{"use strict";var ya=Zu&&Zu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zu,"__esModule",{value:!0});var KW=ya(B1()),XW=ya(W1()),YW=ya(U1()),JW=ya(H1()),QW=ya(G1()),ZW=ya(z1()),eU={any:KW.default,general:XW.default,list:YW.default,map:JW.default,string:ZW.default,number:QW.default};Zu.default=eU});var K1=m((N6,tU)=>{tU.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var X1=m((q6,nU)=>{nU.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"function",arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"function",arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"function",arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var Y1=m((j6,rU)=>{rU.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var J1=m((F6,iU)=>{iU.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var Q1=m(($6,sU)=>{sU.exports={type:"number",definitions:{}}});var Z1=m((B6,oU)=>{oU.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var eR=m((W6,aU)=>{aU.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var PS=m(kn=>{"use strict";var os=kn&&kn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kn,"__esModule",{value:!0});kn.miniscriptMeta=void 0;var uU=xn(),cU=os(V1()),lU=os(K1()),hU=os(X1()),dU=os(Y1()),fU=os(J1()),pU=os(Q1()),gU=os(Z1()),mU=os(eR());kn.miniscriptMeta=new uU.Container;kn.miniscriptMeta.addTypeSignatureFromPayload(lU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(hU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(dU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(fU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(pU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(gU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(mU.default);kn.miniscriptMeta.addMetaFromPayload("en",cU.default)});var ec=m(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var yU=PS(),bU=ea();DS.default=new bU.TypeManager({container:yU.miniscriptMeta})});var NS=m($n=>{"use strict";var LS=$n&&$n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($n,"__esModule",{value:!0});$n.DocumentManager=$n.PROCESSING_TIMEOUT=$n.ActiveDocument=$n.DocumentURIBuilder=void 0;var _U=LS(require("events")),vU=Yr(),SU=LS(Ff()),IS=$1(),as=RS(),tc=ji(),TU=LS(ec()),nc=class t{static async fromTextDocument(e,n){let r=as.URI.parse(e.uri),i=await n.fs.getWorkspaceFolderUri(r);return new t(as.Utils.joinPath(r,".."),i)}constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){return this.workspaceFolderUri==null?(console.warn("Workspace folders are not available. Falling back to only relative paths."),as.Utils.joinPath(this.rootPath,e).toString()):as.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return as.Utils.joinPath(this.rootPath,e).toString()}getAlternativePathsWithContext(e,n){return e.startsWith("/")?n.getConfiguration().fileExtensions.map(r=>this.getFromWorkspaceFolder(`${e}.${r}`)):n.getConfiguration().fileExtensions.map(r=>this.getFromRootPath(`${e}.${r}`))}getOriginalPath(e){return e.startsWith("/")?this.getFromWorkspaceFolder(e):this.getFromRootPath(e)}async getPathWithContext(e,n){return n.fs.findExistingPath(this.getOriginalPath(e),...this.getAlternativePathsWithContext(e,n))}};$n.DocumentURIBuilder=nc;var Bf=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return as.Utils.joinPath(as.URI.parse(this.textDocument.uri),"..")}async getImportUris(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new nc(r,e);return(await Promise.all([...n.imports.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,tc.parseDependencyLocation)({type:tc.DependencyType.Import,location:u,args:[a.name?.name]})})])).filter(a=>a!=null)}async getIncludeUris(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new nc(r,e);return(await Promise.all([...n.includes.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,tc.parseDependencyLocation)({type:tc.DependencyType.Include,location:u})})])).filter(a=>a!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(as.URI.parse(this.textDocument.uri)),[n,r]=await Promise.all([this.getImportUris(e),this.getIncludeUris(e)]),i=new Set([...n,...r]);return this.dependencies=Array.from(i).map(tc.parseDependencyRawLocation),this.dependencies}async getImports(e=!0){if(this.document==null)return[];let n=new Set,r=new Set([this.textDocument.uri]),i=async s=>{let o=await s.getDependencies();for(let a of o){if(r.has(a.location))continue;let u=await this.documentManager.open(a.location);r.add(a.location),u!==null&&(n.add({document:u,location:a}),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};$n.ActiveDocument=Bf;$n.PROCESSING_TIMEOUT=100;var MS=class extends _U.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=$n.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new SU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,IS.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,IS.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new vU.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),TU.default.analyze(e.uri,i),new Bf({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,IS.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};$n.DocumentManager=MS});var rR=m(ba=>{"use strict";var wU=ba&&ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ba,"__esModule",{value:!0});ba.activate=void 0;var tR=Yr(),qS=xn(),EU=wU(require("path")),xU=ia(),nR=Lf(),Wf=Nf(),AU=ji(),kU=NS();function CU(t){async function e(n,r){let i=new nR.MarkdownString(""),o=r.closest.path,u=await(await kU.DocumentURIBuilder.fromTextDocument(n,t)).getPathWithContext(o,t),c=u==null?["Cannot open file."]:[`[Inserts file "${EU.default.basename(u)}" inside this code when building](${u.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(c.join(`
|
152
|
-
`)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=new
|
153
|
-
`),ht.String),this.next()}processNumericLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,ht.Number,0),this.next()}processBooleanLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,ht.Constant,0),this.next()}processNilLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,ht.Constant,0),this.next()}processIdentifier(){let e=this.token;if(he.Selectors.MemberSeperator(this.previousToken)){let s=
|
151
|
+
hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."},funcRef:{description:"Returns a `map` which enables to extend function references with custom methods.",example:["funcRef.signature = function"," return str(@self)","end function","print (@print).signature"]},list:{description:"Returns a `map` which enables to extend list types with custom methods.",example:["list.map = function(callback)"," newList = []"," for item in self"," newList.push(callback(item, __item_idx))"," end for"," return newList","end function","myMapFunction = function(item, index)",' print "Mapping value at index: " + index'," return item.myValue","end function",'print [{ "myValue": 24 }].map(@myMapFunction)']},number:{description:"Returns a `map` which enables to extend number types with custom methods.",example:["number.add = function(right)"," return self + right","end function","print (1234).add(1)"]},string:{description:"Returns a `map` which enables to extend string types with custom methods.",example:['string.color = function(colorValue = "red")',' return "<color=" + colorValue + ">" + self + "</color>"',"end function",'print "My text: ".color + "Hello world".color("yellow")']},map:{description:"Returns a `map` which enables to extend map types with custom methods.",example:["map.extend = function(value)"," for item in value"," self[item.key] = item.value"," end for"," return self","end function",'test = {"123":123}','test.extend({"bar": "foo"})','print "My extended value: " + test.bar']}}});var iR=m((c8,yU)=>{yU.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var sR=m((l8,bU)=>{bU.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var oR=m((h8,_U)=>{_U.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var aR=m((d8,vU)=>{vU.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var uR=m(ec=>{"use strict";var _a=ec&&ec.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ec,"__esModule",{value:!0});var SU=_a(nR()),TU=_a(rR()),wU=_a(iR()),EU=_a(sR()),xU=_a(oR()),AU=_a(aR()),kU={any:SU.default,general:TU.default,list:wU.default,map:EU.default,string:AU.default,number:xU.default};ec.default=kU});var cR=m((p8,CU)=>{CU.exports={type:"any",definitions:{insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["null"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:["list"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]}}}});var lR=m((g8,OU)=>{OU.exports={type:"general",definitions:{hasIndex:{id:"hasIndex",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{id:"print",type:"function",tags:["function"],arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{id:"indexes",type:"function",tags:["function"],arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{id:"values",type:"function",tags:["function"],arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{id:"indexOf",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{id:"len",type:"function",tags:["function"],arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{id:"shuffle",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{id:"val",type:"function",tags:["function"],arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{id:"lower",type:"function",tags:["function"],arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{id:"upper",type:"function",tags:["function"],arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{id:"sum",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{id:"pop",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{id:"pull",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{id:"push",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{id:"sort",type:"function",tags:["function"],arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{id:"remove",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{id:"wait",type:"function",tags:["function"],arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{id:"abs",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{id:"acos",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{id:"asin",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{id:"atan",type:"function",tags:["function"],arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{id:"tan",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{id:"cos",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{id:"code",type:"function",tags:["function"],arguments:[{label:"value",type:"string"}],returns:["number"]},char:{id:"char",type:"function",tags:["function"],arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{id:"sin",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{id:"floor",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{id:"range",type:"function",tags:["function"],arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{id:"round",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{id:"rnd",type:"function",tags:["function"],arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{id:"sign",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{id:"sqrt",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{id:"str",type:"function",tags:["function"],arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{id:"ceil",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{id:"pi",type:"function",tags:["function"],returns:["number"]},slice:{id:"slice",type:"function",tags:["function"],arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{id:"hash",type:"function",tags:["function"],arguments:[{label:"value",type:"any"}],returns:["number"]},time:{id:"time",type:"function",tags:["function"],returns:["number"]},bitAnd:{id:"bitAnd",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{id:"bitOr",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{id:"bitXor",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{id:"log",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{id:"yield",type:"function",tags:["function"],returns:["null"]},insert:{id:"insert",type:"function",tags:["function"],arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{id:"join",type:"function",tags:["function"],arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{id:"split",type:"function",tags:["function"],arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{id:"replace",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{id:"funcRef",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},list:{id:"list",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},map:{id:"map",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},number:{id:"number",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},string:{id:"string",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},refEquals:{id:"refEquals",type:"function",tags:["function"],arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{id:"stackTrace",type:"function",tags:["function"],returns:[{type:"list",valueType:"string"}]},version:{id:"version",type:"function",tags:["function"],returns:["version"]}}}});var hR=m((m8,RU)=>{RU.exports={type:"list",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{id:"sort",type:"function",tags:["method"],arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{id:"join",type:"function",tags:["method"],arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:[{type:"list",valueType:"number"}]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var dR=m((y8,DU)=>{DU.exports={type:"map",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["number"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:["list"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var fR=m((b8,PU)=>{PU.exports={type:"number",definitions:{}}});var pR=m((_8,IU)=>{IU.exports={type:"string",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{id:"split",type:"function",tags:["method"],arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:[{type:"list",valueType:"number"}]},code:{id:"code",type:"function",tags:["method"],returns:["number"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},lower:{id:"lower",type:"function",tags:["method"],returns:["string"]},upper:{id:"upper",type:"function",tags:["method"],returns:["string"]},val:{id:"val",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:[{type:"list",valueType:"string"}]}}}});var gR=m((v8,MU)=>{MU.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string",tags:[]},buildDate:{type:"string",tags:[]},host:{type:"number",tags:[]},hostName:{type:"string",tags:[]},hostInfo:{type:"string",tags:[]}}}});var qS=m(kn=>{"use strict";var us=kn&&kn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kn,"__esModule",{value:!0});kn.miniscriptMeta=void 0;var LU=gn(),NU=us(uR()),qU=us(cR()),jU=us(lR()),FU=us(hR()),$U=us(dR()),BU=us(fR()),WU=us(pR()),UU=us(gR());kn.miniscriptMeta=new LU.Container;kn.miniscriptMeta.addTypeSignatureFromPayload(qU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(jU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(FU.default);kn.miniscriptMeta.addTypeSignatureFromPayload($U.default);kn.miniscriptMeta.addTypeSignatureFromPayload(BU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(WU.default);kn.miniscriptMeta.addTypeSignatureFromPayload(UU.default);kn.miniscriptMeta.addMetaFromPayload("en",NU.default)});var tc=m(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var HU=qS(),GU=na();jS.default=new GU.TypeManager({container:HU.miniscriptMeta})});var WS=m($n=>{"use strict";var BS=$n&&$n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($n,"__esModule",{value:!0});$n.DocumentManager=$n.PROCESSING_TIMEOUT=$n.ActiveDocument=$n.DocumentURIBuilder=void 0;var zU=BS(require("events")),KU=Qr(),VU=BS(Hf()),FS=tR(),cs=NS(),nc=$i(),XU=BS(tc()),rc=class t{static async fromTextDocument(e,n){let r=cs.URI.parse(e.uri),i=await n.fs.getWorkspaceFolderUri(r);return new t(cs.Utils.joinPath(r,".."),i)}constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){return this.workspaceFolderUri==null?(console.warn("Workspace folders are not available. Falling back to only relative paths."),cs.Utils.joinPath(this.rootPath,e).toString()):cs.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return cs.Utils.joinPath(this.rootPath,e).toString()}getAlternativePathsWithContext(e,n){return e.startsWith("/")?n.getConfiguration().fileExtensions.map(r=>this.getFromWorkspaceFolder(`${e}.${r}`)):n.getConfiguration().fileExtensions.map(r=>this.getFromRootPath(`${e}.${r}`))}getOriginalPath(e){return e.startsWith("/")?this.getFromWorkspaceFolder(e):this.getFromRootPath(e)}async getPathWithContext(e,n){return n.fs.findExistingPath(this.getOriginalPath(e),...this.getAlternativePathsWithContext(e,n))}};$n.DocumentURIBuilder=rc;var zf=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return cs.Utils.joinPath(cs.URI.parse(this.textDocument.uri),"..")}async getImportUris(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new rc(r,e);return(await Promise.all([...n.imports.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,nc.parseDependencyLocation)({type:nc.DependencyType.Import,location:u,args:[a.name?.name]})})])).filter(a=>a!=null)}async getIncludeUris(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new rc(r,e);return(await Promise.all([...n.includes.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,nc.parseDependencyLocation)({type:nc.DependencyType.Include,location:u})})])).filter(a=>a!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(cs.URI.parse(this.textDocument.uri)),[n,r]=await Promise.all([this.getImportUris(e),this.getIncludeUris(e)]),i=new Set([...n,...r]);return this.dependencies=Array.from(i).map(nc.parseDependencyRawLocation),this.dependencies}async getImports(e=!0){if(this.document==null)return[];let n=new Set,r=new Set([this.textDocument.uri]),i=async s=>{let o=await s.getDependencies();for(let a of o){if(r.has(a.location))continue;let u=await this.documentManager.open(a.location);r.add(a.location),u!==null&&(n.add({document:u,location:a}),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};$n.ActiveDocument=zf;$n.PROCESSING_TIMEOUT=100;var $S=class extends zU.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=$n.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new VU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,FS.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,FS.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new KU.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),XU.default.analyze(e.uri,i),new zf({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,FS.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};$n.DocumentManager=$S});var bR=m(va=>{"use strict";var YU=va&&va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(va,"__esModule",{value:!0});va.activate=void 0;var mR=Qr(),US=gn(),JU=YU(require("path")),QU=oa(),yR=$f(),Kf=Bf(),ZU=$i(),e5=WS();function t5(t){async function e(n,r){let i=new yR.MarkdownString(""),o=r.closest.path,u=await(await e5.DocumentURIBuilder.fromTextDocument(n,t)).getPathWithContext(o,t),c=u==null?["Cannot open file."]:[`[Inserts file "${JU.default.basename(u)}" inside this code when building](${u.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(c.join(`
|
152
|
+
`)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=new QU.LookupHelper(r,t),s=await i.lookupAST(n.position);if(!s)return;if(s.closest.type===mR.ASTType.FeatureImportExpression||s.closest.type===mR.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,Kf.createHover)(o);let a=new yR.MarkdownString(""),u=o.toMeta().map(US.SignatureDefinitionTypeMeta.parse),c=`(${(0,Kf.formatKind)(o.kind)}) ${o.label}: ${(0,Kf.formatTypes)(u)}`;if(o.types.has(US.SignatureDefinitionBaseType.Map)){let l={};for(let[h,d]of o.values){let g=d.toMeta().map(US.SignatureDefinitionTypeMeta.parse);l[h.slice(2)]=(0,Kf.formatTypes)(g)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(ZU.LanguageId,c),{contents:a.toString()}})}va.activate=t5});var vR=m(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.activate=void 0;var _R=Ee(),n5=oa(),r5=Bf(),i5=t=>{if(t.closest.type===_R.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===_R.ASTType.CallExpression)return n}return null};function s5(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;await t.documentManager.getLatest(n);let r=new n5.LookupHelper(n,t),i=await r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=i5(i);if(o===null)return;let a=await r.lookupTypeInfo({closest:o.base,outer:s.scope?[s.scope]:[]});if(!a||!a.isCallable())return;let c=o.arguments.findIndex(h=>{let d=h.start.character-1,g=h.end.character;return d<=e.position.character&&g>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,r5.createSignatureInfo)(a)),l})}Vf.activate=s5});var TR=m(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.activate=void 0;var SR=$i();function o5(t){let e=r=>r.languageId!==SR.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===SR.LanguageId&&t.documentManager.clear(r)};t.fs.on("text-document-open",e),t.fs.on("text-document-change",e),t.fs.on("text-document-close",n)}Xf.activate=o5});var AR=m(Sa=>{"use strict";var a5=Sa&&Sa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.activate=void 0;var wR=Ee(),u5=na(),c5=Cv(),l5=a5(tc()),ER=(t,e,n)=>{let r=e.resolveNamespace(n.variable,!0);if(r==null)return null;let i=(0,u5.createExpressionId)(n.variable),s=r?.kind?(0,c5.getSymbolItemKind)(r.kind):13,o={line:n.variable.start.line-1,character:n.variable.start.character-1},a={line:n.variable.end.line-1,character:n.variable.end.character-1};return{name:i,kind:s,location:{uri:t.uri,range:{start:o,end:a}}}},h5=(t,e,n)=>{switch(n.node.type){case wR.ASTType.AssignmentStatement:return ER(t,e,n.node);case wR.ASTType.ForGenericStatement:return ER(t,e,n.node);default:return null}},xR=(t,e)=>{let n=l5.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){let o=h5(t,n,s);o!=null&&i.push(o)}return i};function d5(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:(await t.documentManager.getLatest(n)).document?xR(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...xR(r,e.query));return n})}Sa.activate=d5});var Jf=m(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.buildTokens=Cn.TokenHandler=Cn.semanticTokensLegend=Cn.SemanticTokenModifier=Cn.SemanticTokenType=void 0;var Rr=Qr(),he=Ee(),f5=qS(),kR=(t,e)=>!!f5.miniscriptMeta.getDefinition(t,e),ht;(function(t){t[t.Keyword=0]="Keyword",t[t.String=1]="String",t[t.Number=2]="Number",t[t.Variable=3]="Variable",t[t.Property=4]="Property",t[t.Function=5]="Function",t[t.Parameter=6]="Parameter",t[t.Operator=7]="Operator",t[t.Comment=8]="Comment",t[t.Constant=9]="Constant",t[t.Punctuator=10]="Punctuator"})(ht=Cn.SemanticTokenType||(Cn.SemanticTokenType={}));var HS;(function(t){t[t.Declaration=0]="Declaration",t[t.Definition=1]="Definition",t[t.Readonly=2]="Readonly",t[t.Static=3]="Static",t[t.Deprecated=4]="Deprecated",t[t.Abstract=5]="Abstract",t[t.Async=6]="Async",t[t.Modification=7]="Modification",t[t.Documentation=8]="Documentation",t[t.DefaultLibrary=9]="DefaultLibrary"})(HS=Cn.SemanticTokenModifier||(Cn.SemanticTokenModifier={}));Cn.semanticTokensLegend={tokenTypes:["keyword","string","number","variable","property","function","parameter","operator","comment","constant","punctuator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]};var CR=t=>1<<t,Yf=class{constructor(e,n){this._lexer=e,this._builder=n}next(){this.previousToken=this.token,this.token=this._lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}processMultilineToken(e,n,r){if(n.length>1){this._builder.push(e.start.line-1,e.start.character-1,n[0].length,r,0);for(let i=1;i<n.length;i++)this._builder.push(e.start.line+i-1,0,n[i].length,r,0)}else this._builder.push(e.start.line-1,e.start.character-1,n[0].length,r,0)}processFunction(){let e=this;if(!he.SelectorGroups.BlockEndOfLine(e.token)){if(!e.consume(he.Selectors.LParenthesis))return;for(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,ht.Punctuator,0);!he.SelectorGroups.FunctionDeclarationArgEnd(e.token);){if(e.token.type!==he.TokenType.Identifier)return;if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,ht.Parameter,0),e.next(),e.consume(he.Selectors.Assign))for(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,ht.Operator,0);!he.Selectors.ArgumentSeperator(e.token)&&!he.Selectors.RParenthesis(e.token)&&!he.Selectors.EndOfLine(e.token);)e.process();if(!he.Selectors.RParenthesis(e.token)){if(!he.Selectors.ArgumentSeperator(e.token))return;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,ht.Punctuator,0),e.next()}}if(e.consume(he.Selectors.RParenthesis)){e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,ht.Punctuator,0);return}}}processPathSegment(){let e=this;if(this.token.type===he.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,ht.String,0),this.next();return}let n="";for(;!Rr.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,ht.String,0),n=n+e.token.value,e.next();return e.consumeMany(Rr.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,ht.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e.token.type===he.TokenType.StringLiteral&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,ht.String,0),e.next())}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.token.type===he.TokenType.Identifier&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,ht.Variable,0),e.next(),e.consume(Rr.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,ht.Keyword,0),e.processPathSegment()))}processFeatureIncludeStatement(){this.processPathSegment()}processKeyword(){let e=this.token;switch(this._builder.push(e.start.line-1,e.start.character-1,e.value.length,ht.Keyword,0),this.next(),e.value){case he.Keyword.Function:{this.processFunction();return}case Rr.GreybelKeyword.Include:case Rr.GreybelKeyword.IncludeWithComment:{this.processFeatureIncludeStatement();return}case Rr.GreybelKeyword.Import:case Rr.GreybelKeyword.ImportWithComment:{this.processFeatureImportStatement();return}case Rr.GreybelKeyword.Envar:{this.processFeatureEnvarExpression();return}case Rr.GreybelKeyword.Inject:{this.processFeatureInjectExpression();return}case Rr.GreybelKeyword.Debugger:return}}processStringLiteral(){let e=this.token;this.processMultilineToken(e,e.raw.split(`
|
153
|
+
`),ht.String),this.next()}processNumericLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,ht.Number,0),this.next()}processBooleanLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,ht.Constant,0),this.next()}processNilLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,ht.Constant,0),this.next()}processIdentifier(){let e=this.token;if(he.Selectors.MemberSeperator(this.previousToken)){let s=kR(["any"],e.value)?CR(HS.DefaultLibrary):0;this._builder.push(e.start.line-1,e.start.character-1,e.value.length,ht.Property,s),this.next();return}let r=kR(["general"],e.value)?CR(HS.DefaultLibrary):0;this._builder.push(e.start.line-1,e.start.character-1,e.value.length,ht.Variable,r),this.next()}processPunctuator(){let e=this.token;switch(e.value){case he.Operator.Plus:case he.Operator.Asterik:case he.Operator.Minus:case he.Operator.Slash:case he.Operator.Power:case he.Operator.Modulo:case he.Operator.LessThan:case he.Operator.LessThanOrEqual:case he.Operator.GreaterThan:case he.Operator.GreaterThanOrEqual:case he.Operator.Equal:case he.Operator.NotEqual:case he.Operator.Assign:case he.Operator.AddShorthand:case he.Operator.SubtractShorthand:case he.Operator.MultiplyShorthand:case he.Operator.DivideShorthand:case he.Operator.ModuloShorthand:case he.Operator.PowerShorthand:case he.Operator.Reference:{this._builder.push(e.start.line-1,e.start.character-1,e.value.length,ht.Operator,0);break}default:{this._builder.push(e.start.line-1,e.start.character-1,e.value.length,ht.Punctuator,0);break}}this.next()}processComment(){this.token.lastLine!=null?this.processMultilineToken(this.token,`/*${this.token.value}*/`.split(`
|
154
154
|
`),ht.Comment):this.processMultilineToken(this.token,`//${this.token.value}`.split(`
|
155
|
-
`),ht.Comment),this.next()}process(){let e=this;switch(e.token.type){case he.TokenType.Keyword:{this.processKeyword();break}case he.TokenType.StringLiteral:{this.processStringLiteral();break}case he.TokenType.Identifier:{this.processIdentifier();break}case he.TokenType.NumericLiteral:{this.processNumericLiteral();break}case he.TokenType.Punctuator:case he.TokenType.SliceOperator:{this.processPunctuator();break}case he.TokenType.BooleanLiteral:{this.processBooleanLiteral();break}case he.TokenType.NilLiteral:{this.processNilLiteral();break}case he.TokenType.Comment:{this.processComment();break}default:e.next()}}digest(){let e=this;for(e.next();!he.Selectors.EndOfFile(e.token);)e.process()}};Cn.TokenHandler=Gf;function BU(t,e){let n=new Cr.Lexer(e.content,{unsafe:!0});return new Gf(n,t).digest(),t}Cn.buildTokens=BU});var pR=m(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.activate=void 0;var WU=zf();function UU(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,WU.buildTokens)(i,r),i.build()})}Vf.activate=UU});var gR=m(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.buildFoldingRanges=void 0;var Zr=Ee(),FS=Lm(),HU=Vd();function GU(t){let e=[];return new HU.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Zr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:FS.FoldingRangeKind.Comment}),null;case Zr.ASTType.MapConstructorExpression:case Zr.ASTType.ListConstructorExpression:case Zr.ASTType.StringLiteral:case Zr.ASTType.WhileStatement:case Zr.ASTType.ForGenericStatement:case Zr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:FS.FoldingRangeKind.Region}),null;case Zr.ASTType.IfClause:case Zr.ASTType.ElseifClause:case Zr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:FS.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}Kf.buildFoldingRanges=GU});var mR=m(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.activate=void 0;var zU=gR();function VU(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n);if(r.document)return(0,zU.buildFoldingRanges)(r)})}Xf.activate=VU});var _R=m((e8,bR)=>{var $S=Object.defineProperty,KU=Object.getOwnPropertyDescriptor,XU=Object.getOwnPropertyNames,YU=Object.prototype.hasOwnProperty,JU=(t,e)=>{for(var n in e)$S(t,n,{get:e[n],enumerable:!0})},QU=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of XU(e))!YU.call(t,i)&&i!==n&&$S(t,i,{get:()=>e[i],enumerable:!(r=KU(e,i))||r.enumerable});return t},ZU=t=>QU($S({},"__esModule",{value:!0}),t),yR={};JU(yR,{toposort:()=>BS,toposortWithEdges:()=>n5,toposortWithGraph:()=>r5});bR.exports=ZU(yR);function e5(t,e){let n=new Array(t.size);for(let r=0,i=t.size;r<i;r++)n[r]=new Set;for(let r=0,i=e.length;r<i;r++){let[s,o]=e[r],a=t.get(s),u=t.get(o);a==null||u==null||n[a].add(u)}return n}function t5(t){let e=new Map;for(let n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}function n5(t){let e=Array.from(new Set(t.flat()));return BS(e,t)}function r5(t){let e=Array.from(new Set(Object.keys(t))),n=new Set(e),r=[];for(let i=0,s=e.length;i<s;i++){let o=e[i],a=Array.from(new Set(t[o]));for(let u=0,c=a.length;u<c;u++)r.push([o,a[u]]),n.add(a[u])}return BS(Array.from(n),r)}function BS(t,e){let n=t5(t),r=e5(n,e),i=new Array(t.length).fill(0);for(let a=0,u=r.length;a<u;a++)r[a].forEach(c=>{i[c]+=1});let s=[];i.forEach((a,u)=>{a===0&&s.push(u)});let o=[];for(;s.length>0;){let a=s.shift();o.push(t[a]),r[a].forEach(u=>{--i[u]===0&&s.push(u)})}if(o.length!==r.length)throw new Error(`Cyclic dependency detected: ${i5(o,n,r)?.map(a=>t[a]).join(" -> ")}`);return o}function i5(t,e,n){let r=new Set(t.map(a=>e.get(a))),i=null;function s(a,u){if(u.has(a))return!0;if(r.has(a))return!1;r.add(a),u.add(a);let c=Array.from(n[a]);for(let l=0,h=c.length;l<h;l++)if(s(c[l],u))return i==null&&(i=[a,c[l]]),!0;return u.delete(a),!1}let o=Array.from(n.keys());for(let a=0,u=o.length;a<u;a++)if(!r.has(o[a])&&s(o[a],new Set))return i;return null}});var vR=m(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.hash=void 0;function s5(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Yf.hash=s5});var ER=m(va=>{"use strict";var wR=va&&va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(va,"__esModule",{value:!0});va.DocumentMerger=void 0;var o5=wR(Ff()),a5=_R(),SR=ji(),TR=vR(),Jf=wR(ec()),WS=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new o5.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,TR.hash)(`main-${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,TR.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=Jf.default.get(i);if(r.set(i,null),!s)return null;let o=[],u=await(await n.documentManager.getLatest(e)).getImports(),c=this.createCacheKey(e,u.map(d=>d.document));if(this.results.has(c))return this.results.get(c);this.registerCacheKey(c,i);let l=await n.documentManager.get(e).getDependencies();await Promise.all(l.map(async d=>{let g=n.documentManager.results.get(d.location);if(!g)return;let{document:y,textDocument:b}=g;if(!y)return;let C=await this.processByDependencies(b,n,r);C!==null&&o.push(C)}));let h=s.merge(...o);return r.set(i,h),this.results.set(c,h),h}async buildByDependencies(e,n){let r=e.uri,i=Jf.default.get(r);if(!i)return null;let o=await(await n.documentManager.getLatest(e)).getImports(),a=this.createCacheKey(e,o.map(g=>g.document));if(this.results.has(a))return this.results.get(a);let u=[],c=[];this.registerCacheKey(a,r);let l=await n.documentManager.get(e).getDependencies(),h=new Map([[r,null]]);await Promise.all(l.map(async g=>{let y=n.documentManager.results.get(g.location);if(!y)return;let{document:b,textDocument:C}=y;if(!b)return;let A=await this.processByDependencies(C,n,h);if(A!==null){if(g.type===SR.DependencyType.Import){c.push({namespace:g.args[0],typeDoc:A});return}u.push(A)}}));let d=i.merge(...u);return c.forEach((g,y)=>{let b=g.typeDoc.getRootScopeContext().scope.resolveNamespace("module",!0)?.resolveProperty("exports",!0);b!=null&&d.getRootScopeContext().scope.setProperty(g.namespace??`unknown${y}`,b,!0)}),this.results.set(a,d),d}async buildByWorkspace(e,n){let r=e.uri,i=Jf.default.get(r);if(!i)return null;let s=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let c=a.map(g=>g.textDocument.uri),l=await Promise.all(a.map(async g=>(await g.getDependencies()).map(b=>[g.textDocument.uri,b.location]))),h=(0,a5.toposort)(c,l.flat());for(let g=h.length-1;g>=0;g--){let y=h[g];if(y===r)continue;let b=Jf.default.get(y);if(b===null)return;s.push(b)}let d=i.merge(...s);return this.results.set(u,d),d}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===SR.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};va.DocumentMerger=WS});var kR=m(Sa=>{"use strict";var u5=Sa&&Sa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.CoreContext=void 0;var c5=u5(require("events")),rc=ji(),xR=zf();function AR(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):rc.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??rc.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??rc.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var US=class extends c5.default{constructor(){super(),this._configuration=AR(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(rc.ConfigurationNamespace),n=AR(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:rc.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:xR.semanticTokensLegend.tokenTypes,tokenModifiers:xR.semanticTokensLegend.tokenModifiers},full:!0},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};Sa.CoreContext=US});var Qf=m(z=>{"use strict";var l5=z&&z.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),h5=z&&z.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),d5=z&&z.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&l5(e,t,n);return h5(e,t),e},f5=z&&z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(z,"__esModule",{value:!0});z.CoreContext=z.buildTokens=z.semanticTokensLegend=z.lookupBase=z.lookupIdentifier=z.typeAnalyzer=z.appendTooltipHeader=z.appendTooltipBody=z.formatTypes=z.formatDefaultValue=z.createTooltipHeader=z.createSignatureInfo=z.createHover=z.MarkdownString=z.LookupHelper=z.DocumentMerger=z.DocumentManager=z.ActiveDocument=z.ASTScraper=z.activateFoldingRange=z.activateSemantic=z.activateSymbol=z.activateSubscriptions=z.activateSignature=z.activateHover=z.activateFormatter=z.activateDiagnostic=z.activateDefinition=z.activateColor=z.activateAutocomplete=z.DefaultFileExtensions=z.TypeAnalyzerStrategy=z.ConfigurationNamespace=z.LanguageId=z.IndentationType=void 0;var ic=ji();Object.defineProperty(z,"IndentationType",{enumerable:!0,get:function(){return ic.IndentationType}});Object.defineProperty(z,"LanguageId",{enumerable:!0,get:function(){return ic.LanguageId}});Object.defineProperty(z,"ConfigurationNamespace",{enumerable:!0,get:function(){return ic.ConfigurationNamespace}});Object.defineProperty(z,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return ic.TypeAnalyzerStrategy}});Object.defineProperty(z,"DefaultFileExtensions",{enumerable:!0,get:function(){return ic.DefaultFileExtensions}});var p5=jO();Object.defineProperty(z,"activateAutocomplete",{enumerable:!0,get:function(){return p5.activate}});var g5=KO();Object.defineProperty(z,"activateColor",{enumerable:!0,get:function(){return g5.activate}});var m5=YO();Object.defineProperty(z,"activateDefinition",{enumerable:!0,get:function(){return m5.activate}});var y5=JO();Object.defineProperty(z,"activateDiagnostic",{enumerable:!0,get:function(){return y5.activate}});var b5=A1();Object.defineProperty(z,"activateFormatter",{enumerable:!0,get:function(){return b5.activate}});var _5=rR();Object.defineProperty(z,"activateHover",{enumerable:!0,get:function(){return _5.activate}});var v5=sR();Object.defineProperty(z,"activateSignature",{enumerable:!0,get:function(){return v5.activate}});var S5=aR();Object.defineProperty(z,"activateSubscriptions",{enumerable:!0,get:function(){return S5.activate}});var T5=hR();Object.defineProperty(z,"activateSymbol",{enumerable:!0,get:function(){return T5.activate}});var w5=pR();Object.defineProperty(z,"activateSemantic",{enumerable:!0,get:function(){return w5.activate}});var E5=mR();Object.defineProperty(z,"activateFoldingRange",{enumerable:!0,get:function(){return E5.activate}});z.ASTScraper=d5(Vd());var CR=NS();Object.defineProperty(z,"ActiveDocument",{enumerable:!0,get:function(){return CR.ActiveDocument}});Object.defineProperty(z,"DocumentManager",{enumerable:!0,get:function(){return CR.DocumentManager}});var x5=ER();Object.defineProperty(z,"DocumentMerger",{enumerable:!0,get:function(){return x5.DocumentMerger}});var A5=ia();Object.defineProperty(z,"LookupHelper",{enumerable:!0,get:function(){return A5.LookupHelper}});var k5=Lf();Object.defineProperty(z,"MarkdownString",{enumerable:!0,get:function(){return k5.MarkdownString}});var Qs=Nf();Object.defineProperty(z,"createHover",{enumerable:!0,get:function(){return Qs.createHover}});Object.defineProperty(z,"createSignatureInfo",{enumerable:!0,get:function(){return Qs.createSignatureInfo}});Object.defineProperty(z,"createTooltipHeader",{enumerable:!0,get:function(){return Qs.createTooltipHeader}});Object.defineProperty(z,"formatDefaultValue",{enumerable:!0,get:function(){return Qs.formatDefaultValue}});Object.defineProperty(z,"formatTypes",{enumerable:!0,get:function(){return Qs.formatTypes}});Object.defineProperty(z,"appendTooltipBody",{enumerable:!0,get:function(){return Qs.appendTooltipBody}});Object.defineProperty(z,"appendTooltipHeader",{enumerable:!0,get:function(){return Qs.appendTooltipHeader}});var C5=ec();Object.defineProperty(z,"typeAnalyzer",{enumerable:!0,get:function(){return f5(C5).default}});var OR=Ev();Object.defineProperty(z,"lookupIdentifier",{enumerable:!0,get:function(){return OR.lookupIdentifier}});Object.defineProperty(z,"lookupBase",{enumerable:!0,get:function(){return OR.lookupBase}});var RR=zf();Object.defineProperty(z,"semanticTokensLegend",{enumerable:!0,get:function(){return RR.semanticTokensLegend}});Object.defineProperty(z,"buildTokens",{enumerable:!0,get:function(){return RR.buildTokens}});var O5=kR();Object.defineProperty(z,"CoreContext",{enumerable:!0,get:function(){return O5.CoreContext}})});var MR={};JP(MR,{TextDocument:()=>HS});function GS(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);GS(r,e),GS(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function PR(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);DR(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function DR(t){return t===13||t===10}function IR(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function R5(t){let e=IR(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Zf,HS,LR=YP(()=>{"use strict";Zf=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=IR(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,l=PR(r.text,!1,s);if(u-a===l.length)for(let d=0,g=l.length;d<g;d++)c[d+a+1]=l[d];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));let h=r.text.length-(o-s);if(h!==0)for(let d=a+1+l.length,g=c.length;d<g;d++)c[d]=c[d]+h}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=PR(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&DR(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(t){function e(i,s,o,a){return new Zf(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Zf)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=GS(s.map(R5),(l,h)=>{let d=l.range.start.line-h.range.start.line;return d===0?l.range.start.character-h.range.start.character:d}),u=0,c=[];for(let l of a){let h=i.offsetAt(l.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&c.push(o.substring(u,h)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(HS||(HS={}))});var $R=m((s8,FR)=>{"use strict";FR.exports=qR;function qR(t,e,n){t instanceof RegExp&&(t=NR(t,n)),e instanceof RegExp&&(e=NR(e,n));var r=jR(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function NR(t,e){var n=e.match(t);return n?n[0]:null}qR.range=jR;function jR(t,e,n){var r,i,s,o,a,u=n.indexOf(t),c=n.indexOf(e,u+1),l=u;if(u>=0&&c>0){if(t===e)return[u,c];for(r=[],s=n.length;l>=0&&!a;)l==u?(r.push(l),u=n.indexOf(t,l+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i<s&&(s=i,o=c),c=n.indexOf(e,l+1)),l=u<c&&u>=0?u:c;r.length&&(a=[s,o])}return a}});var KR=m((o8,VR)=>{var BR=$R();VR.exports=I5;var WR="\0SLASH"+Math.random()+"\0",UR="\0OPEN"+Math.random()+"\0",VS="\0CLOSE"+Math.random()+"\0",HR="\0COMMA"+Math.random()+"\0",GR="\0PERIOD"+Math.random()+"\0";function zS(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function P5(t){return t.split("\\\\").join(WR).split("\\{").join(UR).split("\\}").join(VS).split("\\,").join(HR).split("\\.").join(GR)}function D5(t){return t.split(WR).join("\\").split(UR).join("{").split(VS).join("}").split(HR).join(",").split(GR).join(".")}function zR(t){if(!t)return[""];var e=[],n=BR("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=zR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function I5(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),sc(P5(t),!0).map(D5)):[]}function M5(t){return"{"+t+"}"}function L5(t){return/^-?0\d/.test(t)}function N5(t,e){return t<=e}function q5(t,e){return t>=e}function sc(t,e){var n=[],r=BR("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?sc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),l=u||c,h=r.body.indexOf(",")>=0;if(!l&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+VS+r.post,sc(t)):[t];var d;if(l)d=r.body.split(/\.\./);else if(d=zR(r.body),d.length===1&&(d=sc(d[0],!1).map(M5),d.length===1))return s.map(function(W){return r.pre+d[0]+W});var g;if(l){var y=zS(d[0]),b=zS(d[1]),C=Math.max(d[0].length,d[1].length),A=d.length==3?Math.abs(zS(d[2])):1,w=N5,T=b<y;T&&(A*=-1,w=q5);var v=d.some(L5);g=[];for(var L=y;w(L,b);L+=A){var R;if(c)R=String.fromCharCode(L),R==="\\"&&(R="");else if(R=String(L),v){var B=C-R.length;if(B>0){var ee=new Array(B+1).join("0");L<0?R="-"+ee+R.slice(1):R=ee+R}}g.push(R)}}else{g=[];for(var re=0;re<d.length;re++)g.push.apply(g,sc(d[re],!1))}for(var re=0;re<g.length;re++)for(var o=0;o<s.length;o++){var a=i+g[re]+s[o];(!e||l||a)&&n.push(a)}}return n}});var XR=m(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.assertValidPattern=void 0;var j5=1024*64,F5=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>j5)throw new TypeError("pattern is too long")};ep.assertValidPattern=F5});var JR=m(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.parseClass=void 0;var $5={"[: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]},oc=t=>t.replace(/[[\]\\-]/g,"\\$&"),B5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),YR=t=>t.join(""),W5=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,u=!1,c=!1,l=n,h="";e:for(;s<t.length;){let b=t.charAt(s);if((b==="!"||b==="^")&&s===n+1){c=!0,s++;continue}if(b==="]"&&o&&!u){l=s+1;break}if(o=!0,b==="\\"&&!u){u=!0,s++;continue}if(b==="["&&!u){for(let[C,[A,w,T]]of Object.entries($5))if(t.startsWith(C,s)){if(h)return["$.",!1,t.length-n,!0];s+=C.length,T?i.push(A):r.push(A),a=a||w;continue e}}if(u=!1,h){b>h?r.push(oc(h)+"-"+oc(b)):b===h&&r.push(oc(b)),h="",s++;continue}if(t.startsWith("-]",s+1)){r.push(oc(b+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=b,s+=2;continue}r.push(oc(b)),s++}if(l<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!c){let b=r[0].length===2?r[0].slice(-1):r[0];return[B5(b),!1,l-n,!1]}let d="["+(c?"^":"")+YR(r)+"]",g="["+(c?"":"^")+YR(i)+"]";return[r.length&&i.length?"("+d+"|"+g+")":r.length?d:g,a,l-n,!0]};tp.parseClass=W5});var rp=m(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.unescape=void 0;var U5=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");np.unescape=U5});var YS=m(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.AST=void 0;var H5=JR(),ip=rp(),G5=new Set(["!","?","+","*","@"]),QR=t=>G5.has(t),z5="(?!(?:^|/)\\.\\.?(?:$|/))",sp="(?!\\.)",V5=new Set(["[","."]),K5=new Set(["..","."]),X5=new Set("().*{}+?[]^$\\!"),Y5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),XS="[^/]",ZR=XS+"*?",eP=XS+"+?",KS=class t{type;#e;#t;#s=!1;#r=[];#o;#v;#c;#h=!1;#a;#u;#i=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#h&&this.#c.push(this),this.#v=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.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#v+1;!r.type&&i<r.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#r[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let n=0;n<this.#v;n++){let r=e.#r[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#r.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#r)n.copyIn(r);return n}static#y(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,y="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,y+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(u=!0):b==="]"&&!(g===a+2&&u)&&(o=!1),y+=b;continue}else if(b==="["){o=!0,a=g,u=!1,y+=b;continue}if(!i.noext&&QR(b)&&e.charAt(g)==="("){n.push(y),y="";let C=new t(b,n);g=t.#y(e,C,g,i),n.push(C);continue}y+=b}return n.push(y),g}let c=r+1,l=new t(null,n),h=[],d="";for(;c<e.length;){let g=e.charAt(c++);if(s||g==="\\"){s=!s,d+=g;continue}if(o){c===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(c===a+2&&u)&&(o=!1),d+=g;continue}else if(g==="["){o=!0,a=c,u=!1,d+=g;continue}if(QR(g)&&e.charAt(c)==="("){l.push(d),d="";let y=new t(g,l);l.push(y),c=t.#y(e,y,c,i);continue}if(g==="|"){l.push(d),d="",h.push(l),l=new t(null,n);continue}if(g===")")return d===""&&n.#r.length===0&&(n.#i=!0),l.push(d),d="",n.push(...h,l),c;d+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],c}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#m(),!this.type){let u=this.isStart()&&this.isEnd(),c=this.#r.map(g=>{let[y,b,C,A]=typeof g=="string"?t.#d(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||C,this.#s=this.#s||A,y}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&K5.has(this.#r[0]))){let y=V5,b=n&&y.has(c.charAt(0))||c.startsWith("\\.")&&y.has(c.charAt(2))||c.startsWith("\\.\\.")&&y.has(c.charAt(4)),C=!n&&!e&&y.has(c.charAt(0));l=b?z5:C?sp:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[l+c+h,(0,ip.unescape)(c),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#f(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,ip.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!sp?"":this.#f(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?sp:"")+eP;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?sp:"")+ZR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,ip.unescape)(s),this.#t=!!this.#t,this.#s]}#f(e){return this.#r.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#d(e,n,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(X5.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[c,l,h,d]=(0,H5.parseClass)(e,a);if(h){s+=c,o=o||l,a+=h-1,n=n||d;continue}}if(u==="*"){r&&e==="*"?s+=eP:s+=ZR,n=!0;continue}if(u==="?"){s+=XS,n=!0;continue}s+=Y5(u)}return[s,(0,ip.unescape)(e),!!n,o]}};op.AST=KS});var JS=m(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.escape=void 0;var J5=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");ap.escape=J5});var us=m(Z=>{"use strict";var Q5=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Z,"__esModule",{value:!0});Z.unescape=Z.escape=Z.AST=Z.Minimatch=Z.match=Z.makeRe=Z.braceExpand=Z.defaults=Z.filter=Z.GLOBSTAR=Z.sep=Z.minimatch=void 0;var Z5=Q5(KR()),up=XR(),rP=YS(),eH=JS(),tH=rp(),nH=(t,e,n={})=>((0,up.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new Zs(e,n).match(t));Z.minimatch=nH;var rH=/^\*+([^+@!?\*\[\(]*)$/,iH=t=>e=>!e.startsWith(".")&&e.endsWith(t),sH=t=>e=>e.endsWith(t),oH=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),aH=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),uH=/^\*+\.\*+$/,cH=t=>!t.startsWith(".")&&t.includes("."),lH=t=>t!=="."&&t!==".."&&t.includes("."),hH=/^\.\*+$/,dH=t=>t!=="."&&t!==".."&&t.startsWith("."),fH=/^\*+$/,pH=t=>t.length!==0&&!t.startsWith("."),gH=t=>t.length!==0&&t!=="."&&t!=="..",mH=/^\?+([^+@!?\*\[\(]*)?$/,yH=([t,e=""])=>{let n=iP([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},bH=([t,e=""])=>{let n=sP([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},_H=([t,e=""])=>{let n=sP([t]);return e?r=>n(r)&&r.endsWith(e):n},vH=([t,e=""])=>{let n=iP([t]);return e?r=>n(r)&&r.endsWith(e):n},iP=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},sP=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},oP=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",tP={win32:{sep:"\\"},posix:{sep:"/"}};Z.sep=oP==="win32"?tP.win32.sep:tP.posix.sep;Z.minimatch.sep=Z.sep;Z.GLOBSTAR=Symbol("globstar **");Z.minimatch.GLOBSTAR=Z.GLOBSTAR;var SH="[^/]",TH=SH+"*?",wH="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",EH="(?:(?!(?:\\/|^)\\.).)*?",xH=(t,e={})=>n=>(0,Z.minimatch)(n,t,e);Z.filter=xH;Z.minimatch.filter=Z.filter;var cr=(t,e={})=>Object.assign({},t,e),AH=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Z.minimatch;let e=Z.minimatch;return Object.assign((r,i,s={})=>e(r,i,cr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,cr(t,s))}static defaults(i){return e.defaults(cr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,cr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,cr(t,s))}},unescape:(r,i={})=>e.unescape(r,cr(t,i)),escape:(r,i={})=>e.escape(r,cr(t,i)),filter:(r,i={})=>e.filter(r,cr(t,i)),defaults:r=>e.defaults(cr(t,r)),makeRe:(r,i={})=>e.makeRe(r,cr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,cr(t,i)),match:(r,i,s={})=>e.match(r,i,cr(t,s)),sep:e.sep,GLOBSTAR:Z.GLOBSTAR})};Z.defaults=AH;Z.minimatch.defaults=Z.defaults;var kH=(t,e={})=>((0,up.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Z5.default)(t));Z.braceExpand=kH;Z.minimatch.braceExpand=Z.braceExpand;var CH=(t,e={})=>new Zs(t,e).makeRe();Z.makeRe=CH;Z.minimatch.makeRe=Z.makeRe;var OH=(t,e,n={})=>{let r=new Zs(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};Z.match=OH;Z.minimatch.match=Z.match;var nP=/[?*]|[+@!]\(.*?\)|\[|\]/,RH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Zs=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,up.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||oP,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!nP.test(s[2]))&&!nP.test(s[3]),c=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(c)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],u=r[i+2],c=r[i+3];if(a!==".."||!u||u==="."||u===".."||!c||c==="."||c==="..")continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),C=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),w=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),T=C?3:b?0:void 0,v=w?3:A?0:void 0;if(typeof T=="number"&&typeof v=="number"){let[L,R]=[e[T],n[v]];L.toLowerCase()===R.toLowerCase()&&(n[v]=L,v>T?n=n.slice(v):T>v&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,u=e.length,c=n.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");var l=n[a],h=e[o];if(this.debug(n,l,h),l===!1)return!1;if(l===Z.GLOBSTAR){this.debug("GLOBSTAR",[n,l,h]);var d=o,g=a+1;if(g===c){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var y=e[d];if(this.debug(`
|
156
|
-
globstar while`,e,d,n,g,
|
157
|
-
>>> no match, partial?`,e,d,n,g),d===u))}let b;if(typeof l=="string"?(b=h===l,this.debug("string match",l,h,b)):(b=l.test(h),this.debug("pattern match",l,h,b)),!b)return!1}if(o===u&&a===c)return!0;if(o===u)return r;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,Z.braceExpand)(this.pattern,this.options)}parse(e){(0,up.assertValidPattern)(e);let n=this.options;if(e==="**")return Z.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(fH))?i=n.dot?gH:pH:(r=e.match(rH))?i=(n.nocase?n.dot?aH:oH:n.dot?sH:iH)(r[1]):(r=e.match(mH))?i=(n.nocase?n.dot?bH:yH:n.dot?_H:vH)(r):(r=e.match(uH))?i=n.dot?lH:cH:(r=e.match(hH))&&(i=dH);let s=rP.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?TH:n.dot?wH:EH,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let c=u.map(l=>{if(l instanceof RegExp)for(let h of l.flags.split(""))i.add(h);return typeof l=="string"?RH(l):l===Z.GLOBSTAR?Z.GLOBSTAR:l._src});return c.forEach((l,h)=>{let d=c[h+1],g=c[h-1];l!==Z.GLOBSTAR||g===Z.GLOBSTAR||(g===void 0?d!==void 0&&d!==Z.GLOBSTAR?c[h+1]="(?:\\/|"+r+"\\/)?"+d:c[h]=r:d===void 0?c[h-1]=g+"(?:\\/|"+r+")?":d!==Z.GLOBSTAR&&(c[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+d,c[h+1]=Z.GLOBSTAR))}),c.filter(l=>l!==Z.GLOBSTAR).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],c=i;if(r.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Z.minimatch.defaults(e).Minimatch}};Z.Minimatch=Zs;var PH=YS();Object.defineProperty(Z,"AST",{enumerable:!0,get:function(){return PH.AST}});var DH=JS();Object.defineProperty(Z,"escape",{enumerable:!0,get:function(){return DH.escape}});var IH=rp();Object.defineProperty(Z,"unescape",{enumerable:!0,get:function(){return IH.unescape}});Z.minimatch.AST=rP.AST;Z.minimatch.Minimatch=Zs;Z.minimatch.escape=eH.escape;Z.minimatch.unescape=tH.unescape});var hP=m(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.LRUCache=void 0;var Ta=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,uP=new Set,QS=typeof process=="object"&&process?process:{},cP=(t,e,n,r)=>{typeof QS.emitWarning=="function"?QS.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},cp=globalThis.AbortController,aP=globalThis.AbortSignal;if(typeof cp>"u"){aP=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},cp=class{constructor(){e()}signal=new aP;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=QS.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,cP("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 MH=t=>!uP.has(t),y8=Symbol("type"),cs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),lP=t=>cs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?wa:null:null,wa=class extends Array{constructor(e){super(e),this.fill(0)}},ZS=class t{heap;length;static#e=!1;static create(e){let n=lP(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},eT=class t{#e;#t;#s;#r;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#h;#a;#u;#i;#m;#y;#f;#d;#w;#g;#E;#x;#_;#S;#T;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#_,sizes:e.#E,keyMap:e.#a,keyList:e.#u,valList:e.#i,next:e.#m,prev:e.#y,get head(){return e.#f},get tail(){return e.#d},free:e.#w,isBackgroundFetch:n=>e.#l(n),backgroundFetch:(n,r,i,s)=>e.#j(n,r,i,s),moveToTail:n=>e.#$(n),indexes:n=>e.#k(n),rindexes:n=>e.#C(n),isStale:n=>e.#b(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#c}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#r}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:d,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:b,fetchMethod:C,memoMethod:A,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:L,ignoreFetchAbort:R}=e;if(n!==0&&!cs(n))throw new TypeError("max option must be a nonnegative integer");let B=n?lP(n):Array;if(!B)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=g,this.maxEntrySize=y||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=A,C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=C,this.#T=!!C,this.#a=new Map,this.#u=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#m=new B(n),this.#y=new B(n),this.#f=0,this.#d=0,this.#w=ZS.create(n),this.#c=0,this.#h=0,typeof c=="function"&&(this.#s=c),typeof l=="function"?(this.#r=l,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#S=!!this.#s,this.#p=!!this.#r,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!cs(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!cs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=cs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!cs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}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 ee="LRU_CACHE_UNBOUNDED";MH(ee)&&(uP.add(ee),cP("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ee,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#O(){let e=new wa(this.#e),n=new wa(this.#e);this.#_=e,this.#x=n,this.#D=(s,o,a=Ta.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#b(s)&&this.#P(this.#u[s],"expire")},o+1);u.unref&&u.unref()}},this.#A=s=>{n[s]=e[s]!==0?Ta.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],u=n[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=r||i();let c=s.now-u;s.remainingTTL=a-c}};let r=0,i=()=>{let s=Ta.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let c=(r||i())-u;return a-c},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#A=()=>{};#n=()=>{};#D=()=>{};#b=()=>!1;#R(){let e=new wa(this.#e);this.#h=0,this.#E=e,this.#I=n=>{this.#h-=e[n],e[n]=0},this.#L=(n,r,i,s)=>{if(this.#l(r))return 0;if(!cs(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!cs(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#M=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#h>s;)this.#q(!0)}this.#h+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#I=e=>{};#M=(e,n,r)=>{};#L=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#d;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#f));)n=this.#y[n]}*#C({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#f;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#d));)n=this.#m[n]}#N(e){return e!==void 0&&this.#a.get(this.#u[e])===e}*entries(){for(let e of this.#k())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#C())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#k()){let n=this.#u[e];n!==void 0&&!this.#l(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#C()){let n=this.#u[e];n!==void 0&&!this.#l(this.#i[e])&&(yield n)}}*values(){for(let e of this.#k())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#C())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#k()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(e,n=this){for(let r of this.#k()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}rforEach(e,n=this){for(let r of this.#C()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}purgeStale(){let e=!1;for(let n of this.#C({allowStale:!0}))this.#b(n)&&(this.#P(this.#u[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],i=this.#l(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#_&&this.#x){let o=this.#_[n],a=this.#x[n];if(o&&a){let u=o-(Ta.now()-a);s.ttl=u,s.start=Date.now()}}return this.#E&&(s.size=this.#E[n]),s}dump(){let e=[];for(let n of this.#k({allowStale:!0})){let r=this.#u[n],i=this.#i[n],s=this.#l(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#_&&this.#x){o.ttl=this.#_[n];let a=Ta.now()-this.#x[n];o.start=Math.floor(Date.now()-a)}this.#E&&(o.size=this.#E[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Ta.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,l=this.#L(e,n,r.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#c===0?void 0:this.#a.get(e);if(h===void 0)h=this.#c===0?this.#d:this.#w.length!==0?this.#w.pop():this.#c===this.#e?this.#q(!1):this.#c,this.#u[h]=e,this.#i[h]=n,this.#a.set(e,h),this.#m[this.#d]=h,this.#y[h]=this.#d,this.#d=h,this.#c++,this.#M(h,l,u),u&&(u.set="add"),c=!1;else{this.#$(h);let d=this.#i[h];if(n!==d){if(this.#T&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=d;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#g?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(d,e,"set"),this.#p&&this.#g?.push([d,e,"set"]));if(this.#I(h),this.#M(h,l,u),this.#i[h]=n,u){u.set="replace";let g=d&&this.#l(d)?d.__staleWhileFetching:d;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(i!==0&&!this.#_&&this.#O(),this.#_&&(c||this.#D(h,i,s),u&&this.#n(u,h)),!o&&this.#p&&this.#g){let d=this.#g,g;for(;g=d?.shift();)this.#r?.(...g)}return this}pop(){try{for(;this.#c;){let e=this.#i[this.#f];if(this.#q(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#r?.(...n)}}}#q(e){let n=this.#f,r=this.#u[n],i=this.#i[n];return this.#T&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(i,r,"evict"),this.#p&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#u[n]=void 0,this.#i[n]=void 0,this.#w.push(n)),this.#c===1?(this.#f=this.#d=0,this.#w.length=0):this.#f=this.#m[n],this.#a.delete(r),this.#c--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#a.get(e);if(s!==void 0){let o=this.#i[s];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))i&&(i.has="stale",this.#n(i,s));else return r&&this.#A(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#i[i];return this.#l(s)?s.__staleWhileFetching:s}#j(e,n,r,i){let s=n===void 0?void 0:this.#i[n];if(this.#l(s))return s;let o=new cp,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},c=(b,C=!1)=>{let{aborted:A}=o.signal,w=r.ignoreFetchAbort&&b!==void 0;if(r.status&&(A&&!C?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,w&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!w&&!C)return h(o.signal.reason);let T=g;return this.#i[n]===g&&(b===void 0?T.__staleWhileFetching?this.#i[n]=T.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,b,u.options))),b},l=b=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=b),h(b)),h=b=>{let{aborted:C}=o.signal,A=C&&r.allowStaleOnFetchAbort,w=A||r.allowStaleOnFetchRejection,T=w||r.noDeleteOnFetchRejection,v=g;if(this.#i[n]===g&&(!T||v.__staleWhileFetching===void 0?this.#P(e,"fetch"):A||(this.#i[n]=v.__staleWhileFetching)),w)return r.status&&v.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),v.__staleWhileFetching;if(v.__returned===v)throw b},d=(b,C)=>{let A=this.#o?.(e,s,u);A&&A instanceof Promise&&A.then(w=>b(w===void 0?void 0:w),C),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(void 0),r.allowStaleOnFetchAbort&&(b=w=>c(w,!0)))})};r.status&&(r.status.fetchDispatched=!0);let g=new Promise(d).then(c,l),y=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,y,{...u.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=y,y}#l(e){if(!this.#T)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof cp}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:b,forceRefresh:C=!1,status:A,signal:w}=n;if(!this.#T)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let T={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:g,status:A,signal:w},v=this.#a.get(e);if(v===void 0){A&&(A.fetch="miss");let L=this.#j(e,v,T,b);return L.__returned=L}else{let L=this.#i[v];if(this.#l(L)){let W=r&&L.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",W&&(A.returnedStale=!0)),W?L.__staleWhileFetching:L.__returned=L}let R=this.#b(v);if(!C&&!R)return A&&(A.fetch="hit"),this.#$(v),i&&this.#A(v),A&&this.#n(A,v),L;let B=this.#j(e,v,T,b),re=B.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=R?"stale":"refresh",re&&R&&(A.returnedStale=!0)),re?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#v;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=r(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let u=this.#i[a],c=this.#l(u);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),c?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),c?u.__staleWhileFetching:(this.#$(a),i&&this.#A(a),u))}else o&&(o.get="miss")}#F(e,n){this.#y[n]=e,this.#m[e]=n}#$(e){e!==this.#d&&(e===this.#f?this.#f=this.#m[e]:this.#F(this.#y[e],this.#m[e]),this.#F(this.#d,e),this.#d=e)}delete(e){return this.#P(e,"delete")}#P(e,n){let r=!1;if(this.#c!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#c===1)this.#B(n);else{this.#I(i);let s=this.#i[i];if(this.#l(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,n),this.#p&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#u[i]=void 0,this.#i[i]=void 0,i===this.#d)this.#d=this.#y[i];else if(i===this.#f)this.#f=this.#m[i];else{let o=this.#y[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#y[a]=this.#y[i]}this.#c--,this.#w.push(i)}}if(this.#p&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#C({allowStale:!0})){let r=this.#i[n];if(this.#l(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#u[n];this.#S&&this.#s?.(r,i,e),this.#p&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#_&&this.#x&&(this.#_.fill(0),this.#x.fill(0)),this.#E&&this.#E.fill(0),this.#f=0,this.#d=0,this.#w.length=0,this.#h=0,this.#c=0,this.#p&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};lp.LRUCache=eT});var uT=m(yn=>{"use strict";var LH=yn&&yn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yn,"__esModule",{value:!0});yn.Minipass=yn.isWritable=yn.isReadable=yn.isStream=void 0;var dP=typeof process=="object"&&process?process:{stdout:null,stderr:null},aT=require("node:events"),mP=LH(require("node:stream")),NH=require("node:string_decoder"),qH=t=>!!t&&typeof t=="object"&&(t instanceof yp||t instanceof mP.default||(0,yn.isReadable)(t)||(0,yn.isWritable)(t));yn.isStream=qH;var jH=t=>!!t&&typeof t=="object"&&t instanceof aT.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==mP.default.Writable.prototype.pipe;yn.isReadable=jH;var FH=t=>!!t&&typeof t=="object"&&t instanceof aT.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";yn.isWritable=FH;var wi=Symbol("EOF"),Ei=Symbol("maybeEmitEnd"),ls=Symbol("emittedEnd"),hp=Symbol("emittingEnd"),ac=Symbol("emittedError"),dp=Symbol("closed"),fP=Symbol("read"),fp=Symbol("flush"),pP=Symbol("flushChunk"),Or=Symbol("encoding"),Ea=Symbol("decoder"),Ht=Symbol("flowing"),uc=Symbol("paused"),xa=Symbol("resume"),Gt=Symbol("buffer"),mn=Symbol("pipes"),zt=Symbol("bufferLength"),tT=Symbol("bufferPush"),pp=Symbol("bufferShift"),un=Symbol("objectMode"),At=Symbol("destroyed"),nT=Symbol("error"),rT=Symbol("emitData"),gP=Symbol("emitEnd"),iT=Symbol("emitEnd2"),ei=Symbol("async"),sT=Symbol("abort"),gp=Symbol("aborted"),cc=Symbol("signal"),eo=Symbol("dataListeners"),Bn=Symbol("discarded"),lc=t=>Promise.resolve().then(t),$H=t=>t(),BH=t=>t==="end"||t==="finish"||t==="prefinish",WH=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,UH=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),mp=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[xa](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},oT=class extends mp{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},HH=t=>!!t.objectMode,GH=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",yp=class extends aT.EventEmitter{[Ht]=!1;[uc]=!1;[mn]=[];[Gt]=[];[un];[Or];[ei];[Ea];[wi]=!1;[ls]=!1;[hp]=!1;[dp]=!1;[ac]=null;[zt]=0;[At]=!1;[cc];[gp]=!1;[eo]=0;[Bn]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");HH(n)?(this[un]=!0,this[Or]=null):GH(n)?(this[Or]=n.encoding,this[un]=!1):(this[un]=!1,this[Or]=null),this[ei]=!!n.async,this[Ea]=this[Or]?new NH.StringDecoder(this[Or]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Gt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[mn]});let{signal:r}=n;r&&(this[cc]=r,r.aborted?this[sT]():r.addEventListener("abort",()=>this[sT]()))}get bufferLength(){return this[zt]}get encoding(){return this[Or]}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[un]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ei]}set async(e){this[ei]=this[ei]||!!e}[sT](){this[gp]=!0,this.emit("abort",this[cc]?.reason),this.destroy(this[cc]?.reason)}get aborted(){return this[gp]}set aborted(e){}write(e,n,r){if(this[gp])return!1;if(this[wi])throw new Error("write after end");if(this[At])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[ei]?lc:$H;if(!this[un]&&!Buffer.isBuffer(e)){if(UH(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(WH(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[un]?(this[Ht]&&this[zt]!==0&&this[fp](!0),this[Ht]?this.emit("data",e):this[tT](e),this[zt]!==0&&this.emit("readable"),r&&i(r),this[Ht]):e.length?(typeof e=="string"&&!(n===this[Or]&&!this[Ea]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Or]&&(e=this[Ea].write(e)),this[Ht]&&this[zt]!==0&&this[fp](!0),this[Ht]?this.emit("data",e):this[tT](e),this[zt]!==0&&this.emit("readable"),r&&i(r),this[Ht]):(this[zt]!==0&&this.emit("readable"),r&&i(r),this[Ht])}read(e){if(this[At])return null;if(this[Bn]=!1,this[zt]===0||e===0||e&&e>this[zt])return this[Ei](),null;this[un]&&(e=null),this[Gt].length>1&&!this[un]&&(this[Gt]=[this[Or]?this[Gt].join(""):Buffer.concat(this[Gt],this[zt])]);let n=this[fP](e||null,this[Gt][0]);return this[Ei](),n}[fP](e,n){if(this[un])this[pp]();else{let r=n;e===r.length||e===null?this[pp]():typeof r=="string"?(this[Gt][0]=r.slice(e),n=r.slice(0,e),this[zt]-=e):(this[Gt][0]=r.subarray(e),n=r.subarray(0,e),this[zt]-=e)}return this.emit("data",n),!this[Gt].length&&!this[wi]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[wi]=!0,this.writable=!1,(this[Ht]||!this[uc])&&this[Ei](),this}[xa](){this[At]||(!this[eo]&&!this[mn].length&&(this[Bn]=!0),this[uc]=!1,this[Ht]=!0,this.emit("resume"),this[Gt].length?this[fp]():this[wi]?this[Ei]():this.emit("drain"))}resume(){return this[xa]()}pause(){this[Ht]=!1,this[uc]=!0,this[Bn]=!1}get destroyed(){return this[At]}get flowing(){return this[Ht]}get paused(){return this[uc]}[tT](e){this[un]?this[zt]+=1:this[zt]+=e.length,this[Gt].push(e)}[pp](){return this[un]?this[zt]-=1:this[zt]-=this[Gt][0].length,this[Gt].shift()}[fp](e=!1){do;while(this[pP](this[pp]())&&this[Gt].length);!e&&!this[Gt].length&&!this[wi]&&this.emit("drain")}[pP](e){return this.emit("data",e),this[Ht]}pipe(e,n){if(this[At])return e;this[Bn]=!1;let r=this[ls];return n=n||{},e===dP.stdout||e===dP.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[mn].push(n.proxyErrors?new oT(this,e,n):new mp(this,e,n)),this[ei]?lc(()=>this[xa]()):this[xa]()),e}unpipe(e){let n=this[mn].find(r=>r.dest===e);n&&(this[mn].length===1?(this[Ht]&&this[eo]===0&&(this[Ht]=!1),this[mn]=[]):this[mn].splice(this[mn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[Bn]=!1,this[eo]++,!this[mn].length&&!this[Ht]&&this[xa]();else if(e==="readable"&&this[zt]!==0)super.emit("readable");else if(BH(e)&&this[ls])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ac]){let i=n;this[ei]?lc(()=>i.call(this,this[ac])):i.call(this,this[ac])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[eo]=this.listeners("data").length,this[eo]===0&&!this[Bn]&&!this[mn].length&&(this[Ht]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[eo]=0,!this[Bn]&&!this[mn].length&&(this[Ht]=!1)),n}get emittedEnd(){return this[ls]}[Ei](){!this[hp]&&!this[ls]&&!this[At]&&this[Gt].length===0&&this[wi]&&(this[hp]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[dp]&&this.emit("close"),this[hp]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==At&&this[At])return!1;if(e==="data")return!this[un]&&!r?!1:this[ei]?(lc(()=>this[rT](r)),!0):this[rT](r);if(e==="end")return this[gP]();if(e==="close"){if(this[dp]=!0,!this[ls]&&!this[At])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[ac]=r,super.emit(nT,r);let s=!this[cc]||this.listeners("error").length?super.emit("error",r):!1;return this[Ei](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ei](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[Ei](),i}[rT](e){for(let r of this[mn])r.dest.write(e)===!1&&this.pause();let n=this[Bn]?!1:super.emit("data",e);return this[Ei](),n}[gP](){return this[ls]?!1:(this[ls]=!0,this.readable=!1,this[ei]?(lc(()=>this[iT]()),!0):this[iT]())}[iT](){if(this[Ea]){let n=this[Ea].end();if(n){for(let r of this[mn])r.dest.write(n);this[Bn]||super.emit("data",n)}}for(let n of this[mn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[un]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[un]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[un])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Or]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(At,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Bn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[wi])return n();let s,o,a=h=>{this.off("data",u),this.off("end",c),this.off(At,l),n(),o(h)},u=h=>{this.off("error",a),this.off("end",c),this.off(At,l),this.pause(),s({value:h,done:!!this[wi]})},c=()=>{this.off("error",a),this.off("data",u),this.off(At,l),n(),s({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((h,d)=>{o=d,s=h,this.once(At,l),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Bn]=!1;let e=!1,n=()=>(this.pause(),this.off(nT,n),this.off(At,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(nT,n),this.once(At,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[At])return e?this.emit("error",e):this.emit(At),this;this[At]=!0,this[Bn]=!0,this[Gt].length=0,this[zt]=0;let n=this;return typeof n.close=="function"&&!this[dp]&&n.close(),e?this.emit("error",e):this.emit(At),this}static get isStream(){return yn.isStream}};yn.Minipass=yp});var PP=m(je=>{"use strict";var zH=je&&je.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),VH=je&&je.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KH=je&&je.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&zH(e,t,n);return VH(e,t),e};Object.defineProperty(je,"__esModule",{value:!0});je.PathScurry=je.Path=je.PathScurryDarwin=je.PathScurryPosix=je.PathScurryWin32=je.PathScurryBase=je.PathPosix=je.PathWin32=je.PathBase=je.ChildrenCache=je.ResolveCache=void 0;var TP=hP(),Tp=require("node:path"),XH=require("node:url"),dc=require("fs"),YH=KH(require("node:fs")),JH=dc.realpathSync.native,bp=require("node:fs/promises"),yP=uT(),fc={lstatSync:dc.lstatSync,readdir:dc.readdir,readdirSync:dc.readdirSync,readlinkSync:dc.readlinkSync,realpathSync:JH,promises:{lstat:bp.lstat,readdir:bp.readdir,readlink:bp.readlink,realpath:bp.realpath}},wP=t=>!t||t===fc||t===YH?fc:{...fc,...t,promises:{...fc.promises,...t.promises||{}}},EP=/^\\\\\?\\([a-z]:)\\?$/i,QH=t=>t.replace(/\//g,"\\").replace(EP,"$1\\"),ZH=/[\\\/]/,hr=0,xP=1,AP=2,ti=4,kP=6,CP=8,to=10,OP=12,lr=15,hc=~lr,cT=16,bP=32,pc=64,Rr=128,_p=256,Sp=512,_P=pc|Rr|Sp,eG=1023,lT=t=>t.isFile()?CP:t.isDirectory()?ti:t.isSymbolicLink()?to:t.isCharacterDevice()?AP:t.isBlockDevice()?kP:t.isSocket()?OP:t.isFIFO()?xP:hr,vP=new Map,gc=t=>{let e=vP.get(t);if(e)return e;let n=t.normalize("NFKD");return vP.set(t,n),n},SP=new Map,vp=t=>{let e=SP.get(t);if(e)return e;let n=gc(t.toLowerCase());return SP.set(t,n),n},mc=class extends TP.LRUCache{constructor(){super({max:256})}};je.ResolveCache=mc;var wp=class extends TP.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};je.ChildrenCache=wp;var RP=Symbol("PathScurry setAsCwd"),Jt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#c;get rdev(){return this.#c}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#u;get size(){return this.#u}#i;get blocks(){return this.#i}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#f;get ctimeMs(){return this.#f}#d;get birthtimeMs(){return this.#d}#w;get atime(){return this.#w}#g;get mtime(){return this.#g}#E;get ctime(){return this.#E}#x;get birthtime(){return this.#x}#_;#S;#T;#p;#O;#A;#n;#D;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=hr,r,i,s,o,a){this.name=e,this.#_=s?vp(e):gc(e),this.#n=n&eG,this.nocase=s,this.roots=i,this.root=r||this,this.#D=o,this.#T=a.fullpath,this.#O=a.relative,this.#A=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=wP(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#D.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#D.set(this,n),this.#n&=~cT,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?vp(e):gc(e);for(let u of r)if(u.#_===i)return u;let s=this.parent?this.sep:"",o=this.#T?this.#T+s+e:void 0,a=this.newChild(e,hr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Rr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let e=this.name,n=this.parent;if(!n)return this.#O=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,n=this.parent;if(!n)return this.#A=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#T!==void 0)return this.#T;let e=this.name,n=this.parent;if(!n)return this.#T=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#T=i}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#p=`//?/${i}`:this.#p=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&lr)===hr}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&lr)===CP}isDirectory(){return(this.#n&lr)===ti}isCharacterDevice(){return(this.#n&lr)===AP}isBlockDevice(){return(this.#n&lr)===kP}isFIFO(){return(this.#n&lr)===xP}isSocket(){return(this.#n&lr)===OP}isSymbolicLink(){return(this.#n&to)===to}lstatCached(){return this.#n&bP?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&lr;return!(e!==hr&&e!==to||this.#n&_p||this.#n&Rr)}calledReaddir(){return!!(this.#n&cT)}isENOENT(){return!!(this.#n&Rr)}isNamed(e){return this.nocase?this.#_===vp(e):this.#_===gc(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#b=r}catch(n){this.#l(n.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#b=r}catch(n){this.#l(n.code);return}}#M(e){this.#n|=cT;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#L()}}#L(){this.#n&Rr||(this.#n=(this.#n|Rr)&hc,this.#k())}#k(){let e=this.children();e.provisional=0;for(let n of e)n.#L()}#C(){this.#n|=Sp,this.#N()}#N(){if(this.#n&pc)return;let e=this.#n;(e&lr)===ti&&(e&=hc),this.#n=e|pc,this.#k()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#L()}#l(e=""){let n=this.#n;n|=_p,e==="ENOENT"&&(n|=Rr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=hc),this.#n=n,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#F(e,n){return this.#P(e,n)||this.#$(e,n)}#$(e,n){let r=lT(e),i=this.newChild(e.name,r,{parent:this}),s=i.#n&lr;return s!==ti&&s!==to&&s!==hr&&(i.#n|=pc),n.unshift(i),n.provisional++,i}#P(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?vp(e.name):gc(e.name))===i.#_)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#n=n.#n&hc|lT(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if(!(this.#n&Rr))try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if(!(this.#n&Rr))try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:c,dev:l,gid:h,ino:d,mode:g,mtime:y,mtimeMs:b,nlink:C,rdev:A,size:w,uid:T}=e;this.#w=n,this.#m=r,this.#x=i,this.#d=s,this.#h=o,this.#i=a,this.#E=u,this.#f=c,this.#t=l,this.#v=h,this.#a=d,this.#s=g,this.#g=y,this.#y=b,this.#r=C,this.#c=A,this.#u=w,this.#o=T;let v=lT(e);this.#n=this.#n&hc|v|bP,v!==hr&&v!==ti&&v!==to&&(this.#n|=pc)}#U=[];#H=!1;#z(e){this.#H=!1;let n=this.#U.slice();this.#U.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#U.push(e),this.#H)return;this.#H=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),r.provisional=0;else{for(let a of o)this.#F(a,r);this.#M(r)}this.#z(r.slice(0,r.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#W)await this.#W;else{let r=()=>{};this.#W=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#F(i,e);this.#M(e)}catch(i){this.#q(i.code),e.provisional=0}this.#W=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#F(r,e);this.#M(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&_P)return!1;let e=lr&this.#n;return e===hr||e===ti||e===to}shouldWalk(e,n){return(this.#n&ti)===ti&&!(this.#n&_P)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((Sp|_p|Rr)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#C()}}realpathSync(){if(this.#R)return this.#R;if(!((Sp|_p|Rr)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#C()}}[RP](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#O=r.join(this.sep),i.#A=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#O=void 0,i.#A=void 0,i=i.parent}};je.PathBase=Jt;var yc=class t extends Jt{sep="\\";splitSep=ZH;constructor(e,n=hr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=hr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Tp.win32.parse(e).root}getRoot(e){if(e=QH(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new vc(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(EP,"$1\\"),e===n}};je.PathWin32=yc;var bc=class t extends Jt{splitSep="/";sep="/";constructor(e,n=hr,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=hr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};je.PathPosix=bc;var _c=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=fc}={}){this.#r=wP(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,XH.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new mc,this.#t=new mc,this.#s=new wp(s);let u=a.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let c=this.root,l=u.length-1,h=n.sep,d=this.rootPath,g=!1;for(let y of u){let b=l--;c=c.child(y,{relative:new Array(b).fill("..").join(h),relativePosix:new Array(b).fill("..").join("/"),fullpath:d+=(g?"":h)+y}),g=!0}this.cwd=c}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set,c=(h,d)=>{u.add(h),h.readdirCB((g,y)=>{if(g)return d(g);let b=y.length;if(!b)return d();let C=()=>{--b===0&&d()};for(let A of y)(!s||s(A))&&a.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(w=>w?.isUnknown()?w.lstat():w).then(w=>w?.shouldWalk(u,o)?c(w,C):C()):A.shouldWalk(u,o)?c(A,C):C()},!0)},l=e;return new Promise((h,d)=>{c(l,g=>{if(g)return d(g);h(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set([e]);for(let c of u){let l=c.readdirSync();for(let h of l){(!s||s(h))&&a.push(r?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(u,o)&&u.add(d)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let u of a){let c=u.readdirSync();for(let l of c){(!s||s(l))&&(yield r?l:l.fullpath());let h=l;if(l.isSymbolicLink()){if(!(i&&(h=l.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new yP.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,c=[e],l=0,h=()=>{let d=!1;for(;!d;){let g=c.shift();if(!g){l===0&&a.end();return}l++,u.add(g);let y=(C,A,w=!1)=>{if(C)return a.emit("error",C);if(i&&!w){let T=[];for(let v of A)v.isSymbolicLink()&&T.push(v.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(T.length){Promise.all(T).then(()=>y(null,A,!0));return}}for(let T of A)T&&(!s||s(T))&&(a.write(r?T:T.fullpath())||(d=!0));l--;for(let T of A){let v=T.realpathCached()||T;v.shouldWalk(u,o)&&c.push(v)}d&&!a.flowing?a.once("drain",h):b||h()},b=!0;g.readdirCB(y,!0),b=!1}};return h(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new yP.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let c=[e],l=0,h=()=>{let d=!1;for(;!d;){let g=c.shift();if(!g){l===0&&a.end();return}l++,u.add(g);let y=g.readdirSync();for(let b of y)(!s||s(b))&&(a.write(r?b:b.fullpath())||(d=!0));l--;for(let b of y){let C=b;if(b.isSymbolicLink()){if(!(i&&(C=b.realpathSync())))continue;C.isUnknown()&&C.lstatSync()}C.shouldWalk(u,o)&&c.push(C)}}d&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[RP](n)}};je.PathScurryBase=_c;var vc=class extends _c{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,Tp.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Tp.win32.parse(e).root.toUpperCase()}newRoot(e){return new yc(this.rootPath,ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};je.PathScurryWin32=vc;var Sc=class extends _c{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,Tp.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new bc(this.rootPath,ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};je.PathScurryPosix=Sc;var Ep=class extends Sc{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};je.PathScurryDarwin=Ep;je.Path=process.platform==="win32"?yc:bc;je.PathScurry=process.platform==="win32"?vc:process.platform==="darwin"?Ep:Sc});var dT=m(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.Pattern=void 0;var tG=us(),nG=t=>t.length>=1,rG=t=>t.length>=1,hT=class t{#e;#t;#s;length;#r;#o;#v;#c;#h;#a;#u=!0;constructor(e,n,r,i){if(!nG(e))throw new TypeError("empty pattern list");if(!rG(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#s=r,this.#r=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...c]=this.#e,[l,h,d,g,...y]=this.#t;c[0]===""&&(c.shift(),y.shift());let b=[s,o,a,u,""].join("/"),C=[l,h,d,g,""].join("/");this.#e=[b,...c],this.#t=[C,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#t;o[0]===""&&(o.shift(),u.shift());let c=s+"/",l=a+"/";this.#e=[c,...o],this.#t=[l,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===tG.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#s+1,this.#r),this.#o.#a=this.#a,this.#o.#h=this.#h,this.#o.#c=this.#c,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};xp.Pattern=hT});var pT=m(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.Ignore=void 0;var DP=us(),iG=dT(),sG=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",fT=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=sG}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new DP.Minimatch(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new iG.Pattern(i,s,0,this.platform),a=new DP.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),u&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};Ap.Ignore=fT});var MP=m(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Processor=ni.SubWalks=ni.MatchRecord=ni.HasWalkedCache=void 0;var IP=us(),kp=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}};ni.HasWalkedCache=kp;var Cp=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}};ni.MatchRecord=Cp;var Op=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};ni.SubWalks=Op;var gT=class t{hasWalkedCache;matches=new Cp;subwalks=new Op;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new kp}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,c,l=!1;for(;typeof(u=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(u),s=c,l=!0;if(u=s.pattern(),c=s.rest(),l){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,h);continue}else if(u===IP.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=c?.pattern(),d=c?.rest();if(!c||(h===""||h===".")&&!d)this.matches.add(i,a,h===""||h===".");else if(h===".."){let g=i.parent||i;d?this.hasWalkedCache.hasWalked(g,d)||this.subwalks.add(g,d):this.matches.add(g,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),u=o.pattern(),c=o.rest();u===IP.GLOBSTAR?i.testGlobstar(s,o,c,a):u instanceof RegExp?i.testRegExp(s,u,c,a):i.testString(s,u,c,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};ni.Processor=gT});var qP=m(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.GlobStream=hs.GlobWalker=hs.GlobUtil=void 0;var oG=uT(),LP=pT(),NP=MP(),aG=(t,e)=>typeof t=="string"?new LP.Ignore([t],e):Array.isArray(t)?new LP.Ignore(t,e):t,Tc=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=aG(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#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,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new NP.Processor(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,c).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,r,o):a.readdirCB((c,l)=>this.walkCB3(a,l,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,c).then(()=>o()));for(let[a,u]of r.subwalks.entries())s++,this.walkCB2(a,u,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new NP.Processor(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||this.matchSync(a,u,c);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||this.matchSync(a,u,c);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};hs.GlobUtil=Tc;var mT=class extends Tc{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};hs.GlobWalker=mT;var yT=class extends Tc{results;constructor(e,n,r){super(e,n,r),this.results=new oG.Minipass({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}};hs.GlobStream=yT});var _T=m(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Glob=void 0;var uG=us(),cG=require("node:url"),Rp=PP(),lG=dT(),Pp=qP(),hG=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",bT=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,cG.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=n.platform||hG,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=n.platform==="win32"?Rp.PathScurryWin32:n.platform==="darwin"?Rp.PathScurryDarwin:n.platform?Rp.PathScurryPosix:Rp.PathScurry;this.scurry=new u(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new uG.Minimatch(u,i)),[o,a]=s.reduce((u,c)=>(u[0].push(...c.set),u[1].push(...c.globParts),u),[[],[]]);this.patterns=o.map((u,c)=>{let l=a[c];if(!l)throw new Error("invalid pattern object");return new lG.Pattern(u,l,0,this.platform)})}async walk(){return[...await new Pp.GlobWalker(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 Pp.GlobWalker(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 Pp.GlobStream(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 Pp.GlobStream(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()}};Dp.Glob=bT});var vT=m(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.hasMagic=void 0;var dG=us(),fG=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new dG.Minimatch(n,e).hasMagic())return!0;return!1};Ip.hasMagic=fG});var BP=m(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.glob=xe.sync=xe.iterate=xe.iterateSync=xe.stream=xe.streamSync=xe.Ignore=xe.hasMagic=xe.Glob=xe.unescape=xe.escape=void 0;xe.globStreamSync=wc;xe.globStream=ST;xe.globSync=TT;xe.globIterateSync=Ec;xe.globIterate=wT;var jP=us(),no=_T(),pG=vT(),$P=us();Object.defineProperty(xe,"escape",{enumerable:!0,get:function(){return $P.escape}});Object.defineProperty(xe,"unescape",{enumerable:!0,get:function(){return $P.unescape}});var gG=_T();Object.defineProperty(xe,"Glob",{enumerable:!0,get:function(){return gG.Glob}});var mG=vT();Object.defineProperty(xe,"hasMagic",{enumerable:!0,get:function(){return mG.hasMagic}});var yG=pT();Object.defineProperty(xe,"Ignore",{enumerable:!0,get:function(){return yG.Ignore}});function wc(t,e={}){return new no.Glob(t,e).streamSync()}function ST(t,e={}){return new no.Glob(t,e).stream()}function TT(t,e={}){return new no.Glob(t,e).walkSync()}async function FP(t,e={}){return new no.Glob(t,e).walk()}function Ec(t,e={}){return new no.Glob(t,e).iterateSync()}function wT(t,e={}){return new no.Glob(t,e).iterate()}xe.streamSync=wc;xe.stream=Object.assign(ST,{sync:wc});xe.iterateSync=Ec;xe.iterate=Object.assign(wT,{sync:Ec});xe.sync=Object.assign(TT,{stream:wc,iterate:Ec});xe.glob=Object.assign(FP,{glob:FP,globSync:TT,sync:xe.sync,globStream:ST,stream:xe.stream,globStreamSync:wc,streamSync:xe.streamSync,globIterate:wT,iterate:xe.iterate,globIterateSync:Ec,iterateSync:xe.iterateSync,Glob:no.Glob,hasMagic:pG.hasMagic,escape:jP.escape,unescape:jP.unescape});xe.glob.glob=xe.glob});var UP=m(Aa=>{"use strict";var xT=Aa&&Aa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Aa,"__esModule",{value:!0});Aa.FileSystem=void 0;var bG=Nm(),WP=(LR(),ZP(MR)),_G=xT(require("events")),Mp=RS(),vG=xT(require("fs")),SG=Qf(),TG=xT(Ff()),wG=BP(),ET=class extends _G.default{constructor(e){super(),this._context=e,this._textDocumentManager=new bG.TextDocuments(WP.TextDocument),this._tempTextDocumentCache=new TG.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._workspace==null)return[];let e=await this._workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>Mp.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async getWorkspaceRelatedFiles(){let e=this._context.getConfiguration(),n=e.fileExtensions,r=e.typeAnalyzer.exclude,i=await this.getWorkspaceFolderUris();return(await Promise.all(i.flatMap(async o=>(0,wG.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>Mp.URI.file(o))}async findExistingPath(e,...n){if(await this.getTextDocument(e)!=null)return e;if(n.length===0)return null;try{let i=await Promise.any(n.map(async s=>{if(await this.getTextDocument(s)!=null)return s;throw new Error("Alternative path could not resolve")}));return i??null}catch{return null}}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=Mp.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await vG.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=WP.TextDocument.create(e,SG.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(Mp.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};Aa.FileSystem=ET});var HP=m(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.NodeContext=void 0;var AT=Nm(),kT=Qf(),EG=UP(),CT=class extends kT.CoreContext{constructor(){super(),this.documentManager=new kT.DocumentManager().setContext(this),this.documentMerger=new kT.DocumentMerger,this.connection=(0,AT.createConnection)(AT.ProposedFeatures.all),this.fs=new EG.FileSystem(this)}createSemanticTokensBuilder(){return new AT.SemanticTokensBuilder}};Lp.NodeContext=CT});Object.defineProperty(exports,"__esModule",{value:!0});var xG=HP(),Pr=Qf(),GP=new xG.NodeContext;GP.on("ready",t=>{(0,Pr.activateAutocomplete)(t),(0,Pr.activateColor)(t),(0,Pr.activateDefinition)(t),(0,Pr.activateDiagnostic)(t),(0,Pr.activateFormatter)(t),(0,Pr.activateHover)(t),(0,Pr.activateSignature)(t),(0,Pr.activateSubscriptions)(t),(0,Pr.activateSymbol)(t),(0,Pr.activateSemantic)(t),(0,Pr.activateFoldingRange)(t)});GP.listen();
|
155
|
+
`),ht.Comment),this.next()}process(){let e=this;switch(e.token.type){case he.TokenType.Keyword:{this.processKeyword();break}case he.TokenType.StringLiteral:{this.processStringLiteral();break}case he.TokenType.Identifier:{this.processIdentifier();break}case he.TokenType.NumericLiteral:{this.processNumericLiteral();break}case he.TokenType.Punctuator:case he.TokenType.SliceOperator:{this.processPunctuator();break}case he.TokenType.BooleanLiteral:{this.processBooleanLiteral();break}case he.TokenType.NilLiteral:{this.processNilLiteral();break}case he.TokenType.Comment:{this.processComment();break}default:e.next()}}digest(){let e=this;for(e.next();!he.Selectors.EndOfFile(e.token);)e.process()}};Cn.TokenHandler=Yf;function p5(t,e){let n=new Rr.Lexer(e.content,{unsafe:!0});return new Yf(n,t).digest(),t}Cn.buildTokens=p5});var OR=m(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.activate=void 0;var g5=Jf();function m5(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,g5.buildTokens)(i,r),i.build()})}Qf.activate=m5});var RR=m(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.buildFoldingRanges=void 0;var ti=Ee(),GS=$m(),y5=Qd();function b5(t){let e=[];return new y5.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case ti.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:GS.FoldingRangeKind.Comment}),null;case ti.ASTType.MapConstructorExpression:case ti.ASTType.ListConstructorExpression:case ti.ASTType.StringLiteral:case ti.ASTType.WhileStatement:case ti.ASTType.ForGenericStatement:case ti.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:GS.FoldingRangeKind.Region}),null;case ti.ASTType.IfClause:case ti.ASTType.ElseifClause:case ti.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:GS.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}Zf.buildFoldingRanges=b5});var DR=m(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.activate=void 0;var _5=RR();function v5(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n);if(r.document)return(0,_5.buildFoldingRanges)(r)})}ep.activate=v5});var LR=m((P8,MR)=>{var zS=Object.defineProperty,S5=Object.getOwnPropertyDescriptor,T5=Object.getOwnPropertyNames,w5=Object.prototype.hasOwnProperty,E5=(t,e)=>{for(var n in e)zS(t,n,{get:e[n],enumerable:!0})},x5=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of T5(e))!w5.call(t,i)&&i!==n&&zS(t,i,{get:()=>e[i],enumerable:!(r=S5(e,i))||r.enumerable});return t},A5=t=>x5(zS({},"__esModule",{value:!0}),t),IR={};E5(IR,{toposort:()=>KS,toposortWithEdges:()=>O5,toposortWithGraph:()=>R5});MR.exports=A5(IR);function k5(t,e){let n=new Array(t.size);for(let r=0,i=t.size;r<i;r++)n[r]=new Set;for(let r=0,i=e.length;r<i;r++){let[s,o]=e[r],a=t.get(s),u=t.get(o);a==null||u==null||n[a].add(u)}return n}function C5(t){let e=new Map;for(let n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}function O5(t){let e=Array.from(new Set(t.flat()));return KS(e,t)}function R5(t){let e=Array.from(new Set(Object.keys(t))),n=new Set(e),r=[];for(let i=0,s=e.length;i<s;i++){let o=e[i],a=Array.from(new Set(t[o]));for(let u=0,c=a.length;u<c;u++)r.push([o,a[u]]),n.add(a[u])}return KS(Array.from(n),r)}function PR(t,e){let n={value:e};t.first==null?t.first=n:t.last.next=n,t.last=n}function D5(t){let e=t.first;return t.first=e.next,e.value}function P5(t){return t.first==null}function KS(t,e){let n=C5(t),r=k5(n,e),i=new Array(t.length).fill(0);for(let a=0,u=r.length;a<u;a++)r[a].forEach(c=>{i[c]+=1});let s={first:null,last:null};i.forEach((a,u)=>{a===0&&PR(s,u)});let o=[];for(;!P5(s);){let a=D5(s);o.push(t[a]),r[a].forEach(u=>{--i[u]===0&&PR(s,u)})}if(o.length!==r.length)throw new Error(`Cyclic dependency detected: ${I5(o,n,r)?.map(a=>t[a]).join(" -> ")}`);return o}function I5(t,e,n){let r=new Set(t.map(a=>e.get(a))),i=null;function s(a,u){if(u.has(a))return!0;if(r.has(a))return!1;r.add(a),u.add(a);let c=Array.from(n[a]);for(let l=0,h=c.length;l<h;l++)if(s(c[l],u))return i==null&&(i=[a,c[l]]),!0;return u.delete(a),!1}let o=Array.from(n.keys());for(let a=0,u=o.length;a<u;a++)if(!r.has(o[a])&&s(o[a],new Set))return i;return null}});var NR=m(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.hash=void 0;function M5(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}tp.hash=M5});var $R=m(Ta=>{"use strict";var FR=Ta&&Ta.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.DocumentMerger=void 0;var L5=FR(Hf()),N5=LR(),qR=$i(),jR=NR(),np=FR(tc()),VS=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new L5.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,jR.hash)(`main-${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,jR.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=np.default.get(i);if(r.set(i,null),!s)return null;let o=[],u=await(await n.documentManager.getLatest(e)).getImports(),c=this.createCacheKey(e,u.map(d=>d.document));if(this.results.has(c))return this.results.get(c);this.registerCacheKey(c,i);let l=await n.documentManager.get(e).getDependencies();await Promise.all(l.map(async d=>{let g=n.documentManager.results.get(d.location);if(!g)return;let{document:_,textDocument:b}=g;if(!_)return;let C=await this.processByDependencies(b,n,r);C!==null&&o.push(C)}));let h=s.merge(...o);return r.set(i,h),this.results.set(c,h),h}async buildByDependencies(e,n){let r=e.uri,i=np.default.get(r);if(!i)return null;let o=await(await n.documentManager.getLatest(e)).getImports(),a=this.createCacheKey(e,o.map(g=>g.document));if(this.results.has(a))return this.results.get(a);let u=[],c=[];this.registerCacheKey(a,r);let l=await n.documentManager.get(e).getDependencies(),h=new Map([[r,null]]);await Promise.all(l.map(async g=>{let _=n.documentManager.results.get(g.location);if(!_)return;let{document:b,textDocument:C}=_;if(!b)return;let A=await this.processByDependencies(C,n,h);if(A!==null){if(g.type===qR.DependencyType.Import){c.push({namespace:g.args[0],typeDoc:A});return}u.push(A)}}));let d=i.merge(...u);return c.forEach((g,_)=>{let b=g.typeDoc.getRootScopeContext().scope.resolveNamespace("module",!0)?.resolveProperty("exports",!0);b!=null&&d.getRootScopeContext().scope.setProperty(g.namespace??`unknown${_}`,b,!0)}),this.results.set(a,d),d}async buildByWorkspace(e,n){let r=e.uri,i=np.default.get(r);if(!i)return null;let s=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let c=a.map(g=>g.textDocument.uri),l=await Promise.all(a.map(async g=>(await g.getDependencies()).map(b=>[g.textDocument.uri,b.location]))),h=(0,N5.toposort)(c,l.flat());for(let g=h.length-1;g>=0;g--){let _=h[g];if(_===r)continue;let b=np.default.get(_);if(b===null)return;s.push(b)}let d=i.merge(...s);return this.results.set(u,d),d}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===qR.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};Ta.DocumentMerger=VS});var UR=m(wa=>{"use strict";var q5=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.CoreContext=void 0;var j5=q5(require("events")),ic=$i(),BR=Jf();function WR(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):ic.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??ic.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??ic.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var XS=class extends j5.default{constructor(){super(),this._configuration=WR(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(ic.ConfigurationNamespace),n=WR(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:ic.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:BR.semanticTokensLegend.tokenTypes,tokenModifiers:BR.semanticTokensLegend.tokenModifiers},full:!0},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};wa.CoreContext=XS});var rp=m(z=>{"use strict";var F5=z&&z.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),$5=z&&z.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),B5=z&&z.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&F5(e,t,n);return $5(e,t),e},W5=z&&z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(z,"__esModule",{value:!0});z.CoreContext=z.buildTokens=z.semanticTokensLegend=z.lookupBase=z.lookupIdentifier=z.typeAnalyzer=z.appendTooltipHeader=z.appendTooltipBody=z.formatTypes=z.formatDefaultValue=z.createTooltipHeader=z.createSignatureInfo=z.createHover=z.MarkdownString=z.LookupHelper=z.DocumentMerger=z.DocumentManager=z.ActiveDocument=z.ASTScraper=z.activateFoldingRange=z.activateSemantic=z.activateSymbol=z.activateSubscriptions=z.activateSignature=z.activateHover=z.activateFormatter=z.activateDiagnostic=z.activateDefinition=z.activateColor=z.activateAutocomplete=z.DefaultFileExtensions=z.TypeAnalyzerStrategy=z.ConfigurationNamespace=z.LanguageId=z.IndentationType=void 0;var sc=$i();Object.defineProperty(z,"IndentationType",{enumerable:!0,get:function(){return sc.IndentationType}});Object.defineProperty(z,"LanguageId",{enumerable:!0,get:function(){return sc.LanguageId}});Object.defineProperty(z,"ConfigurationNamespace",{enumerable:!0,get:function(){return sc.ConfigurationNamespace}});Object.defineProperty(z,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return sc.TypeAnalyzerStrategy}});Object.defineProperty(z,"DefaultFileExtensions",{enumerable:!0,get:function(){return sc.DefaultFileExtensions}});var U5=ZC();Object.defineProperty(z,"activateAutocomplete",{enumerable:!0,get:function(){return U5.activate}});var H5=cO();Object.defineProperty(z,"activateColor",{enumerable:!0,get:function(){return H5.activate}});var G5=hO();Object.defineProperty(z,"activateDefinition",{enumerable:!0,get:function(){return G5.activate}});var z5=dO();Object.defineProperty(z,"activateDiagnostic",{enumerable:!0,get:function(){return z5.activate}});var K5=BO();Object.defineProperty(z,"activateFormatter",{enumerable:!0,get:function(){return K5.activate}});var V5=bR();Object.defineProperty(z,"activateHover",{enumerable:!0,get:function(){return V5.activate}});var X5=vR();Object.defineProperty(z,"activateSignature",{enumerable:!0,get:function(){return X5.activate}});var Y5=TR();Object.defineProperty(z,"activateSubscriptions",{enumerable:!0,get:function(){return Y5.activate}});var J5=AR();Object.defineProperty(z,"activateSymbol",{enumerable:!0,get:function(){return J5.activate}});var Q5=OR();Object.defineProperty(z,"activateSemantic",{enumerable:!0,get:function(){return Q5.activate}});var Z5=DR();Object.defineProperty(z,"activateFoldingRange",{enumerable:!0,get:function(){return Z5.activate}});z.ASTScraper=B5(Qd());var HR=WS();Object.defineProperty(z,"ActiveDocument",{enumerable:!0,get:function(){return HR.ActiveDocument}});Object.defineProperty(z,"DocumentManager",{enumerable:!0,get:function(){return HR.DocumentManager}});var eH=$R();Object.defineProperty(z,"DocumentMerger",{enumerable:!0,get:function(){return eH.DocumentMerger}});var tH=oa();Object.defineProperty(z,"LookupHelper",{enumerable:!0,get:function(){return tH.LookupHelper}});var nH=$f();Object.defineProperty(z,"MarkdownString",{enumerable:!0,get:function(){return nH.MarkdownString}});var eo=Bf();Object.defineProperty(z,"createHover",{enumerable:!0,get:function(){return eo.createHover}});Object.defineProperty(z,"createSignatureInfo",{enumerable:!0,get:function(){return eo.createSignatureInfo}});Object.defineProperty(z,"createTooltipHeader",{enumerable:!0,get:function(){return eo.createTooltipHeader}});Object.defineProperty(z,"formatDefaultValue",{enumerable:!0,get:function(){return eo.formatDefaultValue}});Object.defineProperty(z,"formatTypes",{enumerable:!0,get:function(){return eo.formatTypes}});Object.defineProperty(z,"appendTooltipBody",{enumerable:!0,get:function(){return eo.appendTooltipBody}});Object.defineProperty(z,"appendTooltipHeader",{enumerable:!0,get:function(){return eo.appendTooltipHeader}});var rH=tc();Object.defineProperty(z,"typeAnalyzer",{enumerable:!0,get:function(){return W5(rH).default}});var GR=Rv();Object.defineProperty(z,"lookupIdentifier",{enumerable:!0,get:function(){return GR.lookupIdentifier}});Object.defineProperty(z,"lookupBase",{enumerable:!0,get:function(){return GR.lookupBase}});var zR=Jf();Object.defineProperty(z,"semanticTokensLegend",{enumerable:!0,get:function(){return zR.semanticTokensLegend}});Object.defineProperty(z,"buildTokens",{enumerable:!0,get:function(){return zR.buildTokens}});var iH=UR();Object.defineProperty(z,"CoreContext",{enumerable:!0,get:function(){return iH.CoreContext}})});var YR={};fP(YR,{TextDocument:()=>YS});function JS(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);JS(r,e),JS(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function KR(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);VR(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function VR(t){return t===13||t===10}function XR(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function sH(t){let e=XR(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var ip,YS,JR=dP(()=>{"use strict";ip=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=XR(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,l=KR(r.text,!1,s);if(u-a===l.length)for(let d=0,g=l.length;d<g;d++)c[d+a+1]=l[d];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));let h=r.text.length-(o-s);if(h!==0)for(let d=a+1+l.length,g=c.length;d<g;d++)c[d]=c[d]+h}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=KR(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&VR(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(t){function e(i,s,o,a){return new ip(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof ip)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=JS(s.map(sH),(l,h)=>{let d=l.range.start.line-h.range.start.line;return d===0?l.range.start.character-h.range.start.character:d}),u=0,c=[];for(let l of a){let h=i.offsetAt(l.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&c.push(o.substring(u,h)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(YS||(YS={}))});var nD=m((q8,tD)=>{"use strict";tD.exports=ZR;function ZR(t,e,n){t instanceof RegExp&&(t=QR(t,n)),e instanceof RegExp&&(e=QR(e,n));var r=eD(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function QR(t,e){var n=e.match(t);return n?n[0]:null}ZR.range=eD;function eD(t,e,n){var r,i,s,o,a,u=n.indexOf(t),c=n.indexOf(e,u+1),l=u;if(u>=0&&c>0){if(t===e)return[u,c];for(r=[],s=n.length;l>=0&&!a;)l==u?(r.push(l),u=n.indexOf(t,l+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i<s&&(s=i,o=c),c=n.indexOf(e,l+1)),l=u<c&&u>=0?u:c;r.length&&(a=[s,o])}return a}});var lD=m((j8,cD)=>{var rD=nD();cD.exports=uH;var iD="\0SLASH"+Math.random()+"\0",sD="\0OPEN"+Math.random()+"\0",ZS="\0CLOSE"+Math.random()+"\0",oD="\0COMMA"+Math.random()+"\0",aD="\0PERIOD"+Math.random()+"\0";function QS(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function oH(t){return t.split("\\\\").join(iD).split("\\{").join(sD).split("\\}").join(ZS).split("\\,").join(oD).split("\\.").join(aD)}function aH(t){return t.split(iD).join("\\").split(sD).join("{").split(ZS).join("}").split(oD).join(",").split(aD).join(".")}function uD(t){if(!t)return[""];var e=[],n=rD("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=uD(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function uH(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),oc(oH(t),!0).map(aH)):[]}function cH(t){return"{"+t+"}"}function lH(t){return/^-?0\d/.test(t)}function hH(t,e){return t<=e}function dH(t,e){return t>=e}function oc(t,e){var n=[],r=rD("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?oc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),l=u||c,h=r.body.indexOf(",")>=0;if(!l&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+ZS+r.post,oc(t)):[t];var d;if(l)d=r.body.split(/\.\./);else if(d=uD(r.body),d.length===1&&(d=oc(d[0],!1).map(cH),d.length===1))return s.map(function(W){return r.pre+d[0]+W});var g;if(l){var _=QS(d[0]),b=QS(d[1]),C=Math.max(d[0].length,d[1].length),A=d.length==3?Math.abs(QS(d[2])):1,w=hH,T=b<_;T&&(A*=-1,w=dH);var v=d.some(lH);g=[];for(var L=_;w(L,b);L+=A){var R;if(c)R=String.fromCharCode(L),R==="\\"&&(R="");else if(R=String(L),v){var B=C-R.length;if(B>0){var ee=new Array(B+1).join("0");L<0?R="-"+ee+R.slice(1):R=ee+R}}g.push(R)}}else{g=[];for(var ie=0;ie<d.length;ie++)g.push.apply(g,oc(d[ie],!1))}for(var ie=0;ie<g.length;ie++)for(var o=0;o<s.length;o++){var a=i+g[ie]+s[o];(!e||l||a)&&n.push(a)}}return n}});var hD=m(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.assertValidPattern=void 0;var fH=1024*64,pH=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>fH)throw new TypeError("pattern is too long")};sp.assertValidPattern=pH});var fD=m(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.parseClass=void 0;var gH={"[: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]},ac=t=>t.replace(/[[\]\\-]/g,"\\$&"),mH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),dD=t=>t.join(""),yH=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,u=!1,c=!1,l=n,h="";e:for(;s<t.length;){let b=t.charAt(s);if((b==="!"||b==="^")&&s===n+1){c=!0,s++;continue}if(b==="]"&&o&&!u){l=s+1;break}if(o=!0,b==="\\"&&!u){u=!0,s++;continue}if(b==="["&&!u){for(let[C,[A,w,T]]of Object.entries(gH))if(t.startsWith(C,s)){if(h)return["$.",!1,t.length-n,!0];s+=C.length,T?i.push(A):r.push(A),a=a||w;continue e}}if(u=!1,h){b>h?r.push(ac(h)+"-"+ac(b)):b===h&&r.push(ac(b)),h="",s++;continue}if(t.startsWith("-]",s+1)){r.push(ac(b+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=b,s+=2;continue}r.push(ac(b)),s++}if(l<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!c){let b=r[0].length===2?r[0].slice(-1):r[0];return[mH(b),!1,l-n,!1]}let d="["+(c?"^":"")+dD(r)+"]",g="["+(c?"":"^")+dD(i)+"]";return[r.length&&i.length?"("+d+"|"+g+")":r.length?d:g,a,l-n,!0]};op.parseClass=yH});var up=m(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.unescape=void 0;var bH=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");ap.unescape=bH});var nT=m(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.AST=void 0;var _H=fD(),cp=up(),vH=new Set(["!","?","+","*","@"]),pD=t=>vH.has(t),SH="(?!(?:^|/)\\.\\.?(?:$|/))",lp="(?!\\.)",TH=new Set(["[","."]),wH=new Set(["..","."]),EH=new Set("().*{}+?[]^$\\!"),xH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),tT="[^/]",gD=tT+"*?",mD=tT+"+?",eT=class t{type;#e;#t;#s=!1;#r=[];#o;#v;#c;#h=!1;#a;#u;#i=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#h&&this.#c.push(this),this.#v=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.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#v+1;!r.type&&i<r.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#r[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let n=0;n<this.#v;n++){let r=e.#r[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#r.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#r)n.copyIn(r);return n}static#y(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,_="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,_+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(u=!0):b==="]"&&!(g===a+2&&u)&&(o=!1),_+=b;continue}else if(b==="["){o=!0,a=g,u=!1,_+=b;continue}if(!i.noext&&pD(b)&&e.charAt(g)==="("){n.push(_),_="";let C=new t(b,n);g=t.#y(e,C,g,i),n.push(C);continue}_+=b}return n.push(_),g}let c=r+1,l=new t(null,n),h=[],d="";for(;c<e.length;){let g=e.charAt(c++);if(s||g==="\\"){s=!s,d+=g;continue}if(o){c===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(c===a+2&&u)&&(o=!1),d+=g;continue}else if(g==="["){o=!0,a=c,u=!1,d+=g;continue}if(pD(g)&&e.charAt(c)==="("){l.push(d),d="";let _=new t(g,l);l.push(_),c=t.#y(e,_,c,i);continue}if(g==="|"){l.push(d),d="",h.push(l),l=new t(null,n);continue}if(g===")")return d===""&&n.#r.length===0&&(n.#i=!0),l.push(d),d="",n.push(...h,l),c;d+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],c}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#m(),!this.type){let u=this.isStart()&&this.isEnd(),c=this.#r.map(g=>{let[_,b,C,A]=typeof g=="string"?t.#d(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||C,this.#s=this.#s||A,_}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&wH.has(this.#r[0]))){let _=TH,b=n&&_.has(c.charAt(0))||c.startsWith("\\.")&&_.has(c.charAt(2))||c.startsWith("\\.\\.")&&_.has(c.charAt(4)),C=!n&&!e&&_.has(c.charAt(0));l=b?SH:C?lp:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[l+c+h,(0,cp.unescape)(c),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#f(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,cp.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!lp?"":this.#f(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?lp:"")+mD;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?lp:"")+gD+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,cp.unescape)(s),this.#t=!!this.#t,this.#s]}#f(e){return this.#r.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#d(e,n,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(EH.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[c,l,h,d]=(0,_H.parseClass)(e,a);if(h){s+=c,o=o||l,a+=h-1,n=n||d;continue}}if(u==="*"){r&&e==="*"?s+=mD:s+=gD,n=!0;continue}if(u==="?"){s+=tT,n=!0;continue}s+=xH(u)}return[s,(0,cp.unescape)(e),!!n,o]}};hp.AST=eT});var rT=m(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.escape=void 0;var AH=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");dp.escape=AH});var ls=m(Z=>{"use strict";var kH=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Z,"__esModule",{value:!0});Z.unescape=Z.escape=Z.AST=Z.Minimatch=Z.match=Z.makeRe=Z.braceExpand=Z.defaults=Z.filter=Z.GLOBSTAR=Z.sep=Z.minimatch=void 0;var CH=kH(lD()),fp=hD(),_D=nT(),OH=rT(),RH=up(),DH=(t,e,n={})=>((0,fp.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new to(e,n).match(t));Z.minimatch=DH;var PH=/^\*+([^+@!?\*\[\(]*)$/,IH=t=>e=>!e.startsWith(".")&&e.endsWith(t),MH=t=>e=>e.endsWith(t),LH=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),NH=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),qH=/^\*+\.\*+$/,jH=t=>!t.startsWith(".")&&t.includes("."),FH=t=>t!=="."&&t!==".."&&t.includes("."),$H=/^\.\*+$/,BH=t=>t!=="."&&t!==".."&&t.startsWith("."),WH=/^\*+$/,UH=t=>t.length!==0&&!t.startsWith("."),HH=t=>t.length!==0&&t!=="."&&t!=="..",GH=/^\?+([^+@!?\*\[\(]*)?$/,zH=([t,e=""])=>{let n=vD([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},KH=([t,e=""])=>{let n=SD([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},VH=([t,e=""])=>{let n=SD([t]);return e?r=>n(r)&&r.endsWith(e):n},XH=([t,e=""])=>{let n=vD([t]);return e?r=>n(r)&&r.endsWith(e):n},vD=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},SD=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},TD=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yD={win32:{sep:"\\"},posix:{sep:"/"}};Z.sep=TD==="win32"?yD.win32.sep:yD.posix.sep;Z.minimatch.sep=Z.sep;Z.GLOBSTAR=Symbol("globstar **");Z.minimatch.GLOBSTAR=Z.GLOBSTAR;var YH="[^/]",JH=YH+"*?",QH="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ZH="(?:(?!(?:\\/|^)\\.).)*?",e3=(t,e={})=>n=>(0,Z.minimatch)(n,t,e);Z.filter=e3;Z.minimatch.filter=Z.filter;var lr=(t,e={})=>Object.assign({},t,e),t3=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Z.minimatch;let e=Z.minimatch;return Object.assign((r,i,s={})=>e(r,i,lr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,lr(t,s))}static defaults(i){return e.defaults(lr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,lr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,lr(t,s))}},unescape:(r,i={})=>e.unescape(r,lr(t,i)),escape:(r,i={})=>e.escape(r,lr(t,i)),filter:(r,i={})=>e.filter(r,lr(t,i)),defaults:r=>e.defaults(lr(t,r)),makeRe:(r,i={})=>e.makeRe(r,lr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,lr(t,i)),match:(r,i,s={})=>e.match(r,i,lr(t,s)),sep:e.sep,GLOBSTAR:Z.GLOBSTAR})};Z.defaults=t3;Z.minimatch.defaults=Z.defaults;var n3=(t,e={})=>((0,fp.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,CH.default)(t));Z.braceExpand=n3;Z.minimatch.braceExpand=Z.braceExpand;var r3=(t,e={})=>new to(t,e).makeRe();Z.makeRe=r3;Z.minimatch.makeRe=Z.makeRe;var i3=(t,e,n={})=>{let r=new to(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};Z.match=i3;Z.minimatch.match=Z.match;var bD=/[?*]|[+@!]\(.*?\)|\[|\]/,s3=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),to=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,fp.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||TD,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!bD.test(s[2]))&&!bD.test(s[3]),c=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(c)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],u=r[i+2],c=r[i+3];if(a!==".."||!u||u==="."||u===".."||!c||c==="."||c==="..")continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),C=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),w=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),T=C?3:b?0:void 0,v=w?3:A?0:void 0;if(typeof T=="number"&&typeof v=="number"){let[L,R]=[e[T],n[v]];L.toLowerCase()===R.toLowerCase()&&(n[v]=L,v>T?n=n.slice(v):T>v&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,u=e.length,c=n.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");var l=n[a],h=e[o];if(this.debug(n,l,h),l===!1)return!1;if(l===Z.GLOBSTAR){this.debug("GLOBSTAR",[n,l,h]);var d=o,g=a+1;if(g===c){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var _=e[d];if(this.debug(`
|
156
|
+
globstar while`,e,d,n,g,_),this.matchOne(e.slice(d),n.slice(g),r))return this.debug("globstar found match!",d,u,_),!0;if(_==="."||_===".."||!i.dot&&_.charAt(0)==="."){this.debug("dot detected!",e,d,n,g);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(r&&(this.debug(`
|
157
|
+
>>> no match, partial?`,e,d,n,g),d===u))}let b;if(typeof l=="string"?(b=h===l,this.debug("string match",l,h,b)):(b=l.test(h),this.debug("pattern match",l,h,b)),!b)return!1}if(o===u&&a===c)return!0;if(o===u)return r;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,Z.braceExpand)(this.pattern,this.options)}parse(e){(0,fp.assertValidPattern)(e);let n=this.options;if(e==="**")return Z.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(WH))?i=n.dot?HH:UH:(r=e.match(PH))?i=(n.nocase?n.dot?NH:LH:n.dot?MH:IH)(r[1]):(r=e.match(GH))?i=(n.nocase?n.dot?KH:zH:n.dot?VH:XH)(r):(r=e.match(qH))?i=n.dot?FH:jH:(r=e.match($H))&&(i=BH);let s=_D.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?JH:n.dot?QH:ZH,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let c=u.map(l=>{if(l instanceof RegExp)for(let h of l.flags.split(""))i.add(h);return typeof l=="string"?s3(l):l===Z.GLOBSTAR?Z.GLOBSTAR:l._src});return c.forEach((l,h)=>{let d=c[h+1],g=c[h-1];l!==Z.GLOBSTAR||g===Z.GLOBSTAR||(g===void 0?d!==void 0&&d!==Z.GLOBSTAR?c[h+1]="(?:\\/|"+r+"\\/)?"+d:c[h]=r:d===void 0?c[h-1]=g+"(?:\\/|"+r+")?":d!==Z.GLOBSTAR&&(c[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+d,c[h+1]=Z.GLOBSTAR))}),c.filter(l=>l!==Z.GLOBSTAR).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],c=i;if(r.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Z.minimatch.defaults(e).Minimatch}};Z.Minimatch=to;var o3=nT();Object.defineProperty(Z,"AST",{enumerable:!0,get:function(){return o3.AST}});var a3=rT();Object.defineProperty(Z,"escape",{enumerable:!0,get:function(){return a3.escape}});var u3=up();Object.defineProperty(Z,"unescape",{enumerable:!0,get:function(){return u3.unescape}});Z.minimatch.AST=_D.AST;Z.minimatch.Minimatch=to;Z.minimatch.escape=OH.escape;Z.minimatch.unescape=RH.unescape});var kD=m(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.LRUCache=void 0;var Ea=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ED=new Set,iT=typeof process=="object"&&process?process:{},xD=(t,e,n,r)=>{typeof iT.emitWarning=="function"?iT.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},pp=globalThis.AbortController,wD=globalThis.AbortSignal;if(typeof pp>"u"){wD=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},pp=class{constructor(){e()}signal=new wD;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=iT.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,xD("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 c3=t=>!ED.has(t),X8=Symbol("type"),hs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),AD=t=>hs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?xa:null:null,xa=class extends Array{constructor(e){super(e),this.fill(0)}},sT=class t{heap;length;static#e=!1;static create(e){let n=AD(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},oT=class t{#e;#t;#s;#r;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#h;#a;#u;#i;#m;#y;#f;#d;#w;#g;#E;#x;#_;#S;#T;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#_,sizes:e.#E,keyMap:e.#a,keyList:e.#u,valList:e.#i,next:e.#m,prev:e.#y,get head(){return e.#f},get tail(){return e.#d},free:e.#w,isBackgroundFetch:n=>e.#l(n),backgroundFetch:(n,r,i,s)=>e.#j(n,r,i,s),moveToTail:n=>e.#$(n),indexes:n=>e.#k(n),rindexes:n=>e.#C(n),isStale:n=>e.#b(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#c}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#r}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:d,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:C,memoMethod:A,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:L,ignoreFetchAbort:R}=e;if(n!==0&&!hs(n))throw new TypeError("max option must be a nonnegative integer");let B=n?AD(n):Array;if(!B)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=g,this.maxEntrySize=_||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=A,C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=C,this.#T=!!C,this.#a=new Map,this.#u=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#m=new B(n),this.#y=new B(n),this.#f=0,this.#d=0,this.#w=sT.create(n),this.#c=0,this.#h=0,typeof c=="function"&&(this.#s=c),typeof l=="function"?(this.#r=l,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#S=!!this.#s,this.#p=!!this.#r,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!hs(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!hs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=hs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!hs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}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 ee="LRU_CACHE_UNBOUNDED";c3(ee)&&(ED.add(ee),xD("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ee,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#O(){let e=new xa(this.#e),n=new xa(this.#e);this.#_=e,this.#x=n,this.#P=(s,o,a=Ea.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#b(s)&&this.#D(this.#u[s],"expire")},o+1);u.unref&&u.unref()}},this.#A=s=>{n[s]=e[s]!==0?Ea.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],u=n[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=r||i();let c=s.now-u;s.remainingTTL=a-c}};let r=0,i=()=>{let s=Ea.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let c=(r||i())-u;return a-c},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#A=()=>{};#n=()=>{};#P=()=>{};#b=()=>!1;#R(){let e=new xa(this.#e);this.#h=0,this.#E=e,this.#I=n=>{this.#h-=e[n],e[n]=0},this.#L=(n,r,i,s)=>{if(this.#l(r))return 0;if(!hs(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!hs(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#M=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#h>s;)this.#q(!0)}this.#h+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#I=e=>{};#M=(e,n,r)=>{};#L=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#d;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#f));)n=this.#y[n]}*#C({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#f;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#d));)n=this.#m[n]}#N(e){return e!==void 0&&this.#a.get(this.#u[e])===e}*entries(){for(let e of this.#k())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#C())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#k()){let n=this.#u[e];n!==void 0&&!this.#l(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#C()){let n=this.#u[e];n!==void 0&&!this.#l(this.#i[e])&&(yield n)}}*values(){for(let e of this.#k())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#C())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#k()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(e,n=this){for(let r of this.#k()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}rforEach(e,n=this){for(let r of this.#C()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}purgeStale(){let e=!1;for(let n of this.#C({allowStale:!0}))this.#b(n)&&(this.#D(this.#u[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],i=this.#l(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#_&&this.#x){let o=this.#_[n],a=this.#x[n];if(o&&a){let u=o-(Ea.now()-a);s.ttl=u,s.start=Date.now()}}return this.#E&&(s.size=this.#E[n]),s}dump(){let e=[];for(let n of this.#k({allowStale:!0})){let r=this.#u[n],i=this.#i[n],s=this.#l(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#_&&this.#x){o.ttl=this.#_[n];let a=Ea.now()-this.#x[n];o.start=Math.floor(Date.now()-a)}this.#E&&(o.size=this.#E[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Ea.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,l=this.#L(e,n,r.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#D(e,"set"),this;let h=this.#c===0?void 0:this.#a.get(e);if(h===void 0)h=this.#c===0?this.#d:this.#w.length!==0?this.#w.pop():this.#c===this.#e?this.#q(!1):this.#c,this.#u[h]=e,this.#i[h]=n,this.#a.set(e,h),this.#m[this.#d]=h,this.#y[h]=this.#d,this.#d=h,this.#c++,this.#M(h,l,u),u&&(u.set="add"),c=!1;else{this.#$(h);let d=this.#i[h];if(n!==d){if(this.#T&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=d;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#g?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(d,e,"set"),this.#p&&this.#g?.push([d,e,"set"]));if(this.#I(h),this.#M(h,l,u),this.#i[h]=n,u){u.set="replace";let g=d&&this.#l(d)?d.__staleWhileFetching:d;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(i!==0&&!this.#_&&this.#O(),this.#_&&(c||this.#P(h,i,s),u&&this.#n(u,h)),!o&&this.#p&&this.#g){let d=this.#g,g;for(;g=d?.shift();)this.#r?.(...g)}return this}pop(){try{for(;this.#c;){let e=this.#i[this.#f];if(this.#q(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#r?.(...n)}}}#q(e){let n=this.#f,r=this.#u[n],i=this.#i[n];return this.#T&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(i,r,"evict"),this.#p&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#u[n]=void 0,this.#i[n]=void 0,this.#w.push(n)),this.#c===1?(this.#f=this.#d=0,this.#w.length=0):this.#f=this.#m[n],this.#a.delete(r),this.#c--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#a.get(e);if(s!==void 0){let o=this.#i[s];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))i&&(i.has="stale",this.#n(i,s));else return r&&this.#A(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#i[i];return this.#l(s)?s.__staleWhileFetching:s}#j(e,n,r,i){let s=n===void 0?void 0:this.#i[n];if(this.#l(s))return s;let o=new pp,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},c=(b,C=!1)=>{let{aborted:A}=o.signal,w=r.ignoreFetchAbort&&b!==void 0;if(r.status&&(A&&!C?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,w&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!w&&!C)return h(o.signal.reason);let T=g;return this.#i[n]===g&&(b===void 0?T.__staleWhileFetching?this.#i[n]=T.__staleWhileFetching:this.#D(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,b,u.options))),b},l=b=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=b),h(b)),h=b=>{let{aborted:C}=o.signal,A=C&&r.allowStaleOnFetchAbort,w=A||r.allowStaleOnFetchRejection,T=w||r.noDeleteOnFetchRejection,v=g;if(this.#i[n]===g&&(!T||v.__staleWhileFetching===void 0?this.#D(e,"fetch"):A||(this.#i[n]=v.__staleWhileFetching)),w)return r.status&&v.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),v.__staleWhileFetching;if(v.__returned===v)throw b},d=(b,C)=>{let A=this.#o?.(e,s,u);A&&A instanceof Promise&&A.then(w=>b(w===void 0?void 0:w),C),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(void 0),r.allowStaleOnFetchAbort&&(b=w=>c(w,!0)))})};r.status&&(r.status.fetchDispatched=!0);let g=new Promise(d).then(c,l),_=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,_,{...u.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=_,_}#l(e){if(!this.#T)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof pp}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:C=!1,status:A,signal:w}=n;if(!this.#T)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let T={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:_,ignoreFetchAbort:g,status:A,signal:w},v=this.#a.get(e);if(v===void 0){A&&(A.fetch="miss");let L=this.#j(e,v,T,b);return L.__returned=L}else{let L=this.#i[v];if(this.#l(L)){let W=r&&L.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",W&&(A.returnedStale=!0)),W?L.__staleWhileFetching:L.__returned=L}let R=this.#b(v);if(!C&&!R)return A&&(A.fetch="hit"),this.#$(v),i&&this.#A(v),A&&this.#n(A,v),L;let B=this.#j(e,v,T,b),ie=B.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=R?"stale":"refresh",ie&&R&&(A.returnedStale=!0)),ie?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#v;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=r(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let u=this.#i[a],c=this.#l(u);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),c?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#D(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),c?u.__staleWhileFetching:(this.#$(a),i&&this.#A(a),u))}else o&&(o.get="miss")}#F(e,n){this.#y[n]=e,this.#m[e]=n}#$(e){e!==this.#d&&(e===this.#f?this.#f=this.#m[e]:this.#F(this.#y[e],this.#m[e]),this.#F(this.#d,e),this.#d=e)}delete(e){return this.#D(e,"delete")}#D(e,n){let r=!1;if(this.#c!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#c===1)this.#B(n);else{this.#I(i);let s=this.#i[i];if(this.#l(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,n),this.#p&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#u[i]=void 0,this.#i[i]=void 0,i===this.#d)this.#d=this.#y[i];else if(i===this.#f)this.#f=this.#m[i];else{let o=this.#y[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#y[a]=this.#y[i]}this.#c--,this.#w.push(i)}}if(this.#p&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#C({allowStale:!0})){let r=this.#i[n];if(this.#l(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#u[n];this.#S&&this.#s?.(r,i,e),this.#p&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#_&&this.#x&&(this.#_.fill(0),this.#x.fill(0)),this.#E&&this.#E.fill(0),this.#f=0,this.#d=0,this.#w.length=0,this.#h=0,this.#c=0,this.#p&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};gp.LRUCache=oT});var pT=m(bn=>{"use strict";var l3=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bn,"__esModule",{value:!0});bn.Minipass=bn.isWritable=bn.isReadable=bn.isStream=void 0;var CD=typeof process=="object"&&process?process:{stdout:null,stderr:null},fT=require("node:events"),PD=l3(require("node:stream")),h3=require("node:string_decoder"),d3=t=>!!t&&typeof t=="object"&&(t instanceof Tp||t instanceof PD.default||(0,bn.isReadable)(t)||(0,bn.isWritable)(t));bn.isStream=d3;var f3=t=>!!t&&typeof t=="object"&&t instanceof fT.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==PD.default.Writable.prototype.pipe;bn.isReadable=f3;var p3=t=>!!t&&typeof t=="object"&&t instanceof fT.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";bn.isWritable=p3;var xi=Symbol("EOF"),Ai=Symbol("maybeEmitEnd"),ds=Symbol("emittedEnd"),mp=Symbol("emittingEnd"),uc=Symbol("emittedError"),yp=Symbol("closed"),OD=Symbol("read"),bp=Symbol("flush"),RD=Symbol("flushChunk"),Dr=Symbol("encoding"),Aa=Symbol("decoder"),Ht=Symbol("flowing"),cc=Symbol("paused"),ka=Symbol("resume"),Gt=Symbol("buffer"),yn=Symbol("pipes"),zt=Symbol("bufferLength"),aT=Symbol("bufferPush"),_p=Symbol("bufferShift"),un=Symbol("objectMode"),At=Symbol("destroyed"),uT=Symbol("error"),cT=Symbol("emitData"),DD=Symbol("emitEnd"),lT=Symbol("emitEnd2"),ni=Symbol("async"),hT=Symbol("abort"),vp=Symbol("aborted"),lc=Symbol("signal"),no=Symbol("dataListeners"),Bn=Symbol("discarded"),hc=t=>Promise.resolve().then(t),g3=t=>t(),m3=t=>t==="end"||t==="finish"||t==="prefinish",y3=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,b3=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Sp=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[ka](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},dT=class extends Sp{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},_3=t=>!!t.objectMode,v3=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Tp=class extends fT.EventEmitter{[Ht]=!1;[cc]=!1;[yn]=[];[Gt]=[];[un];[Dr];[ni];[Aa];[xi]=!1;[ds]=!1;[mp]=!1;[yp]=!1;[uc]=null;[zt]=0;[At]=!1;[lc];[vp]=!1;[no]=0;[Bn]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");_3(n)?(this[un]=!0,this[Dr]=null):v3(n)?(this[Dr]=n.encoding,this[un]=!1):(this[un]=!1,this[Dr]=null),this[ni]=!!n.async,this[Aa]=this[Dr]?new h3.StringDecoder(this[Dr]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Gt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[yn]});let{signal:r}=n;r&&(this[lc]=r,r.aborted?this[hT]():r.addEventListener("abort",()=>this[hT]()))}get bufferLength(){return this[zt]}get encoding(){return this[Dr]}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[un]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ni]}set async(e){this[ni]=this[ni]||!!e}[hT](){this[vp]=!0,this.emit("abort",this[lc]?.reason),this.destroy(this[lc]?.reason)}get aborted(){return this[vp]}set aborted(e){}write(e,n,r){if(this[vp])return!1;if(this[xi])throw new Error("write after end");if(this[At])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[ni]?hc:g3;if(!this[un]&&!Buffer.isBuffer(e)){if(b3(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(y3(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[un]?(this[Ht]&&this[zt]!==0&&this[bp](!0),this[Ht]?this.emit("data",e):this[aT](e),this[zt]!==0&&this.emit("readable"),r&&i(r),this[Ht]):e.length?(typeof e=="string"&&!(n===this[Dr]&&!this[Aa]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Dr]&&(e=this[Aa].write(e)),this[Ht]&&this[zt]!==0&&this[bp](!0),this[Ht]?this.emit("data",e):this[aT](e),this[zt]!==0&&this.emit("readable"),r&&i(r),this[Ht]):(this[zt]!==0&&this.emit("readable"),r&&i(r),this[Ht])}read(e){if(this[At])return null;if(this[Bn]=!1,this[zt]===0||e===0||e&&e>this[zt])return this[Ai](),null;this[un]&&(e=null),this[Gt].length>1&&!this[un]&&(this[Gt]=[this[Dr]?this[Gt].join(""):Buffer.concat(this[Gt],this[zt])]);let n=this[OD](e||null,this[Gt][0]);return this[Ai](),n}[OD](e,n){if(this[un])this[_p]();else{let r=n;e===r.length||e===null?this[_p]():typeof r=="string"?(this[Gt][0]=r.slice(e),n=r.slice(0,e),this[zt]-=e):(this[Gt][0]=r.subarray(e),n=r.subarray(0,e),this[zt]-=e)}return this.emit("data",n),!this[Gt].length&&!this[xi]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[xi]=!0,this.writable=!1,(this[Ht]||!this[cc])&&this[Ai](),this}[ka](){this[At]||(!this[no]&&!this[yn].length&&(this[Bn]=!0),this[cc]=!1,this[Ht]=!0,this.emit("resume"),this[Gt].length?this[bp]():this[xi]?this[Ai]():this.emit("drain"))}resume(){return this[ka]()}pause(){this[Ht]=!1,this[cc]=!0,this[Bn]=!1}get destroyed(){return this[At]}get flowing(){return this[Ht]}get paused(){return this[cc]}[aT](e){this[un]?this[zt]+=1:this[zt]+=e.length,this[Gt].push(e)}[_p](){return this[un]?this[zt]-=1:this[zt]-=this[Gt][0].length,this[Gt].shift()}[bp](e=!1){do;while(this[RD](this[_p]())&&this[Gt].length);!e&&!this[Gt].length&&!this[xi]&&this.emit("drain")}[RD](e){return this.emit("data",e),this[Ht]}pipe(e,n){if(this[At])return e;this[Bn]=!1;let r=this[ds];return n=n||{},e===CD.stdout||e===CD.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[yn].push(n.proxyErrors?new dT(this,e,n):new Sp(this,e,n)),this[ni]?hc(()=>this[ka]()):this[ka]()),e}unpipe(e){let n=this[yn].find(r=>r.dest===e);n&&(this[yn].length===1?(this[Ht]&&this[no]===0&&(this[Ht]=!1),this[yn]=[]):this[yn].splice(this[yn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[Bn]=!1,this[no]++,!this[yn].length&&!this[Ht]&&this[ka]();else if(e==="readable"&&this[zt]!==0)super.emit("readable");else if(m3(e)&&this[ds])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[uc]){let i=n;this[ni]?hc(()=>i.call(this,this[uc])):i.call(this,this[uc])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[no]=this.listeners("data").length,this[no]===0&&!this[Bn]&&!this[yn].length&&(this[Ht]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[no]=0,!this[Bn]&&!this[yn].length&&(this[Ht]=!1)),n}get emittedEnd(){return this[ds]}[Ai](){!this[mp]&&!this[ds]&&!this[At]&&this[Gt].length===0&&this[xi]&&(this[mp]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[yp]&&this.emit("close"),this[mp]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==At&&this[At])return!1;if(e==="data")return!this[un]&&!r?!1:this[ni]?(hc(()=>this[cT](r)),!0):this[cT](r);if(e==="end")return this[DD]();if(e==="close"){if(this[yp]=!0,!this[ds]&&!this[At])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[uc]=r,super.emit(uT,r);let s=!this[lc]||this.listeners("error").length?super.emit("error",r):!1;return this[Ai](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ai](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[Ai](),i}[cT](e){for(let r of this[yn])r.dest.write(e)===!1&&this.pause();let n=this[Bn]?!1:super.emit("data",e);return this[Ai](),n}[DD](){return this[ds]?!1:(this[ds]=!0,this.readable=!1,this[ni]?(hc(()=>this[lT]()),!0):this[lT]())}[lT](){if(this[Aa]){let n=this[Aa].end();if(n){for(let r of this[yn])r.dest.write(n);this[Bn]||super.emit("data",n)}}for(let n of this[yn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[un]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[un]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[un])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Dr]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(At,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Bn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[xi])return n();let s,o,a=h=>{this.off("data",u),this.off("end",c),this.off(At,l),n(),o(h)},u=h=>{this.off("error",a),this.off("end",c),this.off(At,l),this.pause(),s({value:h,done:!!this[xi]})},c=()=>{this.off("error",a),this.off("data",u),this.off(At,l),n(),s({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((h,d)=>{o=d,s=h,this.once(At,l),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Bn]=!1;let e=!1,n=()=>(this.pause(),this.off(uT,n),this.off(At,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(uT,n),this.once(At,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[At])return e?this.emit("error",e):this.emit(At),this;this[At]=!0,this[Bn]=!0,this[Gt].length=0,this[zt]=0;let n=this;return typeof n.close=="function"&&!this[yp]&&n.close(),e?this.emit("error",e):this.emit(At),this}static get isStream(){return bn.isStream}};bn.Minipass=Tp});var KD=m(je=>{"use strict";var S3=je&&je.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),T3=je&&je.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),w3=je&&je.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&S3(e,t,n);return T3(e,t),e};Object.defineProperty(je,"__esModule",{value:!0});je.PathScurry=je.Path=je.PathScurryDarwin=je.PathScurryPosix=je.PathScurryWin32=je.PathScurryBase=je.PathPosix=je.PathWin32=je.PathBase=je.ChildrenCache=je.ResolveCache=void 0;var jD=kD(),kp=require("node:path"),E3=require("node:url"),fc=require("fs"),x3=w3(require("node:fs")),A3=fc.realpathSync.native,wp=require("node:fs/promises"),ID=pT(),pc={lstatSync:fc.lstatSync,readdir:fc.readdir,readdirSync:fc.readdirSync,readlinkSync:fc.readlinkSync,realpathSync:A3,promises:{lstat:wp.lstat,readdir:wp.readdir,readlink:wp.readlink,realpath:wp.realpath}},FD=t=>!t||t===pc||t===x3?pc:{...pc,...t,promises:{...pc.promises,...t.promises||{}}},$D=/^\\\\\?\\([a-z]:)\\?$/i,k3=t=>t.replace(/\//g,"\\").replace($D,"$1\\"),C3=/[\\\/]/,dr=0,BD=1,WD=2,ri=4,UD=6,HD=8,ro=10,GD=12,hr=15,dc=~hr,gT=16,MD=32,gc=64,Pr=128,Ep=256,Ap=512,LD=gc|Pr|Ap,O3=1023,mT=t=>t.isFile()?HD:t.isDirectory()?ri:t.isSymbolicLink()?ro:t.isCharacterDevice()?WD:t.isBlockDevice()?UD:t.isSocket()?GD:t.isFIFO()?BD:dr,ND=new Map,mc=t=>{let e=ND.get(t);if(e)return e;let n=t.normalize("NFKD");return ND.set(t,n),n},qD=new Map,xp=t=>{let e=qD.get(t);if(e)return e;let n=mc(t.toLowerCase());return qD.set(t,n),n},yc=class extends jD.LRUCache{constructor(){super({max:256})}};je.ResolveCache=yc;var Cp=class extends jD.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};je.ChildrenCache=Cp;var zD=Symbol("PathScurry setAsCwd"),Jt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#c;get rdev(){return this.#c}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#u;get size(){return this.#u}#i;get blocks(){return this.#i}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#f;get ctimeMs(){return this.#f}#d;get birthtimeMs(){return this.#d}#w;get atime(){return this.#w}#g;get mtime(){return this.#g}#E;get ctime(){return this.#E}#x;get birthtime(){return this.#x}#_;#S;#T;#p;#O;#A;#n;#P;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=dr,r,i,s,o,a){this.name=e,this.#_=s?xp(e):mc(e),this.#n=n&O3,this.nocase=s,this.roots=i,this.root=r||this,this.#P=o,this.#T=a.fullpath,this.#O=a.relative,this.#A=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=FD(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#P}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#P.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#P.set(this,n),this.#n&=~gT,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?xp(e):mc(e);for(let u of r)if(u.#_===i)return u;let s=this.parent?this.sep:"",o=this.#T?this.#T+s+e:void 0,a=this.newChild(e,dr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Pr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let e=this.name,n=this.parent;if(!n)return this.#O=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,n=this.parent;if(!n)return this.#A=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#T!==void 0)return this.#T;let e=this.name,n=this.parent;if(!n)return this.#T=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#T=i}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#p=`//?/${i}`:this.#p=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&hr)===dr}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&hr)===HD}isDirectory(){return(this.#n&hr)===ri}isCharacterDevice(){return(this.#n&hr)===WD}isBlockDevice(){return(this.#n&hr)===UD}isFIFO(){return(this.#n&hr)===BD}isSocket(){return(this.#n&hr)===GD}isSymbolicLink(){return(this.#n&ro)===ro}lstatCached(){return this.#n&MD?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&hr;return!(e!==dr&&e!==ro||this.#n&Ep||this.#n&Pr)}calledReaddir(){return!!(this.#n&gT)}isENOENT(){return!!(this.#n&Pr)}isNamed(e){return this.nocase?this.#_===xp(e):this.#_===mc(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#b=r}catch(n){this.#l(n.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#b=r}catch(n){this.#l(n.code);return}}#M(e){this.#n|=gT;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#L()}}#L(){this.#n&Pr||(this.#n=(this.#n|Pr)&dc,this.#k())}#k(){let e=this.children();e.provisional=0;for(let n of e)n.#L()}#C(){this.#n|=Ap,this.#N()}#N(){if(this.#n&gc)return;let e=this.#n;(e&hr)===ri&&(e&=dc),this.#n=e|gc,this.#k()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#L()}#l(e=""){let n=this.#n;n|=Ep,e==="ENOENT"&&(n|=Pr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=dc),this.#n=n,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#F(e,n){return this.#D(e,n)||this.#$(e,n)}#$(e,n){let r=mT(e),i=this.newChild(e.name,r,{parent:this}),s=i.#n&hr;return s!==ri&&s!==ro&&s!==dr&&(i.#n|=gc),n.unshift(i),n.provisional++,i}#D(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?xp(e.name):mc(e.name))===i.#_)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#n=n.#n&dc|mT(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if(!(this.#n&Pr))try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if(!(this.#n&Pr))try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:c,dev:l,gid:h,ino:d,mode:g,mtime:_,mtimeMs:b,nlink:C,rdev:A,size:w,uid:T}=e;this.#w=n,this.#m=r,this.#x=i,this.#d=s,this.#h=o,this.#i=a,this.#E=u,this.#f=c,this.#t=l,this.#v=h,this.#a=d,this.#s=g,this.#g=_,this.#y=b,this.#r=C,this.#c=A,this.#u=w,this.#o=T;let v=mT(e);this.#n=this.#n&dc|v|MD,v!==dr&&v!==ri&&v!==ro&&(this.#n|=gc)}#U=[];#H=!1;#z(e){this.#H=!1;let n=this.#U.slice();this.#U.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#U.push(e),this.#H)return;this.#H=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),r.provisional=0;else{for(let a of o)this.#F(a,r);this.#M(r)}this.#z(r.slice(0,r.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#W)await this.#W;else{let r=()=>{};this.#W=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#F(i,e);this.#M(e)}catch(i){this.#q(i.code),e.provisional=0}this.#W=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#F(r,e);this.#M(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&LD)return!1;let e=hr&this.#n;return e===dr||e===ri||e===ro}shouldWalk(e,n){return(this.#n&ri)===ri&&!(this.#n&LD)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((Ap|Ep|Pr)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#C()}}realpathSync(){if(this.#R)return this.#R;if(!((Ap|Ep|Pr)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#C()}}[zD](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#O=r.join(this.sep),i.#A=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#O=void 0,i.#A=void 0,i=i.parent}};je.PathBase=Jt;var bc=class t extends Jt{sep="\\";splitSep=C3;constructor(e,n=dr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=dr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return kp.win32.parse(e).root}getRoot(e){if(e=k3(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new Sc(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace($D,"$1\\"),e===n}};je.PathWin32=bc;var _c=class t extends Jt{splitSep="/";sep="/";constructor(e,n=dr,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=dr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};je.PathPosix=_c;var vc=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=pc}={}){this.#r=FD(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,E3.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new yc,this.#t=new yc,this.#s=new Cp(s);let u=a.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let c=this.root,l=u.length-1,h=n.sep,d=this.rootPath,g=!1;for(let _ of u){let b=l--;c=c.child(_,{relative:new Array(b).fill("..").join(h),relativePosix:new Array(b).fill("..").join("/"),fullpath:d+=(g?"":h)+_}),g=!0}this.cwd=c}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set,c=(h,d)=>{u.add(h),h.readdirCB((g,_)=>{if(g)return d(g);let b=_.length;if(!b)return d();let C=()=>{--b===0&&d()};for(let A of _)(!s||s(A))&&a.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(w=>w?.isUnknown()?w.lstat():w).then(w=>w?.shouldWalk(u,o)?c(w,C):C()):A.shouldWalk(u,o)?c(A,C):C()},!0)},l=e;return new Promise((h,d)=>{c(l,g=>{if(g)return d(g);h(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set([e]);for(let c of u){let l=c.readdirSync();for(let h of l){(!s||s(h))&&a.push(r?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(u,o)&&u.add(d)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let u of a){let c=u.readdirSync();for(let l of c){(!s||s(l))&&(yield r?l:l.fullpath());let h=l;if(l.isSymbolicLink()){if(!(i&&(h=l.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new ID.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,c=[e],l=0,h=()=>{let d=!1;for(;!d;){let g=c.shift();if(!g){l===0&&a.end();return}l++,u.add(g);let _=(C,A,w=!1)=>{if(C)return a.emit("error",C);if(i&&!w){let T=[];for(let v of A)v.isSymbolicLink()&&T.push(v.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(T.length){Promise.all(T).then(()=>_(null,A,!0));return}}for(let T of A)T&&(!s||s(T))&&(a.write(r?T:T.fullpath())||(d=!0));l--;for(let T of A){let v=T.realpathCached()||T;v.shouldWalk(u,o)&&c.push(v)}d&&!a.flowing?a.once("drain",h):b||h()},b=!0;g.readdirCB(_,!0),b=!1}};return h(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Jt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new ID.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let c=[e],l=0,h=()=>{let d=!1;for(;!d;){let g=c.shift();if(!g){l===0&&a.end();return}l++,u.add(g);let _=g.readdirSync();for(let b of _)(!s||s(b))&&(a.write(r?b:b.fullpath())||(d=!0));l--;for(let b of _){let C=b;if(b.isSymbolicLink()){if(!(i&&(C=b.realpathSync())))continue;C.isUnknown()&&C.lstatSync()}C.shouldWalk(u,o)&&c.push(C)}}d&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[zD](n)}};je.PathScurryBase=vc;var Sc=class extends vc{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,kp.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return kp.win32.parse(e).root.toUpperCase()}newRoot(e){return new bc(this.rootPath,ri,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};je.PathScurryWin32=Sc;var Tc=class extends vc{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,kp.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new _c(this.rootPath,ri,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};je.PathScurryPosix=Tc;var Op=class extends Tc{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};je.PathScurryDarwin=Op;je.Path=process.platform==="win32"?bc:_c;je.PathScurry=process.platform==="win32"?Sc:process.platform==="darwin"?Op:Tc});var bT=m(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Pattern=void 0;var R3=ls(),D3=t=>t.length>=1,P3=t=>t.length>=1,yT=class t{#e;#t;#s;length;#r;#o;#v;#c;#h;#a;#u=!0;constructor(e,n,r,i){if(!D3(e))throw new TypeError("empty pattern list");if(!P3(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#s=r,this.#r=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...c]=this.#e,[l,h,d,g,..._]=this.#t;c[0]===""&&(c.shift(),_.shift());let b=[s,o,a,u,""].join("/"),C=[l,h,d,g,""].join("/");this.#e=[b,...c],this.#t=[C,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#t;o[0]===""&&(o.shift(),u.shift());let c=s+"/",l=a+"/";this.#e=[c,...o],this.#t=[l,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===R3.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#s+1,this.#r),this.#o.#a=this.#a,this.#o.#h=this.#h,this.#o.#c=this.#c,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};Rp.Pattern=yT});var vT=m(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Ignore=void 0;var VD=ls(),I3=bT(),M3=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",_T=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=M3}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new VD.Minimatch(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new I3.Pattern(i,s,0,this.platform),a=new VD.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),u&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};Dp.Ignore=_T});var YD=m(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.Processor=ii.SubWalks=ii.MatchRecord=ii.HasWalkedCache=void 0;var XD=ls(),Pp=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}};ii.HasWalkedCache=Pp;var Ip=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}};ii.MatchRecord=Ip;var Mp=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};ii.SubWalks=Mp;var ST=class t{hasWalkedCache;matches=new Ip;subwalks=new Mp;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new Pp}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,c,l=!1;for(;typeof(u=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(u),s=c,l=!0;if(u=s.pattern(),c=s.rest(),l){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,h);continue}else if(u===XD.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=c?.pattern(),d=c?.rest();if(!c||(h===""||h===".")&&!d)this.matches.add(i,a,h===""||h===".");else if(h===".."){let g=i.parent||i;d?this.hasWalkedCache.hasWalked(g,d)||this.subwalks.add(g,d):this.matches.add(g,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),u=o.pattern(),c=o.rest();u===XD.GLOBSTAR?i.testGlobstar(s,o,c,a):u instanceof RegExp?i.testRegExp(s,u,c,a):i.testString(s,u,c,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};ii.Processor=ST});var ZD=m(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.GlobStream=fs.GlobWalker=fs.GlobUtil=void 0;var L3=pT(),JD=vT(),QD=YD(),N3=(t,e)=>typeof t=="string"?new JD.Ignore([t],e):Array.isArray(t)?new JD.Ignore(t,e):t,wc=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=N3(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#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,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new QD.Processor(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,c).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,r,o):a.readdirCB((c,l)=>this.walkCB3(a,l,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,c).then(()=>o()));for(let[a,u]of r.subwalks.entries())s++,this.walkCB2(a,u,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new QD.Processor(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||this.matchSync(a,u,c);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||this.matchSync(a,u,c);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};fs.GlobUtil=wc;var TT=class extends wc{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};fs.GlobWalker=TT;var wT=class extends wc{results;constructor(e,n,r){super(e,n,r),this.results=new L3.Minipass({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}};fs.GlobStream=wT});var xT=m(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.Glob=void 0;var q3=ls(),j3=require("node:url"),Lp=KD(),F3=bT(),Np=ZD(),$3=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ET=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,j3.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=n.platform||$3,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=n.platform==="win32"?Lp.PathScurryWin32:n.platform==="darwin"?Lp.PathScurryDarwin:n.platform?Lp.PathScurryPosix:Lp.PathScurry;this.scurry=new u(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new q3.Minimatch(u,i)),[o,a]=s.reduce((u,c)=>(u[0].push(...c.set),u[1].push(...c.globParts),u),[[],[]]);this.patterns=o.map((u,c)=>{let l=a[c];if(!l)throw new Error("invalid pattern object");return new F3.Pattern(u,l,0,this.platform)})}async walk(){return[...await new Np.GlobWalker(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 Np.GlobWalker(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 Np.GlobStream(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 Np.GlobStream(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()}};qp.Glob=ET});var AT=m(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.hasMagic=void 0;var B3=ls(),W3=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new B3.Minimatch(n,e).hasMagic())return!0;return!1};jp.hasMagic=W3});var rP=m(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.glob=xe.sync=xe.iterate=xe.iterateSync=xe.stream=xe.streamSync=xe.Ignore=xe.hasMagic=xe.Glob=xe.unescape=xe.escape=void 0;xe.globStreamSync=Ec;xe.globStream=kT;xe.globSync=CT;xe.globIterateSync=xc;xe.globIterate=OT;var eP=ls(),io=xT(),U3=AT(),nP=ls();Object.defineProperty(xe,"escape",{enumerable:!0,get:function(){return nP.escape}});Object.defineProperty(xe,"unescape",{enumerable:!0,get:function(){return nP.unescape}});var H3=xT();Object.defineProperty(xe,"Glob",{enumerable:!0,get:function(){return H3.Glob}});var G3=AT();Object.defineProperty(xe,"hasMagic",{enumerable:!0,get:function(){return G3.hasMagic}});var z3=vT();Object.defineProperty(xe,"Ignore",{enumerable:!0,get:function(){return z3.Ignore}});function Ec(t,e={}){return new io.Glob(t,e).streamSync()}function kT(t,e={}){return new io.Glob(t,e).stream()}function CT(t,e={}){return new io.Glob(t,e).walkSync()}async function tP(t,e={}){return new io.Glob(t,e).walk()}function xc(t,e={}){return new io.Glob(t,e).iterateSync()}function OT(t,e={}){return new io.Glob(t,e).iterate()}xe.streamSync=Ec;xe.stream=Object.assign(kT,{sync:Ec});xe.iterateSync=xc;xe.iterate=Object.assign(OT,{sync:xc});xe.sync=Object.assign(CT,{stream:Ec,iterate:xc});xe.glob=Object.assign(tP,{glob:tP,globSync:CT,sync:xe.sync,globStream:kT,stream:xe.stream,globStreamSync:Ec,streamSync:xe.streamSync,globIterate:OT,iterate:xe.iterate,globIterateSync:xc,iterateSync:xe.iterateSync,Glob:io.Glob,hasMagic:U3.hasMagic,escape:eP.escape,unescape:eP.unescape});xe.glob.glob=xe.glob});var sP=m(Ca=>{"use strict";var DT=Ca&&Ca.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.FileSystem=void 0;var K3=Bm(),iP=(JR(),gP(YR)),V3=DT(require("events")),Fp=NS(),X3=DT(require("fs")),Y3=rp(),J3=DT(Hf()),Q3=rP(),RT=class extends V3.default{constructor(e){super(),this._context=e,this._textDocumentManager=new K3.TextDocuments(iP.TextDocument),this._tempTextDocumentCache=new J3.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._workspace==null)return[];let e=await this._workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>Fp.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async getWorkspaceRelatedFiles(){let e=this._context.getConfiguration(),n=e.fileExtensions,r=e.typeAnalyzer.exclude,i=await this.getWorkspaceFolderUris();return(await Promise.all(i.flatMap(async o=>(0,Q3.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>Fp.URI.file(o))}async findExistingPath(e,...n){if(await this.getTextDocument(e)!=null)return e;if(n.length===0)return null;try{let i=await Promise.any(n.map(async s=>{if(await this.getTextDocument(s)!=null)return s;throw new Error("Alternative path could not resolve")}));return i??null}catch{return null}}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=Fp.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await X3.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=iP.TextDocument.create(e,Y3.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(Fp.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};Ca.FileSystem=RT});var oP=m($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.NodeContext=void 0;var PT=Bm(),IT=rp(),Z3=sP(),MT=class extends IT.CoreContext{constructor(){super(),this.documentManager=new IT.DocumentManager().setContext(this),this.documentMerger=new IT.DocumentMerger,this.connection=(0,PT.createConnection)(PT.ProposedFeatures.all),this.fs=new Z3.FileSystem(this)}createSemanticTokensBuilder(){return new PT.SemanticTokensBuilder}};$p.NodeContext=MT});Object.defineProperty(exports,"__esModule",{value:!0});var eG=oP(),Ir=rp(),aP=new eG.NodeContext;aP.on("ready",t=>{(0,Ir.activateAutocomplete)(t),(0,Ir.activateColor)(t),(0,Ir.activateDefinition)(t),(0,Ir.activateDiagnostic)(t),(0,Ir.activateFormatter)(t),(0,Ir.activateHover)(t),(0,Ir.activateSignature)(t),(0,Ir.activateSubscriptions)(t),(0,Ir.activateSymbol)(t),(0,Ir.activateSemantic)(t),(0,Ir.activateFoldingRange)(t)});aP.listen();
|