miniscript-languageserver 1.4.8 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/README.md +111 -24
  2. package/index.js +89 -89
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -1,89 +1,89 @@
1
- "use strict";var hf=Object.defineProperty;var lO=Object.getOwnPropertyDescriptor;var dO=Object.getOwnPropertyNames;var fO=Object.prototype.hasOwnProperty;var pO=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hO=(t,e)=>{for(var n in e)hf(t,n,{get:e[n],enumerable:!0})},gO=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dO(e))!fO.call(t,i)&&i!==n&&hf(t,i,{get:()=>e[i],enumerable:!(r=lO(e,i))||r.enumerable});return t};var mO=t=>gO(hf({},"__esModule",{value:!0}),t);var Tu=g(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.thenable=_t.typedArray=_t.stringArray=_t.array=_t.func=_t.error=_t.number=_t.string=_t.boolean=void 0;function yO(t){return t===!0||t===!1}_t.boolean=yO;function gv(t){return typeof t=="string"||t instanceof String}_t.string=gv;function bO(t){return typeof t=="number"||t instanceof Number}_t.number=bO;function vO(t){return t instanceof Error}_t.error=vO;function mv(t){return typeof t=="function"}_t.func=mv;function yv(t){return Array.isArray(t)}_t.array=yv;function _O(t){return yv(t)&&t.every(e=>gv(e))}_t.stringArray=_O;function TO(t,e){return Array.isArray(t)&&t.every(e)}_t.typedArray=TO;function SO(t){return t&&mv(t.then)}_t.thenable=SO});var bs=g(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.stringArray=Ut.array=Ut.func=Ut.error=Ut.number=Ut.string=Ut.boolean=void 0;function kO(t){return t===!0||t===!1}Ut.boolean=kO;function bv(t){return typeof t=="string"||t instanceof String}Ut.string=bv;function xO(t){return typeof t=="number"||t instanceof Number}Ut.number=xO;function wO(t){return t instanceof Error}Ut.error=wO;function EO(t){return typeof t=="function"}Ut.func=EO;function vv(t){return Array.isArray(t)}Ut.array=vv;function AO(t){return vv(t)&&t.every(e=>bv(e))}Ut.stringArray=AO});var Ff=g(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 Pi=bs(),gf;(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})(gf||(ne.ErrorCodes=gf={}));var mf=class t extends Error{constructor(e,n,r){super(n),this.code=Pi.number(e)?e:gf.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=mf;var an=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=an;an.auto=new an("auto");an.byPosition=new an("byPosition");an.byName=new an("byName");var ze=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return an.auto}};ne.AbstractMessageSignature=ze;var yf=class extends ze{constructor(e){super(e,0)}};ne.RequestType0=yf;var bf=class extends ze{constructor(e,n=an.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.RequestType=bf;var vf=class extends ze{constructor(e,n=an.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.RequestType1=vf;var _f=class extends ze{constructor(e){super(e,2)}};ne.RequestType2=_f;var Tf=class extends ze{constructor(e){super(e,3)}};ne.RequestType3=Tf;var Sf=class extends ze{constructor(e){super(e,4)}};ne.RequestType4=Sf;var kf=class extends ze{constructor(e){super(e,5)}};ne.RequestType5=kf;var xf=class extends ze{constructor(e){super(e,6)}};ne.RequestType6=xf;var wf=class extends ze{constructor(e){super(e,7)}};ne.RequestType7=wf;var Ef=class extends ze{constructor(e){super(e,8)}};ne.RequestType8=Ef;var Af=class extends ze{constructor(e){super(e,9)}};ne.RequestType9=Af;var Of=class extends ze{constructor(e,n=an.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.NotificationType=Of;var Cf=class extends ze{constructor(e){super(e,0)}};ne.NotificationType0=Cf;var Rf=class extends ze{constructor(e,n=an.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.NotificationType1=Rf;var Df=class extends ze{constructor(e){super(e,2)}};ne.NotificationType2=Df;var Pf=class extends ze{constructor(e){super(e,3)}};ne.NotificationType3=Pf;var If=class extends ze{constructor(e){super(e,4)}};ne.NotificationType4=If;var Mf=class extends ze{constructor(e){super(e,5)}};ne.NotificationType5=Mf;var Lf=class extends ze{constructor(e){super(e,6)}};ne.NotificationType6=Lf;var qf=class extends ze{constructor(e){super(e,7)}};ne.NotificationType7=qf;var Nf=class extends ze{constructor(e){super(e,8)}};ne.NotificationType8=Nf;var jf=class extends ze{constructor(e){super(e,9)}};ne.NotificationType9=jf;var _v;(function(t){function e(i){let s=i;return s&&Pi.string(s.method)&&(Pi.string(s.id)||Pi.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&Pi.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Pi.string(s.id)||Pi.number(s.id)||s.id===null)}t.isResponse=r})(_v||(ne.Message=_v={}))});var Bf=g(Kr=>{"use strict";var Tv;Object.defineProperty(Kr,"__esModule",{value:!0});Kr.LRUCache=Kr.LinkedMap=Kr.Touch=void 0;var Ht;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ht||(Kr.Touch=Ht={}));var Su=class{constructor(){this[Tv]="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=Ht.None){let r=this._map.get(e);if(r)return n!==Ht.None&&this.touch(r,n),r.value}set(e,n,r=Ht.None){let i=this._map.get(e);if(i)i.value=n,r!==Ht.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Ht.None:this.addItemLast(i);break;case Ht.First:this.addItemFirst(i);break;case Ht.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}[(Tv=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!==Ht.First&&n!==Ht.Last)){if(n===Ht.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===Ht.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)}};Kr.LinkedMap=Su;var $f=class extends Su{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=Ht.AsNew){return super.get(e,n)}peek(e){return super.get(e,Ht.None)}set(e,n){return super.set(e,n,Ht.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Kr.LRUCache=$f});var kv=g(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.Disposable=void 0;var Sv;(function(t){function e(n){return{dispose:n}}t.create=e})(Sv||(ku.Disposable=Sv={}))});var zr=g(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});var Uf;function Hf(){if(Uf===void 0)throw new Error("No runtime abstraction layer installed");return Uf}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Uf=n}t.install=e})(Hf||(Hf={}));Wf.default=Hf});var _s=g(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.Emitter=vs.Event=void 0;var OO=zr(),xv;(function(t){let e={dispose(){}};t.None=function(){return e}})(xv||(vs.Event=xv={}));var Gf=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,OO.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},xu=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Gf),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)}};vs.Emitter=xu;xu._noop=function(){}});var Au=g(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.CancellationTokenSource=Ts.CancellationToken=void 0;var CO=zr(),RO=bs(),Vf=_s(),wu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Vf.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Vf.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||RO.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(wu||(Ts.CancellationToken=wu={}));var DO=Object.freeze(function(t,e){let n=(0,CO.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),Eu=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?DO:(this._emitter||(this._emitter=new Vf.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Kf=class{get token(){return this._token||(this._token=new Eu),this._token}cancel(){this._token?this._token.cancel():this._token=wu.Cancelled}dispose(){this._token?this._token instanceof Eu&&this._token.dispose():this._token=wu.None}};Ts.CancellationTokenSource=Kf});var wv=g(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.SharedArrayReceiverStrategy=Ss.SharedArraySenderStrategy=void 0;var PO=Au(),Fo;(function(t){t.Continue=0,t.Cancelled=1})(Fo||(Fo={}));var zf=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]=Fo.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,Fo.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Ss.SharedArraySenderStrategy=zf;var Xf=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Fo.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Yf=class{constructor(e){this.token=new Xf(e)}cancel(){}dispose(){}},Jf=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new PO.CancellationTokenSource:new Yf(n)}};Ss.SharedArrayReceiverStrategy=Jf});var Zf=g(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.Semaphore=void 0;var IO=zr(),Qf=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,IO.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()}}};Ou.Semaphore=Qf});var Av=g(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.ReadableStreamMessageReader=Xr.AbstractMessageReader=Xr.MessageReader=void 0;var tp=zr(),ks=bs(),ep=_s(),MO=Zf(),Ev;(function(t){function e(n){let r=n;return r&&ks.func(r.listen)&&ks.func(r.dispose)&&ks.func(r.onError)&&ks.func(r.onClose)&&ks.func(r.onPartialMessage)}t.is=e})(Ev||(Xr.MessageReader=Ev={}));var Cu=class{constructor(){this.errorEmitter=new ep.Emitter,this.closeEmitter=new ep.Emitter,this.partialMessageEmitter=new ep.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: ${ks.string(e.message)?e.message:"unknown"}`)}};Xr.AbstractMessageReader=Cu;var np;(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,tp.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(np||(np={}));var rp=class extends Cu{constructor(e,n){super(),this.readable=e,this.options=np.fromOptions(n),this.buffer=(0,tp.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new MO.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,tp.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))}};Xr.ReadableStreamMessageReader=rp});var Pv=g(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.WriteableStreamMessageWriter=Yr.AbstractMessageWriter=Yr.MessageWriter=void 0;var Ov=zr(),$o=bs(),LO=Zf(),Cv=_s(),qO="Content-Length: ",Rv=`\r
3
- `,Dv;(function(t){function e(n){let r=n;return r&&$o.func(r.dispose)&&$o.func(r.onClose)&&$o.func(r.onError)&&$o.func(r.write)}t.is=e})(Dv||(Yr.MessageWriter=Dv={}));var Ru=class{constructor(){this.errorEmitter=new Cv.Emitter,this.closeEmitter=new Cv.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: ${$o.string(e.message)?e.message:"unknown"}`)}};Yr.AbstractMessageWriter=Ru;var ip;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,Ov.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,Ov.default)().applicationJson.encoder}}t.fromOptions=e})(ip||(ip={}));var sp=class extends Ru{constructor(e,n){super(),this.writable=e,this.options=ip.fromOptions(n),this.errorCount=0,this.writeSemaphore=new LO.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(qO,r.byteLength.toString(),Rv),i.push(Rv),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()}};Yr.WriteableStreamMessageWriter=sp});var Iv=g(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.AbstractMessageBuffer=void 0;var NO=13,jO=10,FO=`\r
4
- `,op=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 NO:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case jO: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(FO);if(u.length<2)return a;for(let c=0;c<u.length-2;c++){let l=u[c],d=l.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
5
- ${l}`);let p=l.substr(0,d),y=l.substr(d+1).trim();a.set(e?p.toLowerCase():p,y)}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}};Du.AbstractMessageBuffer=op});var jv=g(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.createMessageConnection=ye.ConnectionOptions=ye.MessageStrategy=ye.CancellationStrategy=ye.CancellationSenderStrategy=ye.CancellationReceiverStrategy=ye.RequestCancellationReceiverStrategy=ye.IdCancellationReceiverStrategy=ye.ConnectionStrategy=ye.ConnectionError=ye.ConnectionErrors=ye.LogTraceNotification=ye.SetTraceNotification=ye.TraceFormat=ye.TraceValues=ye.Trace=ye.NullLogger=ye.ProgressType=ye.ProgressToken=void 0;var Mv=zr(),it=bs(),ce=Ff(),Lv=Bf(),Bo=_s(),ap=Au(),Wo;(function(t){t.type=new ce.NotificationType("$/cancelRequest")})(Wo||(Wo={}));var up;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(up||(ye.ProgressToken=up={}));var Uo;(function(t){t.type=new ce.NotificationType("$/progress")})(Uo||(Uo={}));var cp=class{constructor(){}};ye.ProgressType=cp;var lp;(function(t){function e(n){return it.func(n)}t.is=e})(lp||(lp={}));ye.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ie;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ie||(ye.Trace=Ie={}));var qv;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(qv||(ye.TraceValues=qv={}));(function(t){function e(r){if(!it.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})(Ie||(ye.Trace=Ie={}));var yn;(function(t){t.Text="text",t.JSON="json"})(yn||(ye.TraceFormat=yn={}));(function(t){function e(n){return it.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(yn||(ye.TraceFormat=yn={}));var dp;(function(t){t.type=new ce.NotificationType("$/setTrace")})(dp||(ye.SetTraceNotification=dp={}));var Pu;(function(t){t.type=new ce.NotificationType("$/logTrace")})(Pu||(ye.LogTraceNotification=Pu={}));var Ho;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Ho||(ye.ConnectionErrors=Ho={}));var xs=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ye.ConnectionError=xs;var fp;(function(t){function e(n){let r=n;return r&&it.func(r.cancelUndispatched)}t.is=e})(fp||(ye.ConnectionStrategy=fp={}));var Iu;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&it.func(r.createCancellationTokenSource)&&(r.dispose===void 0||it.func(r.dispose))}t.is=e})(Iu||(ye.IdCancellationReceiverStrategy=Iu={}));var pp;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&it.func(r.createCancellationTokenSource)&&(r.dispose===void 0||it.func(r.dispose))}t.is=e})(pp||(ye.RequestCancellationReceiverStrategy=pp={}));var Mu;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new ap.CancellationTokenSource}});function e(n){return Iu.is(n)||pp.is(n)}t.is=e})(Mu||(ye.CancellationReceiverStrategy=Mu={}));var Lu;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Wo.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&it.func(r.sendCancellation)&&it.func(r.cleanup)}t.is=e})(Lu||(ye.CancellationSenderStrategy=Lu={}));var qu;(function(t){t.Message=Object.freeze({receiver:Mu.Message,sender:Lu.Message});function e(n){let r=n;return r&&Mu.is(r.receiver)&&Lu.is(r.sender)}t.is=e})(qu||(ye.CancellationStrategy=qu={}));var Nu;(function(t){function e(n){let r=n;return r&&it.func(r.handleMessage)}t.is=e})(Nu||(ye.MessageStrategy=Nu={}));var Nv;(function(t){function e(n){let r=n;return r&&(qu.is(r.cancellationStrategy)||fp.is(r.connectionStrategy)||Nu.is(r.messageStrategy))}t.is=e})(Nv||(ye.ConnectionOptions=Nv={}));var Kn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Kn||(Kn={}));function $O(t,e,n,r){let i=n!==void 0?n:ye.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,d,p=new Map,y=new Map,_,E=new Lv.LinkedMap,L=new Map,M=new Set,x=new Map,k=Ie.Off,v=yn.Text,F,C=Kn.New,V=new Bo.Emitter,ae=new Bo.Emitter,ge=new Bo.Emitter,G=new Bo.Emitter,A=new Bo.Emitter,P=r&&r.cancellationStrategy?r.cancellationStrategy:qu.Message;function I(T){if(T===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+T.toString()}function j(T){return T===null?"res-unknown-"+(++a).toString():"res-"+T.toString()}function fe(){return"not-"+(++o).toString()}function le(T,B){ce.Message.isRequest(B)?T.set(I(B.id),B):ce.Message.isResponse(B)?T.set(j(B.id),B):T.set(fe(),B)}function Rt(T){}function ht(){return C===Kn.Listening}function je(){return C===Kn.Closed}function on(){return C===Kn.Disposed}function ps(){(C===Kn.New||C===Kn.Listening)&&(C=Kn.Closed,ae.fire(void 0))}function Ri(T){V.fire([T,void 0,void 0])}function au(T){V.fire(T)}t.onClose(ps),t.onError(Ri),e.onClose(ps),e.onError(au);function Mo(){_||E.size===0||(_=(0,Mv.default)().timer.setImmediate(()=>{_=void 0,uu()}))}function Lo(T){ce.Message.isRequest(T)?lu(T):ce.Message.isNotification(T)?fu(T):ce.Message.isResponse(T)?du(T):hs(T)}function uu(){if(E.size===0)return;let T=E.shift();try{let B=r?.messageStrategy;Nu.is(B)?B.handleMessage(T,Lo):Lo(T)}finally{Mo()}}let cu=T=>{try{if(ce.Message.isNotification(T)&&T.method===Wo.type.method){let B=T.params.id,K=I(B),Z=E.get(K);if(ce.Message.isRequest(Z)){let Le=r?.connectionStrategy,Ke=Le&&Le.cancelUndispatched?Le.cancelUndispatched(Z,Rt):void 0;if(Ke&&(Ke.error!==void 0||Ke.result!==void 0)){E.delete(K),x.delete(B),Ke.id=Z.id,Di(Ke,T.method,Date.now()),e.write(Ke).catch(()=>i.error("Sending response for canceled message failed."));return}}let Ue=x.get(B);if(Ue!==void 0){Ue.cancel(),gs(T);return}else M.add(B)}le(E,T)}finally{Mo()}};function lu(T){if(on())return;function B(Se,He,Ce){let ot={jsonrpc:u,id:T.id};Se instanceof ce.ResponseError?ot.error=Se.toJson():ot.result=Se===void 0?null:Se,Di(ot,He,Ce),e.write(ot).catch(()=>i.error("Sending response failed."))}function K(Se,He,Ce){let ot={jsonrpc:u,id:T.id,error:Se.toJson()};Di(ot,He,Ce),e.write(ot).catch(()=>i.error("Sending response failed."))}function Z(Se,He,Ce){Se===void 0&&(Se=null);let ot={jsonrpc:u,id:T.id,result:Se};Di(ot,He,Ce),e.write(ot).catch(()=>i.error("Sending response failed."))}gu(T);let Ue=l.get(T.method),Le,Ke;Ue&&(Le=Ue.type,Ke=Ue.handler);let Ze=Date.now();if(Ke||c){let Se=T.id??String(Date.now()),He=Iu.is(P.receiver)?P.receiver.createCancellationTokenSource(Se):P.receiver.createCancellationTokenSource(T);T.id!==null&&M.has(T.id)&&He.cancel(),T.id!==null&&x.set(Se,He);try{let Ce;if(Ke)if(T.params===void 0){if(Le!==void 0&&Le.numberOfParams!==0){K(new ce.ResponseError(ce.ErrorCodes.InvalidParams,`Request ${T.method} defines ${Le.numberOfParams} params but received none.`),T.method,Ze);return}Ce=Ke(He.token)}else if(Array.isArray(T.params)){if(Le!==void 0&&Le.parameterStructures===ce.ParameterStructures.byName){K(new ce.ResponseError(ce.ErrorCodes.InvalidParams,`Request ${T.method} defines parameters by name but received parameters by position`),T.method,Ze);return}Ce=Ke(...T.params,He.token)}else{if(Le!==void 0&&Le.parameterStructures===ce.ParameterStructures.byPosition){K(new ce.ResponseError(ce.ErrorCodes.InvalidParams,`Request ${T.method} defines parameters by position but received parameters by name`),T.method,Ze);return}Ce=Ke(T.params,He.token)}else c&&(Ce=c(T.method,T.params,He.token));let ot=Ce;Ce?ot.then?ot.then(Dt=>{x.delete(Se),B(Dt,T.method,Ze)},Dt=>{x.delete(Se),Dt instanceof ce.ResponseError?K(Dt,T.method,Ze):Dt&&it.string(Dt.message)?K(new ce.ResponseError(ce.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${Dt.message}`),T.method,Ze):K(new ce.ResponseError(ce.ErrorCodes.InternalError,`Request ${T.method} failed unexpectedly without providing any details.`),T.method,Ze)}):(x.delete(Se),B(Ce,T.method,Ze)):(x.delete(Se),Z(Ce,T.method,Ze))}catch(Ce){x.delete(Se),Ce instanceof ce.ResponseError?B(Ce,T.method,Ze):Ce&&it.string(Ce.message)?K(new ce.ResponseError(ce.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${Ce.message}`),T.method,Ze):K(new ce.ResponseError(ce.ErrorCodes.InternalError,`Request ${T.method} failed unexpectedly without providing any details.`),T.method,Ze)}}else K(new ce.ResponseError(ce.ErrorCodes.MethodNotFound,`Unhandled method ${T.method}`),T.method,Ze)}function du(T){if(!on())if(T.id===null)T.error?i.error(`Received response message without id: Error is:
6
- ${JSON.stringify(T.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let B=T.id,K=L.get(B);if(mu(T,K),K!==void 0){L.delete(B);try{if(T.error){let Z=T.error;K.reject(new ce.ResponseError(Z.code,Z.message,Z.data))}else if(T.result!==void 0)K.resolve(T.result);else throw new Error("Should never happen.")}catch(Z){Z.message?i.error(`Response handler '${K.method}' failed with message: ${Z.message}`):i.error(`Response handler '${K.method}' failed unexpectedly.`)}}}}function fu(T){if(on())return;let B,K;if(T.method===Wo.type.method){let Z=T.params.id;M.delete(Z),gs(T);return}else{let Z=p.get(T.method);Z&&(K=Z.handler,B=Z.type)}if(K||d)try{if(gs(T),K)if(T.params===void 0)B!==void 0&&B.numberOfParams!==0&&B.parameterStructures!==ce.ParameterStructures.byName&&i.error(`Notification ${T.method} defines ${B.numberOfParams} params but received none.`),K();else if(Array.isArray(T.params)){let Z=T.params;T.method===Uo.type.method&&Z.length===2&&up.is(Z[0])?K({token:Z[0],value:Z[1]}):(B!==void 0&&(B.parameterStructures===ce.ParameterStructures.byName&&i.error(`Notification ${T.method} defines parameters by name but received parameters by position`),B.numberOfParams!==T.params.length&&i.error(`Notification ${T.method} defines ${B.numberOfParams} params but received ${Z.length} arguments`)),K(...Z))}else B!==void 0&&B.parameterStructures===ce.ParameterStructures.byPosition&&i.error(`Notification ${T.method} defines parameters by position but received parameters by name`),K(T.params);else d&&d(T.method,T.params)}catch(Z){Z.message?i.error(`Notification handler '${T.method}' failed with message: ${Z.message}`):i.error(`Notification handler '${T.method}' failed unexpectedly.`)}else ge.fire(T)}function hs(T){if(!T){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
7
- ${JSON.stringify(T,null,4)}`);let B=T;if(it.string(B.id)||it.number(B.id)){let K=B.id,Z=L.get(K);Z&&Z.reject(new Error("The received response has neither a result nor an error property."))}}function Wn(T){if(T!=null)switch(k){case Ie.Verbose:return JSON.stringify(T,null,4);case Ie.Compact:return JSON.stringify(T);default:return}}function pu(T){if(!(k===Ie.Off||!F))if(v===yn.Text){let B;(k===Ie.Verbose||k===Ie.Compact)&&T.params&&(B=`Params: ${Wn(T.params)}
1
+ "use strict";var Tf=Object.defineProperty;var k1=Object.getOwnPropertyDescriptor;var x1=Object.getOwnPropertyNames;var w1=Object.prototype.hasOwnProperty;var E1=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),A1=(t,e)=>{for(var n in e)Tf(t,n,{get:e[n],enumerable:!0})},O1=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of x1(e))!w1.call(t,i)&&i!==n&&Tf(t,i,{get:()=>e[i],enumerable:!(r=k1(e,i))||r.enumerable});return t};var C1=t=>O1(Tf({},"__esModule",{value:!0}),t);var xu=g(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.thenable=St.typedArray=St.stringArray=St.array=St.func=St.error=St.number=St.string=St.boolean=void 0;function R1(t){return t===!0||t===!1}St.boolean=R1;function Ov(t){return typeof t=="string"||t instanceof String}St.string=Ov;function P1(t){return typeof t=="number"||t instanceof Number}St.number=P1;function D1(t){return t instanceof Error}St.error=D1;function Cv(t){return typeof t=="function"}St.func=Cv;function Rv(t){return Array.isArray(t)}St.array=Rv;function I1(t){return Rv(t)&&t.every(e=>Ov(e))}St.stringArray=I1;function M1(t,e){return Array.isArray(t)&&t.every(e)}St.typedArray=M1;function L1(t){return t&&Cv(t.then)}St.thenable=L1});var Ss=g(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.stringArray=Gt.array=Gt.func=Gt.error=Gt.number=Gt.string=Gt.boolean=void 0;function N1(t){return t===!0||t===!1}Gt.boolean=N1;function Pv(t){return typeof t=="string"||t instanceof String}Gt.string=Pv;function q1(t){return typeof t=="number"||t instanceof Number}Gt.number=q1;function j1(t){return t instanceof Error}Gt.error=j1;function F1(t){return typeof t=="function"}Gt.func=F1;function Dv(t){return Array.isArray(t)}Gt.array=Dv;function $1(t){return Dv(t)&&t.every(e=>Pv(e))}Gt.stringArray=$1});var Kf=g(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.Message=ie.NotificationType9=ie.NotificationType8=ie.NotificationType7=ie.NotificationType6=ie.NotificationType5=ie.NotificationType4=ie.NotificationType3=ie.NotificationType2=ie.NotificationType1=ie.NotificationType0=ie.NotificationType=ie.RequestType9=ie.RequestType8=ie.RequestType7=ie.RequestType6=ie.RequestType5=ie.RequestType4=ie.RequestType3=ie.RequestType2=ie.RequestType1=ie.RequestType=ie.RequestType0=ie.AbstractMessageSignature=ie.ParameterStructures=ie.ResponseError=ie.ErrorCodes=void 0;var Ni=Ss(),Sf;(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})(Sf||(ie.ErrorCodes=Sf={}));var kf=class t extends Error{constructor(e,n,r){super(n),this.code=Ni.number(e)?e:Sf.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}};ie.ResponseError=kf;var ln=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ie.ParameterStructures=ln;ln.auto=new ln("auto");ln.byPosition=new ln("byPosition");ln.byName=new ln("byName");var Ye=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return ln.auto}};ie.AbstractMessageSignature=Ye;var xf=class extends Ye{constructor(e){super(e,0)}};ie.RequestType0=xf;var wf=class extends Ye{constructor(e,n=ln.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.RequestType=wf;var Ef=class extends Ye{constructor(e,n=ln.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.RequestType1=Ef;var Af=class extends Ye{constructor(e){super(e,2)}};ie.RequestType2=Af;var Of=class extends Ye{constructor(e){super(e,3)}};ie.RequestType3=Of;var Cf=class extends Ye{constructor(e){super(e,4)}};ie.RequestType4=Cf;var Rf=class extends Ye{constructor(e){super(e,5)}};ie.RequestType5=Rf;var Pf=class extends Ye{constructor(e){super(e,6)}};ie.RequestType6=Pf;var Df=class extends Ye{constructor(e){super(e,7)}};ie.RequestType7=Df;var If=class extends Ye{constructor(e){super(e,8)}};ie.RequestType8=If;var Mf=class extends Ye{constructor(e){super(e,9)}};ie.RequestType9=Mf;var Lf=class extends Ye{constructor(e,n=ln.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.NotificationType=Lf;var Nf=class extends Ye{constructor(e){super(e,0)}};ie.NotificationType0=Nf;var qf=class extends Ye{constructor(e,n=ln.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.NotificationType1=qf;var jf=class extends Ye{constructor(e){super(e,2)}};ie.NotificationType2=jf;var Ff=class extends Ye{constructor(e){super(e,3)}};ie.NotificationType3=Ff;var $f=class extends Ye{constructor(e){super(e,4)}};ie.NotificationType4=$f;var Bf=class extends Ye{constructor(e){super(e,5)}};ie.NotificationType5=Bf;var Uf=class extends Ye{constructor(e){super(e,6)}};ie.NotificationType6=Uf;var Hf=class extends Ye{constructor(e){super(e,7)}};ie.NotificationType7=Hf;var Wf=class extends Ye{constructor(e){super(e,8)}};ie.NotificationType8=Wf;var Gf=class extends Ye{constructor(e){super(e,9)}};ie.NotificationType9=Gf;var Iv;(function(t){function e(i){let s=i;return s&&Ni.string(s.method)&&(Ni.string(s.id)||Ni.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&Ni.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Ni.string(s.id)||Ni.number(s.id)||s.id===null)}t.isResponse=r})(Iv||(ie.Message=Iv={}))});var zf=g(Jr=>{"use strict";var Mv;Object.defineProperty(Jr,"__esModule",{value:!0});Jr.LRUCache=Jr.LinkedMap=Jr.Touch=void 0;var Kt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Kt||(Jr.Touch=Kt={}));var wu=class{constructor(){this[Mv]="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=Kt.None){let r=this._map.get(e);if(r)return n!==Kt.None&&this.touch(r,n),r.value}set(e,n,r=Kt.None){let i=this._map.get(e);if(i)i.value=n,r!==Kt.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Kt.None:this.addItemLast(i);break;case Kt.First:this.addItemFirst(i);break;case Kt.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}[(Mv=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!==Kt.First&&n!==Kt.Last)){if(n===Kt.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===Kt.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)}};Jr.LinkedMap=wu;var Vf=class extends wu{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=Kt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Kt.None)}set(e,n){return super.set(e,n,Kt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Jr.LRUCache=Vf});var Nv=g(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.Disposable=void 0;var Lv;(function(t){function e(n){return{dispose:n}}t.create=e})(Lv||(Eu.Disposable=Lv={}))});var Qr=g(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});var Xf;function Yf(){if(Xf===void 0)throw new Error("No runtime abstraction layer installed");return Xf}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Xf=n}t.install=e})(Yf||(Yf={}));Jf.default=Yf});var xs=g(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.Emitter=ks.Event=void 0;var B1=Qr(),qv;(function(t){let e={dispose(){}};t.None=function(){return e}})(qv||(ks.Event=qv={}));var Qf=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,B1.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Au=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Qf),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)}};ks.Emitter=Au;Au._noop=function(){}});var Ru=g(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.CancellationTokenSource=ws.CancellationToken=void 0;var U1=Qr(),H1=Ss(),Zf=xs(),Ou;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Zf.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Zf.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||H1.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Ou||(ws.CancellationToken=Ou={}));var W1=Object.freeze(function(t,e){let n=(0,U1.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),Cu=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?W1:(this._emitter||(this._emitter=new Zf.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},ep=class{get token(){return this._token||(this._token=new Cu),this._token}cancel(){this._token?this._token.cancel():this._token=Ou.Cancelled}dispose(){this._token?this._token instanceof Cu&&this._token.dispose():this._token=Ou.None}};ws.CancellationTokenSource=ep});var jv=g(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.SharedArrayReceiverStrategy=Es.SharedArraySenderStrategy=void 0;var G1=Ru(),Uo;(function(t){t.Continue=0,t.Cancelled=1})(Uo||(Uo={}));var tp=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]=Uo.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,Uo.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Es.SharedArraySenderStrategy=tp;var np=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Uo.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},rp=class{constructor(e){this.token=new np(e)}cancel(){}dispose(){}},ip=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new G1.CancellationTokenSource:new rp(n)}};Es.SharedArrayReceiverStrategy=ip});var op=g(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.Semaphore=void 0;var K1=Qr(),sp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((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,K1.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()}}};Pu.Semaphore=sp});var $v=g(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.ReadableStreamMessageReader=Zr.AbstractMessageReader=Zr.MessageReader=void 0;var up=Qr(),As=Ss(),ap=xs(),V1=op(),Fv;(function(t){function e(n){let r=n;return r&&As.func(r.listen)&&As.func(r.dispose)&&As.func(r.onError)&&As.func(r.onClose)&&As.func(r.onPartialMessage)}t.is=e})(Fv||(Zr.MessageReader=Fv={}));var Du=class{constructor(){this.errorEmitter=new ap.Emitter,this.closeEmitter=new ap.Emitter,this.partialMessageEmitter=new ap.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: ${As.string(e.message)?e.message:"unknown"}`)}};Zr.AbstractMessageReader=Du;var cp;(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,up.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(cp||(cp={}));var lp=class extends Du{constructor(e,n){super(),this.readable=e,this.options=cp.fromOptions(n),this.buffer=(0,up.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new V1.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,up.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))}};Zr.ReadableStreamMessageReader=lp});var Gv=g(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.WriteableStreamMessageWriter=ei.AbstractMessageWriter=ei.MessageWriter=void 0;var Bv=Qr(),Ho=Ss(),z1=op(),Uv=xs(),X1="Content-Length: ",Hv=`\r
3
+ `,Wv;(function(t){function e(n){let r=n;return r&&Ho.func(r.dispose)&&Ho.func(r.onClose)&&Ho.func(r.onError)&&Ho.func(r.write)}t.is=e})(Wv||(ei.MessageWriter=Wv={}));var Iu=class{constructor(){this.errorEmitter=new Uv.Emitter,this.closeEmitter=new Uv.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: ${Ho.string(e.message)?e.message:"unknown"}`)}};ei.AbstractMessageWriter=Iu;var dp;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,Bv.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,Bv.default)().applicationJson.encoder}}t.fromOptions=e})(dp||(dp={}));var fp=class extends Iu{constructor(e,n){super(),this.writable=e,this.options=dp.fromOptions(n),this.errorCount=0,this.writeSemaphore=new z1.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(X1,r.byteLength.toString(),Hv),i.push(Hv),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()}};ei.WriteableStreamMessageWriter=fp});var Kv=g(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.AbstractMessageBuffer=void 0;var Y1=13,J1=10,Q1=`\r
4
+ `,pp=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 Y1:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case J1: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(Q1);if(u.length<2)return a;for(let c=0;c<u.length-2;c++){let l=u[c],d=l.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
5
+ ${l}`);let p=l.substr(0,d),y=l.substr(d+1).trim();a.set(e?p.toLowerCase():p,y)}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}};Mu.AbstractMessageBuffer=pp});var Jv=g(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.createMessageConnection=ve.ConnectionOptions=ve.MessageStrategy=ve.CancellationStrategy=ve.CancellationSenderStrategy=ve.CancellationReceiverStrategy=ve.RequestCancellationReceiverStrategy=ve.IdCancellationReceiverStrategy=ve.ConnectionStrategy=ve.ConnectionError=ve.ConnectionErrors=ve.LogTraceNotification=ve.SetTraceNotification=ve.TraceFormat=ve.TraceValues=ve.Trace=ve.NullLogger=ve.ProgressType=ve.ProgressToken=void 0;var Vv=Qr(),ot=Ss(),de=Kf(),zv=zf(),Wo=xs(),hp=Ru(),Vo;(function(t){t.type=new de.NotificationType("$/cancelRequest")})(Vo||(Vo={}));var gp;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(gp||(ve.ProgressToken=gp={}));var Go;(function(t){t.type=new de.NotificationType("$/progress")})(Go||(Go={}));var mp=class{constructor(){}};ve.ProgressType=mp;var yp;(function(t){function e(n){return ot.func(n)}t.is=e})(yp||(yp={}));ve.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||(ve.Trace=Le={}));var Xv;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(Xv||(ve.TraceValues=Xv={}));(function(t){function e(r){if(!ot.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||(ve.Trace=Le={}));var _n;(function(t){t.Text="text",t.JSON="json"})(_n||(ve.TraceFormat=_n={}));(function(t){function e(n){return ot.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(_n||(ve.TraceFormat=_n={}));var bp;(function(t){t.type=new de.NotificationType("$/setTrace")})(bp||(ve.SetTraceNotification=bp={}));var Lu;(function(t){t.type=new de.NotificationType("$/logTrace")})(Lu||(ve.LogTraceNotification=Lu={}));var Ko;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Ko||(ve.ConnectionErrors=Ko={}));var Os=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ve.ConnectionError=Os;var vp;(function(t){function e(n){let r=n;return r&&ot.func(r.cancelUndispatched)}t.is=e})(vp||(ve.ConnectionStrategy=vp={}));var Nu;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&ot.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ot.func(r.dispose))}t.is=e})(Nu||(ve.IdCancellationReceiverStrategy=Nu={}));var _p;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&ot.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ot.func(r.dispose))}t.is=e})(_p||(ve.RequestCancellationReceiverStrategy=_p={}));var qu;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new hp.CancellationTokenSource}});function e(n){return Nu.is(n)||_p.is(n)}t.is=e})(qu||(ve.CancellationReceiverStrategy=qu={}));var ju;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Vo.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&ot.func(r.sendCancellation)&&ot.func(r.cleanup)}t.is=e})(ju||(ve.CancellationSenderStrategy=ju={}));var Fu;(function(t){t.Message=Object.freeze({receiver:qu.Message,sender:ju.Message});function e(n){let r=n;return r&&qu.is(r.receiver)&&ju.is(r.sender)}t.is=e})(Fu||(ve.CancellationStrategy=Fu={}));var $u;(function(t){function e(n){let r=n;return r&&ot.func(r.handleMessage)}t.is=e})($u||(ve.MessageStrategy=$u={}));var Yv;(function(t){function e(n){let r=n;return r&&(Fu.is(r.cancellationStrategy)||vp.is(r.connectionStrategy)||$u.is(r.messageStrategy))}t.is=e})(Yv||(ve.ConnectionOptions=Yv={}));var Jn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Jn||(Jn={}));function Z1(t,e,n,r){let i=n!==void 0?n:ve.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,d,p=new Map,y=new Map,_,E=new zv.LinkedMap,L=new Map,M=new Set,x=new Map,k=Le.Off,v=_n.Text,F,C=Jn.New,V=new Wo.Emitter,ce=new Wo.Emitter,ye=new Wo.Emitter,K=new Wo.Emitter,A=new Wo.Emitter,D=r&&r.cancellationStrategy?r.cancellationStrategy:Fu.Message;function I(T){if(T===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+T.toString()}function j(T){return T===null?"res-unknown-"+(++a).toString():"res-"+T.toString()}function he(){return"not-"+(++o).toString()}function fe(T,B){de.Message.isRequest(B)?T.set(I(B.id),B):de.Message.isResponse(B)?T.set(j(B.id),B):T.set(he(),B)}function Dt(T){}function mt(){return C===Jn.Listening}function $e(){return C===Jn.Closed}function cn(){return C===Jn.Disposed}function ys(){(C===Jn.New||C===Jn.Listening)&&(C=Jn.Closed,ce.fire(void 0))}function Mi(T){V.fire([T,void 0,void 0])}function lu(T){V.fire(T)}t.onClose(ys),t.onError(Mi),e.onClose(ys),e.onError(lu);function qo(){_||E.size===0||(_=(0,Vv.default)().timer.setImmediate(()=>{_=void 0,du()}))}function jo(T){de.Message.isRequest(T)?pu(T):de.Message.isNotification(T)?gu(T):de.Message.isResponse(T)?hu(T):bs(T)}function du(){if(E.size===0)return;let T=E.shift();try{let B=r?.messageStrategy;$u.is(B)?B.handleMessage(T,jo):jo(T)}finally{qo()}}let fu=T=>{try{if(de.Message.isNotification(T)&&T.method===Vo.type.method){let B=T.params.id,z=I(B),te=E.get(z);if(de.Message.isRequest(te)){let je=r?.connectionStrategy,Xe=je&&je.cancelUndispatched?je.cancelUndispatched(te,Dt):void 0;if(Xe&&(Xe.error!==void 0||Xe.result!==void 0)){E.delete(z),x.delete(B),Xe.id=te.id,Li(Xe,T.method,Date.now()),e.write(Xe).catch(()=>i.error("Sending response for canceled message failed."));return}}let We=x.get(B);if(We!==void 0){We.cancel(),vs(T);return}else M.add(B)}fe(E,T)}finally{qo()}};function pu(T){if(cn())return;function B(xe,Ge,Pe){let ut={jsonrpc:u,id:T.id};xe instanceof de.ResponseError?ut.error=xe.toJson():ut.result=xe===void 0?null:xe,Li(ut,Ge,Pe),e.write(ut).catch(()=>i.error("Sending response failed."))}function z(xe,Ge,Pe){let ut={jsonrpc:u,id:T.id,error:xe.toJson()};Li(ut,Ge,Pe),e.write(ut).catch(()=>i.error("Sending response failed."))}function te(xe,Ge,Pe){xe===void 0&&(xe=null);let ut={jsonrpc:u,id:T.id,result:xe};Li(ut,Ge,Pe),e.write(ut).catch(()=>i.error("Sending response failed."))}bu(T);let We=l.get(T.method),je,Xe;We&&(je=We.type,Xe=We.handler);let tt=Date.now();if(Xe||c){let xe=T.id??String(Date.now()),Ge=Nu.is(D.receiver)?D.receiver.createCancellationTokenSource(xe):D.receiver.createCancellationTokenSource(T);T.id!==null&&M.has(T.id)&&Ge.cancel(),T.id!==null&&x.set(xe,Ge);try{let Pe;if(Xe)if(T.params===void 0){if(je!==void 0&&je.numberOfParams!==0){z(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${T.method} defines ${je.numberOfParams} params but received none.`),T.method,tt);return}Pe=Xe(Ge.token)}else if(Array.isArray(T.params)){if(je!==void 0&&je.parameterStructures===de.ParameterStructures.byName){z(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${T.method} defines parameters by name but received parameters by position`),T.method,tt);return}Pe=Xe(...T.params,Ge.token)}else{if(je!==void 0&&je.parameterStructures===de.ParameterStructures.byPosition){z(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${T.method} defines parameters by position but received parameters by name`),T.method,tt);return}Pe=Xe(T.params,Ge.token)}else c&&(Pe=c(T.method,T.params,Ge.token));let ut=Pe;Pe?ut.then?ut.then(It=>{x.delete(xe),B(It,T.method,tt)},It=>{x.delete(xe),It instanceof de.ResponseError?z(It,T.method,tt):It&&ot.string(It.message)?z(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${It.message}`),T.method,tt):z(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${T.method} failed unexpectedly without providing any details.`),T.method,tt)}):(x.delete(xe),B(Pe,T.method,tt)):(x.delete(xe),te(Pe,T.method,tt))}catch(Pe){x.delete(xe),Pe instanceof de.ResponseError?B(Pe,T.method,tt):Pe&&ot.string(Pe.message)?z(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${Pe.message}`),T.method,tt):z(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${T.method} failed unexpectedly without providing any details.`),T.method,tt)}}else z(new de.ResponseError(de.ErrorCodes.MethodNotFound,`Unhandled method ${T.method}`),T.method,tt)}function hu(T){if(!cn())if(T.id===null)T.error?i.error(`Received response message without id: Error is:
6
+ ${JSON.stringify(T.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let B=T.id,z=L.get(B);if(vu(T,z),z!==void 0){L.delete(B);try{if(T.error){let te=T.error;z.reject(new de.ResponseError(te.code,te.message,te.data))}else if(T.result!==void 0)z.resolve(T.result);else throw new Error("Should never happen.")}catch(te){te.message?i.error(`Response handler '${z.method}' failed with message: ${te.message}`):i.error(`Response handler '${z.method}' failed unexpectedly.`)}}}}function gu(T){if(cn())return;let B,z;if(T.method===Vo.type.method){let te=T.params.id;M.delete(te),vs(T);return}else{let te=p.get(T.method);te&&(z=te.handler,B=te.type)}if(z||d)try{if(vs(T),z)if(T.params===void 0)B!==void 0&&B.numberOfParams!==0&&B.parameterStructures!==de.ParameterStructures.byName&&i.error(`Notification ${T.method} defines ${B.numberOfParams} params but received none.`),z();else if(Array.isArray(T.params)){let te=T.params;T.method===Go.type.method&&te.length===2&&gp.is(te[0])?z({token:te[0],value:te[1]}):(B!==void 0&&(B.parameterStructures===de.ParameterStructures.byName&&i.error(`Notification ${T.method} defines parameters by name but received parameters by position`),B.numberOfParams!==T.params.length&&i.error(`Notification ${T.method} defines ${B.numberOfParams} params but received ${te.length} arguments`)),z(...te))}else B!==void 0&&B.parameterStructures===de.ParameterStructures.byPosition&&i.error(`Notification ${T.method} defines parameters by position but received parameters by name`),z(T.params);else d&&d(T.method,T.params)}catch(te){te.message?i.error(`Notification handler '${T.method}' failed with message: ${te.message}`):i.error(`Notification handler '${T.method}' failed unexpectedly.`)}else ye.fire(T)}function bs(T){if(!T){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
7
+ ${JSON.stringify(T,null,4)}`);let B=T;if(ot.string(B.id)||ot.number(B.id)){let z=B.id,te=L.get(z);te&&te.reject(new Error("The received response has neither a result nor an error property."))}}function zn(T){if(T!=null)switch(k){case Le.Verbose:return JSON.stringify(T,null,4);case Le.Compact:return JSON.stringify(T);default:return}}function mu(T){if(!(k===Le.Off||!F))if(v===_n.Text){let B;(k===Le.Verbose||k===Le.Compact)&&T.params&&(B=`Params: ${zn(T.params)}
8
8
 
9
- `),F.log(`Sending request '${T.method} - (${T.id})'.`,B)}else wr("send-request",T)}function hu(T){if(!(k===Ie.Off||!F))if(v===yn.Text){let B;(k===Ie.Verbose||k===Ie.Compact)&&(T.params?B=`Params: ${Wn(T.params)}
9
+ `),F.log(`Sending request '${T.method} - (${T.id})'.`,B)}else Pr("send-request",T)}function yu(T){if(!(k===Le.Off||!F))if(v===_n.Text){let B;(k===Le.Verbose||k===Le.Compact)&&(T.params?B=`Params: ${zn(T.params)}
10
10
 
11
11
  `:B=`No parameters provided.
12
12
 
13
- `),F.log(`Sending notification '${T.method}'.`,B)}else wr("send-notification",T)}function Di(T,B,K){if(!(k===Ie.Off||!F))if(v===yn.Text){let Z;(k===Ie.Verbose||k===Ie.Compact)&&(T.error&&T.error.data?Z=`Error data: ${Wn(T.error.data)}
13
+ `),F.log(`Sending notification '${T.method}'.`,B)}else Pr("send-notification",T)}function Li(T,B,z){if(!(k===Le.Off||!F))if(v===_n.Text){let te;(k===Le.Verbose||k===Le.Compact)&&(T.error&&T.error.data?te=`Error data: ${zn(T.error.data)}
14
14
 
15
- `:T.result?Z=`Result: ${Wn(T.result)}
15
+ `:T.result?te=`Result: ${zn(T.result)}
16
16
 
17
- `:T.error===void 0&&(Z=`No result returned.
17
+ `:T.error===void 0&&(te=`No result returned.
18
18
 
19
- `)),F.log(`Sending response '${B} - (${T.id})'. Processing request took ${Date.now()-K}ms`,Z)}else wr("send-response",T)}function gu(T){if(!(k===Ie.Off||!F))if(v===yn.Text){let B;(k===Ie.Verbose||k===Ie.Compact)&&T.params&&(B=`Params: ${Wn(T.params)}
19
+ `)),F.log(`Sending response '${B} - (${T.id})'. Processing request took ${Date.now()-z}ms`,te)}else Pr("send-response",T)}function bu(T){if(!(k===Le.Off||!F))if(v===_n.Text){let B;(k===Le.Verbose||k===Le.Compact)&&T.params&&(B=`Params: ${zn(T.params)}
20
20
 
21
- `),F.log(`Received request '${T.method} - (${T.id})'.`,B)}else wr("receive-request",T)}function gs(T){if(!(k===Ie.Off||!F||T.method===Pu.type.method))if(v===yn.Text){let B;(k===Ie.Verbose||k===Ie.Compact)&&(T.params?B=`Params: ${Wn(T.params)}
21
+ `),F.log(`Received request '${T.method} - (${T.id})'.`,B)}else Pr("receive-request",T)}function vs(T){if(!(k===Le.Off||!F||T.method===Lu.type.method))if(v===_n.Text){let B;(k===Le.Verbose||k===Le.Compact)&&(T.params?B=`Params: ${zn(T.params)}
22
22
 
23
23
  `:B=`No parameters provided.
24
24
 
25
- `),F.log(`Received notification '${T.method}'.`,B)}else wr("receive-notification",T)}function mu(T,B){if(!(k===Ie.Off||!F))if(v===yn.Text){let K;if((k===Ie.Verbose||k===Ie.Compact)&&(T.error&&T.error.data?K=`Error data: ${Wn(T.error.data)}
25
+ `),F.log(`Received notification '${T.method}'.`,B)}else Pr("receive-notification",T)}function vu(T,B){if(!(k===Le.Off||!F))if(v===_n.Text){let z;if((k===Le.Verbose||k===Le.Compact)&&(T.error&&T.error.data?z=`Error data: ${zn(T.error.data)}
26
26
 
27
- `:T.result?K=`Result: ${Wn(T.result)}
27
+ `:T.result?z=`Result: ${zn(T.result)}
28
28
 
29
- `:T.error===void 0&&(K=`No result returned.
29
+ `:T.error===void 0&&(z=`No result returned.
30
30
 
31
- `)),B){let Z=T.error?` Request failed: ${T.error.message} (${T.error.code}).`:"";F.log(`Received response '${B.method} - (${T.id})' in ${Date.now()-B.timerStart}ms.${Z}`,K)}else F.log(`Received response ${T.id} without active response promise.`,K)}else wr("receive-response",T)}function wr(T,B){if(!F||k===Ie.Off)return;let K={isLSPMessage:!0,type:T,message:B,timestamp:Date.now()};F.log(K)}function Vr(){if(je())throw new xs(Ho.Closed,"Connection is closed.");if(on())throw new xs(Ho.Disposed,"Connection is disposed.")}function yu(){if(ht())throw new xs(Ho.AlreadyListening,"Connection is already listening")}function bu(){if(!ht())throw new Error("Call listen() first.")}function sr(T){return T===void 0?null:T}function qo(T){if(T!==null)return T}function No(T){return T!=null&&!Array.isArray(T)&&typeof T=="object"}function ms(T,B){switch(T){case ce.ParameterStructures.auto:return No(B)?qo(B):[sr(B)];case ce.ParameterStructures.byName:if(!No(B))throw new Error("Received parameters by name but param is not an object literal.");return qo(B);case ce.ParameterStructures.byPosition:return[sr(B)];default:throw new Error(`Unknown parameter structure ${T.toString()}`)}}function jo(T,B){let K,Z=T.numberOfParams;switch(Z){case 0:K=void 0;break;case 1:K=ms(T.parameterStructures,B[0]);break;default:K=[];for(let Ue=0;Ue<B.length&&Ue<Z;Ue++)K.push(sr(B[Ue]));if(B.length<Z)for(let Ue=B.length;Ue<Z;Ue++)K.push(null);break}return K}let Er={sendNotification:(T,...B)=>{Vr();let K,Z;if(it.string(T)){K=T;let Le=B[0],Ke=0,Ze=ce.ParameterStructures.auto;ce.ParameterStructures.is(Le)&&(Ke=1,Ze=Le);let Se=B.length,He=Se-Ke;switch(He){case 0:Z=void 0;break;case 1:Z=ms(Ze,B[Ke]);break;default:if(Ze===ce.ParameterStructures.byName)throw new Error(`Received ${He} parameters for 'by Name' notification parameter structure.`);Z=B.slice(Ke,Se).map(Ce=>sr(Ce));break}}else{let Le=B;K=T.method,Z=jo(T,Le)}let Ue={jsonrpc:u,method:K,params:Z};return hu(Ue),e.write(Ue).catch(Le=>{throw i.error("Sending notification failed."),Le})},onNotification:(T,B)=>{Vr();let K;return it.func(T)?d=T:B&&(it.string(T)?(K=T,p.set(T,{type:void 0,handler:B})):(K=T.method,p.set(T.method,{type:T,handler:B}))),{dispose:()=>{K!==void 0?p.delete(K):d=void 0}}},onProgress:(T,B,K)=>{if(y.has(B))throw new Error(`Progress handler for token ${B} already registered`);return y.set(B,K),{dispose:()=>{y.delete(B)}}},sendProgress:(T,B,K)=>Er.sendNotification(Uo.type,{token:B,value:K}),onUnhandledProgress:G.event,sendRequest:(T,...B)=>{Vr(),bu();let K,Z,Ue;if(it.string(T)){K=T;let Se=B[0],He=B[B.length-1],Ce=0,ot=ce.ParameterStructures.auto;ce.ParameterStructures.is(Se)&&(Ce=1,ot=Se);let Dt=B.length;ap.CancellationToken.is(He)&&(Dt=Dt-1,Ue=He);let mn=Dt-Ce;switch(mn){case 0:Z=void 0;break;case 1:Z=ms(ot,B[Ce]);break;default:if(ot===ce.ParameterStructures.byName)throw new Error(`Received ${mn} parameters for 'by Name' request parameter structure.`);Z=B.slice(Ce,Dt).map(vu=>sr(vu));break}}else{let Se=B;K=T.method,Z=jo(T,Se);let He=T.numberOfParams;Ue=ap.CancellationToken.is(Se[He])?Se[He]:void 0}let Le=s++,Ke;Ue&&(Ke=Ue.onCancellationRequested(()=>{let Se=P.sender.sendCancellation(Er,Le);return Se===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Le}`),Promise.resolve()):Se.catch(()=>{i.log(`Sending cancellation messages for id ${Le} failed`)})}));let Ze={jsonrpc:u,id:Le,method:K,params:Z};return pu(Ze),typeof P.sender.enableCancellation=="function"&&P.sender.enableCancellation(Ze),new Promise(async(Se,He)=>{let Ce=mn=>{Se(mn),P.sender.cleanup(Le),Ke?.dispose()},ot=mn=>{He(mn),P.sender.cleanup(Le),Ke?.dispose()},Dt={method:K,timerStart:Date.now(),resolve:Ce,reject:ot};try{await e.write(Ze),L.set(Le,Dt)}catch(mn){throw i.error("Sending request failed."),Dt.reject(new ce.ResponseError(ce.ErrorCodes.MessageWriteError,mn.message?mn.message:"Unknown reason")),mn}})},onRequest:(T,B)=>{Vr();let K=null;return lp.is(T)?(K=void 0,c=T):it.string(T)?(K=null,B!==void 0&&(K=T,l.set(T,{handler:B,type:void 0}))):B!==void 0&&(K=T.method,l.set(T.method,{type:T,handler:B})),{dispose:()=>{K!==null&&(K!==void 0?l.delete(K):c=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(T,B,K)=>{let Z=!1,Ue=yn.Text;K!==void 0&&(it.boolean(K)?Z=K:(Z=K.sendNotification||!1,Ue=K.traceFormat||yn.Text)),k=T,v=Ue,k===Ie.Off?F=void 0:F=B,Z&&!je()&&!on()&&await Er.sendNotification(dp.type,{value:Ie.toString(T)})},onError:V.event,onClose:ae.event,onUnhandledNotification:ge.event,onDispose:A.event,end:()=>{e.end()},dispose:()=>{if(on())return;C=Kn.Disposed,A.fire(void 0);let T=new ce.ResponseError(ce.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let B of L.values())B.reject(T);L=new Map,x=new Map,M=new Set,E=new Lv.LinkedMap,it.func(e.dispose)&&e.dispose(),it.func(t.dispose)&&t.dispose()},listen:()=>{Vr(),yu(),C=Kn.Listening,t.listen(cu)},inspect:()=>{(0,Mv.default)().console.log("inspect")}};return Er.onNotification(Pu.type,T=>{if(k===Ie.Off||!F)return;let B=k===Ie.Verbose||k===Ie.Compact;F.log(T.message,B?T.verbose:void 0)}),Er.onNotification(Uo.type,T=>{let B=y.get(T.token);B?B(T.value):G.fire(T)}),Er}ye.createMessageConnection=$O});var ju=g(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.ProgressType=N.ProgressToken=N.createMessageConnection=N.NullLogger=N.ConnectionOptions=N.ConnectionStrategy=N.AbstractMessageBuffer=N.WriteableStreamMessageWriter=N.AbstractMessageWriter=N.MessageWriter=N.ReadableStreamMessageReader=N.AbstractMessageReader=N.MessageReader=N.SharedArrayReceiverStrategy=N.SharedArraySenderStrategy=N.CancellationToken=N.CancellationTokenSource=N.Emitter=N.Event=N.Disposable=N.LRUCache=N.Touch=N.LinkedMap=N.ParameterStructures=N.NotificationType9=N.NotificationType8=N.NotificationType7=N.NotificationType6=N.NotificationType5=N.NotificationType4=N.NotificationType3=N.NotificationType2=N.NotificationType1=N.NotificationType0=N.NotificationType=N.ErrorCodes=N.ResponseError=N.RequestType9=N.RequestType8=N.RequestType7=N.RequestType6=N.RequestType5=N.RequestType4=N.RequestType3=N.RequestType2=N.RequestType1=N.RequestType0=N.RequestType=N.Message=N.RAL=void 0;N.MessageStrategy=N.CancellationStrategy=N.CancellationSenderStrategy=N.CancellationReceiverStrategy=N.ConnectionError=N.ConnectionErrors=N.LogTraceNotification=N.SetTraceNotification=N.TraceFormat=N.TraceValues=N.Trace=void 0;var Ge=Ff();Object.defineProperty(N,"Message",{enumerable:!0,get:function(){return Ge.Message}});Object.defineProperty(N,"RequestType",{enumerable:!0,get:function(){return Ge.RequestType}});Object.defineProperty(N,"RequestType0",{enumerable:!0,get:function(){return Ge.RequestType0}});Object.defineProperty(N,"RequestType1",{enumerable:!0,get:function(){return Ge.RequestType1}});Object.defineProperty(N,"RequestType2",{enumerable:!0,get:function(){return Ge.RequestType2}});Object.defineProperty(N,"RequestType3",{enumerable:!0,get:function(){return Ge.RequestType3}});Object.defineProperty(N,"RequestType4",{enumerable:!0,get:function(){return Ge.RequestType4}});Object.defineProperty(N,"RequestType5",{enumerable:!0,get:function(){return Ge.RequestType5}});Object.defineProperty(N,"RequestType6",{enumerable:!0,get:function(){return Ge.RequestType6}});Object.defineProperty(N,"RequestType7",{enumerable:!0,get:function(){return Ge.RequestType7}});Object.defineProperty(N,"RequestType8",{enumerable:!0,get:function(){return Ge.RequestType8}});Object.defineProperty(N,"RequestType9",{enumerable:!0,get:function(){return Ge.RequestType9}});Object.defineProperty(N,"ResponseError",{enumerable:!0,get:function(){return Ge.ResponseError}});Object.defineProperty(N,"ErrorCodes",{enumerable:!0,get:function(){return Ge.ErrorCodes}});Object.defineProperty(N,"NotificationType",{enumerable:!0,get:function(){return Ge.NotificationType}});Object.defineProperty(N,"NotificationType0",{enumerable:!0,get:function(){return Ge.NotificationType0}});Object.defineProperty(N,"NotificationType1",{enumerable:!0,get:function(){return Ge.NotificationType1}});Object.defineProperty(N,"NotificationType2",{enumerable:!0,get:function(){return Ge.NotificationType2}});Object.defineProperty(N,"NotificationType3",{enumerable:!0,get:function(){return Ge.NotificationType3}});Object.defineProperty(N,"NotificationType4",{enumerable:!0,get:function(){return Ge.NotificationType4}});Object.defineProperty(N,"NotificationType5",{enumerable:!0,get:function(){return Ge.NotificationType5}});Object.defineProperty(N,"NotificationType6",{enumerable:!0,get:function(){return Ge.NotificationType6}});Object.defineProperty(N,"NotificationType7",{enumerable:!0,get:function(){return Ge.NotificationType7}});Object.defineProperty(N,"NotificationType8",{enumerable:!0,get:function(){return Ge.NotificationType8}});Object.defineProperty(N,"NotificationType9",{enumerable:!0,get:function(){return Ge.NotificationType9}});Object.defineProperty(N,"ParameterStructures",{enumerable:!0,get:function(){return Ge.ParameterStructures}});var hp=Bf();Object.defineProperty(N,"LinkedMap",{enumerable:!0,get:function(){return hp.LinkedMap}});Object.defineProperty(N,"LRUCache",{enumerable:!0,get:function(){return hp.LRUCache}});Object.defineProperty(N,"Touch",{enumerable:!0,get:function(){return hp.Touch}});var BO=kv();Object.defineProperty(N,"Disposable",{enumerable:!0,get:function(){return BO.Disposable}});var Fv=_s();Object.defineProperty(N,"Event",{enumerable:!0,get:function(){return Fv.Event}});Object.defineProperty(N,"Emitter",{enumerable:!0,get:function(){return Fv.Emitter}});var $v=Au();Object.defineProperty(N,"CancellationTokenSource",{enumerable:!0,get:function(){return $v.CancellationTokenSource}});Object.defineProperty(N,"CancellationToken",{enumerable:!0,get:function(){return $v.CancellationToken}});var Bv=wv();Object.defineProperty(N,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Bv.SharedArraySenderStrategy}});Object.defineProperty(N,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Bv.SharedArrayReceiverStrategy}});var gp=Av();Object.defineProperty(N,"MessageReader",{enumerable:!0,get:function(){return gp.MessageReader}});Object.defineProperty(N,"AbstractMessageReader",{enumerable:!0,get:function(){return gp.AbstractMessageReader}});Object.defineProperty(N,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return gp.ReadableStreamMessageReader}});var mp=Pv();Object.defineProperty(N,"MessageWriter",{enumerable:!0,get:function(){return mp.MessageWriter}});Object.defineProperty(N,"AbstractMessageWriter",{enumerable:!0,get:function(){return mp.AbstractMessageWriter}});Object.defineProperty(N,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return mp.WriteableStreamMessageWriter}});var UO=Iv();Object.defineProperty(N,"AbstractMessageBuffer",{enumerable:!0,get:function(){return UO.AbstractMessageBuffer}});var Nt=jv();Object.defineProperty(N,"ConnectionStrategy",{enumerable:!0,get:function(){return Nt.ConnectionStrategy}});Object.defineProperty(N,"ConnectionOptions",{enumerable:!0,get:function(){return Nt.ConnectionOptions}});Object.defineProperty(N,"NullLogger",{enumerable:!0,get:function(){return Nt.NullLogger}});Object.defineProperty(N,"createMessageConnection",{enumerable:!0,get:function(){return Nt.createMessageConnection}});Object.defineProperty(N,"ProgressToken",{enumerable:!0,get:function(){return Nt.ProgressToken}});Object.defineProperty(N,"ProgressType",{enumerable:!0,get:function(){return Nt.ProgressType}});Object.defineProperty(N,"Trace",{enumerable:!0,get:function(){return Nt.Trace}});Object.defineProperty(N,"TraceValues",{enumerable:!0,get:function(){return Nt.TraceValues}});Object.defineProperty(N,"TraceFormat",{enumerable:!0,get:function(){return Nt.TraceFormat}});Object.defineProperty(N,"SetTraceNotification",{enumerable:!0,get:function(){return Nt.SetTraceNotification}});Object.defineProperty(N,"LogTraceNotification",{enumerable:!0,get:function(){return Nt.LogTraceNotification}});Object.defineProperty(N,"ConnectionErrors",{enumerable:!0,get:function(){return Nt.ConnectionErrors}});Object.defineProperty(N,"ConnectionError",{enumerable:!0,get:function(){return Nt.ConnectionError}});Object.defineProperty(N,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Nt.CancellationReceiverStrategy}});Object.defineProperty(N,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Nt.CancellationSenderStrategy}});Object.defineProperty(N,"CancellationStrategy",{enumerable:!0,get:function(){return Nt.CancellationStrategy}});Object.defineProperty(N,"MessageStrategy",{enumerable:!0,get:function(){return Nt.MessageStrategy}});var HO=zr();N.RAL=HO.default});var Wv=g(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});var Uv=require("util"),Or=ju(),Fu=class t extends Or.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 Uv.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)}};Fu.emptyBuffer=Buffer.allocUnsafe(0);var yp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Or.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Or.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Or.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Or.Disposable.create(()=>this.stream.off("data",e))}},bp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Or.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Or.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Or.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()}},Hv=Object.freeze({messageBuffer:Object.freeze({create:t=>new Fu(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 Uv.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new yp(t),asWritableStream:t=>new bp(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 vp(){return Hv}(function(t){function e(){Or.RAL.install(Hv)}t.install=e})(vp||(vp={}));_p.default=vp});var Li=g(we=>{"use strict";var WO=we&&we.__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]}),GO=we&&we.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&WO(e,t,n)};Object.defineProperty(we,"__esModule",{value:!0});we.createMessageConnection=we.createServerSocketTransport=we.createClientSocketTransport=we.createServerPipeTransport=we.createClientPipeTransport=we.generateRandomPipeName=we.StreamMessageWriter=we.StreamMessageReader=we.SocketMessageWriter=we.SocketMessageReader=we.PortMessageWriter=we.PortMessageReader=we.IPCMessageWriter=we.IPCMessageReader=void 0;var ws=Wv();ws.default.install();var Gv=require("path"),VO=require("os"),KO=require("crypto"),Uu=require("net"),bn=ju();GO(ju(),we);var Tp=class extends bn.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),bn.Disposable.create(()=>this.process.off("message",e))}};we.IPCMessageReader=Tp;var Sp=class extends bn.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(){}};we.IPCMessageWriter=Sp;var kp=class extends bn.AbstractMessageReader{constructor(e){super(),this.onData=new bn.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)}};we.PortMessageReader=kp;var xp=class extends bn.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(){}};we.PortMessageWriter=xp;var Ii=class extends bn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,ws.default)().stream.asReadableStream(e),n)}};we.SocketMessageReader=Ii;var Mi=class extends bn.WriteableStreamMessageWriter{constructor(e,n){super((0,ws.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};we.SocketMessageWriter=Mi;var $u=class extends bn.ReadableStreamMessageReader{constructor(e,n){super((0,ws.default)().stream.asReadableStream(e),n)}};we.StreamMessageReader=$u;var Bu=class extends bn.WriteableStreamMessageWriter{constructor(e,n){super((0,ws.default)().stream.asWritableStream(e),n)}};we.StreamMessageWriter=Bu;var Vv=process.env.XDG_RUNTIME_DIR,zO=new Map([["linux",107],["darwin",103]]);function XO(){let t=(0,KO.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Vv?e=Gv.join(Vv,`vscode-ipc-${t}.sock`):e=Gv.join(VO.tmpdir(),`vscode-${t}.sock`);let n=zO.get(process.platform);return n!==void 0&&e.length>n&&(0,ws.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}we.generateRandomPipeName=XO;function YO(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Uu.createServer)(a=>{o.close(),n([new Ii(a,e),new Mi(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}we.createClientPipeTransport=YO;function JO(t,e="utf-8"){let n=(0,Uu.createConnection)(t);return[new Ii(n,e),new Mi(n,e)]}we.createServerPipeTransport=JO;function QO(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Uu.createServer)(a=>{o.close(),n([new Ii(a,e),new Mi(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}we.createClientSocketTransport=QO;function ZO(t,e="utf-8"){let n=(0,Uu.createConnection)(t,"127.0.0.1");return[new Ii(n,e),new Mi(n,e)]}we.createServerSocketTransport=ZO;function eC(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function tC(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function nC(t,e,n,r){n||(n=bn.NullLogger);let i=eC(t)?new $u(t):t,s=tC(e)?new Bu(e):e;return bn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,bn.createMessageConnection)(i,s,n,r)}we.createMessageConnection=nC});var wp=g((GF,Kv)=>{"use strict";Kv.exports=Li()});var Wu=g((zv,Hu)=>{(function(t){if(typeof Hu=="object"&&typeof Hu.exports=="object"){var e=t(require,zv);e!==void 0&&(Hu.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(h){function S(w){return typeof w=="string"}h.is=S})(n||(e.DocumentUri=n={}));var r;(function(h){function S(w){return typeof w=="string"}h.is=S})(r||(e.URI=r={}));var i;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function S(w){return typeof w=="number"&&h.MIN_VALUE<=w&&w<=h.MAX_VALUE}h.is=S})(i||(e.integer=i={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function S(w){return typeof w=="number"&&h.MIN_VALUE<=w&&w<=h.MAX_VALUE}h.is=S})(s||(e.uinteger=s={}));var o;(function(h){function S(m,f){return m===Number.MAX_VALUE&&(m=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:m,character:f}}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.line)&&D.uinteger(f.character)}h.is=w})(o||(e.Position=o={}));var a;(function(h){function S(m,f,R,U){if(D.uinteger(m)&&D.uinteger(f)&&D.uinteger(R)&&D.uinteger(U))return{start:o.create(m,f),end:o.create(R,U)};if(o.is(m)&&o.is(f))return{start:m,end:f};throw new Error("Range#create called with invalid arguments[".concat(m,", ").concat(f,", ").concat(R,", ").concat(U,"]"))}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=w})(a||(e.Range=a={}));var u;(function(h){function S(m,f){return{uri:m,range:f}}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(D.string(f.uri)||D.undefined(f.uri))}h.is=w})(u||(e.Location=u={}));var c;(function(h){function S(m,f,R,U){return{targetUri:m,targetRange:f,targetSelectionRange:R,originSelectionRange:U}}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&a.is(f.targetRange)&&D.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||D.undefined(f.originSelectionRange))}h.is=w})(c||(e.LocationLink=c={}));var l;(function(h){function S(m,f,R,U){return{red:m,green:f,blue:R,alpha:U}}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&D.numberRange(f.red,0,1)&&D.numberRange(f.green,0,1)&&D.numberRange(f.blue,0,1)&&D.numberRange(f.alpha,0,1)}h.is=w})(l||(e.Color=l={}));var d;(function(h){function S(m,f){return{range:m,color:f}}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&l.is(f.color)}h.is=w})(d||(e.ColorInformation=d={}));var p;(function(h){function S(m,f,R){return{label:m,textEdit:f,additionalTextEdits:R}}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.undefined(f.textEdit)||F.is(f))&&(D.undefined(f.additionalTextEdits)||D.typedArray(f.additionalTextEdits,F.is))}h.is=w})(p||(e.ColorPresentation=p={}));var y;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(y||(e.FoldingRangeKind=y={}));var _;(function(h){function S(m,f,R,U,me,at){var We={startLine:m,endLine:f};return D.defined(R)&&(We.startCharacter=R),D.defined(U)&&(We.endCharacter=U),D.defined(me)&&(We.kind=me),D.defined(at)&&(We.collapsedText=at),We}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.startLine)&&D.uinteger(f.startLine)&&(D.undefined(f.startCharacter)||D.uinteger(f.startCharacter))&&(D.undefined(f.endCharacter)||D.uinteger(f.endCharacter))&&(D.undefined(f.kind)||D.string(f.kind))}h.is=w})(_||(e.FoldingRange=_={}));var E;(function(h){function S(m,f){return{location:m,message:f}}h.create=S;function w(m){var f=m;return D.defined(f)&&u.is(f.location)&&D.string(f.message)}h.is=w})(E||(e.DiagnosticRelatedInformation=E={}));var L;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(L||(e.DiagnosticSeverity=L={}));var M;(function(h){h.Unnecessary=1,h.Deprecated=2})(M||(e.DiagnosticTag=M={}));var x;(function(h){function S(w){var m=w;return D.objectLiteral(m)&&D.string(m.href)}h.is=S})(x||(e.CodeDescription=x={}));var k;(function(h){function S(m,f,R,U,me,at){var We={range:m,message:f};return D.defined(R)&&(We.severity=R),D.defined(U)&&(We.code=U),D.defined(me)&&(We.source=me),D.defined(at)&&(We.relatedInformation=at),We}h.create=S;function w(m){var f,R=m;return D.defined(R)&&a.is(R.range)&&D.string(R.message)&&(D.number(R.severity)||D.undefined(R.severity))&&(D.integer(R.code)||D.string(R.code)||D.undefined(R.code))&&(D.undefined(R.codeDescription)||D.string((f=R.codeDescription)===null||f===void 0?void 0:f.href))&&(D.string(R.source)||D.undefined(R.source))&&(D.undefined(R.relatedInformation)||D.typedArray(R.relatedInformation,E.is))}h.is=w})(k||(e.Diagnostic=k={}));var v;(function(h){function S(m,f){for(var R=[],U=2;U<arguments.length;U++)R[U-2]=arguments[U];var me={title:m,command:f};return D.defined(R)&&R.length>0&&(me.arguments=R),me}h.create=S;function w(m){var f=m;return D.defined(f)&&D.string(f.title)&&D.string(f.command)}h.is=w})(v||(e.Command=v={}));var F;(function(h){function S(R,U){return{range:R,newText:U}}h.replace=S;function w(R,U){return{range:{start:R,end:R},newText:U}}h.insert=w;function m(R){return{range:R,newText:""}}h.del=m;function f(R){var U=R;return D.objectLiteral(U)&&D.string(U.newText)&&a.is(U.range)}h.is=f})(F||(e.TextEdit=F={}));var C;(function(h){function S(m,f,R){var U={label:m};return f!==void 0&&(U.needsConfirmation=f),R!==void 0&&(U.description=R),U}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(D.string(f.description)||f.description===void 0)}h.is=w})(C||(e.ChangeAnnotation=C={}));var V;(function(h){function S(w){var m=w;return D.string(m)}h.is=S})(V||(e.ChangeAnnotationIdentifier=V={}));var ae;(function(h){function S(R,U,me){return{range:R,newText:U,annotationId:me}}h.replace=S;function w(R,U,me){return{range:{start:R,end:R},newText:U,annotationId:me}}h.insert=w;function m(R,U){return{range:R,newText:"",annotationId:U}}h.del=m;function f(R){var U=R;return F.is(U)&&(C.is(U.annotationId)||V.is(U.annotationId))}h.is=f})(ae||(e.AnnotatedTextEdit=ae={}));var ge;(function(h){function S(m,f){return{textDocument:m,edits:f}}h.create=S;function w(m){var f=m;return D.defined(f)&&je.is(f.textDocument)&&Array.isArray(f.edits)}h.is=w})(ge||(e.TextDocumentEdit=ge={}));var G;(function(h){function S(m,f,R){var U={kind:"create",uri:m};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&(U.options=f),R!==void 0&&(U.annotationId=R),U}h.create=S;function w(m){var f=m;return f&&f.kind==="create"&&D.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||V.is(f.annotationId))}h.is=w})(G||(e.CreateFile=G={}));var A;(function(h){function S(m,f,R,U){var me={kind:"rename",oldUri:m,newUri:f};return R!==void 0&&(R.overwrite!==void 0||R.ignoreIfExists!==void 0)&&(me.options=R),U!==void 0&&(me.annotationId=U),me}h.create=S;function w(m){var f=m;return f&&f.kind==="rename"&&D.string(f.oldUri)&&D.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||V.is(f.annotationId))}h.is=w})(A||(e.RenameFile=A={}));var P;(function(h){function S(m,f,R){var U={kind:"delete",uri:m};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&(U.options=f),R!==void 0&&(U.annotationId=R),U}h.create=S;function w(m){var f=m;return f&&f.kind==="delete"&&D.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||D.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||D.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||V.is(f.annotationId))}h.is=w})(P||(e.DeleteFile=P={}));var I;(function(h){function S(w){var m=w;return m&&(m.changes!==void 0||m.documentChanges!==void 0)&&(m.documentChanges===void 0||m.documentChanges.every(function(f){return D.string(f.kind)?G.is(f)||A.is(f)||P.is(f):ge.is(f)}))}h.is=S})(I||(e.WorkspaceEdit=I={}));var j=function(){function h(S,w){this.edits=S,this.changeAnnotations=w}return h.prototype.insert=function(S,w,m){var f,R;if(m===void 0?f=F.insert(S,w):V.is(m)?(R=m,f=ae.insert(S,w,m)):(this.assertChangeAnnotations(this.changeAnnotations),R=this.changeAnnotations.manage(m),f=ae.insert(S,w,R)),this.edits.push(f),R!==void 0)return R},h.prototype.replace=function(S,w,m){var f,R;if(m===void 0?f=F.replace(S,w):V.is(m)?(R=m,f=ae.replace(S,w,m)):(this.assertChangeAnnotations(this.changeAnnotations),R=this.changeAnnotations.manage(m),f=ae.replace(S,w,R)),this.edits.push(f),R!==void 0)return R},h.prototype.delete=function(S,w){var m,f;if(w===void 0?m=F.del(S):V.is(w)?(f=w,m=ae.del(S,w)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(w),m=ae.del(S,f)),this.edits.push(m),f!==void 0)return f},h.prototype.add=function(S){this.edits.push(S)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(S){if(S===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),fe=function(){function h(S){this._annotations=S===void 0?Object.create(null):S,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(S,w){var m;if(V.is(S)?m=S:(m=this.nextId(),w=S),this._annotations[m]!==void 0)throw new Error("Id ".concat(m," is already in use."));if(w===void 0)throw new Error("No annotation provided for id ".concat(m));return this._annotations[m]=w,this._size++,m},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),le=function(){function h(S){var w=this;this._textEditChanges=Object.create(null),S!==void 0?(this._workspaceEdit=S,S.documentChanges?(this._changeAnnotations=new fe(S.changeAnnotations),S.changeAnnotations=this._changeAnnotations.all(),S.documentChanges.forEach(function(m){if(ge.is(m)){var f=new j(m.edits,w._changeAnnotations);w._textEditChanges[m.textDocument.uri]=f}})):S.changes&&Object.keys(S.changes).forEach(function(m){var f=new j(S.changes[m]);w._textEditChanges[m]=f})):this._workspaceEdit={}}return Object.defineProperty(h.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),h.prototype.getTextEditChange=function(S){if(je.is(S)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var w={uri:S.uri,version:S.version},m=this._textEditChanges[w.uri];if(!m){var f=[],R={textDocument:w,edits:f};this._workspaceEdit.documentChanges.push(R),m=new j(f,this._changeAnnotations),this._textEditChanges[w.uri]=m}return m}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var m=this._textEditChanges[S];if(!m){var f=[];this._workspaceEdit.changes[S]=f,m=new j(f),this._textEditChanges[S]=m}return m}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new fe,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(S,w,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;C.is(w)||V.is(w)?f=w:m=w;var R,U;if(f===void 0?R=G.create(S,m):(U=V.is(f)?f:this._changeAnnotations.manage(f),R=G.create(S,m,U)),this._workspaceEdit.documentChanges.push(R),U!==void 0)return U},h.prototype.renameFile=function(S,w,m,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var R;C.is(m)||V.is(m)?R=m:f=m;var U,me;if(R===void 0?U=A.create(S,w,f):(me=V.is(R)?R:this._changeAnnotations.manage(R),U=A.create(S,w,f,me)),this._workspaceEdit.documentChanges.push(U),me!==void 0)return me},h.prototype.deleteFile=function(S,w,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;C.is(w)||V.is(w)?f=w:m=w;var R,U;if(f===void 0?R=P.create(S,m):(U=V.is(f)?f:this._changeAnnotations.manage(f),R=P.create(S,m,U)),this._workspaceEdit.documentChanges.push(R),U!==void 0)return U},h}();e.WorkspaceChange=le;var Rt;(function(h){function S(m){return{uri:m}}h.create=S;function w(m){var f=m;return D.defined(f)&&D.string(f.uri)}h.is=w})(Rt||(e.TextDocumentIdentifier=Rt={}));var ht;(function(h){function S(m,f){return{uri:m,version:f}}h.create=S;function w(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.integer(f.version)}h.is=w})(ht||(e.VersionedTextDocumentIdentifier=ht={}));var je;(function(h){function S(m,f){return{uri:m,version:f}}h.create=S;function w(m){var f=m;return D.defined(f)&&D.string(f.uri)&&(f.version===null||D.integer(f.version))}h.is=w})(je||(e.OptionalVersionedTextDocumentIdentifier=je={}));var on;(function(h){function S(m,f,R,U){return{uri:m,languageId:f,version:R,text:U}}h.create=S;function w(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.string(f.languageId)&&D.integer(f.version)&&D.string(f.text)}h.is=w})(on||(e.TextDocumentItem=on={}));var ps;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function S(w){var m=w;return m===h.PlainText||m===h.Markdown}h.is=S})(ps||(e.MarkupKind=ps={}));var Ri;(function(h){function S(w){var m=w;return D.objectLiteral(w)&&ps.is(m.kind)&&D.string(m.value)}h.is=S})(Ri||(e.MarkupContent=Ri={}));var au;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(au||(e.CompletionItemKind=au={}));var Mo;(function(h){h.PlainText=1,h.Snippet=2})(Mo||(e.InsertTextFormat=Mo={}));var Lo;(function(h){h.Deprecated=1})(Lo||(e.CompletionItemTag=Lo={}));var uu;(function(h){function S(m,f,R){return{newText:m,insert:f,replace:R}}h.create=S;function w(m){var f=m;return f&&D.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=w})(uu||(e.InsertReplaceEdit=uu={}));var cu;(function(h){h.asIs=1,h.adjustIndentation=2})(cu||(e.InsertTextMode=cu={}));var lu;(function(h){function S(w){var m=w;return m&&(D.string(m.detail)||m.detail===void 0)&&(D.string(m.description)||m.description===void 0)}h.is=S})(lu||(e.CompletionItemLabelDetails=lu={}));var du;(function(h){function S(w){return{label:w}}h.create=S})(du||(e.CompletionItem=du={}));var fu;(function(h){function S(w,m){return{items:w||[],isIncomplete:!!m}}h.create=S})(fu||(e.CompletionList=fu={}));var hs;(function(h){function S(m){return m.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=S;function w(m){var f=m;return D.string(f)||D.objectLiteral(f)&&D.string(f.language)&&D.string(f.value)}h.is=w})(hs||(e.MarkedString=hs={}));var Wn;(function(h){function S(w){var m=w;return!!m&&D.objectLiteral(m)&&(Ri.is(m.contents)||hs.is(m.contents)||D.typedArray(m.contents,hs.is))&&(w.range===void 0||a.is(w.range))}h.is=S})(Wn||(e.Hover=Wn={}));var pu;(function(h){function S(w,m){return m?{label:w,documentation:m}:{label:w}}h.create=S})(pu||(e.ParameterInformation=pu={}));var hu;(function(h){function S(w,m){for(var f=[],R=2;R<arguments.length;R++)f[R-2]=arguments[R];var U={label:w};return D.defined(m)&&(U.documentation=m),D.defined(f)?U.parameters=f:U.parameters=[],U}h.create=S})(hu||(e.SignatureInformation=hu={}));var Di;(function(h){h.Text=1,h.Read=2,h.Write=3})(Di||(e.DocumentHighlightKind=Di={}));var gu;(function(h){function S(w,m){var f={range:w};return D.number(m)&&(f.kind=m),f}h.create=S})(gu||(e.DocumentHighlight=gu={}));var gs;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(gs||(e.SymbolKind=gs={}));var mu;(function(h){h.Deprecated=1})(mu||(e.SymbolTag=mu={}));var wr;(function(h){function S(w,m,f,R,U){var me={name:w,kind:m,location:{uri:R,range:f}};return U&&(me.containerName=U),me}h.create=S})(wr||(e.SymbolInformation=wr={}));var Vr;(function(h){function S(w,m,f,R){return R!==void 0?{name:w,kind:m,location:{uri:f,range:R}}:{name:w,kind:m,location:{uri:f}}}h.create=S})(Vr||(e.WorkspaceSymbol=Vr={}));var yu;(function(h){function S(m,f,R,U,me,at){var We={name:m,detail:f,kind:R,range:U,selectionRange:me};return at!==void 0&&(We.children=at),We}h.create=S;function w(m){var f=m;return f&&D.string(f.name)&&D.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||D.string(f.detail))&&(f.deprecated===void 0||D.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=w})(yu||(e.DocumentSymbol=yu={}));var bu;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})(bu||(e.CodeActionKind=bu={}));var sr;(function(h){h.Invoked=1,h.Automatic=2})(sr||(e.CodeActionTriggerKind=sr={}));var qo;(function(h){function S(m,f,R){var U={diagnostics:m};return f!=null&&(U.only=f),R!=null&&(U.triggerKind=R),U}h.create=S;function w(m){var f=m;return D.defined(f)&&D.typedArray(f.diagnostics,k.is)&&(f.only===void 0||D.typedArray(f.only,D.string))&&(f.triggerKind===void 0||f.triggerKind===sr.Invoked||f.triggerKind===sr.Automatic)}h.is=w})(qo||(e.CodeActionContext=qo={}));var No;(function(h){function S(m,f,R){var U={title:m},me=!0;return typeof f=="string"?(me=!1,U.kind=f):v.is(f)?U.command=f:U.edit=f,me&&R!==void 0&&(U.kind=R),U}h.create=S;function w(m){var f=m;return f&&D.string(f.title)&&(f.diagnostics===void 0||D.typedArray(f.diagnostics,k.is))&&(f.kind===void 0||D.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||v.is(f.command))&&(f.isPreferred===void 0||D.boolean(f.isPreferred))&&(f.edit===void 0||I.is(f.edit))}h.is=w})(No||(e.CodeAction=No={}));var ms;(function(h){function S(m,f){var R={range:m};return D.defined(f)&&(R.data=f),R}h.create=S;function w(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.command)||v.is(f.command))}h.is=w})(ms||(e.CodeLens=ms={}));var jo;(function(h){function S(m,f){return{tabSize:m,insertSpaces:f}}h.create=S;function w(m){var f=m;return D.defined(f)&&D.uinteger(f.tabSize)&&D.boolean(f.insertSpaces)}h.is=w})(jo||(e.FormattingOptions=jo={}));var Er;(function(h){function S(m,f,R){return{range:m,target:f,data:R}}h.create=S;function w(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.target)||D.string(f.target))}h.is=w})(Er||(e.DocumentLink=Er={}));var T;(function(h){function S(m,f){return{range:m,parent:f}}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=w})(T||(e.SelectionRange=T={}));var B;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(B||(e.SemanticTokenTypes=B={}));var K;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(K||(e.SemanticTokenModifiers=K={}));var Z;(function(h){function S(w){var m=w;return D.objectLiteral(m)&&(m.resultId===void 0||typeof m.resultId=="string")&&Array.isArray(m.data)&&(m.data.length===0||typeof m.data[0]=="number")}h.is=S})(Z||(e.SemanticTokens=Z={}));var Ue;(function(h){function S(m,f){return{range:m,text:f}}h.create=S;function w(m){var f=m;return f!=null&&a.is(f.range)&&D.string(f.text)}h.is=w})(Ue||(e.InlineValueText=Ue={}));var Le;(function(h){function S(m,f,R){return{range:m,variableName:f,caseSensitiveLookup:R}}h.create=S;function w(m){var f=m;return f!=null&&a.is(f.range)&&D.boolean(f.caseSensitiveLookup)&&(D.string(f.variableName)||f.variableName===void 0)}h.is=w})(Le||(e.InlineValueVariableLookup=Le={}));var Ke;(function(h){function S(m,f){return{range:m,expression:f}}h.create=S;function w(m){var f=m;return f!=null&&a.is(f.range)&&(D.string(f.expression)||f.expression===void 0)}h.is=w})(Ke||(e.InlineValueEvaluatableExpression=Ke={}));var Ze;(function(h){function S(m,f){return{frameId:m,stoppedLocation:f}}h.create=S;function w(m){var f=m;return D.defined(f)&&a.is(m.stoppedLocation)}h.is=w})(Ze||(e.InlineValueContext=Ze={}));var Se;(function(h){h.Type=1,h.Parameter=2;function S(w){return w===1||w===2}h.is=S})(Se||(e.InlayHintKind=Se={}));var He;(function(h){function S(m){return{value:m}}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&(f.tooltip===void 0||D.string(f.tooltip)||Ri.is(f.tooltip))&&(f.location===void 0||u.is(f.location))&&(f.command===void 0||v.is(f.command))}h.is=w})(He||(e.InlayHintLabelPart=He={}));var Ce;(function(h){function S(m,f,R){var U={position:m,label:f};return R!==void 0&&(U.kind=R),U}h.create=S;function w(m){var f=m;return D.objectLiteral(f)&&o.is(f.position)&&(D.string(f.label)||D.typedArray(f.label,He.is))&&(f.kind===void 0||Se.is(f.kind))&&f.textEdits===void 0||D.typedArray(f.textEdits,F.is)&&(f.tooltip===void 0||D.string(f.tooltip)||Ri.is(f.tooltip))&&(f.paddingLeft===void 0||D.boolean(f.paddingLeft))&&(f.paddingRight===void 0||D.boolean(f.paddingRight))}h.is=w})(Ce||(e.InlayHint=Ce={}));var ot;(function(h){function S(w){return{kind:"snippet",value:w}}h.createSnippet=S})(ot||(e.StringValue=ot={}));var Dt;(function(h){function S(w,m,f,R){return{insertText:w,filterText:m,range:f,command:R}}h.create=S})(Dt||(e.InlineCompletionItem=Dt={}));var mn;(function(h){function S(w){return{items:w}}h.create=S})(mn||(e.InlineCompletionList=mn={}));var vu;(function(h){h.Invoked=0,h.Automatic=1})(vu||(e.InlineCompletionTriggerKind=vu={}));var lv;(function(h){function S(w,m){return{range:w,text:m}}h.create=S})(lv||(e.SelectedCompletionInfo=lv={}));var dv;(function(h){function S(w,m){return{triggerKind:w,selectedCompletionInfo:m}}h.create=S})(dv||(e.InlineCompletionContext=dv={}));var fv;(function(h){function S(w){var m=w;return D.objectLiteral(m)&&r.is(m.uri)&&D.string(m.name)}h.is=S})(fv||(e.WorkspaceFolder=fv={})),e.EOL=[`
31
+ `)),B){let te=T.error?` Request failed: ${T.error.message} (${T.error.code}).`:"";F.log(`Received response '${B.method} - (${T.id})' in ${Date.now()-B.timerStart}ms.${te}`,z)}else F.log(`Received response ${T.id} without active response promise.`,z)}else Pr("receive-response",T)}function Pr(T,B){if(!F||k===Le.Off)return;let z={isLSPMessage:!0,type:T,message:B,timestamp:Date.now()};F.log(z)}function Yr(){if($e())throw new Os(Ko.Closed,"Connection is closed.");if(cn())throw new Os(Ko.Disposed,"Connection is disposed.")}function _u(){if(mt())throw new Os(Ko.AlreadyListening,"Connection is already listening")}function Tu(){if(!mt())throw new Error("Call listen() first.")}function cr(T){return T===void 0?null:T}function Fo(T){if(T!==null)return T}function $o(T){return T!=null&&!Array.isArray(T)&&typeof T=="object"}function _s(T,B){switch(T){case de.ParameterStructures.auto:return $o(B)?Fo(B):[cr(B)];case de.ParameterStructures.byName:if(!$o(B))throw new Error("Received parameters by name but param is not an object literal.");return Fo(B);case de.ParameterStructures.byPosition:return[cr(B)];default:throw new Error(`Unknown parameter structure ${T.toString()}`)}}function Bo(T,B){let z,te=T.numberOfParams;switch(te){case 0:z=void 0;break;case 1:z=_s(T.parameterStructures,B[0]);break;default:z=[];for(let We=0;We<B.length&&We<te;We++)z.push(cr(B[We]));if(B.length<te)for(let We=B.length;We<te;We++)z.push(null);break}return z}let Dr={sendNotification:(T,...B)=>{Yr();let z,te;if(ot.string(T)){z=T;let je=B[0],Xe=0,tt=de.ParameterStructures.auto;de.ParameterStructures.is(je)&&(Xe=1,tt=je);let xe=B.length,Ge=xe-Xe;switch(Ge){case 0:te=void 0;break;case 1:te=_s(tt,B[Xe]);break;default:if(tt===de.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);te=B.slice(Xe,xe).map(Pe=>cr(Pe));break}}else{let je=B;z=T.method,te=Bo(T,je)}let We={jsonrpc:u,method:z,params:te};return yu(We),e.write(We).catch(je=>{throw i.error("Sending notification failed."),je})},onNotification:(T,B)=>{Yr();let z;return ot.func(T)?d=T:B&&(ot.string(T)?(z=T,p.set(T,{type:void 0,handler:B})):(z=T.method,p.set(T.method,{type:T,handler:B}))),{dispose:()=>{z!==void 0?p.delete(z):d=void 0}}},onProgress:(T,B,z)=>{if(y.has(B))throw new Error(`Progress handler for token ${B} already registered`);return y.set(B,z),{dispose:()=>{y.delete(B)}}},sendProgress:(T,B,z)=>Dr.sendNotification(Go.type,{token:B,value:z}),onUnhandledProgress:K.event,sendRequest:(T,...B)=>{Yr(),Tu();let z,te,We;if(ot.string(T)){z=T;let xe=B[0],Ge=B[B.length-1],Pe=0,ut=de.ParameterStructures.auto;de.ParameterStructures.is(xe)&&(Pe=1,ut=xe);let It=B.length;hp.CancellationToken.is(Ge)&&(It=It-1,We=Ge);let vn=It-Pe;switch(vn){case 0:te=void 0;break;case 1:te=_s(ut,B[Pe]);break;default:if(ut===de.ParameterStructures.byName)throw new Error(`Received ${vn} parameters for 'by Name' request parameter structure.`);te=B.slice(Pe,It).map(Su=>cr(Su));break}}else{let xe=B;z=T.method,te=Bo(T,xe);let Ge=T.numberOfParams;We=hp.CancellationToken.is(xe[Ge])?xe[Ge]:void 0}let je=s++,Xe;We&&(Xe=We.onCancellationRequested(()=>{let xe=D.sender.sendCancellation(Dr,je);return xe===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${je}`),Promise.resolve()):xe.catch(()=>{i.log(`Sending cancellation messages for id ${je} failed`)})}));let tt={jsonrpc:u,id:je,method:z,params:te};return mu(tt),typeof D.sender.enableCancellation=="function"&&D.sender.enableCancellation(tt),new Promise(async(xe,Ge)=>{let Pe=vn=>{xe(vn),D.sender.cleanup(je),Xe?.dispose()},ut=vn=>{Ge(vn),D.sender.cleanup(je),Xe?.dispose()},It={method:z,timerStart:Date.now(),resolve:Pe,reject:ut};try{await e.write(tt),L.set(je,It)}catch(vn){throw i.error("Sending request failed."),It.reject(new de.ResponseError(de.ErrorCodes.MessageWriteError,vn.message?vn.message:"Unknown reason")),vn}})},onRequest:(T,B)=>{Yr();let z=null;return yp.is(T)?(z=void 0,c=T):ot.string(T)?(z=null,B!==void 0&&(z=T,l.set(T,{handler:B,type:void 0}))):B!==void 0&&(z=T.method,l.set(T.method,{type:T,handler:B})),{dispose:()=>{z!==null&&(z!==void 0?l.delete(z):c=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(T,B,z)=>{let te=!1,We=_n.Text;z!==void 0&&(ot.boolean(z)?te=z:(te=z.sendNotification||!1,We=z.traceFormat||_n.Text)),k=T,v=We,k===Le.Off?F=void 0:F=B,te&&!$e()&&!cn()&&await Dr.sendNotification(bp.type,{value:Le.toString(T)})},onError:V.event,onClose:ce.event,onUnhandledNotification:ye.event,onDispose:A.event,end:()=>{e.end()},dispose:()=>{if(cn())return;C=Jn.Disposed,A.fire(void 0);let T=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let B of L.values())B.reject(T);L=new Map,x=new Map,M=new Set,E=new zv.LinkedMap,ot.func(e.dispose)&&e.dispose(),ot.func(t.dispose)&&t.dispose()},listen:()=>{Yr(),_u(),C=Jn.Listening,t.listen(fu)},inspect:()=>{(0,Vv.default)().console.log("inspect")}};return Dr.onNotification(Lu.type,T=>{if(k===Le.Off||!F)return;let B=k===Le.Verbose||k===Le.Compact;F.log(T.message,B?T.verbose:void 0)}),Dr.onNotification(Go.type,T=>{let B=y.get(T.token);B?B(T.value):K.fire(T)}),Dr}ve.createMessageConnection=Z1});var Bu=g(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=Kf();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 Tp=zf();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return Tp.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return Tp.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return Tp.Touch}});var eO=Nv();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return eO.Disposable}});var Qv=xs();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return Qv.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return Qv.Emitter}});var Zv=Ru();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return Zv.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return Zv.CancellationToken}});var e_=jv();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return e_.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return e_.SharedArrayReceiverStrategy}});var Sp=$v();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return Sp.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return Sp.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Sp.ReadableStreamMessageReader}});var kp=Gv();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return kp.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return kp.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return kp.WriteableStreamMessageWriter}});var tO=Kv();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return tO.AbstractMessageBuffer}});var $t=Jv();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return $t.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return $t.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return $t.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return $t.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return $t.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return $t.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return $t.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return $t.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return $t.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return $t.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return $t.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return $t.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return $t.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return $t.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return $t.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return $t.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return $t.MessageStrategy}});var nO=Qr();q.RAL=nO.default});var r_=g(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});var t_=require("util"),Mr=Bu(),Uu=class t extends Mr.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 t_.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)}};Uu.emptyBuffer=Buffer.allocUnsafe(0);var xp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mr.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mr.Disposable.create(()=>this.stream.off("data",e))}},wp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mr.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()}},n_=Object.freeze({messageBuffer:Object.freeze({create:t=>new Uu(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 t_.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new xp(t),asWritableStream:t=>new wp(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 Ep(){return n_}(function(t){function e(){Mr.RAL.install(n_)}t.install=e})(Ep||(Ep={}));Ap.default=Ep});var Fi=g(Ae=>{"use strict";var rO=Ae&&Ae.__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]}),iO=Ae&&Ae.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&rO(e,t,n)};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.createMessageConnection=Ae.createServerSocketTransport=Ae.createClientSocketTransport=Ae.createServerPipeTransport=Ae.createClientPipeTransport=Ae.generateRandomPipeName=Ae.StreamMessageWriter=Ae.StreamMessageReader=Ae.SocketMessageWriter=Ae.SocketMessageReader=Ae.PortMessageWriter=Ae.PortMessageReader=Ae.IPCMessageWriter=Ae.IPCMessageReader=void 0;var Cs=r_();Cs.default.install();var i_=require("path"),sO=require("os"),oO=require("crypto"),Gu=require("net"),Tn=Bu();iO(Bu(),Ae);var Op=class extends Tn.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),Tn.Disposable.create(()=>this.process.off("message",e))}};Ae.IPCMessageReader=Op;var Cp=class extends Tn.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(){}};Ae.IPCMessageWriter=Cp;var Rp=class extends Tn.AbstractMessageReader{constructor(e){super(),this.onData=new Tn.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)}};Ae.PortMessageReader=Rp;var Pp=class extends Tn.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(){}};Ae.PortMessageWriter=Pp;var qi=class extends Tn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,Cs.default)().stream.asReadableStream(e),n)}};Ae.SocketMessageReader=qi;var ji=class extends Tn.WriteableStreamMessageWriter{constructor(e,n){super((0,Cs.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ae.SocketMessageWriter=ji;var Hu=class extends Tn.ReadableStreamMessageReader{constructor(e,n){super((0,Cs.default)().stream.asReadableStream(e),n)}};Ae.StreamMessageReader=Hu;var Wu=class extends Tn.WriteableStreamMessageWriter{constructor(e,n){super((0,Cs.default)().stream.asWritableStream(e),n)}};Ae.StreamMessageWriter=Wu;var s_=process.env.XDG_RUNTIME_DIR,aO=new Map([["linux",107],["darwin",103]]);function uO(){let t=(0,oO.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;s_?e=i_.join(s_,`vscode-ipc-${t}.sock`):e=i_.join(sO.tmpdir(),`vscode-${t}.sock`);let n=aO.get(process.platform);return n!==void 0&&e.length>n&&(0,Cs.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Ae.generateRandomPipeName=uO;function cO(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Gu.createServer)(a=>{o.close(),n([new qi(a,e),new ji(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ae.createClientPipeTransport=cO;function lO(t,e="utf-8"){let n=(0,Gu.createConnection)(t);return[new qi(n,e),new ji(n,e)]}Ae.createServerPipeTransport=lO;function dO(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Gu.createServer)(a=>{o.close(),n([new qi(a,e),new ji(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ae.createClientSocketTransport=dO;function fO(t,e="utf-8"){let n=(0,Gu.createConnection)(t,"127.0.0.1");return[new qi(n,e),new ji(n,e)]}Ae.createServerSocketTransport=fO;function pO(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function hO(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function gO(t,e,n,r){n||(n=Tn.NullLogger);let i=pO(t)?new Hu(t):t,s=hO(e)?new Wu(e):e;return Tn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Tn.createMessageConnection)(i,s,n,r)}Ae.createMessageConnection=gO});var Dp=g((h$,o_)=>{"use strict";o_.exports=Fi()});var Vu=g((a_,Ku)=>{(function(t){if(typeof Ku=="object"&&typeof Ku.exports=="object"){var e=t(require,a_);e!==void 0&&(Ku.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(h){function S(w){return typeof w=="string"}h.is=S})(n||(e.DocumentUri=n={}));var r;(function(h){function S(w){return typeof w=="string"}h.is=S})(r||(e.URI=r={}));var i;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function S(w){return typeof w=="number"&&h.MIN_VALUE<=w&&w<=h.MAX_VALUE}h.is=S})(i||(e.integer=i={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function S(w){return typeof w=="number"&&h.MIN_VALUE<=w&&w<=h.MAX_VALUE}h.is=S})(s||(e.uinteger=s={}));var o;(function(h){function S(m,f){return m===Number.MAX_VALUE&&(m=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:m,character:f}}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&P.uinteger(f.line)&&P.uinteger(f.character)}h.is=w})(o||(e.Position=o={}));var a;(function(h){function S(m,f,R,U){if(P.uinteger(m)&&P.uinteger(f)&&P.uinteger(R)&&P.uinteger(U))return{start:o.create(m,f),end:o.create(R,U)};if(o.is(m)&&o.is(f))return{start:m,end:f};throw new Error("Range#create called with invalid arguments[".concat(m,", ").concat(f,", ").concat(R,", ").concat(U,"]"))}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=w})(a||(e.Range=a={}));var u;(function(h){function S(m,f){return{uri:m,range:f}}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&a.is(f.range)&&(P.string(f.uri)||P.undefined(f.uri))}h.is=w})(u||(e.Location=u={}));var c;(function(h){function S(m,f,R,U){return{targetUri:m,targetRange:f,targetSelectionRange:R,originSelectionRange:U}}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&a.is(f.targetRange)&&P.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||P.undefined(f.originSelectionRange))}h.is=w})(c||(e.LocationLink=c={}));var l;(function(h){function S(m,f,R,U){return{red:m,green:f,blue:R,alpha:U}}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&P.numberRange(f.red,0,1)&&P.numberRange(f.green,0,1)&&P.numberRange(f.blue,0,1)&&P.numberRange(f.alpha,0,1)}h.is=w})(l||(e.Color=l={}));var d;(function(h){function S(m,f){return{range:m,color:f}}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&a.is(f.range)&&l.is(f.color)}h.is=w})(d||(e.ColorInformation=d={}));var p;(function(h){function S(m,f,R){return{label:m,textEdit:f,additionalTextEdits:R}}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&P.string(f.label)&&(P.undefined(f.textEdit)||F.is(f))&&(P.undefined(f.additionalTextEdits)||P.typedArray(f.additionalTextEdits,F.is))}h.is=w})(p||(e.ColorPresentation=p={}));var y;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(y||(e.FoldingRangeKind=y={}));var _;(function(h){function S(m,f,R,U,be,ct){var Ke={startLine:m,endLine:f};return P.defined(R)&&(Ke.startCharacter=R),P.defined(U)&&(Ke.endCharacter=U),P.defined(be)&&(Ke.kind=be),P.defined(ct)&&(Ke.collapsedText=ct),Ke}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&P.uinteger(f.startLine)&&P.uinteger(f.startLine)&&(P.undefined(f.startCharacter)||P.uinteger(f.startCharacter))&&(P.undefined(f.endCharacter)||P.uinteger(f.endCharacter))&&(P.undefined(f.kind)||P.string(f.kind))}h.is=w})(_||(e.FoldingRange=_={}));var E;(function(h){function S(m,f){return{location:m,message:f}}h.create=S;function w(m){var f=m;return P.defined(f)&&u.is(f.location)&&P.string(f.message)}h.is=w})(E||(e.DiagnosticRelatedInformation=E={}));var L;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(L||(e.DiagnosticSeverity=L={}));var M;(function(h){h.Unnecessary=1,h.Deprecated=2})(M||(e.DiagnosticTag=M={}));var x;(function(h){function S(w){var m=w;return P.objectLiteral(m)&&P.string(m.href)}h.is=S})(x||(e.CodeDescription=x={}));var k;(function(h){function S(m,f,R,U,be,ct){var Ke={range:m,message:f};return P.defined(R)&&(Ke.severity=R),P.defined(U)&&(Ke.code=U),P.defined(be)&&(Ke.source=be),P.defined(ct)&&(Ke.relatedInformation=ct),Ke}h.create=S;function w(m){var f,R=m;return P.defined(R)&&a.is(R.range)&&P.string(R.message)&&(P.number(R.severity)||P.undefined(R.severity))&&(P.integer(R.code)||P.string(R.code)||P.undefined(R.code))&&(P.undefined(R.codeDescription)||P.string((f=R.codeDescription)===null||f===void 0?void 0:f.href))&&(P.string(R.source)||P.undefined(R.source))&&(P.undefined(R.relatedInformation)||P.typedArray(R.relatedInformation,E.is))}h.is=w})(k||(e.Diagnostic=k={}));var v;(function(h){function S(m,f){for(var R=[],U=2;U<arguments.length;U++)R[U-2]=arguments[U];var be={title:m,command:f};return P.defined(R)&&R.length>0&&(be.arguments=R),be}h.create=S;function w(m){var f=m;return P.defined(f)&&P.string(f.title)&&P.string(f.command)}h.is=w})(v||(e.Command=v={}));var F;(function(h){function S(R,U){return{range:R,newText:U}}h.replace=S;function w(R,U){return{range:{start:R,end:R},newText:U}}h.insert=w;function m(R){return{range:R,newText:""}}h.del=m;function f(R){var U=R;return P.objectLiteral(U)&&P.string(U.newText)&&a.is(U.range)}h.is=f})(F||(e.TextEdit=F={}));var C;(function(h){function S(m,f,R){var U={label:m};return f!==void 0&&(U.needsConfirmation=f),R!==void 0&&(U.description=R),U}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&P.string(f.label)&&(P.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(P.string(f.description)||f.description===void 0)}h.is=w})(C||(e.ChangeAnnotation=C={}));var V;(function(h){function S(w){var m=w;return P.string(m)}h.is=S})(V||(e.ChangeAnnotationIdentifier=V={}));var ce;(function(h){function S(R,U,be){return{range:R,newText:U,annotationId:be}}h.replace=S;function w(R,U,be){return{range:{start:R,end:R},newText:U,annotationId:be}}h.insert=w;function m(R,U){return{range:R,newText:"",annotationId:U}}h.del=m;function f(R){var U=R;return F.is(U)&&(C.is(U.annotationId)||V.is(U.annotationId))}h.is=f})(ce||(e.AnnotatedTextEdit=ce={}));var ye;(function(h){function S(m,f){return{textDocument:m,edits:f}}h.create=S;function w(m){var f=m;return P.defined(f)&&$e.is(f.textDocument)&&Array.isArray(f.edits)}h.is=w})(ye||(e.TextDocumentEdit=ye={}));var K;(function(h){function S(m,f,R){var U={kind:"create",uri:m};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&(U.options=f),R!==void 0&&(U.annotationId=R),U}h.create=S;function w(m){var f=m;return f&&f.kind==="create"&&P.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||P.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||P.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||V.is(f.annotationId))}h.is=w})(K||(e.CreateFile=K={}));var A;(function(h){function S(m,f,R,U){var be={kind:"rename",oldUri:m,newUri:f};return R!==void 0&&(R.overwrite!==void 0||R.ignoreIfExists!==void 0)&&(be.options=R),U!==void 0&&(be.annotationId=U),be}h.create=S;function w(m){var f=m;return f&&f.kind==="rename"&&P.string(f.oldUri)&&P.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||P.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||P.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||V.is(f.annotationId))}h.is=w})(A||(e.RenameFile=A={}));var D;(function(h){function S(m,f,R){var U={kind:"delete",uri:m};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&(U.options=f),R!==void 0&&(U.annotationId=R),U}h.create=S;function w(m){var f=m;return f&&f.kind==="delete"&&P.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||P.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||P.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||V.is(f.annotationId))}h.is=w})(D||(e.DeleteFile=D={}));var I;(function(h){function S(w){var m=w;return m&&(m.changes!==void 0||m.documentChanges!==void 0)&&(m.documentChanges===void 0||m.documentChanges.every(function(f){return P.string(f.kind)?K.is(f)||A.is(f)||D.is(f):ye.is(f)}))}h.is=S})(I||(e.WorkspaceEdit=I={}));var j=function(){function h(S,w){this.edits=S,this.changeAnnotations=w}return h.prototype.insert=function(S,w,m){var f,R;if(m===void 0?f=F.insert(S,w):V.is(m)?(R=m,f=ce.insert(S,w,m)):(this.assertChangeAnnotations(this.changeAnnotations),R=this.changeAnnotations.manage(m),f=ce.insert(S,w,R)),this.edits.push(f),R!==void 0)return R},h.prototype.replace=function(S,w,m){var f,R;if(m===void 0?f=F.replace(S,w):V.is(m)?(R=m,f=ce.replace(S,w,m)):(this.assertChangeAnnotations(this.changeAnnotations),R=this.changeAnnotations.manage(m),f=ce.replace(S,w,R)),this.edits.push(f),R!==void 0)return R},h.prototype.delete=function(S,w){var m,f;if(w===void 0?m=F.del(S):V.is(w)?(f=w,m=ce.del(S,w)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(w),m=ce.del(S,f)),this.edits.push(m),f!==void 0)return f},h.prototype.add=function(S){this.edits.push(S)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(S){if(S===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),he=function(){function h(S){this._annotations=S===void 0?Object.create(null):S,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(S,w){var m;if(V.is(S)?m=S:(m=this.nextId(),w=S),this._annotations[m]!==void 0)throw new Error("Id ".concat(m," is already in use."));if(w===void 0)throw new Error("No annotation provided for id ".concat(m));return this._annotations[m]=w,this._size++,m},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),fe=function(){function h(S){var w=this;this._textEditChanges=Object.create(null),S!==void 0?(this._workspaceEdit=S,S.documentChanges?(this._changeAnnotations=new he(S.changeAnnotations),S.changeAnnotations=this._changeAnnotations.all(),S.documentChanges.forEach(function(m){if(ye.is(m)){var f=new j(m.edits,w._changeAnnotations);w._textEditChanges[m.textDocument.uri]=f}})):S.changes&&Object.keys(S.changes).forEach(function(m){var f=new j(S.changes[m]);w._textEditChanges[m]=f})):this._workspaceEdit={}}return Object.defineProperty(h.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),h.prototype.getTextEditChange=function(S){if($e.is(S)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var w={uri:S.uri,version:S.version},m=this._textEditChanges[w.uri];if(!m){var f=[],R={textDocument:w,edits:f};this._workspaceEdit.documentChanges.push(R),m=new j(f,this._changeAnnotations),this._textEditChanges[w.uri]=m}return m}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var m=this._textEditChanges[S];if(!m){var f=[];this._workspaceEdit.changes[S]=f,m=new j(f),this._textEditChanges[S]=m}return m}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new he,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(S,w,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;C.is(w)||V.is(w)?f=w:m=w;var R,U;if(f===void 0?R=K.create(S,m):(U=V.is(f)?f:this._changeAnnotations.manage(f),R=K.create(S,m,U)),this._workspaceEdit.documentChanges.push(R),U!==void 0)return U},h.prototype.renameFile=function(S,w,m,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var R;C.is(m)||V.is(m)?R=m:f=m;var U,be;if(R===void 0?U=A.create(S,w,f):(be=V.is(R)?R:this._changeAnnotations.manage(R),U=A.create(S,w,f,be)),this._workspaceEdit.documentChanges.push(U),be!==void 0)return be},h.prototype.deleteFile=function(S,w,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;C.is(w)||V.is(w)?f=w:m=w;var R,U;if(f===void 0?R=D.create(S,m):(U=V.is(f)?f:this._changeAnnotations.manage(f),R=D.create(S,m,U)),this._workspaceEdit.documentChanges.push(R),U!==void 0)return U},h}();e.WorkspaceChange=fe;var Dt;(function(h){function S(m){return{uri:m}}h.create=S;function w(m){var f=m;return P.defined(f)&&P.string(f.uri)}h.is=w})(Dt||(e.TextDocumentIdentifier=Dt={}));var mt;(function(h){function S(m,f){return{uri:m,version:f}}h.create=S;function w(m){var f=m;return P.defined(f)&&P.string(f.uri)&&P.integer(f.version)}h.is=w})(mt||(e.VersionedTextDocumentIdentifier=mt={}));var $e;(function(h){function S(m,f){return{uri:m,version:f}}h.create=S;function w(m){var f=m;return P.defined(f)&&P.string(f.uri)&&(f.version===null||P.integer(f.version))}h.is=w})($e||(e.OptionalVersionedTextDocumentIdentifier=$e={}));var cn;(function(h){function S(m,f,R,U){return{uri:m,languageId:f,version:R,text:U}}h.create=S;function w(m){var f=m;return P.defined(f)&&P.string(f.uri)&&P.string(f.languageId)&&P.integer(f.version)&&P.string(f.text)}h.is=w})(cn||(e.TextDocumentItem=cn={}));var ys;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function S(w){var m=w;return m===h.PlainText||m===h.Markdown}h.is=S})(ys||(e.MarkupKind=ys={}));var Mi;(function(h){function S(w){var m=w;return P.objectLiteral(w)&&ys.is(m.kind)&&P.string(m.value)}h.is=S})(Mi||(e.MarkupContent=Mi={}));var lu;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(lu||(e.CompletionItemKind=lu={}));var qo;(function(h){h.PlainText=1,h.Snippet=2})(qo||(e.InsertTextFormat=qo={}));var jo;(function(h){h.Deprecated=1})(jo||(e.CompletionItemTag=jo={}));var du;(function(h){function S(m,f,R){return{newText:m,insert:f,replace:R}}h.create=S;function w(m){var f=m;return f&&P.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=w})(du||(e.InsertReplaceEdit=du={}));var fu;(function(h){h.asIs=1,h.adjustIndentation=2})(fu||(e.InsertTextMode=fu={}));var pu;(function(h){function S(w){var m=w;return m&&(P.string(m.detail)||m.detail===void 0)&&(P.string(m.description)||m.description===void 0)}h.is=S})(pu||(e.CompletionItemLabelDetails=pu={}));var hu;(function(h){function S(w){return{label:w}}h.create=S})(hu||(e.CompletionItem=hu={}));var gu;(function(h){function S(w,m){return{items:w||[],isIncomplete:!!m}}h.create=S})(gu||(e.CompletionList=gu={}));var bs;(function(h){function S(m){return m.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=S;function w(m){var f=m;return P.string(f)||P.objectLiteral(f)&&P.string(f.language)&&P.string(f.value)}h.is=w})(bs||(e.MarkedString=bs={}));var zn;(function(h){function S(w){var m=w;return!!m&&P.objectLiteral(m)&&(Mi.is(m.contents)||bs.is(m.contents)||P.typedArray(m.contents,bs.is))&&(w.range===void 0||a.is(w.range))}h.is=S})(zn||(e.Hover=zn={}));var mu;(function(h){function S(w,m){return m?{label:w,documentation:m}:{label:w}}h.create=S})(mu||(e.ParameterInformation=mu={}));var yu;(function(h){function S(w,m){for(var f=[],R=2;R<arguments.length;R++)f[R-2]=arguments[R];var U={label:w};return P.defined(m)&&(U.documentation=m),P.defined(f)?U.parameters=f:U.parameters=[],U}h.create=S})(yu||(e.SignatureInformation=yu={}));var Li;(function(h){h.Text=1,h.Read=2,h.Write=3})(Li||(e.DocumentHighlightKind=Li={}));var bu;(function(h){function S(w,m){var f={range:w};return P.number(m)&&(f.kind=m),f}h.create=S})(bu||(e.DocumentHighlight=bu={}));var vs;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(vs||(e.SymbolKind=vs={}));var vu;(function(h){h.Deprecated=1})(vu||(e.SymbolTag=vu={}));var Pr;(function(h){function S(w,m,f,R,U){var be={name:w,kind:m,location:{uri:R,range:f}};return U&&(be.containerName=U),be}h.create=S})(Pr||(e.SymbolInformation=Pr={}));var Yr;(function(h){function S(w,m,f,R){return R!==void 0?{name:w,kind:m,location:{uri:f,range:R}}:{name:w,kind:m,location:{uri:f}}}h.create=S})(Yr||(e.WorkspaceSymbol=Yr={}));var _u;(function(h){function S(m,f,R,U,be,ct){var Ke={name:m,detail:f,kind:R,range:U,selectionRange:be};return ct!==void 0&&(Ke.children=ct),Ke}h.create=S;function w(m){var f=m;return f&&P.string(f.name)&&P.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||P.string(f.detail))&&(f.deprecated===void 0||P.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=w})(_u||(e.DocumentSymbol=_u={}));var Tu;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})(Tu||(e.CodeActionKind=Tu={}));var cr;(function(h){h.Invoked=1,h.Automatic=2})(cr||(e.CodeActionTriggerKind=cr={}));var Fo;(function(h){function S(m,f,R){var U={diagnostics:m};return f!=null&&(U.only=f),R!=null&&(U.triggerKind=R),U}h.create=S;function w(m){var f=m;return P.defined(f)&&P.typedArray(f.diagnostics,k.is)&&(f.only===void 0||P.typedArray(f.only,P.string))&&(f.triggerKind===void 0||f.triggerKind===cr.Invoked||f.triggerKind===cr.Automatic)}h.is=w})(Fo||(e.CodeActionContext=Fo={}));var $o;(function(h){function S(m,f,R){var U={title:m},be=!0;return typeof f=="string"?(be=!1,U.kind=f):v.is(f)?U.command=f:U.edit=f,be&&R!==void 0&&(U.kind=R),U}h.create=S;function w(m){var f=m;return f&&P.string(f.title)&&(f.diagnostics===void 0||P.typedArray(f.diagnostics,k.is))&&(f.kind===void 0||P.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||v.is(f.command))&&(f.isPreferred===void 0||P.boolean(f.isPreferred))&&(f.edit===void 0||I.is(f.edit))}h.is=w})($o||(e.CodeAction=$o={}));var _s;(function(h){function S(m,f){var R={range:m};return P.defined(f)&&(R.data=f),R}h.create=S;function w(m){var f=m;return P.defined(f)&&a.is(f.range)&&(P.undefined(f.command)||v.is(f.command))}h.is=w})(_s||(e.CodeLens=_s={}));var Bo;(function(h){function S(m,f){return{tabSize:m,insertSpaces:f}}h.create=S;function w(m){var f=m;return P.defined(f)&&P.uinteger(f.tabSize)&&P.boolean(f.insertSpaces)}h.is=w})(Bo||(e.FormattingOptions=Bo={}));var Dr;(function(h){function S(m,f,R){return{range:m,target:f,data:R}}h.create=S;function w(m){var f=m;return P.defined(f)&&a.is(f.range)&&(P.undefined(f.target)||P.string(f.target))}h.is=w})(Dr||(e.DocumentLink=Dr={}));var T;(function(h){function S(m,f){return{range:m,parent:f}}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=w})(T||(e.SelectionRange=T={}));var B;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(B||(e.SemanticTokenTypes=B={}));var z;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(z||(e.SemanticTokenModifiers=z={}));var te;(function(h){function S(w){var m=w;return P.objectLiteral(m)&&(m.resultId===void 0||typeof m.resultId=="string")&&Array.isArray(m.data)&&(m.data.length===0||typeof m.data[0]=="number")}h.is=S})(te||(e.SemanticTokens=te={}));var We;(function(h){function S(m,f){return{range:m,text:f}}h.create=S;function w(m){var f=m;return f!=null&&a.is(f.range)&&P.string(f.text)}h.is=w})(We||(e.InlineValueText=We={}));var je;(function(h){function S(m,f,R){return{range:m,variableName:f,caseSensitiveLookup:R}}h.create=S;function w(m){var f=m;return f!=null&&a.is(f.range)&&P.boolean(f.caseSensitiveLookup)&&(P.string(f.variableName)||f.variableName===void 0)}h.is=w})(je||(e.InlineValueVariableLookup=je={}));var Xe;(function(h){function S(m,f){return{range:m,expression:f}}h.create=S;function w(m){var f=m;return f!=null&&a.is(f.range)&&(P.string(f.expression)||f.expression===void 0)}h.is=w})(Xe||(e.InlineValueEvaluatableExpression=Xe={}));var tt;(function(h){function S(m,f){return{frameId:m,stoppedLocation:f}}h.create=S;function w(m){var f=m;return P.defined(f)&&a.is(m.stoppedLocation)}h.is=w})(tt||(e.InlineValueContext=tt={}));var xe;(function(h){h.Type=1,h.Parameter=2;function S(w){return w===1||w===2}h.is=S})(xe||(e.InlayHintKind=xe={}));var Ge;(function(h){function S(m){return{value:m}}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&(f.tooltip===void 0||P.string(f.tooltip)||Mi.is(f.tooltip))&&(f.location===void 0||u.is(f.location))&&(f.command===void 0||v.is(f.command))}h.is=w})(Ge||(e.InlayHintLabelPart=Ge={}));var Pe;(function(h){function S(m,f,R){var U={position:m,label:f};return R!==void 0&&(U.kind=R),U}h.create=S;function w(m){var f=m;return P.objectLiteral(f)&&o.is(f.position)&&(P.string(f.label)||P.typedArray(f.label,Ge.is))&&(f.kind===void 0||xe.is(f.kind))&&f.textEdits===void 0||P.typedArray(f.textEdits,F.is)&&(f.tooltip===void 0||P.string(f.tooltip)||Mi.is(f.tooltip))&&(f.paddingLeft===void 0||P.boolean(f.paddingLeft))&&(f.paddingRight===void 0||P.boolean(f.paddingRight))}h.is=w})(Pe||(e.InlayHint=Pe={}));var ut;(function(h){function S(w){return{kind:"snippet",value:w}}h.createSnippet=S})(ut||(e.StringValue=ut={}));var It;(function(h){function S(w,m,f,R){return{insertText:w,filterText:m,range:f,command:R}}h.create=S})(It||(e.InlineCompletionItem=It={}));var vn;(function(h){function S(w){return{items:w}}h.create=S})(vn||(e.InlineCompletionList=vn={}));var Su;(function(h){h.Invoked=0,h.Automatic=1})(Su||(e.InlineCompletionTriggerKind=Su={}));var kv;(function(h){function S(w,m){return{range:w,text:m}}h.create=S})(kv||(e.SelectedCompletionInfo=kv={}));var xv;(function(h){function S(w,m){return{triggerKind:w,selectedCompletionInfo:m}}h.create=S})(xv||(e.InlineCompletionContext=xv={}));var wv;(function(h){function S(w){var m=w;return P.objectLiteral(m)&&r.is(m.uri)&&P.string(m.name)}h.is=S})(wv||(e.WorkspaceFolder=wv={})),e.EOL=[`
32
32
  `,`\r
33
- `,"\r"];var pv;(function(h){function S(R,U,me,at){return new cO(R,U,me,at)}h.create=S;function w(R){var U=R;return!!(D.defined(U)&&D.string(U.uri)&&(D.undefined(U.languageId)||D.string(U.languageId))&&D.uinteger(U.lineCount)&&D.func(U.getText)&&D.func(U.positionAt)&&D.func(U.offsetAt))}h.is=w;function m(R,U){for(var me=R.getText(),at=f(U,function(ys,_u){var hv=ys.range.start.line-_u.range.start.line;return hv===0?ys.range.start.character-_u.range.start.character:hv}),We=me.length,Gn=at.length-1;Gn>=0;Gn--){var Vn=at[Gn],Ar=R.offsetAt(Vn.range.start),xe=R.offsetAt(Vn.range.end);if(xe<=We)me=me.substring(0,Ar)+Vn.newText+me.substring(xe,me.length);else throw new Error("Overlapping edit");We=Ar}return me}h.applyEdits=m;function f(R,U){if(R.length<=1)return R;var me=R.length/2|0,at=R.slice(0,me),We=R.slice(me);f(at,U),f(We,U);for(var Gn=0,Vn=0,Ar=0;Gn<at.length&&Vn<We.length;){var xe=U(at[Gn],We[Vn]);xe<=0?R[Ar++]=at[Gn++]:R[Ar++]=We[Vn++]}for(;Gn<at.length;)R[Ar++]=at[Gn++];for(;Vn<We.length;)R[Ar++]=We[Vn++];return R}})(pv||(e.TextDocument=pv={}));var cO=function(){function h(S,w,m,f){this._uri=S,this._languageId=w,this._version=m,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(h.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),h.prototype.getText=function(S){if(S){var w=this.offsetAt(S.start),m=this.offsetAt(S.end);return this._content.substring(w,m)}return this._content},h.prototype.update=function(S,w){this._content=S.text,this._version=w,this._lineOffsets=void 0},h.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var S=[],w=this._content,m=!0,f=0;f<w.length;f++){m&&(S.push(f),m=!1);var R=w.charAt(f);m=R==="\r"||R===`
33
+ `,"\r"];var Ev;(function(h){function S(R,U,be,ct){return new S1(R,U,be,ct)}h.create=S;function w(R){var U=R;return!!(P.defined(U)&&P.string(U.uri)&&(P.undefined(U.languageId)||P.string(U.languageId))&&P.uinteger(U.lineCount)&&P.func(U.getText)&&P.func(U.positionAt)&&P.func(U.offsetAt))}h.is=w;function m(R,U){for(var be=R.getText(),ct=f(U,function(Ts,ku){var Av=Ts.range.start.line-ku.range.start.line;return Av===0?Ts.range.start.character-ku.range.start.character:Av}),Ke=be.length,Xn=ct.length-1;Xn>=0;Xn--){var Yn=ct[Xn],Ir=R.offsetAt(Yn.range.start),Ee=R.offsetAt(Yn.range.end);if(Ee<=Ke)be=be.substring(0,Ir)+Yn.newText+be.substring(Ee,be.length);else throw new Error("Overlapping edit");Ke=Ir}return be}h.applyEdits=m;function f(R,U){if(R.length<=1)return R;var be=R.length/2|0,ct=R.slice(0,be),Ke=R.slice(be);f(ct,U),f(Ke,U);for(var Xn=0,Yn=0,Ir=0;Xn<ct.length&&Yn<Ke.length;){var Ee=U(ct[Xn],Ke[Yn]);Ee<=0?R[Ir++]=ct[Xn++]:R[Ir++]=Ke[Yn++]}for(;Xn<ct.length;)R[Ir++]=ct[Xn++];for(;Yn<Ke.length;)R[Ir++]=Ke[Yn++];return R}})(Ev||(e.TextDocument=Ev={}));var S1=function(){function h(S,w,m,f){this._uri=S,this._languageId=w,this._version=m,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(h.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),h.prototype.getText=function(S){if(S){var w=this.offsetAt(S.start),m=this.offsetAt(S.end);return this._content.substring(w,m)}return this._content},h.prototype.update=function(S,w){this._content=S.text,this._version=w,this._lineOffsets=void 0},h.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var S=[],w=this._content,m=!0,f=0;f<w.length;f++){m&&(S.push(f),m=!1);var R=w.charAt(f);m=R==="\r"||R===`
34
34
  `,R==="\r"&&f+1<w.length&&w.charAt(f+1)===`
35
- `&&f++}m&&w.length>0&&S.push(w.length),this._lineOffsets=S}return this._lineOffsets},h.prototype.positionAt=function(S){S=Math.max(Math.min(S,this._content.length),0);var w=this.getLineOffsets(),m=0,f=w.length;if(f===0)return o.create(0,S);for(;m<f;){var R=Math.floor((m+f)/2);w[R]>S?f=R:m=R+1}var U=m-1;return o.create(U,S-w[U])},h.prototype.offsetAt=function(S){var w=this.getLineOffsets();if(S.line>=w.length)return this._content.length;if(S.line<0)return 0;var m=w[S.line],f=S.line+1<w.length?w[S.line+1]:this._content.length;return Math.max(Math.min(m+S.character,f),m)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var S=Object.prototype.toString;function w(xe){return typeof xe<"u"}h.defined=w;function m(xe){return typeof xe>"u"}h.undefined=m;function f(xe){return xe===!0||xe===!1}h.boolean=f;function R(xe){return S.call(xe)==="[object String]"}h.string=R;function U(xe){return S.call(xe)==="[object Number]"}h.number=U;function me(xe,ys,_u){return S.call(xe)==="[object Number]"&&ys<=xe&&xe<=_u}h.numberRange=me;function at(xe){return S.call(xe)==="[object Number]"&&-2147483648<=xe&&xe<=2147483647}h.integer=at;function We(xe){return S.call(xe)==="[object Number]"&&0<=xe&&xe<=2147483647}h.uinteger=We;function Gn(xe){return S.call(xe)==="[object Function]"}h.func=Gn;function Vn(xe){return xe!==null&&typeof xe=="object"}h.objectLiteral=Vn;function Ar(xe,ys){return Array.isArray(xe)&&xe.every(ys)}h.typedArray=Ar})(D||(D={}))})});var et=g(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.ProtocolNotificationType=un.ProtocolNotificationType0=un.ProtocolRequestType=un.ProtocolRequestType0=un.RegistrationType=un.MessageDirection=void 0;var Es=Li(),Xv;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Xv||(un.MessageDirection=Xv={}));var Ep=class{constructor(e){this.method=e}};un.RegistrationType=Ep;var Ap=class extends Es.RequestType0{constructor(e){super(e)}};un.ProtocolRequestType0=Ap;var Op=class extends Es.RequestType{constructor(e){super(e,Es.ParameterStructures.byName)}};un.ProtocolRequestType=Op;var Cp=class extends Es.NotificationType0{constructor(e){super(e)}};un.ProtocolNotificationType0=Cp;var Rp=class extends Es.NotificationType{constructor(e){super(e,Es.ParameterStructures.byName)}};un.ProtocolNotificationType=Rp});var Gu=g(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.objectLiteral=Tt.typedArray=Tt.stringArray=Tt.array=Tt.func=Tt.error=Tt.number=Tt.string=Tt.boolean=void 0;function rC(t){return t===!0||t===!1}Tt.boolean=rC;function Yv(t){return typeof t=="string"||t instanceof String}Tt.string=Yv;function iC(t){return typeof t=="number"||t instanceof Number}Tt.number=iC;function sC(t){return t instanceof Error}Tt.error=sC;function oC(t){return typeof t=="function"}Tt.func=oC;function Jv(t){return Array.isArray(t)}Tt.array=Jv;function aC(t){return Jv(t)&&t.every(e=>Yv(e))}Tt.stringArray=aC;function uC(t,e){return Array.isArray(t)&&t.every(e)}Tt.typedArray=uC;function cC(t){return t!==null&&typeof t=="object"}Tt.objectLiteral=cC});var e_=g(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.ImplementationRequest=void 0;var Qv=et(),Zv;(function(t){t.method="textDocument/implementation",t.messageDirection=Qv.MessageDirection.clientToServer,t.type=new Qv.ProtocolRequestType(t.method)})(Zv||(Vu.ImplementationRequest=Zv={}))});var r_=g(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.TypeDefinitionRequest=void 0;var t_=et(),n_;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=t_.MessageDirection.clientToServer,t.type=new t_.ProtocolRequestType(t.method)})(n_||(Ku.TypeDefinitionRequest=n_={}))});var o_=g(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.DidChangeWorkspaceFoldersNotification=As.WorkspaceFoldersRequest=void 0;var zu=et(),i_;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=zu.MessageDirection.serverToClient,t.type=new zu.ProtocolRequestType0(t.method)})(i_||(As.WorkspaceFoldersRequest=i_={}));var s_;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=zu.MessageDirection.clientToServer,t.type=new zu.ProtocolNotificationType(t.method)})(s_||(As.DidChangeWorkspaceFoldersNotification=s_={}))});var c_=g(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.ConfigurationRequest=void 0;var a_=et(),u_;(function(t){t.method="workspace/configuration",t.messageDirection=a_.MessageDirection.serverToClient,t.type=new a_.ProtocolRequestType(t.method)})(u_||(Xu.ConfigurationRequest=u_={}))});var f_=g(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.ColorPresentationRequest=Os.DocumentColorRequest=void 0;var Yu=et(),l_;(function(t){t.method="textDocument/documentColor",t.messageDirection=Yu.MessageDirection.clientToServer,t.type=new Yu.ProtocolRequestType(t.method)})(l_||(Os.DocumentColorRequest=l_={}));var d_;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Yu.MessageDirection.clientToServer,t.type=new Yu.ProtocolRequestType(t.method)})(d_||(Os.ColorPresentationRequest=d_={}))});var g_=g(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.FoldingRangeRefreshRequest=Cs.FoldingRangeRequest=void 0;var Ju=et(),p_;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Ju.MessageDirection.clientToServer,t.type=new Ju.ProtocolRequestType(t.method)})(p_||(Cs.FoldingRangeRequest=p_={}));var h_;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Ju.MessageDirection.serverToClient,t.type=new Ju.ProtocolRequestType0(t.method)})(h_||(Cs.FoldingRangeRefreshRequest=h_={}))});var b_=g(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.DeclarationRequest=void 0;var m_=et(),y_;(function(t){t.method="textDocument/declaration",t.messageDirection=m_.MessageDirection.clientToServer,t.type=new m_.ProtocolRequestType(t.method)})(y_||(Qu.DeclarationRequest=y_={}))});var T_=g(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.SelectionRangeRequest=void 0;var v_=et(),__;(function(t){t.method="textDocument/selectionRange",t.messageDirection=v_.MessageDirection.clientToServer,t.type=new v_.ProtocolRequestType(t.method)})(__||(Zu.SelectionRangeRequest=__={}))});var w_=g(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.WorkDoneProgressCancelNotification=Jr.WorkDoneProgressCreateRequest=Jr.WorkDoneProgress=void 0;var lC=Li(),ec=et(),S_;(function(t){t.type=new lC.ProgressType;function e(n){return n===t.type}t.is=e})(S_||(Jr.WorkDoneProgress=S_={}));var k_;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=ec.MessageDirection.serverToClient,t.type=new ec.ProtocolRequestType(t.method)})(k_||(Jr.WorkDoneProgressCreateRequest=k_={}));var x_;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=ec.MessageDirection.clientToServer,t.type=new ec.ProtocolNotificationType(t.method)})(x_||(Jr.WorkDoneProgressCancelNotification=x_={}))});var C_=g(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.CallHierarchyOutgoingCallsRequest=Qr.CallHierarchyIncomingCallsRequest=Qr.CallHierarchyPrepareRequest=void 0;var Rs=et(),E_;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(E_||(Qr.CallHierarchyPrepareRequest=E_={}));var A_;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(A_||(Qr.CallHierarchyIncomingCallsRequest=A_={}));var O_;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(O_||(Qr.CallHierarchyOutgoingCallsRequest=O_={}))});var L_=g(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.SemanticTokensRefreshRequest=cn.SemanticTokensRangeRequest=cn.SemanticTokensDeltaRequest=cn.SemanticTokensRequest=cn.SemanticTokensRegistrationType=cn.TokenFormat=void 0;var Cr=et(),R_;(function(t){t.Relative="relative"})(R_||(cn.TokenFormat=R_={}));var Go;(function(t){t.method="textDocument/semanticTokens",t.type=new Cr.RegistrationType(t.method)})(Go||(cn.SemanticTokensRegistrationType=Go={}));var D_;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Cr.MessageDirection.clientToServer,t.type=new Cr.ProtocolRequestType(t.method),t.registrationMethod=Go.method})(D_||(cn.SemanticTokensRequest=D_={}));var P_;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Cr.MessageDirection.clientToServer,t.type=new Cr.ProtocolRequestType(t.method),t.registrationMethod=Go.method})(P_||(cn.SemanticTokensDeltaRequest=P_={}));var I_;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Cr.MessageDirection.clientToServer,t.type=new Cr.ProtocolRequestType(t.method),t.registrationMethod=Go.method})(I_||(cn.SemanticTokensRangeRequest=I_={}));var M_;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Cr.MessageDirection.serverToClient,t.type=new Cr.ProtocolRequestType0(t.method)})(M_||(cn.SemanticTokensRefreshRequest=M_={}))});var j_=g(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.ShowDocumentRequest=void 0;var q_=et(),N_;(function(t){t.method="window/showDocument",t.messageDirection=q_.MessageDirection.serverToClient,t.type=new q_.ProtocolRequestType(t.method)})(N_||(tc.ShowDocumentRequest=N_={}))});var B_=g(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.LinkedEditingRangeRequest=void 0;var F_=et(),$_;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=F_.MessageDirection.clientToServer,t.type=new F_.ProtocolRequestType(t.method)})($_||(nc.LinkedEditingRangeRequest=$_={}))});var X_=g(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.WillDeleteFilesRequest=Wt.DidDeleteFilesNotification=Wt.DidRenameFilesNotification=Wt.WillRenameFilesRequest=Wt.DidCreateFilesNotification=Wt.WillCreateFilesRequest=Wt.FileOperationPatternKind=void 0;var En=et(),U_;(function(t){t.file="file",t.folder="folder"})(U_||(Wt.FileOperationPatternKind=U_={}));var H_;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(H_||(Wt.WillCreateFilesRequest=H_={}));var W_;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(W_||(Wt.DidCreateFilesNotification=W_={}));var G_;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(G_||(Wt.WillRenameFilesRequest=G_={}));var V_;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(V_||(Wt.DidRenameFilesNotification=V_={}));var K_;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(K_||(Wt.DidDeleteFilesNotification=K_={}));var z_;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(z_||(Wt.WillDeleteFilesRequest=z_={}))});var eT=g(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.MonikerRequest=Zr.MonikerKind=Zr.UniquenessLevel=void 0;var Y_=et(),J_;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(J_||(Zr.UniquenessLevel=J_={}));var Q_;(function(t){t.$import="import",t.$export="export",t.local="local"})(Q_||(Zr.MonikerKind=Q_={}));var Z_;(function(t){t.method="textDocument/moniker",t.messageDirection=Y_.MessageDirection.clientToServer,t.type=new Y_.ProtocolRequestType(t.method)})(Z_||(Zr.MonikerRequest=Z_={}))});var iT=g(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.TypeHierarchySubtypesRequest=ei.TypeHierarchySupertypesRequest=ei.TypeHierarchyPrepareRequest=void 0;var Ds=et(),tT;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Ds.MessageDirection.clientToServer,t.type=new Ds.ProtocolRequestType(t.method)})(tT||(ei.TypeHierarchyPrepareRequest=tT={}));var nT;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Ds.MessageDirection.clientToServer,t.type=new Ds.ProtocolRequestType(t.method)})(nT||(ei.TypeHierarchySupertypesRequest=nT={}));var rT;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Ds.MessageDirection.clientToServer,t.type=new Ds.ProtocolRequestType(t.method)})(rT||(ei.TypeHierarchySubtypesRequest=rT={}))});var aT=g(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.InlineValueRefreshRequest=Ps.InlineValueRequest=void 0;var rc=et(),sT;(function(t){t.method="textDocument/inlineValue",t.messageDirection=rc.MessageDirection.clientToServer,t.type=new rc.ProtocolRequestType(t.method)})(sT||(Ps.InlineValueRequest=sT={}));var oT;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=rc.MessageDirection.serverToClient,t.type=new rc.ProtocolRequestType0(t.method)})(oT||(Ps.InlineValueRefreshRequest=oT={}))});var dT=g(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.InlayHintRefreshRequest=ti.InlayHintResolveRequest=ti.InlayHintRequest=void 0;var Is=et(),uT;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Is.MessageDirection.clientToServer,t.type=new Is.ProtocolRequestType(t.method)})(uT||(ti.InlayHintRequest=uT={}));var cT;(function(t){t.method="inlayHint/resolve",t.messageDirection=Is.MessageDirection.clientToServer,t.type=new Is.ProtocolRequestType(t.method)})(cT||(ti.InlayHintResolveRequest=cT={}));var lT;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Is.MessageDirection.serverToClient,t.type=new Is.ProtocolRequestType0(t.method)})(lT||(ti.InlayHintRefreshRequest=lT={}))});var bT=g(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.DiagnosticRefreshRequest=An.WorkspaceDiagnosticRequest=An.DocumentDiagnosticRequest=An.DocumentDiagnosticReportKind=An.DiagnosticServerCancellationData=void 0;var yT=Li(),dC=Gu(),Ms=et(),fT;(function(t){function e(n){let r=n;return r&&dC.boolean(r.retriggerRequest)}t.is=e})(fT||(An.DiagnosticServerCancellationData=fT={}));var pT;(function(t){t.Full="full",t.Unchanged="unchanged"})(pT||(An.DocumentDiagnosticReportKind=pT={}));var hT;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Ms.MessageDirection.clientToServer,t.type=new Ms.ProtocolRequestType(t.method),t.partialResult=new yT.ProgressType})(hT||(An.DocumentDiagnosticRequest=hT={}));var gT;(function(t){t.method="workspace/diagnostic",t.messageDirection=Ms.MessageDirection.clientToServer,t.type=new Ms.ProtocolRequestType(t.method),t.partialResult=new yT.ProgressType})(gT||(An.WorkspaceDiagnosticRequest=gT={}));var mT;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Ms.MessageDirection.serverToClient,t.type=new Ms.ProtocolRequestType0(t.method)})(mT||(An.DiagnosticRefreshRequest=mT={}))});var wT=g(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.DidCloseNotebookDocumentNotification=ut.DidSaveNotebookDocumentNotification=ut.DidChangeNotebookDocumentNotification=ut.NotebookCellArrayChange=ut.DidOpenNotebookDocumentNotification=ut.NotebookDocumentSyncRegistrationType=ut.NotebookDocument=ut.NotebookCell=ut.ExecutionSummary=ut.NotebookCellKind=void 0;var Vo=Wu(),zn=Gu(),or=et(),Dp;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Dp||(ut.NotebookCellKind=Dp={}));var Pp;(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 zn.objectLiteral(s)&&Vo.uinteger.is(s.executionOrder)&&(s.success===void 0||zn.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})(Pp||(ut.ExecutionSummary=Pp={}));var ic;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return zn.objectLiteral(o)&&Dp.is(o.kind)&&Vo.DocumentUri.is(o.document)&&(o.metadata===void 0||zn.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)&&!Pp.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(zn.objectLiteral(s)&&zn.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 d=0;d<c.length;d++){let p=c[d];if(!i(s[p],o[p]))return!1}}return!0}})(ic||(ut.NotebookCell=ic={}));var vT;(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 zn.objectLiteral(i)&&zn.string(i.uri)&&Vo.integer.is(i.version)&&zn.typedArray(i.cells,ic.is)}t.is=n})(vT||(ut.NotebookDocument=vT={}));var Ls;(function(t){t.method="notebookDocument/sync",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.RegistrationType(t.method)})(Ls||(ut.NotebookDocumentSyncRegistrationType=Ls={}));var _T;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.ProtocolNotificationType(t.method),t.registrationMethod=Ls.method})(_T||(ut.DidOpenNotebookDocumentNotification=_T={}));var TT;(function(t){function e(r){let i=r;return zn.objectLiteral(i)&&Vo.uinteger.is(i.start)&&Vo.uinteger.is(i.deleteCount)&&(i.cells===void 0||zn.typedArray(i.cells,ic.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})(TT||(ut.NotebookCellArrayChange=TT={}));var ST;(function(t){t.method="notebookDocument/didChange",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.ProtocolNotificationType(t.method),t.registrationMethod=Ls.method})(ST||(ut.DidChangeNotebookDocumentNotification=ST={}));var kT;(function(t){t.method="notebookDocument/didSave",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.ProtocolNotificationType(t.method),t.registrationMethod=Ls.method})(kT||(ut.DidSaveNotebookDocumentNotification=kT={}));var xT;(function(t){t.method="notebookDocument/didClose",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.ProtocolNotificationType(t.method),t.registrationMethod=Ls.method})(xT||(ut.DidCloseNotebookDocumentNotification=xT={}))});var OT=g(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.InlineCompletionRequest=void 0;var ET=et(),AT;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=ET.MessageDirection.clientToServer,t.type=new ET.ProtocolRequestType(t.method)})(AT||(sc.InlineCompletionRequest=AT={}))});var BS=g(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.WorkspaceSymbolRequest=b.CodeActionResolveRequest=b.CodeActionRequest=b.DocumentSymbolRequest=b.DocumentHighlightRequest=b.ReferencesRequest=b.DefinitionRequest=b.SignatureHelpRequest=b.SignatureHelpTriggerKind=b.HoverRequest=b.CompletionResolveRequest=b.CompletionRequest=b.CompletionTriggerKind=b.PublishDiagnosticsNotification=b.WatchKind=b.RelativePattern=b.FileChangeType=b.DidChangeWatchedFilesNotification=b.WillSaveTextDocumentWaitUntilRequest=b.WillSaveTextDocumentNotification=b.TextDocumentSaveReason=b.DidSaveTextDocumentNotification=b.DidCloseTextDocumentNotification=b.DidChangeTextDocumentNotification=b.TextDocumentContentChangeEvent=b.DidOpenTextDocumentNotification=b.TextDocumentSyncKind=b.TelemetryEventNotification=b.LogMessageNotification=b.ShowMessageRequest=b.ShowMessageNotification=b.MessageType=b.DidChangeConfigurationNotification=b.ExitNotification=b.ShutdownRequest=b.InitializedNotification=b.InitializeErrorCodes=b.InitializeRequest=b.WorkDoneProgressOptions=b.TextDocumentRegistrationOptions=b.StaticRegistrationOptions=b.PositionEncodingKind=b.FailureHandlingKind=b.ResourceOperationKind=b.UnregistrationRequest=b.RegistrationRequest=b.DocumentSelector=b.NotebookCellTextDocumentFilter=b.NotebookDocumentFilter=b.TextDocumentFilter=void 0;b.MonikerRequest=b.MonikerKind=b.UniquenessLevel=b.WillDeleteFilesRequest=b.DidDeleteFilesNotification=b.WillRenameFilesRequest=b.DidRenameFilesNotification=b.WillCreateFilesRequest=b.DidCreateFilesNotification=b.FileOperationPatternKind=b.LinkedEditingRangeRequest=b.ShowDocumentRequest=b.SemanticTokensRegistrationType=b.SemanticTokensRefreshRequest=b.SemanticTokensRangeRequest=b.SemanticTokensDeltaRequest=b.SemanticTokensRequest=b.TokenFormat=b.CallHierarchyPrepareRequest=b.CallHierarchyOutgoingCallsRequest=b.CallHierarchyIncomingCallsRequest=b.WorkDoneProgressCancelNotification=b.WorkDoneProgressCreateRequest=b.WorkDoneProgress=b.SelectionRangeRequest=b.DeclarationRequest=b.FoldingRangeRefreshRequest=b.FoldingRangeRequest=b.ColorPresentationRequest=b.DocumentColorRequest=b.ConfigurationRequest=b.DidChangeWorkspaceFoldersNotification=b.WorkspaceFoldersRequest=b.TypeDefinitionRequest=b.ImplementationRequest=b.ApplyWorkspaceEditRequest=b.ExecuteCommandRequest=b.PrepareRenameRequest=b.RenameRequest=b.PrepareSupportDefaultBehavior=b.DocumentOnTypeFormattingRequest=b.DocumentRangesFormattingRequest=b.DocumentRangeFormattingRequest=b.DocumentFormattingRequest=b.DocumentLinkResolveRequest=b.DocumentLinkRequest=b.CodeLensRefreshRequest=b.CodeLensResolveRequest=b.CodeLensRequest=b.WorkspaceSymbolResolveRequest=void 0;b.InlineCompletionRequest=b.DidCloseNotebookDocumentNotification=b.DidSaveNotebookDocumentNotification=b.DidChangeNotebookDocumentNotification=b.NotebookCellArrayChange=b.DidOpenNotebookDocumentNotification=b.NotebookDocumentSyncRegistrationType=b.NotebookDocument=b.NotebookCell=b.ExecutionSummary=b.NotebookCellKind=b.DiagnosticRefreshRequest=b.WorkspaceDiagnosticRequest=b.DocumentDiagnosticRequest=b.DocumentDiagnosticReportKind=b.DiagnosticServerCancellationData=b.InlayHintRefreshRequest=b.InlayHintResolveRequest=b.InlayHintRequest=b.InlineValueRefreshRequest=b.InlineValueRequest=b.TypeHierarchySupertypesRequest=b.TypeHierarchySubtypesRequest=b.TypeHierarchyPrepareRequest=void 0;var W=et(),CT=Wu(),Pt=Gu(),fC=e_();Object.defineProperty(b,"ImplementationRequest",{enumerable:!0,get:function(){return fC.ImplementationRequest}});var pC=r_();Object.defineProperty(b,"TypeDefinitionRequest",{enumerable:!0,get:function(){return pC.TypeDefinitionRequest}});var NS=o_();Object.defineProperty(b,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return NS.WorkspaceFoldersRequest}});Object.defineProperty(b,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return NS.DidChangeWorkspaceFoldersNotification}});var hC=c_();Object.defineProperty(b,"ConfigurationRequest",{enumerable:!0,get:function(){return hC.ConfigurationRequest}});var jS=f_();Object.defineProperty(b,"DocumentColorRequest",{enumerable:!0,get:function(){return jS.DocumentColorRequest}});Object.defineProperty(b,"ColorPresentationRequest",{enumerable:!0,get:function(){return jS.ColorPresentationRequest}});var FS=g_();Object.defineProperty(b,"FoldingRangeRequest",{enumerable:!0,get:function(){return FS.FoldingRangeRequest}});Object.defineProperty(b,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return FS.FoldingRangeRefreshRequest}});var gC=b_();Object.defineProperty(b,"DeclarationRequest",{enumerable:!0,get:function(){return gC.DeclarationRequest}});var mC=T_();Object.defineProperty(b,"SelectionRangeRequest",{enumerable:!0,get:function(){return mC.SelectionRangeRequest}});var Np=w_();Object.defineProperty(b,"WorkDoneProgress",{enumerable:!0,get:function(){return Np.WorkDoneProgress}});Object.defineProperty(b,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Np.WorkDoneProgressCreateRequest}});Object.defineProperty(b,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Np.WorkDoneProgressCancelNotification}});var jp=C_();Object.defineProperty(b,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return jp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(b,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return jp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(b,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return jp.CallHierarchyPrepareRequest}});var qs=L_();Object.defineProperty(b,"TokenFormat",{enumerable:!0,get:function(){return qs.TokenFormat}});Object.defineProperty(b,"SemanticTokensRequest",{enumerable:!0,get:function(){return qs.SemanticTokensRequest}});Object.defineProperty(b,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return qs.SemanticTokensDeltaRequest}});Object.defineProperty(b,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return qs.SemanticTokensRangeRequest}});Object.defineProperty(b,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return qs.SemanticTokensRefreshRequest}});Object.defineProperty(b,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return qs.SemanticTokensRegistrationType}});var yC=j_();Object.defineProperty(b,"ShowDocumentRequest",{enumerable:!0,get:function(){return yC.ShowDocumentRequest}});var bC=B_();Object.defineProperty(b,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return bC.LinkedEditingRangeRequest}});var qi=X_();Object.defineProperty(b,"FileOperationPatternKind",{enumerable:!0,get:function(){return qi.FileOperationPatternKind}});Object.defineProperty(b,"DidCreateFilesNotification",{enumerable:!0,get:function(){return qi.DidCreateFilesNotification}});Object.defineProperty(b,"WillCreateFilesRequest",{enumerable:!0,get:function(){return qi.WillCreateFilesRequest}});Object.defineProperty(b,"DidRenameFilesNotification",{enumerable:!0,get:function(){return qi.DidRenameFilesNotification}});Object.defineProperty(b,"WillRenameFilesRequest",{enumerable:!0,get:function(){return qi.WillRenameFilesRequest}});Object.defineProperty(b,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return qi.DidDeleteFilesNotification}});Object.defineProperty(b,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return qi.WillDeleteFilesRequest}});var Fp=eT();Object.defineProperty(b,"UniquenessLevel",{enumerable:!0,get:function(){return Fp.UniquenessLevel}});Object.defineProperty(b,"MonikerKind",{enumerable:!0,get:function(){return Fp.MonikerKind}});Object.defineProperty(b,"MonikerRequest",{enumerable:!0,get:function(){return Fp.MonikerRequest}});var $p=iT();Object.defineProperty(b,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return $p.TypeHierarchyPrepareRequest}});Object.defineProperty(b,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return $p.TypeHierarchySubtypesRequest}});Object.defineProperty(b,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return $p.TypeHierarchySupertypesRequest}});var $S=aT();Object.defineProperty(b,"InlineValueRequest",{enumerable:!0,get:function(){return $S.InlineValueRequest}});Object.defineProperty(b,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return $S.InlineValueRefreshRequest}});var Bp=dT();Object.defineProperty(b,"InlayHintRequest",{enumerable:!0,get:function(){return Bp.InlayHintRequest}});Object.defineProperty(b,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Bp.InlayHintResolveRequest}});Object.defineProperty(b,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Bp.InlayHintRefreshRequest}});var Ko=bT();Object.defineProperty(b,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ko.DiagnosticServerCancellationData}});Object.defineProperty(b,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ko.DocumentDiagnosticReportKind}});Object.defineProperty(b,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ko.DocumentDiagnosticRequest}});Object.defineProperty(b,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ko.WorkspaceDiagnosticRequest}});Object.defineProperty(b,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ko.DiagnosticRefreshRequest}});var ar=wT();Object.defineProperty(b,"NotebookCellKind",{enumerable:!0,get:function(){return ar.NotebookCellKind}});Object.defineProperty(b,"ExecutionSummary",{enumerable:!0,get:function(){return ar.ExecutionSummary}});Object.defineProperty(b,"NotebookCell",{enumerable:!0,get:function(){return ar.NotebookCell}});Object.defineProperty(b,"NotebookDocument",{enumerable:!0,get:function(){return ar.NotebookDocument}});Object.defineProperty(b,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ar.NotebookDocumentSyncRegistrationType}});Object.defineProperty(b,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ar.DidOpenNotebookDocumentNotification}});Object.defineProperty(b,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ar.NotebookCellArrayChange}});Object.defineProperty(b,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ar.DidChangeNotebookDocumentNotification}});Object.defineProperty(b,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ar.DidSaveNotebookDocumentNotification}});Object.defineProperty(b,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ar.DidCloseNotebookDocumentNotification}});var vC=OT();Object.defineProperty(b,"InlineCompletionRequest",{enumerable:!0,get:function(){return vC.InlineCompletionRequest}});var Ip;(function(t){function e(n){let r=n;return Pt.string(r)||Pt.string(r.language)||Pt.string(r.scheme)||Pt.string(r.pattern)}t.is=e})(Ip||(b.TextDocumentFilter=Ip={}));var Mp;(function(t){function e(n){let r=n;return Pt.objectLiteral(r)&&(Pt.string(r.notebookType)||Pt.string(r.scheme)||Pt.string(r.pattern))}t.is=e})(Mp||(b.NotebookDocumentFilter=Mp={}));var Lp;(function(t){function e(n){let r=n;return Pt.objectLiteral(r)&&(Pt.string(r.notebook)||Mp.is(r.notebook))&&(r.language===void 0||Pt.string(r.language))}t.is=e})(Lp||(b.NotebookCellTextDocumentFilter=Lp={}));var qp;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Pt.string(r)&&!Ip.is(r)&&!Lp.is(r))return!1;return!0}t.is=e})(qp||(b.DocumentSelector=qp={}));var RT;(function(t){t.method="client/registerCapability",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(RT||(b.RegistrationRequest=RT={}));var DT;(function(t){t.method="client/unregisterCapability",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(DT||(b.UnregistrationRequest=DT={}));var PT;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(PT||(b.ResourceOperationKind=PT={}));var IT;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(IT||(b.FailureHandlingKind=IT={}));var MT;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(MT||(b.PositionEncodingKind=MT={}));var LT;(function(t){function e(n){let r=n;return r&&Pt.string(r.id)&&r.id.length>0}t.hasId=e})(LT||(b.StaticRegistrationOptions=LT={}));var qT;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||qp.is(r.documentSelector))}t.is=e})(qT||(b.TextDocumentRegistrationOptions=qT={}));var NT;(function(t){function e(r){let i=r;return Pt.objectLiteral(i)&&(i.workDoneProgress===void 0||Pt.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Pt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(NT||(b.WorkDoneProgressOptions=NT={}));var jT;(function(t){t.method="initialize",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(jT||(b.InitializeRequest=jT={}));var FT;(function(t){t.unknownProtocolVersion=1})(FT||(b.InitializeErrorCodes=FT={}));var $T;(function(t){t.method="initialized",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})($T||(b.InitializedNotification=$T={}));var BT;(function(t){t.method="shutdown",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType0(t.method)})(BT||(b.ShutdownRequest=BT={}));var UT;(function(t){t.method="exit",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType0(t.method)})(UT||(b.ExitNotification=UT={}));var HT;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(HT||(b.DidChangeConfigurationNotification=HT={}));var WT;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(WT||(b.MessageType=WT={}));var GT;(function(t){t.method="window/showMessage",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(GT||(b.ShowMessageNotification=GT={}));var VT;(function(t){t.method="window/showMessageRequest",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(VT||(b.ShowMessageRequest=VT={}));var KT;(function(t){t.method="window/logMessage",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(KT||(b.LogMessageNotification=KT={}));var zT;(function(t){t.method="telemetry/event",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(zT||(b.TelemetryEventNotification=zT={}));var XT;(function(t){t.None=0,t.Full=1,t.Incremental=2})(XT||(b.TextDocumentSyncKind=XT={}));var YT;(function(t){t.method="textDocument/didOpen",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(YT||(b.DidOpenTextDocumentNotification=YT={}));var JT;(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})(JT||(b.TextDocumentContentChangeEvent=JT={}));var QT;(function(t){t.method="textDocument/didChange",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(QT||(b.DidChangeTextDocumentNotification=QT={}));var ZT;(function(t){t.method="textDocument/didClose",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(ZT||(b.DidCloseTextDocumentNotification=ZT={}));var eS;(function(t){t.method="textDocument/didSave",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(eS||(b.DidSaveTextDocumentNotification=eS={}));var tS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(tS||(b.TextDocumentSaveReason=tS={}));var nS;(function(t){t.method="textDocument/willSave",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(nS||(b.WillSaveTextDocumentNotification=nS={}));var rS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(rS||(b.WillSaveTextDocumentWaitUntilRequest=rS={}));var iS;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(iS||(b.DidChangeWatchedFilesNotification=iS={}));var sS;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(sS||(b.FileChangeType=sS={}));var oS;(function(t){function e(n){let r=n;return Pt.objectLiteral(r)&&(CT.URI.is(r.baseUri)||CT.WorkspaceFolder.is(r.baseUri))&&Pt.string(r.pattern)}t.is=e})(oS||(b.RelativePattern=oS={}));var aS;(function(t){t.Create=1,t.Change=2,t.Delete=4})(aS||(b.WatchKind=aS={}));var uS;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(uS||(b.PublishDiagnosticsNotification=uS={}));var cS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(cS||(b.CompletionTriggerKind=cS={}));var lS;(function(t){t.method="textDocument/completion",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(lS||(b.CompletionRequest=lS={}));var dS;(function(t){t.method="completionItem/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(dS||(b.CompletionResolveRequest=dS={}));var fS;(function(t){t.method="textDocument/hover",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(fS||(b.HoverRequest=fS={}));var pS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(pS||(b.SignatureHelpTriggerKind=pS={}));var hS;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(hS||(b.SignatureHelpRequest=hS={}));var gS;(function(t){t.method="textDocument/definition",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(gS||(b.DefinitionRequest=gS={}));var mS;(function(t){t.method="textDocument/references",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(mS||(b.ReferencesRequest=mS={}));var yS;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(yS||(b.DocumentHighlightRequest=yS={}));var bS;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(bS||(b.DocumentSymbolRequest=bS={}));var vS;(function(t){t.method="textDocument/codeAction",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(vS||(b.CodeActionRequest=vS={}));var _S;(function(t){t.method="codeAction/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(_S||(b.CodeActionResolveRequest=_S={}));var TS;(function(t){t.method="workspace/symbol",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(TS||(b.WorkspaceSymbolRequest=TS={}));var SS;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(SS||(b.WorkspaceSymbolResolveRequest=SS={}));var kS;(function(t){t.method="textDocument/codeLens",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(kS||(b.CodeLensRequest=kS={}));var xS;(function(t){t.method="codeLens/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(xS||(b.CodeLensResolveRequest=xS={}));var wS;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType0(t.method)})(wS||(b.CodeLensRefreshRequest=wS={}));var ES;(function(t){t.method="textDocument/documentLink",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(ES||(b.DocumentLinkRequest=ES={}));var AS;(function(t){t.method="documentLink/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(AS||(b.DocumentLinkResolveRequest=AS={}));var OS;(function(t){t.method="textDocument/formatting",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(OS||(b.DocumentFormattingRequest=OS={}));var CS;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(CS||(b.DocumentRangeFormattingRequest=CS={}));var RS;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(RS||(b.DocumentRangesFormattingRequest=RS={}));var DS;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(DS||(b.DocumentOnTypeFormattingRequest=DS={}));var PS;(function(t){t.Identifier=1})(PS||(b.PrepareSupportDefaultBehavior=PS={}));var IS;(function(t){t.method="textDocument/rename",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(IS||(b.RenameRequest=IS={}));var MS;(function(t){t.method="textDocument/prepareRename",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(MS||(b.PrepareRenameRequest=MS={}));var LS;(function(t){t.method="workspace/executeCommand",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(LS||(b.ExecuteCommandRequest=LS={}));var qS;(function(t){t.method="workspace/applyEdit",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType("workspace/applyEdit")})(qS||(b.ApplyWorkspaceEditRequest=qS={}))});var HS=g(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.createProtocolConnection=void 0;var US=Li();function _C(t,e,n,r){return US.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,US.createMessageConnection)(t,e,n,r)}oc.createProtocolConnection=_C});var GS=g(ln=>{"use strict";var TC=ln&&ln.__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]}),ac=ln&&ln.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TC(e,t,n)};Object.defineProperty(ln,"__esModule",{value:!0});ln.LSPErrorCodes=ln.createProtocolConnection=void 0;ac(Li(),ln);ac(Wu(),ln);ac(et(),ln);ac(BS(),ln);var SC=HS();Object.defineProperty(ln,"createProtocolConnection",{enumerable:!0,get:function(){return SC.createProtocolConnection}});var WS;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(WS||(ln.LSPErrorCodes=WS={}))});var gt=g(ur=>{"use strict";var kC=ur&&ur.__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]}),VS=ur&&ur.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&kC(e,t,n)};Object.defineProperty(ur,"__esModule",{value:!0});ur.createProtocolConnection=void 0;var xC=wp();VS(wp(),ur);VS(GS(),ur);function wC(t,e,n,r){return(0,xC.createMessageConnection)(t,e,n,r)}ur.createProtocolConnection=wC});var Up=g(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.generateUuid=On.parse=On.isUUID=On.v4=On.empty=void 0;var zo=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Xo=class t extends zo{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(""))}};Xo._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Xo._timeHighBits=["8","9","a","b"];On.empty=new zo("00000000-0000-0000-0000-000000000000");function KS(){return new Xo}On.v4=KS;var EC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function zS(t){return EC.test(t)}On.isUUID=zS;function AC(t){if(!zS(t))throw new Error("invalid uuid");return new zo(t)}On.parse=AC;function OC(){return KS().asHex()}On.generateUuid=OC});var XS=g(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.attachPartialResult=ri.ProgressFeature=ri.attachWorkDone=void 0;var ni=gt(),CC=Up(),Ni=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(ni.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(ni.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(ni.WorkDoneProgress.type,this._token,{kind:"end"})}};Ni.Instances=new Map;var uc=class extends Ni{constructor(e,n){super(e,n),this._source=new ni.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Yo=class{constructor(){}begin(){}report(){}done(){}},cc=class extends Yo{constructor(){super(),this._source=new ni.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function RC(t,e){if(e===void 0||e.workDoneToken===void 0)return new Yo;let n=e.workDoneToken;return delete e.workDoneToken,new Ni(t,n)}ri.attachWorkDone=RC;var DC=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ni.WorkDoneProgressCancelNotification.type,n=>{let r=Ni.Instances.get(n.token);(r instanceof uc||r instanceof cc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Yo:new Ni(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,CC.generateUuid)();return this.connection.sendRequest(ni.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new uc(this.connection,e))}else return Promise.resolve(new cc)}};ri.ProgressFeature=DC;var Hp;(function(t){t.type=new ni.ProgressType})(Hp||(Hp={}));var Wp=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Hp.type,this._token,e)}};function PC(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Wp(t,n)}ri.attachPartialResult=PC});var YS=g(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.ConfigurationFeature=void 0;var IC=gt(),MC=Tu(),LC=t=>class extends t{getConfiguration(e){return e?MC.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(IC.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};lc.ConfigurationFeature=LC});var JS=g(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.WorkspaceFoldersFeature=void 0;var dc=gt(),qC=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new dc.Emitter,this.connection.onNotification(dc.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(dc.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(dc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};fc.WorkspaceFoldersFeature=qC});var QS=g(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.CallHierarchyFeature=void 0;var Gp=gt(),NC=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Gp.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Gp.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Gp.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};pc.CallHierarchyFeature=NC});var Kp=g(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.SemanticTokensBuilder=ii.SemanticTokensDiff=ii.SemanticTokensFeature=void 0;var hc=gt(),jC=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(hc.SemanticTokensRefreshRequest.type),on:e=>{let n=hc.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=hc.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=hc.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ii.SemanticTokensFeature=jC;var gc=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}]:[]}};ii.SemanticTokensDiff=gc;var Vp=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 gc(this._prevData,this._data).computeDiff()}:this.build()}};ii.SemanticTokensBuilder=Vp});var ZS=g(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.ShowDocumentFeature=void 0;var FC=gt(),$C=t=>class extends t{showDocument(e){return this.connection.sendRequest(FC.ShowDocumentRequest.type,e)}};mc.ShowDocumentFeature=$C});var ek=g(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.FileOperationsFeature=void 0;var Ns=gt(),BC=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ns.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Ns.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Ns.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Ns.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Ns.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Ns.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};yc.FileOperationsFeature=BC});var tk=g(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.LinkedEditingRangeFeature=void 0;var UC=gt(),HC=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(UC.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};bc.LinkedEditingRangeFeature=HC});var nk=g(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.TypeHierarchyFeature=void 0;var zp=gt(),WC=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(zp.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=zp.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=zp.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};vc.TypeHierarchyFeature=WC});var ik=g(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.InlineValueFeature=void 0;var rk=gt(),GC=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(rk.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(rk.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};_c.InlineValueFeature=GC});var ok=g(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.FoldingRangeFeature=void 0;var sk=gt(),VC=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(sk.FoldingRangeRefreshRequest.type),on:e=>{let n=sk.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Tc.FoldingRangeFeature=VC});var ak=g(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.InlayHintFeature=void 0;var Xp=gt(),KC=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Xp.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Xp.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(Xp.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Sc.InlayHintFeature=KC});var uk=g(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.DiagnosticFeature=void 0;var Jo=gt(),zC=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Jo.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Jo.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Jo.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Jo.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Jo.WorkspaceDiagnosticRequest.partialResult,n)))}}};kc.DiagnosticFeature=zC});var Jp=g(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.TextDocuments=void 0;var ji=gt(),Yp=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ji.Emitter,this._onDidOpen=new ji.Emitter,this._onDidClose=new ji.Emitter,this._onDidSave=new ji.Emitter,this._onWillSave=new ji.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=ji.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}))})),ji.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};xc.TextDocuments=Yp});var Zp=g(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.NotebookDocuments=js.NotebookSyncFeature=void 0;var Cn=gt(),ck=Jp(),XC=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Cn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Cn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Cn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Cn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};js.NotebookSyncFeature=XC;var wc=class t{onDidOpenTextDocument(e){return this.openHandler=e,Cn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Cn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Cn.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}};wc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Qp=class{constructor(e){e instanceof ck.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ck.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Cn.Emitter,this._onDidChange=new Cn.Emitter,this._onDidSave=new Cn.Emitter,this._onDidClose=new Cn.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 wc,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=[],d=[],p=[];if(u.cells!==void 0){let M=u.cells;if(M.structure!==void 0){let x=M.structure.array;if(s.cells.splice(x.start,x.deleteCount,...x.cells!==void 0?x.cells:[]),M.structure.didOpen!==void 0)for(let k of M.structure.didOpen)n.openTextDocument({textDocument:k}),c.push(k.uri);if(M.structure.didClose)for(let k of M.structure.didClose)n.closeTextDocument({textDocument:k}),l.push(k.uri)}if(M.data!==void 0){let x=new Map(M.data.map(k=>[k.document,k]));for(let k=0;k<=s.cells.length;k++){let v=x.get(s.cells[k].document);if(v!==void 0){let F=s.cells.splice(k,1,v);if(d.push({old:F[0],new:v}),x.delete(v.document),x.size===0)break}}}if(M.textContent!==void 0)for(let x of M.textContent)n.changeTextDocument({textDocument:x.document,contentChanges:x.changes}),p.push(x.document.uri)}this.updateCellMap(s);let y={notebookDocument:s};a&&(y.metadata={old:o,new:s.metadata});let _=[];for(let M of c)_.push(this.getNotebookCell(M));let E=[];for(let M of l)E.push(this.getNotebookCell(M));let L=[];for(let M of p)L.push(this.getNotebookCell(M));(_.length>0||E.length>0||d.length>0||L.length>0)&&(y.cells={added:_,removed:E,changed:{data:d,textContent:L}}),(y.metadata!==void 0||y.cells!==void 0)&&this._onDidChange.fire(y)})),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)}})),Cn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};js.NotebookDocuments=Qp});var lk=g(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.MonikerFeature=void 0;var YC=gt(),JC=t=>class extends t{get moniker(){return{on:e=>{let n=YC.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ec.MonikerFeature=JC});var sh=g(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.createConnection=Re.combineFeatures=Re.combineNotebooksFeatures=Re.combineLanguagesFeatures=Re.combineWorkspaceFeatures=Re.combineWindowFeatures=Re.combineClientFeatures=Re.combineTracerFeatures=Re.combineTelemetryFeatures=Re.combineConsoleFeatures=Re._NotebooksImpl=Re._LanguagesImpl=Re.BulkUnregistration=Re.BulkRegistration=Re.ErrorMessageTracker=void 0;var z=gt(),Rn=Tu(),th=Up(),pe=XS(),QC=YS(),ZC=JS(),e1=QS(),t1=Kp(),n1=ZS(),r1=ek(),i1=tk(),s1=nk(),o1=ik(),a1=ok(),u1=ak(),c1=uk(),l1=Zp(),d1=lk();function eh(t){if(t!==null)return t}var nh=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)})}};Re.ErrorMessageTracker=nh;var Ac=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(z.MessageType.Error,e)}warn(e){this.send(z.MessageType.Warning,e)}info(e){this.send(z.MessageType.Info,e)}log(e){this.send(z.MessageType.Log,e)}debug(e){this.send(z.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(z.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,z.RAL)().console.error("Sending log message failed")})}},rh=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:z.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eh)}showWarningMessage(e,...n){let r={type:z.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eh)}showInformationMessage(e,...n){let r={type:z.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eh)}},dk=(0,n1.ShowDocumentFeature)((0,pe.ProgressFeature)(rh)),fk;(function(t){function e(){return new Oc}t.create=e})(fk||(Re.BulkRegistration=fk={}));var Oc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Rn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=th.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},pk;(function(t){function e(){return new Qo(void 0,[])}t.create=e})(pk||(Re.BulkUnregistration=pk={}));var Qo=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(z.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Rn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(z.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Cc=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 Oc?this.registerMany(e):e instanceof Qo?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=Rn.string(n)?n:n.method,s=th.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(z.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=Rn.string(e)?e:e.method,i=th.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(z.RegistrationRequest.type,s).then(o=>z.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(z.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(z.RegistrationRequest.type,n).then(()=>new Qo(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},ih=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(z.ApplyWorkspaceEditRequest.type,r)}},hk=(0,r1.FileOperationsFeature)((0,ZC.WorkspaceFoldersFeature)((0,QC.ConfigurationFeature)(ih))),Rc=class{constructor(){this._trace=z.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!==z.Trace.Off&&this.connection.sendNotification(z.LogTraceNotification.type,{message:e,verbose:this._trace===z.Trace.Verbose?n:void 0}).catch(()=>{})}},Dc=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(z.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Pc=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,pe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,pe.attachPartialResult)(this.connection,n)}};Re._LanguagesImpl=Pc;var gk=(0,a1.FoldingRangeFeature)((0,d1.MonikerFeature)((0,c1.DiagnosticFeature)((0,u1.InlayHintFeature)((0,o1.InlineValueFeature)((0,s1.TypeHierarchyFeature)((0,i1.LinkedEditingRangeFeature)((0,t1.SemanticTokensFeature)((0,e1.CallHierarchyFeature)(Pc))))))))),Ic=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,pe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,pe.attachPartialResult)(this.connection,n)}};Re._NotebooksImpl=Ic;var mk=(0,l1.NotebookSyncFeature)(Ic);function yk(t,e){return function(n){return e(t(n))}}Re.combineConsoleFeatures=yk;function bk(t,e){return function(n){return e(t(n))}}Re.combineTelemetryFeatures=bk;function vk(t,e){return function(n){return e(t(n))}}Re.combineTracerFeatures=vk;function _k(t,e){return function(n){return e(t(n))}}Re.combineClientFeatures=_k;function Tk(t,e){return function(n){return e(t(n))}}Re.combineWindowFeatures=Tk;function Sk(t,e){return function(n){return e(t(n))}}Re.combineWorkspaceFeatures=Sk;function kk(t,e){return function(n){return e(t(n))}}Re.combineLanguagesFeatures=kk;function xk(t,e){return function(n){return e(t(n))}}Re.combineNotebooksFeatures=xk;function f1(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,yk),tracer:n(t.tracer,e.tracer,vk),telemetry:n(t.telemetry,e.telemetry,bk),client:n(t.client,e.client,_k),window:n(t.window,e.window,Tk),workspace:n(t.workspace,e.workspace,Sk),languages:n(t.languages,e.languages,kk),notebooks:n(t.notebooks,e.notebooks,xk)}}Re.combineFeatures=f1;function p1(t,e,n){let r=n&&n.console?new(n.console(Ac)):new Ac,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Rc)):new Rc,o=n&&n.telemetry?new(n.telemetry(Dc)):new Dc,a=n&&n.client?new(n.client(Cc)):new Cc,u=n&&n.window?new(n.window(dk)):new dk,c=n&&n.workspace?new(n.workspace(hk)):new hk,l=n&&n.languages?new(n.languages(gk)):new gk,d=n&&n.notebooks?new(n.notebooks(mk)):new mk,p=[r,s,o,a,u,c,l,d];function y(x){return x instanceof Promise?x:Rn.thenable(x)?new Promise((k,v)=>{x.then(F=>k(F),F=>v(F))}):Promise.resolve(x)}let _,E,L,M={listen:()=>i.listen(),sendRequest:(x,...k)=>i.sendRequest(Rn.string(x)?x:x.method,...k),onRequest:(x,k)=>i.onRequest(x,k),sendNotification:(x,k)=>{let v=Rn.string(x)?x:x.method;return i.sendNotification(v,k)},onNotification:(x,k)=>i.onNotification(x,k),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:x=>(E=x,{dispose:()=>{E=void 0}}),onInitialized:x=>i.onNotification(z.InitializedNotification.type,x),onShutdown:x=>(_=x,{dispose:()=>{_=void 0}}),onExit:x=>(L=x,{dispose:()=>{L=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 d},onDidChangeConfiguration:x=>i.onNotification(z.DidChangeConfigurationNotification.type,x),onDidChangeWatchedFiles:x=>i.onNotification(z.DidChangeWatchedFilesNotification.type,x),__textDocumentSync:void 0,onDidOpenTextDocument:x=>i.onNotification(z.DidOpenTextDocumentNotification.type,x),onDidChangeTextDocument:x=>i.onNotification(z.DidChangeTextDocumentNotification.type,x),onDidCloseTextDocument:x=>i.onNotification(z.DidCloseTextDocumentNotification.type,x),onWillSaveTextDocument:x=>i.onNotification(z.WillSaveTextDocumentNotification.type,x),onWillSaveTextDocumentWaitUntil:x=>i.onRequest(z.WillSaveTextDocumentWaitUntilRequest.type,x),onDidSaveTextDocument:x=>i.onNotification(z.DidSaveTextDocumentNotification.type,x),sendDiagnostics:x=>i.sendNotification(z.PublishDiagnosticsNotification.type,x),onHover:x=>i.onRequest(z.HoverRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),void 0)),onCompletion:x=>i.onRequest(z.CompletionRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onCompletionResolve:x=>i.onRequest(z.CompletionResolveRequest.type,x),onSignatureHelp:x=>i.onRequest(z.SignatureHelpRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),void 0)),onDeclaration:x=>i.onRequest(z.DeclarationRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onDefinition:x=>i.onRequest(z.DefinitionRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onTypeDefinition:x=>i.onRequest(z.TypeDefinitionRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onImplementation:x=>i.onRequest(z.ImplementationRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onReferences:x=>i.onRequest(z.ReferencesRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onDocumentHighlight:x=>i.onRequest(z.DocumentHighlightRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onDocumentSymbol:x=>i.onRequest(z.DocumentSymbolRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onWorkspaceSymbol:x=>i.onRequest(z.WorkspaceSymbolRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onWorkspaceSymbolResolve:x=>i.onRequest(z.WorkspaceSymbolResolveRequest.type,x),onCodeAction:x=>i.onRequest(z.CodeActionRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onCodeActionResolve:x=>i.onRequest(z.CodeActionResolveRequest.type,(k,v)=>x(k,v)),onCodeLens:x=>i.onRequest(z.CodeLensRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onCodeLensResolve:x=>i.onRequest(z.CodeLensResolveRequest.type,(k,v)=>x(k,v)),onDocumentFormatting:x=>i.onRequest(z.DocumentFormattingRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),void 0)),onDocumentRangeFormatting:x=>i.onRequest(z.DocumentRangeFormattingRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),void 0)),onDocumentOnTypeFormatting:x=>i.onRequest(z.DocumentOnTypeFormattingRequest.type,(k,v)=>x(k,v)),onRenameRequest:x=>i.onRequest(z.RenameRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),void 0)),onPrepareRename:x=>i.onRequest(z.PrepareRenameRequest.type,(k,v)=>x(k,v)),onDocumentLinks:x=>i.onRequest(z.DocumentLinkRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onDocumentLinkResolve:x=>i.onRequest(z.DocumentLinkResolveRequest.type,(k,v)=>x(k,v)),onDocumentColor:x=>i.onRequest(z.DocumentColorRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onColorPresentation:x=>i.onRequest(z.ColorPresentationRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onFoldingRanges:x=>i.onRequest(z.FoldingRangeRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onSelectionRanges:x=>i.onRequest(z.SelectionRangeRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),(0,pe.attachPartialResult)(i,k))),onExecuteCommand:x=>i.onRequest(z.ExecuteCommandRequest.type,(k,v)=>x(k,v,(0,pe.attachWorkDone)(i,k),void 0)),dispose:()=>i.dispose()};for(let x of p)x.attach(M);return i.onRequest(z.InitializeRequest.type,x=>{e.initialize(x),Rn.string(x.trace)&&(s.trace=z.Trace.fromString(x.trace));for(let k of p)k.initialize(x.capabilities);if(E){let k=E(x,new z.CancellationTokenSource().token,(0,pe.attachWorkDone)(i,x),void 0);return y(k).then(v=>{if(v instanceof z.ResponseError)return v;let F=v;F||(F={capabilities:{}});let C=F.capabilities;C||(C={},F.capabilities=C),C.textDocumentSync===void 0||C.textDocumentSync===null?C.textDocumentSync=Rn.number(M.__textDocumentSync)?M.__textDocumentSync:z.TextDocumentSyncKind.None:!Rn.number(C.textDocumentSync)&&!Rn.number(C.textDocumentSync.change)&&(C.textDocumentSync.change=Rn.number(M.__textDocumentSync)?M.__textDocumentSync:z.TextDocumentSyncKind.None);for(let V of p)V.fillServerCapabilities(C);return F})}else{let k={capabilities:{textDocumentSync:z.TextDocumentSyncKind.None}};for(let v of p)v.fillServerCapabilities(k.capabilities);return k}}),i.onRequest(z.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,_)return _(new z.CancellationTokenSource().token)}),i.onNotification(z.ExitNotification.type,()=>{try{L&&L()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(z.SetTraceNotification.type,x=>{s.trace=z.Trace.fromString(x.value)}),M}Re.createConnection=p1});var wk=g(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.resolveModulePath=dn.FileSystem=dn.resolveGlobalYarnPath=dn.resolveGlobalNodePath=dn.resolve=dn.uriToFilePath=void 0;var h1=require("url"),Xn=require("path"),oh=require("fs"),lh=require("child_process");function g1(t){let e=h1.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 Xn.normalize(n.join("/"))}dn.uriToFilePath=g1;function ah(){return process.platform==="win32"}function Mc(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&&oh.existsSync(e)&&(c[i]?c[i]=e+Xn.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,lh.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",p=>{a(p)}),l.on("message",p=>{p.c==="r"&&(l.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${t}`)))});let d={c:"rs",a:t};l.send(d)}catch(l){a(l)}})}dn.resolve=Mc;function uh(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};ah()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,lh.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?ah()?Xn.join(o,"node_modules"):Xn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}dn.resolveGlobalNodePath=uh;function m1(t){let e="yarn",n={encoding:"utf8"};ah()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,lh.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 Xn.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}dn.resolveGlobalYarnPath=m1;var ch;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!oh.existsSync(__filename.toUpperCase())||!oh.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Xn.normalize(s).indexOf(Xn.normalize(i))===0:Xn.normalize(s).toLowerCase().indexOf(Xn.normalize(i).toLowerCase())===0}t.isParent=r})(ch||(dn.FileSystem=ch={}));function y1(t,e,n,r){return n?(Xn.isAbsolute(n)||(n=Xn.join(t,n)),Mc(e,n,n,r).then(i=>ch.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Mc(e,uh(r),t,r))):Mc(e,uh(r),t,r)}dn.resolveModulePath=y1});var dh=g((Z$,Ek)=>{"use strict";Ek.exports=gt()});var Ak=g(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.InlineCompletionFeature=void 0;var b1=gt(),v1=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(b1.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Lc.InlineCompletionFeature=v1});var Rk=g(Gt=>{"use strict";var _1=Gt&&Gt.__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]}),Ck=Gt&&Gt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&_1(e,t,n)};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ProposedFeatures=Gt.NotebookDocuments=Gt.TextDocuments=Gt.SemanticTokensBuilder=void 0;var T1=Kp();Object.defineProperty(Gt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return T1.SemanticTokensBuilder}});var S1=Ak();Ck(gt(),Gt);var k1=Jp();Object.defineProperty(Gt,"TextDocuments",{enumerable:!0,get:function(){return k1.TextDocuments}});var x1=Zp();Object.defineProperty(Gt,"NotebookDocuments",{enumerable:!0,get:function(){return x1.NotebookDocuments}});Ck(sh(),Gt);var Ok;(function(t){t.all={__brand:"features",languages:S1.InlineCompletionFeature}})(Ok||(Gt.ProposedFeatures=Ok={}))});var qk=g(Dn=>{"use strict";var w1=Dn&&Dn.__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]}),Mk=Dn&&Dn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&w1(e,t,n)};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.createConnection=Dn.Files=void 0;var Dk=require("node:util"),fh=Tu(),E1=sh(),Zo=wk(),Fi=dh();Mk(dh(),Dn);Mk(Rk(),Dn);var Pk;(function(t){t.uriToFilePath=Zo.uriToFilePath,t.resolveGlobalNodePath=Zo.resolveGlobalNodePath,t.resolveGlobalYarnPath=Zo.resolveGlobalYarnPath,t.resolve=Zo.resolve,t.resolveModulePath=Zo.resolveModulePath})(Pk||(Dn.Files=Pk={}));var Ik;function qc(){if(Ik!==void 0)try{Ik.end()}catch{}}var Fs=!1,Lk;function A1(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Lk=setInterval(()=>{try{process.kill(r,0)}catch{qc(),process.exit(Fs?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])}}}A1();var O1={initialize:t=>{let e=t.processId;fh.number(e)&&Lk===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Fs?0:1)}},3e3)},get shutdownReceived(){return Fs},set shutdownReceived(t){Fs=t},exit:t=>{qc(),process.exit(t)}};function C1(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Fi.ConnectionStrategy.is(t)||Fi.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),R1(s,o,a,i)}Dn.createConnection=C1;function R1(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let d=0;d<l.length;d++){let p=l[d];if(p==="--node-ipc"){t=new Fi.IPCMessageReader(process),e=new Fi.IPCMessageWriter(process);break}else if(p==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(p==="--socket"){u=parseInt(l[d+1]);break}else if(p==="--pipe"){c=l[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let d=(0,Fi.createServerSocketTransport)(u);t=d[0],e=d[1]}else if(c){let d=(0,Fi.createServerPipeTransport)(c);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(fh.func(t.read)&&fh.func(t.on)){let u=t;u.on("end",()=>{qc(),process.exit(Fs?0:1)}),u.on("close",()=>{qc(),process.exit(Fs?0:1)})}let a=u=>{let c=(0,Fi.createProtocolConnection)(t,e,u,n);return i&&D1(u),c};return(0,E1.createConnection)(a,O1,r)}function D1(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,Dk.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,Dk.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 ph=g((i2,Nk)=>{"use strict";Nk.exports=qk()});var $s=g(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.IndentationType=Rr.ConfigurationNamespace=Rr.LanguageId=void 0;Rr.LanguageId="miniscript";Rr.ConfigurationNamespace="miniscript";var P1;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(P1=Rr.IndentationType||(Rr.IndentationType={}))});var ea=g(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.Position=void 0;var hh=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};Nc.Position=hh});var si=g(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.LiteralToken=vn.Token=vn.BaseToken=vn.BaseTokenOptions=vn.TokenType=void 0;var jk=ea(),I1;(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"})(I1=vn.TokenType||(vn.TokenType={}));var gh=class{};vn.BaseTokenOptions=gh;var ta=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 jk.Position(this.line,r[0]-n[0]+1),this.end=new jk.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}']`}};vn.BaseToken=ta;var mh=class extends ta{};vn.Token=mh;var yh=class extends ta{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}]`}};vn.LiteralToken=yh});var jc=g(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.CharacterCode=void 0;var M1;(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"})(M1=na.CharacterCode||(na.CharacterCode={}))});var Bs=g(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.Keyword=void 0;var L1;(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"})(L1=ra.Keyword||(ra.Keyword={}))});var _h=g(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var Pn=jc(),q1=Bs(),bh=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(q1.Keyword)))}isWhitespace(e){return Pn.CharacterCode.WHITESPACE===e||Pn.CharacterCode.TAB===e}isEndOfLine(e){return Pn.CharacterCode.NEW_LINE===e||Pn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Pn.CharacterCode.SLASH===e&&Pn.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>=Pn.CharacterCode.NUMBER_0&&e<=Pn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Pn.CharacterCode.RETURN_LINE:return Pn.CharacterCode.NEW_LINE===n;case Pn.CharacterCode.NEW_LINE:return Pn.CharacterCode.RETURN_LINE===n}return!1}};vh.default=bh});var Fc=g(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.ParserException=Us.LexerException=void 0;var Th=class extends Error{constructor(e,n){super(e),this.range=n}};Us.LexerException=Th;var Sh=class extends Error{constructor(e,n){super(e),this.range=n}};Us.ParserException=Sh});var kh=g(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.Literal=void 0;var N1;(function(t){t.True="true",t.False="false",t.Null="null"})(N1=ia.Literal||(ia.Literal={}))});var Hs=g(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.Operator=void 0;var j1;(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"})(j1=sa.Operator||(sa.Operator={}))});var oa=g($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.Range=void 0;var xh=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};$c.Range=xh});var Ah=g(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var wh=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}};Eh.default=wh});var Rh=g(ua=>{"use strict";var $k=ua&&ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ua,"__esModule",{value:!0});var tt=si(),F1=$k(_h()),be=jc(),$1=Fc(),Oh=Bs(),aa=kh(),nt=Hs(),Ws=ea(),Ch=oa(),Fk=$k(Ah());function oi(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Bc=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 F1.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new Fk.default,r.snapshot=new Fk.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 tt.Token({type:tt.TokenType.EOL,value:nt.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 tt.Token({type:tt.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 tt.Token({type:tt.TokenType.EOF,value:nt.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 tt.LiteralToken({type:tt.TokenType.BooleanLiteral,value:e===aa.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 tt.LiteralToken({type:tt.TokenType.NilLiteral,value:null,raw:aa.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 tt.Token({type:tt.TokenType.SliceOperator,value:nt.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 tt.Token({type:tt.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 tt.LiteralToken({type:tt.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 y=n.codeAt();if(n.validator.isEndOfLine(y))r.isWinNewline(y,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(be.CharacterCode.QUOTE===y){if(be.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Ch.Range(new Ws.Position(i,o-a+1),new Ws.Position(n.line,n.index-u+2)));n.index++;let l=n.content.slice(n.tokenStart,n.index),d=l.slice(1,-1).replace(/""/g,nt.Operator.Escape),p=new tt.LiteralToken({type:tt.TokenType.StringLiteral,value:d,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(p),p}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 tt.Token({type:tt.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)||be.CharacterCode.DOT===i||be.CharacterCode.LETTER_E===i||be.CharacterCode.LETTER_e===i||(be.CharacterCode.MINUS===i||be.CharacterCode.PLUS===i)&&(be.CharacterCode.LETTER_E===r||be.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 Ch.Range(new Ws.Position(this.line,this.tokenStart-this.offset+1),new Ws.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 Oh.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Oh.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Oh.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new tt.Token({type:tt.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 aa.Literal.True:case aa.Literal.False:return n.createBoolean(i,e);case aa.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 Ch.Range(new Ws.Position(s,e.tokenStart-e.offset+1),new Ws.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 $1.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new tt.Token({type:tt.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};ua.default=Bc;Bc.scanHandlers={[be.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[be.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(nt.Operator.Member,e))},[be.CharacterCode.EQUAL]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.Equal,e):this.scanPunctuator(nt.Operator.Assign,e)},[be.CharacterCode.ARROW_LEFT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.LessThanOrEqual,e):this.scanPunctuator(nt.Operator.LessThan,e)},[be.CharacterCode.ARROW_RIGHT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.GreaterThanOrEqual,e):this.scanPunctuator(nt.Operator.GreaterThan,e)},[be.CharacterCode.EXCLAMATION_MARK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.NotEqual,e):(this.index++,null)},[be.CharacterCode.MINUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.SubtractShorthand,e):this.scanPunctuator(nt.Operator.Minus,e)},[be.CharacterCode.PLUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.AddShorthand,e):this.scanPunctuator(nt.Operator.Plus,e)},[be.CharacterCode.ASTERISK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.MultiplyShorthand,e):this.scanPunctuator(nt.Operator.Asterik,e)},[be.CharacterCode.SLASH]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.DivideShorthand,e):this.scanPunctuator(nt.Operator.Slash,e)},[be.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[be.CharacterCode.CARET]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.PowerShorthand,e):this.scanPunctuator(nt.Operator.Power,e)},[be.CharacterCode.PERCENT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(nt.Operator.ModuloShorthand,e):this.scanPunctuator(nt.Operator.Modulo,e)},[be.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[be.CharacterCode.COMMA]:oi,[be.CharacterCode.CURLY_BRACKET_LEFT]:oi,[be.CharacterCode.CURLY_BRACKET_RIGHT]:oi,[be.CharacterCode.SQUARE_BRACKETS_LEFT]:oi,[be.CharacterCode.SQUARE_BRACKETS_RIGHT]:oi,[be.CharacterCode.PARENTHESIS_LEFT]:oi,[be.CharacterCode.PARENTHESIS_RIGHT]:oi,[be.CharacterCode.AT_SIGN]:oi}});var ct=g(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.ASTComment=_n.ASTBaseBlockWithScope=_n.ASTBaseBlock=_n.ASTBase=_n.ASTType=void 0;var Bk;(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"})(Bk=_n.ASTType||(_n.ASTType={}));var ca=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})}};_n.ASTBase=ca;var Uc=class t extends ca{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
35
+ `&&f++}m&&w.length>0&&S.push(w.length),this._lineOffsets=S}return this._lineOffsets},h.prototype.positionAt=function(S){S=Math.max(Math.min(S,this._content.length),0);var w=this.getLineOffsets(),m=0,f=w.length;if(f===0)return o.create(0,S);for(;m<f;){var R=Math.floor((m+f)/2);w[R]>S?f=R:m=R+1}var U=m-1;return o.create(U,S-w[U])},h.prototype.offsetAt=function(S){var w=this.getLineOffsets();if(S.line>=w.length)return this._content.length;if(S.line<0)return 0;var m=w[S.line],f=S.line+1<w.length?w[S.line+1]:this._content.length;return Math.max(Math.min(m+S.character,f),m)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),P;(function(h){var S=Object.prototype.toString;function w(Ee){return typeof Ee<"u"}h.defined=w;function m(Ee){return typeof Ee>"u"}h.undefined=m;function f(Ee){return Ee===!0||Ee===!1}h.boolean=f;function R(Ee){return S.call(Ee)==="[object String]"}h.string=R;function U(Ee){return S.call(Ee)==="[object Number]"}h.number=U;function be(Ee,Ts,ku){return S.call(Ee)==="[object Number]"&&Ts<=Ee&&Ee<=ku}h.numberRange=be;function ct(Ee){return S.call(Ee)==="[object Number]"&&-2147483648<=Ee&&Ee<=2147483647}h.integer=ct;function Ke(Ee){return S.call(Ee)==="[object Number]"&&0<=Ee&&Ee<=2147483647}h.uinteger=Ke;function Xn(Ee){return S.call(Ee)==="[object Function]"}h.func=Xn;function Yn(Ee){return Ee!==null&&typeof Ee=="object"}h.objectLiteral=Yn;function Ir(Ee,Ts){return Array.isArray(Ee)&&Ee.every(Ts)}h.typedArray=Ir})(P||(P={}))})});var nt=g(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.ProtocolNotificationType=dn.ProtocolNotificationType0=dn.ProtocolRequestType=dn.ProtocolRequestType0=dn.RegistrationType=dn.MessageDirection=void 0;var Rs=Fi(),u_;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(u_||(dn.MessageDirection=u_={}));var Ip=class{constructor(e){this.method=e}};dn.RegistrationType=Ip;var Mp=class extends Rs.RequestType0{constructor(e){super(e)}};dn.ProtocolRequestType0=Mp;var Lp=class extends Rs.RequestType{constructor(e){super(e,Rs.ParameterStructures.byName)}};dn.ProtocolRequestType=Lp;var Np=class extends Rs.NotificationType0{constructor(e){super(e)}};dn.ProtocolNotificationType0=Np;var qp=class extends Rs.NotificationType{constructor(e){super(e,Rs.ParameterStructures.byName)}};dn.ProtocolNotificationType=qp});var zu=g(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.objectLiteral=kt.typedArray=kt.stringArray=kt.array=kt.func=kt.error=kt.number=kt.string=kt.boolean=void 0;function mO(t){return t===!0||t===!1}kt.boolean=mO;function c_(t){return typeof t=="string"||t instanceof String}kt.string=c_;function yO(t){return typeof t=="number"||t instanceof Number}kt.number=yO;function bO(t){return t instanceof Error}kt.error=bO;function vO(t){return typeof t=="function"}kt.func=vO;function l_(t){return Array.isArray(t)}kt.array=l_;function _O(t){return l_(t)&&t.every(e=>c_(e))}kt.stringArray=_O;function TO(t,e){return Array.isArray(t)&&t.every(e)}kt.typedArray=TO;function SO(t){return t!==null&&typeof t=="object"}kt.objectLiteral=SO});var p_=g(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.ImplementationRequest=void 0;var d_=nt(),f_;(function(t){t.method="textDocument/implementation",t.messageDirection=d_.MessageDirection.clientToServer,t.type=new d_.ProtocolRequestType(t.method)})(f_||(Xu.ImplementationRequest=f_={}))});var m_=g(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.TypeDefinitionRequest=void 0;var h_=nt(),g_;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=h_.MessageDirection.clientToServer,t.type=new h_.ProtocolRequestType(t.method)})(g_||(Yu.TypeDefinitionRequest=g_={}))});var v_=g(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.DidChangeWorkspaceFoldersNotification=Ps.WorkspaceFoldersRequest=void 0;var Ju=nt(),y_;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Ju.MessageDirection.serverToClient,t.type=new Ju.ProtocolRequestType0(t.method)})(y_||(Ps.WorkspaceFoldersRequest=y_={}));var b_;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Ju.MessageDirection.clientToServer,t.type=new Ju.ProtocolNotificationType(t.method)})(b_||(Ps.DidChangeWorkspaceFoldersNotification=b_={}))});var S_=g(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.ConfigurationRequest=void 0;var __=nt(),T_;(function(t){t.method="workspace/configuration",t.messageDirection=__.MessageDirection.serverToClient,t.type=new __.ProtocolRequestType(t.method)})(T_||(Qu.ConfigurationRequest=T_={}))});var w_=g(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.ColorPresentationRequest=Ds.DocumentColorRequest=void 0;var Zu=nt(),k_;(function(t){t.method="textDocument/documentColor",t.messageDirection=Zu.MessageDirection.clientToServer,t.type=new Zu.ProtocolRequestType(t.method)})(k_||(Ds.DocumentColorRequest=k_={}));var x_;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Zu.MessageDirection.clientToServer,t.type=new Zu.ProtocolRequestType(t.method)})(x_||(Ds.ColorPresentationRequest=x_={}))});var O_=g(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.FoldingRangeRefreshRequest=Is.FoldingRangeRequest=void 0;var ec=nt(),E_;(function(t){t.method="textDocument/foldingRange",t.messageDirection=ec.MessageDirection.clientToServer,t.type=new ec.ProtocolRequestType(t.method)})(E_||(Is.FoldingRangeRequest=E_={}));var A_;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=ec.MessageDirection.serverToClient,t.type=new ec.ProtocolRequestType0(t.method)})(A_||(Is.FoldingRangeRefreshRequest=A_={}))});var P_=g(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.DeclarationRequest=void 0;var C_=nt(),R_;(function(t){t.method="textDocument/declaration",t.messageDirection=C_.MessageDirection.clientToServer,t.type=new C_.ProtocolRequestType(t.method)})(R_||(tc.DeclarationRequest=R_={}))});var M_=g(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.SelectionRangeRequest=void 0;var D_=nt(),I_;(function(t){t.method="textDocument/selectionRange",t.messageDirection=D_.MessageDirection.clientToServer,t.type=new D_.ProtocolRequestType(t.method)})(I_||(nc.SelectionRangeRequest=I_={}))});var j_=g(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.WorkDoneProgressCancelNotification=ti.WorkDoneProgressCreateRequest=ti.WorkDoneProgress=void 0;var kO=Fi(),rc=nt(),L_;(function(t){t.type=new kO.ProgressType;function e(n){return n===t.type}t.is=e})(L_||(ti.WorkDoneProgress=L_={}));var N_;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=rc.MessageDirection.serverToClient,t.type=new rc.ProtocolRequestType(t.method)})(N_||(ti.WorkDoneProgressCreateRequest=N_={}));var q_;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=rc.MessageDirection.clientToServer,t.type=new rc.ProtocolNotificationType(t.method)})(q_||(ti.WorkDoneProgressCancelNotification=q_={}))});var U_=g(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.CallHierarchyOutgoingCallsRequest=ni.CallHierarchyIncomingCallsRequest=ni.CallHierarchyPrepareRequest=void 0;var Ms=nt(),F_;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Ms.MessageDirection.clientToServer,t.type=new Ms.ProtocolRequestType(t.method)})(F_||(ni.CallHierarchyPrepareRequest=F_={}));var $_;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Ms.MessageDirection.clientToServer,t.type=new Ms.ProtocolRequestType(t.method)})($_||(ni.CallHierarchyIncomingCallsRequest=$_={}));var B_;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Ms.MessageDirection.clientToServer,t.type=new Ms.ProtocolRequestType(t.method)})(B_||(ni.CallHierarchyOutgoingCallsRequest=B_={}))});var z_=g(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.SemanticTokensRefreshRequest=fn.SemanticTokensRangeRequest=fn.SemanticTokensDeltaRequest=fn.SemanticTokensRequest=fn.SemanticTokensRegistrationType=fn.TokenFormat=void 0;var Lr=nt(),H_;(function(t){t.Relative="relative"})(H_||(fn.TokenFormat=H_={}));var zo;(function(t){t.method="textDocument/semanticTokens",t.type=new Lr.RegistrationType(t.method)})(zo||(fn.SemanticTokensRegistrationType=zo={}));var W_;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Lr.MessageDirection.clientToServer,t.type=new Lr.ProtocolRequestType(t.method),t.registrationMethod=zo.method})(W_||(fn.SemanticTokensRequest=W_={}));var G_;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Lr.MessageDirection.clientToServer,t.type=new Lr.ProtocolRequestType(t.method),t.registrationMethod=zo.method})(G_||(fn.SemanticTokensDeltaRequest=G_={}));var K_;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Lr.MessageDirection.clientToServer,t.type=new Lr.ProtocolRequestType(t.method),t.registrationMethod=zo.method})(K_||(fn.SemanticTokensRangeRequest=K_={}));var V_;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Lr.MessageDirection.serverToClient,t.type=new Lr.ProtocolRequestType0(t.method)})(V_||(fn.SemanticTokensRefreshRequest=V_={}))});var J_=g(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.ShowDocumentRequest=void 0;var X_=nt(),Y_;(function(t){t.method="window/showDocument",t.messageDirection=X_.MessageDirection.serverToClient,t.type=new X_.ProtocolRequestType(t.method)})(Y_||(ic.ShowDocumentRequest=Y_={}))});var eT=g(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.LinkedEditingRangeRequest=void 0;var Q_=nt(),Z_;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Q_.MessageDirection.clientToServer,t.type=new Q_.ProtocolRequestType(t.method)})(Z_||(sc.LinkedEditingRangeRequest=Z_={}))});var uT=g(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.WillDeleteFilesRequest=Vt.DidDeleteFilesNotification=Vt.DidRenameFilesNotification=Vt.WillRenameFilesRequest=Vt.DidCreateFilesNotification=Vt.WillCreateFilesRequest=Vt.FileOperationPatternKind=void 0;var Cn=nt(),tT;(function(t){t.file="file",t.folder="folder"})(tT||(Vt.FileOperationPatternKind=tT={}));var nT;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})(nT||(Vt.WillCreateFilesRequest=nT={}));var rT;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(rT||(Vt.DidCreateFilesNotification=rT={}));var iT;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})(iT||(Vt.WillRenameFilesRequest=iT={}));var sT;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(sT||(Vt.DidRenameFilesNotification=sT={}));var oT;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(oT||(Vt.DidDeleteFilesNotification=oT={}));var aT;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})(aT||(Vt.WillDeleteFilesRequest=aT={}))});var pT=g(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.MonikerRequest=ri.MonikerKind=ri.UniquenessLevel=void 0;var cT=nt(),lT;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(lT||(ri.UniquenessLevel=lT={}));var dT;(function(t){t.$import="import",t.$export="export",t.local="local"})(dT||(ri.MonikerKind=dT={}));var fT;(function(t){t.method="textDocument/moniker",t.messageDirection=cT.MessageDirection.clientToServer,t.type=new cT.ProtocolRequestType(t.method)})(fT||(ri.MonikerRequest=fT={}))});var yT=g(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.TypeHierarchySubtypesRequest=ii.TypeHierarchySupertypesRequest=ii.TypeHierarchyPrepareRequest=void 0;var Ls=nt(),hT;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Ls.MessageDirection.clientToServer,t.type=new Ls.ProtocolRequestType(t.method)})(hT||(ii.TypeHierarchyPrepareRequest=hT={}));var gT;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Ls.MessageDirection.clientToServer,t.type=new Ls.ProtocolRequestType(t.method)})(gT||(ii.TypeHierarchySupertypesRequest=gT={}));var mT;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Ls.MessageDirection.clientToServer,t.type=new Ls.ProtocolRequestType(t.method)})(mT||(ii.TypeHierarchySubtypesRequest=mT={}))});var _T=g(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.InlineValueRefreshRequest=Ns.InlineValueRequest=void 0;var oc=nt(),bT;(function(t){t.method="textDocument/inlineValue",t.messageDirection=oc.MessageDirection.clientToServer,t.type=new oc.ProtocolRequestType(t.method)})(bT||(Ns.InlineValueRequest=bT={}));var vT;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=oc.MessageDirection.serverToClient,t.type=new oc.ProtocolRequestType0(t.method)})(vT||(Ns.InlineValueRefreshRequest=vT={}))});var xT=g(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.InlayHintRefreshRequest=si.InlayHintResolveRequest=si.InlayHintRequest=void 0;var qs=nt(),TT;(function(t){t.method="textDocument/inlayHint",t.messageDirection=qs.MessageDirection.clientToServer,t.type=new qs.ProtocolRequestType(t.method)})(TT||(si.InlayHintRequest=TT={}));var ST;(function(t){t.method="inlayHint/resolve",t.messageDirection=qs.MessageDirection.clientToServer,t.type=new qs.ProtocolRequestType(t.method)})(ST||(si.InlayHintResolveRequest=ST={}));var kT;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=qs.MessageDirection.serverToClient,t.type=new qs.ProtocolRequestType0(t.method)})(kT||(si.InlayHintRefreshRequest=kT={}))});var PT=g(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.DiagnosticRefreshRequest=Rn.WorkspaceDiagnosticRequest=Rn.DocumentDiagnosticRequest=Rn.DocumentDiagnosticReportKind=Rn.DiagnosticServerCancellationData=void 0;var RT=Fi(),xO=zu(),js=nt(),wT;(function(t){function e(n){let r=n;return r&&xO.boolean(r.retriggerRequest)}t.is=e})(wT||(Rn.DiagnosticServerCancellationData=wT={}));var ET;(function(t){t.Full="full",t.Unchanged="unchanged"})(ET||(Rn.DocumentDiagnosticReportKind=ET={}));var AT;(function(t){t.method="textDocument/diagnostic",t.messageDirection=js.MessageDirection.clientToServer,t.type=new js.ProtocolRequestType(t.method),t.partialResult=new RT.ProgressType})(AT||(Rn.DocumentDiagnosticRequest=AT={}));var OT;(function(t){t.method="workspace/diagnostic",t.messageDirection=js.MessageDirection.clientToServer,t.type=new js.ProtocolRequestType(t.method),t.partialResult=new RT.ProgressType})(OT||(Rn.WorkspaceDiagnosticRequest=OT={}));var CT;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=js.MessageDirection.serverToClient,t.type=new js.ProtocolRequestType0(t.method)})(CT||(Rn.DiagnosticRefreshRequest=CT={}))});var jT=g(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.DidCloseNotebookDocumentNotification=lt.DidSaveNotebookDocumentNotification=lt.DidChangeNotebookDocumentNotification=lt.NotebookCellArrayChange=lt.DidOpenNotebookDocumentNotification=lt.NotebookDocumentSyncRegistrationType=lt.NotebookDocument=lt.NotebookCell=lt.ExecutionSummary=lt.NotebookCellKind=void 0;var Xo=Vu(),Qn=zu(),lr=nt(),jp;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(jp||(lt.NotebookCellKind=jp={}));var Fp;(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 Qn.objectLiteral(s)&&Xo.uinteger.is(s.executionOrder)&&(s.success===void 0||Qn.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})(Fp||(lt.ExecutionSummary=Fp={}));var ac;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return Qn.objectLiteral(o)&&jp.is(o.kind)&&Xo.DocumentUri.is(o.document)&&(o.metadata===void 0||Qn.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)&&!Fp.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(Qn.objectLiteral(s)&&Qn.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 d=0;d<c.length;d++){let p=c[d];if(!i(s[p],o[p]))return!1}}return!0}})(ac||(lt.NotebookCell=ac={}));var DT;(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 Qn.objectLiteral(i)&&Qn.string(i.uri)&&Xo.integer.is(i.version)&&Qn.typedArray(i.cells,ac.is)}t.is=n})(DT||(lt.NotebookDocument=DT={}));var Fs;(function(t){t.method="notebookDocument/sync",t.messageDirection=lr.MessageDirection.clientToServer,t.type=new lr.RegistrationType(t.method)})(Fs||(lt.NotebookDocumentSyncRegistrationType=Fs={}));var IT;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=lr.MessageDirection.clientToServer,t.type=new lr.ProtocolNotificationType(t.method),t.registrationMethod=Fs.method})(IT||(lt.DidOpenNotebookDocumentNotification=IT={}));var MT;(function(t){function e(r){let i=r;return Qn.objectLiteral(i)&&Xo.uinteger.is(i.start)&&Xo.uinteger.is(i.deleteCount)&&(i.cells===void 0||Qn.typedArray(i.cells,ac.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})(MT||(lt.NotebookCellArrayChange=MT={}));var LT;(function(t){t.method="notebookDocument/didChange",t.messageDirection=lr.MessageDirection.clientToServer,t.type=new lr.ProtocolNotificationType(t.method),t.registrationMethod=Fs.method})(LT||(lt.DidChangeNotebookDocumentNotification=LT={}));var NT;(function(t){t.method="notebookDocument/didSave",t.messageDirection=lr.MessageDirection.clientToServer,t.type=new lr.ProtocolNotificationType(t.method),t.registrationMethod=Fs.method})(NT||(lt.DidSaveNotebookDocumentNotification=NT={}));var qT;(function(t){t.method="notebookDocument/didClose",t.messageDirection=lr.MessageDirection.clientToServer,t.type=new lr.ProtocolNotificationType(t.method),t.registrationMethod=Fs.method})(qT||(lt.DidCloseNotebookDocumentNotification=qT={}))});var BT=g(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.InlineCompletionRequest=void 0;var FT=nt(),$T;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=FT.MessageDirection.clientToServer,t.type=new FT.ProtocolRequestType(t.method)})($T||(uc.InlineCompletionRequest=$T={}))});var ek=g(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.WorkspaceSymbolRequest=b.CodeActionResolveRequest=b.CodeActionRequest=b.DocumentSymbolRequest=b.DocumentHighlightRequest=b.ReferencesRequest=b.DefinitionRequest=b.SignatureHelpRequest=b.SignatureHelpTriggerKind=b.HoverRequest=b.CompletionResolveRequest=b.CompletionRequest=b.CompletionTriggerKind=b.PublishDiagnosticsNotification=b.WatchKind=b.RelativePattern=b.FileChangeType=b.DidChangeWatchedFilesNotification=b.WillSaveTextDocumentWaitUntilRequest=b.WillSaveTextDocumentNotification=b.TextDocumentSaveReason=b.DidSaveTextDocumentNotification=b.DidCloseTextDocumentNotification=b.DidChangeTextDocumentNotification=b.TextDocumentContentChangeEvent=b.DidOpenTextDocumentNotification=b.TextDocumentSyncKind=b.TelemetryEventNotification=b.LogMessageNotification=b.ShowMessageRequest=b.ShowMessageNotification=b.MessageType=b.DidChangeConfigurationNotification=b.ExitNotification=b.ShutdownRequest=b.InitializedNotification=b.InitializeErrorCodes=b.InitializeRequest=b.WorkDoneProgressOptions=b.TextDocumentRegistrationOptions=b.StaticRegistrationOptions=b.PositionEncodingKind=b.FailureHandlingKind=b.ResourceOperationKind=b.UnregistrationRequest=b.RegistrationRequest=b.DocumentSelector=b.NotebookCellTextDocumentFilter=b.NotebookDocumentFilter=b.TextDocumentFilter=void 0;b.MonikerRequest=b.MonikerKind=b.UniquenessLevel=b.WillDeleteFilesRequest=b.DidDeleteFilesNotification=b.WillRenameFilesRequest=b.DidRenameFilesNotification=b.WillCreateFilesRequest=b.DidCreateFilesNotification=b.FileOperationPatternKind=b.LinkedEditingRangeRequest=b.ShowDocumentRequest=b.SemanticTokensRegistrationType=b.SemanticTokensRefreshRequest=b.SemanticTokensRangeRequest=b.SemanticTokensDeltaRequest=b.SemanticTokensRequest=b.TokenFormat=b.CallHierarchyPrepareRequest=b.CallHierarchyOutgoingCallsRequest=b.CallHierarchyIncomingCallsRequest=b.WorkDoneProgressCancelNotification=b.WorkDoneProgressCreateRequest=b.WorkDoneProgress=b.SelectionRangeRequest=b.DeclarationRequest=b.FoldingRangeRefreshRequest=b.FoldingRangeRequest=b.ColorPresentationRequest=b.DocumentColorRequest=b.ConfigurationRequest=b.DidChangeWorkspaceFoldersNotification=b.WorkspaceFoldersRequest=b.TypeDefinitionRequest=b.ImplementationRequest=b.ApplyWorkspaceEditRequest=b.ExecuteCommandRequest=b.PrepareRenameRequest=b.RenameRequest=b.PrepareSupportDefaultBehavior=b.DocumentOnTypeFormattingRequest=b.DocumentRangesFormattingRequest=b.DocumentRangeFormattingRequest=b.DocumentFormattingRequest=b.DocumentLinkResolveRequest=b.DocumentLinkRequest=b.CodeLensRefreshRequest=b.CodeLensResolveRequest=b.CodeLensRequest=b.WorkspaceSymbolResolveRequest=void 0;b.InlineCompletionRequest=b.DidCloseNotebookDocumentNotification=b.DidSaveNotebookDocumentNotification=b.DidChangeNotebookDocumentNotification=b.NotebookCellArrayChange=b.DidOpenNotebookDocumentNotification=b.NotebookDocumentSyncRegistrationType=b.NotebookDocument=b.NotebookCell=b.ExecutionSummary=b.NotebookCellKind=b.DiagnosticRefreshRequest=b.WorkspaceDiagnosticRequest=b.DocumentDiagnosticRequest=b.DocumentDiagnosticReportKind=b.DiagnosticServerCancellationData=b.InlayHintRefreshRequest=b.InlayHintResolveRequest=b.InlayHintRequest=b.InlineValueRefreshRequest=b.InlineValueRequest=b.TypeHierarchySupertypesRequest=b.TypeHierarchySubtypesRequest=b.TypeHierarchyPrepareRequest=void 0;var G=nt(),UT=Vu(),Mt=zu(),wO=p_();Object.defineProperty(b,"ImplementationRequest",{enumerable:!0,get:function(){return wO.ImplementationRequest}});var EO=m_();Object.defineProperty(b,"TypeDefinitionRequest",{enumerable:!0,get:function(){return EO.TypeDefinitionRequest}});var YS=v_();Object.defineProperty(b,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return YS.WorkspaceFoldersRequest}});Object.defineProperty(b,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return YS.DidChangeWorkspaceFoldersNotification}});var AO=S_();Object.defineProperty(b,"ConfigurationRequest",{enumerable:!0,get:function(){return AO.ConfigurationRequest}});var JS=w_();Object.defineProperty(b,"DocumentColorRequest",{enumerable:!0,get:function(){return JS.DocumentColorRequest}});Object.defineProperty(b,"ColorPresentationRequest",{enumerable:!0,get:function(){return JS.ColorPresentationRequest}});var QS=O_();Object.defineProperty(b,"FoldingRangeRequest",{enumerable:!0,get:function(){return QS.FoldingRangeRequest}});Object.defineProperty(b,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return QS.FoldingRangeRefreshRequest}});var OO=P_();Object.defineProperty(b,"DeclarationRequest",{enumerable:!0,get:function(){return OO.DeclarationRequest}});var CO=M_();Object.defineProperty(b,"SelectionRangeRequest",{enumerable:!0,get:function(){return CO.SelectionRangeRequest}});var Wp=j_();Object.defineProperty(b,"WorkDoneProgress",{enumerable:!0,get:function(){return Wp.WorkDoneProgress}});Object.defineProperty(b,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Wp.WorkDoneProgressCreateRequest}});Object.defineProperty(b,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Wp.WorkDoneProgressCancelNotification}});var Gp=U_();Object.defineProperty(b,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Gp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(b,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Gp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(b,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Gp.CallHierarchyPrepareRequest}});var $s=z_();Object.defineProperty(b,"TokenFormat",{enumerable:!0,get:function(){return $s.TokenFormat}});Object.defineProperty(b,"SemanticTokensRequest",{enumerable:!0,get:function(){return $s.SemanticTokensRequest}});Object.defineProperty(b,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return $s.SemanticTokensDeltaRequest}});Object.defineProperty(b,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return $s.SemanticTokensRangeRequest}});Object.defineProperty(b,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return $s.SemanticTokensRefreshRequest}});Object.defineProperty(b,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return $s.SemanticTokensRegistrationType}});var RO=J_();Object.defineProperty(b,"ShowDocumentRequest",{enumerable:!0,get:function(){return RO.ShowDocumentRequest}});var PO=eT();Object.defineProperty(b,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return PO.LinkedEditingRangeRequest}});var $i=uT();Object.defineProperty(b,"FileOperationPatternKind",{enumerable:!0,get:function(){return $i.FileOperationPatternKind}});Object.defineProperty(b,"DidCreateFilesNotification",{enumerable:!0,get:function(){return $i.DidCreateFilesNotification}});Object.defineProperty(b,"WillCreateFilesRequest",{enumerable:!0,get:function(){return $i.WillCreateFilesRequest}});Object.defineProperty(b,"DidRenameFilesNotification",{enumerable:!0,get:function(){return $i.DidRenameFilesNotification}});Object.defineProperty(b,"WillRenameFilesRequest",{enumerable:!0,get:function(){return $i.WillRenameFilesRequest}});Object.defineProperty(b,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return $i.DidDeleteFilesNotification}});Object.defineProperty(b,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return $i.WillDeleteFilesRequest}});var Kp=pT();Object.defineProperty(b,"UniquenessLevel",{enumerable:!0,get:function(){return Kp.UniquenessLevel}});Object.defineProperty(b,"MonikerKind",{enumerable:!0,get:function(){return Kp.MonikerKind}});Object.defineProperty(b,"MonikerRequest",{enumerable:!0,get:function(){return Kp.MonikerRequest}});var Vp=yT();Object.defineProperty(b,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Vp.TypeHierarchyPrepareRequest}});Object.defineProperty(b,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Vp.TypeHierarchySubtypesRequest}});Object.defineProperty(b,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Vp.TypeHierarchySupertypesRequest}});var ZS=_T();Object.defineProperty(b,"InlineValueRequest",{enumerable:!0,get:function(){return ZS.InlineValueRequest}});Object.defineProperty(b,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return ZS.InlineValueRefreshRequest}});var zp=xT();Object.defineProperty(b,"InlayHintRequest",{enumerable:!0,get:function(){return zp.InlayHintRequest}});Object.defineProperty(b,"InlayHintResolveRequest",{enumerable:!0,get:function(){return zp.InlayHintResolveRequest}});Object.defineProperty(b,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return zp.InlayHintRefreshRequest}});var Yo=PT();Object.defineProperty(b,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Yo.DiagnosticServerCancellationData}});Object.defineProperty(b,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Yo.DocumentDiagnosticReportKind}});Object.defineProperty(b,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Yo.DocumentDiagnosticRequest}});Object.defineProperty(b,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Yo.WorkspaceDiagnosticRequest}});Object.defineProperty(b,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Yo.DiagnosticRefreshRequest}});var dr=jT();Object.defineProperty(b,"NotebookCellKind",{enumerable:!0,get:function(){return dr.NotebookCellKind}});Object.defineProperty(b,"ExecutionSummary",{enumerable:!0,get:function(){return dr.ExecutionSummary}});Object.defineProperty(b,"NotebookCell",{enumerable:!0,get:function(){return dr.NotebookCell}});Object.defineProperty(b,"NotebookDocument",{enumerable:!0,get:function(){return dr.NotebookDocument}});Object.defineProperty(b,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return dr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(b,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return dr.DidOpenNotebookDocumentNotification}});Object.defineProperty(b,"NotebookCellArrayChange",{enumerable:!0,get:function(){return dr.NotebookCellArrayChange}});Object.defineProperty(b,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return dr.DidChangeNotebookDocumentNotification}});Object.defineProperty(b,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return dr.DidSaveNotebookDocumentNotification}});Object.defineProperty(b,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return dr.DidCloseNotebookDocumentNotification}});var DO=BT();Object.defineProperty(b,"InlineCompletionRequest",{enumerable:!0,get:function(){return DO.InlineCompletionRequest}});var $p;(function(t){function e(n){let r=n;return Mt.string(r)||Mt.string(r.language)||Mt.string(r.scheme)||Mt.string(r.pattern)}t.is=e})($p||(b.TextDocumentFilter=$p={}));var Bp;(function(t){function e(n){let r=n;return Mt.objectLiteral(r)&&(Mt.string(r.notebookType)||Mt.string(r.scheme)||Mt.string(r.pattern))}t.is=e})(Bp||(b.NotebookDocumentFilter=Bp={}));var Up;(function(t){function e(n){let r=n;return Mt.objectLiteral(r)&&(Mt.string(r.notebook)||Bp.is(r.notebook))&&(r.language===void 0||Mt.string(r.language))}t.is=e})(Up||(b.NotebookCellTextDocumentFilter=Up={}));var Hp;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Mt.string(r)&&!$p.is(r)&&!Up.is(r))return!1;return!0}t.is=e})(Hp||(b.DocumentSelector=Hp={}));var HT;(function(t){t.method="client/registerCapability",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(HT||(b.RegistrationRequest=HT={}));var WT;(function(t){t.method="client/unregisterCapability",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(WT||(b.UnregistrationRequest=WT={}));var GT;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(GT||(b.ResourceOperationKind=GT={}));var KT;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(KT||(b.FailureHandlingKind=KT={}));var VT;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(VT||(b.PositionEncodingKind=VT={}));var zT;(function(t){function e(n){let r=n;return r&&Mt.string(r.id)&&r.id.length>0}t.hasId=e})(zT||(b.StaticRegistrationOptions=zT={}));var XT;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Hp.is(r.documentSelector))}t.is=e})(XT||(b.TextDocumentRegistrationOptions=XT={}));var YT;(function(t){function e(r){let i=r;return Mt.objectLiteral(i)&&(i.workDoneProgress===void 0||Mt.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Mt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(YT||(b.WorkDoneProgressOptions=YT={}));var JT;(function(t){t.method="initialize",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(JT||(b.InitializeRequest=JT={}));var QT;(function(t){t.unknownProtocolVersion=1})(QT||(b.InitializeErrorCodes=QT={}));var ZT;(function(t){t.method="initialized",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(ZT||(b.InitializedNotification=ZT={}));var eS;(function(t){t.method="shutdown",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType0(t.method)})(eS||(b.ShutdownRequest=eS={}));var tS;(function(t){t.method="exit",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType0(t.method)})(tS||(b.ExitNotification=tS={}));var nS;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(nS||(b.DidChangeConfigurationNotification=nS={}));var rS;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(rS||(b.MessageType=rS={}));var iS;(function(t){t.method="window/showMessage",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(iS||(b.ShowMessageNotification=iS={}));var sS;(function(t){t.method="window/showMessageRequest",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(sS||(b.ShowMessageRequest=sS={}));var oS;(function(t){t.method="window/logMessage",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(oS||(b.LogMessageNotification=oS={}));var aS;(function(t){t.method="telemetry/event",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(aS||(b.TelemetryEventNotification=aS={}));var uS;(function(t){t.None=0,t.Full=1,t.Incremental=2})(uS||(b.TextDocumentSyncKind=uS={}));var cS;(function(t){t.method="textDocument/didOpen",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(cS||(b.DidOpenTextDocumentNotification=cS={}));var lS;(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})(lS||(b.TextDocumentContentChangeEvent=lS={}));var dS;(function(t){t.method="textDocument/didChange",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(dS||(b.DidChangeTextDocumentNotification=dS={}));var fS;(function(t){t.method="textDocument/didClose",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(fS||(b.DidCloseTextDocumentNotification=fS={}));var pS;(function(t){t.method="textDocument/didSave",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(pS||(b.DidSaveTextDocumentNotification=pS={}));var hS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(hS||(b.TextDocumentSaveReason=hS={}));var gS;(function(t){t.method="textDocument/willSave",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(gS||(b.WillSaveTextDocumentNotification=gS={}));var mS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(mS||(b.WillSaveTextDocumentWaitUntilRequest=mS={}));var yS;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(yS||(b.DidChangeWatchedFilesNotification=yS={}));var bS;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(bS||(b.FileChangeType=bS={}));var vS;(function(t){function e(n){let r=n;return Mt.objectLiteral(r)&&(UT.URI.is(r.baseUri)||UT.WorkspaceFolder.is(r.baseUri))&&Mt.string(r.pattern)}t.is=e})(vS||(b.RelativePattern=vS={}));var _S;(function(t){t.Create=1,t.Change=2,t.Delete=4})(_S||(b.WatchKind=_S={}));var TS;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(TS||(b.PublishDiagnosticsNotification=TS={}));var SS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(SS||(b.CompletionTriggerKind=SS={}));var kS;(function(t){t.method="textDocument/completion",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(kS||(b.CompletionRequest=kS={}));var xS;(function(t){t.method="completionItem/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(xS||(b.CompletionResolveRequest=xS={}));var wS;(function(t){t.method="textDocument/hover",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(wS||(b.HoverRequest=wS={}));var ES;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(ES||(b.SignatureHelpTriggerKind=ES={}));var AS;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(AS||(b.SignatureHelpRequest=AS={}));var OS;(function(t){t.method="textDocument/definition",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(OS||(b.DefinitionRequest=OS={}));var CS;(function(t){t.method="textDocument/references",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(CS||(b.ReferencesRequest=CS={}));var RS;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(RS||(b.DocumentHighlightRequest=RS={}));var PS;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(PS||(b.DocumentSymbolRequest=PS={}));var DS;(function(t){t.method="textDocument/codeAction",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(DS||(b.CodeActionRequest=DS={}));var IS;(function(t){t.method="codeAction/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(IS||(b.CodeActionResolveRequest=IS={}));var MS;(function(t){t.method="workspace/symbol",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(MS||(b.WorkspaceSymbolRequest=MS={}));var LS;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(LS||(b.WorkspaceSymbolResolveRequest=LS={}));var NS;(function(t){t.method="textDocument/codeLens",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(NS||(b.CodeLensRequest=NS={}));var qS;(function(t){t.method="codeLens/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(qS||(b.CodeLensResolveRequest=qS={}));var jS;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType0(t.method)})(jS||(b.CodeLensRefreshRequest=jS={}));var FS;(function(t){t.method="textDocument/documentLink",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(FS||(b.DocumentLinkRequest=FS={}));var $S;(function(t){t.method="documentLink/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})($S||(b.DocumentLinkResolveRequest=$S={}));var BS;(function(t){t.method="textDocument/formatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(BS||(b.DocumentFormattingRequest=BS={}));var US;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(US||(b.DocumentRangeFormattingRequest=US={}));var HS;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(HS||(b.DocumentRangesFormattingRequest=HS={}));var WS;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(WS||(b.DocumentOnTypeFormattingRequest=WS={}));var GS;(function(t){t.Identifier=1})(GS||(b.PrepareSupportDefaultBehavior=GS={}));var KS;(function(t){t.method="textDocument/rename",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(KS||(b.RenameRequest=KS={}));var VS;(function(t){t.method="textDocument/prepareRename",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(VS||(b.PrepareRenameRequest=VS={}));var zS;(function(t){t.method="workspace/executeCommand",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(zS||(b.ExecuteCommandRequest=zS={}));var XS;(function(t){t.method="workspace/applyEdit",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType("workspace/applyEdit")})(XS||(b.ApplyWorkspaceEditRequest=XS={}))});var nk=g(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.createProtocolConnection=void 0;var tk=Fi();function IO(t,e,n,r){return tk.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,tk.createMessageConnection)(t,e,n,r)}cc.createProtocolConnection=IO});var ik=g(pn=>{"use strict";var MO=pn&&pn.__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]}),lc=pn&&pn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&MO(e,t,n)};Object.defineProperty(pn,"__esModule",{value:!0});pn.LSPErrorCodes=pn.createProtocolConnection=void 0;lc(Fi(),pn);lc(Vu(),pn);lc(nt(),pn);lc(ek(),pn);var LO=nk();Object.defineProperty(pn,"createProtocolConnection",{enumerable:!0,get:function(){return LO.createProtocolConnection}});var rk;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(rk||(pn.LSPErrorCodes=rk={}))});var yt=g(fr=>{"use strict";var NO=fr&&fr.__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]}),sk=fr&&fr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&NO(e,t,n)};Object.defineProperty(fr,"__esModule",{value:!0});fr.createProtocolConnection=void 0;var qO=Dp();sk(Dp(),fr);sk(ik(),fr);function jO(t,e,n,r){return(0,qO.createMessageConnection)(t,e,n,r)}fr.createProtocolConnection=jO});var Xp=g(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.generateUuid=Pn.parse=Pn.isUUID=Pn.v4=Pn.empty=void 0;var Jo=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Qo=class t extends Jo{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(""))}};Qo._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Qo._timeHighBits=["8","9","a","b"];Pn.empty=new Jo("00000000-0000-0000-0000-000000000000");function ok(){return new Qo}Pn.v4=ok;var FO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ak(t){return FO.test(t)}Pn.isUUID=ak;function $O(t){if(!ak(t))throw new Error("invalid uuid");return new Jo(t)}Pn.parse=$O;function BO(){return ok().asHex()}Pn.generateUuid=BO});var uk=g(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.attachPartialResult=ai.ProgressFeature=ai.attachWorkDone=void 0;var oi=yt(),UO=Xp(),Bi=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(oi.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(oi.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(oi.WorkDoneProgress.type,this._token,{kind:"end"})}};Bi.Instances=new Map;var dc=class extends Bi{constructor(e,n){super(e,n),this._source=new oi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Zo=class{constructor(){}begin(){}report(){}done(){}},fc=class extends Zo{constructor(){super(),this._source=new oi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function HO(t,e){if(e===void 0||e.workDoneToken===void 0)return new Zo;let n=e.workDoneToken;return delete e.workDoneToken,new Bi(t,n)}ai.attachWorkDone=HO;var WO=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(oi.WorkDoneProgressCancelNotification.type,n=>{let r=Bi.Instances.get(n.token);(r instanceof dc||r instanceof fc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Zo:new Bi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,UO.generateUuid)();return this.connection.sendRequest(oi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new dc(this.connection,e))}else return Promise.resolve(new fc)}};ai.ProgressFeature=WO;var Yp;(function(t){t.type=new oi.ProgressType})(Yp||(Yp={}));var Jp=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Yp.type,this._token,e)}};function GO(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Jp(t,n)}ai.attachPartialResult=GO});var ck=g(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.ConfigurationFeature=void 0;var KO=yt(),VO=xu(),zO=t=>class extends t{getConfiguration(e){return e?VO.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(KO.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};pc.ConfigurationFeature=zO});var lk=g(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.WorkspaceFoldersFeature=void 0;var hc=yt(),XO=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new hc.Emitter,this.connection.onNotification(hc.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(hc.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(hc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};gc.WorkspaceFoldersFeature=XO});var dk=g(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.CallHierarchyFeature=void 0;var Qp=yt(),YO=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Qp.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Qp.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Qp.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};mc.CallHierarchyFeature=YO});var eh=g(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.SemanticTokensBuilder=ui.SemanticTokensDiff=ui.SemanticTokensFeature=void 0;var yc=yt(),JO=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(yc.SemanticTokensRefreshRequest.type),on:e=>{let n=yc.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=yc.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=yc.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ui.SemanticTokensFeature=JO;var bc=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}]:[]}};ui.SemanticTokensDiff=bc;var Zp=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 bc(this._prevData,this._data).computeDiff()}:this.build()}};ui.SemanticTokensBuilder=Zp});var fk=g(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.ShowDocumentFeature=void 0;var QO=yt(),ZO=t=>class extends t{showDocument(e){return this.connection.sendRequest(QO.ShowDocumentRequest.type,e)}};vc.ShowDocumentFeature=ZO});var pk=g(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.FileOperationsFeature=void 0;var Bs=yt(),eC=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Bs.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Bs.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Bs.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Bs.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Bs.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Bs.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};_c.FileOperationsFeature=eC});var hk=g(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.LinkedEditingRangeFeature=void 0;var tC=yt(),nC=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(tC.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Tc.LinkedEditingRangeFeature=nC});var gk=g(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.TypeHierarchyFeature=void 0;var th=yt(),rC=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(th.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=th.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=th.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Sc.TypeHierarchyFeature=rC});var yk=g(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.InlineValueFeature=void 0;var mk=yt(),iC=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(mk.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(mk.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};kc.InlineValueFeature=iC});var vk=g(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.FoldingRangeFeature=void 0;var bk=yt(),sC=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(bk.FoldingRangeRefreshRequest.type),on:e=>{let n=bk.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};xc.FoldingRangeFeature=sC});var _k=g(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.InlayHintFeature=void 0;var nh=yt(),oC=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(nh.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(nh.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(nh.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};wc.InlayHintFeature=oC});var Tk=g(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.DiagnosticFeature=void 0;var ea=yt(),aC=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(ea.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(ea.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(ea.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(ea.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(ea.WorkspaceDiagnosticRequest.partialResult,n)))}}};Ec.DiagnosticFeature=aC});var ih=g(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.TextDocuments=void 0;var Ui=yt(),rh=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Ui.Emitter,this._onDidOpen=new Ui.Emitter,this._onDidClose=new Ui.Emitter,this._onDidSave=new Ui.Emitter,this._onWillSave=new Ui.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=Ui.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}))})),Ui.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Ac.TextDocuments=rh});var oh=g(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.NotebookDocuments=Us.NotebookSyncFeature=void 0;var Dn=yt(),Sk=ih(),uC=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Dn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Dn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Dn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Dn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Us.NotebookSyncFeature=uC;var Oc=class t{onDidOpenTextDocument(e){return this.openHandler=e,Dn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Dn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Dn.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}};Oc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var sh=class{constructor(e){e instanceof Sk.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Sk.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Dn.Emitter,this._onDidChange=new Dn.Emitter,this._onDidSave=new Dn.Emitter,this._onDidClose=new Dn.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 Oc,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=[],d=[],p=[];if(u.cells!==void 0){let M=u.cells;if(M.structure!==void 0){let x=M.structure.array;if(s.cells.splice(x.start,x.deleteCount,...x.cells!==void 0?x.cells:[]),M.structure.didOpen!==void 0)for(let k of M.structure.didOpen)n.openTextDocument({textDocument:k}),c.push(k.uri);if(M.structure.didClose)for(let k of M.structure.didClose)n.closeTextDocument({textDocument:k}),l.push(k.uri)}if(M.data!==void 0){let x=new Map(M.data.map(k=>[k.document,k]));for(let k=0;k<=s.cells.length;k++){let v=x.get(s.cells[k].document);if(v!==void 0){let F=s.cells.splice(k,1,v);if(d.push({old:F[0],new:v}),x.delete(v.document),x.size===0)break}}}if(M.textContent!==void 0)for(let x of M.textContent)n.changeTextDocument({textDocument:x.document,contentChanges:x.changes}),p.push(x.document.uri)}this.updateCellMap(s);let y={notebookDocument:s};a&&(y.metadata={old:o,new:s.metadata});let _=[];for(let M of c)_.push(this.getNotebookCell(M));let E=[];for(let M of l)E.push(this.getNotebookCell(M));let L=[];for(let M of p)L.push(this.getNotebookCell(M));(_.length>0||E.length>0||d.length>0||L.length>0)&&(y.cells={added:_,removed:E,changed:{data:d,textContent:L}}),(y.metadata!==void 0||y.cells!==void 0)&&this._onDidChange.fire(y)})),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)}})),Dn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};Us.NotebookDocuments=sh});var kk=g(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.MonikerFeature=void 0;var cC=yt(),lC=t=>class extends t{get moniker(){return{on:e=>{let n=cC.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Cc.MonikerFeature=lC});var fh=g(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.createConnection=De.combineFeatures=De.combineNotebooksFeatures=De.combineLanguagesFeatures=De.combineWorkspaceFeatures=De.combineWindowFeatures=De.combineClientFeatures=De.combineTracerFeatures=De.combineTelemetryFeatures=De.combineConsoleFeatures=De._NotebooksImpl=De._LanguagesImpl=De.BulkUnregistration=De.BulkRegistration=De.ErrorMessageTracker=void 0;var X=yt(),In=xu(),uh=Xp(),ge=uk(),dC=ck(),fC=lk(),pC=dk(),hC=eh(),gC=fk(),mC=pk(),yC=hk(),bC=gk(),vC=yk(),_C=vk(),TC=_k(),SC=Tk(),kC=oh(),xC=kk();function ah(t){if(t!==null)return t}var ch=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)})}};De.ErrorMessageTracker=ch;var Rc=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(X.MessageType.Error,e)}warn(e){this.send(X.MessageType.Warning,e)}info(e){this.send(X.MessageType.Info,e)}log(e){this.send(X.MessageType.Log,e)}debug(e){this.send(X.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(X.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,X.RAL)().console.error("Sending log message failed")})}},lh=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:X.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(X.ShowMessageRequest.type,r).then(ah)}showWarningMessage(e,...n){let r={type:X.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(X.ShowMessageRequest.type,r).then(ah)}showInformationMessage(e,...n){let r={type:X.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(X.ShowMessageRequest.type,r).then(ah)}},xk=(0,gC.ShowDocumentFeature)((0,ge.ProgressFeature)(lh)),wk;(function(t){function e(){return new Pc}t.create=e})(wk||(De.BulkRegistration=wk={}));var Pc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=In.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=uh.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},Ek;(function(t){function e(){return new ta(void 0,[])}t.create=e})(Ek||(De.BulkUnregistration=Ek={}));var ta=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(X.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=In.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(X.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Dc=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 Pc?this.registerMany(e):e instanceof ta?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=In.string(n)?n:n.method,s=uh.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(X.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=In.string(e)?e:e.method,i=uh.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(X.RegistrationRequest.type,s).then(o=>X.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(X.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(X.RegistrationRequest.type,n).then(()=>new ta(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},dh=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(X.ApplyWorkspaceEditRequest.type,r)}},Ak=(0,mC.FileOperationsFeature)((0,fC.WorkspaceFoldersFeature)((0,dC.ConfigurationFeature)(dh))),Ic=class{constructor(){this._trace=X.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==X.Trace.Off&&this.connection.sendNotification(X.LogTraceNotification.type,{message:e,verbose:this._trace===X.Trace.Verbose?n:void 0}).catch(()=>{})}},Mc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(X.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Lc=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,ge.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ge.attachPartialResult)(this.connection,n)}};De._LanguagesImpl=Lc;var Ok=(0,_C.FoldingRangeFeature)((0,xC.MonikerFeature)((0,SC.DiagnosticFeature)((0,TC.InlayHintFeature)((0,vC.InlineValueFeature)((0,bC.TypeHierarchyFeature)((0,yC.LinkedEditingRangeFeature)((0,hC.SemanticTokensFeature)((0,pC.CallHierarchyFeature)(Lc))))))))),Nc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,ge.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ge.attachPartialResult)(this.connection,n)}};De._NotebooksImpl=Nc;var Ck=(0,kC.NotebookSyncFeature)(Nc);function Rk(t,e){return function(n){return e(t(n))}}De.combineConsoleFeatures=Rk;function Pk(t,e){return function(n){return e(t(n))}}De.combineTelemetryFeatures=Pk;function Dk(t,e){return function(n){return e(t(n))}}De.combineTracerFeatures=Dk;function Ik(t,e){return function(n){return e(t(n))}}De.combineClientFeatures=Ik;function Mk(t,e){return function(n){return e(t(n))}}De.combineWindowFeatures=Mk;function Lk(t,e){return function(n){return e(t(n))}}De.combineWorkspaceFeatures=Lk;function Nk(t,e){return function(n){return e(t(n))}}De.combineLanguagesFeatures=Nk;function qk(t,e){return function(n){return e(t(n))}}De.combineNotebooksFeatures=qk;function wC(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Rk),tracer:n(t.tracer,e.tracer,Dk),telemetry:n(t.telemetry,e.telemetry,Pk),client:n(t.client,e.client,Ik),window:n(t.window,e.window,Mk),workspace:n(t.workspace,e.workspace,Lk),languages:n(t.languages,e.languages,Nk),notebooks:n(t.notebooks,e.notebooks,qk)}}De.combineFeatures=wC;function EC(t,e,n){let r=n&&n.console?new(n.console(Rc)):new Rc,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Ic)):new Ic,o=n&&n.telemetry?new(n.telemetry(Mc)):new Mc,a=n&&n.client?new(n.client(Dc)):new Dc,u=n&&n.window?new(n.window(xk)):new xk,c=n&&n.workspace?new(n.workspace(Ak)):new Ak,l=n&&n.languages?new(n.languages(Ok)):new Ok,d=n&&n.notebooks?new(n.notebooks(Ck)):new Ck,p=[r,s,o,a,u,c,l,d];function y(x){return x instanceof Promise?x:In.thenable(x)?new Promise((k,v)=>{x.then(F=>k(F),F=>v(F))}):Promise.resolve(x)}let _,E,L,M={listen:()=>i.listen(),sendRequest:(x,...k)=>i.sendRequest(In.string(x)?x:x.method,...k),onRequest:(x,k)=>i.onRequest(x,k),sendNotification:(x,k)=>{let v=In.string(x)?x:x.method;return i.sendNotification(v,k)},onNotification:(x,k)=>i.onNotification(x,k),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:x=>(E=x,{dispose:()=>{E=void 0}}),onInitialized:x=>i.onNotification(X.InitializedNotification.type,x),onShutdown:x=>(_=x,{dispose:()=>{_=void 0}}),onExit:x=>(L=x,{dispose:()=>{L=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 d},onDidChangeConfiguration:x=>i.onNotification(X.DidChangeConfigurationNotification.type,x),onDidChangeWatchedFiles:x=>i.onNotification(X.DidChangeWatchedFilesNotification.type,x),__textDocumentSync:void 0,onDidOpenTextDocument:x=>i.onNotification(X.DidOpenTextDocumentNotification.type,x),onDidChangeTextDocument:x=>i.onNotification(X.DidChangeTextDocumentNotification.type,x),onDidCloseTextDocument:x=>i.onNotification(X.DidCloseTextDocumentNotification.type,x),onWillSaveTextDocument:x=>i.onNotification(X.WillSaveTextDocumentNotification.type,x),onWillSaveTextDocumentWaitUntil:x=>i.onRequest(X.WillSaveTextDocumentWaitUntilRequest.type,x),onDidSaveTextDocument:x=>i.onNotification(X.DidSaveTextDocumentNotification.type,x),sendDiagnostics:x=>i.sendNotification(X.PublishDiagnosticsNotification.type,x),onHover:x=>i.onRequest(X.HoverRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),void 0)),onCompletion:x=>i.onRequest(X.CompletionRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onCompletionResolve:x=>i.onRequest(X.CompletionResolveRequest.type,x),onSignatureHelp:x=>i.onRequest(X.SignatureHelpRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),void 0)),onDeclaration:x=>i.onRequest(X.DeclarationRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onDefinition:x=>i.onRequest(X.DefinitionRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onTypeDefinition:x=>i.onRequest(X.TypeDefinitionRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onImplementation:x=>i.onRequest(X.ImplementationRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onReferences:x=>i.onRequest(X.ReferencesRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onDocumentHighlight:x=>i.onRequest(X.DocumentHighlightRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onDocumentSymbol:x=>i.onRequest(X.DocumentSymbolRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onWorkspaceSymbol:x=>i.onRequest(X.WorkspaceSymbolRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onWorkspaceSymbolResolve:x=>i.onRequest(X.WorkspaceSymbolResolveRequest.type,x),onCodeAction:x=>i.onRequest(X.CodeActionRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onCodeActionResolve:x=>i.onRequest(X.CodeActionResolveRequest.type,(k,v)=>x(k,v)),onCodeLens:x=>i.onRequest(X.CodeLensRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onCodeLensResolve:x=>i.onRequest(X.CodeLensResolveRequest.type,(k,v)=>x(k,v)),onDocumentFormatting:x=>i.onRequest(X.DocumentFormattingRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),void 0)),onDocumentRangeFormatting:x=>i.onRequest(X.DocumentRangeFormattingRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),void 0)),onDocumentOnTypeFormatting:x=>i.onRequest(X.DocumentOnTypeFormattingRequest.type,(k,v)=>x(k,v)),onRenameRequest:x=>i.onRequest(X.RenameRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),void 0)),onPrepareRename:x=>i.onRequest(X.PrepareRenameRequest.type,(k,v)=>x(k,v)),onDocumentLinks:x=>i.onRequest(X.DocumentLinkRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onDocumentLinkResolve:x=>i.onRequest(X.DocumentLinkResolveRequest.type,(k,v)=>x(k,v)),onDocumentColor:x=>i.onRequest(X.DocumentColorRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onColorPresentation:x=>i.onRequest(X.ColorPresentationRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onFoldingRanges:x=>i.onRequest(X.FoldingRangeRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onSelectionRanges:x=>i.onRequest(X.SelectionRangeRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),(0,ge.attachPartialResult)(i,k))),onExecuteCommand:x=>i.onRequest(X.ExecuteCommandRequest.type,(k,v)=>x(k,v,(0,ge.attachWorkDone)(i,k),void 0)),dispose:()=>i.dispose()};for(let x of p)x.attach(M);return i.onRequest(X.InitializeRequest.type,x=>{e.initialize(x),In.string(x.trace)&&(s.trace=X.Trace.fromString(x.trace));for(let k of p)k.initialize(x.capabilities);if(E){let k=E(x,new X.CancellationTokenSource().token,(0,ge.attachWorkDone)(i,x),void 0);return y(k).then(v=>{if(v instanceof X.ResponseError)return v;let F=v;F||(F={capabilities:{}});let C=F.capabilities;C||(C={},F.capabilities=C),C.textDocumentSync===void 0||C.textDocumentSync===null?C.textDocumentSync=In.number(M.__textDocumentSync)?M.__textDocumentSync:X.TextDocumentSyncKind.None:!In.number(C.textDocumentSync)&&!In.number(C.textDocumentSync.change)&&(C.textDocumentSync.change=In.number(M.__textDocumentSync)?M.__textDocumentSync:X.TextDocumentSyncKind.None);for(let V of p)V.fillServerCapabilities(C);return F})}else{let k={capabilities:{textDocumentSync:X.TextDocumentSyncKind.None}};for(let v of p)v.fillServerCapabilities(k.capabilities);return k}}),i.onRequest(X.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,_)return _(new X.CancellationTokenSource().token)}),i.onNotification(X.ExitNotification.type,()=>{try{L&&L()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(X.SetTraceNotification.type,x=>{s.trace=X.Trace.fromString(x.value)}),M}De.createConnection=EC});var jk=g(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.resolveModulePath=hn.FileSystem=hn.resolveGlobalYarnPath=hn.resolveGlobalNodePath=hn.resolve=hn.uriToFilePath=void 0;var AC=require("url"),Zn=require("path"),ph=require("fs"),yh=require("child_process");function OC(t){let e=AC.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 Zn.normalize(n.join("/"))}hn.uriToFilePath=OC;function hh(){return process.platform==="win32"}function qc(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&&ph.existsSync(e)&&(c[i]?c[i]=e+Zn.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,yh.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",p=>{a(p)}),l.on("message",p=>{p.c==="r"&&(l.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${t}`)))});let d={c:"rs",a:t};l.send(d)}catch(l){a(l)}})}hn.resolve=qc;function gh(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};hh()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,yh.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?hh()?Zn.join(o,"node_modules"):Zn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}hn.resolveGlobalNodePath=gh;function CC(t){let e="yarn",n={encoding:"utf8"};hh()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,yh.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 Zn.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}hn.resolveGlobalYarnPath=CC;var mh;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!ph.existsSync(__filename.toUpperCase())||!ph.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Zn.normalize(s).indexOf(Zn.normalize(i))===0:Zn.normalize(s).toLowerCase().indexOf(Zn.normalize(i).toLowerCase())===0}t.isParent=r})(mh||(hn.FileSystem=mh={}));function RC(t,e,n,r){return n?(Zn.isAbsolute(n)||(n=Zn.join(t,n)),qc(e,n,n,r).then(i=>mh.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>qc(e,gh(r),t,r))):qc(e,gh(r),t,r)}hn.resolveModulePath=RC});var bh=g((S2,Fk)=>{"use strict";Fk.exports=yt()});var $k=g(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.InlineCompletionFeature=void 0;var PC=yt(),DC=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(PC.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};jc.InlineCompletionFeature=DC});var Hk=g(zt=>{"use strict";var IC=zt&&zt.__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]}),Uk=zt&&zt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&IC(e,t,n)};Object.defineProperty(zt,"__esModule",{value:!0});zt.ProposedFeatures=zt.NotebookDocuments=zt.TextDocuments=zt.SemanticTokensBuilder=void 0;var MC=eh();Object.defineProperty(zt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return MC.SemanticTokensBuilder}});var LC=$k();Uk(yt(),zt);var NC=ih();Object.defineProperty(zt,"TextDocuments",{enumerable:!0,get:function(){return NC.TextDocuments}});var qC=oh();Object.defineProperty(zt,"NotebookDocuments",{enumerable:!0,get:function(){return qC.NotebookDocuments}});Uk(fh(),zt);var Bk;(function(t){t.all={__brand:"features",languages:LC.InlineCompletionFeature}})(Bk||(zt.ProposedFeatures=Bk={}))});var Xk=g(Mn=>{"use strict";var jC=Mn&&Mn.__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]}),Vk=Mn&&Mn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&jC(e,t,n)};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.createConnection=Mn.Files=void 0;var Wk=require("node:util"),vh=xu(),FC=fh(),na=jk(),Hi=bh();Vk(bh(),Mn);Vk(Hk(),Mn);var Gk;(function(t){t.uriToFilePath=na.uriToFilePath,t.resolveGlobalNodePath=na.resolveGlobalNodePath,t.resolveGlobalYarnPath=na.resolveGlobalYarnPath,t.resolve=na.resolve,t.resolveModulePath=na.resolveModulePath})(Gk||(Mn.Files=Gk={}));var Kk;function Fc(){if(Kk!==void 0)try{Kk.end()}catch{}}var Hs=!1,zk;function $C(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(zk=setInterval(()=>{try{process.kill(r,0)}catch{Fc(),process.exit(Hs?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])}}}$C();var BC={initialize:t=>{let e=t.processId;vh.number(e)&&zk===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Hs?0:1)}},3e3)},get shutdownReceived(){return Hs},set shutdownReceived(t){Hs=t},exit:t=>{Fc(),process.exit(t)}};function UC(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Hi.ConnectionStrategy.is(t)||Hi.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),HC(s,o,a,i)}Mn.createConnection=UC;function HC(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let d=0;d<l.length;d++){let p=l[d];if(p==="--node-ipc"){t=new Hi.IPCMessageReader(process),e=new Hi.IPCMessageWriter(process);break}else if(p==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(p==="--socket"){u=parseInt(l[d+1]);break}else if(p==="--pipe"){c=l[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let d=(0,Hi.createServerSocketTransport)(u);t=d[0],e=d[1]}else if(c){let d=(0,Hi.createServerPipeTransport)(c);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(vh.func(t.read)&&vh.func(t.on)){let u=t;u.on("end",()=>{Fc(),process.exit(Hs?0:1)}),u.on("close",()=>{Fc(),process.exit(Hs?0:1)})}let a=u=>{let c=(0,Hi.createProtocolConnection)(t,e,u,n);return i&&WC(u),c};return(0,FC.createConnection)(a,BC,r)}function WC(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,Wk.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,Wk.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 _h=g((A2,Yk)=>{"use strict";Yk.exports=Xk()});var Ws=g(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.IndentationType=Nr.ConfigurationNamespace=Nr.LanguageId=void 0;Nr.LanguageId="miniscript";Nr.ConfigurationNamespace="miniscript";var GC;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(GC=Nr.IndentationType||(Nr.IndentationType={}))});var ra=g($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.Position=void 0;var Th=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};$c.Position=Th});var ci=g(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.LiteralToken=Sn.Token=Sn.BaseToken=Sn.BaseTokenOptions=Sn.TokenType=void 0;var Jk=ra(),KC;(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"})(KC=Sn.TokenType||(Sn.TokenType={}));var Sh=class{};Sn.BaseTokenOptions=Sh;var ia=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 Jk.Position(this.line,r[0]-n[0]+1),this.end=new Jk.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}']`}};Sn.BaseToken=ia;var kh=class extends ia{};Sn.Token=kh;var xh=class extends ia{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}]`}};Sn.LiteralToken=xh});var Bc=g(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.CharacterCode=void 0;var VC;(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"})(VC=sa.CharacterCode||(sa.CharacterCode={}))});var Gs=g(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.Keyword=void 0;var zC;(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"})(zC=oa.Keyword||(oa.Keyword={}))});var Ah=g(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var Ln=Bc(),XC=Gs(),wh=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(XC.Keyword)))}isWhitespace(e){return Ln.CharacterCode.WHITESPACE===e||Ln.CharacterCode.TAB===e}isEndOfLine(e){return Ln.CharacterCode.NEW_LINE===e||Ln.CharacterCode.RETURN_LINE===e}isComment(e,n){return Ln.CharacterCode.SLASH===e&&Ln.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>=Ln.CharacterCode.NUMBER_0&&e<=Ln.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Ln.CharacterCode.RETURN_LINE:return Ln.CharacterCode.NEW_LINE===n;case Ln.CharacterCode.NEW_LINE:return Ln.CharacterCode.RETURN_LINE===n}return!1}};Eh.default=wh});var Uc=g(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.ParserException=Ks.LexerException=void 0;var Oh=class extends Error{constructor(e,n){super(e),this.range=n}};Ks.LexerException=Oh;var Ch=class extends Error{constructor(e,n){super(e),this.range=n}};Ks.ParserException=Ch});var Rh=g(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.Literal=void 0;var YC;(function(t){t.True="true",t.False="false",t.Null="null"})(YC=aa.Literal||(aa.Literal={}))});var Vs=g(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.Operator=void 0;var JC;(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"})(JC=ua.Operator||(ua.Operator={}))});var ca=g(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Range=void 0;var Ph=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};Hc.Range=Ph});var Mh=g(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});var Dh=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}};Ih.default=Dh});var qh=g(da=>{"use strict";var Zk=da&&da.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(da,"__esModule",{value:!0});var rt=ci(),QC=Zk(Ah()),_e=Bc(),ZC=Uc(),Lh=Gs(),la=Rh(),it=Vs(),zs=ra(),Nh=ca(),Qk=Zk(Mh());function li(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Wc=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 QC.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new Qk.default,r.snapshot=new Qk.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 rt.Token({type:rt.TokenType.EOL,value:it.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 rt.Token({type:rt.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 rt.Token({type:rt.TokenType.EOF,value:it.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 rt.LiteralToken({type:rt.TokenType.BooleanLiteral,value:e===la.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 rt.LiteralToken({type:rt.TokenType.NilLiteral,value:null,raw:la.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 rt.Token({type:rt.TokenType.SliceOperator,value:it.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 rt.Token({type:rt.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 rt.LiteralToken({type:rt.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 y=n.codeAt();if(n.validator.isEndOfLine(y))r.isWinNewline(y,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(_e.CharacterCode.QUOTE===y){if(_e.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Nh.Range(new zs.Position(i,o-a+1),new zs.Position(n.line,n.index-u+2)));n.index++;let l=n.content.slice(n.tokenStart,n.index),d=l.slice(1,-1).replace(/""/g,it.Operator.Escape),p=new rt.LiteralToken({type:rt.TokenType.StringLiteral,value:d,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(p),p}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 rt.Token({type:rt.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)||_e.CharacterCode.DOT===i||_e.CharacterCode.LETTER_E===i||_e.CharacterCode.LETTER_e===i||(_e.CharacterCode.MINUS===i||_e.CharacterCode.PLUS===i)&&(_e.CharacterCode.LETTER_E===r||_e.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 Nh.Range(new zs.Position(this.line,this.tokenStart-this.offset+1),new zs.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 Lh.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Lh.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Lh.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new rt.Token({type:rt.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 la.Literal.True:case la.Literal.False:return n.createBoolean(i,e);case la.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 Nh.Range(new zs.Position(s,e.tokenStart-e.offset+1),new zs.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 ZC.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new rt.Token({type:rt.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};da.default=Wc;Wc.scanHandlers={[_e.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[_e.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(it.Operator.Member,e))},[_e.CharacterCode.EQUAL]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.Equal,e):this.scanPunctuator(it.Operator.Assign,e)},[_e.CharacterCode.ARROW_LEFT]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.LessThanOrEqual,e):this.scanPunctuator(it.Operator.LessThan,e)},[_e.CharacterCode.ARROW_RIGHT]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.GreaterThanOrEqual,e):this.scanPunctuator(it.Operator.GreaterThan,e)},[_e.CharacterCode.EXCLAMATION_MARK]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.NotEqual,e):(this.index++,null)},[_e.CharacterCode.MINUS]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.SubtractShorthand,e):this.scanPunctuator(it.Operator.Minus,e)},[_e.CharacterCode.PLUS]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.AddShorthand,e):this.scanPunctuator(it.Operator.Plus,e)},[_e.CharacterCode.ASTERISK]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.MultiplyShorthand,e):this.scanPunctuator(it.Operator.Asterik,e)},[_e.CharacterCode.SLASH]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.DivideShorthand,e):this.scanPunctuator(it.Operator.Slash,e)},[_e.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[_e.CharacterCode.CARET]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.PowerShorthand,e):this.scanPunctuator(it.Operator.Power,e)},[_e.CharacterCode.PERCENT]:function(e){return _e.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.ModuloShorthand,e):this.scanPunctuator(it.Operator.Modulo,e)},[_e.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[_e.CharacterCode.COMMA]:li,[_e.CharacterCode.CURLY_BRACKET_LEFT]:li,[_e.CharacterCode.CURLY_BRACKET_RIGHT]:li,[_e.CharacterCode.SQUARE_BRACKETS_LEFT]:li,[_e.CharacterCode.SQUARE_BRACKETS_RIGHT]:li,[_e.CharacterCode.PARENTHESIS_LEFT]:li,[_e.CharacterCode.PARENTHESIS_RIGHT]:li,[_e.CharacterCode.AT_SIGN]:li}});var dt=g(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ASTComment=kn.ASTBaseBlockWithScope=kn.ASTBaseBlock=kn.ASTBase=kn.ASTType=void 0;var ex;(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"})(ex=kn.ASTType||(kn.ASTType={}));var fa=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})}};kn.ASTBase=fa;var Gc=class t extends fa{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})}};_n.ASTBaseBlock=Uc;var Dh=class t extends Uc{constructor(e,n){super(e,n),this.namespaces=n.namespaces||new Set,this.assignments=n.assignments||[],this.returns=n.returns||[]}clone(){return new t(this.type,{namespaces:this.namespaces,assignments:this.assignments.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})}};_n.ASTBaseBlockWithScope=Dh;var Ph=class t extends ca{constructor(e){super(Bk.Comment,e),this.value=e.value,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,start:this.start,end:this.end,range:this.range,scope:this.scope})}};_n.ASTComment=Ph});var Mh=g(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.ASTAssignmentStatement=void 0;var Uk=ct(),Ih=class t extends Uk.ASTBase{constructor(e){super(Uk.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})}};Hc.ASTAssignmentStatement=Ih});var qh=g(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ASTBinaryExpression=void 0;var Hk=ct(),Lh=class t extends Hk.ASTBase{constructor(e){super(Hk.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})}};Wc.ASTBinaryExpression=Lh});var Fh=g(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.ASTCallExpression=Gs.ASTCallStatement=void 0;var Gc=ct(),Nh=class t extends Gc.ASTBase{constructor(e){super(Gc.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})}};Gs.ASTCallStatement=Nh;var jh=class t extends Gc.ASTBase{constructor(e){super(Gc.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})}};Gs.ASTCallExpression=jh});var Bh=g(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ASTChunk=void 0;var Wk=ct(),$h=class t extends Wk.ASTBaseBlockWithScope{constructor(e){super(Wk.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(`
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})}};kn.ASTBaseBlock=Gc;var jh=class t extends Gc{constructor(e,n){super(e,n),this.namespaces=n.namespaces||new Set,this.assignments=n.assignments||[],this.returns=n.returns||[]}clone(){return new t(this.type,{namespaces:this.namespaces,assignments:this.assignments.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})}};kn.ASTBaseBlockWithScope=jh;var Fh=class t extends fa{constructor(e){super(ex.Comment,e),this.value=e.value,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,start:this.start,end:this.end,range:this.range,scope:this.scope})}};kn.ASTComment=Fh});var Bh=g(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.ASTAssignmentStatement=void 0;var tx=dt(),$h=class t extends tx.ASTBase{constructor(e){super(tx.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})}};Kc.ASTAssignmentStatement=$h});var Hh=g(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ASTBinaryExpression=void 0;var nx=dt(),Uh=class t extends nx.ASTBase{constructor(e){super(nx.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})}};Vc.ASTBinaryExpression=Uh});var Kh=g(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.ASTCallExpression=Xs.ASTCallStatement=void 0;var zc=dt(),Wh=class t extends zc.ASTBase{constructor(e){super(zc.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})}};Xs.ASTCallStatement=Wh;var Gh=class t extends zc.ASTBase{constructor(e){super(zc.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})}};Xs.ASTCallExpression=Gh});var zh=g(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.ASTChunk=void 0;var rx=dt(),Vh=class t extends rx.ASTBaseBlockWithScope{constructor(e){super(rx.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})}};Vc.ASTChunk=$h});var Hh=g(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.ASTComparisonGroupExpression=void 0;var Gk=ct(),Uh=class t extends Gk.ASTBase{constructor(e){super(Gk.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})}};Kc.ASTComparisonGroupExpression=Uh});var Gh=g(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.ASTForGenericStatement=void 0;var Vk=ct(),Wh=class t extends Vk.ASTBaseBlock{constructor(e){super(Vk.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(`
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})}};Xc.ASTChunk=Vh});var Yh=g(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.ASTComparisonGroupExpression=void 0;var ix=dt(),Xh=class t extends ix.ASTBase{constructor(e){super(ix.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})}};Yc.ASTComparisonGroupExpression=Xh});var Qh=g(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.ASTForGenericStatement=void 0;var sx=dt(),Jh=class t extends sx.ASTBaseBlock{constructor(e){super(sx.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})}};zc.ASTForGenericStatement=Wh});var Kh=g(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.ASTFunctionStatement=void 0;var Kk=ct(),Vh=class t extends Kk.ASTBaseBlockWithScope{constructor(e){super(Kk.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(`
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})}};Jc.ASTForGenericStatement=Jh});var eg=g(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.ASTFunctionStatement=void 0;var ox=dt(),Zh=class t extends ox.ASTBaseBlockWithScope{constructor(e){super(ox.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})}};Xc.ASTFunctionStatement=Vh});var Jh=g(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.ASTIndexExpression=ai.ASTMemberExpression=ai.ASTIdentifier=void 0;var Vs=ct(),zh=class t extends Vs.ASTBase{constructor(e){super(Vs.ASTType.Identifier,e),this.name=e.name}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ai.ASTIdentifier=zh;var Xh=class t extends Vs.ASTBase{constructor(e){super(Vs.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})}};ai.ASTMemberExpression=Xh;var Yh=class t extends Vs.ASTBase{constructor(e){super(Vs.ASTType.IndexExpression,e),this.base=e.base,this.index=e.index}toString(){return`IndexExpression[${this.start}-${this.end}][${this.base}[${this.index}]]`}clone(){return new t({base:this.base.clone(),index:this.index.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ai.ASTIndexExpression=Yh});var tg=g(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.ASTElseClause=cr.ASTIfClause=cr.ASTIfStatement=cr.ASTClause=void 0;var zk=ct(),la=class extends zk.ASTBaseBlock{};cr.ASTClause=la;var Qh=class t extends zk.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(`
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})}};Qc.ASTFunctionStatement=Zh});var ig=g(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.ASTIndexExpression=di.ASTMemberExpression=di.ASTIdentifier=void 0;var Ys=dt(),tg=class t extends Ys.ASTBase{constructor(e){super(Ys.ASTType.Identifier,e),this.name=e.name}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,range:this.range,scope:this.scope})}};di.ASTIdentifier=tg;var ng=class t extends Ys.ASTBase{constructor(e){super(Ys.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})}};di.ASTMemberExpression=ng;var rg=class t extends Ys.ASTBase{constructor(e){super(Ys.ASTType.IndexExpression,e),this.base=e.base,this.index=e.index}toString(){return`IndexExpression[${this.start}-${this.end}][${this.base}[${this.index}]]`}clone(){return new t({base:this.base.clone(),index:this.index.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};di.ASTIndexExpression=rg});var ug=g(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.ASTElseClause=pr.ASTIfClause=pr.ASTIfStatement=pr.ASTClause=void 0;var ax=dt(),pa=class extends ax.ASTBaseBlock{};pr.ASTClause=pa;var sg=class t extends ax.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})}};cr.ASTIfStatement=Qh;var Zh=class t extends la{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(`
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})}};pr.ASTIfStatement=sg;var og=class t extends pa{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})}};cr.ASTIfClause=Zh;var eg=class t extends la{constructor(e,n){super(e,n)}toString(){if(this.body.length===0)return`${this.type}[]`;let e=this.body.map(n=>`${n}`).join(`
66
+ ]`}clone(){return new t(this.type,{condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};pr.ASTIfClause=og;var ag=class t extends pa{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})}};cr.ASTElseClause=eg});var rg=g(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.ASTIsaExpression=void 0;var Xk=ct(),ng=class t extends Xk.ASTBase{constructor(e){super(Xk.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})}};Yc.ASTIsaExpression=ng});var og=g(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.ASTListConstructorExpression=Ks.ASTListValue=void 0;var Jc=ct(),ig=class t extends Jc.ASTBase{constructor(e){super(Jc.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})}};Ks.ASTListValue=ig;var sg=class t extends Jc.ASTBase{constructor(e){super(Jc.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(`
71
+ }]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};pr.ASTElseClause=ag});var lg=g(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.ASTIsaExpression=void 0;var ux=dt(),cg=class t extends ux.ASTBase{constructor(e){super(ux.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})}};Zc.ASTIsaExpression=cg});var pg=g(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.ASTListConstructorExpression=Js.ASTListValue=void 0;var el=dt(),dg=class t extends el.ASTBase{constructor(e){super(el.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})}};Js.ASTListValue=dg;var fg=class t extends el.ASTBase{constructor(e){super(el.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})}};Ks.ASTListConstructorExpression=sg});var fg=g(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.ASTNilLiteral=In.ASTStringLiteral=In.ASTBooleanLiteral=In.ASTNumericLiteral=In.ASTLiteral=void 0;var Yk=si(),dg=ct(),$i=class extends dg.ASTBase{};In.ASTLiteral=$i;var ag=class t extends $i{constructor(e){super(Yk.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}};In.ASTNumericLiteral=ag;var ug=class t extends $i{constructor(e){super(Yk.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}};In.ASTBooleanLiteral=ug;var cg=class t extends $i{constructor(e){super(dg.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})}};In.ASTStringLiteral=cg;var lg=class t extends $i{constructor(e){super(dg.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})}};In.ASTNilLiteral=lg});var hg=g(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.ASTLogicalExpression=void 0;var Jk=ct(),pg=class t extends Jk.ASTBase{constructor(e){super(Jk.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})}};Qc.ASTLogicalExpression=pg});var yg=g(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.ASTMapConstructorExpression=zs.ASTMapKeyString=void 0;var Zc=ct(),gg=class t extends Zc.ASTBase{constructor(e){super(Zc.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})}};zs.ASTMapKeyString=gg;var mg=class t extends Zc.ASTBase{constructor(e){super(Zc.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(`
76
+ ]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Js.ASTListConstructorExpression=fg});var vg=g(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ASTNilLiteral=Nn.ASTStringLiteral=Nn.ASTBooleanLiteral=Nn.ASTNumericLiteral=Nn.ASTLiteral=void 0;var cx=ci(),bg=dt(),Wi=class extends bg.ASTBase{};Nn.ASTLiteral=Wi;var hg=class t extends Wi{constructor(e){super(cx.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}};Nn.ASTNumericLiteral=hg;var gg=class t extends Wi{constructor(e){super(cx.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}};Nn.ASTBooleanLiteral=gg;var mg=class t extends Wi{constructor(e){super(bg.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})}};Nn.ASTStringLiteral=mg;var yg=class t extends Wi{constructor(e){super(bg.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})}};Nn.ASTNilLiteral=yg});var Tg=g(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.ASTLogicalExpression=void 0;var lx=dt(),_g=class t extends lx.ASTBase{constructor(e){super(lx.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})}};tl.ASTLogicalExpression=_g});var xg=g(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.ASTMapConstructorExpression=Qs.ASTMapKeyString=void 0;var nl=dt(),Sg=class t extends nl.ASTBase{constructor(e){super(nl.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})}};Qs.ASTMapKeyString=Sg;var kg=class t extends nl.ASTBase{constructor(e){super(nl.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})}};zs.ASTMapConstructorExpression=mg});var vg=g(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.ASTParenthesisExpression=void 0;var Qk=ct(),bg=class t extends Qk.ASTBase{constructor(e){super(Qk.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})}};el.ASTParenthesisExpression=bg});var Tg=g(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.ASTReturnStatement=void 0;var Zk=ct(),_g=class t extends Zk.ASTBase{constructor(e){super(Zk.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})}};tl.ASTReturnStatement=_g});var kg=g(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.ASTSliceExpression=void 0;var ex=ct(),Sg=class t extends ex.ASTBase{constructor(e){super(ex.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})}};nl.ASTSliceExpression=Sg});var Eg=g(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.ASTUnaryExpression=void 0;var xg=Hs(),rl=ct(),wg=class t extends rl.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case xg.Operator.Not:return rl.ASTType.NegationExpression;case xg.Operator.Plus:case xg.Operator.Minus:return rl.ASTType.BinaryNegatedExpression;default:return rl.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})}};il.ASTUnaryExpression=wg});var Og=g(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.ASTWhileStatement=void 0;var tx=ct(),Ag=class t extends tx.ASTBaseBlock{constructor(e){super(tx.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(`
81
+ ]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Qs.ASTMapConstructorExpression=kg});var Eg=g(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.ASTParenthesisExpression=void 0;var dx=dt(),wg=class t extends dx.ASTBase{constructor(e){super(dx.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})}};rl.ASTParenthesisExpression=wg});var Og=g(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.ASTReturnStatement=void 0;var fx=dt(),Ag=class t extends fx.ASTBase{constructor(e){super(fx.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})}};il.ASTReturnStatement=Ag});var Rg=g(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.ASTSliceExpression=void 0;var px=dt(),Cg=class t extends px.ASTBase{constructor(e){super(px.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})}};sl.ASTSliceExpression=Cg});var Ig=g(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.ASTUnaryExpression=void 0;var Pg=Vs(),ol=dt(),Dg=class t extends ol.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case Pg.Operator.Not:return ol.ASTType.NegationExpression;case Pg.Operator.Plus:case Pg.Operator.Minus:return ol.ASTType.BinaryNegatedExpression;default:return ol.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})}};al.ASTUnaryExpression=Dg});var Lg=g(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.ASTWhileStatement=void 0;var hx=dt(),Mg=class t extends hx.ASTBaseBlock{constructor(e){super(hx.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})}};sl.ASTWhileStatement=Ag});var Pg=g(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.ASTWhileStatement=X.ASTUnaryExpression=X.ASTSliceExpression=X.ASTReturnStatement=X.ASTParenthesisExpression=X.ASTMapKeyString=X.ASTMapConstructorExpression=X.ASTLogicalExpression=X.ASTStringLiteral=X.ASTNumericLiteral=X.ASTNilLiteral=X.ASTLiteral=X.ASTBooleanLiteral=X.ASTListValue=X.ASTListConstructorExpression=X.ASTIsaExpression=X.ASTIfStatement=X.ASTIfClause=X.ASTElseClause=X.ASTClause=X.ASTMemberExpression=X.ASTIndexExpression=X.ASTIdentifier=X.ASTFunctionStatement=X.ASTForGenericStatement=X.ASTComparisonGroupExpression=X.ASTChunk=X.ASTCallStatement=X.ASTCallExpression=X.ASTBinaryExpression=X.ASTType=X.ASTComment=X.ASTBaseBlockWithScope=X.ASTBaseBlock=X.ASTBase=X.ASTAssignmentStatement=X.ASTProvider=void 0;var ol=si(),B1=Mh(),xt=ct(),U1=qh(),nx=Fh(),H1=Bh(),W1=Hh(),G1=Gh(),V1=Kh(),Cg=Jh(),ui=tg(),K1=rg(),rx=og(),al=fg(),z1=hg(),ix=yg(),X1=vg(),Y1=Tg(),J1=kg(),Q1=Eg(),Z1=Og(),Rg=class{breakStatement(e){return new xt.ASTBase(xt.ASTType.BreakStatement,e)}continueStatement(e){return new xt.ASTBase(xt.ASTType.ContinueStatement,e)}returnStatement(e){return new Y1.ASTReturnStatement(e)}ifShortcutStatement(e){return new ui.ASTIfStatement(xt.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new ui.ASTIfClause(xt.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new ui.ASTIfClause(xt.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new ui.ASTElseClause(xt.ASTType.ElseShortcutClause,e)}ifStatement(e){return new ui.ASTIfStatement(xt.ASTType.IfStatement,e)}ifClause(e){return new ui.ASTIfClause(xt.ASTType.IfClause,e)}elseifClause(e){return new ui.ASTIfClause(xt.ASTType.ElseifClause,e)}elseClause(e){return new ui.ASTElseClause(xt.ASTType.ElseClause,e)}whileStatement(e){return new Z1.ASTWhileStatement(e)}assignmentStatement(e){return new B1.ASTAssignmentStatement(e)}callStatement(e){return new nx.ASTCallStatement(e)}functionStatement(e){return new V1.ASTFunctionStatement(e)}forGenericStatement(e){return new G1.ASTForGenericStatement(e)}chunk(e){return new H1.ASTChunk(e)}identifier(e){return new Cg.ASTIdentifier(e)}literal(e,n){switch(e){case ol.TokenType.StringLiteral:return new al.ASTStringLiteral(n);case ol.TokenType.NumericLiteral:return new al.ASTNumericLiteral(n);case ol.TokenType.BooleanLiteral:return new al.ASTBooleanLiteral(n);case ol.TokenType.NilLiteral:return new al.ASTNilLiteral(n)}}memberExpression(e){return new Cg.ASTMemberExpression(e)}callExpression(e){return new nx.ASTCallExpression(e)}comment(e){return new xt.ASTComment(e)}unaryExpression(e){return new Q1.ASTUnaryExpression(e)}mapKeyString(e){return new ix.ASTMapKeyString(e)}mapConstructorExpression(e){return new ix.ASTMapConstructorExpression(e)}listValue(e){return new rx.ASTListValue(e)}listConstructorExpression(e){return new rx.ASTListConstructorExpression(e)}unknown(e){return new xt.ASTBase(xt.ASTType.Unknown,e)}emptyExpression(e){return new xt.ASTBase(xt.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new xt.ASTBase(xt.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new Cg.ASTIndexExpression(e)}logicalExpression(e){return new z1.ASTLogicalExpression(e)}isaExpression(e){return new K1.ASTIsaExpression(e)}binaryExpression(e){return new U1.ASTBinaryExpression(e)}sliceExpression(e){return new J1.ASTSliceExpression(e)}parenthesisExpression(e){return new X1.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new W1.ASTComparisonGroupExpression(e)}};X.ASTProvider=Rg;var eR=Mh();Object.defineProperty(X,"ASTAssignmentStatement",{enumerable:!0,get:function(){return eR.ASTAssignmentStatement}});var da=ct();Object.defineProperty(X,"ASTBase",{enumerable:!0,get:function(){return da.ASTBase}});Object.defineProperty(X,"ASTBaseBlock",{enumerable:!0,get:function(){return da.ASTBaseBlock}});Object.defineProperty(X,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return da.ASTBaseBlockWithScope}});Object.defineProperty(X,"ASTComment",{enumerable:!0,get:function(){return da.ASTComment}});Object.defineProperty(X,"ASTType",{enumerable:!0,get:function(){return da.ASTType}});var tR=qh();Object.defineProperty(X,"ASTBinaryExpression",{enumerable:!0,get:function(){return tR.ASTBinaryExpression}});var sx=Fh();Object.defineProperty(X,"ASTCallExpression",{enumerable:!0,get:function(){return sx.ASTCallExpression}});Object.defineProperty(X,"ASTCallStatement",{enumerable:!0,get:function(){return sx.ASTCallStatement}});var nR=Bh();Object.defineProperty(X,"ASTChunk",{enumerable:!0,get:function(){return nR.ASTChunk}});var rR=Hh();Object.defineProperty(X,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return rR.ASTComparisonGroupExpression}});var iR=Gh();Object.defineProperty(X,"ASTForGenericStatement",{enumerable:!0,get:function(){return iR.ASTForGenericStatement}});var sR=Kh();Object.defineProperty(X,"ASTFunctionStatement",{enumerable:!0,get:function(){return sR.ASTFunctionStatement}});var Dg=Jh();Object.defineProperty(X,"ASTIdentifier",{enumerable:!0,get:function(){return Dg.ASTIdentifier}});Object.defineProperty(X,"ASTIndexExpression",{enumerable:!0,get:function(){return Dg.ASTIndexExpression}});Object.defineProperty(X,"ASTMemberExpression",{enumerable:!0,get:function(){return Dg.ASTMemberExpression}});var ul=tg();Object.defineProperty(X,"ASTClause",{enumerable:!0,get:function(){return ul.ASTClause}});Object.defineProperty(X,"ASTElseClause",{enumerable:!0,get:function(){return ul.ASTElseClause}});Object.defineProperty(X,"ASTIfClause",{enumerable:!0,get:function(){return ul.ASTIfClause}});Object.defineProperty(X,"ASTIfStatement",{enumerable:!0,get:function(){return ul.ASTIfStatement}});var oR=rg();Object.defineProperty(X,"ASTIsaExpression",{enumerable:!0,get:function(){return oR.ASTIsaExpression}});var ox=og();Object.defineProperty(X,"ASTListConstructorExpression",{enumerable:!0,get:function(){return ox.ASTListConstructorExpression}});Object.defineProperty(X,"ASTListValue",{enumerable:!0,get:function(){return ox.ASTListValue}});var fa=fg();Object.defineProperty(X,"ASTBooleanLiteral",{enumerable:!0,get:function(){return fa.ASTBooleanLiteral}});Object.defineProperty(X,"ASTLiteral",{enumerable:!0,get:function(){return fa.ASTLiteral}});Object.defineProperty(X,"ASTNilLiteral",{enumerable:!0,get:function(){return fa.ASTNilLiteral}});Object.defineProperty(X,"ASTNumericLiteral",{enumerable:!0,get:function(){return fa.ASTNumericLiteral}});Object.defineProperty(X,"ASTStringLiteral",{enumerable:!0,get:function(){return fa.ASTStringLiteral}});var aR=hg();Object.defineProperty(X,"ASTLogicalExpression",{enumerable:!0,get:function(){return aR.ASTLogicalExpression}});var ax=yg();Object.defineProperty(X,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return ax.ASTMapConstructorExpression}});Object.defineProperty(X,"ASTMapKeyString",{enumerable:!0,get:function(){return ax.ASTMapKeyString}});var uR=vg();Object.defineProperty(X,"ASTParenthesisExpression",{enumerable:!0,get:function(){return uR.ASTParenthesisExpression}});var cR=Tg();Object.defineProperty(X,"ASTReturnStatement",{enumerable:!0,get:function(){return cR.ASTReturnStatement}});var lR=kg();Object.defineProperty(X,"ASTSliceExpression",{enumerable:!0,get:function(){return lR.ASTSliceExpression}});var dR=Eg();Object.defineProperty(X,"ASTUnaryExpression",{enumerable:!0,get:function(){return dR.ASTUnaryExpression}});var fR=Og();Object.defineProperty(X,"ASTWhileStatement",{enumerable:!0,get:function(){return fR.ASTWhileStatement}})});var Lg=g(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});var ci=si(),Ig=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([ci.TokenType.StringLiteral,ci.TokenType.NumericLiteral,ci.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([ci.TokenType.StringLiteral,ci.TokenType.NumericLiteral,ci.TokenType.BooleanLiteral,ci.TokenType.NilLiteral]))}isComment(e){return e===ci.TokenType.Comment}};Mg.default=Ig});var Ng=g(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.SelectorGroups=se.SelectorGroupType=se.getSelectorsFromGroup=se.createSelectorGroup=se.Selectors=se.getSelectorValue=se.createSelector=se.createSelectorOptions=se.SelectorType=void 0;var ue=si(),Yn=Bs(),ve=Hs(),pR;(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"})(pR=se.SelectorType||(se.SelectorType={}));var qg=class{};se.createSelectorOptions=qg;function ie(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}se.createSelector=ie;function hR(t){return t.data.value}se.getSelectorValue=hR;se.Selectors={EndOfLine:ie({type:ue.TokenType.EOL,value:ve.Operator.EndOfLine}),EndOfFile:ie({type:ue.TokenType.EOF,value:ve.Operator.EndOfFile}),LParenthesis:ie({type:ue.TokenType.Punctuator,value:ve.Operator.LParenthesis}),RParenthesis:ie({type:ue.TokenType.Punctuator,value:ve.Operator.RParenthesis}),CLBracket:ie({type:ue.TokenType.Punctuator,value:ve.Operator.CLBracket}),CRBracket:ie({type:ue.TokenType.Punctuator,value:ve.Operator.CRBracket}),SLBracket:ie({type:ue.TokenType.Punctuator,value:ve.Operator.SLBracket}),SRBracket:ie({type:ue.TokenType.Punctuator,value:ve.Operator.SRBracket}),Assign:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Assign}),AddShorthand:ie({type:ue.TokenType.Punctuator,value:ve.Operator.AddShorthand}),SubtractShorthand:ie({type:ue.TokenType.Punctuator,value:ve.Operator.SubtractShorthand}),MultiplyShorthand:ie({type:ue.TokenType.Punctuator,value:ve.Operator.MultiplyShorthand}),DivideShorthand:ie({type:ue.TokenType.Punctuator,value:ve.Operator.DivideShorthand}),PowerShorthand:ie({type:ue.TokenType.Punctuator,value:ve.Operator.PowerShorthand}),ModuloShorthand:ie({type:ue.TokenType.Punctuator,value:ve.Operator.ModuloShorthand}),Seperator:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Comma}),Function:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.Function}),EndFunction:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.EndFunction}),EndWhile:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.EndWhile}),EndFor:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.EndFor}),EndIf:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.EndIf}),SliceSeperator:ie({type:ue.TokenType.SliceOperator,value:ve.Operator.SliceSeperator}),MapKeyValueSeperator:ie({type:ue.TokenType.SliceOperator,value:ve.Operator.SliceSeperator}),MapSeperator:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Comma}),ListSeperator:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Comma}),CallSeperator:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Comma}),ArgumentSeperator:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Comma}),ImportCodeSeperator:ie({type:ue.TokenType.SliceOperator,value:ve.Operator.SliceSeperator}),ElseIf:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.ElseIf}),Then:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.Then}),Else:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.Else}),In:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.In}),MemberSeperator:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Member}),NumberSeperator:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Member}),Reference:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Reference}),Isa:ie({type:ue.TokenType.Keyword,value:ve.Operator.Isa}),Or:ie({type:ue.TokenType.Keyword,value:ve.Operator.Or}),And:ie({type:ue.TokenType.Keyword,value:ve.Operator.And}),Minus:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Minus}),Plus:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Plus}),Times:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Asterik}),Power:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Power}),Divide:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Slash}),Mod:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Modulo}),Equal:ie({type:ue.TokenType.Punctuator,value:ve.Operator.Equal}),NotEqual:ie({type:ue.TokenType.Punctuator,value:ve.Operator.NotEqual}),Greater:ie({type:ue.TokenType.Punctuator,value:ve.Operator.GreaterThan}),GreaterEqual:ie({type:ue.TokenType.Punctuator,value:ve.Operator.GreaterThanOrEqual}),Lesser:ie({type:ue.TokenType.Punctuator,value:ve.Operator.LessThan}),LessEqual:ie({type:ue.TokenType.Punctuator,value:ve.Operator.LessThanOrEqual}),New:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.New}),Not:ie({type:ue.TokenType.Keyword,value:Yn.Keyword.Not}),Comment:ie({type:ue.TokenType.Comment})};function lr(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})}};ul.ASTWhileStatement=Mg});var Fg=g(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.ASTWhileStatement=Y.ASTUnaryExpression=Y.ASTSliceExpression=Y.ASTReturnStatement=Y.ASTParenthesisExpression=Y.ASTMapKeyString=Y.ASTMapConstructorExpression=Y.ASTLogicalExpression=Y.ASTStringLiteral=Y.ASTNumericLiteral=Y.ASTNilLiteral=Y.ASTLiteral=Y.ASTBooleanLiteral=Y.ASTListValue=Y.ASTListConstructorExpression=Y.ASTIsaExpression=Y.ASTIfStatement=Y.ASTIfClause=Y.ASTElseClause=Y.ASTClause=Y.ASTMemberExpression=Y.ASTIndexExpression=Y.ASTIdentifier=Y.ASTFunctionStatement=Y.ASTForGenericStatement=Y.ASTComparisonGroupExpression=Y.ASTChunk=Y.ASTCallStatement=Y.ASTCallExpression=Y.ASTBinaryExpression=Y.ASTType=Y.ASTComment=Y.ASTBaseBlockWithScope=Y.ASTBaseBlock=Y.ASTBase=Y.ASTAssignmentStatement=Y.ASTProvider=void 0;var cl=ci(),eR=Bh(),Et=dt(),tR=Hh(),gx=Kh(),nR=zh(),rR=Yh(),iR=Qh(),sR=eg(),Ng=ig(),fi=ug(),oR=lg(),mx=pg(),ll=vg(),aR=Tg(),yx=xg(),uR=Eg(),cR=Og(),lR=Rg(),dR=Ig(),fR=Lg(),qg=class{breakStatement(e){return new Et.ASTBase(Et.ASTType.BreakStatement,e)}continueStatement(e){return new Et.ASTBase(Et.ASTType.ContinueStatement,e)}returnStatement(e){return new cR.ASTReturnStatement(e)}ifShortcutStatement(e){return new fi.ASTIfStatement(Et.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new fi.ASTIfClause(Et.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new fi.ASTIfClause(Et.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new fi.ASTElseClause(Et.ASTType.ElseShortcutClause,e)}ifStatement(e){return new fi.ASTIfStatement(Et.ASTType.IfStatement,e)}ifClause(e){return new fi.ASTIfClause(Et.ASTType.IfClause,e)}elseifClause(e){return new fi.ASTIfClause(Et.ASTType.ElseifClause,e)}elseClause(e){return new fi.ASTElseClause(Et.ASTType.ElseClause,e)}whileStatement(e){return new fR.ASTWhileStatement(e)}assignmentStatement(e){return new eR.ASTAssignmentStatement(e)}callStatement(e){return new gx.ASTCallStatement(e)}functionStatement(e){return new sR.ASTFunctionStatement(e)}forGenericStatement(e){return new iR.ASTForGenericStatement(e)}chunk(e){return new nR.ASTChunk(e)}identifier(e){return new Ng.ASTIdentifier(e)}literal(e,n){switch(e){case cl.TokenType.StringLiteral:return new ll.ASTStringLiteral(n);case cl.TokenType.NumericLiteral:return new ll.ASTNumericLiteral(n);case cl.TokenType.BooleanLiteral:return new ll.ASTBooleanLiteral(n);case cl.TokenType.NilLiteral:return new ll.ASTNilLiteral(n)}}memberExpression(e){return new Ng.ASTMemberExpression(e)}callExpression(e){return new gx.ASTCallExpression(e)}comment(e){return new Et.ASTComment(e)}unaryExpression(e){return new dR.ASTUnaryExpression(e)}mapKeyString(e){return new yx.ASTMapKeyString(e)}mapConstructorExpression(e){return new yx.ASTMapConstructorExpression(e)}listValue(e){return new mx.ASTListValue(e)}listConstructorExpression(e){return new mx.ASTListConstructorExpression(e)}unknown(e){return new Et.ASTBase(Et.ASTType.Unknown,e)}emptyExpression(e){return new Et.ASTBase(Et.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new Et.ASTBase(Et.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new Ng.ASTIndexExpression(e)}logicalExpression(e){return new aR.ASTLogicalExpression(e)}isaExpression(e){return new oR.ASTIsaExpression(e)}binaryExpression(e){return new tR.ASTBinaryExpression(e)}sliceExpression(e){return new lR.ASTSliceExpression(e)}parenthesisExpression(e){return new uR.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new rR.ASTComparisonGroupExpression(e)}};Y.ASTProvider=qg;var pR=Bh();Object.defineProperty(Y,"ASTAssignmentStatement",{enumerable:!0,get:function(){return pR.ASTAssignmentStatement}});var ha=dt();Object.defineProperty(Y,"ASTBase",{enumerable:!0,get:function(){return ha.ASTBase}});Object.defineProperty(Y,"ASTBaseBlock",{enumerable:!0,get:function(){return ha.ASTBaseBlock}});Object.defineProperty(Y,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return ha.ASTBaseBlockWithScope}});Object.defineProperty(Y,"ASTComment",{enumerable:!0,get:function(){return ha.ASTComment}});Object.defineProperty(Y,"ASTType",{enumerable:!0,get:function(){return ha.ASTType}});var hR=Hh();Object.defineProperty(Y,"ASTBinaryExpression",{enumerable:!0,get:function(){return hR.ASTBinaryExpression}});var bx=Kh();Object.defineProperty(Y,"ASTCallExpression",{enumerable:!0,get:function(){return bx.ASTCallExpression}});Object.defineProperty(Y,"ASTCallStatement",{enumerable:!0,get:function(){return bx.ASTCallStatement}});var gR=zh();Object.defineProperty(Y,"ASTChunk",{enumerable:!0,get:function(){return gR.ASTChunk}});var mR=Yh();Object.defineProperty(Y,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return mR.ASTComparisonGroupExpression}});var yR=Qh();Object.defineProperty(Y,"ASTForGenericStatement",{enumerable:!0,get:function(){return yR.ASTForGenericStatement}});var bR=eg();Object.defineProperty(Y,"ASTFunctionStatement",{enumerable:!0,get:function(){return bR.ASTFunctionStatement}});var jg=ig();Object.defineProperty(Y,"ASTIdentifier",{enumerable:!0,get:function(){return jg.ASTIdentifier}});Object.defineProperty(Y,"ASTIndexExpression",{enumerable:!0,get:function(){return jg.ASTIndexExpression}});Object.defineProperty(Y,"ASTMemberExpression",{enumerable:!0,get:function(){return jg.ASTMemberExpression}});var dl=ug();Object.defineProperty(Y,"ASTClause",{enumerable:!0,get:function(){return dl.ASTClause}});Object.defineProperty(Y,"ASTElseClause",{enumerable:!0,get:function(){return dl.ASTElseClause}});Object.defineProperty(Y,"ASTIfClause",{enumerable:!0,get:function(){return dl.ASTIfClause}});Object.defineProperty(Y,"ASTIfStatement",{enumerable:!0,get:function(){return dl.ASTIfStatement}});var vR=lg();Object.defineProperty(Y,"ASTIsaExpression",{enumerable:!0,get:function(){return vR.ASTIsaExpression}});var vx=pg();Object.defineProperty(Y,"ASTListConstructorExpression",{enumerable:!0,get:function(){return vx.ASTListConstructorExpression}});Object.defineProperty(Y,"ASTListValue",{enumerable:!0,get:function(){return vx.ASTListValue}});var ga=vg();Object.defineProperty(Y,"ASTBooleanLiteral",{enumerable:!0,get:function(){return ga.ASTBooleanLiteral}});Object.defineProperty(Y,"ASTLiteral",{enumerable:!0,get:function(){return ga.ASTLiteral}});Object.defineProperty(Y,"ASTNilLiteral",{enumerable:!0,get:function(){return ga.ASTNilLiteral}});Object.defineProperty(Y,"ASTNumericLiteral",{enumerable:!0,get:function(){return ga.ASTNumericLiteral}});Object.defineProperty(Y,"ASTStringLiteral",{enumerable:!0,get:function(){return ga.ASTStringLiteral}});var _R=Tg();Object.defineProperty(Y,"ASTLogicalExpression",{enumerable:!0,get:function(){return _R.ASTLogicalExpression}});var _x=xg();Object.defineProperty(Y,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return _x.ASTMapConstructorExpression}});Object.defineProperty(Y,"ASTMapKeyString",{enumerable:!0,get:function(){return _x.ASTMapKeyString}});var TR=Eg();Object.defineProperty(Y,"ASTParenthesisExpression",{enumerable:!0,get:function(){return TR.ASTParenthesisExpression}});var SR=Og();Object.defineProperty(Y,"ASTReturnStatement",{enumerable:!0,get:function(){return SR.ASTReturnStatement}});var kR=Rg();Object.defineProperty(Y,"ASTSliceExpression",{enumerable:!0,get:function(){return kR.ASTSliceExpression}});var xR=Ig();Object.defineProperty(Y,"ASTUnaryExpression",{enumerable:!0,get:function(){return xR.ASTUnaryExpression}});var wR=Lg();Object.defineProperty(Y,"ASTWhileStatement",{enumerable:!0,get:function(){return wR.ASTWhileStatement}})});var Ug=g(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});var pi=ci(),$g=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([pi.TokenType.StringLiteral,pi.TokenType.NumericLiteral,pi.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([pi.TokenType.StringLiteral,pi.TokenType.NumericLiteral,pi.TokenType.BooleanLiteral,pi.TokenType.NilLiteral]))}isComment(e){return e===pi.TokenType.Comment}};Bg.default=$g});var Wg=g(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.SelectorGroups=ue.SelectorGroupType=ue.getSelectorsFromGroup=ue.createSelectorGroup=ue.Selectors=ue.getSelectorValue=ue.createSelector=ue.createSelectorOptions=ue.SelectorType=void 0;var le=ci(),er=Gs(),Te=Vs(),ER;(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"})(ER=ue.SelectorType||(ue.SelectorType={}));var Hg=class{};ue.createSelectorOptions=Hg;function ae(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}ue.createSelector=ae;function AR(t){return t.data.value}ue.getSelectorValue=AR;ue.Selectors={EndOfLine:ae({type:le.TokenType.EOL,value:Te.Operator.EndOfLine}),EndOfFile:ae({type:le.TokenType.EOF,value:Te.Operator.EndOfFile}),LParenthesis:ae({type:le.TokenType.Punctuator,value:Te.Operator.LParenthesis}),RParenthesis:ae({type:le.TokenType.Punctuator,value:Te.Operator.RParenthesis}),CLBracket:ae({type:le.TokenType.Punctuator,value:Te.Operator.CLBracket}),CRBracket:ae({type:le.TokenType.Punctuator,value:Te.Operator.CRBracket}),SLBracket:ae({type:le.TokenType.Punctuator,value:Te.Operator.SLBracket}),SRBracket:ae({type:le.TokenType.Punctuator,value:Te.Operator.SRBracket}),Assign:ae({type:le.TokenType.Punctuator,value:Te.Operator.Assign}),AddShorthand:ae({type:le.TokenType.Punctuator,value:Te.Operator.AddShorthand}),SubtractShorthand:ae({type:le.TokenType.Punctuator,value:Te.Operator.SubtractShorthand}),MultiplyShorthand:ae({type:le.TokenType.Punctuator,value:Te.Operator.MultiplyShorthand}),DivideShorthand:ae({type:le.TokenType.Punctuator,value:Te.Operator.DivideShorthand}),PowerShorthand:ae({type:le.TokenType.Punctuator,value:Te.Operator.PowerShorthand}),ModuloShorthand:ae({type:le.TokenType.Punctuator,value:Te.Operator.ModuloShorthand}),Seperator:ae({type:le.TokenType.Punctuator,value:Te.Operator.Comma}),Function:ae({type:le.TokenType.Keyword,value:er.Keyword.Function}),EndFunction:ae({type:le.TokenType.Keyword,value:er.Keyword.EndFunction}),EndWhile:ae({type:le.TokenType.Keyword,value:er.Keyword.EndWhile}),EndFor:ae({type:le.TokenType.Keyword,value:er.Keyword.EndFor}),EndIf:ae({type:le.TokenType.Keyword,value:er.Keyword.EndIf}),SliceSeperator:ae({type:le.TokenType.SliceOperator,value:Te.Operator.SliceSeperator}),MapKeyValueSeperator:ae({type:le.TokenType.SliceOperator,value:Te.Operator.SliceSeperator}),MapSeperator:ae({type:le.TokenType.Punctuator,value:Te.Operator.Comma}),ListSeperator:ae({type:le.TokenType.Punctuator,value:Te.Operator.Comma}),CallSeperator:ae({type:le.TokenType.Punctuator,value:Te.Operator.Comma}),ArgumentSeperator:ae({type:le.TokenType.Punctuator,value:Te.Operator.Comma}),ImportCodeSeperator:ae({type:le.TokenType.SliceOperator,value:Te.Operator.SliceSeperator}),ElseIf:ae({type:le.TokenType.Keyword,value:er.Keyword.ElseIf}),Then:ae({type:le.TokenType.Keyword,value:er.Keyword.Then}),Else:ae({type:le.TokenType.Keyword,value:er.Keyword.Else}),In:ae({type:le.TokenType.Keyword,value:er.Keyword.In}),MemberSeperator:ae({type:le.TokenType.Punctuator,value:Te.Operator.Member}),NumberSeperator:ae({type:le.TokenType.Punctuator,value:Te.Operator.Member}),Reference:ae({type:le.TokenType.Punctuator,value:Te.Operator.Reference}),Isa:ae({type:le.TokenType.Keyword,value:Te.Operator.Isa}),Or:ae({type:le.TokenType.Keyword,value:Te.Operator.Or}),And:ae({type:le.TokenType.Keyword,value:Te.Operator.And}),Minus:ae({type:le.TokenType.Punctuator,value:Te.Operator.Minus}),Plus:ae({type:le.TokenType.Punctuator,value:Te.Operator.Plus}),Times:ae({type:le.TokenType.Punctuator,value:Te.Operator.Asterik}),Power:ae({type:le.TokenType.Punctuator,value:Te.Operator.Power}),Divide:ae({type:le.TokenType.Punctuator,value:Te.Operator.Slash}),Mod:ae({type:le.TokenType.Punctuator,value:Te.Operator.Modulo}),Equal:ae({type:le.TokenType.Punctuator,value:Te.Operator.Equal}),NotEqual:ae({type:le.TokenType.Punctuator,value:Te.Operator.NotEqual}),Greater:ae({type:le.TokenType.Punctuator,value:Te.Operator.GreaterThan}),GreaterEqual:ae({type:le.TokenType.Punctuator,value:Te.Operator.GreaterThanOrEqual}),Lesser:ae({type:le.TokenType.Punctuator,value:Te.Operator.LessThan}),LessEqual:ae({type:le.TokenType.Punctuator,value:Te.Operator.LessThanOrEqual}),New:ae({type:le.TokenType.Keyword,value:er.Keyword.New}),Not:ae({type:le.TokenType.Keyword,value:er.Keyword.Not}),Comment:ae({type:le.TokenType.Comment})};function hr(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,71 +93,71 @@ ${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}se.createSelectorGroup=lr;function gR(t){return t.selectors}se.getSelectorsFromGroup=gR;var dr;(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"})(dr=se.SelectorGroupType||(se.SelectorGroupType={}));se.SelectorGroups={BlockEndOfLine:lr(dr.AssignmentEndOfExpr,[se.Selectors.EndOfLine,se.Selectors.Comment]),AssignmentEndOfExpr:lr(dr.AssignmentEndOfExpr,[se.Selectors.EndOfFile,se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),AssignmentShorthand:lr(dr.AssignmentShorthand,[se.Selectors.AddShorthand,se.Selectors.SubtractShorthand,se.Selectors.MultiplyShorthand,se.Selectors.DivideShorthand,se.Selectors.PowerShorthand,se.Selectors.ModuloShorthand]),AssignmentCommandArgs:lr(dr.AssignmentCommandArgs,[se.Selectors.ArgumentSeperator,se.Selectors.EndOfLine,se.Selectors.EndOfFile]),ReturnStatementEnd:lr(dr.ReturnStatementEnd,[se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),FunctionDeclarationArgEnd:lr(dr.FunctionDeclarationArgEnd,[se.Selectors.RParenthesis,se.Selectors.EndOfFile,se.Selectors.EndOfLine]),ComparisonOperators:lr(dr.ComparisonOperators,[se.Selectors.Equal,se.Selectors.NotEqual,se.Selectors.Greater,se.Selectors.GreaterEqual,se.Selectors.Lesser,se.Selectors.LessEqual]),MultiDivOperators:lr(dr.MultiDivOperators,[se.Selectors.Times,se.Selectors.Divide,se.Selectors.Mod]),CallArgsEnd:lr(dr.CallArgsEnd,[se.Selectors.ArgumentSeperator,se.Selectors.RParenthesis])}});var Fg=g(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.Stack=void 0;var jg=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}};cl.Stack=jg});var Gg=g(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.PendingWhile=Xe.isPendingWhile=Xe.PendingIf=Xe.isPendingIf=Xe.PendingFunction=Xe.isPendingFunction=Xe.PendingFor=Xe.isPendingFor=Xe.PendingChunk=Xe.isPendingChunk=Xe.PendingBlockType=void 0;var Jn;(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"})(Jn=Xe.PendingBlockType||(Xe.PendingBlockType={}));var Bi=class{constructor(e,n){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 mR(t){return t.type===Jn.Chunk}Xe.isPendingChunk=mR;var $g=class extends Bi{constructor(e){super(e,Jn.Chunk)}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)}};Xe.PendingChunk=$g;function yR(t){return t.type===Jn.For}Xe.isPendingFor=yR;var Bg=class extends Bi{constructor(e){super(e,Jn.For)}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)}};Xe.PendingFor=Bg;function bR(t){return t.type===Jn.Function}Xe.isPendingFunction=bR;var Ug=class extends Bi{constructor(e){super(e,Jn.Function)}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)}};Xe.PendingFunction=Ug;function vR(t){return t.type===Jn.If}Xe.isPendingIf=vR;var Hg=class extends Bi{constructor(e,n){super(e,Jn.If),this.currentClause=n}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],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]],super.complete(e)}};Xe.PendingIf=Hg;function _R(t){return t.type===Jn.While}Xe.isPendingWhile=_R;var Wg=class extends Bi{constructor(e){super(e,Jn.While)}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)}};Xe.PendingWhile=Wg});var cx=g(pa=>{"use strict";var ux=pa&&pa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pa,"__esModule",{value:!0});var TR=ux(Rh()),li=si(),fr=Pg(),SR=ux(Lg()),kR=Fc(),jt=Bs(),Dr=Hs(),Jt=oa(),Y=Ng(),xR=Fg(),pr=Gg(),Vg=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new xR.Stack,r.statementErrors=[],r.lexer=n.lexer||new TR.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lines={},r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.literals=[],r.validator=n.validator||new SR.default,r.astProvider=n.astProvider||new fr.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 Jt.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,Y.getSelectorValue)(e)}" is required`,new Jt.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,Y.getSelectorsFromGroup)(e).map(i=>`"${(0,Y.getSelectorValue)(i)}"`).join(", ")} is required`,new Jt.Range(n||r.start,r.end)),null)}addItemToLines(e){let n=this.lines,r=e.end.line;for(let i=e.start.line;i<=r;i++){let s=n[i];s?s.push(e):n[i]=[e]}}skipNewlines(){let e=this,n=0;for(;;){if(Y.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,start:e.token.start,end:e.token.end,range:e.token.range,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(Y.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}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!==li.TokenType.EOL&&e.token.type!==li.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,pr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new Jt.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 pr.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!Y.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Y.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.lines,r}parseStatement(){let e=this;if(li.TokenType.Keyword===e.token.type&&jt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case jt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.addItemToLines(i),r.body.push(i);return}case jt.Keyword.If:{e.next(),e.parseIfStatement();return}case jt.Keyword.ElseIf:{e.next(),e.nextIfClause(fr.ASTType.ElseifClause);return}case jt.Keyword.Else:{e.next(),e.nextIfClause(fr.ASTType.ElseClause);return}case jt.Keyword.While:{e.next(),e.parseWhileStatement();return}case jt.Keyword.For:{e.next(),e.parseForStatement();return}case jt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case jt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case jt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case jt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case jt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let i=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}case jt.Keyword.Break:{let r=e.backpatches.peek();e.next();let i=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new Jt.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(li.TokenType.Keyword===e.token.type&&jt.Keyword.Not!==e.token.value)switch(e.token.value){case jt.Keyword.Return:return e.next(),e.parseReturnStatement();case jt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});case jt.Keyword.Break:return e.next(),e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new Jt.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(Y.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(Y.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;if(e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],o.init.type===fr.ASTType.FunctionDeclaration){let u=e.backpatches.peek();u.onComplete=c=>{o.end=c.block.end,o.range[1]=c.block.range[1]}}return e.currentAssignment=a,n.assignments.push(o),o}else if(Y.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),d=e.parseExpr(a),p=e.astProvider.parenthesisExpression({start:d.start,end:d.end,range:d.range,expression:d});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:p,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.assignments.push(a),a}let s=[];for(;!Y.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),Y.SelectorGroups.BlockEndOfLine(e.token)||Y.Selectors.Else(e.token))break;if(Y.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(Y.SelectorGroups.AssignmentCommandArgs,r.start);if(Y.Selectors.EndOfLine(a)||Y.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});if(Y.SelectorGroups.ReturnStatementEnd(e.token))s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1];else{if(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],i.type===fr.ASTType.FunctionDeclaration){let o=e.backpatches.peek();o.onComplete=a=>{s.end=a.block.end,s.range[1]=a.block.range[1]}}s.argument=i}return n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.addItemToLines(r),e.requireToken(Y.Selectors.Then,n.start),!Y.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 pr.PendingIf(i,s);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,pr.isPendingIf)(r)){n.raise("no matching open if block",new Jt.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case fr.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(Y.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 fr.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.addItemToLines(r.block),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})),Y.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.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 Jt.Range(n.start,e.token.end));return}if(!Y.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 pr.PendingWhile(i);e.backpatches.push(s),s.onComplete=o=>{e.addItemToLines(o.block),e.backpatches.pop(),e.backpatches.peek().body.push(o.block)}}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,pr.isPendingWhile)(n)){e.raise("no matching open while block",new Jt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken)}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.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(),s=e.astProvider.assignmentStatement({variable:i,init:e.astProvider.unknown({start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n}),o=e.astProvider.assignmentStatement({variable:e.astProvider.identifier({name:`__${i.name}_idx`,start:i.start,end:i.end,range:i.range,scope:n}),init:e.astProvider.literal(li.TokenType.NumericLiteral,{value:0,raw:"0",start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n});n.assignments.push(s,o),e.requireToken(Y.Selectors.In,r.start);let a=e.parseExpr(null);if(!a){e.raise("sequence expression expected for 'for' loop",new Jt.Range(r.start,e.token.end));return}if(!Y.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,a,r);let u=e.astProvider.forGenericStatement({variable:i,iterator:a,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),c=new pr.PendingFor(u);e.backpatches.push(c)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,pr.isPendingFor)(n)){e.raise("no matching open for block",new Jt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.addItemToLines(n.block),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.backpatches.peek(),o=i.parseShortcutStatement(),a=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[o],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});i.addItemToLines(a),s.body.push(a)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!Y.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),!Y.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(Y.Selectors.LParenthesis,s.start);!Y.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(),l=c;if(i.consume(Y.Selectors.Assign)){let d=i.parseExpr(null);if(d instanceof fr.ASTLiteral){let p=i.astProvider.assignmentStatement({variable:c,init:d,start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.assignments.push(p),a.push(p)}else i.raise("parameter default value must be a literal value",new Jt.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 d=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.assignments.push(d),a.push(c)}if(Y.Selectors.RParenthesis(i.token))break;if(i.requireToken(Y.Selectors.ArgumentSeperator,s.start),Y.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new Jt.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(Y.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new pr.PendingFunction(o);return i.backpatches.push(u),u.onComplete=c=>{e!==null?(e.end=c.block.end,e.range[1]=c.block.range[1],i.addItemToLines(e)):i.addItemToLines(c.block)},o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,pr.isPendingFunction)(n)){e.raise("no matching open function block",new Jt.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(;Y.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:Dr.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(;Y.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:Dr.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(Y.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:Dr.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(Y.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:Dr.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(!Y.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(Y.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(;Y.Selectors.Plus(r.token)||Y.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(;Y.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(!Y.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof fr.ASTNumericLiteral||s instanceof fr.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:Dr.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(!Y.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:Dr.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(!Y.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower();return r.astProvider.unaryExpression({operator:Dr.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(Y.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:Dr.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(;!Y.Selectors.EndOfFile(r.token);)if(Y.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier();s=r.astProvider.memberExpression({base:s,indexer:Dr.Operator.Member,identifier:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}else if(Y.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),Y.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=Y.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(Y.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=Y.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,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(Y.Selectors.SRBracket,i.start)}else if(Y.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(Y.Selectors.LParenthesis(e.token))if(e.next(),Y.Selectors.RParenthesis(e.token))e.next();else for(;!Y.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),Y.Selectors.RParenthesis(e.requireTokenOfAny(Y.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!Y.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(),Y.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!Y.Selectors.EndOfFile(r.token);){if(Y.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(Y.Selectors.MapKeyValueSeperator),r.skipNewlines(),r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:u.key,base:r.currentAssignment.variable,start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:i}),init:null,start:u.start,end:null,range:[u.range[0],null]}),l=r.currentAssignment;r.currentAssignment=c,u.value=r.parseExpr(u),r.currentAssignment=l,c.init=u.value,c.end=r.previousToken.end,c.range[1]=r.previousToken.range[1],i.assignments.push(c)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),Y.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),Y.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(!Y.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(),Y.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!Y.Selectors.EndOfFile(r.token);){if(Y.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(r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(li.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:s.start,end:r.token.end,range:[s.range[0],r.token.range[1]],scope:i}),base:r.currentAssignment.variable,start:null,end:null,range:[null,null],scope:i}),init:null,start:null,range:[null,null],end:null}),l=r.currentAssignment,d=r.token;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=l,c.variable.start=d.start,c.variable.end=r.previousToken.end,c.variable.range=[d.range[0],r.previousToken.range[1]],c.init=u.value,c.start=u.start,c.end=r.previousToken.end,c.range=[u.range[0],r.previousToken.range[1]],i.assignments.push(c)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),Y.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),Y.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(!Y.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(Y.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(li.TokenType.Identifier)?r.parseIdentifier():(r.raise(`got ${r.token} where number, string, or identifier is required`,new Jt.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(){let e=this,n=e.token,r=e.requireType(li.TokenType.Identifier);return r===null?e.parseInvalidCode():(e.currentScope.namespaces.add(r.value),e.astProvider.identifier({name:r.value,start:n.start,end:n.end,range:n.range,scope:e.currentScope}))}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 kR.ParserException(e,n);return r.statementErrors.push(i),i}};pa.default=Vg});var qe=g(Me=>{"use strict";var wR=Me&&Me.__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]}),Qn=Me&&Me.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&wR(e,t,n)},ll=Me&&Me.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Me,"__esModule",{value:!0});Me.ASTRange=Me.ASTPosition=Me.ParserValidatorm=Me.Parser=Me.LexerValidator=Me.Lexer=void 0;var ER=Rh();Object.defineProperty(Me,"Lexer",{enumerable:!0,get:function(){return ll(ER).default}});Qn(si(),Me);var AR=_h();Object.defineProperty(Me,"LexerValidator",{enumerable:!0,get:function(){return ll(AR).default}});var OR=cx();Object.defineProperty(Me,"Parser",{enumerable:!0,get:function(){return ll(OR).default}});Qn(Pg(),Me);var CR=Lg();Object.defineProperty(Me,"ParserValidatorm",{enumerable:!0,get:function(){return ll(CR).default}});Qn(Gg(),Me);Qn(Fg(),Me);Qn(Ah(),Me);Qn(jc(),Me);Qn(Fc(),Me);Qn(Bs(),Me);Qn(kh(),Me);Qn(Hs(),Me);var RR=ea();Object.defineProperty(Me,"ASTPosition",{enumerable:!0,get:function(){return RR.Position}});var DR=oa();Object.defineProperty(Me,"ASTRange",{enumerable:!0,get:function(){return DR.Range}});Qn(Ng(),Me)});var ha=g(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.isValidIdentifierLiteral=void 0;var PR=qe(),IR=t=>{if(t.type!==PR.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};dl.isValidIdentifierLiteral=IR});var Kg=g(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.getStringHashCode=di.getHashCode=di.rotateBits=void 0;function MR(t){return t>>1|t<<31}di.rotateBits=MR;function LR(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}di.getHashCode=LR;di.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 lx=g(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.createExpressionHash=void 0;var Ve=qe(),mt=Kg(),qR=ha(),Ft=(t,e)=>t.$$hash=e,NR=t=>t.$$hash??null;function rt(t){let e=NR(t);if(e!==null)return e;let n=(0,mt.getStringHashCode)(t.type);switch(t.type){case Ve.ASTType.BinaryExpression:{let r=t;return n^=(0,mt.getStringHashCode)(r.operator),n^=rt(r.left),n^=rt(r.right),Ft(t,n)}case Ve.ASTType.LogicalExpression:{let r=t;return n^=(0,mt.getStringHashCode)(r.operator),n^=rt(r.left),n^=rt(r.right),Ft(t,n)}case Ve.ASTType.IsaExpression:{let r=t;return n^=(0,mt.getStringHashCode)(r.operator),n^=rt(r.left),n^=rt(r.right),Ft(t,n)}case Ve.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=rt(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,mt.getStringHashCode)(r.operators[i]);return Ft(t,n)}case Ve.ASTType.FunctionDeclaration:{let r=t;n^=(0,mt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===Ve.ASTType.Identifier){n^=(0,mt.getStringHashCode)(s.name);continue}let o=s;n^=(0,mt.getStringHashCode)(o.variable.name),n^=rt(o.init)}return Ft(t,n)}case Ve.ASTType.ParenthesisExpression:return rt(t.expression);case Ve.ASTType.MemberExpression:{let r=t;if(r.base.type===Ve.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,mt.getStringHashCode)(Ve.ASTType.Identifier),n^=(0,mt.getStringHashCode)(r.identifier.name),Ft(t,n)}return n^=rt(r.base),n^=rt(r.identifier),Ft(t,n)}case Ve.ASTType.IndexExpression:{let r=t;if((0,qR.isValidIdentifierLiteral)(r.index)){if(r.base.type===Ve.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,mt.getStringHashCode)(Ve.ASTType.Identifier),n^=(0,mt.getStringHashCode)(r.index.value.toString()),Ft(t,n)}n=(0,mt.getStringHashCode)(Ve.ASTType.MemberExpression),n^=rt(r.base);let i=(0,mt.getStringHashCode)(Ve.ASTType.Identifier);i^=(0,mt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=rt(r.base),n^=rt(r.index);return Ft(t,n)}case Ve.ASTType.CallExpression:{let r=t;n^=rt(r.base),n^=(0,mt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=rt(s)}return Ft(t,n)}case Ve.ASTType.NegationExpression:case Ve.ASTType.BinaryNegatedExpression:case Ve.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,mt.getStringHashCode)(r.operator):1,n^=rt(r.argument),Ft(t,n)}case Ve.ASTType.Identifier:{let r=t;return n^=(0,mt.getStringHashCode)(r.name),Ft(t,n)}case Ve.ASTType.NumericLiteral:case Ve.ASTType.StringLiteral:case Ve.ASTType.NilLiteral:return n^=(0,mt.getStringHashCode)(t.value.toString()),Ft(t,n);case Ve.ASTType.MapConstructorExpression:{let r=t;n^=(0,mt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=rt(s.key),n^=rt(s.value)}return Ft(t,n)}case Ve.ASTType.ListConstructorExpression:{let r=t;n^=(0,mt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=rt(s.value)}return Ft(t,n)}case Ve.ASTType.SliceExpression:{let r=t;return n^=rt(r.base),n^=rt(r.left),n^=rt(r.right),Ft(t,n)}}return Ft(t,n)}function jR(t){return rt(t)}fl.createExpressionHash=jR});var zg=g(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.createExpressionId=void 0;var St=qe(),FR=ha(),wt=(t,e)=>t.$$id=e,$R=t=>t.$$id??null;function Ye(t){let e=$R(t);if(e!==null)return e;switch(t.type){case St.ASTType.BinaryExpression:{let n=t;return wt(t,Ye(n.left)+n.operator+Ye(n.right))}case St.ASTType.LogicalExpression:{let n=t;return wt(t,Ye(n.left)+n.operator+Ye(n.right))}case St.ASTType.IsaExpression:{let n=t;return wt(t,Ye(n.left)+n.operator+Ye(n.right))}case St.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>Ye(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return wt(t,i.join(" "))}case St.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===St.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+Ye(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),wt(t,r)}case St.ASTType.ParenthesisExpression:return wt(t,Ye(t.expression));case St.ASTType.MemberExpression:{let n=t;return wt(t,Ye(n.base)+"."+n.identifier.name)}case St.ASTType.IndexExpression:{let n=t;return(0,FR.isValidIdentifierLiteral)(n.index)?wt(t,Ye(n.base)+"."+n.index.value.toString()):wt(t,Ye(n.base)+"["+Ye(n.index)+"]")}case St.ASTType.CallExpression:{let n=t,r=Ye(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(Ye(o))}return i.length>0&&(r+="("+i.join(",")+")"),wt(t,r)}case St.ASTType.NegationExpression:case St.ASTType.BinaryNegatedExpression:case St.ASTType.UnaryExpression:{let n=t;return n.operator==null?wt(t,Ye(n.argument)):n.operator==="@"?wt(t,n.operator+Ye(n.argument)):wt(t,n.operator+" "+Ye(n.argument))}case St.ASTType.Identifier:return wt(t,t.name);case St.ASTType.NumericLiteral:case St.ASTType.StringLiteral:case St.ASTType.NilLiteral:return wt(t,t.raw.toString());case St.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Ye(s.key)+":"+Ye(s.value))}return wt(t,"{"+r.join(",")+"}")}case St.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Ye(s.value))}return wt(t,"["+r.join(",")+"]")}case St.ASTType.SliceExpression:{let n=t;return wt(t,Ye(n.base)+"["+Ye(n.left)+":"+Ye(n.right)+"]")}}return wt(t,"")}function BR(t){return Ye(t)}pl.createExpressionId=BR});var Xs=g(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.Markers=void 0;var UR;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(UR=ga.Markers||(ga.Markers={}))});var Zn=g(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.rewireSpecs=lt.rewireSource=lt.seedTokens=lt.seedSpec=lt.seedBlock=lt.splitLines=lt.splitSpace=lt.splitCR=lt.hasCR=lt.isSpace=void 0;function HR(t){return/^\s+$/.test(t)}lt.isSpace=HR;function WR(t){return/\r$/.test(t)}lt.hasCR=WR;function GR(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}lt.splitCR=GR;function VR(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}lt.splitSpace=VR;function KR(t){return t.split(/\n/)}lt.splitLines=KR;function zR(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}lt.seedBlock=zR;function XR(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}lt.seedSpec=XR;function YR(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}lt.seedTokens=YR;function JR(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}lt.rewireSource=JR;function QR(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}lt.rewireSpecs=QR});var dx=g(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});var ZR=/^@\S+/;function eD({fence:t="```"}={}){let e=tD(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)ZR.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}Xg.default=eD;function tD(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var fx=g(Yg=>{"use strict";Object.defineProperty(Yg,"__esModule",{value:!0});var nD=Xs(),ma=Zn();function rD({startLine:t=0,markers:e=nD.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,ma.seedTokens)();if([a.lineEnd,o]=(0,ma.splitCR)(o),[a.start,o]=(0,ma.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,ma.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,ma.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}}Yg.default=rD});var px=g(Jg=>{"use strict";Object.defineProperty(Jg,"__esModule",{value:!0});var iD=Zn();function sD({tokenizers:t}){return function(n){var r;let i=(0,iD.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}}Jg.default=sD});var Zg=g(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});function oD(){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)}}Qg.default=oD});var tm=g(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var aD=Zn();function uD(t="compact"){let e=lD(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,aD.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}}em.default=uD;var cD=t=>t.trim();function lD(t){return t==="compact"?e=>e.map(cD).join(""):t==="preserve"?e=>e.join(`
97
- `):t}});var im=g(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var nm=Zn(),dD=t=>t&&t.startsWith('"')&&t.endsWith('"');function fD(){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,nm.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,nm.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(!dD(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,nm.splitSpace)(r.slice(n.name.length)),e}}rm.default=fD});var om=g(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.getJoiner=void 0;var sm=Xs();function pD(t="compact",e=sm.Markers){let n=hx(t);return r=>(r.description=n(r.source,e),r)}ya.default=pD;function hx(t){return t==="compact"?hD:t==="preserve"?yD:t}ya.getJoiner=hx;function hD(t,e=sm.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var gD=(t,{tokens:e},n)=>e.type===""?t:n,mD=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function yD(t,e=sm.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(gD,0)),t.map(mD).join(`
98
- `)}});var mx=g(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var bD=Xs(),vD=Zn(),_D=dx(),TD=fx(),SD=px(),kD=Zg(),xD=tm(),wD=im(),gx=om();function ED({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=bD.Markers,tokenizers:i=[(0,kD.default)(),(0,xD.default)(n),(0,wD.default)(),(0,gx.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,TD.default)({startLine:t,markers:r}),o=(0,_D.default)({fence:e}),a=(0,SD.default)({tokenizers:i}),u=(0,gx.getJoiner)(n);return function(c){let l=[];for(let d of(0,vD.splitLines)(c)){let p=s(d);if(p===null)continue;let y=o(p),_=y.slice(1).map(a);l.push({description:u(y[0],r),tags:_,source:p,problems:_.reduce((E,L)=>E.concat(L.problems),[])})}return l}}am.default=ED});var yx=g(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});function AD(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 OD(){return t=>t.source.map(({tokens:e})=>AD(e)).join(`
99
- `)}um.default=OD});var vx=g(ba=>{"use strict";var CD=ba&&ba.__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(ba,"__esModule",{value:!0});var bx=Xs(),RD=Zn(),DD={start:0,tag:0,type:0,name:0},PD=(t=bx.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)}),Ui=t=>"".padStart(t," ");function ID(t=bx.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=Ui(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=Ui(n.start);break;case t.delim:s.start=Ui(n.start+1);break;default:s.delimiter="",s.start=Ui(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=Ui(n.tag-s.tag.length+1)),a.type||(s.postType=Ui(n.type-s.type.length+1)),a.name||(s.postName=Ui(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=CD(i,["source"]);return n=s.reduce(PD(t),Object.assign({},DD)),(0,RD.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}ba.default=ID});var _x=g(va=>{"use strict";var MD=va&&va.__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(va,"__esModule",{value:!0});var LD=Zn(),qD=t=>e=>e.slice(t),ND=t=>{let e="".padStart(t," ");return n=>n+e};function jD(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?ND(s):qD(-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=MD(i,["source"]);return(0,LD.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}va.default=jD});var Tx=g(_a=>{"use strict";var FD=_a&&_a.__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(_a,"__esModule",{value:!0});var $D=Zn();function BD(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=FD(n,["source"]);return(0,$D.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}_a.default=BD});var Sx=g(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.flow=void 0;function UD(...t){return e=>t.reduce((n,r)=>r(n),e)}hl.flow=UD});var Ex=g(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var HD=Zn(),xx={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},kx={lineEnd:"CR"},cm=Object.keys(xx),wx=t=>(0,HD.isSpace)(t)?`{${t.length}}`:t,WD=t=>"|"+t.join("|")+"|",GD=(t,e)=>Object.keys(e).map(n=>wx(e[n]).padEnd(t[n]));function VD({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},xx);for(let s of cm)r[s]=((e=kx[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],wx(o[a]).length)}let i=[[],[]];for(let s of cm)i[0].push(((n=kx[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of cm)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...GD(r,o)])}return i.map(WD).join(`
100
- `)}lm.default=VD});var dm=g(Et=>{"use strict";var KD=Et&&Et.__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]}),zD=Et&&Et.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&KD(e,t,n)};Object.defineProperty(Et,"__esModule",{value:!0});Et.util=Et.tokenizers=Et.transforms=Et.inspect=Et.stringify=Et.parse=void 0;var XD=mx(),YD=om(),JD=im(),QD=Zg(),ZD=tm(),eP=yx(),tP=vx(),nP=_x(),rP=Tx(),iP=Sx(),gl=Zn();zD(Xs(),Et);function sP(t,e={}){return(0,XD.default)(e)(t)}Et.parse=sP;Et.stringify=(0,eP.default)();var oP=Ex();Object.defineProperty(Et,"inspect",{enumerable:!0,get:function(){return oP.default}});Et.transforms={flow:iP.flow,align:tP.default,indent:nP.default,crlf:rP.default};Et.tokenizers={tag:QD.default,type:ZD.default,name:JD.default,description:YD.default};Et.util={rewireSpecs:gl.rewireSpecs,rewireSource:gl.rewireSource,seedBlock:gl.seedBlock,seedTokens:gl.seedTokens}});var Hi=g(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.SignatureDefinitionBaseType=void 0;var aP;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(aP=Ta.SignatureDefinitionBaseType||(Ta.SignatureDefinitionBaseType={}))});var Sa=g(Ys=>{"use strict";var Ax=Ys&&Ys.__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};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.SignatureDefinitionTypeMeta=void 0;var Qt=Hi(),uP=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=e.match(/^([a-zA-Z]+)(?:<([^>]+)>)?$/);if(!n)return null;var r=null,i=null,s=Ax(n,3),o=s[0],a=s[1],u=s[2];if(a===Qt.SignatureDefinitionBaseType.Map?(r=Qt.SignatureDefinitionBaseType.Any,i=Qt.SignatureDefinitionBaseType.Any):a===Qt.SignatureDefinitionBaseType.List&&(r=Qt.SignatureDefinitionBaseType.Any),u){var c=u.split(",").map(function(y){return y.trim()});if(c.length>2)return null;var l=Ax(c,2),d=l[0],p=l[1];p!=null?(r=p,i=d):r=d}return new t({type:a,keyType:i,valueType:r})},t.parse=function(e){var n,r;if(typeof e=="string"){var i=e,s=null,o=null;return i===Qt.SignatureDefinitionBaseType.Map?(s=Qt.SignatureDefinitionBaseType.Any,o=Qt.SignatureDefinitionBaseType.Any):i===Qt.SignatureDefinitionBaseType.List&&(s=Qt.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}else if(typeof e=="object"){var i=e.type,s=(n=e.valueType)!==null&&n!==void 0?n:null,o=(r=e.keyType)!==null&&r!==void 0?r:null;return i===Qt.SignatureDefinitionBaseType.Map?(s=s??Qt.SignatureDefinitionBaseType.Any,o=o??Qt.SignatureDefinitionBaseType.Any):i===Qt.SignatureDefinitionBaseType.List&&(s=s??Qt.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}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===e.keyType&&this.valueType===e.valueType},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType,">"):"".concat(this.type,"<").concat(this.keyType,",").concat(this.valueType,">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType}:{type:this.type,keyType:this.keyType,valueType:this.valueType}},t.prototype.copy=function(){return new t({type:this.type,keyType:this.keyType,valueType:this.valueType})},t}();Ys.SignatureDefinitionTypeMeta=uP});var fm=g(fi=>{"use strict";var Ox=fi&&fi.__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},Cx=fi&&fi.__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(fi,"__esModule",{value:!0});fi.SignatureDefinitionFunctionArg=void 0;var Rx=Sa(),cP=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(Rx.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,Cx([],Ox(e.types.map(Rx.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 Cx([],Ox(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}();fi.SignatureDefinitionFunctionArg=cP});var ml=g(hr=>{"use strict";var Wi=hr&&hr.__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},Gi=hr&&hr.__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))},lP=hr&&hr.__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(hr,"__esModule",{value:!0});hr.VariationRegistry=void 0;var dP=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(Gi(Gi([],Wi(e),!1),Wi(this._variations),!1)),this},t.prototype.getAll=function(){return Gi([],Wi(this._variations),!1)},t}(),fP=function(){function t(){}return t.add=function(e,n){var r=new dP(e);return r.push.apply(r,Gi([],Wi(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=lP(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(Gi(Gi([],Wi(c.getAll()),!1),Wi(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 Gi([],Wi(i),!1)},t.variationContainers=new Map,t}();hr.VariationRegistry=fP});var yl=g(pi=>{"use strict";var pP=pi&&pi.__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},hP=pi&&pi.__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(pi,"__esModule",{value:!0});pi.SignatureDefinition=void 0;var gP=ml(),mP=Sa(),yP=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:mP.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 gP.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?hP([],pP(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}();pi.SignatureDefinition=yP});var pm=g(Mn=>{"use strict";var bP=Mn&&Mn.__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)}}(),bl=Mn&&Mn.__assign||function(){return bl=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},bl.apply(this,arguments)},vP=Mn&&Mn.__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},_P=Mn&&Mn.__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(Mn,"__esModule",{value:!0});Mn.SignatureDefinitionFunction=void 0;var TP=Hi(),SP=ml(),kP=yl(),xP=fm(),Dx=Sa(),wP=function(t){bP(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 Dx.SignatureDefinitionTypeMeta({type:TP.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(xP.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(Dx.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 _P([],vP(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=[]),SP.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return bl(bl({},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}(kP.SignatureDefinition);Mn.SignatureDefinitionFunction=wP});var Ix=g((yB,Px)=>{"use strict";Px.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var hm=g((Mx,Lx)=>{"use strict";var EP=Ix();Lx.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:EP(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Mx.assert)}}});var De=g((vB,qx)=>{"use strict";var AP=hm();qx.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new AP(e)}});var Vi=g((_B,jx)=>{"use strict";var gm=De(),Nx={};jx.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);gm(!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&&Nx.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){gm(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),gm(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};Nx.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var mm=g((Zt,$x)=>{"use strict";var Fx={};Zt=$x.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};Fx.typeMap=new Map([["[object Error]",Zt.error],["[object Map]",Zt.map],["[object Promise]",Zt.promise],["[object Set]",Zt.set],["[object WeakMap]",Zt.weakMap],["[object WeakSet]",Zt.weakSet]]);Zt.getInternalProto=function(t){if(Array.isArray(t))return Zt.array;if(Buffer&&t instanceof Buffer)return Zt.buffer;if(t instanceof Date)return Zt.date;if(t instanceof RegExp)return Zt.regex;if(t instanceof Error)return Zt.error;let e=Object.prototype.toString.call(t);return Fx.typeMap.get(e)||Zt.generic}});var ym=g(Bx=>{"use strict";Bx.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var en=g((SB,Ux)=>{"use strict";var OP=Vi(),Tn=mm(),CP=ym(),Pr={needsProtoHack:new Set([Tn.set,Tn.map,Tn.weakSet,Tn.weakMap])};Ux.exports=Pr.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=Pr.clone,i=n;if(e.shallow){if(e.shallow!==!0)return Pr.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=Tn.getInternalProto(t);if(s===Tn.buffer)return Buffer&&Buffer.from(t);if(s===Tn.date)return new Date(t.getTime());if(s===Tn.regex)return new RegExp(t);let o=Pr.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===Tn.set)for(let u of t)o.add(r(u,e,i));else if(s===Tn.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=CP.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===Tn.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};Pr.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=OP(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return Pr.clone(t,e,r)};Pr.base=function(t,e,n){if(n.prototype===!1)return Pr.needsProtoHack.has(e)?new e.constructor:e===Tn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===Tn.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(Pr.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var Hx=g((kB,RP)=>{RP.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 vl=g(ka=>{"use strict";var O=_l(),he={};he.wrap=O.string().min(1).max(2).allow(!1);ka.preferences=O.object({allowUnknown:O.boolean(),abortEarly:O.boolean(),artifacts:O.boolean(),cache:O.boolean(),context:O.object(),convert:O.boolean(),dateFormat:O.valid("date","iso","string","time","utc"),debug:O.boolean(),errors:{escapeHtml:O.boolean(),label:O.valid("path","key",!1),language:[O.string(),O.object().ref()],render:O.boolean(),stack:O.boolean(),wrap:{label:he.wrap,array:he.wrap,string:he.wrap}},externals:O.boolean(),messages:O.object(),noDefaults:O.boolean(),nonEnumerables:O.boolean(),presence:O.valid("required","optional","forbidden"),skipFunctions:O.boolean(),stripUnknown:O.object({arrays:O.boolean(),objects:O.boolean()}).or("arrays","objects").allow(!0,!1),warnings:O.boolean()}).strict();he.nameRx=/^[a-zA-Z0-9]\w*$/;he.rule=O.object({alias:O.array().items(O.string().pattern(he.nameRx)).single(),args:O.array().items(O.string(),O.object({name:O.string().pattern(he.nameRx).required(),ref:O.boolean(),assert:O.alternatives([O.function(),O.object().schema()]).conditional("ref",{is:!0,then:O.required()}),normalize:O.function(),message:O.string().when("assert",{is:O.function(),then:O.required()})})),convert:O.boolean(),manifest:O.boolean(),method:O.function().allow(!1),multi:O.boolean(),validate:O.function()});ka.extension=O.object({type:O.alternatives([O.string(),O.object().regex()]).required(),args:O.function(),cast:O.object().pattern(he.nameRx,O.object({from:O.function().maxArity(1).required(),to:O.function().minArity(1).maxArity(2).required()})),base:O.object().schema().when("type",{is:O.object().regex(),then:O.forbidden()}),coerce:[O.function().maxArity(3),O.object({method:O.function().maxArity(3).required(),from:O.array().items(O.string()).single()})],flags:O.object().pattern(he.nameRx,O.object({setter:O.string(),default:O.any()})),manifest:{build:O.function().arity(2)},messages:[O.object(),O.string()],modifiers:O.object().pattern(he.nameRx,O.function().minArity(1).maxArity(2)),overrides:O.object().pattern(he.nameRx,O.function()),prepare:O.function().maxArity(3),rebuild:O.function().arity(1),rules:O.object().pattern(he.nameRx,he.rule),terms:O.object().pattern(he.nameRx,O.object({init:O.array().allow(null).required(),manifest:O.object().pattern(/.+/,[O.valid("schema","single"),O.object({mapped:O.object({from:O.string().required(),to:O.string().required()}).required()})])})),validate:O.function().maxArity(3)}).strict();ka.extensions=O.array().items(O.object(),O.function().arity(1)).strict();he.desc={buffer:O.object({buffer:O.string()}),func:O.object({function:O.function().required(),options:{literal:!0}}),override:O.object({override:!0}),ref:O.object({ref:O.object({type:O.valid("value","global","local"),path:O.array().required(),separator:O.string().length(1).allow(!1),ancestor:O.number().min(0).integer().allow("root"),map:O.array().items(O.array().length(2)).min(1),adjust:O.function(),iterables:O.boolean(),in:O.boolean(),render:O.boolean()}).required()}),regex:O.object({regex:O.string().min(3)}),special:O.object({special:O.valid("deep").required()}),template:O.object({template:O.string().required(),options:O.object()}),value:O.object({value:O.alternatives([O.object(),O.array()]).required()})};he.desc.entity=O.alternatives([O.array().items(O.link("...")),O.boolean(),O.function(),O.number(),O.string(),he.desc.buffer,he.desc.func,he.desc.ref,he.desc.regex,he.desc.special,he.desc.template,he.desc.value,O.link("/")]);he.desc.values=O.array().items(null,O.boolean(),O.function(),O.number().allow(1/0,-1/0),O.string().allow(""),O.symbol(),he.desc.buffer,he.desc.func,he.desc.override,he.desc.ref,he.desc.regex,he.desc.template,he.desc.value);he.desc.messages=O.object().pattern(/.+/,[O.string(),he.desc.template,O.object().pattern(/.+/,[O.string(),he.desc.template])]);ka.description=O.object({type:O.string().required(),flags:O.object({cast:O.string(),default:O.any(),description:O.string(),empty:O.link("/"),failover:he.desc.entity,id:O.string(),label:O.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:O.boolean(),unit:O.string()}).unknown(),preferences:{allowUnknown:O.boolean(),abortEarly:O.boolean(),artifacts:O.boolean(),cache:O.boolean(),convert:O.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:O.boolean(),label:["path","key"],language:[O.string(),he.desc.ref],wrap:{label:he.wrap,array:he.wrap}},externals:O.boolean(),messages:he.desc.messages,noDefaults:O.boolean(),nonEnumerables:O.boolean(),presence:["required","optional","forbidden"],skipFunctions:O.boolean(),stripUnknown:O.object({arrays:O.boolean(),objects:O.boolean()}).or("arrays","objects").allow(!0,!1),warnings:O.boolean()},allow:he.desc.values,invalid:he.desc.values,rules:O.array().min(1).items({name:O.string().required(),args:O.object().min(1),keep:O.boolean(),message:[O.string(),he.desc.messages],warn:O.boolean()}),keys:O.object().pattern(/.*/,O.link("/")),link:he.desc.ref}).pattern(/^[a-z]\w*$/,O.any())});var Gx=g((wB,Wx)=>{"use strict";var hi={};Wx.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);hi.isSafe(r)?e+=t[n]:e+=hi.escapeHtmlChar(r)}return e};hi.escapeHtmlChar=function(t){let e=hi.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};hi.isSafe=function(t){return hi.safeCharCodes.has(t)};hi.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);hi.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 Vx=g(xa=>{"use strict";var Ae={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};xa.Parser=class{constructor(t,e={}){if(!e[Ae.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[Ae.settings]?e:Object.assign({[Ae.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 xa.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(Ae.operatorCharacters.includes(n))u&&u.type==="operator"&&Ae.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Ae.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(Ae.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 Ae.literals?i=Ae.literals[a]:a==="("?(s(),++r):Ae.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(Ae.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Ae.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 Ae.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):Ae.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 Ae.literals&&!s?(i+=c,o=Ae.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new xa.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=Ae.evaluate(i,t);e[n]=Ae.single(r.value,s)}}return Ae.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Ae.evaluate(e[r-1],t),o=Ae.evaluate(e[r+1],t);e.splice(r,2);let a=Ae.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Ae.evaluate(e[0],t)}};xa.Parser.prototype[Ae.symbol]=!0;Ae.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Ae.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Ae.symbol]?t.evaluate(e):t};Ae.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Ae.calculate=function(t,e,n){if(t==="??")return Ae.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Ae.exists(e)?e:"",n=Ae.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};Ae.exists=function(t){return t!=null}});var zx=g(Kx=>{"use strict";var DP=en(),PP=Je(),Ki={annotations:Symbol("annotations")};Kx.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=DP(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,d=i;for(let p=0;;++p){let y=l[p];if(PP.isSchema(d)&&(d=d.clone()),p+1<l.length&&typeof d[y]!="string")d=d[y];else{let _=d[Ki.annotations]||{errors:{},missing:{}};d[Ki.annotations]=_;let E=y||c.context.key;d[y]!==void 0?(_.errors[E]=_.errors[E]||[],_.errors[E].push(u)):_.missing[E]=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=Ki.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}ue.createSelectorGroup=hr;function OR(t){return t.selectors}ue.getSelectorsFromGroup=OR;var gr;(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"})(gr=ue.SelectorGroupType||(ue.SelectorGroupType={}));ue.SelectorGroups={BlockEndOfLine:hr(gr.AssignmentEndOfExpr,[ue.Selectors.EndOfLine,ue.Selectors.Comment]),AssignmentEndOfExpr:hr(gr.AssignmentEndOfExpr,[ue.Selectors.EndOfFile,ue.Selectors.EndOfLine,ue.Selectors.Else,ue.Selectors.Comment]),AssignmentShorthand:hr(gr.AssignmentShorthand,[ue.Selectors.AddShorthand,ue.Selectors.SubtractShorthand,ue.Selectors.MultiplyShorthand,ue.Selectors.DivideShorthand,ue.Selectors.PowerShorthand,ue.Selectors.ModuloShorthand]),AssignmentCommandArgs:hr(gr.AssignmentCommandArgs,[ue.Selectors.ArgumentSeperator,ue.Selectors.EndOfLine,ue.Selectors.EndOfFile]),ReturnStatementEnd:hr(gr.ReturnStatementEnd,[ue.Selectors.EndOfLine,ue.Selectors.Else,ue.Selectors.Comment]),FunctionDeclarationArgEnd:hr(gr.FunctionDeclarationArgEnd,[ue.Selectors.RParenthesis,ue.Selectors.EndOfFile,ue.Selectors.EndOfLine]),ComparisonOperators:hr(gr.ComparisonOperators,[ue.Selectors.Equal,ue.Selectors.NotEqual,ue.Selectors.Greater,ue.Selectors.GreaterEqual,ue.Selectors.Lesser,ue.Selectors.LessEqual]),MultiDivOperators:hr(gr.MultiDivOperators,[ue.Selectors.Times,ue.Selectors.Divide,ue.Selectors.Mod]),CallArgsEnd:hr(gr.CallArgsEnd,[ue.Selectors.ArgumentSeperator,ue.Selectors.RParenthesis])}});var Kg=g(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.Stack=void 0;var Gg=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}};fl.Stack=Gg});var Qg=g(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.PendingWhile=Je.isPendingWhile=Je.PendingIf=Je.isPendingIf=Je.PendingFunction=Je.isPendingFunction=Je.PendingFor=Je.isPendingFor=Je.PendingChunk=Je.isPendingChunk=Je.PendingBlockType=void 0;var tr;(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"})(tr=Je.PendingBlockType||(Je.PendingBlockType={}));var Gi=class{constructor(e,n){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 CR(t){return t.type===tr.Chunk}Je.isPendingChunk=CR;var Vg=class extends Gi{constructor(e){super(e,tr.Chunk)}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)}};Je.PendingChunk=Vg;function RR(t){return t.type===tr.For}Je.isPendingFor=RR;var zg=class extends Gi{constructor(e){super(e,tr.For)}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)}};Je.PendingFor=zg;function PR(t){return t.type===tr.Function}Je.isPendingFunction=PR;var Xg=class extends Gi{constructor(e){super(e,tr.Function)}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)}};Je.PendingFunction=Xg;function DR(t){return t.type===tr.If}Je.isPendingIf=DR;var Yg=class extends Gi{constructor(e,n){super(e,tr.If),this.currentClause=n}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],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]],super.complete(e)}};Je.PendingIf=Yg;function IR(t){return t.type===tr.While}Je.isPendingWhile=IR;var Jg=class extends Gi{constructor(e){super(e,tr.While)}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)}};Je.PendingWhile=Jg});var Sx=g(ma=>{"use strict";var Tx=ma&&ma.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ma,"__esModule",{value:!0});var MR=Tx(qh()),hi=ci(),mr=Fg(),LR=Tx(Ug()),NR=Uc(),Bt=Gs(),qr=Vs(),en=ca(),J=Wg(),qR=Kg(),yr=Qg(),Zg=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new qR.Stack,r.statementErrors=[],r.lexer=n.lexer||new MR.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lines={},r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.literals=[],r.validator=n.validator||new LR.default,r.astProvider=n.astProvider||new mr.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 en.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,J.getSelectorValue)(e)}" is required`,new en.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,J.getSelectorsFromGroup)(e).map(i=>`"${(0,J.getSelectorValue)(i)}"`).join(", ")} is required`,new en.Range(n||r.start,r.end)),null)}addItemToLines(e){let n=this.lines,r=e.end.line;for(let i=e.start.line;i<=r;i++){let s=n[i];s?s.push(e):n[i]=[e]}}skipNewlines(){let e=this,n=0;for(;;){if(J.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,start:e.token.start,end:e.token.end,range:e.token.range,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(J.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}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!==hi.TokenType.EOL&&e.token.type!==hi.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,yr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new en.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 yr.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!J.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!J.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.lines,r}parseStatement(){let e=this;if(hi.TokenType.Keyword===e.token.type&&Bt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Bt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.addItemToLines(i),r.body.push(i);return}case Bt.Keyword.If:{e.next(),e.parseIfStatement();return}case Bt.Keyword.ElseIf:{e.next(),e.nextIfClause(mr.ASTType.ElseifClause);return}case Bt.Keyword.Else:{e.next(),e.nextIfClause(mr.ASTType.ElseClause);return}case Bt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Bt.Keyword.For:{e.next(),e.parseForStatement();return}case Bt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Bt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Bt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Bt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Bt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let i=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}case Bt.Keyword.Break:{let r=e.backpatches.peek();e.next();let i=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new en.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(hi.TokenType.Keyword===e.token.type&&Bt.Keyword.Not!==e.token.value)switch(e.token.value){case Bt.Keyword.Return:return e.next(),e.parseReturnStatement();case Bt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});case Bt.Keyword.Break:return e.next(),e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new en.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(J.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(J.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;if(e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],o.init.type===mr.ASTType.FunctionDeclaration){let u=e.backpatches.peek();u.onComplete=c=>{o.end=c.block.end,o.range[1]=c.block.range[1]}}return e.currentAssignment=a,n.assignments.push(o),o}else if(J.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),d=e.parseExpr(a),p=e.astProvider.parenthesisExpression({start:d.start,end:d.end,range:d.range,expression:d});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:p,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.assignments.push(a),a}let s=[];for(;!J.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),J.SelectorGroups.BlockEndOfLine(e.token)||J.Selectors.Else(e.token))break;if(J.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(J.SelectorGroups.AssignmentCommandArgs,r.start);if(J.Selectors.EndOfLine(a)||J.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});if(J.SelectorGroups.ReturnStatementEnd(e.token))s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1];else{if(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],i.type===mr.ASTType.FunctionDeclaration){let o=e.backpatches.peek();o.onComplete=a=>{s.end=a.block.end,s.range[1]=a.block.range[1]}}s.argument=i}return n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.addItemToLines(r),e.requireToken(J.Selectors.Then,n.start),!J.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 yr.PendingIf(i,s);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,yr.isPendingIf)(r)){n.raise("no matching open if block",new en.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case mr.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(J.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 mr.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.addItemToLines(r.block),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})),J.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.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 en.Range(n.start,e.token.end));return}if(!J.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 yr.PendingWhile(i);e.backpatches.push(s),s.onComplete=o=>{e.addItemToLines(o.block),e.backpatches.pop(),e.backpatches.peek().body.push(o.block)}}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,yr.isPendingWhile)(n)){e.raise("no matching open while block",new en.Range(e.token.start,e.token.end));return}n.complete(e.previousToken)}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.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(),s=e.astProvider.assignmentStatement({variable:i,init:e.astProvider.unknown({start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n}),o=e.astProvider.assignmentStatement({variable:e.astProvider.identifier({name:`__${i.name}_idx`,start:i.start,end:i.end,range:i.range,scope:n}),init:e.astProvider.literal(hi.TokenType.NumericLiteral,{value:0,raw:"0",start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n});n.assignments.push(s,o),e.requireToken(J.Selectors.In,r.start);let a=e.parseExpr(null);if(!a){e.raise("sequence expression expected for 'for' loop",new en.Range(r.start,e.token.end));return}if(!J.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,a,r);let u=e.astProvider.forGenericStatement({variable:i,iterator:a,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),c=new yr.PendingFor(u);e.backpatches.push(c)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,yr.isPendingFor)(n)){e.raise("no matching open for block",new en.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.addItemToLines(n.block),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.backpatches.peek(),o=i.parseShortcutStatement(),a=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[o],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});i.addItemToLines(a),s.body.push(a)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!J.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),!J.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(J.Selectors.LParenthesis,s.start);!J.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(),l=c;if(i.consume(J.Selectors.Assign)){let d=i.parseExpr(null);if(d instanceof mr.ASTLiteral){let p=i.astProvider.assignmentStatement({variable:c,init:d,start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.assignments.push(p),a.push(p)}else i.raise("parameter default value must be a literal value",new en.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 d=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.assignments.push(d),a.push(c)}if(J.Selectors.RParenthesis(i.token))break;if(i.requireToken(J.Selectors.ArgumentSeperator,s.start),J.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new en.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(J.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new yr.PendingFunction(o);return i.backpatches.push(u),u.onComplete=c=>{e!==null?(e.end=c.block.end,e.range[1]=c.block.range[1],i.addItemToLines(e)):i.addItemToLines(c.block)},o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,yr.isPendingFunction)(n)){e.raise("no matching open function block",new en.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(;J.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:qr.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(;J.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:qr.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(J.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:qr.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(J.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:qr.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(!J.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(J.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(;J.Selectors.Plus(r.token)||J.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(;J.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(!J.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof mr.ASTNumericLiteral||s instanceof mr.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:qr.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(!J.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:qr.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(!J.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower();return r.astProvider.unaryExpression({operator:qr.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(J.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:qr.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(;!J.Selectors.EndOfFile(r.token);)if(J.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier();s=r.astProvider.memberExpression({base:s,indexer:qr.Operator.Member,identifier:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}else if(J.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),J.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=J.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(J.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=J.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,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(J.Selectors.SRBracket,i.start)}else if(J.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(J.Selectors.LParenthesis(e.token))if(e.next(),J.Selectors.RParenthesis(e.token))e.next();else for(;!J.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),J.Selectors.RParenthesis(e.requireTokenOfAny(J.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!J.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(),J.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!J.Selectors.EndOfFile(r.token);){if(J.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(J.Selectors.MapKeyValueSeperator),r.skipNewlines(),r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:u.key,base:r.currentAssignment.variable,start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:i}),init:null,start:u.start,end:null,range:[u.range[0],null]}),l=r.currentAssignment;r.currentAssignment=c,u.value=r.parseExpr(u),r.currentAssignment=l,c.init=u.value,c.end=r.previousToken.end,c.range[1]=r.previousToken.range[1],i.assignments.push(c)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),J.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),J.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(!J.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(),J.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!J.Selectors.EndOfFile(r.token);){if(J.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(r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(hi.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:s.start,end:r.token.end,range:[s.range[0],r.token.range[1]],scope:i}),base:r.currentAssignment.variable,start:null,end:null,range:[null,null],scope:i}),init:null,start:null,range:[null,null],end:null}),l=r.currentAssignment,d=r.token;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=l,c.variable.start=d.start,c.variable.end=r.previousToken.end,c.variable.range=[d.range[0],r.previousToken.range[1]],c.init=u.value,c.start=u.start,c.end=r.previousToken.end,c.range=[u.range[0],r.previousToken.range[1]],i.assignments.push(c)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),J.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),J.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(!J.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(J.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(hi.TokenType.Identifier)?r.parseIdentifier():(r.raise(`got ${r.token} where number, string, or identifier is required`,new en.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(){let e=this,n=e.token,r=e.requireType(hi.TokenType.Identifier);return r===null?e.parseInvalidCode():(e.currentScope.namespaces.add(r.value),e.astProvider.identifier({name:r.value,start:n.start,end:n.end,range:n.range,scope:e.currentScope}))}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 NR.ParserException(e,n);return r.statementErrors.push(i),i}};ma.default=Zg});var qe=g(Ne=>{"use strict";var jR=Ne&&Ne.__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]}),nr=Ne&&Ne.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&jR(e,t,n)},pl=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.ASTRange=Ne.ASTPosition=Ne.ParserValidatorm=Ne.Parser=Ne.LexerValidator=Ne.Lexer=void 0;var FR=qh();Object.defineProperty(Ne,"Lexer",{enumerable:!0,get:function(){return pl(FR).default}});nr(ci(),Ne);var $R=Ah();Object.defineProperty(Ne,"LexerValidator",{enumerable:!0,get:function(){return pl($R).default}});var BR=Sx();Object.defineProperty(Ne,"Parser",{enumerable:!0,get:function(){return pl(BR).default}});nr(Fg(),Ne);var UR=Ug();Object.defineProperty(Ne,"ParserValidatorm",{enumerable:!0,get:function(){return pl(UR).default}});nr(Qg(),Ne);nr(Kg(),Ne);nr(Mh(),Ne);nr(Bc(),Ne);nr(Uc(),Ne);nr(Gs(),Ne);nr(Rh(),Ne);nr(Vs(),Ne);var HR=ra();Object.defineProperty(Ne,"ASTPosition",{enumerable:!0,get:function(){return HR.Position}});var WR=ca();Object.defineProperty(Ne,"ASTRange",{enumerable:!0,get:function(){return WR.Range}});nr(Wg(),Ne)});var ya=g(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.isValidIdentifierLiteral=void 0;var GR=qe(),KR=t=>{if(t.type!==GR.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};hl.isValidIdentifierLiteral=KR});var em=g(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.getStringHashCode=gi.getHashCode=gi.rotateBits=void 0;function VR(t){return t>>1|t<<31}gi.rotateBits=VR;function zR(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}gi.getHashCode=zR;gi.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 kx=g(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.createExpressionHash=void 0;var ze=qe(),bt=em(),XR=ya(),Ut=(t,e)=>t.$$hash=e,YR=t=>t.$$hash??null;function st(t){let e=YR(t);if(e!==null)return e;let n=(0,bt.getStringHashCode)(t.type);switch(t.type){case ze.ASTType.BinaryExpression:{let r=t;return n^=(0,bt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Ut(t,n)}case ze.ASTType.LogicalExpression:{let r=t;return n^=(0,bt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Ut(t,n)}case ze.ASTType.IsaExpression:{let r=t;return n^=(0,bt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Ut(t,n)}case ze.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,bt.getStringHashCode)(r.operators[i]);return Ut(t,n)}case ze.ASTType.FunctionDeclaration:{let r=t;n^=(0,bt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===ze.ASTType.Identifier){n^=(0,bt.getStringHashCode)(s.name);continue}let o=s;n^=(0,bt.getStringHashCode)(o.variable.name),n^=st(o.init)}return Ut(t,n)}case ze.ASTType.ParenthesisExpression:return st(t.expression);case ze.ASTType.MemberExpression:{let r=t;if(r.base.type===ze.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,bt.getStringHashCode)(ze.ASTType.Identifier),n^=(0,bt.getStringHashCode)(r.identifier.name),Ut(t,n)}return n^=st(r.base),n^=st(r.identifier),Ut(t,n)}case ze.ASTType.IndexExpression:{let r=t;if((0,XR.isValidIdentifierLiteral)(r.index)){if(r.base.type===ze.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,bt.getStringHashCode)(ze.ASTType.Identifier),n^=(0,bt.getStringHashCode)(r.index.value.toString()),Ut(t,n)}n=(0,bt.getStringHashCode)(ze.ASTType.MemberExpression),n^=st(r.base);let i=(0,bt.getStringHashCode)(ze.ASTType.Identifier);i^=(0,bt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=st(r.base),n^=st(r.index);return Ut(t,n)}case ze.ASTType.CallExpression:{let r=t;n^=st(r.base),n^=(0,bt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=st(s)}return Ut(t,n)}case ze.ASTType.NegationExpression:case ze.ASTType.BinaryNegatedExpression:case ze.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,bt.getStringHashCode)(r.operator):1,n^=st(r.argument),Ut(t,n)}case ze.ASTType.Identifier:{let r=t;return n^=(0,bt.getStringHashCode)(r.name),Ut(t,n)}case ze.ASTType.NumericLiteral:case ze.ASTType.StringLiteral:case ze.ASTType.NilLiteral:return n^=(0,bt.getStringHashCode)(t.value.toString()),Ut(t,n);case ze.ASTType.MapConstructorExpression:{let r=t;n^=(0,bt.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 Ut(t,n)}case ze.ASTType.ListConstructorExpression:{let r=t;n^=(0,bt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=st(s.value)}return Ut(t,n)}case ze.ASTType.SliceExpression:{let r=t;return n^=st(r.base),n^=st(r.left),n^=st(r.right),Ut(t,n)}}return Ut(t,n)}function JR(t){return st(t)}gl.createExpressionHash=JR});var tm=g(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});ml.createExpressionId=void 0;var xt=qe(),QR=ya(),At=(t,e)=>t.$$id=e,ZR=t=>t.$$id??null;function Qe(t){let e=ZR(t);if(e!==null)return e;switch(t.type){case xt.ASTType.BinaryExpression:{let n=t;return At(t,Qe(n.left)+n.operator+Qe(n.right))}case xt.ASTType.LogicalExpression:{let n=t;return At(t,Qe(n.left)+n.operator+Qe(n.right))}case xt.ASTType.IsaExpression:{let n=t;return At(t,Qe(n.left)+n.operator+Qe(n.right))}case xt.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>Qe(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return At(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+"="+Qe(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),At(t,r)}case xt.ASTType.ParenthesisExpression:return At(t,Qe(t.expression));case xt.ASTType.MemberExpression:{let n=t;return At(t,Qe(n.base)+"."+n.identifier.name)}case xt.ASTType.IndexExpression:{let n=t;return(0,QR.isValidIdentifierLiteral)(n.index)?At(t,Qe(n.base)+"."+n.index.value.toString()):At(t,Qe(n.base)+"["+Qe(n.index)+"]")}case xt.ASTType.CallExpression:{let n=t,r=Qe(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(Qe(o))}return i.length>0&&(r+="("+i.join(",")+")"),At(t,r)}case xt.ASTType.NegationExpression:case xt.ASTType.BinaryNegatedExpression:case xt.ASTType.UnaryExpression:{let n=t;return n.operator==null?At(t,Qe(n.argument)):n.operator==="@"?At(t,n.operator+Qe(n.argument)):At(t,n.operator+" "+Qe(n.argument))}case xt.ASTType.Identifier:return At(t,t.name);case xt.ASTType.NumericLiteral:case xt.ASTType.StringLiteral:case xt.ASTType.NilLiteral:return At(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(Qe(s.key)+":"+Qe(s.value))}return At(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(Qe(s.value))}return At(t,"["+r.join(",")+"]")}case xt.ASTType.SliceExpression:{let n=t;return At(t,Qe(n.base)+"["+Qe(n.left)+":"+Qe(n.right)+"]")}}return At(t,"")}function eP(t){return Qe(t)}ml.createExpressionId=eP});var Zs=g(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.Markers=void 0;var tP;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(tP=ba.Markers||(ba.Markers={}))});var rr=g(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.rewireSpecs=ft.rewireSource=ft.seedTokens=ft.seedSpec=ft.seedBlock=ft.splitLines=ft.splitSpace=ft.splitCR=ft.hasCR=ft.isSpace=void 0;function nP(t){return/^\s+$/.test(t)}ft.isSpace=nP;function rP(t){return/\r$/.test(t)}ft.hasCR=rP;function iP(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}ft.splitCR=iP;function sP(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}ft.splitSpace=sP;function oP(t){return t.split(/\n/)}ft.splitLines=oP;function aP(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}ft.seedBlock=aP;function uP(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}ft.seedSpec=uP;function cP(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}ft.seedTokens=cP;function lP(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}ft.rewireSource=lP;function dP(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}ft.rewireSpecs=dP});var xx=g(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});var fP=/^@\S+/;function pP({fence:t="```"}={}){let e=hP(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)fP.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}nm.default=pP;function hP(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var wx=g(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var gP=Zs(),va=rr();function mP({startLine:t=0,markers:e=gP.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,va.seedTokens)();if([a.lineEnd,o]=(0,va.splitCR)(o),[a.start,o]=(0,va.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,va.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,va.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}}rm.default=mP});var Ex=g(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var yP=rr();function bP({tokenizers:t}){return function(n){var r;let i=(0,yP.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}}im.default=bP});var om=g(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});function vP(){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)}}sm.default=vP});var um=g(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var _P=rr();function TP(t="compact"){let e=kP(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,_P.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}}am.default=TP;var SP=t=>t.trim();function kP(t){return t==="compact"?e=>e.map(SP).join(""):t==="preserve"?e=>e.join(`
97
+ `):t}});var dm=g(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var cm=rr(),xP=t=>t&&t.startsWith('"')&&t.endsWith('"');function wP(){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,cm.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,cm.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(!xP(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,cm.splitSpace)(r.slice(n.name.length)),e}}lm.default=wP});var pm=g(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.getJoiner=void 0;var fm=Zs();function EP(t="compact",e=fm.Markers){let n=Ax(t);return r=>(r.description=n(r.source,e),r)}_a.default=EP;function Ax(t){return t==="compact"?AP:t==="preserve"?RP:t}_a.getJoiner=Ax;function AP(t,e=fm.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var OP=(t,{tokens:e},n)=>e.type===""?t:n,CP=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function RP(t,e=fm.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(OP,0)),t.map(CP).join(`
98
+ `)}});var Cx=g(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var PP=Zs(),DP=rr(),IP=xx(),MP=wx(),LP=Ex(),NP=om(),qP=um(),jP=dm(),Ox=pm();function FP({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=PP.Markers,tokenizers:i=[(0,NP.default)(),(0,qP.default)(n),(0,jP.default)(),(0,Ox.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,MP.default)({startLine:t,markers:r}),o=(0,IP.default)({fence:e}),a=(0,LP.default)({tokenizers:i}),u=(0,Ox.getJoiner)(n);return function(c){let l=[];for(let d of(0,DP.splitLines)(c)){let p=s(d);if(p===null)continue;let y=o(p),_=y.slice(1).map(a);l.push({description:u(y[0],r),tags:_,source:p,problems:_.reduce((E,L)=>E.concat(L.problems),[])})}return l}}hm.default=FP});var Rx=g(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});function $P(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 BP(){return t=>t.source.map(({tokens:e})=>$P(e)).join(`
99
+ `)}gm.default=BP});var Dx=g(Ta=>{"use strict";var UP=Ta&&Ta.__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(Ta,"__esModule",{value:!0});var Px=Zs(),HP=rr(),WP={start:0,tag:0,type:0,name:0},GP=(t=Px.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)}),Ki=t=>"".padStart(t," ");function KP(t=Px.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=Ki(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=Ki(n.start);break;case t.delim:s.start=Ki(n.start+1);break;default:s.delimiter="",s.start=Ki(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=Ki(n.tag-s.tag.length+1)),a.type||(s.postType=Ki(n.type-s.type.length+1)),a.name||(s.postName=Ki(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=UP(i,["source"]);return n=s.reduce(GP(t),Object.assign({},WP)),(0,HP.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}Ta.default=KP});var Ix=g(Sa=>{"use strict";var VP=Sa&&Sa.__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(Sa,"__esModule",{value:!0});var zP=rr(),XP=t=>e=>e.slice(t),YP=t=>{let e="".padStart(t," ");return n=>n+e};function JP(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?YP(s):XP(-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=VP(i,["source"]);return(0,zP.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}Sa.default=JP});var Mx=g(ka=>{"use strict";var QP=ka&&ka.__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(ka,"__esModule",{value:!0});var ZP=rr();function eD(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=QP(n,["source"]);return(0,ZP.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}ka.default=eD});var Lx=g(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.flow=void 0;function tD(...t){return e=>t.reduce((n,r)=>r(n),e)}yl.flow=tD});var Fx=g(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var nD=rr(),qx={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},Nx={lineEnd:"CR"},mm=Object.keys(qx),jx=t=>(0,nD.isSpace)(t)?`{${t.length}}`:t,rD=t=>"|"+t.join("|")+"|",iD=(t,e)=>Object.keys(e).map(n=>jx(e[n]).padEnd(t[n]));function sD({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},qx);for(let s of mm)r[s]=((e=Nx[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],jx(o[a]).length)}let i=[[],[]];for(let s of mm)i[0].push(((n=Nx[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of mm)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...iD(r,o)])}return i.map(rD).join(`
100
+ `)}ym.default=sD});var bm=g(Ot=>{"use strict";var oD=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]}),aD=Ot&&Ot.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&oD(e,t,n)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.util=Ot.tokenizers=Ot.transforms=Ot.inspect=Ot.stringify=Ot.parse=void 0;var uD=Cx(),cD=pm(),lD=dm(),dD=om(),fD=um(),pD=Rx(),hD=Dx(),gD=Ix(),mD=Mx(),yD=Lx(),bl=rr();aD(Zs(),Ot);function bD(t,e={}){return(0,uD.default)(e)(t)}Ot.parse=bD;Ot.stringify=(0,pD.default)();var vD=Fx();Object.defineProperty(Ot,"inspect",{enumerable:!0,get:function(){return vD.default}});Ot.transforms={flow:yD.flow,align:hD.default,indent:gD.default,crlf:mD.default};Ot.tokenizers={tag:dD.default,type:fD.default,name:lD.default,description:cD.default};Ot.util={rewireSpecs:bl.rewireSpecs,rewireSource:bl.rewireSource,seedBlock:bl.seedBlock,seedTokens:bl.seedTokens}});var Vi=g(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.SignatureDefinitionBaseType=void 0;var _D;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(_D=xa.SignatureDefinitionBaseType||(xa.SignatureDefinitionBaseType={}))});var wa=g(eo=>{"use strict";var $x=eo&&eo.__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};Object.defineProperty(eo,"__esModule",{value:!0});eo.SignatureDefinitionTypeMeta=void 0;var tn=Vi(),TD=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=e.match(/^([a-zA-Z]+)(?:<([^>]+)>)?$/);if(!n)return null;var r=null,i=null,s=$x(n,3),o=s[0],a=s[1],u=s[2];if(a===tn.SignatureDefinitionBaseType.Map?(r=tn.SignatureDefinitionBaseType.Any,i=tn.SignatureDefinitionBaseType.Any):a===tn.SignatureDefinitionBaseType.List&&(r=tn.SignatureDefinitionBaseType.Any),u){var c=u.split(",").map(function(y){return y.trim()});if(c.length>2)return null;var l=$x(c,2),d=l[0],p=l[1];p!=null?(r=p,i=d):r=d}return new t({type:a,keyType:i,valueType:r})},t.parse=function(e){var n,r;if(typeof e=="string"){var i=e,s=null,o=null;return i===tn.SignatureDefinitionBaseType.Map?(s=tn.SignatureDefinitionBaseType.Any,o=tn.SignatureDefinitionBaseType.Any):i===tn.SignatureDefinitionBaseType.List&&(s=tn.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}else if(typeof e=="object"){var i=e.type,s=(n=e.valueType)!==null&&n!==void 0?n:null,o=(r=e.keyType)!==null&&r!==void 0?r:null;return i===tn.SignatureDefinitionBaseType.Map?(s=s??tn.SignatureDefinitionBaseType.Any,o=o??tn.SignatureDefinitionBaseType.Any):i===tn.SignatureDefinitionBaseType.List&&(s=s??tn.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}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===e.keyType&&this.valueType===e.valueType},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType,">"):"".concat(this.type,"<").concat(this.keyType,",").concat(this.valueType,">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType}:{type:this.type,keyType:this.keyType,valueType:this.valueType}},t.prototype.copy=function(){return new t({type:this.type,keyType:this.keyType,valueType:this.valueType})},t}();eo.SignatureDefinitionTypeMeta=TD});var vm=g(mi=>{"use strict";var Bx=mi&&mi.__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},Ux=mi&&mi.__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(mi,"__esModule",{value:!0});mi.SignatureDefinitionFunctionArg=void 0;var Hx=wa(),SD=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(Hx.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,Ux([],Bx(e.types.map(Hx.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 Ux([],Bx(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}();mi.SignatureDefinitionFunctionArg=SD});var vl=g(br=>{"use strict";var zi=br&&br.__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},Xi=br&&br.__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))},kD=br&&br.__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(br,"__esModule",{value:!0});br.VariationRegistry=void 0;var xD=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(Xi(Xi([],zi(e),!1),zi(this._variations),!1)),this},t.prototype.getAll=function(){return Xi([],zi(this._variations),!1)},t}(),wD=function(){function t(){}return t.add=function(e,n){var r=new xD(e);return r.push.apply(r,Xi([],zi(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=kD(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(Xi(Xi([],zi(c.getAll()),!1),zi(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 Xi([],zi(i),!1)},t.variationContainers=new Map,t}();br.VariationRegistry=wD});var _l=g(yi=>{"use strict";var ED=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},AD=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 OD=vl(),CD=wa(),RD=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:CD.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 OD.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?AD([],ED(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}();yi.SignatureDefinition=RD});var _m=g(qn=>{"use strict";var PD=qn&&qn.__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)}}(),Tl=qn&&qn.__assign||function(){return Tl=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},Tl.apply(this,arguments)},DD=qn&&qn.__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},ID=qn&&qn.__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(qn,"__esModule",{value:!0});qn.SignatureDefinitionFunction=void 0;var MD=Vi(),LD=vl(),ND=_l(),qD=vm(),Wx=wa(),jD=function(t){PD(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 Wx.SignatureDefinitionTypeMeta({type:MD.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(qD.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(Wx.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 ID([],DD(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=[]),LD.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Tl(Tl({},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}(ND.SignatureDefinition);qn.SignatureDefinitionFunction=jD});var Kx=g(($B,Gx)=>{"use strict";Gx.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var Tm=g((Vx,zx)=>{"use strict";var FD=Kx();zx.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:FD(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Vx.assert)}}});var Ie=g((UB,Xx)=>{"use strict";var $D=Tm();Xx.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new $D(e)}});var Yi=g((HB,Jx)=>{"use strict";var Sm=Ie(),Yx={};Jx.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);Sm(!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&&Yx.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){Sm(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),Sm(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};Yx.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var km=g((nn,Zx)=>{"use strict";var Qx={};nn=Zx.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};Qx.typeMap=new Map([["[object Error]",nn.error],["[object Map]",nn.map],["[object Promise]",nn.promise],["[object Set]",nn.set],["[object WeakMap]",nn.weakMap],["[object WeakSet]",nn.weakSet]]);nn.getInternalProto=function(t){if(Array.isArray(t))return nn.array;if(Buffer&&t instanceof Buffer)return nn.buffer;if(t instanceof Date)return nn.date;if(t instanceof RegExp)return nn.regex;if(t instanceof Error)return nn.error;let e=Object.prototype.toString.call(t);return Qx.typeMap.get(e)||nn.generic}});var xm=g(ew=>{"use strict";ew.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var rn=g((GB,tw)=>{"use strict";var BD=Yi(),xn=km(),UD=xm(),jr={needsProtoHack:new Set([xn.set,xn.map,xn.weakSet,xn.weakMap])};tw.exports=jr.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=jr.clone,i=n;if(e.shallow){if(e.shallow!==!0)return jr.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=xn.getInternalProto(t);if(s===xn.buffer)return Buffer&&Buffer.from(t);if(s===xn.date)return new Date(t.getTime());if(s===xn.regex)return new RegExp(t);let o=jr.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===xn.set)for(let u of t)o.add(r(u,e,i));else if(s===xn.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=UD.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===xn.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};jr.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=BD(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return jr.clone(t,e,r)};jr.base=function(t,e,n){if(n.prototype===!1)return jr.needsProtoHack.has(e)?new e.constructor:e===xn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===xn.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(jr.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var nw=g((KB,HD)=>{HD.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 Sl=g(Ea=>{"use strict";var O=kl(),me={};me.wrap=O.string().min(1).max(2).allow(!1);Ea.preferences=O.object({allowUnknown:O.boolean(),abortEarly:O.boolean(),artifacts:O.boolean(),cache:O.boolean(),context:O.object(),convert:O.boolean(),dateFormat:O.valid("date","iso","string","time","utc"),debug:O.boolean(),errors:{escapeHtml:O.boolean(),label:O.valid("path","key",!1),language:[O.string(),O.object().ref()],render:O.boolean(),stack:O.boolean(),wrap:{label:me.wrap,array:me.wrap,string:me.wrap}},externals:O.boolean(),messages:O.object(),noDefaults:O.boolean(),nonEnumerables:O.boolean(),presence:O.valid("required","optional","forbidden"),skipFunctions:O.boolean(),stripUnknown:O.object({arrays:O.boolean(),objects:O.boolean()}).or("arrays","objects").allow(!0,!1),warnings:O.boolean()}).strict();me.nameRx=/^[a-zA-Z0-9]\w*$/;me.rule=O.object({alias:O.array().items(O.string().pattern(me.nameRx)).single(),args:O.array().items(O.string(),O.object({name:O.string().pattern(me.nameRx).required(),ref:O.boolean(),assert:O.alternatives([O.function(),O.object().schema()]).conditional("ref",{is:!0,then:O.required()}),normalize:O.function(),message:O.string().when("assert",{is:O.function(),then:O.required()})})),convert:O.boolean(),manifest:O.boolean(),method:O.function().allow(!1),multi:O.boolean(),validate:O.function()});Ea.extension=O.object({type:O.alternatives([O.string(),O.object().regex()]).required(),args:O.function(),cast:O.object().pattern(me.nameRx,O.object({from:O.function().maxArity(1).required(),to:O.function().minArity(1).maxArity(2).required()})),base:O.object().schema().when("type",{is:O.object().regex(),then:O.forbidden()}),coerce:[O.function().maxArity(3),O.object({method:O.function().maxArity(3).required(),from:O.array().items(O.string()).single()})],flags:O.object().pattern(me.nameRx,O.object({setter:O.string(),default:O.any()})),manifest:{build:O.function().arity(2)},messages:[O.object(),O.string()],modifiers:O.object().pattern(me.nameRx,O.function().minArity(1).maxArity(2)),overrides:O.object().pattern(me.nameRx,O.function()),prepare:O.function().maxArity(3),rebuild:O.function().arity(1),rules:O.object().pattern(me.nameRx,me.rule),terms:O.object().pattern(me.nameRx,O.object({init:O.array().allow(null).required(),manifest:O.object().pattern(/.+/,[O.valid("schema","single"),O.object({mapped:O.object({from:O.string().required(),to:O.string().required()}).required()})])})),validate:O.function().maxArity(3)}).strict();Ea.extensions=O.array().items(O.object(),O.function().arity(1)).strict();me.desc={buffer:O.object({buffer:O.string()}),func:O.object({function:O.function().required(),options:{literal:!0}}),override:O.object({override:!0}),ref:O.object({ref:O.object({type:O.valid("value","global","local"),path:O.array().required(),separator:O.string().length(1).allow(!1),ancestor:O.number().min(0).integer().allow("root"),map:O.array().items(O.array().length(2)).min(1),adjust:O.function(),iterables:O.boolean(),in:O.boolean(),render:O.boolean()}).required()}),regex:O.object({regex:O.string().min(3)}),special:O.object({special:O.valid("deep").required()}),template:O.object({template:O.string().required(),options:O.object()}),value:O.object({value:O.alternatives([O.object(),O.array()]).required()})};me.desc.entity=O.alternatives([O.array().items(O.link("...")),O.boolean(),O.function(),O.number(),O.string(),me.desc.buffer,me.desc.func,me.desc.ref,me.desc.regex,me.desc.special,me.desc.template,me.desc.value,O.link("/")]);me.desc.values=O.array().items(null,O.boolean(),O.function(),O.number().allow(1/0,-1/0),O.string().allow(""),O.symbol(),me.desc.buffer,me.desc.func,me.desc.override,me.desc.ref,me.desc.regex,me.desc.template,me.desc.value);me.desc.messages=O.object().pattern(/.+/,[O.string(),me.desc.template,O.object().pattern(/.+/,[O.string(),me.desc.template])]);Ea.description=O.object({type:O.string().required(),flags:O.object({cast:O.string(),default:O.any(),description:O.string(),empty:O.link("/"),failover:me.desc.entity,id:O.string(),label:O.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:O.boolean(),unit:O.string()}).unknown(),preferences:{allowUnknown:O.boolean(),abortEarly:O.boolean(),artifacts:O.boolean(),cache:O.boolean(),convert:O.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:O.boolean(),label:["path","key"],language:[O.string(),me.desc.ref],wrap:{label:me.wrap,array:me.wrap}},externals:O.boolean(),messages:me.desc.messages,noDefaults:O.boolean(),nonEnumerables:O.boolean(),presence:["required","optional","forbidden"],skipFunctions:O.boolean(),stripUnknown:O.object({arrays:O.boolean(),objects:O.boolean()}).or("arrays","objects").allow(!0,!1),warnings:O.boolean()},allow:me.desc.values,invalid:me.desc.values,rules:O.array().min(1).items({name:O.string().required(),args:O.object().min(1),keep:O.boolean(),message:[O.string(),me.desc.messages],warn:O.boolean()}),keys:O.object().pattern(/.*/,O.link("/")),link:me.desc.ref}).pattern(/^[a-z]\w*$/,O.any())});var iw=g((zB,rw)=>{"use strict";var bi={};rw.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);bi.isSafe(r)?e+=t[n]:e+=bi.escapeHtmlChar(r)}return e};bi.escapeHtmlChar=function(t){let e=bi.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};bi.isSafe=function(t){return bi.safeCharCodes.has(t)};bi.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);bi.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 sw=g(Aa=>{"use strict";var Ce={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};Aa.Parser=class{constructor(t,e={}){if(!e[Ce.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[Ce.settings]?e:Object.assign({[Ce.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 Aa.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(Ce.operatorCharacters.includes(n))u&&u.type==="operator"&&Ce.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Ce.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(Ce.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 Ce.literals?i=Ce.literals[a]:a==="("?(s(),++r):Ce.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(Ce.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Ce.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 Ce.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):Ce.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 Ce.literals&&!s?(i+=c,o=Ce.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new Aa.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=Ce.evaluate(i,t);e[n]=Ce.single(r.value,s)}}return Ce.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Ce.evaluate(e[r-1],t),o=Ce.evaluate(e[r+1],t);e.splice(r,2);let a=Ce.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Ce.evaluate(e[0],t)}};Aa.Parser.prototype[Ce.symbol]=!0;Ce.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Ce.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Ce.symbol]?t.evaluate(e):t};Ce.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Ce.calculate=function(t,e,n){if(t==="??")return Ce.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Ce.exists(e)?e:"",n=Ce.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};Ce.exists=function(t){return t!=null}});var aw=g(ow=>{"use strict";var WD=rn(),GD=Ze(),Ji={annotations:Symbol("annotations")};ow.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=WD(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,d=i;for(let p=0;;++p){let y=l[p];if(GD.isSchema(d)&&(d=d.clone()),p+1<l.length&&typeof d[y]!="string")d=d[y];else{let _=d[Ji.annotations]||{errors:{},missing:{}};d[Ji.annotations]=_;let E=y||c.context.key;d[y]!==void 0?(_.errors[E]=_.errors[E]||[],_.errors[E].push(u)):_.missing[E]=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=Ji.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
101
  ${c} ${e}[${u}]${r}`).replace(s.specials,(a,u)=>u);o=`${o}
102
102
  ${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};Ki.safeStringify=function(t,e){return JSON.stringify(t,Ki.serializer(),e)};Ki.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[Ki.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 Ir=g(kt=>{"use strict";var IP=zx(),MP=Je(),LP=gi();kt.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=kt.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 kt.template(this.value,t,e||this.code,this.state,this.prefs)}};kt.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};kt.template=function(t,e,n,r,i){if(!e)return;if(LP.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(MP.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["*"]};kt.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=kt.path(i);return s||kt.template(null,n.messages,"root",e,n)||r&&kt.template(null,r,"root",e,n)||"value"};kt.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=kt.details(t);if(r)return r;if(n.errors.stack)return new kt.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new kt.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};kt.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}};kt.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof kt.ValidationError}};kt.ValidationError.prototype.isJoi=!0;kt.ValidationError.prototype.name="ValidationError";kt.ValidationError.prototype.annotate=IP.error});var Mr=g(Nn=>{"use strict";var Ln=De(),qP=en(),NP=Vi(),wa=Je(),bm,qn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};Nn.create=function(t,e={}){Ln(typeof t=="string","Invalid reference key:",t),wa.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Ln(!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&&(Ln(!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)Ln(!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)};Nn.in=function(t,e={}){return Nn.create(t,{...e,in:!0})};Nn.isRef=function(t){return t?!!t[wa.symbols.ref]:!1};qn.Ref=class{constructor(t){Ln(typeof t=="object","Invalid reference construction"),wa.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Ln([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Ln(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Ln(!t.map||Array.isArray(t.map),"options.map must be an array"),Ln(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,qn.defaults,t),Ln(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 Ln(!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):(Ln(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=NP(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[wa.symbols.ref]=!0;Nn.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]};Nn.toSibling=0;Nn.toParent=1;Nn.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?Nn.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(wa.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}Nn.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),bm=bm||gi(),bm.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new Nn.Manager;return t.refs=qP(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var gi=g((Qx,Zx)=>{"use strict";var Tl=De(),jP=en(),FP=Gx(),$P=Vx(),Yx=Je(),Xx=Ir(),Jx=Mr(),Fe={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}};Zx.exports=Qx=Fe.Template=class{constructor(t,e){if(Tl(typeof t=="string","Template source must be a string"),Tl(!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?jP(r):void 0,this._functions=n,this._functions&&(Tl(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),Tl(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=Fe.encode(this.source),e=Fe.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(`{${Fe.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let d=this._ref(Fe.decode(c),{raw:o,wrapped:l});r.push(d),typeof d!="string"&&(n=!0);let p=s.slice(u+a.length);p&&r.push(Fe.decode(p))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return Fe.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 Fe.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[Yx.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=Fe.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:FP(u);s.push(Fe.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=Jx.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?{...Fe.functions,...this._functions}:Fe.functions;var s=new $P.Parser(t,{reference:i,functions:o,constants:Fe.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 Fe.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};Fe.Template.prototype[Yx.symbols.template]=!0;Fe.Template.prototype.isImmutable=!0;Fe.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>Fe.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>Fe.closes.slice(0,n.length))};Fe.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};Fe.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};Fe.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};Fe.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(Jx.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 Fe.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 Fe.Template.date(t,r);if(t instanceof Map){let l=[];for(let[d,p]of t.entries())l.push(`${d.toString()} -> ${p.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push(Fe.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return Fe.wrap(c.join(", "),!u&&a.array)};Fe.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};Fe.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=Xx.template(e,o[0],t,n,r)||Xx.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 Js=g(Ea=>{"use strict";var zi=De(),ew=en(),Sn=gi();Ea.compile=function(t,e){if(typeof t=="string")return zi(!e,"Cannot set single message string"),new Sn(t);if(Sn.isTemplate(t))return zi(!e,"Cannot set single message template"),t;zi(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?ew(e):{};for(let n in t){let r=t[n];if(n==="root"||Sn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new Sn(r);continue}zi(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"||Sn.isTemplate(s)){e[i][n]=s;continue}zi(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new Sn(s)}}return e};Ea.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(Sn.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};Ea.merge=function(t,e){if(!t)return Ea.compile(e);if(!e)return t;if(typeof e=="string")return new Sn(e);if(Sn.isTemplate(e))return e;let n=ew(t);for(let r in e){let i=e[r];if(r==="root"||Sn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new Sn(i);continue}zi(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"||Sn.isTemplate(o)){n[s][r]=o;continue}zi(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new Sn(o)}}return n}});var Je=g(Qe=>{"use strict";var Sl=De(),BP=hm(),UP=Hx(),vm,_m,HP={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=UP.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"){Sl(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));Sl(r.length===0,`${n} contain unknown keys: ${r}`)};Qe.checkPreferences=function(t){_m=_m||vl();let e=_m.preferences.validate(t);if(e.error)throw new BP([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 HP.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?(Sl(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){vm=vm||Js(),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=vm.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)Sl(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Tm=g(tw=>{"use strict";var WP=De(),GP=en(),VP=Je(),Qs={max:1e3,supported:new Set(["undefined","boolean","number","string"])};tw.provider={provision(t){return new Qs.Cache(t)}};Qs.Cache=class{constructor(t={}){VP.assertOptions(t,["max"]),WP(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||Qs.max,this._map=new Map,this._list=new Qs.List}get length(){return this._map.size}set(t,e){if(t!==null&&!Qs.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),GP(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};Qs.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 Xi=g(Lr=>{"use strict";var dt=De(),kn=Je(),Zs=Mr(),jn={};Lr.schema=function(t,e,n={}){kn.assertOptions(n,["appendPath","override"]);try{return jn.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};jn.schema=function(t,e,n){dt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(dt(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(jn.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(dt(typeof e=="object","Invalid schema content:",typeof e),kn.isResolvable(e))return r(t,e);if(kn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!jn.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):(dt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};Lr.ref=function(t,e){return Zs.isRef(t)?t:Zs.create(t,e)};Lr.compile=function(t,e,n={}){kn.assertOptions(n,["legacy"]);let r=e&&e[kn.symbols.any];if(r)return dt(n.legacy||r.version===kn.version,"Cannot mix different versions of joi schemas:",r.version,kn.version),e;if(typeof e!="object"||!n.legacy)return Lr.schema(t,e,{appendPath:!0});let i=jn.walk(e);return i?i.compile(i.root,e):Lr.schema(t,e,{appendPath:!0})};jn.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=jn.walk(n);if(r)return r}return null}let e=t[kn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};dt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=jn.walk(t[n]);if(r)return r}return null};jn.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};Lr.when=function(t,e,n){if(n===void 0&&(dt(e&&typeof e=="object","Missing options"),n=e,e=Zs.create(".")),Array.isArray(n)&&(n={switch:n}),kn.assertOptions(n,["is","not","then","otherwise","switch","break"]),kn.isSchema(e))return dt(n.is===void 0,'"is" can not be used with a schema condition'),dt(n.not===void 0,'"not" can not be used with a schema condition'),dt(n.switch===void 0,'"switch" can not be used with a schema condition'),jn.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(dt(Zs.isRef(e)||typeof e=="string","Invalid condition:",e),dt(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 dt(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),dt(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!Zs.isRef(n.is)&&!kn.isSchema(n.is)&&(s=s.required()),jn.condition(t,{ref:Lr.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}dt(Array.isArray(n.switch),'"switch" must be an array'),dt(n.is===void 0,'Cannot combine "switch" with "is"'),dt(n.not===void 0,'Cannot combine "switch" with "not"'),dt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:Lr.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;kn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),dt(s.is!==void 0,'Switch statement missing "is"'),dt(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!Zs.isRef(s.is)&&!kn.isSchema(s.is)&&(a.is=a.is.required()),o){dt(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&&(dt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};jn.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 Sm=g(rw=>{"use strict";var mi=De(),KP=en(),nw=Je(),zP=Js(),gr={};rw.type=function(t,e){let n=Object.getPrototypeOf(t),r=KP(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=zP.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 d in s.terms){let p=s.terms[d];mi(i.$_terms[d]===void 0,"Invalid term override for",s.type,d),i.$_terms[d]=p.init,a[d]=p}s.terms=a,s.args||(s.args=o.args),s.prepare=gr.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=gr.coerce(s.coerce,o.coerce),s.validate=gr.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let d in s.rules){let p=s.rules[d];mi(typeof p=="object","Invalid rule definition for",s.type,d);let y=p.method;if(y===void 0&&(y=function(){return this.$_addRule(d)}),y&&(mi(!r[d],"Rule conflict in",s.type,d),r[d]=y),mi(!u[d],"Rule conflict in",s.type,d),u[d]=p,p.alias){let _=[].concat(p.alias);for(let E of _)r[E]=p.method}p.args&&(p.argsByName=new Map,p.args=p.args.map(_=>(typeof _=="string"&&(_={name:_}),mi(!p.argsByName.has(_.name),"Duplicated argument name",_.name),nw.isSchema(_.assert)&&(_.assert=_.assert.strict().label(_.name)),p.argsByName.set(_.name,_),_)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let d in s.modifiers){mi(!r[d],"Rule conflict in",s.type,d);let p=s.modifiers[d];mi(typeof p=="function","Invalid modifier definition for",s.type,d);let y=function(_){return this.rule({[d]:_})};r[d]=y,c[d]=p}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let d in s.overrides)mi(n[d],"Cannot override missing",d),s.overrides[d][nw.symbols.parent]=n[d],i.$_super[d]=n[d].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=gr.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=gr.rebuild(s.rebuild,o.rebuild),i};gr.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};gr.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}}};gr.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}};gr.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};gr.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 wm=g(xm=>{"use strict";var mr=De(),kl=en(),Yi=Je(),XP=Js(),iw=Mr(),YP=gi(),km,tn={};xm.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=tn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=kl(t._preferences,{shallow:["messages"]}),delete n.preferences[Yi.symbols.prefs],n.preferences.messages&&(n.preferences.messages=XP.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]=tn.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]=tn.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;mr(!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(Yi.isValues(i)){n[r]=i.describe();continue}mr(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(tn.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"){mr(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return tn.validate(t.$_root,n),n};tn.describe=function(t,e={}){if(Array.isArray(t))return t.map(tn.describe);if(t===Yi.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return kl(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[Yi.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]=tn.describe(i,{assign:r}))}return n};xm.build=function(t,e){return new tn.Builder(t).parse(e)};tn.Builder=class{constructor(t){this.joi=t}parse(t){tn.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;mr(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){mr(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){mr(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 mr(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;mr(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 kl(t);if(e.assign==="regex")return tn.regex(t);if(e.assign==="ref")return iw.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return mr(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[Yi.symbols.literal]:!0,literal:t.function};if(t.override)return Yi.symbols.override;if(t.ref)return iw.build(t.ref);if(t.regex)return tn.regex(t.regex);if(t.special)return mr(["deep"].includes(t.special),"Unknown special value",t.special),Yi.symbols.deepDefault;if(t.value)return kl(t.value)}if(t.type)return this.parse(t);if(t.template)return YP.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};tn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};tn.validate=function(t,e){km=km||vl(),t.assert(e,km.description)}});var Aa=g((GB,sw)=>{"use strict";var yr=mm(),Vt={mismatched:null};sw.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!Vt.isDeepEqual(t,e,n,[])};Vt.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=Vt.getSharedType(t,e,!!n.prototype);switch(s){case yr.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case yr.promise:return t===e;case yr.regex:return t.toString()===e.toString();case Vt.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new Vt.SeenEntry(t,e));try{return!!Vt.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};Vt.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?Vt.mismatched:yr.getInternalProto(t);let r=yr.getInternalProto(t);return r!==yr.getInternalProto(e)?Vt.mismatched:r};Vt.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};Vt.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};Vt.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};Vt.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=Vt,{keys:u,getOwnPropertySymbols:c}=Object;if(t===yr.array)if(r.part){for(let _ of e)for(let E of n)if(s(_,E,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===yr.set){if(e.size!==n.size)return!1;if(!Vt.isSetSimpleEqual(e,n)){let _=new Set(Set.prototype.values.call(n));for(let E of Set.prototype.values.call(e)){if(_.delete(E))continue;let L=!1;for(let M of _)if(s(E,M,r,i)){_.delete(M),L=!0;break}if(!L)return!1}}}else if(t===yr.map){if(e.size!==n.size)return!1;for(let[_,E]of Map.prototype.entries.call(e))if(E===void 0&&!Map.prototype.has.call(n,_)||!s(E,Map.prototype.get.call(n,_),r,i))return!1}else if(t===yr.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),d=o(n);if((e!==l||n!==d)&&!s(l,d,r,i))return!1;let p=u(e);if(!r.part&&p.length!==u(n).length&&!r.skip)return!1;let y=0;for(let _ of p){if(r.skip&&r.skip.includes(_)){n[_]===void 0&&++y;continue}if(!a(n,_)||!s(e[_],n[_],r,i))return!1}if(!r.part&&p.length-y!==u(n).length)return!1;if(r.symbols!==!1){let _=c(e),E=new Set(c(n));for(let L of _){if(!r.skip||!r.skip.includes(L)){if(a(e,L)){if(!a(n,L)||!s(e[L],n[L],r,i))return!1}else if(a(n,L))return!1}E.delete(L)}for(let L of E)if(a(n,L))return!1}return!0};Vt.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var aw=g(ow=>{"use strict";ow.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 Am=g(Em=>{"use strict";var uw=Aa(),cw=aw(),JP=Ir(),Kt={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Em.setup=function(t){let e=function(){return t._tracer=t._tracer||new Kt.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Em.location=function(t){return t.$_setFlag("_tracerLocation",cw.location(2))};Kt.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 Kt.Store(t),{filename:r,line:i}=t._flags._tracerLocation||cw.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(Kt.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 d=a[`_${l}s`];if(!d)continue;let p=new Set(d._values),y=new Set(d._refs);for(let{value:_,ref:E}of u[l])p.delete(_),y.delete(E);(p.size||y.size)&&s.push({status:[...p,...[...y].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 d=Kt.labels[u.rule[l]||0];if(d){let p={rule:l,status:d};u.paths.size&&(p.paths=[...u.paths]),s.push(p)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(Kt.message).join(", ")}`})}return e.length?e:null}};Kt.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){Kt.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){Kt.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){Kt.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]|=Kt.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||uw(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=Kt.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};Kt.message=function(t){return`${t.paths?JP.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};Kt.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)};Kt.sub=function(t,e){for(let n of t)for(let r of e)if(uw(n.slice(0,r.length),r))return!0;return!1};Kt.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var xl=g((JB,fw)=>{"use strict";var Om=De(),lw=en(),QP=ym(),dw={};fw.exports=dw.merge=function(t,e,n){if(Om(t&&typeof t=="object","Invalid target value: must be an object"),Om(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)){Om(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(lw(e[i],{symbols:n.symbols}));return t}let r=QP.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]=lw(o,{symbols:n.symbols}):dw.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var pw=g(wl=>{"use strict";var qr=De(),Cm=Je(),ZP=Mr(),br={};wl.Ids=br.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new br.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())qr(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())qr(!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)};qr(Cm.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:br.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);qr(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||!Cm.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);qr(!r||r.schema===t,"Cannot add different schemas with the same id:",n),qr(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(qr(!this._byKey.has(e),"Schema already contains key:",e),qr(!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);qr(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)}};br.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=wl.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};wl.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=br.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=br.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=br.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};br.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=br.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&Cm.isSchema(t)||n.ref!==!1&&ZP.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=br.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var gw=g((e5,hw)=>{"use strict";hw.exports=function(){}});var bw=g((t5,yw)=>{"use strict";var eI=en(),mw=Vi(),tI=Je(),vr={value:Symbol("value")};yw.exports=vr.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 vr.State(t,e,this);return n&&r.schemas&&(r.schemas=[vr.schemas(n),...r.schemas]),r}nest(t,e){let n=new vr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[vr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new vr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=eI(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()}};vr.schemas=function(t){return tI.isSchema(t)?{schema:t}:t};vr.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[vr.value]=e}get(t){let e=this.node(t);if(e)return e[vr.value]}node(t){if(this._values)return mw(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=mw(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var _w=g(Ca=>{"use strict";var Oa=De(),vw=en(),eo=gw(),nI=Vi(),At=Je(),yi=Ir(),rI=bw(),_e={result:Symbol("result")};Ca.entry=function(t,e,n){let r=At.defaults;n&&(Oa(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),Oa(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=At.preferences(At.defaults,n));let i=_e.entry(t,e,r);Oa(!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};Ca.entryAsync=async function(t,e,n){let r=At.defaults;n&&(r=At.preferences(At.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,d=c.schema.type==="link"?s.links.get(c.schema):null,p=a,y,_,E=l.length?[a]:[],L=l.length?nI(t,l):t;if(l.length){y=l[l.length-1];let M=a;for(let x of l.slice(0,-1))M=M[x],E.unshift(M);_=E[0],p=_[y]}try{let M=(k,v)=>(d||c.schema).$_createError(k,p,v,c.state,r),x=await c.method(p,{schema:c.schema,linked:d,state:c.state,prefs:n,original:L,error:M,errorsArray:_e.errorsArray,warn:(k,v)=>s.warnings.push((d||c.schema).$_createError(k,p,v,c.state,r)),message:(k,v)=>(d||c.schema).$_createError("external",p,v,c.state,r,{messages:k})});if(x===void 0||x===p)continue;if(x instanceof yi.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(x),r.abortEarly)break;continue}if(Array.isArray(x)&&x[At.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...x),r.abortEarly)break;continue}_?(s.tracer.value(c.state,"rule",p,x,"external"),_[y]=x):(s.tracer.value(c.state,"rule",a,x,"external"),a=x)}catch(M){throw r.errors.label&&(M.message+=` (${c.label})`),M}}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 rI([],[],{mainstay:a,schemas:u}),l=Ca.validate(t,e,c,n);i&&e.$_root.untrace();let d=yi.process(l.errors,t,n);return{value:l.value,error:d,mainstay:a}};_e.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(Oa(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:_e.ignore}};Ca.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 d=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!d),d)return d}let s=(d,p,y)=>e.$_createError(d,t,p,y||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:_e.errorsArray,warn:(d,p,y)=>n.mainstay.warnings.push(s(d,p,y)),message:(d,p)=>e.$_createError("custom",t,p,n,r,{messages:d})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let d=a.prepare(t,o);if(d){if(n.mainstay.tracer.value(n,"prepare",t,d.value),d.errors)return _e.finalize(d.value,[].concat(d.errors),o);t=d.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let d=a.coerce.method(t,o);if(d){if(n.mainstay.tracer.value(n,"coerced",t,d.value),d.errors)return _e.finalize(d.value,[].concat(d.errors),o);t=d.value}}let u=e._flags.empty;u&&u.$_match(_e.trim(t,e),n.nest(u),At.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!==At.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 d=e._valids.get(t,n,r,e._flags.insensitive);if(d)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,d.value),t=d.value),n.mainstay.tracer.filter(e,n,"valid",d),_e.finalize(t,null,o);if(e._flags.only){let p=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return _e.finalize(t,[p],o);l.push(p)}}if(e._invalids){let d=e._invalids.get(t,n,r,e._flags.insensitive);if(d){n.mainstay.tracer.filter(e,n,"invalid",d);let p=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return _e.finalize(t,[p],o);l.push(p)}}if(a.validate){let d=a.validate(t,o);if(d&&(n.mainstay.tracer.value(n,"base",t,d.value),t=d.value,d.errors)){if(!Array.isArray(d.errors))return l.push(d.errors),_e.finalize(t,l,o);if(d.errors.length)return l.push(...d.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 d of o._resolve){let p=a.argsByName.get(d),y=c[d].resolve(t,i,s),_=p.normalize?p.normalize(y):y,E=At.validateArg(_,null,p);if(E){u=r.$_createError("any.ref",y,{arg:d,ref:c[d],reason:E},i,s);break}c[d]=_}}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[At.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)Oa(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===At.defaults;return n&&t._preferences[At.symbols.prefs]?t._preferences[At.symbols.prefs]:(e=At.preferences(e,t._preferences),n&&(t._preferences[At.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?[vw(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[At.symbols.literal]?a.literal:At.isResolvable(a)?a.resolve(e,s,o):vw(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:eo,entry:eo,filter:eo,log:eo,resolve:eo,value:eo};_e.errorsArray=function(){let t=[];return t[At.symbols.errors]=!0,t}});var Dm=g((o5,Sw)=>{"use strict";var iI=De(),Tw=Aa(),Rm=Je(),Nr={};Sw.exports=Nr.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=Nr.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(Rm.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 Nr.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(Rm.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(Tw(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(Tw(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 Nr.Values(this._values,this._refs);return t._override=this._override,t}concat(t){iI(!t._override,"Cannot concat override set of values");let e=new Nr.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}};Nr.Values.prototype[Rm.symbols.values]=!0;Nr.Values.prototype.slice=Nr.Values.prototype.clone;Nr.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 Rw=g((u5,Cw)=>{"use strict";var ee=De(),kw=en(),xw=Aa(),Pm=xl(),sI=Tm(),yt=Je(),Im=Xi(),oI=Ir(),aI=Sm(),ww=wm(),uI=Js(),Ew=pw(),Aw=Mr(),Ow=Am(),El=_w(),Al=Dm(),It={};It.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new Ew.Ids,this._preferences=null,this._refs=new Aw.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 ee(typeof ww.describe=="function","Manifest functionality disabled"),ww.describe(this)}allow(...t){return yt.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){ee(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),ee(!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];ee(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 ee(t!==void 0,"Artifact cannot be undefined"),ee(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return ee(t===!1||typeof t=="string","Invalid to value"),ee(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 ee(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 ee(t,"Missing error"),ee(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return ee(t!==void 0,"Missing example"),yt.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(ee(!e,"Cannot combine options with description"),e=t.description,t=t.method),ee(typeof t=="function","Method must be a function"),ee(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?(ee(typeof t=="string","id must be a non-empty string"),ee(/^[^\.]+$/.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 ee(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return ee(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){ee(t.length,"Missing notes");for(let e of t)ee(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return ee(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){ee(t,"Missing preferences"),ee(t.context===void 0,"Cannot override context"),ee(t.externals===void 0,"Cannot override externals"),ee(t.warnings===void 0,"Cannot override warnings"),ee(t.debug===void 0,"Cannot override debug"),yt.checkPreferences(t);let e=this.clone();return e._preferences=yt.preferences(e._preferences,t),e}presence(t){return ee(["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 ee(["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=yt.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){ee(t.length,"Missing tags");for(let e of t)ee(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return ee(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){yt.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=Im.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)ee(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),ee(!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){ee(!this._inRuleset(),"Cannot set caching inside a ruleset"),ee(!this._cache,"Cannot override schema cache"),ee(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||sI.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){ee(yt.isSchema(t),"Invalid schema object"),ee(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),ee(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),ee(!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,Aw.toSibling),e._preferences=e._preferences?yt.preferences(e._preferences,t._preferences):t._preferences,e._valids=Al.merge(e._valids,t._valids,t._invalids),e._invalids=Al.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,Pm(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,Pm(e._flags,n)}else Pm(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 ee(!t.base,"Cannot extend type with another base"),aI.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){ee(!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;yt.assertOptions(t,Object.keys(e.modifiers)),ee(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;ee(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=kw(s);for(let a in t)e.modifiers[a](o,t[a]),ee(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(){ee(!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),ee(!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),ee(yt.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 Ow.location?Ow.location(this):this}validate(t,e){return El.entry(t,this,e)}validateAsync(t,e){return El.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),ee(t&&typeof t=="object","Invalid options"),ee(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)ee(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;ee(n,"Unknown rule",e.method);let i=this.clone();if(r){ee(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&&yt.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=yt.validateArg(o,s,a);ee(!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 Im.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?uI.merge(this._definition.messages,s.messages):this._definition.messages;return new oI.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=!El.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return yt.assertOptions(t,["each","once","ref","schema"]),Ew.schema(this,t)||this}$_mutateRebuild(){ee(!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={}){ee(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(xw(e,r.default)&&(e=void 0),xw(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][yt.symbols.parent].call(this,...e)}$_validate(t,e,n){return El.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=kw(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 yt.assertOptions(n,"literal"),ee(e!==void 0,"Missing",t,"value"),ee(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[yt.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,d=i.length;for(let p=0;p<l.length;++p){let{is:y,then:_,otherwise:E}=l[p],L=`${a}${u.switch?"."+p:""}`;if(y.$_match(c,e.nest(y,`${L}.is`),n)){if(_){let M=e.localize([...e.path,`${L}.then`],e.ancestors,e.schemas),{schema:x,id:k}=_._generate(t,M,n);r.push(x),i.push(`${L}.then${k?`(${k})`:""}`);break}}else if(E){let M=e.localize([...e.path,`${L}.otherwise`],e.ancestors,e.schemas),{schema:x,id:k}=E._generate(t,M,n);r.push(x),i.push(`${L}.otherwise${k?`(${k})`:""}`);break}}if(u.break&&i.length>d)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={}){ee(!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){yt.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===yt.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new Al:r&&(n[e]=t.length?new Al:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){ee(i!==void 0,"Cannot call allow/valid/invalid with undefined"),ee(i!==yt.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(ee(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}};It.Base.prototype[yt.symbols.any]={version:yt.version,compile:Im.compile,root:"$_root"};It.Base.prototype.isImmutable=!0;It.Base.prototype.deny=It.Base.prototype.invalid;It.Base.prototype.disallow=It.Base.prototype.invalid;It.Base.prototype.equal=It.Base.prototype.valid;It.Base.prototype.exist=It.Base.prototype.required;It.Base.prototype.not=It.Base.prototype.invalid;It.Base.prototype.options=It.Base.prototype.prefs;It.Base.prototype.preferences=It.Base.prototype.prefs;Cw.exports=new It.Base});var Fn=g((l5,Dw)=>{"use strict";var Ol=De(),cI=Rw(),lI=Je(),dI=Js();Dw.exports=cI.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 Ol(typeof t=="function","Method must be a function"),Ol(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){Ol(lI.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 Ol(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=dI.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 Mw=g((d5,Iw)=>{"use strict";var Ji=De(),fI=xl(),pI=Fn(),Pw=Je(),hI=Xi(),Cl=Ir(),gI=Mr(),to={};Iw.exports=pI.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:gI.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 d=n.$_terms.matches[l],p=i.nest(d.schema,`match.${l}`);p.snapshot();let y=d.schema.$_validate(t,p,s);y.errors?(u.push(y.errors),p.restore()):(a.push(y.value),p.commit())}if(a.length===0){let l={details:u.map(d=>Cl.details(d,{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(d=>Cl.details(d,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(d=>d.schema.type==="object"||d.schema.type==="alternatives"&&c(d.schema));return c(n)?{value:a.reduce((l,d)=>fI(l,d,{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 d=i.nest(u.schema,`match.${a}`);d.snapshot();let p=u.schema.$_validate(t,d,s);if(!p.errors)return d.commit(),p;d.restore(),o.push({schema:u.schema,reports:p.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let d=0;d<l.length;++d){let p=l[d],{is:y,then:_,otherwise:E}=p,L=`match.${a}${u.switch?"."+d:""}`;if(y.$_match(c,i.nest(y,`${L}.is`),s)){if(_)return _.$_validate(t,i.nest(_,`${L}.then`),s)}else if(E)return E.$_validate(t,i.nest(E,`${L}.otherwise`),s)}}return to.errors(o,e)},rules:{conditional:{method(t,e){Ji(!this._flags._endedSwitch,"Unreachable condition"),Ji(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Ji(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=hI.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(Ji(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Ji(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Ji(t.length,"Missing alternative schemas"),Pw.verifyFlat(t,"try"),Ji(!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=>{Pw.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}}"}});to.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 to.unmatched(t,e);let a=s[0];if(!(a instanceof Cl.Report))return to.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}:to.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};to.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",Cl.details(n,{override:!1}))}}});var qw=g((f5,Lw)=>{"use strict";var Ra=De(),mI=Aa(),yI=Vi(),bI=Fn(),$n=Je(),vI=Xi(),st={};Lw.exports=bI.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 st.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[$n.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){$n.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=$n.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[$n.symbols.arraySingle];delete t[$n.symbols.arraySingle];let l=s(),d=t.length;for(let p=0;p<d;++p){let y=t[p],_=!1,E=!1,L=c?p:new Number(p),M=[...r.path,L];if(!e._flags.sparse&&y===void 0){if(l.push(n("array.sparse",{key:L,path:M,pos:p,value:void 0},r.localize(M))),i.abortEarly)return l;a.shift();continue}let x=[t,...r.ancestors];for(let C of e.$_terms._exclusions)if(C.$_match(y,r.localize(M,x,C),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:p,value:y},r.localize(M))),i.abortEarly)return l;_=!0,a.shift();break}if(_)continue;if(e.$_terms.ordered.length){if(a.length){let C=a.shift(),V=C.$_validate(y,r.localize(M,x,C),i);if(V.errors){if(l.push(...V.errors),i.abortEarly)return l}else if(C._flags.result==="strip")st.fastSplice(t,p),--p,--d;else if(!e._flags.sparse&&V.value===void 0){if(l.push(n("array.sparse",{key:L,path:M,pos:p,value:void 0},r.localize(M))),i.abortEarly)return l;continue}else t[p]=V.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:p,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let k=[],v=o.length;for(let C=0;C<v;++C){let V=r.localize(M,x,o[C]);V.snapshot();let ae=o[C].$_validate(y,V,i);if(k[C]=ae,!ae.errors){if(V.commit(),t[p]=ae.value,E=!0,st.fastSplice(o,C),--C,--v,!e._flags.sparse&&ae.value===void 0&&(l.push(n("array.sparse",{key:L,path:M,pos:p,value:void 0},r.localize(M))),i.abortEarly))return l;break}V.restore()}if(E)continue;let F=i.stripUnknown&&!!i.stripUnknown.arrays||!1;v=u.length;for(let C of u){let V,ae=o.indexOf(C);if(ae!==-1)V=k[ae];else{let ge=r.localize(M,x,C);if(ge.snapshot(),V=C.$_validate(y,ge,i),!V.errors){ge.commit(),C._flags.result==="strip"?(st.fastSplice(t,p),--p,--d):!e._flags.sparse&&V.value===void 0?(l.push(n("array.sparse",{key:L,path:M,pos:p,value:void 0},r.localize(M))),_=!0):t[p]=V.value,E=!0;break}ge.restore()}if(v===1){if(F){st.fastSplice(t,p),--p,--d,E=!0;break}if(l.push(...V.errors),i.abortEarly)return l;_=!0;break}}if(!_&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!E){if(F){st.fastSplice(t,p),--p,--d;continue}if(l.push(n("array.includes",{pos:p,value:y},r.localize(M))),i.abortEarly)return l}}return o.length&&st.fillMissedErrors(e,l,o,t,r,i),a.length&&(st.fillOrderedErrors(e,l,a,t,r,i),l.length||st.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 $n.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:$n.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){$n.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=$n.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});st.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 Ra(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){$n.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=vI.ref(t.by,{ancestor:0}),Ra(!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}=st.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={}){Ra(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),$n.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=$n.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||mI,l=s.ignoreUndefined;for(let d=0;d<t.length;++d){let p=a?yI(t[d],a):t[d],y=o?u.custom:u[typeof p];if(Ra(y,"Failed to find unique map container for type",typeof p),y instanceof Map){let _=y.entries(),E;for(;!(E=_.next()).done;)if(c(E.value[0],p)){let L=e.localize([...e.path,d],[t,...e.ancestors]),M={pos:d,value:t[d],dupePos:E.value[1],dupeValue:t[E.value[1]]};return a&&(M.path=i),n("array.unique",M,L)}y.set(p,d)}else{if((!l||p!==void 0)&&y[p]!==void 0){let _={pos:d,value:t[d],dupePos:y[p],dupeValue:t[y[p]]};a&&(_.path=i);let E=e.localize([...e.path,d],[t,...e.ancestors]);return n("array.unique",_,E)}y[p]=d}}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)st.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)st.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"}});st.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))};st.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&st.fillMissedErrors(t,e,o,r,i,s)};st.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)};st.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};st.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(Ra(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};st.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let d=st.compare(c,l,o,a);if(d!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),d=st.compare(c,l,o,a),d!==null))return d;let p=typeof c;if(p!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(p!=="number"&&p!=="string")throw t.$_createError("array.sort.unsupported",e,{type:p},r,i);return p==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};st.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 Bw=g((p5,$w)=>{"use strict";var Nw=De(),_I=Fn(),jw=Je(),Fw=Dm(),Mm={};Mm.isBool=function(t){return typeof t=="boolean"};$w.exports=_I.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){jw.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new Fw;for(let n=0;n<t.length;++n){let r=t[n];Nw(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){jw.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new Fw;for(let n=0;n<t.length;++n){let r=t[n];Nw(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:Mm.isBool,to(t,e){return t?1:0}},string:{from:Mm.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 Gw=g((h5,Ww)=>{"use strict";var Uw=De(),TI=Fn(),Hw=Je(),SI=gi(),er={};er.isDate=function(t){return t instanceof Date};Ww.exports=TI.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:er.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 Hw.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:er.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return Uw(["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 Uw(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:er.isDate,to(t,e){return t.getTime()}},string:{from:er.isDate,to(t,{prefs:e}){return SI.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"}});er.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 Hw.isIsoDate(t)?er.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return er.date(1*t);if(e==="unix")return er.date(1e3*t);if(typeof n=="string")return null}return er.date(t)};er.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var Yw=g((g5,Xw)=>{"use strict";var Rl=De(),Kw=en(),zw=xl(),Vw=Vi(),Dl={};Xw.exports=function(t,e,n={}){if(Rl(t&&typeof t=="object","Invalid defaults value: must be an object"),Rl(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),Rl(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return Dl.applyToDefaultsWithShallow(t,e,n);let r=Kw(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return zw(r,e,{nullOverride:i,mergeArrays:!1})};Dl.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;Rl(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=Vw(t,u);c&&typeof c=="object"?i.set(c,s&&Vw(e,u)||c):s&&s.add(u)}let o=Kw(t,{},i);if(!s)return o;for(let u of s)Dl.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return zw(o,e,{nullOverride:a,mergeArrays:!1})};Dl.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 Zw=g(Qw=>{"use strict";var Qi=De(),Jw={};Qw.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;Qi(!n.includes(i),`Item cannot come before itself: ${i}`),Qi(!n.includes("?"),"Item cannot come before unassociated items"),Qi(!r.includes(i),`Item cannot come after itself: ${i}`),Qi(!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();Qi(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(Jw.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Qi(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Qi(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,d=0;for(let p=0;p<l;++p)i[r[c][p]]&&++d;if(d===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}};Jw.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var qm=g((b5,n0)=>{"use strict";var kI=Yw(),Bn=De(),e0=en(),xI=Zw(),wI=Fn(),zt=Je(),Lm=Xi(),EI=Ir(),t0=Mr(),Pl=gi(),de={renameDefaults:{alias:!1,multiple:!1,override:!1}};n0.exports=wI.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=de.clone(t,i);let s=[];if(e.$_terms.renames&&!de.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 d=r.localize([...r.path,c],a,u),p=u.schema.$_validate(l,d,i);if(p.errors){if(i.abortEarly)return{value:t,errors:p.errors};p.value!==void 0&&(t[c]=p.value),s.push(...p.errors)}else u.schema._flags.result==="strip"||p.value===void 0&&l!==void 0?delete t[c]:p.value!==void 0&&(t[c]=p.value)}}if(o.size||e._flags._hasPatternMatch){let a=de.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&&de.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=de.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 zt.verifyFlat(t,"and"),de.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){Pl.isTemplate(t)||(t=Lm.ref(t)),Bn(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=t0.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 Bn(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){Bn(t===void 0||typeof t=="object","Object schema must be a valid object"),Bn(!zt.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 de.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new de.Keys;for(let n in t)zt.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 zt.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:zt.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 zt.verifyFlat(t,"nand"),de.dependency(this,"nand",null,t)}},or:{method(...t){return zt.verifyFlat(t,"or"),de.dependency(this,"or",null,t)}},oxor:{method(...t){return de.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),Bn(e!==void 0,"Invalid rule"),zt.assertOptions(n,["fallthrough","matches"]),r&&Bn(!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 t0.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={}){Bn(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),Bn(typeof e=="string"||e instanceof Pl,"Invalid rename to argument"),Bn(e!==t,"Cannot rename key to same name:",t),zt.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)Bn(i.from!==t,"Cannot rename the same key multiple times");return e instanceof Pl&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:kI(de.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return zt.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 de.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return de.dependency(this,"without",t,e,n)}},xor:{method(...t){return zt.verifyFlat(t,"xor"),de.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=zt.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new xI.Sorter;for(let n of t.$_terms.keys)zt.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new de.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=de.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}}"}});de.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return e0(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=e0(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};de.dependency=function(t,e,n,r,i){Bn(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),zt.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=zt.default(i.separator,"."),o=[];for(let u of r)Bn(typeof u=="string",e,"peers must be strings"),o.push(Lm.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=Lm.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new de.Dependency(e,n,o,r,i)),a};de.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=de.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:de.keysToLabels(t,o),missing:s,missingWithLabels:de.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=de.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:de.keysToLabels(t,a),peers:u,peersWithLabels:de.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=de.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:de.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=de.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:de.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=de.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=de.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:de.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:de.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=de.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:de.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:de.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=de.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:de.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=de.keysToLabels(t,s),{code:"object.xor",context:a})}};de.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};de.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};de.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,d=c.to;if(d instanceof Pl&&(d=d.render(e,n,r,c.match)),l!==d){if(!o.options.multiple&&s[d]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:d,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,d)&&!o.options.override&&!s[d]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:d,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[d]:e[d]=e[l],s[d]=!0,o.options.alias||delete e[l]}}}return!0};de.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 d=e[l],p=[...i.path,l];for(let y=0;y<t.$_terms.patterns.length;++y){let _=t.$_terms.patterns[y];if(_.regex){let M=_.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${y}`,M?"pass":"error"),!M)continue}else if(!_.schema.$_match(l,i.nest(_.schema,`pattern.${y}`),s))continue;n.delete(l);let E=i.localize(p,c,{schema:_.rule,key:l}),L=_.rule.$_validate(d,E,s);if(L.errors){if(s.abortEarly)return{value:e,errors:L.errors};r.push(...L.errors)}if(_.matches&&u[y].push(l),e[l]=L.value,!_.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let d=u[l];if(!d)continue;let p=t.$_terms.patterns[l].matches,y=i.localize(i.path,c,p),_=p.$_validate(d,y,s);if(_.errors){let E=EI.details(_.errors,{override:!1});E.matches=d;let L=t.$_createError("object.pattern.match",e,E,i,s);if(s.abortEarly)return{value:e,errors:L};r.push(L)}}}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(!zt.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)}};de.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}};de.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 i0=g((T5,r0)=>{"use strict";var Nm=De(),AI=qm();r0.exports=AI.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return Nm(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 Nm(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 Nm(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 o0=g((S5,s0)=>{"use strict";var jr=De(),OI=Fn(),CI=Je(),RI=Xi(),DI=Ir(),Fr={};s0.exports=OI.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}){jr(e.$_terms.link,"Uninitialized link schema");let i=Fr.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 Fr.generate(t,e,n,r)},rules:{ref:{method(t){jr(!this.$_terms.link,"Cannot reinitialize schema"),t=RI.ref(t),jr(t.type==="value"||t.type==="local","Invalid reference type:",t.type),jr(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){jr(this.$_terms.link,"Uninitialized link schema"),jr(CI.isSchema(t),"Invalid schema object"),jr(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 jr(e.link,"Invalid link description missing link"),t.ref(e.link)}}});Fr.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}=Fr.perspective(s,n);Fr.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{Fr.assert(!1,"to non-existing schema",s,t,n,r)}return Fr.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};Fr.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}};Fr.assert=function(t,e,n,r,i,s){t||jr(!1,`"${DI.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var u0=g((k5,a0)=>{"use strict";var jm=De(),PI=Fn(),Fm=Je(),xn={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))))}};a0.exports=PI.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(xn.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(xn.extractSignificantDigits(t)!==xn.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!==xn.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(!Fm.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 Fm.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Fm.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"?xn.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 xn.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 jm(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(xn.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 jm(["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 jm(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"}});xn.extractSignificantDigits=function(t){return t.replace(xn.exponentialPartRegex,"").replace(xn.dotRegex,"").replace(xn.trailingZerosRegex,"").replace(xn.leadingSignAndZerosRegex,"")};xn.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 l0=g((x5,c0)=>{"use strict";var II=qm();c0.exports=II.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var $m=g(Il=>{"use strict";Il.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"};Il.code=function(t){return{code:t,error:Il.codes[t]}}});var Bm=g(Ml=>{"use strict";var MI=require("url"),tr=$m(),bi={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:MI.URL||URL};Ml.analyze=function(t,e={}){if(!t)return tr.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return tr.code("DOMAIN_TOO_LONG");if(!!bi.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return tr.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(bi.domainControlRx.test(t))return tr.code("DOMAIN_INVALID_CHARS");t=bi.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||bi.minDomainSegments,i=t.split(".");if(i.length<r)return tr.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return tr.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 tr.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return tr.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return tr.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!bi.domainSegmentRx.test(a))return tr.code("DOMAIN_INVALID_CHARS")}else if(!bi.tldSegmentRx.test(a))return tr.code("DOMAIN_INVALID_TLDS_CHARS")}return null};Ml.isValid=function(t,e){return!Ml.analyze(t,e)};bi.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new bi.URL(`http://${t}`).host}catch{return t}}});var d0=g(Um=>{"use strict";var LI=require("util"),qI=Bm(),_r=$m(),nn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(LI.TextEncoder||TextEncoder)};Um.analyze=function(t,e){return nn.email(t,e)};Um.isValid=function(t,e){return!nn.email(t,e)};nn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return _r.code("EMPTY_STRING");let n=!nn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return _r.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?_r.code("MULTIPLE_AT_CHAR"):_r.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return _r.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return _r.code("ADDRESS_TOO_LONG");if(nn.encoder.encode(i).length>64)return _r.code("LOCAL_TOO_LONG")}return nn.local(i,n)||qI.analyze(s,e)};nn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return _r.code("EMPTY_LOCAL_SEGMENT");if(e){if(!nn.atextRx.test(r))return _r.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(nn.atextRx.test(i))continue;let s=nn.binary(i);if(!nn.atomRx.test(s))return _r.code("INVALID_LOCAL_CHARS")}}};nn.binary=function(t){return Array.from(nn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};nn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;nn.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 Hm=g((O5,f0)=>{"use strict";f0.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Gm=g(Wm=>{"use strict";var Ll=De(),NI=Hm(),$t={};$t.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+")",d="(?:"+c+":){6}"+l,p="::(?:"+c+":){5}"+l,y="(?:"+c+")?::(?:"+c+":){4}"+l,_="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,E="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,L="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,M="(?:(?:"+c+":){0,4}"+c+")?::"+l,x="(?:(?:"+c+":){0,5}"+c+")?::"+c,k="(?:(?:"+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="(?:"+d+"|"+p+"|"+y+"|"+_+"|"+E+"|"+L+"|"+M+"|"+x+"|"+k+")",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+":]*",F="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",C="["+r+s+i+"]{1,255}",V="(?:"+F+"|"+t.ipv4address+"|"+C+")",ae="\\d*",ge="(?:"+v+"@)?"+V+"(?::"+ae+")?",G="(?:"+v+"@)?("+V+")(?::"+ae+")?",A=a+"*",P=a+"+",I="["+r+s+i+"@]+",j="",fe="(?:\\/"+A+")*",le="\\/(?:"+P+fe+")?",Rt=P+fe,ht=I+fe,je="(?:\\/\\/\\/"+A+fe+")";return t.hierPart="(?:(?:\\/\\/"+ge+fe+")|"+le+"|"+Rt+"|"+je+")",t.hierPartCapture="(?:(?:\\/\\/"+G+fe+")|"+le+"|"+Rt+")",t.relativeRef="(?:(?:\\/\\/"+ge+fe+")|"+le+"|"+ht+"|"+j+")",t.relativeRefCapture="(?:(?:\\/\\/"+G+fe+")|"+le+"|"+ht+"|"+j+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};$t.rfc3986=$t.generate();Wm.ip={v4Cidr:$t.rfc3986.ipv4Cidr,v6Cidr:$t.rfc3986.ipv6Cidr,ipv4:$t.rfc3986.ipv4address,ipv6:$t.rfc3986.ipv6address,ipvfuture:$t.rfc3986.ipvFuture};$t.createRegex=function(t){let e=$t.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return $t.wrap(i+r);let s="";if(t.scheme){Ll(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);Ll(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let d=0;d<c.length;++d){let p=c[d];Ll(p instanceof RegExp||typeof p=="string","scheme at position "+d+" must be a RegExp or String"),p instanceof RegExp?l.push(p.source.toString()):(Ll(e.schemeRegex.test(p),"scheme at position "+d+" must be a valid scheme"),l.push(NI(p)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return $t.wrap(u+r,s)};$t.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};$t.uriRegex=$t.createRegex({});Wm.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?$t.createRegex(t):$t.uriRegex}});var h0=g(p0=>{"use strict";var no=De(),Da=Gm();p0.regex=function(t={}){no(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";no(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),no(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]),no(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)no(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),no(["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 Da.ip[o];let a=`\\/${o==="ipv4"?Da.ip.v4Cidr:Da.ip.v6Cidr}`;return e==="required"?`${Da.ip[o]}${a}`:`${Da.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var y0=g((D5,m0)=>{"use strict";var g0={};g0.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"];m0.exports=new Set(g0.tlds.map(t=>t.toLowerCase()))});var S0=g((P5,T0)=>{"use strict";var $e=De(),ql=Bm(),jI=d0(),_0=h0(),b0=Hm(),v0=y0(),FI=Gm(),$I=Fn(),rn=Je(),Oe={tlds:v0 instanceof Set?{tlds:{allow:v0,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:_0.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"]};T0.exports=$I.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=Oe.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(rn.isResolvable(c)&&(c=c.resolve(t,n,r),!rn.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 rn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},$e(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),$e(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Oe.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return $e(["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 rn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},$e(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Oe.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Oe.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&rn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Oe.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return ql.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){rn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),$e(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Oe.addressOptions(t),n=new RegExp(`\\s*[${t.separator?b0(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)jI.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){rn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);$e(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];$e(typeof a=="string","version at position "+o+" must be a string");let u=Oe.guidVersions[a.toLowerCase()];$e(u,"version at position "+o+" must be one of "+Object.keys(Oe.guidVersions).join(", ")),$e(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}$e(Oe.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||Oe.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return rn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},$e(typeof t.byteAligned=="boolean","byteAligned must be boolean"),$e(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"?Oe.hexRegex.withOptionalPrefix:n.prefix===!0?Oe.hexRegex.withPrefix:Oe.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 ql.isValid(t,{minDomainSegments:1})||Oe.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){rn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=_0.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 Oe.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Oe.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Oe.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 rn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:rn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Oe.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Oe.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return $e(Oe.normalizationForms.includes(t),"normalization form must be one of "+Oe.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={}){$e(t instanceof RegExp,"regex must be a RegExp"),$e(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),rn.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(b0(t),"g")),$e(t instanceof RegExp,"pattern must be a RegExp"),$e(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 $e(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 $e(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){rn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&rn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=FI.regex(t),r=t.domain?Oe.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)&&!ql.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"}});Oe.addressOptions=function(t){if(!t)return Oe.tlds||t;if($e(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),$e(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 $e(Oe.tlds,"Built-in TLD list disabled"),Object.assign({},t,Oe.tlds);$e(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)}})),$e(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),$e(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Oe.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?($e(Oe.tlds,"Built-in TLD list disabled"),Object.assign({},t,Oe.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),$e(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Oe.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Oe.validateTlds=function(t,e){for(let n of t)$e(ql.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Oe.isoDate=function(t){if(!rn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Oe.length=function(t,e,n,r,i){return $e(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var x0=g((I5,k0)=>{"use strict";var Nl=De(),BI=Fn(),Vm={};Vm.Map=class extends Map{slice(){return new Vm.Map(this)}};k0.exports=BI.extend({type:"symbol",terms:{map:{init:new Vm.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)),Nl(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){Nl(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;Nl(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),Nl(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 A0=g((L5,E0)=>{"use strict";var UI=De(),HI=Fn(),w0=Je();E0.exports=HI.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 UI(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 w0.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:w0.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 _l=g((q5,D0)=>{"use strict";var es=De(),WI=en(),GI=Tm(),Zi=Je(),VI=Xi(),zm=Ir(),KI=Sm(),O0=wm(),Km=Mr(),C0=gi(),R0=Am(),jl,Ot={types:{alternatives:Mw(),any:Fn(),array:qw(),boolean:Bw(),date:Gw(),function:i0(),link:o0(),number:u0(),object:l0(),string:S0(),symbol:x0()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Ot.types.binary=A0());Ot.root=function(){let t={_types:new Set(Object.keys(Ot.types))};for(let e of t._types)t[e]=function(...n){return es(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Ot.generate(this,Ot.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,Ot.methods);for(let e in Ot.aliases){let n=Ot.aliases[e];t[e]=t[n]}return t.x=t.expression,R0.setup&&R0.setup(t),t};Ot.methods={ValidationError:zm.ValidationError,version:Zi.version,cache:GI.provider,assert(t,e,...n){Ot.assert(t,e,!0,n)},attempt(t,e,...n){return Ot.assert(t,e,!1,n)},build(t){return es(typeof O0.build=="function","Manifest functionality disabled"),O0.build(this,t)},checkPreferences(t){Zi.checkPreferences(t)},compile(t,e){return VI.compile(this,t,e)},defaults(t){es(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());es(Zi.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return Ot.generate(this,r,i)}}return e},expression(...t){return new C0(...t)},extend(...t){Zi.verifyFlat(t,"extend"),jl=jl||vl(),es(t.length,"You need to provide at least one extension"),this.assert(t,jl.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,jl.extension);let r=Ot.expandExtension(n,e);for(let i of r){es(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=KI.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Ot.generate(this,o,a)}}}return e},isError:zm.ValidationError.isError,isExpression:C0.isTemplate,isRef:Km.isRef,isSchema:Zi.isSchema,in(...t){return Km.in(...t)},override:Zi.symbols.override,ref(...t){return Km.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Ot.aliases)t[e]=this[e]();return t}};Ot.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,Zi.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 zm.ValidationError||(a=WI(a)),a.message=i?`${i} ${u}`:u,a};Ot.generate=function(t,e,n){return es(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Ot.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};D0.exports=Ot.root()});var P0=g(Te=>{"use strict";var zI=Te&&Te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Te,"__esModule",{value:!0});Te.descriptionContainerSchema=Te.signatureSchema=Te.signatureDefinitionContainerSchema=Te.signatureDefinitionSchema=Te.signatureDefinitionFunctionSchema=Te.signatureDefinitionFunctionSchemaArg=Te.signatureDefinitionFunctionSchemaArgMultiTypes=Te.signatureDefinitionFunctionSchemaArgDefaultNumber=Te.signatureDefinitionFunctionSchemaArgDefaultString=Te.signatureDefinitionTypeSchema=Te.variationsSchema=void 0;var re=zI(_l()),Fl=Hi();Te.variationsSchema=re.default.array().items(re.default.alternatives(re.default.string(),re.default.number()));Te.signatureDefinitionTypeSchema=re.default.alternatives(re.default.string(),re.default.object({type:re.default.string().required(),keyType:re.default.string().optional(),valueType:re.default.string().optional()}));Te.signatureDefinitionFunctionSchemaArgDefaultString=re.default.object({type:re.default.string().valid(Fl.SignatureDefinitionBaseType.String).required(),value:re.default.string().allow("").required()});Te.signatureDefinitionFunctionSchemaArgDefaultNumber=re.default.object({type:re.default.string().valid(Fl.SignatureDefinitionBaseType.Number).required(),value:re.default.number().required()});Te.signatureDefinitionFunctionSchemaArgMultiTypes=re.default.object({label:re.default.string().required(),types:re.default.array().items(Te.signatureDefinitionTypeSchema).required(),opt:re.default.boolean().optional(),default:re.default.alternatives(Te.signatureDefinitionFunctionSchemaArgDefaultString,Te.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Te.signatureDefinitionFunctionSchemaArg=re.default.object({label:re.default.string().required(),type:Te.signatureDefinitionTypeSchema.required(),opt:re.default.boolean().optional(),default:re.default.alternatives(Te.signatureDefinitionFunctionSchemaArgDefaultString,Te.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Te.signatureDefinitionFunctionSchema=re.default.object({type:re.default.string().valid(Fl.SignatureDefinitionBaseType.Function).required(),description:re.default.string().optional(),example:re.default.string().optional(),isProtected:re.default.boolean().optional(),arguments:re.default.array().items(re.default.alternatives(Te.signatureDefinitionFunctionSchemaArg,Te.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:re.default.array().items(Te.signatureDefinitionTypeSchema).required(),variations:Te.variationsSchema.optional(),returnVariations:Te.variationsSchema.optional()});Te.signatureDefinitionSchema=re.default.object({type:Te.signatureDefinitionTypeSchema.invalid(Fl.SignatureDefinitionBaseType.Function).required(),description:re.default.string().optional(),example:re.default.string().optional(),isProtected:re.default.boolean().optional(),variations:Te.variationsSchema.optional()});Te.signatureDefinitionContainerSchema=re.default.object().pattern(re.default.string(),re.default.alternatives(Te.signatureDefinitionFunctionSchema,Te.signatureDefinitionSchema));Te.signatureSchema=re.default.object({type:re.default.string().required(),hidden:re.default.boolean().optional(),extends:re.default.string().optional(),definitions:re.default.object().required()});Te.descriptionContainerSchema=re.default.object({$meta:re.default.object({description:re.default.string().required(),example:re.default.array().items(re.default.string().allow("")).optional()}).optional()}).pattern(re.default.string(),re.default.object({description:re.default.string().required(),example:re.default.array().items(re.default.string().allow("")).optional()}))});var Qm=g(fn=>{"use strict";var ro=fn&&fn.__assign||function(){return ro=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},ro.apply(this,arguments)},XI=fn&&fn.__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},vi=fn&&fn.__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.")},Xm=fn&&fn.__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},YI=fn&&fn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fn,"__esModule",{value:!0});fn.Signature=void 0;var Ym=YI(_l()),Jm=P0(),JI=Hi(),QI=yl(),ZI=pm(),eM=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;Ym.default.assert(e,Jm.signatureDefinitionContainerSchema);var i={};try{for(var s=vi(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=Xm(o.value,2),u=a[0],c=a[1],l=c.type===JI.SignatureDefinitionBaseType.Function?ZI.SignatureDefinitionFunction.parse(c):QI.SignatureDefinition.parse(c);i[u]=l}}catch(d){n={error:d}}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;Ym.default.assert(e,Jm.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=XI(e,["$meta"]);u=c,a=l}var d={};try{for(var p=vi(Object.entries(a)),y=p.next();!y.done;y=p.next()){var _=Xm(y.value,2),E=_[0],L=_[1];d[E]={description:L.description,example:(i=L.example)!==null&&i!==void 0?i:null}}}catch(M){n={error:M}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}return ro({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},d)},t.parse=function(e,n){var r,i;Ym.default.assert(e,Jm.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=vi(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=Xm(u.value,2),l=c[0],d=c[1],p=t.parseDescriptions(d);s.addDescriptions(l,p)}}catch(y){r={error:y}}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=vi(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=vi(o),u=a.next();!u.done;u=a.next()){var c=u.value;s[c]=ro(ro({},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=vi(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=vi(a),c=u.next();!c.done;c=u.next()){var l=c.value;o[l]=this._definitions[l].copy()}}catch(E){e={error:E}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var d={},p=Object.keys(this._descriptions);try{for(var y=vi(p),_=y.next();!_.done;_=y.next()){var l=_.value;d[l]=ro({},d[l])}}catch(E){r={error:E}}finally{try{_&&!_.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}return s._descriptions=d,s._definitions=o,s},t}();fn.Signature=eM});var I0=g(Sr=>{"use strict";var _i=Sr&&Sr.__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},io=Sr&&Sr.__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))},Pa=Sr&&Sr.__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(Sr,"__esModule",{value:!0});Sr.Container=void 0;var Tr=Qm(),bt=Hi(),tM=function(){function t(){this._primitives=new Map([[bt.SignatureDefinitionBaseType.Any,new Tr.Signature({type:bt.SignatureDefinitionBaseType.Any})],[bt.SignatureDefinitionBaseType.General,new Tr.Signature({type:bt.SignatureDefinitionBaseType.General})],[bt.SignatureDefinitionBaseType.String,new Tr.Signature({type:bt.SignatureDefinitionBaseType.String})],[bt.SignatureDefinitionBaseType.Function,new Tr.Signature({type:bt.SignatureDefinitionBaseType.Function})],[bt.SignatureDefinitionBaseType.Number,new Tr.Signature({type:bt.SignatureDefinitionBaseType.Number})],[bt.SignatureDefinitionBaseType.List,new Tr.Signature({type:bt.SignatureDefinitionBaseType.List})],[bt.SignatureDefinitionBaseType.Map,new Tr.Signature({type:bt.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 Tr.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 io(io([],_i(this._primitives.keys()),!1),_i(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==bt.SignatureDefinitionBaseType.Any&&n!==bt.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 io(io([],_i(this.getAllPrimitiveSignatures()),!1),_i(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return io(io([],_i(this.getAllPrimitiveSignatures()),!1),_i(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=Tr.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=Pa(o),u=a.next();!u.done;u=a.next()){var c=u.value,l=Tr.Signature.parseDescriptions(n[c]);s[c]=l}}catch(d){r={error:d}}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=Pa(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(bt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=Pa(o),l=c.next();!l.done;l=c.next()){var d=l.value;if(!this._excludeFromSearch.has(d)){for(var p=d,y=this.getTypeSignature(d),_=null;y!==null&&!a.has(y.getType())&&(a.add(y.getType()),y.isHidden()||(_=y.getDefinition(n,r)),_===null);)p=y.getExtendedType(),y=this.getTypeSignature(p);_!==null&&u.set(p,_)}}}catch(E){i={error:E}}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(bt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(bt.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(bt.SignatureDefinitionBaseType.Any)?s.get(bt.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=Pa(this._primitives),a=o.next();!a.done;a=o.next()){var u=_i(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 d=Pa(this._types),p=d.next();!p.done;p=d.next()){var y=_i(p.value,2),c=y[0],l=y[1];s._types.set(c,l.copy())}}catch(_){r={error:_}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();Sr.Container=tM});var L0=g(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0})});var Un=g(ft=>{"use strict";var nM=ft&&ft.__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]}),q0=ft&&ft.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&nM(e,t,n)};Object.defineProperty(ft,"__esModule",{value:!0});ft.VariationRegistry=ft.Container=ft.Signature=ft.SignatureDefinition=ft.SignatureDefinitionTypeMeta=ft.SignatureDefinitionFunction=ft.SignatureDefinitionFunctionArg=void 0;var rM=fm();Object.defineProperty(ft,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return rM.SignatureDefinitionFunctionArg}});var iM=pm();Object.defineProperty(ft,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return iM.SignatureDefinitionFunction}});var sM=Sa();Object.defineProperty(ft,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return sM.SignatureDefinitionTypeMeta}});var oM=yl();Object.defineProperty(ft,"SignatureDefinition",{enumerable:!0,get:function(){return oM.SignatureDefinition}});var aM=Qm();Object.defineProperty(ft,"Signature",{enumerable:!0,get:function(){return aM.Signature}});var uM=I0();Object.defineProperty(ft,"Container",{enumerable:!0,get:function(){return uM.Container}});var cM=ml();Object.defineProperty(ft,"VariationRegistry",{enumerable:!0,get:function(){return cM.VariationRegistry}});q0(L0(),ft);q0(Hi(),ft)});var Zm=g(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.enrichWithMetaInformation=ts.FunctionBlockTag=void 0;var lM=dm(),N0=Un();function j0(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var Ia;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Example="example"})(Ia=ts.FunctionBlockTag||(ts.FunctionBlockTag={}));function dM(t){let e=[t.description??"",...t.tags.filter(s=>s.tag===Ia.Description).map(j0)].join(`
103
+ [${u}] ${this.details[a].message}`}return o=o+r,o};Ji.safeStringify=function(t,e){return JSON.stringify(t,Ji.serializer(),e)};Ji.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[Ji.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 Fr=g(wt=>{"use strict";var KD=aw(),VD=Ze(),zD=vi();wt.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=wt.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 wt.template(this.value,t,e||this.code,this.state,this.prefs)}};wt.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};wt.template=function(t,e,n,r,i){if(!e)return;if(zD.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(VD.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["*"]};wt.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=wt.path(i);return s||wt.template(null,n.messages,"root",e,n)||r&&wt.template(null,r,"root",e,n)||"value"};wt.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=wt.details(t);if(r)return r;if(n.errors.stack)return new wt.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new wt.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};wt.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}};wt.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof wt.ValidationError}};wt.ValidationError.prototype.isJoi=!0;wt.ValidationError.prototype.name="ValidationError";wt.ValidationError.prototype.annotate=KD.error});var $r=g($n=>{"use strict";var jn=Ie(),XD=rn(),YD=Yi(),Oa=Ze(),wm,Fn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};$n.create=function(t,e={}){jn(typeof t=="string","Invalid reference key:",t),Oa.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({},Fn.defaults,e);delete n.prefix;let r=n.separator,i=Fn.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]=Fn.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 Fn.Ref(n)};$n.in=function(t,e={}){return $n.create(t,{...e,in:!0})};$n.isRef=function(t){return t?!!t[Oa.symbols.ref]:!1};Fn.Ref=class{constructor(t){jn(typeof t=="object","Invalid reference construction"),Oa.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,Fn.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=YD(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 Fn.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||""}`}};Fn.Ref.prototype[Oa.symbols.ref]=!0;$n.build=function(t){return t=Object.assign({},Fn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Fn.Ref(t)};Fn.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"}};Fn.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]};$n.toSibling=0;$n.toParent=1;$n.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?$n.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(Oa.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}$n.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),wm=wm||vi(),wm.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new $n.Manager;return t.refs=XD(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var vi=g((dw,fw)=>{"use strict";var xl=Ie(),JD=rn(),QD=iw(),ZD=sw(),cw=Ze(),uw=Fr(),lw=$r(),Be={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}};fw.exports=dw=Be.Template=class{constructor(t,e){if(xl(typeof t=="string","Template source must be a string"),xl(!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?JD(r):void 0,this._functions=n,this._functions&&(xl(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),xl(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=Be.encode(this.source),e=Be.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(`{${Be.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let d=this._ref(Be.decode(c),{raw:o,wrapped:l});r.push(d),typeof d!="string"&&(n=!0);let p=s.slice(u+a.length);p&&r.push(Be.decode(p))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return Be.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 Be.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[cw.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=Be.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:QD(u);s.push(Be.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=lw.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?{...Be.functions,...this._functions}:Be.functions;var s=new ZD.Parser(t,{reference:i,functions:o,constants:Be.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 Be.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};Be.Template.prototype[cw.symbols.template]=!0;Be.Template.prototype.isImmutable=!0;Be.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>Be.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>Be.closes.slice(0,n.length))};Be.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};Be.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};Be.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};Be.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(lw.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 Be.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 Be.Template.date(t,r);if(t instanceof Map){let l=[];for(let[d,p]of t.entries())l.push(`${d.toString()} -> ${p.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push(Be.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return Be.wrap(c.join(", "),!u&&a.array)};Be.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};Be.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=uw.template(e,o[0],t,n,r)||uw.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 to=g(Ca=>{"use strict";var Qi=Ie(),pw=rn(),wn=vi();Ca.compile=function(t,e){if(typeof t=="string")return Qi(!e,"Cannot set single message string"),new wn(t);if(wn.isTemplate(t))return Qi(!e,"Cannot set single message template"),t;Qi(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?pw(e):{};for(let n in t){let r=t[n];if(n==="root"||wn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new wn(r);continue}Qi(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"||wn.isTemplate(s)){e[i][n]=s;continue}Qi(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new wn(s)}}return e};Ca.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(wn.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};Ca.merge=function(t,e){if(!t)return Ca.compile(e);if(!e)return t;if(typeof e=="string")return new wn(e);if(wn.isTemplate(e))return e;let n=pw(t);for(let r in e){let i=e[r];if(r==="root"||wn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new wn(i);continue}Qi(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"||wn.isTemplate(o)){n[s][r]=o;continue}Qi(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new wn(o)}}return n}});var Ze=g(et=>{"use strict";var wl=Ie(),eI=Tm(),tI=nw(),Em,Am,nI={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)?)?)?)?$/};et.version=tI.version;et.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};et.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")};et.assertOptions=function(t,e,n="Options"){wl(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));wl(r.length===0,`${n} contain unknown keys: ${r}`)};et.checkPreferences=function(t){Am=Am||Sl();let e=Am.preferences.validate(t);if(e.error)throw new eI([e.error.details[0].message])};et.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}};et.default=function(t,e){return t===void 0?e:t};et.isIsoDate=function(t){return nI.isoDate.test(t)};et.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};et.isResolvable=function(t){return t?t[et.symbols.ref]||t[et.symbols.template]:!1};et.isSchema=function(t,e={}){let n=t&&t[et.symbols.any];return n?(wl(e.legacy||n.version===et.version,"Cannot mix different versions of joi schemas"),!0):!1};et.isValues=function(t){return t[et.symbols.values]};et.limit=function(t){return Number.isSafeInteger(t)&&t>=0};et.preferences=function(t,e){Em=Em||to(),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=Em.compile(e.messages,t.messages)),delete n[et.symbols.prefs],n};et.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}};et.validateArg=function(t,e,{assert:n,message:r}){if(et.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};et.verifyFlat=function(t,e){for(let n of t)wl(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Om=g(hw=>{"use strict";var rI=Ie(),iI=rn(),sI=Ze(),no={max:1e3,supported:new Set(["undefined","boolean","number","string"])};hw.provider={provision(t){return new no.Cache(t)}};no.Cache=class{constructor(t={}){sI.assertOptions(t,["max"]),rI(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||no.max,this._map=new Map,this._list=new no.List}get length(){return this._map.size}set(t,e){if(t!==null&&!no.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),iI(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};no.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 Zi=g(Br=>{"use strict";var pt=Ie(),En=Ze(),ro=$r(),Bn={};Br.schema=function(t,e,n={}){En.assertOptions(n,["appendPath","override"]);try{return Bn.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};Bn.schema=function(t,e,n){pt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(pt(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(Bn.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(pt(typeof e=="object","Invalid schema content:",typeof e),En.isResolvable(e))return r(t,e);if(En.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!Bn.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):(pt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};Br.ref=function(t,e){return ro.isRef(t)?t:ro.create(t,e)};Br.compile=function(t,e,n={}){En.assertOptions(n,["legacy"]);let r=e&&e[En.symbols.any];if(r)return pt(n.legacy||r.version===En.version,"Cannot mix different versions of joi schemas:",r.version,En.version),e;if(typeof e!="object"||!n.legacy)return Br.schema(t,e,{appendPath:!0});let i=Bn.walk(e);return i?i.compile(i.root,e):Br.schema(t,e,{appendPath:!0})};Bn.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=Bn.walk(n);if(r)return r}return null}let e=t[En.symbols.any];if(e)return{root:t[e.root],compile:e.compile};pt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=Bn.walk(t[n]);if(r)return r}return null};Bn.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};Br.when=function(t,e,n){if(n===void 0&&(pt(e&&typeof e=="object","Missing options"),n=e,e=ro.create(".")),Array.isArray(n)&&(n={switch:n}),En.assertOptions(n,["is","not","then","otherwise","switch","break"]),En.isSchema(e))return pt(n.is===void 0,'"is" can not be used with a schema condition'),pt(n.not===void 0,'"not" can not be used with a schema condition'),pt(n.switch===void 0,'"switch" can not be used with a schema condition'),Bn.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(pt(ro.isRef(e)||typeof e=="string","Invalid condition:",e),pt(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 pt(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),pt(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!ro.isRef(n.is)&&!En.isSchema(n.is)&&(s=s.required()),Bn.condition(t,{ref:Br.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}pt(Array.isArray(n.switch),'"switch" must be an array'),pt(n.is===void 0,'Cannot combine "switch" with "is"'),pt(n.not===void 0,'Cannot combine "switch" with "not"'),pt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:Br.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;En.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),pt(s.is!==void 0,'Switch statement missing "is"'),pt(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!ro.isRef(s.is)&&!En.isSchema(s.is)&&(a.is=a.is.required()),o){pt(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&&(pt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};Bn.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 Cm=g(mw=>{"use strict";var _i=Ie(),oI=rn(),gw=Ze(),aI=to(),vr={};mw.type=function(t,e){let n=Object.getPrototypeOf(t),r=oI(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=aI.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 d in s.terms){let p=s.terms[d];_i(i.$_terms[d]===void 0,"Invalid term override for",s.type,d),i.$_terms[d]=p.init,a[d]=p}s.terms=a,s.args||(s.args=o.args),s.prepare=vr.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=vr.coerce(s.coerce,o.coerce),s.validate=vr.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let d in s.rules){let p=s.rules[d];_i(typeof p=="object","Invalid rule definition for",s.type,d);let y=p.method;if(y===void 0&&(y=function(){return this.$_addRule(d)}),y&&(_i(!r[d],"Rule conflict in",s.type,d),r[d]=y),_i(!u[d],"Rule conflict in",s.type,d),u[d]=p,p.alias){let _=[].concat(p.alias);for(let E of _)r[E]=p.method}p.args&&(p.argsByName=new Map,p.args=p.args.map(_=>(typeof _=="string"&&(_={name:_}),_i(!p.argsByName.has(_.name),"Duplicated argument name",_.name),gw.isSchema(_.assert)&&(_.assert=_.assert.strict().label(_.name)),p.argsByName.set(_.name,_),_)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let d in s.modifiers){_i(!r[d],"Rule conflict in",s.type,d);let p=s.modifiers[d];_i(typeof p=="function","Invalid modifier definition for",s.type,d);let y=function(_){return this.rule({[d]:_})};r[d]=y,c[d]=p}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let d in s.overrides)_i(n[d],"Cannot override missing",d),s.overrides[d][gw.symbols.parent]=n[d],i.$_super[d]=n[d].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=vr.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=vr.rebuild(s.rebuild,o.rebuild),i};vr.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};vr.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}}};vr.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}};vr.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};vr.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 Dm=g(Pm=>{"use strict";var _r=Ie(),El=rn(),es=Ze(),uI=to(),yw=$r(),cI=vi(),Rm,sn={};Pm.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=sn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=El(t._preferences,{shallow:["messages"]}),delete n.preferences[es.symbols.prefs],n.preferences.messages&&(n.preferences.messages=uI.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]=sn.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]=sn.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;_r(!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(es.isValues(i)){n[r]=i.describe();continue}_r(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(sn.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"){_r(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return sn.validate(t.$_root,n),n};sn.describe=function(t,e={}){if(Array.isArray(t))return t.map(sn.describe);if(t===es.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return El(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[es.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]=sn.describe(i,{assign:r}))}return n};Pm.build=function(t,e){return new sn.Builder(t).parse(e)};sn.Builder=class{constructor(t){this.joi=t}parse(t){sn.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;_r(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){_r(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){_r(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 _r(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;_r(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 El(t);if(e.assign==="regex")return sn.regex(t);if(e.assign==="ref")return yw.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return _r(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[es.symbols.literal]:!0,literal:t.function};if(t.override)return es.symbols.override;if(t.ref)return yw.build(t.ref);if(t.regex)return sn.regex(t.regex);if(t.special)return _r(["deep"].includes(t.special),"Unknown special value",t.special),es.symbols.deepDefault;if(t.value)return El(t.value)}if(t.type)return this.parse(t);if(t.template)return cI.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};sn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};sn.validate=function(t,e){Rm=Rm||Sl(),t.assert(e,Rm.description)}});var Ra=g((h5,bw)=>{"use strict";var Tr=km(),Xt={mismatched:null};bw.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!Xt.isDeepEqual(t,e,n,[])};Xt.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=Xt.getSharedType(t,e,!!n.prototype);switch(s){case Tr.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Tr.promise:return t===e;case Tr.regex:return t.toString()===e.toString();case Xt.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new Xt.SeenEntry(t,e));try{return!!Xt.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};Xt.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?Xt.mismatched:Tr.getInternalProto(t);let r=Tr.getInternalProto(t);return r!==Tr.getInternalProto(e)?Xt.mismatched:r};Xt.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};Xt.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};Xt.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};Xt.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=Xt,{keys:u,getOwnPropertySymbols:c}=Object;if(t===Tr.array)if(r.part){for(let _ of e)for(let E of n)if(s(_,E,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===Tr.set){if(e.size!==n.size)return!1;if(!Xt.isSetSimpleEqual(e,n)){let _=new Set(Set.prototype.values.call(n));for(let E of Set.prototype.values.call(e)){if(_.delete(E))continue;let L=!1;for(let M of _)if(s(E,M,r,i)){_.delete(M),L=!0;break}if(!L)return!1}}}else if(t===Tr.map){if(e.size!==n.size)return!1;for(let[_,E]of Map.prototype.entries.call(e))if(E===void 0&&!Map.prototype.has.call(n,_)||!s(E,Map.prototype.get.call(n,_),r,i))return!1}else if(t===Tr.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),d=o(n);if((e!==l||n!==d)&&!s(l,d,r,i))return!1;let p=u(e);if(!r.part&&p.length!==u(n).length&&!r.skip)return!1;let y=0;for(let _ of p){if(r.skip&&r.skip.includes(_)){n[_]===void 0&&++y;continue}if(!a(n,_)||!s(e[_],n[_],r,i))return!1}if(!r.part&&p.length-y!==u(n).length)return!1;if(r.symbols!==!1){let _=c(e),E=new Set(c(n));for(let L of _){if(!r.skip||!r.skip.includes(L)){if(a(e,L)){if(!a(n,L)||!s(e[L],n[L],r,i))return!1}else if(a(n,L))return!1}E.delete(L)}for(let L of E)if(a(n,L))return!1}return!0};Xt.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var _w=g(vw=>{"use strict";vw.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 Mm=g(Im=>{"use strict";var Tw=Ra(),Sw=_w(),lI=Fr(),Yt={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Im.setup=function(t){let e=function(){return t._tracer=t._tracer||new Yt.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Im.location=function(t){return t.$_setFlag("_tracerLocation",Sw.location(2))};Yt.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 Yt.Store(t),{filename:r,line:i}=t._flags._tracerLocation||Sw.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(Yt.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 d=a[`_${l}s`];if(!d)continue;let p=new Set(d._values),y=new Set(d._refs);for(let{value:_,ref:E}of u[l])p.delete(_),y.delete(E);(p.size||y.size)&&s.push({status:[...p,...[...y].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 d=Yt.labels[u.rule[l]||0];if(d){let p={rule:l,status:d};u.paths.size&&(p.paths=[...u.paths]),s.push(p)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(Yt.message).join(", ")}`})}return e.length?e:null}};Yt.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){Yt.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){Yt.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){Yt.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]|=Yt.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||Tw(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=Yt.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};Yt.message=function(t){return`${t.paths?lI.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};Yt.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)};Yt.sub=function(t,e){for(let n of t)for(let r of e)if(Tw(n.slice(0,r.length),r))return!0;return!1};Yt.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Al=g((_5,ww)=>{"use strict";var Lm=Ie(),kw=rn(),dI=xm(),xw={};ww.exports=xw.merge=function(t,e,n){if(Lm(t&&typeof t=="object","Invalid target value: must be an object"),Lm(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)){Lm(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(kw(e[i],{symbols:n.symbols}));return t}let r=dI.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]=kw(o,{symbols:n.symbols}):xw.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var Ew=g(Ol=>{"use strict";var Ur=Ie(),Nm=Ze(),fI=$r(),Sr={};Ol.Ids=Sr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new Sr.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())Ur(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())Ur(!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)};Ur(Nm.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:Sr.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);Ur(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||!Nm.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);Ur(!r||r.schema===t,"Cannot add different schemas with the same id:",n),Ur(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(Ur(!this._byKey.has(e),"Schema already contains key:",e),Ur(!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);Ur(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)}};Sr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=Ol.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};Ol.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=Sr.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=Sr.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=Sr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};Sr.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=Sr.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&Nm.isSchema(t)||n.ref!==!1&&fI.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=Sr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var Ow=g((k5,Aw)=>{"use strict";Aw.exports=function(){}});var Pw=g((x5,Rw)=>{"use strict";var pI=rn(),Cw=Yi(),hI=Ze(),kr={value:Symbol("value")};Rw.exports=kr.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 kr.State(t,e,this);return n&&r.schemas&&(r.schemas=[kr.schemas(n),...r.schemas]),r}nest(t,e){let n=new kr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[kr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new kr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=pI(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()}};kr.schemas=function(t){return hI.isSchema(t)?{schema:t}:t};kr.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[kr.value]=e}get(t){let e=this.node(t);if(e)return e[kr.value]}node(t){if(this._values)return Cw(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=Cw(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var Iw=g(Da=>{"use strict";var Pa=Ie(),Dw=rn(),io=Ow(),gI=Yi(),Ct=Ze(),Ti=Fr(),mI=Pw(),Se={result:Symbol("result")};Da.entry=function(t,e,n){let r=Ct.defaults;n&&(Pa(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),Pa(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Ct.preferences(Ct.defaults,n));let i=Se.entry(t,e,r);Pa(!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=Ti.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};Da.entryAsync=async function(t,e,n){let r=Ct.defaults;n&&(r=Ct.preferences(Ct.defaults,n));let i=Se.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,d=c.schema.type==="link"?s.links.get(c.schema):null,p=a,y,_,E=l.length?[a]:[],L=l.length?gI(t,l):t;if(l.length){y=l[l.length-1];let M=a;for(let x of l.slice(0,-1))M=M[x],E.unshift(M);_=E[0],p=_[y]}try{let M=(k,v)=>(d||c.schema).$_createError(k,p,v,c.state,r),x=await c.method(p,{schema:c.schema,linked:d,state:c.state,prefs:n,original:L,error:M,errorsArray:Se.errorsArray,warn:(k,v)=>s.warnings.push((d||c.schema).$_createError(k,p,v,c.state,r)),message:(k,v)=>(d||c.schema).$_createError("external",p,v,c.state,r,{messages:k})});if(x===void 0||x===p)continue;if(x instanceof Ti.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(x),r.abortEarly)break;continue}if(Array.isArray(x)&&x[Ct.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...x),r.abortEarly)break;continue}_?(s.tracer.value(c.state,"rule",p,x,"external"),_[y]=x):(s.tracer.value(c.state,"rule",a,x,"external"),a=x)}catch(M){throw r.errors.label&&(M.message+=` (${c.label})`),M}}if(i.value=a,u.length)throw i.error=Ti.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=Ti.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};Se.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()}};Se.entry=function(t,e,n){let{tracer:r,cleanup:i}=Se.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new Se.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new mI([],[],{mainstay:a,schemas:u}),l=Da.validate(t,e,c,n);i&&e.$_root.untrace();let d=Ti.process(l.errors,t,n);return{value:l.value,error:d,mainstay:a}};Se.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(Pa(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:Se.ignore}};Da.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=Se.prefs(e,r)),e._cache&&r.cache){let d=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!d),d)return d}let s=(d,p,y)=>e.$_createError(d,t,p,y||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:Se.errorsArray,warn:(d,p,y)=>n.mainstay.warnings.push(s(d,p,y)),message:(d,p)=>e.$_createError("custom",t,p,n,r,{messages:d})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let d=a.prepare(t,o);if(d){if(n.mainstay.tracer.value(n,"prepare",t,d.value),d.errors)return Se.finalize(d.value,[].concat(d.errors),o);t=d.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let d=a.coerce.method(t,o);if(d){if(n.mainstay.tracer.value(n,"coerced",t,d.value),d.errors)return Se.finalize(d.value,[].concat(d.errors),o);t=d.value}}let u=e._flags.empty;u&&u.$_match(Se.trim(t,e),n.nest(u),Ct.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 Se.finalize(t,null,o);if(c==="required")return Se.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==Ct.symbols.deepDefault)return Se.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return Se.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let d=e._valids.get(t,n,r,e._flags.insensitive);if(d)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,d.value),t=d.value),n.mainstay.tracer.filter(e,n,"valid",d),Se.finalize(t,null,o);if(e._flags.only){let p=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return Se.finalize(t,[p],o);l.push(p)}}if(e._invalids){let d=e._invalids.get(t,n,r,e._flags.insensitive);if(d){n.mainstay.tracer.filter(e,n,"invalid",d);let p=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return Se.finalize(t,[p],o);l.push(p)}}if(a.validate){let d=a.validate(t,o);if(d&&(n.mainstay.tracer.value(n,"base",t,d.value),t=d.value,d.errors)){if(!Array.isArray(d.errors))return l.push(d.errors),Se.finalize(t,l,o);if(d.errors.length)return l.push(...d.errors),Se.finalize(t,l,o)}}return e._rules.length?Se.rules(t,l,o):Se.finalize(t,l,o)};Se.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 d of o._resolve){let p=a.argsByName.get(d),y=c[d].resolve(t,i,s),_=p.normalize?p.normalize(y):y,E=Ct.validateArg(_,null,p);if(E){u=r.$_createError("any.ref",y,{arg:d,ref:c[d],reason:E},i,s);break}c[d]=_}}u=u||a.validate(t,n,c,o);let l=Se.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 Se.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 Se.finalize(t,e,n)};Se.rule=function(t,e){return t instanceof Ti.Report?(Se.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Ct.symbols.errors]?(t.forEach(n=>Se.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};Se.error=function(t,e){return e.message&&t._setTemplate(e.message),t};Se.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=Se.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)Pa(a instanceof Error||a instanceof Ti.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=Se.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:Ti.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};Se.prefs=function(t,e){let n=e===Ct.defaults;return n&&t._preferences[Ct.symbols.prefs]?t._preferences[Ct.symbols.prefs]:(e=Ct.preferences(e,t._preferences),n&&(t._preferences[Ct.symbols.prefs]=e),e)};Se.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?[Dw(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[Ct.symbols.literal]?a.literal:Ct.isResolvable(a)?a.resolve(e,s,o):Dw(a)};Se.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};Se.ignore={active:!1,debug:io,entry:io,filter:io,log:io,resolve:io,value:io};Se.errorsArray=function(){let t=[];return t[Ct.symbols.errors]=!0,t}});var jm=g((C5,Lw)=>{"use strict";var yI=Ie(),Mw=Ra(),qm=Ze(),Hr={};Lw.exports=Hr.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=Hr.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(qm.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 Hr.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(qm.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(Mw(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(Mw(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 Hr.Values(this._values,this._refs);return t._override=this._override,t}concat(t){yI(!t._override,"Cannot concat override set of values");let e=new Hr.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}};Hr.Values.prototype[qm.symbols.values]=!0;Hr.Values.prototype.slice=Hr.Values.prototype.clone;Hr.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 Hw=g((P5,Uw)=>{"use strict";var ne=Ie(),Nw=rn(),qw=Ra(),Fm=Al(),bI=Om(),vt=Ze(),$m=Zi(),vI=Fr(),_I=Cm(),jw=Dm(),TI=to(),Fw=Ew(),$w=$r(),Bw=Mm(),Cl=Iw(),Rl=jm(),Lt={};Lt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new Fw.Ids,this._preferences=null,this._refs=new $w.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 ne(typeof jw.describe=="function","Manifest functionality disabled"),jw.describe(this)}allow(...t){return vt.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){ne(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),ne(!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];ne(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 ne(t!==void 0,"Artifact cannot be undefined"),ne(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return ne(t===!1||typeof t=="string","Invalid to value"),ne(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 ne(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 ne(t,"Missing error"),ne(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return ne(t!==void 0,"Missing example"),vt.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(ne(!e,"Cannot combine options with description"),e=t.description,t=t.method),ne(typeof t=="function","Method must be a function"),ne(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?(ne(typeof t=="string","id must be a non-empty string"),ne(/^[^\.]+$/.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 ne(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return ne(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){ne(t.length,"Missing notes");for(let e of t)ne(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return ne(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){ne(t,"Missing preferences"),ne(t.context===void 0,"Cannot override context"),ne(t.externals===void 0,"Cannot override externals"),ne(t.warnings===void 0,"Cannot override warnings"),ne(t.debug===void 0,"Cannot override debug"),vt.checkPreferences(t);let e=this.clone();return e._preferences=vt.preferences(e._preferences,t),e}presence(t){return ne(["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 ne(["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=vt.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){ne(t.length,"Missing tags");for(let e of t)ne(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return ne(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){vt.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=$m.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)ne(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),ne(!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){ne(!this._inRuleset(),"Cannot set caching inside a ruleset"),ne(!this._cache,"Cannot override schema cache"),ne(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||bI.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){ne(vt.isSchema(t),"Invalid schema object"),ne(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),ne(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),ne(!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,$w.toSibling),e._preferences=e._preferences?vt.preferences(e._preferences,t._preferences):t._preferences,e._valids=Rl.merge(e._valids,t._valids,t._invalids),e._invalids=Rl.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,Fm(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,Fm(e._flags,n)}else Fm(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 ne(!t.base,"Cannot extend type with another base"),_I.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){ne(!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;vt.assertOptions(t,Object.keys(e.modifiers)),ne(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;ne(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=Nw(s);for(let a in t)e.modifiers[a](o,t[a]),ne(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(){ne(!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),ne(!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),ne(vt.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 Bw.location?Bw.location(this):this}validate(t,e){return Cl.entry(t,this,e)}validateAsync(t,e){return Cl.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),ne(t&&typeof t=="object","Invalid options"),ne(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)ne(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;ne(n,"Unknown rule",e.method);let i=this.clone();if(r){ne(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&&vt.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=vt.validateArg(o,s,a);ne(!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 $m.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?TI.merge(this._definition.messages,s.messages):this._definition.messages;return new vI.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=!Cl.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return vt.assertOptions(t,["each","once","ref","schema"]),Fw.schema(this,t)||this}$_mutateRebuild(){ne(!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={}){ne(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(qw(e,r.default)&&(e=void 0),qw(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][vt.symbols.parent].call(this,...e)}$_validate(t,e,n){return Cl.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=Nw(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 vt.assertOptions(n,"literal"),ne(e!==void 0,"Missing",t,"value"),ne(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[vt.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,d=i.length;for(let p=0;p<l.length;++p){let{is:y,then:_,otherwise:E}=l[p],L=`${a}${u.switch?"."+p:""}`;if(y.$_match(c,e.nest(y,`${L}.is`),n)){if(_){let M=e.localize([...e.path,`${L}.then`],e.ancestors,e.schemas),{schema:x,id:k}=_._generate(t,M,n);r.push(x),i.push(`${L}.then${k?`(${k})`:""}`);break}}else if(E){let M=e.localize([...e.path,`${L}.otherwise`],e.ancestors,e.schemas),{schema:x,id:k}=E._generate(t,M,n);r.push(x),i.push(`${L}.otherwise${k?`(${k})`:""}`);break}}if(u.break&&i.length>d)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={}){ne(!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){vt.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===vt.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new Rl:r&&(n[e]=t.length?new Rl:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){ne(i!==void 0,"Cannot call allow/valid/invalid with undefined"),ne(i!==vt.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(ne(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}};Lt.Base.prototype[vt.symbols.any]={version:vt.version,compile:$m.compile,root:"$_root"};Lt.Base.prototype.isImmutable=!0;Lt.Base.prototype.deny=Lt.Base.prototype.invalid;Lt.Base.prototype.disallow=Lt.Base.prototype.invalid;Lt.Base.prototype.equal=Lt.Base.prototype.valid;Lt.Base.prototype.exist=Lt.Base.prototype.required;Lt.Base.prototype.not=Lt.Base.prototype.invalid;Lt.Base.prototype.options=Lt.Base.prototype.prefs;Lt.Base.prototype.preferences=Lt.Base.prototype.prefs;Uw.exports=new Lt.Base});var Un=g((I5,Ww)=>{"use strict";var Pl=Ie(),SI=Hw(),kI=Ze(),xI=to();Ww.exports=SI.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 Pl(typeof t=="function","Method must be a function"),Pl(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){Pl(kI.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 Pl(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=xI.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 Vw=g((M5,Kw)=>{"use strict";var ts=Ie(),wI=Al(),EI=Un(),Gw=Ze(),AI=Zi(),Dl=Fr(),OI=$r(),so={};Kw.exports=EI.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:OI.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 d=n.$_terms.matches[l],p=i.nest(d.schema,`match.${l}`);p.snapshot();let y=d.schema.$_validate(t,p,s);y.errors?(u.push(y.errors),p.restore()):(a.push(y.value),p.commit())}if(a.length===0){let l={details:u.map(d=>Dl.details(d,{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(d=>Dl.details(d,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(d=>d.schema.type==="object"||d.schema.type==="alternatives"&&c(d.schema));return c(n)?{value:a.reduce((l,d)=>wI(l,d,{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 d=i.nest(u.schema,`match.${a}`);d.snapshot();let p=u.schema.$_validate(t,d,s);if(!p.errors)return d.commit(),p;d.restore(),o.push({schema:u.schema,reports:p.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let d=0;d<l.length;++d){let p=l[d],{is:y,then:_,otherwise:E}=p,L=`match.${a}${u.switch?"."+d:""}`;if(y.$_match(c,i.nest(y,`${L}.is`),s)){if(_)return _.$_validate(t,i.nest(_,`${L}.then`),s)}else if(E)return E.$_validate(t,i.nest(E,`${L}.otherwise`),s)}}return so.errors(o,e)},rules:{conditional:{method(t,e){ts(!this._flags._endedSwitch,"Unreachable condition"),ts(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),ts(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=AI.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(ts(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)ts(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){ts(t.length,"Missing alternative schemas"),Gw.verifyFlat(t,"try"),ts(!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=>{Gw.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}}"}});so.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 so.unmatched(t,e);let a=s[0];if(!(a instanceof Dl.Report))return so.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}:so.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};so.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",Dl.details(n,{override:!1}))}}});var Xw=g((L5,zw)=>{"use strict";var Ia=Ie(),CI=Ra(),RI=Yi(),PI=Un(),Hn=Ze(),DI=Zi(),at={};zw.exports=PI.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 at.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[Hn.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){Hn.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=Hn.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[Hn.symbols.arraySingle];delete t[Hn.symbols.arraySingle];let l=s(),d=t.length;for(let p=0;p<d;++p){let y=t[p],_=!1,E=!1,L=c?p:new Number(p),M=[...r.path,L];if(!e._flags.sparse&&y===void 0){if(l.push(n("array.sparse",{key:L,path:M,pos:p,value:void 0},r.localize(M))),i.abortEarly)return l;a.shift();continue}let x=[t,...r.ancestors];for(let C of e.$_terms._exclusions)if(C.$_match(y,r.localize(M,x,C),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:p,value:y},r.localize(M))),i.abortEarly)return l;_=!0,a.shift();break}if(_)continue;if(e.$_terms.ordered.length){if(a.length){let C=a.shift(),V=C.$_validate(y,r.localize(M,x,C),i);if(V.errors){if(l.push(...V.errors),i.abortEarly)return l}else if(C._flags.result==="strip")at.fastSplice(t,p),--p,--d;else if(!e._flags.sparse&&V.value===void 0){if(l.push(n("array.sparse",{key:L,path:M,pos:p,value:void 0},r.localize(M))),i.abortEarly)return l;continue}else t[p]=V.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:p,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let k=[],v=o.length;for(let C=0;C<v;++C){let V=r.localize(M,x,o[C]);V.snapshot();let ce=o[C].$_validate(y,V,i);if(k[C]=ce,!ce.errors){if(V.commit(),t[p]=ce.value,E=!0,at.fastSplice(o,C),--C,--v,!e._flags.sparse&&ce.value===void 0&&(l.push(n("array.sparse",{key:L,path:M,pos:p,value:void 0},r.localize(M))),i.abortEarly))return l;break}V.restore()}if(E)continue;let F=i.stripUnknown&&!!i.stripUnknown.arrays||!1;v=u.length;for(let C of u){let V,ce=o.indexOf(C);if(ce!==-1)V=k[ce];else{let ye=r.localize(M,x,C);if(ye.snapshot(),V=C.$_validate(y,ye,i),!V.errors){ye.commit(),C._flags.result==="strip"?(at.fastSplice(t,p),--p,--d):!e._flags.sparse&&V.value===void 0?(l.push(n("array.sparse",{key:L,path:M,pos:p,value:void 0},r.localize(M))),_=!0):t[p]=V.value,E=!0;break}ye.restore()}if(v===1){if(F){at.fastSplice(t,p),--p,--d,E=!0;break}if(l.push(...V.errors),i.abortEarly)return l;_=!0;break}}if(!_&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!E){if(F){at.fastSplice(t,p),--p,--d;continue}if(l.push(n("array.includes",{pos:p,value:y},r.localize(M))),i.abortEarly)return l}}return o.length&&at.fillMissedErrors(e,l,o,t,r,i),a.length&&(at.fillOrderedErrors(e,l,a,t,r,i),l.length||at.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 Hn.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Hn.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){Hn.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=Hn.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});at.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 Ia(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){Hn.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=DI.ref(t.by,{ancestor:0}),Ia(!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}=at.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={}){Ia(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),Hn.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=Hn.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||CI,l=s.ignoreUndefined;for(let d=0;d<t.length;++d){let p=a?RI(t[d],a):t[d],y=o?u.custom:u[typeof p];if(Ia(y,"Failed to find unique map container for type",typeof p),y instanceof Map){let _=y.entries(),E;for(;!(E=_.next()).done;)if(c(E.value[0],p)){let L=e.localize([...e.path,d],[t,...e.ancestors]),M={pos:d,value:t[d],dupePos:E.value[1],dupeValue:t[E.value[1]]};return a&&(M.path=i),n("array.unique",M,L)}y.set(p,d)}else{if((!l||p!==void 0)&&y[p]!==void 0){let _={pos:d,value:t[d],dupePos:y[p],dupeValue:t[y[p]]};a&&(_.path=i);let E=e.localize([...e.path,d],[t,...e.ancestors]);return n("array.unique",_,E)}y[p]=d}}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)at.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)at.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"}});at.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))};at.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&at.fillMissedErrors(t,e,o,r,i,s)};at.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)};at.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};at.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(Ia(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};at.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let d=at.compare(c,l,o,a);if(d!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),d=at.compare(c,l,o,a),d!==null))return d;let p=typeof c;if(p!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(p!=="number"&&p!=="string")throw t.$_createError("array.sort.unsupported",e,{type:p},r,i);return p==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};at.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 e0=g((N5,Zw)=>{"use strict";var Yw=Ie(),II=Un(),Jw=Ze(),Qw=jm(),Bm={};Bm.isBool=function(t){return typeof t=="boolean"};Zw.exports=II.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){Jw.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new Qw;for(let n=0;n<t.length;++n){let r=t[n];Yw(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){Jw.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new Qw;for(let n=0;n<t.length;++n){let r=t[n];Yw(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:Bm.isBool,to(t,e){return t?1:0}},string:{from:Bm.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 i0=g((q5,r0)=>{"use strict";var t0=Ie(),MI=Un(),n0=Ze(),LI=vi(),ir={};ir.isDate=function(t){return t instanceof Date};r0.exports=MI.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:ir.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 n0.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:ir.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return t0(["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 t0(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:ir.isDate,to(t,e){return t.getTime()}},string:{from:ir.isDate,to(t,{prefs:e}){return LI.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"}});ir.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 n0.isIsoDate(t)?ir.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return ir.date(1*t);if(e==="unix")return ir.date(1e3*t);if(typeof n=="string")return null}return ir.date(t)};ir.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var c0=g((j5,u0)=>{"use strict";var Il=Ie(),o0=rn(),a0=Al(),s0=Yi(),Ml={};u0.exports=function(t,e,n={}){if(Il(t&&typeof t=="object","Invalid defaults value: must be an object"),Il(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),Il(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return Ml.applyToDefaultsWithShallow(t,e,n);let r=o0(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return a0(r,e,{nullOverride:i,mergeArrays:!1})};Ml.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;Il(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=s0(t,u);c&&typeof c=="object"?i.set(c,s&&s0(e,u)||c):s&&s.add(u)}let o=o0(t,{},i);if(!s)return o;for(let u of s)Ml.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return a0(o,e,{nullOverride:a,mergeArrays:!1})};Ml.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 f0=g(d0=>{"use strict";var ns=Ie(),l0={};d0.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;ns(!n.includes(i),`Item cannot come before itself: ${i}`),ns(!n.includes("?"),"Item cannot come before unassociated items"),ns(!r.includes(i),`Item cannot come after itself: ${i}`),ns(!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();ns(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(l0.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return ns(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return ns(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,d=0;for(let p=0;p<l;++p)i[r[c][p]]&&++d;if(d===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}};l0.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var Hm=g((B5,g0)=>{"use strict";var NI=c0(),Wn=Ie(),p0=rn(),qI=f0(),jI=Un(),Jt=Ze(),Um=Zi(),FI=Fr(),h0=$r(),Ll=vi(),pe={renameDefaults:{alias:!1,multiple:!1,override:!1}};g0.exports=jI.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=pe.clone(t,i);let s=[];if(e.$_terms.renames&&!pe.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 d=r.localize([...r.path,c],a,u),p=u.schema.$_validate(l,d,i);if(p.errors){if(i.abortEarly)return{value:t,errors:p.errors};p.value!==void 0&&(t[c]=p.value),s.push(...p.errors)}else u.schema._flags.result==="strip"||p.value===void 0&&l!==void 0?delete t[c]:p.value!==void 0&&(t[c]=p.value)}}if(o.size||e._flags._hasPatternMatch){let a=pe.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&&pe.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=pe.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 Jt.verifyFlat(t,"and"),pe.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){Ll.isTemplate(t)||(t=Um.ref(t)),Wn(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=h0.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 Wn(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){Wn(t===void 0||typeof t=="object","Object schema must be a valid object"),Wn(!Jt.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 pe.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new pe.Keys;for(let n in t)Jt.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 Jt.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Jt.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 Jt.verifyFlat(t,"nand"),pe.dependency(this,"nand",null,t)}},or:{method(...t){return Jt.verifyFlat(t,"or"),pe.dependency(this,"or",null,t)}},oxor:{method(...t){return pe.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),Wn(e!==void 0,"Invalid rule"),Jt.assertOptions(n,["fallthrough","matches"]),r&&Wn(!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 h0.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={}){Wn(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),Wn(typeof e=="string"||e instanceof Ll,"Invalid rename to argument"),Wn(e!==t,"Cannot rename key to same name:",t),Jt.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)Wn(i.from!==t,"Cannot rename the same key multiple times");return e instanceof Ll&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:NI(pe.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return Jt.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 pe.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return pe.dependency(this,"without",t,e,n)}},xor:{method(...t){return Jt.verifyFlat(t,"xor"),pe.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=Jt.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new qI.Sorter;for(let n of t.$_terms.keys)Jt.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new pe.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=pe.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}}"}});pe.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return p0(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=p0(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};pe.dependency=function(t,e,n,r,i){Wn(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),Jt.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=Jt.default(i.separator,"."),o=[];for(let u of r)Wn(typeof u=="string",e,"peers must be strings"),o.push(Um.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=Um.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new pe.Dependency(e,n,o,r,i)),a};pe.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=pe.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:pe.keysToLabels(t,o),missing:s,missingWithLabels:pe.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=pe.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:pe.keysToLabels(t,a),peers:u,peersWithLabels:pe.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=pe.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:pe.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=pe.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:pe.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=pe.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=pe.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:pe.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:pe.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=pe.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:pe.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:pe.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=pe.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:pe.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=pe.keysToLabels(t,s),{code:"object.xor",context:a})}};pe.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};pe.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};pe.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,d=c.to;if(d instanceof Ll&&(d=d.render(e,n,r,c.match)),l!==d){if(!o.options.multiple&&s[d]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:d,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,d)&&!o.options.override&&!s[d]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:d,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[d]:e[d]=e[l],s[d]=!0,o.options.alias||delete e[l]}}}return!0};pe.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 d=e[l],p=[...i.path,l];for(let y=0;y<t.$_terms.patterns.length;++y){let _=t.$_terms.patterns[y];if(_.regex){let M=_.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${y}`,M?"pass":"error"),!M)continue}else if(!_.schema.$_match(l,i.nest(_.schema,`pattern.${y}`),s))continue;n.delete(l);let E=i.localize(p,c,{schema:_.rule,key:l}),L=_.rule.$_validate(d,E,s);if(L.errors){if(s.abortEarly)return{value:e,errors:L.errors};r.push(...L.errors)}if(_.matches&&u[y].push(l),e[l]=L.value,!_.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let d=u[l];if(!d)continue;let p=t.$_terms.patterns[l].matches,y=i.localize(i.path,c,p),_=p.$_validate(d,y,s);if(_.errors){let E=FI.details(_.errors,{override:!1});E.matches=d;let L=t.$_createError("object.pattern.match",e,E,i,s);if(s.abortEarly)return{value:e,errors:L};r.push(L)}}}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(!Jt.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)}};pe.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}};pe.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 y0=g((W5,m0)=>{"use strict";var Wm=Ie(),$I=Hm();m0.exports=$I.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return Wm(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 Wm(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 Wm(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 v0=g((G5,b0)=>{"use strict";var Wr=Ie(),BI=Un(),UI=Ze(),HI=Zi(),WI=Fr(),Gr={};b0.exports=BI.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}){Wr(e.$_terms.link,"Uninitialized link schema");let i=Gr.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 Gr.generate(t,e,n,r)},rules:{ref:{method(t){Wr(!this.$_terms.link,"Cannot reinitialize schema"),t=HI.ref(t),Wr(t.type==="value"||t.type==="local","Invalid reference type:",t.type),Wr(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){Wr(this.$_terms.link,"Uninitialized link schema"),Wr(UI.isSchema(t),"Invalid schema object"),Wr(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 Wr(e.link,"Invalid link description missing link"),t.ref(e.link)}}});Gr.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}=Gr.perspective(s,n);Gr.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{Gr.assert(!1,"to non-existing schema",s,t,n,r)}return Gr.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};Gr.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}};Gr.assert=function(t,e,n,r,i,s){t||Wr(!1,`"${WI.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var T0=g((K5,_0)=>{"use strict";var Gm=Ie(),GI=Un(),Km=Ze(),An={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))))}};_0.exports=GI.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(An.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(An.extractSignificantDigits(t)!==An.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!==An.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(!Km.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 Km.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Km.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"?An.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 An.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 Gm(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(An.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 Gm(["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 Gm(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"}});An.extractSignificantDigits=function(t){return t.replace(An.exponentialPartRegex,"").replace(An.dotRegex,"").replace(An.trailingZerosRegex,"").replace(An.leadingSignAndZerosRegex,"")};An.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 k0=g((V5,S0)=>{"use strict";var KI=Hm();S0.exports=KI.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var Vm=g(Nl=>{"use strict";Nl.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"};Nl.code=function(t){return{code:t,error:Nl.codes[t]}}});var zm=g(ql=>{"use strict";var VI=require("url"),sr=Vm(),Si={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:VI.URL||URL};ql.analyze=function(t,e={}){if(!t)return sr.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return sr.code("DOMAIN_TOO_LONG");if(!!Si.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return sr.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(Si.domainControlRx.test(t))return sr.code("DOMAIN_INVALID_CHARS");t=Si.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||Si.minDomainSegments,i=t.split(".");if(i.length<r)return sr.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return sr.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 sr.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return sr.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return sr.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!Si.domainSegmentRx.test(a))return sr.code("DOMAIN_INVALID_CHARS")}else if(!Si.tldSegmentRx.test(a))return sr.code("DOMAIN_INVALID_TLDS_CHARS")}return null};ql.isValid=function(t,e){return!ql.analyze(t,e)};Si.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new Si.URL(`http://${t}`).host}catch{return t}}});var x0=g(Xm=>{"use strict";var zI=require("util"),XI=zm(),xr=Vm(),on={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(zI.TextEncoder||TextEncoder)};Xm.analyze=function(t,e){return on.email(t,e)};Xm.isValid=function(t,e){return!on.email(t,e)};on.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return xr.code("EMPTY_STRING");let n=!on.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return xr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?xr.code("MULTIPLE_AT_CHAR"):xr.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return xr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return xr.code("ADDRESS_TOO_LONG");if(on.encoder.encode(i).length>64)return xr.code("LOCAL_TOO_LONG")}return on.local(i,n)||XI.analyze(s,e)};on.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return xr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!on.atextRx.test(r))return xr.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(on.atextRx.test(i))continue;let s=on.binary(i);if(!on.atomRx.test(s))return xr.code("INVALID_LOCAL_CHARS")}}};on.binary=function(t){return Array.from(on.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};on.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;on.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 Ym=g((J5,w0)=>{"use strict";w0.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Qm=g(Jm=>{"use strict";var jl=Ie(),YI=Ym(),Ht={};Ht.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+")",d="(?:"+c+":){6}"+l,p="::(?:"+c+":){5}"+l,y="(?:"+c+")?::(?:"+c+":){4}"+l,_="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,E="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,L="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,M="(?:(?:"+c+":){0,4}"+c+")?::"+l,x="(?:(?:"+c+":){0,5}"+c+")?::"+c,k="(?:(?:"+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="(?:"+d+"|"+p+"|"+y+"|"+_+"|"+E+"|"+L+"|"+M+"|"+x+"|"+k+")",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+":]*",F="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",C="["+r+s+i+"]{1,255}",V="(?:"+F+"|"+t.ipv4address+"|"+C+")",ce="\\d*",ye="(?:"+v+"@)?"+V+"(?::"+ce+")?",K="(?:"+v+"@)?("+V+")(?::"+ce+")?",A=a+"*",D=a+"+",I="["+r+s+i+"@]+",j="",he="(?:\\/"+A+")*",fe="\\/(?:"+D+he+")?",Dt=D+he,mt=I+he,$e="(?:\\/\\/\\/"+A+he+")";return t.hierPart="(?:(?:\\/\\/"+ye+he+")|"+fe+"|"+Dt+"|"+$e+")",t.hierPartCapture="(?:(?:\\/\\/"+K+he+")|"+fe+"|"+Dt+")",t.relativeRef="(?:(?:\\/\\/"+ye+he+")|"+fe+"|"+mt+"|"+j+")",t.relativeRefCapture="(?:(?:\\/\\/"+K+he+")|"+fe+"|"+mt+"|"+j+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};Ht.rfc3986=Ht.generate();Jm.ip={v4Cidr:Ht.rfc3986.ipv4Cidr,v6Cidr:Ht.rfc3986.ipv6Cidr,ipv4:Ht.rfc3986.ipv4address,ipv6:Ht.rfc3986.ipv6address,ipvfuture:Ht.rfc3986.ipvFuture};Ht.createRegex=function(t){let e=Ht.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Ht.wrap(i+r);let s="";if(t.scheme){jl(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);jl(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let d=0;d<c.length;++d){let p=c[d];jl(p instanceof RegExp||typeof p=="string","scheme at position "+d+" must be a RegExp or String"),p instanceof RegExp?l.push(p.source.toString()):(jl(e.schemeRegex.test(p),"scheme at position "+d+" must be a valid scheme"),l.push(YI(p)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return Ht.wrap(u+r,s)};Ht.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Ht.uriRegex=Ht.createRegex({});Jm.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Ht.createRegex(t):Ht.uriRegex}});var A0=g(E0=>{"use strict";var oo=Ie(),Ma=Qm();E0.regex=function(t={}){oo(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";oo(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),oo(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]),oo(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)oo(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),oo(["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 Ma.ip[o];let a=`\\/${o==="ipv4"?Ma.ip.v4Cidr:Ma.ip.v6Cidr}`;return e==="required"?`${Ma.ip[o]}${a}`:`${Ma.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var R0=g((eU,C0)=>{"use strict";var O0={};O0.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"];C0.exports=new Set(O0.tlds.map(t=>t.toLowerCase()))});var L0=g((tU,M0)=>{"use strict";var Ue=Ie(),Fl=zm(),JI=x0(),I0=A0(),P0=Ym(),D0=R0(),QI=Qm(),ZI=Un(),an=Ze(),Re={tlds:D0 instanceof Set?{tlds:{allow:D0,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:I0.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"]};M0.exports=ZI.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=Re.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(an.isResolvable(c)&&(c=c.resolve(t,n,r),!an.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 an.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Ue(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Ue(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Re.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Ue(["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 an.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Ue(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Re.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Re.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&an.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Re.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return Fl.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){an.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Ue(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Re.addressOptions(t),n=new RegExp(`\\s*[${t.separator?P0(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)JI.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){an.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Ue(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];Ue(typeof a=="string","version at position "+o+" must be a string");let u=Re.guidVersions[a.toLowerCase()];Ue(u,"version at position "+o+" must be one of "+Object.keys(Re.guidVersions).join(", ")),Ue(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Ue(Re.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||Re.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return an.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Ue(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Ue(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"?Re.hexRegex.withOptionalPrefix:n.prefix===!0?Re.hexRegex.withPrefix:Re.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 Fl.isValid(t,{minDomainSegments:1})||Re.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){an.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=I0.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 Re.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Re.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Re.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 an.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:an.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Re.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Re.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Ue(Re.normalizationForms.includes(t),"normalization form must be one of "+Re.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={}){Ue(t instanceof RegExp,"regex must be a RegExp"),Ue(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),an.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(P0(t),"g")),Ue(t instanceof RegExp,"pattern must be a RegExp"),Ue(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 Ue(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 Ue(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){an.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&an.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=QI.regex(t),r=t.domain?Re.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)&&!Fl.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"}});Re.addressOptions=function(t){if(!t)return Re.tlds||t;if(Ue(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Ue(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 Ue(Re.tlds,"Built-in TLD list disabled"),Object.assign({},t,Re.tlds);Ue(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)}})),Ue(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Ue(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Re.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Ue(Re.tlds,"Built-in TLD list disabled"),Object.assign({},t,Re.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Ue(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Re.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Re.validateTlds=function(t,e){for(let n of t)Ue(Fl.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Re.isoDate=function(t){if(!an.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Re.length=function(t,e,n,r,i){return Ue(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var q0=g((nU,N0)=>{"use strict";var $l=Ie(),eM=Un(),Zm={};Zm.Map=class extends Map{slice(){return new Zm.Map(this)}};N0.exports=eM.extend({type:"symbol",terms:{map:{init:new Zm.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)),$l(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){$l(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;$l(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),$l(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 $0=g((iU,F0)=>{"use strict";var tM=Ie(),nM=Un(),j0=Ze();F0.exports=nM.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 tM(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 j0.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:j0.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 kl=g((sU,W0)=>{"use strict";var is=Ie(),rM=rn(),iM=Om(),rs=Ze(),sM=Zi(),ty=Fr(),oM=Cm(),B0=Dm(),ey=$r(),U0=vi(),H0=Mm(),Bl,Rt={types:{alternatives:Vw(),any:Un(),array:Xw(),boolean:e0(),date:i0(),function:y0(),link:v0(),number:T0(),object:k0(),string:L0(),symbol:q0()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Rt.types.binary=$0());Rt.root=function(){let t={_types:new Set(Object.keys(Rt.types))};for(let e of t._types)t[e]=function(...n){return is(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Rt.generate(this,Rt.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,Rt.methods);for(let e in Rt.aliases){let n=Rt.aliases[e];t[e]=t[n]}return t.x=t.expression,H0.setup&&H0.setup(t),t};Rt.methods={ValidationError:ty.ValidationError,version:rs.version,cache:iM.provider,assert(t,e,...n){Rt.assert(t,e,!0,n)},attempt(t,e,...n){return Rt.assert(t,e,!1,n)},build(t){return is(typeof B0.build=="function","Manifest functionality disabled"),B0.build(this,t)},checkPreferences(t){rs.checkPreferences(t)},compile(t,e){return sM.compile(this,t,e)},defaults(t){is(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());is(rs.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return Rt.generate(this,r,i)}}return e},expression(...t){return new U0(...t)},extend(...t){rs.verifyFlat(t,"extend"),Bl=Bl||Sl(),is(t.length,"You need to provide at least one extension"),this.assert(t,Bl.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,Bl.extension);let r=Rt.expandExtension(n,e);for(let i of r){is(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=oM.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Rt.generate(this,o,a)}}}return e},isError:ty.ValidationError.isError,isExpression:U0.isTemplate,isRef:ey.isRef,isSchema:rs.isSchema,in(...t){return ey.in(...t)},override:rs.symbols.override,ref(...t){return ey.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Rt.aliases)t[e]=this[e]();return t}};Rt.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,rs.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 ty.ValidationError||(a=rM(a)),a.message=i?`${i} ${u}`:u,a};Rt.generate=function(t,e,n){return is(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Rt.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};W0.exports=Rt.root()});var G0=g(ke=>{"use strict";var aM=ke&&ke.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ke,"__esModule",{value:!0});ke.descriptionContainerSchema=ke.signatureSchema=ke.signatureDefinitionContainerSchema=ke.signatureDefinitionSchema=ke.signatureDefinitionFunctionSchema=ke.signatureDefinitionFunctionSchemaArg=ke.signatureDefinitionFunctionSchemaArgMultiTypes=ke.signatureDefinitionFunctionSchemaArgDefaultNumber=ke.signatureDefinitionFunctionSchemaArgDefaultString=ke.signatureDefinitionTypeSchema=ke.variationsSchema=void 0;var oe=aM(kl()),Ul=Vi();ke.variationsSchema=oe.default.array().items(oe.default.alternatives(oe.default.string(),oe.default.number()));ke.signatureDefinitionTypeSchema=oe.default.alternatives(oe.default.string(),oe.default.object({type:oe.default.string().required(),keyType:oe.default.string().optional(),valueType:oe.default.string().optional()}));ke.signatureDefinitionFunctionSchemaArgDefaultString=oe.default.object({type:oe.default.string().valid(Ul.SignatureDefinitionBaseType.String).required(),value:oe.default.string().allow("").required()});ke.signatureDefinitionFunctionSchemaArgDefaultNumber=oe.default.object({type:oe.default.string().valid(Ul.SignatureDefinitionBaseType.Number).required(),value:oe.default.number().required()});ke.signatureDefinitionFunctionSchemaArgMultiTypes=oe.default.object({label:oe.default.string().required(),types:oe.default.array().items(ke.signatureDefinitionTypeSchema).required(),opt:oe.default.boolean().optional(),default:oe.default.alternatives(ke.signatureDefinitionFunctionSchemaArgDefaultString,ke.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});ke.signatureDefinitionFunctionSchemaArg=oe.default.object({label:oe.default.string().required(),type:ke.signatureDefinitionTypeSchema.required(),opt:oe.default.boolean().optional(),default:oe.default.alternatives(ke.signatureDefinitionFunctionSchemaArgDefaultString,ke.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});ke.signatureDefinitionFunctionSchema=oe.default.object({type:oe.default.string().valid(Ul.SignatureDefinitionBaseType.Function).required(),description:oe.default.string().optional(),example:oe.default.string().optional(),isProtected:oe.default.boolean().optional(),arguments:oe.default.array().items(oe.default.alternatives(ke.signatureDefinitionFunctionSchemaArg,ke.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:oe.default.array().items(ke.signatureDefinitionTypeSchema).required(),variations:ke.variationsSchema.optional(),returnVariations:ke.variationsSchema.optional()});ke.signatureDefinitionSchema=oe.default.object({type:ke.signatureDefinitionTypeSchema.invalid(Ul.SignatureDefinitionBaseType.Function).required(),description:oe.default.string().optional(),example:oe.default.string().optional(),isProtected:oe.default.boolean().optional(),variations:ke.variationsSchema.optional()});ke.signatureDefinitionContainerSchema=oe.default.object().pattern(oe.default.string(),oe.default.alternatives(ke.signatureDefinitionFunctionSchema,ke.signatureDefinitionSchema));ke.signatureSchema=oe.default.object({type:oe.default.string().required(),hidden:oe.default.boolean().optional(),extends:oe.default.string().optional(),definitions:oe.default.object().required()});ke.descriptionContainerSchema=oe.default.object({$meta:oe.default.object({description:oe.default.string().required(),example:oe.default.array().items(oe.default.string().allow("")).optional()}).optional()}).pattern(oe.default.string(),oe.default.object({description:oe.default.string().required(),example:oe.default.array().items(oe.default.string().allow("")).optional()}))});var sy=g(gn=>{"use strict";var ao=gn&&gn.__assign||function(){return ao=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},ao.apply(this,arguments)},uM=gn&&gn.__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},ki=gn&&gn.__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.")},ny=gn&&gn.__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},cM=gn&&gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gn,"__esModule",{value:!0});gn.Signature=void 0;var ry=cM(kl()),iy=G0(),lM=Vi(),dM=_l(),fM=_m(),pM=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;ry.default.assert(e,iy.signatureDefinitionContainerSchema);var i={};try{for(var s=ki(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=ny(o.value,2),u=a[0],c=a[1],l=c.type===lM.SignatureDefinitionBaseType.Function?fM.SignatureDefinitionFunction.parse(c):dM.SignatureDefinition.parse(c);i[u]=l}}catch(d){n={error:d}}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;ry.default.assert(e,iy.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=uM(e,["$meta"]);u=c,a=l}var d={};try{for(var p=ki(Object.entries(a)),y=p.next();!y.done;y=p.next()){var _=ny(y.value,2),E=_[0],L=_[1];d[E]={description:L.description,example:(i=L.example)!==null&&i!==void 0?i:null}}}catch(M){n={error:M}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}return ao({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},d)},t.parse=function(e,n){var r,i;ry.default.assert(e,iy.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=ki(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=ny(u.value,2),l=c[0],d=c[1],p=t.parseDescriptions(d);s.addDescriptions(l,p)}}catch(y){r={error:y}}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=ki(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=ki(o),u=a.next();!u.done;u=a.next()){var c=u.value;s[c]=ao(ao({},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=ki(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=ki(a),c=u.next();!c.done;c=u.next()){var l=c.value;o[l]=this._definitions[l].copy()}}catch(E){e={error:E}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var d={},p=Object.keys(this._descriptions);try{for(var y=ki(p),_=y.next();!_.done;_=y.next()){var l=_.value;d[l]=ao({},d[l])}}catch(E){r={error:E}}finally{try{_&&!_.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}return s._descriptions=d,s._definitions=o,s},t}();gn.Signature=pM});var K0=g(Er=>{"use strict";var xi=Er&&Er.__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},uo=Er&&Er.__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))},La=Er&&Er.__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(Er,"__esModule",{value:!0});Er.Container=void 0;var wr=sy(),_t=Vi(),hM=function(){function t(){this._primitives=new Map([[_t.SignatureDefinitionBaseType.Any,new wr.Signature({type:_t.SignatureDefinitionBaseType.Any})],[_t.SignatureDefinitionBaseType.General,new wr.Signature({type:_t.SignatureDefinitionBaseType.General})],[_t.SignatureDefinitionBaseType.String,new wr.Signature({type:_t.SignatureDefinitionBaseType.String})],[_t.SignatureDefinitionBaseType.Function,new wr.Signature({type:_t.SignatureDefinitionBaseType.Function})],[_t.SignatureDefinitionBaseType.Number,new wr.Signature({type:_t.SignatureDefinitionBaseType.Number})],[_t.SignatureDefinitionBaseType.List,new wr.Signature({type:_t.SignatureDefinitionBaseType.List})],[_t.SignatureDefinitionBaseType.Map,new wr.Signature({type:_t.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 wr.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 uo(uo([],xi(this._primitives.keys()),!1),xi(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==_t.SignatureDefinitionBaseType.Any&&n!==_t.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 uo(uo([],xi(this.getAllPrimitiveSignatures()),!1),xi(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return uo(uo([],xi(this.getAllPrimitiveSignatures()),!1),xi(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=wr.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=La(o),u=a.next();!u.done;u=a.next()){var c=u.value,l=wr.Signature.parseDescriptions(n[c]);s[c]=l}}catch(d){r={error:d}}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=La(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(_t.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=La(o),l=c.next();!l.done;l=c.next()){var d=l.value;if(!this._excludeFromSearch.has(d)){for(var p=d,y=this.getTypeSignature(d),_=null;y!==null&&!a.has(y.getType())&&(a.add(y.getType()),y.isHidden()||(_=y.getDefinition(n,r)),_===null);)p=y.getExtendedType(),y=this.getTypeSignature(p);_!==null&&u.set(p,_)}}}catch(E){i={error:E}}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(_t.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(_t.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(_t.SignatureDefinitionBaseType.Any)?s.get(_t.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=La(this._primitives),a=o.next();!a.done;a=o.next()){var u=xi(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 d=La(this._types),p=d.next();!p.done;p=d.next()){var y=xi(p.value,2),c=y[0],l=y[1];s._types.set(c,l.copy())}}catch(_){r={error:_}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();Er.Container=hM});var z0=g(V0=>{"use strict";Object.defineProperty(V0,"__esModule",{value:!0})});var Gn=g(ht=>{"use strict";var gM=ht&&ht.__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]}),X0=ht&&ht.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&gM(e,t,n)};Object.defineProperty(ht,"__esModule",{value:!0});ht.VariationRegistry=ht.Container=ht.Signature=ht.SignatureDefinition=ht.SignatureDefinitionTypeMeta=ht.SignatureDefinitionFunction=ht.SignatureDefinitionFunctionArg=void 0;var mM=vm();Object.defineProperty(ht,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return mM.SignatureDefinitionFunctionArg}});var yM=_m();Object.defineProperty(ht,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return yM.SignatureDefinitionFunction}});var bM=wa();Object.defineProperty(ht,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return bM.SignatureDefinitionTypeMeta}});var vM=_l();Object.defineProperty(ht,"SignatureDefinition",{enumerable:!0,get:function(){return vM.SignatureDefinition}});var _M=sy();Object.defineProperty(ht,"Signature",{enumerable:!0,get:function(){return _M.Signature}});var TM=K0();Object.defineProperty(ht,"Container",{enumerable:!0,get:function(){return TM.Container}});var SM=vl();Object.defineProperty(ht,"VariationRegistry",{enumerable:!0,get:function(){return SM.VariationRegistry}});X0(z0(),ht);X0(Vi(),ht)});var oy=g(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.enrichWithMetaInformation=ss.FunctionBlockTag=void 0;var kM=bm(),Y0=Gn();function J0(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var Na;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Example="example"})(Na=ss.FunctionBlockTag||(ss.FunctionBlockTag={}));function xM(t){let e=[t.description??"",...t.tags.filter(s=>s.tag===Na.Description).map(J0)].join(`
104
104
 
105
- `),n=t.tags.filter(s=>s.tag===Ia.Param).map(s=>({label:s.name,types:s.type.split("|"),opt:s.optional})),r=t.tags.find(s=>s.tag===Ia.Return)??{type:"any"},i=t.tags.filter(s=>s.tag===Ia.Example).map(j0);return{descriptions:e,args:n,returns:r,examples:i}}function fM(t){let e=(0,lM.parse)(`/**
105
+ `),n=t.tags.filter(s=>s.tag===Na.Param).map(s=>({label:s.name,types:s.type.split("|"),opt:s.optional})),r=t.tags.find(s=>s.tag===Na.Return)??{type:"any"},i=t.tags.filter(s=>s.tag===Na.Example).map(J0);return{descriptions:e,args:n,returns:r,examples:i}}function wM(t){let e=(0,kM.parse)(`/**
106
106
  ${t.getDescription()}
107
- */`),[n]=e;if(n.tags.length>0){let{descriptions:r,args:i,returns:s,examples:o}=dM(n);return N0.SignatureDefinitionFunction.parse({type:N0.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let c=a.getLabel(),l=a.getTypes().map(p=>p.toString()),d=a.isOptional();return{types:l,opt:d,...i[u],label:c}}),returns:s.type.split("|"),description:r,example:o})}return t}ts.enrichWithMetaInformation=fM});var ey=g($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.createResolveChain=void 0;var sn=qe();function Ti(t,e,n=null,r=!1){switch(t.type){case sn.ASTType.ParenthesisExpression:{Ti(t.expression,e,n);return}case sn.ASTType.MemberExpression:{let i=t;Ti(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case sn.ASTType.IndexExpression:{let i=t;Ti(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case sn.ASTType.CallStatement:{Ti(t.expression,e,n,!0);return}case sn.ASTType.CallExpression:{Ti(t.base,e,n,!0);return}case sn.ASTType.NegationExpression:case sn.ASTType.BinaryNegatedExpression:case sn.ASTType.UnaryExpression:{let i=t;Ti(i.argument,e,i);return}case sn.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case sn.ASTType.NumericLiteral:case sn.ASTType.StringLiteral:case sn.ASTType.NilLiteral:case sn.ASTType.MapConstructorExpression:case sn.ASTType.ListConstructorExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case sn.ASTType.SliceExpression:Ti(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function pM(t){let e=[];return Ti(t,e),e}$l.createResolveChain=pM});var $0=g(ty=>{function F0(t,e){return t>e?1:-1}ty.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(F0),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},ty.sortNumbers=F0});var iy=g(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.ObjectSet=so.ObjectSetIterator=void 0;var ny=$0(),Bl=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}}};so.ObjectSetIterator=Bl;var ry=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,ny.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 Bl(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,ny.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,ny.hash)(e);return this._map.delete(n)}extend(e){for(let[n,r]of e._map)this._map.set(n,r),this._first??(this._first=n),this._last=n;return this}toJSON(){return Array.from(this._map.values())}clear(){this._map.clear()}};so.ObjectSet=ry});var sy=g(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;Ul.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 ns=g(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.CompletionItemKind=void 0;var hM;(function(t){t.Variable="var",t.Property="var",t.Function="function",t.Literal="literal",t.Constant="constant",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(hM=Ma.CompletionItemKind||(Ma.CompletionItemKind={}))});var oy=g(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.isResolveChainItemWithValue=kr.isResolveChainItemWithIdentifier=kr.isResolveChainItemWithMember=kr.isResolveChainItemWithIndex=void 0;var Si=qe(),gM=t=>t!=null&&t.ref.type===Si.ASTType.IndexExpression;kr.isResolveChainItemWithIndex=gM;var mM=t=>t!=null&&t.ref.type===Si.ASTType.MemberExpression;kr.isResolveChainItemWithMember=mM;var yM=t=>t!=null&&t.ref.type===Si.ASTType.Identifier;kr.isResolveChainItemWithIdentifier=yM;var bM=t=>t!=null&&(t.ref.type===Si.ASTType.NumericLiteral||t.ref.type===Si.ASTType.StringLiteral||t.ref.type===Si.ASTType.NilLiteral||t.ref.type===Si.ASTType.MapConstructorExpression||t.ref.type===Si.ASTType.ListConstructorExpression);kr.isResolveChainItemWithValue=bM});var ay=g(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.isSignatureDefinitionFunction=void 0;var vM=Un(),_M=t=>t.getType().type===vM.SignatureDefinitionBaseType.Function;Hl.isSignatureDefinitionFunction=_M});var B0=g(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.aggregateEntity=void 0;var TM=t=>{let e=[],n=t;for(;n!=null;)e.push(n),n=n.getIsa();return e};Wl.aggregateEntity=TM});var La=g(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.injectIdentifers=void 0;var SM=B0(),kM=(t,e)=>{let n=(0,SM.aggregateEntity)(e);for(let r=0;r<n.length;r++){let i=n[r];for(let[s,o]of i.values)if(s.startsWith("i:")){let a=s.slice(2);if(t.has(a))continue;t.set(a,{kind:o.kind,line:o.line})}}};Gl.injectIdentifers=kM});var Kl=g(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.isEligibleForProperties=void 0;var uy=Un(),xM=t=>t.types.has(uy.SignatureDefinitionBaseType.Map)||t.types.has(uy.SignatureDefinitionBaseType.List)||t.types.has(uy.SignatureDefinitionBaseType.Any);Vl.isEligibleForProperties=xM});var Xl=g(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.lookupProperty=void 0;var wM=Kl(),EM=(t,e)=>{let n=t;for(;(0,wM.isEligibleForProperties)(n);){let r=n.values.get(`i:${e}`);if(r!=null)return r;let i=n.getIsa();if(i==null)break;n=i}return null};zl.lookupProperty=EM});var uo=g(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.Entity=ki.resolveEntity=void 0;var oo=Un(),ao=ns(),AM=ay(),OM=La(),Yl=Kl(),U0=Xl(),H0=iy(),CM=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let i=e.getCallableReturnTypes();return i?new rs({kind:ao.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(...i):new rs({kind:ao.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(oo.SignatureDefinitionBaseType.Any)}return e};ki.resolveEntity=CM;var cy={hasProperty(t,e,n){return!!(0,U0.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,U0.lookupProperty)(t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,ki.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,Yl.isEligibleForProperties)(t))return!1;let i=`i:${n}`,s=t.values.get(i);return s?s.extend(r):t.values.set(i,r.copy({container:e,label:n,context:t})),!0}},ly={hasProperty(t,e,n){if(!(0,Yl.isEligibleForProperties)(t))return!1;for(let r of n.types)if(t.values.has(`t:${r}`))return!0;return!1},resolveProperty(t,e,n,r=!1){if(!(0,Yl.isEligibleForProperties)(t))return new rs({kind:ao.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(oo.SignatureDefinitionBaseType.Any);let i=new rs({kind:ao.CompletionItemKind.Variable,container:e,label:n.label,context:t});for(let s of n.types){let o=t.values.get(`t:${s}`);o&&i.extend(o)}return i.types.size===0&&i.addType(oo.SignatureDefinitionBaseType.Any),(0,ki.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,Yl.isEligibleForProperties)(t))return!1;for(let i of n.types){let s=`t:${i}`,o=t.values.get(s);o?o.extend(r):t.values.set(s,r.copy({container:e,label:i,context:t}))}return!0}},rs=class t{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._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 H0.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}getIsa(){return this._values.get("i:__isa")??null}hasIsa(){return this._values.has("i:__isa")}isAPI(){return this._isAPI}isCallable(){return this._types.has(oo.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,AM.isSignatureDefinitionFunction)(n));return e.length===0?null:e.flatMap(n=>n.getReturns()).map(n=>n.type)}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){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return ly.hasProperty(this,this._container,e);default:return cy.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return ly.resolveProperty(this,this._container,e,n);default:return cy.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return ly.setProperty(this,this._container,e,n);default:return cy.setProperty(this,this._container,e,n)}}extend(e){if(e===this)return this;this._isFromSignature=!1,this._signatureDefinitions.extend(e.signatureDefinitions),this.addType(...e.types);for(let[n,r]of e.values){let i=this.values.get(n);i==null?this.values.set(n,r.copy({container:this._container,context:this})):i.extend(r)}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(oo.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({label:i,kind:s.getType().type===oo.SignatureDefinitionBaseType.Function?ao.CompletionItemKind.Function:ao.CompletionItemKind.Property,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getAllIdentifier(){let e=new Map;for(let n of this._types){let r=this._container.getAllIdentifier(n);for(let i of r)e.set(...i)}return(0,OM.injectIdentifers)(e,this),e}toJSONInternal(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?.toJSONInternal(e),r),{}),n}toJSON(){return this.toJSONInternal()}copy(e={}){let n=new t({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 H0.ObjectSet(Array.from(this._signatureDefinitions,r=>r.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values});return e.deepCopy&&(n._values=new Map(Array.from(this._values,([r,i])=>[r,i.copy({deepCopy:e.deepCopy,container:e.container,line:e.line,context:n,values:i.values})]))),n}};ki.Entity=rs});var py=g(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.Scope=void 0;var Jl=Un(),is=ns(),dy=La(),Ql=uo(),fy=class t{get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return is.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(Jl.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._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new Ql.Entity({kind:is.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(Jl.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;if(this._locals.values.has(`i:${e}`)){let r=this._locals.values.get(`i:${e}`);return(0,Ql.resolveEntity)(this._container,r,n)}else if(this._parent?.locals.values.has(`i:${e}`)){let r=this._parent.locals.values.get(`i:${e}`);return(0,Ql.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,Ql.resolveEntity)(this._container,r,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!")}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}getAllIdentifier(){let e=new Map([["globals",{kind:is.CompletionItemKind.Constant,line:-1}],["locals",{kind:is.CompletionItemKind.Constant,line:-1}],["outer",{kind:is.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(Jl.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,dy.injectIdentifers)(e,this._globals),this._parent&&(0,dy.injectIdentifers)(e,this._parent.locals),(0,dy.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:is.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:is.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(Jl.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({container:e.container??this._container,parent:this._parent.copy({container:e.container,line:-1,deepCopy:!0}),globals:this._globals.copy({container:e.container,line:-1,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};Zl.Scope=fy});var co=g(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.GreybelKeyword=void 0;var RM;(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"})(RM=qa.GreybelKeyword||(qa.GreybelKeyword={}))});var my=g(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});var ss=qe(),DM=co(),hy=class extends ss.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(ss.Keyword),...Object.values(DM.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===ss.CharacterCode.HASH}isMultilineComment(e,n){return ss.CharacterCode.SLASH===e&&ss.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return ss.CharacterCode.ASTERISK===e&&ss.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};gy.default=hy});var yy=g(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.CharacterCode=void 0;var PM;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(PM=Na.CharacterCode||(Na.CharacterCode={}))});var lo=g(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.Operator=void 0;var IM;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(IM=ja.Operator||(ja.Operator={}))});var vy=g(Fa=>{"use strict";var MM=Fa&&Fa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fa,"__esModule",{value:!0});var nr=qe(),LM=MM(my()),W0=yy(),G0=co(),by=lo();function V0(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var ed=class t extends nr.Lexer{constructor(e,n={}){n.validator=n.validator||new LM.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 d=n.codeAt();if(n.validator.isEndOfLine(d))n.validator.isWinNewline(d,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 nr.ASTRange(new nr.ASTPosition(r,s-o+1),new nr.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new nr.Token({type:nr.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(G0.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(G0.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Fa.default=ed;ed.greybelScanHandlers={[nr.CharacterCode.ARROW_LEFT]:function(e){if(nr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(by.Operator.LeftShift,e)},[nr.CharacterCode.ARROW_RIGHT]:function(e){if(nr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return nr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(by.Operator.UnsignedRightShift,e):this.scanPunctuator(by.Operator.RightShift,e)},[W0.CharacterCode.AMPERSAND]:V0,[W0.CharacterCode.VERTICAL_LINE]:V0}});var td=g($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.ASTType=void 0;var qM;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(qM=$a.ASTType||($a.ASTType={}))});var Ty=g(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.ASTChunkAdvanced=void 0;var NM=qe(),_y=class t extends NM.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.ASTChunkAdvanced=_y});var Ay=g(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ASTFeatureFileExpression=Hn.ASTFeatureInjectExpression=Hn.ASTFeatureEnvarExpression=Hn.ASTFeatureIncludeExpression=Hn.ASTFeatureImportExpression=void 0;var Ba=qe(),Ua=td(),Sy=class t extends Ba.ASTBase{constructor(e){super(Ua.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})}};Hn.ASTFeatureImportExpression=Sy;var ky=class t extends Ba.ASTBase{constructor(e){super(Ua.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})}};Hn.ASTFeatureIncludeExpression=ky;var xy=class t extends Ba.ASTBase{constructor(e){super(Ua.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})}};Hn.ASTFeatureEnvarExpression=xy;var wy=class t extends Ba.ASTBase{constructor(e){super(Ua.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})}};Hn.ASTFeatureInjectExpression=wy;var Ey=class t extends Ba.ASTBase{constructor(e){super(Ua.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})}};Hn.ASTFeatureFileExpression=Ey});var Ry=g(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.ASTFeatureInjectExpression=Mt.ASTFeatureIncludeExpression=Mt.ASTFeatureImportExpression=Mt.ASTFeatureFileExpression=Mt.ASTFeatureEnvarExpression=Mt.ASTChunkAdvanced=Mt.ASTType=Mt.ASTProvider=void 0;var Oy=qe(),K0=td(),jM=Ty(),Ha=Ay(),Cy=class extends Oy.ASTProvider{featureImportExpression(e){return new Ha.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Ha.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Ha.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Ha.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new Oy.ASTBase(K0.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new Oy.ASTBase(K0.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Ha.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new jM.ASTChunkAdvanced(e)}};Mt.ASTProvider=Cy;var FM=td();Object.defineProperty(Mt,"ASTType",{enumerable:!0,get:function(){return FM.ASTType}});var $M=Ty();Object.defineProperty(Mt,"ASTChunkAdvanced",{enumerable:!0,get:function(){return $M.ASTChunkAdvanced}});var Wa=Ay();Object.defineProperty(Mt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Wa.ASTFeatureEnvarExpression}});Object.defineProperty(Mt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Wa.ASTFeatureFileExpression}});Object.defineProperty(Mt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Wa.ASTFeatureImportExpression}});Object.defineProperty(Mt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Wa.ASTFeatureIncludeExpression}});Object.defineProperty(Mt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Wa.ASTFeatureInjectExpression}})});var Dy=g(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.SelectorGroups=pt.SelectorGroupType=pt.Selectors=pt.SelectorTypes=void 0;var Be=qe(),rd=co(),Ga=lo(),BM;(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"})(BM=pt.SelectorTypes||(pt.SelectorTypes={}));pt.Selectors=Object.assign(Object.assign({},Be.Selectors),{From:(0,Be.createSelector)({type:Be.TokenType.Identifier,value:"from"}),Envar:(0,Be.createSelector)({type:Be.TokenType.Keyword,value:rd.GreybelKeyword.Envar}),Inject:(0,Be.createSelector)({type:Be.TokenType.Keyword,value:rd.GreybelKeyword.Inject}),Line:(0,Be.createSelector)({type:Be.TokenType.Keyword,value:rd.GreybelKeyword.Line}),File:(0,Be.createSelector)({type:Be.TokenType.Keyword,value:rd.GreybelKeyword.File}),LeftShift:(0,Be.createSelector)({type:Be.TokenType.Punctuator,value:Ga.Operator.LeftShift}),RightShift:(0,Be.createSelector)({type:Be.TokenType.Punctuator,value:Ga.Operator.RightShift}),UnsignedRightShift:(0,Be.createSelector)({type:Be.TokenType.Punctuator,value:Ga.Operator.UnsignedRightShift}),BitwiseOr:(0,Be.createSelector)({type:Be.TokenType.Punctuator,value:Ga.Operator.BitwiseOr}),BitwiseAnd:(0,Be.createSelector)({type:Be.TokenType.Punctuator,value:Ga.Operator.BitwiseAnd}),Escape:(0,Be.createSelector)({type:Be.TokenType.Punctuator,value:Be.Operator.Escape})});var $r;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})($r=pt.SelectorGroupType||(pt.SelectorGroupType={}));pt.SelectorGroups=Object.assign(Object.assign({},Be.SelectorGroups),{[$r.MapSeparator]:(0,Be.createSelectorGroup)($r.MapSeparator,[pt.Selectors.MapSeperator,pt.Selectors.CRBracket]),[$r.ListSeparator]:(0,Be.createSelectorGroup)($r.ListSeparator,[pt.Selectors.MapSeperator,pt.Selectors.SRBracket]),[$r.PathSegmentEnd]:(0,Be.createSelectorGroup)($r.PathSegmentEnd,[pt.Selectors.EndOfLine,pt.Selectors.Comment,pt.Selectors.EndOfFile]),[$r.BitwiseOperators]:(0,Be.createSelectorGroup)($r.BitwiseOperators,[pt.Selectors.LeftShift,pt.Selectors.RightShift,pt.Selectors.UnsignedRightShift])})});var Y0=g(Va=>{"use strict";var UM=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var pn=qe(),HM=ea(),z0=oa(),WM=UM(vy()),GM=Ry(),os=co(),X0=lo(),Ne=Dy(),Py=class extends pn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new WM.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new GM.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(){let e=this,n=0;for(;;){if(Ne.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,isMultiline:e.token.value.indexOf(`
108
- `)!==-1,start:e.token.start,end:e.token.end,range:e.token.range,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(Ne.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}parseMap(e=!1,n=!1){let r=this;if(!Ne.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(),Ne.Selectors.CRBracket(r.token))r.next();else for(;!Ne.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ne.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(Ne.Selectors.MapKeyValueSeperator),r.skipNewlines(),r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:u.key,base:r.currentAssignment.variable,start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:i}),init:null,start:u.start,end:null,range:[u.range[0],null]}),d=r.currentAssignment;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=d,l.init=u.value,l.end=r.previousToken.end,l.range[1]=r.previousToken.range[1],i.assignments.push(l)}else 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(Ne.SelectorGroups.MapSeparator,s.start);if(Ne.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(!Ne.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(),Ne.Selectors.SRBracket(r.token))r.next();else for(;!Ne.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ne.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(r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(pn.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:s.start,end:r.token.end,range:[s.range[0],r.token.range[1]],scope:i}),base:r.currentAssignment.variable,start:null,end:null,range:[null,null],scope:i}),init:null,start:null,end:null,range:[null,null]}),d=r.currentAssignment,p=r.token;r.currentAssignment=d,u.value=r.parseExpr(u),r.currentAssignment=d,l.variable.start=p.start,l.variable.end=r.previousToken.end,l.variable.range=[p.range[0],r.previousToken.range[1]],l.init=u.value,l.start=u.start,l.end=r.previousToken.end,l.range=[u.range[0],r.previousToken.range[1]],i.assignments.push(l)}else 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(Ne.SelectorGroups.ListSeparator,s.start);if(Ne.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===pn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!Ne.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(Ne.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();if(!n.consume(Ne.Selectors.From))return n.raise("expected from keyword",new z0.Range(r.start,new HM.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});n.imports.push(o);let a=n.astProvider.assignmentStatement({variable:i,init:n.astProvider.literal(pn.TokenType.NilLiteral,{value:null,raw:"null",start:i.start,end:i.end,range:i.range,scope:n.currentScope}),start:i.start,end:i.end,range:i.range,scope:n.currentScope});return n.currentScope.assignments.push(a),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(Ne.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:pn.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(;Ne.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:X0.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(;Ne.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:X0.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(;Ne.Selectors.Plus(r.token)||Ne.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(;Ne.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 Ne.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):Ne.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):Ne.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new pn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new pn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):Ne.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new pn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new pn.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(pn.TokenType.Keyword))switch(e.token.value){case os.GreybelKeyword.Include:case os.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.addItemToLines(i),n.body.push(i);return}case os.GreybelKeyword.Import:case os.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.addItemToLines(i),n.body.push(i);return}case os.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.addItemToLines(i),n.body.push(i);return}case os.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.addItemToLines(i),n.body.push(i);return}case os.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new pn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new pn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunkAdvanced({start:n.start,end:null,range:[n.range[0],null]}),i=new pn.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!Ne.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Ne.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,pn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new z0.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.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};Va.default=Py});var Br=g(Ct=>{"use strict";var VM=Ct&&Ct.__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]}),Ka=Ct&&Ct.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&VM(e,t,n)},Iy=Ct&&Ct.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.Parser=Ct.LexerValidator=Ct.Lexer=void 0;var KM=vy();Object.defineProperty(Ct,"Lexer",{enumerable:!0,get:function(){return Iy(KM).default}});var zM=my();Object.defineProperty(Ct,"LexerValidator",{enumerable:!0,get:function(){return Iy(zM).default}});var XM=Y0();Object.defineProperty(Ct,"Parser",{enumerable:!0,get:function(){return Iy(XM).default}});Ka(Ry(),Ct);Ka(yy(),Ct);Ka(co(),Ct);Ka(lo(),Ct);Ka(Dy(),Ct)});var J0=g(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.parseMapDescription=void 0;var YM=dm();function JM(t){return{path:t.name,type:t.type}}function QM(t){let e=t.tags.find(r=>r.tag==="type");if(!e)return null;let n=t.tags.filter(r=>r.tag==="property");return{type:e.name,properties:n.map(JM)}}function ZM(t){let e=(0,YM.parse)(`/**
107
+ */`),[n]=e;if(n.tags.length>0){let{descriptions:r,args:i,returns:s,examples:o}=xM(n);return Y0.SignatureDefinitionFunction.parse({type:Y0.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let c=a.getLabel(),l=a.getTypes().map(p=>p.toString()),d=a.isOptional();return{types:l,opt:d,...i[u],label:c}}),returns:s.type.split("|"),description:r,example:o})}return t}ss.enrichWithMetaInformation=wM});var ay=g(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.createResolveChain=void 0;var un=qe();function wi(t,e,n=null,r=!1){switch(t.type){case un.ASTType.ParenthesisExpression:{wi(t.expression,e,n);return}case un.ASTType.MemberExpression:{let i=t;wi(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case un.ASTType.IndexExpression:{let i=t;wi(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case un.ASTType.CallStatement:{wi(t.expression,e,n,!0);return}case un.ASTType.CallExpression:{wi(t.base,e,n,!0);return}case un.ASTType.NegationExpression:case un.ASTType.BinaryNegatedExpression:case un.ASTType.UnaryExpression:{let i=t;wi(i.argument,e,i);return}case un.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case un.ASTType.NumericLiteral:case un.ASTType.StringLiteral:case un.ASTType.NilLiteral:case un.ASTType.MapConstructorExpression:case un.ASTType.ListConstructorExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case un.ASTType.SliceExpression:wi(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function EM(t){let e=[];return wi(t,e),e}Hl.createResolveChain=EM});var Z0=g(uy=>{function Q0(t,e){return t>e?1:-1}uy.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(Q0),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},uy.sortNumbers=Q0});var dy=g(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.ObjectSet=co.ObjectSetIterator=void 0;var cy=Z0(),Wl=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}}};co.ObjectSetIterator=Wl;var ly=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,cy.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 Wl(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,cy.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,cy.hash)(e);return this._map.delete(n)}extend(e){for(let[n,r]of e._map)this._map.set(n,r),this._first??(this._first=n),this._last=n;return this}toJSON(){return Array.from(this._map.values())}clear(){this._map.clear()}};co.ObjectSet=ly});var fy=g(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;Gl.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 os=g(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.CompletionItemKind=void 0;var AM;(function(t){t.Variable="var",t.Property="var",t.Function="function",t.Literal="literal",t.Constant="constant",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(AM=qa.CompletionItemKind||(qa.CompletionItemKind={}))});var py=g(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.isResolveChainItemWithValue=Ar.isResolveChainItemWithIdentifier=Ar.isResolveChainItemWithMember=Ar.isResolveChainItemWithIndex=void 0;var Ei=qe(),OM=t=>t!=null&&t.ref.type===Ei.ASTType.IndexExpression;Ar.isResolveChainItemWithIndex=OM;var CM=t=>t!=null&&t.ref.type===Ei.ASTType.MemberExpression;Ar.isResolveChainItemWithMember=CM;var RM=t=>t!=null&&t.ref.type===Ei.ASTType.Identifier;Ar.isResolveChainItemWithIdentifier=RM;var PM=t=>t!=null&&(t.ref.type===Ei.ASTType.NumericLiteral||t.ref.type===Ei.ASTType.StringLiteral||t.ref.type===Ei.ASTType.NilLiteral||t.ref.type===Ei.ASTType.MapConstructorExpression||t.ref.type===Ei.ASTType.ListConstructorExpression);Ar.isResolveChainItemWithValue=PM});var hy=g(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.isSignatureDefinitionFunction=void 0;var DM=Gn(),IM=t=>t.getType().type===DM.SignatureDefinitionBaseType.Function;Kl.isSignatureDefinitionFunction=IM});var gy=g(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.aggregateEntity=void 0;var MM=t=>{let e=[],n=t;for(;n!=null;)e.push(n),n=n.getIsa();return e};Vl.aggregateEntity=MM});var ja=g(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.injectIdentifers=void 0;var LM=gy(),NM=(t,e)=>{let n=(0,LM.aggregateEntity)(e);for(let r=0;r<n.length;r++){let i=n[r];for(let[s,o]of i.values)if(s.startsWith("i:")){let a=s.slice(2);if(t.has(a))continue;t.set(a,{kind:o.kind,line:o.line})}}};zl.injectIdentifers=NM});var Yl=g(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.isEligibleForProperties=void 0;var my=Gn(),qM=t=>t.types.has(my.SignatureDefinitionBaseType.Map)||t.types.has(my.SignatureDefinitionBaseType.List)||t.types.has(my.SignatureDefinitionBaseType.Any);Xl.isEligibleForProperties=qM});var Ql=g(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.lookupProperty=void 0;var jM=Yl(),FM=(t,e)=>{let n=t;for(;(0,jM.isEligibleForProperties)(n);){let r=n.values.get(`i:${e}`);if(r!=null)return r;let i=n.getIsa();if(i==null)break;n=i}return null};Jl.lookupProperty=FM});var po=g(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Entity=Ai.resolveEntity=void 0;var lo=Gn(),fo=os(),$M=hy(),BM=ja(),Zl=Yl(),eE=Ql(),tE=dy(),UM=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let i=e.getCallableReturnTypes();return i?new as({kind:fo.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(...i):new as({kind:fo.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(lo.SignatureDefinitionBaseType.Any)}return e};Ai.resolveEntity=UM;var yy={hasProperty(t,e,n){return!!(0,eE.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,eE.lookupProperty)(t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,Ai.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,Zl.isEligibleForProperties)(t))return!1;let i=`i:${n}`,s=t.values.get(i);return s?s.extend(r):t.values.set(i,r.copy({container:e,label:n,context:t,definitions:[]})),!0}},by={hasProperty(t,e,n){if(!(0,Zl.isEligibleForProperties)(t))return!1;for(let r of n.types)if(t.values.has(`t:${r}`))return!0;return!1},resolveProperty(t,e,n,r=!1){if(!(0,Zl.isEligibleForProperties)(t))return new as({kind:fo.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(lo.SignatureDefinitionBaseType.Any);let i=new as({kind:fo.CompletionItemKind.Variable,container:e,label:n.label,context:t});for(let s of n.types){let o=t.values.get(`t:${s}`);o&&i.extend(o)}return i.types.size===0&&i.addType(lo.SignatureDefinitionBaseType.Any),(0,Ai.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,Zl.isEligibleForProperties)(t))return!1;for(let i of n.types){let s=`t:${i}`,o=t.values.get(s);o?o.extend(r):t.values.set(s,r.copy({container:e,label:i,context:t,definitions:[]}))}return!0}},as=class t{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._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 tE.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("i:__isa")??null}hasIsa(){return this._values.has("i:__isa")}isAPI(){return this._isAPI}isCallable(){return this._types.has(lo.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,$M.isSignatureDefinitionFunction)(n));return e.length===0?null:e.flatMap(n=>n.getReturns()).map(n=>n.type)}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){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return by.hasProperty(this,this._container,e);default:return yy.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return by.resolveProperty(this,this._container,e,n);default:return yy.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return by.setProperty(this,this._container,e,n);default:return yy.setProperty(this,this._container,e,n)}}extend(e){if(e===this)return this;this._isFromSignature=!1,this._signatureDefinitions.extend(e.signatureDefinitions),this.addType(...e.types);for(let[n,r]of e.values){let i=this.values.get(n);i==null?this.values.set(n,r.copy({container:this._container,context:this})):i.extend(r)}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(lo.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({label:i,kind:s.getType().type===lo.SignatureDefinitionBaseType.Function?fo.CompletionItemKind.Function:fo.CompletionItemKind.Property,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getAllIdentifier(){let e=new Map;for(let n of this._types){let r=this._container.getAllIdentifier(n);for(let i of r)e.set(...i)}return(0,BM.injectIdentifers)(e,this),e}toJSONInternal(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?.toJSONInternal(e),r),{}),n}toJSON(){return this.toJSONInternal()}copy(e={}){let n=new t({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 tE.ObjectSet(Array.from(this._signatureDefinitions,r=>r.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values,definitions:e.definitions??this._definitions});return e.deepCopy&&(n._values=new Map(Array.from(this._values,([r,i])=>[r,i.copy({deepCopy:e.deepCopy,container:e.container,line:e.line,context:n,values:i.values})])),n._definitions=[...this._definitions]),n}};Ai.Entity=as});var Ty=g(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.Scope=void 0;var ed=Gn(),us=os(),vy=ja(),td=po(),_y=class t{get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return us.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(ed.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._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new td.Entity({kind:us.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(ed.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;if(this._locals.values.has(`i:${e}`)){let r=this._locals.values.get(`i:${e}`);return(0,td.resolveEntity)(this._container,r,n)}else if(this._parent?.locals.values.has(`i:${e}`)){let r=this._parent.locals.values.get(`i:${e}`);return(0,td.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,td.resolveEntity)(this._container,r,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!")}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}getAllIdentifier(){let e=new Map([["globals",{kind:us.CompletionItemKind.Constant,line:-1}],["locals",{kind:us.CompletionItemKind.Constant,line:-1}],["outer",{kind:us.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(ed.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,vy.injectIdentifers)(e,this._globals),this._parent&&(0,vy.injectIdentifers)(e,this._parent.locals),(0,vy.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:us.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:us.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(ed.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({container:e.container??this._container,parent:this._parent.copy({container:e.container,line:-1,deepCopy:!0}),globals:this._globals.copy({container:e.container,line:-1,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};nd.Scope=_y});var ho=g(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.GreybelKeyword=void 0;var HM;(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"})(HM=Fa.GreybelKeyword||(Fa.GreybelKeyword={}))});var xy=g(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});var cs=qe(),WM=ho(),Sy=class extends cs.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(cs.Keyword),...Object.values(WM.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===cs.CharacterCode.HASH}isMultilineComment(e,n){return cs.CharacterCode.SLASH===e&&cs.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return cs.CharacterCode.ASTERISK===e&&cs.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};ky.default=Sy});var wy=g($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.CharacterCode=void 0;var GM;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(GM=$a.CharacterCode||($a.CharacterCode={}))});var go=g(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.Operator=void 0;var KM;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(KM=Ba.Operator||(Ba.Operator={}))});var Ay=g(Ua=>{"use strict";var VM=Ua&&Ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ua,"__esModule",{value:!0});var or=qe(),zM=VM(xy()),nE=wy(),rE=ho(),Ey=go();function iE(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var rd=class t extends or.Lexer{constructor(e,n={}){n.validator=n.validator||new zM.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 d=n.codeAt();if(n.validator.isEndOfLine(d))n.validator.isWinNewline(d,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 or.ASTRange(new or.ASTPosition(r,s-o+1),new or.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new or.Token({type:or.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(rE.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(rE.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Ua.default=rd;rd.greybelScanHandlers={[or.CharacterCode.ARROW_LEFT]:function(e){if(or.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(Ey.Operator.LeftShift,e)},[or.CharacterCode.ARROW_RIGHT]:function(e){if(or.CharacterCode.ARROW_RIGHT===this.codeAt(1))return or.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(Ey.Operator.UnsignedRightShift,e):this.scanPunctuator(Ey.Operator.RightShift,e)},[nE.CharacterCode.AMPERSAND]:iE,[nE.CharacterCode.VERTICAL_LINE]:iE}});var id=g(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.ASTType=void 0;var XM;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(XM=Ha.ASTType||(Ha.ASTType={}))});var Cy=g(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.ASTChunkAdvanced=void 0;var YM=qe(),Oy=class t extends YM.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})}};sd.ASTChunkAdvanced=Oy});var Ly=g(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.ASTFeatureFileExpression=Kn.ASTFeatureInjectExpression=Kn.ASTFeatureEnvarExpression=Kn.ASTFeatureIncludeExpression=Kn.ASTFeatureImportExpression=void 0;var Wa=qe(),Ga=id(),Ry=class t extends Wa.ASTBase{constructor(e){super(Ga.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})}};Kn.ASTFeatureImportExpression=Ry;var Py=class t extends Wa.ASTBase{constructor(e){super(Ga.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})}};Kn.ASTFeatureIncludeExpression=Py;var Dy=class t extends Wa.ASTBase{constructor(e){super(Ga.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})}};Kn.ASTFeatureEnvarExpression=Dy;var Iy=class t extends Wa.ASTBase{constructor(e){super(Ga.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})}};Kn.ASTFeatureInjectExpression=Iy;var My=class t extends Wa.ASTBase{constructor(e){super(Ga.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})}};Kn.ASTFeatureFileExpression=My});var jy=g(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.ASTFeatureInjectExpression=Nt.ASTFeatureIncludeExpression=Nt.ASTFeatureImportExpression=Nt.ASTFeatureFileExpression=Nt.ASTFeatureEnvarExpression=Nt.ASTChunkAdvanced=Nt.ASTType=Nt.ASTProvider=void 0;var Ny=qe(),sE=id(),JM=Cy(),Ka=Ly(),qy=class extends Ny.ASTProvider{featureImportExpression(e){return new Ka.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Ka.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Ka.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Ka.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new Ny.ASTBase(sE.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new Ny.ASTBase(sE.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Ka.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new JM.ASTChunkAdvanced(e)}};Nt.ASTProvider=qy;var QM=id();Object.defineProperty(Nt,"ASTType",{enumerable:!0,get:function(){return QM.ASTType}});var ZM=Cy();Object.defineProperty(Nt,"ASTChunkAdvanced",{enumerable:!0,get:function(){return ZM.ASTChunkAdvanced}});var Va=Ly();Object.defineProperty(Nt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Va.ASTFeatureEnvarExpression}});Object.defineProperty(Nt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Va.ASTFeatureFileExpression}});Object.defineProperty(Nt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Va.ASTFeatureImportExpression}});Object.defineProperty(Nt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Va.ASTFeatureIncludeExpression}});Object.defineProperty(Nt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Va.ASTFeatureInjectExpression}})});var Fy=g(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.SelectorGroups=gt.SelectorGroupType=gt.Selectors=gt.SelectorTypes=void 0;var He=qe(),od=ho(),za=go(),eL;(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"})(eL=gt.SelectorTypes||(gt.SelectorTypes={}));gt.Selectors=Object.assign(Object.assign({},He.Selectors),{From:(0,He.createSelector)({type:He.TokenType.Identifier,value:"from"}),Envar:(0,He.createSelector)({type:He.TokenType.Keyword,value:od.GreybelKeyword.Envar}),Inject:(0,He.createSelector)({type:He.TokenType.Keyword,value:od.GreybelKeyword.Inject}),Line:(0,He.createSelector)({type:He.TokenType.Keyword,value:od.GreybelKeyword.Line}),File:(0,He.createSelector)({type:He.TokenType.Keyword,value:od.GreybelKeyword.File}),LeftShift:(0,He.createSelector)({type:He.TokenType.Punctuator,value:za.Operator.LeftShift}),RightShift:(0,He.createSelector)({type:He.TokenType.Punctuator,value:za.Operator.RightShift}),UnsignedRightShift:(0,He.createSelector)({type:He.TokenType.Punctuator,value:za.Operator.UnsignedRightShift}),BitwiseOr:(0,He.createSelector)({type:He.TokenType.Punctuator,value:za.Operator.BitwiseOr}),BitwiseAnd:(0,He.createSelector)({type:He.TokenType.Punctuator,value:za.Operator.BitwiseAnd}),Escape:(0,He.createSelector)({type:He.TokenType.Punctuator,value:He.Operator.Escape})});var Kr;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(Kr=gt.SelectorGroupType||(gt.SelectorGroupType={}));gt.SelectorGroups=Object.assign(Object.assign({},He.SelectorGroups),{[Kr.MapSeparator]:(0,He.createSelectorGroup)(Kr.MapSeparator,[gt.Selectors.MapSeperator,gt.Selectors.CRBracket]),[Kr.ListSeparator]:(0,He.createSelectorGroup)(Kr.ListSeparator,[gt.Selectors.MapSeperator,gt.Selectors.SRBracket]),[Kr.PathSegmentEnd]:(0,He.createSelectorGroup)(Kr.PathSegmentEnd,[gt.Selectors.EndOfLine,gt.Selectors.Comment,gt.Selectors.EndOfFile]),[Kr.BitwiseOperators]:(0,He.createSelectorGroup)(Kr.BitwiseOperators,[gt.Selectors.LeftShift,gt.Selectors.RightShift,gt.Selectors.UnsignedRightShift])})});var uE=g(Xa=>{"use strict";var tL=Xa&&Xa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xa,"__esModule",{value:!0});var mn=qe(),nL=ra(),oE=ca(),rL=tL(Ay()),iL=jy(),ls=ho(),aE=go(),Fe=Fy(),$y=class extends mn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new rL.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new iL.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(){let e=this,n=0;for(;;){if(Fe.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,isMultiline:e.token.value.indexOf(`
108
+ `)!==-1,start:e.token.start,end:e.token.end,range:e.token.range,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(Fe.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}parseMap(e=!1,n=!1){let r=this;if(!Fe.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(),Fe.Selectors.CRBracket(r.token))r.next();else for(;!Fe.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Fe.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(Fe.Selectors.MapKeyValueSeperator),r.skipNewlines(),r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:u.key,base:r.currentAssignment.variable,start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:i}),init:null,start:u.start,end:null,range:[u.range[0],null]}),d=r.currentAssignment;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=d,l.init=u.value,l.end=r.previousToken.end,l.range[1]=r.previousToken.range[1],i.assignments.push(l)}else 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(Fe.SelectorGroups.MapSeparator,s.start);if(Fe.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(!Fe.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(),Fe.Selectors.SRBracket(r.token))r.next();else for(;!Fe.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Fe.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(r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(mn.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:s.start,end:r.token.end,range:[s.range[0],r.token.range[1]],scope:i}),base:r.currentAssignment.variable,start:null,end:null,range:[null,null],scope:i}),init:null,start:null,end:null,range:[null,null]}),d=r.currentAssignment,p=r.token;r.currentAssignment=d,u.value=r.parseExpr(u),r.currentAssignment=d,l.variable.start=p.start,l.variable.end=r.previousToken.end,l.variable.range=[p.range[0],r.previousToken.range[1]],l.init=u.value,l.start=u.start,l.end=r.previousToken.end,l.range=[u.range[0],r.previousToken.range[1]],i.assignments.push(l)}else 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(Fe.SelectorGroups.ListSeparator,s.start);if(Fe.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===mn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!Fe.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(Fe.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();if(!n.consume(Fe.Selectors.From))return n.raise("expected from keyword",new oE.Range(r.start,new nL.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});n.imports.push(o);let a=n.astProvider.assignmentStatement({variable:i,init:n.astProvider.literal(mn.TokenType.NilLiteral,{value:null,raw:"null",start:i.start,end:i.end,range:i.range,scope:n.currentScope}),start:i.start,end:i.end,range:i.range,scope:n.currentScope});return n.currentScope.assignments.push(a),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(Fe.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:mn.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(;Fe.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:aE.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(;Fe.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:aE.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(;Fe.Selectors.Plus(r.token)||Fe.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(;Fe.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 Fe.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):Fe.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):Fe.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new mn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new mn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):Fe.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new mn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new mn.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(mn.TokenType.Keyword))switch(e.token.value){case ls.GreybelKeyword.Include:case ls.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.addItemToLines(i),n.body.push(i);return}case ls.GreybelKeyword.Import:case ls.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.addItemToLines(i),n.body.push(i);return}case ls.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.addItemToLines(i),n.body.push(i);return}case ls.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.addItemToLines(i),n.body.push(i);return}case ls.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new mn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new mn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunkAdvanced({start:n.start,end:null,range:[n.range[0],null]}),i=new mn.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!Fe.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Fe.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,mn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new oE.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.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};Xa.default=$y});var Or=g(Pt=>{"use strict";var sL=Pt&&Pt.__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]}),Ya=Pt&&Pt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&sL(e,t,n)},By=Pt&&Pt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Parser=Pt.LexerValidator=Pt.Lexer=void 0;var oL=Ay();Object.defineProperty(Pt,"Lexer",{enumerable:!0,get:function(){return By(oL).default}});var aL=xy();Object.defineProperty(Pt,"LexerValidator",{enumerable:!0,get:function(){return By(aL).default}});var uL=uE();Object.defineProperty(Pt,"Parser",{enumerable:!0,get:function(){return By(uL).default}});Ya(jy(),Pt);Ya(wy(),Pt);Ya(ho(),Pt);Ya(go(),Pt);Ya(Fy(),Pt)});var cE=g(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.parseMapDescription=void 0;var cL=bm();function lL(t){return{path:t.name,type:t.type}}function dL(t){let e=t.tags.find(r=>r.tag==="type");if(!e)return null;let n=t.tags.filter(r=>r.tag==="property");return{type:e.name,properties:n.map(lL)}}function fL(t){let e=(0,cL.parse)(`/**
109
109
  ${t}
110
- */`),[n]=e;return n.tags.length>0?QM(n):null}id.parseMapDescription=ZM});var My=g(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.merge=void 0;function eL(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))}sd.merge=eL});var Q0=g(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.mergeUnique=void 0;function tL(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))}od.mergeUnique=tL});var qy=g(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.Aggregator=void 0;var ad=Br(),Pe=Un(),Ee=qe(),nL=sy(),ke=ns(),as=oy(),Z0=zg(),rL=Zm(),eE=ey(),tE=ha(),iL=J0(),sL=uo(),nE=My(),oL=Q0(),Ly=class{get definitions(){return this._definitions}get parent(){return this._parent}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map}factory(e){return new sL.Entity({kind:e,container:this._document.container})}createMapDescription(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Ee.ASTType.Comment);if(n instanceof Ee.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 Ee.ASTComment)i.add(a),s.unshift(a.value);else break}return s.join(`
111
- `)}else if(r instanceof Ee.ASTComment)return r.value;return null}createCustomTypeFromMap(e,n){let r=this.createMapDescription(e);if(r==null)return;let i=(0,iL.parseMapDescription)(r);i!=null&&(i.properties.forEach(s=>{if(s.path==="__isa")return;let o=s.path.split("."),a=this.factory(ke.CompletionItemKind.Property).addType(s.type).setLabel(o[o.length-1]);this.setEntityInPath(n,o,a)}),this._scope.setCustomType(i.type,n))}createFunctionDescription(e,n=nL.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),i=this._document.findASTItemInLine(e.start.line,Ee.ASTType.Comment);if(r instanceof Ee.ASTComment){let s=new Set,o=[],a=e.start.line-1;for(;a>=0;){let u=this._document.getLastASTItemOfLine(a--);if(!s.has(u))if(u instanceof Ee.ASTComment)s.add(u),o.unshift(u.value);else break}return o.join(`
110
+ */`),[n]=e;return n.tags.length>0?dL(n):null}ad.parseMapDescription=fL});var Uy=g(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.merge=void 0;function pL(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=pL});var lE=g(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.mergeUnique=void 0;function hL(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=hL});var Wy=g(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.Aggregator=void 0;var ld=Or(),Me=Gn(),Oe=qe(),gL=fy(),we=os(),ds=py(),dE=tm(),mL=oy(),fE=ay(),pE=ya(),yL=cE(),bL=po(),hE=Uy(),vL=lE(),Hy=class{get definitions(){return this._definitions}get parent(){return this._parent}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 bL.Entity({kind:e,container:this._document.container})}createMapDescription(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Oe.ASTType.Comment);if(n instanceof Oe.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 Oe.ASTComment)i.add(a),s.unshift(a.value);else break}return s.join(`
111
+ `)}else if(r instanceof Oe.ASTComment)return r.value;return null}createCustomTypeFromMap(e,n){let r=this.createMapDescription(e);if(r==null)return;let i=(0,yL.parseMapDescription)(r);i!=null&&(i.properties.forEach(s=>{if(s.path==="__isa")return;let o=s.path.split("."),a=this.factory(we.CompletionItemKind.Property).addType(s.type).setLabel(o[o.length-1]);this.setEntityInPath(n,o,a)}),this._scope.setCustomType(i.type,n))}createFunctionDescription(e,n=gL.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),i=this._document.findASTItemInLine(e.start.line,Oe.ASTType.Comment);if(r instanceof Oe.ASTComment){let s=new Set,o=[],a=e.start.line-1;for(;a>=0;){let u=this._document.getLastASTItemOfLine(a--);if(!s.has(u))if(u instanceof Oe.ASTComment)s.add(u),o.unshift(u.value);else break}return o.join(`
112
112
 
113
- `)}else if(i instanceof Ee.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=Pe.SignatureDefinitionFunction.parse({type:Pe.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Ee.ASTType.Identifier)return{label:r.name??"unknown",type:Pe.SignatureDefinitionBaseType.Any};let i=r;return{label:i.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(i.init).types)}}),returns:["any"]});return this.factory(ke.CompletionItemKind.Function).addType(Pe.SignatureDefinitionBaseType.Function).addSignatureType((0,rL.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(ke.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(ke.CompletionItemKind.Expression).setLabel("Logical Expr").addType(Pe.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(ke.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Pe.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(ke.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Pe.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(ke.CompletionItemKind.MapConstructor).addType(Pe.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===Ee.ASTType.StringLiteral)n.setProperty(i.key.value.toString(),s);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(ke.CompletionItemKind.ListConstructor).addType(Pe.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(ke.CompletionItemKind.Variable).addType(Pe.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(ke.CompletionItemKind.Variable).addType(Pe.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(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(ke.CompletionItemKind.Property).addType(Pe.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(ke.CompletionItemKind.Property).addType(Pe.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Ee.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Ee.ASTType.CallStatement:return this.resolveCallStatement(e);case Ee.ASTType.CallExpression:return this.resolveCallExpression(e);case Ee.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Ee.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Ee.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Ee.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Ee.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Ee.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Ee.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Ee.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Ee.ASTType.Identifier:return this.resolveIdentifier(e,n);case Ee.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Ee.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Ee.ASTType.NegationExpression:case Ee.ASTType.BinaryNegatedExpression:case Ee.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Ee.ASTType.NilLiteral:return this.factory(ke.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Ee.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(ke.CompletionItemKind.Literal).addType(Pe.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Ee.ASTType.NumericLiteral:case Ee.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(ke.CompletionItemKind.Literal).addType(Pe.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case ad.ASTType.FeatureFileExpression:return this.factory(ke.CompletionItemKind.Expression).addType(Pe.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case ad.ASTType.FeatureLineExpression:return this.factory(ke.CompletionItemKind.Expression).addType(Pe.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case ad.ASTType.FeatureEnvarExpression:return this.factory(ke.CompletionItemKind.Expression).addType(Pe.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case ad.ASTType.FeatureInjectExpression:return this.factory(ke.CompletionItemKind.Expression).addType(Pe.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(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any);return e!=null&&i.setLine(e.start.line),i}return r}resolveChain(e,n=!1){if(e.length===0)return null;let r=null,i=e[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||n&&e.length===1;if((0,as.isResolveChainItemWithIdentifier)(i))if(i.getter.name==="globals")r=this._scope.globals;else if(i.getter.name==="outer")r=this._scope.outer;else if(i.getter.name==="locals")r=this._scope.locals;else if(i.getter.name==="super"){let a=this._document.getScopeContext(i.ref.scope)?.scope.context?.getIsa();a==null?r=this.factory(ke.CompletionItemKind.Constant).addType("null").setLabel("super"):r=a.copy({kind:ke.CompletionItemKind.Constant,label:"super",values:a.values})}else if(i.getter.name==="self"){let a=this._document.getScopeContext(i.ref.scope)?.scope.context;a==null?r=this.factory(ke.CompletionItemKind.Constant).addType("null").setLabel("self"):r=a.copy({kind:ke.CompletionItemKind.Constant,label:"self",values:a.values})}else r=this._scope.resolveNamespace(i.getter.name,s)??this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any).setLabel(i.getter.name);else if((0,as.isResolveChainItemWithValue)(i))r=this.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator===Ee.Keyword.New&&r!==null){let a=this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Map).setLabel(r.label);a.setProperty("__isa",r),this.createCustomTypeFromMap(i.unary,a),r=a}let o=e.length;for(let a=1;a<o&&r!==null;a++){let u=e[a],c=u.unary?.operator==="@"&&!u.isInCallExpression||n&&e.length-1===a;if((0,as.isResolveChainItemWithMember)(u))r=r.resolveProperty(u.getter.name,c)??this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any).setLabel(u.getter.name);else if((0,as.isResolveChainItemWithIndex)(u))if((0,tE.isValidIdentifierLiteral)(u.getter)){let l=u.getter.value.toString();r=r.resolveProperty(l,u.isInCallExpression)??this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any).setLabel(l)}else{let l=this.resolveTypeWithDefault(u.getter);r=r.resolveProperty(l,u.isInCallExpression)??this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any)}else if(u.ref.type===Ee.ASTType.SliceExpression)r=r.copy();else return null;if(u.unary?.operator===Ee.Keyword.New&&r!==null){let l=this.factory(ke.CompletionItemKind.Property).addType(Pe.SignatureDefinitionBaseType.Map).setLabel(r.label);l.setProperty("__isa",r),this.createCustomTypeFromMap(u.unary,l),r=l}}return r}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(ke.CompletionItemKind.Property).addType(Pe.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,eE.createResolveChain)(e);return this.resolveChain(r,n)}defineNamespace(e,n){let r=(0,eE.createResolveChain)(e),i=r.pop();if(r.length>0){let o=this.resolveChain(r);if(o===null)return!1;if((0,as.isResolveChainItemWithMember)(i))return o.setProperty(i.getter.name,n);if((0,as.isResolveChainItemWithIndex)(i)){if((0,tE.isValidIdentifierLiteral)(i.getter))return o.setProperty(i.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(i.getter);return o.setProperty(a,n)}}return!1}let s=this._scope;return(0,as.isResolveChainItemWithIdentifier)(i)?s.setProperty(i.getter.name,n):!1}resolveAvailableAssignmentsWithQuery(e){let n=[],r=new Set([this,this._parent,this._document.getRootScopeContext().aggregator]);for(let i of r){let s=i.definitions;for(let o of s.keys())if(o.includes(e)){let a=s.get(o);(0,nE.merge)(n,a)}}return n}resolveAvailableAssignments(e){let n=(0,Z0.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=[],s=new Set([r,r._parent,r._document.getRootScopeContext().aggregator]);for(let o of s){if(o==null)continue;let a=o._definitions.get(n);a!=null&&(0,nE.merge)(i,a)}return i}analyze(){for(let e=0;e<this._root.assignments.length;e++){let n=this._root.assignments[e],r=this.resolveType(n.init)?.copy().setLine(n.start.line)??this.factory(ke.CompletionItemKind.Variable).addType(Pe.SignatureDefinitionBaseType.Any).setLine(n.start.line);this.defineNamespace(n.variable,r);let i=(0,Z0.createExpressionId)(n.variable),s=this._definitions;i.startsWith("globals.")?(s=this._document.getRootScopeContext().aggregator.definitions,i=i.slice(8)):i.startsWith("locals.")?(s=this._definitions,i=i.slice(7)):i.startsWith("outer.")&&(s=this.parent.definitions,i=i.slice(6));let o=s.get(i);o?o.push(n):s.set(i,[n])}}extend(e){for(let[n,r]of e.definitions){let i=this.definitions.get(n);i?(0,oL.mergeUnique)(i,r):this.definitions.set(n,r)}}};ud.Aggregator=Ly});var jy=g(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.Document=void 0;var Ur=Un(),aL=qe(),rE=ns(),iE=qy(),sE=uo(),oE=py(),uL=My(),Ny=class t{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._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(Ur.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(Ur.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(Ur.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(Ur.SignatureDefinitionBaseType.String),list:this._container.primitives.get(Ur.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(Ur.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 sE.Entity({kind:rE.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(Ur.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new oE.Scope({container:this._container,parent:n?.scope,globals:this._globals}),i=new iE.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof aL.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(Ur.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),d=c.getTypes().map(p=>p.type);l===null?r.setProperty(c.getLabel(),new sE.Entity({kind:rE.CompletionItemKind.Variable,container:this._container}).addType(...d)):(l.types.delete(Ur.SignatureDefinitionBaseType.Any),l.addType(...d))}}}}analyze(){let e=new oE.Scope({container:this._container,globals:this._globals,locals:this._globals}),n=new iE.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];return n&&n.length>0?n[n.length-1]:null}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;for(let a of o.keys())if(a.includes(e)){let u=o.get(a);(0,uL.merge)(n,u)}}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({root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals.copy({line:-1})),n._intrinscis.map.extend(i._intrinscis.map.copy({line:-1})),n._intrinscis.funcRef.extend(i._intrinscis.funcRef.copy({line:-1})),n._intrinscis.number.extend(i._intrinscis.number.copy({line:-1})),n._intrinscis.string.extend(i._intrinscis.string.copy({line:-1})),n._intrinscis.list.extend(i._intrinscis.list.copy({line:-1})),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}};cd.Document=Ny});var By=g(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.ContainerProxy=void 0;var rr=Un(),xi=uo(),aE=ns(),uE=La(),Fy=Xl(),$y=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;for(let[n,r]of this._container.getPrimitives()){let i=new xi.Entity({kind:aE.CompletionItemKind.Constant,container:this,isAPI:n===rr.SignatureDefinitionBaseType.General}).addType(rr.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}createTypes(){let e=new Map;for(let[n,r]of this._container.getTypes()){let i=new xi.Entity({kind:aE.CompletionItemKind.Constant,container:this}).addType(rr.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}setCustomType(e,n){this._types.has(e)||(this._types.set(e,n),this._customTypes.add(e))}mergeCustomTypes(e){for(let n of e._customTypes){let r=e._types.get(n);r!=null&&this.setCustomType(n,r.copy({deepCopy:!0,line:-1}))}}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(rr.SignatureDefinitionBaseType.Any)?new Set(this._container.getAllVisibleTypes()):new Set(e),i=new Map;for(let s of r){let o=this.getTypeSignature(s);if(o===null)continue;let a=(0,Fy.lookupProperty)(o,n);a!==null&&i.set(s,a)}return i}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let i=(0,Fy.lookupProperty)(this._primitives.get(rr.SignatureDefinitionBaseType.Any),n);if(e.includes(rr.SignatureDefinitionBaseType.Any)&&i)return(0,xi.resolveEntity)(this,i,r);let s=this.searchDefinitionMatches(e,n);return s.size===0?null:s.size===1?(0,xi.resolveEntity)(this,s.values().next().value,r):s.has(rr.SignatureDefinitionBaseType.Any)?(0,xi.resolveEntity)(this,s.get(rr.SignatureDefinitionBaseType.Any),r):i!==null?(0,xi.resolveEntity)(this,i,r):(0,xi.resolveEntity)(this,s.values().next().value,r)}getGeneralDefinition(e,n=!1){let r=(0,Fy.lookupProperty)(this._primitives.get(rr.SignatureDefinitionBaseType.General),e);return r==null?null:(0,xi.resolveEntity)(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,uE.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(rr.SignatureDefinitionBaseType.Map);(0,uE.injectIdentifers)(e,i)}}getAllIdentifier(e){let n=new Map;if(e===rr.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})}};ld.ContainerProxy=$y});var cE=g(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.TypeManager=void 0;var cL=jy(),lL=By(),Uy=class{constructor(e){this._container=new lL.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new cL.Document({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}};dd.TypeManager=Uy});var za=g(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.TypeManager=oe.ContainerProxy=oe.Document=oe.Aggregator=oe.Scope=oe.Entity=oe.lookupProperty=oe.isEligibleForProperties=oe.injectIdentifers=oe.isSignatureDefinitionFunction=oe.isResolveChainItemWithValue=oe.isResolveChainItemWithMember=oe.isResolveChainItemWithIndex=oe.isResolveChainItemWithIdentifier=oe.CompletionItemKind=oe.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=oe.ObjectSetIterator=oe.ObjectSet=oe.rotateBits=oe.getStringHashCode=oe.getHashCode=oe.createResolveChain=oe.enrichWithMetaInformation=oe.createExpressionId=oe.createExpressionHash=oe.isValidIdentifierLiteral=void 0;var dL=ha();Object.defineProperty(oe,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return dL.isValidIdentifierLiteral}});var fL=lx();Object.defineProperty(oe,"createExpressionHash",{enumerable:!0,get:function(){return fL.createExpressionHash}});var pL=zg();Object.defineProperty(oe,"createExpressionId",{enumerable:!0,get:function(){return pL.createExpressionId}});var hL=Zm();Object.defineProperty(oe,"enrichWithMetaInformation",{enumerable:!0,get:function(){return hL.enrichWithMetaInformation}});var gL=ey();Object.defineProperty(oe,"createResolveChain",{enumerable:!0,get:function(){return gL.createResolveChain}});var Hy=Kg();Object.defineProperty(oe,"getHashCode",{enumerable:!0,get:function(){return Hy.getHashCode}});Object.defineProperty(oe,"getStringHashCode",{enumerable:!0,get:function(){return Hy.getStringHashCode}});Object.defineProperty(oe,"rotateBits",{enumerable:!0,get:function(){return Hy.rotateBits}});var lE=iy();Object.defineProperty(oe,"ObjectSet",{enumerable:!0,get:function(){return lE.ObjectSet}});Object.defineProperty(oe,"ObjectSetIterator",{enumerable:!0,get:function(){return lE.ObjectSetIterator}});var mL=sy();Object.defineProperty(oe,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return mL.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var yL=ns();Object.defineProperty(oe,"CompletionItemKind",{enumerable:!0,get:function(){return yL.CompletionItemKind}});var fd=oy();Object.defineProperty(oe,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return fd.isResolveChainItemWithIdentifier}});Object.defineProperty(oe,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return fd.isResolveChainItemWithIndex}});Object.defineProperty(oe,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return fd.isResolveChainItemWithMember}});Object.defineProperty(oe,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return fd.isResolveChainItemWithValue}});var bL=ay();Object.defineProperty(oe,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return bL.isSignatureDefinitionFunction}});var vL=La();Object.defineProperty(oe,"injectIdentifers",{enumerable:!0,get:function(){return vL.injectIdentifers}});var _L=Kl();Object.defineProperty(oe,"isEligibleForProperties",{enumerable:!0,get:function(){return _L.isEligibleForProperties}});var TL=Xl();Object.defineProperty(oe,"lookupProperty",{enumerable:!0,get:function(){return TL.lookupProperty}});var SL=uo();Object.defineProperty(oe,"Entity",{enumerable:!0,get:function(){return SL.Entity}});var kL=py();Object.defineProperty(oe,"Scope",{enumerable:!0,get:function(){return kL.Scope}});var xL=qy();Object.defineProperty(oe,"Aggregator",{enumerable:!0,get:function(){return xL.Aggregator}});var wL=jy();Object.defineProperty(oe,"Document",{enumerable:!0,get:function(){return wL.Document}});var EL=By();Object.defineProperty(oe,"ContainerProxy",{enumerable:!0,get:function(){return EL.ContainerProxy}});var AL=cE();Object.defineProperty(oe,"TypeManager",{enumerable:!0,get:function(){return AL.TypeManager}})});var Wy=g(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.getSymbolItemKind=fo.getCompletionItemKind=void 0;var Xt=za(),OL=t=>{switch(t){case Xt.CompletionItemKind.Constant:return 21;case Xt.CompletionItemKind.Variable:return 6;case Xt.CompletionItemKind.Expression:return 6;case Xt.CompletionItemKind.Function:return 3;case Xt.CompletionItemKind.ListConstructor:case Xt.CompletionItemKind.MapConstructor:case Xt.CompletionItemKind.Literal:case Xt.CompletionItemKind.Unknown:return 12}};fo.getCompletionItemKind=OL;var CL=t=>{switch(t){case Xt.CompletionItemKind.Constant:return 14;case Xt.CompletionItemKind.Variable:return 13;case Xt.CompletionItemKind.Expression:return 13;case Xt.CompletionItemKind.Function:return 12;case Xt.CompletionItemKind.ListConstructor:return 18;case Xt.CompletionItemKind.MapConstructor:return 19;case Xt.CompletionItemKind.Literal:case Xt.CompletionItemKind.Unknown:return 13}};fo.getSymbolItemKind=CL});var Vy=g(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.findEx=void 0;var RL=qe(),DL=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:()=>{}}},Gy=class{constructor(e){this.map=DL(this.visit.bind(this)),this.callback=e,this.state={exit:!1}}visit(e,n=0){let r=this;if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");if(r.state=r.callback(e,n),r.state.exit||r.state.skip)return;let i=r.map[e.type];i?.call(r,e,n+1)}};function PL(t,e){let n=[];return new Gy((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==RL.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}pd.findEx=PL});var dE=g((xU,IL)=>{IL.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 fE=g((wU,ML)=>{ML.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:"Returns a `list` where each item is a `number`. By default, the `list` starts with the `number` zero and increments by one for each item. Optionally start and end can be defined. Additionally, the incremental value can be changed as well. 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:
113
+ `)}else if(i instanceof Oe.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=Me.SignatureDefinitionFunction.parse({type:Me.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Oe.ASTType.Identifier)return{label:r.name??"unknown",type:Me.SignatureDefinitionBaseType.Any};let i=r;return{label:i.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(i.init).types)}}),returns:["any"]});return this.factory(we.CompletionItemKind.Function).addType(Me.SignatureDefinitionBaseType.Function).addSignatureType((0,mL.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(we.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(we.CompletionItemKind.Expression).setLabel("Logical Expr").addType(Me.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(we.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Me.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(we.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Me.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(we.CompletionItemKind.MapConstructor).addType(Me.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===Oe.ASTType.StringLiteral){let o=i.key.value.toString();n.setProperty(o,s),n.values.get(`i:${o}`)?.definitions.push(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(we.CompletionItemKind.ListConstructor).addType(Me.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(we.CompletionItemKind.Variable).addType(Me.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(we.CompletionItemKind.Variable).addType(Me.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(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(we.CompletionItemKind.Property).addType(Me.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(we.CompletionItemKind.Property).addType(Me.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Oe.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Oe.ASTType.CallStatement:return this.resolveCallStatement(e);case Oe.ASTType.CallExpression:return this.resolveCallExpression(e);case Oe.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Oe.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Oe.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Oe.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Oe.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Oe.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Oe.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Oe.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Oe.ASTType.Identifier:return this.resolveIdentifier(e,n);case Oe.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Oe.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Oe.ASTType.NegationExpression:case Oe.ASTType.BinaryNegatedExpression:case Oe.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Oe.ASTType.NilLiteral:return this.factory(we.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Oe.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(we.CompletionItemKind.Literal).addType(Me.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Oe.ASTType.NumericLiteral:case Oe.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(we.CompletionItemKind.Literal).addType(Me.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case ld.ASTType.FeatureFileExpression:return this.factory(we.CompletionItemKind.Expression).addType(Me.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case ld.ASTType.FeatureLineExpression:return this.factory(we.CompletionItemKind.Expression).addType(Me.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case ld.ASTType.FeatureEnvarExpression:return this.factory(we.CompletionItemKind.Expression).addType(Me.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case ld.ASTType.FeatureInjectExpression:return this.factory(we.CompletionItemKind.Expression).addType(Me.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(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any);return e!=null&&i.setLine(e.start.line),i}return r}resolveChain(e,n=!1){if(e.length===0)return null;let r=null,i=e[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||n&&e.length===1;if((0,ds.isResolveChainItemWithIdentifier)(i))if(i.getter.name==="globals")r=this._scope.globals;else if(i.getter.name==="outer")r=this._scope.outer;else if(i.getter.name==="locals")r=this._scope.locals;else if(i.getter.name==="super"){let a=this._document.getScopeContext(i.ref.scope)?.scope.context?.getIsa();a==null?r=this.factory(we.CompletionItemKind.Constant).addType("null").setLabel("super"):r=a.copy({kind:we.CompletionItemKind.Constant,label:"super",values:a.values})}else if(i.getter.name==="self"){let a=this._document.getScopeContext(i.ref.scope)?.scope.context;a==null?r=this.factory(we.CompletionItemKind.Constant).addType("null").setLabel("self"):r=a.copy({kind:we.CompletionItemKind.Constant,label:"self",values:a.values})}else r=this._scope.resolveNamespace(i.getter.name,s)??this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any).setLabel(i.getter.name);else if((0,ds.isResolveChainItemWithValue)(i))r=this.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator===Oe.Keyword.New&&r!==null){let a=this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Map).setLabel(r.label);a.setProperty("__isa",r),this.createCustomTypeFromMap(i.unary,a),r=a}let o=e.length;for(let a=1;a<o&&r!==null;a++){let u=e[a],c=u.unary?.operator==="@"&&!u.isInCallExpression||n&&e.length-1===a;if((0,ds.isResolveChainItemWithMember)(u))r=r.resolveProperty(u.getter.name,c)??this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any).setLabel(u.getter.name);else if((0,ds.isResolveChainItemWithIndex)(u))if((0,pE.isValidIdentifierLiteral)(u.getter)){let l=u.getter.value.toString();r=r.resolveProperty(l,u.isInCallExpression)??this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any).setLabel(l)}else{let l=this.resolveTypeWithDefault(u.getter);r=r.resolveProperty(l,u.isInCallExpression)??this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any)}else if(u.ref.type===Oe.ASTType.SliceExpression)r=r.copy();else return null;if(u.unary?.operator===Oe.Keyword.New&&r!==null){let l=this.factory(we.CompletionItemKind.Property).addType(Me.SignatureDefinitionBaseType.Map).setLabel(r.label);l.setProperty("__isa",r),this.createCustomTypeFromMap(u.unary,l),r=l}}return r}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(we.CompletionItemKind.Property).addType(Me.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,fE.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,fE.createResolveChain)(e),i=r.pop();if(this._lastModifiedProperty=null,r.length>0){let o=this.resolveChain(r);if(o===null)return!1;if((0,ds.isResolveChainItemWithMember)(i))return this.defineProperty(o,i.getter.name,n);if((0,ds.isResolveChainItemWithIndex)(i)){if((0,pE.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,ds.isResolveChainItemWithIdentifier)(i)?this.defineProperty(s,i.getter.name,n):!1}addDefinition(e){this._lastModifiedProperty?.definitions.push(e);let n=(0,dE.createExpressionId)(e.variable),r=this._definitions;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator.definitions,n=n.slice(8)):n.startsWith("locals.")?(r=this._definitions,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent.definitions,n=n.slice(6));let i=r.get(n);i?i.push(e):r.set(n,[e])}resolveAvailableAssignmentsWithQuery(e){let n=[],r=new Set([this,this._parent,this._document.getRootScopeContext().aggregator]);for(let i of r){let s=i.definitions;for(let o of s.keys())if(o.includes(e)){let a=s.get(o);(0,hE.merge)(n,a)}}return n}resolveAvailableAssignments(e){let n=(0,dE.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=[],s=new Set([r,r._parent,r._document.getRootScopeContext().aggregator]);for(let o of s){if(o==null)continue;let a=o.resolveNamespace(e,!0);a!=null&&(0,hE.merge)(i,a.definitions)}return i}analyze(){for(let e=0;e<this._root.assignments.length;e++){let n=this._root.assignments[e],r=this.resolveType(n.init)?.copy().setLine(n.start.line)??this.factory(we.CompletionItemKind.Variable).addType(Me.SignatureDefinitionBaseType.Any).setLine(n.start.line);this.defineNamespace(n.variable,r),this.addDefinition(n)}}extend(e){for(let[n,r]of e.definitions){let i=this.definitions.get(n);i?(0,vL.mergeUnique)(i,r):this.definitions.set(n,r)}}};dd.Aggregator=Hy});var Ky=g(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.Document=void 0;var Vr=Gn(),_L=qe(),gE=os(),mE=Wy(),yE=po(),bE=Ty(),TL=Uy(),Gy=class t{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._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(Vr.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(Vr.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(Vr.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(Vr.SignatureDefinitionBaseType.String),list:this._container.primitives.get(Vr.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(Vr.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 yE.Entity({kind:gE.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(Vr.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new bE.Scope({container:this._container,parent:n?.scope,globals:this._globals}),i=new mE.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof _L.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(Vr.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),d=c.getTypes().map(p=>p.type);l===null?r.setProperty(c.getLabel(),new yE.Entity({kind:gE.CompletionItemKind.Variable,container:this._container}).addType(...d)):(l.types.delete(Vr.SignatureDefinitionBaseType.Any),l.addType(...d))}}}}analyze(){let e=new bE.Scope({container:this._container,globals:this._globals,locals:this._globals}),n=new mE.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];return n&&n.length>0?n[n.length-1]:null}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;for(let a of o.keys())if(a.includes(e)){let u=o.get(a);(0,TL.merge)(n,u)}}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({root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals.copy({line:-1})),n._intrinscis.map.extend(i._intrinscis.map.copy({line:-1})),n._intrinscis.funcRef.extend(i._intrinscis.funcRef.copy({line:-1})),n._intrinscis.number.extend(i._intrinscis.number.copy({line:-1})),n._intrinscis.string.extend(i._intrinscis.string.copy({line:-1})),n._intrinscis.list.extend(i._intrinscis.list.copy({line:-1})),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}};fd.Document=Gy});var Xy=g(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.ContainerProxy=void 0;var ar=Gn(),Oi=po(),vE=os(),_E=ja(),Vy=Ql(),zy=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;for(let[n,r]of this._container.getPrimitives()){let i=new Oi.Entity({kind:vE.CompletionItemKind.Constant,container:this,isAPI:n===ar.SignatureDefinitionBaseType.General}).addType(ar.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}createTypes(){let e=new Map;for(let[n,r]of this._container.getTypes()){let i=new Oi.Entity({kind:vE.CompletionItemKind.Constant,container:this}).addType(ar.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}setCustomType(e,n){this._types.has(e)||(this._types.set(e,n),this._customTypes.add(e))}mergeCustomTypes(e){for(let n of e._customTypes){let r=e._types.get(n);r!=null&&this.setCustomType(n,r.copy({deepCopy:!0,line:-1}))}}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;for(let s of r){let o=this.getTypeSignature(s);if(o===null)continue;let a=(0,Vy.lookupProperty)(o,n);a!==null&&i.set(s,a)}return i}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let i=(0,Vy.lookupProperty)(this._primitives.get(ar.SignatureDefinitionBaseType.Any),n);if(e.includes(ar.SignatureDefinitionBaseType.Any)&&i)return(0,Oi.resolveEntity)(this,i,r);let s=this.searchDefinitionMatches(e,n);return s.size===0?null:s.size===1?(0,Oi.resolveEntity)(this,s.values().next().value,r):s.has(ar.SignatureDefinitionBaseType.Any)?(0,Oi.resolveEntity)(this,s.get(ar.SignatureDefinitionBaseType.Any),r):i!==null?(0,Oi.resolveEntity)(this,i,r):(0,Oi.resolveEntity)(this,s.values().next().value,r)}getGeneralDefinition(e,n=!1){let r=(0,Vy.lookupProperty)(this._primitives.get(ar.SignatureDefinitionBaseType.General),e);return r==null?null:(0,Oi.resolveEntity)(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,_E.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(ar.SignatureDefinitionBaseType.Map);(0,_E.injectIdentifers)(e,i)}}getAllIdentifier(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})}};pd.ContainerProxy=zy});var TE=g(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.TypeManager=void 0;var SL=Ky(),kL=Xy(),Yy=class{constructor(e){this._container=new kL.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new SL.Document({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}};hd.TypeManager=Yy});var Ja=g(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.TypeManager=se.ContainerProxy=se.Document=se.Aggregator=se.Scope=se.Entity=se.aggregateEntity=se.lookupProperty=se.isEligibleForProperties=se.injectIdentifers=se.isSignatureDefinitionFunction=se.isResolveChainItemWithValue=se.isResolveChainItemWithMember=se.isResolveChainItemWithIndex=se.isResolveChainItemWithIdentifier=se.CompletionItemKind=se.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=se.ObjectSetIterator=se.ObjectSet=se.rotateBits=se.getStringHashCode=se.getHashCode=se.createResolveChain=se.enrichWithMetaInformation=se.createExpressionId=se.createExpressionHash=se.isValidIdentifierLiteral=void 0;var xL=ya();Object.defineProperty(se,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return xL.isValidIdentifierLiteral}});var wL=kx();Object.defineProperty(se,"createExpressionHash",{enumerable:!0,get:function(){return wL.createExpressionHash}});var EL=tm();Object.defineProperty(se,"createExpressionId",{enumerable:!0,get:function(){return EL.createExpressionId}});var AL=oy();Object.defineProperty(se,"enrichWithMetaInformation",{enumerable:!0,get:function(){return AL.enrichWithMetaInformation}});var OL=ay();Object.defineProperty(se,"createResolveChain",{enumerable:!0,get:function(){return OL.createResolveChain}});var Jy=em();Object.defineProperty(se,"getHashCode",{enumerable:!0,get:function(){return Jy.getHashCode}});Object.defineProperty(se,"getStringHashCode",{enumerable:!0,get:function(){return Jy.getStringHashCode}});Object.defineProperty(se,"rotateBits",{enumerable:!0,get:function(){return Jy.rotateBits}});var SE=dy();Object.defineProperty(se,"ObjectSet",{enumerable:!0,get:function(){return SE.ObjectSet}});Object.defineProperty(se,"ObjectSetIterator",{enumerable:!0,get:function(){return SE.ObjectSetIterator}});var CL=fy();Object.defineProperty(se,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return CL.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var RL=os();Object.defineProperty(se,"CompletionItemKind",{enumerable:!0,get:function(){return RL.CompletionItemKind}});var gd=py();Object.defineProperty(se,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return gd.isResolveChainItemWithIdentifier}});Object.defineProperty(se,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return gd.isResolveChainItemWithIndex}});Object.defineProperty(se,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return gd.isResolveChainItemWithMember}});Object.defineProperty(se,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return gd.isResolveChainItemWithValue}});var PL=hy();Object.defineProperty(se,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return PL.isSignatureDefinitionFunction}});var DL=ja();Object.defineProperty(se,"injectIdentifers",{enumerable:!0,get:function(){return DL.injectIdentifers}});var IL=Yl();Object.defineProperty(se,"isEligibleForProperties",{enumerable:!0,get:function(){return IL.isEligibleForProperties}});var ML=Ql();Object.defineProperty(se,"lookupProperty",{enumerable:!0,get:function(){return ML.lookupProperty}});var LL=gy();Object.defineProperty(se,"aggregateEntity",{enumerable:!0,get:function(){return LL.aggregateEntity}});var NL=po();Object.defineProperty(se,"Entity",{enumerable:!0,get:function(){return NL.Entity}});var qL=Ty();Object.defineProperty(se,"Scope",{enumerable:!0,get:function(){return qL.Scope}});var jL=Wy();Object.defineProperty(se,"Aggregator",{enumerable:!0,get:function(){return jL.Aggregator}});var FL=Ky();Object.defineProperty(se,"Document",{enumerable:!0,get:function(){return FL.Document}});var $L=Xy();Object.defineProperty(se,"ContainerProxy",{enumerable:!0,get:function(){return $L.ContainerProxy}});var BL=TE();Object.defineProperty(se,"TypeManager",{enumerable:!0,get:function(){return BL.TypeManager}})});var Qy=g(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.getSymbolItemKind=mo.getCompletionItemKind=void 0;var Qt=Ja(),UL=t=>{switch(t){case Qt.CompletionItemKind.Constant:return 21;case Qt.CompletionItemKind.Variable:return 6;case Qt.CompletionItemKind.Expression:return 6;case Qt.CompletionItemKind.Function:return 3;case Qt.CompletionItemKind.ListConstructor:case Qt.CompletionItemKind.MapConstructor:case Qt.CompletionItemKind.Literal:case Qt.CompletionItemKind.Unknown:return 12}};mo.getCompletionItemKind=UL;var HL=t=>{switch(t){case Qt.CompletionItemKind.Constant:return 14;case Qt.CompletionItemKind.Variable:return 13;case Qt.CompletionItemKind.Expression:return 13;case Qt.CompletionItemKind.Function:return 12;case Qt.CompletionItemKind.ListConstructor:return 18;case Qt.CompletionItemKind.MapConstructor:return 19;case Qt.CompletionItemKind.Literal:case Qt.CompletionItemKind.Unknown:return 13}};mo.getSymbolItemKind=HL});var eb=g(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.findEx=void 0;var WL=qe(),GL=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:()=>{}}},Zy=class{constructor(e){this.map=GL(this.visit.bind(this)),this.callback=e,this.state={exit:!1}}visit(e,n=0){let r=this;if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");if(r.state=r.callback(e,n),r.state.exit||r.state.skip)return;let i=r.map[e.type];i?.call(r,e,n+1)}};function KL(t,e){let n=[];return new Zy((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==WL.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}md.findEx=KL});var kE=g((VU,VL)=>{VL.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 xE=g((zU,zL)=>{zL.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:"Returns a `list` where each item is a `number`. By default, the `list` starts with the `number` zero and increments by one for each item. Optionally start and end can be defined. Additionally, the incremental value can be changed as well. 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:
114
114
  miniscript: a string such as "1.5"
115
115
  buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
116
116
  host: a number for the host major and minor version, like 0.9
117
117
  hostName: name of the host application, e.g. "Mini Micro"
118
- hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var pE=g((EU,LL)=>{LL.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 hE=g((AU,qL)=>{qL.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 gE=g((OU,NL)=>{NL.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 mE=g((CU,jL)=>{jL.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 yE=g(Xa=>{"use strict";var po=Xa&&Xa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xa,"__esModule",{value:!0});var FL=po(dE()),$L=po(fE()),BL=po(pE()),UL=po(hE()),HL=po(gE()),WL=po(mE()),GL={any:FL.default,general:$L.default,list:BL.default,map:UL.default,string:WL.default,number:HL.default};Xa.default=GL});var bE=g((DU,VL)=>{VL.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 vE=g((PU,KL)=>{KL.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 _E=g((IU,zL)=>{zL.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 TE=g((MU,XL)=>{XL.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 SE=g((LU,YL)=>{YL.exports={type:"number",definitions:{}}});var kE=g((qU,JL)=>{JL.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 xE=g((NU,QL)=>{QL.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var wE=g(hn=>{"use strict";var wi=hn&&hn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hn,"__esModule",{value:!0});hn.miniscriptMeta=void 0;var ZL=Un(),eq=wi(yE()),tq=wi(bE()),nq=wi(vE()),rq=wi(_E()),iq=wi(TE()),sq=wi(SE()),oq=wi(kE()),aq=wi(xE());hn.miniscriptMeta=new ZL.Container;hn.miniscriptMeta.addTypeSignatureFromPayload(tq.default);hn.miniscriptMeta.addTypeSignatureFromPayload(nq.default);hn.miniscriptMeta.addTypeSignatureFromPayload(rq.default);hn.miniscriptMeta.addTypeSignatureFromPayload(iq.default);hn.miniscriptMeta.addTypeSignatureFromPayload(sq.default);hn.miniscriptMeta.addTypeSignatureFromPayload(oq.default);hn.miniscriptMeta.addTypeSignatureFromPayload(aq.default);hn.miniscriptMeta.addMetaFromPayload("en",eq.default)});var ho=g(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.lookupBase=ir.lookupIdentifier=void 0;var Hr=qe(),uq=wE(),cq=za(),lq=t=>{switch(t.type){case Hr.ASTType.CallStatement:return(0,ir.lookupIdentifier)(t.expression);case Hr.ASTType.CallExpression:return(0,ir.lookupIdentifier)(t.base);case Hr.ASTType.Identifier:return t;case Hr.ASTType.MemberExpression:return(0,ir.lookupIdentifier)(t.identifier);case Hr.ASTType.IndexExpression:return(0,ir.lookupIdentifier)(t.index);default:return null}};ir.lookupIdentifier=lq;var dq=(t=null)=>{switch(t?.type){case Hr.ASTType.MemberExpression:return t.base;case Hr.ASTType.IndexExpression:return t.base;case Hr.ASTType.CallExpression:return t.base;case Hr.ASTType.SliceExpression:return t.base;default:return null}};ir.lookupBase=dq;ir.default=new cq.TypeManager({container:uq.miniscriptMeta})});var yo=g(xr=>{"use strict";var fq=xr&&xr.__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]}),pq=xr&&xr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AE=xr&&xr.__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)&&fq(e,t,n);return pq(e,t),e};Object.defineProperty(xr,"__esModule",{value:!0});xr.LookupHelper=void 0;var hq=Un(),EE=qe(),go=za(),gq=AE(Vy()),mo=AE(ho()),Ky=class{constructor(e,n){this.document=e,this.context=n}findAllAssignmentsOfIdentifier(e,n){let r=mo.default.get(this.document.uri);if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignmentsWithQuery(e)}findAllAssignmentsOfItem(e,n){let r=mo.default.get(this.document.uri);if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignments(e)}findAllAvailableIdentifierInRoot(){let e=mo.default.get(this.document.uri);return e==null?new Map:e.getRootScopeContext().scope.getAllIdentifier()}findAllAvailableIdentifier(e){let n=mo.default.get(this.document.uri);if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAllIdentifier()}findAllAvailableIdentifierRelatedToPosition(e){let n=mo.default.get(this.document.uri),r=new Map;for(let a of n.container.getAllIdentifier(hq.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:go.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:go.CompletionItemKind.Constant,line:-1});let s=new Map;(0,go.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,go.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,go.injectIdentifers)(r,i.scope.outer),r}lookupAST(e){let n=this,i=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=gq.findEx((c,l)=>{let d=c.start.line-1,p=c.start.character-1,y=c.end.line-1,_=c.end.character-1;return d>e.line?{exit:!0}:d<y?{valid:e.line>d&&e.line<y||e.line===d&&p<=e.character||e.line===y&&_>=e.character}:{valid:d<=e.line&&p<=e.character&&y>=e.line&&_>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.buildTypeMap();if(n===null)return null;let r=(0,mo.lookupBase)(e);return r?n.resolveNamespace(r):null}async buildTypeMap(){return this.context.documentMerger.build(this.document,this.context)}async lookupTypeInfo({closest:e,outer:n}){let r=await this.buildTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===EE.ASTType.MemberExpression&&e===i.identifier||i?.type===EE.ASTType.IndexExpression&&e===i.index&&(0,go.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};xr.LookupHelper=Ky});var OE=g(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.AVAILABLE_CONSTANTS=void 0;hd.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var CE=g(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.AVAILABLE_KEYWORDS=void 0;var bo=Br(),Yt=qe();gd.AVAILABLE_KEYWORDS=[Yt.Keyword.If,Yt.Keyword.In,Yt.Keyword.Or,Yt.Keyword.And,Yt.Keyword.Isa,Yt.Keyword.For,Yt.Keyword.New,Yt.Keyword.Not,Yt.Keyword.End,Yt.Keyword.Then,Yt.Keyword.Else,Yt.Keyword.Break,Yt.Keyword.While,Yt.Keyword.Return,Yt.Keyword.Function,Yt.Keyword.Continue,bo.GreybelKeyword.Envar,bo.GreybelKeyword.Import,bo.GreybelKeyword.Include,bo.GreybelKeyword.Debugger,bo.GreybelKeyword.Line,bo.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var RE=g(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.AVAILABLE_OPERATORS=void 0;var Ya=lo(),Lt=qe();md.AVAILABLE_OPERATORS=[Lt.Operator.Plus,Lt.Operator.Asterik,Lt.Operator.Minus,Lt.Operator.Slash,Lt.Operator.Power,Lt.Operator.Modulo,Lt.Operator.LessThan,Lt.Operator.GreaterThan,Lt.Operator.LessThanOrEqual,Lt.Operator.GreaterThanOrEqual,Lt.Operator.NotEqual,Lt.Operator.Equal,Lt.Operator.AddShorthand,Lt.Operator.SubtractShorthand,Lt.Operator.MultiplyShorthand,Lt.Operator.DivideShorthand,Ya.Operator.BitwiseAnd,Ya.Operator.BitwiseOr,Ya.Operator.LeftShift,Ya.Operator.RightShift,Ya.Operator.UnsignedRightShift,Lt.Operator.Assign,Lt.Operator.Reference].map(t=>({label:t,kind:24}))});var IE=g(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.activate=qt.getDefaultCompletionList=qt.getPropertyCompletionList=qt.transformToCompletionItems=void 0;var DE=qe(),mq=Wy(),PE=yo(),yq=OE(),bq=CE(),vq=RE(),_q=t=>{let e=[];for(let[n,r]of t)e.push({label:n,kind:(0,mq.getCompletionItemKind)(r.kind)});return e};qt.transformToCompletionItems=_q;var Tq=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?[]:(0,qt.transformToCompletionItems)(n.getAllIdentifier())};qt.getPropertyCompletionList=Tq;var Sq=()=>[...bq.AVAILABLE_KEYWORDS,...vq.AVAILABLE_OPERATORS,...yq.AVAILABLE_CONSTANTS];qt.getDefaultCompletionList=Sq;function kq(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 PE.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=[],a=!1;if(s){let{closest:l}=s;l instanceof DE.ASTMemberExpression?(o.push(...await(0,qt.getPropertyCompletionList)(i,l)),a=!0):l instanceof DE.ASTIndexExpression?(o.push(...await(0,qt.getPropertyCompletionList)(i,l)),a=!0):o.push(...(0,qt.getDefaultCompletionList)())}else o.push(...(0,qt.getDefaultCompletionList)()),o.push(...(0,qt.transformToCompletionItems)(i.findAllAvailableIdentifierInRoot()));if(!s||a)return o;let u=new Set([...o.map(l=>l.label)]),c=await r.getImports();for(let l of c){let{document:d}=l;if(!d)continue;let p=new PE.LookupHelper(l.textDocument,t);o.push(...(0,qt.transformToCompletionItems)(p.findAllAvailableIdentifier(d)).filter(y=>!u.has(y.label)).map(y=>(u.add(y.label),y)))}return o.push(...(0,qt.transformToCompletionItems)(i.findAllAvailableIdentifierRelatedToPosition(s.closest)).filter(l=>!u.has(l.label))),o}),t.connection.onCompletionResolve(e=>e)}qt.activate=kq});var LE=g((GU,ME)=>{"use strict";ME.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 zy=g((VU,NE)=>{var Ja=LE(),qE={};for(let t of Object.keys(Ja))qE[Ja[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"]}};NE.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),d=function(p){return(c-p)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=d(o),n=d(a),r=d(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 xq(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=qE[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Ja)){let s=Ja[i],o=xq(t,s);o<n&&(n=o,r=i)}return r};te.keyword.rgb=function(t){return Ja[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,d;switch(o){default:case 6:case 0:c=a,l=u,d=n;break;case 1:c=u,l=a,d=n;break;case 2:c=n,l=a,d=u;break;case 3:c=n,l=u,d=a;break;case 4:c=u,l=n,d=a;break;case 5:c=a,l=n,d=u;break}return[c*255,l*255,d*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 FE=g((KU,jE)=>{var yd=zy();function wq(){let t={},e=Object.keys(yd);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function Eq(t){let e=wq(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(yd[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 Aq(t,e){return function(n){return e(t(n))}}function Oq(t,e){let n=[e[t].parent,t],r=yd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=Aq(yd[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}jE.exports=function(t){let e=Eq(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]=Oq(o,e))}return n}});var BE=g((zU,$E)=>{var Xy=zy(),Cq=FE(),vo={},Rq=Object.keys(Xy);function Dq(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 Pq(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}Rq.forEach(t=>{vo[t]={},Object.defineProperty(vo[t],"channels",{value:Xy[t].channels}),Object.defineProperty(vo[t],"labels",{value:Xy[t].labels});let e=Cq(t);Object.keys(e).forEach(r=>{let i=e[r];vo[t][r]=Pq(i),vo[t][r].raw=Dq(i)})});$E.exports=vo});var HE=g(_o=>{"use strict";var Iq=_o&&_o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_o,"__esModule",{value:!0});_o.activate=void 0;var Yy=Iq(BE()),Mq=qe(),UE;(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"})(UE||(UE={}));var Jy={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},Lq=()=>new RegExp(`(?:mark|color)=(${Object.keys(Jy).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),qq=Object.prototype.hasOwnProperty;function Nq(t){t.connection.onColorPresentation(e=>[{label:`#${Yy.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===Mq.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:d,lineIndex:p})=>{let y=u.index+c.indexOf("=")+1,_=y+l.length,E=d.line-1+p,L=y,M=_;return p===0&&(L+=d.character,M+=d.character),{start:{line:E,character:L},end:{line:E,character:M}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,d=c.value.toString().split(`
119
- `);for(let p=0;p<d.length;p++){let y=d[p],_=Lq(),E;for(;E=_.exec(y);){let[L,M]=E,x=a({match:E,markup:L,value:M,astPosition:l,lineIndex:p});if(M.startsWith("#")){let[k,v,F]=Yy.default.hex.rgb(M.slice(1));o.push({range:x,color:{red:k/255,green:v/255,blue:F/255,alpha:1}})}else if(qq.call(Jy,M)){let[k,v,F]=Yy.default.hex.rgb(Jy[M].slice(1));o.push({range:x,color:{red:k/255,green:v/255,blue:F/255,alpha:1}})}else o.push({range:x,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}_o.activate=Nq});var VE=g(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.activate=void 0;var jq=qe(),WE=yo(),GE=(t,e,n)=>{let r=t.findAllAssignmentsOfItem(e,n),i=[];for(let s of r){if(!s.start||!s.end)continue;let o={line:s.start.line-1,character:s.start.character-1},a={line:s.end.line-1,character:s.end.character-1},u={targetUri:t.document.uri,targetRange:{start:o,end:a},targetSelectionRange:{start:o,end:a}};i.push(u)}return i};function Fq(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new WE.LookupHelper(n,t),i=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;a&&a instanceof jq.ASTMemberExpression&&a.identifier===o&&(u=a);let c=GE(r,u,u.scope),l=await t.documentManager.get(n).getImports();for(let d of l){let{document:p,textDocument:y}=d;if(!p)continue;let _=new WE.LookupHelper(y,t),E=GE(_,u,p);c.push(...E)}return c})}bd.activate=Fq});var KE=g(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.activate=void 0;async function $q(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 Bq(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 $q(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}vd.activate=Bq});var zE=g(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.getStringHashCode=void 0;_d.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 Qy=g(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.createExpressionHash=void 0;var Td=qe(),XE=zE(),Sd=(t,e)=>t.$$hash=e,Uq=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function To(t){let e=Uq(t);if(e!==null)return e;let n=(0,XE.getStringHashCode)(t.type);switch(t.type){case Td.ASTType.ParenthesisExpression:return To(t.expression);case Td.ASTType.MemberExpression:{let r=t;return n^=To(r.base),n^=To(r.identifier),Sd(t,n)}case Td.ASTType.IndexExpression:{let r=t;return n^=To(r.base),n^=To(r.index),Sd(t,n)}case Td.ASTType.Identifier:{let r=t;return n^=(0,XE.getStringHashCode)(r.name),Sd(t,n)}}return Sd(t,n)}function Hq(t){return To(t)}kd.createExpressionHash=Hq});var eb=g(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.Stack=void 0;var Zy=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}};xd.Stack=Zy});var So=g(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.Factory=us.TokenType=void 0;var Wq=eb(),Gq;(function(t){t[t.Text=0]="Text",t[t.EndOfLine=1]="EndOfLine",t[t.Comment=2]="Comment"})(Gq=us.TokenType||(us.TokenType={}));var tb=class{get tokens(){return this._tokens}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}constructor(e){this.transformer=e,this._tokens=[],this._currentDependency=null,this._currentStack=new Wq.Stack}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()}};us.Factory=tb});var rb=g(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.BeautifyContext=cs.IndentationType=void 0;var Qa=qe(),wd=So(),YE;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(YE=cs.IndentationType||(cs.IndentationType={}));var nb=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}get usedComments(){return this._usedComments}constructor(e,n){this.factory=e,this.options=n,this._indent=0,this._isMultilineAllowed=!0,this._usedComments=new Set,this.getIndent=n.indentation===YE.Tab?(r=0)=>" ".repeat(this._indent+r):(r=0)=>" ".repeat(n.indentationSpaces).repeat(this._indent+r)}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof Qa.ASTIfClause||e instanceof Qa.ASTWhileStatement?e.condition.end.line:e instanceof Qa.ASTForGenericStatement?e.iterator.end.line:e instanceof Qa.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Qa.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}containsNewLineInRange(e,n=this.factory.tokens.length){let r=Math.min(n,this.factory.tokens.length);for(let i=e;i<r;i++)if(this.factory.tokens[i].type===wd.TokenType.EndOfLine)return!0;return!1}buildBlock(e){if(e.body.length===0)return;e.body.sort((s,o)=>s.range[0]-o.range[0]);let n=null;for(let s=0;s<e.body.length;s++){let o=e.body[s],a=n?this.getPreviousEndLine(n):this.getBlockOpenerEndLine(e),u=Math.max(o.start.line-a-1,0);if(u>0)for(let l=0;l<u;l++){let d={line:a+l+1,character:0};this.factory.tokens.push({type:wd.TokenType.EndOfLine,value:`
120
- `,ref:{start:d,end:d}})}let c=this.factory.tokens.length;this.factory.process(o,{isCommand:!0}),c<this.factory.tokens.length&&(this.factory.tokens[c].value=this.getIndent()+this.factory.tokens[c].value,this.factory.tokens.push({type:wd.TokenType.EndOfLine,value:`
121
- `,ref:{start:o.end,end:o.end}})),n=o}let r=e.body[e.body.length-1],i=Math.max(e.end.line-this.getPreviousEndLine(r)-1,0);if(i>0)for(let s=0;s<i;s++){let o={line:r.end.line+s+1,character:0};this.factory.tokens.push({type:wd.TokenType.EndOfLine,value:`
122
- `,ref:{start:o,end:o}})}}};cs.BeautifyContext=nb});var ib=g(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.hasEmptyBody=Bt.containsMultilineItemInShortcutClauses=Bt.getLastComment=Bt.unwrap=Bt.countRightBinaryExpressions=Bt.SHORTHAND_OPERATORS=void 0;var gn=qe();Bt.SHORTHAND_OPERATORS=[gn.Operator.Plus,gn.Operator.Minus,gn.Operator.Asterik,gn.Operator.Slash,gn.Operator.Modulo,gn.Operator.Power];var Vq=t=>{if(t=(0,Bt.unwrap)(t),t instanceof gn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof gn.ASTBinaryExpression&&n++,(r instanceof gn.ASTBinaryExpression||r instanceof gn.ASTLogicalExpression||r instanceof gn.ASTIsaExpression)&&(e.push((0,Bt.unwrap)(r.left)),e.push((0,Bt.unwrap)(r.right)))}return n};Bt.countRightBinaryExpressions=Vq;var Kq=t=>{for(;t instanceof gn.ASTParenthesisExpression;)t=t.expression;return t};Bt.unwrap=Kq;var zq=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===gn.ASTType.Comment)return n}return null};Bt.getLastComment=zq;var Xq=(t,e)=>e.some(n=>t.line<n.body[0].end.line);Bt.containsMultilineItemInShortcutClauses=Xq;var Yq=t=>!t.some(e=>!(e instanceof gn.ASTComment));Bt.hasEmptyBody=Yq});var ob=g(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.BeautifyFactory=void 0;var Za=qe(),Jq=require("path"),JE=Qy(),QE=rb(),Wr=ib(),q=So(),sb=class extends q.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"(",ref:o}),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:q.TokenType.Text,value:")",ref:o})},Comment:function(o,a){if(this.context.usedComments.add(o),o.isMultiline){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Comment,value:`/*${o.value}*/`,ref:o,isMultiline:!0});return}this.tokens.push({type:q.TokenType.Comment,value:o.value.split(`
118
+ hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var wE=g((XU,XL)=>{XL.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 EE=g((YU,YL)=>{YL.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 AE=g((JU,JL)=>{JL.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 OE=g((QU,QL)=>{QL.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 CE=g(Qa=>{"use strict";var yo=Qa&&Qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qa,"__esModule",{value:!0});var ZL=yo(kE()),eN=yo(xE()),tN=yo(wE()),nN=yo(EE()),rN=yo(AE()),iN=yo(OE()),sN={any:ZL.default,general:eN.default,list:tN.default,map:nN.default,string:iN.default,number:rN.default};Qa.default=sN});var RE=g((eH,oN)=>{oN.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 PE=g((tH,aN)=>{aN.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 DE=g((nH,uN)=>{uN.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 IE=g((rH,cN)=>{cN.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 ME=g((iH,lN)=>{lN.exports={type:"number",definitions:{}}});var LE=g((sH,dN)=>{dN.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 NE=g((oH,fN)=>{fN.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var tb=g(yn=>{"use strict";var Ci=yn&&yn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yn,"__esModule",{value:!0});yn.miniscriptMeta=void 0;var pN=Gn(),hN=Ci(CE()),gN=Ci(RE()),mN=Ci(PE()),yN=Ci(DE()),bN=Ci(IE()),vN=Ci(ME()),_N=Ci(LE()),TN=Ci(NE());yn.miniscriptMeta=new pN.Container;yn.miniscriptMeta.addTypeSignatureFromPayload(gN.default);yn.miniscriptMeta.addTypeSignatureFromPayload(mN.default);yn.miniscriptMeta.addTypeSignatureFromPayload(yN.default);yn.miniscriptMeta.addTypeSignatureFromPayload(bN.default);yn.miniscriptMeta.addTypeSignatureFromPayload(vN.default);yn.miniscriptMeta.addTypeSignatureFromPayload(_N.default);yn.miniscriptMeta.addTypeSignatureFromPayload(TN.default);yn.miniscriptMeta.addMetaFromPayload("en",hN.default)});var bo=g(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.lookupBase=ur.lookupIdentifier=void 0;var zr=qe(),SN=tb(),kN=Ja(),xN=t=>{switch(t.type){case zr.ASTType.CallStatement:return(0,ur.lookupIdentifier)(t.expression);case zr.ASTType.CallExpression:return(0,ur.lookupIdentifier)(t.base);case zr.ASTType.Identifier:return t;case zr.ASTType.MemberExpression:return(0,ur.lookupIdentifier)(t.identifier);case zr.ASTType.IndexExpression:return(0,ur.lookupIdentifier)(t.index);default:return null}};ur.lookupIdentifier=xN;var wN=(t=null)=>{switch(t?.type){case zr.ASTType.MemberExpression:return t.base;case zr.ASTType.IndexExpression:return t.base;case zr.ASTType.CallExpression:return t.base;case zr.ASTType.SliceExpression:return t.base;default:return null}};ur.lookupBase=wN;ur.default=new kN.TypeManager({container:SN.miniscriptMeta})});var _o=g(Cr=>{"use strict";var EN=Cr&&Cr.__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]}),AN=Cr&&Cr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jE=Cr&&Cr.__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)&&EN(e,t,n);return AN(e,t),e};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.LookupHelper=void 0;var ON=Gn(),qE=qe(),vo=Ja(),CN=jE(eb()),yd=jE(bo()),nb=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null,this.refMapForScopes=null}getRefMapForScopes(){return this.refMapForScopes==null&&(this.refMapForScopes=new Map,this.context.documentManager.results.forEach(e=>{e.document&&this.refMapForScopes.set(e.document,e.textDocument.uri)})),this.refMapForScopes}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)}findAllAvailableIdentifierInRoot(){let e=yd.default.get(this.document.uri);return e==null?new Map:e.getRootScopeContext().scope.getAllIdentifier()}findAllAvailableIdentifier(e){let n=yd.default.get(this.document.uri);if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAllIdentifier()}findAllAvailableIdentifierRelatedToPosition(e){let n=yd.default.get(this.document.uri),r=new Map;for(let a of n.container.getAllIdentifier(ON.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:vo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:vo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,vo.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,vo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,vo.injectIdentifers)(r,i.scope.outer),r}lookupAST(e){let n=this,i=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=CN.findEx((c,l)=>{let d=c.start.line-1,p=c.start.character-1,y=c.end.line-1,_=c.end.character-1;return d>e.line?{exit:!0}:d<y?{valid:e.line>d&&e.line<y||e.line===d&&p<=e.character||e.line===y&&_>=e.character}:{valid:d<=e.line&&p<=e.character&&y>=e.line&&_>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.getTypeMap();if(n===null)return null;let r=(0,yd.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===qE.ASTType.MemberExpression&&e===i.identifier||i?.type===qE.ASTType.IndexExpression&&e===i.index&&(0,vo.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Cr.LookupHelper=nb});var FE=g(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.AVAILABLE_CONSTANTS=void 0;bd.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var $E=g(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.AVAILABLE_KEYWORDS=void 0;var To=Or(),Zt=qe();vd.AVAILABLE_KEYWORDS=[Zt.Keyword.If,Zt.Keyword.In,Zt.Keyword.Or,Zt.Keyword.And,Zt.Keyword.Isa,Zt.Keyword.For,Zt.Keyword.New,Zt.Keyword.Not,Zt.Keyword.End,Zt.Keyword.Then,Zt.Keyword.Else,Zt.Keyword.Break,Zt.Keyword.While,Zt.Keyword.Return,Zt.Keyword.Function,Zt.Keyword.Continue,To.GreybelKeyword.Envar,To.GreybelKeyword.Import,To.GreybelKeyword.Include,To.GreybelKeyword.Debugger,To.GreybelKeyword.Line,To.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var BE=g(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.AVAILABLE_OPERATORS=void 0;var Za=go(),qt=qe();_d.AVAILABLE_OPERATORS=[qt.Operator.Plus,qt.Operator.Asterik,qt.Operator.Minus,qt.Operator.Slash,qt.Operator.Power,qt.Operator.Modulo,qt.Operator.LessThan,qt.Operator.GreaterThan,qt.Operator.LessThanOrEqual,qt.Operator.GreaterThanOrEqual,qt.Operator.NotEqual,qt.Operator.Equal,qt.Operator.AddShorthand,qt.Operator.SubtractShorthand,qt.Operator.MultiplyShorthand,qt.Operator.DivideShorthand,Za.Operator.BitwiseAnd,Za.Operator.BitwiseOr,Za.Operator.LeftShift,Za.Operator.RightShift,Za.Operator.UnsignedRightShift,qt.Operator.Assign,qt.Operator.Reference].map(t=>({label:t,kind:24}))});var WE=g(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.activate=jt.getDefaultCompletionList=jt.getPropertyCompletionList=jt.transformToCompletionItems=void 0;var UE=qe(),RN=Qy(),HE=_o(),PN=FE(),DN=$E(),IN=BE(),MN=t=>{let e=[];for(let[n,r]of t)e.push({label:n,kind:(0,RN.getCompletionItemKind)(r.kind)});return e};jt.transformToCompletionItems=MN;var LN=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?[]:(0,jt.transformToCompletionItems)(n.getAllIdentifier())};jt.getPropertyCompletionList=LN;var NN=()=>[...DN.AVAILABLE_KEYWORDS,...IN.AVAILABLE_OPERATORS,...PN.AVAILABLE_CONSTANTS];jt.getDefaultCompletionList=NN;function qN(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 HE.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=[],a=!1;if(s){let{closest:l}=s;l instanceof UE.ASTMemberExpression?(o.push(...await(0,jt.getPropertyCompletionList)(i,l)),a=!0):l instanceof UE.ASTIndexExpression?(o.push(...await(0,jt.getPropertyCompletionList)(i,l)),a=!0):o.push(...(0,jt.getDefaultCompletionList)())}else o.push(...(0,jt.getDefaultCompletionList)()),o.push(...(0,jt.transformToCompletionItems)(i.findAllAvailableIdentifierInRoot()));if(!s||a)return o;let u=new Set([...o.map(l=>l.label)]),c=await r.getImports();for(let l of c){let{document:d}=l;if(!d)continue;let p=new HE.LookupHelper(l.textDocument,t);o.push(...(0,jt.transformToCompletionItems)(p.findAllAvailableIdentifier(d)).filter(y=>!u.has(y.label)).map(y=>(u.add(y.label),y)))}return o.push(...(0,jt.transformToCompletionItems)(i.findAllAvailableIdentifierRelatedToPosition(s.closest)).filter(l=>!u.has(l.label))),o}),t.connection.onCompletionResolve(e=>e)}jt.activate=qN});var KE=g((hH,GE)=>{"use strict";GE.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 rb=g((gH,zE)=>{var eu=KE(),VE={};for(let t of Object.keys(eu))VE[eu[t]]=t;var re={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"]}};zE.exports=re;for(let t of Object.keys(re)){if(!("channels"in re[t]))throw new Error("missing channels property: "+t);if(!("labels"in re[t]))throw new Error("missing channel labels property: "+t);if(re[t].labels.length!==re[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=re[t];delete re[t].channels,delete re[t].labels,Object.defineProperty(re[t],"channels",{value:e}),Object.defineProperty(re[t],"labels",{value:n})}re.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]};re.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),d=function(p){return(c-p)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=d(o),n=d(a),r=d(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]};re.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=re.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]};re.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 jN(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}re.rgb.keyword=function(t){let e=VE[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(eu)){let s=eu[i],o=jN(t,s);o<n&&(n=o,r=i)}return r};re.keyword.rgb=function(t){return eu[t]};re.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]};re.rgb.lab=function(t){let e=re.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]};re.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};re.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]};re.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]}};re.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]};re.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,d;switch(o){default:case 6:case 0:c=a,l=u,d=n;break;case 1:c=u,l=a,d=n;break;case 2:c=n,l=a,d=u;break;case 3:c=n,l=u,d=a;break;case 4:c=u,l=n,d=a;break;case 5:c=a,l=n,d=u;break}return[c*255,l*255,d*255]};re.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]};re.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]};re.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]};re.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]};re.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]};re.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]};re.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?re.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};re.hsv.ansi16=function(t){return re.rgb.ansi16(re.hsv.rgb(t),t[2])};re.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)};re.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]};re.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]};re.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};re.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]};re.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]};re.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]};re.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]};re.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]};re.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]};re.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]};re.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]};re.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]};re.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};re.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};re.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};re.gray.hsl=function(t){return[0,0,t[0]]};re.gray.hsv=re.gray.hsl;re.gray.hwb=function(t){return[0,100,t[0]]};re.gray.cmyk=function(t){return[0,0,0,t[0]]};re.gray.lab=function(t){return[t[0],0,0]};re.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};re.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var YE=g((mH,XE)=>{var Td=rb();function FN(){let t={},e=Object.keys(Td);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function $N(t){let e=FN(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Td[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 BN(t,e){return function(n){return e(t(n))}}function UN(t,e){let n=[e[t].parent,t],r=Td[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=BN(Td[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}XE.exports=function(t){let e=$N(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]=UN(o,e))}return n}});var QE=g((yH,JE)=>{var ib=rb(),HN=YE(),So={},WN=Object.keys(ib);function GN(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 KN(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}WN.forEach(t=>{So[t]={},Object.defineProperty(So[t],"channels",{value:ib[t].channels}),Object.defineProperty(So[t],"labels",{value:ib[t].labels});let e=HN(t);Object.keys(e).forEach(r=>{let i=e[r];So[t][r]=KN(i),So[t][r].raw=GN(i)})});JE.exports=So});var eA=g(ko=>{"use strict";var VN=ko&&ko.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ko,"__esModule",{value:!0});ko.activate=void 0;var sb=VN(QE()),zN=qe(),ZE;(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"})(ZE||(ZE={}));var ob={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},XN=()=>new RegExp(`(?:mark|color)=(${Object.keys(ob).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),YN=Object.prototype.hasOwnProperty;function JN(t){t.connection.onColorPresentation(e=>[{label:`#${sb.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===zN.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:d,lineIndex:p})=>{let y=u.index+c.indexOf("=")+1,_=y+l.length,E=d.line-1+p,L=y,M=_;return p===0&&(L+=d.character,M+=d.character),{start:{line:E,character:L},end:{line:E,character:M}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,d=c.value.toString().split(`
119
+ `);for(let p=0;p<d.length;p++){let y=d[p],_=XN(),E;for(;E=_.exec(y);){let[L,M]=E,x=a({match:E,markup:L,value:M,astPosition:l,lineIndex:p});if(M.startsWith("#")){let[k,v,F]=sb.default.hex.rgb(M.slice(1));o.push({range:x,color:{red:k/255,green:v/255,blue:F/255,alpha:1}})}else if(YN.call(ob,M)){let[k,v,F]=sb.default.hex.rgb(ob[M].slice(1));o.push({range:x,color:{red:k/255,green:v/255,blue:F/255,alpha:1}})}else o.push({range:x,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}ko.activate=JN});var tA=g(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.getRootScope=void 0;function QN(t){let e=t,n=t.scope;for(;n!=null;)e=n,n=e.scope;return e}Sd.getRootScope=QN});var nA=g(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.activate=void 0;var ZN=qe(),eq=_o(),tq=tA(),nq=async(t,e,n)=>{let r=await t.findAllAssignmentsOfItem(e,n),i=[],s=t.getRefMapForScopes();for(let o of r){if(!o.start||!o.end)continue;let a={line:o.start.line-1,character:o.start.character-1},u={line:o.end.line-1,character:o.end.character-1},c=(0,tq.getRootScope)(o);if(!c)continue;let l=s.get(c);if(!l)continue;let d={targetUri:l,targetRange:{start:a,end:u},targetSelectionRange:{start:a,end:u}};i.push(d)}return i};function rq(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new eq.LookupHelper(n,t),i=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 ZN.ASTMemberExpression&&a.identifier===o&&(u=a),await nq(r,u,u.scope)})}kd.activate=rq});var rA=g(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.activate=void 0;async function iq(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 sq(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 iq(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}xd.activate=sq});var iA=g(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.getStringHashCode=void 0;wd.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 ab=g(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.createExpressionHash=void 0;var Ed=qe(),sA=iA(),Ad=(t,e)=>t.$$hash=e,oq=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function xo(t){let e=oq(t);if(e!==null)return e;let n=(0,sA.getStringHashCode)(t.type);switch(t.type){case Ed.ASTType.ParenthesisExpression:return xo(t.expression);case Ed.ASTType.MemberExpression:{let r=t;return n^=xo(r.base),n^=xo(r.identifier),Ad(t,n)}case Ed.ASTType.IndexExpression:{let r=t;return n^=xo(r.base),n^=xo(r.index),Ad(t,n)}case Ed.ASTType.Identifier:{let r=t;return n^=(0,sA.getStringHashCode)(r.name),Ad(t,n)}}return Ad(t,n)}function aq(t){return xo(t)}Od.createExpressionHash=aq});var cb=g(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.Stack=void 0;var ub=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}};Cd.Stack=ub});var wo=g(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.Factory=fs.TokenType=void 0;var uq=cb(),cq;(function(t){t[t.Text=0]="Text",t[t.EndOfLine=1]="EndOfLine",t[t.Comment=2]="Comment"})(cq=fs.TokenType||(fs.TokenType={}));var lb=class{get tokens(){return this._tokens}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}constructor(e){this.transformer=e,this._tokens=[],this._currentDependency=null,this._currentStack=new uq.Stack}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()}};fs.Factory=lb});var fb=g(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.BeautifyContext=ps.IndentationType=void 0;var tu=qe(),Rd=wo(),oA;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(oA=ps.IndentationType||(ps.IndentationType={}));var db=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}get usedComments(){return this._usedComments}constructor(e,n){this.factory=e,this.options=n,this._indent=0,this._isMultilineAllowed=!0,this._usedComments=new Set,this.getIndent=n.indentation===oA.Tab?(r=0)=>" ".repeat(this._indent+r):(r=0)=>" ".repeat(n.indentationSpaces).repeat(this._indent+r)}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof tu.ASTIfClause||e instanceof tu.ASTWhileStatement?e.condition.end.line:e instanceof tu.ASTForGenericStatement?e.iterator.end.line:e instanceof tu.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===tu.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}containsNewLineInRange(e,n=this.factory.tokens.length){let r=Math.min(n,this.factory.tokens.length);for(let i=e;i<r;i++)if(this.factory.tokens[i].type===Rd.TokenType.EndOfLine)return!0;return!1}buildBlock(e){if(e.body.length===0)return;e.body.sort((s,o)=>s.range[0]-o.range[0]);let n=null;for(let s=0;s<e.body.length;s++){let o=e.body[s],a=n?this.getPreviousEndLine(n):this.getBlockOpenerEndLine(e),u=Math.max(o.start.line-a-1,0);if(u>0)for(let l=0;l<u;l++){let d={line:a+l+1,character:0};this.factory.tokens.push({type:Rd.TokenType.EndOfLine,value:`
120
+ `,ref:{start:d,end:d}})}let c=this.factory.tokens.length;this.factory.process(o,{isCommand:!0}),c<this.factory.tokens.length&&(this.factory.tokens[c].value=this.getIndent()+this.factory.tokens[c].value,this.factory.tokens.push({type:Rd.TokenType.EndOfLine,value:`
121
+ `,ref:{start:o.end,end:o.end}})),n=o}let r=e.body[e.body.length-1],i=Math.max(e.end.line-this.getPreviousEndLine(r)-1,0);if(i>0)for(let s=0;s<i;s++){let o={line:r.end.line+s+1,character:0};this.factory.tokens.push({type:Rd.TokenType.EndOfLine,value:`
122
+ `,ref:{start:o,end:o}})}}};ps.BeautifyContext=db});var pb=g(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.hasEmptyBody=Wt.containsMultilineItemInShortcutClauses=Wt.getLastComment=Wt.unwrap=Wt.countRightBinaryExpressions=Wt.SHORTHAND_OPERATORS=void 0;var bn=qe();Wt.SHORTHAND_OPERATORS=[bn.Operator.Plus,bn.Operator.Minus,bn.Operator.Asterik,bn.Operator.Slash,bn.Operator.Modulo,bn.Operator.Power];var lq=t=>{if(t=(0,Wt.unwrap)(t),t instanceof bn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof bn.ASTBinaryExpression&&n++,(r instanceof bn.ASTBinaryExpression||r instanceof bn.ASTLogicalExpression||r instanceof bn.ASTIsaExpression)&&(e.push((0,Wt.unwrap)(r.left)),e.push((0,Wt.unwrap)(r.right)))}return n};Wt.countRightBinaryExpressions=lq;var dq=t=>{for(;t instanceof bn.ASTParenthesisExpression;)t=t.expression;return t};Wt.unwrap=dq;var fq=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===bn.ASTType.Comment)return n}return null};Wt.getLastComment=fq;var pq=(t,e)=>e.some(n=>t.line<n.body[0].end.line);Wt.containsMultilineItemInShortcutClauses=pq;var hq=t=>!t.some(e=>!(e instanceof bn.ASTComment));Wt.hasEmptyBody=hq});var gb=g(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.BeautifyFactory=void 0;var nu=qe(),gq=require("path"),aA=ab(),uA=fb(),Xr=pb(),N=wo(),hb=class extends N.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"(",ref:o}),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:N.TokenType.Text,value:")",ref:o})},Comment:function(o,a){if(this.context.usedComments.add(o),o.isMultiline){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:N.TokenType.Comment,value:`/*${o.value}*/`,ref:o,isMultiline:!0});return}this.tokens.push({type:N.TokenType.Comment,value:o.value.split(`
123
123
  `).map(u=>`//${u}`).join(`
124
- `),ref:o,isMultiline:!0});return}this.tokens.push({type:q.TokenType.Comment,value:"// "+o.value.trimStart(),ref:o,isMultiline:!1})},AssignmentStatement:function(o,a){let u=o.variable,c=o.init;if(this.process(u),(u instanceof Za.ASTIdentifier||u instanceof Za.ASTMemberExpression)&&c instanceof Za.ASTBinaryExpression&&(c.left instanceof Za.ASTIdentifier||c.left instanceof Za.ASTMemberExpression)&&Wr.SHORTHAND_OPERATORS.includes(c.operator)&&(0,JE.createExpressionHash)(u)===(0,JE.createExpressionHash)(c.left)){this.tokens.push({type:q.TokenType.Text,value:" "+c.operator+"= ",ref:o}),this.process((0,Wr.unwrap)(c.right));return}this.tokens.push({type:q.TokenType.Text,value:" = ",ref:o}),this.process(c)},MemberExpression:function(o,a){this.process(o.base),this.tokens.push({type:q.TokenType.Text,value:o.indexer,ref:o}),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.tokens.push({type:q.TokenType.Text,value:"function",ref:{start:o.start,end:o.start}});else{this.context.disableMultiline(),this.tokens.push({type:q.TokenType.Text,value:"function(",ref:{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.tokens.push({type:q.TokenType.Text,value:", ",ref:c})}this.tokens.push({type:q.TokenType.Text,value:")",ref:{start:o.start,end:o.start}}),this.context.enableMultiline()}this.tokens.push({type:q.TokenType.EndOfLine,value:`
125
- `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"end function",ref:{start:o.end,end:o.end}})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.tokens.push({type:q.TokenType.Text,value:"{}",ref:o});return}if(o.fields.length===1){this.tokens.push({type:q.TokenType.Text,value:"{ ",ref:o}),this.process(o.fields[0]),this.tokens.push({type:q.TokenType.Text,value:" }",ref:o});return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.tokens.push({type:q.TokenType.Text,value:"{",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
126
- `,ref:{start:o.start,end:o.start}});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:c}),this.process(c),this.tokens.push({type:q.TokenType.Text,value:",",ref:c}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
127
- `,ref:c})}this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"}",ref:{start:o.end,end:o.end}});return}this.tokens.push({type:q.TokenType.Text,value:"{ ",ref:{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.tokens.push({type:q.TokenType.Text,value:", ",ref:c})}this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:" }",ref:{start:o.end,end:o.end}})},MapKeyString:function(o,a){this.process(o.key),this.tokens.push({type:q.TokenType.Text,value:": ",ref:o}),this.process(o.value)},Identifier:function(o,a){this.tokens.push({type:q.TokenType.Text,value:o.name,ref:o})},ReturnStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"return ",ref:o}),o.argument&&this.process(o.argument)},NumericLiteral:function(o,a){this.tokens.push({type:q.TokenType.Text,value:(o.negated?"-":"")+o.value.toString(),ref:o})},WhileStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"while ",ref:{start:o.start,end:o.start}}),this.context.disableMultiline(),this.process(o.condition),this.context.enableMultiline(),this.tokens.push({type:q.TokenType.EndOfLine,value:`
128
- `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"end while",ref:{start:o.end,end:o.end}})},CallExpression:function(o,a){if(this.process(o.base),o.arguments.length===0)return;if(o.arguments.length>3&&this.context.isMultilineAllowed){this.context.incIndent(),this.tokens.push({type:q.TokenType.Text,value:"(",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
129
- `,ref:{start:o.start,end:o.start}});for(let l=0;l<o.arguments.length;l++){let d=o.arguments[l];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:d}),this.process(d),l!==o.arguments.length-1&&(this.tokens.push({type:q.TokenType.Text,value:",",ref:d}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
130
- `,ref:d}))}this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:")",ref:{start:o.end,end:o.end}});return}this.tokens.push({type:q.TokenType.Text,value:"(",ref:{start:o.start,end:o.start}});let u=this.tokens.length-1;for(let l=0;l<o.arguments.length;l++){let d=o.arguments[l];this.process(d),l!==o.arguments.length-1&&this.tokens.push({type:q.TokenType.Text,value:", ",ref:d})}let c=this.context.containsNewLineInRange(u);if(o.arguments.length>1&&c){this._tokens=this._tokens.slice(0,u+1),this.context.incIndent(),this.tokens.push({type:q.TokenType.EndOfLine,value:`
131
- `,ref:{start:o.start,end:o.start}});for(let l=0;l<o.arguments.length;l++){let d=o.arguments[l];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:d}),this.process(d),l!==o.arguments.length-1&&(this.tokens.push({type:q.TokenType.Text,value:",",ref:d}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
132
- `,ref:d}))}this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:")",ref:{start:o.end,end:o.end}});return}if(a.isCommand&&!this.transformer.buildOptions.keepParentheses){this.tokens[u].value=" ";return}this.tokens.push({type:q.TokenType.Text,value:")",ref:{start:o.end,end:o.end}})},StringLiteral:function(o,a){this.tokens.push({type:q.TokenType.Text,value:o.raw.toString(),ref:{start:o.end,end:o.end}})},SliceExpression:function(o,a){this.process(o.base),this.tokens.push({type:q.TokenType.Text,value:"[",ref:o}),this.process(o.left),this.tokens.push({type:q.TokenType.Text,value:" : ",ref:o}),this.process(o.right),this.tokens.push({type:q.TokenType.Text,value:"]",ref:o})},IndexExpression:function(o,a){this.process(o.base),this.tokens.push({type:q.TokenType.Text,value:"[",ref:o}),this.process(o.index),this.tokens.push({type:q.TokenType.Text,value:"]",ref:o})},UnaryExpression:function(o,a){o.operator==="new"?this.tokens.push({type:q.TokenType.Text,value:o.operator+" ",ref:o}):this.tokens.push({type:q.TokenType.Text,value:o.operator,ref:o}),this.process(o.argument)},NegationExpression:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"not ",ref:o}),this.process(o.argument)},FeatureEnvarExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:`#envar ${o.name}`,ref:o});return}let u=this.transformer.environmentVariables.get(o.name);if(!u){this.tokens.push({type:q.TokenType.Text,value:"null",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`"${u}"`,ref: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.tokens.push({type:q.TokenType.Text,value:" ",ref:o})}},IfShortcutClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"if ",ref:o}),this.process((0,Wr.unwrap)(o.condition)),this.tokens.push({type:q.TokenType.Text,value:" then ",ref:o}),this.process(o.body[0])},ElseifShortcutClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"else if ",ref:o}),this.process((0,Wr.unwrap)(o.condition)),this.tokens.push({type:q.TokenType.Text,value:" then ",ref:o}),this.process(o.body[0])},ElseShortcutClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"else ",ref:o}),this.process(o.body[0])},NilLiteral:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"null",ref:o})},ForGenericStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"for ",ref:{start:o.start,end:o.start}}),this.process((0,Wr.unwrap)(o.variable)),this.tokens.push({type:q.TokenType.Text,value:" in ",ref:{start:o.start,end:o.start}}),this.process((0,Wr.unwrap)(o.iterator)),this.tokens.push({type:q.TokenType.EndOfLine,value:`
133
- `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"end for",ref:{start:o.end,end:o.end}})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"end if",ref:{start:o.end,end:o.end}})},IfClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"if ",ref:{start:o.start,end:o.start}}),this.process((0,Wr.unwrap)(o.condition)),this.tokens.push({type:q.TokenType.Text,value:" then",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
134
- `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"else if ",ref:{start:o.start,end:o.start}}),this.process((0,Wr.unwrap)(o.condition)),this.tokens.push({type:q.TokenType.Text,value:" then",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
135
- `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"else",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
136
- `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"continue",ref:o})},BreakStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"break",ref:o})},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:`#inject "${o.path}";`,ref:o});return}if(this.currentDependency===null){this.tokens.push({type:q.TokenType.Text,value:`#inject "${o.path}";`,ref:o});return}let u=this.currentDependency.injections.get(o.path);if(u==null){this.tokens.push({type:q.TokenType.Text,value:"null",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`"${u.replace(/"/g,'""')}"`,ref:o})},FeatureImportExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#import ",ref:o}),this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:` from "${o.path}";`,ref:o});return}if(!o.chunk){this.tokens.push({type:q.TokenType.Text,value:"#import ",ref:o}),this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:` from "${o.path}";`,ref:o});return}this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:' = __REQUIRE("'+o.namespace+'")',ref:o})},FeatureIncludeExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:`#include "${o.path}";`,ref:o});return}if(!o.chunk){this.tokens.push({type:q.TokenType.Text,value:`#include "${o.path}";`,ref:o});return}this.process(o.chunk)},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"debugger",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:"//debugger",ref:o})},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#line",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`${o.start.line}`,ref:o})},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#filename",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`"${(0,Jq.basename)(o.filename).replace(/"/g,'"')}"`,ref:o})},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.tokens.push({type:q.TokenType.Text,value:"[]",ref:o});return}if(o.fields.length===1){this.tokens.push({type:q.TokenType.Text,value:"[ ",ref:o}),this.process(o.fields[0]),this.tokens.push({type:q.TokenType.Text,value:" ]",ref:o});return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.tokens.push({type:q.TokenType.Text,value:"[",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
137
- `,ref:{start:o.start,end:o.start}});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:c}),this.process(c),this.tokens.push({type:q.TokenType.Text,value:",",ref:c}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
138
- `,ref:c})}this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"]",ref:{start:o.end,end:o.end}});return}this.tokens.push({type:q.TokenType.Text,value:"[ ",ref:o});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.tokens.push({type:q.TokenType.Text,value:", ",ref:c})}this.tokens.push({type:q.TokenType.Text,value:" ]",ref:o})},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.tokens.push({type:q.TokenType.Text,value:(o.negated?"-":"")+o.raw.toString(),ref:o})},EmptyExpression:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"",ref:o})},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:q.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,Wr.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.tokens.push({type:q.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
139
- `,ref:o}),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:o}),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:q.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.tokens.push({type:q.TokenType.Text,value:"bitOr(",ref:o}),this.process(o.left),this.tokens.push({type:q.TokenType.Text,value:", ",ref:o}),this.process(o.right),this.tokens.push({type:q.TokenType.Text,value:")",ref:o});return}else if(o.operator==="&"){this.tokens.push({type:q.TokenType.Text,value:"bitAnd(",ref:o}),this.process(o.left),this.tokens.push({type:q.TokenType.Text,value:", ",ref:o}),this.process(o.right),this.tokens.push({type:q.TokenType.Text,value:")",ref: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.tokens.push({type:q.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.tokens.push({type:q.TokenType.Text,value:o.operator,ref:o}),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.tokens.push({type:q.TokenType.Text,value:" "+o.operators[u]+" ",ref:o}),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.buildBlock(o)}};let{keepParentheses:n=!1,indentation:r=QE.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new QE.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i],o=this.tokens[i+1];if(s.type===q.TokenType.Text)r+=s.value;else if(s.type===q.TokenType.Comment)r+=s.value;else if(s.type===q.TokenType.EndOfLine){if(o?.type===q.TokenType.Comment&&s.ref.end.line===o?.ref.start.line){r+=" "+o.value.trim(),i++;continue}r+=`
140
- `}else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Ed.BeautifyFactory=sb});var ub=g(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.DefaultFactory=void 0;var Qq=require("path"),H=So(),ab=class extends H.Factory{constructor(){super(...arguments),this.handlers={ParenthesisExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"(",ref:e}),this.process(e.expression),this.tokens.push({type:H.TokenType.Text,value:")",ref:e})},Comment:function(e,n){if(e.isMultiline){this.tokens.push({type:H.TokenType.Comment,value:e.value.split(`
124
+ `),ref:o,isMultiline:!0});return}this.tokens.push({type:N.TokenType.Comment,value:"// "+o.value.trimStart(),ref:o,isMultiline:!1})},AssignmentStatement:function(o,a){let u=o.variable,c=o.init;if(this.process(u),(u instanceof nu.ASTIdentifier||u instanceof nu.ASTMemberExpression)&&c instanceof nu.ASTBinaryExpression&&(c.left instanceof nu.ASTIdentifier||c.left instanceof nu.ASTMemberExpression)&&Xr.SHORTHAND_OPERATORS.includes(c.operator)&&(0,aA.createExpressionHash)(u)===(0,aA.createExpressionHash)(c.left)){this.tokens.push({type:N.TokenType.Text,value:" "+c.operator+"= ",ref:o}),this.process((0,Xr.unwrap)(c.right));return}this.tokens.push({type:N.TokenType.Text,value:" = ",ref:o}),this.process(c)},MemberExpression:function(o,a){this.process(o.base),this.tokens.push({type:N.TokenType.Text,value:o.indexer,ref:o}),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.tokens.push({type:N.TokenType.Text,value:"function",ref:{start:o.start,end:o.start}});else{this.context.disableMultiline(),this.tokens.push({type:N.TokenType.Text,value:"function(",ref:{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.tokens.push({type:N.TokenType.Text,value:", ",ref:c})}this.tokens.push({type:N.TokenType.Text,value:")",ref:{start:o.start,end:o.start}}),this.context.enableMultiline()}this.tokens.push({type:N.TokenType.EndOfLine,value:`
125
+ `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent()+"end function",ref:{start:o.end,end:o.end}})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.tokens.push({type:N.TokenType.Text,value:"{}",ref:o});return}if(o.fields.length===1){this.tokens.push({type:N.TokenType.Text,value:"{ ",ref:o}),this.process(o.fields[0]),this.tokens.push({type:N.TokenType.Text,value:" }",ref:o});return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.tokens.push({type:N.TokenType.Text,value:"{",ref:{start:o.start,end:o.start}}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
126
+ `,ref:{start:o.start,end:o.start}});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent(),ref:c}),this.process(c),this.tokens.push({type:N.TokenType.Text,value:",",ref:c}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
127
+ `,ref:c})}this.context.decIndent(),this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent()+"}",ref:{start:o.end,end:o.end}});return}this.tokens.push({type:N.TokenType.Text,value:"{ ",ref:{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.tokens.push({type:N.TokenType.Text,value:", ",ref:c})}this.context.decIndent(),this.tokens.push({type:N.TokenType.Text,value:" }",ref:{start:o.end,end:o.end}})},MapKeyString:function(o,a){this.process(o.key),this.tokens.push({type:N.TokenType.Text,value:": ",ref:o}),this.process(o.value)},Identifier:function(o,a){this.tokens.push({type:N.TokenType.Text,value:o.name,ref:o})},ReturnStatement:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"return ",ref:o}),o.argument&&this.process(o.argument)},NumericLiteral:function(o,a){this.tokens.push({type:N.TokenType.Text,value:(o.negated?"-":"")+o.value.toString(),ref:o})},WhileStatement:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"while ",ref:{start:o.start,end:o.start}}),this.context.disableMultiline(),this.process(o.condition),this.context.enableMultiline(),this.tokens.push({type:N.TokenType.EndOfLine,value:`
128
+ `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent()+"end while",ref:{start:o.end,end:o.end}})},CallExpression:function(o,a){if(this.process(o.base),o.arguments.length===0)return;if(o.arguments.length>3&&this.context.isMultilineAllowed){this.context.incIndent(),this.tokens.push({type:N.TokenType.Text,value:"(",ref:{start:o.start,end:o.start}}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
129
+ `,ref:{start:o.start,end:o.start}});for(let l=0;l<o.arguments.length;l++){let d=o.arguments[l];this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent(),ref:d}),this.process(d),l!==o.arguments.length-1&&(this.tokens.push({type:N.TokenType.Text,value:",",ref:d}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
130
+ `,ref:d}))}this.context.decIndent(),this.tokens.push({type:N.TokenType.Text,value:")",ref:{start:o.end,end:o.end}});return}this.tokens.push({type:N.TokenType.Text,value:"(",ref:{start:o.start,end:o.start}});let u=this.tokens.length-1;for(let l=0;l<o.arguments.length;l++){let d=o.arguments[l];this.process(d),l!==o.arguments.length-1&&this.tokens.push({type:N.TokenType.Text,value:", ",ref:d})}let c=this.context.containsNewLineInRange(u);if(o.arguments.length>1&&c){this._tokens=this._tokens.slice(0,u+1),this.context.incIndent(),this.tokens.push({type:N.TokenType.EndOfLine,value:`
131
+ `,ref:{start:o.start,end:o.start}});for(let l=0;l<o.arguments.length;l++){let d=o.arguments[l];this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent(),ref:d}),this.process(d),l!==o.arguments.length-1&&(this.tokens.push({type:N.TokenType.Text,value:",",ref:d}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
132
+ `,ref:d}))}this.context.decIndent(),this.tokens.push({type:N.TokenType.Text,value:")",ref:{start:o.end,end:o.end}});return}if(a.isCommand&&!this.transformer.buildOptions.keepParentheses){this.tokens[u].value=" ";return}this.tokens.push({type:N.TokenType.Text,value:")",ref:{start:o.end,end:o.end}})},StringLiteral:function(o,a){this.tokens.push({type:N.TokenType.Text,value:o.raw.toString(),ref:{start:o.end,end:o.end}})},SliceExpression:function(o,a){this.process(o.base),this.tokens.push({type:N.TokenType.Text,value:"[",ref:o}),this.process(o.left),this.tokens.push({type:N.TokenType.Text,value:" : ",ref:o}),this.process(o.right),this.tokens.push({type:N.TokenType.Text,value:"]",ref:o})},IndexExpression:function(o,a){this.process(o.base),this.tokens.push({type:N.TokenType.Text,value:"[",ref:o}),this.process(o.index),this.tokens.push({type:N.TokenType.Text,value:"]",ref:o})},UnaryExpression:function(o,a){o.operator==="new"?this.tokens.push({type:N.TokenType.Text,value:o.operator+" ",ref:o}):this.tokens.push({type:N.TokenType.Text,value:o.operator,ref:o}),this.process(o.argument)},NegationExpression:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"not ",ref:o}),this.process(o.argument)},FeatureEnvarExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:N.TokenType.Text,value:`#envar ${o.name}`,ref:o});return}let u=this.transformer.environmentVariables.get(o.name);if(!u){this.tokens.push({type:N.TokenType.Text,value:"null",ref:o});return}this.tokens.push({type:N.TokenType.Text,value:`"${u}"`,ref: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.tokens.push({type:N.TokenType.Text,value:" ",ref:o})}},IfShortcutClause:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"if ",ref:o}),this.process((0,Xr.unwrap)(o.condition)),this.tokens.push({type:N.TokenType.Text,value:" then ",ref:o}),this.process(o.body[0])},ElseifShortcutClause:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"else if ",ref:o}),this.process((0,Xr.unwrap)(o.condition)),this.tokens.push({type:N.TokenType.Text,value:" then ",ref:o}),this.process(o.body[0])},ElseShortcutClause:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"else ",ref:o}),this.process(o.body[0])},NilLiteral:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"null",ref:o})},ForGenericStatement:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"for ",ref:{start:o.start,end:o.start}}),this.process((0,Xr.unwrap)(o.variable)),this.tokens.push({type:N.TokenType.Text,value:" in ",ref:{start:o.start,end:o.start}}),this.process((0,Xr.unwrap)(o.iterator)),this.tokens.push({type:N.TokenType.EndOfLine,value:`
133
+ `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent()+"end for",ref:{start:o.end,end:o.end}})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent()+"end if",ref:{start:o.end,end:o.end}})},IfClause:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"if ",ref:{start:o.start,end:o.start}}),this.process((0,Xr.unwrap)(o.condition)),this.tokens.push({type:N.TokenType.Text,value:" then",ref:{start:o.start,end:o.start}}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
134
+ `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent()+"else if ",ref:{start:o.start,end:o.start}}),this.process((0,Xr.unwrap)(o.condition)),this.tokens.push({type:N.TokenType.Text,value:" then",ref:{start:o.start,end:o.start}}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
135
+ `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent()+"else",ref:{start:o.start,end:o.start}}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
136
+ `,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"continue",ref:o})},BreakStatement:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"break",ref:o})},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:N.TokenType.Text,value:`#inject "${o.path}";`,ref:o});return}if(this.currentDependency===null){this.tokens.push({type:N.TokenType.Text,value:`#inject "${o.path}";`,ref:o});return}let u=this.currentDependency.injections.get(o.path);if(u==null){this.tokens.push({type:N.TokenType.Text,value:"null",ref:o});return}this.tokens.push({type:N.TokenType.Text,value:`"${u.replace(/"/g,'""')}"`,ref:o})},FeatureImportExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:N.TokenType.Text,value:"#import ",ref:o}),this.process(o.name),this.tokens.push({type:N.TokenType.Text,value:` from "${o.path}";`,ref:o});return}if(!o.chunk){this.tokens.push({type:N.TokenType.Text,value:"#import ",ref:o}),this.process(o.name),this.tokens.push({type:N.TokenType.Text,value:` from "${o.path}";`,ref:o});return}this.process(o.name),this.tokens.push({type:N.TokenType.Text,value:' = __REQUIRE("'+o.namespace+'")',ref:o})},FeatureIncludeExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:N.TokenType.Text,value:`#include "${o.path}";`,ref:o});return}if(!o.chunk){this.tokens.push({type:N.TokenType.Text,value:`#include "${o.path}";`,ref:o});return}this.process(o.chunk)},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:N.TokenType.Text,value:"debugger",ref:o});return}this.tokens.push({type:N.TokenType.Text,value:"//debugger",ref:o})},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:N.TokenType.Text,value:"#line",ref:o});return}this.tokens.push({type:N.TokenType.Text,value:`${o.start.line}`,ref:o})},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:N.TokenType.Text,value:"#filename",ref:o});return}this.tokens.push({type:N.TokenType.Text,value:`"${(0,gq.basename)(o.filename).replace(/"/g,'"')}"`,ref:o})},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.tokens.push({type:N.TokenType.Text,value:"[]",ref:o});return}if(o.fields.length===1){this.tokens.push({type:N.TokenType.Text,value:"[ ",ref:o}),this.process(o.fields[0]),this.tokens.push({type:N.TokenType.Text,value:" ]",ref:o});return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.tokens.push({type:N.TokenType.Text,value:"[",ref:{start:o.start,end:o.start}}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
137
+ `,ref:{start:o.start,end:o.start}});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent(),ref:c}),this.process(c),this.tokens.push({type:N.TokenType.Text,value:",",ref:c}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
138
+ `,ref:c})}this.context.decIndent(),this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent()+"]",ref:{start:o.end,end:o.end}});return}this.tokens.push({type:N.TokenType.Text,value:"[ ",ref:o});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.tokens.push({type:N.TokenType.Text,value:", ",ref:c})}this.tokens.push({type:N.TokenType.Text,value:" ]",ref:o})},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.tokens.push({type:N.TokenType.Text,value:(o.negated?"-":"")+o.raw.toString(),ref:o})},EmptyExpression:function(o,a){this.tokens.push({type:N.TokenType.Text,value:"",ref:o})},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:N.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,Xr.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.tokens.push({type:N.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.tokens.push({type:N.TokenType.EndOfLine,value:`
139
+ `,ref:o}),this.tokens.push({type:N.TokenType.Text,value:this.context.getIndent(),ref:o}),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:N.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.tokens.push({type:N.TokenType.Text,value:"bitOr(",ref:o}),this.process(o.left),this.tokens.push({type:N.TokenType.Text,value:", ",ref:o}),this.process(o.right),this.tokens.push({type:N.TokenType.Text,value:")",ref:o});return}else if(o.operator==="&"){this.tokens.push({type:N.TokenType.Text,value:"bitAnd(",ref:o}),this.process(o.left),this.tokens.push({type:N.TokenType.Text,value:", ",ref:o}),this.process(o.right),this.tokens.push({type:N.TokenType.Text,value:")",ref: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.tokens.push({type:N.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.tokens.push({type:N.TokenType.Text,value:o.operator,ref:o}),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.tokens.push({type:N.TokenType.Text,value:" "+o.operators[u]+" ",ref:o}),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.buildBlock(o)}};let{keepParentheses:n=!1,indentation:r=uA.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new uA.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i],o=this.tokens[i+1];if(s.type===N.TokenType.Text)r+=s.value;else if(s.type===N.TokenType.Comment)r+=s.value;else if(s.type===N.TokenType.EndOfLine){if(o?.type===N.TokenType.Comment&&s.ref.end.line===o?.ref.start.line){r+=" "+o.value.trim(),i++;continue}r+=`
140
+ `}else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Pd.BeautifyFactory=hb});var yb=g(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.DefaultFactory=void 0;var mq=require("path"),W=wo(),mb=class extends W.Factory{constructor(){super(...arguments),this.handlers={ParenthesisExpression:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"(",ref:e}),this.process(e.expression),this.tokens.push({type:W.TokenType.Text,value:")",ref:e})},Comment:function(e,n){if(e.isMultiline){this.tokens.push({type:W.TokenType.Comment,value:e.value.split(`
141
141
  `).map(r=>`//${r}`).join(`
142
- `),ref:e});return}this.tokens.push({type:H.TokenType.Comment,value:"//"+e.value,ref:e})},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.tokens.push({type:H.TokenType.Text,value:"=",ref:e}),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.tokens.push({type:H.TokenType.Text,value:e.indexer,ref:e}),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.tokens.push({type:H.TokenType.Text,value:"function",ref:{start:e.start,end:e.start}});else{this.tokens.push({type:H.TokenType.Text,value:"function(",ref:{start:e.start,end:e.start}});for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:")",ref:{start:e.start,end:e.start}})}this.tokens.push({type:H.TokenType.EndOfLine,value:`
143
- `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
144
- `,ref:{start:r.end,end:r.end}})}this.tokens.push({type:H.TokenType.Text,value:"end function",ref:{start:e.end,end:e.end}})},MapConstructorExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"{",ref:{start:e.start,end:e.start}});for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:"}",ref:{start:e.end,end:e.end}})},MapKeyString:function(e,n){this.process(e.key),this.tokens.push({type:H.TokenType.Text,value:":",ref:e}),this.process(e.value)},Identifier:function(e,n){this.tokens.push({type:H.TokenType.Text,value:e.name,ref:e})},ReturnStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"return ",ref:e}),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:(e.negated?"-":"")+e.value.toString(),ref:e})},WhileStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"while ",ref:{start:e.start,end:e.start}}),this.process(e.condition),this.tokens.push({type:H.TokenType.EndOfLine,value:`
145
- `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
146
- `,ref:{start:r.end,end:r.end}})}this.tokens.push({type:H.TokenType.Text,value:"end while",ref:{start:e.end,end:e.end}})},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.tokens.push({type:H.TokenType.Text,value:"(",ref:{start:e.start,end:e.start}});for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:")",ref:{start:e.end,end:e.end}})}},StringLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:e.raw.toString(),ref:e})},SliceExpression:function(e,n){this.process(e.base),this.tokens.push({type:H.TokenType.Text,value:"[",ref:e}),this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:":",ref:e}),this.process(e.right),this.tokens.push({type:H.TokenType.Text,value:"]",ref:e})},IndexExpression:function(e,n){this.process(e.base),this.tokens.push({type:H.TokenType.Text,value:"[",ref:e}),this.process(e.index),this.tokens.push({type:H.TokenType.Text,value:"]",ref:e})},UnaryExpression:function(e,n){e.operator==="new"?this.tokens.push({type:H.TokenType.Text,value:e.operator+" ",ref:e}):this.tokens.push({type:H.TokenType.Text,value:e.operator,ref:e}),this.process(e.argument)},NegationExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"not ",ref:e}),this.process(e.argument)},FeatureEnvarExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:`#envar ${e.name}`,ref:e});return}let r=this.transformer.environmentVariables.get(e.name);if(!r){this.tokens.push({type:H.TokenType.Text,value:"null",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`"${r}"`,ref:e})},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.tokens.push({type:H.TokenType.Text,value:" ",ref:e})}},IfShortcutClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"if ",ref:e}),this.process(e.condition),this.tokens.push({type:H.TokenType.Text,value:" then ",ref:e}),this.process(e.body[0])},ElseifShortcutClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"else if ",ref:e}),this.process(e.condition),this.tokens.push({type:H.TokenType.Text,value:" then ",ref:e}),this.process(e.body[0])},ElseShortcutClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"else ",ref:e}),this.process(e.body[0])},NilLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"null",ref:e})},ForGenericStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"for ",ref:{start:e.start,end:e.start}}),this.process(e.variable),this.tokens.push({type:H.TokenType.Text,value:" in ",ref:{start:e.start,end:e.start}}),this.process(e.iterator),this.tokens.push({type:H.TokenType.EndOfLine,value:`
147
- `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
148
- `,ref:{start:r.end,end:r.end}})}this.tokens.push({type:H.TokenType.Text,value:"end for",ref:{start:e.end,end:e.end}})},IfStatement:function(e,n){for(let r of e.clauses)this.process(r);this.tokens.push({type:H.TokenType.Text,value:"end if",ref:{start:e.end,end:e.end}})},IfClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"if ",ref:{start:e.start,end:e.start}}),this.process(e.condition),this.tokens.push({type:H.TokenType.Text,value:" then",ref:{start:e.start,end:e.start}}),this.tokens.push({type:H.TokenType.EndOfLine,value:`
149
- `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
150
- `,ref:{start:r.end,end:r.end}})}},ElseifClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"else if ",ref:{start:e.start,end:e.start}}),this.process(e.condition),this.tokens.push({type:H.TokenType.Text,value:" then",ref:{start:e.start,end:e.start}}),this.tokens.push({type:H.TokenType.EndOfLine,value:`
151
- `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
152
- `,ref:{start:r.end,end:r.end}})}},ElseClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"else",ref:{start:e.start,end:e.start}}),this.tokens.push({type:H.TokenType.EndOfLine,value:`
153
- `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
154
- `,ref:{start:r.end,end:r.end}})}},ContinueStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"continue",ref:e})},BreakStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"break",ref:e})},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:`#inject "${e.path}";`,ref:e});return}if(this.currentDependency===null){this.tokens.push({type:H.TokenType.Text,value:`#inject "${e.path}";`,ref:e});return}let r=this.currentDependency.injections.get(e.path);if(r==null){this.tokens.push({type:H.TokenType.Text,value:"null",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`"${r.replace(/"/g,'""')}"`,ref:e})},FeatureImportExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#import ",ref:e}),this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:` from "${e.path}";`,ref:e});return}if(!e.chunk){this.tokens.push({type:H.TokenType.Text,value:"#import ",ref:e}),this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:` from "${e.path}";`,ref:e});return}this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:' = __REQUIRE("'+e.namespace+'")',ref:e})},FeatureIncludeExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:`#include "${e.path}";`,ref:e});return}if(!e.chunk){this.tokens.push({type:H.TokenType.Text,value:`#include "${e.path}";`,ref:e});return}this.process(e.chunk)},FeatureDebuggerExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"debugger",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:"//debugger",ref:e})},FeatureLineExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#line",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`${e.start.line}`,ref:e})},FeatureFileExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#filename",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`"${(0,Qq.basename)(e.filename).replace(/"/g,'"')}"`,ref:e})},ListConstructorExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"[",ref:e});for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:"]",ref:e})},ListValue:function(e,n){this.process(e.value)},BooleanLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:(e.negated?"-":"")+e.raw.toString(),ref:e})},EmptyExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"",ref:e})},IsaExpression:function(e,n){this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:" "+e.operator+" ",ref:e}),this.process(e.right)},LogicalExpression:function(e,n){this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:" "+e.operator+" ",ref:e}),this.process(e.right)},BinaryExpression:function(e,n){if(e.operator==="|"){this.tokens.push({type:H.TokenType.Text,value:"bitOr(",ref:e}),this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:",",ref:e}),this.process(e.right),this.tokens.push({type:H.TokenType.Text,value:")",ref:e});return}else if(e.operator==="&"){this.tokens.push({type:H.TokenType.Text,value:"bitAnd(",ref:e}),this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:",",ref:e}),this.process(e.right),this.tokens.push({type:H.TokenType.Text,value:")",ref:e});return}else if(e.operator==="<<"||e.operator===">>"||e.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:e.operator,ref:e}),this.process(e.right)},BinaryNegatedExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:e.operator,ref:e}),this.process(e.argument)},ComparisonGroupExpression:function(e,n){this.process(e.expressions[0]);for(let r=0;r<e.operators.length;r++)this.tokens.push({type:H.TokenType.Text,value:e.operators[r],ref:e}),this.process(e.expressions[r+1])},Chunk:function(e,n){for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
155
- `,ref:{start:r.end,end:r.end}})}}}}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i];if(s.type===H.TokenType.Text||s.type===H.TokenType.Comment)r+=s.value;else if(s.type===H.TokenType.EndOfLine)r+=`
156
- `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Ad.DefaultFactory=ab});var cb=g(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.createExpressionString=void 0;var Od=qe();function eu(t){switch(t.type){case Od.ASTType.ParenthesisExpression:return eu(t.expression);case Od.ASTType.MemberExpression:{let e=t;return`${eu(e.base)}.${eu(e.identifier)}`}case Od.ASTType.IndexExpression:return`${eu(t.base)}[]`;case Od.ASTType.Identifier:return t.name}}function Zq(t){return eu(t)}Cd.createExpressionString=Zq});var db=g(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.UglifyFactory=void 0;var eN=require("path"),ZE=cb(),$=So(),lb=class extends $.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"(",ref:i}),this.process(i.expression),this.tokens.push({type:$.TokenType.Text,value:")",ref:i})},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.tokens.push({type:$.TokenType.Text,value:"=",ref:i}),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.tokens.push({type:$.TokenType.Text,value:i.indexer,ref:i});let o=(0,ZE.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.tokens.push({type:$.TokenType.Text,value:"function",ref:{start:i.start,end:i.start}});else{this.tokens.push({type:$.TokenType.Text,value:"function(",ref:{start:i.start,end:i.start}}),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.tokens.push({type:$.TokenType.Text,value:",",ref:a})}this.isWithinArgument=!1,this.tokens.push({type:$.TokenType.Text,value:")",ref:{start:i.start,end:i.start}})}this.tokens.push({type:$.TokenType.EndOfLine,value:`
142
+ `),ref:e});return}this.tokens.push({type:W.TokenType.Comment,value:"//"+e.value,ref:e})},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.tokens.push({type:W.TokenType.Text,value:"=",ref:e}),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.tokens.push({type:W.TokenType.Text,value:e.indexer,ref:e}),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.tokens.push({type:W.TokenType.Text,value:"function",ref:{start:e.start,end:e.start}});else{this.tokens.push({type:W.TokenType.Text,value:"function(",ref:{start:e.start,end:e.start}});for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.tokens.push({type:W.TokenType.Text,value:",",ref:i})}this.tokens.push({type:W.TokenType.Text,value:")",ref:{start:e.start,end:e.start}})}this.tokens.push({type:W.TokenType.EndOfLine,value:`
143
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:W.TokenType.EndOfLine,value:`
144
+ `,ref:{start:r.end,end:r.end}})}this.tokens.push({type:W.TokenType.Text,value:"end function",ref:{start:e.end,end:e.end}})},MapConstructorExpression:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"{",ref:{start:e.start,end:e.start}});for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.tokens.push({type:W.TokenType.Text,value:",",ref:i})}this.tokens.push({type:W.TokenType.Text,value:"}",ref:{start:e.end,end:e.end}})},MapKeyString:function(e,n){this.process(e.key),this.tokens.push({type:W.TokenType.Text,value:":",ref:e}),this.process(e.value)},Identifier:function(e,n){this.tokens.push({type:W.TokenType.Text,value:e.name,ref:e})},ReturnStatement:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"return ",ref:e}),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.tokens.push({type:W.TokenType.Text,value:(e.negated?"-":"")+e.value.toString(),ref:e})},WhileStatement:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"while ",ref:{start:e.start,end:e.start}}),this.process(e.condition),this.tokens.push({type:W.TokenType.EndOfLine,value:`
145
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:W.TokenType.EndOfLine,value:`
146
+ `,ref:{start:r.end,end:r.end}})}this.tokens.push({type:W.TokenType.Text,value:"end while",ref:{start:e.end,end:e.end}})},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.tokens.push({type:W.TokenType.Text,value:"(",ref:{start:e.start,end:e.start}});for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.tokens.push({type:W.TokenType.Text,value:",",ref:i})}this.tokens.push({type:W.TokenType.Text,value:")",ref:{start:e.end,end:e.end}})}},StringLiteral:function(e,n){this.tokens.push({type:W.TokenType.Text,value:e.raw.toString(),ref:e})},SliceExpression:function(e,n){this.process(e.base),this.tokens.push({type:W.TokenType.Text,value:"[",ref:e}),this.process(e.left),this.tokens.push({type:W.TokenType.Text,value:":",ref:e}),this.process(e.right),this.tokens.push({type:W.TokenType.Text,value:"]",ref:e})},IndexExpression:function(e,n){this.process(e.base),this.tokens.push({type:W.TokenType.Text,value:"[",ref:e}),this.process(e.index),this.tokens.push({type:W.TokenType.Text,value:"]",ref:e})},UnaryExpression:function(e,n){e.operator==="new"?this.tokens.push({type:W.TokenType.Text,value:e.operator+" ",ref:e}):this.tokens.push({type:W.TokenType.Text,value:e.operator,ref:e}),this.process(e.argument)},NegationExpression:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"not ",ref:e}),this.process(e.argument)},FeatureEnvarExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:W.TokenType.Text,value:`#envar ${e.name}`,ref:e});return}let r=this.transformer.environmentVariables.get(e.name);if(!r){this.tokens.push({type:W.TokenType.Text,value:"null",ref:e});return}this.tokens.push({type:W.TokenType.Text,value:`"${r}"`,ref:e})},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.tokens.push({type:W.TokenType.Text,value:" ",ref:e})}},IfShortcutClause:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"if ",ref:e}),this.process(e.condition),this.tokens.push({type:W.TokenType.Text,value:" then ",ref:e}),this.process(e.body[0])},ElseifShortcutClause:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"else if ",ref:e}),this.process(e.condition),this.tokens.push({type:W.TokenType.Text,value:" then ",ref:e}),this.process(e.body[0])},ElseShortcutClause:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"else ",ref:e}),this.process(e.body[0])},NilLiteral:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"null",ref:e})},ForGenericStatement:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"for ",ref:{start:e.start,end:e.start}}),this.process(e.variable),this.tokens.push({type:W.TokenType.Text,value:" in ",ref:{start:e.start,end:e.start}}),this.process(e.iterator),this.tokens.push({type:W.TokenType.EndOfLine,value:`
147
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:W.TokenType.EndOfLine,value:`
148
+ `,ref:{start:r.end,end:r.end}})}this.tokens.push({type:W.TokenType.Text,value:"end for",ref:{start:e.end,end:e.end}})},IfStatement:function(e,n){for(let r of e.clauses)this.process(r);this.tokens.push({type:W.TokenType.Text,value:"end if",ref:{start:e.end,end:e.end}})},IfClause:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"if ",ref:{start:e.start,end:e.start}}),this.process(e.condition),this.tokens.push({type:W.TokenType.Text,value:" then",ref:{start:e.start,end:e.start}}),this.tokens.push({type:W.TokenType.EndOfLine,value:`
149
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:W.TokenType.EndOfLine,value:`
150
+ `,ref:{start:r.end,end:r.end}})}},ElseifClause:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"else if ",ref:{start:e.start,end:e.start}}),this.process(e.condition),this.tokens.push({type:W.TokenType.Text,value:" then",ref:{start:e.start,end:e.start}}),this.tokens.push({type:W.TokenType.EndOfLine,value:`
151
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:W.TokenType.EndOfLine,value:`
152
+ `,ref:{start:r.end,end:r.end}})}},ElseClause:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"else",ref:{start:e.start,end:e.start}}),this.tokens.push({type:W.TokenType.EndOfLine,value:`
153
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:W.TokenType.EndOfLine,value:`
154
+ `,ref:{start:r.end,end:r.end}})}},ContinueStatement:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"continue",ref:e})},BreakStatement:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"break",ref:e})},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:W.TokenType.Text,value:`#inject "${e.path}";`,ref:e});return}if(this.currentDependency===null){this.tokens.push({type:W.TokenType.Text,value:`#inject "${e.path}";`,ref:e});return}let r=this.currentDependency.injections.get(e.path);if(r==null){this.tokens.push({type:W.TokenType.Text,value:"null",ref:e});return}this.tokens.push({type:W.TokenType.Text,value:`"${r.replace(/"/g,'""')}"`,ref:e})},FeatureImportExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:W.TokenType.Text,value:"#import ",ref:e}),this.process(e.name),this.tokens.push({type:W.TokenType.Text,value:` from "${e.path}";`,ref:e});return}if(!e.chunk){this.tokens.push({type:W.TokenType.Text,value:"#import ",ref:e}),this.process(e.name),this.tokens.push({type:W.TokenType.Text,value:` from "${e.path}";`,ref:e});return}this.process(e.name),this.tokens.push({type:W.TokenType.Text,value:' = __REQUIRE("'+e.namespace+'")',ref:e})},FeatureIncludeExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:W.TokenType.Text,value:`#include "${e.path}";`,ref:e});return}if(!e.chunk){this.tokens.push({type:W.TokenType.Text,value:`#include "${e.path}";`,ref:e});return}this.process(e.chunk)},FeatureDebuggerExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:W.TokenType.Text,value:"debugger",ref:e});return}this.tokens.push({type:W.TokenType.Text,value:"//debugger",ref:e})},FeatureLineExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:W.TokenType.Text,value:"#line",ref:e});return}this.tokens.push({type:W.TokenType.Text,value:`${e.start.line}`,ref:e})},FeatureFileExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:W.TokenType.Text,value:"#filename",ref:e});return}this.tokens.push({type:W.TokenType.Text,value:`"${(0,mq.basename)(e.filename).replace(/"/g,'"')}"`,ref:e})},ListConstructorExpression:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"[",ref:e});for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.tokens.push({type:W.TokenType.Text,value:",",ref:i})}this.tokens.push({type:W.TokenType.Text,value:"]",ref:e})},ListValue:function(e,n){this.process(e.value)},BooleanLiteral:function(e,n){this.tokens.push({type:W.TokenType.Text,value:(e.negated?"-":"")+e.raw.toString(),ref:e})},EmptyExpression:function(e,n){this.tokens.push({type:W.TokenType.Text,value:"",ref:e})},IsaExpression:function(e,n){this.process(e.left),this.tokens.push({type:W.TokenType.Text,value:" "+e.operator+" ",ref:e}),this.process(e.right)},LogicalExpression:function(e,n){this.process(e.left),this.tokens.push({type:W.TokenType.Text,value:" "+e.operator+" ",ref:e}),this.process(e.right)},BinaryExpression:function(e,n){if(e.operator==="|"){this.tokens.push({type:W.TokenType.Text,value:"bitOr(",ref:e}),this.process(e.left),this.tokens.push({type:W.TokenType.Text,value:",",ref:e}),this.process(e.right),this.tokens.push({type:W.TokenType.Text,value:")",ref:e});return}else if(e.operator==="&"){this.tokens.push({type:W.TokenType.Text,value:"bitAnd(",ref:e}),this.process(e.left),this.tokens.push({type:W.TokenType.Text,value:",",ref:e}),this.process(e.right),this.tokens.push({type:W.TokenType.Text,value:")",ref:e});return}else if(e.operator==="<<"||e.operator===">>"||e.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(e.left),this.tokens.push({type:W.TokenType.Text,value:e.operator,ref:e}),this.process(e.right)},BinaryNegatedExpression:function(e,n){this.tokens.push({type:W.TokenType.Text,value:e.operator,ref:e}),this.process(e.argument)},ComparisonGroupExpression:function(e,n){this.process(e.expressions[0]);for(let r=0;r<e.operators.length;r++)this.tokens.push({type:W.TokenType.Text,value:e.operators[r],ref:e}),this.process(e.expressions[r+1])},Chunk:function(e,n){for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:W.TokenType.EndOfLine,value:`
155
+ `,ref:{start:r.end,end:r.end}})}}}}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i];if(s.type===W.TokenType.Text||s.type===W.TokenType.Comment)r+=s.value;else if(s.type===W.TokenType.EndOfLine)r+=`
156
+ `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Dd.DefaultFactory=mb});var bb=g(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.createExpressionString=void 0;var Id=qe();function ru(t){switch(t.type){case Id.ASTType.ParenthesisExpression:return ru(t.expression);case Id.ASTType.MemberExpression:{let e=t;return`${ru(e.base)}.${ru(e.identifier)}`}case Id.ASTType.IndexExpression:return`${ru(t.base)}[]`;case Id.ASTType.Identifier:return t.name}}function yq(t){return ru(t)}Md.createExpressionString=yq});var _b=g(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.UglifyFactory=void 0;var bq=require("path"),cA=bb(),$=wo(),vb=class extends $.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"(",ref:i}),this.process(i.expression),this.tokens.push({type:$.TokenType.Text,value:")",ref:i})},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.tokens.push({type:$.TokenType.Text,value:"=",ref:i}),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.tokens.push({type:$.TokenType.Text,value:i.indexer,ref:i});let o=(0,cA.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.tokens.push({type:$.TokenType.Text,value:"function",ref:{start:i.start,end:i.start}});else{this.tokens.push({type:$.TokenType.Text,value:"function(",ref:{start:i.start,end:i.start}}),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.tokens.push({type:$.TokenType.Text,value:",",ref:a})}this.isWithinArgument=!1,this.tokens.push({type:$.TokenType.Text,value:")",ref:{start:i.start,end:i.start}})}this.tokens.push({type:$.TokenType.EndOfLine,value:`
157
157
  `,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:$.TokenType.EndOfLine,value:`
158
158
  `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:$.TokenType.Text,value:"end function",ref:{start:i.end,end:i.end}})},MapConstructorExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"{",ref:{start:i.start,end:i.start}});for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.tokens.push({type:$.TokenType.Text,value:",",ref:a})}this.tokens.push({type:$.TokenType.Text,value:"}",ref:{start:i.end,end:i.end}})},MapKeyString:function(i,s){this.process(i.key),this.tokens.push({type:$.TokenType.Text,value:":",ref:i}),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.tokens.push({type:$.TokenType.Text,value:o,ref:i});return}if(s.isMember){if(s.usesNativeVar){this.tokens.push({type:$.TokenType.Text,value:this.transformer.context.variables.get(o)||o,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:o,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:this.transformer.context.variables.get(o)||o,ref:i})},ReturnStatement:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"return ",ref:i}),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:$.TokenType.Text,value:(i.negated?"-":"")+i.value.toString(),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:$.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:(i.negated?"-":"")+i.value.toString(),ref:i})},WhileStatement:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"while ",ref:{start:i.start,end:i.start}}),this.process(i.condition),this.tokens.push({type:$.TokenType.EndOfLine,value:`
159
159
  `,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:$.TokenType.EndOfLine,value:`
160
- `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:$.TokenType.Text,value:"end while",ref:{start:i.end,end:i.end}})},CallExpression:function(i,s){let o=(0,ZE.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=u.value.toString(),l=this.transformer.context.variables.get(c);this.tokens.push({type:$.TokenType.Text,value:'("'+(l??c)+'")',ref:{start:i.start,end:i.start}});return}this.tokens.push({type:$.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}}),this.process(u),this.tokens.push({type:$.TokenType.Text,value:")",ref:{start:i.end,end:i.end}});return}if(i.arguments.length!==0){this.tokens.push({type:$.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}});for(let c=0;c<i.arguments.length;c++){let l=i.arguments[c];this.process(l),c!==i.arguments.length-1&&this.tokens.push({type:$.TokenType.Text,value:",",ref:l})}this.tokens.push({type:$.TokenType.Text,value:")",ref:{start:i.end,end:i.end}})}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:$.TokenType.Text,value:i.raw.toString(),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:$.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:i.raw.toString(),ref:i})},SliceExpression:function(i,s){this.process(i.base),this.tokens.push({type:$.TokenType.Text,value:"[",ref:i}),this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:":",ref:i}),this.process(i.right),this.tokens.push({type:$.TokenType.Text,value:"]",ref:i})},IndexExpression:function(i,s){this.process(i.base),this.tokens.push({type:$.TokenType.Text,value:"[",ref:i}),this.process(i.index),this.tokens.push({type:$.TokenType.Text,value:"]",ref:i})},UnaryExpression:function(i,s){i.operator==="new"?this.tokens.push({type:$.TokenType.Text,value:i.operator+" ",ref:i}):this.tokens.push({type:$.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},NegationExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"not ",ref:i}),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:`#envar ${i.name}`,ref:i});return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.tokens.push({type:$.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:`"${o}"`,ref:i})},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:"debugger",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:"//debugger",ref:i})},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:"#line",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:`${i.start.line}`,ref:i})},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:"#filename",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:`"${(0,eN.basename)(i.filename).replace(/"/g,'"')}"`,ref:i})},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.tokens.push({type:$.TokenType.Text,value:" ",ref:i})}},IfShortcutClause:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"if ",ref:i}),this.process(i.condition),this.tokens.push({type:$.TokenType.Text,value:" then ",ref:i}),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"else if ",ref:i}),this.process(i.condition),this.tokens.push({type:$.TokenType.Text,value:" then ",ref:i}),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"else ",ref:i}),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:$.TokenType.Text,value:"null",ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:$.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:"null",ref:i})},ForGenericStatement:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"for ",ref:{start:i.start,end:i.start}}),this.process(i.variable),this.tokens.push({type:$.TokenType.Text,value:" in ",ref:{start:i.start,end:i.start}}),this.process(i.iterator),this.tokens.push({type:$.TokenType.EndOfLine,value:`
160
+ `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:$.TokenType.Text,value:"end while",ref:{start:i.end,end:i.end}})},CallExpression:function(i,s){let o=(0,cA.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=u.value.toString(),l=this.transformer.context.variables.get(c);this.tokens.push({type:$.TokenType.Text,value:'("'+(l??c)+'")',ref:{start:i.start,end:i.start}});return}this.tokens.push({type:$.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}}),this.process(u),this.tokens.push({type:$.TokenType.Text,value:")",ref:{start:i.end,end:i.end}});return}if(i.arguments.length!==0){this.tokens.push({type:$.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}});for(let c=0;c<i.arguments.length;c++){let l=i.arguments[c];this.process(l),c!==i.arguments.length-1&&this.tokens.push({type:$.TokenType.Text,value:",",ref:l})}this.tokens.push({type:$.TokenType.Text,value:")",ref:{start:i.end,end:i.end}})}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:$.TokenType.Text,value:i.raw.toString(),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:$.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:i.raw.toString(),ref:i})},SliceExpression:function(i,s){this.process(i.base),this.tokens.push({type:$.TokenType.Text,value:"[",ref:i}),this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:":",ref:i}),this.process(i.right),this.tokens.push({type:$.TokenType.Text,value:"]",ref:i})},IndexExpression:function(i,s){this.process(i.base),this.tokens.push({type:$.TokenType.Text,value:"[",ref:i}),this.process(i.index),this.tokens.push({type:$.TokenType.Text,value:"]",ref:i})},UnaryExpression:function(i,s){i.operator==="new"?this.tokens.push({type:$.TokenType.Text,value:i.operator+" ",ref:i}):this.tokens.push({type:$.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},NegationExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"not ",ref:i}),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:`#envar ${i.name}`,ref:i});return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.tokens.push({type:$.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:`"${o}"`,ref:i})},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:"debugger",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:"//debugger",ref:i})},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:"#line",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:`${i.start.line}`,ref:i})},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:"#filename",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:`"${(0,bq.basename)(i.filename).replace(/"/g,'"')}"`,ref:i})},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.tokens.push({type:$.TokenType.Text,value:" ",ref:i})}},IfShortcutClause:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"if ",ref:i}),this.process(i.condition),this.tokens.push({type:$.TokenType.Text,value:" then ",ref:i}),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"else if ",ref:i}),this.process(i.condition),this.tokens.push({type:$.TokenType.Text,value:" then ",ref:i}),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"else ",ref:i}),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:$.TokenType.Text,value:"null",ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:$.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:"null",ref:i})},ForGenericStatement:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"for ",ref:{start:i.start,end:i.start}}),this.process(i.variable),this.tokens.push({type:$.TokenType.Text,value:" in ",ref:{start:i.start,end:i.start}}),this.process(i.iterator),this.tokens.push({type:$.TokenType.EndOfLine,value:`
161
161
  `,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:$.TokenType.EndOfLine,value:`
162
162
  `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:$.TokenType.Text,value:"end for",ref:{start:i.end,end:i.end}})},IfStatement:function(i,s){for(let o of i.clauses)this.process(o);this.tokens.push({type:$.TokenType.Text,value:"end if",ref:{start:i.end,end:i.end}})},IfClause:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"if ",ref:{start:i.start,end:i.start}}),this.process(i.condition),this.tokens.push({type:$.TokenType.Text,value:" then",ref:{start:i.start,end:i.start}}),this.tokens.push({type:$.TokenType.EndOfLine,value:`
163
163
  `,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:$.TokenType.EndOfLine,value:`
@@ -167,7 +167,7 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
167
167
  `,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:$.TokenType.EndOfLine,value:`
168
168
  `,ref:{start:o.end,end:o.end}})}},ContinueStatement:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"continue",ref:i})},BreakStatement:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"break",ref:i})},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}if(this.currentDependency===null){this.tokens.push({type:$.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.tokens.push({type:$.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:`"${o.replace(/"/g,'""')}"`,ref:i})},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:$.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:$.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:$.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(this.process(i.name),this.disableNamespacesOptimization){this.tokens.push({type:$.TokenType.Text,value:`=__REQUIRE("${i.namespace}")`,ref:i});return}let o=this.transformer.context.variables.get("__REQUIRE");this.tokens.push({type:$.TokenType.Text,value:`=${o}("${i.namespace}")`,ref:i})},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:$.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"[",ref:i});for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.tokens.push({type:$.TokenType.Text,value:",",ref:a})}this.tokens.push({type:$.TokenType.Text,value:"]",ref:i})},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:$.TokenType.Text,value:(i.negated?"-":"")+i.raw.toString(),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:$.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:(i.negated?"-":"")+i.raw.toString(),ref:i})},EmptyExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"",ref:i})},IsaExpression:function(i,s){this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.tokens.push({type:$.TokenType.Text,value:"bitOr(",ref:i}),this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:$.TokenType.Text,value:")",ref:i});return}else if(i.operator==="&"){this.tokens.push({type:$.TokenType.Text,value:"bitAnd(",ref:i}),this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:$.TokenType.Text,value:")",ref:i});return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:i.operator,ref:i}),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.tokens.push({type:$.TokenType.Text,value:i.operators[o],ref:i}),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:$.TokenType.EndOfLine,value:`
169
169
  `,ref:{start:o.end,end:o.end}})}}},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.isWithinArgument=!1}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i];if(s.type===$.TokenType.Text||s.type===$.TokenType.Comment)r+=s.value;else if(s.type===$.TokenType.EndOfLine)r+=`
170
- `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];return(!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0&&i.push(...n.map(s=>`${r}.${s.namespace}=${s.literal.raw}`)),i}};Rd.UglifyFactory=lb});var Dd=g(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.getFactory=ls.BuildType=void 0;var tN=ob(),nN=ub(),rN=db(),tu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(tu=ls.BuildType||(ls.BuildType={}));var iN={[tu.DEFAULT]:nN.DefaultFactory,[tu.UGLIFY]:rN.UglifyFactory,[tu.BEAUTIFY]:tN.BeautifyFactory};function sN(t=tu.DEFAULT){let e=iN[t];if(!e)throw new Error("Unknown build type.");return e}ls.getFactory=sN});var fb=g((eA,Pd)=>{(function(t){"use strict";function e(v,F){var C=(v&65535)+(F&65535),V=(v>>16)+(F>>16)+(C>>16);return V<<16|C&65535}function n(v,F){return v<<F|v>>>32-F}function r(v,F,C,V,ae,ge){return e(n(e(e(F,v),e(V,ge)),ae),C)}function i(v,F,C,V,ae,ge,G){return r(F&C|~F&V,v,F,ae,ge,G)}function s(v,F,C,V,ae,ge,G){return r(F&V|C&~V,v,F,ae,ge,G)}function o(v,F,C,V,ae,ge,G){return r(F^C^V,v,F,ae,ge,G)}function a(v,F,C,V,ae,ge,G){return r(C^(F|~V),v,F,ae,ge,G)}function u(v,F){v[F>>5]|=128<<F%32,v[(F+64>>>9<<4)+14]=F;var C,V,ae,ge,G,A=1732584193,P=-271733879,I=-1732584194,j=271733878;for(C=0;C<v.length;C+=16)V=A,ae=P,ge=I,G=j,A=i(A,P,I,j,v[C],7,-680876936),j=i(j,A,P,I,v[C+1],12,-389564586),I=i(I,j,A,P,v[C+2],17,606105819),P=i(P,I,j,A,v[C+3],22,-1044525330),A=i(A,P,I,j,v[C+4],7,-176418897),j=i(j,A,P,I,v[C+5],12,1200080426),I=i(I,j,A,P,v[C+6],17,-1473231341),P=i(P,I,j,A,v[C+7],22,-45705983),A=i(A,P,I,j,v[C+8],7,1770035416),j=i(j,A,P,I,v[C+9],12,-1958414417),I=i(I,j,A,P,v[C+10],17,-42063),P=i(P,I,j,A,v[C+11],22,-1990404162),A=i(A,P,I,j,v[C+12],7,1804603682),j=i(j,A,P,I,v[C+13],12,-40341101),I=i(I,j,A,P,v[C+14],17,-1502002290),P=i(P,I,j,A,v[C+15],22,1236535329),A=s(A,P,I,j,v[C+1],5,-165796510),j=s(j,A,P,I,v[C+6],9,-1069501632),I=s(I,j,A,P,v[C+11],14,643717713),P=s(P,I,j,A,v[C],20,-373897302),A=s(A,P,I,j,v[C+5],5,-701558691),j=s(j,A,P,I,v[C+10],9,38016083),I=s(I,j,A,P,v[C+15],14,-660478335),P=s(P,I,j,A,v[C+4],20,-405537848),A=s(A,P,I,j,v[C+9],5,568446438),j=s(j,A,P,I,v[C+14],9,-1019803690),I=s(I,j,A,P,v[C+3],14,-187363961),P=s(P,I,j,A,v[C+8],20,1163531501),A=s(A,P,I,j,v[C+13],5,-1444681467),j=s(j,A,P,I,v[C+2],9,-51403784),I=s(I,j,A,P,v[C+7],14,1735328473),P=s(P,I,j,A,v[C+12],20,-1926607734),A=o(A,P,I,j,v[C+5],4,-378558),j=o(j,A,P,I,v[C+8],11,-2022574463),I=o(I,j,A,P,v[C+11],16,1839030562),P=o(P,I,j,A,v[C+14],23,-35309556),A=o(A,P,I,j,v[C+1],4,-1530992060),j=o(j,A,P,I,v[C+4],11,1272893353),I=o(I,j,A,P,v[C+7],16,-155497632),P=o(P,I,j,A,v[C+10],23,-1094730640),A=o(A,P,I,j,v[C+13],4,681279174),j=o(j,A,P,I,v[C],11,-358537222),I=o(I,j,A,P,v[C+3],16,-722521979),P=o(P,I,j,A,v[C+6],23,76029189),A=o(A,P,I,j,v[C+9],4,-640364487),j=o(j,A,P,I,v[C+12],11,-421815835),I=o(I,j,A,P,v[C+15],16,530742520),P=o(P,I,j,A,v[C+2],23,-995338651),A=a(A,P,I,j,v[C],6,-198630844),j=a(j,A,P,I,v[C+7],10,1126891415),I=a(I,j,A,P,v[C+14],15,-1416354905),P=a(P,I,j,A,v[C+5],21,-57434055),A=a(A,P,I,j,v[C+12],6,1700485571),j=a(j,A,P,I,v[C+3],10,-1894986606),I=a(I,j,A,P,v[C+10],15,-1051523),P=a(P,I,j,A,v[C+1],21,-2054922799),A=a(A,P,I,j,v[C+8],6,1873313359),j=a(j,A,P,I,v[C+15],10,-30611744),I=a(I,j,A,P,v[C+6],15,-1560198380),P=a(P,I,j,A,v[C+13],21,1309151649),A=a(A,P,I,j,v[C+4],6,-145523070),j=a(j,A,P,I,v[C+11],10,-1120210379),I=a(I,j,A,P,v[C+2],15,718787259),P=a(P,I,j,A,v[C+9],21,-343485551),A=e(A,V),P=e(P,ae),I=e(I,ge),j=e(j,G);return[A,P,I,j]}function c(v){var F,C="",V=v.length*32;for(F=0;F<V;F+=8)C+=String.fromCharCode(v[F>>5]>>>F%32&255);return C}function l(v){var F,C=[];for(C[(v.length>>2)-1]=void 0,F=0;F<C.length;F+=1)C[F]=0;var V=v.length*8;for(F=0;F<V;F+=8)C[F>>5]|=(v.charCodeAt(F/8)&255)<<F%32;return C}function d(v){return c(u(l(v),v.length*8))}function p(v,F){var C,V=l(v),ae=[],ge=[],G;for(ae[15]=ge[15]=void 0,V.length>16&&(V=u(V,v.length*8)),C=0;C<16;C+=1)ae[C]=V[C]^909522486,ge[C]=V[C]^1549556828;return G=u(ae.concat(l(F)),512+F.length*8),c(u(ge.concat(G),640))}function y(v){var F="0123456789abcdef",C="",V,ae;for(ae=0;ae<v.length;ae+=1)V=v.charCodeAt(ae),C+=F.charAt(V>>>4&15)+F.charAt(V&15);return C}function _(v){return unescape(encodeURIComponent(v))}function E(v){return d(_(v))}function L(v){return y(E(v))}function M(v,F){return p(_(v),_(F))}function x(v,F){return y(M(v,F))}function k(v,F,C){return F?C?M(F,v):x(F,v):C?E(v):L(v)}typeof define=="function"&&define.amd?define(function(){return k}):typeof Pd=="object"&&Pd.exports?Pd.exports=k:t.md5=k})(eA)});var hb=g(ko=>{"use strict";var oN=ko&&ko.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ko,"__esModule",{value:!0});ko.LiteralsMapper=void 0;var aN=oN(fb()),pb=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=e.raw.toString();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,aN.default)(r)))}return n}get(e){let n=this,r=e.raw.toString();return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};ko.LiteralsMapper=pb});var mb=g(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.NamespaceGenerator=void 0;var gb=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}};Id.NamespaceGenerator=gb});var nu=g(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.Context=ds.ContextDataProperty=void 0;var uN=hb(),tA=mb(),cN;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(cN=ds.ContextDataProperty||(ds.ContextDataProperty={}));var yb=class{constructor(e){let n=this;n.modules=new tA.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new tA.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",...e.variablesExcluded||[]]}),n.literals=new uN.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)}};ds.Context=yb});var bb=g(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.DependencyType=void 0;var lN;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(lN=ru.DependencyType||(ru.DependencyType={}))});var Ld=g(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.BuildError=void 0;var vb=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Md.BuildError=vb});var Nd=g(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.fetchNamespaces=void 0;function dN(t){let e=new Set(t.namespaces);return t.scopes.reduce((n,r)=>(r.namespaces.forEach(i=>e.add(i)),n),e),Array.from(e)}qd.fetchNamespaces=dN});var Fd=g(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.merge=void 0;function fN(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=fN});var kb=g(Ei=>{"use strict";var _b=Ei&&Ei.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},oA=Ei&&Ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Dependency=void 0;var nA=oA(fb()),pN=oA(require("events")),rA=Br(),$d=nu(),Tb=bb(),iA=Ld(),hN=Nd(),sA=Fd(),Sb=class t extends pN.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,nA.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||Tb.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData($d.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData($d.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return _b(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get($d.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,nA.default)(c),d=o.get(l);if(a.has(d))return a.get(d);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let p=yield u.get(c);i.emit("parse-before",c);try{let _=new rA.Parser(p,{filename:c}).parseChunk(),E=new t({target:c,resourceHandler:u,chunk:_,type:n,context:s,ref:r});return i.emit("parse-after",E),E}catch(y){throw y instanceof iA.BuildError?y:new iA.BuildError(y.message,{target:c,range:y.range})}})}findInjections(){return _b(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 _b(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get($d.ContextDataProperty.DependencyCallStack),o=[...(0,hN.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let d of c){let p=d instanceof rA.ASTFeatureIncludeExpression?Tb.DependencyType.Include:Tb.DependencyType.Import,y=yield e.resolve(d.path,p,d),_=y.getNamespace();if(s.includes(_))throw new Error(`Circular dependency from ${e.target} to ${y.target} detected.`);let E=y.chunk;d.chunk=E,d.namespace=_;let L=yield y.findDependencies();(0,sA.merge)(o,L.namespaces),(0,sA.merge)(a,L.literals),u.push(y)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};Ei.Dependency=Sb});var Ud=g(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.Transformer=void 0;var xb=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)}};Bd.Transformer=xb});var Gd=g(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.generateCharsetMap=void 0;function Hd(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function gN(t=!1){let e=Hd(65,90),n=Hd(97,122),r=Hd(48,57),i="_";return t&&(i=i+Hd(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}Wd.generateCharsetMap=gN});var Eb=g(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.MAIN_BOILERPLATE=Ai.MODULE_BOILERPLATE=Ai.HEADER_BOILERPLATE=void 0;var wb=Br();Ai.HEADER_BOILERPLATE=new wb.Parser(`MODULES={}
170
+ `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];return(!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0&&i.push(...n.map(s=>`${r}.${s.namespace}=${s.literal.raw}`)),i}};Ld.UglifyFactory=vb});var Nd=g(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.getFactory=hs.BuildType=void 0;var vq=gb(),_q=yb(),Tq=_b(),iu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(iu=hs.BuildType||(hs.BuildType={}));var Sq={[iu.DEFAULT]:_q.DefaultFactory,[iu.UGLIFY]:Tq.UglifyFactory,[iu.BEAUTIFY]:vq.BeautifyFactory};function kq(t=iu.DEFAULT){let e=Sq[t];if(!e)throw new Error("Unknown build type.");return e}hs.getFactory=kq});var Tb=g((lA,qd)=>{(function(t){"use strict";function e(v,F){var C=(v&65535)+(F&65535),V=(v>>16)+(F>>16)+(C>>16);return V<<16|C&65535}function n(v,F){return v<<F|v>>>32-F}function r(v,F,C,V,ce,ye){return e(n(e(e(F,v),e(V,ye)),ce),C)}function i(v,F,C,V,ce,ye,K){return r(F&C|~F&V,v,F,ce,ye,K)}function s(v,F,C,V,ce,ye,K){return r(F&V|C&~V,v,F,ce,ye,K)}function o(v,F,C,V,ce,ye,K){return r(F^C^V,v,F,ce,ye,K)}function a(v,F,C,V,ce,ye,K){return r(C^(F|~V),v,F,ce,ye,K)}function u(v,F){v[F>>5]|=128<<F%32,v[(F+64>>>9<<4)+14]=F;var C,V,ce,ye,K,A=1732584193,D=-271733879,I=-1732584194,j=271733878;for(C=0;C<v.length;C+=16)V=A,ce=D,ye=I,K=j,A=i(A,D,I,j,v[C],7,-680876936),j=i(j,A,D,I,v[C+1],12,-389564586),I=i(I,j,A,D,v[C+2],17,606105819),D=i(D,I,j,A,v[C+3],22,-1044525330),A=i(A,D,I,j,v[C+4],7,-176418897),j=i(j,A,D,I,v[C+5],12,1200080426),I=i(I,j,A,D,v[C+6],17,-1473231341),D=i(D,I,j,A,v[C+7],22,-45705983),A=i(A,D,I,j,v[C+8],7,1770035416),j=i(j,A,D,I,v[C+9],12,-1958414417),I=i(I,j,A,D,v[C+10],17,-42063),D=i(D,I,j,A,v[C+11],22,-1990404162),A=i(A,D,I,j,v[C+12],7,1804603682),j=i(j,A,D,I,v[C+13],12,-40341101),I=i(I,j,A,D,v[C+14],17,-1502002290),D=i(D,I,j,A,v[C+15],22,1236535329),A=s(A,D,I,j,v[C+1],5,-165796510),j=s(j,A,D,I,v[C+6],9,-1069501632),I=s(I,j,A,D,v[C+11],14,643717713),D=s(D,I,j,A,v[C],20,-373897302),A=s(A,D,I,j,v[C+5],5,-701558691),j=s(j,A,D,I,v[C+10],9,38016083),I=s(I,j,A,D,v[C+15],14,-660478335),D=s(D,I,j,A,v[C+4],20,-405537848),A=s(A,D,I,j,v[C+9],5,568446438),j=s(j,A,D,I,v[C+14],9,-1019803690),I=s(I,j,A,D,v[C+3],14,-187363961),D=s(D,I,j,A,v[C+8],20,1163531501),A=s(A,D,I,j,v[C+13],5,-1444681467),j=s(j,A,D,I,v[C+2],9,-51403784),I=s(I,j,A,D,v[C+7],14,1735328473),D=s(D,I,j,A,v[C+12],20,-1926607734),A=o(A,D,I,j,v[C+5],4,-378558),j=o(j,A,D,I,v[C+8],11,-2022574463),I=o(I,j,A,D,v[C+11],16,1839030562),D=o(D,I,j,A,v[C+14],23,-35309556),A=o(A,D,I,j,v[C+1],4,-1530992060),j=o(j,A,D,I,v[C+4],11,1272893353),I=o(I,j,A,D,v[C+7],16,-155497632),D=o(D,I,j,A,v[C+10],23,-1094730640),A=o(A,D,I,j,v[C+13],4,681279174),j=o(j,A,D,I,v[C],11,-358537222),I=o(I,j,A,D,v[C+3],16,-722521979),D=o(D,I,j,A,v[C+6],23,76029189),A=o(A,D,I,j,v[C+9],4,-640364487),j=o(j,A,D,I,v[C+12],11,-421815835),I=o(I,j,A,D,v[C+15],16,530742520),D=o(D,I,j,A,v[C+2],23,-995338651),A=a(A,D,I,j,v[C],6,-198630844),j=a(j,A,D,I,v[C+7],10,1126891415),I=a(I,j,A,D,v[C+14],15,-1416354905),D=a(D,I,j,A,v[C+5],21,-57434055),A=a(A,D,I,j,v[C+12],6,1700485571),j=a(j,A,D,I,v[C+3],10,-1894986606),I=a(I,j,A,D,v[C+10],15,-1051523),D=a(D,I,j,A,v[C+1],21,-2054922799),A=a(A,D,I,j,v[C+8],6,1873313359),j=a(j,A,D,I,v[C+15],10,-30611744),I=a(I,j,A,D,v[C+6],15,-1560198380),D=a(D,I,j,A,v[C+13],21,1309151649),A=a(A,D,I,j,v[C+4],6,-145523070),j=a(j,A,D,I,v[C+11],10,-1120210379),I=a(I,j,A,D,v[C+2],15,718787259),D=a(D,I,j,A,v[C+9],21,-343485551),A=e(A,V),D=e(D,ce),I=e(I,ye),j=e(j,K);return[A,D,I,j]}function c(v){var F,C="",V=v.length*32;for(F=0;F<V;F+=8)C+=String.fromCharCode(v[F>>5]>>>F%32&255);return C}function l(v){var F,C=[];for(C[(v.length>>2)-1]=void 0,F=0;F<C.length;F+=1)C[F]=0;var V=v.length*8;for(F=0;F<V;F+=8)C[F>>5]|=(v.charCodeAt(F/8)&255)<<F%32;return C}function d(v){return c(u(l(v),v.length*8))}function p(v,F){var C,V=l(v),ce=[],ye=[],K;for(ce[15]=ye[15]=void 0,V.length>16&&(V=u(V,v.length*8)),C=0;C<16;C+=1)ce[C]=V[C]^909522486,ye[C]=V[C]^1549556828;return K=u(ce.concat(l(F)),512+F.length*8),c(u(ye.concat(K),640))}function y(v){var F="0123456789abcdef",C="",V,ce;for(ce=0;ce<v.length;ce+=1)V=v.charCodeAt(ce),C+=F.charAt(V>>>4&15)+F.charAt(V&15);return C}function _(v){return unescape(encodeURIComponent(v))}function E(v){return d(_(v))}function L(v){return y(E(v))}function M(v,F){return p(_(v),_(F))}function x(v,F){return y(M(v,F))}function k(v,F,C){return F?C?M(F,v):x(F,v):C?E(v):L(v)}typeof define=="function"&&define.amd?define(function(){return k}):typeof qd=="object"&&qd.exports?qd.exports=k:t.md5=k})(lA)});var kb=g(Eo=>{"use strict";var xq=Eo&&Eo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.LiteralsMapper=void 0;var wq=xq(Tb()),Sb=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=e.raw.toString();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,wq.default)(r)))}return n}get(e){let n=this,r=e.raw.toString();return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};Eo.LiteralsMapper=Sb});var wb=g(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.NamespaceGenerator=void 0;var xb=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}};jd.NamespaceGenerator=xb});var su=g(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.Context=gs.ContextDataProperty=void 0;var Eq=kb(),dA=wb(),Aq;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(Aq=gs.ContextDataProperty||(gs.ContextDataProperty={}));var Eb=class{constructor(e){let n=this;n.modules=new dA.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new dA.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",...e.variablesExcluded||[]]}),n.literals=new Eq.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)}};gs.Context=Eb});var Ab=g(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.DependencyType=void 0;var Oq;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(Oq=ou.DependencyType||(ou.DependencyType={}))});var $d=g(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.BuildError=void 0;var Ob=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Fd.BuildError=Ob});var Ud=g(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.fetchNamespaces=void 0;function Cq(t){let e=new Set(t.namespaces);return t.scopes.reduce((n,r)=>(r.namespaces.forEach(i=>e.add(i)),n),e),Array.from(e)}Bd.fetchNamespaces=Cq});var Wd=g(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.merge=void 0;function Rq(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))}Hd.merge=Rq});var Db=g(Ri=>{"use strict";var Cb=Ri&&Ri.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},mA=Ri&&Ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.Dependency=void 0;var fA=mA(Tb()),Pq=mA(require("events")),pA=Or(),Gd=su(),Rb=Ab(),hA=$d(),Dq=Ud(),gA=Wd(),Pb=class t extends Pq.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,fA.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||Rb.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(Gd.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(Gd.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return Cb(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(Gd.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,fA.default)(c),d=o.get(l);if(a.has(d))return a.get(d);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let p=yield u.get(c);i.emit("parse-before",c);try{let _=new pA.Parser(p,{filename:c}).parseChunk(),E=new t({target:c,resourceHandler:u,chunk:_,type:n,context:s,ref:r});return i.emit("parse-after",E),E}catch(y){throw y instanceof hA.BuildError?y:new hA.BuildError(y.message,{target:c,range:y.range})}})}findInjections(){return Cb(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 Cb(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(Gd.ContextDataProperty.DependencyCallStack),o=[...(0,Dq.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let d of c){let p=d instanceof pA.ASTFeatureIncludeExpression?Rb.DependencyType.Include:Rb.DependencyType.Import,y=yield e.resolve(d.path,p,d),_=y.getNamespace();if(s.includes(_))throw new Error(`Circular dependency from ${e.target} to ${y.target} detected.`);let E=y.chunk;d.chunk=E,d.namespace=_;let L=yield y.findDependencies();(0,gA.merge)(o,L.namespaces),(0,gA.merge)(a,L.literals),u.push(y)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};Ri.Dependency=Pb});var Vd=g(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.Transformer=void 0;var Ib=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)}};Kd.Transformer=Ib});var Yd=g(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.generateCharsetMap=void 0;function zd(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function Iq(t=!1){let e=zd(65,90),n=zd(97,122),r=zd(48,57),i="_";return t&&(i=i+zd(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}Xd.generateCharsetMap=Iq});var Lb=g(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.MAIN_BOILERPLATE=Pi.MODULE_BOILERPLATE=Pi.HEADER_BOILERPLATE=void 0;var Mb=Or();Pi.HEADER_BOILERPLATE=new Mb.Parser(`MODULES={}
171
171
  EXPORTED={}
172
172
  __REQUIRE=function(r)
173
173
  if (not MODULES.hasIndex(r)) then
@@ -176,7 +176,7 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
176
176
  end if
177
177
  module=@MODULES[r]
178
178
  return @module(r).exports
179
- end function`).parseChunk();Ai.MODULE_BOILERPLATE=new wb.Parser(`MODULES["$0"]=function(r)
179
+ end function`).parseChunk();Pi.MODULE_BOILERPLATE=new Mb.Parser(`MODULES["$0"]=function(r)
180
180
  module={}
181
181
  if (EXPORTED.hasIndex(r)) then
182
182
  module=EXPORTED[r]
@@ -186,11 +186,11 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
186
186
  end if
187
187
  EXPORTED[r]=module
188
188
  return EXPORTED[r]
189
- end function`).parseChunk();Ai.MAIN_BOILERPLATE=new wb.Parser('"$0"').parseChunk()});var Kd=g(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.OutputProcessor=void 0;var aA=Eb(),mN=Fd(),Ab=class{constructor(e,n,{header:r=aA.HEADER_BOILERPLATE,main:i=aA.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,mN.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(`
190
- `)}};Vd.OutputProcessor=Ab});var cA=g(xo=>{"use strict";var yN=xo&&xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xo,"__esModule",{value:!0});xo.DirectTranspiler=void 0;var bN=yN(require("events")),vN=Br(),uA=Dd(),_N=nu(),TN=Ud(),SN=Gd(),kN=Nd(),xN=Kd(),wN=Object.prototype.hasOwnProperty,Ob=class extends bN.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=wN.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||uA.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,uA.getFactory)(e.buildType),i=new vN.Parser(e.code).parseChunk(),s=(0,kN.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,SN.generateCharsetMap)(e.obfuscation),u=new _N.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(y=>u.variables.createNamespace(y)),o.forEach(y=>u.literals.add(y));let l=new TN.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),d=new xN.OutputProcessor(u,l);d.addOptimizations();let p=l.transform(i);return d.addCode(p),d.build()}};xo.DirectTranspiler=Ob});var Rb=g(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.ResourceProvider=void 0;var Cb=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))}}};zd.ResourceProvider=Cb});var Pb=g(Oi=>{"use strict";var EN=Oi&&Oi.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},AN=Oi&&Oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.Target=void 0;var ON=AN(require("events")),CN=Br(),RN=kb(),lA=Ld(),Db=class extends ON.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return EN(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 CN.Parser(s,{filename:r}).parseChunk(),u=new RN.Dependency({target:r,resourceHandler:n,chunk:a,context:i}),{namespaces:c,literals:l}=yield u.findDependencies(),d=new Set(c);for(let p of d)i.variables.createNamespace(p);for(let p of l)i.literals.add(p);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof lA.BuildError?o:new lA.BuildError(o.message,{target:this.target,range:o.range})}})}};Oi.Target=Db});var fA=g(wo=>{"use strict";var DN=wo&&wo.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(wo,"__esModule",{value:!0});wo.Transpiler=void 0;var PN=Mb(),IN=Eb(),dA=Dd(),MN=nu(),LN=Rb(),qN=Pb(),NN=Ud(),jN=Gd(),FN=Kd(),$N=Object.prototype.hasOwnProperty,Ib=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new LN.ResourceProvider().getHandler(),n.obfuscation=$N.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,jN.generateCharsetMap)(n.obfuscation);n.context=new MN.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||dA.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return DN(this,void 0,void 0,function*(){let e=this,n=(0,dA.getFactory)(e.buildType),r=e.context,s=yield new qN.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new NN.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(IN.MODULE_BOILERPLATE),c=l=>{let d=r.modules.get(l.getId()),p={},y=0,_=function(M){let x=M.getNamespace();if(!(x in p)){if(x!==d&&M.type===PN.DependencyType.Import){let k=o.transform(M.chunk,M);p[x]=u.replace('"$0"','"'+x+'"').replace('"$1"',k),y++}for(let k of M.dependencies)_(k)}};_(l);let E=new FN.OutputProcessor(r,o);E.addOptimizations(),y>0&&E.addHeader(),Object.keys(p).forEach(M=>E.addCode(p[M]));let L=o.transform(l.chunk,l);return E.addCode(L,!0),E.build()};return{[e.target]:c(a.dependency)}})}};wo.Transpiler=Ib});var pA=g(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.unwrap=void 0;var BN=qe();function UN(t){for(;t instanceof BN.ASTParenthesisExpression;)t=t.expression;return t}Xd.unwrap=UN});var Mb=g(J=>{"use strict";var hA=J&&J.__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]}),HN=J&&J.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WN=J&&J.__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)&&hA(e,t,n);return HN(e,t),e},GN=J&&J.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&hA(e,t,n)};Object.defineProperty(J,"__esModule",{value:!0});J.merge=J.unwrap=J.Stack=J.OutputProcessor=J.NamespaceGenerator=J.LiteralsMapper=J.fetchNamespaces=J.BuildError=J.createExpressionString=J.createExpressionHash=J.generateCharsetMap=J.DependencyType=J.Transpiler=J.Transformer=J.Target=J.DirectTranspiler=J.Dependency=J.ContextDataProperty=J.Context=J.UglifyFactory=J.TokenType=J.Factory=J.DefaultFactory=J.BeautifyUtils=J.BeautifyContext=J.BeautifyFactory=J.getFactory=J.BuildType=void 0;var gA=Dd();Object.defineProperty(J,"BuildType",{enumerable:!0,get:function(){return gA.BuildType}});Object.defineProperty(J,"getFactory",{enumerable:!0,get:function(){return gA.getFactory}});var VN=ob();Object.defineProperty(J,"BeautifyFactory",{enumerable:!0,get:function(){return VN.BeautifyFactory}});var KN=rb();Object.defineProperty(J,"BeautifyContext",{enumerable:!0,get:function(){return KN.BeautifyContext}});J.BeautifyUtils=WN(ib());var zN=ub();Object.defineProperty(J,"DefaultFactory",{enumerable:!0,get:function(){return zN.DefaultFactory}});var mA=So();Object.defineProperty(J,"Factory",{enumerable:!0,get:function(){return mA.Factory}});Object.defineProperty(J,"TokenType",{enumerable:!0,get:function(){return mA.TokenType}});var XN=db();Object.defineProperty(J,"UglifyFactory",{enumerable:!0,get:function(){return XN.UglifyFactory}});var yA=nu();Object.defineProperty(J,"Context",{enumerable:!0,get:function(){return yA.Context}});Object.defineProperty(J,"ContextDataProperty",{enumerable:!0,get:function(){return yA.ContextDataProperty}});var YN=kb();Object.defineProperty(J,"Dependency",{enumerable:!0,get:function(){return YN.Dependency}});var JN=cA();Object.defineProperty(J,"DirectTranspiler",{enumerable:!0,get:function(){return JN.DirectTranspiler}});GN(Rb(),J);var QN=Pb();Object.defineProperty(J,"Target",{enumerable:!0,get:function(){return QN.Target}});var ZN=Ud();Object.defineProperty(J,"Transformer",{enumerable:!0,get:function(){return ZN.Transformer}});var ej=fA();Object.defineProperty(J,"Transpiler",{enumerable:!0,get:function(){return ej.Transpiler}});var tj=bb();Object.defineProperty(J,"DependencyType",{enumerable:!0,get:function(){return tj.DependencyType}});var nj=Gd();Object.defineProperty(J,"generateCharsetMap",{enumerable:!0,get:function(){return nj.generateCharsetMap}});var rj=Qy();Object.defineProperty(J,"createExpressionHash",{enumerable:!0,get:function(){return rj.createExpressionHash}});var ij=cb();Object.defineProperty(J,"createExpressionString",{enumerable:!0,get:function(){return ij.createExpressionString}});var sj=Ld();Object.defineProperty(J,"BuildError",{enumerable:!0,get:function(){return sj.BuildError}});var oj=Nd();Object.defineProperty(J,"fetchNamespaces",{enumerable:!0,get:function(){return oj.fetchNamespaces}});var aj=hb();Object.defineProperty(J,"LiteralsMapper",{enumerable:!0,get:function(){return aj.LiteralsMapper}});var uj=mb();Object.defineProperty(J,"NamespaceGenerator",{enumerable:!0,get:function(){return uj.NamespaceGenerator}});var cj=Kd();Object.defineProperty(J,"OutputProcessor",{enumerable:!0,get:function(){return cj.OutputProcessor}});var lj=eb();Object.defineProperty(J,"Stack",{enumerable:!0,get:function(){return lj.Stack}});var dj=pA();Object.defineProperty(J,"unwrap",{enumerable:!0,get:function(){return dj.unwrap}});var fj=Fd();Object.defineProperty(J,"merge",{enumerable:!0,get:function(){return fj.merge}})});var vA=g(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.activate=void 0;var bA=Mb();function pj(t){async function e(n){try{let r=t.getConfiguration();return new bA.DirectTranspiler({code:n,buildType:bA.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}]})}Yd.activate=pj});var Jd=g((iu,Lb)=>{(function(t,e){if(typeof iu=="object"&&typeof Lb=="object")Lb.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof iu=="object"?iu:t)[r]=n[r]}})(iu,()=>(()=>{"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,d="",p=0,y=-1,_=0,E=0;E<=u.length;++E){if(E<u.length)l=u.charCodeAt(E);else{if(l===47)break;l=47}if(l===47){if(!(y===E-1||_===1))if(y!==E-1&&_===2){if(d.length<2||p!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var L=d.lastIndexOf("/");if(L!==d.length-1){L===-1?(d="",p=0):p=(d=d.slice(0,L)).length-1-d.lastIndexOf("/"),y=E,_=0;continue}}else if(d.length===2||d.length===1){d="",p=0,y=E,_=0;continue}}c&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+u.slice(y+1,E):d=u.slice(y+1,E),p=E-y-1;y=E,_=0}else l===46&&_!==-1?++_:_=-1}return d}var a={resolve:function(){for(var u,c="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),s(p),p.length!==0&&(c=p+"/"+c,l=p.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 d=u.length,p=d-l,y=1;y<c.length&&c.charCodeAt(y)===47;++y);for(var _=c.length-y,E=p<_?p:_,L=-1,M=0;M<=E;++M){if(M===E){if(_>E){if(c.charCodeAt(y+M)===47)return c.slice(y+M+1);if(M===0)return c.slice(y+M)}else p>E&&(u.charCodeAt(l+M)===47?L=M:M===0&&(L=0));break}var x=u.charCodeAt(l+M);if(x!==c.charCodeAt(y+M))break;x===47&&(L=M)}var k="";for(M=l+L+1;M<=d;++M)M!==d&&u.charCodeAt(M)!==47||(k.length===0?k+="..":k+="/..");return k.length>0?k+c.slice(y+L):(y+=L,c.charCodeAt(y)===47&&++y,c.slice(y))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,d=-1,p=!0,y=u.length-1;y>=1;--y)if((c=u.charCodeAt(y))===47){if(!p){d=y;break}}else p=!1;return d===-1?l?"/":".":l&&d===1?"//":u.slice(0,d)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,d=0,p=-1,y=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var _=c.length-1,E=-1;for(l=u.length-1;l>=0;--l){var L=u.charCodeAt(l);if(L===47){if(!y){d=l+1;break}}else E===-1&&(y=!1,E=l+1),_>=0&&(L===c.charCodeAt(_)?--_==-1&&(p=l):(_=-1,p=E))}return d===p?p=E:p===-1&&(p=u.length),u.slice(d,p)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!y){d=l+1;break}}else p===-1&&(y=!1,p=l+1);return p===-1?"":u.slice(d,p)},extname:function(u){s(u);for(var c=-1,l=0,d=-1,p=!0,y=0,_=u.length-1;_>=0;--_){var E=u.charCodeAt(_);if(E!==47)d===-1&&(p=!1,d=_+1),E===46?c===-1?c=_:y!==1&&(y=1):c!==-1&&(y=-1);else if(!p){l=_+1;break}}return c===-1||d===-1||y===0||y===1&&c===d-1&&c===l+1?"":u.slice(c,d)},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 d=l.dir||l.root,p=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+p:d+"/"+p:p}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,d=u.charCodeAt(0),p=d===47;p?(c.root="/",l=1):l=0;for(var y=-1,_=0,E=-1,L=!0,M=u.length-1,x=0;M>=l;--M)if((d=u.charCodeAt(M))!==47)E===-1&&(L=!1,E=M+1),d===46?y===-1?y=M:x!==1&&(x=1):y!==-1&&(x=-1);else if(!L){_=M+1;break}return y===-1||E===-1||x===0||x===1&&y===E-1&&y===_+1?E!==-1&&(c.base=c.name=_===0&&p?u.slice(1,E):u.slice(_,E)):(_===0&&p?(c.name=u.slice(1,y),c.base=u.slice(1,E)):(c.name=u.slice(_,y),c.base=u.slice(_,E)),c.ext=u.slice(y,E)),_>0?c.dir=u.slice(0,_-1):p&&(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 d(G,A){if(!G.scheme&&A)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${G.authority}", path: "${G.path}", query: "${G.query}", fragment: "${G.fragment}"}`);if(G.scheme&&!u.test(G.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(G.path){if(G.authority){if(!c.test(G.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(G.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let p="",y="/",_=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class E{static isUri(A){return A instanceof E||!!A&&typeof A.authority=="string"&&typeof A.fragment=="string"&&typeof A.path=="string"&&typeof A.query=="string"&&typeof A.scheme=="string"&&typeof A.fsPath=="string"&&typeof A.with=="function"&&typeof A.toString=="function"}scheme;authority;path;query;fragment;constructor(A,P,I,j,fe,le=!1){typeof A=="object"?(this.scheme=A.scheme||p,this.authority=A.authority||p,this.path=A.path||p,this.query=A.query||p,this.fragment=A.fragment||p):(this.scheme=function(Rt,ht){return Rt||ht?Rt:"file"}(A,le),this.authority=P||p,this.path=function(Rt,ht){switch(Rt){case"https":case"http":case"file":ht?ht[0]!==y&&(ht=y+ht):ht=y}return ht}(this.scheme,I||p),this.query=j||p,this.fragment=fe||p,d(this,le))}get fsPath(){return F(this,!1)}with(A){if(!A)return this;let{scheme:P,authority:I,path:j,query:fe,fragment:le}=A;return P===void 0?P=this.scheme:P===null&&(P=p),I===void 0?I=this.authority:I===null&&(I=p),j===void 0?j=this.path:j===null&&(j=p),fe===void 0?fe=this.query:fe===null&&(fe=p),le===void 0?le=this.fragment:le===null&&(le=p),P===this.scheme&&I===this.authority&&j===this.path&&fe===this.query&&le===this.fragment?this:new M(P,I,j,fe,le)}static parse(A,P=!1){let I=_.exec(A);return I?new M(I[2]||p,ge(I[4]||p),ge(I[5]||p),ge(I[7]||p),ge(I[9]||p),P):new M(p,p,p,p,p)}static file(A){let P=p;if(a.isWindows&&(A=A.replace(/\\/g,y)),A[0]===y&&A[1]===y){let I=A.indexOf(y,2);I===-1?(P=A.substring(2),A=y):(P=A.substring(2,I),A=A.substring(I)||y)}return new M("file",P,A,p,p)}static from(A){let P=new M(A.scheme,A.authority,A.path,A.query,A.fragment);return d(P,!0),P}toString(A=!1){return C(this,A)}toJSON(){return this}static revive(A){if(A){if(A instanceof E)return A;{let P=new M(A);return P._formatted=A.external,P._fsPath=A._sep===L?A.fsPath:null,P}}return A}}s.URI=E;let L=a.isWindows?1:void 0;class M extends E{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=F(this,!1)),this._fsPath}toString(A=!1){return A?C(this,!0):(this._formatted||(this._formatted=C(this,!1)),this._formatted)}toJSON(){let A={$mid:1};return this._fsPath&&(A.fsPath=this._fsPath,A._sep=L),this._formatted&&(A.external=this._formatted),this.path&&(A.path=this.path),this.scheme&&(A.scheme=this.scheme),this.authority&&(A.authority=this.authority),this.query&&(A.query=this.query),this.fragment&&(A.fragment=this.fragment),A}}let x={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 k(G,A,P){let I,j=-1;for(let fe=0;fe<G.length;fe++){let le=G.charCodeAt(fe);if(le>=97&&le<=122||le>=65&&le<=90||le>=48&&le<=57||le===45||le===46||le===95||le===126||A&&le===47||P&&le===91||P&&le===93||P&&le===58)j!==-1&&(I+=encodeURIComponent(G.substring(j,fe)),j=-1),I!==void 0&&(I+=G.charAt(fe));else{I===void 0&&(I=G.substr(0,fe));let Rt=x[le];Rt!==void 0?(j!==-1&&(I+=encodeURIComponent(G.substring(j,fe)),j=-1),I+=Rt):j===-1&&(j=fe)}}return j!==-1&&(I+=encodeURIComponent(G.substring(j))),I!==void 0?I:G}function v(G){let A;for(let P=0;P<G.length;P++){let I=G.charCodeAt(P);I===35||I===63?(A===void 0&&(A=G.substr(0,P)),A+=x[I]):A!==void 0&&(A+=G[P])}return A!==void 0?A:G}function F(G,A){let P;return P=G.authority&&G.path.length>1&&G.scheme==="file"?`//${G.authority}${G.path}`:G.path.charCodeAt(0)===47&&(G.path.charCodeAt(1)>=65&&G.path.charCodeAt(1)<=90||G.path.charCodeAt(1)>=97&&G.path.charCodeAt(1)<=122)&&G.path.charCodeAt(2)===58?A?G.path.substr(1):G.path[1].toLowerCase()+G.path.substr(2):G.path,a.isWindows&&(P=P.replace(/\//g,"\\")),P}function C(G,A){let P=A?v:k,I="",{scheme:j,authority:fe,path:le,query:Rt,fragment:ht}=G;if(j&&(I+=j,I+=":"),(fe||j==="file")&&(I+=y,I+=y),fe){let je=fe.indexOf("@");if(je!==-1){let on=fe.substr(0,je);fe=fe.substr(je+1),je=on.lastIndexOf(":"),je===-1?I+=P(on,!1,!1):(I+=P(on.substr(0,je),!1,!1),I+=":",I+=P(on.substr(je+1),!1,!0)),I+="@"}fe=fe.toLowerCase(),je=fe.lastIndexOf(":"),je===-1?I+=P(fe,!1,!0):(I+=P(fe.substr(0,je),!1,!0),I+=fe.substr(je))}if(le){if(le.length>=3&&le.charCodeAt(0)===47&&le.charCodeAt(2)===58){let je=le.charCodeAt(1);je>=65&&je<=90&&(le=`/${String.fromCharCode(je+32)}:${le.substr(3)}`)}else if(le.length>=2&&le.charCodeAt(1)===58){let je=le.charCodeAt(0);je>=65&&je<=90&&(le=`${String.fromCharCode(je+32)}:${le.substr(2)}`)}I+=P(le,!0,!1)}return Rt&&(I+="?",I+=P(Rt,!1,!1)),ht&&(I+="#",I+=A?ht:k(ht,!1,!1)),I}function V(G){try{return decodeURIComponent(G)}catch{return G.length>3?G.substr(0,3)+V(G.substr(3)):G}}s.uriToFsPath=F;let ae=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ge(G){return G.match(ae)?G.replace(ae,A=>V(A)):G}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(_,E,L,M){M===void 0&&(M=L);var x=Object.getOwnPropertyDescriptor(E,L);x&&!("get"in x?!E.__esModule:x.writable||x.configurable)||(x={enumerable:!0,get:function(){return E[L]}}),Object.defineProperty(_,M,x)}:function(_,E,L,M){M===void 0&&(M=L),_[M]=E[L]}),u=this&&this.__setModuleDefault||(Object.create?function(_,E){Object.defineProperty(_,"default",{enumerable:!0,value:E})}:function(_,E){_.default=E}),c=this&&this.__importStar||function(_){if(_&&_.__esModule)return _;var E={};if(_!=null)for(var L in _)L!=="default"&&Object.prototype.hasOwnProperty.call(_,L)&&a(E,_,L);return u(E,_),E};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),d=l.posix||l,p="/";var y;(function(_){_.joinPath=function(E,...L){return E.with({path:d.join(E.path,...L)})},_.resolvePath=function(E,...L){let M=E.path,x=!1;M[0]!==p&&(M=p+M,x=!0);let k=d.resolve(M,...L);return x&&k[0]===p&&!E.authority&&(k=k.substring(1)),E.with({path:k})},_.dirname=function(E){if(E.path.length===0||E.path===p)return E;let L=d.dirname(E.path);return L.length===1&&L.charCodeAt(0)===46&&(L=""),E.with({path:L})},_.basename=function(E){return d.basename(E.path)},_.extname=function(E){return d.extname(E.path)}})(y||(s.Utils=y={}))}},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 Zd=g(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.MarkdownString=void 0;var qb=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+=`
191
- `,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};Qd.MarkdownString=qb});var ef=g(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.createHover=vt.createSignatureInfo=vt.appendTooltipBody=vt.appendTooltipHeader=vt.createTooltipHeader=vt.formatDefaultValue=vt.formatTypes=void 0;var _A=$s(),TA=Zd();function Nb(t){return t==null?"":t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}vt.formatTypes=Nb;function SA(t){return typeof t=="string"?`"${t}"`:t.toString()}vt.formatDefaultValue=SA;var hj=(t,e)=>{let n=e.getArguments()||[],r=Nb(e.getReturns())||"null";if(n.length===0)return`(${t.kind}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${Nb(s.getTypes())}${s.getDefault()?` = ${SA(s.getDefault().value)}`:""}`).join(", ");return`(${t.kind}) ${t.label} (${i}): ${r}`};vt.createTooltipHeader=hj;var gj=(t,e,n)=>{t.appendCodeblock(_A.LanguageId,(0,vt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
192
- `)};vt.appendTooltipHeader=gj;var mj=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
189
+ end function`).parseChunk();Pi.MAIN_BOILERPLATE=new Mb.Parser('"$0"').parseChunk()});var Qd=g(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.OutputProcessor=void 0;var yA=Lb(),Mq=Wd(),Nb=class{constructor(e,n,{header:r=yA.HEADER_BOILERPLATE,main:i=yA.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,Mq.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(`
190
+ `)}};Jd.OutputProcessor=Nb});var vA=g(Ao=>{"use strict";var Lq=Ao&&Ao.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.DirectTranspiler=void 0;var Nq=Lq(require("events")),qq=Or(),bA=Nd(),jq=su(),Fq=Vd(),$q=Yd(),Bq=Ud(),Uq=Qd(),Hq=Object.prototype.hasOwnProperty,qb=class extends Nq.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=Hq.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||bA.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,bA.getFactory)(e.buildType),i=new qq.Parser(e.code).parseChunk(),s=(0,Bq.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,$q.generateCharsetMap)(e.obfuscation),u=new jq.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(y=>u.variables.createNamespace(y)),o.forEach(y=>u.literals.add(y));let l=new Fq.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),d=new Uq.OutputProcessor(u,l);d.addOptimizations();let p=l.transform(i);return d.addCode(p),d.build()}};Ao.DirectTranspiler=qb});var Fb=g(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.ResourceProvider=void 0;var jb=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))}}};Zd.ResourceProvider=jb});var Bb=g(Di=>{"use strict";var Wq=Di&&Di.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},Gq=Di&&Di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Di,"__esModule",{value:!0});Di.Target=void 0;var Kq=Gq(require("events")),Vq=Or(),zq=Db(),_A=$d(),$b=class extends Kq.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return Wq(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 Vq.Parser(s,{filename:r}).parseChunk(),u=new zq.Dependency({target:r,resourceHandler:n,chunk:a,context:i}),{namespaces:c,literals:l}=yield u.findDependencies(),d=new Set(c);for(let p of d)i.variables.createNamespace(p);for(let p of l)i.literals.add(p);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof _A.BuildError?o:new _A.BuildError(o.message,{target:this.target,range:o.range})}})}};Di.Target=$b});var SA=g(Oo=>{"use strict";var Xq=Oo&&Oo.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.Transpiler=void 0;var Yq=Hb(),Jq=Lb(),TA=Nd(),Qq=su(),Zq=Fb(),ej=Bb(),tj=Vd(),nj=Yd(),rj=Qd(),ij=Object.prototype.hasOwnProperty,Ub=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new Zq.ResourceProvider().getHandler(),n.obfuscation=ij.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,nj.generateCharsetMap)(n.obfuscation);n.context=new Qq.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||TA.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return Xq(this,void 0,void 0,function*(){let e=this,n=(0,TA.getFactory)(e.buildType),r=e.context,s=yield new ej.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new tj.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(Jq.MODULE_BOILERPLATE),c=l=>{let d=r.modules.get(l.getId()),p={},y=0,_=function(M){let x=M.getNamespace();if(!(x in p)){if(x!==d&&M.type===Yq.DependencyType.Import){let k=o.transform(M.chunk,M);p[x]=u.replace('"$0"','"'+x+'"').replace('"$1"',k),y++}for(let k of M.dependencies)_(k)}};_(l);let E=new rj.OutputProcessor(r,o);E.addOptimizations(),y>0&&E.addHeader(),Object.keys(p).forEach(M=>E.addCode(p[M]));let L=o.transform(l.chunk,l);return E.addCode(L,!0),E.build()};return{[e.target]:c(a.dependency)}})}};Oo.Transpiler=Ub});var kA=g(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.unwrap=void 0;var sj=qe();function oj(t){for(;t instanceof sj.ASTParenthesisExpression;)t=t.expression;return t}ef.unwrap=oj});var Hb=g(ee=>{"use strict";var xA=ee&&ee.__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]}),aj=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uj=ee&&ee.__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)&&xA(e,t,n);return aj(e,t),e},cj=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&xA(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.merge=ee.unwrap=ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.LiteralsMapper=ee.fetchNamespaces=ee.BuildError=ee.createExpressionString=ee.createExpressionHash=ee.generateCharsetMap=ee.DependencyType=ee.Transpiler=ee.Transformer=ee.Target=ee.DirectTranspiler=ee.Dependency=ee.ContextDataProperty=ee.Context=ee.UglifyFactory=ee.TokenType=ee.Factory=ee.DefaultFactory=ee.BeautifyUtils=ee.BeautifyContext=ee.BeautifyFactory=ee.getFactory=ee.BuildType=void 0;var wA=Nd();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return wA.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return wA.getFactory}});var lj=gb();Object.defineProperty(ee,"BeautifyFactory",{enumerable:!0,get:function(){return lj.BeautifyFactory}});var dj=fb();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return dj.BeautifyContext}});ee.BeautifyUtils=uj(pb());var fj=yb();Object.defineProperty(ee,"DefaultFactory",{enumerable:!0,get:function(){return fj.DefaultFactory}});var EA=wo();Object.defineProperty(ee,"Factory",{enumerable:!0,get:function(){return EA.Factory}});Object.defineProperty(ee,"TokenType",{enumerable:!0,get:function(){return EA.TokenType}});var pj=_b();Object.defineProperty(ee,"UglifyFactory",{enumerable:!0,get:function(){return pj.UglifyFactory}});var AA=su();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return AA.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return AA.ContextDataProperty}});var hj=Db();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return hj.Dependency}});var gj=vA();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return gj.DirectTranspiler}});cj(Fb(),ee);var mj=Bb();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return mj.Target}});var yj=Vd();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return yj.Transformer}});var bj=SA();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return bj.Transpiler}});var vj=Ab();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return vj.DependencyType}});var _j=Yd();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return _j.generateCharsetMap}});var Tj=ab();Object.defineProperty(ee,"createExpressionHash",{enumerable:!0,get:function(){return Tj.createExpressionHash}});var Sj=bb();Object.defineProperty(ee,"createExpressionString",{enumerable:!0,get:function(){return Sj.createExpressionString}});var kj=$d();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return kj.BuildError}});var xj=Ud();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return xj.fetchNamespaces}});var wj=kb();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return wj.LiteralsMapper}});var Ej=wb();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return Ej.NamespaceGenerator}});var Aj=Qd();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return Aj.OutputProcessor}});var Oj=cb();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return Oj.Stack}});var Cj=kA();Object.defineProperty(ee,"unwrap",{enumerable:!0,get:function(){return Cj.unwrap}});var Rj=Wd();Object.defineProperty(ee,"merge",{enumerable:!0,get:function(){return Rj.merge}})});var CA=g(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.activate=void 0;var OA=Hb();function Pj(t){async function e(n){try{let r=t.getConfiguration();return new OA.DirectTranspiler({code:n,buildType:OA.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}]})}tf.activate=Pj});var nf=g((au,Wb)=>{(function(t,e){if(typeof au=="object"&&typeof Wb=="object")Wb.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof au=="object"?au:t)[r]=n[r]}})(au,()=>(()=>{"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,d="",p=0,y=-1,_=0,E=0;E<=u.length;++E){if(E<u.length)l=u.charCodeAt(E);else{if(l===47)break;l=47}if(l===47){if(!(y===E-1||_===1))if(y!==E-1&&_===2){if(d.length<2||p!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var L=d.lastIndexOf("/");if(L!==d.length-1){L===-1?(d="",p=0):p=(d=d.slice(0,L)).length-1-d.lastIndexOf("/"),y=E,_=0;continue}}else if(d.length===2||d.length===1){d="",p=0,y=E,_=0;continue}}c&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+u.slice(y+1,E):d=u.slice(y+1,E),p=E-y-1;y=E,_=0}else l===46&&_!==-1?++_:_=-1}return d}var a={resolve:function(){for(var u,c="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),s(p),p.length!==0&&(c=p+"/"+c,l=p.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 d=u.length,p=d-l,y=1;y<c.length&&c.charCodeAt(y)===47;++y);for(var _=c.length-y,E=p<_?p:_,L=-1,M=0;M<=E;++M){if(M===E){if(_>E){if(c.charCodeAt(y+M)===47)return c.slice(y+M+1);if(M===0)return c.slice(y+M)}else p>E&&(u.charCodeAt(l+M)===47?L=M:M===0&&(L=0));break}var x=u.charCodeAt(l+M);if(x!==c.charCodeAt(y+M))break;x===47&&(L=M)}var k="";for(M=l+L+1;M<=d;++M)M!==d&&u.charCodeAt(M)!==47||(k.length===0?k+="..":k+="/..");return k.length>0?k+c.slice(y+L):(y+=L,c.charCodeAt(y)===47&&++y,c.slice(y))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,d=-1,p=!0,y=u.length-1;y>=1;--y)if((c=u.charCodeAt(y))===47){if(!p){d=y;break}}else p=!1;return d===-1?l?"/":".":l&&d===1?"//":u.slice(0,d)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,d=0,p=-1,y=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var _=c.length-1,E=-1;for(l=u.length-1;l>=0;--l){var L=u.charCodeAt(l);if(L===47){if(!y){d=l+1;break}}else E===-1&&(y=!1,E=l+1),_>=0&&(L===c.charCodeAt(_)?--_==-1&&(p=l):(_=-1,p=E))}return d===p?p=E:p===-1&&(p=u.length),u.slice(d,p)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!y){d=l+1;break}}else p===-1&&(y=!1,p=l+1);return p===-1?"":u.slice(d,p)},extname:function(u){s(u);for(var c=-1,l=0,d=-1,p=!0,y=0,_=u.length-1;_>=0;--_){var E=u.charCodeAt(_);if(E!==47)d===-1&&(p=!1,d=_+1),E===46?c===-1?c=_:y!==1&&(y=1):c!==-1&&(y=-1);else if(!p){l=_+1;break}}return c===-1||d===-1||y===0||y===1&&c===d-1&&c===l+1?"":u.slice(c,d)},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 d=l.dir||l.root,p=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+p:d+"/"+p:p}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,d=u.charCodeAt(0),p=d===47;p?(c.root="/",l=1):l=0;for(var y=-1,_=0,E=-1,L=!0,M=u.length-1,x=0;M>=l;--M)if((d=u.charCodeAt(M))!==47)E===-1&&(L=!1,E=M+1),d===46?y===-1?y=M:x!==1&&(x=1):y!==-1&&(x=-1);else if(!L){_=M+1;break}return y===-1||E===-1||x===0||x===1&&y===E-1&&y===_+1?E!==-1&&(c.base=c.name=_===0&&p?u.slice(1,E):u.slice(_,E)):(_===0&&p?(c.name=u.slice(1,y),c.base=u.slice(1,E)):(c.name=u.slice(_,y),c.base=u.slice(_,E)),c.ext=u.slice(y,E)),_>0?c.dir=u.slice(0,_-1):p&&(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 d(K,A){if(!K.scheme&&A)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${K.authority}", path: "${K.path}", query: "${K.query}", fragment: "${K.fragment}"}`);if(K.scheme&&!u.test(K.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(K.path){if(K.authority){if(!c.test(K.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(K.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let p="",y="/",_=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class E{static isUri(A){return A instanceof E||!!A&&typeof A.authority=="string"&&typeof A.fragment=="string"&&typeof A.path=="string"&&typeof A.query=="string"&&typeof A.scheme=="string"&&typeof A.fsPath=="string"&&typeof A.with=="function"&&typeof A.toString=="function"}scheme;authority;path;query;fragment;constructor(A,D,I,j,he,fe=!1){typeof A=="object"?(this.scheme=A.scheme||p,this.authority=A.authority||p,this.path=A.path||p,this.query=A.query||p,this.fragment=A.fragment||p):(this.scheme=function(Dt,mt){return Dt||mt?Dt:"file"}(A,fe),this.authority=D||p,this.path=function(Dt,mt){switch(Dt){case"https":case"http":case"file":mt?mt[0]!==y&&(mt=y+mt):mt=y}return mt}(this.scheme,I||p),this.query=j||p,this.fragment=he||p,d(this,fe))}get fsPath(){return F(this,!1)}with(A){if(!A)return this;let{scheme:D,authority:I,path:j,query:he,fragment:fe}=A;return D===void 0?D=this.scheme:D===null&&(D=p),I===void 0?I=this.authority:I===null&&(I=p),j===void 0?j=this.path:j===null&&(j=p),he===void 0?he=this.query:he===null&&(he=p),fe===void 0?fe=this.fragment:fe===null&&(fe=p),D===this.scheme&&I===this.authority&&j===this.path&&he===this.query&&fe===this.fragment?this:new M(D,I,j,he,fe)}static parse(A,D=!1){let I=_.exec(A);return I?new M(I[2]||p,ye(I[4]||p),ye(I[5]||p),ye(I[7]||p),ye(I[9]||p),D):new M(p,p,p,p,p)}static file(A){let D=p;if(a.isWindows&&(A=A.replace(/\\/g,y)),A[0]===y&&A[1]===y){let I=A.indexOf(y,2);I===-1?(D=A.substring(2),A=y):(D=A.substring(2,I),A=A.substring(I)||y)}return new M("file",D,A,p,p)}static from(A){let D=new M(A.scheme,A.authority,A.path,A.query,A.fragment);return d(D,!0),D}toString(A=!1){return C(this,A)}toJSON(){return this}static revive(A){if(A){if(A instanceof E)return A;{let D=new M(A);return D._formatted=A.external,D._fsPath=A._sep===L?A.fsPath:null,D}}return A}}s.URI=E;let L=a.isWindows?1:void 0;class M extends E{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=F(this,!1)),this._fsPath}toString(A=!1){return A?C(this,!0):(this._formatted||(this._formatted=C(this,!1)),this._formatted)}toJSON(){let A={$mid:1};return this._fsPath&&(A.fsPath=this._fsPath,A._sep=L),this._formatted&&(A.external=this._formatted),this.path&&(A.path=this.path),this.scheme&&(A.scheme=this.scheme),this.authority&&(A.authority=this.authority),this.query&&(A.query=this.query),this.fragment&&(A.fragment=this.fragment),A}}let x={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 k(K,A,D){let I,j=-1;for(let he=0;he<K.length;he++){let fe=K.charCodeAt(he);if(fe>=97&&fe<=122||fe>=65&&fe<=90||fe>=48&&fe<=57||fe===45||fe===46||fe===95||fe===126||A&&fe===47||D&&fe===91||D&&fe===93||D&&fe===58)j!==-1&&(I+=encodeURIComponent(K.substring(j,he)),j=-1),I!==void 0&&(I+=K.charAt(he));else{I===void 0&&(I=K.substr(0,he));let Dt=x[fe];Dt!==void 0?(j!==-1&&(I+=encodeURIComponent(K.substring(j,he)),j=-1),I+=Dt):j===-1&&(j=he)}}return j!==-1&&(I+=encodeURIComponent(K.substring(j))),I!==void 0?I:K}function v(K){let A;for(let D=0;D<K.length;D++){let I=K.charCodeAt(D);I===35||I===63?(A===void 0&&(A=K.substr(0,D)),A+=x[I]):A!==void 0&&(A+=K[D])}return A!==void 0?A:K}function F(K,A){let D;return D=K.authority&&K.path.length>1&&K.scheme==="file"?`//${K.authority}${K.path}`:K.path.charCodeAt(0)===47&&(K.path.charCodeAt(1)>=65&&K.path.charCodeAt(1)<=90||K.path.charCodeAt(1)>=97&&K.path.charCodeAt(1)<=122)&&K.path.charCodeAt(2)===58?A?K.path.substr(1):K.path[1].toLowerCase()+K.path.substr(2):K.path,a.isWindows&&(D=D.replace(/\//g,"\\")),D}function C(K,A){let D=A?v:k,I="",{scheme:j,authority:he,path:fe,query:Dt,fragment:mt}=K;if(j&&(I+=j,I+=":"),(he||j==="file")&&(I+=y,I+=y),he){let $e=he.indexOf("@");if($e!==-1){let cn=he.substr(0,$e);he=he.substr($e+1),$e=cn.lastIndexOf(":"),$e===-1?I+=D(cn,!1,!1):(I+=D(cn.substr(0,$e),!1,!1),I+=":",I+=D(cn.substr($e+1),!1,!0)),I+="@"}he=he.toLowerCase(),$e=he.lastIndexOf(":"),$e===-1?I+=D(he,!1,!0):(I+=D(he.substr(0,$e),!1,!0),I+=he.substr($e))}if(fe){if(fe.length>=3&&fe.charCodeAt(0)===47&&fe.charCodeAt(2)===58){let $e=fe.charCodeAt(1);$e>=65&&$e<=90&&(fe=`/${String.fromCharCode($e+32)}:${fe.substr(3)}`)}else if(fe.length>=2&&fe.charCodeAt(1)===58){let $e=fe.charCodeAt(0);$e>=65&&$e<=90&&(fe=`${String.fromCharCode($e+32)}:${fe.substr(2)}`)}I+=D(fe,!0,!1)}return Dt&&(I+="?",I+=D(Dt,!1,!1)),mt&&(I+="#",I+=A?mt:k(mt,!1,!1)),I}function V(K){try{return decodeURIComponent(K)}catch{return K.length>3?K.substr(0,3)+V(K.substr(3)):K}}s.uriToFsPath=F;let ce=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ye(K){return K.match(ce)?K.replace(ce,A=>V(A)):K}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(_,E,L,M){M===void 0&&(M=L);var x=Object.getOwnPropertyDescriptor(E,L);x&&!("get"in x?!E.__esModule:x.writable||x.configurable)||(x={enumerable:!0,get:function(){return E[L]}}),Object.defineProperty(_,M,x)}:function(_,E,L,M){M===void 0&&(M=L),_[M]=E[L]}),u=this&&this.__setModuleDefault||(Object.create?function(_,E){Object.defineProperty(_,"default",{enumerable:!0,value:E})}:function(_,E){_.default=E}),c=this&&this.__importStar||function(_){if(_&&_.__esModule)return _;var E={};if(_!=null)for(var L in _)L!=="default"&&Object.prototype.hasOwnProperty.call(_,L)&&a(E,_,L);return u(E,_),E};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),d=l.posix||l,p="/";var y;(function(_){_.joinPath=function(E,...L){return E.with({path:d.join(E.path,...L)})},_.resolvePath=function(E,...L){let M=E.path,x=!1;M[0]!==p&&(M=p+M,x=!0);let k=d.resolve(M,...L);return x&&k[0]===p&&!E.authority&&(k=k.substring(1)),E.with({path:k})},_.dirname=function(E){if(E.path.length===0||E.path===p)return E;let L=d.dirname(E.path);return L.length===1&&L.charCodeAt(0)===46&&(L=""),E.with({path:L})},_.basename=function(E){return d.basename(E.path)},_.extname=function(E){return d.extname(E.path)}})(y||(s.Utils=y={}))}},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 sf=g(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.MarkdownString=void 0;var Gb=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+=`
191
+ `,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};rf.MarkdownString=Gb});var of=g(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.createHover=Tt.createSignatureInfo=Tt.appendTooltipBody=Tt.appendTooltipHeader=Tt.createTooltipHeader=Tt.formatDefaultValue=Tt.formatTypes=void 0;var RA=Ws(),PA=sf();function Kb(t){return t==null?"":t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}Tt.formatTypes=Kb;function DA(t){return typeof t=="string"?`"${t}"`:t.toString()}Tt.formatDefaultValue=DA;var Dj=(t,e)=>{let n=e.getArguments()||[],r=Kb(e.getReturns())||"null";if(n.length===0)return`(${t.kind}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${Kb(s.getTypes())}${s.getDefault()?` = ${DA(s.getDefault().value)}`:""}`).join(", ");return`(${t.kind}) ${t.label} (${i}): ${r}`};Tt.createTooltipHeader=Dj;var Ij=(t,e,n)=>{t.appendCodeblock(RA.LanguageId,(0,Tt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
192
+ `)};Tt.appendTooltipHeader=Ij;var Mj=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
193
193
  `),n.length>0&&(t.appendMarkdown(`#### Examples:
194
- `),t.appendCodeblock(_A.LanguageId,n.join(`
195
- `)))};vt.appendTooltipBody=mj;var yj=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,vt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new TA.MarkdownString("");(0,vt.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};vt.createSignatureInfo=yj;var bj=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new TA.MarkdownString(""),i=n;(0,vt.appendTooltipHeader)(r,t,i),(0,vt.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};vt.createHover=bj});var wA=g(Eo=>{"use strict";var vj=Eo&&Eo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.activate=void 0;var kA=Br(),jb=Un(),_j=vj(require("path")),su=Jd(),Tj=yo(),xA=Zd(),Fb=ef(),Sj=$s(),kj=async(t,e,n)=>{let r=su.URI.parse(e.uri),i=await t.fs.getWorkspaceFolderUri(r);return i==null?su.Utils.joinPath(r,".."):n.startsWith("/")?i:su.Utils.joinPath(r,"..")};function xj(t){async function e(n,r){let i=new xA.MarkdownString(""),o=r.closest.path,a=await kj(t,n,o),u=su.Utils.joinPath(a,o),c=su.Utils.joinPath(a,`${o}`),l=await t.fs.findExistingPath(u.toString(),c.toString()),d=l==null?["Cannot open file."]:[`[Inserts file "${_j.default.basename(l)}" inside this code when building](${l.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(d.join(`
196
- `)),{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 Tj.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===kA.ASTType.FeatureImportExpression||s.closest.type===kA.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,Fb.createHover)(o);let a=new xA.MarkdownString(""),u=Array.from(o.types).map(jb.SignatureDefinitionTypeMeta.parse),c=`(${o.kind}) ${o.label}: ${(0,Fb.formatTypes)(u)}`;if(o.types.has(jb.SignatureDefinitionBaseType.Map)){let l={};for(let[d,p]of o.values){let y=Array.from(p.types).map(jb.SignatureDefinitionTypeMeta.parse);l[d.slice(2)]=(0,Fb.formatTypes)(y)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(Sj.LanguageId,c),{contents:a.toString()}})}Eo.activate=xj});var AA=g(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.activate=void 0;var EA=qe(),wj=yo(),Ej=ef(),Aj=t=>{if(t.closest.type===EA.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===EA.ASTType.CallExpression)return n}return null};function Oj(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 wj.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=Aj(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(d=>{let p=d.start.character-1,y=d.end.character;return p<=e.position.character&&y>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,Ej.createSignatureInfo)(a)),l})}tf.activate=Oj});var CA=g(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.activate=void 0;var OA=$s();function Cj(t){let e=r=>r.languageId!==OA.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===OA.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)}nf.activate=Cj});var DA=g(Ao=>{"use strict";var Rj=Ao&&Ao.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.activate=void 0;var Dj=za(),Pj=Wy(),Ij=Rj(ho()),RA=(t,e)=>{let n=Ij.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){let o=s,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=a?.label??(0,Dj.createExpressionId)(s.variable),c=a?.kind?(0,Pj.getSymbolItemKind)(a.kind):13,l={line:o.variable.start.line-1,character:o.variable.start.character-1},d={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,containerName:u,kind:c,location:{uri:t.uri,range:{start:l,end:d}}})}return i};function Mj(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?RA(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...RA(r,e.query));return n})}Ao.activate=Mj});var of=g((qH,LA)=>{var ou=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Lj=typeof AbortController=="function",rf=Lj?AbortController:class{constructor(){this.signal=new PA}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})}},qj=typeof AbortSignal=="function",Nj=typeof rf.AbortSignal=="function",PA=qj?AbortSignal:Nj?rf.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))}},Hb=new Set,$b=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;sf(n)&&Wb(n,`${t} option`,`options.${e}`,Co)},Bb=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(sf(n)){let{prototype:r}=Co,{get:i}=Object.getOwnPropertyDescriptor(r,t);Wb(n,`${t} method`,`cache.${e}()`,i)}},jj=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(sf(n)){let{prototype:r}=Co,{get:i}=Object.getOwnPropertyDescriptor(r,t);Wb(n,`${t} property`,`cache.${e}`,i)}},IA=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},sf=t=>!Hb.has(t),Wb=(t,e,n,r)=>{Hb.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;IA(i,"DeprecationWarning",t,r)},Ci=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),MA=t=>Ci(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Oo:null:null,Oo=class extends Array{constructor(e){super(e),this.fill(0)}},Ub=class{constructor(e){if(e===0)return[];let n=MA(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Co=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:d,noUpdateTTL:p,maxSize:y=0,maxEntrySize:_=0,sizeCalculation:E,fetchMethod:L,fetchContext:M,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:F,ignoreFetchAbort:C}=e,{length:V,maxAge:ae,stale:ge}=e instanceof t?{}:e;if(n!==0&&!Ci(n))throw new TypeError("max option must be a nonnegative integer");let G=n?MA(n):Array;if(!G)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=y,this.maxEntrySize=_||this.maxSize,this.sizeCalculation=E||V,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=L||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=M,!this.fetchMethod&&M!==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 G(n),this.prev=new G(n),this.head=0,this.tail=0,this.free=new Ub(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=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(this.maxSize!==0&&!Ci(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!Ci(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!ge,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ci(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ae||0,this.ttl){if(!Ci(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 A="LRU_CACHE_UNBOUNDED";sf(A)&&(Hb.add(A),IA("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,t))}ge&&$b("stale","allowStale"),ae&&$b("maxAge","ttl"),V&&$b("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Oo(this.max),this.starts=new Oo(this.max),this.setItemTTL=(r,i,s=ou.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?ou.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=ou.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 Oo(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(!Ci(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!Ci(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 Bb("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=ou.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=ou.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 d=this.valList[l];if(n!==d){if(this.isBackgroundFetch(d)?d.__abortController.abort(new Error("replaced")):s||(this.dispose(d,e,"set"),this.disposeAfter&&this.disposed.push([d,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let p=d&&this.isBackgroundFetch(d)?d.__staleWhileFetching:d;p!==void 0&&(c.oldValue=p)}}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 rf;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(y,_=!1)=>{let{aborted:E}=o.signal,L=r.ignoreFetchAbort&&y!==void 0;return r.status&&(E&&!_?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,L&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!L&&!_?l(o.signal.reason):(this.valList[n]===p&&(y===void 0?p.__staleWhileFetching?this.valList[n]=p.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,a.options))),y)},c=y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),l(y)),l=y=>{let{aborted:_}=o.signal,E=_&&r.allowStaleOnFetchAbort,L=E||r.allowStaleOnFetchRejection,M=L||r.noDeleteOnFetchRejection;if(this.valList[n]===p&&(!M||p.__staleWhileFetching===void 0?this.delete(e):E||(this.valList[n]=p.__staleWhileFetching)),L)return r.status&&p.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw y},d=(y,_)=>{this.fetchMethod(e,s,a).then(E=>y(E),_),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(),r.allowStaleOnFetchAbort&&(y=E=>u(E,!0)))})};r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,c);return p.__abortController=o,p.__staleWhileFetching=s,p.__returned=null,n===void 0?(this.set(e,p,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=p,p}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:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,fetchContext:_=this.fetchContext,forceRefresh:E=!1,status:L,signal:M}={}){if(!this.fetchMethod)return L&&(L.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:L});let x={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:L,signal:M},k=this.keyMap.get(e);if(k===void 0){L&&(L.fetch="miss");let v=this.backgroundFetch(e,k,x,_);return v.__returned=v}else{let v=this.valList[k];if(this.isBackgroundFetch(v)){let ge=n&&v.__staleWhileFetching!==void 0;return L&&(L.fetch="inflight",ge&&(L.returnedStale=!0)),ge?v.__staleWhileFetching:v.__returned=v}let F=this.isStale(k);if(!E&&!F)return L&&(L.fetch="hit"),this.moveToTail(k),r&&this.updateItemAge(k),this.statusTTL(L,k),v;let C=this.backgroundFetch(e,k,x,_),V=C.__staleWhileFetching!==void 0,ae=V&&n;return L&&(L.fetch=V&&F?"stale":"refresh",ae&&F&&(L.returnedStale=!0)),ae?C.__staleWhileFetching:C.__returned=C}}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 Bb("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 Bb("reset","clear"),this.clear}get length(){return jj("length","size"),this.size}static get AbortController(){return rf}static get AbortSignal(){return PA}};LA.exports=Co});var UA=g((NH,BA)=>{var zb=Object.defineProperty,Fj=Object.getOwnPropertyDescriptor,$j=Object.getOwnPropertyNames,Bj=Object.prototype.hasOwnProperty,Uj=(t,e)=>{for(var n in e)zb(t,n,{get:e[n],enumerable:!0})},Hj=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $j(e))!Bj.call(t,i)&&i!==n&&zb(t,i,{get:()=>e[i],enumerable:!(r=Fj(e,i))||r.enumerable});return t},Wj=t=>Hj(zb({},"__esModule",{value:!0}),t),qA={};Uj(qA,{ScheduleIntervalHelper:()=>Gb,SchedulePostMessageHelper:()=>Vb,ScheduleSetImmmediateHelper:()=>Kb,schedule:()=>Kj,scheduleProvider:()=>$A});BA.exports=Wj(qA);var Gj=Promise.prototype.then.bind(Promise.resolve()),Xb=class af{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,af.QUEUE_LIMIT);this.queue=this.queue.slice(af.QUEUE_LIMIT);for(let r=0;r<n;Gj(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=af.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},Gb=class NA extends Xb{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new NA;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}},Vj=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},Vb=class jA extends Xb{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!Vj()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new jA;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}},Kb=class FA extends Xb{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new FA;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 $A(){if(Kb.isApplicable())return Kb.createCallback();if(Vb.isApplicable())return Vb.createCallback();if(Gb.isApplicable())return Gb.createCallback();throw new Error("No schedule helper fulfills requirements!")}var Kj=$A()});var HA=g(wn=>{"use strict";var Qb=wn&&wn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wn,"__esModule",{value:!0});wn.DocumentManager=wn.PROCESSING_TIMEOUT=wn.ActiveDocument=wn.DocumentURIBuilder=void 0;var zj=Qb(require("events")),Xj=Br(),Yj=Qb(of()),Yb=UA(),Ro=Jd(),Jj=Qb(ho()),uf=class{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."),Ro.Utils.joinPath(this.rootPath,e).toString()):Ro.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return Ro.Utils.joinPath(this.rootPath,e).toString()}};wn.DocumentURIBuilder=uf;var cf=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 Ro.Utils.joinPath(Ro.URI.parse(this.textDocument.uri),"..")}async getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new uf(r,e),o=u=>u.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(u),s.getFromWorkspaceFolder(`${u}.src`)):i.fs.findExistingPath(s.getFromRootPath(u),s.getFromRootPath(`${u}.src`));return(await Promise.all([...n.imports.filter(u=>u.path).map(u=>o(u.path)),...n.includes.filter(u=>u.path).map(u=>o(u.path))])).filter(u=>u!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(Ro.URI.parse(this.textDocument.uri)),n=await this.getImportsAndIncludes(e),r=new Set([...n]);return this.dependencies=Array.from(r),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))continue;let u=await this.documentManager.open(a);r.add(a),u!==null&&(n.add(u),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};wn.ActiveDocument=cf;wn.PROCESSING_TIMEOUT=100;var Jb=class extends zj.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=wn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new Yj.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,Yb.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,Yb.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 Xj.Parser(n,{unsafe:!0}),i=r.parseChunk();return Jj.default.analyze(e.uri,i),new cf({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,Yb.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)}};wn.DocumentManager=Jb});var GA=g(Do=>{"use strict";var Qj=Do&&Do.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Do,"__esModule",{value:!0});Do.CoreContext=void 0;var Zj=Qj(require("events")),Zb=$s();function WA(t){return{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??Zb.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}}}}var ev=class extends Zj.default{constructor(){super(),this._configuration=WA(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Zb.ConfigurationNamespace);this._configuration=WA(e)}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,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Zb.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},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()}};Do.CoreContext=ev});var lf=g(Q=>{"use strict";var eF=Q&&Q.__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]}),tF=Q&&Q.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nF=Q&&Q.__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)&&eF(e,t,n);return tF(e,t),e},rF=Q&&Q.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Q,"__esModule",{value:!0});Q.CoreContext=Q.typeAnalyzer=Q.lookupBase=Q.lookupIdentifier=Q.appendTooltipHeader=Q.appendTooltipBody=Q.formatTypes=Q.formatDefaultValue=Q.createTooltipHeader=Q.createSignatureInfo=Q.createHover=Q.MarkdownString=Q.LookupHelper=Q.DocumentManager=Q.ActiveDocument=Q.ASTScraper=Q.activateSymbol=Q.activateSubscriptions=Q.activateSignature=Q.activateHover=Q.activateFormatter=Q.activateDiagnostic=Q.activateDefinition=Q.activateColor=Q.activateAutocomplete=Q.ConfigurationNamespace=Q.LanguageId=Q.IndentationType=void 0;var tv=$s();Object.defineProperty(Q,"IndentationType",{enumerable:!0,get:function(){return tv.IndentationType}});Object.defineProperty(Q,"LanguageId",{enumerable:!0,get:function(){return tv.LanguageId}});Object.defineProperty(Q,"ConfigurationNamespace",{enumerable:!0,get:function(){return tv.ConfigurationNamespace}});var iF=IE();Object.defineProperty(Q,"activateAutocomplete",{enumerable:!0,get:function(){return iF.activate}});var sF=HE();Object.defineProperty(Q,"activateColor",{enumerable:!0,get:function(){return sF.activate}});var oF=VE();Object.defineProperty(Q,"activateDefinition",{enumerable:!0,get:function(){return oF.activate}});var aF=KE();Object.defineProperty(Q,"activateDiagnostic",{enumerable:!0,get:function(){return aF.activate}});var uF=vA();Object.defineProperty(Q,"activateFormatter",{enumerable:!0,get:function(){return uF.activate}});var cF=wA();Object.defineProperty(Q,"activateHover",{enumerable:!0,get:function(){return cF.activate}});var lF=AA();Object.defineProperty(Q,"activateSignature",{enumerable:!0,get:function(){return lF.activate}});var dF=CA();Object.defineProperty(Q,"activateSubscriptions",{enumerable:!0,get:function(){return dF.activate}});var fF=DA();Object.defineProperty(Q,"activateSymbol",{enumerable:!0,get:function(){return fF.activate}});Q.ASTScraper=nF(Vy());var VA=HA();Object.defineProperty(Q,"ActiveDocument",{enumerable:!0,get:function(){return VA.ActiveDocument}});Object.defineProperty(Q,"DocumentManager",{enumerable:!0,get:function(){return VA.DocumentManager}});var pF=yo();Object.defineProperty(Q,"LookupHelper",{enumerable:!0,get:function(){return pF.LookupHelper}});var hF=Zd();Object.defineProperty(Q,"MarkdownString",{enumerable:!0,get:function(){return hF.MarkdownString}});var fs=ef();Object.defineProperty(Q,"createHover",{enumerable:!0,get:function(){return fs.createHover}});Object.defineProperty(Q,"createSignatureInfo",{enumerable:!0,get:function(){return fs.createSignatureInfo}});Object.defineProperty(Q,"createTooltipHeader",{enumerable:!0,get:function(){return fs.createTooltipHeader}});Object.defineProperty(Q,"formatDefaultValue",{enumerable:!0,get:function(){return fs.formatDefaultValue}});Object.defineProperty(Q,"formatTypes",{enumerable:!0,get:function(){return fs.formatTypes}});Object.defineProperty(Q,"appendTooltipBody",{enumerable:!0,get:function(){return fs.appendTooltipBody}});Object.defineProperty(Q,"appendTooltipHeader",{enumerable:!0,get:function(){return fs.appendTooltipHeader}});var nv=ho();Object.defineProperty(Q,"lookupIdentifier",{enumerable:!0,get:function(){return nv.lookupIdentifier}});Object.defineProperty(Q,"lookupBase",{enumerable:!0,get:function(){return nv.lookupBase}});Object.defineProperty(Q,"typeAnalyzer",{enumerable:!0,get:function(){return rF(nv).default}});var gF=GA();Object.defineProperty(Q,"CoreContext",{enumerable:!0,get:function(){return gF.CoreContext}})});var YA={};hO(YA,{TextDocument:()=>rv});function iv(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);iv(r,e),iv(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 KA(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);zA(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function zA(t){return t===13||t===10}function XA(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 mF(t){let e=XA(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var df,rv,JA=pO(()=>{"use strict";df=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=XA(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=KA(r.text,!1,s);if(u-a===l.length)for(let p=0,y=l.length;p<y;p++)c[p+a+1]=l[p];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 d=r.text.length-(o-s);if(d!==0)for(let p=a+1+l.length,y=c.length;p<y;p++)c[p]=c[p]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=KA(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&&zA(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 df(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof df)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=iv(s.map(mF),(l,d)=>{let p=l.range.start.line-d.range.start.line;return p===0?l.range.start.character-d.range.start.character:p}),u=0,c=[];for(let l of a){let d=i.offsetAt(l.range.start);if(d<u)throw new Error("Overlapping edit");d>u&&c.push(o.substring(u,d)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(rv||(rv={}))});var ZA=g(Po=>{"use strict";var av=Po&&Po.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Po,"__esModule",{value:!0});Po.FileSystem=void 0;var yF=ph(),QA=(JA(),mO(YA)),bF=av(require("events")),sv=Jd(),vF=av(require("fs")),_F=lf(),TF=av(of()),ov=class extends bF.default{constructor(e){super(),this._context=e,this._textDocumentManager=new yF.TextDocuments(QA.TextDocument),this._tempTextDocumentCache=new TF.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=>sv.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async findExistingPath(...e){if(e.length===0)return null;for(let n=0;n<e.length;n++)if(await this.getTextDocument(e[n])!=null)return e[n];return null}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=sv.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await vF.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=QA.TextDocument.create(e,_F.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(sv.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)})}};Po.FileSystem=ov});var eO=g(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.hash=void 0;function SF(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}ff.hash=SF});var iO=g(Io=>{"use strict";var rO=Io&&Io.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Io,"__esModule",{value:!0});Io.DocumentMerger=void 0;var kF=rO(of()),tO=rO(ho()),nO=eO(),uv=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new kF.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,nO.hash)(`${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,nO.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){let r=this.keyToDocumentUriMap.get(n);r&&this.results.delete(r),this.keyToDocumentUriMap.set(n,e)}async process(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=tO.default.get(i);if(r.set(i,null),!s)return null;let o=[],a=await n.documentManager.get(e).getImports(),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,i);let c=await n.documentManager.get(e).getDependencies();await Promise.all(c.map(async d=>{let p=n.documentManager.results.get(d);if(!p)return;let{document:y,textDocument:_}=p;if(!y)return;let E=await this.process(_,n,r);E!==null&&o.push(E)}));let l=s.merge(...o);return r.set(i,l),this.results.set(u,l),l}async build(e,n){let r=e.uri,i=tO.default.get(r);if(!i)return null;let s=[],o=await n.documentManager.get(e).getImports(),a=this.createCacheKey(e,o);if(this.results.has(a))return this.results.get(a);this.registerCacheKey(a,r);let u=await n.documentManager.get(e).getDependencies(),c=new Map([[r,null]]);await Promise.all(u.map(async d=>{let p=n.documentManager.results.get(d);if(!p)return;let{document:y,textDocument:_}=p;if(!y)return;let E=await this.process(_,n,c);E!==null&&s.push(E)}));let l=i.merge(...s);return this.results.set(a,l),l}};Io.DocumentMerger=uv});var aO=g(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.NodeContext=void 0;var sO=ph(),oO=lf(),xF=ZA(),wF=iO(),cv=class extends oO.CoreContext{constructor(){super(),this.documentManager=new oO.DocumentManager().setContext(this),this.documentMerger=new wF.DocumentMerger,this.connection=(0,sO.createConnection)(sO.ProposedFeatures.all),this.fs=new xF.FileSystem(this)}};pf.NodeContext=cv});Object.defineProperty(exports,"__esModule",{value:!0});var EF=aO(),Gr=lf(),uO=new EF.NodeContext;uO.on("ready",t=>{(0,Gr.activateAutocomplete)(t),(0,Gr.activateColor)(t),(0,Gr.activateDefinition)(t),(0,Gr.activateDiagnostic)(t),(0,Gr.activateFormatter)(t),(0,Gr.activateHover)(t),(0,Gr.activateSignature)(t),(0,Gr.activateSubscriptions)(t),(0,Gr.activateSymbol)(t)});uO.listen();
194
+ `),t.appendCodeblock(RA.LanguageId,n.join(`
195
+ `)))};Tt.appendTooltipBody=Mj;var Lj=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,Tt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new PA.MarkdownString("");(0,Tt.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};Tt.createSignatureInfo=Lj;var Nj=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new PA.MarkdownString(""),i=n;(0,Tt.appendTooltipHeader)(r,t,i),(0,Tt.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};Tt.createHover=Nj});var LA=g(Co=>{"use strict";var qj=Co&&Co.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Co,"__esModule",{value:!0});Co.activate=void 0;var IA=Or(),Vb=Gn(),jj=qj(require("path")),uu=nf(),Fj=_o(),MA=sf(),zb=of(),$j=Ws(),Bj=async(t,e,n)=>{let r=uu.URI.parse(e.uri),i=await t.fs.getWorkspaceFolderUri(r);return i==null?uu.Utils.joinPath(r,".."):n.startsWith("/")?i:uu.Utils.joinPath(r,"..")};function Uj(t){async function e(n,r){let i=new MA.MarkdownString(""),o=r.closest.path,a=await Bj(t,n,o),u=uu.Utils.joinPath(a,o),c=uu.Utils.joinPath(a,`${o}`),l=await t.fs.findExistingPath(u.toString(),c.toString()),d=l==null?["Cannot open file."]:[`[Inserts file "${jj.default.basename(l)}" inside this code when building](${l.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(d.join(`
196
+ `)),{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 Fj.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===IA.ASTType.FeatureImportExpression||s.closest.type===IA.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,zb.createHover)(o);let a=new MA.MarkdownString(""),u=Array.from(o.types).map(Vb.SignatureDefinitionTypeMeta.parse),c=`(${o.kind}) ${o.label}: ${(0,zb.formatTypes)(u)}`;if(o.types.has(Vb.SignatureDefinitionBaseType.Map)){let l={};for(let[d,p]of o.values){let y=Array.from(p.types).map(Vb.SignatureDefinitionTypeMeta.parse);l[d.slice(2)]=(0,zb.formatTypes)(y)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock($j.LanguageId,c),{contents:a.toString()}})}Co.activate=Uj});var qA=g(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.activate=void 0;var NA=qe(),Hj=_o(),Wj=of(),Gj=t=>{if(t.closest.type===NA.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===NA.ASTType.CallExpression)return n}return null};function Kj(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 Hj.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=Gj(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(d=>{let p=d.start.character-1,y=d.end.character;return p<=e.position.character&&y>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,Wj.createSignatureInfo)(a)),l})}af.activate=Kj});var FA=g(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.activate=void 0;var jA=Ws();function Vj(t){let e=r=>r.languageId!==jA.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===jA.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)}uf.activate=Vj});var BA=g(Ro=>{"use strict";var zj=Ro&&Ro.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.activate=void 0;var Xj=Ja(),Yj=Qy(),Jj=zj(bo()),$A=(t,e)=>{let n=Jj.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){let o=s,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=a?.label??(0,Xj.createExpressionId)(s.variable),c=a?.kind?(0,Yj.getSymbolItemKind)(a.kind):13,l={line:o.variable.start.line-1,character:o.variable.start.character-1},d={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,containerName:u,kind:c,location:{uri:t.uri,range:{start:l,end:d}}})}return i};function Qj(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?$A(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...$A(r,e.query));return n})}Ro.activate=Qj});var cf=g(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.buildTokens=Vn.semanticTokensLegend=Vn.SemanticTokenModifier=Vn.SemanticTokenType=void 0;var H=qe(),Ft=Or(),Zj=tb(),UA=(t,e)=>!!Zj.miniscriptMeta.getDefinition(t,e),Q;(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"})(Q=Vn.SemanticTokenType||(Vn.SemanticTokenType={}));var Xb;(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"})(Xb=Vn.SemanticTokenModifier||(Vn.SemanticTokenModifier={}));Vn.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 HA=t=>1<<t,Yb=class{constructor(e,n){this._lexer=e,this._builder=n,this._validator=new H.ParserValidatorm}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){let n=this.token;return this.token.type!==e?null:(this.next(),n)}requireToken(e){let n=this.token;return e(n)?(this.next(),n):null}requireTokenOfAny(e){let n=this.token;return e(n)?(this.next(),n):null}skipNewlines(){let e=this;for(;;){if(H.Selectors.Comment(e.token))this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length+2,Q.Comment,0);else if(!H.Selectors.EndOfLine(e.token))break;e.next()}}processIdentifier(e=!1,n=!1){let r=this,i=r.requireType(H.TokenType.Identifier);if(i)if(n)r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Q.Parameter,0);else if(e){let o=UA(["any"],i.value)?HA(Xb.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Q.Property,o)}else{let o=UA(["general"],i.value)?HA(Xb.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Q.Variable,o)}}processLiteral(){let e=this.token;switch(e.type){case H.TokenType.StringLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Q.String,0);break}case H.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Q.Number,0);break}case H.TokenType.BooleanLiteral:case H.TokenType.NilLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Q.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(Ft.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(Ft.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next(),r.processFeatureInjectExpression();if(Ft.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next();return}else if(Ft.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next();return}if(r._validator.isLiteral(r.token.type))return r.processLiteral();if(r.isType(H.TokenType.Identifier))return r.processIdentifier()}processQuantity(e=!1,n=!1){let r=this;if(!H.Selectors.LParenthesis(r.token))return r.processAtom(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.skipNewlines(),r.processExpr();let i=r.requireToken(H.Selectors.RParenthesis);i&&r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Q.Punctuator,0)}processList(e=!1,n=!1){let r=this;if(!H.Selectors.SLBracket(r.token))return r.processQuantity(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),H.Selectors.SRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next();else for(r.skipNewlines();!H.Selectors.EndOfFile(r.token);){if(H.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next();break}if(r.processExpr(),H.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.skipNewlines()),H.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next();break}}}processMap(e=!1,n=!1){let r=this;if(!H.Selectors.CLBracket(r.token))return r.processList(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),H.Selectors.CRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next();else for(r.skipNewlines();!H.Selectors.EndOfFile(r.token);){if(H.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next();break}r.processExpr();let i=r.requireToken(H.Selectors.MapKeyValueSeperator);if(!i)return;if(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Q.Punctuator,0),r.skipNewlines(),r.processExpr(),H.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.skipNewlines()),H.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next();break}}}processCallArgs(){let e=this;if(H.Selectors.LParenthesis(e.token))if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.Punctuator,0),e.next(),H.Selectors.RParenthesis(e.token))e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.Punctuator,0),e.next();else for(;!H.Selectors.EndOfFile(e.token);){e.skipNewlines(),e.processExpr(),e.skipNewlines();let n=e.requireTokenOfAny(H.SelectorGroups.CallArgsEnd);if(!n)return;if(H.Selectors.RParenthesis(n)){e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Q.Punctuator,0);break}else if(!H.Selectors.ArgumentSeperator(n))break}}processCallExpr(e=!1,n=!1){let r=this;for(r.processMap(e,n);!H.Selectors.EndOfFile(r.token);)if(H.Selectors.MemberSeperator(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.skipNewlines(),r.processIdentifier(!0);else if(H.Selectors.SLBracket(r.token)&&!r.token.afterSpace){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.skipNewlines(),H.Selectors.SliceSeperator(r.token)?(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.skipNewlines(),H.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0):r.processExpr()):(r.processExpr(),H.Selectors.SliceSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.skipNewlines(),H.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0):r.processExpr()));let i=r.requireToken(H.Selectors.SRBracket);if(!i)return;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Q.Punctuator,0)}else if(H.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace))r.processCallArgs();else break}processPower(e=!1,n=!1){let r=this;r.processCallExpr(e,n),H.Selectors.Power(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Operator,0),r.next(),r.skipNewlines(),r.processCallExpr())}processAddressOf(e=!1,n=!1){let r=this;if(!H.Selectors.Reference(r.token))return r.processPower(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.skipNewlines(),r.processPower()}processNew(e=!1,n=!1){let r=this;if(!H.Selectors.New(r.token))return r.processAddressOf(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next(),r.skipNewlines(),r.processNew()}processUnaryMinus(e=!1,n=!1){let r=this;if(!H.Selectors.Minus(r.token))return r.processNew(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Operator,0),r.next(),r.skipNewlines(),r.processNew()}processMultDiv(e=!1,n=!1){let r=this;for(r.processUnaryMinus(e,n);H.SelectorGroups.MultiDivOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);Ft.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Operator,0),r.next(),r.skipNewlines(),r.processMultDiv()}processAddSub(e=!1,n=!1){let r=this;for(r.processBitwise(e,n);H.Selectors.Plus(r.token)||H.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r._lexer.isAtWhitespace());)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Operator,0),r.next(),r.skipNewlines(),r.processBitwise()}processComparisons(e=!1,n=!1){let r=this;if(r.processAddSub(e,n),!!H.SelectorGroups.ComparisonOperators(r.token))do r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Operator,0),r.next(),r.skipNewlines(),r.processAddSub();while(H.SelectorGroups.ComparisonOperators(r.token))}processBitwiseAnd(e=!1,n=!1){let r=this;for(r.processComparisons(e,n);Ft.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);Ft.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;if(r.processBitwiseOr(e,n),H.Selectors.Isa(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr();return}}processNot(e=!1,n=!1){let r=this;if(H.Selectors.Not(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next(),r.skipNewlines(),r.processIsa();return}r.processIsa(e,n)}processAnd(e=!1,n=!1){let r=this;for(r.processNot(e,n);H.Selectors.And(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next(),r.skipNewlines(),r.processNot()}processOr(e=!1,n=!1){let r=this;for(r.processAnd(e,n);H.Selectors.Or(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next(),r.skipNewlines(),r.processAnd()}processFunctionDeclaration(e=!1,n=!1){let r=this;if(!H.Selectors.Function(r.token))return r.processOr(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Keyword,0),r.next(),!H.SelectorGroups.BlockEndOfLine(r.token)){let i=r.requireToken(H.Selectors.LParenthesis);if(!i)return;for(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Q.Punctuator,0);!H.SelectorGroups.FunctionDeclarationArgEnd(r.token)&&(r.processIdentifier(!1,!0),r.consume(H.Selectors.Assign)&&(r._builder.push(r.previousToken.start.line-1,r.previousToken.start.character-1,r.previousToken.value.length,Q.Operator,0),r.processExpr()),!H.Selectors.RParenthesis(r.token));){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0);let o=r.requireToken(H.Selectors.ArgumentSeperator);if(!o)return;if(r._builder.push(o.start.line-1,o.start.character-1,o.value.length,Q.Punctuator,0),H.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Q.Punctuator,0);break}}let s=r.requireToken(H.Selectors.RParenthesis);if(!s)return;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Q.Punctuator,0)}}processExpr(e=!1,n=!1){this.processFunctionDeclaration(e,n)}processForShortcutStatement(){this.processShortcutStatement()}processForStatement(){let e=this;e.processIdentifier();let n=e.requireToken(H.Selectors.In);if(n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Q.Keyword,0),e.processExpr(),!H.SelectorGroups.BlockEndOfLine(e.token))){e.processForShortcutStatement();return}}processWhileShortcutStatement(){this.processShortcutStatement()}processWhileStatement(){let e=this;if(e.processExpr(),!H.SelectorGroups.BlockEndOfLine(e.token))return e.processWhileShortcutStatement()}processIfShortcutStatement(){let e=this;e.processShortcutStatement(),H.Selectors.Else(e.token)&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.Keyword,0),e.next(),e.processShortcutStatement())}processNextIfClause(e){let n=this;switch(e){case H.ASTType.ElseifClause:{n.processExpr();let r=n.requireToken(H.Selectors.Then);if(!r)return;n._builder.push(r.start.line-1,r.start.character-1,r.value.length,Q.Keyword,0);break}case H.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(H.Selectors.Then);if(n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Q.Keyword,0),!H.SelectorGroups.BlockEndOfLine(e.token))){e.processIfShortcutStatement();return}}processReturnStatement(){let e=this;H.SelectorGroups.ReturnStatementEnd(e.token)||e.processExpr()}processAssignment(){let e=this,n=e.token;if(e.processExpr(!0,!0),H.SelectorGroups.AssignmentEndOfExpr(e.token))return;if(H.Selectors.Assign(e.token)){e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.Operator,0),e.next(),e.processExpr();return}else if(H.SelectorGroups.AssignmentShorthand(e.token)){let i=e.token;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.Operator,0),e.next(),e.processExpr();return}let r=[];for(;!H.Selectors.EndOfFile(e.token)&&(e.processExpr(),!(H.SelectorGroups.BlockEndOfLine(e.token)||H.Selectors.Else(e.token)));){if(H.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let i=e.requireTokenOfAny(H.SelectorGroups.AssignmentCommandArgs);if(!i)return;if(H.Selectors.EndOfLine(i)||H.Selectors.EndOfFile(i))break}r.length}processShortcutStatement(){let e=this;if(H.TokenType.Keyword===e.token.type&&H.Keyword.Not!==e.token.value){let n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.Keyword,0),n){case H.Keyword.Return:e.next(),e.processReturnStatement();case H.Keyword.Continue:{e.next();return}case H.Keyword.Break:{e.next();return}default:}}return e.processAssignment()}processPathSegment(){let e=this;if(this.token.type===H.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,Q.String,0),this.next();return}let n="";for(;!Ft.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.String,0),n=n+e.token.value,e.next();return e.consumeMany(Ft.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Q.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(Ft.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Q.Keyword,0),e.processPathSegment())}processFeatureIncludeStatement(){this.processPathSegment()}processNativeImportCodeStatement(){let e=this;if(e.consume(H.Selectors.LParenthesis)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Q.Punctuator,0),H.TokenType.StringLiteral===e.token.type){let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Q.String,0),e.next()}else return;if(e.consume(H.Selectors.ImportCodeSeperator)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Q.Punctuator,0),!e.isType(H.TokenType.StringLiteral))return;let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Q.String,0),e.next()}e.consume(H.Selectors.RParenthesis)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Q.Punctuator,0)}}processKeyword(){let e=this,n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Q.Keyword,0),n){case H.Keyword.Return:{e.next(),e.processReturnStatement();return}case H.Keyword.If:{e.next(),e.processIfStatement();return}case H.Keyword.ElseIf:{e.next(),e.processNextIfClause(H.ASTType.ElseifClause);return}case H.Keyword.Else:{e.next(),e.processNextIfClause(H.ASTType.ElseClause);return}case H.Keyword.While:{e.next(),e.processWhileStatement();return}case H.Keyword.For:{e.next(),e.processForStatement();return}case H.Keyword.EndFunction:{e.next();return}case H.Keyword.EndFor:{e.next();return}case H.Keyword.EndWhile:{e.next();return}case H.Keyword.EndIf:{e.next();return}case H.Keyword.Continue:{e.next();return}case H.Keyword.Break:{e.next();return}case Ft.GreybelKeyword.Include:case Ft.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case Ft.GreybelKeyword.Import:case Ft.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case Ft.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case Ft.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case Ft.GreybelKeyword.Debugger:{e.next();return}}}processStatement(){let e=this;if(H.TokenType.Keyword===e.token.type&&H.Keyword.Not!==e.token.value){e.processKeyword();return}e.processAssignment()}process(){let e=this;for(e.next();!H.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!H.Selectors.EndOfFile(e.token));)e.processStatement()}};function eF(t,e){let n=new Ft.Lexer(e.content,{unsafe:!0});return new Yb(n,t).process(),t}Vn.buildTokens=eF});var WA=g(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.activate=void 0;var tF=cf();function nF(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,tF.buildTokens)(i,r),i.build()})}lf.activate=nF});var pf=g((uW,zA)=>{var cu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,rF=typeof AbortController=="function",df=rF?AbortController:class{constructor(){this.signal=new GA}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})}},iF=typeof AbortSignal=="function",sF=typeof df.AbortSignal=="function",GA=iF?AbortSignal:sF?df.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))}},ev=new Set,Jb=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;ff(n)&&tv(n,`${t} option`,`options.${e}`,Do)},Qb=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(ff(n)){let{prototype:r}=Do,{get:i}=Object.getOwnPropertyDescriptor(r,t);tv(n,`${t} method`,`cache.${e}()`,i)}},oF=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(ff(n)){let{prototype:r}=Do,{get:i}=Object.getOwnPropertyDescriptor(r,t);tv(n,`${t} property`,`cache.${e}`,i)}},KA=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},ff=t=>!ev.has(t),tv=(t,e,n,r)=>{ev.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;KA(i,"DeprecationWarning",t,r)},Ii=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),VA=t=>Ii(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Po:null:null,Po=class extends Array{constructor(e){super(e),this.fill(0)}},Zb=class{constructor(e){if(e===0)return[];let n=VA(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Do=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:d,noUpdateTTL:p,maxSize:y=0,maxEntrySize:_=0,sizeCalculation:E,fetchMethod:L,fetchContext:M,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:F,ignoreFetchAbort:C}=e,{length:V,maxAge:ce,stale:ye}=e instanceof t?{}:e;if(n!==0&&!Ii(n))throw new TypeError("max option must be a nonnegative integer");let K=n?VA(n):Array;if(!K)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=y,this.maxEntrySize=_||this.maxSize,this.sizeCalculation=E||V,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=L||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=M,!this.fetchMethod&&M!==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 K(n),this.prev=new K(n),this.head=0,this.tail=0,this.free=new Zb(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=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(this.maxSize!==0&&!Ii(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!Ii(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!ye,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ii(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ce||0,this.ttl){if(!Ii(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 A="LRU_CACHE_UNBOUNDED";ff(A)&&(ev.add(A),KA("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,t))}ye&&Jb("stale","allowStale"),ce&&Jb("maxAge","ttl"),V&&Jb("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Po(this.max),this.starts=new Po(this.max),this.setItemTTL=(r,i,s=cu.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?cu.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=cu.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 Po(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(!Ii(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!Ii(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 Qb("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=cu.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=cu.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 d=this.valList[l];if(n!==d){if(this.isBackgroundFetch(d)?d.__abortController.abort(new Error("replaced")):s||(this.dispose(d,e,"set"),this.disposeAfter&&this.disposed.push([d,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let p=d&&this.isBackgroundFetch(d)?d.__staleWhileFetching:d;p!==void 0&&(c.oldValue=p)}}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 df;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(y,_=!1)=>{let{aborted:E}=o.signal,L=r.ignoreFetchAbort&&y!==void 0;return r.status&&(E&&!_?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,L&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!L&&!_?l(o.signal.reason):(this.valList[n]===p&&(y===void 0?p.__staleWhileFetching?this.valList[n]=p.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,a.options))),y)},c=y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),l(y)),l=y=>{let{aborted:_}=o.signal,E=_&&r.allowStaleOnFetchAbort,L=E||r.allowStaleOnFetchRejection,M=L||r.noDeleteOnFetchRejection;if(this.valList[n]===p&&(!M||p.__staleWhileFetching===void 0?this.delete(e):E||(this.valList[n]=p.__staleWhileFetching)),L)return r.status&&p.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw y},d=(y,_)=>{this.fetchMethod(e,s,a).then(E=>y(E),_),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(),r.allowStaleOnFetchAbort&&(y=E=>u(E,!0)))})};r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,c);return p.__abortController=o,p.__staleWhileFetching=s,p.__returned=null,n===void 0?(this.set(e,p,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=p,p}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:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,fetchContext:_=this.fetchContext,forceRefresh:E=!1,status:L,signal:M}={}){if(!this.fetchMethod)return L&&(L.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:L});let x={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:L,signal:M},k=this.keyMap.get(e);if(k===void 0){L&&(L.fetch="miss");let v=this.backgroundFetch(e,k,x,_);return v.__returned=v}else{let v=this.valList[k];if(this.isBackgroundFetch(v)){let ye=n&&v.__staleWhileFetching!==void 0;return L&&(L.fetch="inflight",ye&&(L.returnedStale=!0)),ye?v.__staleWhileFetching:v.__returned=v}let F=this.isStale(k);if(!E&&!F)return L&&(L.fetch="hit"),this.moveToTail(k),r&&this.updateItemAge(k),this.statusTTL(L,k),v;let C=this.backgroundFetch(e,k,x,_),V=C.__staleWhileFetching!==void 0,ce=V&&n;return L&&(L.fetch=V&&F?"stale":"refresh",ce&&F&&(L.returnedStale=!0)),ce?C.__staleWhileFetching:C.__returned=C}}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 Qb("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 Qb("reset","clear"),this.clear}get length(){return oF("length","size"),this.size}static get AbortController(){return df}static get AbortSignal(){return GA}};zA.exports=Do});var t1=g((cW,e1)=>{var sv=Object.defineProperty,aF=Object.getOwnPropertyDescriptor,uF=Object.getOwnPropertyNames,cF=Object.prototype.hasOwnProperty,lF=(t,e)=>{for(var n in e)sv(t,n,{get:e[n],enumerable:!0})},dF=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uF(e))!cF.call(t,i)&&i!==n&&sv(t,i,{get:()=>e[i],enumerable:!(r=aF(e,i))||r.enumerable});return t},fF=t=>dF(sv({},"__esModule",{value:!0}),t),XA={};lF(XA,{ScheduleIntervalHelper:()=>nv,SchedulePostMessageHelper:()=>rv,ScheduleSetImmmediateHelper:()=>iv,schedule:()=>gF,scheduleProvider:()=>ZA});e1.exports=fF(XA);var pF=Promise.prototype.then.bind(Promise.resolve()),ov=class hf{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,hf.QUEUE_LIMIT);this.queue=this.queue.slice(hf.QUEUE_LIMIT);for(let r=0;r<n;pF(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=hf.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},nv=class YA extends ov{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new YA;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}},hF=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},rv=class JA extends ov{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!hF()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new JA;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}},iv=class QA extends ov{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new QA;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 ZA(){if(iv.isApplicable())return iv.createCallback();if(rv.isApplicable())return rv.createCallback();if(nv.isApplicable())return nv.createCallback();throw new Error("No schedule helper fulfills requirements!")}var gF=ZA()});var n1=g(On=>{"use strict";var cv=On&&On.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(On,"__esModule",{value:!0});On.DocumentManager=On.PROCESSING_TIMEOUT=On.ActiveDocument=On.DocumentURIBuilder=void 0;var mF=cv(require("events")),yF=Or(),bF=cv(pf()),av=t1(),Io=nf(),vF=cv(bo()),gf=class{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."),Io.Utils.joinPath(this.rootPath,e).toString()):Io.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return Io.Utils.joinPath(this.rootPath,e).toString()}};On.DocumentURIBuilder=gf;var mf=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 Io.Utils.joinPath(Io.URI.parse(this.textDocument.uri),"..")}async getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new gf(r,e),o=u=>u.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(u),s.getFromWorkspaceFolder(`${u}.src`)):i.fs.findExistingPath(s.getFromRootPath(u),s.getFromRootPath(`${u}.src`));return(await Promise.all([...n.imports.filter(u=>u.path).map(u=>o(u.path)),...n.includes.filter(u=>u.path).map(u=>o(u.path))])).filter(u=>u!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(Io.URI.parse(this.textDocument.uri)),n=await this.getImportsAndIncludes(e),r=new Set([...n]);return this.dependencies=Array.from(r),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))continue;let u=await this.documentManager.open(a);r.add(a),u!==null&&(n.add(u),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};On.ActiveDocument=mf;On.PROCESSING_TIMEOUT=100;var uv=class extends mF.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=On.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new bF.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,av.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,av.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 yF.Parser(n,{unsafe:!0}),i=r.parseChunk();return vF.default.analyze(e.uri,i),new mf({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,av.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)}};On.DocumentManager=uv});var r1=g(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.hash=void 0;function _F(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}yf.hash=_F});var a1=g(Mo=>{"use strict";var o1=Mo&&Mo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.DocumentMerger=void 0;var TF=o1(pf()),i1=o1(bo()),s1=r1(),lv=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new TF.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,s1.hash)(`${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,s1.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){let r=this.keyToDocumentUriMap.get(n);r&&this.results.delete(r),this.keyToDocumentUriMap.set(n,e)}async process(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=i1.default.get(i);if(r.set(i,null),!s)return null;let o=[],a=await n.documentManager.get(e).getImports(),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,i);let c=await n.documentManager.get(e).getDependencies();await Promise.all(c.map(async d=>{let p=n.documentManager.results.get(d);if(!p)return;let{document:y,textDocument:_}=p;if(!y)return;let E=await this.process(_,n,r);E!==null&&o.push(E)}));let l=s.merge(...o);return r.set(i,l),this.results.set(u,l),l}async build(e,n){let r=e.uri,i=i1.default.get(r);if(!i)return null;let s=[],o=await n.documentManager.get(e).getImports(),a=this.createCacheKey(e,o);if(this.results.has(a))return this.results.get(a);this.registerCacheKey(a,r);let u=await n.documentManager.get(e).getDependencies(),c=new Map([[r,null]]);await Promise.all(u.map(async d=>{let p=n.documentManager.results.get(d);if(!p)return;let{document:y,textDocument:_}=p;if(!y)return;let E=await this.process(_,n,c);E!==null&&s.push(E)}));let l=i.merge(...s);return this.results.set(a,l),l}};Mo.DocumentMerger=lv});var l1=g(Lo=>{"use strict";var SF=Lo&&Lo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.CoreContext=void 0;var kF=SF(require("events")),dv=Ws(),u1=cf();function c1(t){return{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??dv.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}}}}var fv=class extends kF.default{constructor(){super(),this._configuration=c1(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(dv.ConfigurationNamespace);this._configuration=c1(e)}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,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:dv.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:u1.semanticTokensLegend.tokenTypes,tokenModifiers:u1.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()}};Lo.CoreContext=fv});var bf=g(Z=>{"use strict";var xF=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]}),wF=Z&&Z.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),EF=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)&&xF(e,t,n);return wF(e,t),e},AF=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.typeAnalyzer=Z.lookupBase=Z.lookupIdentifier=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.activateSemantic=Z.activateSymbol=Z.activateSubscriptions=Z.activateSignature=Z.activateHover=Z.activateFormatter=Z.activateDiagnostic=Z.activateDefinition=Z.activateColor=Z.activateAutocomplete=Z.ConfigurationNamespace=Z.LanguageId=Z.IndentationType=void 0;var pv=Ws();Object.defineProperty(Z,"IndentationType",{enumerable:!0,get:function(){return pv.IndentationType}});Object.defineProperty(Z,"LanguageId",{enumerable:!0,get:function(){return pv.LanguageId}});Object.defineProperty(Z,"ConfigurationNamespace",{enumerable:!0,get:function(){return pv.ConfigurationNamespace}});var OF=WE();Object.defineProperty(Z,"activateAutocomplete",{enumerable:!0,get:function(){return OF.activate}});var CF=eA();Object.defineProperty(Z,"activateColor",{enumerable:!0,get:function(){return CF.activate}});var RF=nA();Object.defineProperty(Z,"activateDefinition",{enumerable:!0,get:function(){return RF.activate}});var PF=rA();Object.defineProperty(Z,"activateDiagnostic",{enumerable:!0,get:function(){return PF.activate}});var DF=CA();Object.defineProperty(Z,"activateFormatter",{enumerable:!0,get:function(){return DF.activate}});var IF=LA();Object.defineProperty(Z,"activateHover",{enumerable:!0,get:function(){return IF.activate}});var MF=qA();Object.defineProperty(Z,"activateSignature",{enumerable:!0,get:function(){return MF.activate}});var LF=FA();Object.defineProperty(Z,"activateSubscriptions",{enumerable:!0,get:function(){return LF.activate}});var NF=BA();Object.defineProperty(Z,"activateSymbol",{enumerable:!0,get:function(){return NF.activate}});var qF=WA();Object.defineProperty(Z,"activateSemantic",{enumerable:!0,get:function(){return qF.activate}});Z.ASTScraper=EF(eb());var d1=n1();Object.defineProperty(Z,"ActiveDocument",{enumerable:!0,get:function(){return d1.ActiveDocument}});Object.defineProperty(Z,"DocumentManager",{enumerable:!0,get:function(){return d1.DocumentManager}});var jF=a1();Object.defineProperty(Z,"DocumentMerger",{enumerable:!0,get:function(){return jF.DocumentMerger}});var FF=_o();Object.defineProperty(Z,"LookupHelper",{enumerable:!0,get:function(){return FF.LookupHelper}});var $F=sf();Object.defineProperty(Z,"MarkdownString",{enumerable:!0,get:function(){return $F.MarkdownString}});var ms=of();Object.defineProperty(Z,"createHover",{enumerable:!0,get:function(){return ms.createHover}});Object.defineProperty(Z,"createSignatureInfo",{enumerable:!0,get:function(){return ms.createSignatureInfo}});Object.defineProperty(Z,"createTooltipHeader",{enumerable:!0,get:function(){return ms.createTooltipHeader}});Object.defineProperty(Z,"formatDefaultValue",{enumerable:!0,get:function(){return ms.formatDefaultValue}});Object.defineProperty(Z,"formatTypes",{enumerable:!0,get:function(){return ms.formatTypes}});Object.defineProperty(Z,"appendTooltipBody",{enumerable:!0,get:function(){return ms.appendTooltipBody}});Object.defineProperty(Z,"appendTooltipHeader",{enumerable:!0,get:function(){return ms.appendTooltipHeader}});var hv=bo();Object.defineProperty(Z,"lookupIdentifier",{enumerable:!0,get:function(){return hv.lookupIdentifier}});Object.defineProperty(Z,"lookupBase",{enumerable:!0,get:function(){return hv.lookupBase}});Object.defineProperty(Z,"typeAnalyzer",{enumerable:!0,get:function(){return AF(hv).default}});var f1=cf();Object.defineProperty(Z,"semanticTokensLegend",{enumerable:!0,get:function(){return f1.semanticTokensLegend}});Object.defineProperty(Z,"buildTokens",{enumerable:!0,get:function(){return f1.buildTokens}});var BF=l1();Object.defineProperty(Z,"CoreContext",{enumerable:!0,get:function(){return BF.CoreContext}})});var m1={};A1(m1,{TextDocument:()=>gv});function mv(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);mv(r,e),mv(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 p1(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);h1(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function h1(t){return t===13||t===10}function g1(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 UF(t){let e=g1(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var vf,gv,y1=E1(()=>{"use strict";vf=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=g1(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=p1(r.text,!1,s);if(u-a===l.length)for(let p=0,y=l.length;p<y;p++)c[p+a+1]=l[p];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 d=r.text.length-(o-s);if(d!==0)for(let p=a+1+l.length,y=c.length;p<y;p++)c[p]=c[p]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=p1(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&&h1(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 vf(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof vf)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=mv(s.map(UF),(l,d)=>{let p=l.range.start.line-d.range.start.line;return p===0?l.range.start.character-d.range.start.character:p}),u=0,c=[];for(let l of a){let d=i.offsetAt(l.range.start);if(d<u)throw new Error("Overlapping edit");d>u&&c.push(o.substring(u,d)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(gv||(gv={}))});var v1=g(No=>{"use strict";var vv=No&&No.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(No,"__esModule",{value:!0});No.FileSystem=void 0;var HF=_h(),b1=(y1(),C1(m1)),WF=vv(require("events")),yv=nf(),GF=vv(require("fs")),KF=bf(),VF=vv(pf()),bv=class extends WF.default{constructor(e){super(),this._context=e,this._textDocumentManager=new HF.TextDocuments(b1.TextDocument),this._tempTextDocumentCache=new VF.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=>yv.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async findExistingPath(...e){if(e.length===0)return null;for(let n=0;n<e.length;n++)if(await this.getTextDocument(e[n])!=null)return e[n];return null}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=yv.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await GF.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=b1.TextDocument.create(e,KF.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(yv.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)})}};No.FileSystem=bv});var _1=g(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.NodeContext=void 0;var _v=_h(),Tv=bf(),zF=v1(),Sv=class extends Tv.CoreContext{constructor(){super(),this.documentManager=new Tv.DocumentManager().setContext(this),this.documentMerger=new Tv.DocumentMerger,this.connection=(0,_v.createConnection)(_v.ProposedFeatures.all),this.fs=new zF.FileSystem(this)}createSemanticTokensBuilder(){return new _v.SemanticTokensBuilder}};_f.NodeContext=Sv});Object.defineProperty(exports,"__esModule",{value:!0});var XF=_1(),Rr=bf(),T1=new XF.NodeContext;T1.on("ready",t=>{(0,Rr.activateAutocomplete)(t),(0,Rr.activateColor)(t),(0,Rr.activateDefinition)(t),(0,Rr.activateDiagnostic)(t),(0,Rr.activateFormatter)(t),(0,Rr.activateHover)(t),(0,Rr.activateSignature)(t),(0,Rr.activateSubscriptions)(t),(0,Rr.activateSymbol)(t),(0,Rr.activateSemantic)(t)});T1.listen();