miniscript-languageserver 1.6.2 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +22 -0
  2. package/index.js +108 -106
  3. package/package.json +5 -4
package/index.js CHANGED
@@ -1,168 +1,168 @@
1
- "use strict";var Pf=Object.defineProperty;var q1=Object.getOwnPropertyDescriptor;var j1=Object.getOwnPropertyNames;var F1=Object.prototype.hasOwnProperty;var $1=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),B1=(t,e)=>{for(var n in e)Pf(t,n,{get:e[n],enumerable:!0})},U1=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of j1(e))!F1.call(t,i)&&i!==n&&Pf(t,i,{get:()=>e[i],enumerable:!(r=q1(e,i))||r.enumerable});return t};var H1=t=>U1(Pf({},"__esModule",{value:!0}),t);var Pu=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 W1(t){return t===!0||t===!1}St.boolean=W1;function Uv(t){return typeof t=="string"||t instanceof String}St.string=Uv;function G1(t){return typeof t=="number"||t instanceof Number}St.number=G1;function K1(t){return t instanceof Error}St.error=K1;function Hv(t){return typeof t=="function"}St.func=Hv;function Wv(t){return Array.isArray(t)}St.array=Wv;function V1(t){return Wv(t)&&t.every(e=>Uv(e))}St.stringArray=V1;function z1(t,e){return Array.isArray(t)&&t.every(e)}St.typedArray=z1;function X1(t){return t&&Hv(t.then)}St.thenable=X1});var xs=g(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.stringArray=Wt.array=Wt.func=Wt.error=Wt.number=Wt.string=Wt.boolean=void 0;function Y1(t){return t===!0||t===!1}Wt.boolean=Y1;function Gv(t){return typeof t=="string"||t instanceof String}Wt.string=Gv;function J1(t){return typeof t=="number"||t instanceof Number}Wt.number=J1;function Q1(t){return t instanceof Error}Wt.error=Q1;function Z1(t){return typeof t=="function"}Wt.func=Z1;function Kv(t){return Array.isArray(t)}Wt.array=Kv;function eO(t){return Kv(t)&&t.every(e=>Gv(e))}Wt.stringArray=eO});var np=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 ji=xs(),Df;(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})(Df||(ie.ErrorCodes=Df={}));var If=class t extends Error{constructor(e,n,r){super(n),this.code=ji.number(e)?e:Df.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=If;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 Mf=class extends Ye{constructor(e){super(e,0)}};ie.RequestType0=Mf;var Lf=class extends Ye{constructor(e,n=ln.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.RequestType=Lf;var Nf=class extends Ye{constructor(e,n=ln.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.RequestType1=Nf;var qf=class extends Ye{constructor(e){super(e,2)}};ie.RequestType2=qf;var jf=class extends Ye{constructor(e){super(e,3)}};ie.RequestType3=jf;var Ff=class extends Ye{constructor(e){super(e,4)}};ie.RequestType4=Ff;var $f=class extends Ye{constructor(e){super(e,5)}};ie.RequestType5=$f;var Bf=class extends Ye{constructor(e){super(e,6)}};ie.RequestType6=Bf;var Uf=class extends Ye{constructor(e){super(e,7)}};ie.RequestType7=Uf;var Hf=class extends Ye{constructor(e){super(e,8)}};ie.RequestType8=Hf;var Wf=class extends Ye{constructor(e){super(e,9)}};ie.RequestType9=Wf;var Gf=class extends Ye{constructor(e,n=ln.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.NotificationType=Gf;var Kf=class extends Ye{constructor(e){super(e,0)}};ie.NotificationType0=Kf;var Vf=class extends Ye{constructor(e,n=ln.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.NotificationType1=Vf;var zf=class extends Ye{constructor(e){super(e,2)}};ie.NotificationType2=zf;var Xf=class extends Ye{constructor(e){super(e,3)}};ie.NotificationType3=Xf;var Yf=class extends Ye{constructor(e){super(e,4)}};ie.NotificationType4=Yf;var Jf=class extends Ye{constructor(e){super(e,5)}};ie.NotificationType5=Jf;var Qf=class extends Ye{constructor(e){super(e,6)}};ie.NotificationType6=Qf;var Zf=class extends Ye{constructor(e){super(e,7)}};ie.NotificationType7=Zf;var ep=class extends Ye{constructor(e){super(e,8)}};ie.NotificationType8=ep;var tp=class extends Ye{constructor(e){super(e,9)}};ie.NotificationType9=tp;var Vv;(function(t){function e(i){let s=i;return s&&ji.string(s.method)&&(ji.string(s.id)||ji.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&ji.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(ji.string(s.id)||ji.number(s.id)||s.id===null)}t.isResponse=r})(Vv||(ie.Message=Vv={}))});var ip=g(ei=>{"use strict";var zv;Object.defineProperty(ei,"__esModule",{value:!0});ei.LRUCache=ei.LinkedMap=ei.Touch=void 0;var Gt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Gt||(ei.Touch=Gt={}));var Du=class{constructor(){this[zv]="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=Gt.None){let r=this._map.get(e);if(r)return n!==Gt.None&&this.touch(r,n),r.value}set(e,n,r=Gt.None){let i=this._map.get(e);if(i)i.value=n,r!==Gt.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Gt.None:this.addItemLast(i);break;case Gt.First:this.addItemFirst(i);break;case Gt.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}[(zv=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!==Gt.First&&n!==Gt.Last)){if(n===Gt.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===Gt.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)}};ei.LinkedMap=Du;var rp=class extends Du{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=Gt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Gt.None)}set(e,n){return super.set(e,n,Gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};ei.LRUCache=rp});var Yv=g(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.Disposable=void 0;var Xv;(function(t){function e(n){return{dispose:n}}t.create=e})(Xv||(Iu.Disposable=Xv={}))});var ti=g(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var sp;function op(){if(sp===void 0)throw new Error("No runtime abstraction layer installed");return sp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");sp=n}t.install=e})(op||(op={}));ap.default=op});var Es=g(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.Emitter=ws.Event=void 0;var tO=ti(),Jv;(function(t){let e={dispose(){}};t.None=function(){return e}})(Jv||(ws.Event=Jv={}));var up=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,tO.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Mu=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new up),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)}};ws.Emitter=Mu;Mu._noop=function(){}});var qu=g(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.CancellationTokenSource=As.CancellationToken=void 0;var nO=ti(),rO=xs(),cp=Es(),Lu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:cp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:cp.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})(Lu||(As.CancellationToken=Lu={}));var iO=Object.freeze(function(t,e){let n=(0,nO.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),Nu=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?iO:(this._emitter||(this._emitter=new cp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},lp=class{get token(){return this._token||(this._token=new Nu),this._token}cancel(){this._token?this._token.cancel():this._token=Lu.Cancelled}dispose(){this._token?this._token instanceof Nu&&this._token.dispose():this._token=Lu.None}};As.CancellationTokenSource=lp});var Qv=g(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.SharedArrayReceiverStrategy=Os.SharedArraySenderStrategy=void 0;var sO=qu(),Vo;(function(t){t.Continue=0,t.Cancelled=1})(Vo||(Vo={}));var dp=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]=Vo.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,Vo.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Os.SharedArraySenderStrategy=dp;var fp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Vo.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},pp=class{constructor(e){this.token=new fp(e)}cancel(){}dispose(){}},hp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new sO.CancellationTokenSource:new pp(n)}};Os.SharedArrayReceiverStrategy=hp});var mp=g(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.Semaphore=void 0;var oO=ti(),gp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((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,oO.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()}}};ju.Semaphore=gp});var e_=g(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.ReadableStreamMessageReader=ni.AbstractMessageReader=ni.MessageReader=void 0;var bp=ti(),Cs=xs(),yp=Es(),aO=mp(),Zv;(function(t){function e(n){let r=n;return r&&Cs.func(r.listen)&&Cs.func(r.dispose)&&Cs.func(r.onError)&&Cs.func(r.onClose)&&Cs.func(r.onPartialMessage)}t.is=e})(Zv||(ni.MessageReader=Zv={}));var Fu=class{constructor(){this.errorEmitter=new yp.Emitter,this.closeEmitter=new yp.Emitter,this.partialMessageEmitter=new yp.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: ${Cs.string(e.message)?e.message:"unknown"}`)}};ni.AbstractMessageReader=Fu;var vp;(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,bp.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(vp||(vp={}));var _p=class extends Fu{constructor(e,n){super(),this.readable=e,this.options=vp.fromOptions(n),this.buffer=(0,bp.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new aO.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,bp.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))}};ni.ReadableStreamMessageReader=_p});var s_=g(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.WriteableStreamMessageWriter=ri.AbstractMessageWriter=ri.MessageWriter=void 0;var t_=ti(),zo=xs(),uO=mp(),n_=Es(),cO="Content-Length: ",r_=`\r
3
- `,i_;(function(t){function e(n){let r=n;return r&&zo.func(r.dispose)&&zo.func(r.onClose)&&zo.func(r.onError)&&zo.func(r.write)}t.is=e})(i_||(ri.MessageWriter=i_={}));var $u=class{constructor(){this.errorEmitter=new n_.Emitter,this.closeEmitter=new n_.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: ${zo.string(e.message)?e.message:"unknown"}`)}};ri.AbstractMessageWriter=$u;var Tp;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,t_.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,t_.default)().applicationJson.encoder}}t.fromOptions=e})(Tp||(Tp={}));var Sp=class extends $u{constructor(e,n){super(),this.writable=e,this.options=Tp.fromOptions(n),this.errorCount=0,this.writeSemaphore=new uO.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(cO,r.byteLength.toString(),r_),i.push(r_),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()}};ri.WriteableStreamMessageWriter=Sp});var o_=g(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.AbstractMessageBuffer=void 0;var lO=13,dO=10,fO=`\r
4
- `,kp=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 lO:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case dO: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),b=l.substr(d+1).trim();a.set(e?p.toLowerCase():p,b)}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}};Bu.AbstractMessageBuffer=kp});var d_=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 a_=ti(),ot=xs(),de=np(),u_=ip(),Xo=Es(),xp=qu(),Qo;(function(t){t.type=new de.NotificationType("$/cancelRequest")})(Qo||(Qo={}));var wp;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(wp||(ve.ProgressToken=wp={}));var Yo;(function(t){t.type=new de.NotificationType("$/progress")})(Yo||(Yo={}));var Ep=class{constructor(){}};ve.ProgressType=Ep;var Ap;(function(t){function e(n){return ot.func(n)}t.is=e})(Ap||(Ap={}));ve.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ne;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ne||(ve.Trace=Ne={}));var c_;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(c_||(ve.TraceValues=c_={}));(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})(Ne||(ve.Trace=Ne={}));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 Op;(function(t){t.type=new de.NotificationType("$/setTrace")})(Op||(ve.SetTraceNotification=Op={}));var Uu;(function(t){t.type=new de.NotificationType("$/logTrace")})(Uu||(ve.LogTraceNotification=Uu={}));var Jo;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Jo||(ve.ConnectionErrors=Jo={}));var Rs=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ve.ConnectionError=Rs;var Cp;(function(t){function e(n){let r=n;return r&&ot.func(r.cancelUndispatched)}t.is=e})(Cp||(ve.ConnectionStrategy=Cp={}));var Hu;(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})(Hu||(ve.IdCancellationReceiverStrategy=Hu={}));var Rp;(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})(Rp||(ve.RequestCancellationReceiverStrategy=Rp={}));var Wu;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new xp.CancellationTokenSource}});function e(n){return Hu.is(n)||Rp.is(n)}t.is=e})(Wu||(ve.CancellationReceiverStrategy=Wu={}));var Gu;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Qo.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&ot.func(r.sendCancellation)&&ot.func(r.cleanup)}t.is=e})(Gu||(ve.CancellationSenderStrategy=Gu={}));var Ku;(function(t){t.Message=Object.freeze({receiver:Wu.Message,sender:Gu.Message});function e(n){let r=n;return r&&Wu.is(r.receiver)&&Gu.is(r.sender)}t.is=e})(Ku||(ve.CancellationStrategy=Ku={}));var Vu;(function(t){function e(n){let r=n;return r&&ot.func(r.handleMessage)}t.is=e})(Vu||(ve.MessageStrategy=Vu={}));var l_;(function(t){function e(n){let r=n;return r&&(Ku.is(r.cancellationStrategy)||Cp.is(r.connectionStrategy)||Vu.is(r.messageStrategy))}t.is=e})(l_||(ve.ConnectionOptions=l_={}));var Qn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Qn||(Qn={}));function pO(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,b=new Map,_,E=new u_.LinkedMap,L=new Map,M=new Set,x=new Map,k=Ne.Off,v=_n.Text,F,C=Qn.New,V=new Xo.Emitter,ce=new Xo.Emitter,ye=new Xo.Emitter,K=new Xo.Emitter,A=new Xo.Emitter,D=r&&r.cancellationStrategy?r.cancellationStrategy:Ku.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,$){de.Message.isRequest($)?T.set(I($.id),$):de.Message.isResponse($)?T.set(j($.id),$):T.set(he(),$)}function Dt(T){}function mt(){return C===Qn.Listening}function $e(){return C===Qn.Closed}function cn(){return C===Qn.Disposed}function vs(){(C===Qn.New||C===Qn.Listening)&&(C=Qn.Closed,ce.fire(void 0))}function Ni(T){V.fire([T,void 0,void 0])}function yu(T){V.fire(T)}t.onClose(vs),t.onError(Ni),e.onClose(vs),e.onError(yu);function Uo(){_||E.size===0||(_=(0,a_.default)().timer.setImmediate(()=>{_=void 0,bu()}))}function Ho(T){de.Message.isRequest(T)?_u(T):de.Message.isNotification(T)?Su(T):de.Message.isResponse(T)?Tu(T):_s(T)}function bu(){if(E.size===0)return;let T=E.shift();try{let $=r?.messageStrategy;Vu.is($)?$.handleMessage(T,Ho):Ho(T)}finally{Uo()}}let vu=T=>{try{if(de.Message.isNotification(T)&&T.method===Qo.type.method){let $=T.params.id,z=I($),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($),Xe.id=te.id,qi(Xe,T.method,Date.now()),e.write(Xe).catch(()=>i.error("Sending response for canceled message failed."));return}}let We=x.get($);if(We!==void 0){We.cancel(),Ts(T);return}else M.add($)}fe(E,T)}finally{Uo()}};function _u(T){if(cn())return;function $(xe,Ge,De){let ut={jsonrpc:u,id:T.id};xe instanceof de.ResponseError?ut.error=xe.toJson():ut.result=xe===void 0?null:xe,qi(ut,Ge,De),e.write(ut).catch(()=>i.error("Sending response failed."))}function z(xe,Ge,De){let ut={jsonrpc:u,id:T.id,error:xe.toJson()};qi(ut,Ge,De),e.write(ut).catch(()=>i.error("Sending response failed."))}function te(xe,Ge,De){xe===void 0&&(xe=null);let ut={jsonrpc:u,id:T.id,result:xe};qi(ut,Ge,De),e.write(ut).catch(()=>i.error("Sending response failed."))}wu(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=Hu.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 De;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}De=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}De=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}De=Xe(T.params,Ge.token)}else c&&(De=c(T.method,T.params,Ge.token));let ut=De;De?ut.then?ut.then(It=>{x.delete(xe),$(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),$(De,T.method,tt)):(x.delete(xe),te(De,T.method,tt))}catch(De){x.delete(xe),De instanceof de.ResponseError?$(De,T.method,tt):De&&ot.string(De.message)?z(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${De.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 Tu(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 $=T.id,z=L.get($);if(Eu(T,z),z!==void 0){L.delete($);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 Su(T){if(cn())return;let $,z;if(T.method===Qo.type.method){let te=T.params.id;M.delete(te),Ts(T);return}else{let te=p.get(T.method);te&&(z=te.handler,$=te.type)}if(z||d)try{if(Ts(T),z)if(T.params===void 0)$!==void 0&&$.numberOfParams!==0&&$.parameterStructures!==de.ParameterStructures.byName&&i.error(`Notification ${T.method} defines ${$.numberOfParams} params but received none.`),z();else if(Array.isArray(T.params)){let te=T.params;T.method===Yo.type.method&&te.length===2&&wp.is(te[0])?z({token:te[0],value:te[1]}):($!==void 0&&($.parameterStructures===de.ParameterStructures.byName&&i.error(`Notification ${T.method} defines parameters by name but received parameters by position`),$.numberOfParams!==T.params.length&&i.error(`Notification ${T.method} defines ${$.numberOfParams} params but received ${te.length} arguments`)),z(...te))}else $!==void 0&&$.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 _s(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 $=T;if(ot.string($.id)||ot.number($.id)){let z=$.id,te=L.get(z);te&&te.reject(new Error("The received response has neither a result nor an error property."))}}function Xn(T){if(T!=null)switch(k){case Ne.Verbose:return JSON.stringify(T,null,4);case Ne.Compact:return JSON.stringify(T);default:return}}function ku(T){if(!(k===Ne.Off||!F))if(v===_n.Text){let $;(k===Ne.Verbose||k===Ne.Compact)&&T.params&&($=`Params: ${Xn(T.params)}
1
+ "use strict";var mp=Object.defineProperty;var iP=Object.getOwnPropertyDescriptor;var oP=Object.getOwnPropertyNames;var aP=Object.prototype.hasOwnProperty;var uP=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lP=(t,e)=>{for(var n in e)mp(t,n,{get:e[n],enumerable:!0})},cP=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of oP(e))!aP.call(t,s)&&s!==n&&mp(t,s,{get:()=>e[s],enumerable:!(r=iP(e,s))||r.enumerable});return t};var hP=t=>cP(mp({},"__esModule",{value:!0}),t);var Ml=m(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.thenable=Et.typedArray=Et.stringArray=Et.array=Et.func=Et.error=Et.number=Et.string=Et.boolean=void 0;function fP(t){return t===!0||t===!1}Et.boolean=fP;function sS(t){return typeof t=="string"||t instanceof String}Et.string=sS;function dP(t){return typeof t=="number"||t instanceof Number}Et.number=dP;function pP(t){return t instanceof Error}Et.error=pP;function iS(t){return typeof t=="function"}Et.func=iS;function oS(t){return Array.isArray(t)}Et.array=oS;function gP(t){return oS(t)&&t.every(e=>sS(e))}Et.stringArray=gP;function mP(t,e){return Array.isArray(t)&&t.every(e)}Et.typedArray=mP;function yP(t){return t&&iS(t.then)}Et.thenable=yP});var to=m(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.stringArray=Zt.array=Zt.func=Zt.error=Zt.number=Zt.string=Zt.boolean=void 0;function bP(t){return t===!0||t===!1}Zt.boolean=bP;function aS(t){return typeof t=="string"||t instanceof String}Zt.string=aS;function vP(t){return typeof t=="number"||t instanceof Number}Zt.number=vP;function _P(t){return t instanceof Error}Zt.error=_P;function TP(t){return typeof t=="function"}Zt.func=TP;function uS(t){return Array.isArray(t)}Zt.array=uS;function SP(t){return uS(t)&&t.every(e=>aS(e))}Zt.stringArray=SP});var Bp=m(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.Message=oe.NotificationType9=oe.NotificationType8=oe.NotificationType7=oe.NotificationType6=oe.NotificationType5=oe.NotificationType4=oe.NotificationType3=oe.NotificationType2=oe.NotificationType1=oe.NotificationType0=oe.NotificationType=oe.RequestType9=oe.RequestType8=oe.RequestType7=oe.RequestType6=oe.RequestType5=oe.RequestType4=oe.RequestType3=oe.RequestType2=oe.RequestType1=oe.RequestType=oe.RequestType0=oe.AbstractMessageSignature=oe.ParameterStructures=oe.ResponseError=oe.ErrorCodes=void 0;var ci=to(),yp;(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})(yp||(oe.ErrorCodes=yp={}));var bp=class t extends Error{constructor(e,n,r){super(n),this.code=ci.number(e)?e:yp.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}};oe.ResponseError=bp;var Tn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};oe.ParameterStructures=Tn;Tn.auto=new Tn("auto");Tn.byPosition=new Tn("byPosition");Tn.byName=new Tn("byName");var Ze=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return Tn.auto}};oe.AbstractMessageSignature=Ze;var vp=class extends Ze{constructor(e){super(e,0)}};oe.RequestType0=vp;var _p=class extends Ze{constructor(e,n=Tn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.RequestType=_p;var Tp=class extends Ze{constructor(e,n=Tn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.RequestType1=Tp;var Sp=class extends Ze{constructor(e){super(e,2)}};oe.RequestType2=Sp;var kp=class extends Ze{constructor(e){super(e,3)}};oe.RequestType3=kp;var wp=class extends Ze{constructor(e){super(e,4)}};oe.RequestType4=wp;var xp=class extends Ze{constructor(e){super(e,5)}};oe.RequestType5=xp;var Ep=class extends Ze{constructor(e){super(e,6)}};oe.RequestType6=Ep;var Ap=class extends Ze{constructor(e){super(e,7)}};oe.RequestType7=Ap;var Op=class extends Ze{constructor(e){super(e,8)}};oe.RequestType8=Op;var Cp=class extends Ze{constructor(e){super(e,9)}};oe.RequestType9=Cp;var Rp=class extends Ze{constructor(e,n=Tn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.NotificationType=Rp;var Pp=class extends Ze{constructor(e){super(e,0)}};oe.NotificationType0=Pp;var Dp=class extends Ze{constructor(e,n=Tn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.NotificationType1=Dp;var Ip=class extends Ze{constructor(e){super(e,2)}};oe.NotificationType2=Ip;var Mp=class extends Ze{constructor(e){super(e,3)}};oe.NotificationType3=Mp;var Lp=class extends Ze{constructor(e){super(e,4)}};oe.NotificationType4=Lp;var Np=class extends Ze{constructor(e){super(e,5)}};oe.NotificationType5=Np;var qp=class extends Ze{constructor(e){super(e,6)}};oe.NotificationType6=qp;var jp=class extends Ze{constructor(e){super(e,7)}};oe.NotificationType7=jp;var Fp=class extends Ze{constructor(e){super(e,8)}};oe.NotificationType8=Fp;var $p=class extends Ze{constructor(e){super(e,9)}};oe.NotificationType9=$p;var lS;(function(t){function e(s){let i=s;return i&&ci.string(i.method)&&(ci.string(i.id)||ci.number(i.id))}t.isRequest=e;function n(s){let i=s;return i&&ci.string(i.method)&&s.id===void 0}t.isNotification=n;function r(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(ci.string(i.id)||ci.number(i.id)||i.id===null)}t.isResponse=r})(lS||(oe.Message=lS={}))});var Wp=m(ks=>{"use strict";var cS;Object.defineProperty(ks,"__esModule",{value:!0});ks.LRUCache=ks.LinkedMap=ks.Touch=void 0;var en;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(en||(ks.Touch=en={}));var Ll=class{constructor(){this[cS]="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=en.None){let r=this._map.get(e);if(r)return n!==en.None&&this.touch(r,n),r.value}set(e,n,r=en.None){let s=this._map.get(e);if(s)s.value=n,r!==en.None&&this.touch(s,r);else{switch(s={key:e,value:n,next:void 0,previous:void 0},r){case en.None:this.addItemLast(s);break;case en.First:this.addItemFirst(s);break;case en.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let 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,s=this._head;for(;s;){if(n?e.bind(n)(s.value,s.key,this):e(s.value,s.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}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 s={value:n.value,done:!1};return n=n.next,s}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 s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return r}[(cS=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!==en.First&&n!==en.Last)){if(n===en.First){if(e===this._head)return;let r=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(r.previous=s,s.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===en.Last){if(e===this._tail)return;let r=e.next,s=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=s,s.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};ks.LinkedMap=Ll;var Up=class extends Ll{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=en.AsNew){return super.get(e,n)}peek(e){return super.get(e,en.None)}set(e,n){return super.set(e,n,en.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};ks.LRUCache=Up});var fS=m(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.Disposable=void 0;var hS;(function(t){function e(n){return{dispose:n}}t.create=e})(hS||(Nl.Disposable=hS={}))});var ws=m(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});var Hp;function Gp(){if(Hp===void 0)throw new Error("No runtime abstraction layer installed");return Hp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Hp=n}t.install=e})(Gp||(Gp={}));zp.default=Gp});var ro=m(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.Emitter=no.Event=void 0;var kP=ws(),dS;(function(t){let e={dispose(){}};t.None=function(){return e}})(dS||(no.Event=dS={}));var Kp=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 s=0,i=this._callbacks.length;s<i;s++)if(this._callbacks[s]===e)if(this._contexts[s]===n){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=r.length;i<o;i++)try{n.push(r[i].apply(s[i],e))}catch(a){(0,kP.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ql=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Kp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),s.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};no.Emitter=ql;ql._noop=function(){}});var $l=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CancellationTokenSource=so.CancellationToken=void 0;var wP=ws(),xP=to(),Vp=ro(),jl;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Vp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Vp.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||xP.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(jl||(so.CancellationToken=jl={}));var EP=Object.freeze(function(t,e){let n=(0,wP.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),Fl=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?EP:(this._emitter||(this._emitter=new Vp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Xp=class{get token(){return this._token||(this._token=new Fl),this._token}cancel(){this._token?this._token.cancel():this._token=jl.Cancelled}dispose(){this._token?this._token instanceof Fl&&this._token.dispose():this._token=jl.None}};so.CancellationTokenSource=Xp});var pS=m(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.SharedArrayReceiverStrategy=io.SharedArraySenderStrategy=void 0;var AP=$l(),Oa;(function(t){t.Continue=0,t.Cancelled=1})(Oa||(Oa={}));var Yp=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Oa.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let s=new Int32Array(r,0,1);Atomics.store(s,0,Oa.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};io.SharedArraySenderStrategy=Yp;var Jp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Oa.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Qp=class{constructor(e){this.token=new Jp(e)}cancel(){}dispose(){}},Zp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new AP.CancellationTokenSource:new Qp(n)}};io.SharedArrayReceiverStrategy=Zp});var tg=m(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.Semaphore=void 0;var OP=ws(),eg=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,OP.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()}}};Bl.Semaphore=eg});var mS=m(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.ReadableStreamMessageReader=xs.AbstractMessageReader=xs.MessageReader=void 0;var rg=ws(),oo=to(),ng=ro(),CP=tg(),gS;(function(t){function e(n){let r=n;return r&&oo.func(r.listen)&&oo.func(r.dispose)&&oo.func(r.onError)&&oo.func(r.onClose)&&oo.func(r.onPartialMessage)}t.is=e})(gS||(xs.MessageReader=gS={}));var Ul=class{constructor(){this.errorEmitter=new ng.Emitter,this.closeEmitter=new ng.Emitter,this.partialMessageEmitter=new ng.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: ${oo.string(e.message)?e.message:"unknown"}`)}};xs.AbstractMessageReader=Ul;var sg;(function(t){function e(n){let r,s,i,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&&(i=n.contentDecoder,o.set(i.name,i)),n.contentDecoders!==void 0)for(let l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let l of n.contentTypeDecoders)u.set(l.name,l)}return a===void 0&&(a=(0,rg.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(sg||(sg={}));var ig=class extends Ul{constructor(e,n){super(),this.readable=e,this.options=sg.fromOptions(n),this.buffer=(0,rg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new CP.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 s=r.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
2
+ ${JSON.stringify(Object.fromEntries(r))}`));return}let i=parseInt(s);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=i}let 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,s=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(s)}).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,rg.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))}};xs.ReadableStreamMessageReader=ig});var TS=m(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.WriteableStreamMessageWriter=Es.AbstractMessageWriter=Es.MessageWriter=void 0;var yS=ws(),Ca=to(),RP=tg(),bS=ro(),PP="Content-Length: ",vS=`\r
3
+ `,_S;(function(t){function e(n){let r=n;return r&&Ca.func(r.dispose)&&Ca.func(r.onClose)&&Ca.func(r.onError)&&Ca.func(r.write)}t.is=e})(_S||(Es.MessageWriter=_S={}));var Wl=class{constructor(){this.errorEmitter=new bS.Emitter,this.closeEmitter=new bS.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: ${Ca.string(e.message)?e.message:"unknown"}`)}};Es.AbstractMessageWriter=Wl;var og;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,yS.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,yS.default)().applicationJson.encoder}}t.fromOptions=e})(og||(og={}));var ag=class extends Wl{constructor(e,n){super(),this.writable=e,this.options=og.fromOptions(n),this.errorCount=0,this.writeSemaphore=new RP.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let s=[];return s.push(PP,r.byteLength.toString(),vS),s.push(vS),this.doWrite(e,s,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(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};Es.WriteableStreamMessageWriter=ag});var SS=m(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.AbstractMessageBuffer=void 0;var DP=13,IP=10,MP=`\r
4
+ `,ug=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,s=0,i=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(s=0;s<l.length;){switch(l[s]){case DP:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case IP:switch(n){case 1:n=2;break;case 3:n=4,s++;break e;default:n=0}break;default:n=0}s++}i+=l.byteLength,r++}if(n!==4)return;let o=this._read(i+s),a=new Map,u=this.toString(o,"ascii").split(MP);if(u.length<2)return a;for(let l=0;l<u.length-2;l++){let c=u[l],h=c.indexOf(":");if(h===-1)throw new Error(`Message header must separate key and value using ':'
5
+ ${c}`);let f=c.substr(0,h),g=c.substr(h+1).trim();a.set(e?f.toLowerCase():f,g)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(i)}if(this._chunks[0].byteLength>e){let i=this._chunks[0],o=this.asNative(i,e);return this._chunks[0]=i.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,s=0;for(;e>0;){let i=this._chunks[s];if(i.byteLength>e){let o=i.slice(0,e);n.set(o,r),r+=e,this._chunks[s]=i.slice(e),this._totalLength-=e,e-=e}else n.set(i,r),r+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,e-=i.byteLength}return n}};Hl.AbstractMessageBuffer=ug});var AS=m(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.createMessageConnection=_e.ConnectionOptions=_e.MessageStrategy=_e.CancellationStrategy=_e.CancellationSenderStrategy=_e.CancellationReceiverStrategy=_e.RequestCancellationReceiverStrategy=_e.IdCancellationReceiverStrategy=_e.ConnectionStrategy=_e.ConnectionError=_e.ConnectionErrors=_e.LogTraceNotification=_e.SetTraceNotification=_e.TraceFormat=_e.TraceValues=_e.Trace=_e.NullLogger=_e.ProgressType=_e.ProgressToken=void 0;var kS=ws(),lt=to(),de=Bp(),wS=Wp(),Ra=ro(),lg=$l(),Ia;(function(t){t.type=new de.NotificationType("$/cancelRequest")})(Ia||(Ia={}));var cg;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(cg||(_e.ProgressToken=cg={}));var Pa;(function(t){t.type=new de.NotificationType("$/progress")})(Pa||(Pa={}));var hg=class{constructor(){}};_e.ProgressType=hg;var fg;(function(t){function e(n){return lt.func(n)}t.is=e})(fg||(fg={}));_e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var qe;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(qe||(_e.Trace=qe={}));var xS;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(xS||(_e.TraceValues=xS={}));(function(t){function e(r){if(!lt.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})(qe||(_e.Trace=qe={}));var Dn;(function(t){t.Text="text",t.JSON="json"})(Dn||(_e.TraceFormat=Dn={}));(function(t){function e(n){return lt.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Dn||(_e.TraceFormat=Dn={}));var dg;(function(t){t.type=new de.NotificationType("$/setTrace")})(dg||(_e.SetTraceNotification=dg={}));var Gl;(function(t){t.type=new de.NotificationType("$/logTrace")})(Gl||(_e.LogTraceNotification=Gl={}));var Da;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Da||(_e.ConnectionErrors=Da={}));var ao=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};_e.ConnectionError=ao;var pg;(function(t){function e(n){let r=n;return r&&lt.func(r.cancelUndispatched)}t.is=e})(pg||(_e.ConnectionStrategy=pg={}));var zl;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&lt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||lt.func(r.dispose))}t.is=e})(zl||(_e.IdCancellationReceiverStrategy=zl={}));var gg;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&lt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||lt.func(r.dispose))}t.is=e})(gg||(_e.RequestCancellationReceiverStrategy=gg={}));var Kl;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new lg.CancellationTokenSource}});function e(n){return zl.is(n)||gg.is(n)}t.is=e})(Kl||(_e.CancellationReceiverStrategy=Kl={}));var Vl;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Ia.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&lt.func(r.sendCancellation)&&lt.func(r.cleanup)}t.is=e})(Vl||(_e.CancellationSenderStrategy=Vl={}));var Xl;(function(t){t.Message=Object.freeze({receiver:Kl.Message,sender:Vl.Message});function e(n){let r=n;return r&&Kl.is(r.receiver)&&Vl.is(r.sender)}t.is=e})(Xl||(_e.CancellationStrategy=Xl={}));var Yl;(function(t){function e(n){let r=n;return r&&lt.func(r.handleMessage)}t.is=e})(Yl||(_e.MessageStrategy=Yl={}));var ES;(function(t){function e(n){let r=n;return r&&(Xl.is(r.cancellationStrategy)||pg.is(r.connectionStrategy)||Yl.is(r.messageStrategy))}t.is=e})(ES||(_e.ConnectionOptions=ES={}));var pr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(pr||(pr={}));function LP(t,e,n,r){let s=n!==void 0?n:_e.NullLogger,i=0,o=0,a=0,u="2.0",l,c=new Map,h,f=new Map,g=new Map,v,b=new wS.LinkedMap,O=new Map,A=new Set,k=new Map,S=qe.Off,_=Dn.Text,N,R=pr.New,G=new Ra.Emitter,se=new Ra.Emitter,ue=new Ra.Emitter,z=new Ra.Emitter,C=new Ra.Emitter,M=r&&r.cancellationStrategy?r.cancellationStrategy:Xl.Message;function L(w){if(w===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+w.toString()}function F(w){return w===null?"res-unknown-"+(++a).toString():"res-"+w.toString()}function me(){return"not-"+(++o).toString()}function pe(w,$){de.Message.isRequest($)?w.set(L($.id),$):de.Message.isResponse($)?w.set(F($.id),$):w.set(me(),$)}function Nt(w){}function vt(){return R===pr.Listening}function Ue(){return R===pr.Closed}function _n(){return R===pr.Disposed}function Yi(){(R===pr.New||R===pr.Listening)&&(R=pr.Closed,se.fire(void 0))}function ui(w){G.fire([w,void 0,void 0])}function _l(w){G.fire(w)}t.onClose(Yi),t.onError(ui),e.onClose(Yi),e.onError(_l);function ka(){v||b.size===0||(v=(0,kS.default)().timer.setImmediate(()=>{v=void 0,Tl()}))}function wa(w){de.Message.isRequest(w)?kl(w):de.Message.isNotification(w)?xl(w):de.Message.isResponse(w)?wl(w):Ji(w)}function Tl(){if(b.size===0)return;let w=b.shift();try{let $=r?.messageStrategy;Yl.is($)?$.handleMessage(w,wa):wa(w)}finally{ka()}}let Sl=w=>{try{if(de.Message.isNotification(w)&&w.method===Ia.type.method){let $=w.params.id,V=L($),te=b.get(V);if(de.Message.isRequest(te)){let Fe=r?.connectionStrategy,Qe=Fe&&Fe.cancelUndispatched?Fe.cancelUndispatched(te,Nt):void 0;if(Qe&&(Qe.error!==void 0||Qe.result!==void 0)){b.delete(V),k.delete($),Qe.id=te.id,li(Qe,w.method,Date.now()),e.write(Qe).catch(()=>s.error("Sending response for canceled message failed."));return}}let Ke=k.get($);if(Ke!==void 0){Ke.cancel(),Qi(w);return}else A.add($)}pe(b,w)}finally{ka()}};function kl(w){if(_n())return;function $(xe,Ve,Me){let ht={jsonrpc:u,id:w.id};xe instanceof de.ResponseError?ht.error=xe.toJson():ht.result=xe===void 0?null:xe,li(ht,Ve,Me),e.write(ht).catch(()=>s.error("Sending response failed."))}function V(xe,Ve,Me){let ht={jsonrpc:u,id:w.id,error:xe.toJson()};li(ht,Ve,Me),e.write(ht).catch(()=>s.error("Sending response failed."))}function te(xe,Ve,Me){xe===void 0&&(xe=null);let ht={jsonrpc:u,id:w.id,result:xe};li(ht,Ve,Me),e.write(ht).catch(()=>s.error("Sending response failed."))}Ol(w);let Ke=c.get(w.method),Fe,Qe;Ke&&(Fe=Ke.type,Qe=Ke.handler);let st=Date.now();if(Qe||l){let xe=w.id??String(Date.now()),Ve=zl.is(M.receiver)?M.receiver.createCancellationTokenSource(xe):M.receiver.createCancellationTokenSource(w);w.id!==null&&A.has(w.id)&&Ve.cancel(),w.id!==null&&k.set(xe,Ve);try{let Me;if(Qe)if(w.params===void 0){if(Fe!==void 0&&Fe.numberOfParams!==0){V(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${w.method} defines ${Fe.numberOfParams} params but received none.`),w.method,st);return}Me=Qe(Ve.token)}else if(Array.isArray(w.params)){if(Fe!==void 0&&Fe.parameterStructures===de.ParameterStructures.byName){V(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${w.method} defines parameters by name but received parameters by position`),w.method,st);return}Me=Qe(...w.params,Ve.token)}else{if(Fe!==void 0&&Fe.parameterStructures===de.ParameterStructures.byPosition){V(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${w.method} defines parameters by position but received parameters by name`),w.method,st);return}Me=Qe(w.params,Ve.token)}else l&&(Me=l(w.method,w.params,Ve.token));let ht=Me;Me?ht.then?ht.then(qt=>{k.delete(xe),$(qt,w.method,st)},qt=>{k.delete(xe),qt instanceof de.ResponseError?V(qt,w.method,st):qt&&lt.string(qt.message)?V(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${w.method} failed with message: ${qt.message}`),w.method,st):V(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${w.method} failed unexpectedly without providing any details.`),w.method,st)}):(k.delete(xe),$(Me,w.method,st)):(k.delete(xe),te(Me,w.method,st))}catch(Me){k.delete(xe),Me instanceof de.ResponseError?$(Me,w.method,st):Me&&lt.string(Me.message)?V(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${w.method} failed with message: ${Me.message}`),w.method,st):V(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${w.method} failed unexpectedly without providing any details.`),w.method,st)}}else V(new de.ResponseError(de.ErrorCodes.MethodNotFound,`Unhandled method ${w.method}`),w.method,st)}function wl(w){if(!_n())if(w.id===null)w.error?s.error(`Received response message without id: Error is:
6
+ ${JSON.stringify(w.error,void 0,4)}`):s.error("Received response message without id. No further error information provided.");else{let $=w.id,V=O.get($);if(Cl(w,V),V!==void 0){O.delete($);try{if(w.error){let te=w.error;V.reject(new de.ResponseError(te.code,te.message,te.data))}else if(w.result!==void 0)V.resolve(w.result);else throw new Error("Should never happen.")}catch(te){te.message?s.error(`Response handler '${V.method}' failed with message: ${te.message}`):s.error(`Response handler '${V.method}' failed unexpectedly.`)}}}}function xl(w){if(_n())return;let $,V;if(w.method===Ia.type.method){let te=w.params.id;A.delete(te),Qi(w);return}else{let te=f.get(w.method);te&&(V=te.handler,$=te.type)}if(V||h)try{if(Qi(w),V)if(w.params===void 0)$!==void 0&&$.numberOfParams!==0&&$.parameterStructures!==de.ParameterStructures.byName&&s.error(`Notification ${w.method} defines ${$.numberOfParams} params but received none.`),V();else if(Array.isArray(w.params)){let te=w.params;w.method===Pa.type.method&&te.length===2&&cg.is(te[0])?V({token:te[0],value:te[1]}):($!==void 0&&($.parameterStructures===de.ParameterStructures.byName&&s.error(`Notification ${w.method} defines parameters by name but received parameters by position`),$.numberOfParams!==w.params.length&&s.error(`Notification ${w.method} defines ${$.numberOfParams} params but received ${te.length} arguments`)),V(...te))}else $!==void 0&&$.parameterStructures===de.ParameterStructures.byPosition&&s.error(`Notification ${w.method} defines parameters by position but received parameters by name`),V(w.params);else h&&h(w.method,w.params)}catch(te){te.message?s.error(`Notification handler '${w.method}' failed with message: ${te.message}`):s.error(`Notification handler '${w.method}' failed unexpectedly.`)}else ue.fire(w)}function Ji(w){if(!w){s.error("Received empty message.");return}s.error(`Received message which is neither a response nor a notification message:
7
+ ${JSON.stringify(w,null,4)}`);let $=w;if(lt.string($.id)||lt.number($.id)){let V=$.id,te=O.get(V);te&&te.reject(new Error("The received response has neither a result nor an error property."))}}function hr(w){if(w!=null)switch(S){case qe.Verbose:return JSON.stringify(w,null,4);case qe.Compact:return JSON.stringify(w);default:return}}function El(w){if(!(S===qe.Off||!N))if(_===Dn.Text){let $;(S===qe.Verbose||S===qe.Compact)&&w.params&&($=`Params: ${hr(w.params)}
8
8
 
9
- `),F.log(`Sending request '${T.method} - (${T.id})'.`,$)}else Ir("send-request",T)}function xu(T){if(!(k===Ne.Off||!F))if(v===_n.Text){let $;(k===Ne.Verbose||k===Ne.Compact)&&(T.params?$=`Params: ${Xn(T.params)}
9
+ `),N.log(`Sending request '${w.method} - (${w.id})'.`,$)}else ts("send-request",w)}function Al(w){if(!(S===qe.Off||!N))if(_===Dn.Text){let $;(S===qe.Verbose||S===qe.Compact)&&(w.params?$=`Params: ${hr(w.params)}
10
10
 
11
11
  `:$=`No parameters provided.
12
12
 
13
- `),F.log(`Sending notification '${T.method}'.`,$)}else Ir("send-notification",T)}function qi(T,$,z){if(!(k===Ne.Off||!F))if(v===_n.Text){let te;(k===Ne.Verbose||k===Ne.Compact)&&(T.error&&T.error.data?te=`Error data: ${Xn(T.error.data)}
13
+ `),N.log(`Sending notification '${w.method}'.`,$)}else ts("send-notification",w)}function li(w,$,V){if(!(S===qe.Off||!N))if(_===Dn.Text){let te;(S===qe.Verbose||S===qe.Compact)&&(w.error&&w.error.data?te=`Error data: ${hr(w.error.data)}
14
14
 
15
- `:T.result?te=`Result: ${Xn(T.result)}
15
+ `:w.result?te=`Result: ${hr(w.result)}
16
16
 
17
- `:T.error===void 0&&(te=`No result returned.
17
+ `:w.error===void 0&&(te=`No result returned.
18
18
 
19
- `)),F.log(`Sending response '${$} - (${T.id})'. Processing request took ${Date.now()-z}ms`,te)}else Ir("send-response",T)}function wu(T){if(!(k===Ne.Off||!F))if(v===_n.Text){let $;(k===Ne.Verbose||k===Ne.Compact)&&T.params&&($=`Params: ${Xn(T.params)}
19
+ `)),N.log(`Sending response '${$} - (${w.id})'. Processing request took ${Date.now()-V}ms`,te)}else ts("send-response",w)}function Ol(w){if(!(S===qe.Off||!N))if(_===Dn.Text){let $;(S===qe.Verbose||S===qe.Compact)&&w.params&&($=`Params: ${hr(w.params)}
20
20
 
21
- `),F.log(`Received request '${T.method} - (${T.id})'.`,$)}else Ir("receive-request",T)}function Ts(T){if(!(k===Ne.Off||!F||T.method===Uu.type.method))if(v===_n.Text){let $;(k===Ne.Verbose||k===Ne.Compact)&&(T.params?$=`Params: ${Xn(T.params)}
21
+ `),N.log(`Received request '${w.method} - (${w.id})'.`,$)}else ts("receive-request",w)}function Qi(w){if(!(S===qe.Off||!N||w.method===Gl.type.method))if(_===Dn.Text){let $;(S===qe.Verbose||S===qe.Compact)&&(w.params?$=`Params: ${hr(w.params)}
22
22
 
23
23
  `:$=`No parameters provided.
24
24
 
25
- `),F.log(`Received notification '${T.method}'.`,$)}else Ir("receive-notification",T)}function Eu(T,$){if(!(k===Ne.Off||!F))if(v===_n.Text){let z;if((k===Ne.Verbose||k===Ne.Compact)&&(T.error&&T.error.data?z=`Error data: ${Xn(T.error.data)}
25
+ `),N.log(`Received notification '${w.method}'.`,$)}else ts("receive-notification",w)}function Cl(w,$){if(!(S===qe.Off||!N))if(_===Dn.Text){let V;if((S===qe.Verbose||S===qe.Compact)&&(w.error&&w.error.data?V=`Error data: ${hr(w.error.data)}
26
26
 
27
- `:T.result?z=`Result: ${Xn(T.result)}
27
+ `:w.result?V=`Result: ${hr(w.result)}
28
28
 
29
- `:T.error===void 0&&(z=`No result returned.
29
+ `:w.error===void 0&&(V=`No result returned.
30
30
 
31
- `)),$){let te=T.error?` Request failed: ${T.error.message} (${T.error.code}).`:"";F.log(`Received response '${$.method} - (${T.id})' in ${Date.now()-$.timerStart}ms.${te}`,z)}else F.log(`Received response ${T.id} without active response promise.`,z)}else Ir("receive-response",T)}function Ir(T,$){if(!F||k===Ne.Off)return;let z={isLSPMessage:!0,type:T,message:$,timestamp:Date.now()};F.log(z)}function Zr(){if($e())throw new Rs(Jo.Closed,"Connection is closed.");if(cn())throw new Rs(Jo.Disposed,"Connection is disposed.")}function Au(){if(mt())throw new Rs(Jo.AlreadyListening,"Connection is already listening")}function Ou(){if(!mt())throw new Error("Call listen() first.")}function lr(T){return T===void 0?null:T}function Wo(T){if(T!==null)return T}function Go(T){return T!=null&&!Array.isArray(T)&&typeof T=="object"}function Ss(T,$){switch(T){case de.ParameterStructures.auto:return Go($)?Wo($):[lr($)];case de.ParameterStructures.byName:if(!Go($))throw new Error("Received parameters by name but param is not an object literal.");return Wo($);case de.ParameterStructures.byPosition:return[lr($)];default:throw new Error(`Unknown parameter structure ${T.toString()}`)}}function Ko(T,$){let z,te=T.numberOfParams;switch(te){case 0:z=void 0;break;case 1:z=Ss(T.parameterStructures,$[0]);break;default:z=[];for(let We=0;We<$.length&&We<te;We++)z.push(lr($[We]));if($.length<te)for(let We=$.length;We<te;We++)z.push(null);break}return z}let Mr={sendNotification:(T,...$)=>{Zr();let z,te;if(ot.string(T)){z=T;let je=$[0],Xe=0,tt=de.ParameterStructures.auto;de.ParameterStructures.is(je)&&(Xe=1,tt=je);let xe=$.length,Ge=xe-Xe;switch(Ge){case 0:te=void 0;break;case 1:te=Ss(tt,$[Xe]);break;default:if(tt===de.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);te=$.slice(Xe,xe).map(De=>lr(De));break}}else{let je=$;z=T.method,te=Ko(T,je)}let We={jsonrpc:u,method:z,params:te};return xu(We),e.write(We).catch(je=>{throw i.error("Sending notification failed."),je})},onNotification:(T,$)=>{Zr();let z;return ot.func(T)?d=T:$&&(ot.string(T)?(z=T,p.set(T,{type:void 0,handler:$})):(z=T.method,p.set(T.method,{type:T,handler:$}))),{dispose:()=>{z!==void 0?p.delete(z):d=void 0}}},onProgress:(T,$,z)=>{if(b.has($))throw new Error(`Progress handler for token ${$} already registered`);return b.set($,z),{dispose:()=>{b.delete($)}}},sendProgress:(T,$,z)=>Mr.sendNotification(Yo.type,{token:$,value:z}),onUnhandledProgress:K.event,sendRequest:(T,...$)=>{Zr(),Ou();let z,te,We;if(ot.string(T)){z=T;let xe=$[0],Ge=$[$.length-1],De=0,ut=de.ParameterStructures.auto;de.ParameterStructures.is(xe)&&(De=1,ut=xe);let It=$.length;xp.CancellationToken.is(Ge)&&(It=It-1,We=Ge);let vn=It-De;switch(vn){case 0:te=void 0;break;case 1:te=Ss(ut,$[De]);break;default:if(ut===de.ParameterStructures.byName)throw new Error(`Received ${vn} parameters for 'by Name' request parameter structure.`);te=$.slice(De,It).map(Cu=>lr(Cu));break}}else{let xe=$;z=T.method,te=Ko(T,xe);let Ge=T.numberOfParams;We=xp.CancellationToken.is(xe[Ge])?xe[Ge]:void 0}let je=s++,Xe;We&&(Xe=We.onCancellationRequested(()=>{let xe=D.sender.sendCancellation(Mr,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 ku(tt),typeof D.sender.enableCancellation=="function"&&D.sender.enableCancellation(tt),new Promise(async(xe,Ge)=>{let De=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:De,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,$)=>{Zr();let z=null;return Ap.is(T)?(z=void 0,c=T):ot.string(T)?(z=null,$!==void 0&&(z=T,l.set(T,{handler:$,type:void 0}))):$!==void 0&&(z=T.method,l.set(T.method,{type:T,handler:$})),{dispose:()=>{z!==null&&(z!==void 0?l.delete(z):c=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(T,$,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===Ne.Off?F=void 0:F=$,te&&!$e()&&!cn()&&await Mr.sendNotification(Op.type,{value:Ne.toString(T)})},onError:V.event,onClose:ce.event,onUnhandledNotification:ye.event,onDispose:A.event,end:()=>{e.end()},dispose:()=>{if(cn())return;C=Qn.Disposed,A.fire(void 0);let T=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let $ of L.values())$.reject(T);L=new Map,x=new Map,M=new Set,E=new u_.LinkedMap,ot.func(e.dispose)&&e.dispose(),ot.func(t.dispose)&&t.dispose()},listen:()=>{Zr(),Au(),C=Qn.Listening,t.listen(vu)},inspect:()=>{(0,a_.default)().console.log("inspect")}};return Mr.onNotification(Uu.type,T=>{if(k===Ne.Off||!F)return;let $=k===Ne.Verbose||k===Ne.Compact;F.log(T.message,$?T.verbose:void 0)}),Mr.onNotification(Yo.type,T=>{let $=b.get(T.token);$?$(T.value):K.fire(T)}),Mr}ve.createMessageConnection=pO});var zu=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=np();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 Pp=ip();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return Pp.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return Pp.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return Pp.Touch}});var hO=Yv();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return hO.Disposable}});var f_=Es();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return f_.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return f_.Emitter}});var p_=qu();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return p_.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return p_.CancellationToken}});var h_=Qv();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return h_.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return h_.SharedArrayReceiverStrategy}});var Dp=e_();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return Dp.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return Dp.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Dp.ReadableStreamMessageReader}});var Ip=s_();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return Ip.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return Ip.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Ip.WriteableStreamMessageWriter}});var gO=o_();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return gO.AbstractMessageBuffer}});var Ft=d_();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return Ft.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return Ft.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return Ft.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return Ft.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return Ft.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return Ft.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return Ft.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return Ft.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return Ft.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return Ft.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return Ft.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return Ft.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return Ft.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ft.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ft.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return Ft.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return Ft.MessageStrategy}});var mO=ti();q.RAL=mO.default});var y_=g(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});var g_=require("util"),Nr=zu(),Xu=class t extends Nr.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 g_.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)}};Xu.emptyBuffer=Buffer.allocUnsafe(0);var Mp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Nr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Nr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Nr.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Nr.Disposable.create(()=>this.stream.off("data",e))}},Lp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Nr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Nr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Nr.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()}},m_=Object.freeze({messageBuffer:Object.freeze({create:t=>new Xu(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 g_.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Mp(t),asWritableStream:t=>new Lp(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 Np(){return m_}(function(t){function e(){Nr.RAL.install(m_)}t.install=e})(Np||(Np={}));qp.default=Np});var Bi=g(Ae=>{"use strict";var yO=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]}),bO=Ae&&Ae.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&yO(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 Ps=y_();Ps.default.install();var b_=require("path"),vO=require("os"),_O=require("crypto"),Qu=require("net"),Tn=zu();bO(zu(),Ae);var jp=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=jp;var Fp=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=Fp;var $p=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=$p;var Bp=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=Bp;var Fi=class extends Tn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,Ps.default)().stream.asReadableStream(e),n)}};Ae.SocketMessageReader=Fi;var $i=class extends Tn.WriteableStreamMessageWriter{constructor(e,n){super((0,Ps.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ae.SocketMessageWriter=$i;var Yu=class extends Tn.ReadableStreamMessageReader{constructor(e,n){super((0,Ps.default)().stream.asReadableStream(e),n)}};Ae.StreamMessageReader=Yu;var Ju=class extends Tn.WriteableStreamMessageWriter{constructor(e,n){super((0,Ps.default)().stream.asWritableStream(e),n)}};Ae.StreamMessageWriter=Ju;var v_=process.env.XDG_RUNTIME_DIR,TO=new Map([["linux",107],["darwin",103]]);function SO(){let t=(0,_O.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;v_?e=b_.join(v_,`vscode-ipc-${t}.sock`):e=b_.join(vO.tmpdir(),`vscode-${t}.sock`);let n=TO.get(process.platform);return n!==void 0&&e.length>n&&(0,Ps.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Ae.generateRandomPipeName=SO;function kO(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Qu.createServer)(a=>{o.close(),n([new Fi(a,e),new $i(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ae.createClientPipeTransport=kO;function xO(t,e="utf-8"){let n=(0,Qu.createConnection)(t);return[new Fi(n,e),new $i(n,e)]}Ae.createServerPipeTransport=xO;function wO(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Qu.createServer)(a=>{o.close(),n([new Fi(a,e),new $i(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ae.createClientSocketTransport=wO;function EO(t,e="utf-8"){let n=(0,Qu.createConnection)(t,"127.0.0.1");return[new Fi(n,e),new $i(n,e)]}Ae.createServerSocketTransport=EO;function AO(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function OO(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function CO(t,e,n,r){n||(n=Tn.NullLogger);let i=AO(t)?new Yu(t):t,s=OO(e)?new Ju(e):e;return Tn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Tn.createMessageConnection)(i,s,n,r)}Ae.createMessageConnection=CO});var Up=g((W$,__)=>{"use strict";__.exports=Bi()});var ec=g((T_,Zu)=>{(function(t){if(typeof Zu=="object"&&typeof Zu.exports=="object"){var e=t(require,T_);e!==void 0&&(Zu.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 b;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(b||(e.FoldingRangeKind=b={}));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 vs;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function S(w){var m=w;return m===h.PlainText||m===h.Markdown}h.is=S})(vs||(e.MarkupKind=vs={}));var Ni;(function(h){function S(w){var m=w;return P.objectLiteral(w)&&vs.is(m.kind)&&P.string(m.value)}h.is=S})(Ni||(e.MarkupContent=Ni={}));var yu;(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})(yu||(e.CompletionItemKind=yu={}));var Uo;(function(h){h.PlainText=1,h.Snippet=2})(Uo||(e.InsertTextFormat=Uo={}));var Ho;(function(h){h.Deprecated=1})(Ho||(e.CompletionItemTag=Ho={}));var bu;(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})(bu||(e.InsertReplaceEdit=bu={}));var vu;(function(h){h.asIs=1,h.adjustIndentation=2})(vu||(e.InsertTextMode=vu={}));var _u;(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})(_u||(e.CompletionItemLabelDetails=_u={}));var Tu;(function(h){function S(w){return{label:w}}h.create=S})(Tu||(e.CompletionItem=Tu={}));var Su;(function(h){function S(w,m){return{items:w||[],isIncomplete:!!m}}h.create=S})(Su||(e.CompletionList=Su={}));var _s;(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})(_s||(e.MarkedString=_s={}));var Xn;(function(h){function S(w){var m=w;return!!m&&P.objectLiteral(m)&&(Ni.is(m.contents)||_s.is(m.contents)||P.typedArray(m.contents,_s.is))&&(w.range===void 0||a.is(w.range))}h.is=S})(Xn||(e.Hover=Xn={}));var ku;(function(h){function S(w,m){return m?{label:w,documentation:m}:{label:w}}h.create=S})(ku||(e.ParameterInformation=ku={}));var xu;(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})(xu||(e.SignatureInformation=xu={}));var qi;(function(h){h.Text=1,h.Read=2,h.Write=3})(qi||(e.DocumentHighlightKind=qi={}));var wu;(function(h){function S(w,m){var f={range:w};return P.number(m)&&(f.kind=m),f}h.create=S})(wu||(e.DocumentHighlight=wu={}));var Ts;(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})(Ts||(e.SymbolKind=Ts={}));var Eu;(function(h){h.Deprecated=1})(Eu||(e.SymbolTag=Eu={}));var Ir;(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})(Ir||(e.SymbolInformation=Ir={}));var Zr;(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})(Zr||(e.WorkspaceSymbol=Zr={}));var Au;(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})(Au||(e.DocumentSymbol=Au={}));var Ou;(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"})(Ou||(e.CodeActionKind=Ou={}));var lr;(function(h){h.Invoked=1,h.Automatic=2})(lr||(e.CodeActionTriggerKind=lr={}));var Wo;(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===lr.Invoked||f.triggerKind===lr.Automatic)}h.is=w})(Wo||(e.CodeActionContext=Wo={}));var Go;(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})(Go||(e.CodeAction=Go={}));var Ss;(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})(Ss||(e.CodeLens=Ss={}));var Ko;(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})(Ko||(e.FormattingOptions=Ko={}));var Mr;(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})(Mr||(e.DocumentLink=Mr={}));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 $;(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"})($||(e.SemanticTokenTypes=$={}));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)||Ni.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 De;(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)||Ni.is(f.tooltip))&&(f.paddingLeft===void 0||P.boolean(f.paddingLeft))&&(f.paddingRight===void 0||P.boolean(f.paddingRight))}h.is=w})(De||(e.InlayHint=De={}));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 Cu;(function(h){h.Invoked=0,h.Automatic=1})(Cu||(e.InlineCompletionTriggerKind=Cu={}));var qv;(function(h){function S(w,m){return{range:w,text:m}}h.create=S})(qv||(e.SelectedCompletionInfo=qv={}));var jv;(function(h){function S(w,m){return{triggerKind:w,selectedCompletionInfo:m}}h.create=S})(jv||(e.InlineCompletionContext=jv={}));var Fv;(function(h){function S(w){var m=w;return P.objectLiteral(m)&&r.is(m.uri)&&P.string(m.name)}h.is=S})(Fv||(e.WorkspaceFolder=Fv={})),e.EOL=[`
31
+ `)),$){let te=w.error?` Request failed: ${w.error.message} (${w.error.code}).`:"";N.log(`Received response '${$.method} - (${w.id})' in ${Date.now()-$.timerStart}ms.${te}`,V)}else N.log(`Received response ${w.id} without active response promise.`,V)}else ts("receive-response",w)}function ts(w,$){if(!N||S===qe.Off)return;let V={isLSPMessage:!0,type:w,message:$,timestamp:Date.now()};N.log(V)}function Ss(){if(Ue())throw new ao(Da.Closed,"Connection is closed.");if(_n())throw new ao(Da.Disposed,"Connection is disposed.")}function Rl(){if(vt())throw new ao(Da.AlreadyListening,"Connection is already listening")}function Pl(){if(!vt())throw new Error("Call listen() first.")}function Cr(w){return w===void 0?null:w}function xa(w){if(w!==null)return w}function Ea(w){return w!=null&&!Array.isArray(w)&&typeof w=="object"}function Zi(w,$){switch(w){case de.ParameterStructures.auto:return Ea($)?xa($):[Cr($)];case de.ParameterStructures.byName:if(!Ea($))throw new Error("Received parameters by name but param is not an object literal.");return xa($);case de.ParameterStructures.byPosition:return[Cr($)];default:throw new Error(`Unknown parameter structure ${w.toString()}`)}}function Aa(w,$){let V,te=w.numberOfParams;switch(te){case 0:V=void 0;break;case 1:V=Zi(w.parameterStructures,$[0]);break;default:V=[];for(let Ke=0;Ke<$.length&&Ke<te;Ke++)V.push(Cr($[Ke]));if($.length<te)for(let Ke=$.length;Ke<te;Ke++)V.push(null);break}return V}let ns={sendNotification:(w,...$)=>{Ss();let V,te;if(lt.string(w)){V=w;let Fe=$[0],Qe=0,st=de.ParameterStructures.auto;de.ParameterStructures.is(Fe)&&(Qe=1,st=Fe);let xe=$.length,Ve=xe-Qe;switch(Ve){case 0:te=void 0;break;case 1:te=Zi(st,$[Qe]);break;default:if(st===de.ParameterStructures.byName)throw new Error(`Received ${Ve} parameters for 'by Name' notification parameter structure.`);te=$.slice(Qe,xe).map(Me=>Cr(Me));break}}else{let Fe=$;V=w.method,te=Aa(w,Fe)}let Ke={jsonrpc:u,method:V,params:te};return Al(Ke),e.write(Ke).catch(Fe=>{throw s.error("Sending notification failed."),Fe})},onNotification:(w,$)=>{Ss();let V;return lt.func(w)?h=w:$&&(lt.string(w)?(V=w,f.set(w,{type:void 0,handler:$})):(V=w.method,f.set(w.method,{type:w,handler:$}))),{dispose:()=>{V!==void 0?f.delete(V):h=void 0}}},onProgress:(w,$,V)=>{if(g.has($))throw new Error(`Progress handler for token ${$} already registered`);return g.set($,V),{dispose:()=>{g.delete($)}}},sendProgress:(w,$,V)=>ns.sendNotification(Pa.type,{token:$,value:V}),onUnhandledProgress:z.event,sendRequest:(w,...$)=>{Ss(),Pl();let V,te,Ke;if(lt.string(w)){V=w;let xe=$[0],Ve=$[$.length-1],Me=0,ht=de.ParameterStructures.auto;de.ParameterStructures.is(xe)&&(Me=1,ht=xe);let qt=$.length;lg.CancellationToken.is(Ve)&&(qt=qt-1,Ke=Ve);let Pn=qt-Me;switch(Pn){case 0:te=void 0;break;case 1:te=Zi(ht,$[Me]);break;default:if(ht===de.ParameterStructures.byName)throw new Error(`Received ${Pn} parameters for 'by Name' request parameter structure.`);te=$.slice(Me,qt).map(Dl=>Cr(Dl));break}}else{let xe=$;V=w.method,te=Aa(w,xe);let Ve=w.numberOfParams;Ke=lg.CancellationToken.is(xe[Ve])?xe[Ve]:void 0}let Fe=i++,Qe;Ke&&(Qe=Ke.onCancellationRequested(()=>{let xe=M.sender.sendCancellation(ns,Fe);return xe===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${Fe}`),Promise.resolve()):xe.catch(()=>{s.log(`Sending cancellation messages for id ${Fe} failed`)})}));let st={jsonrpc:u,id:Fe,method:V,params:te};return El(st),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(st),new Promise(async(xe,Ve)=>{let Me=Pn=>{xe(Pn),M.sender.cleanup(Fe),Qe?.dispose()},ht=Pn=>{Ve(Pn),M.sender.cleanup(Fe),Qe?.dispose()},qt={method:V,timerStart:Date.now(),resolve:Me,reject:ht};try{await e.write(st),O.set(Fe,qt)}catch(Pn){throw s.error("Sending request failed."),qt.reject(new de.ResponseError(de.ErrorCodes.MessageWriteError,Pn.message?Pn.message:"Unknown reason")),Pn}})},onRequest:(w,$)=>{Ss();let V=null;return fg.is(w)?(V=void 0,l=w):lt.string(w)?(V=null,$!==void 0&&(V=w,c.set(w,{handler:$,type:void 0}))):$!==void 0&&(V=w.method,c.set(w.method,{type:w,handler:$})),{dispose:()=>{V!==null&&(V!==void 0?c.delete(V):l=void 0)}}},hasPendingResponse:()=>O.size>0,trace:async(w,$,V)=>{let te=!1,Ke=Dn.Text;V!==void 0&&(lt.boolean(V)?te=V:(te=V.sendNotification||!1,Ke=V.traceFormat||Dn.Text)),S=w,_=Ke,S===qe.Off?N=void 0:N=$,te&&!Ue()&&!_n()&&await ns.sendNotification(dg.type,{value:qe.toString(w)})},onError:G.event,onClose:se.event,onUnhandledNotification:ue.event,onDispose:C.event,end:()=>{e.end()},dispose:()=>{if(_n())return;R=pr.Disposed,C.fire(void 0);let w=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let $ of O.values())$.reject(w);O=new Map,k=new Map,A=new Set,b=new wS.LinkedMap,lt.func(e.dispose)&&e.dispose(),lt.func(t.dispose)&&t.dispose()},listen:()=>{Ss(),Rl(),R=pr.Listening,t.listen(Sl)},inspect:()=>{(0,kS.default)().console.log("inspect")}};return ns.onNotification(Gl.type,w=>{if(S===qe.Off||!N)return;let $=S===qe.Verbose||S===qe.Compact;N.log(w.message,$?w.verbose:void 0)}),ns.onNotification(Pa.type,w=>{let $=g.get(w.token);$?$(w.value):z.fire(w)}),ns}_e.createMessageConnection=LP});var Jl=m(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.ProgressType=j.ProgressToken=j.createMessageConnection=j.NullLogger=j.ConnectionOptions=j.ConnectionStrategy=j.AbstractMessageBuffer=j.WriteableStreamMessageWriter=j.AbstractMessageWriter=j.MessageWriter=j.ReadableStreamMessageReader=j.AbstractMessageReader=j.MessageReader=j.SharedArrayReceiverStrategy=j.SharedArraySenderStrategy=j.CancellationToken=j.CancellationTokenSource=j.Emitter=j.Event=j.Disposable=j.LRUCache=j.Touch=j.LinkedMap=j.ParameterStructures=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.ErrorCodes=j.ResponseError=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType0=j.RequestType=j.Message=j.RAL=void 0;j.MessageStrategy=j.CancellationStrategy=j.CancellationSenderStrategy=j.CancellationReceiverStrategy=j.ConnectionError=j.ConnectionErrors=j.LogTraceNotification=j.SetTraceNotification=j.TraceFormat=j.TraceValues=j.Trace=void 0;var Ye=Bp();Object.defineProperty(j,"Message",{enumerable:!0,get:function(){return Ye.Message}});Object.defineProperty(j,"RequestType",{enumerable:!0,get:function(){return Ye.RequestType}});Object.defineProperty(j,"RequestType0",{enumerable:!0,get:function(){return Ye.RequestType0}});Object.defineProperty(j,"RequestType1",{enumerable:!0,get:function(){return Ye.RequestType1}});Object.defineProperty(j,"RequestType2",{enumerable:!0,get:function(){return Ye.RequestType2}});Object.defineProperty(j,"RequestType3",{enumerable:!0,get:function(){return Ye.RequestType3}});Object.defineProperty(j,"RequestType4",{enumerable:!0,get:function(){return Ye.RequestType4}});Object.defineProperty(j,"RequestType5",{enumerable:!0,get:function(){return Ye.RequestType5}});Object.defineProperty(j,"RequestType6",{enumerable:!0,get:function(){return Ye.RequestType6}});Object.defineProperty(j,"RequestType7",{enumerable:!0,get:function(){return Ye.RequestType7}});Object.defineProperty(j,"RequestType8",{enumerable:!0,get:function(){return Ye.RequestType8}});Object.defineProperty(j,"RequestType9",{enumerable:!0,get:function(){return Ye.RequestType9}});Object.defineProperty(j,"ResponseError",{enumerable:!0,get:function(){return Ye.ResponseError}});Object.defineProperty(j,"ErrorCodes",{enumerable:!0,get:function(){return Ye.ErrorCodes}});Object.defineProperty(j,"NotificationType",{enumerable:!0,get:function(){return Ye.NotificationType}});Object.defineProperty(j,"NotificationType0",{enumerable:!0,get:function(){return Ye.NotificationType0}});Object.defineProperty(j,"NotificationType1",{enumerable:!0,get:function(){return Ye.NotificationType1}});Object.defineProperty(j,"NotificationType2",{enumerable:!0,get:function(){return Ye.NotificationType2}});Object.defineProperty(j,"NotificationType3",{enumerable:!0,get:function(){return Ye.NotificationType3}});Object.defineProperty(j,"NotificationType4",{enumerable:!0,get:function(){return Ye.NotificationType4}});Object.defineProperty(j,"NotificationType5",{enumerable:!0,get:function(){return Ye.NotificationType5}});Object.defineProperty(j,"NotificationType6",{enumerable:!0,get:function(){return Ye.NotificationType6}});Object.defineProperty(j,"NotificationType7",{enumerable:!0,get:function(){return Ye.NotificationType7}});Object.defineProperty(j,"NotificationType8",{enumerable:!0,get:function(){return Ye.NotificationType8}});Object.defineProperty(j,"NotificationType9",{enumerable:!0,get:function(){return Ye.NotificationType9}});Object.defineProperty(j,"ParameterStructures",{enumerable:!0,get:function(){return Ye.ParameterStructures}});var mg=Wp();Object.defineProperty(j,"LinkedMap",{enumerable:!0,get:function(){return mg.LinkedMap}});Object.defineProperty(j,"LRUCache",{enumerable:!0,get:function(){return mg.LRUCache}});Object.defineProperty(j,"Touch",{enumerable:!0,get:function(){return mg.Touch}});var NP=fS();Object.defineProperty(j,"Disposable",{enumerable:!0,get:function(){return NP.Disposable}});var OS=ro();Object.defineProperty(j,"Event",{enumerable:!0,get:function(){return OS.Event}});Object.defineProperty(j,"Emitter",{enumerable:!0,get:function(){return OS.Emitter}});var CS=$l();Object.defineProperty(j,"CancellationTokenSource",{enumerable:!0,get:function(){return CS.CancellationTokenSource}});Object.defineProperty(j,"CancellationToken",{enumerable:!0,get:function(){return CS.CancellationToken}});var RS=pS();Object.defineProperty(j,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return RS.SharedArraySenderStrategy}});Object.defineProperty(j,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return RS.SharedArrayReceiverStrategy}});var yg=mS();Object.defineProperty(j,"MessageReader",{enumerable:!0,get:function(){return yg.MessageReader}});Object.defineProperty(j,"AbstractMessageReader",{enumerable:!0,get:function(){return yg.AbstractMessageReader}});Object.defineProperty(j,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return yg.ReadableStreamMessageReader}});var bg=TS();Object.defineProperty(j,"MessageWriter",{enumerable:!0,get:function(){return bg.MessageWriter}});Object.defineProperty(j,"AbstractMessageWriter",{enumerable:!0,get:function(){return bg.AbstractMessageWriter}});Object.defineProperty(j,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return bg.WriteableStreamMessageWriter}});var qP=SS();Object.defineProperty(j,"AbstractMessageBuffer",{enumerable:!0,get:function(){return qP.AbstractMessageBuffer}});var Kt=AS();Object.defineProperty(j,"ConnectionStrategy",{enumerable:!0,get:function(){return Kt.ConnectionStrategy}});Object.defineProperty(j,"ConnectionOptions",{enumerable:!0,get:function(){return Kt.ConnectionOptions}});Object.defineProperty(j,"NullLogger",{enumerable:!0,get:function(){return Kt.NullLogger}});Object.defineProperty(j,"createMessageConnection",{enumerable:!0,get:function(){return Kt.createMessageConnection}});Object.defineProperty(j,"ProgressToken",{enumerable:!0,get:function(){return Kt.ProgressToken}});Object.defineProperty(j,"ProgressType",{enumerable:!0,get:function(){return Kt.ProgressType}});Object.defineProperty(j,"Trace",{enumerable:!0,get:function(){return Kt.Trace}});Object.defineProperty(j,"TraceValues",{enumerable:!0,get:function(){return Kt.TraceValues}});Object.defineProperty(j,"TraceFormat",{enumerable:!0,get:function(){return Kt.TraceFormat}});Object.defineProperty(j,"SetTraceNotification",{enumerable:!0,get:function(){return Kt.SetTraceNotification}});Object.defineProperty(j,"LogTraceNotification",{enumerable:!0,get:function(){return Kt.LogTraceNotification}});Object.defineProperty(j,"ConnectionErrors",{enumerable:!0,get:function(){return Kt.ConnectionErrors}});Object.defineProperty(j,"ConnectionError",{enumerable:!0,get:function(){return Kt.ConnectionError}});Object.defineProperty(j,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Kt.CancellationReceiverStrategy}});Object.defineProperty(j,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Kt.CancellationSenderStrategy}});Object.defineProperty(j,"CancellationStrategy",{enumerable:!0,get:function(){return Kt.CancellationStrategy}});Object.defineProperty(j,"MessageStrategy",{enumerable:!0,get:function(){return Kt.MessageStrategy}});var jP=ws();j.RAL=jP.default});var IS=m(Sg=>{"use strict";Object.defineProperty(Sg,"__esModule",{value:!0});var PS=require("util"),ss=Jl(),Ql=class t extends ss.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 PS.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)}};Ql.emptyBuffer=Buffer.allocUnsafe(0);var vg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ss.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ss.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ss.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ss.Disposable.create(()=>this.stream.off("data",e))}},_g=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ss.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ss.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ss.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,s)=>{let i=o=>{o==null?r():s(o)};typeof e=="string"?this.stream.write(e,n,i):this.stream.write(e,i)})}end(){this.stream.end()}},DS=Object.freeze({messageBuffer:Object.freeze({create:t=>new Ql(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 PS.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new vg(t),asWritableStream:t=>new _g(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function Tg(){return DS}(function(t){function e(){ss.RAL.install(DS)}t.install=e})(Tg||(Tg={}));Sg.default=Tg});var di=m(Oe=>{"use strict";var FP=Oe&&Oe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),$P=Oe&&Oe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&FP(e,t,n)};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createMessageConnection=Oe.createServerSocketTransport=Oe.createClientSocketTransport=Oe.createServerPipeTransport=Oe.createClientPipeTransport=Oe.generateRandomPipeName=Oe.StreamMessageWriter=Oe.StreamMessageReader=Oe.SocketMessageWriter=Oe.SocketMessageReader=Oe.PortMessageWriter=Oe.PortMessageReader=Oe.IPCMessageWriter=Oe.IPCMessageReader=void 0;var uo=IS();uo.default.install();var MS=require("path"),BP=require("os"),UP=require("crypto"),tc=require("net"),In=Jl();$P(Jl(),Oe);var kg=class extends In.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),In.Disposable.create(()=>this.process.off("message",e))}};Oe.IPCMessageReader=kg;var wg=class extends In.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(){}};Oe.IPCMessageWriter=wg;var xg=class extends In.AbstractMessageReader{constructor(e){super(),this.onData=new In.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)}};Oe.PortMessageReader=xg;var Eg=class extends In.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(){}};Oe.PortMessageWriter=Eg;var hi=class extends In.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,uo.default)().stream.asReadableStream(e),n)}};Oe.SocketMessageReader=hi;var fi=class extends In.WriteableStreamMessageWriter{constructor(e,n){super((0,uo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Oe.SocketMessageWriter=fi;var Zl=class extends In.ReadableStreamMessageReader{constructor(e,n){super((0,uo.default)().stream.asReadableStream(e),n)}};Oe.StreamMessageReader=Zl;var ec=class extends In.WriteableStreamMessageWriter{constructor(e,n){super((0,uo.default)().stream.asWritableStream(e),n)}};Oe.StreamMessageWriter=ec;var LS=process.env.XDG_RUNTIME_DIR,WP=new Map([["linux",107],["darwin",103]]);function HP(){let t=(0,UP.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;LS?e=MS.join(LS,`vscode-ipc-${t}.sock`):e=MS.join(BP.tmpdir(),`vscode-${t}.sock`);let n=WP.get(process.platform);return n!==void 0&&e.length>n&&(0,uo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Oe.generateRandomPipeName=HP;function GP(t,e="utf-8"){let n,r=new Promise((s,i)=>{n=s});return new Promise((s,i)=>{let o=(0,tc.createServer)(a=>{o.close(),n([new hi(a,e),new fi(a,e)])});o.on("error",i),o.listen(t,()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}Oe.createClientPipeTransport=GP;function zP(t,e="utf-8"){let n=(0,tc.createConnection)(t);return[new hi(n,e),new fi(n,e)]}Oe.createServerPipeTransport=zP;function KP(t,e="utf-8"){let n,r=new Promise((s,i)=>{n=s});return new Promise((s,i)=>{let o=(0,tc.createServer)(a=>{o.close(),n([new hi(a,e),new fi(a,e)])});o.on("error",i),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}Oe.createClientSocketTransport=KP;function VP(t,e="utf-8"){let n=(0,tc.createConnection)(t,"127.0.0.1");return[new hi(n,e),new fi(n,e)]}Oe.createServerSocketTransport=VP;function XP(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function YP(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function JP(t,e,n,r){n||(n=In.NullLogger);let s=XP(t)?new Zl(t):t,i=YP(e)?new ec(e):e;return In.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,In.createMessageConnection)(s,i,n,r)}Oe.createMessageConnection=JP});var Ag=m((oH,NS)=>{"use strict";NS.exports=di()});var rc=m((qS,nc)=>{(function(t){if(typeof nc=="object"&&typeof nc.exports=="object"){var e=t(require,qS);e!==void 0&&(nc.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var n;(function(p){function x(E){return typeof E=="string"}p.is=x})(n||(e.DocumentUri=n={}));var r;(function(p){function x(E){return typeof E=="string"}p.is=x})(r||(e.URI=r={}));var s;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function x(E){return typeof E=="number"&&p.MIN_VALUE<=E&&E<=p.MAX_VALUE}p.is=x})(s||(e.integer=s={}));var i;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function x(E){return typeof E=="number"&&p.MIN_VALUE<=E&&E<=p.MAX_VALUE}p.is=x})(i||(e.uinteger=i={}));var o;(function(p){function x(y,d){return y===Number.MAX_VALUE&&(y=i.MAX_VALUE),d===Number.MAX_VALUE&&(d=i.MAX_VALUE),{line:y,character:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.uinteger(d.line)&&I.uinteger(d.character)}p.is=E})(o||(e.Position=o={}));var a;(function(p){function x(y,d,D,U){if(I.uinteger(y)&&I.uinteger(d)&&I.uinteger(D)&&I.uinteger(U))return{start:o.create(y,d),end:o.create(D,U)};if(o.is(y)&&o.is(d))return{start:y,end:d};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(d,", ").concat(D,", ").concat(U,"]"))}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&o.is(d.start)&&o.is(d.end)}p.is=E})(a||(e.Range=a={}));var u;(function(p){function x(y,d){return{uri:y,range:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&(I.string(d.uri)||I.undefined(d.uri))}p.is=E})(u||(e.Location=u={}));var l;(function(p){function x(y,d,D,U){return{targetUri:y,targetRange:d,targetSelectionRange:D,originSelectionRange:U}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.targetRange)&&I.string(d.targetUri)&&a.is(d.targetSelectionRange)&&(a.is(d.originSelectionRange)||I.undefined(d.originSelectionRange))}p.is=E})(l||(e.LocationLink=l={}));var c;(function(p){function x(y,d,D,U){return{red:y,green:d,blue:D,alpha:U}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.numberRange(d.red,0,1)&&I.numberRange(d.green,0,1)&&I.numberRange(d.blue,0,1)&&I.numberRange(d.alpha,0,1)}p.is=E})(c||(e.Color=c={}));var h;(function(p){function x(y,d){return{range:y,color:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&c.is(d.color)}p.is=E})(h||(e.ColorInformation=h={}));var f;(function(p){function x(y,d,D){return{label:y,textEdit:d,additionalTextEdits:D}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.string(d.label)&&(I.undefined(d.textEdit)||N.is(d))&&(I.undefined(d.additionalTextEdits)||I.typedArray(d.additionalTextEdits,N.is))}p.is=E})(f||(e.ColorPresentation=f={}));var g;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(g||(e.FoldingRangeKind=g={}));var v;(function(p){function x(y,d,D,U,ve,ft){var Xe={startLine:y,endLine:d};return I.defined(D)&&(Xe.startCharacter=D),I.defined(U)&&(Xe.endCharacter=U),I.defined(ve)&&(Xe.kind=ve),I.defined(ft)&&(Xe.collapsedText=ft),Xe}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.uinteger(d.startLine)&&I.uinteger(d.startLine)&&(I.undefined(d.startCharacter)||I.uinteger(d.startCharacter))&&(I.undefined(d.endCharacter)||I.uinteger(d.endCharacter))&&(I.undefined(d.kind)||I.string(d.kind))}p.is=E})(v||(e.FoldingRange=v={}));var b;(function(p){function x(y,d){return{location:y,message:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&u.is(d.location)&&I.string(d.message)}p.is=E})(b||(e.DiagnosticRelatedInformation=b={}));var O;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(O||(e.DiagnosticSeverity=O={}));var A;(function(p){p.Unnecessary=1,p.Deprecated=2})(A||(e.DiagnosticTag=A={}));var k;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&I.string(y.href)}p.is=x})(k||(e.CodeDescription=k={}));var S;(function(p){function x(y,d,D,U,ve,ft){var Xe={range:y,message:d};return I.defined(D)&&(Xe.severity=D),I.defined(U)&&(Xe.code=U),I.defined(ve)&&(Xe.source=ve),I.defined(ft)&&(Xe.relatedInformation=ft),Xe}p.create=x;function E(y){var d,D=y;return I.defined(D)&&a.is(D.range)&&I.string(D.message)&&(I.number(D.severity)||I.undefined(D.severity))&&(I.integer(D.code)||I.string(D.code)||I.undefined(D.code))&&(I.undefined(D.codeDescription)||I.string((d=D.codeDescription)===null||d===void 0?void 0:d.href))&&(I.string(D.source)||I.undefined(D.source))&&(I.undefined(D.relatedInformation)||I.typedArray(D.relatedInformation,b.is))}p.is=E})(S||(e.Diagnostic=S={}));var _;(function(p){function x(y,d){for(var D=[],U=2;U<arguments.length;U++)D[U-2]=arguments[U];var ve={title:y,command:d};return I.defined(D)&&D.length>0&&(ve.arguments=D),ve}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.title)&&I.string(d.command)}p.is=E})(_||(e.Command=_={}));var N;(function(p){function x(D,U){return{range:D,newText:U}}p.replace=x;function E(D,U){return{range:{start:D,end:D},newText:U}}p.insert=E;function y(D){return{range:D,newText:""}}p.del=y;function d(D){var U=D;return I.objectLiteral(U)&&I.string(U.newText)&&a.is(U.range)}p.is=d})(N||(e.TextEdit=N={}));var R;(function(p){function x(y,d,D){var U={label:y};return d!==void 0&&(U.needsConfirmation=d),D!==void 0&&(U.description=D),U}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.string(d.label)&&(I.boolean(d.needsConfirmation)||d.needsConfirmation===void 0)&&(I.string(d.description)||d.description===void 0)}p.is=E})(R||(e.ChangeAnnotation=R={}));var G;(function(p){function x(E){var y=E;return I.string(y)}p.is=x})(G||(e.ChangeAnnotationIdentifier=G={}));var se;(function(p){function x(D,U,ve){return{range:D,newText:U,annotationId:ve}}p.replace=x;function E(D,U,ve){return{range:{start:D,end:D},newText:U,annotationId:ve}}p.insert=E;function y(D,U){return{range:D,newText:"",annotationId:U}}p.del=y;function d(D){var U=D;return N.is(U)&&(R.is(U.annotationId)||G.is(U.annotationId))}p.is=d})(se||(e.AnnotatedTextEdit=se={}));var ue;(function(p){function x(y,d){return{textDocument:y,edits:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&Ue.is(d.textDocument)&&Array.isArray(d.edits)}p.is=E})(ue||(e.TextDocumentEdit=ue={}));var z;(function(p){function x(y,d,D){var U={kind:"create",uri:y};return d!==void 0&&(d.overwrite!==void 0||d.ignoreIfExists!==void 0)&&(U.options=d),D!==void 0&&(U.annotationId=D),U}p.create=x;function E(y){var d=y;return d&&d.kind==="create"&&I.string(d.uri)&&(d.options===void 0||(d.options.overwrite===void 0||I.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||I.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(z||(e.CreateFile=z={}));var C;(function(p){function x(y,d,D,U){var ve={kind:"rename",oldUri:y,newUri:d};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ve.options=D),U!==void 0&&(ve.annotationId=U),ve}p.create=x;function E(y){var d=y;return d&&d.kind==="rename"&&I.string(d.oldUri)&&I.string(d.newUri)&&(d.options===void 0||(d.options.overwrite===void 0||I.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||I.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(C||(e.RenameFile=C={}));var M;(function(p){function x(y,d,D){var U={kind:"delete",uri:y};return d!==void 0&&(d.recursive!==void 0||d.ignoreIfNotExists!==void 0)&&(U.options=d),D!==void 0&&(U.annotationId=D),U}p.create=x;function E(y){var d=y;return d&&d.kind==="delete"&&I.string(d.uri)&&(d.options===void 0||(d.options.recursive===void 0||I.boolean(d.options.recursive))&&(d.options.ignoreIfNotExists===void 0||I.boolean(d.options.ignoreIfNotExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(M||(e.DeleteFile=M={}));var L;(function(p){function x(E){var y=E;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(d){return I.string(d.kind)?z.is(d)||C.is(d)||M.is(d):ue.is(d)}))}p.is=x})(L||(e.WorkspaceEdit=L={}));var F=function(){function p(x,E){this.edits=x,this.changeAnnotations=E}return p.prototype.insert=function(x,E,y){var d,D;if(y===void 0?d=N.insert(x,E):G.is(y)?(D=y,d=se.insert(x,E,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),d=se.insert(x,E,D)),this.edits.push(d),D!==void 0)return D},p.prototype.replace=function(x,E,y){var d,D;if(y===void 0?d=N.replace(x,E):G.is(y)?(D=y,d=se.replace(x,E,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),d=se.replace(x,E,D)),this.edits.push(d),D!==void 0)return D},p.prototype.delete=function(x,E){var y,d;if(E===void 0?y=N.del(x):G.is(E)?(d=E,y=se.del(x,E)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(E),y=se.del(x,d)),this.edits.push(y),d!==void 0)return d},p.prototype.add=function(x){this.edits.push(x)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),me=function(){function p(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(x,E){var y;if(G.is(x)?y=x:(y=this.nextId(),E=x),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=E,this._size++,y},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),pe=function(){function p(x){var E=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new me(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(y){if(ue.is(y)){var d=new F(y.edits,E._changeAnnotations);E._textEditChanges[y.textDocument.uri]=d}})):x.changes&&Object.keys(x.changes).forEach(function(y){var d=new F(x.changes[y]);E._textEditChanges[y]=d})):this._workspaceEdit={}}return Object.defineProperty(p.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),p.prototype.getTextEditChange=function(x){if(Ue.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:x.uri,version:x.version},y=this._textEditChanges[E.uri];if(!y){var d=[],D={textDocument:E,edits:d};this._workspaceEdit.documentChanges.push(D),y=new F(d,this._changeAnnotations),this._textEditChanges[E.uri]=y}return y}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var y=this._textEditChanges[x];if(!y){var d=[];this._workspaceEdit.changes[x]=d,y=new F(d),this._textEditChanges[x]=y}return y}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new me,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(x,E,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;R.is(E)||G.is(E)?d=E:y=E;var D,U;if(d===void 0?D=z.create(x,y):(U=G.is(d)?d:this._changeAnnotations.manage(d),D=z.create(x,y,U)),this._workspaceEdit.documentChanges.push(D),U!==void 0)return U},p.prototype.renameFile=function(x,E,y,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;R.is(y)||G.is(y)?D=y:d=y;var U,ve;if(D===void 0?U=C.create(x,E,d):(ve=G.is(D)?D:this._changeAnnotations.manage(D),U=C.create(x,E,d,ve)),this._workspaceEdit.documentChanges.push(U),ve!==void 0)return ve},p.prototype.deleteFile=function(x,E,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;R.is(E)||G.is(E)?d=E:y=E;var D,U;if(d===void 0?D=M.create(x,y):(U=G.is(d)?d:this._changeAnnotations.manage(d),D=M.create(x,y,U)),this._workspaceEdit.documentChanges.push(D),U!==void 0)return U},p}();e.WorkspaceChange=pe;var Nt;(function(p){function x(y){return{uri:y}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)}p.is=E})(Nt||(e.TextDocumentIdentifier=Nt={}));var vt;(function(p){function x(y,d){return{uri:y,version:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&I.integer(d.version)}p.is=E})(vt||(e.VersionedTextDocumentIdentifier=vt={}));var Ue;(function(p){function x(y,d){return{uri:y,version:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&(d.version===null||I.integer(d.version))}p.is=E})(Ue||(e.OptionalVersionedTextDocumentIdentifier=Ue={}));var _n;(function(p){function x(y,d,D,U){return{uri:y,languageId:d,version:D,text:U}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&I.string(d.languageId)&&I.integer(d.version)&&I.string(d.text)}p.is=E})(_n||(e.TextDocumentItem=_n={}));var Yi;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function x(E){var y=E;return y===p.PlainText||y===p.Markdown}p.is=x})(Yi||(e.MarkupKind=Yi={}));var ui;(function(p){function x(E){var y=E;return I.objectLiteral(E)&&Yi.is(y.kind)&&I.string(y.value)}p.is=x})(ui||(e.MarkupContent=ui={}));var _l;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(_l||(e.CompletionItemKind=_l={}));var ka;(function(p){p.PlainText=1,p.Snippet=2})(ka||(e.InsertTextFormat=ka={}));var wa;(function(p){p.Deprecated=1})(wa||(e.CompletionItemTag=wa={}));var Tl;(function(p){function x(y,d,D){return{newText:y,insert:d,replace:D}}p.create=x;function E(y){var d=y;return d&&I.string(d.newText)&&a.is(d.insert)&&a.is(d.replace)}p.is=E})(Tl||(e.InsertReplaceEdit=Tl={}));var Sl;(function(p){p.asIs=1,p.adjustIndentation=2})(Sl||(e.InsertTextMode=Sl={}));var kl;(function(p){function x(E){var y=E;return y&&(I.string(y.detail)||y.detail===void 0)&&(I.string(y.description)||y.description===void 0)}p.is=x})(kl||(e.CompletionItemLabelDetails=kl={}));var wl;(function(p){function x(E){return{label:E}}p.create=x})(wl||(e.CompletionItem=wl={}));var xl;(function(p){function x(E,y){return{items:E||[],isIncomplete:!!y}}p.create=x})(xl||(e.CompletionList=xl={}));var Ji;(function(p){function x(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=x;function E(y){var d=y;return I.string(d)||I.objectLiteral(d)&&I.string(d.language)&&I.string(d.value)}p.is=E})(Ji||(e.MarkedString=Ji={}));var hr;(function(p){function x(E){var y=E;return!!y&&I.objectLiteral(y)&&(ui.is(y.contents)||Ji.is(y.contents)||I.typedArray(y.contents,Ji.is))&&(E.range===void 0||a.is(E.range))}p.is=x})(hr||(e.Hover=hr={}));var El;(function(p){function x(E,y){return y?{label:E,documentation:y}:{label:E}}p.create=x})(El||(e.ParameterInformation=El={}));var Al;(function(p){function x(E,y){for(var d=[],D=2;D<arguments.length;D++)d[D-2]=arguments[D];var U={label:E};return I.defined(y)&&(U.documentation=y),I.defined(d)?U.parameters=d:U.parameters=[],U}p.create=x})(Al||(e.SignatureInformation=Al={}));var li;(function(p){p.Text=1,p.Read=2,p.Write=3})(li||(e.DocumentHighlightKind=li={}));var Ol;(function(p){function x(E,y){var d={range:E};return I.number(y)&&(d.kind=y),d}p.create=x})(Ol||(e.DocumentHighlight=Ol={}));var Qi;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(Qi||(e.SymbolKind=Qi={}));var Cl;(function(p){p.Deprecated=1})(Cl||(e.SymbolTag=Cl={}));var ts;(function(p){function x(E,y,d,D,U){var ve={name:E,kind:y,location:{uri:D,range:d}};return U&&(ve.containerName=U),ve}p.create=x})(ts||(e.SymbolInformation=ts={}));var Ss;(function(p){function x(E,y,d,D){return D!==void 0?{name:E,kind:y,location:{uri:d,range:D}}:{name:E,kind:y,location:{uri:d}}}p.create=x})(Ss||(e.WorkspaceSymbol=Ss={}));var Rl;(function(p){function x(y,d,D,U,ve,ft){var Xe={name:y,detail:d,kind:D,range:U,selectionRange:ve};return ft!==void 0&&(Xe.children=ft),Xe}p.create=x;function E(y){var d=y;return d&&I.string(d.name)&&I.number(d.kind)&&a.is(d.range)&&a.is(d.selectionRange)&&(d.detail===void 0||I.string(d.detail))&&(d.deprecated===void 0||I.boolean(d.deprecated))&&(d.children===void 0||Array.isArray(d.children))&&(d.tags===void 0||Array.isArray(d.tags))}p.is=E})(Rl||(e.DocumentSymbol=Rl={}));var Pl;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(Pl||(e.CodeActionKind=Pl={}));var Cr;(function(p){p.Invoked=1,p.Automatic=2})(Cr||(e.CodeActionTriggerKind=Cr={}));var xa;(function(p){function x(y,d,D){var U={diagnostics:y};return d!=null&&(U.only=d),D!=null&&(U.triggerKind=D),U}p.create=x;function E(y){var d=y;return I.defined(d)&&I.typedArray(d.diagnostics,S.is)&&(d.only===void 0||I.typedArray(d.only,I.string))&&(d.triggerKind===void 0||d.triggerKind===Cr.Invoked||d.triggerKind===Cr.Automatic)}p.is=E})(xa||(e.CodeActionContext=xa={}));var Ea;(function(p){function x(y,d,D){var U={title:y},ve=!0;return typeof d=="string"?(ve=!1,U.kind=d):_.is(d)?U.command=d:U.edit=d,ve&&D!==void 0&&(U.kind=D),U}p.create=x;function E(y){var d=y;return d&&I.string(d.title)&&(d.diagnostics===void 0||I.typedArray(d.diagnostics,S.is))&&(d.kind===void 0||I.string(d.kind))&&(d.edit!==void 0||d.command!==void 0)&&(d.command===void 0||_.is(d.command))&&(d.isPreferred===void 0||I.boolean(d.isPreferred))&&(d.edit===void 0||L.is(d.edit))}p.is=E})(Ea||(e.CodeAction=Ea={}));var Zi;(function(p){function x(y,d){var D={range:y};return I.defined(d)&&(D.data=d),D}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(d.range)&&(I.undefined(d.command)||_.is(d.command))}p.is=E})(Zi||(e.CodeLens=Zi={}));var Aa;(function(p){function x(y,d){return{tabSize:y,insertSpaces:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.uinteger(d.tabSize)&&I.boolean(d.insertSpaces)}p.is=E})(Aa||(e.FormattingOptions=Aa={}));var ns;(function(p){function x(y,d,D){return{range:y,target:d,data:D}}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(d.range)&&(I.undefined(d.target)||I.string(d.target))}p.is=E})(ns||(e.DocumentLink=ns={}));var w;(function(p){function x(y,d){return{range:y,parent:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&(d.parent===void 0||p.is(d.parent))}p.is=E})(w||(e.SelectionRange=w={}));var $;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})($||(e.SemanticTokenTypes=$={}));var V;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(V||(e.SemanticTokenModifiers=V={}));var te;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}p.is=x})(te||(e.SemanticTokens=te={}));var Ke;(function(p){function x(y,d){return{range:y,text:d}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&I.string(d.text)}p.is=E})(Ke||(e.InlineValueText=Ke={}));var Fe;(function(p){function x(y,d,D){return{range:y,variableName:d,caseSensitiveLookup:D}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&I.boolean(d.caseSensitiveLookup)&&(I.string(d.variableName)||d.variableName===void 0)}p.is=E})(Fe||(e.InlineValueVariableLookup=Fe={}));var Qe;(function(p){function x(y,d){return{range:y,expression:d}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&(I.string(d.expression)||d.expression===void 0)}p.is=E})(Qe||(e.InlineValueEvaluatableExpression=Qe={}));var st;(function(p){function x(y,d){return{frameId:y,stoppedLocation:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(y.stoppedLocation)}p.is=E})(st||(e.InlineValueContext=st={}));var xe;(function(p){p.Type=1,p.Parameter=2;function x(E){return E===1||E===2}p.is=x})(xe||(e.InlayHintKind=xe={}));var Ve;(function(p){function x(y){return{value:y}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&(d.tooltip===void 0||I.string(d.tooltip)||ui.is(d.tooltip))&&(d.location===void 0||u.is(d.location))&&(d.command===void 0||_.is(d.command))}p.is=E})(Ve||(e.InlayHintLabelPart=Ve={}));var Me;(function(p){function x(y,d,D){var U={position:y,label:d};return D!==void 0&&(U.kind=D),U}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&o.is(d.position)&&(I.string(d.label)||I.typedArray(d.label,Ve.is))&&(d.kind===void 0||xe.is(d.kind))&&d.textEdits===void 0||I.typedArray(d.textEdits,N.is)&&(d.tooltip===void 0||I.string(d.tooltip)||ui.is(d.tooltip))&&(d.paddingLeft===void 0||I.boolean(d.paddingLeft))&&(d.paddingRight===void 0||I.boolean(d.paddingRight))}p.is=E})(Me||(e.InlayHint=Me={}));var ht;(function(p){function x(E){return{kind:"snippet",value:E}}p.createSnippet=x})(ht||(e.StringValue=ht={}));var qt;(function(p){function x(E,y,d,D){return{insertText:E,filterText:y,range:d,command:D}}p.create=x})(qt||(e.InlineCompletionItem=qt={}));var Pn;(function(p){function x(E){return{items:E}}p.create=x})(Pn||(e.InlineCompletionList=Pn={}));var Dl;(function(p){p.Invoked=0,p.Automatic=1})(Dl||(e.InlineCompletionTriggerKind=Dl={}));var ZT;(function(p){function x(E,y){return{range:E,text:y}}p.create=x})(ZT||(e.SelectedCompletionInfo=ZT={}));var eS;(function(p){function x(E,y){return{triggerKind:E,selectedCompletionInfo:y}}p.create=x})(eS||(e.InlineCompletionContext=eS={}));var tS;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&r.is(y.uri)&&I.string(y.name)}p.is=x})(tS||(e.WorkspaceFolder=tS={})),e.EOL=[`
32
32
  `,`\r
33
- `,"\r"];var $v;(function(h){function S(R,U,be,ct){return new N1(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(ks,Ru){var Bv=ks.range.start.line-Ru.range.start.line;return Bv===0?ks.range.start.character-Ru.range.start.character:Bv}),Ke=be.length,Yn=ct.length-1;Yn>=0;Yn--){var Jn=ct[Yn],Lr=R.offsetAt(Jn.range.start),Ee=R.offsetAt(Jn.range.end);if(Ee<=Ke)be=be.substring(0,Lr)+Jn.newText+be.substring(Ee,be.length);else throw new Error("Overlapping edit");Ke=Lr}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 Yn=0,Jn=0,Lr=0;Yn<ct.length&&Jn<Ke.length;){var Ee=U(ct[Yn],Ke[Jn]);Ee<=0?R[Lr++]=ct[Yn++]:R[Lr++]=Ke[Jn++]}for(;Yn<ct.length;)R[Lr++]=ct[Yn++];for(;Jn<Ke.length;)R[Lr++]=Ke[Jn++];return R}})($v||(e.TextDocument=$v={}));var N1=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
- `,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}(),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,ks,Ru){return S.call(Ee)==="[object Number]"&&ks<=Ee&&Ee<=Ru}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 Yn(Ee){return S.call(Ee)==="[object Function]"}h.func=Yn;function Jn(Ee){return Ee!==null&&typeof Ee=="object"}h.objectLiteral=Jn;function Lr(Ee,ks){return Array.isArray(Ee)&&Ee.every(ks)}h.typedArray=Lr})(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 Ds=Bi(),S_;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(S_||(dn.MessageDirection=S_={}));var Hp=class{constructor(e){this.method=e}};dn.RegistrationType=Hp;var Wp=class extends Ds.RequestType0{constructor(e){super(e)}};dn.ProtocolRequestType0=Wp;var Gp=class extends Ds.RequestType{constructor(e){super(e,Ds.ParameterStructures.byName)}};dn.ProtocolRequestType=Gp;var Kp=class extends Ds.NotificationType0{constructor(e){super(e)}};dn.ProtocolNotificationType0=Kp;var Vp=class extends Ds.NotificationType{constructor(e){super(e,Ds.ParameterStructures.byName)}};dn.ProtocolNotificationType=Vp});var tc=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 RO(t){return t===!0||t===!1}kt.boolean=RO;function k_(t){return typeof t=="string"||t instanceof String}kt.string=k_;function PO(t){return typeof t=="number"||t instanceof Number}kt.number=PO;function DO(t){return t instanceof Error}kt.error=DO;function IO(t){return typeof t=="function"}kt.func=IO;function x_(t){return Array.isArray(t)}kt.array=x_;function MO(t){return x_(t)&&t.every(e=>k_(e))}kt.stringArray=MO;function LO(t,e){return Array.isArray(t)&&t.every(e)}kt.typedArray=LO;function NO(t){return t!==null&&typeof t=="object"}kt.objectLiteral=NO});var A_=g(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.ImplementationRequest=void 0;var w_=nt(),E_;(function(t){t.method="textDocument/implementation",t.messageDirection=w_.MessageDirection.clientToServer,t.type=new w_.ProtocolRequestType(t.method)})(E_||(nc.ImplementationRequest=E_={}))});var R_=g(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.TypeDefinitionRequest=void 0;var O_=nt(),C_;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=O_.MessageDirection.clientToServer,t.type=new O_.ProtocolRequestType(t.method)})(C_||(rc.TypeDefinitionRequest=C_={}))});var I_=g(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.DidChangeWorkspaceFoldersNotification=Is.WorkspaceFoldersRequest=void 0;var ic=nt(),P_;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ic.MessageDirection.serverToClient,t.type=new ic.ProtocolRequestType0(t.method)})(P_||(Is.WorkspaceFoldersRequest=P_={}));var D_;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ic.MessageDirection.clientToServer,t.type=new ic.ProtocolNotificationType(t.method)})(D_||(Is.DidChangeWorkspaceFoldersNotification=D_={}))});var N_=g(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.ConfigurationRequest=void 0;var M_=nt(),L_;(function(t){t.method="workspace/configuration",t.messageDirection=M_.MessageDirection.serverToClient,t.type=new M_.ProtocolRequestType(t.method)})(L_||(sc.ConfigurationRequest=L_={}))});var F_=g(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.ColorPresentationRequest=Ms.DocumentColorRequest=void 0;var oc=nt(),q_;(function(t){t.method="textDocument/documentColor",t.messageDirection=oc.MessageDirection.clientToServer,t.type=new oc.ProtocolRequestType(t.method)})(q_||(Ms.DocumentColorRequest=q_={}));var j_;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=oc.MessageDirection.clientToServer,t.type=new oc.ProtocolRequestType(t.method)})(j_||(Ms.ColorPresentationRequest=j_={}))});var U_=g(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.FoldingRangeRefreshRequest=Ls.FoldingRangeRequest=void 0;var ac=nt(),$_;(function(t){t.method="textDocument/foldingRange",t.messageDirection=ac.MessageDirection.clientToServer,t.type=new ac.ProtocolRequestType(t.method)})($_||(Ls.FoldingRangeRequest=$_={}));var B_;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=ac.MessageDirection.serverToClient,t.type=new ac.ProtocolRequestType0(t.method)})(B_||(Ls.FoldingRangeRefreshRequest=B_={}))});var G_=g(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.DeclarationRequest=void 0;var H_=nt(),W_;(function(t){t.method="textDocument/declaration",t.messageDirection=H_.MessageDirection.clientToServer,t.type=new H_.ProtocolRequestType(t.method)})(W_||(uc.DeclarationRequest=W_={}))});var z_=g(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.SelectionRangeRequest=void 0;var K_=nt(),V_;(function(t){t.method="textDocument/selectionRange",t.messageDirection=K_.MessageDirection.clientToServer,t.type=new K_.ProtocolRequestType(t.method)})(V_||(cc.SelectionRangeRequest=V_={}))});var Q_=g(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.WorkDoneProgressCancelNotification=ii.WorkDoneProgressCreateRequest=ii.WorkDoneProgress=void 0;var qO=Bi(),lc=nt(),X_;(function(t){t.type=new qO.ProgressType;function e(n){return n===t.type}t.is=e})(X_||(ii.WorkDoneProgress=X_={}));var Y_;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=lc.MessageDirection.serverToClient,t.type=new lc.ProtocolRequestType(t.method)})(Y_||(ii.WorkDoneProgressCreateRequest=Y_={}));var J_;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=lc.MessageDirection.clientToServer,t.type=new lc.ProtocolNotificationType(t.method)})(J_||(ii.WorkDoneProgressCancelNotification=J_={}))});var nT=g(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.CallHierarchyOutgoingCallsRequest=si.CallHierarchyIncomingCallsRequest=si.CallHierarchyPrepareRequest=void 0;var Ns=nt(),Z_;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Ns.MessageDirection.clientToServer,t.type=new Ns.ProtocolRequestType(t.method)})(Z_||(si.CallHierarchyPrepareRequest=Z_={}));var eT;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Ns.MessageDirection.clientToServer,t.type=new Ns.ProtocolRequestType(t.method)})(eT||(si.CallHierarchyIncomingCallsRequest=eT={}));var tT;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Ns.MessageDirection.clientToServer,t.type=new Ns.ProtocolRequestType(t.method)})(tT||(si.CallHierarchyOutgoingCallsRequest=tT={}))});var uT=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 qr=nt(),rT;(function(t){t.Relative="relative"})(rT||(fn.TokenFormat=rT={}));var Zo;(function(t){t.method="textDocument/semanticTokens",t.type=new qr.RegistrationType(t.method)})(Zo||(fn.SemanticTokensRegistrationType=Zo={}));var iT;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=qr.MessageDirection.clientToServer,t.type=new qr.ProtocolRequestType(t.method),t.registrationMethod=Zo.method})(iT||(fn.SemanticTokensRequest=iT={}));var sT;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=qr.MessageDirection.clientToServer,t.type=new qr.ProtocolRequestType(t.method),t.registrationMethod=Zo.method})(sT||(fn.SemanticTokensDeltaRequest=sT={}));var oT;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=qr.MessageDirection.clientToServer,t.type=new qr.ProtocolRequestType(t.method),t.registrationMethod=Zo.method})(oT||(fn.SemanticTokensRangeRequest=oT={}));var aT;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=qr.MessageDirection.serverToClient,t.type=new qr.ProtocolRequestType0(t.method)})(aT||(fn.SemanticTokensRefreshRequest=aT={}))});var dT=g(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.ShowDocumentRequest=void 0;var cT=nt(),lT;(function(t){t.method="window/showDocument",t.messageDirection=cT.MessageDirection.serverToClient,t.type=new cT.ProtocolRequestType(t.method)})(lT||(dc.ShowDocumentRequest=lT={}))});var hT=g(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.LinkedEditingRangeRequest=void 0;var fT=nt(),pT;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=fT.MessageDirection.clientToServer,t.type=new fT.ProtocolRequestType(t.method)})(pT||(fc.LinkedEditingRangeRequest=pT={}))});var ST=g(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.WillDeleteFilesRequest=Kt.DidDeleteFilesNotification=Kt.DidRenameFilesNotification=Kt.WillRenameFilesRequest=Kt.DidCreateFilesNotification=Kt.WillCreateFilesRequest=Kt.FileOperationPatternKind=void 0;var Cn=nt(),gT;(function(t){t.file="file",t.folder="folder"})(gT||(Kt.FileOperationPatternKind=gT={}));var mT;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})(mT||(Kt.WillCreateFilesRequest=mT={}));var yT;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(yT||(Kt.DidCreateFilesNotification=yT={}));var bT;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})(bT||(Kt.WillRenameFilesRequest=bT={}));var vT;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(vT||(Kt.DidRenameFilesNotification=vT={}));var _T;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(_T||(Kt.DidDeleteFilesNotification=_T={}));var TT;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})(TT||(Kt.WillDeleteFilesRequest=TT={}))});var AT=g(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.MonikerRequest=oi.MonikerKind=oi.UniquenessLevel=void 0;var kT=nt(),xT;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(xT||(oi.UniquenessLevel=xT={}));var wT;(function(t){t.$import="import",t.$export="export",t.local="local"})(wT||(oi.MonikerKind=wT={}));var ET;(function(t){t.method="textDocument/moniker",t.messageDirection=kT.MessageDirection.clientToServer,t.type=new kT.ProtocolRequestType(t.method)})(ET||(oi.MonikerRequest=ET={}))});var PT=g(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.TypeHierarchySubtypesRequest=ai.TypeHierarchySupertypesRequest=ai.TypeHierarchyPrepareRequest=void 0;var qs=nt(),OT;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=qs.MessageDirection.clientToServer,t.type=new qs.ProtocolRequestType(t.method)})(OT||(ai.TypeHierarchyPrepareRequest=OT={}));var CT;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=qs.MessageDirection.clientToServer,t.type=new qs.ProtocolRequestType(t.method)})(CT||(ai.TypeHierarchySupertypesRequest=CT={}));var RT;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=qs.MessageDirection.clientToServer,t.type=new qs.ProtocolRequestType(t.method)})(RT||(ai.TypeHierarchySubtypesRequest=RT={}))});var MT=g(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.InlineValueRefreshRequest=js.InlineValueRequest=void 0;var pc=nt(),DT;(function(t){t.method="textDocument/inlineValue",t.messageDirection=pc.MessageDirection.clientToServer,t.type=new pc.ProtocolRequestType(t.method)})(DT||(js.InlineValueRequest=DT={}));var IT;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=pc.MessageDirection.serverToClient,t.type=new pc.ProtocolRequestType0(t.method)})(IT||(js.InlineValueRefreshRequest=IT={}))});var jT=g(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.InlayHintRefreshRequest=ui.InlayHintResolveRequest=ui.InlayHintRequest=void 0;var Fs=nt(),LT;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Fs.MessageDirection.clientToServer,t.type=new Fs.ProtocolRequestType(t.method)})(LT||(ui.InlayHintRequest=LT={}));var NT;(function(t){t.method="inlayHint/resolve",t.messageDirection=Fs.MessageDirection.clientToServer,t.type=new Fs.ProtocolRequestType(t.method)})(NT||(ui.InlayHintResolveRequest=NT={}));var qT;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Fs.MessageDirection.serverToClient,t.type=new Fs.ProtocolRequestType0(t.method)})(qT||(ui.InlayHintRefreshRequest=qT={}))});var GT=g(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.DiagnosticRefreshRequest=Rn.WorkspaceDiagnosticRequest=Rn.DocumentDiagnosticRequest=Rn.DocumentDiagnosticReportKind=Rn.DiagnosticServerCancellationData=void 0;var WT=Bi(),jO=tc(),$s=nt(),FT;(function(t){function e(n){let r=n;return r&&jO.boolean(r.retriggerRequest)}t.is=e})(FT||(Rn.DiagnosticServerCancellationData=FT={}));var $T;(function(t){t.Full="full",t.Unchanged="unchanged"})($T||(Rn.DocumentDiagnosticReportKind=$T={}));var BT;(function(t){t.method="textDocument/diagnostic",t.messageDirection=$s.MessageDirection.clientToServer,t.type=new $s.ProtocolRequestType(t.method),t.partialResult=new WT.ProgressType})(BT||(Rn.DocumentDiagnosticRequest=BT={}));var UT;(function(t){t.method="workspace/diagnostic",t.messageDirection=$s.MessageDirection.clientToServer,t.type=new $s.ProtocolRequestType(t.method),t.partialResult=new WT.ProgressType})(UT||(Rn.WorkspaceDiagnosticRequest=UT={}));var HT;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=$s.MessageDirection.serverToClient,t.type=new $s.ProtocolRequestType0(t.method)})(HT||(Rn.DiagnosticRefreshRequest=HT={}))});var QT=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 ea=ec(),Zn=tc(),dr=nt(),zp;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(zp||(lt.NotebookCellKind=zp={}));var Xp;(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)&&ea.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})(Xp||(lt.ExecutionSummary=Xp={}));var hc;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return Zn.objectLiteral(o)&&zp.is(o.kind)&&ea.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)&&!Xp.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}})(hc||(lt.NotebookCell=hc={}));var KT;(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)&&ea.integer.is(i.version)&&Zn.typedArray(i.cells,hc.is)}t.is=n})(KT||(lt.NotebookDocument=KT={}));var Bs;(function(t){t.method="notebookDocument/sync",t.messageDirection=dr.MessageDirection.clientToServer,t.type=new dr.RegistrationType(t.method)})(Bs||(lt.NotebookDocumentSyncRegistrationType=Bs={}));var VT;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=dr.MessageDirection.clientToServer,t.type=new dr.ProtocolNotificationType(t.method),t.registrationMethod=Bs.method})(VT||(lt.DidOpenNotebookDocumentNotification=VT={}));var zT;(function(t){function e(r){let i=r;return Zn.objectLiteral(i)&&ea.uinteger.is(i.start)&&ea.uinteger.is(i.deleteCount)&&(i.cells===void 0||Zn.typedArray(i.cells,hc.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})(zT||(lt.NotebookCellArrayChange=zT={}));var XT;(function(t){t.method="notebookDocument/didChange",t.messageDirection=dr.MessageDirection.clientToServer,t.type=new dr.ProtocolNotificationType(t.method),t.registrationMethod=Bs.method})(XT||(lt.DidChangeNotebookDocumentNotification=XT={}));var YT;(function(t){t.method="notebookDocument/didSave",t.messageDirection=dr.MessageDirection.clientToServer,t.type=new dr.ProtocolNotificationType(t.method),t.registrationMethod=Bs.method})(YT||(lt.DidSaveNotebookDocumentNotification=YT={}));var JT;(function(t){t.method="notebookDocument/didClose",t.messageDirection=dr.MessageDirection.clientToServer,t.type=new dr.ProtocolNotificationType(t.method),t.registrationMethod=Bs.method})(JT||(lt.DidCloseNotebookDocumentNotification=JT={}))});var tS=g(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.InlineCompletionRequest=void 0;var ZT=nt(),eS;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=ZT.MessageDirection.clientToServer,t.type=new ZT.ProtocolRequestType(t.method)})(eS||(gc.InlineCompletionRequest=eS={}))});var hk=g(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.WorkspaceSymbolRequest=y.CodeActionResolveRequest=y.CodeActionRequest=y.DocumentSymbolRequest=y.DocumentHighlightRequest=y.ReferencesRequest=y.DefinitionRequest=y.SignatureHelpRequest=y.SignatureHelpTriggerKind=y.HoverRequest=y.CompletionResolveRequest=y.CompletionRequest=y.CompletionTriggerKind=y.PublishDiagnosticsNotification=y.WatchKind=y.RelativePattern=y.FileChangeType=y.DidChangeWatchedFilesNotification=y.WillSaveTextDocumentWaitUntilRequest=y.WillSaveTextDocumentNotification=y.TextDocumentSaveReason=y.DidSaveTextDocumentNotification=y.DidCloseTextDocumentNotification=y.DidChangeTextDocumentNotification=y.TextDocumentContentChangeEvent=y.DidOpenTextDocumentNotification=y.TextDocumentSyncKind=y.TelemetryEventNotification=y.LogMessageNotification=y.ShowMessageRequest=y.ShowMessageNotification=y.MessageType=y.DidChangeConfigurationNotification=y.ExitNotification=y.ShutdownRequest=y.InitializedNotification=y.InitializeErrorCodes=y.InitializeRequest=y.WorkDoneProgressOptions=y.TextDocumentRegistrationOptions=y.StaticRegistrationOptions=y.PositionEncodingKind=y.FailureHandlingKind=y.ResourceOperationKind=y.UnregistrationRequest=y.RegistrationRequest=y.DocumentSelector=y.NotebookCellTextDocumentFilter=y.NotebookDocumentFilter=y.TextDocumentFilter=void 0;y.MonikerRequest=y.MonikerKind=y.UniquenessLevel=y.WillDeleteFilesRequest=y.DidDeleteFilesNotification=y.WillRenameFilesRequest=y.DidRenameFilesNotification=y.WillCreateFilesRequest=y.DidCreateFilesNotification=y.FileOperationPatternKind=y.LinkedEditingRangeRequest=y.ShowDocumentRequest=y.SemanticTokensRegistrationType=y.SemanticTokensRefreshRequest=y.SemanticTokensRangeRequest=y.SemanticTokensDeltaRequest=y.SemanticTokensRequest=y.TokenFormat=y.CallHierarchyPrepareRequest=y.CallHierarchyOutgoingCallsRequest=y.CallHierarchyIncomingCallsRequest=y.WorkDoneProgressCancelNotification=y.WorkDoneProgressCreateRequest=y.WorkDoneProgress=y.SelectionRangeRequest=y.DeclarationRequest=y.FoldingRangeRefreshRequest=y.FoldingRangeRequest=y.ColorPresentationRequest=y.DocumentColorRequest=y.ConfigurationRequest=y.DidChangeWorkspaceFoldersNotification=y.WorkspaceFoldersRequest=y.TypeDefinitionRequest=y.ImplementationRequest=y.ApplyWorkspaceEditRequest=y.ExecuteCommandRequest=y.PrepareRenameRequest=y.RenameRequest=y.PrepareSupportDefaultBehavior=y.DocumentOnTypeFormattingRequest=y.DocumentRangesFormattingRequest=y.DocumentRangeFormattingRequest=y.DocumentFormattingRequest=y.DocumentLinkResolveRequest=y.DocumentLinkRequest=y.CodeLensRefreshRequest=y.CodeLensResolveRequest=y.CodeLensRequest=y.WorkspaceSymbolResolveRequest=void 0;y.InlineCompletionRequest=y.DidCloseNotebookDocumentNotification=y.DidSaveNotebookDocumentNotification=y.DidChangeNotebookDocumentNotification=y.NotebookCellArrayChange=y.DidOpenNotebookDocumentNotification=y.NotebookDocumentSyncRegistrationType=y.NotebookDocument=y.NotebookCell=y.ExecutionSummary=y.NotebookCellKind=y.DiagnosticRefreshRequest=y.WorkspaceDiagnosticRequest=y.DocumentDiagnosticRequest=y.DocumentDiagnosticReportKind=y.DiagnosticServerCancellationData=y.InlayHintRefreshRequest=y.InlayHintResolveRequest=y.InlayHintRequest=y.InlineValueRefreshRequest=y.InlineValueRequest=y.TypeHierarchySupertypesRequest=y.TypeHierarchySubtypesRequest=y.TypeHierarchyPrepareRequest=void 0;var G=nt(),nS=ec(),Mt=tc(),FO=A_();Object.defineProperty(y,"ImplementationRequest",{enumerable:!0,get:function(){return FO.ImplementationRequest}});var $O=R_();Object.defineProperty(y,"TypeDefinitionRequest",{enumerable:!0,get:function(){return $O.TypeDefinitionRequest}});var lk=I_();Object.defineProperty(y,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return lk.WorkspaceFoldersRequest}});Object.defineProperty(y,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return lk.DidChangeWorkspaceFoldersNotification}});var BO=N_();Object.defineProperty(y,"ConfigurationRequest",{enumerable:!0,get:function(){return BO.ConfigurationRequest}});var dk=F_();Object.defineProperty(y,"DocumentColorRequest",{enumerable:!0,get:function(){return dk.DocumentColorRequest}});Object.defineProperty(y,"ColorPresentationRequest",{enumerable:!0,get:function(){return dk.ColorPresentationRequest}});var fk=U_();Object.defineProperty(y,"FoldingRangeRequest",{enumerable:!0,get:function(){return fk.FoldingRangeRequest}});Object.defineProperty(y,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return fk.FoldingRangeRefreshRequest}});var UO=G_();Object.defineProperty(y,"DeclarationRequest",{enumerable:!0,get:function(){return UO.DeclarationRequest}});var HO=z_();Object.defineProperty(y,"SelectionRangeRequest",{enumerable:!0,get:function(){return HO.SelectionRangeRequest}});var eh=Q_();Object.defineProperty(y,"WorkDoneProgress",{enumerable:!0,get:function(){return eh.WorkDoneProgress}});Object.defineProperty(y,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return eh.WorkDoneProgressCreateRequest}});Object.defineProperty(y,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return eh.WorkDoneProgressCancelNotification}});var th=nT();Object.defineProperty(y,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return th.CallHierarchyIncomingCallsRequest}});Object.defineProperty(y,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return th.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(y,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return th.CallHierarchyPrepareRequest}});var Us=uT();Object.defineProperty(y,"TokenFormat",{enumerable:!0,get:function(){return Us.TokenFormat}});Object.defineProperty(y,"SemanticTokensRequest",{enumerable:!0,get:function(){return Us.SemanticTokensRequest}});Object.defineProperty(y,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Us.SemanticTokensDeltaRequest}});Object.defineProperty(y,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Us.SemanticTokensRangeRequest}});Object.defineProperty(y,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Us.SemanticTokensRefreshRequest}});Object.defineProperty(y,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Us.SemanticTokensRegistrationType}});var WO=dT();Object.defineProperty(y,"ShowDocumentRequest",{enumerable:!0,get:function(){return WO.ShowDocumentRequest}});var GO=hT();Object.defineProperty(y,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return GO.LinkedEditingRangeRequest}});var Ui=ST();Object.defineProperty(y,"FileOperationPatternKind",{enumerable:!0,get:function(){return Ui.FileOperationPatternKind}});Object.defineProperty(y,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Ui.DidCreateFilesNotification}});Object.defineProperty(y,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Ui.WillCreateFilesRequest}});Object.defineProperty(y,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Ui.DidRenameFilesNotification}});Object.defineProperty(y,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Ui.WillRenameFilesRequest}});Object.defineProperty(y,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Ui.DidDeleteFilesNotification}});Object.defineProperty(y,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Ui.WillDeleteFilesRequest}});var nh=AT();Object.defineProperty(y,"UniquenessLevel",{enumerable:!0,get:function(){return nh.UniquenessLevel}});Object.defineProperty(y,"MonikerKind",{enumerable:!0,get:function(){return nh.MonikerKind}});Object.defineProperty(y,"MonikerRequest",{enumerable:!0,get:function(){return nh.MonikerRequest}});var rh=PT();Object.defineProperty(y,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return rh.TypeHierarchyPrepareRequest}});Object.defineProperty(y,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return rh.TypeHierarchySubtypesRequest}});Object.defineProperty(y,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return rh.TypeHierarchySupertypesRequest}});var pk=MT();Object.defineProperty(y,"InlineValueRequest",{enumerable:!0,get:function(){return pk.InlineValueRequest}});Object.defineProperty(y,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return pk.InlineValueRefreshRequest}});var ih=jT();Object.defineProperty(y,"InlayHintRequest",{enumerable:!0,get:function(){return ih.InlayHintRequest}});Object.defineProperty(y,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ih.InlayHintResolveRequest}});Object.defineProperty(y,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ih.InlayHintRefreshRequest}});var ta=GT();Object.defineProperty(y,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return ta.DiagnosticServerCancellationData}});Object.defineProperty(y,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return ta.DocumentDiagnosticReportKind}});Object.defineProperty(y,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return ta.DocumentDiagnosticRequest}});Object.defineProperty(y,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return ta.WorkspaceDiagnosticRequest}});Object.defineProperty(y,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return ta.DiagnosticRefreshRequest}});var fr=QT();Object.defineProperty(y,"NotebookCellKind",{enumerable:!0,get:function(){return fr.NotebookCellKind}});Object.defineProperty(y,"ExecutionSummary",{enumerable:!0,get:function(){return fr.ExecutionSummary}});Object.defineProperty(y,"NotebookCell",{enumerable:!0,get:function(){return fr.NotebookCell}});Object.defineProperty(y,"NotebookDocument",{enumerable:!0,get:function(){return fr.NotebookDocument}});Object.defineProperty(y,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return fr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(y,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return fr.DidOpenNotebookDocumentNotification}});Object.defineProperty(y,"NotebookCellArrayChange",{enumerable:!0,get:function(){return fr.NotebookCellArrayChange}});Object.defineProperty(y,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return fr.DidChangeNotebookDocumentNotification}});Object.defineProperty(y,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return fr.DidSaveNotebookDocumentNotification}});Object.defineProperty(y,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return fr.DidCloseNotebookDocumentNotification}});var KO=tS();Object.defineProperty(y,"InlineCompletionRequest",{enumerable:!0,get:function(){return KO.InlineCompletionRequest}});var Yp;(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})(Yp||(y.TextDocumentFilter=Yp={}));var Jp;(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})(Jp||(y.NotebookDocumentFilter=Jp={}));var Qp;(function(t){function e(n){let r=n;return Mt.objectLiteral(r)&&(Mt.string(r.notebook)||Jp.is(r.notebook))&&(r.language===void 0||Mt.string(r.language))}t.is=e})(Qp||(y.NotebookCellTextDocumentFilter=Qp={}));var Zp;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Mt.string(r)&&!Yp.is(r)&&!Qp.is(r))return!1;return!0}t.is=e})(Zp||(y.DocumentSelector=Zp={}));var rS;(function(t){t.method="client/registerCapability",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(rS||(y.RegistrationRequest=rS={}));var iS;(function(t){t.method="client/unregisterCapability",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(iS||(y.UnregistrationRequest=iS={}));var sS;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(sS||(y.ResourceOperationKind=sS={}));var oS;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(oS||(y.FailureHandlingKind=oS={}));var aS;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(aS||(y.PositionEncodingKind=aS={}));var uS;(function(t){function e(n){let r=n;return r&&Mt.string(r.id)&&r.id.length>0}t.hasId=e})(uS||(y.StaticRegistrationOptions=uS={}));var cS;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Zp.is(r.documentSelector))}t.is=e})(cS||(y.TextDocumentRegistrationOptions=cS={}));var lS;(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})(lS||(y.WorkDoneProgressOptions=lS={}));var dS;(function(t){t.method="initialize",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(dS||(y.InitializeRequest=dS={}));var fS;(function(t){t.unknownProtocolVersion=1})(fS||(y.InitializeErrorCodes=fS={}));var pS;(function(t){t.method="initialized",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(pS||(y.InitializedNotification=pS={}));var hS;(function(t){t.method="shutdown",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType0(t.method)})(hS||(y.ShutdownRequest=hS={}));var gS;(function(t){t.method="exit",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType0(t.method)})(gS||(y.ExitNotification=gS={}));var mS;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(mS||(y.DidChangeConfigurationNotification=mS={}));var yS;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(yS||(y.MessageType=yS={}));var bS;(function(t){t.method="window/showMessage",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(bS||(y.ShowMessageNotification=bS={}));var vS;(function(t){t.method="window/showMessageRequest",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(vS||(y.ShowMessageRequest=vS={}));var _S;(function(t){t.method="window/logMessage",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(_S||(y.LogMessageNotification=_S={}));var TS;(function(t){t.method="telemetry/event",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(TS||(y.TelemetryEventNotification=TS={}));var SS;(function(t){t.None=0,t.Full=1,t.Incremental=2})(SS||(y.TextDocumentSyncKind=SS={}));var kS;(function(t){t.method="textDocument/didOpen",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(kS||(y.DidOpenTextDocumentNotification=kS={}));var xS;(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})(xS||(y.TextDocumentContentChangeEvent=xS={}));var wS;(function(t){t.method="textDocument/didChange",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(wS||(y.DidChangeTextDocumentNotification=wS={}));var ES;(function(t){t.method="textDocument/didClose",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(ES||(y.DidCloseTextDocumentNotification=ES={}));var AS;(function(t){t.method="textDocument/didSave",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(AS||(y.DidSaveTextDocumentNotification=AS={}));var OS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(OS||(y.TextDocumentSaveReason=OS={}));var CS;(function(t){t.method="textDocument/willSave",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(CS||(y.WillSaveTextDocumentNotification=CS={}));var RS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(RS||(y.WillSaveTextDocumentWaitUntilRequest=RS={}));var PS;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(PS||(y.DidChangeWatchedFilesNotification=PS={}));var DS;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(DS||(y.FileChangeType=DS={}));var IS;(function(t){function e(n){let r=n;return Mt.objectLiteral(r)&&(nS.URI.is(r.baseUri)||nS.WorkspaceFolder.is(r.baseUri))&&Mt.string(r.pattern)}t.is=e})(IS||(y.RelativePattern=IS={}));var MS;(function(t){t.Create=1,t.Change=2,t.Delete=4})(MS||(y.WatchKind=MS={}));var LS;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(LS||(y.PublishDiagnosticsNotification=LS={}));var NS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(NS||(y.CompletionTriggerKind=NS={}));var qS;(function(t){t.method="textDocument/completion",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(qS||(y.CompletionRequest=qS={}));var jS;(function(t){t.method="completionItem/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(jS||(y.CompletionResolveRequest=jS={}));var FS;(function(t){t.method="textDocument/hover",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(FS||(y.HoverRequest=FS={}));var $S;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})($S||(y.SignatureHelpTriggerKind=$S={}));var BS;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(BS||(y.SignatureHelpRequest=BS={}));var US;(function(t){t.method="textDocument/definition",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(US||(y.DefinitionRequest=US={}));var HS;(function(t){t.method="textDocument/references",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(HS||(y.ReferencesRequest=HS={}));var WS;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(WS||(y.DocumentHighlightRequest=WS={}));var GS;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(GS||(y.DocumentSymbolRequest=GS={}));var KS;(function(t){t.method="textDocument/codeAction",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(KS||(y.CodeActionRequest=KS={}));var VS;(function(t){t.method="codeAction/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(VS||(y.CodeActionResolveRequest=VS={}));var zS;(function(t){t.method="workspace/symbol",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(zS||(y.WorkspaceSymbolRequest=zS={}));var XS;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(XS||(y.WorkspaceSymbolResolveRequest=XS={}));var YS;(function(t){t.method="textDocument/codeLens",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(YS||(y.CodeLensRequest=YS={}));var JS;(function(t){t.method="codeLens/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(JS||(y.CodeLensResolveRequest=JS={}));var QS;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType0(t.method)})(QS||(y.CodeLensRefreshRequest=QS={}));var ZS;(function(t){t.method="textDocument/documentLink",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(ZS||(y.DocumentLinkRequest=ZS={}));var ek;(function(t){t.method="documentLink/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(ek||(y.DocumentLinkResolveRequest=ek={}));var tk;(function(t){t.method="textDocument/formatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(tk||(y.DocumentFormattingRequest=tk={}));var nk;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(nk||(y.DocumentRangeFormattingRequest=nk={}));var rk;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(rk||(y.DocumentRangesFormattingRequest=rk={}));var ik;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(ik||(y.DocumentOnTypeFormattingRequest=ik={}));var sk;(function(t){t.Identifier=1})(sk||(y.PrepareSupportDefaultBehavior=sk={}));var ok;(function(t){t.method="textDocument/rename",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(ok||(y.RenameRequest=ok={}));var ak;(function(t){t.method="textDocument/prepareRename",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(ak||(y.PrepareRenameRequest=ak={}));var uk;(function(t){t.method="workspace/executeCommand",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(uk||(y.ExecuteCommandRequest=uk={}));var ck;(function(t){t.method="workspace/applyEdit",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType("workspace/applyEdit")})(ck||(y.ApplyWorkspaceEditRequest=ck={}))});var mk=g(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.createProtocolConnection=void 0;var gk=Bi();function VO(t,e,n,r){return gk.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,gk.createMessageConnection)(t,e,n,r)}mc.createProtocolConnection=VO});var bk=g(pn=>{"use strict";var zO=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]}),yc=pn&&pn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&zO(e,t,n)};Object.defineProperty(pn,"__esModule",{value:!0});pn.LSPErrorCodes=pn.createProtocolConnection=void 0;yc(Bi(),pn);yc(ec(),pn);yc(nt(),pn);yc(hk(),pn);var XO=mk();Object.defineProperty(pn,"createProtocolConnection",{enumerable:!0,get:function(){return XO.createProtocolConnection}});var yk;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(yk||(pn.LSPErrorCodes=yk={}))});var yt=g(pr=>{"use strict";var YO=pr&&pr.__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=pr&&pr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&YO(e,t,n)};Object.defineProperty(pr,"__esModule",{value:!0});pr.createProtocolConnection=void 0;var JO=Up();vk(Up(),pr);vk(bk(),pr);function QO(t,e,n,r){return(0,JO.createMessageConnection)(t,e,n,r)}pr.createProtocolConnection=QO});var sh=g(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.generateUuid=Pn.parse=Pn.isUUID=Pn.v4=Pn.empty=void 0;var na=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ra=class t extends na{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(""))}};ra._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ra._timeHighBits=["8","9","a","b"];Pn.empty=new na("00000000-0000-0000-0000-000000000000");function _k(){return new ra}Pn.v4=_k;var ZO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Tk(t){return ZO.test(t)}Pn.isUUID=Tk;function eC(t){if(!Tk(t))throw new Error("invalid uuid");return new na(t)}Pn.parse=eC;function tC(){return _k().asHex()}Pn.generateUuid=tC});var Sk=g(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.attachPartialResult=li.ProgressFeature=li.attachWorkDone=void 0;var ci=yt(),nC=sh(),Hi=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(ci.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(ci.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(ci.WorkDoneProgress.type,this._token,{kind:"end"})}};Hi.Instances=new Map;var bc=class extends Hi{constructor(e,n){super(e,n),this._source=new ci.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ia=class{constructor(){}begin(){}report(){}done(){}},vc=class extends ia{constructor(){super(),this._source=new ci.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 ia;let n=e.workDoneToken;return delete e.workDoneToken,new Hi(t,n)}li.attachWorkDone=rC;var iC=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ci.WorkDoneProgressCancelNotification.type,n=>{let r=Hi.Instances.get(n.token);(r instanceof bc||r instanceof vc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ia:new Hi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,nC.generateUuid)();return this.connection.sendRequest(ci.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new bc(this.connection,e))}else return Promise.resolve(new vc)}};li.ProgressFeature=iC;var oh;(function(t){t.type=new ci.ProgressType})(oh||(oh={}));var ah=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(oh.type,this._token,e)}};function sC(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new ah(t,n)}li.attachPartialResult=sC});var kk=g(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.ConfigurationFeature=void 0;var oC=yt(),aC=Pu(),uC=t=>class extends t{getConfiguration(e){return e?aC.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(oC.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};_c.ConfigurationFeature=uC});var xk=g(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.WorkspaceFoldersFeature=void 0;var Tc=yt(),cC=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Tc.Emitter,this.connection.onNotification(Tc.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(Tc.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(Tc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Sc.WorkspaceFoldersFeature=cC});var wk=g(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.CallHierarchyFeature=void 0;var uh=yt(),lC=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(uh.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=uh.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=uh.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};kc.CallHierarchyFeature=lC});var lh=g(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.SemanticTokensBuilder=di.SemanticTokensDiff=di.SemanticTokensFeature=void 0;var xc=yt(),dC=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(xc.SemanticTokensRefreshRequest.type),on:e=>{let n=xc.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=xc.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=xc.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};di.SemanticTokensFeature=dC;var wc=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}]:[]}};di.SemanticTokensDiff=wc;var ch=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 wc(this._prevData,this._data).computeDiff()}:this.build()}};di.SemanticTokensBuilder=ch});var Ek=g(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.ShowDocumentFeature=void 0;var fC=yt(),pC=t=>class extends t{showDocument(e){return this.connection.sendRequest(fC.ShowDocumentRequest.type,e)}};Ec.ShowDocumentFeature=pC});var Ak=g(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.FileOperationsFeature=void 0;var Hs=yt(),hC=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Hs.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Hs.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Hs.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Hs.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Hs.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Hs.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Ac.FileOperationsFeature=hC});var Ok=g(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.LinkedEditingRangeFeature=void 0;var gC=yt(),mC=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(gC.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Oc.LinkedEditingRangeFeature=mC});var Ck=g(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.TypeHierarchyFeature=void 0;var dh=yt(),yC=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(dh.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=dh.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=dh.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Cc.TypeHierarchyFeature=yC});var Pk=g(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.InlineValueFeature=void 0;var Rk=yt(),bC=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)))}}};Rc.InlineValueFeature=bC});var Ik=g(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.FoldingRangeFeature=void 0;var Dk=yt(),vC=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Dk.FoldingRangeRefreshRequest.type),on:e=>{let n=Dk.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Pc.FoldingRangeFeature=vC});var Mk=g(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.InlayHintFeature=void 0;var fh=yt(),_C=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(fh.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(fh.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(fh.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Dc.InlayHintFeature=_C});var Lk=g(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.DiagnosticFeature=void 0;var sa=yt(),TC=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(sa.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(sa.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(sa.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(sa.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(sa.WorkspaceDiagnosticRequest.partialResult,n)))}}};Ic.DiagnosticFeature=TC});var hh=g(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.TextDocuments=void 0;var Wi=yt(),ph=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Wi.Emitter,this._onDidOpen=new Wi.Emitter,this._onDidClose=new Wi.Emitter,this._onDidSave=new Wi.Emitter,this._onWillSave=new Wi.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=Wi.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}))})),Wi.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Mc.TextDocuments=ph});var mh=g(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.NotebookDocuments=Ws.NotebookSyncFeature=void 0;var Dn=yt(),Nk=hh(),SC=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)})}}};Ws.NotebookSyncFeature=SC;var Lc=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}};Lc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var gh=class{constructor(e){e instanceof Nk.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Nk.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new 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 Lc,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 b={notebookDocument:s};a&&(b.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)&&(b.cells={added:_,removed:E,changed:{data:d,textContent:L}}),(b.metadata!==void 0||b.cells!==void 0)&&this._onDidChange.fire(b)})),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])}};Ws.NotebookDocuments=gh});var qk=g(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.MonikerFeature=void 0;var kC=yt(),xC=t=>class extends t{get moniker(){return{on:e=>{let n=kC.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Nc.MonikerFeature=xC});var Sh=g(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createConnection=Ie.combineFeatures=Ie.combineNotebooksFeatures=Ie.combineLanguagesFeatures=Ie.combineWorkspaceFeatures=Ie.combineWindowFeatures=Ie.combineClientFeatures=Ie.combineTracerFeatures=Ie.combineTelemetryFeatures=Ie.combineConsoleFeatures=Ie._NotebooksImpl=Ie._LanguagesImpl=Ie.BulkUnregistration=Ie.BulkRegistration=Ie.ErrorMessageTracker=void 0;var X=yt(),In=Pu(),bh=sh(),ge=Sk(),wC=kk(),EC=xk(),AC=wk(),OC=lh(),CC=Ek(),RC=Ak(),PC=Ok(),DC=Ck(),IC=Pk(),MC=Ik(),LC=Mk(),NC=Lk(),qC=mh(),jC=qk();function yh(t){if(t!==null)return t}var vh=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Ie.ErrorMessageTracker=vh;var qc=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")})}},_h=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(yh)}showWarningMessage(e,...n){let r={type:X.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(X.ShowMessageRequest.type,r).then(yh)}showInformationMessage(e,...n){let r={type:X.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(X.ShowMessageRequest.type,r).then(yh)}},jk=(0,CC.ShowDocumentFeature)((0,ge.ProgressFeature)(_h)),Fk;(function(t){function e(){return new jc}t.create=e})(Fk||(Ie.BulkRegistration=Fk={}));var jc=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=bh.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},$k;(function(t){function e(){return new oa(void 0,[])}t.create=e})($k||(Ie.BulkUnregistration=$k={}));var oa=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}},Fc=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 jc?this.registerMany(e):e instanceof oa?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=In.string(n)?n:n.method,s=bh.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=bh.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 oa(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Th=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)}},Bk=(0,RC.FileOperationsFeature)((0,EC.WorkspaceFoldersFeature)((0,wC.ConfigurationFeature)(Th))),$c=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(()=>{})}},Bc=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")})}},Uc=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)}};Ie._LanguagesImpl=Uc;var Uk=(0,MC.FoldingRangeFeature)((0,jC.MonikerFeature)((0,NC.DiagnosticFeature)((0,LC.InlayHintFeature)((0,IC.InlineValueFeature)((0,DC.TypeHierarchyFeature)((0,PC.LinkedEditingRangeFeature)((0,OC.SemanticTokensFeature)((0,AC.CallHierarchyFeature)(Uc))))))))),Hc=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)}};Ie._NotebooksImpl=Hc;var Hk=(0,qC.NotebookSyncFeature)(Hc);function Wk(t,e){return function(n){return e(t(n))}}Ie.combineConsoleFeatures=Wk;function Gk(t,e){return function(n){return e(t(n))}}Ie.combineTelemetryFeatures=Gk;function Kk(t,e){return function(n){return e(t(n))}}Ie.combineTracerFeatures=Kk;function Vk(t,e){return function(n){return e(t(n))}}Ie.combineClientFeatures=Vk;function zk(t,e){return function(n){return e(t(n))}}Ie.combineWindowFeatures=zk;function Xk(t,e){return function(n){return e(t(n))}}Ie.combineWorkspaceFeatures=Xk;function Yk(t,e){return function(n){return e(t(n))}}Ie.combineLanguagesFeatures=Yk;function Jk(t,e){return function(n){return e(t(n))}}Ie.combineNotebooksFeatures=Jk;function FC(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Wk),tracer:n(t.tracer,e.tracer,Kk),telemetry:n(t.telemetry,e.telemetry,Gk),client:n(t.client,e.client,Vk),window:n(t.window,e.window,zk),workspace:n(t.workspace,e.workspace,Xk),languages:n(t.languages,e.languages,Yk),notebooks:n(t.notebooks,e.notebooks,Jk)}}Ie.combineFeatures=FC;function $C(t,e,n){let r=n&&n.console?new(n.console(qc)):new qc,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer($c)):new $c,o=n&&n.telemetry?new(n.telemetry(Bc)):new Bc,a=n&&n.client?new(n.client(Fc)):new Fc,u=n&&n.window?new(n.window(jk)):new jk,c=n&&n.workspace?new(n.workspace(Bk)):new Bk,l=n&&n.languages?new(n.languages(Uk)):new Uk,d=n&&n.notebooks?new(n.notebooks(Hk)):new Hk,p=[r,s,o,a,u,c,l,d];function b(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 b(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}Ie.createConnection=$C});var Qk=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 BC=require("url"),er=require("path"),kh=require("fs"),Ah=require("child_process");function UC(t){let e=BC.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 er.normalize(n.join("/"))}hn.uriToFilePath=UC;function xh(){return process.platform==="win32"}function Wc(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&&kh.existsSync(e)&&(c[i]?c[i]=e+er.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,Ah.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=Wc;function wh(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};xh()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,Ah.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?xh()?er.join(o,"node_modules"):er.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}hn.resolveGlobalNodePath=wh;function HC(t){let e="yarn",n={encoding:"utf8"};xh()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,Ah.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 er.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}hn.resolveGlobalYarnPath=HC;var Eh;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!kh.existsSync(__filename.toUpperCase())||!kh.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?er.normalize(s).indexOf(er.normalize(i))===0:er.normalize(s).toLowerCase().indexOf(er.normalize(i).toLowerCase())===0}t.isParent=r})(Eh||(hn.FileSystem=Eh={}));function WC(t,e,n,r){return n?(er.isAbsolute(n)||(n=er.join(t,n)),Wc(e,n,n,r).then(i=>Eh.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Wc(e,wh(r),t,r))):Wc(e,wh(r),t,r)}hn.resolveModulePath=WC});var Oh=g((Q2,Zk)=>{"use strict";Zk.exports=yt()});var ex=g(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.InlineCompletionFeature=void 0;var GC=yt(),KC=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(GC.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Gc.InlineCompletionFeature=KC});var rx=g(Vt=>{"use strict";var VC=Vt&&Vt.__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]}),nx=Vt&&Vt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&VC(e,t,n)};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.ProposedFeatures=Vt.NotebookDocuments=Vt.TextDocuments=Vt.SemanticTokensBuilder=void 0;var zC=lh();Object.defineProperty(Vt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return zC.SemanticTokensBuilder}});var XC=ex();nx(yt(),Vt);var YC=hh();Object.defineProperty(Vt,"TextDocuments",{enumerable:!0,get:function(){return YC.TextDocuments}});var JC=mh();Object.defineProperty(Vt,"NotebookDocuments",{enumerable:!0,get:function(){return JC.NotebookDocuments}});nx(Sh(),Vt);var tx;(function(t){t.all={__brand:"features",languages:XC.InlineCompletionFeature}})(tx||(Vt.ProposedFeatures=tx={}))});var Rh=g(Mn=>{"use strict";var QC=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]}),ax=Mn&&Mn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&QC(e,t,n)};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.createConnection=Mn.Files=void 0;var ix=require("node:util"),Ch=Pu(),ZC=Sh(),aa=Qk(),Gi=Oh();ax(Oh(),Mn);ax(rx(),Mn);var sx;(function(t){t.uriToFilePath=aa.uriToFilePath,t.resolveGlobalNodePath=aa.resolveGlobalNodePath,t.resolveGlobalYarnPath=aa.resolveGlobalYarnPath,t.resolve=aa.resolve,t.resolveModulePath=aa.resolveModulePath})(sx||(Mn.Files=sx={}));var ox;function Kc(){if(ox!==void 0)try{ox.end()}catch{}}var Gs=!1,ux;function eR(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(ux=setInterval(()=>{try{process.kill(r,0)}catch{Kc(),process.exit(Gs?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])}}}eR();var tR={initialize:t=>{let e=t.processId;Ch.number(e)&&ux===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Gs?0:1)}},3e3)},get shutdownReceived(){return Gs},set shutdownReceived(t){Gs=t},exit:t=>{Kc(),process.exit(t)}};function nR(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Gi.ConnectionStrategy.is(t)||Gi.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),rR(s,o,a,i)}Mn.createConnection=nR;function rR(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 Gi.IPCMessageReader(process),e=new Gi.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,Gi.createServerSocketTransport)(u);t=d[0],e=d[1]}else if(c){let d=(0,Gi.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(Ch.func(t.read)&&Ch.func(t.on)){let u=t;u.on("end",()=>{Kc(),process.exit(Gs?0:1)}),u.on("close",()=>{Kc(),process.exit(Gs?0:1)})}let a=u=>{let c=(0,Gi.createProtocolConnection)(t,e,u,n);return i&&iR(u),c};return(0,ZC.createConnection)(a,tR,r)}function iR(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,ix.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,ix.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((rB,cx)=>{"use strict";cx.exports=Rh()});var Ks=g(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.IndentationType=jr.ConfigurationNamespace=jr.LanguageId=void 0;jr.LanguageId="miniscript";jr.ConfigurationNamespace="miniscript";var sR;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(sR=jr.IndentationType||(jr.IndentationType={}))});var ua=g(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Position=void 0;var Dh=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};Vc.Position=Dh});var fi=g(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.LiteralToken=Sn.Token=Sn.BaseToken=Sn.BaseTokenOptions=Sn.TokenType=void 0;var lx=ua(),oR;(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"})(oR=Sn.TokenType||(Sn.TokenType={}));var Ih=class{};Sn.BaseTokenOptions=Ih;var ca=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 lx.Position(this.line,r[0]-n[0]+1),this.end=new lx.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=ca;var Mh=class extends ca{};Sn.Token=Mh;var Lh=class extends ca{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=Lh});var zc=g(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.CharacterCode=void 0;var aR;(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"})(aR=la.CharacterCode||(la.CharacterCode={}))});var Vs=g(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.Keyword=void 0;var uR;(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"})(uR=da.Keyword||(da.Keyword={}))});var jh=g(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var Ln=zc(),cR=Vs(),Nh=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(cR.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}};qh.default=Nh});var Xc=g(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.ParserException=zs.LexerException=void 0;var Fh=class extends Error{constructor(e,n){super(e),this.range=n}};zs.LexerException=Fh;var $h=class extends Error{constructor(e,n){super(e),this.range=n}};zs.ParserException=$h});var Bh=g(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.Literal=void 0;var lR;(function(t){t.True="true",t.False="false",t.Null="null"})(lR=fa.Literal||(fa.Literal={}))});var Xs=g(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.Operator=void 0;var dR;(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"})(dR=pa.Operator||(pa.Operator={}))});var ha=g(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.Range=void 0;var Uh=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};Yc.Range=Uh});var Gh=g(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});var Hh=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}};Wh.default=Hh});var zh=g(ma=>{"use strict";var fx=ma&&ma.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ma,"__esModule",{value:!0});var rt=fi(),fR=fx(jh()),_e=zc(),pR=Xc(),Kh=Vs(),ga=Bh(),it=Xs(),Ys=ua(),Vh=ha(),dx=fx(Gh());function pi(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Jc=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 fR.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new dx.default,r.snapshot=new dx.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===ga.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:ga.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 b=n.codeAt();if(n.validator.isEndOfLine(b))r.isWinNewline(b,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(_e.CharacterCode.QUOTE===b){if(_e.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Vh.Range(new Ys.Position(i,o-a+1),new Ys.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 Vh.Range(new Ys.Position(this.line,this.tokenStart-this.offset+1),new Ys.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 Kh.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Kh.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Kh.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 ga.Literal.True:case ga.Literal.False:return n.createBoolean(i,e);case ga.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 Vh.Range(new Ys.Position(s,e.tokenStart-e.offset+1),new Ys.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 pR.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}};ma.default=Jc;Jc.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]:pi,[_e.CharacterCode.CURLY_BRACKET_LEFT]:pi,[_e.CharacterCode.CURLY_BRACKET_RIGHT]:pi,[_e.CharacterCode.SQUARE_BRACKETS_LEFT]:pi,[_e.CharacterCode.SQUARE_BRACKETS_RIGHT]:pi,[_e.CharacterCode.PARENTHESIS_LEFT]:pi,[_e.CharacterCode.PARENTHESIS_RIGHT]:pi,[_e.CharacterCode.AT_SIGN]:pi}});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 px;(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"})(px=kn.ASTType||(kn.ASTType={}));var ya=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=ya;var Qc=class t extends ya{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
33
+ `,"\r"];var nS;(function(p){function x(D,U,ve,ft){return new sP(D,U,ve,ft)}p.create=x;function E(D){var U=D;return!!(I.defined(U)&&I.string(U.uri)&&(I.undefined(U.languageId)||I.string(U.languageId))&&I.uinteger(U.lineCount)&&I.func(U.getText)&&I.func(U.positionAt)&&I.func(U.offsetAt))}p.is=E;function y(D,U){for(var ve=D.getText(),ft=d(U,function(eo,Il){var rS=eo.range.start.line-Il.range.start.line;return rS===0?eo.range.start.character-Il.range.start.character:rS}),Xe=ve.length,fr=ft.length-1;fr>=0;fr--){var dr=ft[fr],rs=D.offsetAt(dr.range.start),Ae=D.offsetAt(dr.range.end);if(Ae<=Xe)ve=ve.substring(0,rs)+dr.newText+ve.substring(Ae,ve.length);else throw new Error("Overlapping edit");Xe=rs}return ve}p.applyEdits=y;function d(D,U){if(D.length<=1)return D;var ve=D.length/2|0,ft=D.slice(0,ve),Xe=D.slice(ve);d(ft,U),d(Xe,U);for(var fr=0,dr=0,rs=0;fr<ft.length&&dr<Xe.length;){var Ae=U(ft[fr],Xe[dr]);Ae<=0?D[rs++]=ft[fr++]:D[rs++]=Xe[dr++]}for(;fr<ft.length;)D[rs++]=ft[fr++];for(;dr<Xe.length;)D[rs++]=Xe[dr++];return D}})(nS||(e.TextDocument=nS={}));var sP=function(){function p(x,E,y,d){this._uri=x,this._languageId=E,this._version=y,this._content=d,this._lineOffsets=void 0}return Object.defineProperty(p.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),p.prototype.getText=function(x){if(x){var E=this.offsetAt(x.start),y=this.offsetAt(x.end);return this._content.substring(E,y)}return this._content},p.prototype.update=function(x,E){this._content=x.text,this._version=E,this._lineOffsets=void 0},p.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var x=[],E=this._content,y=!0,d=0;d<E.length;d++){y&&(x.push(d),y=!1);var D=E.charAt(d);y=D==="\r"||D===`
34
+ `,D==="\r"&&d+1<E.length&&E.charAt(d+1)===`
35
+ `&&d++}y&&E.length>0&&x.push(E.length),this._lineOffsets=x}return this._lineOffsets},p.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var E=this.getLineOffsets(),y=0,d=E.length;if(d===0)return o.create(0,x);for(;y<d;){var D=Math.floor((y+d)/2);E[D]>x?d=D:y=D+1}var U=y-1;return o.create(U,x-E[U])},p.prototype.offsetAt=function(x){var E=this.getLineOffsets();if(x.line>=E.length)return this._content.length;if(x.line<0)return 0;var y=E[x.line],d=x.line+1<E.length?E[x.line+1]:this._content.length;return Math.max(Math.min(y+x.character,d),y)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),I;(function(p){var x=Object.prototype.toString;function E(Ae){return typeof Ae<"u"}p.defined=E;function y(Ae){return typeof Ae>"u"}p.undefined=y;function d(Ae){return Ae===!0||Ae===!1}p.boolean=d;function D(Ae){return x.call(Ae)==="[object String]"}p.string=D;function U(Ae){return x.call(Ae)==="[object Number]"}p.number=U;function ve(Ae,eo,Il){return x.call(Ae)==="[object Number]"&&eo<=Ae&&Ae<=Il}p.numberRange=ve;function ft(Ae){return x.call(Ae)==="[object Number]"&&-2147483648<=Ae&&Ae<=2147483647}p.integer=ft;function Xe(Ae){return x.call(Ae)==="[object Number]"&&0<=Ae&&Ae<=2147483647}p.uinteger=Xe;function fr(Ae){return x.call(Ae)==="[object Function]"}p.func=fr;function dr(Ae){return Ae!==null&&typeof Ae=="object"}p.objectLiteral=dr;function rs(Ae,eo){return Array.isArray(Ae)&&Ae.every(eo)}p.typedArray=rs})(I||(I={}))})});var it=m(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.ProtocolNotificationType=Sn.ProtocolNotificationType0=Sn.ProtocolRequestType=Sn.ProtocolRequestType0=Sn.RegistrationType=Sn.MessageDirection=void 0;var lo=di(),jS;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(jS||(Sn.MessageDirection=jS={}));var Og=class{constructor(e){this.method=e}};Sn.RegistrationType=Og;var Cg=class extends lo.RequestType0{constructor(e){super(e)}};Sn.ProtocolRequestType0=Cg;var Rg=class extends lo.RequestType{constructor(e){super(e,lo.ParameterStructures.byName)}};Sn.ProtocolRequestType=Rg;var Pg=class extends lo.NotificationType0{constructor(e){super(e)}};Sn.ProtocolNotificationType0=Pg;var Dg=class extends lo.NotificationType{constructor(e){super(e,lo.ParameterStructures.byName)}};Sn.ProtocolNotificationType=Dg});var sc=m(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.objectLiteral=At.typedArray=At.stringArray=At.array=At.func=At.error=At.number=At.string=At.boolean=void 0;function QP(t){return t===!0||t===!1}At.boolean=QP;function FS(t){return typeof t=="string"||t instanceof String}At.string=FS;function ZP(t){return typeof t=="number"||t instanceof Number}At.number=ZP;function eD(t){return t instanceof Error}At.error=eD;function tD(t){return typeof t=="function"}At.func=tD;function $S(t){return Array.isArray(t)}At.array=$S;function nD(t){return $S(t)&&t.every(e=>FS(e))}At.stringArray=nD;function rD(t,e){return Array.isArray(t)&&t.every(e)}At.typedArray=rD;function sD(t){return t!==null&&typeof t=="object"}At.objectLiteral=sD});var WS=m(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.ImplementationRequest=void 0;var BS=it(),US;(function(t){t.method="textDocument/implementation",t.messageDirection=BS.MessageDirection.clientToServer,t.type=new BS.ProtocolRequestType(t.method)})(US||(ic.ImplementationRequest=US={}))});var zS=m(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.TypeDefinitionRequest=void 0;var HS=it(),GS;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=HS.MessageDirection.clientToServer,t.type=new HS.ProtocolRequestType(t.method)})(GS||(oc.TypeDefinitionRequest=GS={}))});var XS=m(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.DidChangeWorkspaceFoldersNotification=co.WorkspaceFoldersRequest=void 0;var ac=it(),KS;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ac.MessageDirection.serverToClient,t.type=new ac.ProtocolRequestType0(t.method)})(KS||(co.WorkspaceFoldersRequest=KS={}));var VS;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ac.MessageDirection.clientToServer,t.type=new ac.ProtocolNotificationType(t.method)})(VS||(co.DidChangeWorkspaceFoldersNotification=VS={}))});var QS=m(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.ConfigurationRequest=void 0;var YS=it(),JS;(function(t){t.method="workspace/configuration",t.messageDirection=YS.MessageDirection.serverToClient,t.type=new YS.ProtocolRequestType(t.method)})(JS||(uc.ConfigurationRequest=JS={}))});var tk=m(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.ColorPresentationRequest=ho.DocumentColorRequest=void 0;var lc=it(),ZS;(function(t){t.method="textDocument/documentColor",t.messageDirection=lc.MessageDirection.clientToServer,t.type=new lc.ProtocolRequestType(t.method)})(ZS||(ho.DocumentColorRequest=ZS={}));var ek;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=lc.MessageDirection.clientToServer,t.type=new lc.ProtocolRequestType(t.method)})(ek||(ho.ColorPresentationRequest=ek={}))});var sk=m(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.FoldingRangeRefreshRequest=fo.FoldingRangeRequest=void 0;var cc=it(),nk;(function(t){t.method="textDocument/foldingRange",t.messageDirection=cc.MessageDirection.clientToServer,t.type=new cc.ProtocolRequestType(t.method)})(nk||(fo.FoldingRangeRequest=nk={}));var rk;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=cc.MessageDirection.serverToClient,t.type=new cc.ProtocolRequestType0(t.method)})(rk||(fo.FoldingRangeRefreshRequest=rk={}))});var ak=m(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.DeclarationRequest=void 0;var ik=it(),ok;(function(t){t.method="textDocument/declaration",t.messageDirection=ik.MessageDirection.clientToServer,t.type=new ik.ProtocolRequestType(t.method)})(ok||(hc.DeclarationRequest=ok={}))});var ck=m(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.SelectionRangeRequest=void 0;var uk=it(),lk;(function(t){t.method="textDocument/selectionRange",t.messageDirection=uk.MessageDirection.clientToServer,t.type=new uk.ProtocolRequestType(t.method)})(lk||(fc.SelectionRangeRequest=lk={}))});var pk=m(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.WorkDoneProgressCancelNotification=As.WorkDoneProgressCreateRequest=As.WorkDoneProgress=void 0;var iD=di(),dc=it(),hk;(function(t){t.type=new iD.ProgressType;function e(n){return n===t.type}t.is=e})(hk||(As.WorkDoneProgress=hk={}));var fk;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=dc.MessageDirection.serverToClient,t.type=new dc.ProtocolRequestType(t.method)})(fk||(As.WorkDoneProgressCreateRequest=fk={}));var dk;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=dc.MessageDirection.clientToServer,t.type=new dc.ProtocolNotificationType(t.method)})(dk||(As.WorkDoneProgressCancelNotification=dk={}))});var bk=m(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.CallHierarchyOutgoingCallsRequest=Os.CallHierarchyIncomingCallsRequest=Os.CallHierarchyPrepareRequest=void 0;var po=it(),gk;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(gk||(Os.CallHierarchyPrepareRequest=gk={}));var mk;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(mk||(Os.CallHierarchyIncomingCallsRequest=mk={}));var yk;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(yk||(Os.CallHierarchyOutgoingCallsRequest=yk={}))});var wk=m(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.SemanticTokensRefreshRequest=kn.SemanticTokensRangeRequest=kn.SemanticTokensDeltaRequest=kn.SemanticTokensRequest=kn.SemanticTokensRegistrationType=kn.TokenFormat=void 0;var is=it(),vk;(function(t){t.Relative="relative"})(vk||(kn.TokenFormat=vk={}));var Ma;(function(t){t.method="textDocument/semanticTokens",t.type=new is.RegistrationType(t.method)})(Ma||(kn.SemanticTokensRegistrationType=Ma={}));var _k;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=is.MessageDirection.clientToServer,t.type=new is.ProtocolRequestType(t.method),t.registrationMethod=Ma.method})(_k||(kn.SemanticTokensRequest=_k={}));var Tk;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=is.MessageDirection.clientToServer,t.type=new is.ProtocolRequestType(t.method),t.registrationMethod=Ma.method})(Tk||(kn.SemanticTokensDeltaRequest=Tk={}));var Sk;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=is.MessageDirection.clientToServer,t.type=new is.ProtocolRequestType(t.method),t.registrationMethod=Ma.method})(Sk||(kn.SemanticTokensRangeRequest=Sk={}));var kk;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=is.MessageDirection.serverToClient,t.type=new is.ProtocolRequestType0(t.method)})(kk||(kn.SemanticTokensRefreshRequest=kk={}))});var Ak=m(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.ShowDocumentRequest=void 0;var xk=it(),Ek;(function(t){t.method="window/showDocument",t.messageDirection=xk.MessageDirection.serverToClient,t.type=new xk.ProtocolRequestType(t.method)})(Ek||(pc.ShowDocumentRequest=Ek={}))});var Rk=m(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.LinkedEditingRangeRequest=void 0;var Ok=it(),Ck;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Ok.MessageDirection.clientToServer,t.type=new Ok.ProtocolRequestType(t.method)})(Ck||(gc.LinkedEditingRangeRequest=Ck={}))});var jk=m(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.WillDeleteFilesRequest=tn.DidDeleteFilesNotification=tn.DidRenameFilesNotification=tn.WillRenameFilesRequest=tn.DidCreateFilesNotification=tn.WillCreateFilesRequest=tn.FileOperationPatternKind=void 0;var Un=it(),Pk;(function(t){t.file="file",t.folder="folder"})(Pk||(tn.FileOperationPatternKind=Pk={}));var Dk;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolRequestType(t.method)})(Dk||(tn.WillCreateFilesRequest=Dk={}));var Ik;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolNotificationType(t.method)})(Ik||(tn.DidCreateFilesNotification=Ik={}));var Mk;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolRequestType(t.method)})(Mk||(tn.WillRenameFilesRequest=Mk={}));var Lk;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolNotificationType(t.method)})(Lk||(tn.DidRenameFilesNotification=Lk={}));var Nk;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolNotificationType(t.method)})(Nk||(tn.DidDeleteFilesNotification=Nk={}));var qk;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolRequestType(t.method)})(qk||(tn.WillDeleteFilesRequest=qk={}))});var Wk=m(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.MonikerRequest=Cs.MonikerKind=Cs.UniquenessLevel=void 0;var Fk=it(),$k;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})($k||(Cs.UniquenessLevel=$k={}));var Bk;(function(t){t.$import="import",t.$export="export",t.local="local"})(Bk||(Cs.MonikerKind=Bk={}));var Uk;(function(t){t.method="textDocument/moniker",t.messageDirection=Fk.MessageDirection.clientToServer,t.type=new Fk.ProtocolRequestType(t.method)})(Uk||(Cs.MonikerRequest=Uk={}))});var Kk=m(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.TypeHierarchySubtypesRequest=Rs.TypeHierarchySupertypesRequest=Rs.TypeHierarchyPrepareRequest=void 0;var go=it(),Hk;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(Hk||(Rs.TypeHierarchyPrepareRequest=Hk={}));var Gk;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(Gk||(Rs.TypeHierarchySupertypesRequest=Gk={}));var zk;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(zk||(Rs.TypeHierarchySubtypesRequest=zk={}))});var Yk=m(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.InlineValueRefreshRequest=mo.InlineValueRequest=void 0;var mc=it(),Vk;(function(t){t.method="textDocument/inlineValue",t.messageDirection=mc.MessageDirection.clientToServer,t.type=new mc.ProtocolRequestType(t.method)})(Vk||(mo.InlineValueRequest=Vk={}));var Xk;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=mc.MessageDirection.serverToClient,t.type=new mc.ProtocolRequestType0(t.method)})(Xk||(mo.InlineValueRefreshRequest=Xk={}))});var ew=m(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.InlayHintRefreshRequest=Ps.InlayHintResolveRequest=Ps.InlayHintRequest=void 0;var yo=it(),Jk;(function(t){t.method="textDocument/inlayHint",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(Jk||(Ps.InlayHintRequest=Jk={}));var Qk;(function(t){t.method="inlayHint/resolve",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(Qk||(Ps.InlayHintResolveRequest=Qk={}));var Zk;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=yo.MessageDirection.serverToClient,t.type=new yo.ProtocolRequestType0(t.method)})(Zk||(Ps.InlayHintRefreshRequest=Zk={}))});var aw=m(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.DiagnosticRefreshRequest=Wn.WorkspaceDiagnosticRequest=Wn.DocumentDiagnosticRequest=Wn.DocumentDiagnosticReportKind=Wn.DiagnosticServerCancellationData=void 0;var ow=di(),oD=sc(),bo=it(),tw;(function(t){function e(n){let r=n;return r&&oD.boolean(r.retriggerRequest)}t.is=e})(tw||(Wn.DiagnosticServerCancellationData=tw={}));var nw;(function(t){t.Full="full",t.Unchanged="unchanged"})(nw||(Wn.DocumentDiagnosticReportKind=nw={}));var rw;(function(t){t.method="textDocument/diagnostic",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.partialResult=new ow.ProgressType})(rw||(Wn.DocumentDiagnosticRequest=rw={}));var sw;(function(t){t.method="workspace/diagnostic",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.partialResult=new ow.ProgressType})(sw||(Wn.WorkspaceDiagnosticRequest=sw={}));var iw;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=bo.MessageDirection.serverToClient,t.type=new bo.ProtocolRequestType0(t.method)})(iw||(Wn.DiagnosticRefreshRequest=iw={}))});var pw=m(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.DidCloseNotebookDocumentNotification=dt.DidSaveNotebookDocumentNotification=dt.DidChangeNotebookDocumentNotification=dt.NotebookCellArrayChange=dt.DidOpenNotebookDocumentNotification=dt.NotebookDocumentSyncRegistrationType=dt.NotebookDocument=dt.NotebookCell=dt.ExecutionSummary=dt.NotebookCellKind=void 0;var La=rc(),gr=sc(),Rr=it(),Ig;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Ig||(dt.NotebookCellKind=Ig={}));var Mg;(function(t){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}t.create=e;function n(s){let i=s;return gr.objectLiteral(i)&&La.uinteger.is(i.executionOrder)&&(i.success===void 0||gr.boolean(i.success))}t.is=n;function r(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}t.equals=r})(Mg||(dt.ExecutionSummary=Mg={}));var yc;(function(t){function e(i,o){return{kind:i,document:o}}t.create=e;function n(i){let o=i;return gr.objectLiteral(o)&&Ig.is(o.kind)&&La.DocumentUri.is(o.document)&&(o.metadata===void 0||gr.objectLiteral(o.metadata))}t.is=n;function r(i,o){let a=new Set;return i.document!==o.document&&a.add("document"),i.kind!==o.kind&&a.add("kind"),i.executionSummary!==o.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||o.metadata!==void 0)&&!s(i.metadata,o.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||o.executionSummary!==void 0)&&!Mg.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function s(i,o){if(i===o)return!0;if(i==null||o===null||o===void 0||typeof i!=typeof o||typeof i!="object")return!1;let a=Array.isArray(i),u=Array.isArray(o);if(a!==u)return!1;if(a&&u){if(i.length!==o.length)return!1;for(let l=0;l<i.length;l++)if(!s(i[l],o[l]))return!1}if(gr.objectLiteral(i)&&gr.objectLiteral(o)){let l=Object.keys(i),c=Object.keys(o);if(l.length!==c.length||(l.sort(),c.sort(),!s(l,c)))return!1;for(let h=0;h<l.length;h++){let f=l[h];if(!s(i[f],o[f]))return!1}}return!0}})(yc||(dt.NotebookCell=yc={}));var uw;(function(t){function e(r,s,i,o){return{uri:r,notebookType:s,version:i,cells:o}}t.create=e;function n(r){let s=r;return gr.objectLiteral(s)&&gr.string(s.uri)&&La.integer.is(s.version)&&gr.typedArray(s.cells,yc.is)}t.is=n})(uw||(dt.NotebookDocument=uw={}));var vo;(function(t){t.method="notebookDocument/sync",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.RegistrationType(t.method)})(vo||(dt.NotebookDocumentSyncRegistrationType=vo={}));var lw;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=vo.method})(lw||(dt.DidOpenNotebookDocumentNotification=lw={}));var cw;(function(t){function e(r){let s=r;return gr.objectLiteral(s)&&La.uinteger.is(s.start)&&La.uinteger.is(s.deleteCount)&&(s.cells===void 0||gr.typedArray(s.cells,yc.is))}t.is=e;function n(r,s,i){let o={start:r,deleteCount:s};return i!==void 0&&(o.cells=i),o}t.create=n})(cw||(dt.NotebookCellArrayChange=cw={}));var hw;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=vo.method})(hw||(dt.DidChangeNotebookDocumentNotification=hw={}));var fw;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=vo.method})(fw||(dt.DidSaveNotebookDocumentNotification=fw={}));var dw;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=vo.method})(dw||(dt.DidCloseNotebookDocumentNotification=dw={}))});var yw=m(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.InlineCompletionRequest=void 0;var gw=it(),mw;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=gw.MessageDirection.clientToServer,t.type=new gw.ProtocolRequestType(t.method)})(mw||(bc.InlineCompletionRequest=mw={}))});var R0=m(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.WorkspaceSymbolRequest=T.CodeActionResolveRequest=T.CodeActionRequest=T.DocumentSymbolRequest=T.DocumentHighlightRequest=T.ReferencesRequest=T.DefinitionRequest=T.SignatureHelpRequest=T.SignatureHelpTriggerKind=T.HoverRequest=T.CompletionResolveRequest=T.CompletionRequest=T.CompletionTriggerKind=T.PublishDiagnosticsNotification=T.WatchKind=T.RelativePattern=T.FileChangeType=T.DidChangeWatchedFilesNotification=T.WillSaveTextDocumentWaitUntilRequest=T.WillSaveTextDocumentNotification=T.TextDocumentSaveReason=T.DidSaveTextDocumentNotification=T.DidCloseTextDocumentNotification=T.DidChangeTextDocumentNotification=T.TextDocumentContentChangeEvent=T.DidOpenTextDocumentNotification=T.TextDocumentSyncKind=T.TelemetryEventNotification=T.LogMessageNotification=T.ShowMessageRequest=T.ShowMessageNotification=T.MessageType=T.DidChangeConfigurationNotification=T.ExitNotification=T.ShutdownRequest=T.InitializedNotification=T.InitializeErrorCodes=T.InitializeRequest=T.WorkDoneProgressOptions=T.TextDocumentRegistrationOptions=T.StaticRegistrationOptions=T.PositionEncodingKind=T.FailureHandlingKind=T.ResourceOperationKind=T.UnregistrationRequest=T.RegistrationRequest=T.DocumentSelector=T.NotebookCellTextDocumentFilter=T.NotebookDocumentFilter=T.TextDocumentFilter=void 0;T.MonikerRequest=T.MonikerKind=T.UniquenessLevel=T.WillDeleteFilesRequest=T.DidDeleteFilesNotification=T.WillRenameFilesRequest=T.DidRenameFilesNotification=T.WillCreateFilesRequest=T.DidCreateFilesNotification=T.FileOperationPatternKind=T.LinkedEditingRangeRequest=T.ShowDocumentRequest=T.SemanticTokensRegistrationType=T.SemanticTokensRefreshRequest=T.SemanticTokensRangeRequest=T.SemanticTokensDeltaRequest=T.SemanticTokensRequest=T.TokenFormat=T.CallHierarchyPrepareRequest=T.CallHierarchyOutgoingCallsRequest=T.CallHierarchyIncomingCallsRequest=T.WorkDoneProgressCancelNotification=T.WorkDoneProgressCreateRequest=T.WorkDoneProgress=T.SelectionRangeRequest=T.DeclarationRequest=T.FoldingRangeRefreshRequest=T.FoldingRangeRequest=T.ColorPresentationRequest=T.DocumentColorRequest=T.ConfigurationRequest=T.DidChangeWorkspaceFoldersNotification=T.WorkspaceFoldersRequest=T.TypeDefinitionRequest=T.ImplementationRequest=T.ApplyWorkspaceEditRequest=T.ExecuteCommandRequest=T.PrepareRenameRequest=T.RenameRequest=T.PrepareSupportDefaultBehavior=T.DocumentOnTypeFormattingRequest=T.DocumentRangesFormattingRequest=T.DocumentRangeFormattingRequest=T.DocumentFormattingRequest=T.DocumentLinkResolveRequest=T.DocumentLinkRequest=T.CodeLensRefreshRequest=T.CodeLensResolveRequest=T.CodeLensRequest=T.WorkspaceSymbolResolveRequest=void 0;T.InlineCompletionRequest=T.DidCloseNotebookDocumentNotification=T.DidSaveNotebookDocumentNotification=T.DidChangeNotebookDocumentNotification=T.NotebookCellArrayChange=T.DidOpenNotebookDocumentNotification=T.NotebookDocumentSyncRegistrationType=T.NotebookDocument=T.NotebookCell=T.ExecutionSummary=T.NotebookCellKind=T.DiagnosticRefreshRequest=T.WorkspaceDiagnosticRequest=T.DocumentDiagnosticRequest=T.DocumentDiagnosticReportKind=T.DiagnosticServerCancellationData=T.InlayHintRefreshRequest=T.InlayHintResolveRequest=T.InlayHintRequest=T.InlineValueRefreshRequest=T.InlineValueRequest=T.TypeHierarchySupertypesRequest=T.TypeHierarchySubtypesRequest=T.TypeHierarchyPrepareRequest=void 0;var K=it(),bw=rc(),jt=sc(),aD=WS();Object.defineProperty(T,"ImplementationRequest",{enumerable:!0,get:function(){return aD.ImplementationRequest}});var uD=zS();Object.defineProperty(T,"TypeDefinitionRequest",{enumerable:!0,get:function(){return uD.TypeDefinitionRequest}});var E0=XS();Object.defineProperty(T,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return E0.WorkspaceFoldersRequest}});Object.defineProperty(T,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return E0.DidChangeWorkspaceFoldersNotification}});var lD=QS();Object.defineProperty(T,"ConfigurationRequest",{enumerable:!0,get:function(){return lD.ConfigurationRequest}});var A0=tk();Object.defineProperty(T,"DocumentColorRequest",{enumerable:!0,get:function(){return A0.DocumentColorRequest}});Object.defineProperty(T,"ColorPresentationRequest",{enumerable:!0,get:function(){return A0.ColorPresentationRequest}});var O0=sk();Object.defineProperty(T,"FoldingRangeRequest",{enumerable:!0,get:function(){return O0.FoldingRangeRequest}});Object.defineProperty(T,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return O0.FoldingRangeRefreshRequest}});var cD=ak();Object.defineProperty(T,"DeclarationRequest",{enumerable:!0,get:function(){return cD.DeclarationRequest}});var hD=ck();Object.defineProperty(T,"SelectionRangeRequest",{enumerable:!0,get:function(){return hD.SelectionRangeRequest}});var Fg=pk();Object.defineProperty(T,"WorkDoneProgress",{enumerable:!0,get:function(){return Fg.WorkDoneProgress}});Object.defineProperty(T,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Fg.WorkDoneProgressCreateRequest}});Object.defineProperty(T,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Fg.WorkDoneProgressCancelNotification}});var $g=bk();Object.defineProperty(T,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return $g.CallHierarchyIncomingCallsRequest}});Object.defineProperty(T,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return $g.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(T,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return $g.CallHierarchyPrepareRequest}});var _o=wk();Object.defineProperty(T,"TokenFormat",{enumerable:!0,get:function(){return _o.TokenFormat}});Object.defineProperty(T,"SemanticTokensRequest",{enumerable:!0,get:function(){return _o.SemanticTokensRequest}});Object.defineProperty(T,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return _o.SemanticTokensDeltaRequest}});Object.defineProperty(T,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return _o.SemanticTokensRangeRequest}});Object.defineProperty(T,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return _o.SemanticTokensRefreshRequest}});Object.defineProperty(T,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return _o.SemanticTokensRegistrationType}});var fD=Ak();Object.defineProperty(T,"ShowDocumentRequest",{enumerable:!0,get:function(){return fD.ShowDocumentRequest}});var dD=Rk();Object.defineProperty(T,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return dD.LinkedEditingRangeRequest}});var pi=jk();Object.defineProperty(T,"FileOperationPatternKind",{enumerable:!0,get:function(){return pi.FileOperationPatternKind}});Object.defineProperty(T,"DidCreateFilesNotification",{enumerable:!0,get:function(){return pi.DidCreateFilesNotification}});Object.defineProperty(T,"WillCreateFilesRequest",{enumerable:!0,get:function(){return pi.WillCreateFilesRequest}});Object.defineProperty(T,"DidRenameFilesNotification",{enumerable:!0,get:function(){return pi.DidRenameFilesNotification}});Object.defineProperty(T,"WillRenameFilesRequest",{enumerable:!0,get:function(){return pi.WillRenameFilesRequest}});Object.defineProperty(T,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return pi.DidDeleteFilesNotification}});Object.defineProperty(T,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return pi.WillDeleteFilesRequest}});var Bg=Wk();Object.defineProperty(T,"UniquenessLevel",{enumerable:!0,get:function(){return Bg.UniquenessLevel}});Object.defineProperty(T,"MonikerKind",{enumerable:!0,get:function(){return Bg.MonikerKind}});Object.defineProperty(T,"MonikerRequest",{enumerable:!0,get:function(){return Bg.MonikerRequest}});var Ug=Kk();Object.defineProperty(T,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ug.TypeHierarchyPrepareRequest}});Object.defineProperty(T,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Ug.TypeHierarchySubtypesRequest}});Object.defineProperty(T,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Ug.TypeHierarchySupertypesRequest}});var C0=Yk();Object.defineProperty(T,"InlineValueRequest",{enumerable:!0,get:function(){return C0.InlineValueRequest}});Object.defineProperty(T,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return C0.InlineValueRefreshRequest}});var Wg=ew();Object.defineProperty(T,"InlayHintRequest",{enumerable:!0,get:function(){return Wg.InlayHintRequest}});Object.defineProperty(T,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Wg.InlayHintResolveRequest}});Object.defineProperty(T,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Wg.InlayHintRefreshRequest}});var Na=aw();Object.defineProperty(T,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Na.DiagnosticServerCancellationData}});Object.defineProperty(T,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Na.DocumentDiagnosticReportKind}});Object.defineProperty(T,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Na.DocumentDiagnosticRequest}});Object.defineProperty(T,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Na.WorkspaceDiagnosticRequest}});Object.defineProperty(T,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Na.DiagnosticRefreshRequest}});var Pr=pw();Object.defineProperty(T,"NotebookCellKind",{enumerable:!0,get:function(){return Pr.NotebookCellKind}});Object.defineProperty(T,"ExecutionSummary",{enumerable:!0,get:function(){return Pr.ExecutionSummary}});Object.defineProperty(T,"NotebookCell",{enumerable:!0,get:function(){return Pr.NotebookCell}});Object.defineProperty(T,"NotebookDocument",{enumerable:!0,get:function(){return Pr.NotebookDocument}});Object.defineProperty(T,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Pr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(T,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Pr.DidOpenNotebookDocumentNotification}});Object.defineProperty(T,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Pr.NotebookCellArrayChange}});Object.defineProperty(T,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Pr.DidChangeNotebookDocumentNotification}});Object.defineProperty(T,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Pr.DidSaveNotebookDocumentNotification}});Object.defineProperty(T,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Pr.DidCloseNotebookDocumentNotification}});var pD=yw();Object.defineProperty(T,"InlineCompletionRequest",{enumerable:!0,get:function(){return pD.InlineCompletionRequest}});var Lg;(function(t){function e(n){let r=n;return jt.string(r)||jt.string(r.language)||jt.string(r.scheme)||jt.string(r.pattern)}t.is=e})(Lg||(T.TextDocumentFilter=Lg={}));var Ng;(function(t){function e(n){let r=n;return jt.objectLiteral(r)&&(jt.string(r.notebookType)||jt.string(r.scheme)||jt.string(r.pattern))}t.is=e})(Ng||(T.NotebookDocumentFilter=Ng={}));var qg;(function(t){function e(n){let r=n;return jt.objectLiteral(r)&&(jt.string(r.notebook)||Ng.is(r.notebook))&&(r.language===void 0||jt.string(r.language))}t.is=e})(qg||(T.NotebookCellTextDocumentFilter=qg={}));var jg;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!jt.string(r)&&!Lg.is(r)&&!qg.is(r))return!1;return!0}t.is=e})(jg||(T.DocumentSelector=jg={}));var vw;(function(t){t.method="client/registerCapability",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType(t.method)})(vw||(T.RegistrationRequest=vw={}));var _w;(function(t){t.method="client/unregisterCapability",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType(t.method)})(_w||(T.UnregistrationRequest=_w={}));var Tw;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(Tw||(T.ResourceOperationKind=Tw={}));var Sw;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(Sw||(T.FailureHandlingKind=Sw={}));var kw;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(kw||(T.PositionEncodingKind=kw={}));var ww;(function(t){function e(n){let r=n;return r&&jt.string(r.id)&&r.id.length>0}t.hasId=e})(ww||(T.StaticRegistrationOptions=ww={}));var xw;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||jg.is(r.documentSelector))}t.is=e})(xw||(T.TextDocumentRegistrationOptions=xw={}));var Ew;(function(t){function e(r){let s=r;return jt.objectLiteral(s)&&(s.workDoneProgress===void 0||jt.boolean(s.workDoneProgress))}t.is=e;function n(r){let s=r;return s&&jt.boolean(s.workDoneProgress)}t.hasWorkDoneProgress=n})(Ew||(T.WorkDoneProgressOptions=Ew={}));var Aw;(function(t){t.method="initialize",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(Aw||(T.InitializeRequest=Aw={}));var Ow;(function(t){t.unknownProtocolVersion=1})(Ow||(T.InitializeErrorCodes=Ow={}));var Cw;(function(t){t.method="initialized",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Cw||(T.InitializedNotification=Cw={}));var Rw;(function(t){t.method="shutdown",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType0(t.method)})(Rw||(T.ShutdownRequest=Rw={}));var Pw;(function(t){t.method="exit",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType0(t.method)})(Pw||(T.ExitNotification=Pw={}));var Dw;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Dw||(T.DidChangeConfigurationNotification=Dw={}));var Iw;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(Iw||(T.MessageType=Iw={}));var Mw;(function(t){t.method="window/showMessage",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolNotificationType(t.method)})(Mw||(T.ShowMessageNotification=Mw={}));var Lw;(function(t){t.method="window/showMessageRequest",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType(t.method)})(Lw||(T.ShowMessageRequest=Lw={}));var Nw;(function(t){t.method="window/logMessage",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolNotificationType(t.method)})(Nw||(T.LogMessageNotification=Nw={}));var qw;(function(t){t.method="telemetry/event",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolNotificationType(t.method)})(qw||(T.TelemetryEventNotification=qw={}));var jw;(function(t){t.None=0,t.Full=1,t.Incremental=2})(jw||(T.TextDocumentSyncKind=jw={}));var Fw;(function(t){t.method="textDocument/didOpen",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Fw||(T.DidOpenTextDocumentNotification=Fw={}));var $w;(function(t){function e(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range!==void 0&&(s.rangeLength===void 0||typeof s.rangeLength=="number")}t.isIncremental=e;function n(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}t.isFull=n})($w||(T.TextDocumentContentChangeEvent=$w={}));var Bw;(function(t){t.method="textDocument/didChange",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Bw||(T.DidChangeTextDocumentNotification=Bw={}));var Uw;(function(t){t.method="textDocument/didClose",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Uw||(T.DidCloseTextDocumentNotification=Uw={}));var Ww;(function(t){t.method="textDocument/didSave",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Ww||(T.DidSaveTextDocumentNotification=Ww={}));var Hw;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Hw||(T.TextDocumentSaveReason=Hw={}));var Gw;(function(t){t.method="textDocument/willSave",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Gw||(T.WillSaveTextDocumentNotification=Gw={}));var zw;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(zw||(T.WillSaveTextDocumentWaitUntilRequest=zw={}));var Kw;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Kw||(T.DidChangeWatchedFilesNotification=Kw={}));var Vw;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Vw||(T.FileChangeType=Vw={}));var Xw;(function(t){function e(n){let r=n;return jt.objectLiteral(r)&&(bw.URI.is(r.baseUri)||bw.WorkspaceFolder.is(r.baseUri))&&jt.string(r.pattern)}t.is=e})(Xw||(T.RelativePattern=Xw={}));var Yw;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Yw||(T.WatchKind=Yw={}));var Jw;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolNotificationType(t.method)})(Jw||(T.PublishDiagnosticsNotification=Jw={}));var Qw;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Qw||(T.CompletionTriggerKind=Qw={}));var Zw;(function(t){t.method="textDocument/completion",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(Zw||(T.CompletionRequest=Zw={}));var e0;(function(t){t.method="completionItem/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(e0||(T.CompletionResolveRequest=e0={}));var t0;(function(t){t.method="textDocument/hover",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(t0||(T.HoverRequest=t0={}));var n0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(n0||(T.SignatureHelpTriggerKind=n0={}));var r0;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(r0||(T.SignatureHelpRequest=r0={}));var s0;(function(t){t.method="textDocument/definition",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(s0||(T.DefinitionRequest=s0={}));var i0;(function(t){t.method="textDocument/references",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(i0||(T.ReferencesRequest=i0={}));var o0;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(o0||(T.DocumentHighlightRequest=o0={}));var a0;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(a0||(T.DocumentSymbolRequest=a0={}));var u0;(function(t){t.method="textDocument/codeAction",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(u0||(T.CodeActionRequest=u0={}));var l0;(function(t){t.method="codeAction/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(l0||(T.CodeActionResolveRequest=l0={}));var c0;(function(t){t.method="workspace/symbol",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(c0||(T.WorkspaceSymbolRequest=c0={}));var h0;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(h0||(T.WorkspaceSymbolResolveRequest=h0={}));var f0;(function(t){t.method="textDocument/codeLens",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(f0||(T.CodeLensRequest=f0={}));var d0;(function(t){t.method="codeLens/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(d0||(T.CodeLensResolveRequest=d0={}));var p0;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType0(t.method)})(p0||(T.CodeLensRefreshRequest=p0={}));var g0;(function(t){t.method="textDocument/documentLink",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(g0||(T.DocumentLinkRequest=g0={}));var m0;(function(t){t.method="documentLink/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(m0||(T.DocumentLinkResolveRequest=m0={}));var y0;(function(t){t.method="textDocument/formatting",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(y0||(T.DocumentFormattingRequest=y0={}));var b0;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(b0||(T.DocumentRangeFormattingRequest=b0={}));var v0;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(v0||(T.DocumentRangesFormattingRequest=v0={}));var _0;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(_0||(T.DocumentOnTypeFormattingRequest=_0={}));var T0;(function(t){t.Identifier=1})(T0||(T.PrepareSupportDefaultBehavior=T0={}));var S0;(function(t){t.method="textDocument/rename",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(S0||(T.RenameRequest=S0={}));var k0;(function(t){t.method="textDocument/prepareRename",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(k0||(T.PrepareRenameRequest=k0={}));var w0;(function(t){t.method="workspace/executeCommand",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(w0||(T.ExecuteCommandRequest=w0={}));var x0;(function(t){t.method="workspace/applyEdit",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType("workspace/applyEdit")})(x0||(T.ApplyWorkspaceEditRequest=x0={}))});var D0=m(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.createProtocolConnection=void 0;var P0=di();function gD(t,e,n,r){return P0.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,P0.createMessageConnection)(t,e,n,r)}vc.createProtocolConnection=gD});var M0=m(wn=>{"use strict";var mD=wn&&wn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),_c=wn&&wn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&mD(e,t,n)};Object.defineProperty(wn,"__esModule",{value:!0});wn.LSPErrorCodes=wn.createProtocolConnection=void 0;_c(di(),wn);_c(rc(),wn);_c(it(),wn);_c(R0(),wn);var yD=D0();Object.defineProperty(wn,"createProtocolConnection",{enumerable:!0,get:function(){return yD.createProtocolConnection}});var I0;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(I0||(wn.LSPErrorCodes=I0={}))});var _t=m(Dr=>{"use strict";var bD=Dr&&Dr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),L0=Dr&&Dr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&bD(e,t,n)};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.createProtocolConnection=void 0;var vD=Ag();L0(Ag(),Dr);L0(M0(),Dr);function _D(t,e,n,r){return(0,vD.createMessageConnection)(t,e,n,r)}Dr.createProtocolConnection=_D});var Hg=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.generateUuid=Hn.parse=Hn.isUUID=Hn.v4=Hn.empty=void 0;var qa=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ja=class t extends qa{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(""))}};ja._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ja._timeHighBits=["8","9","a","b"];Hn.empty=new qa("00000000-0000-0000-0000-000000000000");function N0(){return new ja}Hn.v4=N0;var TD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function q0(t){return TD.test(t)}Hn.isUUID=q0;function SD(t){if(!q0(t))throw new Error("invalid uuid");return new qa(t)}Hn.parse=SD;function kD(){return N0().asHex()}Hn.generateUuid=kD});var j0=m(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.attachPartialResult=Is.ProgressFeature=Is.attachWorkDone=void 0;var Ds=_t(),wD=Hg(),gi=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,s){let i={kind:"begin",title:e,percentage:n,message:r,cancellable:s};this._connection.sendProgress(Ds.WorkDoneProgress.type,this._token,i)}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(Ds.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Ds.WorkDoneProgress.type,this._token,{kind:"end"})}};gi.Instances=new Map;var Tc=class extends gi{constructor(e,n){super(e,n),this._source=new Ds.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Fa=class{constructor(){}begin(){}report(){}done(){}},Sc=class extends Fa{constructor(){super(),this._source=new Ds.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function xD(t,e){if(e===void 0||e.workDoneToken===void 0)return new Fa;let n=e.workDoneToken;return delete e.workDoneToken,new gi(t,n)}Is.attachWorkDone=xD;var ED=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Ds.WorkDoneProgressCancelNotification.type,n=>{let r=gi.Instances.get(n.token);(r instanceof Tc||r instanceof Sc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Fa:new gi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,wD.generateUuid)();return this.connection.sendRequest(Ds.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Tc(this.connection,e))}else return Promise.resolve(new Sc)}};Is.ProgressFeature=ED;var Gg;(function(t){t.type=new Ds.ProgressType})(Gg||(Gg={}));var zg=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Gg.type,this._token,e)}};function AD(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new zg(t,n)}Is.attachPartialResult=AD});var F0=m(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.ConfigurationFeature=void 0;var OD=_t(),CD=Ml(),RD=t=>class extends t{getConfiguration(e){return e?CD.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(OD.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};kc.ConfigurationFeature=RD});var $0=m(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.WorkspaceFoldersFeature=void 0;var wc=_t(),PD=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new wc.Emitter,this.connection.onNotification(wc.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(wc.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(wc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};xc.WorkspaceFoldersFeature=PD});var B0=m(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.CallHierarchyFeature=void 0;var Kg=_t(),DD=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Kg.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Kg.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Kg.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ec.CallHierarchyFeature=DD});var Xg=m(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.SemanticTokensBuilder=Ms.SemanticTokensDiff=Ms.SemanticTokensFeature=void 0;var Ac=_t(),ID=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ac.SemanticTokensRefreshRequest.type),on:e=>{let n=Ac.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Ac.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Ac.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ms.SemanticTokensFeature=ID;var Oc=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 s=e-1,i=n-1;for(;s>=r&&i>=r&&this.originalSequence[s]===this.modifiedSequence[i];)s--,i--;(s<r||i<r)&&(s++,i++);let o=s-r+1,a=this.modifiedSequence.slice(r,i+1);return a.length===1&&a[0]===this.originalSequence[s]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Ms.SemanticTokensDiff=Oc;var Vg=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,s,i){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++]=s,this._data[this._dataLen++]=i,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 Oc(this._prevData,this._data).computeDiff()}:this.build()}};Ms.SemanticTokensBuilder=Vg});var U0=m(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.ShowDocumentFeature=void 0;var MD=_t(),LD=t=>class extends t{showDocument(e){return this.connection.sendRequest(MD.ShowDocumentRequest.type,e)}};Cc.ShowDocumentFeature=LD});var W0=m(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.FileOperationsFeature=void 0;var To=_t(),ND=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(To.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(To.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(To.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(To.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(To.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(To.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Rc.FileOperationsFeature=ND});var H0=m(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.LinkedEditingRangeFeature=void 0;var qD=_t(),jD=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(qD.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Pc.LinkedEditingRangeFeature=jD});var G0=m(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.TypeHierarchyFeature=void 0;var Yg=_t(),FD=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Yg.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=Yg.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=Yg.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Dc.TypeHierarchyFeature=FD});var K0=m(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.InlineValueFeature=void 0;var z0=_t(),$D=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(z0.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(z0.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Ic.InlineValueFeature=$D});var X0=m(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.FoldingRangeFeature=void 0;var V0=_t(),BD=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(V0.FoldingRangeRefreshRequest.type),on:e=>{let n=V0.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Mc.FoldingRangeFeature=BD});var Y0=m(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.InlayHintFeature=void 0;var Jg=_t(),UD=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Jg.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Jg.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(Jg.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Lc.InlayHintFeature=UD});var J0=m(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.DiagnosticFeature=void 0;var $a=_t(),WD=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest($a.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest($a.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress($a.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest($a.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress($a.WorkspaceDiagnosticRequest.partialResult,n)))}}};Nc.DiagnosticFeature=WD});var Zg=m(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.TextDocuments=void 0;var mi=_t(),Qg=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new mi.Emitter,this._onDidOpen=new mi.Emitter,this._onDidClose=new mi.Emitter,this._onDidSave=new mi.Emitter,this._onWillSave=new mi.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=mi.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let s=r.textDocument,i=this._configuration.create(s.uri,s.languageId,s.version,s.text);this._syncedDocuments.set(s.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let s=r.textDocument,i=r.contentChanges;if(i.length===0)return;let{version:o}=s;if(o==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let a=this._syncedDocuments.get(s.uri);a!==void 0&&(a=this._configuration.update(a,i,o),this._syncedDocuments.set(s.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onWillSave.fire(Object.freeze({document:s,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,s)=>{let i=this._syncedDocuments.get(r.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:r.reason}),s):[]})),n.push(e.onDidSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),mi.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};qc.TextDocuments=Qg});var tm=m(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.NotebookDocuments=So.NotebookSyncFeature=void 0;var Gn=_t(),Q0=Zg(),HD=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Gn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Gn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Gn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Gn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};So.NotebookSyncFeature=HD;var jc=class t{onDidOpenTextDocument(e){return this.openHandler=e,Gn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Gn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Gn.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};jc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var em=class{constructor(e){e instanceof Q0.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Q0.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Gn.Emitter,this._onDidChange=new Gn.Emitter,this._onDidSave=new Gn.Emitter,this._onDidClose=new Gn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new jc,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(s=>{this.notebookDocuments.set(s.notebookDocument.uri,s.notebookDocument);for(let i of s.cellTextDocuments)n.openTextDocument({textDocument:i});this.updateCellMap(s.notebookDocument),this._onDidOpen.fire(s.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i===void 0)return;i.version=s.notebookDocument.version;let o=i.metadata,a=!1,u=s.change;u.metadata!==void 0&&(a=!0,i.metadata=u.metadata);let l=[],c=[],h=[],f=[];if(u.cells!==void 0){let A=u.cells;if(A.structure!==void 0){let k=A.structure.array;if(i.cells.splice(k.start,k.deleteCount,...k.cells!==void 0?k.cells:[]),A.structure.didOpen!==void 0)for(let S of A.structure.didOpen)n.openTextDocument({textDocument:S}),l.push(S.uri);if(A.structure.didClose)for(let S of A.structure.didClose)n.closeTextDocument({textDocument:S}),c.push(S.uri)}if(A.data!==void 0){let k=new Map(A.data.map(S=>[S.document,S]));for(let S=0;S<=i.cells.length;S++){let _=k.get(i.cells[S].document);if(_!==void 0){let N=i.cells.splice(S,1,_);if(h.push({old:N[0],new:_}),k.delete(_.document),k.size===0)break}}}if(A.textContent!==void 0)for(let k of A.textContent)n.changeTextDocument({textDocument:k.document,contentChanges:k.changes}),f.push(k.document.uri)}this.updateCellMap(i);let g={notebookDocument:i};a&&(g.metadata={old:o,new:i.metadata});let v=[];for(let A of l)v.push(this.getNotebookCell(A));let b=[];for(let A of c)b.push(this.getNotebookCell(A));let O=[];for(let A of f)O.push(this.getNotebookCell(A));(v.length>0||b.length>0||h.length>0||O.length>0)&&(g.cells={added:v,removed:b,changed:{data:h,textContent:O}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let o of s.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(s.notebookDocument.uri);for(let o of i.cells)this.notebookCellMap.delete(o.document)}})),Gn.Disposable.create(()=>{r.forEach(s=>s.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};So.NotebookDocuments=em});var Z0=m(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.MonikerFeature=void 0;var GD=_t(),zD=t=>class extends t{get moniker(){return{on:e=>{let n=GD.MonikerRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Fc.MonikerFeature=zD});var am=m(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.createConnection=Le.combineFeatures=Le.combineNotebooksFeatures=Le.combineLanguagesFeatures=Le.combineWorkspaceFeatures=Le.combineWindowFeatures=Le.combineClientFeatures=Le.combineTracerFeatures=Le.combineTelemetryFeatures=Le.combineConsoleFeatures=Le._NotebooksImpl=Le._LanguagesImpl=Le.BulkUnregistration=Le.BulkRegistration=Le.ErrorMessageTracker=void 0;var Y=_t(),zn=Ml(),rm=Hg(),ye=j0(),KD=F0(),VD=$0(),XD=B0(),YD=Xg(),JD=U0(),QD=W0(),ZD=H0(),eI=G0(),tI=K0(),nI=X0(),rI=Y0(),sI=J0(),iI=tm(),oI=Z0();function nm(t){if(t!==null)return t}var sm=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)})}};Le.ErrorMessageTracker=sm;var $c=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(Y.MessageType.Error,e)}warn(e){this.send(Y.MessageType.Warning,e)}info(e){this.send(Y.MessageType.Info,e)}log(e){this.send(Y.MessageType.Log,e)}debug(e){this.send(Y.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(Y.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,Y.RAL)().console.error("Sending log message failed")})}},im=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:Y.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(Y.ShowMessageRequest.type,r).then(nm)}showWarningMessage(e,...n){let r={type:Y.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(Y.ShowMessageRequest.type,r).then(nm)}showInformationMessage(e,...n){let r={type:Y.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(Y.ShowMessageRequest.type,r).then(nm)}},ex=(0,JD.ShowDocumentFeature)((0,ye.ProgressFeature)(im)),tx;(function(t){function e(){return new Bc}t.create=e})(tx||(Le.BulkRegistration=tx={}));var Bc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=zn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let s=rm.generateUuid();this._registrations.push({id:s,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},nx;(function(t){function e(){return new Ba(void 0,[])}t.create=e})(nx||(Le.BulkUnregistration=nx={}));var Ba=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(Y.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=zn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let s={unregisterations:[r]};return this._connection.sendRequest(Y.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(n)},i=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Uc=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 Bc?this.registerMany(e):e instanceof Ba?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let s=zn.string(n)?n:n.method,i=rm.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Y.RegistrationRequest.type,o).then(a=>(e.add({id:i,method:s}),e),a=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=zn.string(e)?e:e.method,s=rm.generateUuid(),i={registrations:[{id:s,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(Y.RegistrationRequest.type,i).then(o=>Y.Disposable.create(()=>{this.unregisterSingle(s,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(Y.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(Y.RegistrationRequest.type,n).then(()=>new Ba(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},om=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(s){return s&&!!s.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(Y.ApplyWorkspaceEditRequest.type,r)}},rx=(0,QD.FileOperationsFeature)((0,VD.WorkspaceFoldersFeature)((0,KD.ConfigurationFeature)(om))),Wc=class{constructor(){this._trace=Y.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!==Y.Trace.Off&&this.connection.sendNotification(Y.LogTraceNotification.type,{message:e,verbose:this._trace===Y.Trace.Verbose?n:void 0}).catch(()=>{})}},Hc=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(Y.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Gc=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,ye.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ye.attachPartialResult)(this.connection,n)}};Le._LanguagesImpl=Gc;var sx=(0,nI.FoldingRangeFeature)((0,oI.MonikerFeature)((0,sI.DiagnosticFeature)((0,rI.InlayHintFeature)((0,tI.InlineValueFeature)((0,eI.TypeHierarchyFeature)((0,ZD.LinkedEditingRangeFeature)((0,YD.SemanticTokensFeature)((0,XD.CallHierarchyFeature)(Gc))))))))),zc=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,ye.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ye.attachPartialResult)(this.connection,n)}};Le._NotebooksImpl=zc;var ix=(0,iI.NotebookSyncFeature)(zc);function ox(t,e){return function(n){return e(t(n))}}Le.combineConsoleFeatures=ox;function ax(t,e){return function(n){return e(t(n))}}Le.combineTelemetryFeatures=ax;function ux(t,e){return function(n){return e(t(n))}}Le.combineTracerFeatures=ux;function lx(t,e){return function(n){return e(t(n))}}Le.combineClientFeatures=lx;function cx(t,e){return function(n){return e(t(n))}}Le.combineWindowFeatures=cx;function hx(t,e){return function(n){return e(t(n))}}Le.combineWorkspaceFeatures=hx;function fx(t,e){return function(n){return e(t(n))}}Le.combineLanguagesFeatures=fx;function dx(t,e){return function(n){return e(t(n))}}Le.combineNotebooksFeatures=dx;function aI(t,e){function n(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:n(t.console,e.console,ox),tracer:n(t.tracer,e.tracer,ux),telemetry:n(t.telemetry,e.telemetry,ax),client:n(t.client,e.client,lx),window:n(t.window,e.window,cx),workspace:n(t.workspace,e.workspace,hx),languages:n(t.languages,e.languages,fx),notebooks:n(t.notebooks,e.notebooks,dx)}}Le.combineFeatures=aI;function uI(t,e,n){let r=n&&n.console?new(n.console($c)):new $c,s=t(r);r.rawAttach(s);let i=n&&n.tracer?new(n.tracer(Wc)):new Wc,o=n&&n.telemetry?new(n.telemetry(Hc)):new Hc,a=n&&n.client?new(n.client(Uc)):new Uc,u=n&&n.window?new(n.window(ex)):new ex,l=n&&n.workspace?new(n.workspace(rx)):new rx,c=n&&n.languages?new(n.languages(sx)):new sx,h=n&&n.notebooks?new(n.notebooks(ix)):new ix,f=[r,i,o,a,u,l,c,h];function g(k){return k instanceof Promise?k:zn.thenable(k)?new Promise((S,_)=>{k.then(N=>S(N),N=>_(N))}):Promise.resolve(k)}let v,b,O,A={listen:()=>s.listen(),sendRequest:(k,...S)=>s.sendRequest(zn.string(k)?k:k.method,...S),onRequest:(k,S)=>s.onRequest(k,S),sendNotification:(k,S)=>{let _=zn.string(k)?k:k.method;return s.sendNotification(_,S)},onNotification:(k,S)=>s.onNotification(k,S),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:k=>(b=k,{dispose:()=>{b=void 0}}),onInitialized:k=>s.onNotification(Y.InitializedNotification.type,k),onShutdown:k=>(v=k,{dispose:()=>{v=void 0}}),onExit:k=>(O=k,{dispose:()=>{O=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return i},get client(){return a},get window(){return u},get workspace(){return l},get languages(){return c},get notebooks(){return h},onDidChangeConfiguration:k=>s.onNotification(Y.DidChangeConfigurationNotification.type,k),onDidChangeWatchedFiles:k=>s.onNotification(Y.DidChangeWatchedFilesNotification.type,k),__textDocumentSync:void 0,onDidOpenTextDocument:k=>s.onNotification(Y.DidOpenTextDocumentNotification.type,k),onDidChangeTextDocument:k=>s.onNotification(Y.DidChangeTextDocumentNotification.type,k),onDidCloseTextDocument:k=>s.onNotification(Y.DidCloseTextDocumentNotification.type,k),onWillSaveTextDocument:k=>s.onNotification(Y.WillSaveTextDocumentNotification.type,k),onWillSaveTextDocumentWaitUntil:k=>s.onRequest(Y.WillSaveTextDocumentWaitUntilRequest.type,k),onDidSaveTextDocument:k=>s.onNotification(Y.DidSaveTextDocumentNotification.type,k),sendDiagnostics:k=>s.sendNotification(Y.PublishDiagnosticsNotification.type,k),onHover:k=>s.onRequest(Y.HoverRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),void 0)),onCompletion:k=>s.onRequest(Y.CompletionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onCompletionResolve:k=>s.onRequest(Y.CompletionResolveRequest.type,k),onSignatureHelp:k=>s.onRequest(Y.SignatureHelpRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),void 0)),onDeclaration:k=>s.onRequest(Y.DeclarationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onDefinition:k=>s.onRequest(Y.DefinitionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onTypeDefinition:k=>s.onRequest(Y.TypeDefinitionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onImplementation:k=>s.onRequest(Y.ImplementationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onReferences:k=>s.onRequest(Y.ReferencesRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onDocumentHighlight:k=>s.onRequest(Y.DocumentHighlightRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onDocumentSymbol:k=>s.onRequest(Y.DocumentSymbolRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onWorkspaceSymbol:k=>s.onRequest(Y.WorkspaceSymbolRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onWorkspaceSymbolResolve:k=>s.onRequest(Y.WorkspaceSymbolResolveRequest.type,k),onCodeAction:k=>s.onRequest(Y.CodeActionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onCodeActionResolve:k=>s.onRequest(Y.CodeActionResolveRequest.type,(S,_)=>k(S,_)),onCodeLens:k=>s.onRequest(Y.CodeLensRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onCodeLensResolve:k=>s.onRequest(Y.CodeLensResolveRequest.type,(S,_)=>k(S,_)),onDocumentFormatting:k=>s.onRequest(Y.DocumentFormattingRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),void 0)),onDocumentRangeFormatting:k=>s.onRequest(Y.DocumentRangeFormattingRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),void 0)),onDocumentOnTypeFormatting:k=>s.onRequest(Y.DocumentOnTypeFormattingRequest.type,(S,_)=>k(S,_)),onRenameRequest:k=>s.onRequest(Y.RenameRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),void 0)),onPrepareRename:k=>s.onRequest(Y.PrepareRenameRequest.type,(S,_)=>k(S,_)),onDocumentLinks:k=>s.onRequest(Y.DocumentLinkRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onDocumentLinkResolve:k=>s.onRequest(Y.DocumentLinkResolveRequest.type,(S,_)=>k(S,_)),onDocumentColor:k=>s.onRequest(Y.DocumentColorRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onColorPresentation:k=>s.onRequest(Y.ColorPresentationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onFoldingRanges:k=>s.onRequest(Y.FoldingRangeRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onSelectionRanges:k=>s.onRequest(Y.SelectionRangeRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),(0,ye.attachPartialResult)(s,S))),onExecuteCommand:k=>s.onRequest(Y.ExecuteCommandRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(s,S),void 0)),dispose:()=>s.dispose()};for(let k of f)k.attach(A);return s.onRequest(Y.InitializeRequest.type,k=>{e.initialize(k),zn.string(k.trace)&&(i.trace=Y.Trace.fromString(k.trace));for(let S of f)S.initialize(k.capabilities);if(b){let S=b(k,new Y.CancellationTokenSource().token,(0,ye.attachWorkDone)(s,k),void 0);return g(S).then(_=>{if(_ instanceof Y.ResponseError)return _;let N=_;N||(N={capabilities:{}});let R=N.capabilities;R||(R={},N.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=zn.number(A.__textDocumentSync)?A.__textDocumentSync:Y.TextDocumentSyncKind.None:!zn.number(R.textDocumentSync)&&!zn.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=zn.number(A.__textDocumentSync)?A.__textDocumentSync:Y.TextDocumentSyncKind.None);for(let G of f)G.fillServerCapabilities(R);return N})}else{let S={capabilities:{textDocumentSync:Y.TextDocumentSyncKind.None}};for(let _ of f)_.fillServerCapabilities(S.capabilities);return S}}),s.onRequest(Y.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,v)return v(new Y.CancellationTokenSource().token)}),s.onNotification(Y.ExitNotification.type,()=>{try{O&&O()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),s.onNotification(Y.SetTraceNotification.type,k=>{i.trace=Y.Trace.fromString(k.value)}),A}Le.createConnection=uI});var px=m(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.resolveModulePath=xn.FileSystem=xn.resolveGlobalYarnPath=xn.resolveGlobalNodePath=xn.resolve=xn.uriToFilePath=void 0;var lI=require("url"),mr=require("path"),um=require("fs"),fm=require("child_process");function cI(t){let e=lI.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,s=n.length;r<s;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let i=n[0],o=n[1];i.length===0&&o.length>1&&o[1]===":"&&n.shift()}return mr.normalize(n.join("/"))}xn.uriToFilePath=cI;function lm(){return process.platform==="win32"}function Kc(t,e,n,r){let s="NODE_PATH",i=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let u=process.env,l=Object.create(null);Object.keys(u).forEach(c=>l[c]=u[c]),e&&um.existsSync(e)&&(l[s]?l[s]=e+mr.delimiter+l[s]:l[s]=e,r&&r(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let c=(0,fm.fork)("",[],{cwd:n,env:l,execArgv:["-e",i]});if(c.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",f=>{a(f)}),c.on("message",f=>{f.c==="r"&&(c.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};c.send(h)}catch(c){a(c)}})}xn.resolve=Kc;function cm(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(i=>n[i]=process.env[i]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};lm()&&(e="npm.cmd",r.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,fm.spawnSync)(e,["config","get","prefix"],r).stdout;if(!i){t&&t("'npm config get prefix' didn't return a value.");return}let o=i.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?lm()?mr.join(o,"node_modules"):mr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}xn.resolveGlobalNodePath=cm;function hI(t){let e="yarn",n={encoding:"utf8"};lm()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,fm.spawnSync)(e,["global","dir","--json"],n),i=s.stdout;if(!i){t&&(t("'yarn global dir' didn't return a value."),s.stderr&&t(s.stderr));return}let o=i.trim().split(/\r?\n/);for(let a of o)try{let u=JSON.parse(a);if(u.type==="log")return mr.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}xn.resolveGlobalYarnPath=hI;var hm;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!um.existsSync(__filename.toUpperCase())||!um.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(s,i){return n()?mr.normalize(i).indexOf(mr.normalize(s))===0:mr.normalize(i).toLowerCase().indexOf(mr.normalize(s).toLowerCase())===0}t.isParent=r})(hm||(xn.FileSystem=hm={}));function fI(t,e,n,r){return n?(mr.isAbsolute(n)||(n=mr.join(t,n)),Kc(e,n,n,r).then(s=>hm.isParent(n,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>Kc(e,cm(r),t,r))):Kc(e,cm(r),t,r)}xn.resolveModulePath=fI});var dm=m((pG,gx)=>{"use strict";gx.exports=_t()});var mx=m(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.InlineCompletionFeature=void 0;var dI=_t(),pI=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(dI.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Vc.InlineCompletionFeature=pI});var vx=m(nn=>{"use strict";var gI=nn&&nn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),bx=nn&&nn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&gI(e,t,n)};Object.defineProperty(nn,"__esModule",{value:!0});nn.ProposedFeatures=nn.NotebookDocuments=nn.TextDocuments=nn.SemanticTokensBuilder=void 0;var mI=Xg();Object.defineProperty(nn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return mI.SemanticTokensBuilder}});var yI=mx();bx(_t(),nn);var bI=Zg();Object.defineProperty(nn,"TextDocuments",{enumerable:!0,get:function(){return bI.TextDocuments}});var vI=tm();Object.defineProperty(nn,"NotebookDocuments",{enumerable:!0,get:function(){return vI.NotebookDocuments}});bx(am(),nn);var yx;(function(t){t.all={__brand:"features",languages:yI.InlineCompletionFeature}})(yx||(nn.ProposedFeatures=yx={}))});var gm=m(Kn=>{"use strict";var _I=Kn&&Kn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),kx=Kn&&Kn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&_I(e,t,n)};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.createConnection=Kn.Files=void 0;var _x=require("node:util"),pm=Ml(),TI=am(),Ua=px(),yi=dm();kx(dm(),Kn);kx(vx(),Kn);var Tx;(function(t){t.uriToFilePath=Ua.uriToFilePath,t.resolveGlobalNodePath=Ua.resolveGlobalNodePath,t.resolveGlobalYarnPath=Ua.resolveGlobalYarnPath,t.resolve=Ua.resolve,t.resolveModulePath=Ua.resolveModulePath})(Tx||(Kn.Files=Tx={}));var Sx;function Xc(){if(Sx!==void 0)try{Sx.end()}catch{}}var ko=!1,wx;function SI(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(wx=setInterval(()=>{try{process.kill(r,0)}catch{Xc(),process.exit(ko?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 s=r.split("=");s[0]===t&&e(s[1])}}}SI();var kI={initialize:t=>{let e=t.processId;pm.number(e)&&wx===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(ko?0:1)}},3e3)},get shutdownReceived(){return ko},set shutdownReceived(t){ko=t},exit:t=>{Xc(),process.exit(t)}};function wI(t,e,n,r){let s,i,o,a;return t!==void 0&&t.__brand==="features"&&(s=t,t=e,e=n,n=r),yi.ConnectionStrategy.is(t)||yi.ConnectionOptions.is(t)?a=t:(i=t,o=e,a=n),xI(i,o,a,s)}Kn.createConnection=wI;function xI(t,e,n,r){let s=!1;if(!t&&!e&&process.argv.length>2){let u,l,c=process.argv.slice(2);for(let h=0;h<c.length;h++){let f=c[h];if(f==="--node-ipc"){t=new yi.IPCMessageReader(process),e=new yi.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!0,t=process.stdin,e=process.stdout;break}else if(f==="--socket"){u=parseInt(c[h+1]);break}else if(f==="--pipe"){l=c[h+1];break}else{var i=f.split("=");if(i[0]==="--socket"){u=parseInt(i[1]);break}else if(i[0]==="--pipe"){l=i[1];break}}}if(u){let h=(0,yi.createServerSocketTransport)(u);t=h[0],e=h[1]}else if(l){let h=(0,yi.createServerPipeTransport)(l);t=h[0],e=h[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(pm.func(t.read)&&pm.func(t.on)){let u=t;u.on("end",()=>{Xc(),process.exit(ko?0:1)}),u.on("close",()=>{Xc(),process.exit(ko?0:1)})}let a=u=>{let l=(0,yi.createProtocolConnection)(t,e,u,n);return s&&EI(u),l};return(0,TI.createConnection)(a,kI,r)}function EI(t){function e(r){return r.map(s=>typeof s=="string"?s:(0,_x.inspect)(s)).join(" ")}let n=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)t.error("Assertion failed");else{let[o,...a]=i;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(s="default"){let i=String(s),o=n.get(i)??0;o+=1,n.set(i,o),t.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?n.clear():n.delete(String(s))},console.debug=function(...s){t.log(e(s))},console.dir=function(s,i){t.log((0,_x.inspect)(s,i))},console.log=function(...s){t.log(e(s))},console.error=function(...s){t.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),t.log(`${o}
36
+ ${i}`)},console.warn=function(...s){t.warn(e(s))}}});var mm=m((vG,xx)=>{"use strict";xx.exports=gm()});var bi=m(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.TypeAnalyzerStrategy=En.IndentationType=En.DefaultFileExtensions=En.ConfigurationNamespace=En.LanguageId=void 0;En.LanguageId="miniscript";En.ConfigurationNamespace="miniscript";En.DefaultFileExtensions=["ms"];var AI;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(AI=En.IndentationType||(En.IndentationType={}));var OI;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(OI=En.TypeAnalyzerStrategy||(En.TypeAnalyzerStrategy={}))});var Wa=m(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.Position=void 0;var ym=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};Yc.Position=ym});var Ls=m(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.LiteralToken=Mn.Token=Mn.BaseToken=Mn.BaseTokenOptions=Mn.TokenType=void 0;var Ex=Wa(),CI;(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"})(CI=Mn.TokenType||(Mn.TokenType={}));var bm=class{};Mn.BaseTokenOptions=bm;var Ha=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 Ex.Position(this.line,r[0]-n[0]+1),this.end=new Ex.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,s=this.end.character,i=`${e}:${r} - ${n}:${s}`;return`${this.type}[${i}: value = '${this.value}']`}};Mn.BaseToken=Ha;var vm=class extends Ha{};Mn.Token=vm;var _m=class extends Ha{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,s=this.end.character,i=`${e}:${r} - ${n}:${s}`;return`${this.type}[${i}: value = ${this.raw}]`}};Mn.LiteralToken=_m});var Jc=m(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.CharacterCode=void 0;var RI;(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"})(RI=Ga.CharacterCode||(Ga.CharacterCode={}))});var wo=m(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.Keyword=void 0;var PI;(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"})(PI=za.Keyword||(za.Keyword={}))});var km=m(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var Vn=Jc(),DI=wo(),Tm=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(DI.Keyword)))}isWhitespace(e){return Vn.CharacterCode.WHITESPACE===e||Vn.CharacterCode.TAB===e}isEndOfLine(e){return Vn.CharacterCode.NEW_LINE===e||Vn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Vn.CharacterCode.SLASH===e&&Vn.CharacterCode.SLASH===n}isIdentifierStart(e){return(e|32)>=97&&(e|32)<=122||e>=128||e===95}isIdentifierPart(e){return(e|32)>=97&&(e|32)<=122||e>=48&&e<=57||e>=128||e===95}isDecDigit(e){return e>=Vn.CharacterCode.NUMBER_0&&e<=Vn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Vn.CharacterCode.RETURN_LINE:return Vn.CharacterCode.NEW_LINE===n;case Vn.CharacterCode.NEW_LINE:return Vn.CharacterCode.RETURN_LINE===n}return!1}};Sm.default=Tm});var Qc=m(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.ParserException=xo.LexerException=void 0;var wm=class extends Error{constructor(e,n){super(e),this.range=n}};xo.LexerException=wm;var xm=class extends Error{constructor(e,n){super(e),this.range=n}};xo.ParserException=xm});var Em=m(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.Literal=void 0;var II;(function(t){t.True="true",t.False="false",t.Null="null"})(II=Ka.Literal||(Ka.Literal={}))});var Eo=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.Operator=void 0;var MI;(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"})(MI=Va.Operator||(Va.Operator={}))});var Xa=m(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.Range=void 0;var Am=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};Zc.Range=Am});var Rm=m(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var Om=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}};Cm.default=Om});var Im=m(Ja=>{"use strict";var Ox=Ja&&Ja.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ja,"__esModule",{value:!0});var ot=Ls(),LI=Ox(km()),Te=Jc(),NI=Qc(),Pm=wo(),Ya=Em(),at=Eo(),Ao=Wa(),Dm=Xa(),Ax=Ox(Rm());function Ns(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var eh=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 LI.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new Ax.default,r.snapshot=new Ax.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 ot.Token({type:ot.TokenType.EOL,value:at.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,s=new ot.Token({type:ot.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(s),s}createEOF(e){let n=this,r=new ot.Token({type:ot.TokenType.EOF,value:at.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,s=new ot.LiteralToken({type:ot.TokenType.BooleanLiteral,value:e===Ya.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(s),s}createNull(e){let n=this,r=new ot.LiteralToken({type:ot.TokenType.NilLiteral,value:null,raw:Ya.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 ot.Token({type:ot.TokenType.SliceOperator,value:at.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 ot.Token({type:ot.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 s=new ot.LiteralToken({type:ot.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(s),s}scanStringLiteral(e){let n=this,r=n.validator,s=n.line,i=n.lineStart,o=n.index,a=n.offset,u=n.offset,l=!1;for(;n.index<n.length;){n.index++;let g=n.codeAt();if(n.validator.isEndOfLine(g))r.isWinNewline(g,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(Te.CharacterCode.QUOTE===g){if(Te.CharacterCode.QUOTE!==n.codeAt(1)){l=!0;break}n.index++}}if(!l)return n.raise("Unexpected string end of file.",new Dm.Range(new Ao.Position(s,o-a+1),new Ao.Position(n.line,n.index-u+2)));n.index++;let c=n.content.slice(n.tokenStart,n.index),h=c.slice(1,-1).replace(/""/g,at.Operator.Escape),f=new ot.LiteralToken({type:ot.TokenType.StringLiteral,value:h,raw:c,line:s,lineStart:i,range:[n.tokenStart,n.index],offsetRange:[a,u],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=u,n.snapshot.enqueue(f),f}scanComment(e){let n=this,r=n.validator,s=n.line,i=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 ot.Token({type:ot.TokenType.Comment,value:o,line:s,lineStart:i,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,s;for(;this.index<this.length&&(r=s,s=this.codeAt(),n.isDecDigit(s)||Te.CharacterCode.DOT===s||Te.CharacterCode.LETTER_E===s||Te.CharacterCode.LETTER_e===s||(Te.CharacterCode.MINUS===s||Te.CharacterCode.PLUS===s)&&(Te.CharacterCode.LETTER_E===r||Te.CharacterCode.LETTER_e===r));)this.index++;let i=this.content.slice(this.tokenStart,this.index),o=Number(i);return isNaN(o)?this.raise(`Invalid numeric literal: ${i}`,new Dm.Range(new Ao.Position(this.line,this.tokenStart-this.offset+1),new Ao.Position(this.line,this.index-this.offset+1))):this.createNumericLiteral(o,i,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,s=r.validator,i=e;switch(e){case Pm.Keyword.End:{for(r.index++;s.isIdentifierPart(r.codeAt());r.index++);i=r.content.slice(r.tokenStart,r.index);break}case Pm.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Pm.Keyword.ElseIf&&(r.index+=3,i=a);break}}let o=new ot.Token({type:ot.TokenType.Keyword,value:i,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 s=n.content.slice(n.tokenStart,n.index);if(r.isKeyword(s))return n.scanKeyword(s,e);switch(s){case Ya.Literal.True:case Ya.Literal.False:return n.createBoolean(s,e);case Ya.Literal.Null:return n.createNull(e)}return n.createIdentifier(s,e)}next(){let e=this;if(e.backlog.size)return e.backlog.dequeue();let n=e.index;e.skipWhiteSpace();let r=n<e.index,s=e.codeAt();if(e.validator.isComment(s,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(s)){e.validator.isWinNewline(s,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(s))return e.scanIdentifierOrKeyword(r);let i=e.line,o=e.scan(s,r);return o||e.raise(`Invalid character ${s} (Code: ${String.fromCharCode(s)})`,new Dm.Range(new Ao.Position(i,e.tokenStart-e.offset+1),new Ao.Position(e.line,e.index-e.offset+1)))}recordSnapshot(){this.snapshot.clear()}recoverFromSnapshot(){this.backlog.copyInto(this.snapshot)}raise(e,n){let r=this,s=new NI.LexerException(e,n);if(r.errors.push(s),r.unsafe)return new ot.Token({type:ot.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw s}};Ja.default=eh;eh.scanHandlers={[Te.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[Te.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(at.Operator.Member,e))},[Te.CharacterCode.EQUAL]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.Equal,e):this.scanPunctuator(at.Operator.Assign,e)},[Te.CharacterCode.ARROW_LEFT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.LessThanOrEqual,e):this.scanPunctuator(at.Operator.LessThan,e)},[Te.CharacterCode.ARROW_RIGHT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.GreaterThanOrEqual,e):this.scanPunctuator(at.Operator.GreaterThan,e)},[Te.CharacterCode.EXCLAMATION_MARK]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.NotEqual,e):(this.index++,null)},[Te.CharacterCode.MINUS]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.SubtractShorthand,e):this.scanPunctuator(at.Operator.Minus,e)},[Te.CharacterCode.PLUS]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.AddShorthand,e):this.scanPunctuator(at.Operator.Plus,e)},[Te.CharacterCode.ASTERISK]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.MultiplyShorthand,e):this.scanPunctuator(at.Operator.Asterik,e)},[Te.CharacterCode.SLASH]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.DivideShorthand,e):this.scanPunctuator(at.Operator.Slash,e)},[Te.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[Te.CharacterCode.CARET]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.PowerShorthand,e):this.scanPunctuator(at.Operator.Power,e)},[Te.CharacterCode.PERCENT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.ModuloShorthand,e):this.scanPunctuator(at.Operator.Modulo,e)},[Te.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[Te.CharacterCode.COMMA]:Ns,[Te.CharacterCode.CURLY_BRACKET_LEFT]:Ns,[Te.CharacterCode.CURLY_BRACKET_RIGHT]:Ns,[Te.CharacterCode.SQUARE_BRACKETS_LEFT]:Ns,[Te.CharacterCode.SQUARE_BRACKETS_RIGHT]:Ns,[Te.CharacterCode.PARENTHESIS_LEFT]:Ns,[Te.CharacterCode.PARENTHESIS_RIGHT]:Ns,[Te.CharacterCode.AT_SIGN]:Ns}});var pt=m(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.ASTComment=Ln.ASTBaseBlockWithScope=Ln.ASTBaseBlock=Ln.ASTBase=Ln.ASTType=void 0;var Cx;(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"})(Cx=Ln.ASTType||(Ln.ASTType={}));var Qa=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})}};Ln.ASTBase=Qa;var th=class t extends Qa{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})}};kn.ASTBaseBlock=Qc;var Xh=class t extends Qc{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=Xh;var Yh=class t extends ya{constructor(e){super(px.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=Yh});var Qh=g(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.ASTAssignmentStatement=void 0;var hx=dt(),Jh=class t extends hx.ASTBase{constructor(e){super(hx.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})}};Zc.ASTAssignmentStatement=Jh});var eg=g(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.ASTBinaryExpression=void 0;var gx=dt(),Zh=class t extends gx.ASTBase{constructor(e){super(gx.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})}};el.ASTBinaryExpression=Zh});var rg=g(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.ASTCallExpression=Js.ASTCallStatement=void 0;var tl=dt(),tg=class t extends tl.ASTBase{constructor(e){super(tl.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})}};Js.ASTCallStatement=tg;var ng=class t extends tl.ASTBase{constructor(e){super(tl.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})}};Js.ASTCallExpression=ng});var sg=g(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.ASTChunk=void 0;var mx=dt(),ig=class t extends mx.ASTBaseBlockWithScope{constructor(e){super(mx.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})}};Ln.ASTBaseBlock=th;var Mm=class t extends th{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})}};Ln.ASTBaseBlockWithScope=Mm;var Lm=class t extends Qa{constructor(e){super(Cx.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})}};Ln.ASTComment=Lm});var qm=m(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.ASTAssignmentStatement=void 0;var Rx=pt(),Nm=class t extends Rx.ASTBase{constructor(e){super(Rx.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})}};nh.ASTAssignmentStatement=Nm});var Fm=m(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.ASTBinaryExpression=void 0;var Px=pt(),jm=class t extends Px.ASTBase{constructor(e){super(Px.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})}};rh.ASTBinaryExpression=jm});var Um=m(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.ASTCallExpression=Oo.ASTCallStatement=void 0;var sh=pt(),$m=class t extends sh.ASTBase{constructor(e){super(sh.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})}};Oo.ASTCallStatement=$m;var Bm=class t extends sh.ASTBase{constructor(e){super(sh.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})}};Oo.ASTCallExpression=Bm});var Hm=m(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.ASTChunk=void 0;var Dx=pt(),Wm=class t extends Dx.ASTBaseBlockWithScope{constructor(e){super(Dx.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})}};nl.ASTChunk=ig});var ag=g(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.ASTComparisonGroupExpression=void 0;var yx=dt(),og=class t extends yx.ASTBase{constructor(e){super(yx.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})}};rl.ASTComparisonGroupExpression=og});var cg=g(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.ASTForGenericStatement=void 0;var bx=dt(),ug=class t extends bx.ASTBaseBlock{constructor(e){super(bx.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})}};ih.ASTChunk=Wm});var zm=m(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.ASTComparisonGroupExpression=void 0;var Ix=pt(),Gm=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})}};oh.ASTComparisonGroupExpression=Gm});var Vm=m(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.ASTForGenericStatement=void 0;var Mx=pt(),Km=class t extends Mx.ASTBaseBlock{constructor(e){super(Mx.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})}};il.ASTForGenericStatement=ug});var dg=g(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.ASTFunctionStatement=void 0;var vx=dt(),lg=class t extends vx.ASTBaseBlockWithScope{constructor(e){super(vx.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})}};ah.ASTForGenericStatement=Km});var Ym=m(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.ASTFunctionStatement=void 0;var Lx=pt(),Xm=class t extends Lx.ASTBaseBlockWithScope{constructor(e){super(Lx.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})}};sl.ASTFunctionStatement=lg});var gg=g(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.ASTIndexExpression=hi.ASTMemberExpression=hi.ASTIdentifier=void 0;var Qs=dt(),fg=class t extends Qs.ASTBase{constructor(e){super(Qs.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})}};hi.ASTIdentifier=fg;var pg=class t extends Qs.ASTBase{constructor(e){super(Qs.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})}};hi.ASTMemberExpression=pg;var hg=class t extends Qs.ASTBase{constructor(e){super(Qs.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})}};hi.ASTIndexExpression=hg});var vg=g(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.ASTElseClause=hr.ASTIfClause=hr.ASTIfStatement=hr.ASTClause=void 0;var _x=dt(),ba=class extends _x.ASTBaseBlock{};hr.ASTClause=ba;var mg=class t extends _x.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})}};uh.ASTFunctionStatement=Xm});var ey=m(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.ASTIndexExpression=qs.ASTMemberExpression=qs.ASTIdentifier=void 0;var Co=pt(),Jm=class t extends Co.ASTBase{constructor(e){super(Co.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})}};qs.ASTIdentifier=Jm;var Qm=class t extends Co.ASTBase{constructor(e){super(Co.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})}};qs.ASTMemberExpression=Qm;var Zm=class t extends Co.ASTBase{constructor(e){super(Co.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})}};qs.ASTIndexExpression=Zm});var sy=m(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.ASTElseClause=Ir.ASTIfClause=Ir.ASTIfStatement=Ir.ASTClause=void 0;var Nx=pt(),Za=class extends Nx.ASTBaseBlock{};Ir.ASTClause=Za;var ty=class t extends Nx.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})}};hr.ASTIfStatement=mg;var yg=class t extends ba{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})}};Ir.ASTIfStatement=ty;var ny=class t extends Za{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})}};hr.ASTIfClause=yg;var bg=class t extends ba{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})}};Ir.ASTIfClause=ny;var ry=class t extends Za{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})}};hr.ASTElseClause=bg});var Tg=g(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.ASTIsaExpression=void 0;var Tx=dt(),_g=class t extends Tx.ASTBase{constructor(e){super(Tx.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})}};ol.ASTIsaExpression=_g});var xg=g(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.ASTListConstructorExpression=Zs.ASTListValue=void 0;var al=dt(),Sg=class t extends al.ASTBase{constructor(e){super(al.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})}};Zs.ASTListValue=Sg;var kg=class t extends al.ASTBase{constructor(e){super(al.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})}};Ir.ASTElseClause=ry});var oy=m(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.ASTIsaExpression=void 0;var qx=pt(),iy=class t extends qx.ASTBase{constructor(e){super(qx.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})}};lh.ASTIsaExpression=iy});var ly=m(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.ASTListConstructorExpression=Ro.ASTListValue=void 0;var ch=pt(),ay=class t extends ch.ASTBase{constructor(e){super(ch.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})}};Ro.ASTListValue=ay;var uy=class t extends ch.ASTBase{constructor(e){super(ch.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})}};Zs.ASTListConstructorExpression=kg});var Rg=g(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ASTNilLiteral=Nn.ASTStringLiteral=Nn.ASTBooleanLiteral=Nn.ASTNumericLiteral=Nn.ASTLiteral=void 0;var Sx=fi(),Cg=dt(),Ki=class extends Cg.ASTBase{};Nn.ASTLiteral=Ki;var wg=class t extends Ki{constructor(e){super(Sx.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=wg;var Eg=class t extends Ki{constructor(e){super(Sx.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=Eg;var Ag=class t extends Ki{constructor(e){super(Cg.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=Ag;var Og=class t extends Ki{constructor(e){super(Cg.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=Og});var Dg=g(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.ASTLogicalExpression=void 0;var kx=dt(),Pg=class t extends kx.ASTBase{constructor(e){super(kx.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})}};ul.ASTLogicalExpression=Pg});var Lg=g(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.ASTMapConstructorExpression=eo.ASTMapKeyString=void 0;var cl=dt(),Ig=class t extends cl.ASTBase{constructor(e){super(cl.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})}};eo.ASTMapKeyString=Ig;var Mg=class t extends cl.ASTBase{constructor(e){super(cl.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})}};Ro.ASTListConstructorExpression=uy});var gy=m(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.ASTNilLiteral=Xn.ASTStringLiteral=Xn.ASTBooleanLiteral=Xn.ASTNumericLiteral=Xn.ASTLiteral=void 0;var jx=Ls(),py=pt(),vi=class extends py.ASTBase{};Xn.ASTLiteral=vi;var cy=class t extends vi{constructor(e){super(jx.TokenType.NumericLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Xn.ASTNumericLiteral=cy;var hy=class t extends vi{constructor(e){super(jx.TokenType.BooleanLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Xn.ASTBooleanLiteral=hy;var fy=class t extends vi{constructor(e){super(py.ASTType.StringLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Xn.ASTStringLiteral=fy;var dy=class t extends vi{constructor(e){super(py.ASTType.NilLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Xn.ASTNilLiteral=dy});var yy=m(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.ASTLogicalExpression=void 0;var Fx=pt(),my=class t extends Fx.ASTBase{constructor(e){super(Fx.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})}};hh.ASTLogicalExpression=my});var _y=m(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ASTMapConstructorExpression=Po.ASTMapKeyString=void 0;var fh=pt(),by=class t extends fh.ASTBase{constructor(e){super(fh.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})}};Po.ASTMapKeyString=by;var vy=class t extends fh.ASTBase{constructor(e){super(fh.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})}};eo.ASTMapConstructorExpression=Mg});var qg=g(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.ASTParenthesisExpression=void 0;var xx=dt(),Ng=class t extends xx.ASTBase{constructor(e){super(xx.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})}};ll.ASTParenthesisExpression=Ng});var Fg=g(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.ASTReturnStatement=void 0;var wx=dt(),jg=class t extends wx.ASTBase{constructor(e){super(wx.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})}};dl.ASTReturnStatement=jg});var Bg=g(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.ASTSliceExpression=void 0;var Ex=dt(),$g=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})}};fl.ASTSliceExpression=$g});var Wg=g(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.ASTUnaryExpression=void 0;var Ug=Xs(),pl=dt(),Hg=class t extends pl.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case Ug.Operator.Not:return pl.ASTType.NegationExpression;case Ug.Operator.Plus:case Ug.Operator.Minus:return pl.ASTType.BinaryNegatedExpression;default:return pl.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})}};hl.ASTUnaryExpression=Hg});var Kg=g(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.ASTWhileStatement=void 0;var Ax=dt(),Gg=class t extends Ax.ASTBaseBlock{constructor(e){super(Ax.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})}};Po.ASTMapConstructorExpression=vy});var Sy=m(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh.ASTParenthesisExpression=void 0;var $x=pt(),Ty=class t extends $x.ASTBase{constructor(e){super($x.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})}};dh.ASTParenthesisExpression=Ty});var wy=m(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.ASTReturnStatement=void 0;var Bx=pt(),ky=class t extends Bx.ASTBase{constructor(e){super(Bx.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})}};ph.ASTReturnStatement=ky});var Ey=m(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.ASTSliceExpression=void 0;var Ux=pt(),xy=class t extends Ux.ASTBase{constructor(e){super(Ux.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})}};gh.ASTSliceExpression=xy});var Cy=m(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.ASTUnaryExpression=void 0;var Ay=Eo(),mh=pt(),Oy=class t extends mh.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case Ay.Operator.Not:return mh.ASTType.NegationExpression;case Ay.Operator.Plus:case Ay.Operator.Minus:return mh.ASTType.BinaryNegatedExpression;default:return mh.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})}};yh.ASTUnaryExpression=Oy});var Py=m(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.ASTWhileStatement=void 0;var Wx=pt(),Ry=class t extends Wx.ASTBaseBlock{constructor(e){super(Wx.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})}};gl.ASTWhileStatement=Gg});var Yg=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 ml=fi(),hR=Qh(),Et=dt(),gR=eg(),Ox=rg(),mR=sg(),yR=ag(),bR=cg(),vR=dg(),Vg=gg(),gi=vg(),_R=Tg(),Cx=xg(),yl=Rg(),TR=Dg(),Rx=Lg(),SR=qg(),kR=Fg(),xR=Bg(),wR=Wg(),ER=Kg(),zg=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 kR.ASTReturnStatement(e)}ifShortcutStatement(e){return new gi.ASTIfStatement(Et.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new gi.ASTIfClause(Et.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new gi.ASTIfClause(Et.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new gi.ASTElseClause(Et.ASTType.ElseShortcutClause,e)}ifStatement(e){return new gi.ASTIfStatement(Et.ASTType.IfStatement,e)}ifClause(e){return new gi.ASTIfClause(Et.ASTType.IfClause,e)}elseifClause(e){return new gi.ASTIfClause(Et.ASTType.ElseifClause,e)}elseClause(e){return new gi.ASTElseClause(Et.ASTType.ElseClause,e)}whileStatement(e){return new ER.ASTWhileStatement(e)}assignmentStatement(e){return new hR.ASTAssignmentStatement(e)}callStatement(e){return new Ox.ASTCallStatement(e)}functionStatement(e){return new vR.ASTFunctionStatement(e)}forGenericStatement(e){return new bR.ASTForGenericStatement(e)}chunk(e){return new mR.ASTChunk(e)}identifier(e){return new Vg.ASTIdentifier(e)}literal(e,n){switch(e){case ml.TokenType.StringLiteral:return new yl.ASTStringLiteral(n);case ml.TokenType.NumericLiteral:return new yl.ASTNumericLiteral(n);case ml.TokenType.BooleanLiteral:return new yl.ASTBooleanLiteral(n);case ml.TokenType.NilLiteral:return new yl.ASTNilLiteral(n)}}memberExpression(e){return new Vg.ASTMemberExpression(e)}callExpression(e){return new Ox.ASTCallExpression(e)}comment(e){return new Et.ASTComment(e)}unaryExpression(e){return new wR.ASTUnaryExpression(e)}mapKeyString(e){return new Rx.ASTMapKeyString(e)}mapConstructorExpression(e){return new Rx.ASTMapConstructorExpression(e)}listValue(e){return new Cx.ASTListValue(e)}listConstructorExpression(e){return new Cx.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 Vg.ASTIndexExpression(e)}logicalExpression(e){return new TR.ASTLogicalExpression(e)}isaExpression(e){return new _R.ASTIsaExpression(e)}binaryExpression(e){return new gR.ASTBinaryExpression(e)}sliceExpression(e){return new xR.ASTSliceExpression(e)}parenthesisExpression(e){return new SR.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new yR.ASTComparisonGroupExpression(e)}};Y.ASTProvider=zg;var AR=Qh();Object.defineProperty(Y,"ASTAssignmentStatement",{enumerable:!0,get:function(){return AR.ASTAssignmentStatement}});var va=dt();Object.defineProperty(Y,"ASTBase",{enumerable:!0,get:function(){return va.ASTBase}});Object.defineProperty(Y,"ASTBaseBlock",{enumerable:!0,get:function(){return va.ASTBaseBlock}});Object.defineProperty(Y,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return va.ASTBaseBlockWithScope}});Object.defineProperty(Y,"ASTComment",{enumerable:!0,get:function(){return va.ASTComment}});Object.defineProperty(Y,"ASTType",{enumerable:!0,get:function(){return va.ASTType}});var OR=eg();Object.defineProperty(Y,"ASTBinaryExpression",{enumerable:!0,get:function(){return OR.ASTBinaryExpression}});var Px=rg();Object.defineProperty(Y,"ASTCallExpression",{enumerable:!0,get:function(){return Px.ASTCallExpression}});Object.defineProperty(Y,"ASTCallStatement",{enumerable:!0,get:function(){return Px.ASTCallStatement}});var CR=sg();Object.defineProperty(Y,"ASTChunk",{enumerable:!0,get:function(){return CR.ASTChunk}});var RR=ag();Object.defineProperty(Y,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return RR.ASTComparisonGroupExpression}});var PR=cg();Object.defineProperty(Y,"ASTForGenericStatement",{enumerable:!0,get:function(){return PR.ASTForGenericStatement}});var DR=dg();Object.defineProperty(Y,"ASTFunctionStatement",{enumerable:!0,get:function(){return DR.ASTFunctionStatement}});var Xg=gg();Object.defineProperty(Y,"ASTIdentifier",{enumerable:!0,get:function(){return Xg.ASTIdentifier}});Object.defineProperty(Y,"ASTIndexExpression",{enumerable:!0,get:function(){return Xg.ASTIndexExpression}});Object.defineProperty(Y,"ASTMemberExpression",{enumerable:!0,get:function(){return Xg.ASTMemberExpression}});var bl=vg();Object.defineProperty(Y,"ASTClause",{enumerable:!0,get:function(){return bl.ASTClause}});Object.defineProperty(Y,"ASTElseClause",{enumerable:!0,get:function(){return bl.ASTElseClause}});Object.defineProperty(Y,"ASTIfClause",{enumerable:!0,get:function(){return bl.ASTIfClause}});Object.defineProperty(Y,"ASTIfStatement",{enumerable:!0,get:function(){return bl.ASTIfStatement}});var IR=Tg();Object.defineProperty(Y,"ASTIsaExpression",{enumerable:!0,get:function(){return IR.ASTIsaExpression}});var Dx=xg();Object.defineProperty(Y,"ASTListConstructorExpression",{enumerable:!0,get:function(){return Dx.ASTListConstructorExpression}});Object.defineProperty(Y,"ASTListValue",{enumerable:!0,get:function(){return Dx.ASTListValue}});var _a=Rg();Object.defineProperty(Y,"ASTBooleanLiteral",{enumerable:!0,get:function(){return _a.ASTBooleanLiteral}});Object.defineProperty(Y,"ASTLiteral",{enumerable:!0,get:function(){return _a.ASTLiteral}});Object.defineProperty(Y,"ASTNilLiteral",{enumerable:!0,get:function(){return _a.ASTNilLiteral}});Object.defineProperty(Y,"ASTNumericLiteral",{enumerable:!0,get:function(){return _a.ASTNumericLiteral}});Object.defineProperty(Y,"ASTStringLiteral",{enumerable:!0,get:function(){return _a.ASTStringLiteral}});var MR=Dg();Object.defineProperty(Y,"ASTLogicalExpression",{enumerable:!0,get:function(){return MR.ASTLogicalExpression}});var Ix=Lg();Object.defineProperty(Y,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return Ix.ASTMapConstructorExpression}});Object.defineProperty(Y,"ASTMapKeyString",{enumerable:!0,get:function(){return Ix.ASTMapKeyString}});var LR=qg();Object.defineProperty(Y,"ASTParenthesisExpression",{enumerable:!0,get:function(){return LR.ASTParenthesisExpression}});var NR=Fg();Object.defineProperty(Y,"ASTReturnStatement",{enumerable:!0,get:function(){return NR.ASTReturnStatement}});var qR=Bg();Object.defineProperty(Y,"ASTSliceExpression",{enumerable:!0,get:function(){return qR.ASTSliceExpression}});var jR=Wg();Object.defineProperty(Y,"ASTUnaryExpression",{enumerable:!0,get:function(){return jR.ASTUnaryExpression}});var FR=Kg();Object.defineProperty(Y,"ASTWhileStatement",{enumerable:!0,get:function(){return FR.ASTWhileStatement}})});var Zg=g(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});var mi=fi(),Jg=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([mi.TokenType.StringLiteral,mi.TokenType.NumericLiteral,mi.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([mi.TokenType.StringLiteral,mi.TokenType.NumericLiteral,mi.TokenType.BooleanLiteral,mi.TokenType.NilLiteral]))}isComment(e){return e===mi.TokenType.Comment}};Qg.default=Jg});var tm=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=fi(),tr=Vs(),Te=Xs(),$R;(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"})($R=ue.SelectorType||(ue.SelectorType={}));var em=class{};ue.createSelectorOptions=em;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 BR(t){return t.data.value}ue.getSelectorValue=BR;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:tr.Keyword.Function}),EndFunction:ae({type:le.TokenType.Keyword,value:tr.Keyword.EndFunction}),EndWhile:ae({type:le.TokenType.Keyword,value:tr.Keyword.EndWhile}),EndFor:ae({type:le.TokenType.Keyword,value:tr.Keyword.EndFor}),EndIf:ae({type:le.TokenType.Keyword,value:tr.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:tr.Keyword.ElseIf}),Then:ae({type:le.TokenType.Keyword,value:tr.Keyword.Then}),Else:ae({type:le.TokenType.Keyword,value:tr.Keyword.Else}),In:ae({type:le.TokenType.Keyword,value:tr.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:tr.Keyword.New}),Not:ae({type:le.TokenType.Keyword,value:tr.Keyword.Not}),Comment:ae({type:le.TokenType.Comment})};function gr(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
- `),s=e.filter(a=>a.data.value===void 0).map(a=>`case '${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})}};bh.ASTWhileStatement=Ry});var Ly=m(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.ASTWhileStatement=J.ASTUnaryExpression=J.ASTSliceExpression=J.ASTReturnStatement=J.ASTParenthesisExpression=J.ASTMapKeyString=J.ASTMapConstructorExpression=J.ASTLogicalExpression=J.ASTStringLiteral=J.ASTNumericLiteral=J.ASTNilLiteral=J.ASTLiteral=J.ASTBooleanLiteral=J.ASTListValue=J.ASTListConstructorExpression=J.ASTIsaExpression=J.ASTIfStatement=J.ASTIfClause=J.ASTElseClause=J.ASTClause=J.ASTMemberExpression=J.ASTIndexExpression=J.ASTIdentifier=J.ASTFunctionStatement=J.ASTForGenericStatement=J.ASTComparisonGroupExpression=J.ASTChunk=J.ASTCallStatement=J.ASTCallExpression=J.ASTBinaryExpression=J.ASTType=J.ASTComment=J.ASTBaseBlockWithScope=J.ASTBaseBlock=J.ASTBase=J.ASTAssignmentStatement=J.ASTProvider=void 0;var vh=Ls(),qI=qm(),Rt=pt(),jI=Fm(),Hx=Um(),FI=Hm(),$I=zm(),BI=Vm(),UI=Ym(),Dy=ey(),js=sy(),WI=oy(),Gx=ly(),_h=gy(),HI=yy(),zx=_y(),GI=Sy(),zI=wy(),KI=Ey(),VI=Cy(),XI=Py(),Iy=class{breakStatement(e){return new Rt.ASTBase(Rt.ASTType.BreakStatement,e)}continueStatement(e){return new Rt.ASTBase(Rt.ASTType.ContinueStatement,e)}returnStatement(e){return new zI.ASTReturnStatement(e)}ifShortcutStatement(e){return new js.ASTIfStatement(Rt.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new js.ASTIfClause(Rt.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new js.ASTIfClause(Rt.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new js.ASTElseClause(Rt.ASTType.ElseShortcutClause,e)}ifStatement(e){return new js.ASTIfStatement(Rt.ASTType.IfStatement,e)}ifClause(e){return new js.ASTIfClause(Rt.ASTType.IfClause,e)}elseifClause(e){return new js.ASTIfClause(Rt.ASTType.ElseifClause,e)}elseClause(e){return new js.ASTElseClause(Rt.ASTType.ElseClause,e)}whileStatement(e){return new XI.ASTWhileStatement(e)}assignmentStatement(e){return new qI.ASTAssignmentStatement(e)}callStatement(e){return new Hx.ASTCallStatement(e)}functionStatement(e){return new UI.ASTFunctionStatement(e)}forGenericStatement(e){return new BI.ASTForGenericStatement(e)}chunk(e){return new FI.ASTChunk(e)}identifier(e){return new Dy.ASTIdentifier(e)}literal(e,n){switch(e){case vh.TokenType.StringLiteral:return new _h.ASTStringLiteral(n);case vh.TokenType.NumericLiteral:return new _h.ASTNumericLiteral(n);case vh.TokenType.BooleanLiteral:return new _h.ASTBooleanLiteral(n);case vh.TokenType.NilLiteral:return new _h.ASTNilLiteral(n)}}memberExpression(e){return new Dy.ASTMemberExpression(e)}callExpression(e){return new Hx.ASTCallExpression(e)}comment(e){return new Rt.ASTComment(e)}unaryExpression(e){return new VI.ASTUnaryExpression(e)}mapKeyString(e){return new zx.ASTMapKeyString(e)}mapConstructorExpression(e){return new zx.ASTMapConstructorExpression(e)}listValue(e){return new Gx.ASTListValue(e)}listConstructorExpression(e){return new Gx.ASTListConstructorExpression(e)}unknown(e){return new Rt.ASTBase(Rt.ASTType.Unknown,e)}emptyExpression(e){return new Rt.ASTBase(Rt.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new Rt.ASTBase(Rt.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new Dy.ASTIndexExpression(e)}logicalExpression(e){return new HI.ASTLogicalExpression(e)}isaExpression(e){return new WI.ASTIsaExpression(e)}binaryExpression(e){return new jI.ASTBinaryExpression(e)}sliceExpression(e){return new KI.ASTSliceExpression(e)}parenthesisExpression(e){return new GI.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new $I.ASTComparisonGroupExpression(e)}};J.ASTProvider=Iy;var YI=qm();Object.defineProperty(J,"ASTAssignmentStatement",{enumerable:!0,get:function(){return YI.ASTAssignmentStatement}});var eu=pt();Object.defineProperty(J,"ASTBase",{enumerable:!0,get:function(){return eu.ASTBase}});Object.defineProperty(J,"ASTBaseBlock",{enumerable:!0,get:function(){return eu.ASTBaseBlock}});Object.defineProperty(J,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return eu.ASTBaseBlockWithScope}});Object.defineProperty(J,"ASTComment",{enumerable:!0,get:function(){return eu.ASTComment}});Object.defineProperty(J,"ASTType",{enumerable:!0,get:function(){return eu.ASTType}});var JI=Fm();Object.defineProperty(J,"ASTBinaryExpression",{enumerable:!0,get:function(){return JI.ASTBinaryExpression}});var Kx=Um();Object.defineProperty(J,"ASTCallExpression",{enumerable:!0,get:function(){return Kx.ASTCallExpression}});Object.defineProperty(J,"ASTCallStatement",{enumerable:!0,get:function(){return Kx.ASTCallStatement}});var QI=Hm();Object.defineProperty(J,"ASTChunk",{enumerable:!0,get:function(){return QI.ASTChunk}});var ZI=zm();Object.defineProperty(J,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return ZI.ASTComparisonGroupExpression}});var eM=Vm();Object.defineProperty(J,"ASTForGenericStatement",{enumerable:!0,get:function(){return eM.ASTForGenericStatement}});var tM=Ym();Object.defineProperty(J,"ASTFunctionStatement",{enumerable:!0,get:function(){return tM.ASTFunctionStatement}});var My=ey();Object.defineProperty(J,"ASTIdentifier",{enumerable:!0,get:function(){return My.ASTIdentifier}});Object.defineProperty(J,"ASTIndexExpression",{enumerable:!0,get:function(){return My.ASTIndexExpression}});Object.defineProperty(J,"ASTMemberExpression",{enumerable:!0,get:function(){return My.ASTMemberExpression}});var Th=sy();Object.defineProperty(J,"ASTClause",{enumerable:!0,get:function(){return Th.ASTClause}});Object.defineProperty(J,"ASTElseClause",{enumerable:!0,get:function(){return Th.ASTElseClause}});Object.defineProperty(J,"ASTIfClause",{enumerable:!0,get:function(){return Th.ASTIfClause}});Object.defineProperty(J,"ASTIfStatement",{enumerable:!0,get:function(){return Th.ASTIfStatement}});var nM=oy();Object.defineProperty(J,"ASTIsaExpression",{enumerable:!0,get:function(){return nM.ASTIsaExpression}});var Vx=ly();Object.defineProperty(J,"ASTListConstructorExpression",{enumerable:!0,get:function(){return Vx.ASTListConstructorExpression}});Object.defineProperty(J,"ASTListValue",{enumerable:!0,get:function(){return Vx.ASTListValue}});var tu=gy();Object.defineProperty(J,"ASTBooleanLiteral",{enumerable:!0,get:function(){return tu.ASTBooleanLiteral}});Object.defineProperty(J,"ASTLiteral",{enumerable:!0,get:function(){return tu.ASTLiteral}});Object.defineProperty(J,"ASTNilLiteral",{enumerable:!0,get:function(){return tu.ASTNilLiteral}});Object.defineProperty(J,"ASTNumericLiteral",{enumerable:!0,get:function(){return tu.ASTNumericLiteral}});Object.defineProperty(J,"ASTStringLiteral",{enumerable:!0,get:function(){return tu.ASTStringLiteral}});var rM=yy();Object.defineProperty(J,"ASTLogicalExpression",{enumerable:!0,get:function(){return rM.ASTLogicalExpression}});var Xx=_y();Object.defineProperty(J,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return Xx.ASTMapConstructorExpression}});Object.defineProperty(J,"ASTMapKeyString",{enumerable:!0,get:function(){return Xx.ASTMapKeyString}});var sM=Sy();Object.defineProperty(J,"ASTParenthesisExpression",{enumerable:!0,get:function(){return sM.ASTParenthesisExpression}});var iM=wy();Object.defineProperty(J,"ASTReturnStatement",{enumerable:!0,get:function(){return iM.ASTReturnStatement}});var oM=Ey();Object.defineProperty(J,"ASTSliceExpression",{enumerable:!0,get:function(){return oM.ASTSliceExpression}});var aM=Cy();Object.defineProperty(J,"ASTUnaryExpression",{enumerable:!0,get:function(){return aM.ASTUnaryExpression}});var uM=Py();Object.defineProperty(J,"ASTWhileStatement",{enumerable:!0,get:function(){return uM.ASTWhileStatement}})});var jy=m(qy=>{"use strict";Object.defineProperty(qy,"__esModule",{value:!0});var Fs=Ls(),Ny=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([Fs.TokenType.StringLiteral,Fs.TokenType.NumericLiteral,Fs.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([Fs.TokenType.StringLiteral,Fs.TokenType.NumericLiteral,Fs.TokenType.BooleanLiteral,Fs.TokenType.NilLiteral]))}isComment(e){return e===Fs.TokenType.Comment}};qy.default=Ny});var $y=m(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.SelectorGroups=he.SelectorGroupType=he.getSelectorsFromGroup=he.createSelectorGroup=he.Selectors=he.getSelectorValue=he.createSelector=he.createSelectorOptions=he.SelectorType=void 0;var fe=Ls(),yr=wo(),Se=Eo(),lM;(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"})(lM=he.SelectorType||(he.SelectorType={}));var Fy=class{};he.createSelectorOptions=Fy;function ce(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}he.createSelector=ce;function cM(t){return t.data.value}he.getSelectorValue=cM;he.Selectors={EndOfLine:ce({type:fe.TokenType.EOL,value:Se.Operator.EndOfLine}),EndOfFile:ce({type:fe.TokenType.EOF,value:Se.Operator.EndOfFile}),LParenthesis:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LParenthesis}),RParenthesis:ce({type:fe.TokenType.Punctuator,value:Se.Operator.RParenthesis}),CLBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.CLBracket}),CRBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.CRBracket}),SLBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SLBracket}),SRBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SRBracket}),Assign:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Assign}),AddShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.AddShorthand}),SubtractShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SubtractShorthand}),MultiplyShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.MultiplyShorthand}),DivideShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.DivideShorthand}),PowerShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.PowerShorthand}),ModuloShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.ModuloShorthand}),Seperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),Function:ce({type:fe.TokenType.Keyword,value:yr.Keyword.Function}),EndFunction:ce({type:fe.TokenType.Keyword,value:yr.Keyword.EndFunction}),EndWhile:ce({type:fe.TokenType.Keyword,value:yr.Keyword.EndWhile}),EndFor:ce({type:fe.TokenType.Keyword,value:yr.Keyword.EndFor}),EndIf:ce({type:fe.TokenType.Keyword,value:yr.Keyword.EndIf}),SliceSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),MapKeyValueSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),MapSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ListSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),CallSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ArgumentSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ImportCodeSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),ElseIf:ce({type:fe.TokenType.Keyword,value:yr.Keyword.ElseIf}),Then:ce({type:fe.TokenType.Keyword,value:yr.Keyword.Then}),Else:ce({type:fe.TokenType.Keyword,value:yr.Keyword.Else}),In:ce({type:fe.TokenType.Keyword,value:yr.Keyword.In}),MemberSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Member}),NumberSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Member}),Reference:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Reference}),Isa:ce({type:fe.TokenType.Keyword,value:Se.Operator.Isa}),Or:ce({type:fe.TokenType.Keyword,value:Se.Operator.Or}),And:ce({type:fe.TokenType.Keyword,value:Se.Operator.And}),Minus:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Minus}),Plus:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Plus}),Times:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Asterik}),Power:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Power}),Divide:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Slash}),Mod:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Modulo}),Equal:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Equal}),NotEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.NotEqual}),Greater:ce({type:fe.TokenType.Punctuator,value:Se.Operator.GreaterThan}),GreaterEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.GreaterThanOrEqual}),Lesser:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LessThan}),LessEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LessThanOrEqual}),New:ce({type:fe.TokenType.Keyword,value:yr.Keyword.New}),Not:ce({type:fe.TokenType.Keyword,value:yr.Keyword.Not}),Comment:ce({type:fe.TokenType.Comment})};function Mr(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
+ `),i=e.filter(a=>a.data.value===void 0).map(a=>`case '${a.data.type}':`).join(`
88
88
  `),o=new Function("token",`
89
- ${s.length>0?`switch(token.type) {
90
- ${s}
89
+ ${i.length>0?`switch(token.type) {
90
+ ${i}
91
91
  return true;
92
92
  }`:""}
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}ue.createSelectorGroup=gr;function UR(t){return t.selectors}ue.getSelectorsFromGroup=UR;var mr;(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"})(mr=ue.SelectorGroupType||(ue.SelectorGroupType={}));ue.SelectorGroups={BlockEndOfLine:gr(mr.AssignmentEndOfExpr,[ue.Selectors.EndOfLine,ue.Selectors.Comment]),AssignmentEndOfExpr:gr(mr.AssignmentEndOfExpr,[ue.Selectors.EndOfFile,ue.Selectors.EndOfLine,ue.Selectors.Else,ue.Selectors.Comment]),AssignmentShorthand:gr(mr.AssignmentShorthand,[ue.Selectors.AddShorthand,ue.Selectors.SubtractShorthand,ue.Selectors.MultiplyShorthand,ue.Selectors.DivideShorthand,ue.Selectors.PowerShorthand,ue.Selectors.ModuloShorthand]),AssignmentCommandArgs:gr(mr.AssignmentCommandArgs,[ue.Selectors.ArgumentSeperator,ue.Selectors.EndOfLine,ue.Selectors.EndOfFile]),ReturnStatementEnd:gr(mr.ReturnStatementEnd,[ue.Selectors.EndOfLine,ue.Selectors.Else,ue.Selectors.Comment]),FunctionDeclarationArgEnd:gr(mr.FunctionDeclarationArgEnd,[ue.Selectors.RParenthesis,ue.Selectors.EndOfFile,ue.Selectors.EndOfLine]),ComparisonOperators:gr(mr.ComparisonOperators,[ue.Selectors.Equal,ue.Selectors.NotEqual,ue.Selectors.Greater,ue.Selectors.GreaterEqual,ue.Selectors.Lesser,ue.Selectors.LessEqual]),MultiDivOperators:gr(mr.MultiDivOperators,[ue.Selectors.Times,ue.Selectors.Divide,ue.Selectors.Mod]),CallArgsEnd:gr(mr.CallArgsEnd,[ue.Selectors.ArgumentSeperator,ue.Selectors.RParenthesis])}});var rm=g(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.Stack=void 0;var nm=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}};vl.Stack=nm});var cm=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 nr;(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"})(nr=Je.PendingBlockType||(Je.PendingBlockType={}));var Vi=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 HR(t){return t.type===nr.Chunk}Je.isPendingChunk=HR;var im=class extends Vi{constructor(e){super(e,nr.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=im;function WR(t){return t.type===nr.For}Je.isPendingFor=WR;var sm=class extends Vi{constructor(e){super(e,nr.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=sm;function GR(t){return t.type===nr.Function}Je.isPendingFunction=GR;var om=class extends Vi{constructor(e){super(e,nr.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=om;function KR(t){return t.type===nr.If}Je.isPendingIf=KR;var am=class extends Vi{constructor(e,n){super(e,nr.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=am;function VR(t){return t.type===nr.While}Je.isPendingWhile=VR;var um=class extends Vi{constructor(e){super(e,nr.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=um});var Lx=g(Ta=>{"use strict";var Mx=Ta&&Ta.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ta,"__esModule",{value:!0});var zR=Mx(zh()),yi=fi(),yr=Yg(),XR=Mx(Zg()),YR=Xc(),$t=Vs(),Fr=Xs(),Zt=ha(),J=tm(),JR=rm(),br=cm(),lm=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new JR.Stack,r.statementErrors=[],r.lexer=n.lexer||new zR.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 XR.default,r.astProvider=n.astProvider||new yr.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 Zt.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 Zt.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 Zt.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!==yi.TokenType.EOL&&e.token.type!==yi.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,br.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new Zt.Range(n.block.start,n.block.start));if(n.complete(e.previousToken),e.errors.push(r),!e.unsafe)throw r;n=e.backpatches.pop()}}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunk({start:n,end:null,range:[e.token.range[0],null]}),i=new br.PendingChunk(r);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(yi.TokenType.Keyword===e.token.type&&$t.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 $t.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 $t.Keyword.If:{e.next(),e.parseIfStatement();return}case $t.Keyword.ElseIf:{e.next(),e.nextIfClause(yr.ASTType.ElseifClause);return}case $t.Keyword.Else:{e.next(),e.nextIfClause(yr.ASTType.ElseClause);return}case $t.Keyword.While:{e.next(),e.parseWhileStatement();return}case $t.Keyword.For:{e.next(),e.parseForStatement();return}case $t.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case $t.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case $t.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case $t.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case $t.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 $t.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 Zt.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(yi.TokenType.Keyword===e.token.type&&$t.Keyword.Not!==e.token.value)switch(e.token.value){case $t.Keyword.Return:return e.next(),e.parseReturnStatement();case $t.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});case $t.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 Zt.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===yr.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===yr.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 br.PendingIf(i,s);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,br.isPendingIf)(r)){n.raise("no matching open if block",new Zt.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case yr.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 yr.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 Zt.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 br.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,br.isPendingWhile)(n)){e.raise("no matching open while block",new Zt.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(yi.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 Zt.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 br.PendingFor(u);e.backpatches.push(c)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,br.isPendingFor)(n)){e.raise("no matching open for block",new Zt.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 yr.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 Zt.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 Zt.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(J.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new br.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,br.isPendingFunction)(n)){e.raise("no matching open function block",new Zt.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:Fr.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:Fr.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:Fr.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:Fr.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 yr.ASTNumericLiteral||s instanceof yr.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:Fr.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:Fr.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:Fr.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:Fr.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:Fr.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(yi.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(yi.TokenType.Identifier)?r.parseIdentifier():(r.raise(`got ${r.token} where number, string, or identifier is required`,new Zt.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(yi.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 YR.ParserException(e,n);return r.statementErrors.push(i),i}};Ta.default=lm});var Oe=g(qe=>{"use strict";var QR=qe&&qe.__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]}),rr=qe&&qe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&QR(e,t,n)},_l=qe&&qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qe,"__esModule",{value:!0});qe.ASTRange=qe.ASTPosition=qe.ParserValidatorm=qe.Parser=qe.LexerValidator=qe.Lexer=void 0;var ZR=zh();Object.defineProperty(qe,"Lexer",{enumerable:!0,get:function(){return _l(ZR).default}});rr(fi(),qe);var eP=jh();Object.defineProperty(qe,"LexerValidator",{enumerable:!0,get:function(){return _l(eP).default}});var tP=Lx();Object.defineProperty(qe,"Parser",{enumerable:!0,get:function(){return _l(tP).default}});rr(Yg(),qe);var nP=Zg();Object.defineProperty(qe,"ParserValidatorm",{enumerable:!0,get:function(){return _l(nP).default}});rr(cm(),qe);rr(rm(),qe);rr(Gh(),qe);rr(zc(),qe);rr(Xc(),qe);rr(Vs(),qe);rr(Bh(),qe);rr(Xs(),qe);var rP=ua();Object.defineProperty(qe,"ASTPosition",{enumerable:!0,get:function(){return rP.Position}});var iP=ha();Object.defineProperty(qe,"ASTRange",{enumerable:!0,get:function(){return iP.Range}});rr(tm(),qe)});var Sa=g(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.isValidIdentifierLiteral=void 0;var sP=Oe(),oP=t=>{if(t.type!==sP.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};Tl.isValidIdentifierLiteral=oP});var dm=g(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.getStringHashCode=bi.getHashCode=bi.rotateBits=void 0;function aP(t){return t>>1|t<<31}bi.rotateBits=aP;function uP(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}bi.getHashCode=uP;bi.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 Nx=g(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.createExpressionHash=void 0;var ze=Oe(),bt=dm(),cP=Sa(),Bt=(t,e)=>t.$$hash=e,lP=t=>t.$$hash??null;function st(t){let e=lP(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),Bt(t,n)}case ze.ASTType.LogicalExpression:{let r=t;return n^=(0,bt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Bt(t,n)}case ze.ASTType.IsaExpression:{let r=t;return n^=(0,bt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Bt(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 Bt(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 Bt(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),Bt(t,n)}return n^=st(r.base),n^=st(r.identifier),Bt(t,n)}case ze.ASTType.IndexExpression:{let r=t;if((0,cP.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()),Bt(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 Bt(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 Bt(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),Bt(t,n)}case ze.ASTType.Identifier:{let r=t;return n^=(0,bt.getStringHashCode)(r.name),Bt(t,n)}case ze.ASTType.NumericLiteral:case ze.ASTType.StringLiteral:case ze.ASTType.NilLiteral:return n^=(0,bt.getStringHashCode)(t.value.toString()),Bt(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 Bt(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 Bt(t,n)}case ze.ASTType.SliceExpression:{let r=t;return n^=st(r.base),n^=st(r.left),n^=st(r.right),Bt(t,n)}}return Bt(t,n)}function dP(t){return st(t)}Sl.createExpressionHash=dP});var fm=g(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.createExpressionId=void 0;var xt=Oe(),fP=Sa(),At=(t,e)=>t.$$id=e,pP=t=>t.$$id??null;function Qe(t){let e=pP(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,fP.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 hP(t){return Qe(t)}kl.createExpressionId=hP});var to=g(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.Markers=void 0;var gP;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(gP=ka.Markers||(ka.Markers={}))});var ir=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 mP(t){return/^\s+$/.test(t)}ft.isSpace=mP;function yP(t){return/\r$/.test(t)}ft.hasCR=yP;function bP(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}ft.splitCR=bP;function vP(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}ft.splitSpace=vP;function _P(t){return t.split(/\n/)}ft.splitLines=_P;function TP(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}ft.seedBlock=TP;function SP(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}ft.seedSpec=SP;function kP(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}ft.seedTokens=kP;function xP(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=xP;function wP(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=wP});var qx=g(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var EP=/^@\S+/;function AP({fence:t="```"}={}){let e=OP(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)EP.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}pm.default=AP;function OP(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var jx=g(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var CP=to(),xa=ir();function RP({startLine:t=0,markers:e=CP.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,xa.seedTokens)();if([a.lineEnd,o]=(0,xa.splitCR)(o),[a.start,o]=(0,xa.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,xa.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,xa.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}}hm.default=RP});var Fx=g(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});var PP=ir();function DP({tokenizers:t}){return function(n){var r;let i=(0,PP.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}}gm.default=DP});var ym=g(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});function IP(){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)}}mm.default=IP});var vm=g(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});var MP=ir();function LP(t="compact"){let e=qP(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,MP.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}}bm.default=LP;var NP=t=>t.trim();function qP(t){return t==="compact"?e=>e.map(NP).join(""):t==="preserve"?e=>e.join(`
97
- `):t}});var Sm=g(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var _m=ir(),jP=t=>t&&t.startsWith('"')&&t.endsWith('"');function FP(){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,_m.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,_m.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(!jP(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,_m.splitSpace)(r.slice(n.name.length)),e}}Tm.default=FP});var xm=g(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.getJoiner=void 0;var km=to();function $P(t="compact",e=km.Markers){let n=$x(t);return r=>(r.description=n(r.source,e),r)}wa.default=$P;function $x(t){return t==="compact"?BP:t==="preserve"?WP:t}wa.getJoiner=$x;function BP(t,e=km.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var UP=(t,{tokens:e},n)=>e.type===""?t:n,HP=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function WP(t,e=km.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(UP,0)),t.map(HP).join(`
98
- `)}});var Ux=g(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var GP=to(),KP=ir(),VP=qx(),zP=jx(),XP=Fx(),YP=ym(),JP=vm(),QP=Sm(),Bx=xm();function ZP({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=GP.Markers,tokenizers:i=[(0,YP.default)(),(0,JP.default)(n),(0,QP.default)(),(0,Bx.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,zP.default)({startLine:t,markers:r}),o=(0,VP.default)({fence:e}),a=(0,XP.default)({tokenizers:i}),u=(0,Bx.getJoiner)(n);return function(c){let l=[];for(let d of(0,KP.splitLines)(c)){let p=s(d);if(p===null)continue;let b=o(p),_=b.slice(1).map(a);l.push({description:u(b[0],r),tags:_,source:p,problems:_.reduce((E,L)=>E.concat(L.problems),[])})}return l}}wm.default=ZP});var Hx=g(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});function eD(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 tD(){return t=>t.source.map(({tokens:e})=>eD(e)).join(`
99
- `)}Em.default=tD});var Gx=g(Ea=>{"use strict";var nD=Ea&&Ea.__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(Ea,"__esModule",{value:!0});var Wx=to(),rD=ir(),iD={start:0,tag:0,type:0,name:0},sD=(t=Wx.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)}),zi=t=>"".padStart(t," ");function oD(t=Wx.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=zi(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=zi(n.start);break;case t.delim:s.start=zi(n.start+1);break;default:s.delimiter="",s.start=zi(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=zi(n.tag-s.tag.length+1)),a.type||(s.postType=zi(n.type-s.type.length+1)),a.name||(s.postName=zi(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=nD(i,["source"]);return n=s.reduce(sD(t),Object.assign({},iD)),(0,rD.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}Ea.default=oD});var Kx=g(Aa=>{"use strict";var aD=Aa&&Aa.__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(Aa,"__esModule",{value:!0});var uD=ir(),cD=t=>e=>e.slice(t),lD=t=>{let e="".padStart(t," ");return n=>n+e};function dD(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?lD(s):cD(-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=aD(i,["source"]);return(0,uD.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}Aa.default=dD});var Vx=g(Oa=>{"use strict";var fD=Oa&&Oa.__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(Oa,"__esModule",{value:!0});var pD=ir();function hD(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,pD.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}Oa.default=hD});var zx=g(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.flow=void 0;function gD(...t){return e=>t.reduce((n,r)=>r(n),e)}xl.flow=gD});var Qx=g(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});var mD=ir(),Yx={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},Xx={lineEnd:"CR"},Am=Object.keys(Yx),Jx=t=>(0,mD.isSpace)(t)?`{${t.length}}`:t,yD=t=>"|"+t.join("|")+"|",bD=(t,e)=>Object.keys(e).map(n=>Jx(e[n]).padEnd(t[n]));function vD({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},Yx);for(let s of Am)r[s]=((e=Xx[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 Am)i[0].push(((n=Xx[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of Am)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...bD(r,o)])}return i.map(yD).join(`
100
- `)}Om.default=vD});var Cm=g(Ot=>{"use strict";var _D=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]}),TD=Ot&&Ot.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&_D(e,t,n)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.util=Ot.tokenizers=Ot.transforms=Ot.inspect=Ot.stringify=Ot.parse=void 0;var SD=Ux(),kD=xm(),xD=Sm(),wD=ym(),ED=vm(),AD=Hx(),OD=Gx(),CD=Kx(),RD=Vx(),PD=zx(),wl=ir();TD(to(),Ot);function DD(t,e={}){return(0,SD.default)(e)(t)}Ot.parse=DD;Ot.stringify=(0,AD.default)();var ID=Qx();Object.defineProperty(Ot,"inspect",{enumerable:!0,get:function(){return ID.default}});Ot.transforms={flow:PD.flow,align:OD.default,indent:CD.default,crlf:RD.default};Ot.tokenizers={tag:wD.default,type:ED.default,name:xD.default,description:kD.default};Ot.util={rewireSpecs:wl.rewireSpecs,rewireSource:wl.rewireSource,seedBlock:wl.seedBlock,seedTokens:wl.seedTokens}});var Xi=g(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.SignatureDefinitionBaseType=void 0;var MD;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(MD=Ca.SignatureDefinitionBaseType||(Ca.SignatureDefinitionBaseType={}))});var Ra=g(no=>{"use strict";var Zx=no&&no.__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(no,"__esModule",{value:!0});no.SignatureDefinitionTypeMeta=void 0;var en=Xi(),LD=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=Zx(n,3),o=s[0],a=s[1],u=s[2];if(a===en.SignatureDefinitionBaseType.Map?(r=en.SignatureDefinitionBaseType.Any,i=en.SignatureDefinitionBaseType.Any):a===en.SignatureDefinitionBaseType.List&&(r=en.SignatureDefinitionBaseType.Any),u){var c=u.split(",").map(function(b){return b.trim()});if(c.length>2)return null;var l=Zx(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===en.SignatureDefinitionBaseType.Map?(s=en.SignatureDefinitionBaseType.Any,o=en.SignatureDefinitionBaseType.Any):i===en.SignatureDefinitionBaseType.List&&(s=en.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===en.SignatureDefinitionBaseType.Map?(s=s??en.SignatureDefinitionBaseType.Any,o=o??en.SignatureDefinitionBaseType.Any):i===en.SignatureDefinitionBaseType.List&&(s=s??en.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}();no.SignatureDefinitionTypeMeta=LD});var Rm=g(vi=>{"use strict";var ew=vi&&vi.__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},tw=vi&&vi.__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(vi,"__esModule",{value:!0});vi.SignatureDefinitionFunctionArg=void 0;var nw=Ra(),ND=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(nw.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,tw([],ew(e.types.map(nw.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 tw([],ew(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}();vi.SignatureDefinitionFunctionArg=ND});var El=g(vr=>{"use strict";var Yi=vr&&vr.__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},Ji=vr&&vr.__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))},qD=vr&&vr.__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(vr,"__esModule",{value:!0});vr.VariationRegistry=void 0;var jD=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(Ji(Ji([],Yi(e),!1),Yi(this._variations),!1)),this},t.prototype.getAll=function(){return Ji([],Yi(this._variations),!1)},t}(),FD=function(){function t(){}return t.add=function(e,n){var r=new jD(e);return r.push.apply(r,Ji([],Yi(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=qD(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(Ji(Ji([],Yi(c.getAll()),!1),Yi(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 Ji([],Yi(i),!1)},t.variationContainers=new Map,t}();vr.VariationRegistry=FD});var Al=g(_i=>{"use strict";var $D=_i&&_i.__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},BD=_i&&_i.__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(_i,"__esModule",{value:!0});_i.SignatureDefinition=void 0;var UD=El(),HD=Ra(),WD=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:HD.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 UD.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?BD([],$D(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}();_i.SignatureDefinition=WD});var Pm=g(qn=>{"use strict";var GD=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)}}(),Ol=qn&&qn.__assign||function(){return Ol=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},Ol.apply(this,arguments)},KD=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},VD=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 zD=Xi(),XD=El(),YD=Al(),JD=Rm(),rw=Ra(),QD=function(t){GD(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 rw.SignatureDefinitionTypeMeta({type:zD.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(JD.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(rw.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 VD([],KD(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=[]),XD.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Ol(Ol({},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}(YD.SignatureDefinition);qn.SignatureDefinitionFunction=QD});var sw=g((m5,iw)=>{"use strict";iw.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var Dm=g((ow,aw)=>{"use strict";var ZD=sw();aw.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:ZD(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ow.assert)}}});var Me=g((b5,uw)=>{"use strict";var eI=Dm();uw.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new eI(e)}});var Qi=g((v5,lw)=>{"use strict";var Im=Me(),cw={};lw.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);Im(!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&&cw.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){Im(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),Im(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};cw.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Mm=g((tn,fw)=>{"use strict";var dw={};tn=fw.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};dw.typeMap=new Map([["[object Error]",tn.error],["[object Map]",tn.map],["[object Promise]",tn.promise],["[object Set]",tn.set],["[object WeakMap]",tn.weakMap],["[object WeakSet]",tn.weakSet]]);tn.getInternalProto=function(t){if(Array.isArray(t))return tn.array;if(Buffer&&t instanceof Buffer)return tn.buffer;if(t instanceof Date)return tn.date;if(t instanceof RegExp)return tn.regex;if(t instanceof Error)return tn.error;let e=Object.prototype.toString.call(t);return dw.typeMap.get(e)||tn.generic}});var Lm=g(pw=>{"use strict";pw.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var nn=g((T5,hw)=>{"use strict";var tI=Qi(),xn=Mm(),nI=Lm(),$r={needsProtoHack:new Set([xn.set,xn.map,xn.weakSet,xn.weakMap])};hw.exports=$r.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=$r.clone,i=n;if(e.shallow){if(e.shallow!==!0)return $r.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=$r.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=nI.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};$r.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=tI(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return $r.clone(t,e,r)};$r.base=function(t,e,n){if(n.prototype===!1)return $r.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($r.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var gw=g((S5,rI)=>{rI.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 Cl=g(Pa=>{"use strict";var O=Rl(),me={};me.wrap=O.string().min(1).max(2).allow(!1);Pa.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()});Pa.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();Pa.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])]);Pa.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 yw=g((x5,mw)=>{"use strict";var Ti={};mw.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);Ti.isSafe(r)?e+=t[n]:e+=Ti.escapeHtmlChar(r)}return e};Ti.escapeHtmlChar=function(t){let e=Ti.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};Ti.isSafe=function(t){return Ti.safeCharCodes.has(t)};Ti.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);Ti.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 bw=g(Da=>{"use strict";var Re={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};Da.Parser=class{constructor(t,e={}){if(!e[Re.settings]&&e.constants)for(let n in e.constants){let r=e.constants[n];if(r!==null&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${n} contains invalid ${typeof r} value type`)}this.settings=e[Re.settings]?e:Object.assign({[Re.settings]:!0,constants:{},functions:{}},e),this.single=null,this._parts=null,this._parse(t)}_parse(t){let e=[],n="",r=0,i=!1,s=a=>{if(r)throw new Error("Formula missing closing parenthesis");let u=e.length?e[e.length-1]:null;if(!(!i&&!n&&!a)){if(u&&u.type==="reference"&&a===")"){u.type="function",u.value=this._subFormula(n,u.value),n="";return}if(a===")"){let c=new Da.Parser(n,this.settings);e.push({type:"segment",value:c})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(Re.operatorCharacters.includes(n))u&&u.type==="operator"&&Re.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Re.numberRx))e.push({type:"constant",value:parseFloat(n)});else if(this.settings.constants[n]!==void 0)e.push({type:"constant",value:this.settings.constants[n]});else{if(!n.match(Re.tokenRx))throw new Error(`Formula contains invalid token: ${n}`);e.push({type:"reference",value:n})}n=""}};for(let a of t)i?a===i?(s(),i=!1):n+=a:r?a==="("?(n+=a,++r):a===")"?(--r,r?n+=a:s(a)):n+=a:a in Re.literals?i=Re.literals[a]:a==="("?(s(),++r):Re.operatorCharacters.includes(a)?(s(),n=a,s()):a!==" "?n+=a:s();s(),e=e.map((a,u)=>a.type!=="operator"||a.value!=="-"||u&&e[u-1].type!=="operator"?a:{type:"operator",value:"n"});let o=!1;for(let a of e){if(a.type==="operator"){if(Re.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Re.operators.includes(a.value))throw new Error(`Formula contains an unknown operator ${a.value}`)}else if(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");e.length===1&&["reference","literal","constant"].includes(e[0].type)&&(this.single={type:e[0].type==="reference"?"reference":"value",value:e[0].value}),this._parts=e.map(a=>{if(a.type==="operator")return Re.operatorsPrefix.includes(a.value)?a:a.value;if(a.type!=="reference")return a.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(a.value))throw new Error(`Formula contains invalid reference ${a.value}`);return this.settings.reference?this.settings.reference(a.value):Re.reference(a.value)})}_subFormula(t,e){let n=this.settings.functions[e];if(typeof n!="function")throw new Error(`Formula contains unknown function ${e}`);let r=[];if(t){let i="",s=0,o=!1,a=()=>{if(!i)throw new Error(`Formula contains function ${e} with invalid arguments ${t}`);r.push(i),i=""};for(let u=0;u<t.length;++u){let c=t[u];o?(i+=c,c===o&&(o=!1)):c in Re.literals&&!s?(i+=c,o=Re.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new Da.Parser(i,this.settings)),function(i){let s=[];for(let o of r)s.push(o.evaluate(i));return n.call(i,...s)}}evaluate(t){let e=this._parts.slice();for(let n=e.length-2;n>=0;--n){let r=e[n];if(r&&r.type==="operator"){let i=e[n+1];e.splice(n+1,1);let s=Re.evaluate(i,t);e[n]=Re.single(r.value,s)}}return Re.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Re.evaluate(e[r-1],t),o=Re.evaluate(e[r+1],t);e.splice(r,2);let a=Re.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Re.evaluate(e[0],t)}};Da.Parser.prototype[Re.symbol]=!0;Re.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Re.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Re.symbol]?t.evaluate(e):t};Re.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Re.calculate=function(t,e,n){if(t==="??")return Re.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Re.exists(e)?e:"",n=Re.exists(n)?n:"",e+n}else switch(t){case"^":return Math.pow(e,n);case"*":return e*n;case"/":return e/n;case"%":return e%n;case"+":return e+n;case"-":return e-n}switch(t){case"<":return e<n;case"<=":return e<=n;case">":return e>n;case">=":return e>=n;case"==":return e===n;case"!=":return e!==n;case"&&":return e&&n;case"||":return e||n}return null};Re.exists=function(t){return t!=null}});var _w=g(vw=>{"use strict";var iI=nn(),sI=Ze(),Zi={annotations:Symbol("annotations")};vw.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=iI(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 b=l[p];if(sI.isSchema(d)&&(d=d.clone()),p+1<l.length&&typeof d[b]!="string")d=d[b];else{let _=d[Zi.annotations]||{errors:{},missing:{}};d[Zi.annotations]=_;let E=b||c.context.key;d[b]!==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=Zi.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
- ${c} ${e}[${u}]${r}`).replace(s.specials,(a,u)=>u);o=`${o}
96
+ return false;`);return Object.defineProperty(o,"name",{value:`selector_group_${t}`,writable:!1}),o.selectors=e,o}he.createSelectorGroup=Mr;function hM(t){return t.selectors}he.getSelectorsFromGroup=hM;var Lr;(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"})(Lr=he.SelectorGroupType||(he.SelectorGroupType={}));he.SelectorGroups={BlockEndOfLine:Mr(Lr.AssignmentEndOfExpr,[he.Selectors.EndOfLine,he.Selectors.Comment]),AssignmentEndOfExpr:Mr(Lr.AssignmentEndOfExpr,[he.Selectors.EndOfFile,he.Selectors.EndOfLine,he.Selectors.Else,he.Selectors.Comment]),AssignmentShorthand:Mr(Lr.AssignmentShorthand,[he.Selectors.AddShorthand,he.Selectors.SubtractShorthand,he.Selectors.MultiplyShorthand,he.Selectors.DivideShorthand,he.Selectors.PowerShorthand,he.Selectors.ModuloShorthand]),AssignmentCommandArgs:Mr(Lr.AssignmentCommandArgs,[he.Selectors.ArgumentSeperator,he.Selectors.EndOfLine,he.Selectors.EndOfFile]),ReturnStatementEnd:Mr(Lr.ReturnStatementEnd,[he.Selectors.EndOfLine,he.Selectors.Else,he.Selectors.Comment]),FunctionDeclarationArgEnd:Mr(Lr.FunctionDeclarationArgEnd,[he.Selectors.RParenthesis,he.Selectors.EndOfFile,he.Selectors.EndOfLine]),ComparisonOperators:Mr(Lr.ComparisonOperators,[he.Selectors.Equal,he.Selectors.NotEqual,he.Selectors.Greater,he.Selectors.GreaterEqual,he.Selectors.Lesser,he.Selectors.LessEqual]),MultiDivOperators:Mr(Lr.MultiDivOperators,[he.Selectors.Times,he.Selectors.Divide,he.Selectors.Mod]),CallArgsEnd:Mr(Lr.CallArgsEnd,[he.Selectors.ArgumentSeperator,he.Selectors.RParenthesis])}});var Uy=m(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.Stack=void 0;var By=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}};Sh.Stack=By});var Vy=m(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.PendingWhile=et.isPendingWhile=et.PendingIf=et.isPendingIf=et.PendingFunction=et.isPendingFunction=et.PendingFor=et.isPendingFor=et.PendingChunk=et.isPendingChunk=et.PendingBlockType=void 0;var br;(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"})(br=et.PendingBlockType||(et.PendingBlockType={}));var _i=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 fM(t){return t.type===br.Chunk}et.isPendingChunk=fM;var Wy=class extends _i{constructor(e){super(e,br.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)}};et.PendingChunk=Wy;function dM(t){return t.type===br.For}et.isPendingFor=dM;var Hy=class extends _i{constructor(e){super(e,br.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)}};et.PendingFor=Hy;function pM(t){return t.type===br.Function}et.isPendingFunction=pM;var Gy=class extends _i{constructor(e){super(e,br.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)}};et.PendingFunction=Gy;function gM(t){return t.type===br.If}et.isPendingIf=gM;var zy=class extends _i{constructor(e,n){super(e,br.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)}};et.PendingIf=zy;function mM(t){return t.type===br.While}et.isPendingWhile=mM;var Ky=class extends _i{constructor(e){super(e,br.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)}};et.PendingWhile=Ky});var Jx=m(nu=>{"use strict";var Yx=nu&&nu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nu,"__esModule",{value:!0});var yM=Yx(Im()),$s=Ls(),Nr=Ly(),bM=Yx(jy()),vM=Qc(),Vt=wo(),os=Eo(),cn=Xa(),Q=$y(),_M=Uy(),qr=Vy(),Xy=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new _M.Stack,r.statementErrors=[],r.lexer=n.lexer||new yM.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 bM.default,r.astProvider=n.astProvider||new Nr.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 cn.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,Q.getSelectorValue)(e)}" is required`,new cn.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,Q.getSelectorsFromGroup)(e).map(s=>`"${(0,Q.getSelectorValue)(s)}"`).join(", ")} is required`,new cn.Range(n||r.start,r.end)),null)}addItemToLines(e){let n=this.lines,r=e.end.line;for(let s=e.start.line;s<=r;s++){let i=n[s];i?i.push(e):n[s]=[e]}}skipNewlines(){let e=this,n=0;for(;;){if(Q.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(Q.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!==$s.TokenType.EOL&&e.token.type!==$s.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,qr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new cn.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]}),s=new qr.PendingChunk(r);for(e.backpatches.setDefault(s),e.pushScope(r);!Q.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Q.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();return e.finishRemaingScopes(),e.popScope(),s.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lines,r}parseStatement(){let e=this;if($s.TokenType.Keyword===e.token.type&&Vt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Vt.Keyword.Return:{let r=e.backpatches.peek();e.next();let s=e.parseReturnStatement();s.end!==null&&e.addItemToLines(s),r.body.push(s);return}case Vt.Keyword.If:{e.next(),e.parseIfStatement();return}case Vt.Keyword.ElseIf:{e.next(),e.nextIfClause(Nr.ASTType.ElseifClause);return}case Vt.Keyword.Else:{e.next(),e.nextIfClause(Nr.ASTType.ElseClause);return}case Vt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Vt.Keyword.For:{e.next(),e.parseForStatement();return}case Vt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Vt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Vt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Vt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Vt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let s=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(s),r.body.push(s);return}case Vt.Keyword.Break:{let r=e.backpatches.peek();e.next();let s=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(s),r.body.push(s);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new cn.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if($s.TokenType.Keyword===e.token.type&&Vt.Keyword.Not!==e.token.value)switch(e.token.value){case Vt.Keyword.Return:return e.next(),e.parseReturnStatement();case Vt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});case Vt.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 cn.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token,s=e.parseExpr(null,!0,!0);if(Q.SelectorGroups.AssignmentEndOfExpr(e.token))return s;if(Q.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:s,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===Nr.ASTType.FunctionDeclaration){let u=e.backpatches.peek();u.onComplete=l=>{o.end=l.block.end,o.range[1]=l.block.range[1]}}return e.currentAssignment=a,n.assignments.push(o),o}else if(Q.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:s,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let l=e.token,c=o.value.charAt(0),h=e.parseExpr(a),f=e.astProvider.parenthesisExpression({start:h.start,end:h.end,range:h.range,expression:h});return a.init=e.astProvider.binaryExpression({operator:c,left:s.clone(),right:f,start:l.start,end:e.previousToken.end,range:[l.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 i=[];for(;!Q.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(i.push(o),Q.SelectorGroups.BlockEndOfLine(e.token)||Q.Selectors.Else(e.token))break;if(Q.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(Q.SelectorGroups.AssignmentCommandArgs,r.start);if(Q.Selectors.EndOfLine(a)||Q.Selectors.EndOfFile(a))break}return i.length===0?e.astProvider.callStatement({expression:s,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:s,arguments:i,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,s=null,i=e.astProvider.returnStatement({argument:null,start:r.start,end:null,range:[r.range[0],null],scope:n});if(Q.SelectorGroups.ReturnStatementEnd(e.token))i.end=e.previousToken.end,i.range[1]=e.previousToken.range[1];else{if(s=e.parseExpr(i),i.end=e.previousToken.end,i.range[1]=e.previousToken.range[1],s.type===Nr.ASTType.FunctionDeclaration){let o=e.backpatches.peek();o.onComplete=a=>{i.end=a.block.end,i.range[1]=a.block.range[1]}}i.argument=s}return n.returns.push(i),i}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.addItemToLines(r),e.requireToken(Q.Selectors.Then,n.start),!Q.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let s=e.astProvider.ifStatement({clauses:[],start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),i=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 qr.PendingIf(s,i);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,qr.isPendingIf)(r)){n.raise("no matching open if block",new cn.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case Nr.ASTType.ElseifClause:{let s=n.token,i=n.parseExpr(null);n.requireToken(Q.Selectors.Then,s.start),r.currentClause=n.astProvider.elseifClause({condition:i,start:s.start,end:null,range:[s.range[0],null],scope:n.currentScope});break}case Nr.ASTType.ElseClause:{let s=n.token;r.currentClause=n.astProvider.elseClause({start:s.start,end:null,range:[s.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,s=[],i=r.backpatches.peek(),o=r.astProvider.ifShortcutStatement({clauses:s,start:n.start,end:null,range:[n.range[0],null],scope:r.currentScope}),a=r.parseShortcutStatement();if(s.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})),Q.Selectors.Else(r.token)){r.next();let u=r.token,l=r.parseShortcutStatement();s.push(r.astProvider.elseShortcutClause({body:[l],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),i.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new cn.Range(n.start,e.token.end));return}if(!Q.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let s=e.astProvider.whileStatement({condition:r,start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),i=new qr.PendingWhile(s);e.backpatches.push(i),i.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,qr.isPendingWhile)(n)){e.raise("no matching open while block",new cn.Range(e.token.start,e.token.end));return}n.complete(e.previousToken)}parseWhileShortcutStatement(e,n){let r=this,s=r.backpatches.peek(),i=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[i],start:n.start,end:r.previousToken.end,range:[n.range[0],r.previousToken.range[1]],scope:r.currentScope});r.addItemToLines(o),s.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,s=e.parseIdentifier(),i=e.astProvider.assignmentStatement({variable:s,init:e.astProvider.unknown({start:s.start,end:s.end,range:s.range,scope:n}),start:s.start,end:s.end,range:s.range,scope:n}),o=e.astProvider.assignmentStatement({variable:e.astProvider.identifier({name:`__${s.name}_idx`,start:s.start,end:s.end,range:s.range,scope:n}),init:e.astProvider.literal($s.TokenType.NumericLiteral,{value:0,raw:"0",start:s.start,end:s.end,range:s.range,scope:n}),start:s.start,end:s.end,range:s.range,scope:n});n.assignments.push(i,o),e.requireToken(Q.Selectors.In,r.start);let a=e.parseExpr(null);if(!a){e.raise("sequence expression expected for 'for' loop",new cn.Range(r.start,e.token.end));return}if(!Q.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(s,a,r);let u=e.astProvider.forGenericStatement({variable:s,iterator:a,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),l=new qr.PendingFor(u);e.backpatches.push(l)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,qr.isPendingFor)(n)){e.raise("no matching open for block",new cn.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 s=this,i=s.backpatches.peek(),o=s.parseShortcutStatement(),a=s.astProvider.forGenericStatement({variable:e,iterator:n,body:[o],start:r.start,end:s.previousToken.end,range:[r.range[0],s.previousToken.range[1]],scope:s.currentScope});s.addItemToLines(a),i.body.push(a)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let s=this;if(!Q.Selectors.Function(s.token))return s.parseOr(n,r);s.next();let i=s.previousToken,o=s.astProvider.functionStatement({start:i.start,end:null,range:[i.range[0],null],scope:s.currentScope,parent:s.outerScopes[s.outerScopes.length-1],assignment:s.currentAssignment}),a=[];if(s.pushScope(o),!Q.SelectorGroups.BlockEndOfLine(s.token)){for(s.requireToken(Q.Selectors.LParenthesis,i.start);!Q.SelectorGroups.FunctionDeclarationArgEnd(s.token);){let l=s.parseIdentifier(),c=l;if(s.consume(Q.Selectors.Assign)){let h=s.parseExpr(null);if(h instanceof Nr.ASTLiteral){let f=s.astProvider.assignmentStatement({variable:l,init:h,start:c.start,end:s.previousToken.end,range:[c.range[0],s.previousToken.range[1]],scope:s.currentScope});s.currentScope.assignments.push(f),a.push(f)}else s.raise("parameter default value must be a literal value",new cn.Range(c.start,s.token.end)),a.push(s.astProvider.invalidCodeExpression({start:c.start,end:s.previousToken.end,range:[c.range[0],s.previousToken.range[1]]}))}else{let h=s.astProvider.assignmentStatement({variable:l,init:s.astProvider.unknown({start:c.start,end:s.previousToken.end,range:[c.range[0],s.previousToken.range[1]],scope:s.currentScope}),start:c.start,end:s.previousToken.end,range:[c.range[0],s.previousToken.range[1]],scope:s.currentScope});s.currentScope.assignments.push(h),a.push(l)}if(Q.Selectors.RParenthesis(s.token))break;if(s.requireToken(Q.Selectors.ArgumentSeperator,i.start),Q.Selectors.RParenthesis(s.token)){s.raise("expected argument instead received right parenthesis",new cn.Range(s.previousToken.end,s.previousToken.end));break}}s.requireToken(Q.Selectors.RParenthesis,i.start)}o.parameters=a;let u=new qr.PendingFunction(o);return s.backpatches.push(u),u.onComplete=l=>{e!==null?(e.end=l.block.end,e.range[1]=l.block.range[1],s.addItemToLines(e)):s.addItemToLines(l.block)},o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,qr.isPendingFunction)(n)){e.raise("no matching open function block",new cn.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,s=r.token,o=r.parseAnd(e,n);for(;Q.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:os.Operator.Or,left:o,right:a,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,s=r.token,o=r.parseNot(e,n);for(;Q.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:os.Operator.And,left:o,right:a,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,s=r.token;if(Q.Selectors.Not(r.token)){r.next(),r.skipNewlines();let i=r.parseIsa();return r.astProvider.unaryExpression({operator:os.Operator.Not,argument:i,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,s=r.token,i=r.parseComparisons(e,n);if(Q.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:os.Operator.Isa,left:i,right:o,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return i}parseComparisons(e=!1,n=!1){let r=this,s=r.token,i=r.parseAddSub(e,n);if(!Q.SelectorGroups.ComparisonOperators(r.token))return i;let o=[i],a=[];do{let u=r.token;r.next(),r.skipNewlines();let l=r.parseAddSub();a.push(u.value),o.push(l)}while(Q.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,s=r.token,o=r.parseMultDiv(e,n);for(;Q.Selectors.Plus(r.token)||Q.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:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,s=r.token,o=r.parseUnaryMinus(e,n);for(;Q.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:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!Q.Selectors.Minus(r.token))return r.parseNew(e,n);let s=r.token;r.next(),r.skipNewlines();let i=r.parseNew();return i instanceof Nr.ASTNumericLiteral||i instanceof Nr.ASTBooleanLiteral?(i.negated=!0,i):r.astProvider.unaryExpression({operator:os.Operator.Minus,argument:i,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!Q.Selectors.New(r.token))return r.parseAddressOf(e,n);let s=r.token;r.next(),r.skipNewlines();let i=r.parseNew();return r.astProvider.unaryExpression({operator:os.Operator.New,argument:i,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!Q.Selectors.Reference(r.token))return r.parsePower(e,n);let s=r.token;r.next(),r.skipNewlines();let i=r.parsePower();return r.astProvider.unaryExpression({operator:os.Operator.Reference,argument:i,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,s=r.token,i=r.parseCallExpr(e,n);if(Q.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:os.Operator.Power,left:i,right:o,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return i}parseCallExpr(e=!1,n=!1){let r=this,s=r.token,i=r.parseMap(e,n);for(;!Q.Selectors.EndOfFile(r.token);)if(Q.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier();i=r.astProvider.memberExpression({base:i,indexer:os.Operator.Member,identifier:o,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}else if(Q.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),Q.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=Q.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);i=r.astProvider.sliceExpression({base:i,left:o,right:a,start:s.start,end:r.token.end,range:[s.range[0],r.token.range[1]],scope:r.currentScope})}else{let o=r.parseExpr(null);if(Q.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=Q.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);i=r.astProvider.sliceExpression({base:i,left:o,right:a,start:s.start,end:r.token.end,range:[s.range[0],r.token.range[1]],scope:r.currentScope})}else i=r.astProvider.indexExpression({base:i,index:o,start:s.start,end:r.token.end,range:[s.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(Q.Selectors.SRBracket,s.start)}else if(Q.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();i=r.astProvider.callExpression({base:i,arguments:o,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}else break;return i}parseCallArgs(){let e=this,n=[];if(Q.Selectors.LParenthesis(e.token))if(e.next(),Q.Selectors.RParenthesis(e.token))e.next();else for(;!Q.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),Q.Selectors.RParenthesis(e.requireTokenOfAny(Q.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!Q.Selectors.CLBracket(r.token))return r.parseList(e,n);let s=r.currentScope,i=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:i.start,end:null,range:[i.range[0],null],scope:s});if(r.next(),Q.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!Q.Selectors.EndOfFile(r.token);){if(Q.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:s});if(u.key=r.parseExpr(null),r.requireToken(Q.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:s}),init:null,start:u.start,end:null,range:[u.range[0],null]}),c=r.currentAssignment;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=c,l.init=u.value,l.end=r.previousToken.end,l.range[1]=r.previousToken.range[1],s.assignments.push(l)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),Q.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),Q.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(!Q.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let s=r.currentScope,i=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:i.start,end:null,range:[i.range[0],null],scope:s});if(r.next(),Q.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!Q.Selectors.EndOfFile(r.token);){if(Q.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:s});if(r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal($s.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:s}),base:r.currentAssignment.variable,start:null,end:null,range:[null,null],scope:s}),init:null,start:null,range:[null,null],end:null}),c=r.currentAssignment,h=r.token;r.currentAssignment=c,u.value=r.parseExpr(u),r.currentAssignment=c,l.variable.start=h.start,l.variable.end=r.previousToken.end,l.variable.range=[h.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]],s.assignments.push(l)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),Q.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),Q.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(!Q.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let s=r.token;r.next(),r.skipNewlines();let i=r.parseExpr(null);return r.requireToken(Q.Selectors.RParenthesis,s.start),r.astProvider.parenthesisExpression({expression:i,start:s.start,end:r.previousToken.end,range:[s.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($s.TokenType.Identifier)?r.parseIdentifier():(r.raise(`got ${r.token} where number, string, or identifier is required`,new cn.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token,r=e.token.type,s=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(s),e.next(),s}parseIdentifier(){let e=this,n=e.token,r=e.requireType($s.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,s=new vM.ParserException(e,n);return r.statementErrors.push(s),s}};nu.default=Xy});var Ce=m(je=>{"use strict";var TM=je&&je.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),vr=je&&je.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TM(e,t,n)},kh=je&&je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(je,"__esModule",{value:!0});je.ASTRange=je.ASTPosition=je.ParserValidatorm=je.Parser=je.LexerValidator=je.Lexer=void 0;var SM=Im();Object.defineProperty(je,"Lexer",{enumerable:!0,get:function(){return kh(SM).default}});vr(Ls(),je);var kM=km();Object.defineProperty(je,"LexerValidator",{enumerable:!0,get:function(){return kh(kM).default}});var wM=Jx();Object.defineProperty(je,"Parser",{enumerable:!0,get:function(){return kh(wM).default}});vr(Ly(),je);var xM=jy();Object.defineProperty(je,"ParserValidatorm",{enumerable:!0,get:function(){return kh(xM).default}});vr(Vy(),je);vr(Uy(),je);vr(Rm(),je);vr(Jc(),je);vr(Qc(),je);vr(wo(),je);vr(Em(),je);vr(Eo(),je);var EM=Wa();Object.defineProperty(je,"ASTPosition",{enumerable:!0,get:function(){return EM.Position}});var AM=Xa();Object.defineProperty(je,"ASTRange",{enumerable:!0,get:function(){return AM.Range}});vr($y(),je)});var ru=m(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.isValidIdentifierLiteral=void 0;var OM=Ce(),CM=t=>{if(t.type!==OM.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};wh.isValidIdentifierLiteral=CM});var Yy=m(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.getStringHashCode=Bs.getHashCode=Bs.rotateBits=void 0;function RM(t){return t>>1|t<<31}Bs.rotateBits=RM;function PM(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}Bs.getHashCode=PM;Bs.getStringHashCode=function(){let t=new Map,e=n=>{let r,s;for(r=0,s=0;r<n.length;r++)s=Math.imul(31,s)+n.charCodeAt(r)|0;return s};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let s=e(n);return t.set(n,s),s}}()});var Qx=m(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.createExpressionHash=void 0;var Je=Ce(),Tt=Yy(),DM=ru(),Xt=(t,e)=>t.$$hash=e,IM=t=>t.$$hash??null;function ut(t){let e=IM(t);if(e!==null)return e;let n=(0,Tt.getStringHashCode)(t.type);switch(t.type){case Je.ASTType.BinaryExpression:{let r=t;return n^=(0,Tt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Xt(t,n)}case Je.ASTType.LogicalExpression:{let r=t;return n^=(0,Tt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Xt(t,n)}case Je.ASTType.IsaExpression:{let r=t;return n^=(0,Tt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Xt(t,n)}case Je.ASTType.ComparisonGroupExpression:{let r=t;for(let s=0;s<r.expressions.length;s++)n^=ut(r.expressions[s]);for(let s=0;s<r.operators.length;s++)n^=(0,Tt.getStringHashCode)(r.operators[s]);return Xt(t,n)}case Je.ASTType.FunctionDeclaration:{let r=t;n^=(0,Tt.getHashCode)(r.parameters.length);for(let s=0;s<r.parameters.length;s++){let i=r.parameters[s];if(i.type===Je.ASTType.Identifier){n^=(0,Tt.getStringHashCode)(i.name);continue}let o=i;n^=(0,Tt.getStringHashCode)(o.variable.name),n^=ut(o.init)}return Xt(t,n)}case Je.ASTType.ParenthesisExpression:return ut(t.expression);case Je.ASTType.MemberExpression:{let r=t;if(r.base.type===Je.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,Tt.getStringHashCode)(Je.ASTType.Identifier),n^=(0,Tt.getStringHashCode)(r.identifier.name),Xt(t,n)}return n^=ut(r.base),n^=ut(r.identifier),Xt(t,n)}case Je.ASTType.IndexExpression:{let r=t;if((0,DM.isValidIdentifierLiteral)(r.index)){if(r.base.type===Je.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,Tt.getStringHashCode)(Je.ASTType.Identifier),n^=(0,Tt.getStringHashCode)(r.index.value.toString()),Xt(t,n)}n=(0,Tt.getStringHashCode)(Je.ASTType.MemberExpression),n^=ut(r.base);let s=(0,Tt.getStringHashCode)(Je.ASTType.Identifier);s^=(0,Tt.getStringHashCode)(r.index.value.toString()),n^=s}else n^=ut(r.base),n^=ut(r.index);return Xt(t,n)}case Je.ASTType.CallExpression:{let r=t;n^=ut(r.base),n^=(0,Tt.getHashCode)(r.arguments.length);for(let s=0;s<r.arguments.length;s++){let i=r.arguments[s];n^=ut(i)}return Xt(t,n)}case Je.ASTType.NegationExpression:case Je.ASTType.BinaryNegatedExpression:case Je.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,Tt.getStringHashCode)(r.operator):1,n^=ut(r.argument),Xt(t,n)}case Je.ASTType.Identifier:{let r=t;return n^=(0,Tt.getStringHashCode)(r.name),Xt(t,n)}case Je.ASTType.NumericLiteral:case Je.ASTType.StringLiteral:case Je.ASTType.NilLiteral:return n^=(0,Tt.getStringHashCode)(t.value.toString()),Xt(t,n);case Je.ASTType.MapConstructorExpression:{let r=t;n^=(0,Tt.getHashCode)(r.fields.length);for(let s=0;s<r.fields.length;s++){let i=r.fields[s];n^=ut(i.key),n^=ut(i.value)}return Xt(t,n)}case Je.ASTType.ListConstructorExpression:{let r=t;n^=(0,Tt.getHashCode)(r.fields.length);for(let s=0;s<r.fields.length;s++){let i=r.fields[s];n^=ut(i.value)}return Xt(t,n)}case Je.ASTType.SliceExpression:{let r=t;return n^=ut(r.base),n^=ut(r.left),n^=ut(r.right),Xt(t,n)}}return Xt(t,n)}function MM(t){return ut(t)}xh.createExpressionHash=MM});var Jy=m(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.createExpressionId=void 0;var Ot=Ce(),LM=ru(),Pt=(t,e)=>t.$$id=e,NM=t=>t.$$id??null;function tt(t){let e=NM(t);if(e!==null)return e;switch(t.type){case Ot.ASTType.BinaryExpression:{let n=t;return Pt(t,tt(n.left)+n.operator+tt(n.right))}case Ot.ASTType.LogicalExpression:{let n=t;return Pt(t,tt(n.left)+n.operator+tt(n.right))}case Ot.ASTType.IsaExpression:{let n=t;return Pt(t,tt(n.left)+n.operator+tt(n.right))}case Ot.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(i=>tt(i)),s=[r[0]];for(let i=0;i<n.operators.length;i++)s.push(n.operators[i],r[i+1]);return Pt(t,s.join(" "))}case Ot.ASTType.FunctionDeclaration:{let n=t,r="function",s=[];for(let i=0;i<n.parameters.length;i++){let o=n.parameters[i];if(o.type===Ot.ASTType.Identifier){s.push(o.name);continue}let a=o;s.push(a.variable.name+"="+tt(a.init))}return s.length>0&&(r+="("+s.join(",")+")"),Pt(t,r)}case Ot.ASTType.ParenthesisExpression:return Pt(t,tt(t.expression));case Ot.ASTType.MemberExpression:{let n=t;return Pt(t,tt(n.base)+"."+n.identifier.name)}case Ot.ASTType.IndexExpression:{let n=t;return(0,LM.isValidIdentifierLiteral)(n.index)?Pt(t,tt(n.base)+"."+n.index.value.toString()):Pt(t,tt(n.base)+"["+tt(n.index)+"]")}case Ot.ASTType.CallExpression:{let n=t,r=tt(n.base),s=[];for(let i=0;i<n.arguments.length;i++){let o=n.arguments[i];s.push(tt(o))}return s.length>0&&(r+="("+s.join(",")+")"),Pt(t,r)}case Ot.ASTType.NegationExpression:case Ot.ASTType.BinaryNegatedExpression:case Ot.ASTType.UnaryExpression:{let n=t;return n.operator==null?Pt(t,tt(n.argument)):n.operator==="@"?Pt(t,n.operator+tt(n.argument)):Pt(t,n.operator+" "+tt(n.argument))}case Ot.ASTType.Identifier:return Pt(t,t.name);case Ot.ASTType.NumericLiteral:case Ot.ASTType.StringLiteral:case Ot.ASTType.NilLiteral:return Pt(t,t.raw.toString());case Ot.ASTType.MapConstructorExpression:{let n=t,r=[];for(let s=0;s<n.fields.length;s++){let i=n.fields[s];r.push(tt(i.key)+":"+tt(i.value))}return Pt(t,"{"+r.join(",")+"}")}case Ot.ASTType.ListConstructorExpression:{let n=t,r=[];for(let s=0;s<n.fields.length;s++){let i=n.fields[s];r.push(tt(i.value))}return Pt(t,"["+r.join(",")+"]")}case Ot.ASTType.SliceExpression:{let n=t;return Pt(t,tt(n.base)+"["+tt(n.left)+":"+tt(n.right)+"]")}}return Pt(t,"")}function qM(t){return tt(t)}Eh.createExpressionId=qM});var Do=m(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.Markers=void 0;var jM;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(jM=su.Markers||(su.Markers={}))});var _r=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.rewireSpecs=gt.rewireSource=gt.seedTokens=gt.seedSpec=gt.seedBlock=gt.splitLines=gt.splitSpace=gt.splitCR=gt.hasCR=gt.isSpace=void 0;function FM(t){return/^\s+$/.test(t)}gt.isSpace=FM;function $M(t){return/\r$/.test(t)}gt.hasCR=$M;function BM(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}gt.splitCR=BM;function UM(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}gt.splitSpace=UM;function WM(t){return t.split(/\n/)}gt.splitLines=WM;function HM(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}gt.seedBlock=HM;function GM(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}gt.seedSpec=GM;function zM(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}gt.seedTokens=zM;function KM(t){let e=t.source.reduce((n,r)=>n.set(r.number,r),new Map);for(let n of t.tags)n.source=n.source.map(r=>e.get(r.number));return t}gt.rewireSource=KM;function VM(t){let e=t.tags.reduce((n,r)=>r.source.reduce((s,i)=>s.set(i.number,i),n),new Map);return t.source=t.source.map(n=>e.get(n.number)||n),t}gt.rewireSpecs=VM});var Zx=m(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});var XM=/^@\S+/;function YM({fence:t="```"}={}){let e=JM(t),n=(r,s)=>e(r)?!s:s;return function(s){let i=[[]],o=!1;for(let a of s)XM.test(a.tokens.description)&&!o?i.push([a]):i[i.length-1].push(a),o=n(a.tokens.description,o);return i}}Qy.default=YM;function JM(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var eE=m(Zy=>{"use strict";Object.defineProperty(Zy,"__esModule",{value:!0});var QM=Do(),iu=_r();function ZM({startLine:t=0,markers:e=QM.Markers}={}){let n=null,r=t;return function(i){let o=i,a=(0,iu.seedTokens)();if([a.lineEnd,o]=(0,iu.splitCR)(o),[a.start,o]=(0,iu.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,iu.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,iu.splitSpace)(o)),u){let l=o.trimRight();a.end=o.slice(l.length-e.end.length),o=l.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:i,tokens:a}),r++,u){let l=n.slice();return n=null,l}return null}}Zy.default=ZM});var tE=m(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var eL=_r();function tL({tokenizers:t}){return function(n){var r;let s=(0,eL.seedSpec)({source:n});for(let i of t)if(s=i(s),!((r=s.problems[s.problems.length-1])===null||r===void 0)&&r.critical)break;return s}}eb.default=tL});var nb=m(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});function nL(){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)}}tb.default=nL});var sb=m(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var rL=_r();function sL(t="compact"){let e=oL(t);return n=>{let r=0,s=[];for(let[a,{tokens:u}]of n.source.entries()){let l="";if(a===0&&u.description[0]!=="{")return n;for(let c of u.description)if(c==="{"&&r++,c==="}"&&r--,l+=c,r===0)break;if(s.push([u,l]),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 i=[],o=s[0][0].postDelimiter.length;for(let[a,[u,l]]of s.entries())u.type=l,a>0&&(u.type=u.postDelimiter.slice(o)+l,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,rL.splitSpace)(u.description.slice(l.length)),i.push(u.type);return i[0]=i[0].slice(1),i[i.length-1]=i[i.length-1].slice(0,-1),n.type=e(i),n}}rb.default=sL;var iL=t=>t.trim();function oL(t){return t==="compact"?e=>e.map(iL).join(""):t==="preserve"?e=>e.join(`
97
+ `):t}});var ab=m(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var ib=_r(),aL=t=>t&&t.startsWith('"')&&t.endsWith('"');function uL(){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(),s=r.split('"');if(s.length>1&&s[0]===""&&s.length%2===1)return e.name=s[1],n.name=`"${s[1]}"`,[n.postName,n.description]=(0,ib.splitSpace)(r.slice(n.name.length)),e;let i=0,o="",a=!1,u;for(let c of r){if(i===0&&(0,ib.isSpace)(c))break;c==="["&&i++,c==="]"&&i--,o+=c}if(i!==0)return e.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:e.source[0].number,critical:!0}),e;let l=o;if(o[0]==="["&&o[o.length-1]==="]"){a=!0,o=o.slice(1,-1);let c=o.split("=");if(o=c[0].trim(),c[1]!==void 0&&(u=c.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(!aL(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=l,u!==void 0&&(e.default=u),[n.postName,n.description]=(0,ib.splitSpace)(r.slice(n.name.length)),e}}ob.default=uL});var lb=m(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.getJoiner=void 0;var ub=Do();function lL(t="compact",e=ub.Markers){let n=nE(t);return r=>(r.description=n(r.source,e),r)}ou.default=lL;function nE(t){return t==="compact"?cL:t==="preserve"?dL:t}ou.getJoiner=nE;function cL(t,e=ub.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var hL=(t,{tokens:e},n)=>e.type===""?t:n,fL=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function dL(t,e=ub.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(hL,0)),t.map(fL).join(`
98
+ `)}});var sE=m(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var pL=Do(),gL=_r(),mL=Zx(),yL=eE(),bL=tE(),vL=nb(),_L=sb(),TL=ab(),rE=lb();function SL({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=pL.Markers,tokenizers:s=[(0,vL.default)(),(0,_L.default)(n),(0,TL.default)(),(0,rE.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let i=(0,yL.default)({startLine:t,markers:r}),o=(0,mL.default)({fence:e}),a=(0,bL.default)({tokenizers:s}),u=(0,rE.getJoiner)(n);return function(l){let c=[];for(let h of(0,gL.splitLines)(l)){let f=i(h);if(f===null)continue;let g=o(f),v=g.slice(1).map(a);c.push({description:u(g[0],r),tags:v,source:f,problems:v.reduce((b,O)=>b.concat(O.problems),[])})}return c}}cb.default=SL});var iE=m(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});function kL(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 wL(){return t=>t.source.map(({tokens:e})=>kL(e)).join(`
99
+ `)}hb.default=wL});var aE=m(au=>{"use strict";var xL=au&&au.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};Object.defineProperty(au,"__esModule",{value:!0});var oE=Do(),EL=_r(),AL={start:0,tag:0,type:0,name:0},OL=(t=oE.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)}),Ti=t=>"".padStart(t," ");function CL(t=oE.Markers){let e=!1,n;function r(s){let i=Object.assign({},s.tokens);i.tag!==""&&(e=!0);let o=i.tag===""&&i.name===""&&i.type===""&&i.description==="";if(i.end===t.end&&o)return i.start=Ti(n.start+1),Object.assign(Object.assign({},s),{tokens:i});switch(i.delimiter){case t.start:i.start=Ti(n.start);break;case t.delim:i.start=Ti(n.start+1);break;default:i.delimiter="",i.start=Ti(n.start+2)}if(!e)return i.postDelimiter=i.description===""?"":" ",Object.assign(Object.assign({},s),{tokens:i});let a={delim:!1,tag:!1,type:!1,name:!1};return i.description===""&&(a.name=!0,i.postName="",i.name===""&&(a.type=!0,i.postType="",i.type===""&&(a.tag=!0,i.postTag="",i.tag===""&&(a.delim=!0)))),i.postDelimiter=a.delim?"":" ",a.tag||(i.postTag=Ti(n.tag-i.tag.length+1)),a.type||(i.postType=Ti(n.type-i.type.length+1)),a.name||(i.postName=Ti(n.name-i.name.length+1)),Object.assign(Object.assign({},s),{tokens:i})}return s=>{var{source:i}=s,o=xL(s,["source"]);return n=i.reduce(OL(t),Object.assign({},AL)),(0,EL.rewireSource)(Object.assign(Object.assign({},o),{source:i.map(r)}))}}au.default=CL});var uE=m(uu=>{"use strict";var RL=uu&&uu.__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 s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};Object.defineProperty(uu,"__esModule",{value:!0});var PL=_r(),DL=t=>e=>e.slice(t),IL=t=>{let e="".padStart(t," ");return n=>n+e};function ML(t){let e,n=s=>{if(e===void 0){let i=t-s.length;e=i>0?IL(i):DL(-i)}return e(s)},r=s=>Object.assign(Object.assign({},s),{tokens:Object.assign(Object.assign({},s.tokens),{start:n(s.tokens.start)})});return s=>{var{source:i}=s,o=RL(s,["source"]);return(0,PL.rewireSource)(Object.assign(Object.assign({},o),{source:i.map(r)}))}}uu.default=ML});var lE=m(lu=>{"use strict";var LL=lu&&lu.__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 s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};Object.defineProperty(lu,"__esModule",{value:!0});var NL=_r();function qL(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,s=LL(n,["source"]);return(0,NL.rewireSource)(Object.assign(Object.assign({},s),{source:r.map(e)}))}}lu.default=qL});var cE=m(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.flow=void 0;function jL(...t){return e=>t.reduce((n,r)=>r(n),e)}Ah.flow=jL});var pE=m(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var FL=_r(),fE={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},hE={lineEnd:"CR"},fb=Object.keys(fE),dE=t=>(0,FL.isSpace)(t)?`{${t.length}}`:t,$L=t=>"|"+t.join("|")+"|",BL=(t,e)=>Object.keys(e).map(n=>dE(e[n]).padEnd(t[n]));function UL({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},fE);for(let i of fb)r[i]=((e=hE[i])!==null&&e!==void 0?e:i).length;for(let{number:i,tokens:o}of t){r.line=Math.max(r.line,i.toString().length);for(let a in o)r[a]=Math.max(r[a],dE(o[a]).length)}let s=[[],[]];for(let i of fb)s[0].push(((n=hE[i])!==null&&n!==void 0?n:i).padEnd(r[i]));for(let i of fb)s[1].push("-".padEnd(r[i],"-"));for(let{number:i,tokens:o}of t){let a=i.toString().padStart(r.line);s.push([a,...BL(r,o)])}return s.map($L).join(`
100
+ `)}db.default=UL});var pb=m(Dt=>{"use strict";var WL=Dt&&Dt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),HL=Dt&&Dt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&WL(e,t,n)};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.util=Dt.tokenizers=Dt.transforms=Dt.inspect=Dt.stringify=Dt.parse=void 0;var GL=sE(),zL=lb(),KL=ab(),VL=nb(),XL=sb(),YL=iE(),JL=aE(),QL=uE(),ZL=lE(),eN=cE(),Oh=_r();HL(Do(),Dt);function tN(t,e={}){return(0,GL.default)(e)(t)}Dt.parse=tN;Dt.stringify=(0,YL.default)();var nN=pE();Object.defineProperty(Dt,"inspect",{enumerable:!0,get:function(){return nN.default}});Dt.transforms={flow:eN.flow,align:JL.default,indent:QL.default,crlf:ZL.default};Dt.tokenizers={tag:VL.default,type:XL.default,name:KL.default,description:zL.default};Dt.util={rewireSpecs:Oh.rewireSpecs,rewireSource:Oh.rewireSource,seedBlock:Oh.seedBlock,seedTokens:Oh.seedTokens}});var Si=m(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.SignatureDefinitionBaseType=void 0;var rN;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(rN=cu.SignatureDefinitionBaseType||(cu.SignatureDefinitionBaseType={}))});var hu=m(Io=>{"use strict";var gE=Io&&Io.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i};Object.defineProperty(Io,"__esModule",{value:!0});Io.SignatureDefinitionTypeMeta=void 0;var hn=Si(),sN=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,s=null,i=gE(n,3),o=i[0],a=i[1],u=i[2];if(a===hn.SignatureDefinitionBaseType.Map?(r=hn.SignatureDefinitionBaseType.Any,s=hn.SignatureDefinitionBaseType.Any):a===hn.SignatureDefinitionBaseType.List&&(r=hn.SignatureDefinitionBaseType.Any),u){var l=u.split(",").map(function(g){return g.trim()});if(l.length>2)return null;var c=gE(l,2),h=c[0],f=c[1];f!=null?(r=f,s=h):r=h}return new t({type:a,keyType:s,valueType:r})},t.parse=function(e){var n,r;if(typeof e=="string"){var s=e,i=null,o=null;return s===hn.SignatureDefinitionBaseType.Map?(i=hn.SignatureDefinitionBaseType.Any,o=hn.SignatureDefinitionBaseType.Any):s===hn.SignatureDefinitionBaseType.List&&(i=hn.SignatureDefinitionBaseType.Any),new t({type:s,valueType:i,keyType:o})}else if(typeof e=="object"){var s=e.type,i=(n=e.valueType)!==null&&n!==void 0?n:null,o=(r=e.keyType)!==null&&r!==void 0?r:null;return s===hn.SignatureDefinitionBaseType.Map?(i=i??hn.SignatureDefinitionBaseType.Any,o=o??hn.SignatureDefinitionBaseType.Any):s===hn.SignatureDefinitionBaseType.List&&(i=i??hn.SignatureDefinitionBaseType.Any),new t({type:s,valueType:i,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}();Io.SignatureDefinitionTypeMeta=sN});var gb=m(Us=>{"use strict";var mE=Us&&Us.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i},yE=Us&&Us.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(Us,"__esModule",{value:!0});Us.SignatureDefinitionFunctionArg=void 0;var bE=hu(),iN=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,s=[];if(e.type)s.push(bE.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)s.push.apply(s,yE([],mE(e.types.map(bE.SignatureDefinitionTypeMeta.parse)),!1));else throw new Error("Invalid signature definition function arg payload!");return new t({label:e.label,types:s,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 yE([],mE(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}();Us.SignatureDefinitionFunctionArg=iN});var Ch=m(jr=>{"use strict";var ki=jr&&jr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i},wi=jr&&jr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},oN=jr&&jr.__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(jr,"__esModule",{value:!0});jr.VariationRegistry=void 0;var aN=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(wi(wi([],ki(e),!1),ki(this._variations),!1)),this},t.prototype.getAll=function(){return wi([],ki(this._variations),!1)},t}(),uN=function(){function t(){}return t.add=function(e,n){var r=new aN(e);return r.push.apply(r,wi([],ki(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,s=new Set;try{for(var i=oN(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(typeof a=="string"&&a.startsWith("!")){var u=a.slice(1),l=this.get(u);if(l!==null)s=new Set(wi(wi([],ki(l.getAll()),!1),ki(s),!1));else throw new Error("Cannot find variation container for ".concat(u));continue}s.add(a)}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return wi([],ki(s),!1)},t.variationContainers=new Map,t}();jr.VariationRegistry=uN});var Rh=m(Ws=>{"use strict";var lN=Ws&&Ws.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i},cN=Ws&&Ws.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.SignatureDefinition=void 0;var hN=Ch(),fN=hu(),dN=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,s;return new t({type:fN.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:(s=e.variations)!==null&&s!==void 0?s: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 hN.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?cN([],lN(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}();Ws.SignatureDefinition=dN});var mb=m(Yn=>{"use strict";var pN=Yn&&Yn.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},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)}}(),Ph=Yn&&Yn.__assign||function(){return Ph=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Ph.apply(this,arguments)},gN=Yn&&Yn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i},mN=Yn&&Yn.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.SignatureDefinitionFunction=void 0;var yN=Si(),bN=Ch(),vN=Rh(),_N=gb(),vE=hu(),TN=function(t){pN(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(s){return s.getLabel()}),r._argRefs=n.arguments.reduce(function(s,i){return s.set(i.getLabel(),i)},new Map),r._returns=n.returns.reduce(function(s,i){return s.set(i.type,i)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n){var r,s,i,o,a,u;return new e({type:new vE.SignatureDefinitionTypeMeta({type:yN.SignatureDefinitionBaseType.Function}),isProtected:(r=n.isProtected)!==null&&r!==void 0?r:!1,description:(s=n.description)!==null&&s!==void 0?s:null,example:(i=n.example)!==null&&i!==void 0?i:null,arguments:(a=(o=n.arguments)===null||o===void 0?void 0:o.map(_N.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(vE.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 mN([],gN(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=[]),bN.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Ph(Ph({},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,s;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:(s=n?.example)!==null&&s!==void 0?s: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}(vN.SignatureDefinition);Yn.SignatureDefinitionFunction=TN});var TE=m((D3,_E)=>{"use strict";_E.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var yb=m((SE,kE)=>{"use strict";var SN=TE();kE.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:SN(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,SE.assert)}}});var Ne=m((M3,wE)=>{"use strict";var kN=yb();wE.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new kN(e)}});var xi=m((L3,EE)=>{"use strict";var bb=Ne(),xE={};EE.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);bb(!r||!n.separator,"Separator option is not valid for array-based chain");let s=r?e:e.split(n.separator||"."),i=t;for(let o=0;o<s.length;++o){let a=s[o],u=n.iterables&&xE.iterables(i);if(Array.isArray(i)||u==="set"){let l=Number(a);Number.isInteger(l)&&(a=l<0?i.length+l:l)}if(!i||typeof i=="function"&&n.functions===!1||!u&&i[a]===void 0){bb(!n.strict||o+1===s.length,"Missing segment",a,"in reach path ",e),bb(typeof i=="object"||n.functions===!0||typeof i!="function","Invalid segment",a,"in reach path ",e),i=n.default;break}u?u==="set"?i=[...i][a]:i=i.get(a):i=i[a]}return i};xE.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var vb=m((fn,OE)=>{"use strict";var AE={};fn=OE.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};AE.typeMap=new Map([["[object Error]",fn.error],["[object Map]",fn.map],["[object Promise]",fn.promise],["[object Set]",fn.set],["[object WeakMap]",fn.weakMap],["[object WeakSet]",fn.weakSet]]);fn.getInternalProto=function(t){if(Array.isArray(t))return fn.array;if(Buffer&&t instanceof Buffer)return fn.buffer;if(t instanceof Date)return fn.date;if(t instanceof RegExp)return fn.regex;if(t instanceof Error)return fn.error;let e=Object.prototype.toString.call(t);return AE.typeMap.get(e)||fn.generic}});var _b=m(CE=>{"use strict";CE.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var dn=m((q3,RE)=>{"use strict";var wN=xi(),Nn=vb(),xN=_b(),as={needsProtoHack:new Set([Nn.set,Nn.map,Nn.weakSet,Nn.weakMap])};RE.exports=as.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=as.clone,s=n;if(e.shallow){if(e.shallow!==!0)return as.cloneWithShallow(t,e);r=u=>u}else if(s){let u=s.get(t);if(u)return u}else s=new Map;let i=Nn.getInternalProto(t);if(i===Nn.buffer)return Buffer&&Buffer.from(t);if(i===Nn.date)return new Date(t.getTime());if(i===Nn.regex)return new RegExp(t);let o=as.base(t,i,e);if(o===t)return t;if(s&&s.set(t,o),i===Nn.set)for(let u of t)o.add(r(u,e,s));else if(i===Nn.map)for(let[u,l]of t)o.set(u,r(l,e,s));let a=xN.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(i===Nn.array&&u==="length"){o.length=t.length;continue}let l=Object.getOwnPropertyDescriptor(t,u);l?l.get||l.set?Object.defineProperty(o,u,l):l.enumerable?o[u]=r(t[u],e,s):Object.defineProperty(o,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],e,s)}):Object.defineProperty(o,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],e,s)})}return o};as.cloneWithShallow=function(t,e){let n=e.shallow;e=Object.assign({},e),e.shallow=!1;let r=new Map;for(let s of n){let i=wN(t,s);(typeof i=="object"||typeof i=="function")&&r.set(i,i)}return as.clone(t,e,r)};as.base=function(t,e,n){if(n.prototype===!1)return as.needsProtoHack.has(e)?new e.constructor:e===Nn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===Nn.array){let s=[];return r!==e&&Object.setPrototypeOf(s,r),s}if(as.needsProtoHack.has(e)){let s=new r.constructor;return r!==e&&Object.setPrototypeOf(s,r),s}return Object.create(r)}});var PE=m((j3,EN)=>{EN.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 Dh=m(fu=>{"use strict";var P=Ih(),be={};be.wrap=P.string().min(1).max(2).allow(!1);fu.preferences=P.object({allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),context:P.object(),convert:P.boolean(),dateFormat:P.valid("date","iso","string","time","utc"),debug:P.boolean(),errors:{escapeHtml:P.boolean(),label:P.valid("path","key",!1),language:[P.string(),P.object().ref()],render:P.boolean(),stack:P.boolean(),wrap:{label:be.wrap,array:be.wrap,string:be.wrap}},externals:P.boolean(),messages:P.object(),noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:P.valid("required","optional","forbidden"),skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()}).strict();be.nameRx=/^[a-zA-Z0-9]\w*$/;be.rule=P.object({alias:P.array().items(P.string().pattern(be.nameRx)).single(),args:P.array().items(P.string(),P.object({name:P.string().pattern(be.nameRx).required(),ref:P.boolean(),assert:P.alternatives([P.function(),P.object().schema()]).conditional("ref",{is:!0,then:P.required()}),normalize:P.function(),message:P.string().when("assert",{is:P.function(),then:P.required()})})),convert:P.boolean(),manifest:P.boolean(),method:P.function().allow(!1),multi:P.boolean(),validate:P.function()});fu.extension=P.object({type:P.alternatives([P.string(),P.object().regex()]).required(),args:P.function(),cast:P.object().pattern(be.nameRx,P.object({from:P.function().maxArity(1).required(),to:P.function().minArity(1).maxArity(2).required()})),base:P.object().schema().when("type",{is:P.object().regex(),then:P.forbidden()}),coerce:[P.function().maxArity(3),P.object({method:P.function().maxArity(3).required(),from:P.array().items(P.string()).single()})],flags:P.object().pattern(be.nameRx,P.object({setter:P.string(),default:P.any()})),manifest:{build:P.function().arity(2)},messages:[P.object(),P.string()],modifiers:P.object().pattern(be.nameRx,P.function().minArity(1).maxArity(2)),overrides:P.object().pattern(be.nameRx,P.function()),prepare:P.function().maxArity(3),rebuild:P.function().arity(1),rules:P.object().pattern(be.nameRx,be.rule),terms:P.object().pattern(be.nameRx,P.object({init:P.array().allow(null).required(),manifest:P.object().pattern(/.+/,[P.valid("schema","single"),P.object({mapped:P.object({from:P.string().required(),to:P.string().required()}).required()})])})),validate:P.function().maxArity(3)}).strict();fu.extensions=P.array().items(P.object(),P.function().arity(1)).strict();be.desc={buffer:P.object({buffer:P.string()}),func:P.object({function:P.function().required(),options:{literal:!0}}),override:P.object({override:!0}),ref:P.object({ref:P.object({type:P.valid("value","global","local"),path:P.array().required(),separator:P.string().length(1).allow(!1),ancestor:P.number().min(0).integer().allow("root"),map:P.array().items(P.array().length(2)).min(1),adjust:P.function(),iterables:P.boolean(),in:P.boolean(),render:P.boolean()}).required()}),regex:P.object({regex:P.string().min(3)}),special:P.object({special:P.valid("deep").required()}),template:P.object({template:P.string().required(),options:P.object()}),value:P.object({value:P.alternatives([P.object(),P.array()]).required()})};be.desc.entity=P.alternatives([P.array().items(P.link("...")),P.boolean(),P.function(),P.number(),P.string(),be.desc.buffer,be.desc.func,be.desc.ref,be.desc.regex,be.desc.special,be.desc.template,be.desc.value,P.link("/")]);be.desc.values=P.array().items(null,P.boolean(),P.function(),P.number().allow(1/0,-1/0),P.string().allow(""),P.symbol(),be.desc.buffer,be.desc.func,be.desc.override,be.desc.ref,be.desc.regex,be.desc.template,be.desc.value);be.desc.messages=P.object().pattern(/.+/,[P.string(),be.desc.template,P.object().pattern(/.+/,[P.string(),be.desc.template])]);fu.description=P.object({type:P.string().required(),flags:P.object({cast:P.string(),default:P.any(),description:P.string(),empty:P.link("/"),failover:be.desc.entity,id:P.string(),label:P.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:P.boolean(),unit:P.string()}).unknown(),preferences:{allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),convert:P.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:P.boolean(),label:["path","key"],language:[P.string(),be.desc.ref],wrap:{label:be.wrap,array:be.wrap}},externals:P.boolean(),messages:be.desc.messages,noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:["required","optional","forbidden"],skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()},allow:be.desc.values,invalid:be.desc.values,rules:P.array().min(1).items({name:P.string().required(),args:P.object().min(1),keep:P.boolean(),message:[P.string(),be.desc.messages],warn:P.boolean()}),keys:P.object().pattern(/.*/,P.link("/")),link:be.desc.ref}).pattern(/^[a-z]\w*$/,P.any())});var IE=m(($3,DE)=>{"use strict";var Hs={};DE.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);Hs.isSafe(r)?e+=t[n]:e+=Hs.escapeHtmlChar(r)}return e};Hs.escapeHtmlChar=function(t){let e=Hs.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};Hs.isSafe=function(t){return Hs.safeCharCodes.has(t)};Hs.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);Hs.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 ME=m(du=>{"use strict";var Pe={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};du.Parser=class{constructor(t,e={}){if(!e[Pe.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[Pe.settings]?e:Object.assign({[Pe.settings]:!0,constants:{},functions:{}},e),this.single=null,this._parts=null,this._parse(t)}_parse(t){let e=[],n="",r=0,s=!1,i=a=>{if(r)throw new Error("Formula missing closing parenthesis");let u=e.length?e[e.length-1]:null;if(!(!s&&!n&&!a)){if(u&&u.type==="reference"&&a===")"){u.type="function",u.value=this._subFormula(n,u.value),n="";return}if(a===")"){let l=new du.Parser(n,this.settings);e.push({type:"segment",value:l})}else if(s){if(s==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(Pe.operatorCharacters.includes(n))u&&u.type==="operator"&&Pe.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Pe.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(Pe.tokenRx))throw new Error(`Formula contains invalid token: ${n}`);e.push({type:"reference",value:n})}n=""}};for(let a of t)s?a===s?(i(),s=!1):n+=a:r?a==="("?(n+=a,++r):a===")"?(--r,r?n+=a:i(a)):n+=a:a in Pe.literals?s=Pe.literals[a]:a==="("?(i(),++r):Pe.operatorCharacters.includes(a)?(i(),n=a,i()):a!==" "?n+=a:i();i(),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(Pe.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Pe.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 Pe.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):Pe.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 s="",i=0,o=!1,a=()=>{if(!s)throw new Error(`Formula contains function ${e} with invalid arguments ${t}`);r.push(s),s=""};for(let u=0;u<t.length;++u){let l=t[u];o?(s+=l,l===o&&(o=!1)):l in Pe.literals&&!i?(s+=l,o=Pe.literals[l]):l===","&&!i?a():(s+=l,l==="("?++i:l===")"&&--i)}a()}return r=r.map(s=>new du.Parser(s,this.settings)),function(s){let i=[];for(let o of r)i.push(o.evaluate(s));return n.call(s,...i)}}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 s=e[n+1];e.splice(n+1,1);let i=Pe.evaluate(s,t);e[n]=Pe.single(r.value,i)}}return Pe.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let s=e[r],i=Pe.evaluate(e[r-1],t),o=Pe.evaluate(e[r+1],t);e.splice(r,2);let a=Pe.calculate(s,i,o);e[r-1]=a===0?0:a}else r+=2}),Pe.evaluate(e[0],t)}};du.Parser.prototype[Pe.symbol]=!0;Pe.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Pe.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Pe.symbol]?t.evaluate(e):t};Pe.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Pe.calculate=function(t,e,n){if(t==="??")return Pe.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Pe.exists(e)?e:"",n=Pe.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};Pe.exists=function(t){return t!=null}});var NE=m(LE=>{"use strict";var AN=dn(),ON=nt(),Ei={annotations:Symbol("annotations")};LE.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",s=AN(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,l=this.details[a],c=l.path,h=s;for(let f=0;;++f){let g=c[f];if(ON.isSchema(h)&&(h=h.clone()),f+1<c.length&&typeof h[g]!="string")h=h[g];else{let v=h[Ei.annotations]||{errors:{},missing:{}};h[Ei.annotations]=v;let b=g||l.context.key;h[g]!==void 0?(v.errors[b]=v.errors[b]||[],v.errors[b].push(u)):v.missing[b]=u;break}}}let i={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=Ei.safeStringify(s,2).replace(i.key,(a,u)=>`" ${e}[${u}]${r}`).replace(i.missing,(a,u,l)=>`${n}"${u}"${r}${e} [${l}]: -- missing --${r}`).replace(i.arrayIndex,(a,u,l)=>`
101
+ ${l} ${e}[${u}]${r}`).replace(i.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};Zi.safeStringify=function(t,e){return JSON.stringify(t,Zi.serializer(),e)};Zi.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[Zi.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 Br=g(wt=>{"use strict";var oI=_w(),aI=Ze(),uI=Si();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(uI.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(aI.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=oI.error});var Ur=g($n=>{"use strict";var jn=Me(),cI=nn(),lI=Qi(),Ia=Ze(),Nm,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),Ia.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[Ia.symbols.ref]:!1};Fn.Ref=class{constructor(t){jn(typeof t=="object","Invalid reference construction"),Ia.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=lI(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[Ia.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(Ia.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}),Nm=Nm||Si(),Nm.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new $n.Manager;return t.refs=cI(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Si=g((xw,ww)=>{"use strict";var Pl=Me(),dI=nn(),fI=yw(),pI=bw(),Sw=Ze(),Tw=Br(),kw=Ur(),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}};ww.exports=xw=Be.Template=class{constructor(t,e){if(Pl(typeof t=="string","Template source must be a string"),Pl(!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?dI(r):void 0,this._functions=n,this._functions&&(Pl(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),Pl(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[Sw.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:fI(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=kw.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 pI.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[Sw.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(kw.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=Tw.template(e,o[0],t,n,r)||Tw.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 ro=g(Ma=>{"use strict";var es=Me(),Ew=nn(),wn=Si();Ma.compile=function(t,e){if(typeof t=="string")return es(!e,"Cannot set single message string"),new wn(t);if(wn.isTemplate(t))return es(!e,"Cannot set single message template"),t;es(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"||wn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new wn(r);continue}es(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}es(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new wn(s)}}return e};Ma.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};Ma.merge=function(t,e){if(!t)return Ma.compile(e);if(!e)return t;if(typeof e=="string")return new wn(e);if(wn.isTemplate(e))return e;let n=Ew(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}es(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}es(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new wn(o)}}return n}});var Ze=g(et=>{"use strict";var Dl=Me(),hI=Dm(),gI=gw(),qm,jm,mI={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=gI.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"){Dl(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));Dl(r.length===0,`${n} contain unknown keys: ${r}`)};et.checkPreferences=function(t){jm=jm||Cl();let e=jm.preferences.validate(t);if(e.error)throw new hI([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 mI.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?(Dl(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){qm=qm||ro(),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=qm.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)Dl(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Fm=g(Aw=>{"use strict";var yI=Me(),bI=nn(),vI=Ze(),io={max:1e3,supported:new Set(["undefined","boolean","number","string"])};Aw.provider={provision(t){return new io.Cache(t)}};io.Cache=class{constructor(t={}){vI.assertOptions(t,["max"]),yI(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||io.max,this._map=new Map,this._list=new io.List}get length(){return this._map.size}set(t,e){if(t!==null&&!io.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),bI(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};io.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 ts=g(Hr=>{"use strict";var pt=Me(),En=Ze(),so=Ur(),Bn={};Hr.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))};Hr.ref=function(t,e){return so.isRef(t)?t:so.create(t,e)};Hr.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 Hr.schema(t,e,{appendPath:!0});let i=Bn.walk(e);return i?i.compile(i.root,e):Hr.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)};Hr.when=function(t,e,n){if(n===void 0&&(pt(e&&typeof e=="object","Missing options"),n=e,e=so.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(so.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&&!so.isRef(n.is)&&!En.isSchema(n.is)&&(s=s.required()),Bn.condition(t,{ref:Hr.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:Hr.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(!so.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 $m=g(Cw=>{"use strict";var ki=Me(),_I=nn(),Ow=Ze(),TI=ro(),_r={};Cw.type=function(t,e){let n=Object.getPrototypeOf(t),r=_I(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=TI.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];ki(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=_r.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=_r.coerce(s.coerce,o.coerce),s.validate=_r.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];ki(typeof p=="object","Invalid rule definition for",s.type,d);let b=p.method;if(b===void 0&&(b=function(){return this.$_addRule(d)}),b&&(ki(!r[d],"Rule conflict in",s.type,d),r[d]=b),ki(!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:_}),ki(!p.argsByName.has(_.name),"Duplicated argument name",_.name),Ow.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){ki(!r[d],"Rule conflict in",s.type,d);let p=s.modifiers[d];ki(typeof p=="function","Invalid modifier definition for",s.type,d);let b=function(_){return this.rule({[d]:_})};r[d]=b,c[d]=p}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let d in s.overrides)ki(n[d],"Cannot override missing",d),s.overrides[d][Ow.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=_r.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=_r.rebuild(s.rebuild,o.rebuild),i};_r.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};_r.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}}};_r.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}};_r.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};_r.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 Hm=g(Um=>{"use strict";var Tr=Me(),Il=nn(),ns=Ze(),SI=ro(),Rw=Ur(),kI=Si(),Bm,rn={};Um.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=rn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=Il(t._preferences,{shallow:["messages"]}),delete n.preferences[ns.symbols.prefs],n.preferences.messages&&(n.preferences.messages=SI.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]=rn.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]=rn.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;Tr(!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(ns.isValues(i)){n[r]=i.describe();continue}Tr(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(rn.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"){Tr(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return rn.validate(t.$_root,n),n};rn.describe=function(t,e={}){if(Array.isArray(t))return t.map(rn.describe);if(t===ns.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return Il(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[ns.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]=rn.describe(i,{assign:r}))}return n};Um.build=function(t,e){return new rn.Builder(t).parse(e)};rn.Builder=class{constructor(t){this.joi=t}parse(t){rn.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;Tr(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){Tr(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){Tr(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 Tr(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;Tr(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 Il(t);if(e.assign==="regex")return rn.regex(t);if(e.assign==="ref")return Rw.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return Tr(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[ns.symbols.literal]:!0,literal:t.function};if(t.override)return ns.symbols.override;if(t.ref)return Rw.build(t.ref);if(t.regex)return rn.regex(t.regex);if(t.special)return Tr(["deep"].includes(t.special),"Unknown special value",t.special),ns.symbols.deepDefault;if(t.value)return Il(t.value)}if(t.type)return this.parse(t);if(t.template)return kI.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};rn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};rn.validate=function(t,e){Bm=Bm||Cl(),t.assert(e,Bm.description)}});var La=g((W5,Pw)=>{"use strict";var Sr=Mm(),zt={mismatched:null};Pw.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!zt.isDeepEqual(t,e,n,[])};zt.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=zt.getSharedType(t,e,!!n.prototype);switch(s){case Sr.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Sr.promise:return t===e;case Sr.regex:return t.toString()===e.toString();case zt.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new zt.SeenEntry(t,e));try{return!!zt.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};zt.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?zt.mismatched:Sr.getInternalProto(t);let r=Sr.getInternalProto(t);return r!==Sr.getInternalProto(e)?zt.mismatched:r};zt.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};zt.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};zt.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};zt.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=zt,{keys:u,getOwnPropertySymbols:c}=Object;if(t===Sr.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===Sr.set){if(e.size!==n.size)return!1;if(!zt.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===Sr.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===Sr.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 b=0;for(let _ of p){if(r.skip&&r.skip.includes(_)){n[_]===void 0&&++b;continue}if(!a(n,_)||!s(e[_],n[_],r,i))return!1}if(!r.part&&p.length-b!==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};zt.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var Iw=g(Dw=>{"use strict";Dw.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 Gm=g(Wm=>{"use strict";var Mw=La(),Lw=Iw(),xI=Br(),Xt={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Wm.setup=function(t){let e=function(){return t._tracer=t._tracer||new Xt.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Wm.location=function(t){return t.$_setFlag("_tracerLocation",Lw.location(2))};Xt.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 Xt.Store(t),{filename:r,line:i}=t._flags._tracerLocation||Lw.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(Xt.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),b=new Set(d._refs);for(let{value:_,ref:E}of u[l])p.delete(_),b.delete(E);(p.size||b.size)&&s.push({status:[...p,...[...b].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=Xt.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(Xt.message).join(", ")}`})}return e.length?e:null}};Xt.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){Xt.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){Xt.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){Xt.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]|=Xt.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||Mw(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=Xt.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};Xt.message=function(t){return`${t.paths?xI.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};Xt.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)};Xt.sub=function(t,e){for(let n of t)for(let r of e)if(Mw(n.slice(0,r.length),r))return!0;return!1};Xt.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Ml=g((Y5,jw)=>{"use strict";var Km=Me(),Nw=nn(),wI=Lm(),qw={};jw.exports=qw.merge=function(t,e,n){if(Km(t&&typeof t=="object","Invalid target value: must be an object"),Km(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)){Km(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(Nw(e[i],{symbols:n.symbols}));return t}let r=wI.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]=Nw(o,{symbols:n.symbols}):qw.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var Fw=g(Ll=>{"use strict";var Wr=Me(),Vm=Ze(),EI=Ur(),kr={};Ll.Ids=kr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new kr.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())Wr(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())Wr(!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)};Wr(Vm.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:kr.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);Wr(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||!Vm.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);Wr(!r||r.schema===t,"Cannot add different schemas with the same id:",n),Wr(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(Wr(!this._byKey.has(e),"Schema already contains key:",e),Wr(!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);Wr(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)}};kr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=Ll.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};Ll.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=kr.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=kr.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=kr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};kr.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=kr.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&Vm.isSchema(t)||n.ref!==!1&&EI.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=kr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var Bw=g((Z5,$w)=>{"use strict";$w.exports=function(){}});var Ww=g((eU,Hw)=>{"use strict";var AI=nn(),Uw=Qi(),OI=Ze(),xr={value:Symbol("value")};Hw.exports=xr.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 xr.State(t,e,this);return n&&r.schemas&&(r.schemas=[xr.schemas(n),...r.schemas]),r}nest(t,e){let n=new xr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[xr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new xr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=AI(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()}};xr.schemas=function(t){return OI.isSchema(t)?{schema:t}:t};xr.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[xr.value]=e}get(t){let e=this.node(t);if(e)return e[xr.value]}node(t){if(this._values)return Uw(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=Uw(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var Kw=g(qa=>{"use strict";var Na=Me(),Gw=nn(),oo=Bw(),CI=Qi(),Ct=Ze(),xi=Br(),RI=Ww(),Se={result:Symbol("result")};qa.entry=function(t,e,n){let r=Ct.defaults;n&&(Na(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),Na(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Ct.preferences(Ct.defaults,n));let i=Se.entry(t,e,r);Na(!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=xi.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};qa.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,b,_,E=l.length?[a]:[],L=l.length?CI(t,l):t;if(l.length){b=l[l.length-1];let M=a;for(let x of l.slice(0,-1))M=M[x],E.unshift(M);_=E[0],p=_[b]}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 xi.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"),_[b]=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=xi.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=xi.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 RI([],[],{mainstay:a,schemas:u}),l=qa.validate(t,e,c,n);i&&e.$_root.untrace();let d=xi.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?(Na(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:Se.ignore}};qa.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,b)=>e.$_createError(d,t,p,b||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:Se.errorsArray,warn:(d,p,b)=>n.mainstay.warnings.push(s(d,p,b)),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),b=c[d].resolve(t,i,s),_=p.normalize?p.normalize(b):b,E=Ct.validateArg(_,null,p);if(E){u=r.$_createError("any.ref",b,{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 xi.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)Na(a instanceof Error||a instanceof xi.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:xi.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?[Gw(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):Gw(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:oo,entry:oo,filter:oo,log:oo,resolve:oo,value:oo};Se.errorsArray=function(){let t=[];return t[Ct.symbols.errors]=!0,t}});var Xm=g((sU,zw)=>{"use strict";var PI=Me(),Vw=La(),zm=Ze(),Gr={};zw.exports=Gr.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=Gr.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(zm.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 Gr.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(zm.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(Vw(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(Vw(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 Gr.Values(this._values,this._refs);return t._override=this._override,t}concat(t){PI(!t._override,"Cannot concat override set of values");let e=new Gr.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}};Gr.Values.prototype[zm.symbols.values]=!0;Gr.Values.prototype.slice=Gr.Values.prototype.clone;Gr.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 n0=g((aU,t0)=>{"use strict";var ne=Me(),Xw=nn(),Yw=La(),Ym=Ml(),DI=Fm(),vt=Ze(),Jm=ts(),II=Br(),MI=$m(),Jw=Hm(),LI=ro(),Qw=Fw(),Zw=Ur(),e0=Gm(),Nl=Kw(),ql=Xm(),Lt={};Lt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new Qw.Ids,this._preferences=null,this._refs=new Zw.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=Jm.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||DI.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,Zw.toSibling),e._preferences=e._preferences?vt.preferences(e._preferences,t._preferences):t._preferences,e._valids=ql.merge(e._valids,t._valids,t._invalids),e._invalids=ql.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,Ym(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,Ym(e._flags,n)}else Ym(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"),MI.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=Xw(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 e0.location?e0.location(this):this}validate(t,e){return Nl.entry(t,this,e)}validateAsync(t,e){return Nl.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 Jm.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?LI.merge(this._definition.messages,s.messages):this._definition.messages;return new II.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=!Nl.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return vt.assertOptions(t,["each","once","ref","schema"]),Qw.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(Yw(e,r.default)&&(e=void 0),Yw(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 Nl.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=Xw(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:b,then:_,otherwise:E}=l[p],L=`${a}${u.switch?"."+p:""}`;if(b.$_match(c,e.nest(b,`${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 ql:r&&(n[e]=t.length?new ql: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:Jm.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;t0.exports=new Lt.Base});var Un=g((cU,r0)=>{"use strict";var jl=Me(),NI=n0(),qI=Ze(),jI=ro();r0.exports=NI.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 jl(typeof t=="function","Method must be a function"),jl(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){jl(qI.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 jl(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=jI.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 o0=g((lU,s0)=>{"use strict";var rs=Me(),FI=Ml(),$I=Un(),i0=Ze(),BI=ts(),Fl=Br(),UI=Ur(),ao={};s0.exports=$I.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:UI.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 b=d.schema.$_validate(t,p,s);b.errors?(u.push(b.errors),p.restore()):(a.push(b.value),p.commit())}if(a.length===0){let l={details:u.map(d=>Fl.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=>Fl.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:b,then:_,otherwise:E}=p,L=`match.${a}${u.switch?"."+d:""}`;if(b.$_match(c,i.nest(b,`${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 ao.errors(o,e)},rules:{conditional:{method(t,e){rs(!this._flags._endedSwitch,"Unreachable condition"),rs(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),rs(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=BI.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(rs(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)rs(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){rs(t.length,"Missing alternative schemas"),i0.verifyFlat(t,"try"),rs(!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=>{i0.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}}"}});ao.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 ao.unmatched(t,e);let a=s[0];if(!(a instanceof Fl.Report))return ao.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}:ao.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};ao.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",Fl.details(n,{override:!1}))}}});var u0=g((dU,a0)=>{"use strict";var ja=Me(),HI=La(),WI=Qi(),GI=Un(),Hn=Ze(),KI=ts(),at={};a0.exports=GI.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 b=t[p],_=!1,E=!1,L=c?p:new Number(p),M=[...r.path,L];if(!e._flags.sparse&&b===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(b,r.localize(M,x,C),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:p,value:b},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(b,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(b,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(b,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:b},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 ja(!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=KI.ref(t.by,{ancestor:0}),ja(!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={}){ja(!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||HI,l=s.ignoreUndefined;for(let d=0;d<t.length;++d){let p=a?WI(t[d],a):t[d],b=o?u.custom:u[typeof p];if(ja(b,"Failed to find unique map container for type",typeof p),b instanceof Map){let _=b.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)}b.set(p,d)}else{if((!l||p!==void 0)&&b[p]!==void 0){let _={pos:d,value:t[d],dupePos:b[p],dupeValue:t[b[p]]};a&&(_.path=i);let E=e.localize([...e.path,d],[t,...e.ancestors]);return n("array.unique",_,E)}b[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)&&(ja(!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 p0=g((fU,f0)=>{"use strict";var c0=Me(),VI=Un(),l0=Ze(),d0=Xm(),Qm={};Qm.isBool=function(t){return typeof t=="boolean"};f0.exports=VI.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){l0.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new d0;for(let n=0;n<t.length;++n){let r=t[n];c0(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){l0.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new d0;for(let n=0;n<t.length;++n){let r=t[n];c0(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:Qm.isBool,to(t,e){return t?1:0}},string:{from:Qm.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 y0=g((pU,m0)=>{"use strict";var h0=Me(),zI=Un(),g0=Ze(),XI=Si(),sr={};sr.isDate=function(t){return t instanceof Date};m0.exports=zI.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:sr.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 g0.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:sr.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return h0(["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 h0(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:sr.isDate,to(t,e){return t.getTime()}},string:{from:sr.isDate,to(t,{prefs:e}){return XI.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"}});sr.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 g0.isIsoDate(t)?sr.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return sr.date(1*t);if(e==="unix")return sr.date(1e3*t);if(typeof n=="string")return null}return sr.date(t)};sr.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var S0=g((hU,T0)=>{"use strict";var $l=Me(),v0=nn(),_0=Ml(),b0=Qi(),Bl={};T0.exports=function(t,e,n={}){if($l(t&&typeof t=="object","Invalid defaults value: must be an object"),$l(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),$l(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return Bl.applyToDefaultsWithShallow(t,e,n);let r=v0(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return _0(r,e,{nullOverride:i,mergeArrays:!1})};Bl.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;$l(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=b0(t,u);c&&typeof c=="object"?i.set(c,s&&b0(e,u)||c):s&&s.add(u)}let o=v0(t,{},i);if(!s)return o;for(let u of s)Bl.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return _0(o,e,{nullOverride:a,mergeArrays:!1})};Bl.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 w0=g(x0=>{"use strict";var is=Me(),k0={};x0.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(t,e){e=e||{};let n=[].concat(e.before||[]),r=[].concat(e.after||[]),i=e.group||"?",s=e.sort||0;is(!n.includes(i),`Item cannot come before itself: ${i}`),is(!n.includes("?"),"Item cannot come before unassociated items"),is(!r.includes(i),`Item cannot come after itself: ${i}`),is(!r.includes("?"),"Item cannot come after unassociated items"),Array.isArray(t)||(t=[t]);for(let o of t){let a={seq:this._items.length,sort:s,before:n,after:r,group:i,node:o};this._items.push(a)}if(!e.manual){let o=this._sort();is(o,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(t){Array.isArray(t)||(t=[t]);for(let n of t)if(n)for(let r of n._items)this._items.push(Object.assign({},r));this._items.sort(k0.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return is(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return is(t,"sort created a dependencies error"),this.nodes}_sort(){let t={},e=Object.create(null),n=Object.create(null);for(let a of this._items){let u=a.seq,c=a.group;n[c]=n[c]||[],n[c].push(u),t[u]=a.before;for(let l of a.after)e[l]=e[l]||[],e[l].push(u)}for(let a in t){let u=[];for(let c in t[a]){let l=t[a][c];n[l]=n[l]||[],u.push(...n[l])}t[a]=u}for(let a in e)if(n[a])for(let u of n[a])t[u].push(...e[a]);let r={};for(let a in t){let u=t[a];for(let c of u)r[c]=r[c]||[],r[c].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let c=0;c<this._items.length;++c){if(i[c]===!0)continue;r[c]||(r[c]=[]);let l=r[c].length,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}};k0.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var ey=g((yU,O0)=>{"use strict";var YI=S0(),Wn=Me(),E0=nn(),JI=w0(),QI=Un(),Yt=Ze(),Zm=ts(),ZI=Br(),A0=Ur(),Ul=Si(),pe={renameDefaults:{alias:!1,multiple:!1,override:!1}};O0.exports=QI.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 Yt.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){Ul.isTemplate(t)||(t=Zm.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=A0.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(!Yt.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)Yt.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 Yt.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Yt.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 Yt.verifyFlat(t,"nand"),pe.dependency(this,"nand",null,t)}},or:{method(...t){return Yt.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"),Yt.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 A0.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 Ul,"Invalid rename to argument"),Wn(e!==t,"Cannot rename key to same name:",t),Yt.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 Ul&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:YI(pe.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return Yt.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 Yt.verifyFlat(t,"xor"),pe.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=Yt.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new JI.Sorter;for(let n of t.$_terms.keys)Yt.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 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};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():{}),Yt.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=Yt.default(i.separator,"."),o=[];for(let u of r)Wn(typeof u=="string",e,"peers must be strings"),o.push(Zm.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=Zm.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 Ul&&(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 b=0;b<t.$_terms.patterns.length;++b){let _=t.$_terms.patterns[b];if(_.regex){let M=_.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${b}`,M?"pass":"error"),!M)continue}else if(!_.schema.$_match(l,i.nest(_.schema,`pattern.${b}`),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[b].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,b=i.localize(i.path,c,p),_=p.$_validate(d,b,s);if(_.errors){let E=ZI.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(!Yt.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 R0=g((_U,C0)=>{"use strict";var ty=Me(),eM=ey();C0.exports=eM.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return ty(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 ty(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 ty(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 D0=g((TU,P0)=>{"use strict";var Kr=Me(),tM=Un(),nM=Ze(),rM=ts(),iM=Br(),Vr={};P0.exports=tM.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}){Kr(e.$_terms.link,"Uninitialized link schema");let i=Vr.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 Vr.generate(t,e,n,r)},rules:{ref:{method(t){Kr(!this.$_terms.link,"Cannot reinitialize schema"),t=rM.ref(t),Kr(t.type==="value"||t.type==="local","Invalid reference type:",t.type),Kr(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){Kr(this.$_terms.link,"Uninitialized link schema"),Kr(nM.isSchema(t),"Invalid schema object"),Kr(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 Kr(e.link,"Invalid link description missing link"),t.ref(e.link)}}});Vr.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}=Vr.perspective(s,n);Vr.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{Vr.assert(!1,"to non-existing schema",s,t,n,r)}return Vr.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};Vr.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}};Vr.assert=function(t,e,n,r,i,s){t||Kr(!1,`"${iM.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var M0=g((SU,I0)=>{"use strict";var ny=Me(),sM=Un(),ry=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))))}};I0.exports=sM.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(!ry.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 ry.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:ry.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 ny(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 ny(["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 ny(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 N0=g((kU,L0)=>{"use strict";var oM=ey();L0.exports=oM.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var iy=g(Hl=>{"use strict";Hl.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"};Hl.code=function(t){return{code:t,error:Hl.codes[t]}}});var sy=g(Wl=>{"use strict";var aM=require("url"),or=iy(),wi={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:aM.URL||URL};Wl.analyze=function(t,e={}){if(!t)return or.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return or.code("DOMAIN_TOO_LONG");if(!!wi.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return or.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(wi.domainControlRx.test(t))return or.code("DOMAIN_INVALID_CHARS");t=wi.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||wi.minDomainSegments,i=t.split(".");if(i.length<r)return or.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return or.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 or.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return or.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return or.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!wi.domainSegmentRx.test(a))return or.code("DOMAIN_INVALID_CHARS")}else if(!wi.tldSegmentRx.test(a))return or.code("DOMAIN_INVALID_TLDS_CHARS")}return null};Wl.isValid=function(t,e){return!Wl.analyze(t,e)};wi.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new wi.URL(`http://${t}`).host}catch{return t}}});var q0=g(oy=>{"use strict";var uM=require("util"),cM=sy(),wr=iy(),sn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(uM.TextEncoder||TextEncoder)};oy.analyze=function(t,e){return sn.email(t,e)};oy.isValid=function(t,e){return!sn.email(t,e)};sn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return wr.code("EMPTY_STRING");let n=!sn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return wr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?wr.code("MULTIPLE_AT_CHAR"):wr.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return wr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return wr.code("ADDRESS_TOO_LONG");if(sn.encoder.encode(i).length>64)return wr.code("LOCAL_TOO_LONG")}return sn.local(i,n)||cM.analyze(s,e)};sn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return wr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!sn.atextRx.test(r))return wr.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(sn.atextRx.test(i))continue;let s=sn.binary(i);if(!sn.atomRx.test(s))return wr.code("INVALID_LOCAL_CHARS")}}};sn.binary=function(t){return Array.from(sn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};sn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;sn.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 ay=g((AU,j0)=>{"use strict";j0.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var cy=g(uy=>{"use strict";var Gl=Me(),lM=ay(),Ut={};Ut.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,b="(?:"+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+"|"+b+"|"+_+"|"+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};Ut.rfc3986=Ut.generate();uy.ip={v4Cidr:Ut.rfc3986.ipv4Cidr,v6Cidr:Ut.rfc3986.ipv6Cidr,ipv4:Ut.rfc3986.ipv4address,ipv6:Ut.rfc3986.ipv6address,ipvfuture:Ut.rfc3986.ipvFuture};Ut.createRegex=function(t){let e=Ut.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Ut.wrap(i+r);let s="";if(t.scheme){Gl(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);Gl(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];Gl(p instanceof RegExp||typeof p=="string","scheme at position "+d+" must be a RegExp or String"),p instanceof RegExp?l.push(p.source.toString()):(Gl(e.schemeRegex.test(p),"scheme at position "+d+" must be a valid scheme"),l.push(lM(p)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return Ut.wrap(u+r,s)};Ut.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Ut.uriRegex=Ut.createRegex({});uy.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Ut.createRegex(t):Ut.uriRegex}});var $0=g(F0=>{"use strict";var uo=Me(),Fa=cy();F0.regex=function(t={}){uo(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";uo(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),uo(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]),uo(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)uo(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),uo(["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 Fa.ip[o];let a=`\\/${o==="ipv4"?Fa.ip.v4Cidr:Fa.ip.v6Cidr}`;return e==="required"?`${Fa.ip[o]}${a}`:`${Fa.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var H0=g((RU,U0)=>{"use strict";var B0={};B0.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"];U0.exports=new Set(B0.tlds.map(t=>t.toLowerCase()))});var z0=g((PU,V0)=>{"use strict";var Ue=Me(),Kl=sy(),dM=q0(),K0=$0(),W0=ay(),G0=H0(),fM=cy(),pM=Un(),on=Ze(),Pe={tlds:G0 instanceof Set?{tlds:{allow:G0,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:K0.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"]};V0.exports=pM.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(t,{schema:e,state:n,prefs:r}){let i=e.$_getRule("normalize");i&&(t=t.normalize(i.args.form));let s=e.$_getRule("case");s&&(t=s.args.direction==="upper"?t.toLocaleUpperCase():t.toLocaleLowerCase());let o=e.$_getRule("trim");if(o&&o.args.enabled&&(t=t.trim()),e.$_terms.replacements)for(let u of e.$_terms.replacements)t=t.replace(u.pattern,u.replacement);let a=e.$_getRule("hex");if(a&&a.args.options.byteAligned&&t.length%2!==0&&(t=`0${t}`),e.$_getRule("isoDate")){let u=Pe.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(on.isResolvable(c)&&(c=c.resolve(t,n,r),!on.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 on.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 Pe.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 on.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(Pe.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Pe.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&on.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Pe.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return Kl.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){on.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=Pe.addressOptions(t),n=new RegExp(`\\s*[${t.separator?W0(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)dM.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){on.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=Pe.guidVersions[a.toLowerCase()];Ue(u,"version at position "+o+" must be one of "+Object.keys(Pe.guidVersions).join(", ")),Ue(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Ue(Pe.guidSeparators.has(t.separator),'separator must be one of true, false, "-", or ":"');let n=t.separator===void 0?"[:-]?":t.separator===!0?"[:-]":t.separator===!1?"[]?":`\\${t.separator}`,r=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${e||"0-9A-F"}][0-9A-F]{3}\\2?[${e?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:t},regex:r})},validate(t,e,n,{regex:r}){let i=r.exec(t);return!i||Pe.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return on.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"?Pe.hexRegex.withOptionalPrefix:n.prefix===!0?Pe.hexRegex.withPrefix:Pe.hexRegex.withoutPrefix).test(t)?n.byteAligned&&t.length%2!==0?e.error("string.hexAlign"):t:e.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate(t,e){return Kl.isValid(t,{minDomainSegments:1})||Pe.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){on.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=K0.regex(t),i=t.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:e,version:i}},regex:r})},validate(t,e,{options:n},{regex:r}){return r.test(t)?t:n.version?e.error("string.ipVersion",{value:t,cidr:n.cidr,version:n.version}):e.error("string.ip",{value:t,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(t,{error:e}){return Pe.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Pe.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Pe.length(this,"length",t,"=",e)},validate(t,e,{limit:n,encoding:r},{name:i,operator:s,args:o}){let a=r?Buffer&&Buffer.byteLength(t,r):t.length;return on.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:on.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Pe.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Pe.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Ue(Pe.normalizationForms.includes(t),"normalization form must be one of "+Pe.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:t}})},validate(t,{error:e},{form:n}){return t===t.normalize(n)?t:e("string.normalize",{value:t,form:n})},convert:!0},pattern:{alias:"regex",method(t,e={}){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}),on.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(W0(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={}){on.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&on.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=fM.regex(t),r=t.domain?Pe.addressOptions(t.domain):null;return this.$_addRule({name:"uri",args:{options:t},regex:e,domain:r,scheme:n})},validate(t,e,{options:n},{regex:r,domain:i,scheme:s}){if(["http:/","https:/"].includes(t))return e.error("string.uri");let o=r.exec(t);if(!o&&e.prefs.convert&&n.encodeUri){let a=encodeURI(t);o=r.exec(a),o&&(t=a)}if(o){let a=o[1]||o[2];return i&&(!n.allowRelative||a)&&!Kl.isValid(a,i)?e.error("string.domain",{value:a}):t}return n.relativeOnly?e.error("string.uriRelativeOnly"):n.scheme?e.error("string.uriCustomScheme",{scheme:s,value:t}):e.error("string.uri")}}},manifest:{build(t,e){if(e.replacements)for(let{pattern:n,replacement:r}of e.replacements)t=t.replace(n,r);return t}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}});Pe.addressOptions=function(t){if(!t)return Pe.tlds||t;if(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(Pe.tlds,"Built-in TLD list disabled"),Object.assign({},t,Pe.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"),Pe.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Ue(Pe.tlds,"Built-in TLD list disabled"),Object.assign({},t,Pe.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"),Pe.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Pe.validateTlds=function(t,e){for(let n of t)Ue(Kl.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Pe.isoDate=function(t){if(!on.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Pe.length=function(t,e,n,r,i){return Ue(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var Y0=g((DU,X0)=>{"use strict";var Vl=Me(),hM=Un(),ly={};ly.Map=class extends Map{slice(){return new ly.Map(this)}};X0.exports=hM.extend({type:"symbol",terms:{map:{init:new ly.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)),Vl(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){Vl(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;Vl(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),Vl(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 Z0=g((MU,Q0)=>{"use strict";var gM=Me(),mM=Un(),J0=Ze();Q0.exports=mM.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 gM(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 Rl=g((LU,rE)=>{"use strict";var os=Me(),yM=nn(),bM=Fm(),ss=Ze(),vM=ts(),fy=Br(),_M=$m(),eE=Hm(),dy=Ur(),tE=Si(),nE=Gm(),zl,Rt={types:{alternatives:o0(),any:Un(),array:u0(),boolean:p0(),date:y0(),function:R0(),link:D0(),number:M0(),object:N0(),string:z0(),symbol:Y0()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Rt.types.binary=Z0());Rt.root=function(){let t={_types:new Set(Object.keys(Rt.types))};for(let e of t._types)t[e]=function(...n){return os(!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,nE.setup&&nE.setup(t),t};Rt.methods={ValidationError:fy.ValidationError,version:ss.version,cache:bM.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 os(typeof eE.build=="function","Manifest functionality disabled"),eE.build(this,t)},checkPreferences(t){ss.checkPreferences(t)},compile(t,e){return vM.compile(this,t,e)},defaults(t){os(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());os(ss.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 tE(...t)},extend(...t){ss.verifyFlat(t,"extend"),zl=zl||Cl(),os(t.length,"You need to provide at least one extension"),this.assert(t,zl.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,zl.extension);let r=Rt.expandExtension(n,e);for(let i of r){os(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=_M.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Rt.generate(this,o,a)}}}return e},isError:fy.ValidationError.isError,isExpression:tE.isTemplate,isRef:dy.isRef,isSchema:ss.isSchema,in(...t){return dy.in(...t)},override:ss.symbols.override,ref(...t){return dy.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,ss.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 fy.ValidationError||(a=yM(a)),a.message=i?`${i} ${u}`:u,a};Rt.generate=function(t,e,n){return os(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};rE.exports=Rt.root()});var iE=g(ke=>{"use strict";var TM=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=TM(Rl()),Xl=Xi();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(Xl.SignatureDefinitionBaseType.String).required(),value:oe.default.string().allow("").required()});ke.signatureDefinitionFunctionSchemaArgDefaultNumber=oe.default.object({type:oe.default.string().valid(Xl.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(Xl.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(Xl.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 my=g(gn=>{"use strict";var co=gn&&gn.__assign||function(){return co=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},co.apply(this,arguments)},SM=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},Ei=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.")},py=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},kM=gn&&gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gn,"__esModule",{value:!0});gn.Signature=void 0;var hy=kM(Rl()),gy=iE(),xM=Xi(),wM=Al(),EM=Pm(),AM=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;hy.default.assert(e,gy.signatureDefinitionContainerSchema);var i={};try{for(var s=Ei(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=py(o.value,2),u=a[0],c=a[1],l=c.type===xM.SignatureDefinitionBaseType.Function?EM.SignatureDefinitionFunction.parse(c):wM.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;hy.default.assert(e,gy.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=SM(e,["$meta"]);u=c,a=l}var d={};try{for(var p=Ei(Object.entries(a)),b=p.next();!b.done;b=p.next()){var _=py(b.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{b&&!b.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}return co({$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;hy.default.assert(e,gy.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=Ei(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=py(u.value,2),l=c[0],d=c[1],p=t.parseDescriptions(d);s.addDescriptions(l,p)}}catch(b){r={error:b}}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=Ei(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=Ei(o),u=a.next();!u.done;u=a.next()){var c=u.value;s[c]=co(co({},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=Ei(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=Ei(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 b=Ei(p),_=b.next();!_.done;_=b.next()){var l=_.value;d[l]=co({},d[l])}}catch(E){r={error:E}}finally{try{_&&!_.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}return s._descriptions=d,s._definitions=o,s},t}();gn.Signature=AM});var sE=g(Ar=>{"use strict";var Ai=Ar&&Ar.__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},lo=Ar&&Ar.__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))},$a=Ar&&Ar.__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(Ar,"__esModule",{value:!0});Ar.Container=void 0;var Er=my(),_t=Xi(),OM=function(){function t(){this._primitives=new Map([[_t.SignatureDefinitionBaseType.Any,new Er.Signature({type:_t.SignatureDefinitionBaseType.Any})],[_t.SignatureDefinitionBaseType.General,new Er.Signature({type:_t.SignatureDefinitionBaseType.General})],[_t.SignatureDefinitionBaseType.String,new Er.Signature({type:_t.SignatureDefinitionBaseType.String})],[_t.SignatureDefinitionBaseType.Function,new Er.Signature({type:_t.SignatureDefinitionBaseType.Function})],[_t.SignatureDefinitionBaseType.Number,new Er.Signature({type:_t.SignatureDefinitionBaseType.Number})],[_t.SignatureDefinitionBaseType.List,new Er.Signature({type:_t.SignatureDefinitionBaseType.List})],[_t.SignatureDefinitionBaseType.Map,new Er.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 Er.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 lo(lo([],Ai(this._primitives.keys()),!1),Ai(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 lo(lo([],Ai(this.getAllPrimitiveSignatures()),!1),Ai(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return lo(lo([],Ai(this.getAllPrimitiveSignatures()),!1),Ai(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=Er.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=$a(o),u=a.next();!u.done;u=a.next()){var c=u.value,l=Er.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=$a(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=$a(o),l=c.next();!l.done;l=c.next()){var d=l.value;if(!this._excludeFromSearch.has(d)){for(var p=d,b=this.getTypeSignature(d),_=null;b!==null&&!a.has(b.getType())&&(a.add(b.getType()),b.isHidden()||(_=b.getDefinition(n,r)),_===null);)p=b.getExtendedType(),b=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=$a(this._primitives),a=o.next();!a.done;a=o.next()){var u=Ai(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=$a(this._types),p=d.next();!p.done;p=d.next()){var b=Ai(p.value,2),c=b[0],l=b[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}();Ar.Container=OM});var aE=g(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0})});var Gn=g(ht=>{"use strict";var CM=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]}),uE=ht&&ht.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&CM(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 RM=Rm();Object.defineProperty(ht,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return RM.SignatureDefinitionFunctionArg}});var PM=Pm();Object.defineProperty(ht,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return PM.SignatureDefinitionFunction}});var DM=Ra();Object.defineProperty(ht,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return DM.SignatureDefinitionTypeMeta}});var IM=Al();Object.defineProperty(ht,"SignatureDefinition",{enumerable:!0,get:function(){return IM.SignatureDefinition}});var MM=my();Object.defineProperty(ht,"Signature",{enumerable:!0,get:function(){return MM.Signature}});var LM=sE();Object.defineProperty(ht,"Container",{enumerable:!0,get:function(){return LM.Container}});var NM=El();Object.defineProperty(ht,"VariationRegistry",{enumerable:!0,get:function(){return NM.VariationRegistry}});uE(aE(),ht);uE(Xi(),ht)});var yy=g(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.enrichWithMetaInformation=as.FunctionBlockTag=void 0;var qM=Cm(),cE=Gn();function lE(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var Ba;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Example="example"})(Ba=as.FunctionBlockTag||(as.FunctionBlockTag={}));function jM(t){let e=[t.description??"",...t.tags.filter(s=>s.tag===Ba.Description).map(lE)].join(`
103
+ [${u}] ${this.details[a].message}`}return o=o+r,o};Ei.safeStringify=function(t,e){return JSON.stringify(t,Ei.serializer(),e)};Ei.serializer=function(){let t=[],e=[],n=(r,s)=>e[0]===s?"[Circular ~]":"[Circular ~."+t.slice(0,e.indexOf(s)).join(".")+"]";return function(r,s){if(e.length>0){let i=e.indexOf(this);~i?(e.length=i+1,t.length=i+1,t[i]=r):(e.push(this),t.push(r)),~e.indexOf(s)&&(s=n.call(this,r,s))}else e.push(s);if(s){let i=s[Ei.annotations];if(i){if(Array.isArray(s)){let o=[];for(let a=0;a<s.length;++a)i.errors[a]&&o.push(`_$idx$_${i.errors[a].sort().join(", ")}_$end$_`),o.push(s[a]);s=o}else{for(let o in i.errors)s[`${o}_$key$_${i.errors[o].sort().join(", ")}_$end$_`]=s[o],s[o]=void 0;for(let o in i.missing)s[`_$miss$_${o}|${i.missing[o]}_$end$_`]="__missing__"}return s}}return s===1/0||s===-1/0||Number.isNaN(s)||typeof s=="function"||typeof s=="symbol"?"["+s.toString()+"]":s}}});var us=m(Ct=>{"use strict";var CN=NE(),RN=nt(),PN=Gs();Ct.Report=class{constructor(t,e,n,r,s,i,o){if(this.code=t,this.flags=r,this.messages=s,this.path=i.path,this.prefs=o,this.state=i,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=Ct.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 Ct.template(this.value,t,e||this.code,this.state,this.prefs)}};Ct.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};Ct.template=function(t,e,n,r,s){if(!e)return;if(PN.isTemplate(e))return n!=="root"?e:null;let i=s.errors.language;if(RN.isResolvable(i)&&(i=i.resolve(t,r,s)),i&&e[i]){if(e[i][n]!==void 0)return e[i][n];if(e[i]["*"]!==void 0)return e[i]["*"]}return e[n]?e[n]:e["*"]};Ct.label=function(t,e,n,r){if(!n.errors.label)return"";if(t.label)return t.label;let s=e.path;n.errors.label==="key"&&e.path.length>1&&(s=e.path.slice(-1));let i=Ct.path(s);return i||Ct.template(null,n.messages,"root",e,n)||r&&Ct.template(null,r,"root",e,n)||"value"};Ct.process=function(t,e,n){if(!t)return null;let{override:r,message:s,details:i}=Ct.details(t);if(r)return r;if(n.errors.stack)return new Ct.ValidationError(s,i,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new Ct.ValidationError(s,i,e);return Error.stackTraceLimit=o,a};Ct.details=function(t,e={}){let n=[],r=[];for(let s of t){if(s instanceof Error){if(e.override!==!1)return{override:s};let o=s.toString();n.push(o),r.push({message:o,type:"override",context:{error:s}});continue}let i=s.toString();n.push(i),r.push({message:i,path:s.path.filter(o=>typeof o!="object"),type:s.code,context:s.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}};Ct.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof Ct.ValidationError}};Ct.ValidationError.prototype.isJoi=!0;Ct.ValidationError.prototype.name="ValidationError";Ct.ValidationError.prototype.annotate=CN.error});var ls=m(Zn=>{"use strict";var Jn=Ne(),DN=dn(),IN=xi(),pu=nt(),Tb,Qn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};Zn.create=function(t,e={}){Jn(typeof t=="string","Invalid reference key:",t),pu.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Jn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Qn.defaults,e);delete n.prefix;let r=n.separator,s=Qn.context(t,r,e.prefix);if(n.type=s.type,t=s.key,n.type==="value")if(s.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[i,o]=Qn.ancestor(t,r);o&&(t=t.slice(o),t===""&&(t=null)),n.ancestor=i}return n.path=r?t===null?[]:t.split(r):[t],new Qn.Ref(n)};Zn.in=function(t,e={}){return Zn.create(t,{...e,in:!0})};Zn.isRef=function(t){return t?!!t[pu.symbols.ref]:!1};Qn.Ref=class{constructor(t){Jn(typeof t=="object","Invalid reference construction"),pu.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Jn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Jn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Jn(!t.map||Array.isArray(t.map),"options.map must be an array"),Jn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Qn.defaults,t),Jn(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(t,e,n,r,s={}){return Jn(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(n.context,e,s):this.type==="local"?this._resolve(r,e,s):this.ancestor?this.ancestor==="root"?this._resolve(e.ancestors[e.ancestors.length-1],e,s):(Jn(this.ancestor<=e.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(e.ancestors[this.ancestor-1],e,s)):this._resolve(t,e,s)}_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=IN(t,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){let s=this.map.get(r);s!==void 0&&(r=s)}return e.mainstay&&e.mainstay.tracer.resolve(e,this,r),r}toString(){return this.display}absolute(t){return[...t.path.slice(0,-this.ancestor),...this.path]}clone(){return new Qn.Ref(this)}describe(){let t={path:this.path};this.type!=="value"&&(t.type=this.type),this.separator!=="."&&(t.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(t.ancestor=this.ancestor),this.map&&(t.map=[...this.map]);for(let e of["adjust","iterables","render"])this[e]!==null&&this[e]!==void 0&&(t[e]=this[e]);return this.in!==!1&&(t.in=!0),{ref:t}}updateDisplay(){let t=this.key!==null?this.key:"";if(this.type!=="value"){this.display=`ref:${this.type}:${t}`;return}if(!this.separator){this.display=`ref:${t}`;return}if(!this.ancestor){this.display=`ref:${this.separator}${t}`;return}if(this.ancestor==="root"){this.display=`ref:root:${t}`;return}if(this.ancestor===1){this.display=`ref:${t||".."}`;return}let e=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${e}${t||""}`}};Qn.Ref.prototype[pu.symbols.ref]=!0;Zn.build=function(t){return t=Object.assign({},Qn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Qn.Ref(t)};Qn.context=function(t,e,n={}){if(t=t.trim(),n){let r=n.global===void 0?"$":n.global;if(r!==e&&t.startsWith(r))return{key:t.slice(r.length),type:"global"};let s=n.local===void 0?"#":n.local;if(s!==e&&t.startsWith(s))return{key:t.slice(s.length),type:"local"};let i=n.root===void 0?"/":n.root;if(i!==e&&t.startsWith(i))return{key:t.slice(i.length),type:"value",root:!0}}return{key:t,type:"value"}};Qn.ancestor=function(t,e){if(!e)return[1,0];if(t[0]!==e)return[1,0];if(t[1]!==e)return[0,1];let n=2;for(;t[n]===e;)++n;return[n-1,n]};Zn.toSibling=0;Zn.toParent=1;Zn.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?Zn.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(pu.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}Zn.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),Tb=Tb||Gs(),Tb.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new Zn.Manager;return t.refs=DN(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Gs=m(($E,BE)=>{"use strict";var Mh=Ne(),MN=dn(),LN=IE(),NN=ME(),jE=nt(),qE=us(),FE=ls(),We={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}};BE.exports=$E=We.Template=class{constructor(t,e){if(Mh(typeof t=="string","Template source must be a string"),Mh(!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?MN(r):void 0,this._functions=n,this._functions&&(Mh(Object.keys(this._functions).every(s=>typeof s=="string"),"Functions keys must be strings"),Mh(Object.values(this._functions).every(s=>typeof s=="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=We.encode(this.source),e=We.split(t),n=!1,r=[],s=e.shift();s&&r.push(s);for(let i of e){let o=i[0]!=="{",a=o?"}":"}}",u=i.indexOf(a);if(u===-1||i[1]==="{"){r.push(`{${We.decode(i)}`);continue}let l=i.slice(o?0:1,u),c=l[0]===":";c&&(l=l.slice(1));let h=this._ref(We.decode(l),{raw:o,wrapped:c});r.push(h),typeof h!="string"&&(n=!0);let f=i.slice(u+a.length);f&&r.push(We.decode(f))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return We.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 We.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[jE.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,s={}){if(!this.isDynamic())return this.rendered;let i=[];for(let o of this._template)if(typeof o=="string")i.push(o);else{let a=this._part(o,t,e,n,r,s),u=We.stringify(a,t,e,n,r,s);if(u!==void 0){let l=o.raw||(s.errors&&s.errors.escapeHtml)===!1?u:LN(u);i.push(We.wrap(l,o.wrapped&&n.errors.wrap.label))}}return i.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],s=o=>{let a=FE.create(o,this._settings);return r.push(a),u=>{let l=a.resolve(...u);return l!==void 0?l:null}};try{let o=this._functions?{...We.functions,...this._functions}:We.functions;var i=new NN.Parser(t,{reference:s,functions:o,constants:We.constants})}catch(o){throw o.message=`Invalid template variable "${t}" fails due to: ${o.message}`,o}if(i.single){if(i.single.type==="reference"){let o=r[0];return{ref:o,raw:e,refs:r,wrapped:n||o.type==="local"&&o.key==="label"}}return We.stringify(i.single.value)}return{formula:i,raw:e,refs:r}}toString(){return this.source}};We.Template.prototype[jE.symbols.template]=!0;We.Template.prototype.isImmutable=!0;We.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>We.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>We.closes.slice(0,n.length))};We.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};We.split=function(t){let e=[],n="";for(let r=0;r<t.length;++r){let s=t[r];if(s==="{"){let i="";for(;r+1<t.length&&t[r+1]==="{";)i+="{",++r;e.push(n),n=i}else n+=s}return e.push(n),e};We.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};We.stringify=function(t,e,n,r,s,i={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(FE.isRef(t)&&t.render&&(u=t.in,t=t.resolve(e,n,r,s,{in:t.in,...i})),t===null)return"null";if(o==="string")return We.wrap(t,i.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 We.Template.date(t,r);if(t instanceof Map){let c=[];for(let[h,f]of t.entries())c.push(`${h.toString()} -> ${f.toString()}`);t=c}if(!Array.isArray(t))return t.toString();let l=[];for(let c of t)l.push(We.stringify(c,e,n,r,s,{arrayItems:!0,...i}));return We.wrap(l.join(", "),!u&&a.array)};We.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};We.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,s,i]=this,o=i.messages;if(!o)return"";let a=qE.template(e,o[0],t,n,r)||qE.template(e,o[1],t,n,r);return a?a.render(e,n,r,s,i):""},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 Mo=m(gu=>{"use strict";var Ai=Ne(),UE=dn(),qn=Gs();gu.compile=function(t,e){if(typeof t=="string")return Ai(!e,"Cannot set single message string"),new qn(t);if(qn.isTemplate(t))return Ai(!e,"Cannot set single message template"),t;Ai(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?UE(e):{};for(let n in t){let r=t[n];if(n==="root"||qn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new qn(r);continue}Ai(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);let s=n;e[s]=e[s]||{};for(n in r){let i=r[n];if(n==="root"||qn.isTemplate(i)){e[s][n]=i;continue}Ai(typeof i=="string","Invalid message for",n,"in",s),e[s][n]=new qn(i)}}return e};gu.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(qn.isTemplate(r)){e[n]=r.describe({compact:!0});continue}let s=n;e[s]={};for(n in r){let i=r[n];if(n==="root"){e[s].root=i;continue}e[s][n]=i.describe({compact:!0})}}return e};gu.merge=function(t,e){if(!t)return gu.compile(e);if(!e)return t;if(typeof e=="string")return new qn(e);if(qn.isTemplate(e))return e;let n=UE(t);for(let r in e){let s=e[r];if(r==="root"||qn.isTemplate(s)){n[r]=s;continue}if(typeof s=="string"){n[r]=new qn(s);continue}Ai(typeof s=="object"&&!Array.isArray(s),"Invalid message for",r);let i=r;n[i]=n[i]||{};for(r in s){let o=s[r];if(r==="root"||qn.isTemplate(o)){n[i][r]=o;continue}Ai(typeof o=="string","Invalid message for",r,"in",i),n[i][r]=new qn(o)}}return n}});var nt=m(rt=>{"use strict";var Lh=Ne(),qN=yb(),jN=PE(),Sb,kb,FN={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)?)?)?)?$/};rt.version=jN.version;rt.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};rt.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")};rt.assertOptions=function(t,e,n="Options"){Lh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(s=>!e.includes(s));Lh(r.length===0,`${n} contain unknown keys: ${r}`)};rt.checkPreferences=function(t){kb=kb||Dh();let e=kb.preferences.validate(t);if(e.error)throw new qN([e.error.details[0].message])};rt.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}};rt.default=function(t,e){return t===void 0?e:t};rt.isIsoDate=function(t){return FN.isoDate.test(t)};rt.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};rt.isResolvable=function(t){return t?t[rt.symbols.ref]||t[rt.symbols.template]:!1};rt.isSchema=function(t,e={}){let n=t&&t[rt.symbols.any];return n?(Lh(e.legacy||n.version===rt.version,"Cannot mix different versions of joi schemas"),!0):!1};rt.isValues=function(t){return t[rt.symbols.values]};rt.limit=function(t){return Number.isSafeInteger(t)&&t>=0};rt.preferences=function(t,e){Sb=Sb||Mo(),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=Sb.compile(e.messages,t.messages)),delete n[rt.symbols.prefs],n};rt.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}};rt.validateArg=function(t,e,{assert:n,message:r}){if(rt.isSchema(n)){let s=n.validate(t);return s.error?s.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};rt.verifyFlat=function(t,e){for(let n of t)Lh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var wb=m(WE=>{"use strict";var $N=Ne(),BN=dn(),UN=nt(),Lo={max:1e3,supported:new Set(["undefined","boolean","number","string"])};WE.provider={provision(t){return new Lo.Cache(t)}};Lo.Cache=class{constructor(t={}){UN.assertOptions(t,["max"]),$N(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||Lo.max,this._map=new Map,this._list=new Lo.List}get length(){return this._map.size}set(t,e){if(t!==null&&!Lo.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),BN(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};Lo.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 Oi=m(cs=>{"use strict";var mt=Ne(),jn=nt(),No=ls(),er={};cs.schema=function(t,e,n={}){jn.assertOptions(n,["appendPath","override"]);try{return er.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};er.schema=function(t,e,n){mt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(mt(e.length,"Invalid empty array schema"),e.length===1&&(e=e[0]));let r=(s,...i)=>n.override!==!1?s.valid(t.override,...i):s.valid(...i);if(er.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(mt(typeof e=="object","Invalid schema content:",typeof e),jn.isResolvable(e))return r(t,e);if(jn.isSchema(e))return e;if(Array.isArray(e)){for(let s of e)if(!er.simple(s))return t.alternatives().try(...e);return r(t,...e)}return e instanceof RegExp?t.string().regex(e):e instanceof Date?r(t.date(),e):(mt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};cs.ref=function(t,e){return No.isRef(t)?t:No.create(t,e)};cs.compile=function(t,e,n={}){jn.assertOptions(n,["legacy"]);let r=e&&e[jn.symbols.any];if(r)return mt(n.legacy||r.version===jn.version,"Cannot mix different versions of joi schemas:",r.version,jn.version),e;if(typeof e!="object"||!n.legacy)return cs.schema(t,e,{appendPath:!0});let s=er.walk(e);return s?s.compile(s.root,e):cs.schema(t,e,{appendPath:!0})};er.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=er.walk(n);if(r)return r}return null}let e=t[jn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};mt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=er.walk(t[n]);if(r)return r}return null};er.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};cs.when=function(t,e,n){if(n===void 0&&(mt(e&&typeof e=="object","Missing options"),n=e,e=No.create(".")),Array.isArray(n)&&(n={switch:n}),jn.assertOptions(n,["is","not","then","otherwise","switch","break"]),jn.isSchema(e))return mt(n.is===void 0,'"is" can not be used with a schema condition'),mt(n.not===void 0,'"not" can not be used with a schema condition'),mt(n.switch===void 0,'"switch" can not be used with a schema condition'),er.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(mt(No.isRef(e)||typeof e=="string","Invalid condition:",e),mt(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let s=n;n.not!==void 0&&(s={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let i=s.is!==void 0?t.$_compile(s.is):t.$_root.invalid(null,!1,0,"").required();return mt(s.then!==void 0||s.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),mt(s.break===void 0||s.then===void 0||s.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!No.isRef(n.is)&&!jn.isSchema(n.is)&&(i=i.required()),er.condition(t,{ref:cs.ref(e),is:i,then:s.then,otherwise:s.otherwise,break:s.break})}mt(Array.isArray(n.switch),'"switch" must be an array'),mt(n.is===void 0,'Cannot combine "switch" with "is"'),mt(n.not===void 0,'Cannot combine "switch" with "not"'),mt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:cs.ref(e),switch:[],break:n.break};for(let s=0;s<n.switch.length;++s){let i=n.switch[s],o=s===n.switch.length-1;jn.assertOptions(i,o?["is","then","otherwise"]:["is","then"]),mt(i.is!==void 0,'Switch statement missing "is"'),mt(i.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(i.is),then:t.$_compile(i.then)};if(!No.isRef(i.is)&&!jn.isSchema(i.is)&&(a.is=a.is.required()),o){mt(n.otherwise===void 0||i.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');let u=n.otherwise!==void 0?n.otherwise:i.otherwise;u!==void 0&&(mt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};er.condition=function(t,e){for(let n of["then","otherwise"])e[n]===void 0?delete e[n]:e[n]=t.$_compile(e[n]);return e}});var xb=m(GE=>{"use strict";var zs=Ne(),WN=dn(),HE=nt(),HN=Mo(),Fr={};GE.type=function(t,e){let n=Object.getPrototypeOf(t),r=WN(n),s=t._assign(Object.create(r)),i=Object.assign({},e);delete i.base,r._definition=i;let o=n._definition||{};i.messages=HN.merge(o.messages,i.messages),i.properties=Object.assign({},o.properties,i.properties),s.type=i.type,i.flags=Object.assign({},o.flags,i.flags);let a=Object.assign({},o.terms);if(i.terms)for(let h in i.terms){let f=i.terms[h];zs(s.$_terms[h]===void 0,"Invalid term override for",i.type,h),s.$_terms[h]=f.init,a[h]=f}i.terms=a,i.args||(i.args=o.args),i.prepare=Fr.prepare(i.prepare,o.prepare),i.coerce&&(typeof i.coerce=="function"&&(i.coerce={method:i.coerce}),i.coerce.from&&!Array.isArray(i.coerce.from)&&(i.coerce={method:i.coerce.method,from:[].concat(i.coerce.from)})),i.coerce=Fr.coerce(i.coerce,o.coerce),i.validate=Fr.validate(i.validate,o.validate);let u=Object.assign({},o.rules);if(i.rules)for(let h in i.rules){let f=i.rules[h];zs(typeof f=="object","Invalid rule definition for",i.type,h);let g=f.method;if(g===void 0&&(g=function(){return this.$_addRule(h)}),g&&(zs(!r[h],"Rule conflict in",i.type,h),r[h]=g),zs(!u[h],"Rule conflict in",i.type,h),u[h]=f,f.alias){let v=[].concat(f.alias);for(let b of v)r[b]=f.method}f.args&&(f.argsByName=new Map,f.args=f.args.map(v=>(typeof v=="string"&&(v={name:v}),zs(!f.argsByName.has(v.name),"Duplicated argument name",v.name),HE.isSchema(v.assert)&&(v.assert=v.assert.strict().label(v.name)),f.argsByName.set(v.name,v),v)))}i.rules=u;let l=Object.assign({},o.modifiers);if(i.modifiers)for(let h in i.modifiers){zs(!r[h],"Rule conflict in",i.type,h);let f=i.modifiers[h];zs(typeof f=="function","Invalid modifier definition for",i.type,h);let g=function(v){return this.rule({[h]:v})};r[h]=g,l[h]=f}if(i.modifiers=l,i.overrides){r._super=n,s.$_super={};for(let h in i.overrides)zs(n[h],"Cannot override missing",h),i.overrides[h][HE.symbols.parent]=n[h],s.$_super[h]=n[h].bind(s);Object.assign(r,i.overrides)}i.cast=Object.assign({},o.cast,i.cast);let c=Object.assign({},o.manifest,i.manifest);return c.build=Fr.build(i.manifest&&i.manifest.build,o.manifest&&o.manifest.build),i.manifest=c,i.rebuild=Fr.rebuild(i.rebuild,o.rebuild),s};Fr.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};Fr.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 s;if((!e.from||e.from.includes(typeof n))&&(s=e.method(n,r),s)){if(s.errors||s.value===void 0)return s;n=s.value}if(!t.from||t.from.includes(typeof n)){let i=t.method(n,r);if(i)return i}return s}}};Fr.prepare=function(t,e){return!t||!e?t||e:function(n,r){let s=t(n,r);if(s){if(s.errors||s.value===void 0)return s;n=s.value}return e(n,r)||s}};Fr.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};Fr.validate=function(t,e){return!t||!e?t||e:function(n,r){let s=e(n,r);if(s){if(s.errors&&(!Array.isArray(s.errors)||s.errors.length))return s;n=s.value}return t(n,r)||s}}});var Ob=m(Ab=>{"use strict";var $r=Ne(),Nh=dn(),Ci=nt(),GN=Mo(),zE=ls(),zN=Gs(),Eb,pn={};Ab.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=pn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=Nh(t._preferences,{shallow:["messages"]}),delete n.preferences[Ci.symbols.prefs],n.preferences.messages&&(n.preferences.messages=GN.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 i={name:r.name};for(let o in e.modifiers)r[o]!==void 0&&(i[o]=pn.describe(r[o]));if(r.args){i.args={};for(let o in r.args){let a=r.args[o];o==="options"&&!Object.keys(a).length||(i.args[o]=pn.describe(a,{assign:o}))}Object.keys(i.args).length||delete i.args}n.rules.push(i)}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 s=t.$_terms[r];if(!s)continue;if(s instanceof Map){s.size&&(n[r]=[...s.entries()]);continue}if(Ci.isValues(s)){n[r]=s.describe();continue}$r(e.terms[r],"Term",r,"missing configuration");let i=e.terms[r].manifest,o=typeof i=="object";if(!s.length&&!o)continue;let a=[];for(let u of s)a.push(pn.describe(u));if(o){let{from:u,to:l}=i.mapped;n[r]={};for(let c of a)n[r][c[l]]=c[u];continue}if(i==="single"){$r(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return pn.validate(t.$_root,n),n};pn.describe=function(t,e={}){if(Array.isArray(t))return t.map(pn.describe);if(t===Ci.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return Nh(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[Ci.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 s=t[r];s!==void 0&&(n[r]=pn.describe(s,{assign:r}))}return n};Ab.build=function(t,e){return new pn.Builder(t).parse(e)};pn.Builder=class{constructor(t){this.joi=t}parse(t){pn.validate(this.joi,t);let e=this.joi[t.type]()._bare(),n=e._definition;if(t.flags)for(let s in t.flags){let i=n.flags[s]&&n.flags[s].setter||s;$r(typeof e[i]=="function","Invalid flag",s,"for type",t.type),e=e[i](this.build(t.flags[s]))}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 s of t.rules){$r(typeof e[s.name]=="function","Invalid rule",s.name,"for type",t.type);let i=[];if(s.args){let a={};for(let c in s.args)a[c]=this.build(s.args[c],{assign:c});let u=Object.keys(a),l=n.rules[s.name].args;if(l){$r(u.length<=l.length,"Invalid number of arguments for",t.type,s.name,"(expected up to",l.length,", found",u.length,")");for(let{name:c}of l)i.push(a[c])}else $r(u.length===1,"Invalid number of arguments for",t.type,s.name,"(expected up to 1, found",u.length,")"),i.push(a[u[0]])}e=e[s.name](...i);let o={};for(let a in n.modifiers)s[a]!==void 0&&(o[a]=this.build(s[a]));Object.keys(o).length&&(e=e.rule(o))}let r={};for(let s in t){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(s))continue;$r(n.terms[s],"Term",s,"missing configuration");let i=n.terms[s].manifest;if(i==="schema"){r[s]=t[s].map(o=>this.parse(o));continue}if(i==="values"){r[s]=t[s].map(o=>this.build(o));continue}if(i==="single"){r[s]=this.build(t[s]);continue}if(typeof i=="object"){r[s]={};for(let o in t[s]){let a=t[s][o];r[s][o]=this.parse(a)}continue}r[s]=this.build(t[s])}return t.whens&&(r.whens=t.whens.map(s=>this.build(s))),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 Nh(t);if(e.assign==="regex")return pn.regex(t);if(e.assign==="ref")return zE.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{[Ci.symbols.literal]:!0,literal:t.function};if(t.override)return Ci.symbols.override;if(t.ref)return zE.build(t.ref);if(t.regex)return pn.regex(t.regex);if(t.special)return $r(["deep"].includes(t.special),"Unknown special value",t.special),Ci.symbols.deepDefault;if(t.value)return Nh(t.value)}if(t.type)return this.parse(t);if(t.template)return zN.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};pn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};pn.validate=function(t,e){Eb=Eb||Dh(),t.assert(e,Eb.description)}});var mu=m((o4,KE)=>{"use strict";var Br=vb(),rn={mismatched:null};KE.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!rn.isDeepEqual(t,e,n,[])};rn.isDeepEqual=function(t,e,n,r){if(t===e)return t!==0||1/t===1/e;let s=typeof t;if(s!==typeof e||t===null||e===null)return!1;if(s==="function"){if(!n.deepFunction||t.toString()!==e.toString())return!1}else if(s!=="object")return t!==t&&e!==e;let i=rn.getSharedType(t,e,!!n.prototype);switch(i){case Br.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Br.promise:return t===e;case Br.regex:return t.toString()===e.toString();case rn.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new rn.SeenEntry(t,e));try{return!!rn.isDeepEqualObj(i,t,e,n,r)}finally{r.pop()}};rn.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?rn.mismatched:Br.getInternalProto(t);let r=Br.getInternalProto(t);return r!==Br.getInternalProto(e)?rn.mismatched:r};rn.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};rn.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};rn.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};rn.isDeepEqualObj=function(t,e,n,r,s){let{isDeepEqual:i,valueOf:o,hasOwnEnumerableProperty:a}=rn,{keys:u,getOwnPropertySymbols:l}=Object;if(t===Br.array)if(r.part){for(let v of e)for(let b of n)if(i(v,b,r,s))return!0}else{if(e.length!==n.length)return!1;for(let v=0;v<e.length;++v)if(!i(e[v],n[v],r,s))return!1;return!0}else if(t===Br.set){if(e.size!==n.size)return!1;if(!rn.isSetSimpleEqual(e,n)){let v=new Set(Set.prototype.values.call(n));for(let b of Set.prototype.values.call(e)){if(v.delete(b))continue;let O=!1;for(let A of v)if(i(b,A,r,s)){v.delete(A),O=!0;break}if(!O)return!1}}}else if(t===Br.map){if(e.size!==n.size)return!1;for(let[v,b]of Map.prototype.entries.call(e))if(b===void 0&&!Map.prototype.has.call(n,v)||!i(b,Map.prototype.get.call(n,v),r,s))return!1}else if(t===Br.error&&(e.name!==n.name||e.message!==n.message))return!1;let c=o(e),h=o(n);if((e!==c||n!==h)&&!i(c,h,r,s))return!1;let f=u(e);if(!r.part&&f.length!==u(n).length&&!r.skip)return!1;let g=0;for(let v of f){if(r.skip&&r.skip.includes(v)){n[v]===void 0&&++g;continue}if(!a(n,v)||!i(e[v],n[v],r,s))return!1}if(!r.part&&f.length-g!==u(n).length)return!1;if(r.symbols!==!1){let v=l(e),b=new Set(l(n));for(let O of v){if(!r.skip||!r.skip.includes(O)){if(a(e,O)){if(!a(n,O)||!i(e[O],n[O],r,s))return!1}else if(a(n,O))return!1}b.delete(O)}for(let O of b)if(a(n,O))return!1}return!0};rn.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var XE=m(VE=>{"use strict";VE.location=function(t=0){let e=Error.prepareStackTrace;Error.prepareStackTrace=(s,i)=>i;let n={};Error.captureStackTrace(n,this);let r=n.stack[t+1];return Error.prepareStackTrace=e,{filename:r.getFileName(),line:r.getLineNumber()}}});var Rb=m(Cb=>{"use strict";var YE=mu(),JE=XE(),KN=us(),sn={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Cb.setup=function(t){let e=function(){return t._tracer=t._tracer||new sn.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Cb.location=function(t){return t.$_setFlag("_tracerLocation",JE.location(2))};sn.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(t){let e=this._schemas.get(t);if(e)return e.store;let n=new sn.Store(t),{filename:r,line:s}=t._flags._tracerLocation||JE.location(5);return this._schemas.set(t,{filename:r,line:s,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:s}of this._schemas.values()){if(t&&t!==n)continue;let i=[],o=[];for(let[a,u]of s._sources.entries()){if(sn.sub(u.paths,o))continue;if(!u.entry){i.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let c of["valid","invalid"]){let h=a[`_${c}s`];if(!h)continue;let f=new Set(h._values),g=new Set(h._refs);for(let{value:v,ref:b}of u[c])f.delete(v),g.delete(b);(f.size||g.size)&&i.push({status:[...f,...[...g].map(v=>v.display)],rule:`${c}s`})}let l=a._rules.map(c=>c.name);for(let c of["default","failover"])a._flags[c]!==void 0&&l.push(c);for(let c of l){let h=sn.labels[u.rule[c]||0];if(h){let f={rule:c,status:h};u.paths.size&&(f.paths=[...u.paths]),i.push(f)}}}i.length&&e.push({filename:n,line:r,missing:i,severity:"error",message:`Schema missing tests for ${i.map(sn.message).join(", ")}`})}return e.length?e:null}};sn.Store=class{constructor(t){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(t)}debug(t,e,n,r){t.mainstay.debug&&t.mainstay.debug.push({type:e,name:n,result:r,path:t.path})}entry(t,e){sn.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){sn.debug(e,{type:n,...r}),this._record(t,s=>{s[n].add(r)})}log(t,e,n,r,s){sn.debug(e,{type:n,name:r,result:s==="full"?"pass":s}),this._record(t,i=>{i[n][r]=i[n][r]||0,i[n][r]|=sn.codes[s]})}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,s){if(!t.mainstay.debug||YE(n,r))return;let i={type:"value",by:e,from:n,to:r,path:t.path};s&&(i.name=s),t.mainstay.debug.push(i)}_record(t,e){let n=this._sources.get(t);if(n){e(n);return}let r=this._combos.get(t);for(let s of r)this._record(s,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 s=(i,o)=>{let a=sn.id(i,o);this._scan(i,n.concat(a))};t.$_modify({each:s,ref:!1})}_combine(t,e){this._combos.set(t,e)}};sn.message=function(t){return`${t.paths?KN.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};sn.id=function(t,{source:e,name:n,path:r,key:s}){return t._flags.id?t._flags.id:s||(n=`@${n}`,e==="terms"?[n,r[Math.min(r.length-1,1)]]:n)};sn.sub=function(t,e){for(let n of t)for(let r of e)if(YE(n.slice(0,r.length),r))return!0;return!1};sn.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var qh=m((f4,eA)=>{"use strict";var Pb=Ne(),QE=dn(),VN=_b(),ZE={};eA.exports=ZE.merge=function(t,e,n){if(Pb(t&&typeof t=="object","Invalid target value: must be an object"),Pb(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)){Pb(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let s=0;s<e.length;++s)t.push(QE(e[s],{symbols:n.symbols}));return t}let r=VN.keys(e,n);for(let s=0;s<r.length;++s){let i=r[s];if(i==="__proto__"||!Object.prototype.propertyIsEnumerable.call(e,i))continue;let o=e[i];if(o&&typeof o=="object"){if(t[i]===o)continue;!t[i]||typeof t[i]!="object"||Array.isArray(t[i])!==Array.isArray(o)||o instanceof Date||Buffer&&Buffer.isBuffer(o)||o instanceof RegExp?t[i]=QE(o,{symbols:n.symbols}):ZE.merge(t[i],o,n)}else(o!=null||n.nullOverride)&&(t[i]=o)}return t}});var tA=m(jh=>{"use strict";var hs=Ne(),Db=nt(),XN=ls(),Ur={};jh.Ids=Ur.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new Ur.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())hs(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())hs(!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 s=r.shift(),i={id:s.id,schema:e(s.schema)};hs(Db.isSchema(i.schema),"adjuster function failed to return a joi schema type");for(let o of r)i={id:o.id,schema:Ur.fork(o.schema,i.id,i.schema)};return i.schema}labels(t,e=[]){let n=t[0],r=this._get(n);if(!r)return[...e,...t].join(".");let s=t.slice(1);return e=[...e,r.schema._flags.label||n],s.length?r.schema._ids.labels(s,e):e.join(".")}reach(t,e=[]){let n=t[0],r=this._get(n);hs(r,"Schema does not contain path",[...e,...t].join("."));let s=t.slice(1);return s.length?r.schema._ids.reach(s,[...e,n]):r.schema}register(t,{key:e}={}){if(!t||!Db.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);hs(!r||r.schema===t,"Cannot add different schemas with the same id:",n),hs(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(hs(!this._byKey.has(e),"Schema already contains key:",e),hs(!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],s=this._get(r);hs(s,"Schema does not contain path",[...e,...t].join(".")),n=[s,...n];let i=t.slice(1);return i.length?s.schema._ids._collect(i,[...e,r],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}};Ur.fork=function(t,e,n){let r=(i,{key:o})=>{if(e===(i._flags.id||o))return n},s=jh.schema(t,{each:r,ref:!1});return s?s.$_mutateRebuild():t};jh.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let s=Ur.scan(t._flags[r],{source:"flags",name:r},e);s!==void 0&&(n=n||t.clone(),n._flags[r]=s)}for(let r=0;r<t._rules.length;++r){let s=t._rules[r],i=Ur.scan(s.args,{source:"rules",name:s.name},e);if(i!==void 0){n=n||t.clone();let o=Object.assign({},s);o.args=i,n._rules[r]=o,n._singleRules.get(s.name)===s&&n._singleRules.set(s.name,o)}}for(let r in t.$_terms){if(r[0]==="_")continue;let s=Ur.scan(t.$_terms[r],{source:"terms",name:r},e);s!==void 0&&(n=n||t.clone(),n.$_terms[r]=s)}return n};Ur.scan=function(t,e,n,r,s){let i=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,l=Ur.scan(t[a],e,n,[a,...i],u);l!==void 0&&(o=o||t.slice(),o[a]=l)}return o}if(n.schema!==!1&&Db.isSchema(t)||n.ref!==!1&&XN.isRef(t)){let a=n.each(t,{...e,path:i,key:s});return a===t?void 0:a}for(let a in t){if(a[0]==="_")continue;let u=Ur.scan(t[a],e,n,[a,...i],s);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var rA=m((g4,nA)=>{"use strict";nA.exports=function(){}});var oA=m((m4,iA)=>{"use strict";var YN=dn(),sA=xi(),JN=nt(),Wr={value:Symbol("value")};iA.exports=Wr.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 Wr.State(t,e,this);return n&&r.schemas&&(r.schemas=[Wr.schemas(n),...r.schemas]),r}nest(t,e){let n=new Wr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[Wr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new Wr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=YN(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()}};Wr.schemas=function(t){return JN.isSchema(t)?{schema:t}:t};Wr.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 s=0;s<t.length;++s){let i=t[s],o=r.get(i);o||(o=new Map,r.set(i,o)),r=o}r[Wr.value]=e}get(t){let e=this.node(t);if(e)return e[Wr.value]}node(t){if(this._values)return sA(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],s=sA(this._values,n,{iterables:!0});if(e){s.set(r,e);return}s&&s.delete(r)}}});var uA=m(bu=>{"use strict";var yu=Ne(),aA=dn(),qo=rA(),QN=xi(),It=nt(),Ks=us(),ZN=oA(),ke={result:Symbol("result")};bu.entry=function(t,e,n){let r=It.defaults;n&&(yu(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),yu(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=It.preferences(It.defaults,n));let s=ke.entry(t,e,r);yu(!s.mainstay.externals.length,"Schema with external rules must use validateAsync()");let i={value:s.value};return s.error&&(i.error=s.error),s.mainstay.warnings.length&&(i.warning=Ks.details(s.mainstay.warnings)),s.mainstay.debug&&(i.debug=s.mainstay.debug),s.mainstay.artifacts&&(i.artifacts=s.mainstay.artifacts),i};bu.entryAsync=async function(t,e,n){let r=It.defaults;n&&(r=It.preferences(It.defaults,n));let s=ke.entry(t,e,r),i=s.mainstay;if(s.error)throw i.debug&&(s.error.debug=i.debug),s.error;if(i.externals.length){let a=s.value,u=[];for(let l of i.externals){let c=l.state.path,h=l.schema.type==="link"?i.links.get(l.schema):null,f=a,g,v,b=c.length?[a]:[],O=c.length?QN(t,c):t;if(c.length){g=c[c.length-1];let A=a;for(let k of c.slice(0,-1))A=A[k],b.unshift(A);v=b[0],f=v[g]}try{let A=(S,_)=>(h||l.schema).$_createError(S,f,_,l.state,r),k=await l.method(f,{schema:l.schema,linked:h,state:l.state,prefs:n,original:O,error:A,errorsArray:ke.errorsArray,warn:(S,_)=>i.warnings.push((h||l.schema).$_createError(S,f,_,l.state,r)),message:(S,_)=>(h||l.schema).$_createError("external",f,_,l.state,r,{messages:S})});if(k===void 0||k===f)continue;if(k instanceof Ks.Report){if(i.tracer.log(l.schema,l.state,"rule","external","error"),u.push(k),r.abortEarly)break;continue}if(Array.isArray(k)&&k[It.symbols.errors]){if(i.tracer.log(l.schema,l.state,"rule","external","error"),u.push(...k),r.abortEarly)break;continue}v?(i.tracer.value(l.state,"rule",f,k,"external"),v[g]=k):(i.tracer.value(l.state,"rule",a,k,"external"),a=k)}catch(A){throw r.errors.label&&(A.message+=` (${l.label})`),A}}if(s.value=a,u.length)throw s.error=Ks.process(u,t,r),i.debug&&(s.error.debug=i.debug),s.error}if(!r.warnings&&!r.debug&&!r.artifacts)return s.value;let o={value:s.value};return i.warnings.length&&(o.warning=Ks.details(i.warnings)),i.debug&&(o.debug=i.debug),i.artifacts&&(o.artifacts=i.artifacts),o};ke.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()}};ke.entry=function(t,e,n){let{tracer:r,cleanup:s}=ke.tracer(e,n),i=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ke.Mainstay(r,i,o),u=e._ids._schemaChain?[{schema:e}]:null,l=new ZN([],[],{mainstay:a,schemas:u}),c=bu.validate(t,e,l,n);s&&e.$_root.untrace();let h=Ks.process(c.errors,t,n);return{value:c.value,error:h,mainstay:a}};ke.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(yu(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ke.ignore}};bu.validate=function(t,e,n,r,s={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ke.prefs(e,r)),e._cache&&r.cache){let h=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!h),h)return h}let i=(h,f,g)=>e.$_createError(h,t,f,g||n,r),o={original:t,prefs:r,schema:e,state:n,error:i,errorsArray:ke.errorsArray,warn:(h,f,g)=>n.mainstay.warnings.push(i(h,f,g)),message:(h,f)=>e.$_createError("custom",t,f,n,r,{messages:h})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let h=a.prepare(t,o);if(h){if(n.mainstay.tracer.value(n,"prepare",t,h.value),h.errors)return ke.finalize(h.value,[].concat(h.errors),o);t=h.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let h=a.coerce.method(t,o);if(h){if(n.mainstay.tracer.value(n,"coerced",t,h.value),h.errors)return ke.finalize(h.value,[].concat(h.errors),o);t=h.value}}let u=e._flags.empty;u&&u.$_match(ke.trim(t,e),n.nest(u),It.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let l=s.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(l==="forbidden")return ke.finalize(t,null,o);if(l==="required")return ke.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(l==="optional"){if(e._flags.default!==It.symbols.deepDefault)return ke.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(l==="forbidden")return ke.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let c=[];if(e._valids){let h=e._valids.get(t,n,r,e._flags.insensitive);if(h)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,h.value),t=h.value),n.mainstay.tracer.filter(e,n,"valid",h),ke.finalize(t,null,o);if(e._flags.only){let f=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ke.finalize(t,[f],o);c.push(f)}}if(e._invalids){let h=e._invalids.get(t,n,r,e._flags.insensitive);if(h){n.mainstay.tracer.filter(e,n,"invalid",h);let f=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ke.finalize(t,[f],o);c.push(f)}}if(a.validate){let h=a.validate(t,o);if(h&&(n.mainstay.tracer.value(n,"base",t,h.value),t=h.value,h.errors)){if(!Array.isArray(h.errors))return c.push(h.errors),ke.finalize(t,c,o);if(h.errors.length)return c.push(...h.errors),ke.finalize(t,c,o)}}return e._rules.length?ke.rules(t,c,o):ke.finalize(t,c,o)};ke.rules=function(t,e,n){let{schema:r,state:s,prefs:i}=n;for(let o of r._rules){let a=r._definition.rules[o.method];if(a.convert&&i.convert){s.mainstay.tracer.log(r,s,"rule",o.name,"full");continue}let u,l=o.args;if(o._resolve.length){l=Object.assign({},l);for(let h of o._resolve){let f=a.argsByName.get(h),g=l[h].resolve(t,s,i),v=f.normalize?f.normalize(g):g,b=It.validateArg(v,null,f);if(b){u=r.$_createError("any.ref",g,{arg:h,ref:l[h],reason:b},s,i);break}l[h]=v}}u=u||a.validate(t,n,l,o);let c=ke.rule(u,o);if(c.errors){if(s.mainstay.tracer.log(r,s,"rule",o.name,"error"),o.warn){s.mainstay.warnings.push(...c.errors);continue}if(i.abortEarly)return ke.finalize(t,c.errors,n);e.push(...c.errors)}else s.mainstay.tracer.log(r,s,"rule",o.name,"pass"),s.mainstay.tracer.value(s,"rule",t,c.value,o.name),t=c.value}return ke.finalize(t,e,n)};ke.rule=function(t,e){return t instanceof Ks.Report?(ke.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[It.symbols.errors]?(t.forEach(n=>ke.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ke.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ke.finalize=function(t,e,n){e=e||[];let{schema:r,state:s,prefs:i}=n;if(e.length){let a=ke.default("failover",void 0,e,n);a!==void 0&&(s.mainstay.tracer.value(s,"failover",t,a),t=a,e=[])}if(e.length&&r._flags.error)if(typeof r._flags.error=="function"){e=r._flags.error(e),Array.isArray(e)||(e=[e]);for(let a of e)yu(a instanceof Error||a instanceof Ks.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ke.default("default",t,e,n);s.mainstay.tracer.value(s,"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);s.mainstay.tracer.value(s,"cast",t,u,r._flags.cast),t=u}}if(r.$_terms.externals&&i.externals&&i._externals!==!1)for(let{method:a}of r.$_terms.externals)s.mainstay.externals.push({method:a,schema:r,state:s,label:Ks.label(r._flags,s,i)});let o={value:t,errors:e.length?e:null};return r._flags.result&&(o.value=r._flags.result==="strip"?void 0:n.original,s.mainstay.tracer.value(s,r._flags.result,t,o.value),s.shadow(t,r._flags.result)),r._cache&&i.cache!==!1&&!r._refs.length&&r._cache.set(n.original,o),t!==void 0&&!o.errors&&r._flags.artifact!==void 0&&(s.mainstay.artifacts=s.mainstay.artifacts||new Map,s.mainstay.artifacts.has(r._flags.artifact)||s.mainstay.artifacts.set(r._flags.artifact,[]),s.mainstay.artifacts.get(r._flags.artifact).push(s.path)),o};ke.prefs=function(t,e){let n=e===It.defaults;return n&&t._preferences[It.symbols.prefs]?t._preferences[It.symbols.prefs]:(e=It.preferences(e,t._preferences),n&&(t._preferences[It.symbols.prefs]=e),e)};ke.default=function(t,e,n,r){let{schema:s,state:i,prefs:o}=r,a=s._flags[t];if(o.noDefaults||a===void 0)return e;if(i.mainstay.tracer.log(s,i,"rule",t,"full"),!a)return a;if(typeof a=="function"){let u=a.length?[aA(i.ancestors[0]),r]:[];try{return a(...u)}catch(l){n.push(s.$_createError(`any.${t}`,null,{error:l},i,o));return}}return typeof a!="object"?a:a[It.symbols.literal]?a.literal:It.isResolvable(a)?a.resolve(e,i,o):aA(a)};ke.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ke.ignore={active:!1,debug:qo,entry:qo,filter:qo,log:qo,resolve:qo,value:qo};ke.errorsArray=function(){let t=[];return t[It.symbols.errors]=!0,t}});var Mb=m((T4,cA)=>{"use strict";var eq=Ne(),lA=mu(),Ib=nt(),fs={};cA.exports=fs.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=fs.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(Ib.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 fs.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(Ib.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 s=this._lowercase.get(t.toLowerCase());if(s)return{value:s}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(let s of this._values)if(lA(s,t))return{value:s}}if(e)for(let s of this._refs){let i=s.resolve(t,e,n,null,{in:!0});if(i===void 0)continue;let o=!s.in||typeof i!="object"?[i]:Array.isArray(i)?i:Object.keys(i);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:s}}else if(lA(a,t))return{value:a,ref:s}}}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 fs.Values(this._values,this._refs);return t._override=this._override,t}concat(t){eq(!t._override,"Cannot concat override set of values");let e=new fs.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}};fs.Values.prototype[Ib.symbols.values]=!0;fs.Values.prototype.slice=fs.Values.prototype.clone;fs.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 bA=m((k4,yA)=>{"use strict";var ne=Ne(),hA=dn(),fA=mu(),Lb=qh(),tq=wb(),St=nt(),Nb=Oi(),nq=us(),rq=xb(),dA=Ob(),sq=Mo(),pA=tA(),gA=ls(),mA=Rb(),Fh=uA(),$h=Mb(),Ft={};Ft.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new pA.Ids,this._preferences=null,this._refs=new gA.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 dA.describe=="function","Manifest functionality disabled"),dA.describe(this)}allow(...t){return St.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"),St.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"),St.checkPreferences(t);let e=this.clone();return e._preferences=St.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=St.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){St.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=Nb.when(n,t,e);if(!["any","link"].includes(n.type)){let s=r.is?[r]:r.switch;for(let i of s)ne(!i.then||i.then.type==="any"||i.then.type===n.type,"Cannot combine",n.type,"with",i.then&&i.then.type),ne(!i.otherwise||i.otherwise.type==="any"||i.otherwise.type===n.type,"Cannot combine",n.type,"with",i.otherwise&&i.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||tq.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){ne(St.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,gA.toSibling),e._preferences=e._preferences?St.preferences(e._preferences,t._preferences):t._preferences,e._valids=$h.merge(e._valids,t._valids,t._invalids),e._invalids=$h.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,Lb(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,Lb(e._flags,n)}else Lb(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"),rq.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;St.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 s=n;s<r._rules.length;++s){let i=r._rules[s],o=hA(i);for(let a in t)e.modifiers[a](o,t[a]),ne(o.name===i.name,"Cannot change rule name");r._rules[s]=o,r._singleRules.get(o.name)===i&&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(St.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 mA.location?mA.location(this):this}validate(t,e){return Fh.entry(t,this,e)}validateAsync(t,e){return Fh.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 i in t)ne(i[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 s=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 i in r){let o=r[i];if(n.argsByName){let a=n.argsByName.get(i);if(a.ref&&St.isResolvable(o))e._resolve.push(i),s.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[i]=o),a.assert){let u=St.validateArg(o,i,a);ne(!u,u,"or reference")}}if(o===void 0){delete r[i];continue}r[i]=o}}return n.multi||(s._ruleRemove(e.name,{clone:!1}),s._singleRules.set(e.name,e)),s.$_temp.ruleset===!1&&(s.$_temp.ruleset=null),n.priority?s._rules.unshift(e):s._rules.push(e),s}$_compile(t,e){return Nb.schema(this.$_root,t,e)}$_createError(t,e,n,r,s,i={}){let o=i.flags!==!1?this._flags:{},a=i.messages?sq.merge(this._definition.messages,i.messages):this._definition.messages;return new nq.Report(t,e,n,o,a,r,s)}$_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 s=!Fh.validate(t,this,e,n,r).errors;return e.restore(),s}$_modify(t){return St.assertOptions(t,["each","once","ref","schema"]),pA.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:s,key:i})=>{let o=this._definition[n][r]&&this._definition[n][r].register;o!==!1&&this.$_mutateRegister(e,{family:o,key:i})};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(fA(e,r.default)&&(e=void 0),fA(e,this._flags[t]))return this;let s=n.clone!==!1?this.clone():this;return e!==void 0?(s._flags[t]=e,s.$_mutateRegister(e)):delete s._flags[t],t[0]!=="_"&&(s.$_temp.ruleset=!1),s}$_parent(t,...e){return this[t][St.symbols.parent].call(this,...e)}$_validate(t,e,n){return Fh.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=hA(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 St.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={[St.symbols.literal]:!0,literal:e}),this.$_setFlag(t,e)}_generate(t,e,n){if(!this.$_terms.whens)return{schema:this};let r=[],s=[];for(let a=0;a<this.$_terms.whens.length;++a){let u=this.$_terms.whens[a];if(u.concat){r.push(u.concat),s.push(`${a}.concat`);continue}let l=u.ref?u.ref.resolve(t,e,n):t,c=u.is?[u]:u.switch,h=s.length;for(let f=0;f<c.length;++f){let{is:g,then:v,otherwise:b}=c[f],O=`${a}${u.switch?"."+f:""}`;if(g.$_match(l,e.nest(g,`${O}.is`),n)){if(v){let A=e.localize([...e.path,`${O}.then`],e.ancestors,e.schemas),{schema:k,id:S}=v._generate(t,A,n);r.push(k),s.push(`${O}.then${S?`(${S})`:""}`);break}}else if(b){let A=e.localize([...e.path,`${O}.otherwise`],e.ancestors,e.schemas),{schema:k,id:S}=b._generate(t,A,n);r.push(k),s.push(`${O}.otherwise${S?`(${S})`:""}`);break}}if(u.break&&s.length>h)break}let i=s.join(", ");if(e.mainstay.tracer.debug(e,"rule","when",i),!i)return{schema:this};if(!e.mainstay.tracer.active&&this.$_temp.whens[i])return{schema:this.$_temp.whens[i],id:i};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[i]=o,{schema:o,id:i}}_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 s=0;s<n._rules.length;++s){let i=n._rules[s];if(i.name===t&&!i.keep){n._inRuleset()&&s<n.$_temp.ruleset&&--n.$_temp.ruleset;continue}r.push(i)}return n._rules=r,n}_values(t,e){St.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===St.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new $h:r&&(n[e]=t.length?new $h:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let s of t){ne(s!==void 0,"Cannot call allow/valid/invalid with undefined"),ne(s!==St.symbols.override,"Override must be the first value");let i=e==="_invalids"?"_valids":"_invalids";n[i]&&(n[i].remove(s),n[i].length||(ne(e==="_valids"||!n._flags.only,"Setting invalid value",s,"leaves schema rejecting all values due to previous valid rule"),n[i]=null)),n[e].add(s,n._refs)}return n}};Ft.Base.prototype[St.symbols.any]={version:St.version,compile:Nb.compile,root:"$_root"};Ft.Base.prototype.isImmutable=!0;Ft.Base.prototype.deny=Ft.Base.prototype.invalid;Ft.Base.prototype.disallow=Ft.Base.prototype.invalid;Ft.Base.prototype.equal=Ft.Base.prototype.valid;Ft.Base.prototype.exist=Ft.Base.prototype.required;Ft.Base.prototype.not=Ft.Base.prototype.invalid;Ft.Base.prototype.options=Ft.Base.prototype.prefs;Ft.Base.prototype.preferences=Ft.Base.prototype.prefs;yA.exports=new Ft.Base});var tr=m((x4,vA)=>{"use strict";var Bh=Ne(),iq=bA(),oq=nt(),aq=Mo();vA.exports=iq.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 Bh(typeof t=="function","Method must be a function"),Bh(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){Bh(oq.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 Bh(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=aq.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 s of r)t=t[n.slice(0,-1)](s);continue}if(n==="alterations"){let s={};for(let{target:i,adjuster:o}of r)s[i]=o;t=t.alter(s);continue}if(n==="whens"){for(let s of r){let{ref:i,is:o,not:a,then:u,otherwise:l,concat:c}=s;c?t=t.concat(c):i?t=t.when(i,{is:o,not:a,then:u,otherwise:l,switch:s.switch,break:s.break}):t=t.when(o,{then:u,otherwise:l,break:s.break})}continue}if(n==="shared")for(let s of r)t=t.shared(s)}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 SA=m((E4,TA)=>{"use strict";var Ri=Ne(),uq=qh(),lq=tr(),_A=nt(),cq=Oi(),Uh=us(),hq=ls(),jo={};TA.exports=lq.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:hq.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:s,prefs:i}=e;if(n._flags.match){let a=[],u=[];for(let c=0;c<n.$_terms.matches.length;++c){let h=n.$_terms.matches[c],f=s.nest(h.schema,`match.${c}`);f.snapshot();let g=h.schema.$_validate(t,f,i);g.errors?(u.push(g.errors),f.restore()):(a.push(g.value),f.commit())}if(a.length===0){let c={details:u.map(h=>Uh.details(h,{override:!1}))};return{errors:r("alternatives.any",c)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let c={details:u.map(h=>Uh.details(h,{override:!1}))};return{errors:r("alternatives.all",c)}}let l=c=>c.$_terms.matches.some(h=>h.schema.type==="object"||h.schema.type==="alternatives"&&l(h.schema));return l(n)?{value:a.reduce((c,h)=>uq(c,h,{mergeArrays:!1}))}:{value:a[a.length-1]}}let o=[];for(let a=0;a<n.$_terms.matches.length;++a){let u=n.$_terms.matches[a];if(u.schema){let h=s.nest(u.schema,`match.${a}`);h.snapshot();let f=u.schema.$_validate(t,h,i);if(!f.errors)return h.commit(),f;h.restore(),o.push({schema:u.schema,reports:f.errors});continue}let l=u.ref?u.ref.resolve(t,s,i):t,c=u.is?[u]:u.switch;for(let h=0;h<c.length;++h){let f=c[h],{is:g,then:v,otherwise:b}=f,O=`match.${a}${u.switch?"."+h:""}`;if(g.$_match(l,s.nest(g,`${O}.is`),i)){if(v)return v.$_validate(t,s.nest(v,`${O}.then`),i)}else if(b)return b.$_validate(t,s.nest(b,`${O}.otherwise`),i)}}return jo.errors(o,e)},rules:{conditional:{method(t,e){Ri(!this._flags._endedSwitch,"Unreachable condition"),Ri(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Ri(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=cq.when(n,t,e),s=r.is?[r]:r.switch;for(let i of s)if(i.then&&i.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(r),n.$_mutateRebuild()}},match:{method(t){if(Ri(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Ri(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Ri(t.length,"Missing alternative schemas"),_A.verifyFlat(t,"try"),Ri(!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,s)=>s.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=>{_A.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:s,is:i,not:o,then:a,otherwise:u}=n;r?t=t.try(r):s?t=t.conditional(s,{is:i,then:a,not:o,otherwise:u,switch:n.switch}):t=t.conditional(i,{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}}"}});jo.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,s=[];for(let{reports:i,schema:o}of t){if(i.length>1)return jo.unmatched(t,e);let a=i[0];if(!(a instanceof Uh.Report))return jo.unmatched(t,e);if(a.state.path.length!==n.path.length){s.push({type:o.type,report:a});continue}if(a.code==="any.only"){for(let c of a.local.valids)r.add(c);continue}let[u,l]=a.code.split(".");l!=="base"?s.push({type:o.type,report:a}):a.code==="object.base"?r.add(a.local.type):r.add(u)}return s.length?s.length===1?{errors:s[0].report}:jo.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};jo.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",Uh.details(n,{override:!1}))}}});var wA=m((A4,kA)=>{"use strict";var vu=Ne(),fq=mu(),dq=xi(),pq=tr(),nr=nt(),gq=Oi(),ct={};kA.exports=pq.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 s=e.$_getRule("sort");if(s)return ct.sort(e,t,s.args.options,n,r)}},validate(t,{schema:e,error:n}){if(!Array.isArray(t)){if(e._flags.single){let r=[t];return r[nr.symbols.arraySingle]=!0,{value:r}}return{errors:n("array.base")}}if(!(!e.$_getRule("items")&&!e.$_terms.externals))return{value:t.slice()}},rules:{has:{method(t){t=this.$_compile(t,{appendPath:!0});let e=this.$_addRule({name:"has",args:{schema:t}});return e.$_mutateRegister(t),e},validate(t,{state:e,prefs:n,error:r},{schema:s}){let i=[t,...e.ancestors];for(let a=0;a<t.length;++a){let u=e.localize([...e.path,a],i,s);if(s.$_match(t[a],u,n))return t}let o=s._flags.label;return o?r("array.hasKnown",{patternLabel:o}):r("array.hasUnknown",null)},multi:!0},items:{method(...t){nr.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=nr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});e.$_terms.items.push(r)}return e.$_mutateRebuild()},validate(t,{schema:e,error:n,state:r,prefs:s,errorsArray:i}){let o=e.$_terms._requireds.slice(),a=e.$_terms.ordered.slice(),u=[...e.$_terms._inclusions,...o],l=!t[nr.symbols.arraySingle];delete t[nr.symbols.arraySingle];let c=i(),h=t.length;for(let f=0;f<h;++f){let g=t[f],v=!1,b=!1,O=l?f:new Number(f),A=[...r.path,O];if(!e._flags.sparse&&g===void 0){if(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),s.abortEarly)return c;a.shift();continue}let k=[t,...r.ancestors];for(let R of e.$_terms._exclusions)if(R.$_match(g,r.localize(A,k,R),s,{presence:"ignore"})){if(c.push(n("array.excludes",{pos:f,value:g},r.localize(A))),s.abortEarly)return c;v=!0,a.shift();break}if(v)continue;if(e.$_terms.ordered.length){if(a.length){let R=a.shift(),G=R.$_validate(g,r.localize(A,k,R),s);if(G.errors){if(c.push(...G.errors),s.abortEarly)return c}else if(R._flags.result==="strip")ct.fastSplice(t,f),--f,--h;else if(!e._flags.sparse&&G.value===void 0){if(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),s.abortEarly)return c;continue}else t[f]=G.value;continue}else if(!e.$_terms.items.length){if(c.push(n("array.orderedLength",{pos:f,limit:e.$_terms.ordered.length})),s.abortEarly)return c;break}}let S=[],_=o.length;for(let R=0;R<_;++R){let G=r.localize(A,k,o[R]);G.snapshot();let se=o[R].$_validate(g,G,s);if(S[R]=se,!se.errors){if(G.commit(),t[f]=se.value,b=!0,ct.fastSplice(o,R),--R,--_,!e._flags.sparse&&se.value===void 0&&(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),s.abortEarly))return c;break}G.restore()}if(b)continue;let N=s.stripUnknown&&!!s.stripUnknown.arrays||!1;_=u.length;for(let R of u){let G,se=o.indexOf(R);if(se!==-1)G=S[se];else{let ue=r.localize(A,k,R);if(ue.snapshot(),G=R.$_validate(g,ue,s),!G.errors){ue.commit(),R._flags.result==="strip"?(ct.fastSplice(t,f),--f,--h):!e._flags.sparse&&G.value===void 0?(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),v=!0):t[f]=G.value,b=!0;break}ue.restore()}if(_===1){if(N){ct.fastSplice(t,f),--f,--h,b=!0;break}if(c.push(...G.errors),s.abortEarly)return c;v=!0;break}}if(!v&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!b){if(N){ct.fastSplice(t,f),--f,--h;continue}if(c.push(n("array.includes",{pos:f,value:g},r.localize(A))),s.abortEarly)return c}}return o.length&&ct.fillMissedErrors(e,c,o,t,r,s),a.length&&(ct.fillOrderedErrors(e,c,a,t,r,s),c.length||ct.fillDefault(a,t,r,s)),c.length?c: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:s,args:i}){return nr.compare(t.length,n,s)?t:e.error("array."+r,{limit:i.limit,value:t})},args:[{name:"limit",ref:!0,assert:nr.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},ordered:{method(...t){nr.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=nr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});ct.validateSingle(r,e),e.$_mutateRegister(r),e.$_terms.ordered.push(r)}return e.$_mutateRebuild()}},single:{method(t){let e=t===void 0?!0:!!t;return vu(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){nr.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=gq.ref(t.by,{ancestor:0}),vu(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(t,{error:e,state:n,prefs:r,schema:s},{options:i}){let{value:o,errors:a}=ct.sort(s,t,i,n,r);if(a)return a;for(let u=0;u<t.length;++u)if(t[u]!==o[u])return e("array.sort",{order:i.order,by:i.by?i.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={}){vu(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),nr.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=nr.default(e.separator,".");n.path=r?t.split(r):[t]}else n.comparator=t;return this.$_addRule(n)},validate(t,{state:e,error:n,schema:r},{comparator:s,options:i},{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},l=o||fq,c=i.ignoreUndefined;for(let h=0;h<t.length;++h){let f=a?dq(t[h],a):t[h],g=o?u.custom:u[typeof f];if(vu(g,"Failed to find unique map container for type",typeof f),g instanceof Map){let v=g.entries(),b;for(;!(b=v.next()).done;)if(l(b.value[0],f)){let O=e.localize([...e.path,h],[t,...e.ancestors]),A={pos:h,value:t[h],dupePos:b.value[1],dupeValue:t[b.value[1]]};return a&&(A.path=s),n("array.unique",A,O)}g.set(f,h)}else{if((!c||f!==void 0)&&g[f]!==void 0){let v={pos:h,value:t[h],dupePos:g[f],dupeValue:t[g[f]]};a&&(v.path=s);let b=e.localize([...e.path,h],[t,...e.ancestors]);return n("array.unique",v,b)}g[f]=h}}return t},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to(t,e){return new Set(t)}}},rebuild(t){t.$_terms._inclusions=[],t.$_terms._exclusions=[],t.$_terms._requireds=[];for(let e of t.$_terms.items)ct.validateSingle(e,t),e._flags.presence==="required"?t.$_terms._requireds.push(e):e._flags.presence==="forbidden"?t.$_terms._exclusions.push(e):t.$_terms._inclusions.push(e);for(let e of t.$_terms.ordered)ct.validateSingle(e,t)},manifest:{build(t,e){return e.items&&(t=t.items(...e.items)),e.ordered&&(t=t.ordered(...e.ordered)),t}},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}});ct.fillMissedErrors=function(t,e,n,r,s,i){let o=[],a=0;for(let u of n){let l=u._flags.label;l?o.push(l):++a}o.length?a?e.push(t.$_createError("array.includesRequiredBoth",r,{knownMisses:o,unknownMisses:a},s,i)):e.push(t.$_createError("array.includesRequiredKnowns",r,{knownMisses:o},s,i)):e.push(t.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},s,i))};ct.fillOrderedErrors=function(t,e,n,r,s,i){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&ct.fillMissedErrors(t,e,o,r,s,i)};ct.fillDefault=function(t,e,n,r){let s=[],i=!0;for(let o=t.length-1;o>=0;--o){let a=t[o],u=[e,...n.ancestors],l=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(i){if(l===void 0)continue;i=!1}s.unshift(l)}s.length&&e.push(...s)};ct.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};ct.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(vu(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};ct.sort=function(t,e,n,r,s){let i=n.order==="ascending"?1:-1,o=-1*i,a=i,u=(l,c)=>{let h=ct.compare(l,c,o,a);if(h!==null||(n.by&&(l=n.by.resolve(l,r,s),c=n.by.resolve(c,r,s)),h=ct.compare(l,c,o,a),h!==null))return h;let f=typeof l;if(f!==typeof c)throw t.$_createError("array.sort.mismatching",e,null,r,s);if(f!=="number"&&f!=="string")throw t.$_createError("array.sort.unsupported",e,{type:f},r,s);return f==="number"?(l-c)*i:l<c?o:a};try{return{value:e.slice().sort(u)}}catch(l){return{errors:l}}};ct.compare=function(t,e,n,r){return t===e?0:t===void 0?1:e===void 0?-1:t===null?r:e===null?n:null}});var CA=m((O4,OA)=>{"use strict";var xA=Ne(),mq=tr(),EA=nt(),AA=Mb(),qb={};qb.isBool=function(t){return typeof t=="boolean"};OA.exports=mq.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){EA.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new AA;for(let n=0;n<t.length;++n){let r=t[n];xA(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){EA.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new AA;for(let n=0;n<t.length;++n){let r=t[n];xA(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:qb.isBool,to(t,e){return t?1:0}},string:{from:qb.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 IA=m((C4,DA)=>{"use strict";var RA=Ne(),yq=tr(),PA=nt(),bq=Gs(),Tr={};Tr.isDate=function(t){return t instanceof Date};DA.exports=yq.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:Tr.parse(t,e._flags.format)||t}}},validate(t,{schema:e,error:n,prefs:r}){if(t instanceof Date&&!isNaN(t.getTime()))return;let s=e._flags.format;return!r.convert||!s||typeof t!="string"?{value:t,errors:n("date.base")}:{value:t,errors:n("date.format",{format:s})}},rules:{compare:{method:!1,validate(t,e,{date:n},{name:r,operator:s,args:i}){let o=n==="now"?Date.now():n.getTime();return PA.compare(t.getTime(),o,s)?t:e.error("date."+r,{limit:i.date,value:t})},args:[{name:"date",ref:!0,normalize:t=>t==="now"?t:Tr.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return RA(["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 RA(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:Tr.isDate,to(t,e){return t.getTime()}},string:{from:Tr.isDate,to(t,{prefs:e}){return bq.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"}});Tr.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 PA.isIsoDate(t)?Tr.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return Tr.date(1*t);if(e==="unix")return Tr.date(1e3*t);if(typeof n=="string")return null}return Tr.date(t)};Tr.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var jA=m((R4,qA)=>{"use strict";var Wh=Ne(),LA=dn(),NA=qh(),MA=xi(),Hh={};qA.exports=function(t,e,n={}){if(Wh(t&&typeof t=="object","Invalid defaults value: must be an object"),Wh(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),Wh(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return Hh.applyToDefaultsWithShallow(t,e,n);let r=LA(t);if(e===!0)return r;let s=n.nullOverride!==void 0?n.nullOverride:!1;return NA(r,e,{nullOverride:s,mergeArrays:!1})};Hh.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;Wh(Array.isArray(r),"Invalid keys");let s=new Map,i=e===!0?null:new Set;for(let u of r){u=Array.isArray(u)?u:u.split(".");let l=MA(t,u);l&&typeof l=="object"?s.set(l,i&&MA(e,u)||l):i&&i.add(u)}let o=LA(t,{},s);if(!i)return o;for(let u of i)Hh.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return NA(o,e,{nullOverride:a,mergeArrays:!1})};Hh.reachCopy=function(t,e,n){for(let i of n){if(!(i in e))return;let o=e[i];if(typeof o!="object"||o===null)return;e=o}let r=e,s=t;for(let i=0;i<n.length-1;++i){let o=n[i];typeof s[o]!="object"&&(s[o]={}),s=s[o]}s[n[n.length-1]]=r}});var BA=m($A=>{"use strict";var Pi=Ne(),FA={};$A.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(t,e){e=e||{};let n=[].concat(e.before||[]),r=[].concat(e.after||[]),s=e.group||"?",i=e.sort||0;Pi(!n.includes(s),`Item cannot come before itself: ${s}`),Pi(!n.includes("?"),"Item cannot come before unassociated items"),Pi(!r.includes(s),`Item cannot come after itself: ${s}`),Pi(!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:i,before:n,after:r,group:s,node:o};this._items.push(a)}if(!e.manual){let o=this._sort();Pi(o,"item",s!=="?"?`added into group ${s}`:"","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(FA.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Pi(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Pi(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,l=a.group;n[l]=n[l]||[],n[l].push(u),t[u]=a.before;for(let c of a.after)e[c]=e[c]||[],e[c].push(u)}for(let a in t){let u=[];for(let l in t[a]){let c=t[a][l];n[c]=n[c]||[],u.push(...n[c])}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 l of u)r[l]=r[l]||[],r[l].push(a)}let s={},i=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let l=0;l<this._items.length;++l){if(s[l]===!0)continue;r[l]||(r[l]=[]);let c=r[l].length,h=0;for(let f=0;f<c;++f)s[r[l][f]]&&++h;if(h===c){u=l;break}}}u!==null&&(s[u]=!0,i.push(u))}if(i.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 i){let u=o[a];this.nodes.push(u.node),this._items.push(u)}return!0}};FA.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var Fb=m((I4,HA)=>{"use strict";var vq=jA(),rr=Ne(),UA=dn(),_q=BA(),Tq=tr(),on=nt(),jb=Oi(),Sq=us(),WA=ls(),Gh=Gs(),ge={renameDefaults:{alias:!1,multiple:!1,override:!1}};HA.exports=Tq.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:s}){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=ge.clone(t,s);let i=[];if(e.$_terms.renames&&!ge.rename(e,t,r,s,i))return{value:t,errors:i};if(!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.dependencies)return{value:t,errors:i};let o=new Set(Object.keys(t));if(e.$_terms.keys){let a=[t,...r.ancestors];for(let u of e.$_terms.keys){let l=u.key,c=t[l];o.delete(l);let h=r.localize([...r.path,l],a,u),f=u.schema.$_validate(c,h,s);if(f.errors){if(s.abortEarly)return{value:t,errors:f.errors};f.value!==void 0&&(t[l]=f.value),i.push(...f.errors)}else u.schema._flags.result==="strip"||f.value===void 0&&c!==void 0?delete t[l]:f.value!==void 0&&(t[l]=f.value)}}if(o.size||e._flags._hasPatternMatch){let a=ge.unknown(e,t,o,i,r,s);if(a)return a}if(e.$_terms.dependencies)for(let a of e.$_terms.dependencies){if(a.key!==null&&ge.isPresent(a.options)(a.key.resolve(t,r,s,null,{shadow:!1}))===!1)continue;let u=ge.dependencies[a.rel](e,a,t,r,s);if(u){let l=e.$_createError(u.code,t,u.context,r,s);if(s.abortEarly)return{value:t,errors:l};i.push(l)}}return{value:t,errors:i}},rules:{and:{method(...t){return on.verifyFlat(t,"and"),ge.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){Gh.isTemplate(t)||(t=jb.ref(t)),rr(n===void 0||typeof n=="string","Message must be a string"),e=this.$_compile(e,{appendPath:!0});let r=this.$_addRule({name:"assert",args:{subject:t,schema:e,message:n}});return r.$_mutateRegister(t),r.$_mutateRegister(e),r},validate(t,{error:e,prefs:n,state:r},{subject:s,schema:i,message:o}){let a=s.resolve(t,r,n),u=WA.isRef(s)?s.absolute(r):[];return i.$_match(a,r.localize(u,[t,...r.ancestors],i),n)?t:e("object.assert",{subject:s,message:o})},args:["subject","schema","message"],multi:!0},instance:{method(t,e){return rr(typeof t=="function","constructor must be a function"),e=e||t.name,this.$_addRule({name:"instance",args:{constructor:t,name:e}})},validate(t,e,{constructor:n,name:r}){return t instanceof n?t:e.error("object.instance",{type:r,value:t})},args:["constructor","name"]},keys:{method(t){rr(t===void 0||typeof t=="object","Object schema must be a valid object"),rr(!on.isSchema(t),"Object schema cannot be a joi schema");let e=this.clone();if(!t)e.$_terms.keys=null;else if(!Object.keys(t).length)e.$_terms.keys=new ge.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new ge.Keys;for(let n in t)on.tryWithPath(()=>e.$_terms.keys.push({key:n,schema:this.$_compile(t[n])}),n)}return e.$_mutateRebuild()}},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:s,args:i}){return on.compare(Object.keys(t).length,n,s)?t:e.error("object."+r,{limit:i.limit,value:t})},args:[{name:"limit",ref:!0,assert:on.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},nand:{method(...t){return on.verifyFlat(t,"nand"),ge.dependency(this,"nand",null,t)}},or:{method(...t){return on.verifyFlat(t,"or"),ge.dependency(this,"or",null,t)}},oxor:{method(...t){return ge.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),rr(e!==void 0,"Invalid rule"),on.assertOptions(n,["fallthrough","matches"]),r&&rr(!t.flags.includes("g")&&!t.flags.includes("y"),"pattern should not use global or sticky mode"),e=this.$_compile(e,{appendPath:!0});let s=this.clone();s.$_terms.patterns=s.$_terms.patterns||[];let i={[r?"regex":"schema"]:t,rule:e};return n.matches&&(i.matches=this.$_compile(n.matches),i.matches.type!=="array"&&(i.matches=i.matches.$_root.array().items(i.matches)),s.$_mutateRegister(i.matches),s.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(i.fallthrough=!0),s.$_terms.patterns.push(i),s.$_mutateRegister(e),s}},ref:{method(){return this.$_addRule("ref")},validate(t,e){return WA.isRef(t)?t:e.error("object.refType",{value:t})}},regex:{method(){return this.$_addRule("regex")},validate(t,e){return t instanceof RegExp?t:e.error("object.regex",{value:t})}},rename:{method(t,e,n={}){rr(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),rr(typeof e=="string"||e instanceof Gh,"Invalid rename to argument"),rr(e!==t,"Cannot rename key to same name:",t),on.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let s of r.$_terms.renames)rr(s.from!==t,"Cannot rename the same key multiple times");return e instanceof Gh&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:vq(ge.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return on.isSchema(t)&&(n==="any"||t.type===n)?t:e.error("object.schema",{type:n})}},unknown:{method(t){return this.$_setFlag("unknown",t!==!1)}},with:{method(t,e,n={}){return ge.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return ge.dependency(this,"without",t,e,n)}},xor:{method(...t){return on.verifyFlat(t,"xor"),ge.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=on.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new _q.Sorter;for(let n of t.$_terms.keys)on.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new ge.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:s,options:i}of e.dependencies)t=ge.dependency(t,n,r,s,i);if(e.patterns)for(let{regex:n,schema:r,rule:s,fallthrough:i,matches:o}of e.patterns)t=t.pattern(n||r,s,{fallthrough:i,matches:o});if(e.renames)for(let{from:n,to:r,options:s}of e.renames)t=t.rename(n,r,s);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}}"}});ge.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return UA(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=UA(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};ge.dependency=function(t,e,n,r,s){rr(n===null||typeof n=="string",e,"key must be a strings"),s||(s=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),on.assertOptions(s,["separator","isPresent"]),r=[].concat(r);let i=on.default(s.separator,"."),o=[];for(let u of r)rr(typeof u=="string",e,"peers must be strings"),o.push(jb.ref(u,{separator:i,ancestor:0,prefix:!1}));n!==null&&(n=jb.ref(n,{separator:i,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new ge.Dependency(e,n,o,r,s)),a};ge.dependencies={and(t,e,n,r,s){let i=[],o=[],a=e.peers.length,u=ge.isPresent(e.options);for(let l of e.peers)u(l.resolve(n,r,s,null,{shadow:!1}))===!1?i.push(l.key):o.push(l.key);if(i.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:ge.keysToLabels(t,o),missing:i,missingWithLabels:ge.keysToLabels(t,i)}}},nand(t,e,n,r,s){let i=[],o=ge.isPresent(e.options);for(let l of e.peers)o(l.resolve(n,r,s,null,{shadow:!1}))&&i.push(l.key);if(i.length!==e.peers.length)return;let a=e.paths[0],u=e.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:ge.keysToLabels(t,a),peers:u,peersWithLabels:ge.keysToLabels(t,u)}}},or(t,e,n,r,s){let i=ge.isPresent(e.options);for(let o of e.peers)if(i(o.resolve(n,r,s,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:e.paths,peersWithLabels:ge.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,s){let i=[],o=ge.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,s,null,{shadow:!1}))&&i.push(u.key);if(!i.length||i.length===1)return;let a={peers:e.paths,peersWithLabels:ge.keysToLabels(t,e.paths)};return a.present=i,a.presentWithLabels=ge.keysToLabels(t,i),{code:"object.oxor",context:a}},with(t,e,n,r,s){let i=ge.isPresent(e.options);for(let o of e.peers)if(i(o.resolve(n,r,s,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:e.key.key,mainWithLabel:ge.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ge.keysToLabels(t,o.key)}}},without(t,e,n,r,s){let i=ge.isPresent(e.options);for(let o of e.peers)if(i(o.resolve(n,r,s,null,{shadow:!1})))return{code:"object.without",context:{main:e.key.key,mainWithLabel:ge.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ge.keysToLabels(t,o.key)}}},xor(t,e,n,r,s){let i=[],o=ge.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,s,null,{shadow:!1}))&&i.push(u.key);if(i.length===1)return;let a={peers:e.paths,peersWithLabels:ge.keysToLabels(t,e.paths)};return i.length===0?{code:"object.missing",context:a}:(a.present=i,a.presentWithLabels=ge.keysToLabels(t,i),{code:"object.xor",context:a})}};ge.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};ge.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};ge.rename=function(t,e,n,r,s){let i={};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 l in e){if(e[l]===void 0&&o.options.ignoreUndefined||l===o.to)continue;let c=o.from.exec(l);c&&a.push({from:l,to:o.to,match:c})}for(let l of a){let c=l.from,h=l.to;if(h instanceof Gh&&(h=h.render(e,n,r,l.match)),c!==h){if(!o.options.multiple&&i[h]&&(s.push(t.$_createError("object.rename.multiple",e,{from:c,to:h,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,h)&&!o.options.override&&!i[h]&&(s.push(t.$_createError("object.rename.override",e,{from:c,to:h,pattern:u},n,r)),r.abortEarly))return!1;e[c]===void 0?delete e[h]:e[h]=e[c],i[h]=!0,o.options.alias||delete e[c]}}}return!0};ge.unknown=function(t,e,n,r,s,i){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(c=>{if(c.matches)return a=!0,[]}),l=[e,...s.ancestors];for(let c of n){let h=e[c],f=[...s.path,c];for(let g=0;g<t.$_terms.patterns.length;++g){let v=t.$_terms.patterns[g];if(v.regex){let A=v.regex.test(c);if(s.mainstay.tracer.debug(s,"rule",`pattern.${g}`,A?"pass":"error"),!A)continue}else if(!v.schema.$_match(c,s.nest(v.schema,`pattern.${g}`),i))continue;n.delete(c);let b=s.localize(f,l,{schema:v.rule,key:c}),O=v.rule.$_validate(h,b,i);if(O.errors){if(i.abortEarly)return{value:e,errors:O.errors};r.push(...O.errors)}if(v.matches&&u[g].push(c),e[c]=O.value,!v.fallthrough)break}}if(a)for(let c=0;c<u.length;++c){let h=u[c];if(!h)continue;let f=t.$_terms.patterns[c].matches,g=s.localize(s.path,l,f),v=f.$_validate(h,g,i);if(v.errors){let b=Sq.details(v.errors,{override:!1});b.matches=h;let O=t.$_createError("object.pattern.match",e,b,s,i);if(i.abortEarly)return{value:e,errors:O};r.push(O)}}}if(!n.size||!t.$_terms.keys&&!t.$_terms.patterns)return;if(i.stripUnknown&&typeof t._flags.unknown>"u"||i.skipFunctions){let a=i.stripUnknown?i.stripUnknown===!0?!0:!!i.stripUnknown.objects:!1;for(let u of n)a?(delete e[u],n.delete(u)):typeof e[u]=="function"&&n.delete(u)}if(!on.default(t._flags.unknown,i.allowUnknown))for(let a of n){let u=s.localize([...s.path,a],[]),l=t.$_createError("object.unknown",e[a],{child:a},u,i,{flags:!1});if(i.abortEarly)return{value:e,errors:l};r.push(l)}};ge.Dependency=class{constructor(t,e,n,r,s){this.rel=t,this.key=e,this.peers=n,this.paths=r,this.options=s}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}};ge.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 s=r.key,i=n.get(s);i!==void 0?e[i]={key:s,schema:e[i].schema.concat(r.schema)}:e.push(r)}return e}}});var zA=m((N4,GA)=>{"use strict";var $b=Ne(),kq=Fb();GA.exports=kq.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return $b(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 $b(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 $b(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 VA=m((q4,KA)=>{"use strict";var ds=Ne(),wq=tr(),xq=nt(),Eq=Oi(),Aq=us(),ps={};KA.exports=wq.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}){ds(e.$_terms.link,"Uninitialized link schema");let s=ps.generate(e,t,n,r),i=e.$_terms.link[0].ref;return s.$_validate(t,n.nest(s,`link:${i.display}:${s.type}`),r)},generate(t,e,n,r){return ps.generate(t,e,n,r)},rules:{ref:{method(t){ds(!this.$_terms.link,"Cannot reinitialize schema"),t=Eq.ref(t),ds(t.type==="value"||t.type==="local","Invalid reference type:",t.type),ds(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){ds(this.$_terms.link,"Uninitialized link schema"),ds(xq.isSchema(t),"Invalid schema object"),ds(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 ds(e.link,"Invalid link description missing link"),t.ref(e.link)}}});ps.generate=function(t,e,n,r){let s=n.mainstay.links.get(t);if(s)return s._generate(e,n,r).schema;let i=t.$_terms.link[0].ref,{perspective:o,path:a}=ps.perspective(i,n);ps.assert(o,"which is outside of schema boundaries",i,t,n,r);try{s=a.length?o.$_reach(a):o}catch{ps.assert(!1,"to non-existing schema",i,t,n,r)}return ps.assert(s.type!=="link","which is another link",i,t,n,r),t._flags.relative||n.mainstay.links.set(t,s),s._generate(e,n,r).schema};ps.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 i of n.$_terms.shared)if(i._flags.id===t.path[0])return{perspective:i,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}};ps.assert=function(t,e,n,r,s,i){t||ds(!1,`"${Aq.label(r._flags,s,i)}" contains link reference "${n.display}" ${e}`)}});var YA=m((j4,XA)=>{"use strict";var Bb=Ne(),Oq=tr(),Ub=nt(),Fn={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))))}};XA.exports=Oq.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(Fn.numberRx))return;t=t.trim();let s={value:parseFloat(t)};if(s.value===0&&(s.value=0),!e._flags.unsafe)if(t.match(/e/i)){if(Fn.extractSignificantDigits(t)!==Fn.extractSignificantDigits(String(s.value)))return s.errors=n("number.unsafe"),s}else{let i=s.value.toString();if(i.match(/e/i))return s;if(i!==Fn.normalizeDecimal(t))return s.errors=n("number.unsafe"),s}return s}},validate(t,{schema:e,error:n,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!Ub.isNumber(t))return{value:t,errors:n("number.base")};let s={value:t};if(r.convert){let i=e.$_getRule("precision");if(i){let o=Math.pow(10,i.args.limit);s.value=Math.round(s.value*o)/o}}return s.value===0&&(s.value=0),!e._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(s.errors=n("number.unsafe")),s},rules:{compare:{method:!1,validate(t,e,{limit:n},{name:r,operator:s,args:i}){return Ub.compare(t,n,s)?t:e.error("number."+r,{limit:i.limit,value:t})},args:[{name:"limit",ref:!0,assert:Ub.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"?Fn.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:s},i){return Fn.decimalPlaces(t)>r?e.error("number.multiple",{multiple:i.args.base,value:t}):Math.round(s*t)%Math.round(s*n)===0?t:e.error("number.multiple",{multiple:i.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 Bb(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(Fn.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 Bb(["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 Bb(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"}});Fn.extractSignificantDigits=function(t){return t.replace(Fn.exponentialPartRegex,"").replace(Fn.dotRegex,"").replace(Fn.trailingZerosRegex,"").replace(Fn.leadingSignAndZerosRegex,"")};Fn.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 QA=m((F4,JA)=>{"use strict";var Cq=Fb();JA.exports=Cq.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var Wb=m(zh=>{"use strict";zh.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"};zh.code=function(t){return{code:t,error:zh.codes[t]}}});var Hb=m(Kh=>{"use strict";var Rq=require("url"),Sr=Wb(),Vs={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:Rq.URL||URL};Kh.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(!!Vs.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return Sr.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(Vs.domainControlRx.test(t))return Sr.code("DOMAIN_INVALID_CHARS");t=Vs.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||Vs.minDomainSegments,s=t.split(".");if(s.length<r)return Sr.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&s.length>e.maxDomainSegments)return Sr.code("DOMAIN_SEGMENTS_COUNT_MAX");let i=e.tlds;if(i){let o=s[s.length-1].toLowerCase();if(i.deny&&i.deny.has(o)||i.allow&&!i.allow.has(o))return Sr.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<s.length;++o){let a=s[o];if(!a.length)return Sr.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return Sr.code("DOMAIN_LONG_SEGMENT");if(o<s.length-1){if(!Vs.domainSegmentRx.test(a))return Sr.code("DOMAIN_INVALID_CHARS")}else if(!Vs.tldSegmentRx.test(a))return Sr.code("DOMAIN_INVALID_TLDS_CHARS")}return null};Kh.isValid=function(t,e){return!Kh.analyze(t,e)};Vs.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new Vs.URL(`http://${t}`).host}catch{return t}}});var ZA=m(Gb=>{"use strict";var Pq=require("util"),Dq=Hb(),Hr=Wb(),gn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(Pq.TextEncoder||TextEncoder)};Gb.analyze=function(t,e){return gn.email(t,e)};Gb.isValid=function(t,e){return!gn.email(t,e)};gn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return Hr.code("EMPTY_STRING");let n=!gn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return Hr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?Hr.code("MULTIPLE_AT_CHAR"):Hr.code("MISSING_AT_CHAR");let[s,i]=r;if(!s)return Hr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return Hr.code("ADDRESS_TOO_LONG");if(gn.encoder.encode(s).length>64)return Hr.code("LOCAL_TOO_LONG")}return gn.local(s,n)||Dq.analyze(i,e)};gn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return Hr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!gn.atextRx.test(r))return Hr.code("INVALID_LOCAL_CHARS");continue}for(let s of r){if(gn.atextRx.test(s))continue;let i=gn.binary(s);if(!gn.atomRx.test(i))return Hr.code("INVALID_LOCAL_CHARS")}}};gn.binary=function(t){return Array.from(gn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};gn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;gn.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 zb=m((W4,e1)=>{"use strict";e1.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Vb=m(Kb=>{"use strict";var Vh=Ne(),Iq=zb(),Yt={};Yt.generate=function(){let t={},e="\\dA-Fa-f",n="["+e+"]",r="\\w-\\.~",s="!\\$&'\\(\\)\\*\\+,;=",i="%"+e,o=r+i+s+":@",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 l=n+"{1,4}",c="(?:"+l+":"+l+"|"+t.ipv4address+")",h="(?:"+l+":){6}"+c,f="::(?:"+l+":){5}"+c,g="(?:"+l+")?::(?:"+l+":){4}"+c,v="(?:(?:"+l+":){0,1}"+l+")?::(?:"+l+":){3}"+c,b="(?:(?:"+l+":){0,2}"+l+")?::(?:"+l+":){2}"+c,O="(?:(?:"+l+":){0,3}"+l+")?::"+l+":"+c,A="(?:(?:"+l+":){0,4}"+l+")?::"+c,k="(?:(?:"+l+":){0,5}"+l+")?::"+l,S="(?:(?:"+l+":){0,6}"+l+")?::";t.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",t.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",t.ipv6address="(?:"+h+"|"+f+"|"+g+"|"+v+"|"+b+"|"+O+"|"+A+"|"+k+"|"+S+")",t.ipvFuture="v"+n+"+\\.["+r+s+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let _="["+r+i+s+":]*",N="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",R="["+r+i+s+"]{1,255}",G="(?:"+N+"|"+t.ipv4address+"|"+R+")",se="\\d*",ue="(?:"+_+"@)?"+G+"(?::"+se+")?",z="(?:"+_+"@)?("+G+")(?::"+se+")?",C=a+"*",M=a+"+",L="["+r+i+s+"@]+",F="",me="(?:\\/"+C+")*",pe="\\/(?:"+M+me+")?",Nt=M+me,vt=L+me,Ue="(?:\\/\\/\\/"+C+me+")";return t.hierPart="(?:(?:\\/\\/"+ue+me+")|"+pe+"|"+Nt+"|"+Ue+")",t.hierPartCapture="(?:(?:\\/\\/"+z+me+")|"+pe+"|"+Nt+")",t.relativeRef="(?:(?:\\/\\/"+ue+me+")|"+pe+"|"+vt+"|"+F+")",t.relativeRefCapture="(?:(?:\\/\\/"+z+me+")|"+pe+"|"+vt+"|"+F+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};Yt.rfc3986=Yt.generate();Kb.ip={v4Cidr:Yt.rfc3986.ipv4Cidr,v6Cidr:Yt.rfc3986.ipv6Cidr,ipv4:Yt.rfc3986.ipv4address,ipv6:Yt.rfc3986.ipv6address,ipvfuture:Yt.rfc3986.ipvFuture};Yt.createRegex=function(t){let e=Yt.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",s=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Yt.wrap(s+r);let i="";if(t.scheme){Vh(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let l=[].concat(t.scheme);Vh(l.length>=1,"scheme must have at least 1 scheme specified");let c=[];for(let h=0;h<l.length;++h){let f=l[h];Vh(f instanceof RegExp||typeof f=="string","scheme at position "+h+" must be a RegExp or String"),f instanceof RegExp?c.push(f.source.toString()):(Vh(e.schemeRegex.test(f),"scheme at position "+h+" must be a valid scheme"),c.push(Iq(f)))}i=c.join("|")}let a="(?:"+(i?"(?:"+i+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+s+")":a;return Yt.wrap(u+r,i)};Yt.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Yt.uriRegex=Yt.createRegex({});Kb.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Yt.createRegex(t):Yt.uriRegex}});var n1=m(t1=>{"use strict";var Fo=Ne(),_u=Vb();t1.regex=function(t={}){Fo(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";Fo(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),Fo(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]),Fo(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)Fo(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),Fo(["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 s=`(?:${n.map(o=>{if(e==="forbidden")return _u.ip[o];let a=`\\/${o==="ipv4"?_u.ip.v4Cidr:_u.ip.v6Cidr}`;return e==="required"?`${_u.ip[o]}${a}`:`${_u.ip[o]}(?:${a})?`}).join("|")})`,i=new RegExp(`^${s}$`);return{cidr:e,versions:n,regex:i,raw:s}}});var i1=m((z4,s1)=>{"use strict";var r1={};r1.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"];s1.exports=new Set(r1.tlds.map(t=>t.toLowerCase()))});var c1=m((K4,l1)=>{"use strict";var He=Ne(),Xh=Hb(),Mq=ZA(),u1=n1(),o1=zb(),a1=i1(),Lq=Vb(),Nq=tr(),mn=nt(),De={tlds:a1 instanceof Set?{tlds:{allow:a1,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:u1.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"]};l1.exports=Nq.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 s=e.$_getRule("normalize");s&&(t=t.normalize(s.args.form));let i=e.$_getRule("case");i&&(t=i.args.direction==="upper"?t.toLocaleUpperCase():t.toLocaleLowerCase());let o=e.$_getRule("trim");if(o&&o.args.enabled&&(t=t.trim()),e.$_terms.replacements)for(let u of e.$_terms.replacements)t=t.replace(u.pattern,u.replacement);let a=e.$_getRule("hex");if(a&&a.args.options.byteAligned&&t.length%2!==0&&(t=`0${t}`),e.$_getRule("isoDate")){let u=De.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let l=u.args.limit;if(mn.isResolvable(l)&&(l=l.resolve(t,n,r),!mn.limit(l)))return{value:t,errors:e.$_createError("any.ref",l,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,l)}}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 mn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},He(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),He(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return De.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return He(["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,s=1;for(;n--;){let i=t.charAt(n)*s;r=r+(i-(i>9)*9),s=s^3}return r>0&&r%10===0?t:e.error("string.creditCard")}},dataUri:{method(t={}){return mn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},He(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(De.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||De.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&mn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=De.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return Xh.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){mn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),He(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=De.addressOptions(t),n=new RegExp(`\\s*[${t.separator?o1(t.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:t},regex:n,address:e})},validate(t,e,{options:n},{regex:r,address:s}){let i=n.multiple?t.split(r):[t],o=[];for(let a of i)Mq.isValid(a,s)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){mn.assertOptions(t,["version","separator"]);let e="";if(t.version){let s=[].concat(t.version);He(s.length>=1,"version must have at least 1 valid version specified");let i=new Set;for(let o=0;o<s.length;++o){let a=s[o];He(typeof a=="string","version at position "+o+" must be a string");let u=De.guidVersions[a.toLowerCase()];He(u,"version at position "+o+" must be one of "+Object.keys(De.guidVersions).join(", ")),He(!i.has(u),"version at position "+o+" must not be a duplicate"),e+=u,i.add(u)}}He(De.guidSeparators.has(t.separator),'separator must be one of true, false, "-", or ":"');let n=t.separator===void 0?"[:-]?":t.separator===!0?"[:-]":t.separator===!1?"[]?":`\\${t.separator}`,r=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${e||"0-9A-F"}][0-9A-F]{3}\\2?[${e?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:t},regex:r})},validate(t,e,n,{regex:r}){let s=r.exec(t);return!s||De.guidBrackets[s[1]]!==s[s.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return mn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},He(typeof t.byteAligned=="boolean","byteAligned must be boolean"),He(typeof t.prefix=="boolean"||t.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:t}})},validate(t,e,{options:n}){return(n.prefix==="optional"?De.hexRegex.withOptionalPrefix:n.prefix===!0?De.hexRegex.withPrefix:De.hexRegex.withoutPrefix).test(t)?n.byteAligned&&t.length%2!==0?e.error("string.hexAlign"):t:e.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate(t,e){return Xh.isValid(t,{minDomainSegments:1})||De.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){mn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=u1.regex(t),s=t.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:e,version:s}},regex:r})},validate(t,e,{options:n},{regex:r}){return r.test(t)?t:n.version?e.error("string.ipVersion",{value:t,cidr:n.cidr,version:n.version}):e.error("string.ip",{value:t,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(t,{error:e}){return De.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return De.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return De.length(this,"length",t,"=",e)},validate(t,e,{limit:n,encoding:r},{name:s,operator:i,args:o}){let a=r?Buffer&&Buffer.byteLength(t,r):t.length;return mn.compare(a,n,i)?t:e.error("string."+s,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:mn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return De.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return De.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return He(De.normalizationForms.includes(t),"normalization form must be one of "+De.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:t}})},validate(t,{error:e},{form:n}){return t===t.normalize(n)?t:e("string.normalize",{value:t,form:n})},convert:!0},pattern:{alias:"regex",method(t,e={}){He(t instanceof RegExp,"regex must be a RegExp"),He(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),mn.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:s}){return n.test(t)^r.invert?t:e.error(s,{name:r.name,regex:n,value:t})},args:["regex","options"],multi:!0},replace:{method(t,e){typeof t=="string"&&(t=new RegExp(o1(t),"g")),He(t instanceof RegExp,"pattern must be a RegExp"),He(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 He(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 He(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){mn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&mn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=Lq.regex(t),r=t.domain?De.addressOptions(t.domain):null;return this.$_addRule({name:"uri",args:{options:t},regex:e,domain:r,scheme:n})},validate(t,e,{options:n},{regex:r,domain:s,scheme:i}){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 s&&(!n.allowRelative||a)&&!Xh.isValid(a,s)?e.error("string.domain",{value:a}):t}return n.relativeOnly?e.error("string.uriRelativeOnly"):n.scheme?e.error("string.uriCustomScheme",{scheme:i,value:t}):e.error("string.uri")}}},manifest:{build(t,e){if(e.replacements)for(let{pattern:n,replacement:r}of e.replacements)t=t.replace(n,r);return t}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}});De.addressOptions=function(t){if(!t)return De.tlds||t;if(He(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),He(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 He(De.tlds,"Built-in TLD list disabled"),Object.assign({},t,De.tlds);He(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)}})),He(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),He(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),De.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(He(De.tlds,"Built-in TLD list disabled"),Object.assign({},t,De.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),He(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),De.validateTlds(t.tlds.allow,"tlds.allow"),t):t};De.validateTlds=function(t,e){for(let n of t)He(Xh.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};De.isoDate=function(t){if(!mn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};De.length=function(t,e,n,r,s){return He(!s||Buffer&&Buffer.isEncoding(s),"Invalid encoding:",s),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:s},operator:r})}});var f1=m((V4,h1)=>{"use strict";var Yh=Ne(),qq=tr(),Xb={};Xb.Map=class extends Map{slice(){return new Xb.Map(this)}};h1.exports=qq.extend({type:"symbol",terms:{map:{init:new Xb.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)),Yh(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){Yh(r&&r[Symbol.iterator],"Entry must be an iterable");let[s,i]=r;Yh(typeof s!="object"&&typeof s!="function"&&typeof s!="symbol","Key must not be of type object, function, or Symbol"),Yh(typeof i=="symbol","Value must be a Symbol"),e.$_terms.map.set(s,i),n.push(i)}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 g1=m((Y4,p1)=>{"use strict";var jq=Ne(),Fq=tr(),d1=nt();p1.exports=Fq.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 jq(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:s,args:i}){return d1.compare(t.length,n,s)?t:e.error("binary."+r,{limit:i.limit,value:t})},args:[{name:"limit",ref:!0,assert:d1.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 Ih=m((J4,v1)=>{"use strict";var Ii=Ne(),$q=dn(),Bq=wb(),Di=nt(),Uq=Oi(),Jb=us(),Wq=xb(),m1=Ob(),Yb=ls(),y1=Gs(),b1=Rb(),Jh,Mt={types:{alternatives:SA(),any:tr(),array:wA(),boolean:CA(),date:IA(),function:zA(),link:VA(),number:YA(),object:QA(),string:c1(),symbol:f1()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Mt.types.binary=g1());Mt.root=function(){let t={_types:new Set(Object.keys(Mt.types))};for(let e of t._types)t[e]=function(...n){return Ii(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Mt.generate(this,Mt.types[e],n)};for(let e of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])t[e]=function(...n){return this.any()[e](...n)};Object.assign(t,Mt.methods);for(let e in Mt.aliases){let n=Mt.aliases[e];t[e]=t[n]}return t.x=t.expression,b1.setup&&b1.setup(t),t};Mt.methods={ValidationError:Jb.ValidationError,version:Di.version,cache:Bq.provider,assert(t,e,...n){Mt.assert(t,e,!0,n)},attempt(t,e,...n){return Mt.assert(t,e,!1,n)},build(t){return Ii(typeof m1.build=="function","Manifest functionality disabled"),m1.build(this,t)},checkPreferences(t){Di.checkPreferences(t)},compile(t,e){return Uq.compile(this,t,e)},defaults(t){Ii(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Ii(Di.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...s){return Mt.generate(this,r,s)}}return e},expression(...t){return new y1(...t)},extend(...t){Di.verifyFlat(t,"extend"),Jh=Jh||Dh(),Ii(t.length,"You need to provide at least one extension"),this.assert(t,Jh.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,Jh.extension);let r=Mt.expandExtension(n,e);for(let s of r){Ii(e[s.type]===void 0||e._types.has(s.type),"Cannot override name",s.type);let i=s.base||this.any(),o=Wq.type(i,s);e._types.add(s.type),e[s.type]=function(...a){return Mt.generate(this,o,a)}}}return e},isError:Jb.ValidationError.isError,isExpression:y1.isTemplate,isRef:Yb.isRef,isSchema:Di.isSchema,in(...t){return Yb.in(...t)},override:Di.symbols.override,ref(...t){return Yb.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Mt.aliases)t[e]=this[e]();return t}};Mt.assert=function(t,e,n,r){let s=r[0]instanceof Error||typeof r[0]=="string"?r[0]:null,i=s!==null?r[1]:r[0],o=e.validate(t,Di.preferences({errors:{stack:!0}},i||{})),a=o.error;if(!a)return o.value;if(s instanceof Error)throw s;let u=n&&typeof a.annotate=="function"?a.annotate():a.message;throw a instanceof Jb.ValidationError||(a=$q(a)),a.message=s?`${s} ${u}`:u,a};Mt.generate=function(t,e,n){return Ii(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Mt.expandExtension=function(t,e){if(typeof t.type=="string")return[t];let n=[];for(let r of e._types)if(t.type.test(r)){let s=Object.assign({},t);s.type=r,s.base=e[r](),n.push(s)}return n};v1.exports=Mt.root()});var _1=m(we=>{"use strict";var Hq=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.descriptionContainerSchema=we.signatureSchema=we.signatureDefinitionContainerSchema=we.signatureDefinitionSchema=we.signatureDefinitionFunctionSchema=we.signatureDefinitionFunctionSchemaArg=we.signatureDefinitionFunctionSchemaArgMultiTypes=we.signatureDefinitionFunctionSchemaArgDefaultNumber=we.signatureDefinitionFunctionSchemaArgDefaultString=we.signatureDefinitionTypeSchema=we.variationsSchema=void 0;var le=Hq(Ih()),Qh=Si();we.variationsSchema=le.default.array().items(le.default.alternatives(le.default.string(),le.default.number()));we.signatureDefinitionTypeSchema=le.default.alternatives(le.default.string(),le.default.object({type:le.default.string().required(),keyType:le.default.string().optional(),valueType:le.default.string().optional()}));we.signatureDefinitionFunctionSchemaArgDefaultString=le.default.object({type:le.default.string().valid(Qh.SignatureDefinitionBaseType.String).required(),value:le.default.string().allow("").required()});we.signatureDefinitionFunctionSchemaArgDefaultNumber=le.default.object({type:le.default.string().valid(Qh.SignatureDefinitionBaseType.Number).required(),value:le.default.number().required()});we.signatureDefinitionFunctionSchemaArgMultiTypes=le.default.object({label:le.default.string().required(),types:le.default.array().items(we.signatureDefinitionTypeSchema).required(),opt:le.default.boolean().optional(),default:le.default.alternatives(we.signatureDefinitionFunctionSchemaArgDefaultString,we.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});we.signatureDefinitionFunctionSchemaArg=le.default.object({label:le.default.string().required(),type:we.signatureDefinitionTypeSchema.required(),opt:le.default.boolean().optional(),default:le.default.alternatives(we.signatureDefinitionFunctionSchemaArgDefaultString,we.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});we.signatureDefinitionFunctionSchema=le.default.object({type:le.default.string().valid(Qh.SignatureDefinitionBaseType.Function).required(),description:le.default.string().optional(),example:le.default.string().optional(),isProtected:le.default.boolean().optional(),arguments:le.default.array().items(le.default.alternatives(we.signatureDefinitionFunctionSchemaArg,we.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:le.default.array().items(we.signatureDefinitionTypeSchema).required(),variations:we.variationsSchema.optional(),returnVariations:we.variationsSchema.optional()});we.signatureDefinitionSchema=le.default.object({type:we.signatureDefinitionTypeSchema.invalid(Qh.SignatureDefinitionBaseType.Function).required(),description:le.default.string().optional(),example:le.default.string().optional(),isProtected:le.default.boolean().optional(),variations:we.variationsSchema.optional()});we.signatureDefinitionContainerSchema=le.default.object().pattern(le.default.string(),le.default.alternatives(we.signatureDefinitionFunctionSchema,we.signatureDefinitionSchema));we.signatureSchema=le.default.object({type:le.default.string().required(),hidden:le.default.boolean().optional(),extends:le.default.string().optional(),definitions:le.default.object().required()});we.descriptionContainerSchema=le.default.object({$meta:le.default.object({description:le.default.string().required(),example:le.default.array().items(le.default.string().allow("")).optional()}).optional()}).pattern(le.default.string(),le.default.object({description:le.default.string().required(),example:le.default.array().items(le.default.string().allow("")).optional()}))});var tv=m(An=>{"use strict";var $o=An&&An.__assign||function(){return $o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},$o.apply(this,arguments)},Gq=An&&An.__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 s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n},Xs=An&&An.__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.")},Qb=An&&An.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i},zq=An&&An.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(An,"__esModule",{value:!0});An.Signature=void 0;var Zb=zq(Ih()),ev=_1(),Kq=Si(),Vq=Rh(),Xq=mb(),Yq=function(){function t(e){var n,r,s;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=(s=e.hidden)!==null&&s!==void 0?s:!1}return t.parseDefinitions=function(e){var n,r;Zb.default.assert(e,ev.signatureDefinitionContainerSchema);var s={};try{for(var i=Xs(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=Qb(o.value,2),u=a[0],l=a[1],c=l.type===Kq.SignatureDefinitionBaseType.Function?Xq.SignatureDefinitionFunction.parse(l):Vq.SignatureDefinition.parse(l);s[u]=c}}catch(h){n={error:h}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},t.parseDescriptions=function(e){var n,r,s,i,o;Zb.default.assert(e,ev.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var l=e.$meta,c=Gq(e,["$meta"]);u=l,a=c}var h={};try{for(var f=Xs(Object.entries(a)),g=f.next();!g.done;g=f.next()){var v=Qb(g.value,2),b=v[0],O=v[1];h[b]={description:O.description,example:(s=O.example)!==null&&s!==void 0?s:null}}}catch(A){n={error:A}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return $o({$meta:{description:(i=u?.description)!==null&&i!==void 0?i:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},h)},t.parse=function(e,n){var r,s;Zb.default.assert(e,ev.signatureSchema);var i=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.definitions);if(i.setDefinition(o),n!=null)try{for(var a=Xs(Object.entries(n)),u=a.next();!u.done;u=a.next()){var l=Qb(u.value,2),c=l[0],h=l[1],f=t.parseDescriptions(h);i.addDescriptions(c,f)}}catch(g){r={error:g}}finally{try{u&&!u.done&&(s=a.return)&&s.call(a)}finally{if(r)throw r.error}}return i},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,s=Object.keys(e);try{for(var i=Xs(s),o=i.next();!o.done;o=i.next()){var a=o.value;this._definitions[a]=e[a]}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}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],s=this.getDescriptions(n),i=s[e];return r.withDescription(i)},t.prototype.setDescriptions=function(e,n){return this._descriptions[e]=n,this},t.prototype.addDescriptions=function(e,n){var r,s,i=this._descriptions[e];i==null&&(i={},this._descriptions[e]=i);var o=Object.keys(n);try{for(var a=Xs(o),u=a.next();!u.done;u=a.next()){var l=u.value;i[l]=$o($o({},i[l]),n[l])}}catch(c){r={error:c}}finally{try{u&&!u.done&&(s=a.return)&&s.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={},s=Object.keys(this._definitions);try{for(var i=Xs(s),o=i.next();!o.done;o=i.next()){var a=o.value;r[a]=this._definitions[a].toJSON()}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}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,s,i=new t({type:this._type,hidden:this._hidden,extends:this._extends}),o={},a=Object.keys(this._definitions);try{for(var u=Xs(a),l=u.next();!l.done;l=u.next()){var c=l.value;o[c]=this._definitions[c].copy()}}catch(b){e={error:b}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var h={},f=Object.keys(this._descriptions);try{for(var g=Xs(f),v=g.next();!v.done;v=g.next()){var c=v.value;h[c]=$o({},h[c])}}catch(b){r={error:b}}finally{try{v&&!v.done&&(s=g.return)&&s.call(g)}finally{if(r)throw r.error}}return i._descriptions=h,i._definitions=o,i},t}();An.Signature=Yq});var T1=m(zr=>{"use strict";var Ys=zr&&zr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i},Bo=zr&&zr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},Tu=zr&&zr.__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(zr,"__esModule",{value:!0});zr.Container=void 0;var Gr=tv(),kt=Si(),Jq=function(){function t(){this._primitives=new Map([[kt.SignatureDefinitionBaseType.Any,new Gr.Signature({type:kt.SignatureDefinitionBaseType.Any})],[kt.SignatureDefinitionBaseType.General,new Gr.Signature({type:kt.SignatureDefinitionBaseType.General})],[kt.SignatureDefinitionBaseType.String,new Gr.Signature({type:kt.SignatureDefinitionBaseType.String})],[kt.SignatureDefinitionBaseType.Function,new Gr.Signature({type:kt.SignatureDefinitionBaseType.Function})],[kt.SignatureDefinitionBaseType.Number,new Gr.Signature({type:kt.SignatureDefinitionBaseType.Number})],[kt.SignatureDefinitionBaseType.List,new Gr.Signature({type:kt.SignatureDefinitionBaseType.List})],[kt.SignatureDefinitionBaseType.Map,new Gr.Signature({type:kt.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 Gr.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 Bo(Bo([],Ys(this._primitives.keys()),!1),Ys(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==kt.SignatureDefinitionBaseType.Any&&n!==kt.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 Bo(Bo([],Ys(this.getAllPrimitiveSignatures()),!1),Ys(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return Bo(Bo([],Ys(this.getAllPrimitiveSignatures()),!1),Ys(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=Gr.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,s,i={},o=Object.keys(n);try{for(var a=Tu(o),u=a.next();!u.done;u=a.next()){var l=u.value,c=Gr.Signature.parseDescriptions(n[l]);i[l]=c}}catch(h){r={error:h}}finally{try{u&&!u.done&&(s=a.return)&&s.call(a)}finally{if(r)throw r.error}}return this.addMeta(e,i),this},t.prototype.addMeta=function(e,n){var r,s,i=Object.keys(n);try{for(var o=Tu(i),a=o.next();!a.done;a=o.next()){var u=a.value,l=this.getOrCreateTypeSignature(u);l.addDescriptions(e,n[u])}}catch(c){r={error:c}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}return this},t.prototype.searchDefinitionMatches=function(e,n,r){var s,i;if(r===void 0&&(r="en"),typeof e=="string")return this.searchDefinitionMatches([e],n,r);var o=e.includes(kt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var l=Tu(o),c=l.next();!c.done;c=l.next()){var h=c.value;if(!this._excludeFromSearch.has(h)){for(var f=h,g=this.getTypeSignature(h),v=null;g!==null&&!a.has(g.getType())&&(a.add(g.getType()),g.isHidden()||(v=g.getDefinition(n,r)),v===null);)f=g.getExtendedType(),g=this.getTypeSignature(f);v!==null&&u.set(f,v)}}}catch(b){s={error:b}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(s)throw s.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 s=this._primitives.get(kt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(kt.SignatureDefinitionBaseType.Any)&&s)return s;var i=this.searchDefinitionMatches(e,n,r);return i.size===0?null:i.size===1?i.values().next().value:i.has(kt.SignatureDefinitionBaseType.Any)?i.get(kt.SignatureDefinitionBaseType.Any):s!==null?s:i.values().next().value},t.prototype.fork=function(){var e,n,r,s,i=new t;try{for(var o=Tu(this._primitives),a=o.next();!a.done;a=o.next()){var u=Ys(a.value,2),l=u[0],c=u[1];i._primitives.set(l,c.copy())}}catch(v){e={error:v}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var h=Tu(this._types),f=h.next();!f.done;f=h.next()){var g=Ys(f.value,2),l=g[0],c=g[1];i._types.set(l,c.copy())}}catch(v){r={error:v}}finally{try{f&&!f.done&&(s=h.return)&&s.call(h)}finally{if(r)throw r.error}}return i._excludeFromSearch=new Set(this._excludeFromSearch),i},t}();zr.Container=Jq});var k1=m(S1=>{"use strict";Object.defineProperty(S1,"__esModule",{value:!0})});var sr=m(yt=>{"use strict";var Qq=yt&&yt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),w1=yt&&yt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Qq(e,t,n)};Object.defineProperty(yt,"__esModule",{value:!0});yt.VariationRegistry=yt.Container=yt.Signature=yt.SignatureDefinition=yt.SignatureDefinitionTypeMeta=yt.SignatureDefinitionFunction=yt.SignatureDefinitionFunctionArg=void 0;var Zq=gb();Object.defineProperty(yt,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return Zq.SignatureDefinitionFunctionArg}});var ej=mb();Object.defineProperty(yt,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return ej.SignatureDefinitionFunction}});var tj=hu();Object.defineProperty(yt,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return tj.SignatureDefinitionTypeMeta}});var nj=Rh();Object.defineProperty(yt,"SignatureDefinition",{enumerable:!0,get:function(){return nj.SignatureDefinition}});var rj=tv();Object.defineProperty(yt,"Signature",{enumerable:!0,get:function(){return rj.Signature}});var sj=T1();Object.defineProperty(yt,"Container",{enumerable:!0,get:function(){return sj.Container}});var ij=Ch();Object.defineProperty(yt,"VariationRegistry",{enumerable:!0,get:function(){return ij.VariationRegistry}});w1(k1(),yt);w1(Si(),yt)});var nv=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.enrichWithMetaInformation=Mi.FunctionBlockTag=void 0;var oj=pb(),x1=sr();function E1(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var Su;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Example="example"})(Su=Mi.FunctionBlockTag||(Mi.FunctionBlockTag={}));function aj(t){let e=[t.description??"",...t.tags.filter(i=>i.tag===Su.Description).map(E1)].join(`
104
104
 
105
- `),n=t.tags.filter(s=>s.tag===Ba.Param).map(s=>({label:s.name,types:s.type.split("|"),opt:s.optional})),r=t.tags.find(s=>s.tag===Ba.Return)??{type:"any"},i=t.tags.filter(s=>s.tag===Ba.Example).map(lE);return{descriptions:e,args:n,returns:r,examples:i}}function FM(t){let e=(0,qM.parse)(`/**
105
+ `),n=t.tags.filter(i=>i.tag===Su.Param).map(i=>({label:i.name,types:i.type.split("|"),opt:i.optional})),r=t.tags.find(i=>i.tag===Su.Return)??{type:"any"},s=t.tags.filter(i=>i.tag===Su.Example).map(E1);return{descriptions:e,args:n,returns:r,examples:s}}function uj(t){let e=(0,oj.parse)(`/**
106
106
  ${t.getDescription()}
107
- */`),[n]=e;if(n.tags.length>0){let{descriptions:r,args:i,returns:s,examples:o}=jM(n);return cE.SignatureDefinitionFunction.parse({type:cE.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}as.enrichWithMetaInformation=FM});var by=g(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.createResolveChain=void 0;var an=Oe();function Oi(t,e,n=null,r=!1){switch(t.type){case an.ASTType.ParenthesisExpression:{Oi(t.expression,e,n);return}case an.ASTType.MemberExpression:{let i=t;Oi(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case an.ASTType.IndexExpression:{let i=t;Oi(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case an.ASTType.CallStatement:{Oi(t.expression,e,n,!0);return}case an.ASTType.CallExpression:{Oi(t.base,e,n,!0);return}case an.ASTType.NegationExpression:case an.ASTType.BinaryNegatedExpression:case an.ASTType.UnaryExpression:{let i=t;Oi(i.argument,e,i);return}case an.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case an.ASTType.NumericLiteral:case an.ASTType.StringLiteral:case an.ASTType.NilLiteral:case an.ASTType.MapConstructorExpression:case an.ASTType.ListConstructorExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case an.ASTType.SliceExpression:Oi(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function $M(t){let e=[];return Oi(t,e),e}Yl.createResolveChain=$M});var fE=g(vy=>{function dE(t,e){return t>e?1:-1}vy.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(dE),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},vy.sortNumbers=dE});var Sy=g(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.ObjectSet=fo.ObjectSetIterator=void 0;var _y=fE(),Jl=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}}};fo.ObjectSetIterator=Jl;var Ty=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,_y.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 Jl(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,_y.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,_y.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()}};fo.ObjectSet=Ty});var ky=g(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;Ql.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 us=g(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.CompletionItemKind=void 0;var BM;(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"})(BM=Ua.CompletionItemKind||(Ua.CompletionItemKind={}))});var xy=g(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.isResolveChainItemWithValue=Or.isResolveChainItemWithIdentifier=Or.isResolveChainItemWithMember=Or.isResolveChainItemWithIndex=void 0;var Ci=Oe(),UM=t=>t!=null&&t.ref.type===Ci.ASTType.IndexExpression;Or.isResolveChainItemWithIndex=UM;var HM=t=>t!=null&&t.ref.type===Ci.ASTType.MemberExpression;Or.isResolveChainItemWithMember=HM;var WM=t=>t!=null&&t.ref.type===Ci.ASTType.Identifier;Or.isResolveChainItemWithIdentifier=WM;var GM=t=>t!=null&&(t.ref.type===Ci.ASTType.NumericLiteral||t.ref.type===Ci.ASTType.StringLiteral||t.ref.type===Ci.ASTType.NilLiteral||t.ref.type===Ci.ASTType.MapConstructorExpression||t.ref.type===Ci.ASTType.ListConstructorExpression);Or.isResolveChainItemWithValue=GM});var wy=g(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.isSignatureDefinitionFunction=void 0;var KM=Gn(),VM=t=>t.getType().type===KM.SignatureDefinitionBaseType.Function;Zl.isSignatureDefinitionFunction=VM});var Ey=g(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.aggregateEntity=void 0;var zM=t=>{let e=new Set,n=t;for(;n!=null&&!e.has(n);)e.add(n),n=n.getIsa();return Array.from(e)};ed.aggregateEntity=zM});var Ha=g(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.injectIdentifers=void 0;var XM=Ey(),YM=(t,e)=>{let n=(0,XM.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.source===e.source?o.line:-1})}}};td.injectIdentifers=YM});var rd=g(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.isEligibleForProperties=void 0;var Ay=Gn(),JM=t=>t.types.has(Ay.SignatureDefinitionBaseType.Map)||t.types.has(Ay.SignatureDefinitionBaseType.List)||t.types.has(Ay.SignatureDefinitionBaseType.Any);nd.isEligibleForProperties=JM});var sd=g(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.lookupProperty=void 0;var QM=rd(),ZM=(t,e)=>{let n=t,r=new Set([n]);for(;(0,QM.isEligibleForProperties)(n);){let i=n.values.get(`i:${e}`);if(i!=null)return i;let s=n.getIsa();if(s==null||r.has(s))break;r.add(s),n=s}return null};id.lookupProperty=ZM});var Oy=g(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.mergeUnique=void 0;function eL(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=eL});var go=g(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.Entity=Ri.resolveEntity=void 0;var po=Gn(),ho=us(),tL=wy(),nL=Ha(),ad=rd(),pE=sd(),rL=Oy(),hE=Sy(),iL=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let i=e.getCallableReturnTypes();return i?new cs({source:e.source,kind:ho.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addTypes(i):new cs({source:e.source,kind:ho.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(po.SignatureDefinitionBaseType.Any)}return e};Ri.resolveEntity=iL;var Cy={hasProperty(t,e,n){return!!(0,pE.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,pE.lookupProperty)(t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,Ri.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,ad.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}},Ry={hasProperty(t,e,n){if(!(0,ad.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,ad.isEligibleForProperties)(t))return new cs({source:t.source,kind:ho.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(po.SignatureDefinitionBaseType.Any);let i=new cs({source:n.source,kind:ho.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(po.SignatureDefinitionBaseType.Any),(0,Ri.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,ad.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}},cs=class t{get source(){return this._source}get definitions(){return this._definitions}get kind(){return this._kind}get line(){return this._line}get signatureDefinitions(){return this._signatureDefinitions}get context(){return this._context}get label(){return this._label}get types(){return this._types}get values(){return this._values}constructor(e){this._source=e.source,this._isAPI=e.isAPI??!1,this._isFromSignature=e.isFromSignature??!1,this._kind=e.kind,this._line=e.line??-1,this._label=e.label??"anonymous",this._signatureDefinitions=e.signatureDefinitions??new hE.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(po.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,tL.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){return this._types.add(e),this}addTypes(e){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return Ry.hasProperty(this,this._container,e);default:return Cy.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return Ry.resolveProperty(this,this._container,e,n);default:return Cy.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return Ry.setProperty(this,this._container,e,n);default:return Cy.setProperty(this,this._container,e,n)}}extend(e,n=!1){if(e===this)return this;this._isFromSignature=!1,this._signatureDefinitions.extend(e.signatureDefinitions),n&&(0,rL.mergeUnique)(this.definitions,e.definitions),this.addTypes(Array.from(e.types));for(let[r,i]of e.values){let s=this.values.get(r);s==null?this.values.set(r,i.copy({container:this._container,context:this})):s.extend(i,n)}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(po.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({source:this._source,label:i,kind:s.getType().type===po.SignatureDefinitionBaseType.Function?ho.CompletionItemKind.Function:ho.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,nL.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({source:e.source??this._source,kind:e.kind??this._kind,line:e.line??this._line,isFromSignature:e.isFromSignature??this._isFromSignature,isAPI:e.isAPI??this._isAPI,container:e.container??this._container,label:e.label??this._label,context:e.context??this._context,signatureDefinitions:new hE.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}};Ri.Entity=cs});var Iy=g(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.Scope=void 0;var ud=Gn(),ls=us(),Py=Ha(),cd=go(),Dy=class t{get source(){return this._source}get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return ls.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(ud.SignatureDefinitionBaseType.Map)}get values(){return this._locals.values}get globals(){return this._globals}get outer(){return this._parent?.locals??null}get locals(){return this._locals}constructor(e){this._source=e.source,this._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new cd.Entity({source:this._source,kind:ls.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(ud.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,cd.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,cd.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,cd.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!")}addTypes(){throw new Error("Scope cannot get types assigned!")}setReturnEntity(){throw new Error("Scope cannot set return entity!")}getReturnEntity(){throw new Error("Scope cannot get return entity!")}setKind(e){return this._locals.setKind(e),this}setLine(e){return this._locals.setLine(e),this}setLabel(e){return this._locals.setLabel(e),this}setContext(e){return this._locals.setContext(e),this}insertSignature(e){return this._locals.insertSignature(e),this}isAPI(){return!1}hasContext(){return!1}isFromSignature(){return!1}isCallable(){return!1}getCallableReturnTypes(){return null}getAllIdentifier(){let e=new Map([["globals",{kind:ls.CompletionItemKind.Constant,line:-1}],["locals",{kind:ls.CompletionItemKind.Constant,line:-1}],["outer",{kind:ls.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(ud.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,Py.injectIdentifers)(e,this._globals),this._parent&&(0,Py.injectIdentifers)(e,this._parent.locals),(0,Py.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:ls.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:ls.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(ud.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({source:this._source,container:e.container??this._container,parent:this._parent.copy({container:e.container,deepCopy:!0}),globals:this._globals.copy({container:e.container,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};ld.Scope=Dy});var mo=g(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.GreybelKeyword=void 0;var sL;(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"})(sL=Wa.GreybelKeyword||(Wa.GreybelKeyword={}))});var Ny=g(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});var ds=Oe(),oL=mo(),My=class extends ds.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(ds.Keyword),...Object.values(oL.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===ds.CharacterCode.HASH}isMultilineComment(e,n){return ds.CharacterCode.SLASH===e&&ds.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return ds.CharacterCode.ASTERISK===e&&ds.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};Ly.default=My});var qy=g(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.CharacterCode=void 0;var aL;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(aL=Ga.CharacterCode||(Ga.CharacterCode={}))});var yo=g(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.Operator=void 0;var uL;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(uL=Ka.Operator||(Ka.Operator={}))});var Fy=g(Va=>{"use strict";var cL=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var ar=Oe(),lL=cL(Ny()),gE=qy(),mE=mo(),jy=yo();function yE(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var dd=class t extends ar.Lexer{constructor(e,n={}){n.validator=n.validator||new lL.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 ar.ASTRange(new ar.ASTPosition(r,s-o+1),new ar.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new ar.Token({type:ar.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(mE.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(mE.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Va.default=dd;dd.greybelScanHandlers={[ar.CharacterCode.ARROW_LEFT]:function(e){if(ar.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(jy.Operator.LeftShift,e)},[ar.CharacterCode.ARROW_RIGHT]:function(e){if(ar.CharacterCode.ARROW_RIGHT===this.codeAt(1))return ar.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(jy.Operator.UnsignedRightShift,e):this.scanPunctuator(jy.Operator.RightShift,e)},[gE.CharacterCode.AMPERSAND]:yE,[gE.CharacterCode.VERTICAL_LINE]:yE}});var fd=g(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.ASTType=void 0;var dL;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(dL=za.ASTType||(za.ASTType={}))});var By=g(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.ASTChunkAdvanced=void 0;var fL=Oe(),$y=class t extends fL.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})}};pd.ASTChunkAdvanced=$y});var Vy=g(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.ASTFeatureFileExpression=Kn.ASTFeatureInjectExpression=Kn.ASTFeatureEnvarExpression=Kn.ASTFeatureIncludeExpression=Kn.ASTFeatureImportExpression=void 0;var Xa=Oe(),Ya=fd(),Uy=class t extends Xa.ASTBase{constructor(e){super(Ya.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=Uy;var Hy=class t extends Xa.ASTBase{constructor(e){super(Ya.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=Hy;var Wy=class t extends Xa.ASTBase{constructor(e){super(Ya.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=Wy;var Gy=class t extends Xa.ASTBase{constructor(e){super(Ya.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=Gy;var Ky=class t extends Xa.ASTBase{constructor(e){super(Ya.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=Ky});var Yy=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 zy=Oe(),bE=fd(),pL=By(),Ja=Vy(),Xy=class extends zy.ASTProvider{featureImportExpression(e){return new Ja.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Ja.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Ja.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Ja.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new zy.ASTBase(bE.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new zy.ASTBase(bE.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Ja.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new pL.ASTChunkAdvanced(e)}};Nt.ASTProvider=Xy;var hL=fd();Object.defineProperty(Nt,"ASTType",{enumerable:!0,get:function(){return hL.ASTType}});var gL=By();Object.defineProperty(Nt,"ASTChunkAdvanced",{enumerable:!0,get:function(){return gL.ASTChunkAdvanced}});var Qa=Vy();Object.defineProperty(Nt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Qa.ASTFeatureEnvarExpression}});Object.defineProperty(Nt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Qa.ASTFeatureFileExpression}});Object.defineProperty(Nt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Qa.ASTFeatureImportExpression}});Object.defineProperty(Nt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Qa.ASTFeatureIncludeExpression}});Object.defineProperty(Nt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Qa.ASTFeatureInjectExpression}})});var Jy=g(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.SelectorGroups=gt.SelectorGroupType=gt.Selectors=gt.SelectorTypes=void 0;var He=Oe(),hd=mo(),Za=yo(),mL;(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"})(mL=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:hd.GreybelKeyword.Envar}),Inject:(0,He.createSelector)({type:He.TokenType.Keyword,value:hd.GreybelKeyword.Inject}),Line:(0,He.createSelector)({type:He.TokenType.Keyword,value:hd.GreybelKeyword.Line}),File:(0,He.createSelector)({type:He.TokenType.Keyword,value:hd.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 zr;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(zr=gt.SelectorGroupType||(gt.SelectorGroupType={}));gt.SelectorGroups=Object.assign(Object.assign({},He.SelectorGroups),{[zr.MapSeparator]:(0,He.createSelectorGroup)(zr.MapSeparator,[gt.Selectors.MapSeperator,gt.Selectors.CRBracket]),[zr.ListSeparator]:(0,He.createSelectorGroup)(zr.ListSeparator,[gt.Selectors.MapSeperator,gt.Selectors.SRBracket]),[zr.PathSegmentEnd]:(0,He.createSelectorGroup)(zr.PathSegmentEnd,[gt.Selectors.EndOfLine,gt.Selectors.Comment,gt.Selectors.EndOfFile]),[zr.BitwiseOperators]:(0,He.createSelectorGroup)(zr.BitwiseOperators,[gt.Selectors.LeftShift,gt.Selectors.RightShift,gt.Selectors.UnsignedRightShift])})});var TE=g(eu=>{"use strict";var yL=eu&&eu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eu,"__esModule",{value:!0});var mn=Oe(),bL=ua(),vE=ha(),vL=yL(Fy()),_L=Yy(),fs=mo(),_E=yo(),Fe=Jy(),Qy=class extends mn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new vL.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new _L.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 vE.Range(r.start,new bL.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:_E.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:_E.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 fs.GreybelKeyword.Include:case fs.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.addItemToLines(i),n.body.push(i);return}case fs.GreybelKeyword.Import:case fs.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.addItemToLines(i),n.body.push(i);return}case fs.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.addItemToLines(i),n.body.push(i);return}case fs.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.addItemToLines(i),n.body.push(i);return}case fs.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 vE.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}};eu.default=Qy});var Cr=g(Pt=>{"use strict";var TL=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]}),tu=Pt&&Pt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TL(e,t,n)},Zy=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 SL=Fy();Object.defineProperty(Pt,"Lexer",{enumerable:!0,get:function(){return Zy(SL).default}});var kL=Ny();Object.defineProperty(Pt,"LexerValidator",{enumerable:!0,get:function(){return Zy(kL).default}});var xL=TE();Object.defineProperty(Pt,"Parser",{enumerable:!0,get:function(){return Zy(xL).default}});tu(Yy(),Pt);tu(qy(),Pt);tu(mo(),Pt);tu(yo(),Pt);tu(Jy(),Pt)});var eb=g(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.merge=void 0;function wL(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))}gd.merge=wL});var SE=g(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.parseMapDescription=void 0;var EL=Cm();function AL(t){return{path:t.name,type:t.type}}function OL(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(AL)}}function CL(t){let e=(0,EL.parse)(`/**
107
+ */`),[n]=e;if(n.tags.length>0){let{descriptions:r,args:s,returns:i,examples:o}=aj(n);return x1.SignatureDefinitionFunction.parse({type:x1.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let l=a.getLabel(),c=a.getTypes().map(f=>f.toString()),h=a.isOptional();return{types:c,opt:h,...s[u],label:l}}),returns:i.type.split("|"),description:r,example:o})}return t}Mi.enrichWithMetaInformation=uj});var rv=m(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});Zh.createResolveChain=void 0;var $t=Ce();function Js(t,e,n=null,r=!1){switch(t.type){case $t.ASTType.ParenthesisExpression:{Js(t.expression,e,n);return}case $t.ASTType.MemberExpression:{let s=t;Js(s.base,e),e.push({ref:t,getter:s.identifier,unary:n,isInCallExpression:r});return}case $t.ASTType.IndexExpression:{let s=t;Js(s.base,e),e.push({ref:t,getter:s.index,unary:n,isInCallExpression:r});return}case $t.ASTType.CallStatement:{Js(t.expression,e,n,!0);return}case $t.ASTType.CallExpression:{Js(t.base,e,n,!0);return}case $t.ASTType.NegationExpression:case $t.ASTType.BinaryNegatedExpression:case $t.ASTType.UnaryExpression:{let s=t;Js(s.argument,e,s);return}case $t.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case $t.ASTType.NumericLiteral:case $t.ASTType.StringLiteral:case $t.ASTType.NilLiteral:case $t.ASTType.MapConstructorExpression:case $t.ASTType.ListConstructorExpression:case $t.ASTType.BinaryExpression:case $t.ASTType.LogicalExpression:case $t.ASTType.ComparisonGroupExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case $t.ASTType.SliceExpression:Js(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function lj(t){let e=[];return Js(t,e),e}Zh.createResolveChain=lj});var O1=m(sv=>{function A1(t,e){return t>e?1:-1}sv.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 s=Object.keys(e).sort(A1),i=0;i<s.length;i++){var o=s[i],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 l=0;l<u.length;l++)r=33*r^u.charCodeAt(l);return r},sv.sortNumbers=A1});var av=m(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.ObjectSet=Uo.ObjectSetIterator=void 0;var iv=O1(),ef=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}}};Uo.ObjectSetIterator=ef;var ov=class{constructor(e){let r=(e?Array.from(e):[]).map(s=>[(0,iv.hash)(s),s]);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 ef(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,iv.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,iv.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()}};Uo.ObjectSet=ov});var uv=m(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;tf.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 Li=m(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.CompletionItemKind=void 0;var cj;(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"})(cj=ku.CompletionItemKind||(ku.CompletionItemKind={}))});var lv=m(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.isResolveChainItemWithValue=Kr.isResolveChainItemWithIdentifier=Kr.isResolveChainItemWithMember=Kr.isResolveChainItemWithIndex=void 0;var kr=Ce(),hj=t=>t!=null&&t.ref.type===kr.ASTType.IndexExpression;Kr.isResolveChainItemWithIndex=hj;var fj=t=>t!=null&&t.ref.type===kr.ASTType.MemberExpression;Kr.isResolveChainItemWithMember=fj;var dj=t=>t!=null&&t.ref.type===kr.ASTType.Identifier;Kr.isResolveChainItemWithIdentifier=dj;var pj=t=>t!=null&&(t.ref.type===kr.ASTType.NumericLiteral||t.ref.type===kr.ASTType.StringLiteral||t.ref.type===kr.ASTType.NilLiteral||t.ref.type===kr.ASTType.MapConstructorExpression||t.ref.type===kr.ASTType.ListConstructorExpression||t.ref.type===kr.ASTType.BinaryExpression||t.ref.type===kr.ASTType.LogicalExpression||t.ref.type===kr.ASTType.ComparisonGroupExpression);Kr.isResolveChainItemWithValue=pj});var cv=m(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.isSignatureDefinitionFunction=void 0;var gj=sr(),mj=t=>t.getType().type===gj.SignatureDefinitionBaseType.Function;nf.isSignatureDefinitionFunction=mj});var hv=m(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.aggregateEntity=void 0;var yj=t=>{let e=new Set,n=t;for(;n!=null&&!e.has(n);)e.add(n),n=n.getIsa();return Array.from(e)};rf.aggregateEntity=yj});var wu=m(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.injectIdentifers=void 0;var bj=hv(),vj=(t,e)=>{let n=(0,bj.aggregateEntity)(e);for(let r=0;r<n.length;r++){let s=n[r];for(let[i,o]of s.values)if(i.startsWith("i:")){let a=i.slice(2);if(t.has(a))continue;t.set(a,{kind:o.kind,line:o.source===e.source?o.line:-1})}}};sf.injectIdentifers=vj});var af=m(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.isEligibleForProperties=void 0;var fv=sr(),_j=t=>t.types.has(fv.SignatureDefinitionBaseType.Map)||t.types.has(fv.SignatureDefinitionBaseType.List)||t.types.has(fv.SignatureDefinitionBaseType.Any);of.isEligibleForProperties=_j});var lf=m(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.lookupProperty=void 0;var Tj=af(),Sj=(t,e)=>{let n=t,r=new Set([n]);for(;(0,Tj.isEligibleForProperties)(n);){let s=n.values.get(`i:${e}`);if(s!=null)return s;let i=n.getIsa();if(i==null||r.has(i))break;r.add(i),n=i}return null};uf.lookupProperty=Sj});var dv=m(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.mergeUnique=void 0;function kj(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 s=0;s<r.length;s+=n)Array.prototype.push.apply(t,r.slice(s,s+n))}cf.mergeUnique=kj});var Go=m(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.Entity=Qs.resolveEntity=void 0;var Wo=sr(),Ho=Li(),wj=cv(),xj=wu(),hf=af(),C1=lf(),Ej=dv(),R1=av(),Aj=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let s=e.getCallableReturnTypes();return s?new Ni({source:e.source,kind:Ho.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addTypes(s):new Ni({source:e.source,kind:Ho.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(Wo.SignatureDefinitionBaseType.Any)}return e};Qs.resolveEntity=Aj;var pv={hasProperty(t,e,n){return!!(0,C1.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let s=(0,C1.lookupProperty)(t,n)??null;return s==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,Qs.resolveEntity)(e,s,r)},setProperty(t,e,n,r){if(!(0,hf.isEligibleForProperties)(t))return!1;let s=`i:${n}`,i=t.values.get(s);return i?i.extend(r):t.values.set(s,r.copy({container:e,label:n,context:t,definitions:[]})),!0}},gv={hasProperty(t,e,n){if(!(0,hf.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,hf.isEligibleForProperties)(t))return new Ni({source:t.source,kind:Ho.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(Wo.SignatureDefinitionBaseType.Any);let s=new Ni({source:n.source,kind:Ho.CompletionItemKind.Variable,container:e,label:n.label,context:t});for(let i of n.types){let o=t.values.get(`t:${i}`);o&&s.extend(o)}return s.types.size===0&&s.addType(Wo.SignatureDefinitionBaseType.Any),(0,Qs.resolveEntity)(e,s,r)},setProperty(t,e,n,r){if(!(0,hf.isEligibleForProperties)(t))return!1;for(let s of n.types){let i=`t:${s}`,o=t.values.get(i);o?o.extend(r):t.values.set(i,r.copy({container:e,label:s,context:t,definitions:[]}))}return!0}},Ni=class t{get source(){return this._source}get definitions(){return this._definitions}get kind(){return this._kind}get line(){return this._line}get signatureDefinitions(){return this._signatureDefinitions}get context(){return this._context}get label(){return this._label}get types(){return this._types}get values(){return this._values}constructor(e){this._source=e.source,this._isAPI=e.isAPI??!1,this._isFromSignature=e.isFromSignature??!1,this._kind=e.kind,this._line=e.line??-1,this._label=e.label??"anonymous",this._signatureDefinitions=e.signatureDefinitions??new R1.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(Wo.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,wj.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){return this._types.add(e),this}addTypes(e){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return gv.hasProperty(this,this._container,e);default:return pv.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return gv.resolveProperty(this,this._container,e,n);default:return pv.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return gv.setProperty(this,this._container,e,n);default:return pv.setProperty(this,this._container,e,n)}}extend(e,n=!1,r=!1){if(e===this)return this;let s=new WeakSet([e]),i=[{target:this,source:e}];for(;i.length>0;){let o=i.pop(),a=o.target,u=o.source;a._isFromSignature=!1,a._signatureDefinitions.extend(u._signatureDefinitions),n&&(r?a._definitions=[...a._definitions,...u._definitions]:(0,Ej.mergeUnique)(a._definitions,u._definitions)),a.addTypes(Array.from(u.types));for(let[l,c]of u.values){let h=a._values.get(l);h==null?a._values.set(l,c.copy({container:a._container,context:a,deepCopy:r})):s.has(c)||(s.add(c),i.push({target:h,source:c}))}}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(Wo.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let s=n[r],i=e.getDefinition(s),o=new t({source:this._source,label:s,kind:i.getType().type===Wo.SignatureDefinitionBaseType.Function?Ho.CompletionItemKind.Function:Ho.CompletionItemKind.Property,container:this._container,isFromSignature:!0});o.addSignatureType(i),this.setProperty(s,o)}return this}getAllIdentifier(){let e=new Map;for(let n of this._types){let r=this._container.getAllIdentifier(n);for(let s of r)e.set(...s)}return(0,xj.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,[s,i])=>(r[s]=i?.toJSONInternal(e),r),{}),n}toJSON(){return this.toJSONInternal()}copy(e={}){let n=new t({source:e.source??this._source,kind:e.kind??this._kind,line:e.line??this._line,isFromSignature:e.isFromSignature??this._isFromSignature,isAPI:e.isAPI??this._isAPI,container:e.container??this._container,label:e.label??this._label,context:e.context??this._context,signatureDefinitions:new R1.ObjectSet(Array.from(this._signatureDefinitions,i=>i.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values,definitions:e.definitions??this._definitions});if(!e.deepCopy)return n;let r=new WeakMap;function s(i,o){let a=r.get(o);if(a)return a;let u=o.copy({container:e.container,line:e.line,context:i,values:new Map});r.set(o,u);for(let[l,c]of o.values)u._values.set(l,s(u,c));return u._definitions=[...o.definitions],u}n._values=new Map;for(let[i,o]of this._values)n._values.set(i,s(n,o));return n._definitions=[...this._definitions],n}};Qs.Entity=Ni});var bv=m(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.Scope=void 0;var ff=sr(),qi=Li(),mv=wu(),df=Go(),yv=class t{get source(){return this._source}get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return qi.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(ff.SignatureDefinitionBaseType.Map)}get values(){return this._locals.values}get globals(){return this._globals}get outer(){return this._parent?.locals??null}get locals(){return this._locals}constructor(e){this._source=e.source,this._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new df.Entity({source:this._source,kind:qi.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(ff.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,df.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,df.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,df.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!")}addTypes(){throw new Error("Scope cannot get types assigned!")}setReturnEntity(){throw new Error("Scope cannot set return entity!")}getReturnEntity(){throw new Error("Scope cannot get return entity!")}setKind(e){return this._locals.setKind(e),this}setLine(e){return this._locals.setLine(e),this}setLabel(e){return this._locals.setLabel(e),this}setContext(e){return this._locals.setContext(e),this}insertSignature(e){return this._locals.insertSignature(e),this}isAPI(){return!1}hasContext(){return!1}isFromSignature(){return!1}isCallable(){return!1}getCallableReturnTypes(){return null}getAllIdentifier(){let e=new Map([["globals",{kind:qi.CompletionItemKind.Constant,line:-1}],["locals",{kind:qi.CompletionItemKind.Constant,line:-1}],["outer",{kind:qi.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(ff.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,mv.injectIdentifers)(e,this._globals),this._parent&&(0,mv.injectIdentifers)(e,this._parent.locals),(0,mv.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:qi.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:qi.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(ff.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({source:this._source,container:e.container??this._container,parent:this._parent.copy({container:e.container,deepCopy:!0}),globals:this._globals.copy({container:e.container,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};pf.Scope=yv});var zo=m(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.GreybelKeyword=void 0;var Oj;(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"})(Oj=xu.GreybelKeyword||(xu.GreybelKeyword={}))});var Tv=m(_v=>{"use strict";Object.defineProperty(_v,"__esModule",{value:!0});var ji=Ce(),Cj=zo(),vv=class extends ji.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(ji.Keyword),...Object.values(Cj.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===ji.CharacterCode.HASH}isMultilineComment(e,n){return ji.CharacterCode.SLASH===e&&ji.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return ji.CharacterCode.ASTERISK===e&&ji.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};_v.default=vv});var Sv=m(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.CharacterCode=void 0;var Rj;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(Rj=Eu.CharacterCode||(Eu.CharacterCode={}))});var Ko=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.Operator=void 0;var Pj;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(Pj=Au.Operator||(Au.Operator={}))});var wv=m(Ou=>{"use strict";var Dj=Ou&&Ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ou,"__esModule",{value:!0});var wr=Ce(),Ij=Dj(Tv()),P1=Sv(),D1=zo(),kv=Ko();function I1(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var gf=class t extends wr.Lexer{constructor(e,n={}){n.validator=n.validator||new Ij.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,s=n.lineStart,i=n.index,o=n.offset,a=n.offset,u=!1;for(;n.index<n.length;){let h=n.codeAt();if(n.validator.isEndOfLine(h))n.validator.isWinNewline(h,n.codeAt(1))&&n.index++,n.line++,a=n.index+1;else if(n.validator.isMultilineCommentEnd(n.codeAt(),n.codeAt(1))){u=!0;break}n.index++}if(!u)return n.raise("Unexpected end of file in multiline comment.",new wr.ASTRange(new wr.ASTPosition(r,i-o+1),new wr.ASTPosition(n.line,n.index-a+3)));let l=n.content.slice(i+2,n.index);n.index+=2;let c=new wr.Token({type:wr.TokenType.Comment,value:l,line:r,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[o,a],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,n.snapshot.enqueue(c),c}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(D1.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(D1.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Ou.default=gf;gf.greybelScanHandlers={[wr.CharacterCode.ARROW_LEFT]:function(e){if(wr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(kv.Operator.LeftShift,e)},[wr.CharacterCode.ARROW_RIGHT]:function(e){if(wr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return wr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(kv.Operator.UnsignedRightShift,e):this.scanPunctuator(kv.Operator.RightShift,e)},[P1.CharacterCode.AMPERSAND]:I1,[P1.CharacterCode.VERTICAL_LINE]:I1}});var mf=m(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.ASTType=void 0;var Mj;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(Mj=Cu.ASTType||(Cu.ASTType={}))});var Ev=m(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.ASTChunkAdvanced=void 0;var Lj=Ce(),xv=class t extends Lj.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})}};yf.ASTChunkAdvanced=xv});var Dv=m(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.ASTFeatureFileExpression=ir.ASTFeatureInjectExpression=ir.ASTFeatureEnvarExpression=ir.ASTFeatureIncludeExpression=ir.ASTFeatureImportExpression=void 0;var Ru=Ce(),Pu=mf(),Av=class t extends Ru.ASTBase{constructor(e){super(Pu.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})}};ir.ASTFeatureImportExpression=Av;var Ov=class t extends Ru.ASTBase{constructor(e){super(Pu.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})}};ir.ASTFeatureIncludeExpression=Ov;var Cv=class t extends Ru.ASTBase{constructor(e){super(Pu.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})}};ir.ASTFeatureEnvarExpression=Cv;var Rv=class t extends Ru.ASTBase{constructor(e){super(Pu.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})}};ir.ASTFeatureInjectExpression=Rv;var Pv=class t extends Ru.ASTBase{constructor(e){super(Pu.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})}};ir.ASTFeatureFileExpression=Pv});var Lv=m(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ASTFeatureInjectExpression=Bt.ASTFeatureIncludeExpression=Bt.ASTFeatureImportExpression=Bt.ASTFeatureFileExpression=Bt.ASTFeatureEnvarExpression=Bt.ASTChunkAdvanced=Bt.ASTType=Bt.ASTProvider=void 0;var Iv=Ce(),M1=mf(),Nj=Ev(),Du=Dv(),Mv=class extends Iv.ASTProvider{featureImportExpression(e){return new Du.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Du.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Du.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Du.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new Iv.ASTBase(M1.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new Iv.ASTBase(M1.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Du.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new Nj.ASTChunkAdvanced(e)}};Bt.ASTProvider=Mv;var qj=mf();Object.defineProperty(Bt,"ASTType",{enumerable:!0,get:function(){return qj.ASTType}});var jj=Ev();Object.defineProperty(Bt,"ASTChunkAdvanced",{enumerable:!0,get:function(){return jj.ASTChunkAdvanced}});var Iu=Dv();Object.defineProperty(Bt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureEnvarExpression}});Object.defineProperty(Bt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureFileExpression}});Object.defineProperty(Bt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureImportExpression}});Object.defineProperty(Bt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureIncludeExpression}});Object.defineProperty(Bt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureInjectExpression}})});var Nv=m(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.SelectorGroups=bt.SelectorGroupType=bt.Selectors=bt.SelectorTypes=void 0;var Ge=Ce(),bf=zo(),Mu=Ko(),Fj;(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"})(Fj=bt.SelectorTypes||(bt.SelectorTypes={}));bt.Selectors=Object.assign(Object.assign({},Ge.Selectors),{From:(0,Ge.createSelector)({type:Ge.TokenType.Identifier,value:"from"}),Envar:(0,Ge.createSelector)({type:Ge.TokenType.Keyword,value:bf.GreybelKeyword.Envar}),Inject:(0,Ge.createSelector)({type:Ge.TokenType.Keyword,value:bf.GreybelKeyword.Inject}),Line:(0,Ge.createSelector)({type:Ge.TokenType.Keyword,value:bf.GreybelKeyword.Line}),File:(0,Ge.createSelector)({type:Ge.TokenType.Keyword,value:bf.GreybelKeyword.File}),LeftShift:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Mu.Operator.LeftShift}),RightShift:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Mu.Operator.RightShift}),UnsignedRightShift:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Mu.Operator.UnsignedRightShift}),BitwiseOr:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Mu.Operator.BitwiseOr}),BitwiseAnd:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Mu.Operator.BitwiseAnd}),Escape:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Ge.Operator.Escape})});var gs;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(gs=bt.SelectorGroupType||(bt.SelectorGroupType={}));bt.SelectorGroups=Object.assign(Object.assign({},Ge.SelectorGroups),{[gs.MapSeparator]:(0,Ge.createSelectorGroup)(gs.MapSeparator,[bt.Selectors.MapSeperator,bt.Selectors.CRBracket]),[gs.ListSeparator]:(0,Ge.createSelectorGroup)(gs.ListSeparator,[bt.Selectors.MapSeperator,bt.Selectors.SRBracket]),[gs.PathSegmentEnd]:(0,Ge.createSelectorGroup)(gs.PathSegmentEnd,[bt.Selectors.EndOfLine,bt.Selectors.Comment,bt.Selectors.EndOfFile]),[gs.BitwiseOperators]:(0,Ge.createSelectorGroup)(gs.BitwiseOperators,[bt.Selectors.LeftShift,bt.Selectors.RightShift,bt.Selectors.UnsignedRightShift])})});var q1=m(Lu=>{"use strict";var $j=Lu&&Lu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lu,"__esModule",{value:!0});var On=Ce(),Bj=Wa(),L1=Xa(),Uj=$j(wv()),Wj=Lv(),Fi=zo(),N1=Ko(),$e=Nv(),qv=class extends On.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new Uj.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new Wj.ASTProvider,super(e,n);let s=this;s.filename=(r=n.filename)!==null&&r!==void 0?r:"unknown",s.imports=[],s.includes=[],s.injects=[]}skipNewlines(){let e=this,n=0;for(;;){if($e.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($e.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}parseMap(e=!1,n=!1){let r=this;if(!$e.Selectors.CLBracket(r.token))return r.parseList(e,n);let s=r.currentScope,i=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:i.start,end:null,range:[i.range[0],null],scope:s});if(r.next(),$e.Selectors.CRBracket(r.token))r.next();else for(;!$e.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),$e.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:s});if(u.key=r.parseExpr(null),r.requireToken($e.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:s}),init:null,start:u.start,end:null,range:[u.range[0],null]}),h=r.currentAssignment;r.currentAssignment=c,u.value=r.parseExpr(u),r.currentAssignment=h,c.init=u.value,c.end=r.previousToken.end,c.range[1]=r.previousToken.range[1],s.assignments.push(c)}else u.value=r.parseExpr(u);u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let l=r.requireTokenOfAny($e.SelectorGroups.MapSeparator,i.start);if($e.Selectors.CRBracket(l))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!$e.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let s=r.currentScope,i=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:i.start,end:null,range:[i.range[0],null],scope:s});if(r.next(),$e.Selectors.SRBracket(r.token))r.next();else for(;!$e.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),$e.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:s});if(r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(On.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:s}),base:r.currentAssignment.variable,start:null,end:null,range:[null,null],scope:s}),init:null,start:null,end:null,range:[null,null]}),h=r.currentAssignment,f=r.token;r.currentAssignment=h,u.value=r.parseExpr(u),r.currentAssignment=h,c.variable.start=f.start,c.variable.end=r.previousToken.end,c.variable.range=[f.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]],s.assignments.push(c)}else u.value=r.parseExpr(u);u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let l=r.requireTokenOfAny($e.SelectorGroups.ListSeparator,i.start);if($e.Selectors.SRBracket(l))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===On.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!$e.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany($e.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken,r=e.parsePathSegment(),s=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(s),s}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken,s=n.parseIdentifier();if(!n.consume($e.Selectors.From))return n.raise("expected from keyword",new L1.Range(r.start,new Bj.Position((e=n.token.lastLine)!==null&&e!==void 0?e:n.token.line,n.token.end.character))),n.parseInvalidCode();let i=n.parsePathSegment(),o=n.astProvider.featureImportExpression({name:s,path:i,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:s,init:n.astProvider.literal(On.TokenType.NilLiteral,{value:null,raw:"null",start:s.start,end:s.end,range:s.range,scope:n.currentScope}),start:s.start,end:s.end,range:s.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 s=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(s),s}parseIsa(e=!1,n=!1){let r=this,s=r.token,i=r.parseBitwiseOr(e,n);if($e.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:On.Operator.Isa,left:i,right:o,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return i}parseBitwiseOr(e=!1,n=!1){let r=this,s=r.token,o=r.parseBitwiseAnd(e,n);for(;$e.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:N1.Operator.BitwiseOr,left:o,right:a,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,s=r.token,o=r.parseComparisons(e,n);for(;$e.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:N1.Operator.BitwiseAnd,left:o,right:a,start:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,s=r.token,o=r.parseBitwise(e,n);for(;$e.Selectors.Plus(r.token)||$e.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:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,s=r.token,o=r.parseMultDiv(e,n);for(;$e.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:s.start,end:r.previousToken.end,range:[s.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAtom(){let e=this;return $e.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):$e.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):$e.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new On.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new On.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):$e.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new On.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new On.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(On.TokenType.Keyword))switch(e.token.value){case Fi.GreybelKeyword.Include:case Fi.GreybelKeyword.IncludeWithComment:{e.next();let s=e.parseFeatureIncludeStatement();e.addItemToLines(s),n.body.push(s);return}case Fi.GreybelKeyword.Import:case Fi.GreybelKeyword.ImportWithComment:{e.next();let s=e.parseFeatureImportStatement();e.addItemToLines(s),n.body.push(s);return}case Fi.GreybelKeyword.Envar:{e.next();let s=e.parseFeatureEnvarExpression();e.addItemToLines(s),n.body.push(s);return}case Fi.GreybelKeyword.Inject:{e.next();let s=e.parseFeatureInjectExpression();e.addItemToLines(s),n.body.push(s);return}case Fi.GreybelKeyword.Debugger:{e.next();let s=e.astProvider.featureDebuggerExpression({start:new On.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new On.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(s),n.body.push(s);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]}),s=new On.PendingChunk(r);for(e.backpatches.setDefault(s),e.pushScope(r);!$e.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!$e.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let i=e.backpatches.pop();for(;!(0,On.isPendingChunk)(i);){let o=e.raise(`found open block ${i.block.type}`,new L1.Range(i.block.start,i.block.start));if(i.complete(e.previousToken),e.errors.push(o),!e.unsafe)throw o;i=e.backpatches.pop()}return e.finishRemaingScopes(),e.popScope(),s.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}};Lu.default=qv});var Vr=m(Lt=>{"use strict";var Hj=Lt&&Lt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Nu=Lt&&Lt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Hj(e,t,n)},jv=Lt&&Lt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.Parser=Lt.LexerValidator=Lt.Lexer=void 0;var Gj=wv();Object.defineProperty(Lt,"Lexer",{enumerable:!0,get:function(){return jv(Gj).default}});var zj=Tv();Object.defineProperty(Lt,"LexerValidator",{enumerable:!0,get:function(){return jv(zj).default}});var Kj=q1();Object.defineProperty(Lt,"Parser",{enumerable:!0,get:function(){return jv(Kj).default}});Nu(Lv(),Lt);Nu(Sv(),Lt);Nu(zo(),Lt);Nu(Ko(),Lt);Nu(Nv(),Lt)});var Fv=m(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.merge=void 0;function Vj(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))}vf.merge=Vj});var j1=m(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.parseMapDescription=void 0;var Xj=pb();function Yj(t){return{path:t.name,type:t.type}}function Jj(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(Yj)}}function Qj(t){let e=(0,Xj.parse)(`/**
109
109
  ${t}
110
- */`),[n]=e;return n.tags.length>0?OL(n):null}md.parseMapDescription=CL});var nb=g(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.Aggregator=void 0;var yd=Cr(),Le=Gn(),Ce=Oe(),RL=ky(),we=us(),ps=xy(),kE=fm(),PL=yy(),xE=by(),wE=Sa(),EE=eb(),DL=Oy(),IL=SE(),ML=go(),tb=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 ML.Entity({source:this._document.source,kind:e,container:this._document.container})}createMapDescription(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Ce.ASTType.Comment);if(n instanceof Ce.ASTComment){let i=new Set,s=[],o=e.start.line-1;for(;o>=0;){let a=this._document.getLastASTItemOfLine(o--);if(!i.has(a))if(a instanceof Ce.ASTComment)i.add(a),s.unshift(a.value);else break}return s.join(`
111
- `)}else if(r instanceof Ce.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(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=RL.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),i=this._document.findASTItemInLine(e.start.line,Ce.ASTType.Comment);if(r instanceof Ce.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 Ce.ASTComment)s.add(u),o.unshift(u.value);else break}return o.join(`
110
+ */`),[n]=e;return n.tags.length>0?Jj(n):null}_f.parseMapDescription=Qj});var Bv=m(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.Aggregator=Vo.ASTChainIterator=void 0;var Tf=Vr(),ze=sr(),Re=Ce(),Zj=uv(),Ie=Li(),$i=lv(),F1=Jy(),eF=nv(),$1=rv(),U1=ru(),B1=Fv(),tF=dv(),nF=j1(),rF=Go(),Sf=class{constructor(e,n,r=!1,s=!1){this.aggregator=e,this.chain=n,this.noInvoke=r,this.assumeLast=s,this.index=0,this.endIndex=this.chain.length-1,this.current=null}defineAssumedProperty(e,n){let r=this.aggregator.factory(Ie.CompletionItemKind.Variable);return typeof n=="string"&&r.setLabel(n),r.addType(ze.SignatureDefinitionBaseType.Any),this.index===this.endIndex&&!this.assumeLast?r:(e.setProperty(n,r),e.resolveProperty(n,!0))}getInitial(){let e=null,n=this.aggregator.scope,r=this.aggregator.document,s=this.chain[0],i=s.unary?.operator==="@"&&!s.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,$i.isResolveChainItemWithIdentifier)(s))if(s.getter.name==="globals")e=n.globals;else if(s.getter.name==="outer")e=n.outer;else if(s.getter.name==="locals")e=n.locals;else if(s.getter.name==="super"){let o=r.getScopeContext(s.ref.scope)?.scope.context?.getIsa();o==null?e=this.aggregator.factory(Ie.CompletionItemKind.Constant).addType("null").setLabel("super"):e=o.copy({kind:Ie.CompletionItemKind.Constant,label:"super",values:o.values})}else if(s.getter.name==="self"){let o=r.getScopeContext(s.ref.scope)?.scope.context;o==null?e=this.aggregator.factory(Ie.CompletionItemKind.Constant).addType("null").setLabel("self"):e=o.copy({kind:Ie.CompletionItemKind.Constant,label:"self",values:o.values})}else{let o=n.resolveNamespace(s.getter.name,i);o==null&&(o=this.defineAssumedProperty(n.globals,s.getter.name)),e=o}else if((0,$i.isResolveChainItemWithValue)(s))e=this.aggregator.resolveTypeWithDefault(s.value,i);else return null;if(s.unary?.operator===Re.Keyword.New&&e!==null){let o=this.aggregator.factory(Ie.CompletionItemKind.Variable).addType(ze.SignatureDefinitionBaseType.Map).setLabel(e.label);o.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(s.unary,o),e=o}return e}getNext(){let e=this.current,n=this.chain[this.index],r=n.unary?.operator==="@"&&!n.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,$i.isResolveChainItemWithMember)(n)){let s=e.resolveProperty(n.getter.name,r);s==null&&(s=this.defineAssumedProperty(e,n.getter.name)),e=s}else if((0,$i.isResolveChainItemWithIndex)(n))if((0,U1.isValidIdentifierLiteral)(n.getter)){let s=n.getter.value.toString(),i=e.resolveProperty(s,n.isInCallExpression);i==null&&(i=this.defineAssumedProperty(e,s)),e=i}else{let s=this.aggregator.resolveTypeWithDefault(n.getter),i=e.resolveProperty(s,n.isInCallExpression);i==null&&(i=this.defineAssumedProperty(e,s)),e=i}else if(n.ref.type===Re.ASTType.SliceExpression)e=e.copy();else return null;if(n.unary?.operator===Re.Keyword.New&&this.current!==null){let s=this.aggregator.factory(Ie.CompletionItemKind.Property).addType(ze.SignatureDefinitionBaseType.Map).setLabel(e.label);s.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(n.unary,s),e=s}return e}next(){if(this.index>=this.chain.length)return{value:null,done:!0};let e=this.index===0?this.getInitial():this.getNext();return e==null?{value:null,done:!0}:(this.index++,this.current=e,{value:e,done:!1})}};Vo.ASTChainIterator=Sf;var $v=class{get definitions(){return this._definitions}get parent(){return this._parent}get scope(){return this._scope}get document(){return this._document}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map,this._lastModifiedProperty=null}factory(e){return new rF.Entity({source:this._document.source,kind:e,container:this._document.container})}createMapDescription(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Re.ASTType.Comment);if(n instanceof Re.ASTComment){let s=new Set,i=[],o=e.start.line-1;for(;o>=0;){let a=this._document.getLastASTItemOfLine(o--);if(!s.has(a))if(a instanceof Re.ASTComment)s.add(a),i.unshift(a.value);else break}return i.join(`
111
+ `)}else if(r instanceof Re.ASTComment)return r.value;return null}createCustomTypeFromMap(e,n){let r=this.createMapDescription(e);if(r==null)return;let s=(0,nF.parseMapDescription)(r);s!=null&&(s.properties.forEach(i=>{if(i.path==="__isa")return;let o=i.path.split("."),a=this.factory(Ie.CompletionItemKind.Property).addType(i.type).setLabel(o[o.length-1]);this.setEntityInPath(n,o,a)}),this._scope.setCustomType(s.type,n))}createFunctionDescription(e,n=Zj.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),s=this._document.findASTItemInLine(e.start.line,Re.ASTType.Comment);if(r instanceof Re.ASTComment){let i=new Set,o=[],a=e.start.line-1;for(;a>=0;){let u=this._document.getLastASTItemOfLine(a--);if(!i.has(u))if(u instanceof Re.ASTComment)i.add(u),o.unshift(u.value);else break}return o.join(`
112
112
 
113
- `)}else if(i instanceof Ce.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=Le.SignatureDefinitionFunction.parse({type:Le.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Ce.ASTType.Identifier)return{label:r.name??"unknown",type:Le.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(Le.SignatureDefinitionBaseType.Function).addSignatureType((0,PL.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(Le.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(we.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Le.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(we.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Le.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Le.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Le.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Le.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(we.CompletionItemKind.MapConstructor).addType(Le.SignatureDefinitionBaseType.Map);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.resolveTypeWithDefault(i.value).setLine(i.start.line);if(i.key.type===Ce.ASTType.StringLiteral){let o=i.key.value.toString();n.setProperty(o,s),n.values.get(`i:${o}`)?.definitions.push({source:this._document.source,node:i})}else{let o=this.resolveTypeWithDefault(i.key).setLine(i.start.line);n.setProperty(o,s)}}return this.createCustomTypeFromMap(e,n),n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(we.CompletionItemKind.ListConstructor).addType(Le.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(we.CompletionItemKind.Variable).addType(Le.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(Le.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(Le.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(Le.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(Le.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Ce.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Ce.ASTType.CallStatement:return this.resolveCallStatement(e);case Ce.ASTType.CallExpression:return this.resolveCallExpression(e);case Ce.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Ce.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Ce.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Ce.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Ce.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Ce.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Ce.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Ce.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Ce.ASTType.Identifier:return this.resolveIdentifier(e,n);case Ce.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Ce.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Ce.ASTType.NegationExpression:case Ce.ASTType.BinaryNegatedExpression:case Ce.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Ce.ASTType.NilLiteral:return this.factory(we.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Ce.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(we.CompletionItemKind.Literal).addType(Le.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Ce.ASTType.NumericLiteral:case Ce.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(we.CompletionItemKind.Literal).addType(Le.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case yd.ASTType.FeatureFileExpression:return this.factory(we.CompletionItemKind.Expression).addType(Le.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case yd.ASTType.FeatureLineExpression:return this.factory(we.CompletionItemKind.Expression).addType(Le.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case yd.ASTType.FeatureEnvarExpression:return this.factory(we.CompletionItemKind.Expression).addType(Le.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case yd.ASTType.FeatureInjectExpression:return this.factory(we.CompletionItemKind.Expression).addType(Le.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(Le.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,ps.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(Le.SignatureDefinitionBaseType.Any).setLabel(i.getter.name);else if((0,ps.isResolveChainItemWithValue)(i))r=this.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator===Ce.Keyword.New&&r!==null){let a=this.factory(we.CompletionItemKind.Variable).addType(Le.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,ps.isResolveChainItemWithMember)(u))r=r.resolveProperty(u.getter.name,c)??this.factory(we.CompletionItemKind.Variable).addType(Le.SignatureDefinitionBaseType.Any).setLabel(u.getter.name);else if((0,ps.isResolveChainItemWithIndex)(u))if((0,wE.isValidIdentifierLiteral)(u.getter)){let l=u.getter.value.toString();r=r.resolveProperty(l,u.isInCallExpression)??this.factory(we.CompletionItemKind.Variable).addType(Le.SignatureDefinitionBaseType.Any).setLabel(l)}else{let l=this.resolveTypeWithDefault(u.getter);r=r.resolveProperty(l,u.isInCallExpression)??this.factory(we.CompletionItemKind.Variable).addType(Le.SignatureDefinitionBaseType.Any)}else if(u.ref.type===Ce.ASTType.SliceExpression)r=r.copy();else return null;if(u.unary?.operator===Ce.Keyword.New&&r!==null){let l=this.factory(we.CompletionItemKind.Property).addType(Le.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(Le.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,xE.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,xE.createResolveChain)(e),i=r.pop();if(this._lastModifiedProperty=null,r.length>0){let o=this.resolveChain(r);if(o===null)return!1;if((0,ps.isResolveChainItemWithMember)(i))return this.defineProperty(o,i.getter.name,n);if((0,ps.isResolveChainItemWithIndex)(i)){if((0,wE.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,ps.isResolveChainItemWithIdentifier)(i)?this.defineProperty(s,i.getter.name,n):!1}addDefinition(e){this._lastModifiedProperty?.definitions.push({source:this._document.source,node:e});let n=(0,kE.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({source:this._document.source,node:e}):r.set(n,[{source:this._document.source,node: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,EE.merge)(n,a)}}return n}resolveAvailableAssignments(e){let n=(0,kE.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,EE.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({source:this._document.source}).setLine(n.start.line)??this.factory(we.CompletionItemKind.Variable).addType(Le.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,DL.mergeUnique)(i,r):this.definitions.set(n,r)}}};bd.Aggregator=tb});var ib=g(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.Document=void 0;var Xr=Gn(),LL=Oe(),AE=us(),NL=eb(),OE=nb(),CE=go(),RE=Iy(),rb=class t{get source(){return this._source}get root(){return this._root}get container(){return this._container}get intrinsics(){return this._intrinscis}get globals(){return this._globals}get api(){return this._api}constructor(e){this._source=e.source,this._root=e.root,this._container=e.container,this._scopeMapping=e.scopeMapping??new WeakMap,this._intrinscis=e.intrinsics??this.createIntrinscis(),this._api=e.api??this.initApi(),this._globals=e.globals??this.initGlobals()}createIntrinscis(){return{map:this._container.primitives.get(Xr.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(Xr.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(Xr.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(Xr.SignatureDefinitionBaseType.String),list:this._container.primitives.get(Xr.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(Xr.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 CE.Entity({source:this._source,kind:AE.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(Xr.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new RE.Scope({source:this._source,container:this._container,parent:n?.scope,globals:this._globals}),i=new OE.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof LL.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(Xr.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 CE.Entity({source:this._source,kind:AE.CompletionItemKind.Variable,container:this._container}).addTypes(d)):(l.types.delete(Xr.SignatureDefinitionBaseType.Any),l.addTypes(d))}}}}analyze(){let e=new RE.Scope({source:this._source,container:this._container,globals:this._globals,locals:this._globals}),n=new OE.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,NL.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({source:this._source,root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals),n._intrinscis.map.extend(i._intrinscis.map),n._intrinscis.funcRef.extend(i._intrinscis.funcRef),n._intrinscis.number.extend(i._intrinscis.number),n._intrinscis.string.extend(i._intrinscis.string),n._intrinscis.list.extend(i._intrinscis.list),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}};vd.Document=rb});var ub=g(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.ContainerProxy=void 0;var ur=Gn(),Yr=go(),sb=us(),PE=Ha(),ob=sd(),ab=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 Yr.Entity({source:"internal",kind:sb.CompletionItemKind.Constant,container:this,isAPI:n===ur.SignatureDefinitionBaseType.General}).addType(ur.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 Yr.Entity({source:"internal",kind:sb.CompletionItemKind.Constant,container:this}).addType(ur.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}))}}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(ur.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,ob.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,ob.lookupProperty)(this._primitives.get(ur.SignatureDefinitionBaseType.Any),n);if(e.includes(ur.SignatureDefinitionBaseType.Any)&&i)return(0,Yr.resolveEntity)(this,i,r);let s=this.searchDefinitionMatches(e,n);if(s.size===0)return null;if(s.size===1)return(0,Yr.resolveEntity)(this,s.values().next().value,r);if(s.has(ur.SignatureDefinitionBaseType.Any))return(0,Yr.resolveEntity)(this,s.get(ur.SignatureDefinitionBaseType.Any),r);if(i!==null)return(0,Yr.resolveEntity)(this,i,r);let o=new Yr.Entity({source:"internal",label:n,kind:sb.CompletionItemKind.Property,container:this});for(let a of s.values()){let u=(0,Yr.resolveEntity)(this,a,r);o.extend(u,!0)}return o}getGeneralDefinition(e,n=!1){let r=(0,ob.lookupProperty)(this._primitives.get(ur.SignatureDefinitionBaseType.General),e);return r==null?null:(0,Yr.resolveEntity)(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,PE.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(ur.SignatureDefinitionBaseType.Map);(0,PE.injectIdentifers)(e,i)}}getAllIdentifier(e){let n=new Map;if(e===ur.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})}};_d.ContainerProxy=ab});var DE=g(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.TypeManager=void 0;var qL=ib(),jL=ub(),cb=class{constructor(e){this._container=new jL.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new qL.Document({source:e,container:this._container.copy(),root:n});try{r.analyze()}catch(i){console.error(i)}return this._types.set(e,r),r}get(e){return this._types.get(e)??null}};Td.TypeManager=cb});var nu=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 FL=Sa();Object.defineProperty(se,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return FL.isValidIdentifierLiteral}});var $L=Nx();Object.defineProperty(se,"createExpressionHash",{enumerable:!0,get:function(){return $L.createExpressionHash}});var BL=fm();Object.defineProperty(se,"createExpressionId",{enumerable:!0,get:function(){return BL.createExpressionId}});var UL=yy();Object.defineProperty(se,"enrichWithMetaInformation",{enumerable:!0,get:function(){return UL.enrichWithMetaInformation}});var HL=by();Object.defineProperty(se,"createResolveChain",{enumerable:!0,get:function(){return HL.createResolveChain}});var lb=dm();Object.defineProperty(se,"getHashCode",{enumerable:!0,get:function(){return lb.getHashCode}});Object.defineProperty(se,"getStringHashCode",{enumerable:!0,get:function(){return lb.getStringHashCode}});Object.defineProperty(se,"rotateBits",{enumerable:!0,get:function(){return lb.rotateBits}});var IE=Sy();Object.defineProperty(se,"ObjectSet",{enumerable:!0,get:function(){return IE.ObjectSet}});Object.defineProperty(se,"ObjectSetIterator",{enumerable:!0,get:function(){return IE.ObjectSetIterator}});var WL=ky();Object.defineProperty(se,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return WL.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var GL=us();Object.defineProperty(se,"CompletionItemKind",{enumerable:!0,get:function(){return GL.CompletionItemKind}});var Sd=xy();Object.defineProperty(se,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Sd.isResolveChainItemWithIdentifier}});Object.defineProperty(se,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Sd.isResolveChainItemWithIndex}});Object.defineProperty(se,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Sd.isResolveChainItemWithMember}});Object.defineProperty(se,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Sd.isResolveChainItemWithValue}});var KL=wy();Object.defineProperty(se,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return KL.isSignatureDefinitionFunction}});var VL=Ha();Object.defineProperty(se,"injectIdentifers",{enumerable:!0,get:function(){return VL.injectIdentifers}});var zL=rd();Object.defineProperty(se,"isEligibleForProperties",{enumerable:!0,get:function(){return zL.isEligibleForProperties}});var XL=sd();Object.defineProperty(se,"lookupProperty",{enumerable:!0,get:function(){return XL.lookupProperty}});var YL=Ey();Object.defineProperty(se,"aggregateEntity",{enumerable:!0,get:function(){return YL.aggregateEntity}});var JL=go();Object.defineProperty(se,"Entity",{enumerable:!0,get:function(){return JL.Entity}});var QL=Iy();Object.defineProperty(se,"Scope",{enumerable:!0,get:function(){return QL.Scope}});var ZL=nb();Object.defineProperty(se,"Aggregator",{enumerable:!0,get:function(){return ZL.Aggregator}});var eN=ib();Object.defineProperty(se,"Document",{enumerable:!0,get:function(){return eN.Document}});var tN=ub();Object.defineProperty(se,"ContainerProxy",{enumerable:!0,get:function(){return tN.ContainerProxy}});var nN=DE();Object.defineProperty(se,"TypeManager",{enumerable:!0,get:function(){return nN.TypeManager}})});var db=g(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.getSymbolItemKind=bo.getCompletionItemKind=void 0;var Jt=nu(),rN=t=>{switch(t){case Jt.CompletionItemKind.Constant:return 21;case Jt.CompletionItemKind.Variable:return 6;case Jt.CompletionItemKind.Expression:return 6;case Jt.CompletionItemKind.Function:return 3;case Jt.CompletionItemKind.ListConstructor:case Jt.CompletionItemKind.MapConstructor:case Jt.CompletionItemKind.Literal:case Jt.CompletionItemKind.Unknown:return 12}};bo.getCompletionItemKind=rN;var iN=t=>{switch(t){case Jt.CompletionItemKind.Constant:return 14;case Jt.CompletionItemKind.Variable:return 13;case Jt.CompletionItemKind.Expression:return 13;case Jt.CompletionItemKind.Function:return 12;case Jt.CompletionItemKind.ListConstructor:return 18;case Jt.CompletionItemKind.MapConstructor:return 19;case Jt.CompletionItemKind.Literal:case Jt.CompletionItemKind.Unknown:return 13}};bo.getSymbolItemKind=iN});var ME=g(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.CompletionListBuilder=void 0;var sN=db(),fb=class{constructor(){this.collection=new Map,this.default=[]}setDefault(e){this.default=e}addCollection(e){e!=null&&(this.collection=new Map([...this.collection,...e]))}build(){let e=[];for(let[n,r]of this.collection)e.push({label:n,kind:(0,sN.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};kd.CompletionListBuilder=fb});var wd=g(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.findEx=vo.ScraperWalker=void 0;var oN=Oe(),aN=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:()=>{}}},xd=class{constructor(e,n={}){this.map=Object.assign(aN(this.visit.bind(this)),n),this.callback=e,this.state={exit:!1,skip:!1}}visit(e,n=0){if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");let r=this.callback(e,n);if(r!=null&&Object.assign(this.state,r),this.state.exit||this.state.skip){this.state.skip=!1;return}let i=this.map[e.type];i?.call(this,e,n+1)}};vo.ScraperWalker=xd;function uN(t,e){let n=[];return new xd((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==oN.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}vo.findEx=uN});var pb=g(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.lookupBase=un.lookupIdentifier=un.lookupScopes=un.lookupRootScope=void 0;var Jr=Oe(),cN=t=>{let e=t;for(;e.scope;)e=e.scope;return e};un.lookupRootScope=cN;var lN=t=>{if(!t.scope)return[t];let e=(0,un.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};un.lookupScopes=lN;var dN=t=>{switch(t.type){case Jr.ASTType.CallStatement:return(0,un.lookupIdentifier)(t.expression);case Jr.ASTType.CallExpression:return(0,un.lookupIdentifier)(t.base);case Jr.ASTType.Identifier:return t;case Jr.ASTType.MemberExpression:return(0,un.lookupIdentifier)(t.identifier);case Jr.ASTType.IndexExpression:return(0,un.lookupIdentifier)(t.index);default:return null}};un.lookupIdentifier=dN;var fN=(t=null)=>{switch(t?.type){case Jr.ASTType.MemberExpression:return t.base;case Jr.ASTType.IndexExpression:return t.base;case Jr.ASTType.CallExpression:return t.base;case Jr.ASTType.SliceExpression:return t.base;default:return null}};un.lookupBase=fN});var To=g(Rr=>{"use strict";var pN=Rr&&Rr.__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=Rr&&Rr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gN=Rr&&Rr.__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)&&pN(e,t,n);return hN(e,t),e};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.LookupHelper=void 0;var mN=Gn(),LE=Oe(),_o=nu(),yN=gN(wd()),bN=pb(),hb=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null}async getTypeMap(){return this.mergedTypeMap==null&&(this.mergedTypeMap=await this.context.documentMerger.build(this.document,this.context)),this.mergedTypeMap}async findAllAssignmentsOfIdentifier(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignmentsWithQuery(e)}async findAllAssignmentsOfItem(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignments(e)}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.getRootScopeContext().scope.getAllIdentifier()}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAllIdentifier()}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;for(let a of n.container.getAllIdentifier(mN.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:_o.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:_o.CompletionItemKind.Constant,line:-1});let s=new Map;(0,_o.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,_o.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,_o.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=yN.findEx((c,l)=>{let d=c.start.line-1,p=c.start.character-1,b=c.end.line-1,_=c.end.character-1;return d>e.line?{exit:!0}:d<b?{valid:e.line>d&&e.line<b||e.line===d&&p<=e.character||e.line===b&&_>=e.character}:{valid:d<=e.line&&p<=e.character&&b>=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,bN.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===LE.ASTType.MemberExpression&&e===i.identifier||i?.type===LE.ASTType.IndexExpression&&e===i.index&&(0,_o.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}};Rr.LookupHelper=hb});var NE=g(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.AVAILABLE_CONSTANTS=void 0;Ed.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var qE=g(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.AVAILABLE_KEYWORDS=void 0;var So=Cr(),Qt=Oe();Ad.AVAILABLE_KEYWORDS=[Qt.Keyword.If,Qt.Keyword.In,Qt.Keyword.Or,Qt.Keyword.And,Qt.Keyword.Isa,Qt.Keyword.For,Qt.Keyword.New,Qt.Keyword.Not,Qt.Keyword.End,Qt.Keyword.Then,Qt.Keyword.Else,Qt.Keyword.Break,Qt.Keyword.While,Qt.Keyword.Return,Qt.Keyword.Function,Qt.Keyword.Continue,So.GreybelKeyword.Envar,So.GreybelKeyword.Import,So.GreybelKeyword.Include,So.GreybelKeyword.Debugger,So.GreybelKeyword.Line,So.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var jE=g(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.AVAILABLE_OPERATORS=void 0;var ru=yo(),qt=Oe();Od.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,ru.Operator.BitwiseAnd,ru.Operator.BitwiseOr,ru.Operator.LeftShift,ru.Operator.RightShift,ru.Operator.UnsignedRightShift,qt.Operator.Assign,qt.Operator.Reference].map(t=>({label:t,kind:24}))});var $E=g(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.activate=Vn.getDefaultCompletionList=Vn.getPropertyCompletionList=void 0;var FE=Oe(),vN=ME(),_N=To(),TN=NE(),SN=qE(),kN=jE(),xN=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.getAllIdentifier()};Vn.getPropertyCompletionList=xN;var wN=()=>[...SN.AVAILABLE_KEYWORDS,...kN.AVAILABLE_OPERATORS,...TN.AVAILABLE_CONSTANTS];Vn.getDefaultCompletionList=wN;function EN(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 _N.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=new vN.CompletionListBuilder,a=!1;if(s){let{closest:u}=s;u instanceof FE.ASTMemberExpression?(o.addCollection(await(0,Vn.getPropertyCompletionList)(i,u)),a=!0):u instanceof FE.ASTIndexExpression?(o.addCollection(await(0,Vn.getPropertyCompletionList)(i,u)),a=!0):(o.setDefault((0,Vn.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,Vn.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}Vn.activate=EN});var UE=g((RH,BE)=>{"use strict";BE.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 gb=g((PH,WE)=>{var iu=UE(),HE={};for(let t of Object.keys(iu))HE[iu[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"]}};WE.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 AN(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=HE[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(iu)){let s=iu[i],o=AN(t,s);o<n&&(n=o,r=i)}return r};re.keyword.rgb=function(t){return iu[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 KE=g((DH,GE)=>{var Cd=gb();function ON(){let t={},e=Object.keys(Cd);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function CN(t){let e=ON(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Cd[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 RN(t,e){return function(n){return e(t(n))}}function PN(t,e){let n=[e[t].parent,t],r=Cd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=RN(Cd[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}GE.exports=function(t){let e=CN(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]=PN(o,e))}return n}});var zE=g((IH,VE)=>{var mb=gb(),DN=KE(),ko={},IN=Object.keys(mb);function MN(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 LN(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}IN.forEach(t=>{ko[t]={},Object.defineProperty(ko[t],"channels",{value:mb[t].channels}),Object.defineProperty(ko[t],"labels",{value:mb[t].labels});let e=DN(t);Object.keys(e).forEach(r=>{let i=e[r];ko[t][r]=LN(i),ko[t][r].raw=MN(i)})});VE.exports=ko});var YE=g(xo=>{"use strict";var NN=xo&&xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xo,"__esModule",{value:!0});xo.activate=void 0;var yb=NN(zE()),qN=Oe(),XE;(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"})(XE||(XE={}));var bb={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},jN=()=>new RegExp(`(?:mark|color)=(${Object.keys(bb).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),FN=Object.prototype.hasOwnProperty;function $N(t){t.connection.onColorPresentation(e=>[{label:`#${yb.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===qN.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:d,lineIndex:p})=>{let b=u.index+c.indexOf("=")+1,_=b+l.length,E=d.line-1+p,L=b,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(`
114
- `);for(let p=0;p<d.length;p++){let b=d[p],_=jN(),E;for(;E=_.exec(b);){let[L,M]=E,x=a({match:E,markup:L,value:M,astPosition:l,lineIndex:p});if(M.startsWith("#")){let[k,v,F]=yb.default.hex.rgb(M.slice(1));o.push({range:x,color:{red:k/255,green:v/255,blue:F/255,alpha:1}})}else if(FN.call(bb,M)){let[k,v,F]=yb.default.hex.rgb(bb[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})}xo.activate=$N});var JE=g(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.activate=void 0;var BN=Oe(),UN=To(),HN=t=>`${t.targetUri}:${t.targetRange.start.line}:${t.targetRange.start.character}-${t.targetRange.end.line}:${t.targetRange.end.character}`,WN=async(t,e,n)=>{let r=await t.findAllAssignmentsOfItem(e,n),i=[],s=new Set;for(let o of r){let a=o.node;if(!a.start||!a.end)continue;let u={line:a.start.line-1,character:a.start.character-1},c={line:a.end.line-1,character:a.end.character-1},l={targetUri:o.source,targetRange:{start:u,end:c},targetSelectionRange:{start:u,end:c}},d=HN(l);s.has(d)||(s.add(d),i.push(l))}return i};function GN(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new UN.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 BN.ASTMemberExpression&&a.identifier===o&&(u=a),await WN(r,u,u.scope)})}Rd.activate=GN});var QE=g(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.activate=void 0;async function KN(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 VN(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 KN(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}Pd.activate=VN});var ZE=g(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.getStringHashCode=void 0;Dd.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 vb=g(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.createExpressionHash=void 0;var Id=Oe(),eA=ZE(),Md=(t,e)=>t.$$hash=e,zN=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function wo(t){let e=zN(t);if(e!==null)return e;let n=(0,eA.getStringHashCode)(t.type);switch(t.type){case Id.ASTType.ParenthesisExpression:return wo(t.expression);case Id.ASTType.MemberExpression:{let r=t;return n^=wo(r.base),n^=wo(r.identifier),Md(t,n)}case Id.ASTType.IndexExpression:{let r=t;return n^=wo(r.base),n^=wo(r.index),Md(t,n)}case Id.ASTType.Identifier:{let r=t;return n^=(0,eA.getStringHashCode)(r.name),Md(t,n)}}return Md(t,n)}function XN(t){return wo(t)}Ld.createExpressionHash=XN});var Oo=g(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.getLiteralValue=Ao.getLiteralRawValue=void 0;var Eo=Oe(),YN=t=>{switch(t.type){case Eo.ASTType.NilLiteral:return"null";case Eo.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}case Eo.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}default:return t.raw.toString()}};Ao.getLiteralRawValue=YN;var JN=t=>{switch(t.type){case Eo.ASTType.NilLiteral:return"null";case Eo.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}case Eo.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}default:return t.value.toString()}};Ao.getLiteralValue=JN});var Tb=g(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.Stack=void 0;var _b=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}};Nd.Stack=_b});var Co=g(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.Factory=hs.TokenType=void 0;var QN=Tb(),ZN;(function(t){t[t.Text=0]="Text",t[t.EndOfLine=1]="EndOfLine",t[t.Comment=2]="Comment"})(ZN=hs.TokenType||(hs.TokenType={}));var Sb=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 QN.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()}};hs.Factory=Sb});var xb=g(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.BeautifyContext=gs.IndentationType=void 0;var su=Oe(),qd=Co(),tA;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(tA=gs.IndentationType||(gs.IndentationType={}));var kb=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===tA.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 su.ASTIfClause||e instanceof su.ASTWhileStatement?e.condition.end.line:e instanceof su.ASTForGenericStatement?e.iterator.end.line:e instanceof su.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===su.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===qd.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:qd.TokenType.EndOfLine,value:`
115
- `,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:qd.TokenType.EndOfLine,value:`
116
- `,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:qd.TokenType.EndOfLine,value:`
117
- `,ref:{start:o,end:o}})}}};gs.BeautifyContext=kb});var wb=g(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.hasEmptyBody=Ht.containsMultilineItemInShortcutClauses=Ht.getLastComment=Ht.unwrap=Ht.countRightBinaryExpressions=Ht.SHORTHAND_OPERATORS=void 0;var yn=Oe();Ht.SHORTHAND_OPERATORS=[yn.Operator.Plus,yn.Operator.Minus,yn.Operator.Asterik,yn.Operator.Slash,yn.Operator.Modulo,yn.Operator.Power];var eq=t=>{if(t=(0,Ht.unwrap)(t),t instanceof yn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof yn.ASTBinaryExpression&&n++,(r instanceof yn.ASTBinaryExpression||r instanceof yn.ASTLogicalExpression||r instanceof yn.ASTIsaExpression)&&(e.push((0,Ht.unwrap)(r.left)),e.push((0,Ht.unwrap)(r.right)))}return n};Ht.countRightBinaryExpressions=eq;var tq=t=>{for(;t instanceof yn.ASTParenthesisExpression;)t=t.expression;return t};Ht.unwrap=tq;var nq=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===yn.ASTType.Comment)return n}return null};Ht.getLastComment=nq;var rq=(t,e)=>e.some(n=>t.line<n.body[0].end.line);Ht.containsMultilineItemInShortcutClauses=rq;var iq=t=>!t.some(e=>!(e instanceof yn.ASTComment));Ht.hasEmptyBody=iq});var Ab=g(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.BeautifyFactory=void 0;var ou=Oe(),sq=require("path"),nA=vb(),jd=Oo(),rA=xb(),Qr=wb(),N=Co(),Eb=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(`
113
+ `)}else if(s instanceof Re.ASTComment)return s.value;return n}resolveFunctionStatement(e){let n=ze.SignatureDefinitionFunction.parse({type:ze.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Re.ASTType.Identifier)return{label:r.name??"unknown",type:ze.SignatureDefinitionBaseType.Any};let s=r;return{label:s.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(s.init).types)}}),returns:["any"]});return this.factory(Ie.CompletionItemKind.Function).addType(ze.SignatureDefinitionBaseType.Function).addSignatureType((0,eF.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(Ie.CompletionItemKind.Expression).setLabel("Binary Expr").setLine(e.start.line),r=this.resolveTypeWithDefault(e.left),s=this.resolveTypeWithDefault(e.right);return n.extend(r),n.extend(s),n}resolveLogicalExpression(e){return this.factory(Ie.CompletionItemKind.Expression).setLabel("Logical Expr").addType(ze.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(Ie.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(ze.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(Ie.CompletionItemKind.Expression).setLabel("Isa Expr").addType(ze.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(Ie.CompletionItemKind.Variable).addType(ze.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Ie.CompletionItemKind.Variable).addType(ze.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Ie.CompletionItemKind.Variable).addType(ze.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(Ie.CompletionItemKind.MapConstructor).addType(ze.SignatureDefinitionBaseType.Map);for(let r=0;r<e.fields.length;r++){let s=e.fields[r],i=this.resolveTypeWithDefault(s.value).setLine(s.start.line);if(s.key.type===Re.ASTType.StringLiteral){let o=s.key.value.toString();n.setProperty(o,i),n.values.get(`i:${o}`)?.definitions.push({source:this._document.source,node:s})}else{let o=this.resolveTypeWithDefault(s.key).setLine(s.start.line);n.setProperty(o,i)}}return this.createCustomTypeFromMap(e,n),n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(Ie.CompletionItemKind.ListConstructor).addType(ze.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let s=e.fields[r],i=this.factory(Ie.CompletionItemKind.Variable).addType(ze.SignatureDefinitionBaseType.Number).setLine(s.start.line),o=this.resolveTypeWithDefault(s.value).setLine(s.start.line);n.setProperty(i,o)}return n.setLabel("[]").setLine(e.start.line)}resolveSliceExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Ie.CompletionItemKind.Variable).addType(ze.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(Ie.CompletionItemKind.Variable).addType(ze.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Ie.CompletionItemKind.Property).addType(ze.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(Ie.CompletionItemKind.Property).addType(ze.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Re.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Re.ASTType.CallStatement:return this.resolveCallStatement(e);case Re.ASTType.CallExpression:return this.resolveCallExpression(e);case Re.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Re.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Re.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Re.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Re.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Re.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Re.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Re.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Re.ASTType.Identifier:return this.resolveIdentifier(e,n);case Re.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Re.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Re.ASTType.NegationExpression:case Re.ASTType.BinaryNegatedExpression:case Re.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Re.ASTType.NilLiteral:return this.factory(Ie.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Re.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(Ie.CompletionItemKind.Literal).addType(ze.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Re.ASTType.NumericLiteral:case Re.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(Ie.CompletionItemKind.Literal).addType(ze.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case Tf.ASTType.FeatureFileExpression:return this.factory(Ie.CompletionItemKind.Expression).addType(ze.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case Tf.ASTType.FeatureLineExpression:return this.factory(Ie.CompletionItemKind.Expression).addType(ze.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case Tf.ASTType.FeatureEnvarExpression:return this.factory(Ie.CompletionItemKind.Expression).addType(ze.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case Tf.ASTType.FeatureInjectExpression:return this.factory(Ie.CompletionItemKind.Expression).addType(ze.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 s=this.factory(Ie.CompletionItemKind.Variable).addType(ze.SignatureDefinitionBaseType.Any);return e!=null&&s.setLine(e.start.line),s}return r}resolveChain(e,n=!1,r=!1){if(e.length===0)return null;let s=new Sf(this,e,n,r),i=null,o=s.next();for(;!o.done;)i=o.value,o=s.next();return i}setEntityInPath(e,n,r){let s=e;for(let i=0;i<n.length-1;i++){let o=n[i],a=s.resolveProperty(o);if(a==null){let u=this.factory(Ie.CompletionItemKind.Property).addType(ze.SignatureDefinitionBaseType.Map).setLabel(o);s.setProperty(o,u),a=u}s=a}return s.setProperty(n[n.length-1],r)}getEntityInPath(e,n){let r=e;for(let s=0;s<n.length;s++){let i=n[s],o=r.resolveProperty(i);if(o==null)return null;r=o}return r}resolveNamespace(e,n=!1){let r=(0,$1.createResolveChain)(e);return this.resolveChain(r,n)}defineProperty(e,n,r){let s=e.setProperty(n,r);return this._lastModifiedProperty=e.resolveProperty(n,!0),s}defineNamespace(e,n){let r=(0,$1.createResolveChain)(e),s=r.pop();if(this._lastModifiedProperty=null,r.length>0){let o=this.resolveChain(r,!1,!0);if(o===null)return!1;if((0,$i.isResolveChainItemWithMember)(s))return this.defineProperty(o,s.getter.name,n);if((0,$i.isResolveChainItemWithIndex)(s)){if((0,U1.isValidIdentifierLiteral)(s.getter))return this.defineProperty(o,s.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(s.getter);return this.defineProperty(o,a,n)}}return!1}let i=this._scope;return(0,$i.isResolveChainItemWithIdentifier)(s)?this.defineProperty(i,s.getter.name,n):!1}addDefinition(e){this._lastModifiedProperty?.definitions.push({source:this._document.source,node:e});let n=(0,F1.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 s=r.get(n);s?s.push({source:this._document.source,node:e}):r.set(n,[{source:this._document.source,node:e}])}resolveAvailableAssignmentsWithQuery(e){let n=[],r=new Set([this,this._parent,this._document.getRootScopeContext().aggregator]);for(let s of r){let i=s.definitions;for(let o of i.keys())if(o.includes(e)){let a=i.get(o);(0,B1.merge)(n,a)}}return n}resolveAvailableAssignments(e){let n=(0,F1.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 s=[],i=new Set([r,r._parent,r._document.getRootScopeContext().aggregator]);for(let o of i){if(o==null)continue;let a=o.resolveNamespace(e,!0);a!=null&&(0,B1.merge)(s,a.definitions)}return s}analyze(){for(let e=0;e<this._root.assignments.length;e++){let n=this._root.assignments[e],r=this.resolveType(n.init)?.copy({source:this._document.source}).setLine(n.start.line)??this.factory(Ie.CompletionItemKind.Variable).addType(ze.SignatureDefinitionBaseType.Any).setLine(n.start.line);this.defineNamespace(n.variable,r),this.addDefinition(n)}}extend(e){for(let[n,r]of e.definitions){let s=this.definitions.get(n);s?(0,tF.mergeUnique)(s,r):this.definitions.set(n,r)}}};Vo.Aggregator=$v});var Wv=m(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.Document=void 0;var ms=sr(),sF=Ce(),W1=Li(),iF=Fv(),H1=Bv(),G1=Go(),z1=bv(),Uv=class t{get source(){return this._source}get root(){return this._root}get container(){return this._container}get intrinsics(){return this._intrinscis}get globals(){return this._globals}get api(){return this._api}constructor(e){this._source=e.source,this._root=e.root,this._container=e.container,this._scopeMapping=e.scopeMapping??new WeakMap,this._intrinscis=e.intrinsics??this.createIntrinscis(),this._api=e.api??this.initApi(),this._globals=e.globals??this.initGlobals()}createIntrinscis(){return{map:this._container.primitives.get(ms.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(ms.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(ms.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(ms.SignatureDefinitionBaseType.String),list:this._container.primitives.get(ms.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(ms.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 G1.Entity({source:this._source,kind:W1.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(ms.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new z1.Scope({source:this._source,container:this._container,parent:n?.scope,globals:this._globals}),s=new H1.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:s});let i=e.assignment instanceof sF.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(i!==null){let o=i?.context;o!=null&&o.types.has(ms.SignatureDefinitionBaseType.Map)&&o!==this._globals&&r.setContext(o)}if(s.analyze(),i!==null){let o=i.signatureDefinitions.last();if(o!=null){let a=o.getArguments();for(let u=0;u<a.length;u++){let l=a[u],c=r.resolveProperty(l.getLabel(),!0),h=l.getTypes().map(f=>f.type);c===null?r.setProperty(l.getLabel(),new G1.Entity({source:this._source,kind:W1.CompletionItemKind.Variable,container:this._container}).addTypes(h)):(c.types.delete(ms.SignatureDefinitionBaseType.Any),c.addTypes(h))}}}}analyze(){let e=new z1.Scope({source:this._source,container:this._container,globals:this._globals,locals:this._globals}),n=new H1.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 s=this._root.scopes[r];this.analyzeScope(s)}}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 s=r.find(i=>i.type===n);if(s)return s}return null}resolveAllAssignmentsWithQuery(e){let n=[],r=[this._root,...this._root.scopes];for(let s=0;s<r.length;s++){let o=this._scopeMapping.get(r[s]).aggregator.definitions;for(let a of o.keys())if(a.includes(e)){let u=o.get(a);(0,iF.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({source:this._source,root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let s=e[r];n._globals.extend(s._globals,!0,!0),n._intrinscis.map.extend(s._intrinscis.map,!0,!0),n._intrinscis.funcRef.extend(s._intrinscis.funcRef,!0,!0),n._intrinscis.number.extend(s._intrinscis.number,!0,!0),n._intrinscis.string.extend(s._intrinscis.string,!0,!0),n._intrinscis.list.extend(s._intrinscis.list,!0,!0),n._container.mergeCustomTypes(s._container)}n.analyze();for(let r=0;r<e.length;r++){let s=e[r];n.getRootScopeContext().aggregator.extend(s.getRootScopeContext().aggregator)}return n}};kf.Document=Uv});var Kv=m(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.ContainerProxy=void 0;var xr=sr(),ys=Go(),Hv=Li(),K1=wu(),Gv=lf(),zv=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 s=new ys.Entity({source:"internal",kind:Hv.CompletionItemKind.Constant,container:this,isAPI:n===xr.SignatureDefinitionBaseType.General}).addType(xr.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,s)}return e}createTypes(){let e=new Map;for(let[n,r]of this._container.getTypes()){let s=new ys.Entity({source:"internal",kind:Hv.CompletionItemKind.Constant,container:this}).addType(xr.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,s)}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}))}}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(xr.SignatureDefinitionBaseType.Any)?new Set(this._container.getAllVisibleTypes()):new Set(e),s=new Map;for(let i of r){let o=this.getTypeSignature(i);if(o===null)continue;let a=(0,Gv.lookupProperty)(o,n);a!==null&&s.set(i,a)}return s}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let s=(0,Gv.lookupProperty)(this._primitives.get(xr.SignatureDefinitionBaseType.Any),n);if(e.includes(xr.SignatureDefinitionBaseType.Any)&&s)return(0,ys.resolveEntity)(this,s,r);let i=this.searchDefinitionMatches(e,n);if(i.size===0)return null;if(i.size===1)return(0,ys.resolveEntity)(this,i.values().next().value,r);if(i.has(xr.SignatureDefinitionBaseType.Any))return(0,ys.resolveEntity)(this,i.get(xr.SignatureDefinitionBaseType.Any),r);if(s!==null)return(0,ys.resolveEntity)(this,s,r);let o=new ys.Entity({source:"internal",label:n,kind:Hv.CompletionItemKind.Property,container:this});for(let a of i.values()){let u=(0,ys.resolveEntity)(this,a,r);o.extend(u,!0,!0)}return o}getGeneralDefinition(e,n=!1){let r=(0,Gv.lookupProperty)(this._primitives.get(xr.SignatureDefinitionBaseType.General),e);return r==null?null:(0,ys.resolveEntity)(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,K1.injectIdentifers)(e,r),this._types.has(n))){let s=this._primitives.get(xr.SignatureDefinitionBaseType.Map);(0,K1.injectIdentifers)(e,s)}}getAllIdentifier(e){let n=new Map;if(e===xr.SignatureDefinitionBaseType.Any){let r=this._container.getAllVisibleTypes();for(let s=0;s<r.length;s++)this.injectTypeIdentifiers(n,r[s]);return n}return this.injectTypeIdentifiers(n,e),n}copy(){return new t({container:this._container})}};wf.ContainerProxy=zv});var V1=m(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.TypeManager=void 0;var oF=Wv(),aF=Kv(),Vv=class{constructor(e){this._container=new aF.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new oF.Document({source:e,container:this._container.copy(),root:n});try{r.analyze()}catch(s){console.error(s)}return this._types.set(e,r),r}get(e){return this._types.get(e)??null}};xf.TypeManager=Vv});var qu=m(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.TypeManager=ae.ContainerProxy=ae.Document=ae.Aggregator=ae.Scope=ae.Entity=ae.aggregateEntity=ae.lookupProperty=ae.isEligibleForProperties=ae.injectIdentifers=ae.isSignatureDefinitionFunction=ae.isResolveChainItemWithValue=ae.isResolveChainItemWithMember=ae.isResolveChainItemWithIndex=ae.isResolveChainItemWithIdentifier=ae.CompletionItemKind=ae.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=ae.ObjectSetIterator=ae.ObjectSet=ae.rotateBits=ae.getStringHashCode=ae.getHashCode=ae.createResolveChain=ae.enrichWithMetaInformation=ae.createExpressionId=ae.createExpressionHash=ae.isValidIdentifierLiteral=void 0;var uF=ru();Object.defineProperty(ae,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return uF.isValidIdentifierLiteral}});var lF=Qx();Object.defineProperty(ae,"createExpressionHash",{enumerable:!0,get:function(){return lF.createExpressionHash}});var cF=Jy();Object.defineProperty(ae,"createExpressionId",{enumerable:!0,get:function(){return cF.createExpressionId}});var hF=nv();Object.defineProperty(ae,"enrichWithMetaInformation",{enumerable:!0,get:function(){return hF.enrichWithMetaInformation}});var fF=rv();Object.defineProperty(ae,"createResolveChain",{enumerable:!0,get:function(){return fF.createResolveChain}});var Xv=Yy();Object.defineProperty(ae,"getHashCode",{enumerable:!0,get:function(){return Xv.getHashCode}});Object.defineProperty(ae,"getStringHashCode",{enumerable:!0,get:function(){return Xv.getStringHashCode}});Object.defineProperty(ae,"rotateBits",{enumerable:!0,get:function(){return Xv.rotateBits}});var X1=av();Object.defineProperty(ae,"ObjectSet",{enumerable:!0,get:function(){return X1.ObjectSet}});Object.defineProperty(ae,"ObjectSetIterator",{enumerable:!0,get:function(){return X1.ObjectSetIterator}});var dF=uv();Object.defineProperty(ae,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return dF.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var pF=Li();Object.defineProperty(ae,"CompletionItemKind",{enumerable:!0,get:function(){return pF.CompletionItemKind}});var Ef=lv();Object.defineProperty(ae,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Ef.isResolveChainItemWithIdentifier}});Object.defineProperty(ae,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Ef.isResolveChainItemWithIndex}});Object.defineProperty(ae,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Ef.isResolveChainItemWithMember}});Object.defineProperty(ae,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Ef.isResolveChainItemWithValue}});var gF=cv();Object.defineProperty(ae,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return gF.isSignatureDefinitionFunction}});var mF=wu();Object.defineProperty(ae,"injectIdentifers",{enumerable:!0,get:function(){return mF.injectIdentifers}});var yF=af();Object.defineProperty(ae,"isEligibleForProperties",{enumerable:!0,get:function(){return yF.isEligibleForProperties}});var bF=lf();Object.defineProperty(ae,"lookupProperty",{enumerable:!0,get:function(){return bF.lookupProperty}});var vF=hv();Object.defineProperty(ae,"aggregateEntity",{enumerable:!0,get:function(){return vF.aggregateEntity}});var _F=Go();Object.defineProperty(ae,"Entity",{enumerable:!0,get:function(){return _F.Entity}});var TF=bv();Object.defineProperty(ae,"Scope",{enumerable:!0,get:function(){return TF.Scope}});var SF=Bv();Object.defineProperty(ae,"Aggregator",{enumerable:!0,get:function(){return SF.Aggregator}});var kF=Wv();Object.defineProperty(ae,"Document",{enumerable:!0,get:function(){return kF.Document}});var wF=Kv();Object.defineProperty(ae,"ContainerProxy",{enumerable:!0,get:function(){return wF.ContainerProxy}});var xF=V1();Object.defineProperty(ae,"TypeManager",{enumerable:!0,get:function(){return xF.TypeManager}})});var Yv=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.getSymbolItemKind=Xo.getCompletionItemKind=void 0;var an=qu(),EF=t=>{switch(t){case an.CompletionItemKind.Constant:return 21;case an.CompletionItemKind.Variable:return 6;case an.CompletionItemKind.Expression:return 6;case an.CompletionItemKind.Function:return 3;case an.CompletionItemKind.ListConstructor:case an.CompletionItemKind.MapConstructor:case an.CompletionItemKind.Literal:case an.CompletionItemKind.Unknown:return 12}};Xo.getCompletionItemKind=EF;var AF=t=>{switch(t){case an.CompletionItemKind.Constant:return 14;case an.CompletionItemKind.Variable:return 13;case an.CompletionItemKind.Expression:return 13;case an.CompletionItemKind.Function:return 12;case an.CompletionItemKind.ListConstructor:return 18;case an.CompletionItemKind.MapConstructor:return 19;case an.CompletionItemKind.Literal:case an.CompletionItemKind.Unknown:return 13}};Xo.getSymbolItemKind=AF});var Y1=m(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.CompletionListBuilder=void 0;var OF=Yv(),Jv=class{constructor(){this.collection=new Map,this.default=[]}setDefault(e){this.default=e}addCollection(e){e!=null&&(this.collection=new Map([...this.collection,...e]))}build(){let e=[];for(let[n,r]of this.collection)e.push({label:n,kind:(0,OF.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};Af.CompletionListBuilder=Jv});var Cf=m(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.findEx=Yo.ScraperWalker=void 0;var CF=Ce(),RF=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:()=>{}}},Of=class{constructor(e,n={}){this.map=Object.assign(RF(this.visit.bind(this)),n),this.callback=e,this.state={exit:!1,skip:!1}}visit(e,n=0){if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");let r=this.callback(e,n);if(r!=null&&Object.assign(this.state,r),this.state.exit||this.state.skip){this.state.skip=!1;return}let s=this.map[e.type];s?.call(this,e,n+1)}};Yo.ScraperWalker=Of;function PF(t,e){let n=[];return new Of((s,i)=>{let o=t(s,i)||{};return o.valid&&s.type!==CF.ASTType.InvalidCodeExpression&&n.push(s),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}Yo.findEx=PF});var Qv=m(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.lookupBase=yn.lookupIdentifier=yn.lookupScopes=yn.lookupRootScope=void 0;var bs=Ce(),DF=t=>{let e=t;for(;e.scope;)e=e.scope;return e};yn.lookupRootScope=DF;var IF=t=>{if(!t.scope)return[t];let e=(0,yn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};yn.lookupScopes=IF;var MF=t=>{switch(t.type){case bs.ASTType.CallStatement:return(0,yn.lookupIdentifier)(t.expression);case bs.ASTType.CallExpression:return(0,yn.lookupIdentifier)(t.base);case bs.ASTType.Identifier:return t;case bs.ASTType.MemberExpression:return(0,yn.lookupIdentifier)(t.identifier);case bs.ASTType.IndexExpression:return(0,yn.lookupIdentifier)(t.index);default:return null}};yn.lookupIdentifier=MF;var LF=(t=null)=>{switch(t?.type){case bs.ASTType.MemberExpression:return t.base;case bs.ASTType.IndexExpression:return t.base;case bs.ASTType.CallExpression:return t.base;case bs.ASTType.SliceExpression:return t.base;default:return null}};yn.lookupBase=LF});var Qo=m(Xr=>{"use strict";var NF=Xr&&Xr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),qF=Xr&&Xr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jF=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)&&NF(e,t,n);return qF(e,t),e};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.LookupHelper=void 0;var FF=sr(),J1=Ce(),Jo=qu(),$F=jF(Cf()),BF=Qv(),Zv=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null}async getTypeMap(){return this.mergedTypeMap==null&&(this.mergedTypeMap=await this.context.documentMerger.build(this.document,this.context)),this.mergedTypeMap}async findAllAssignmentsOfIdentifier(e,n){let r=await this.getTypeMap();if(r==null)return[];let s=r.getScopeContext(n);return s==null?[]:s.aggregator.resolveAvailableAssignmentsWithQuery(e)}async findAllAssignmentsOfItem(e,n){let r=await this.getTypeMap();if(r==null)return[];let s=r.getScopeContext(n);return s==null?[]:s.aggregator.resolveAvailableAssignments(e)}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.getRootScopeContext().scope.getAllIdentifier()}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAllIdentifier()}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;for(let a of n.container.getAllIdentifier(FF.SignatureDefinitionBaseType.General))r.set(...a);let s=n.getScopeContext(e.scope);if(s==null)return r;s.scope.isSelfAvailable()&&r.set("self",{kind:Jo.CompletionItemKind.Constant,line:-1}),s.scope.isSuperAvailable()&&r.set("super",{kind:Jo.CompletionItemKind.Constant,line:-1});let i=new Map;(0,Jo.injectIdentifers)(i,s.scope);let o=Array.from(i.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 s.scope.locals!==s.scope.globals&&(0,Jo.injectIdentifers)(r,s.scope.globals),s.scope.outer&&(0,Jo.injectIdentifers)(r,s.scope.outer),r}lookupAST(e){let n=this,s=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!s)return null;for(let i=0;i<s.length;i++){let o=s[i],a=$F.findEx((l,c)=>{let h=l.start.line-1,f=l.start.character-1,g=l.end.line-1,v=l.end.character-1;return h>e.line?{exit:!0}:h<g?{valid:e.line>h&&e.line<g||e.line===h&&f<=e.character||e.line===g&&v>=e.character}:{valid:h<=e.line&&f<=e.character&&g>=e.line&&v>=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,BF.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 s=n.length>0?n[n.length-1]:void 0;return s?.type===J1.ASTType.MemberExpression&&e===s.identifier||s?.type===J1.ASTType.IndexExpression&&e===s.index&&(0,Jo.isValidIdentifierLiteral)(e)?r.resolveType(s,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Xr.LookupHelper=Zv});var Q1=m(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.AVAILABLE_CONSTANTS=void 0;Rf.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var Z1=m(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.AVAILABLE_KEYWORDS=void 0;var Zo=Vr(),un=Ce();Pf.AVAILABLE_KEYWORDS=[un.Keyword.If,un.Keyword.In,un.Keyword.Or,un.Keyword.And,un.Keyword.Isa,un.Keyword.For,un.Keyword.New,un.Keyword.Not,un.Keyword.End,un.Keyword.Then,un.Keyword.Else,un.Keyword.Break,un.Keyword.While,un.Keyword.Return,un.Keyword.Function,un.Keyword.Continue,Zo.GreybelKeyword.Envar,Zo.GreybelKeyword.Import,Zo.GreybelKeyword.Include,Zo.GreybelKeyword.Debugger,Zo.GreybelKeyword.Line,Zo.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var eO=m(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.AVAILABLE_OPERATORS=void 0;var ju=Ko(),Ut=Ce();Df.AVAILABLE_OPERATORS=[Ut.Operator.Plus,Ut.Operator.Asterik,Ut.Operator.Minus,Ut.Operator.Slash,Ut.Operator.Power,Ut.Operator.Modulo,Ut.Operator.LessThan,Ut.Operator.GreaterThan,Ut.Operator.LessThanOrEqual,Ut.Operator.GreaterThanOrEqual,Ut.Operator.NotEqual,Ut.Operator.Equal,Ut.Operator.AddShorthand,Ut.Operator.SubtractShorthand,Ut.Operator.MultiplyShorthand,Ut.Operator.DivideShorthand,ju.Operator.BitwiseAnd,ju.Operator.BitwiseOr,ju.Operator.LeftShift,ju.Operator.RightShift,ju.Operator.UnsignedRightShift,Ut.Operator.Assign,Ut.Operator.Reference].map(t=>({label:t,kind:24}))});var nO=m(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.activate=or.getDefaultCompletionList=or.getPropertyCompletionList=void 0;var tO=Ce(),UF=Y1(),WF=Qo(),HF=Q1(),GF=Z1(),zF=eO(),KF=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.getAllIdentifier()};or.getPropertyCompletionList=KF;var VF=()=>[...GF.AVAILABLE_KEYWORDS,...zF.AVAILABLE_OPERATORS,...HF.AVAILABLE_CONSTANTS];or.getDefaultCompletionList=VF;function XF(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),s=new WF.LookupHelper(r.textDocument,t),i=s.lookupAST(e.position),o=new UF.CompletionListBuilder;if(i){let{closest:a}=i;a instanceof tO.ASTMemberExpression?o.addCollection(await(0,or.getPropertyCompletionList)(s,a)):a instanceof tO.ASTIndexExpression?o.addCollection(await(0,or.getPropertyCompletionList)(s,a)):(o.setDefault((0,or.getDefaultCompletionList)()),o.addCollection(await s.findAllAvailableIdentifierRelatedToPosition(i.closest)))}else o.setDefault((0,or.getDefaultCompletionList)()),o.addCollection(await s.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}or.activate=XF});var sO=m((zz,rO)=>{"use strict";rO.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 e_=m((Kz,oO)=>{var Fu=sO(),iO={};for(let t of Object.keys(Fu))iO[Fu[t]]=t;var ie={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"]}};oO.exports=ie;for(let t of Object.keys(ie)){if(!("channels"in ie[t]))throw new Error("missing channels property: "+t);if(!("labels"in ie[t]))throw new Error("missing channel labels property: "+t);if(ie[t].labels.length!==ie[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=ie[t];delete ie[t].channels,delete ie[t].labels,Object.defineProperty(ie[t],"channels",{value:e}),Object.defineProperty(ie[t],"labels",{value:n})}ie.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,s=Math.min(e,n,r),i=Math.max(e,n,r),o=i-s,a,u;i===s?a=0:e===i?a=(n-r)/o:n===i?a=2+(r-e)/o:r===i&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let l=(s+i)/2;return i===s?u=0:l<=.5?u=o/(i+s):u=o/(2-i-s),[a,u*100,l*100]};ie.rgb.hsv=function(t){let e,n,r,s,i,o=t[0]/255,a=t[1]/255,u=t[2]/255,l=Math.max(o,a,u),c=l-Math.min(o,a,u),h=function(f){return(l-f)/6/c+1/2};return c===0?(s=0,i=0):(i=c/l,e=h(o),n=h(a),r=h(u),o===l?s=r-n:a===l?s=1/3+e-r:u===l&&(s=2/3+n-e),s<0?s+=1:s>1&&(s-=1)),[s*360,i*100,l*100]};ie.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],s=ie.rgb.hsl(t)[0],i=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[s,i*100,r*100]};ie.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,s=Math.min(1-e,1-n,1-r),i=(1-e-s)/(1-s)||0,o=(1-n-s)/(1-s)||0,a=(1-r-s)/(1-s)||0;return[i*100,o*100,a*100,s*100]};function YF(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}ie.rgb.keyword=function(t){let e=iO[t];if(e)return e;let n=1/0,r;for(let s of Object.keys(Fu)){let i=Fu[s],o=YF(t,i);o<n&&(n=o,r=s)}return r};ie.keyword.rgb=function(t){return Fu[t]};ie.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 s=e*.4124+n*.3576+r*.1805,i=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[s*100,i*100,o*100]};ie.rgb.lab=function(t){let e=ie.rgb.xyz(t),n=e[0],r=e[1],s=e[2];n/=95.047,r/=100,s/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let i=116*r-16,o=500*(n-r),a=200*(r-s);return[i,o,a]};ie.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,s,i,o;if(n===0)return o=r*255,[o,o,o];r<.5?s=r*(1+n):s=r+n-r*n;let a=2*r-s,u=[0,0,0];for(let l=0;l<3;l++)i=e+1/3*-(l-1),i<0&&i++,i>1&&i--,6*i<1?o=a+(s-a)*6*i:2*i<1?o=s:3*i<2?o=a+(s-a)*(2/3-i)*6:o=a,u[l]=o*255;return u};ie.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,s=n,i=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,s*=i<=1?i:2-i;let o=(r+n)/2,a=r===0?2*s/(i+s):2*n/(r+n);return[e,a*100,o*100]};ie.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,s=Math.floor(e)%6,i=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*i),u=255*r*(1-n*(1-i));switch(r*=255,s){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]}};ie.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,s=Math.max(r,.01),i,o;o=(2-n)*r;let a=(2-n)*s;return i=n*s,i/=a<=1?a:2-a,i=i||0,o/=2,[e,i*100,o*100]};ie.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,s=n+r,i;s>1&&(n/=s,r/=s);let o=Math.floor(6*e),a=1-r;i=6*e-o,o&1&&(i=1-i);let u=n+i*(a-n),l,c,h;switch(o){default:case 6:case 0:l=a,c=u,h=n;break;case 1:l=u,c=a,h=n;break;case 2:l=n,c=a,h=u;break;case 3:l=n,c=u,h=a;break;case 4:l=u,c=n,h=a;break;case 5:l=a,c=n,h=u;break}return[l*255,c*255,h*255]};ie.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,s=t[3]/100,i=1-Math.min(1,e*(1-s)+s),o=1-Math.min(1,n*(1-s)+s),a=1-Math.min(1,r*(1-s)+s);return[i*255,o*255,a*255]};ie.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,s,i,o;return s=e*3.2406+n*-1.5372+r*-.4986,i=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),[s*255,i*255,o*255]};ie.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 s=116*n-16,i=500*(e-n),o=200*(n-r);return[s,i,o]};ie.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],s,i,o;i=(e+16)/116,s=n/500+i,o=i-r/200;let a=i**3,u=s**3,l=o**3;return i=a>.008856?a:(i-16/116)/7.787,s=u>.008856?u:(s-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,s*=95.047,i*=100,o*=108.883,[s,i,o]};ie.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],s;s=Math.atan2(r,n)*360/2/Math.PI,s<0&&(s+=360);let o=Math.sqrt(n*n+r*r);return[e,o,s]};ie.lch.lab=function(t){let e=t[0],n=t[1],s=t[2]/360*2*Math.PI,i=n*Math.cos(s),o=n*Math.sin(s);return[e,i,o]};ie.rgb.ansi16=function(t,e=null){let[n,r,s]=t,i=e===null?ie.rgb.hsv(t)[2]:e;if(i=Math.round(i/50),i===0)return 30;let o=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return i===2&&(o+=60),o};ie.hsv.ansi16=function(t){return ie.rgb.ansi16(ie.hsv.rgb(t),t[2])};ie.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)};ie.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,s=(e>>1&1)*n*255,i=(e>>2&1)*n*255;return[r,s,i]};ie.ansi256.rgb=function(t){if(t>=232){let i=(t-232)*10+8;return[i,i,i]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,s=e%6/5*255;return[n,r,s]};ie.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};ie.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),s=r>>16&255,i=r>>8&255,o=r&255;return[s,i,o]};ie.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,s=Math.max(Math.max(e,n),r),i=Math.min(Math.min(e,n),r),o=s-i,a,u;return o<1?a=i/(1-o):a=0,o<=0?u=0:s===e?u=(n-r)/o%6:s===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};ie.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),s=0;return r<1&&(s=(n-.5*r)/(1-r)),[t[0],r*100,s*100]};ie.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,s=0;return r<1&&(s=(n-r)/(1-r)),[t[0],r*100,s*100]};ie.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 s=[0,0,0],i=e%1*6,o=i%1,a=1-o,u=0;switch(Math.floor(i)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=a,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=a,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=a}return u=(1-n)*r,[(n*s[0]+u)*255,(n*s[1]+u)*255,(n*s[2]+u)*255]};ie.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),s=0;return r>0&&(s=e/r),[t[0],s*100,r*100]};ie.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,s=0;return r>0&&r<.5?s=e/(2*r):r>=.5&&r<1&&(s=e/(2*(1-r))),[t[0],s*100,r*100]};ie.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]};ie.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,s=r-e,i=0;return s<1&&(i=(r-s)/(1-s)),[t[0],s*100,i*100]};ie.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};ie.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};ie.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};ie.gray.hsl=function(t){return[0,0,t[0]]};ie.gray.hsv=ie.gray.hsl;ie.gray.hwb=function(t){return[0,100,t[0]]};ie.gray.cmyk=function(t){return[0,0,0,t[0]]};ie.gray.lab=function(t){return[t[0],0,0]};ie.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};ie.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var uO=m((Vz,aO)=>{var If=e_();function JF(){let t={},e=Object.keys(If);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function QF(t){let e=JF(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),s=Object.keys(If[r]);for(let i=s.length,o=0;o<i;o++){let a=s[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function ZF(t,e){return function(n){return e(t(n))}}function e$(t,e){let n=[e[t].parent,t],r=If[e[t].parent][t],s=e[t].parent;for(;e[s].parent;)n.unshift(e[s].parent),r=ZF(If[e[s].parent][s],r),s=e[s].parent;return r.conversion=n,r}aO.exports=function(t){let e=QF(t),n={},r=Object.keys(e);for(let s=r.length,i=0;i<s;i++){let o=r[i];e[o].parent!==null&&(n[o]=e$(o,e))}return n}});var cO=m((Xz,lO)=>{var t_=e_(),t$=uO(),ea={},n$=Object.keys(t_);function r$(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 s$(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let s=t(n);if(typeof s=="object")for(let i=s.length,o=0;o<i;o++)s[o]=Math.round(s[o]);return s};return"conversion"in t&&(e.conversion=t.conversion),e}n$.forEach(t=>{ea[t]={},Object.defineProperty(ea[t],"channels",{value:t_[t].channels}),Object.defineProperty(ea[t],"labels",{value:t_[t].labels});let e=t$(t);Object.keys(e).forEach(r=>{let s=e[r];ea[t][r]=s$(s),ea[t][r].raw=r$(s)})});lO.exports=ea});var fO=m(ta=>{"use strict";var i$=ta&&ta.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ta,"__esModule",{value:!0});ta.activate=void 0;var n_=i$(cO()),o$=Ce(),hO;(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"})(hO||(hO={}));var r_={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},a$=()=>new RegExp(`(?:mark|color)=(${Object.keys(r_).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),u$=Object.prototype.hasOwnProperty;function l$(t){t.connection.onColorPresentation(e=>[{label:`#${n_.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 i=(await t.documentManager.getLatest(n)).document.literals.filter(u=>u.type===o$.ASTType.StringLiteral),o=[],a=({match:u,markup:l,value:c,astPosition:h,lineIndex:f})=>{let g=u.index+l.indexOf("=")+1,v=g+c.length,b=h.line-1+f,O=g,A=v;return f===0&&(O+=h.character,A+=h.character),{start:{line:b,character:O},end:{line:b,character:A}}};for(let u=0;u<i.length;u++){let l=i[u];if(!l.start)continue;let c=l.start,h=l.value.toString().split(`
114
+ `);for(let f=0;f<h.length;f++){let g=h[f],v=a$(),b;for(;b=v.exec(g);){let[O,A]=b,k=a({match:b,markup:O,value:A,astPosition:c,lineIndex:f});if(A.startsWith("#")){let[S,_,N]=n_.default.hex.rgb(A.slice(1));o.push({range:k,color:{red:S/255,green:_/255,blue:N/255,alpha:1}})}else if(u$.call(r_,A)){let[S,_,N]=n_.default.hex.rgb(r_[A].slice(1));o.push({range:k,color:{red:S/255,green:_/255,blue:N/255,alpha:1}})}else o.push({range:k,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}ta.activate=l$});var dO=m(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.activate=void 0;var c$=Ce(),h$=Qo(),f$=t=>`${t.targetUri}:${t.targetRange.start.line}:${t.targetRange.start.character}-${t.targetRange.end.line}:${t.targetRange.end.character}`,d$=async(t,e,n)=>{let r=await t.findAllAssignmentsOfItem(e,n),s=[],i=new Set;for(let o of r){let a=o.node;if(!a.start||!a.end)continue;let u={line:a.start.line-1,character:a.start.character-1},l={line:a.end.line-1,character:a.end.character-1},c={targetUri:o.source,targetRange:{start:u,end:l},targetSelectionRange:{start:u,end:l}},h=f$(c);i.has(h)||(i.add(h),s.push(c))}return s};function p$(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new h$.LookupHelper(n,t),s=r.lookupAST(e.position);if(!s)return;let{outer:i,closest:o}=s,a=i.length>0?i[i.length-1]:void 0,u=o;return a&&a instanceof c$.ASTMemberExpression&&a.identifier===o&&(u=a),await d$(r,u,u.scope)})}Mf.activate=p$});var pO=m(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.activate=void 0;async function g$(t,e){let n=await e.documentManager.getLatest(t);return n.errors.map(r=>{if(r?.range){let s=r.range;return{range:{start:{line:s.start.line-1,character:s.start.character-1},end:{line:s.end.line-1,character:s.end.character-1}},message:r.message,severity:1}}return{range:{start:n.document.start,end:n.document.end},message:r.message,severity:1}})}function m$(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 g$(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}Lf.activate=m$});var gO=m(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.getStringHashCode=void 0;Nf.getStringHashCode=function(){let t=new Map,e=n=>{let r,s;for(r=0,s=0;r<n.length;r++)s=Math.imul(31,s)+n.charCodeAt(r)|0;return s};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let s=e(n);return t.set(n,s),s}}()});var s_=m(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.createExpressionHash=void 0;var qf=Ce(),mO=gO(),jf=(t,e)=>t.$$hash=e,y$=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function na(t){let e=y$(t);if(e!==null)return e;let n=(0,mO.getStringHashCode)(t.type);switch(t.type){case qf.ASTType.ParenthesisExpression:return na(t.expression);case qf.ASTType.MemberExpression:{let r=t;return n^=na(r.base),n^=na(r.identifier),jf(t,n)}case qf.ASTType.IndexExpression:{let r=t;return n^=na(r.base),n^=na(r.index),jf(t,n)}case qf.ASTType.Identifier:{let r=t;return n^=(0,mO.getStringHashCode)(r.name),jf(t,n)}}return jf(t,n)}function b$(t){return na(t)}Ff.createExpressionHash=b$});var ia=m(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.getLiteralValue=sa.getLiteralRawValue=void 0;var ra=Ce(),v$=t=>{switch(t.type){case ra.ASTType.NilLiteral:return"null";case ra.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}case ra.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}default:return t.raw.toString()}};sa.getLiteralRawValue=v$;var _$=t=>{switch(t.type){case ra.ASTType.NilLiteral:return"null";case ra.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}case ra.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}default:return t.value.toString()}};sa.getLiteralValue=_$});var o_=m($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.Stack=void 0;var i_=class{constructor(){let e=this;e.currentStack=[]}get(e){let r=this.currentStack;e==null&&(e=0);let s=r.length-e-1;return s<0?null:r[s]}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}};$f.Stack=i_});var oa=m(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.Factory=Bi.TokenType=void 0;var T$=o_(),S$;(function(t){t[t.Text=0]="Text",t[t.EndOfLine=1]="EndOfLine",t[t.Comment=2]="Comment"})(S$=Bi.TokenType||(Bi.TokenType={}));var a_=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 T$.Stack}process(e,n={}){let r=this,s=r._currentStack;if(e==null)return;if(e.type==null)throw console.error("Error AST type:",e),new Error("Unexpected AST type");let i=r.handlers[e.type];if(i==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);s.push(e),i.call(this,e,n),s.pop()}};Bi.Factory=a_});var l_=m(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.BeautifyContext=Ui.IndentationType=void 0;var $u=Ce(),Bf=oa(),yO;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(yO=Ui.IndentationType||(Ui.IndentationType={}));var u_=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===yO.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 $u.ASTIfClause||e instanceof $u.ASTWhileStatement?e.condition.end.line:e instanceof $u.ASTForGenericStatement?e.iterator.end.line:e instanceof $u.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===$u.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 s=e;s<r;s++)if(this.factory.tokens[s].type===Bf.TokenType.EndOfLine)return!0;return!1}buildBlock(e){if(e.body.length===0)return;e.body.sort((i,o)=>i.range[0]-o.range[0]);let n=null;for(let i=0;i<e.body.length;i++){let o=e.body[i],a=n?this.getPreviousEndLine(n):this.getBlockOpenerEndLine(e),u=Math.max(o.start.line-a-1,0);if(u>0)for(let c=0;c<u;c++){let h={line:a+c+1,character:0};this.factory.tokens.push({type:Bf.TokenType.EndOfLine,value:`
115
+ `,ref:{start:h,end:h}})}let l=this.factory.tokens.length;this.factory.process(o,{isCommand:!0}),l<this.factory.tokens.length&&(this.factory.tokens[l].value=this.getIndent()+this.factory.tokens[l].value,this.factory.tokens.push({type:Bf.TokenType.EndOfLine,value:`
116
+ `,ref:{start:o.end,end:o.end}})),n=o}let r=e.body[e.body.length-1],s=Math.max(e.end.line-this.getPreviousEndLine(r)-1,0);if(s>0)for(let i=0;i<s;i++){let o={line:r.end.line+i+1,character:0};this.factory.tokens.push({type:Bf.TokenType.EndOfLine,value:`
117
+ `,ref:{start:o,end:o}})}}};Ui.BeautifyContext=u_});var c_=m(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.hasEmptyBody=Jt.containsMultilineItemInShortcutClauses=Jt.getLastComment=Jt.unwrap=Jt.countRightBinaryExpressions=Jt.SHORTHAND_OPERATORS=void 0;var Cn=Ce();Jt.SHORTHAND_OPERATORS=[Cn.Operator.Plus,Cn.Operator.Minus,Cn.Operator.Asterik,Cn.Operator.Slash,Cn.Operator.Modulo,Cn.Operator.Power];var k$=t=>{if(t=(0,Jt.unwrap)(t),t instanceof Cn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof Cn.ASTBinaryExpression&&n++,(r instanceof Cn.ASTBinaryExpression||r instanceof Cn.ASTLogicalExpression||r instanceof Cn.ASTIsaExpression)&&(e.push((0,Jt.unwrap)(r.left)),e.push((0,Jt.unwrap)(r.right)))}return n};Jt.countRightBinaryExpressions=k$;var w$=t=>{for(;t instanceof Cn.ASTParenthesisExpression;)t=t.expression;return t};Jt.unwrap=w$;var x$=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===Cn.ASTType.Comment)return n}return null};Jt.getLastComment=x$;var E$=(t,e)=>e.some(n=>t.line<n.body[0].end.line);Jt.containsMultilineItemInShortcutClauses=E$;var A$=t=>!t.some(e=>!(e instanceof Cn.ASTComment));Jt.hasEmptyBody=A$});var f_=m(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});Wf.BeautifyFactory=void 0;var Bu=Ce(),O$=require("path"),bO=s_(),Uf=ia(),vO=l_(),vs=c_(),q=oa(),h_=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
118
  `).map(u=>`//${u}`).join(`
119
- `),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 ou.ASTIdentifier||u instanceof ou.ASTMemberExpression)&&c instanceof ou.ASTBinaryExpression&&(c.left instanceof ou.ASTIdentifier||c.left instanceof ou.ASTMemberExpression)&&Qr.SHORTHAND_OPERATORS.includes(c.operator)&&(0,nA.createExpressionHash)(u)===(0,nA.createExpressionHash)(c.left)){this.tokens.push({type:N.TokenType.Text,value:" "+c.operator+"= ",ref:o}),this.process((0,Qr.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:`
120
- `,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:`
121
- `,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:`
122
- `,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:(0,jd.getLiteralValue)(o),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:`
123
- `,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:`
124
- `,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:`
125
- `,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:`
126
- `,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:`
127
- `,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:(0,jd.getLiteralRawValue)(o),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,Qr.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,Qr.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:(0,jd.getLiteralRawValue)(o),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,Qr.unwrap)(o.variable)),this.tokens.push({type:N.TokenType.Text,value:" in ",ref:{start:o.start,end:o.start}}),this.process((0,Qr.unwrap)(o.iterator)),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 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,Qr.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:`
129
- `,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,Qr.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:`
130
- `,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:`
131
- `,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,sq.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:`
132
- `,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:`
133
- `,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:(0,jd.getLiteralRawValue)(o),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,Qr.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:`
134
- `,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=rA.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new rA.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+=`
135
- `}else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Fd.BeautifyFactory=Eb});var Cb=g(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.DefaultFactory=void 0;var oq=require("path"),$d=Oo(),W=Co(),Ob=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(`
119
+ `),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,l=o.init;if(this.process(u),(u instanceof Bu.ASTIdentifier||u instanceof Bu.ASTMemberExpression)&&l instanceof Bu.ASTBinaryExpression&&(l.left instanceof Bu.ASTIdentifier||l.left instanceof Bu.ASTMemberExpression)&&vs.SHORTHAND_OPERATORS.includes(l.operator)&&(0,bO.createExpressionHash)(u)===(0,bO.createExpressionHash)(l.left)){this.tokens.push({type:q.TokenType.Text,value:" "+l.operator+"= ",ref:o}),this.process((0,vs.unwrap)(l.right));return}this.tokens.push({type:q.TokenType.Text,value:" = ",ref:o}),this.process(l)},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 l=o.parameters[u];this.process(l),u!==o.parameters.length-1&&this.tokens.push({type:q.TokenType.Text,value:", ",ref:l})}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:`
120
+ `,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:`
121
+ `,ref:{start:o.start,end:o.start}});for(let u=0;u<o.fields.length;u++){let l=o.fields[u];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:l}),this.process(l),this.tokens.push({type:q.TokenType.Text,value:",",ref:l}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
122
+ `,ref:l})}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 l=o.fields[u];this.process(l),u!==o.fields.length-1&&this.tokens.push({type:q.TokenType.Text,value:", ",ref:l})}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:(0,Uf.getLiteralValue)(o),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:`
123
+ `,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:`
124
+ `,ref:{start:o.start,end:o.start}});for(let c=0;c<o.arguments.length;c++){let h=o.arguments[c];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:h}),this.process(h),c!==o.arguments.length-1&&(this.tokens.push({type:q.TokenType.Text,value:",",ref:h}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
125
+ `,ref:h}))}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 c=0;c<o.arguments.length;c++){let h=o.arguments[c];this.process(h),c!==o.arguments.length-1&&this.tokens.push({type:q.TokenType.Text,value:", ",ref:h})}let l=this.context.containsNewLineInRange(u);if(o.arguments.length>1&&l){this._tokens=this._tokens.slice(0,u+1),this.context.incIndent(),this.tokens.push({type:q.TokenType.EndOfLine,value:`
126
+ `,ref:{start:o.start,end:o.start}});for(let c=0;c<o.arguments.length;c++){let h=o.arguments[c];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:h}),this.process(h),c!==o.arguments.length-1&&(this.tokens.push({type:q.TokenType.Text,value:",",ref:h}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
127
+ `,ref:h}))}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:(0,Uf.getLiteralRawValue)(o),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 l=o.clauses[u];this.process(l),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,vs.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,vs.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:(0,Uf.getLiteralRawValue)(o),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,vs.unwrap)(o.variable)),this.tokens.push({type:q.TokenType.Text,value:" in ",ref:{start:o.start,end:o.start}}),this.process((0,vs.unwrap)(o.iterator)),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 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,vs.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:`
129
+ `,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,vs.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:`
130
+ `,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:`
131
+ `,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,O$.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:`
132
+ `,ref:{start:o.start,end:o.start}});for(let u=0;u<o.fields.length;u++){let l=o.fields[u];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:l}),this.process(l),this.tokens.push({type:q.TokenType.Text,value:",",ref:l}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
133
+ `,ref:l})}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 l=o.fields[u];this.process(l),u!==o.fields.length-1&&this.tokens.push({type:q.TokenType.Text,value:", ",ref:l})}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:(0,Uf.getLiteralRawValue)(o),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,vs.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:`
134
+ `,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=vO.IndentationType.Tab,indentationSpaces:s=2,isDevMode:i=!1}=e.buildOptions;this.context=new vO.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:s,isDevMode:i})}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let s=0;s<this.tokens.length-1;s++){let i=this.tokens[s],o=this.tokens[s+1];if(i.type===q.TokenType.Text)r+=i.value;else if(i.type===q.TokenType.Comment)r+=i.value;else if(i.type===q.TokenType.EndOfLine){if(o?.type===q.TokenType.Comment&&i.ref.end.line===o?.ref.start.line){r+=" "+o.value.trim(),s++;continue}r+=`
135
+ `}else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Wf.BeautifyFactory=h_});var p_=m(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.DefaultFactory=void 0;var C$=require("path"),Hf=ia(),H=oa(),d_=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(`
136
136
  `).map(r=>`//${r}`).join(`
137
- `),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:`
138
- `,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:`
139
- `,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:(0,$d.getLiteralValue)(e),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:`
140
- `,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:`
141
- `,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:(0,$d.getLiteralRawValue)(e),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:(0,$d.getLiteralRawValue)(e),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:`
142
- `,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:`
143
- `,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:`
144
- `,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:`
145
- `,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:`
146
- `,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:`
147
- `,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:`
148
- `,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:`
149
- `,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,oq.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:(0,$d.getLiteralRawValue)(e),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:`
150
- `,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+=`
151
- `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Bd.DefaultFactory=Ob});var Rb=g(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.createExpressionString=void 0;var Ud=Oe();function au(t){switch(t.type){case Ud.ASTType.ParenthesisExpression:return au(t.expression);case Ud.ASTType.MemberExpression:{let e=t;return`${au(e.base)}.${au(e.identifier)}`}case Ud.ASTType.IndexExpression:return`${au(t.base)}[]`;case Ud.ASTType.Identifier:return t.name}}function aq(t){return au(t)}Hd.createExpressionString=aq});var uu=g(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.merge=void 0;function uq(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))}Wd.merge=uq});var Db=g(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.UglifyFactory=void 0;var cq=require("path"),iA=Rb(),Pr=Oo(),lq=uu(),B=Co(),Pb=class extends B.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"(",ref:i}),this.process(i.expression),this.tokens.push({type:B.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:B.TokenType.Text,value:"=",ref:i}),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.tokens.push({type:B.TokenType.Text,value:i.indexer,ref:i});let o=(0,iA.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:B.TokenType.Text,value:"function",ref:{start:i.start,end:i.start}});else{this.tokens.push({type:B.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:B.TokenType.Text,value:",",ref:a})}this.isWithinArgument=!1,this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:i.start,end:i.start}})}this.tokens.push({type:B.TokenType.EndOfLine,value:`
152
- `,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:B.TokenType.EndOfLine,value:`
153
- `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end function",ref:{start:i.end,end:i.end}})},MapConstructorExpression:function(i,s){this.tokens.push({type:B.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:B.TokenType.Text,value:",",ref:a})}this.tokens.push({type:B.TokenType.Text,value:"}",ref:{start:i.end,end:i.end}})},MapKeyString:function(i,s){this.process(i.key),this.tokens.push({type:B.TokenType.Text,value:":",ref:i}),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.tokens.push({type:B.TokenType.Text,value:o,ref:i});return}if(s.isMember&&s.usesNativeVar?o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o:s.isMember||(o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o),s.isForVariable&&i.name!==o){let a=`__${i.name}_idx`,u=`__${o}_idx`;this.forIdxMapping.set(a,u)}this.tokens.push({type:B.TokenType.Text,value:o,ref:i})},ReturnStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"return ",ref:i}),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Pr.getLiteralValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Pr.getLiteralValue)(i),ref:i})},WhileStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"while ",ref:{start:i.start,end:i.start}}),this.process(i.condition),this.tokens.push({type:B.TokenType.EndOfLine,value:`
154
- `,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:B.TokenType.EndOfLine,value:`
155
- `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end while",ref:{start:i.end,end:i.end}})},CallExpression:function(i,s){let o=(0,iA.createExpressionString)(i.base),a=o==="globals.hasIndex"||o==="locals.hasIndex"||o==="outer.hasIndex",u;if(this.process(i.base),a){if(u=i.arguments[0],u.type==="StringLiteral"){let c=(0,Pr.getLiteralValue)(u),l=this.transformer.context.variables.get(c);this.tokens.push({type:B.TokenType.Text,value:'("'+(l??c)+'")',ref:{start:i.start,end:i.start}});return}this.tokens.push({type:B.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}}),this.process(u),this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:i.end,end:i.end}});return}if(i.arguments.length!==0){this.tokens.push({type:B.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:B.TokenType.Text,value:",",ref:l})}this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:i.end,end:i.end}})}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Pr.getLiteralRawValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Pr.getLiteralRawValue)(i),ref:i})},SliceExpression:function(i,s){this.process(i.base),this.tokens.push({type:B.TokenType.Text,value:"[",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:":",ref:i}),this.process(i.right),this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},IndexExpression:function(i,s){this.process(i.base),this.tokens.push({type:B.TokenType.Text,value:"[",ref:i}),this.process(i.index),this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},UnaryExpression:function(i,s){i.operator==="new"?this.tokens.push({type:B.TokenType.Text,value:i.operator+" ",ref:i}):this.tokens.push({type:B.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},NegationExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"not ",ref:i}),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#envar ${i.name}`,ref:i});return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.tokens.push({type:B.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${o}"`,ref:i})},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"debugger",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:"//debugger",ref:i})},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#line",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`${i.start.line}`,ref:i})},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#filename",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${(0,cq.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:B.TokenType.Text,value:" ",ref:i})}},IfShortcutClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"if ",ref:i}),this.process(i.condition),this.tokens.push({type:B.TokenType.Text,value:" then ",ref:i}),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"else if ",ref:i}),this.process(i.condition),this.tokens.push({type:B.TokenType.Text,value:" then ",ref:i}),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"else ",ref:i}),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Pr.getLiteralRawValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Pr.getLiteralRawValue)(i),ref:i})},ForGenericStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"for ",ref:{start:i.start,end:i.start}}),this.process(i.variable,{isForVariable:!0}),this.tokens.push({type:B.TokenType.Text,value:" in ",ref:{start:i.start,end:i.start}}),this.process(i.iterator),this.tokens.push({type:B.TokenType.EndOfLine,value:`
156
- `,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:B.TokenType.EndOfLine,value:`
157
- `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.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:B.TokenType.Text,value:"end if",ref:{start:i.end,end:i.end}})},IfClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"if ",ref:{start:i.start,end:i.start}}),this.process(i.condition),this.tokens.push({type:B.TokenType.Text,value:" then",ref:{start:i.start,end:i.start}}),this.tokens.push({type:B.TokenType.EndOfLine,value:`
158
- `,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:B.TokenType.EndOfLine,value:`
159
- `,ref:{start:o.end,end:o.end}})}},ElseifClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"else if ",ref:{start:i.start,end:i.start}}),this.process(i.condition),this.tokens.push({type:B.TokenType.Text,value:" then",ref:{start:i.start,end:i.start}}),this.tokens.push({type:B.TokenType.EndOfLine,value:`
160
- `,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:B.TokenType.EndOfLine,value:`
161
- `,ref:{start:o.end,end:o.end}})}},ElseClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"else",ref:{start:i.start,end:i.start}}),this.tokens.push({type:B.TokenType.EndOfLine,value:`
162
- `,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:B.TokenType.EndOfLine,value:`
163
- `,ref:{start:o.end,end:o.end}})}},ContinueStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"continue",ref:i})},BreakStatement:function(i,s){this.tokens.push({type:B.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:B.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}if(this.currentDependency===null){this.tokens.push({type:B.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.tokens.push({type:B.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${o.replace(/"/g,'""')}"`,ref:i})},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:B.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:B.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:B.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(this.process(i.name),this.disableNamespacesOptimization){this.tokens.push({type:B.TokenType.Text,value:`=__REQUIRE("${i.namespace}")`,ref:i});return}let o=this.transformer.context.variables.get("__REQUIRE");this.tokens.push({type:B.TokenType.Text,value:`=${o}("${i.namespace}")`,ref:i})},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:B.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.tokens.push({type:B.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:B.TokenType.Text,value:",",ref:a})}this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Pr.getLiteralRawValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Pr.getLiteralRawValue)(i),ref:i})},EmptyExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"",ref:i})},IsaExpression:function(i,s){this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.tokens.push({type:B.TokenType.Text,value:"bitOr(",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:B.TokenType.Text,value:")",ref:i});return}else if(i.operator==="&"){this.tokens.push({type:B.TokenType.Text,value:"bitAnd(",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:B.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:B.TokenType.Text,value:i.operator,ref:i}),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.tokens.push({type:B.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:B.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:B.TokenType.EndOfLine,value:`
164
- `,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.forIdxMapping=new Map,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===B.TokenType.Text||s.type===B.TokenType.Comment)r+=s.value;else if(s.type===B.TokenType.EndOfLine)r+=`
165
- `;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=[];if((!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0){let s=n.map(o=>`${r}.${o.namespace}=${(0,Pr.getLiteralRawValue)(o.literal)}`);(0,lq.merge)(i,s)}return i}};Gd.UglifyFactory=Pb});var Kd=g(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.getFactory=ms.BuildType=void 0;var dq=Ab(),fq=Cb(),pq=Db(),cu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(cu=ms.BuildType||(ms.BuildType={}));var hq={[cu.DEFAULT]:fq.DefaultFactory,[cu.UGLIFY]:pq.UglifyFactory,[cu.BEAUTIFY]:dq.BeautifyFactory};function gq(t=cu.DEFAULT){let e=hq[t];if(!e)throw new Error("Unknown build type.");return e}ms.getFactory=gq});var Ib=g((sA,Vd)=>{(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 b(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 b(E(v))}function M(v,F){return p(_(v),_(F))}function x(v,F){return b(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 Vd=="object"&&Vd.exports?Vd.exports=k:t.md5=k})(sA)});var Lb=g(Ro=>{"use strict";var mq=Ro&&Ro.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.LiteralsMapper=void 0;var yq=mq(Ib()),oA=Oo(),Mb=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=(0,oA.getLiteralRawValue)(e);if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,yq.default)(r)))}return n}get(e){let n=this,r=(0,oA.getLiteralRawValue)(e);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};Ro.LiteralsMapper=Mb});var qb=g(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.NamespaceGenerator=void 0;var Nb=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}};zd.NamespaceGenerator=Nb});var lu=g(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.Context=ys.ContextDataProperty=void 0;var bq=Oe(),vq=Lb(),aA=qb(),_q;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(_q=ys.ContextDataProperty||(ys.ContextDataProperty={}));var jb=class{constructor(e){let n=this;n.modules=new aA.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new aA.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...Object.values(bq.Keyword),...e.variablesExcluded||[]]}),n.literals=new vq.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)}};ys.Context=jb});var Fb=g(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.DependencyType=void 0;var Tq;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(Tq=du.DependencyType||(du.DependencyType={}))});var Yd=g(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.BuildError=void 0;var $b=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Xd.BuildError=$b});var Qd=g(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.fetchNamespaces=void 0;function Sq(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)}Jd.fetchNamespaces=Sq});var Wb=g(Pi=>{"use strict";var Bb=Pi&&Pi.__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())})},fA=Pi&&Pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.Dependency=void 0;var uA=fA(Ib()),kq=fA(require("events")),cA=Cr(),Zd=lu(),Ub=Fb(),lA=Yd(),xq=Qd(),dA=uu(),Hb=class t extends kq.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,uA.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||Ub.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(Zd.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(Zd.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return Bb(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(Zd.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,uA.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 cA.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(b){throw b instanceof lA.BuildError?b:new lA.BuildError(b.message,{target:c,range:b.range})}})}findInjections(){return Bb(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 Bb(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(Zd.ContextDataProperty.DependencyCallStack),o=[...(0,xq.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let d of c){let p=d instanceof cA.ASTFeatureIncludeExpression?Ub.DependencyType.Include:Ub.DependencyType.Import,b=yield e.resolve(d.path,p,d),_=b.getNamespace();if(s.includes(_))throw new Error(`Circular dependency from ${e.target} to ${b.target} detected.`);let E=b.chunk;d.chunk=E,d.namespace=_;let L=yield b.findDependencies();(0,dA.merge)(o,L.namespaces),(0,dA.merge)(a,L.literals),u.push(b)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};Pi.Dependency=Hb});var tf=g(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.Transformer=void 0;var Gb=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};ef.Transformer=Gb});var sf=g(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.generateCharsetMap=void 0;function nf(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function wq(t=!1){let e=nf(65,90),n=nf(97,122),r=nf(48,57),i="_";return t&&(i=i+nf(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}rf.generateCharsetMap=wq});var Vb=g(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MAIN_BOILERPLATE=Di.MODULE_BOILERPLATE=Di.HEADER_BOILERPLATE=void 0;var Kb=Cr();Di.HEADER_BOILERPLATE=new Kb.Parser(`MODULES={}
137
+ `),ref:e});return}this.tokens.push({type:H.TokenType.Comment,value:"//"+e.value,ref:e})},AssignmentStatement:function(e,n){let r=e.variable,s=e.init;this.process(r),this.tokens.push({type:H.TokenType.Text,value:"=",ref:e}),this.process(s)},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 s=e.parameters[r];this.process(s),r!==e.parameters.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:s})}this.tokens.push({type:H.TokenType.Text,value:")",ref:{start:e.start,end:e.start}})}this.tokens.push({type:H.TokenType.EndOfLine,value:`
138
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let s=this.tokens.length;this.process(r),s<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
139
+ `,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 s=e.fields[r];this.process(s),r!==e.fields.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:s})}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:(0,Hf.getLiteralValue)(e),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:`
140
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let s=this.tokens.length;this.process(r),s<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
141
+ `,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 s=e.arguments[r];this.process(s),r!==e.arguments.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:s})}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:(0,Hf.getLiteralRawValue)(e),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 s=e.clauses[r];this.process(s),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:(0,Hf.getLiteralRawValue)(e),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:`
142
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let s=this.tokens.length;this.process(r),s<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
143
+ `,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:`
144
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let s=this.tokens.length;this.process(r),s<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
145
+ `,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:`
146
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let s=this.tokens.length;this.process(r),s<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
147
+ `,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:`
148
+ `,ref:{start:e.start,end:e.start}});for(let r of e.body){let s=this.tokens.length;this.process(r),s<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
149
+ `,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,C$.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 s=e.fields[r];this.process(s),r!==e.fields.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:s})}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:(0,Hf.getLiteralRawValue)(e),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 s=this.tokens.length;this.process(r),s<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
150
+ `,ref:{start:r.end,end:r.end}})}}}}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let s=0;s<this.tokens.length-1;s++){let i=this.tokens[s];if(i.type===H.TokenType.Text||i.type===H.TokenType.Comment)r+=i.value;else if(i.type===H.TokenType.EndOfLine)r+=`
151
+ `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Gf.DefaultFactory=d_});var g_=m(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.createExpressionString=void 0;var zf=Ce();function Uu(t){switch(t.type){case zf.ASTType.ParenthesisExpression:return Uu(t.expression);case zf.ASTType.MemberExpression:{let e=t;return`${Uu(e.base)}.${Uu(e.identifier)}`}case zf.ASTType.IndexExpression:return`${Uu(t.base)}[]`;case zf.ASTType.Identifier:return t.name}}function R$(t){return Uu(t)}Kf.createExpressionString=R$});var Wu=m(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.merge=void 0;function P$(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))}Vf.merge=P$});var y_=m(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.UglifyFactory=void 0;var D$=require("path"),_O=g_(),Yr=ia(),I$=Wu(),B=oa(),m_=class extends B.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"(",ref:s}),this.process(s.expression),this.tokens.push({type:B.TokenType.Text,value:")",ref:s})},Comment:function(s,i){},AssignmentStatement:function(s,i){let o=s.variable,a=s.init;this.process(o),this.tokens.push({type:B.TokenType.Text,value:"=",ref:s}),this.process(a)},MemberExpression:function(s,i){this.process(s.base),this.tokens.push({type:B.TokenType.Text,value:s.indexer,ref:s});let o=(0,_O.createExpressionString)(s.base);this.process(s.identifier,{usesNativeVar:o==="globals"||o==="locals"||o==="outer",isMember:!0})},FunctionDeclaration:function(s,i){if(s.parameters.length===0)this.tokens.push({type:B.TokenType.Text,value:"function",ref:{start:s.start,end:s.start}});else{this.tokens.push({type:B.TokenType.Text,value:"function(",ref:{start:s.start,end:s.start}}),this.isWithinArgument=!0;for(let o=0;o<s.parameters.length;o++){let a=s.parameters[o];this.process(a),o!==s.parameters.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:a})}this.isWithinArgument=!1,this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:s.start,end:s.start}})}this.tokens.push({type:B.TokenType.EndOfLine,value:`
152
+ `,ref:{start:s.start,end:s.start}});for(let o of s.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
153
+ `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end function",ref:{start:s.end,end:s.end}})},MapConstructorExpression:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"{",ref:{start:s.start,end:s.start}});for(let o=0;o<s.fields.length;o++){let a=s.fields[o];this.process(a),o!==s.fields.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:a})}this.tokens.push({type:B.TokenType.Text,value:"}",ref:{start:s.end,end:s.end}})},MapKeyString:function(s,i){this.process(s.key),this.tokens.push({type:B.TokenType.Text,value:":",ref:s}),this.process(s.value)},Identifier:function(s,i){let o=s.name;if(this.disableNamespacesOptimization){this.tokens.push({type:B.TokenType.Text,value:o,ref:s});return}if(i.isMember&&i.usesNativeVar?o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o:i.isMember||(o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o),i.isForVariable&&s.name!==o){let a=`__${s.name}_idx`,u=`__${o}_idx`;this.forIdxMapping.set(a,u)}this.tokens.push({type:B.TokenType.Text,value:o,ref:s})},ReturnStatement:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"return ",ref:s}),s.argument&&this.process(s.argument)},NumericLiteral:function(s,i){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Yr.getLiteralValue)(s),ref:s});return}let o=this.transformer.context.literals.get(s);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:s});return}this.tokens.push({type:B.TokenType.Text,value:(0,Yr.getLiteralValue)(s),ref:s})},WhileStatement:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"while ",ref:{start:s.start,end:s.start}}),this.process(s.condition),this.tokens.push({type:B.TokenType.EndOfLine,value:`
154
+ `,ref:{start:s.start,end:s.start}});for(let o of s.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
155
+ `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end while",ref:{start:s.end,end:s.end}})},CallExpression:function(s,i){let o=(0,_O.createExpressionString)(s.base),a=o==="globals.hasIndex"||o==="locals.hasIndex"||o==="outer.hasIndex",u;if(this.process(s.base),a){if(u=s.arguments[0],u.type==="StringLiteral"){let l=(0,Yr.getLiteralValue)(u),c=this.transformer.context.variables.get(l);this.tokens.push({type:B.TokenType.Text,value:'("'+(c??l)+'")',ref:{start:s.start,end:s.start}});return}this.tokens.push({type:B.TokenType.Text,value:"(",ref:{start:s.start,end:s.start}}),this.process(u),this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:s.end,end:s.end}});return}if(s.arguments.length!==0){this.tokens.push({type:B.TokenType.Text,value:"(",ref:{start:s.start,end:s.start}});for(let l=0;l<s.arguments.length;l++){let c=s.arguments[l];this.process(c),l!==s.arguments.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:c})}this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:s.end,end:s.end}})}},StringLiteral:function(s,i){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Yr.getLiteralRawValue)(s),ref:s});return}let o=this.transformer.context.literals.get(s);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:s});return}this.tokens.push({type:B.TokenType.Text,value:(0,Yr.getLiteralRawValue)(s),ref:s})},SliceExpression:function(s,i){this.process(s.base),this.tokens.push({type:B.TokenType.Text,value:"[",ref:s}),this.process(s.left),this.tokens.push({type:B.TokenType.Text,value:":",ref:s}),this.process(s.right),this.tokens.push({type:B.TokenType.Text,value:"]",ref:s})},IndexExpression:function(s,i){this.process(s.base),this.tokens.push({type:B.TokenType.Text,value:"[",ref:s}),this.process(s.index),this.tokens.push({type:B.TokenType.Text,value:"]",ref:s})},UnaryExpression:function(s,i){s.operator==="new"?this.tokens.push({type:B.TokenType.Text,value:s.operator+" ",ref:s}):this.tokens.push({type:B.TokenType.Text,value:s.operator,ref:s}),this.process(s.argument)},NegationExpression:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"not ",ref:s}),this.process(s.argument)},FeatureEnvarExpression:function(s,i){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#envar ${s.name}`,ref:s});return}let o=this.transformer.environmentVariables.get(s.name);if(!o){this.tokens.push({type:B.TokenType.Text,value:"null",ref:s});return}this.tokens.push({type:B.TokenType.Text,value:`"${o}"`,ref:s})},FeatureDebuggerExpression:function(s,i){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"debugger",ref:s});return}this.tokens.push({type:B.TokenType.Text,value:"//debugger",ref:s})},FeatureLineExpression:function(s,i){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#line",ref:s});return}this.tokens.push({type:B.TokenType.Text,value:`${s.start.line}`,ref:s})},FeatureFileExpression:function(s,i){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#filename",ref:s});return}this.tokens.push({type:B.TokenType.Text,value:`"${(0,D$.basename)(s.filename).replace(/"/g,'"')}"`,ref:s})},IfShortcutStatement:function(s,i){for(let o=0;o<s.clauses.length;o++){let a=s.clauses[o];this.process(a),o!==s.clauses.length-1&&this.tokens.push({type:B.TokenType.Text,value:" ",ref:s})}},IfShortcutClause:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"if ",ref:s}),this.process(s.condition),this.tokens.push({type:B.TokenType.Text,value:" then ",ref:s}),this.process(s.body[0])},ElseifShortcutClause:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"else if ",ref:s}),this.process(s.condition),this.tokens.push({type:B.TokenType.Text,value:" then ",ref:s}),this.process(s.body[0])},ElseShortcutClause:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"else ",ref:s}),this.process(s.body[0])},NilLiteral:function(s,i){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Yr.getLiteralRawValue)(s),ref:s});return}let o=this.transformer.context.literals.get(s);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:s});return}this.tokens.push({type:B.TokenType.Text,value:(0,Yr.getLiteralRawValue)(s),ref:s})},ForGenericStatement:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"for ",ref:{start:s.start,end:s.start}}),this.process(s.variable,{isForVariable:!0}),this.tokens.push({type:B.TokenType.Text,value:" in ",ref:{start:s.start,end:s.start}}),this.process(s.iterator),this.tokens.push({type:B.TokenType.EndOfLine,value:`
156
+ `,ref:{start:s.start,end:s.start}});for(let o of s.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
157
+ `,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end for",ref:{start:s.end,end:s.end}})},IfStatement:function(s,i){for(let o of s.clauses)this.process(o);this.tokens.push({type:B.TokenType.Text,value:"end if",ref:{start:s.end,end:s.end}})},IfClause:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"if ",ref:{start:s.start,end:s.start}}),this.process(s.condition),this.tokens.push({type:B.TokenType.Text,value:" then",ref:{start:s.start,end:s.start}}),this.tokens.push({type:B.TokenType.EndOfLine,value:`
158
+ `,ref:{start:s.start,end:s.start}});for(let o of s.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
159
+ `,ref:{start:o.end,end:o.end}})}},ElseifClause:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"else if ",ref:{start:s.start,end:s.start}}),this.process(s.condition),this.tokens.push({type:B.TokenType.Text,value:" then",ref:{start:s.start,end:s.start}}),this.tokens.push({type:B.TokenType.EndOfLine,value:`
160
+ `,ref:{start:s.start,end:s.start}});for(let o of s.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
161
+ `,ref:{start:o.end,end:o.end}})}},ElseClause:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"else",ref:{start:s.start,end:s.start}}),this.tokens.push({type:B.TokenType.EndOfLine,value:`
162
+ `,ref:{start:s.start,end:s.start}});for(let o of s.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
163
+ `,ref:{start:o.end,end:o.end}})}},ContinueStatement:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"continue",ref:s})},BreakStatement:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"break",ref:s})},CallStatement:function(s,i){this.process(s.expression)},FeatureInjectExpression:function(s,i){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#inject "${s.path}";`,ref:s});return}if(this.currentDependency===null){this.tokens.push({type:B.TokenType.Text,value:`#inject "${s.path}";`,ref:s});return}let o=this.currentDependency.injections.get(s.path);if(o==null){this.tokens.push({type:B.TokenType.Text,value:"null",ref:s});return}this.tokens.push({type:B.TokenType.Text,value:`"${o.replace(/"/g,'""')}"`,ref:s})},FeatureImportExpression:function(s,i){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#import ",ref:s}),this.process(s.name),this.tokens.push({type:B.TokenType.Text,value:` from "${s.path}";`,ref:s});return}if(!s.chunk){this.tokens.push({type:B.TokenType.Text,value:"#import ",ref:s}),this.process(s.name),this.tokens.push({type:B.TokenType.Text,value:` from "${s.path}";`,ref:s});return}if(this.process(s.name),this.disableNamespacesOptimization){this.tokens.push({type:B.TokenType.Text,value:`=__REQUIRE("${s.namespace}")`,ref:s});return}let o=this.transformer.context.variables.get("__REQUIRE");this.tokens.push({type:B.TokenType.Text,value:`=${o}("${s.namespace}")`,ref:s})},FeatureIncludeExpression:function(s,i){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#include "${s.path}";`,ref:s});return}if(!s.chunk){this.tokens.push({type:B.TokenType.Text,value:`#include "${s.path}";`,ref:s});return}this.process(s.chunk)},ListConstructorExpression:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"[",ref:s});for(let o=0;o<s.fields.length;o++){let a=s.fields[o];this.process(a),o!==s.fields.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:a})}this.tokens.push({type:B.TokenType.Text,value:"]",ref:s})},ListValue:function(s,i){this.process(s.value)},BooleanLiteral:function(s,i){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Yr.getLiteralRawValue)(s),ref:s});return}let o=this.transformer.context.literals.get(s);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:s});return}this.tokens.push({type:B.TokenType.Text,value:(0,Yr.getLiteralRawValue)(s),ref:s})},EmptyExpression:function(s,i){this.tokens.push({type:B.TokenType.Text,value:"",ref:s})},IsaExpression:function(s,i){this.process(s.left),this.tokens.push({type:B.TokenType.Text,value:" "+s.operator+" ",ref:s}),this.process(s.right)},LogicalExpression:function(s,i){this.process(s.left),this.tokens.push({type:B.TokenType.Text,value:" "+s.operator+" ",ref:s}),this.process(s.right)},BinaryExpression:function(s,i){if(s.operator==="|"){this.tokens.push({type:B.TokenType.Text,value:"bitOr(",ref:s}),this.process(s.left),this.tokens.push({type:B.TokenType.Text,value:",",ref:s}),this.process(s.right),this.tokens.push({type:B.TokenType.Text,value:")",ref:s});return}else if(s.operator==="&"){this.tokens.push({type:B.TokenType.Text,value:"bitAnd(",ref:s}),this.process(s.left),this.tokens.push({type:B.TokenType.Text,value:",",ref:s}),this.process(s.right),this.tokens.push({type:B.TokenType.Text,value:")",ref:s});return}else if(s.operator==="<<"||s.operator===">>"||s.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(s.left),this.tokens.push({type:B.TokenType.Text,value:s.operator,ref:s}),this.process(s.right)},BinaryNegatedExpression:function(s,i){this.tokens.push({type:B.TokenType.Text,value:s.operator,ref:s}),this.process(s.argument)},ComparisonGroupExpression:function(s,i){this.process(s.expressions[0]);for(let o=0;o<s.operators.length;o++)this.tokens.push({type:B.TokenType.Text,value:s.operators[o],ref:s}),this.process(s.expressions[o+1])},Chunk:function(s,i){for(let o of s.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
164
+ `,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.forIdxMapping=new Map,this.isWithinArgument=!1}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let s=0;s<this.tokens.length-1;s++){let i=this.tokens[s];if(i.type===B.TokenType.Text||i.type===B.TokenType.Comment)r+=i.value;else if(i.type===B.TokenType.EndOfLine)r+=`
165
+ `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(i=>i.namespace!=null),r=e.variables.get("globals"),s=[];if((!this.disableNamespacesOptimization||n.length>0)&&s.push(`globals.${r}=globals`),n.length>0){let i=n.map(o=>`${r}.${o.namespace}=${(0,Yr.getLiteralRawValue)(o.literal)}`);(0,I$.merge)(s,i)}return s}};Xf.UglifyFactory=m_});var Yf=m(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.getFactory=Wi.BuildType=void 0;var M$=f_(),L$=p_(),N$=y_(),Hu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Hu=Wi.BuildType||(Wi.BuildType={}));var q$={[Hu.DEFAULT]:L$.DefaultFactory,[Hu.UGLIFY]:N$.UglifyFactory,[Hu.BEAUTIFY]:M$.BeautifyFactory};function j$(t=Hu.DEFAULT){let e=q$[t];if(!e)throw new Error("Unknown build type.");return e}Wi.getFactory=j$});var b_=m((TO,Jf)=>{(function(t){"use strict";function e(_,N){var R=(_&65535)+(N&65535),G=(_>>16)+(N>>16)+(R>>16);return G<<16|R&65535}function n(_,N){return _<<N|_>>>32-N}function r(_,N,R,G,se,ue){return e(n(e(e(N,_),e(G,ue)),se),R)}function s(_,N,R,G,se,ue,z){return r(N&R|~N&G,_,N,se,ue,z)}function i(_,N,R,G,se,ue,z){return r(N&G|R&~G,_,N,se,ue,z)}function o(_,N,R,G,se,ue,z){return r(N^R^G,_,N,se,ue,z)}function a(_,N,R,G,se,ue,z){return r(R^(N|~G),_,N,se,ue,z)}function u(_,N){_[N>>5]|=128<<N%32,_[(N+64>>>9<<4)+14]=N;var R,G,se,ue,z,C=1732584193,M=-271733879,L=-1732584194,F=271733878;for(R=0;R<_.length;R+=16)G=C,se=M,ue=L,z=F,C=s(C,M,L,F,_[R],7,-680876936),F=s(F,C,M,L,_[R+1],12,-389564586),L=s(L,F,C,M,_[R+2],17,606105819),M=s(M,L,F,C,_[R+3],22,-1044525330),C=s(C,M,L,F,_[R+4],7,-176418897),F=s(F,C,M,L,_[R+5],12,1200080426),L=s(L,F,C,M,_[R+6],17,-1473231341),M=s(M,L,F,C,_[R+7],22,-45705983),C=s(C,M,L,F,_[R+8],7,1770035416),F=s(F,C,M,L,_[R+9],12,-1958414417),L=s(L,F,C,M,_[R+10],17,-42063),M=s(M,L,F,C,_[R+11],22,-1990404162),C=s(C,M,L,F,_[R+12],7,1804603682),F=s(F,C,M,L,_[R+13],12,-40341101),L=s(L,F,C,M,_[R+14],17,-1502002290),M=s(M,L,F,C,_[R+15],22,1236535329),C=i(C,M,L,F,_[R+1],5,-165796510),F=i(F,C,M,L,_[R+6],9,-1069501632),L=i(L,F,C,M,_[R+11],14,643717713),M=i(M,L,F,C,_[R],20,-373897302),C=i(C,M,L,F,_[R+5],5,-701558691),F=i(F,C,M,L,_[R+10],9,38016083),L=i(L,F,C,M,_[R+15],14,-660478335),M=i(M,L,F,C,_[R+4],20,-405537848),C=i(C,M,L,F,_[R+9],5,568446438),F=i(F,C,M,L,_[R+14],9,-1019803690),L=i(L,F,C,M,_[R+3],14,-187363961),M=i(M,L,F,C,_[R+8],20,1163531501),C=i(C,M,L,F,_[R+13],5,-1444681467),F=i(F,C,M,L,_[R+2],9,-51403784),L=i(L,F,C,M,_[R+7],14,1735328473),M=i(M,L,F,C,_[R+12],20,-1926607734),C=o(C,M,L,F,_[R+5],4,-378558),F=o(F,C,M,L,_[R+8],11,-2022574463),L=o(L,F,C,M,_[R+11],16,1839030562),M=o(M,L,F,C,_[R+14],23,-35309556),C=o(C,M,L,F,_[R+1],4,-1530992060),F=o(F,C,M,L,_[R+4],11,1272893353),L=o(L,F,C,M,_[R+7],16,-155497632),M=o(M,L,F,C,_[R+10],23,-1094730640),C=o(C,M,L,F,_[R+13],4,681279174),F=o(F,C,M,L,_[R],11,-358537222),L=o(L,F,C,M,_[R+3],16,-722521979),M=o(M,L,F,C,_[R+6],23,76029189),C=o(C,M,L,F,_[R+9],4,-640364487),F=o(F,C,M,L,_[R+12],11,-421815835),L=o(L,F,C,M,_[R+15],16,530742520),M=o(M,L,F,C,_[R+2],23,-995338651),C=a(C,M,L,F,_[R],6,-198630844),F=a(F,C,M,L,_[R+7],10,1126891415),L=a(L,F,C,M,_[R+14],15,-1416354905),M=a(M,L,F,C,_[R+5],21,-57434055),C=a(C,M,L,F,_[R+12],6,1700485571),F=a(F,C,M,L,_[R+3],10,-1894986606),L=a(L,F,C,M,_[R+10],15,-1051523),M=a(M,L,F,C,_[R+1],21,-2054922799),C=a(C,M,L,F,_[R+8],6,1873313359),F=a(F,C,M,L,_[R+15],10,-30611744),L=a(L,F,C,M,_[R+6],15,-1560198380),M=a(M,L,F,C,_[R+13],21,1309151649),C=a(C,M,L,F,_[R+4],6,-145523070),F=a(F,C,M,L,_[R+11],10,-1120210379),L=a(L,F,C,M,_[R+2],15,718787259),M=a(M,L,F,C,_[R+9],21,-343485551),C=e(C,G),M=e(M,se),L=e(L,ue),F=e(F,z);return[C,M,L,F]}function l(_){var N,R="",G=_.length*32;for(N=0;N<G;N+=8)R+=String.fromCharCode(_[N>>5]>>>N%32&255);return R}function c(_){var N,R=[];for(R[(_.length>>2)-1]=void 0,N=0;N<R.length;N+=1)R[N]=0;var G=_.length*8;for(N=0;N<G;N+=8)R[N>>5]|=(_.charCodeAt(N/8)&255)<<N%32;return R}function h(_){return l(u(c(_),_.length*8))}function f(_,N){var R,G=c(_),se=[],ue=[],z;for(se[15]=ue[15]=void 0,G.length>16&&(G=u(G,_.length*8)),R=0;R<16;R+=1)se[R]=G[R]^909522486,ue[R]=G[R]^1549556828;return z=u(se.concat(c(N)),512+N.length*8),l(u(ue.concat(z),640))}function g(_){var N="0123456789abcdef",R="",G,se;for(se=0;se<_.length;se+=1)G=_.charCodeAt(se),R+=N.charAt(G>>>4&15)+N.charAt(G&15);return R}function v(_){return unescape(encodeURIComponent(_))}function b(_){return h(v(_))}function O(_){return g(b(_))}function A(_,N){return f(v(_),v(N))}function k(_,N){return g(A(_,N))}function S(_,N,R){return N?R?A(N,_):k(N,_):R?b(_):O(_)}typeof define=="function"&&define.amd?define(function(){return S}):typeof Jf=="object"&&Jf.exports?Jf.exports=S:t.md5=S})(TO)});var __=m(aa=>{"use strict";var F$=aa&&aa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(aa,"__esModule",{value:!0});aa.LiteralsMapper=void 0;var $$=F$(b_()),SO=ia(),v_=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=(0,SO.getLiteralRawValue)(e);if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let s=n.mapping.get(r),i=s.amount+1,o=s.length+r.length;s.amount=i,s.length=o,o>10&&i>2&&s.namespace==null&&(s.namespace=n.variableNamespacesGenerator.createNamespace((0,$$.default)(r)))}return n}get(e){let n=this,r=(0,SO.getLiteralRawValue)(e);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};aa.LiteralsMapper=v_});var S_=m(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.NamespaceGenerator=void 0;var T_=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,s=n.characters.length;e==null&&(e=r.length-1);let i=r[e];return i=i+1,r[e]=i,i===s&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,s=e.forbidden,i="",o=0,a;for(;o<n.length;)a=n[o],i=i+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return s.indexOf(i)!==-1||e.mapping.has(i)?e.generateNamespace():i}createNamespace(e,n=!1){let r=this,s=r.mapping,i=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(s.has(e)&&!n)return s.get(e);let a=r.generateNamespace();if(s.set(e,a),i.set(a,e),i.has(e)){let u=i.get(e);i.delete(e),a=r.createNamespace(u,!0)}return a}};Qf.NamespaceGenerator=T_});var Gu=m(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.Context=Hi.ContextDataProperty=void 0;var B$=Ce(),U$=__(),kO=S_(),W$;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(W$=Hi.ContextDataProperty||(Hi.ContextDataProperty={}));var k_=class{constructor(e){let n=this;n.modules=new kO.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new kO.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...Object.values(B$.Keyword),...e.variablesExcluded||[]]}),n.literals=new U$.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 s=n();return r.data.set(e,s),s}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};Hi.Context=k_});var w_=m(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.DependencyType=void 0;var H$;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(H$=zu.DependencyType||(zu.DependencyType={}))});var ed=m(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.BuildError=void 0;var x_=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Zf.BuildError=x_});var nd=m(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.fetchNamespaces=void 0;function G$(t){let e=new Set(t.namespaces);return t.scopes.reduce((n,r)=>(r.namespaces.forEach(s=>e.add(s)),n),e),Array.from(e)}td.fetchNamespaces=G$});var C_=m(Zs=>{"use strict";var E_=Zs&&Zs.__awaiter||function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?i(c.value):s(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})},OO=Zs&&Zs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.Dependency=void 0;var wO=OO(b_()),z$=OO(require("events")),xO=Vr(),rd=Gu(),A_=w_(),EO=ed(),K$=nd(),AO=Wu(),O_=class t extends z$.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,wO.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||A_.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(rd.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(rd.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return E_(this,void 0,void 0,function*(){let s=this,i=s.context,{modules:o}=i,a=i.get(rd.ContextDataProperty.ResourceDependencyMap),u=s.resourceHandler,l=yield u.getTargetRelativeTo(s.target,e),c=(0,wO.default)(l),h=o.get(c);if(a.has(h))return a.get(h);if(!(yield u.has(l)))throw new Error("Dependency "+l+" does not exist...");let f=yield u.get(l);s.emit("parse-before",l);try{let v=new xO.Parser(f,{filename:l}).parseChunk(),b=new t({target:l,resourceHandler:u,chunk:v,type:n,context:i,ref:r});return s.emit("parse-after",b),b}catch(g){throw g instanceof EO.BuildError?g:new EO.BuildError(g.message,{target:l,range:g.range})}})}findInjections(){return E_(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let s of n){let i=yield e.resourceHandler.getTargetRelativeTo(e.target,s.path);if(!(yield e.resourceHandler.has(i)))throw new Error("Injection "+i+" does not exist...");let o=yield e.resourceHandler.get(i);r.set(s.path,o)}return e.injections=r,r})}findDependencies(){return E_(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,s=e.getNamespace(),i=e.context.get(rd.ContextDataProperty.DependencyCallStack),o=[...(0,K$.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];i.push(s);let l=[...n,...r];for(let h of l){let f=h instanceof xO.ASTFeatureIncludeExpression?A_.DependencyType.Include:A_.DependencyType.Import,g=yield e.resolve(h.path,f,h),v=g.getNamespace();if(i.includes(v))throw new Error(`Circular dependency from ${e.target} to ${g.target} detected.`);let b=g.chunk;h.chunk=b,h.namespace=v;let O=yield g.findDependencies();(0,AO.merge)(o,O.namespaces),(0,AO.merge)(a,O.literals),u.push(g)}yield this.findInjections();let c=new Set(u);return e.dependencies=c,i.pop(),{dependencies:c,namespaces:o,literals:a}})}};Zs.Dependency=O_});var id=m(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.Transformer=void 0;var R_=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:s,resourceHandler:i}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=s,o._factory=new n(o),o._resourceHandler=i??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};sd.Transformer=R_});var ud=m(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.generateCharsetMap=void 0;function od(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function V$(t=!1){let e=od(65,90),n=od(97,122),r=od(48,57),s="_";return t&&(s=s+od(1e3,2e3)),{variables:e+n+s,modules:e+n+r+s}}ad.generateCharsetMap=V$});var D_=m(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.MAIN_BOILERPLATE=ei.MODULE_BOILERPLATE=ei.HEADER_BOILERPLATE=void 0;var P_=Vr();ei.HEADER_BOILERPLATE=new P_.Parser(`MODULES={}
166
166
  EXPORTED={}
167
167
  __REQUIRE=function(r)
168
168
  if (not MODULES.hasIndex(r)) then
@@ -171,7 +171,7 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
171
171
  end if
172
172
  module=@MODULES[r]
173
173
  return @module(r).exports
174
- end function`).parseChunk();Di.MODULE_BOILERPLATE=new Kb.Parser(`MODULES["$0"]=function(r)
174
+ end function`).parseChunk();ei.MODULE_BOILERPLATE=new P_.Parser(`MODULES["$0"]=function(r)
175
175
  module={}
176
176
  if (EXPORTED.hasIndex(r)) then
177
177
  module=EXPORTED[r]
@@ -181,16 +181,18 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
181
181
  end if
182
182
  EXPORTED[r]=module
183
183
  return EXPORTED[r]
184
- end function`).parseChunk();Di.MAIN_BOILERPLATE=new Kb.Parser('"$0"').parseChunk()});var af=g(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.OutputProcessor=void 0;var pA=Vb(),Eq=uu(),zb=class{constructor(e,n,{header:r=pA.HEADER_BOILERPLATE,main:i=pA.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,Eq.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(`
185
- `)}};of.OutputProcessor=zb});var gA=g(Po=>{"use strict";var Aq=Po&&Po.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Po,"__esModule",{value:!0});Po.DirectTranspiler=void 0;var Oq=Aq(require("events")),Cq=Cr(),hA=Kd(),Rq=lu(),Pq=tf(),Dq=sf(),Iq=Qd(),Mq=af(),Lq=Object.prototype.hasOwnProperty,Xb=class extends Oq.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=Lq.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||hA.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,hA.getFactory)(e.buildType),i=new Cq.Parser(e.code).parseChunk(),s=(0,Iq.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,Dq.generateCharsetMap)(e.obfuscation),u=new Rq.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(b=>u.variables.createNamespace(b)),o.forEach(b=>u.literals.add(b));let l=new Pq.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),d=new Mq.OutputProcessor(u,l);d.addOptimizations();let p=l.transform(i);return d.addCode(p),d.build()}};Po.DirectTranspiler=Xb});var Jb=g(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.ResourceProvider=void 0;var Yb=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))}}};uf.ResourceProvider=Yb});var Zb=g(Ii=>{"use strict";var Nq=Ii&&Ii.__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())})},qq=Ii&&Ii.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.Target=void 0;var jq=qq(require("events")),Fq=Cr(),$q=Wb(),mA=Yd(),Qb=class extends jq.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return Nq(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 Fq.Parser(s,{filename:r}).parseChunk(),u=new $q.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 mA.BuildError?o:new mA.BuildError(o.message,{target:this.target,range:o.range})}})}};Ii.Target=Qb});var bA=g(Do=>{"use strict";var Bq=Do&&Do.__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(Do,"__esModule",{value:!0});Do.Transpiler=void 0;var Uq=tv(),Hq=Vb(),yA=Kd(),Wq=lu(),Gq=Jb(),Kq=Zb(),Vq=tf(),zq=sf(),Xq=af(),Yq=Object.prototype.hasOwnProperty,ev=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new Gq.ResourceProvider().getHandler(),n.obfuscation=Yq.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,zq.generateCharsetMap)(n.obfuscation);n.context=new Wq.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||yA.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return Bq(this,void 0,void 0,function*(){let e=this,n=(0,yA.getFactory)(e.buildType),r=e.context,s=yield new Kq.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new Vq.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(Hq.MODULE_BOILERPLATE),c=l=>{let d=r.modules.get(l.getId()),p={},b=0,_=function(M){let x=M.getNamespace();if(!(x in p)){if(x!==d&&M.type===Uq.DependencyType.Import){let k=o.transform(M.chunk,M);p[x]=u.replace('"$0"','"'+x+'"').replace('"$1"',k),b++}for(let k of M.dependencies)_(k)}};_(l);let E=new Xq.OutputProcessor(r,o);E.addOptimizations(),b>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)}})}};Do.Transpiler=ev});var vA=g(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.unwrap=void 0;var Jq=Oe();function Qq(t){for(;t instanceof Jq.ASTParenthesisExpression;)t=t.expression;return t}cf.unwrap=Qq});var tv=g(ee=>{"use strict";var _A=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]}),Zq=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ej=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)&&_A(e,t,n);return Zq(e,t),e},tj=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&_A(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.unwrap=ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.merge=ee.LiteralsMapper=ee.getLiteralValue=ee.getLiteralRawValue=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 TA=Kd();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return TA.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return TA.getFactory}});var nj=Ab();Object.defineProperty(ee,"BeautifyFactory",{enumerable:!0,get:function(){return nj.BeautifyFactory}});var rj=xb();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return rj.BeautifyContext}});ee.BeautifyUtils=ej(wb());var ij=Cb();Object.defineProperty(ee,"DefaultFactory",{enumerable:!0,get:function(){return ij.DefaultFactory}});var SA=Co();Object.defineProperty(ee,"Factory",{enumerable:!0,get:function(){return SA.Factory}});Object.defineProperty(ee,"TokenType",{enumerable:!0,get:function(){return SA.TokenType}});var sj=Db();Object.defineProperty(ee,"UglifyFactory",{enumerable:!0,get:function(){return sj.UglifyFactory}});var kA=lu();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return kA.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return kA.ContextDataProperty}});var oj=Wb();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return oj.Dependency}});var aj=gA();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return aj.DirectTranspiler}});tj(Jb(),ee);var uj=Zb();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return uj.Target}});var cj=tf();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return cj.Transformer}});var lj=bA();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return lj.Transpiler}});var dj=Fb();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return dj.DependencyType}});var fj=sf();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return fj.generateCharsetMap}});var pj=vb();Object.defineProperty(ee,"createExpressionHash",{enumerable:!0,get:function(){return pj.createExpressionHash}});var hj=Rb();Object.defineProperty(ee,"createExpressionString",{enumerable:!0,get:function(){return hj.createExpressionString}});var gj=Yd();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return gj.BuildError}});var mj=Qd();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return mj.fetchNamespaces}});var xA=Oo();Object.defineProperty(ee,"getLiteralRawValue",{enumerable:!0,get:function(){return xA.getLiteralRawValue}});Object.defineProperty(ee,"getLiteralValue",{enumerable:!0,get:function(){return xA.getLiteralValue}});var yj=Lb();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return yj.LiteralsMapper}});var bj=uu();Object.defineProperty(ee,"merge",{enumerable:!0,get:function(){return bj.merge}});var vj=qb();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return vj.NamespaceGenerator}});var _j=af();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return _j.OutputProcessor}});var Tj=Tb();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return Tj.Stack}});var Sj=vA();Object.defineProperty(ee,"unwrap",{enumerable:!0,get:function(){return Sj.unwrap}})});var EA=g(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.activate=void 0;var wA=tv();function kj(t){async function e(n){try{let r=t.getConfiguration();return new wA.DirectTranspiler({code:n,buildType:wA.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}]})}lf.activate=kj});var df=g((fu,nv)=>{(function(t,e){if(typeof fu=="object"&&typeof nv=="object")nv.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof fu=="object"?fu:t)[r]=n[r]}})(fu,()=>(()=>{"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,b=-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(!(b===E-1||_===1))if(b!==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("/"),b=E,_=0;continue}}else if(d.length===2||d.length===1){d="",p=0,b=E,_=0;continue}}c&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+u.slice(b+1,E):d=u.slice(b+1,E),p=E-b-1;b=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,b=1;b<c.length&&c.charCodeAt(b)===47;++b);for(var _=c.length-b,E=p<_?p:_,L=-1,M=0;M<=E;++M){if(M===E){if(_>E){if(c.charCodeAt(b+M)===47)return c.slice(b+M+1);if(M===0)return c.slice(b+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(b+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(b+L):(b+=L,c.charCodeAt(b)===47&&++b,c.slice(b))},_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,b=u.length-1;b>=1;--b)if((c=u.charCodeAt(b))===47){if(!p){d=b;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,b=!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(!b){d=l+1;break}}else E===-1&&(b=!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(!b){d=l+1;break}}else p===-1&&(b=!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,b=0,_=u.length-1;_>=0;--_){var E=u.charCodeAt(_);if(E!==47)d===-1&&(p=!1,d=_+1),E===46?c===-1?c=_:b!==1&&(b=1):c!==-1&&(b=-1);else if(!p){l=_+1;break}}return c===-1||d===-1||b===0||b===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 b=-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?b===-1?b=M:x!==1&&(x=1):b!==-1&&(x=-1);else if(!L){_=M+1;break}return b===-1||E===-1||x===0||x===1&&b===E-1&&b===_+1?E!==-1&&(c.base=c.name=_===0&&p?u.slice(1,E):u.slice(_,E)):(_===0&&p?(c.name=u.slice(1,b),c.base=u.slice(1,E)):(c.name=u.slice(_,b),c.base=u.slice(_,E)),c.ext=u.slice(b,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="",b="/",_=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;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]!==b&&(mt=b+mt):mt=b}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,b)),A[0]===b&&A[1]===b){let I=A.indexOf(b,2);I===-1?(D=A.substring(2),A=b):(D=A.substring(2,I),A=A.substring(I)||b)}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+=b,I+=b),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 b;(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)}})(b||(s.Utils=b={}))}},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 pf=g(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.MarkdownString=void 0;var rv=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+=`
186
- `,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};ff.MarkdownString=rv});var hf=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 AA=Ks(),OA=pf();function iv(t){return t==null?"":t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}Tt.formatTypes=iv;function CA(t){return typeof t=="string"?`"${t}"`:t.toString()}Tt.formatDefaultValue=CA;var xj=(t,e)=>{let n=e.getArguments()||[],r=iv(e.getReturns())||"null";if(n.length===0)return`(${t.kind}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${iv(s.getTypes())}${s.getDefault()?` = ${CA(s.getDefault().value)}`:""}`).join(", ");return`(${t.kind}) ${t.label} (${i}): ${r}`};Tt.createTooltipHeader=xj;var wj=(t,e,n)=>{t.appendCodeblock(AA.LanguageId,(0,Tt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
187
- `)};Tt.appendTooltipHeader=wj;var Ej=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
184
+ end function`).parseChunk();ei.MAIN_BOILERPLATE=new P_.Parser('"$0"').parseChunk()});var cd=m(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.OutputProcessor=void 0;var CO=D_(),X$=Wu(),I_=class{constructor(e,n,{header:r=CO.HEADER_BOILERPLATE,main:s=CO.MAIN_BOILERPLATE}={}){this.context=e,this.transformer=n,this.processed=[],this.headerBoilerplate=this.transformer.transform(r),this.mainBoilerplate=this.transformer.transform(s)}addOptimizations(){return(0,X$.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(`
185
+ `)}};ld.OutputProcessor=I_});var PO=m(ua=>{"use strict";var Y$=ua&&ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ua,"__esModule",{value:!0});ua.DirectTranspiler=void 0;var J$=Y$(require("events")),Q$=Vr(),RO=Yf(),Z$=Gu(),eB=id(),tB=ud(),nB=nd(),rB=cd(),sB=Object.prototype.hasOwnProperty,M_=class extends J$.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=sB.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||RO.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,RO.getFactory)(e.buildType),s=new Q$.Parser(e.code).parseChunk(),i=(0,nB.fetchNamespaces)(s),o=[].concat(s.literals),a=(0,tB.generateCharsetMap)(e.obfuscation),u=new Z$.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(i).forEach(g=>u.variables.createNamespace(g)),o.forEach(g=>u.literals.add(g));let c=new eB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),h=new rB.OutputProcessor(u,c);h.addOptimizations();let f=c.transform(s);return h.addCode(f),h.build()}};ua.DirectTranspiler=M_});var N_=m(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.ResourceProvider=void 0;var L_=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,s)=>{let i=n.resolve(r,".."),o=n.resolve(i,s);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))}}};hd.ResourceProvider=L_});var j_=m(ti=>{"use strict";var iB=ti&&ti.__awaiter||function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?i(c.value):s(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})},oB=ti&&ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ti,"__esModule",{value:!0});ti.Target=void 0;var aB=oB(require("events")),uB=Vr(),lB=C_(),DO=ed(),q_=class extends aB.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return iB(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 s=e.context,i=yield n.get(r);e.emit("parse-before",r);try{let a=new uB.Parser(i,{filename:r}).parseChunk(),u=new lB.Dependency({target:r,resourceHandler:n,chunk:a,context:s}),{namespaces:l,literals:c}=yield u.findDependencies(),h=new Set(l);for(let f of h)s.variables.createNamespace(f);for(let f of c)s.literals.add(f);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof DO.BuildError?o:new DO.BuildError(o.message,{target:this.target,range:o.range})}})}};ti.Target=q_});var MO=m(la=>{"use strict";var cB=la&&la.__awaiter||function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?i(c.value):s(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})};Object.defineProperty(la,"__esModule",{value:!0});la.Transpiler=void 0;var hB=$_(),fB=D_(),IO=Yf(),dB=Gu(),pB=N_(),gB=j_(),mB=id(),yB=ud(),bB=cd(),vB=Object.prototype.hasOwnProperty,F_=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new pB.ResourceProvider().getHandler(),n.obfuscation=vB.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,yB.generateCharsetMap)(n.obfuscation);n.context=new dB.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||IO.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return cB(this,void 0,void 0,function*(){let e=this,n=(0,IO.getFactory)(e.buildType),r=e.context,i=yield new gB.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new mB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=i.main,u=o.transform(fB.MODULE_BOILERPLATE),l=c=>{let h=r.modules.get(c.getId()),f={},g=0,v=function(A){let k=A.getNamespace();if(!(k in f)){if(k!==h&&A.type===hB.DependencyType.Import){let S=o.transform(A.chunk,A);f[k]=u.replace('"$0"','"'+k+'"').replace('"$1"',S),g++}for(let S of A.dependencies)v(S)}};v(c);let b=new bB.OutputProcessor(r,o);b.addOptimizations(),g>0&&b.addHeader(),Object.keys(f).forEach(A=>b.addCode(f[A]));let O=o.transform(c.chunk,c);return b.addCode(O,!0),b.build()};return{[e.target]:l(a.dependency)}})}};la.Transpiler=F_});var LO=m(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.unwrap=void 0;var _B=Ce();function TB(t){for(;t instanceof _B.ASTParenthesisExpression;)t=t.expression;return t}fd.unwrap=TB});var $_=m(ee=>{"use strict";var NO=ee&&ee.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),SB=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kB=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)&&NO(e,t,n);return SB(e,t),e},wB=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&NO(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.unwrap=ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.merge=ee.LiteralsMapper=ee.getLiteralValue=ee.getLiteralRawValue=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 qO=Yf();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return qO.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return qO.getFactory}});var xB=f_();Object.defineProperty(ee,"BeautifyFactory",{enumerable:!0,get:function(){return xB.BeautifyFactory}});var EB=l_();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return EB.BeautifyContext}});ee.BeautifyUtils=kB(c_());var AB=p_();Object.defineProperty(ee,"DefaultFactory",{enumerable:!0,get:function(){return AB.DefaultFactory}});var jO=oa();Object.defineProperty(ee,"Factory",{enumerable:!0,get:function(){return jO.Factory}});Object.defineProperty(ee,"TokenType",{enumerable:!0,get:function(){return jO.TokenType}});var OB=y_();Object.defineProperty(ee,"UglifyFactory",{enumerable:!0,get:function(){return OB.UglifyFactory}});var FO=Gu();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return FO.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return FO.ContextDataProperty}});var CB=C_();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return CB.Dependency}});var RB=PO();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return RB.DirectTranspiler}});wB(N_(),ee);var PB=j_();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return PB.Target}});var DB=id();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return DB.Transformer}});var IB=MO();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return IB.Transpiler}});var MB=w_();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return MB.DependencyType}});var LB=ud();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return LB.generateCharsetMap}});var NB=s_();Object.defineProperty(ee,"createExpressionHash",{enumerable:!0,get:function(){return NB.createExpressionHash}});var qB=g_();Object.defineProperty(ee,"createExpressionString",{enumerable:!0,get:function(){return qB.createExpressionString}});var jB=ed();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return jB.BuildError}});var FB=nd();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return FB.fetchNamespaces}});var $O=ia();Object.defineProperty(ee,"getLiteralRawValue",{enumerable:!0,get:function(){return $O.getLiteralRawValue}});Object.defineProperty(ee,"getLiteralValue",{enumerable:!0,get:function(){return $O.getLiteralValue}});var $B=__();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return $B.LiteralsMapper}});var BB=Wu();Object.defineProperty(ee,"merge",{enumerable:!0,get:function(){return BB.merge}});var UB=S_();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return UB.NamespaceGenerator}});var WB=cd();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return WB.OutputProcessor}});var HB=o_();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return HB.Stack}});var GB=LO();Object.defineProperty(ee,"unwrap",{enumerable:!0,get:function(){return GB.unwrap}})});var UO=m(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.activate=void 0;var BO=$_();function zB(t){async function e(n){try{let r=t.getConfiguration();return new BO.DirectTranspiler({code:n,buildType:BO.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 s=await t.documentManager.getLatest(r),i=await e(r.getText());return i===null?[]:[{range:{start:{line:0,character:0},end:s.document.end},newText:i}]})}dd.activate=zB});var pd=m((Ku,B_)=>{(function(t,e){if(typeof Ku=="object"&&typeof B_=="object")B_.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Ku=="object"?Ku:t)[r]=n[r]}})(Ku,()=>(()=>{"use strict";var t={470:s=>{function i(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,l){for(var c,h="",f=0,g=-1,v=0,b=0;b<=u.length;++b){if(b<u.length)c=u.charCodeAt(b);else{if(c===47)break;c=47}if(c===47){if(!(g===b-1||v===1))if(g!==b-1&&v===2){if(h.length<2||f!==2||h.charCodeAt(h.length-1)!==46||h.charCodeAt(h.length-2)!==46){if(h.length>2){var O=h.lastIndexOf("/");if(O!==h.length-1){O===-1?(h="",f=0):f=(h=h.slice(0,O)).length-1-h.lastIndexOf("/"),g=b,v=0;continue}}else if(h.length===2||h.length===1){h="",f=0,g=b,v=0;continue}}l&&(h.length>0?h+="/..":h="..",f=2)}else h.length>0?h+="/"+u.slice(g+1,b):h=u.slice(g+1,b),f=b-g-1;g=b,v=0}else c===46&&v!==-1?++v:v=-1}return h}var a={resolve:function(){for(var u,l="",c=!1,h=arguments.length-1;h>=-1&&!c;h--){var f;h>=0?f=arguments[h]:(u===void 0&&(u=process.cwd()),f=u),i(f),f.length!==0&&(l=f+"/"+l,c=f.charCodeAt(0)===47)}return l=o(l,!c),c?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(u){if(i(u),u.length===0)return".";var l=u.charCodeAt(0)===47,c=u.charCodeAt(u.length-1)===47;return(u=o(u,!l)).length!==0||l||(u="."),u.length>0&&c&&(u+="/"),l?"/"+u:u},isAbsolute:function(u){return i(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,l=0;l<arguments.length;++l){var c=arguments[l];i(c),c.length>0&&(u===void 0?u=c:u+="/"+c)}return u===void 0?".":a.normalize(u)},relative:function(u,l){if(i(u),i(l),u===l||(u=a.resolve(u))===(l=a.resolve(l)))return"";for(var c=1;c<u.length&&u.charCodeAt(c)===47;++c);for(var h=u.length,f=h-c,g=1;g<l.length&&l.charCodeAt(g)===47;++g);for(var v=l.length-g,b=f<v?f:v,O=-1,A=0;A<=b;++A){if(A===b){if(v>b){if(l.charCodeAt(g+A)===47)return l.slice(g+A+1);if(A===0)return l.slice(g+A)}else f>b&&(u.charCodeAt(c+A)===47?O=A:A===0&&(O=0));break}var k=u.charCodeAt(c+A);if(k!==l.charCodeAt(g+A))break;k===47&&(O=A)}var S="";for(A=c+O+1;A<=h;++A)A!==h&&u.charCodeAt(A)!==47||(S.length===0?S+="..":S+="/..");return S.length>0?S+l.slice(g+O):(g+=O,l.charCodeAt(g)===47&&++g,l.slice(g))},_makeLong:function(u){return u},dirname:function(u){if(i(u),u.length===0)return".";for(var l=u.charCodeAt(0),c=l===47,h=-1,f=!0,g=u.length-1;g>=1;--g)if((l=u.charCodeAt(g))===47){if(!f){h=g;break}}else f=!1;return h===-1?c?"/":".":c&&h===1?"//":u.slice(0,h)},basename:function(u,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');i(u);var c,h=0,f=-1,g=!0;if(l!==void 0&&l.length>0&&l.length<=u.length){if(l.length===u.length&&l===u)return"";var v=l.length-1,b=-1;for(c=u.length-1;c>=0;--c){var O=u.charCodeAt(c);if(O===47){if(!g){h=c+1;break}}else b===-1&&(g=!1,b=c+1),v>=0&&(O===l.charCodeAt(v)?--v==-1&&(f=c):(v=-1,f=b))}return h===f?f=b:f===-1&&(f=u.length),u.slice(h,f)}for(c=u.length-1;c>=0;--c)if(u.charCodeAt(c)===47){if(!g){h=c+1;break}}else f===-1&&(g=!1,f=c+1);return f===-1?"":u.slice(h,f)},extname:function(u){i(u);for(var l=-1,c=0,h=-1,f=!0,g=0,v=u.length-1;v>=0;--v){var b=u.charCodeAt(v);if(b!==47)h===-1&&(f=!1,h=v+1),b===46?l===-1?l=v:g!==1&&(g=1):l!==-1&&(g=-1);else if(!f){c=v+1;break}}return l===-1||h===-1||g===0||g===1&&l===h-1&&l===c+1?"":u.slice(l,h)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(l,c){var h=c.dir||c.root,f=c.base||(c.name||"")+(c.ext||"");return h?h===c.root?h+f:h+"/"+f:f}(0,u)},parse:function(u){i(u);var l={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return l;var c,h=u.charCodeAt(0),f=h===47;f?(l.root="/",c=1):c=0;for(var g=-1,v=0,b=-1,O=!0,A=u.length-1,k=0;A>=c;--A)if((h=u.charCodeAt(A))!==47)b===-1&&(O=!1,b=A+1),h===46?g===-1?g=A:k!==1&&(k=1):g!==-1&&(k=-1);else if(!O){v=A+1;break}return g===-1||b===-1||k===0||k===1&&g===b-1&&g===v+1?b!==-1&&(l.base=l.name=v===0&&f?u.slice(1,b):u.slice(v,b)):(v===0&&f?(l.name=u.slice(1,g),l.base=u.slice(1,b)):(l.name=u.slice(v,g),l.base=u.slice(v,b)),l.ext=u.slice(g,b)),v>0?l.dir=u.slice(0,v-1):f&&(l.dir="/"),l},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,s.exports=a},674:(s,i)=>{if(Object.defineProperty(i,"__esModule",{value:!0}),i.isWindows=void 0,typeof process=="object")i.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;i.isWindows=o.indexOf("Windows")>=0}},796:(s,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.uriToFsPath=i.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,l=/^\//,c=/^\/\//;function h(z,C){if(!z.scheme&&C)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${z.authority}", path: "${z.path}", query: "${z.query}", fragment: "${z.fragment}"}`);if(z.scheme&&!u.test(z.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(z.path){if(z.authority){if(!l.test(z.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(c.test(z.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let f="",g="/",v=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class b{static isUri(C){return C instanceof b||!!C&&typeof C.authority=="string"&&typeof C.fragment=="string"&&typeof C.path=="string"&&typeof C.query=="string"&&typeof C.scheme=="string"&&typeof C.fsPath=="string"&&typeof C.with=="function"&&typeof C.toString=="function"}scheme;authority;path;query;fragment;constructor(C,M,L,F,me,pe=!1){typeof C=="object"?(this.scheme=C.scheme||f,this.authority=C.authority||f,this.path=C.path||f,this.query=C.query||f,this.fragment=C.fragment||f):(this.scheme=function(Nt,vt){return Nt||vt?Nt:"file"}(C,pe),this.authority=M||f,this.path=function(Nt,vt){switch(Nt){case"https":case"http":case"file":vt?vt[0]!==g&&(vt=g+vt):vt=g}return vt}(this.scheme,L||f),this.query=F||f,this.fragment=me||f,h(this,pe))}get fsPath(){return N(this,!1)}with(C){if(!C)return this;let{scheme:M,authority:L,path:F,query:me,fragment:pe}=C;return M===void 0?M=this.scheme:M===null&&(M=f),L===void 0?L=this.authority:L===null&&(L=f),F===void 0?F=this.path:F===null&&(F=f),me===void 0?me=this.query:me===null&&(me=f),pe===void 0?pe=this.fragment:pe===null&&(pe=f),M===this.scheme&&L===this.authority&&F===this.path&&me===this.query&&pe===this.fragment?this:new A(M,L,F,me,pe)}static parse(C,M=!1){let L=v.exec(C);return L?new A(L[2]||f,ue(L[4]||f),ue(L[5]||f),ue(L[7]||f),ue(L[9]||f),M):new A(f,f,f,f,f)}static file(C){let M=f;if(a.isWindows&&(C=C.replace(/\\/g,g)),C[0]===g&&C[1]===g){let L=C.indexOf(g,2);L===-1?(M=C.substring(2),C=g):(M=C.substring(2,L),C=C.substring(L)||g)}return new A("file",M,C,f,f)}static from(C){let M=new A(C.scheme,C.authority,C.path,C.query,C.fragment);return h(M,!0),M}toString(C=!1){return R(this,C)}toJSON(){return this}static revive(C){if(C){if(C instanceof b)return C;{let M=new A(C);return M._formatted=C.external,M._fsPath=C._sep===O?C.fsPath:null,M}}return C}}i.URI=b;let O=a.isWindows?1:void 0;class A extends b{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=N(this,!1)),this._fsPath}toString(C=!1){return C?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){let C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=O),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C}}let k={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 S(z,C,M){let L,F=-1;for(let me=0;me<z.length;me++){let pe=z.charCodeAt(me);if(pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||pe===45||pe===46||pe===95||pe===126||C&&pe===47||M&&pe===91||M&&pe===93||M&&pe===58)F!==-1&&(L+=encodeURIComponent(z.substring(F,me)),F=-1),L!==void 0&&(L+=z.charAt(me));else{L===void 0&&(L=z.substr(0,me));let Nt=k[pe];Nt!==void 0?(F!==-1&&(L+=encodeURIComponent(z.substring(F,me)),F=-1),L+=Nt):F===-1&&(F=me)}}return F!==-1&&(L+=encodeURIComponent(z.substring(F))),L!==void 0?L:z}function _(z){let C;for(let M=0;M<z.length;M++){let L=z.charCodeAt(M);L===35||L===63?(C===void 0&&(C=z.substr(0,M)),C+=k[L]):C!==void 0&&(C+=z[M])}return C!==void 0?C:z}function N(z,C){let M;return M=z.authority&&z.path.length>1&&z.scheme==="file"?`//${z.authority}${z.path}`:z.path.charCodeAt(0)===47&&(z.path.charCodeAt(1)>=65&&z.path.charCodeAt(1)<=90||z.path.charCodeAt(1)>=97&&z.path.charCodeAt(1)<=122)&&z.path.charCodeAt(2)===58?C?z.path.substr(1):z.path[1].toLowerCase()+z.path.substr(2):z.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function R(z,C){let M=C?_:S,L="",{scheme:F,authority:me,path:pe,query:Nt,fragment:vt}=z;if(F&&(L+=F,L+=":"),(me||F==="file")&&(L+=g,L+=g),me){let Ue=me.indexOf("@");if(Ue!==-1){let _n=me.substr(0,Ue);me=me.substr(Ue+1),Ue=_n.lastIndexOf(":"),Ue===-1?L+=M(_n,!1,!1):(L+=M(_n.substr(0,Ue),!1,!1),L+=":",L+=M(_n.substr(Ue+1),!1,!0)),L+="@"}me=me.toLowerCase(),Ue=me.lastIndexOf(":"),Ue===-1?L+=M(me,!1,!0):(L+=M(me.substr(0,Ue),!1,!0),L+=me.substr(Ue))}if(pe){if(pe.length>=3&&pe.charCodeAt(0)===47&&pe.charCodeAt(2)===58){let Ue=pe.charCodeAt(1);Ue>=65&&Ue<=90&&(pe=`/${String.fromCharCode(Ue+32)}:${pe.substr(3)}`)}else if(pe.length>=2&&pe.charCodeAt(1)===58){let Ue=pe.charCodeAt(0);Ue>=65&&Ue<=90&&(pe=`${String.fromCharCode(Ue+32)}:${pe.substr(2)}`)}L+=M(pe,!0,!1)}return Nt&&(L+="?",L+=M(Nt,!1,!1)),vt&&(L+="#",L+=C?vt:S(vt,!1,!1)),L}function G(z){try{return decodeURIComponent(z)}catch{return z.length>3?z.substr(0,3)+G(z.substr(3)):z}}i.uriToFsPath=N;let se=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ue(z){return z.match(se)?z.replace(se,C=>G(C)):z}},679:function(s,i,o){var a=this&&this.__createBinding||(Object.create?function(v,b,O,A){A===void 0&&(A=O);var k=Object.getOwnPropertyDescriptor(b,O);k&&!("get"in k?!b.__esModule:k.writable||k.configurable)||(k={enumerable:!0,get:function(){return b[O]}}),Object.defineProperty(v,A,k)}:function(v,b,O,A){A===void 0&&(A=O),v[A]=b[O]}),u=this&&this.__setModuleDefault||(Object.create?function(v,b){Object.defineProperty(v,"default",{enumerable:!0,value:b})}:function(v,b){v.default=b}),l=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var b={};if(v!=null)for(var O in v)O!=="default"&&Object.prototype.hasOwnProperty.call(v,O)&&a(b,v,O);return u(b,v),b};Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=void 0;let c=l(o(470)),h=c.posix||c,f="/";var g;(function(v){v.joinPath=function(b,...O){return b.with({path:h.join(b.path,...O)})},v.resolvePath=function(b,...O){let A=b.path,k=!1;A[0]!==f&&(A=f+A,k=!0);let S=h.resolve(A,...O);return k&&S[0]===f&&!b.authority&&(S=S.substring(1)),b.with({path:S})},v.dirname=function(b){if(b.path.length===0||b.path===f)return b;let O=h.dirname(b.path);return O.length===1&&O.charCodeAt(0)===46&&(O=""),b.with({path:O})},v.basename=function(b){return h.basename(b.path)},v.extname=function(b){return h.extname(b.path)}})(g||(i.Utils=g={}))}},e={};function n(s){var i=e[s];if(i!==void 0)return i.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=s.URI=void 0;let i=n(796);Object.defineProperty(s,"URI",{enumerable:!0,get:function(){return i.URI}});let o=n(679);Object.defineProperty(s,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var md=m(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.MarkdownString=void 0;var U_=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+=`
186
+ `,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};gd.MarkdownString=U_});var yd=m(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.createHover=wt.createSignatureInfo=wt.appendTooltipBody=wt.appendTooltipHeader=wt.createTooltipHeader=wt.formatDefaultValue=wt.formatTypes=void 0;var WO=bi(),HO=md();function W_(t){return t==null?"":t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}wt.formatTypes=W_;function GO(t){return typeof t=="string"?`"${t}"`:t.toString()}wt.formatDefaultValue=GO;var KB=(t,e)=>{let n=e.getArguments()||[],r=W_(e.getReturns())||"null";if(n.length===0)return`(${t.kind}) ${t.label} (): ${r}`;let s=n.map(i=>`${i.getLabel()}${i.isOptional()?"?":""}: ${W_(i.getTypes())}${i.getDefault()?` = ${GO(i.getDefault().value)}`:""}`).join(", ");return`(${t.kind}) ${t.label} (${s}): ${r}`};wt.createTooltipHeader=KB;var VB=(t,e,n)=>{t.appendCodeblock(WO.LanguageId,(0,wt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
187
+ `)};wt.appendTooltipHeader=VB;var XB=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
188
188
  `),n.length>0&&(t.appendMarkdown(`#### Examples:
189
- `),t.appendCodeblock(AA.LanguageId,n.join(`
190
- `)))};Tt.appendTooltipBody=Ej;var Aj=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,Tt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new OA.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=Aj;var Oj=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new OA.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=Oj});var DA=g(Io=>{"use strict";var Cj=Io&&Io.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Io,"__esModule",{value:!0});Io.activate=void 0;var RA=Cr(),sv=Gn(),Rj=Cj(require("path")),pu=df(),Pj=To(),PA=pf(),ov=hf(),Dj=Ks(),Ij=async(t,e,n)=>{let r=pu.URI.parse(e.uri),i=await t.fs.getWorkspaceFolderUri(r);return i==null?pu.Utils.joinPath(r,".."):n.startsWith("/")?i:pu.Utils.joinPath(r,"..")};function Mj(t){async function e(n,r){let i=new PA.MarkdownString(""),o=r.closest.path,a=await Ij(t,n,o),u=pu.Utils.joinPath(a,o),c=pu.Utils.joinPath(a,`${o}`),l=await t.fs.findExistingPath(u.toString(),c.toString()),d=l==null?["Cannot open file."]:[`[Inserts file "${Rj.default.basename(l)}" inside this code when building](${l.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(d.join(`
191
- `)),{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 Pj.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===RA.ASTType.FeatureImportExpression||s.closest.type===RA.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,ov.createHover)(o);let a=new PA.MarkdownString(""),u=Array.from(o.types).map(sv.SignatureDefinitionTypeMeta.parse),c=`(${o.kind}) ${o.label}: ${(0,ov.formatTypes)(u)}`;if(o.types.has(sv.SignatureDefinitionBaseType.Map)){let l={};for(let[d,p]of o.values){let b=Array.from(p.types).map(sv.SignatureDefinitionTypeMeta.parse);l[d.slice(2)]=(0,ov.formatTypes)(b)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(Dj.LanguageId,c),{contents:a.toString()}})}Io.activate=Mj});var MA=g(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.activate=void 0;var IA=Oe(),Lj=To(),Nj=hf(),qj=t=>{if(t.closest.type===IA.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===IA.ASTType.CallExpression)return n}return null};function jj(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 Lj.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=qj(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,b=d.end.character;return p<=e.position.character&&b>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,Nj.createSignatureInfo)(a)),l})}gf.activate=jj});var NA=g(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.activate=void 0;var LA=Ks();function Fj(t){let e=r=>r.languageId!==LA.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===LA.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)}mf.activate=Fj});var qA=g((vW,$j)=>{$j.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 jA=g((_W,Bj)=>{Bj.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:
189
+ `),t.appendCodeblock(WO.LanguageId,n.join(`
190
+ `)))};wt.appendTooltipBody=XB;var YB=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,i={label:(0,wt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new HO.MarkdownString("");(0,wt.appendTooltipBody)(a,r),i.parameters=o.map(u=>({label:`${u.getLabel()}${u.isOptional()?"?":""}: ${u.getTypes().join(" or ")}`})),i.documentation=a.toString(),e.push(i)}return e};wt.createSignatureInfo=YB;var JB=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new HO.MarkdownString(""),s=n;(0,wt.appendTooltipHeader)(r,t,s),(0,wt.appendTooltipBody)(r,s),e.push(r)}return{contents:e.map(n=>n.toString())}};wt.createHover=JB});var VO=m(ca=>{"use strict";var QB=ca&&ca.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ca,"__esModule",{value:!0});ca.activate=void 0;var zO=Vr(),H_=sr(),ZB=QB(require("path")),Vu=pd(),e2=Qo(),KO=md(),G_=yd(),t2=bi(),n2=async(t,e,n)=>{let r=Vu.URI.parse(e.uri),s=await t.fs.getWorkspaceFolderUri(r);return s==null?Vu.Utils.joinPath(r,".."):n.startsWith("/")?s:Vu.Utils.joinPath(r,"..")};function r2(t){async function e(n,r){let s=new KO.MarkdownString(""),o=r.closest.path,a=await n2(t,n,o),u=Vu.Utils.joinPath(a,o),l=Vu.Utils.joinPath(a,`${o}`),c=await t.fs.findExistingPath(u.toString(),l.toString()),h=c==null?["Cannot open file."]:[`[Inserts file "${ZB.default.basename(c)}" inside this code when building](${c.toString()})`,"***","Click the link above to open the file."];return s.appendMarkdown(h.join(`
191
+ `)),{contents:s.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 s=new e2.LookupHelper(r,t),i=s.lookupAST(n.position);if(!i)return;if(i.closest.type===zO.ASTType.FeatureImportExpression||i.closest.type===zO.ASTType.FeatureIncludeExpression)return await e(r,i);let o=await s.lookupTypeInfo(i);if(!o)return;if(o.isCallable())return(0,G_.createHover)(o);let a=new KO.MarkdownString(""),u=Array.from(o.types).map(H_.SignatureDefinitionTypeMeta.parse),l=`(${o.kind}) ${o.label}: ${(0,G_.formatTypes)(u)}`;if(o.types.has(H_.SignatureDefinitionBaseType.Map)){let c={};for(let[h,f]of o.values){let g=Array.from(f.types).map(H_.SignatureDefinitionTypeMeta.parse);c[h.slice(2)]=(0,G_.formatTypes)(g)}l+=" "+JSON.stringify(c,null,2)}return a.appendCodeblock(t2.LanguageId,l),{contents:a.toString()}})}ca.activate=r2});var YO=m(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.activate=void 0;var XO=Ce(),s2=Qo(),i2=yd(),o2=t=>{if(t.closest.type===XO.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===XO.ASTType.CallExpression)return n}return null};function a2(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 s2.LookupHelper(n,t),s=r.lookupAST(e.position);if(!s)return;let{closest:i}=s,o=o2(s);if(o===null)return;let a=await r.lookupTypeInfo({closest:o.base,outer:i.scope?[i.scope]:[]});if(!a||!a.isCallable())return;let l=o.arguments.findIndex(h=>{let f=h.start.character-1,g=h.end.character;return f<=e.position.character&&g>=e.position.character}),c={activeParameter:l===-1?0:l,signatures:[],activeSignature:0};return c.signatures.push(...(0,i2.createSignatureInfo)(a)),c})}bd.activate=a2});var QO=m(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.activate=void 0;var JO=bi();function u2(t){let e=r=>r.languageId!==JO.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===JO.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)}vd.activate=u2});var ZO=m((LK,l2)=>{l2.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 eC=m((NK,c2)=>{c2.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:
192
192
  miniscript: a string such as "1.5"
193
193
  buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
194
194
  host: a number for the host major and minor version, like 0.9
195
195
  hostName: name of the host application, e.g. "Mini Micro"
196
- hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var FA=g((TW,Uj)=>{Uj.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 $A=g((SW,Hj)=>{Hj.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 BA=g((kW,Wj)=>{Wj.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 UA=g((xW,Gj)=>{Gj.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 HA=g(hu=>{"use strict";var Mo=hu&&hu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hu,"__esModule",{value:!0});var Kj=Mo(qA()),Vj=Mo(jA()),zj=Mo(FA()),Xj=Mo($A()),Yj=Mo(BA()),Jj=Mo(UA()),Qj={any:Kj.default,general:Vj.default,list:zj.default,map:Xj.default,string:Jj.default,number:Yj.default};hu.default=Qj});var WA=g((EW,Zj)=>{Zj.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 GA=g((AW,eF)=>{eF.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 KA=g((OW,tF)=>{tF.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 VA=g((CW,nF)=>{nF.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 zA=g((RW,rF)=>{rF.exports={type:"number",definitions:{}}});var XA=g((PW,iF)=>{iF.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 YA=g((DW,sF)=>{sF.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var av=g(bn=>{"use strict";var Mi=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bn,"__esModule",{value:!0});bn.miniscriptMeta=void 0;var oF=Gn(),aF=Mi(HA()),uF=Mi(WA()),cF=Mi(GA()),lF=Mi(KA()),dF=Mi(VA()),fF=Mi(zA()),pF=Mi(XA()),hF=Mi(YA());bn.miniscriptMeta=new oF.Container;bn.miniscriptMeta.addTypeSignatureFromPayload(uF.default);bn.miniscriptMeta.addTypeSignatureFromPayload(cF.default);bn.miniscriptMeta.addTypeSignatureFromPayload(lF.default);bn.miniscriptMeta.addTypeSignatureFromPayload(dF.default);bn.miniscriptMeta.addTypeSignatureFromPayload(fF.default);bn.miniscriptMeta.addTypeSignatureFromPayload(pF.default);bn.miniscriptMeta.addTypeSignatureFromPayload(hF.default);bn.miniscriptMeta.addMetaFromPayload("en",aF.default)});var gu=g(uv=>{"use strict";Object.defineProperty(uv,"__esModule",{value:!0});var gF=av(),mF=nu();uv.default=new mF.TypeManager({container:gF.miniscriptMeta})});var QA=g(Lo=>{"use strict";var yF=Lo&&Lo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.activate=void 0;var bF=Oe(),vF=nu(),_F=db(),TF=yF(gu()),JA=(t,e)=>{let n=TF.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){if(s.node.type!==bF.ASTType.AssignmentStatement)continue;let o=s.node,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=a?.label??(0,vF.createExpressionId)(o.variable),c=a?.kind?(0,_F.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 SF(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?JA(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...JA(r,e.query));return n})}Lo.activate=SF});var yf=g(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.buildTokens=zn.semanticTokensLegend=zn.SemanticTokenModifier=zn.SemanticTokenType=void 0;var jt=Cr(),H=Oe(),kF=av(),ZA=(t,e)=>!!kF.miniscriptMeta.getDefinition(t,e),Z;(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"})(Z=zn.SemanticTokenType||(zn.SemanticTokenType={}));var cv;(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"})(cv=zn.SemanticTokenModifier||(zn.SemanticTokenModifier={}));zn.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 e1=t=>1<<t,lv=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,Z.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,Z.Parameter,0);else if(e){let o=ZA(["any"],i.value)?e1(cv.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Property,o)}else{let o=ZA(["general"],i.value)?e1(cv.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.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,Z.String,0);break}case H.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.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,Z.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(jt.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(jt.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureInjectExpression();if(jt.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}else if(jt.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);jt.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.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,Z.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,Z.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);jt.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);jt.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;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,Z.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr())}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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.Punctuator,0),H.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.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,Z.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);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),e.processExpr(),H.SelectorGroups.BlockEndOfLine(e.token)||e.processForShortcutStatement())}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,Z.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,Z.Keyword,0);break}case H.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(H.Selectors.Then);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),H.SelectorGroups.BlockEndOfLine(e.token)||e.processIfShortcutStatement())}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,Z.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,Z.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,Z.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,Z.String,0),this.next();return}let n="";for(;!jt.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),n=n+e.token.value,e.next();return e.consumeMany(jt.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(jt.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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 jt.GreybelKeyword.Include:case jt.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case jt.GreybelKeyword.Import:case jt.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case jt.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case jt.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case jt.GreybelKeyword.Debugger:e.next()}}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 xF(t,e){let n=new jt.Lexer(e.content,{unsafe:!0});return new lv(n,t).process(),t}zn.buildTokens=xF});var t1=g(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.activate=void 0;var wF=yf();function EF(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,wF.buildTokens)(i,r),i.build()})}bf.activate=EF});var n1=g(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.buildFoldingRanges=void 0;var Dr=Oe(),dv=Rh(),AF=wd();function OF(t){let e=[];return new AF.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Dr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:dv.FoldingRangeKind.Comment}),null;case Dr.ASTType.MapConstructorExpression:case Dr.ASTType.ListConstructorExpression:case Dr.ASTType.StringLiteral:case Dr.ASTType.WhileStatement:case Dr.ASTType.ForGenericStatement:case Dr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:dv.FoldingRangeKind.Region}),null;case Dr.ASTType.IfClause:case Dr.ASTType.ElseifClause:case Dr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:dv.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}vf.buildFoldingRanges=OF});var r1=g(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.activate=void 0;var CF=n1();function RF(t){t.connection.languages.foldingRange.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(0,CF.buildFoldingRanges)(r)})}_f.activate=RF});var kf=g((UW,a1)=>{var mu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,PF=typeof AbortController=="function",Tf=PF?AbortController:class{constructor(){this.signal=new i1}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})}},DF=typeof AbortSignal=="function",IF=typeof Tf.AbortSignal=="function",i1=DF?AbortSignal:IF?Tf.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))}},gv=new Set,fv=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Sf(n)&&mv(n,`${t} option`,`options.${e}`,qo)},pv=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Sf(n)){let{prototype:r}=qo,{get:i}=Object.getOwnPropertyDescriptor(r,t);mv(n,`${t} method`,`cache.${e}()`,i)}},MF=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Sf(n)){let{prototype:r}=qo,{get:i}=Object.getOwnPropertyDescriptor(r,t);mv(n,`${t} property`,`cache.${e}`,i)}},s1=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Sf=t=>!gv.has(t),mv=(t,e,n,r)=>{gv.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;s1(i,"DeprecationWarning",t,r)},Li=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),o1=t=>Li(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?No:null:null,No=class extends Array{constructor(e){super(e),this.fill(0)}},hv=class{constructor(e){if(e===0)return[];let n=o1(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},qo=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:b=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&&!Li(n))throw new TypeError("max option must be a nonnegative integer");let K=n?o1(n):Array;if(!K)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=b,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 hv(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&&!Li(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!Li(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=Li(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ce||0,this.ttl){if(!Li(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)&&(gv.add(A),s1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,t))}ye&&fv("stale","allowStale"),ce&&fv("maxAge","ttl"),V&&fv("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new No(this.max),this.starts=new No(this.max),this.setItemTTL=(r,i,s=mu.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?mu.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=mu.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 No(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(!Li(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!Li(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 pv("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=mu.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=mu.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 Tf;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(b,_=!1)=>{let{aborted:E}=o.signal,L=r.ignoreFetchAbort&&b!==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&&(b===void 0?p.__staleWhileFetching?this.valList[n]=p.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,b,a.options))),b)},c=b=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=b),l(b)),l=b=>{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 b},d=(b,_)=>{this.fetchMethod(e,s,a).then(E=>b(E),_),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(),r.allowStaleOnFetchAbort&&(b=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:b=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:b,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 pv("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 pv("reset","clear"),this.clear}get length(){return MF("length","size"),this.size}static get AbortController(){return Tf}static get AbortSignal(){return i1}};a1.exports=qo});var h1=g((HW,p1)=>{var _v=Object.defineProperty,LF=Object.getOwnPropertyDescriptor,NF=Object.getOwnPropertyNames,qF=Object.prototype.hasOwnProperty,jF=(t,e)=>{for(var n in e)_v(t,n,{get:e[n],enumerable:!0})},FF=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of NF(e))!qF.call(t,i)&&i!==n&&_v(t,i,{get:()=>e[i],enumerable:!(r=LF(e,i))||r.enumerable});return t},$F=t=>FF(_v({},"__esModule",{value:!0}),t),u1={};jF(u1,{ScheduleIntervalHelper:()=>yv,SchedulePostMessageHelper:()=>bv,ScheduleSetImmmediateHelper:()=>vv,schedule:()=>HF,scheduleProvider:()=>f1});p1.exports=$F(u1);var BF=Promise.prototype.then.bind(Promise.resolve()),Tv=class xf{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,xf.QUEUE_LIMIT);this.queue=this.queue.slice(xf.QUEUE_LIMIT);for(let r=0;r<n;BF(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=xf.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},yv=class c1 extends Tv{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new c1;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}},UF=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},bv=class l1 extends Tv{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!UF()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new l1;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}},vv=class d1 extends Tv{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new d1;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 f1(){if(vv.isApplicable())return vv.createCallback();if(bv.isApplicable())return bv.createCallback();if(yv.isApplicable())return yv.createCallback();throw new Error("No schedule helper fulfills requirements!")}var HF=f1()});var g1=g(On=>{"use strict";var xv=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 WF=xv(require("events")),GF=Cr(),KF=xv(kf()),Sv=h1(),jo=df(),VF=xv(gu()),wf=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."),jo.Utils.joinPath(this.rootPath,e).toString()):jo.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return jo.Utils.joinPath(this.rootPath,e).toString()}};On.DocumentURIBuilder=wf;var Ef=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 jo.Utils.joinPath(jo.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 wf(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(jo.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=Ef;On.PROCESSING_TIMEOUT=100;var kv=class extends WF.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 KF.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,Sv.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,Sv.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 GF.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),VF.default.analyze(e.uri,i),new Ef({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,Sv.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=kv});var m1=g(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.hash=void 0;function zF(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Af.hash=zF});var _1=g(Fo=>{"use strict";var v1=Fo&&Fo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.DocumentMerger=void 0;var XF=v1(kf()),y1=m1(),b1=v1(gu()),wv=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new XF.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,y1.hash)(`${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,y1.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.results.delete(n),this.keyToDocumentUriMap.delete(e))}async process(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=b1.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:b,textDocument:_}=p;if(!b)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=b1.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:b,textDocument:_}=p;if(!b)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}};Fo.DocumentMerger=wv});var k1=g($o=>{"use strict";var YF=$o&&$o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($o,"__esModule",{value:!0});$o.CoreContext=void 0;var JF=YF(require("events")),Ev=Ks(),T1=yf();function S1(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??Ev.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}}}}var Av=class extends JF.default{constructor(){super(),this._configuration=S1(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Ev.ConfigurationNamespace);this._configuration=S1(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,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Ev.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:T1.semanticTokensLegend.tokenTypes,tokenModifiers:T1.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()}};$o.CoreContext=Av});var Of=g(Q=>{"use strict";var QF=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]}),ZF=Q&&Q.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e$=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)&&QF(e,t,n);return ZF(e,t),e},t$=Q&&Q.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Q,"__esModule",{value:!0});Q.CoreContext=Q.buildTokens=Q.semanticTokensLegend=Q.lookupBase=Q.lookupIdentifier=Q.typeAnalyzer=Q.appendTooltipHeader=Q.appendTooltipBody=Q.formatTypes=Q.formatDefaultValue=Q.createTooltipHeader=Q.createSignatureInfo=Q.createHover=Q.MarkdownString=Q.LookupHelper=Q.DocumentMerger=Q.DocumentManager=Q.ActiveDocument=Q.ASTScraper=Q.activateFoldingRange=Q.activateSemantic=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 Ov=Ks();Object.defineProperty(Q,"IndentationType",{enumerable:!0,get:function(){return Ov.IndentationType}});Object.defineProperty(Q,"LanguageId",{enumerable:!0,get:function(){return Ov.LanguageId}});Object.defineProperty(Q,"ConfigurationNamespace",{enumerable:!0,get:function(){return Ov.ConfigurationNamespace}});var n$=$E();Object.defineProperty(Q,"activateAutocomplete",{enumerable:!0,get:function(){return n$.activate}});var r$=YE();Object.defineProperty(Q,"activateColor",{enumerable:!0,get:function(){return r$.activate}});var i$=JE();Object.defineProperty(Q,"activateDefinition",{enumerable:!0,get:function(){return i$.activate}});var s$=QE();Object.defineProperty(Q,"activateDiagnostic",{enumerable:!0,get:function(){return s$.activate}});var o$=EA();Object.defineProperty(Q,"activateFormatter",{enumerable:!0,get:function(){return o$.activate}});var a$=DA();Object.defineProperty(Q,"activateHover",{enumerable:!0,get:function(){return a$.activate}});var u$=MA();Object.defineProperty(Q,"activateSignature",{enumerable:!0,get:function(){return u$.activate}});var c$=NA();Object.defineProperty(Q,"activateSubscriptions",{enumerable:!0,get:function(){return c$.activate}});var l$=QA();Object.defineProperty(Q,"activateSymbol",{enumerable:!0,get:function(){return l$.activate}});var d$=t1();Object.defineProperty(Q,"activateSemantic",{enumerable:!0,get:function(){return d$.activate}});var f$=r1();Object.defineProperty(Q,"activateFoldingRange",{enumerable:!0,get:function(){return f$.activate}});Q.ASTScraper=e$(wd());var x1=g1();Object.defineProperty(Q,"ActiveDocument",{enumerable:!0,get:function(){return x1.ActiveDocument}});Object.defineProperty(Q,"DocumentManager",{enumerable:!0,get:function(){return x1.DocumentManager}});var p$=_1();Object.defineProperty(Q,"DocumentMerger",{enumerable:!0,get:function(){return p$.DocumentMerger}});var h$=To();Object.defineProperty(Q,"LookupHelper",{enumerable:!0,get:function(){return h$.LookupHelper}});var g$=pf();Object.defineProperty(Q,"MarkdownString",{enumerable:!0,get:function(){return g$.MarkdownString}});var bs=hf();Object.defineProperty(Q,"createHover",{enumerable:!0,get:function(){return bs.createHover}});Object.defineProperty(Q,"createSignatureInfo",{enumerable:!0,get:function(){return bs.createSignatureInfo}});Object.defineProperty(Q,"createTooltipHeader",{enumerable:!0,get:function(){return bs.createTooltipHeader}});Object.defineProperty(Q,"formatDefaultValue",{enumerable:!0,get:function(){return bs.formatDefaultValue}});Object.defineProperty(Q,"formatTypes",{enumerable:!0,get:function(){return bs.formatTypes}});Object.defineProperty(Q,"appendTooltipBody",{enumerable:!0,get:function(){return bs.appendTooltipBody}});Object.defineProperty(Q,"appendTooltipHeader",{enumerable:!0,get:function(){return bs.appendTooltipHeader}});var m$=gu();Object.defineProperty(Q,"typeAnalyzer",{enumerable:!0,get:function(){return t$(m$).default}});var w1=pb();Object.defineProperty(Q,"lookupIdentifier",{enumerable:!0,get:function(){return w1.lookupIdentifier}});Object.defineProperty(Q,"lookupBase",{enumerable:!0,get:function(){return w1.lookupBase}});var E1=yf();Object.defineProperty(Q,"semanticTokensLegend",{enumerable:!0,get:function(){return E1.semanticTokensLegend}});Object.defineProperty(Q,"buildTokens",{enumerable:!0,get:function(){return E1.buildTokens}});var y$=k1();Object.defineProperty(Q,"CoreContext",{enumerable:!0,get:function(){return y$.CoreContext}})});var R1={};B1(R1,{TextDocument:()=>Cv});function Rv(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Rv(r,e),Rv(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 A1(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);O1(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function O1(t){return t===13||t===10}function C1(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 b$(t){let e=C1(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Cf,Cv,P1=$1(()=>{"use strict";Cf=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=C1(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=A1(r.text,!1,s);if(u-a===l.length)for(let p=0,b=l.length;p<b;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,b=c.length;p<b;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=A1(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&&O1(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 Cf(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Cf)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=Rv(s.map(b$),(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})(Cv||(Cv={}))});var I1=g(Bo=>{"use strict";var Iv=Bo&&Bo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.FileSystem=void 0;var v$=Ph(),D1=(P1(),H1(R1)),_$=Iv(require("events")),Pv=df(),T$=Iv(require("fs")),S$=Of(),k$=Iv(kf()),Dv=class extends _$.default{constructor(e){super(),this._context=e,this._textDocumentManager=new v$.TextDocuments(D1.TextDocument),this._tempTextDocumentCache=new k$.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=>Pv.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=Pv.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await T$.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=D1.TextDocument.create(e,S$.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(Pv.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)})}};Bo.FileSystem=Dv});var M1=g(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.NodeContext=void 0;var Mv=Ph(),Lv=Of(),x$=I1(),Nv=class extends Lv.CoreContext{constructor(){super(),this.documentManager=new Lv.DocumentManager().setContext(this),this.documentMerger=new Lv.DocumentMerger,this.connection=(0,Mv.createConnection)(Mv.ProposedFeatures.all),this.fs=new x$.FileSystem(this)}createSemanticTokensBuilder(){return new Mv.SemanticTokensBuilder}};Rf.NodeContext=Nv});Object.defineProperty(exports,"__esModule",{value:!0});var w$=M1(),cr=Of(),L1=new w$.NodeContext;L1.on("ready",t=>{(0,cr.activateAutocomplete)(t),(0,cr.activateColor)(t),(0,cr.activateDefinition)(t),(0,cr.activateDiagnostic)(t),(0,cr.activateFormatter)(t),(0,cr.activateHover)(t),(0,cr.activateSignature)(t),(0,cr.activateSubscriptions)(t),(0,cr.activateSymbol)(t),(0,cr.activateSemantic)(t),(0,cr.activateFoldingRange)(t)});L1.listen();
196
+ hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var tC=m((qK,h2)=>{h2.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 nC=m((jK,f2)=>{f2.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 rC=m((FK,d2)=>{d2.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 sC=m(($K,p2)=>{p2.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 iC=m(Xu=>{"use strict";var ha=Xu&&Xu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xu,"__esModule",{value:!0});var g2=ha(ZO()),m2=ha(eC()),y2=ha(tC()),b2=ha(nC()),v2=ha(rC()),_2=ha(sC()),T2={any:g2.default,general:m2.default,list:y2.default,map:b2.default,string:_2.default,number:v2.default};Xu.default=T2});var oC=m((UK,S2)=>{S2.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 aC=m((WK,k2)=>{k2.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 uC=m((HK,w2)=>{w2.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 lC=m((GK,x2)=>{x2.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 cC=m((zK,E2)=>{E2.exports={type:"number",definitions:{}}});var hC=m((KK,A2)=>{A2.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 fC=m((VK,O2)=>{O2.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var z_=m(Rn=>{"use strict";var ni=Rn&&Rn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.miniscriptMeta=void 0;var C2=sr(),R2=ni(iC()),P2=ni(oC()),D2=ni(aC()),I2=ni(uC()),M2=ni(lC()),L2=ni(cC()),N2=ni(hC()),q2=ni(fC());Rn.miniscriptMeta=new C2.Container;Rn.miniscriptMeta.addTypeSignatureFromPayload(P2.default);Rn.miniscriptMeta.addTypeSignatureFromPayload(D2.default);Rn.miniscriptMeta.addTypeSignatureFromPayload(I2.default);Rn.miniscriptMeta.addTypeSignatureFromPayload(M2.default);Rn.miniscriptMeta.addTypeSignatureFromPayload(L2.default);Rn.miniscriptMeta.addTypeSignatureFromPayload(N2.default);Rn.miniscriptMeta.addTypeSignatureFromPayload(q2.default);Rn.miniscriptMeta.addMetaFromPayload("en",R2.default)});var Yu=m(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});var j2=z_(),F2=qu();K_.default=new F2.TypeManager({container:j2.miniscriptMeta})});var pC=m(fa=>{"use strict";var $2=fa&&fa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fa,"__esModule",{value:!0});fa.activate=void 0;var B2=Ce(),U2=qu(),W2=Yv(),H2=$2(Yu()),dC=(t,e)=>{let n=H2.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),s=[];for(let i of r){if(i.node.type!==B2.ASTType.AssignmentStatement)continue;let o=i.node,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=a?.label??(0,U2.createExpressionId)(o.variable),l=a?.kind?(0,W2.getSymbolItemKind)(a.kind):13,c={line:o.variable.start.line-1,character:o.variable.start.character-1},h={line:o.variable.end.line-1,character:o.variable.end.character-1};s.push({name:u,containerName:u,kind:l,location:{uri:t.uri,range:{start:c,end:h}}})}return s};function G2(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?dC(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...dC(r,e.query));return n})}fa.activate=G2});var _d=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.buildTokens=ar.semanticTokensLegend=ar.SemanticTokenModifier=ar.SemanticTokenType=void 0;var Wt=Vr(),W=Ce(),z2=z_(),gC=(t,e)=>!!z2.miniscriptMeta.getDefinition(t,e),Z;(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"})(Z=ar.SemanticTokenType||(ar.SemanticTokenType={}));var V_;(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"})(V_=ar.SemanticTokenModifier||(ar.SemanticTokenModifier={}));ar.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 mC=t=>1<<t,X_=class{constructor(e,n){this._lexer=e,this._builder=n,this._validator=new W.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(W.Selectors.Comment(e.token))this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length+2,Z.Comment,0);else if(!W.Selectors.EndOfLine(e.token))break;e.next()}}processIdentifier(e=!1,n=!1){let r=this,s=r.requireType(W.TokenType.Identifier);if(s)if(n)r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Parameter,0);else if(e){let o=gC(["any"],s.value)?mC(V_.DefaultLibrary):0;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Property,o)}else{let o=gC(["general"],s.value)?mC(V_.DefaultLibrary):0;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Variable,o)}}processLiteral(){let e=this.token;switch(e.type){case W.TokenType.StringLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.String,0);break}case W.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Number,0);break}case W.TokenType.BooleanLiteral:case W.TokenType.NilLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(Wt.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(Wt.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureInjectExpression();if(Wt.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}else if(Wt.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}if(r._validator.isLiteral(r.token.type))return r.processLiteral();if(r.isType(W.TokenType.Identifier))return r.processIdentifier()}processQuantity(e=!1,n=!1){let r=this;if(!W.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,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processExpr();let s=r.requireToken(W.Selectors.RParenthesis);s&&r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Punctuator,0)}processList(e=!1,n=!1){let r=this;if(!W.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,Z.Punctuator,0),r.next(),W.Selectors.SRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}if(r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processMap(e=!1,n=!1){let r=this;if(!W.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,Z.Punctuator,0),r.next(),W.Selectors.CRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}r.processExpr();let s=r.requireToken(W.Selectors.MapKeyValueSeperator);if(!s)return;if(r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Punctuator,0),r.skipNewlines(),r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processCallArgs(){let e=this;if(W.Selectors.LParenthesis(e.token))if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next(),W.Selectors.RParenthesis(e.token))e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next();else for(;!W.Selectors.EndOfFile(e.token);){e.skipNewlines(),e.processExpr(),e.skipNewlines();let n=e.requireTokenOfAny(W.SelectorGroups.CallArgsEnd);if(!n)return;if(W.Selectors.RParenthesis(n)){e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Punctuator,0);break}else if(!W.Selectors.ArgumentSeperator(n))break}}processCallExpr(e=!1,n=!1){let r=this;for(r.processMap(e,n);!W.Selectors.EndOfFile(r.token);)if(W.Selectors.MemberSeperator(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processIdentifier(!0);else if(W.Selectors.SLBracket(r.token)&&!r.token.afterSpace){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SliceSeperator(r.token)?(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()):(r.processExpr(),W.Selectors.SliceSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()));let s=r.requireToken(W.Selectors.SRBracket);if(!s)return;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Punctuator,0)}else if(W.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace))r.processCallArgs();else break}processPower(e=!1,n=!1){let r=this;r.processCallExpr(e,n),W.Selectors.Power(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processCallExpr())}processAddressOf(e=!1,n=!1){let r=this;if(!W.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,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processPower()}processNew(e=!1,n=!1){let r=this;if(!W.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,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNew()}processUnaryMinus(e=!1,n=!1){let r=this;if(!W.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,Z.Operator,0),r.next(),r.skipNewlines(),r.processNew()}processMultDiv(e=!1,n=!1){let r=this;for(r.processUnaryMinus(e,n);W.SelectorGroups.MultiDivOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);Wt.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processMultDiv()}processAddSub(e=!1,n=!1){let r=this;for(r.processBitwise(e,n);W.Selectors.Plus(r.token)||W.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,Z.Operator,0),r.next(),r.skipNewlines(),r.processBitwise()}processComparisons(e=!1,n=!1){let r=this;if(r.processAddSub(e,n),!!W.SelectorGroups.ComparisonOperators(r.token))do r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processAddSub();while(W.SelectorGroups.ComparisonOperators(r.token))}processBitwiseAnd(e=!1,n=!1){let r=this;for(r.processComparisons(e,n);Wt.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);Wt.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;r.processBitwiseOr(e,n),W.Selectors.Isa(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr())}processNot(e=!1,n=!1){let r=this;if(W.Selectors.Not(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.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);W.Selectors.And(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNot()}processOr(e=!1,n=!1){let r=this;for(r.processAnd(e,n);W.Selectors.Or(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processAnd()}processFunctionDeclaration(e=!1,n=!1){let r=this;if(!W.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,Z.Keyword,0),r.next(),!W.SelectorGroups.BlockEndOfLine(r.token)){let s=r.requireToken(W.Selectors.LParenthesis);if(!s)return;for(r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Punctuator,0);!W.SelectorGroups.FunctionDeclarationArgEnd(r.token)&&(r.processIdentifier(!1,!0),r.consume(W.Selectors.Assign)&&(r._builder.push(r.previousToken.start.line-1,r.previousToken.start.character-1,r.previousToken.value.length,Z.Operator,0),r.processExpr()),!W.Selectors.RParenthesis(r.token));){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);let o=r.requireToken(W.Selectors.ArgumentSeperator);if(!o)return;if(r._builder.push(o.start.line-1,o.start.character-1,o.value.length,Z.Punctuator,0),W.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);break}}let i=r.requireToken(W.Selectors.RParenthesis);if(!i)return;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}}processExpr(e=!1,n=!1){this.processFunctionDeclaration(e,n)}processForShortcutStatement(){this.processShortcutStatement()}processForStatement(){let e=this;e.processIdentifier();let n=e.requireToken(W.Selectors.In);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),e.processExpr(),W.SelectorGroups.BlockEndOfLine(e.token)||e.processForShortcutStatement())}processWhileShortcutStatement(){this.processShortcutStatement()}processWhileStatement(){let e=this;if(e.processExpr(),!W.SelectorGroups.BlockEndOfLine(e.token))return e.processWhileShortcutStatement()}processIfShortcutStatement(){let e=this;e.processShortcutStatement(),W.Selectors.Else(e.token)&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),e.next(),e.processShortcutStatement())}processNextIfClause(e){let n=this;switch(e){case W.ASTType.ElseifClause:{n.processExpr();let r=n.requireToken(W.Selectors.Then);if(!r)return;n._builder.push(r.start.line-1,r.start.character-1,r.value.length,Z.Keyword,0);break}case W.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(W.Selectors.Then);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),W.SelectorGroups.BlockEndOfLine(e.token)||e.processIfShortcutStatement())}processReturnStatement(){let e=this;W.SelectorGroups.ReturnStatementEnd(e.token)||e.processExpr()}processAssignment(){let e=this,n=e.token;if(e.processExpr(!0,!0),W.SelectorGroups.AssignmentEndOfExpr(e.token))return;if(W.Selectors.Assign(e.token)){e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}else if(W.SelectorGroups.AssignmentShorthand(e.token)){let s=e.token;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}let r=[];for(;!W.Selectors.EndOfFile(e.token)&&(e.processExpr(),!(W.SelectorGroups.BlockEndOfLine(e.token)||W.Selectors.Else(e.token)));){if(W.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let s=e.requireTokenOfAny(W.SelectorGroups.AssignmentCommandArgs);if(!s)return;if(W.Selectors.EndOfLine(s)||W.Selectors.EndOfFile(s))break}r.length}processShortcutStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.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,Z.Keyword,0),n){case W.Keyword.Return:e.next(),e.processReturnStatement();case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}default:}}return e.processAssignment()}processPathSegment(){let e=this;if(this.token.type===W.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,Z.String,0),this.next();return}let n="";for(;!Wt.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),n=n+e.token.value,e.next();return e.consumeMany(Wt.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(Wt.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Keyword,0),e.processPathSegment())}processFeatureIncludeStatement(){this.processPathSegment()}processNativeImportCodeStatement(){let e=this;if(e.consume(W.Selectors.LParenthesis)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),W.TokenType.StringLiteral===e.token.type){let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}else return;if(e.consume(W.Selectors.ImportCodeSeperator)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),!e.isType(W.TokenType.StringLiteral))return;let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}e.consume(W.Selectors.RParenthesis)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.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,Z.Keyword,0),n){case W.Keyword.Return:{e.next(),e.processReturnStatement();return}case W.Keyword.If:{e.next(),e.processIfStatement();return}case W.Keyword.ElseIf:{e.next(),e.processNextIfClause(W.ASTType.ElseifClause);return}case W.Keyword.Else:{e.next(),e.processNextIfClause(W.ASTType.ElseClause);return}case W.Keyword.While:{e.next(),e.processWhileStatement();return}case W.Keyword.For:{e.next(),e.processForStatement();return}case W.Keyword.EndFunction:{e.next();return}case W.Keyword.EndFor:{e.next();return}case W.Keyword.EndWhile:{e.next();return}case W.Keyword.EndIf:{e.next();return}case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}case Wt.GreybelKeyword.Include:case Wt.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case Wt.GreybelKeyword.Import:case Wt.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case Wt.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case Wt.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case Wt.GreybelKeyword.Debugger:e.next()}}processStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){e.processKeyword();return}e.processAssignment()}process(){let e=this;for(e.next();!W.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!W.Selectors.EndOfFile(e.token));)e.processStatement()}};function K2(t,e){let n=new Wt.Lexer(e.content,{unsafe:!0});return new X_(n,t).process(),t}ar.buildTokens=K2});var yC=m(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.activate=void 0;var V2=_d();function X2(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 s=t.createSemanticTokensBuilder();return(0,V2.buildTokens)(s,r),s.build()})}Td.activate=X2});var bC=m(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.buildFoldingRanges=void 0;var Jr=Ce(),Y_=gm(),Y2=Cf();function J2(t){let e=[];return new Y2.ScraperWalker((r,s)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Jr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Y_.FoldingRangeKind.Comment}),null;case Jr.ASTType.MapConstructorExpression:case Jr.ASTType.ListConstructorExpression:case Jr.ASTType.StringLiteral:case Jr.ASTType.WhileStatement:case Jr.ASTType.ForGenericStatement:case Jr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Y_.FoldingRangeKind.Region}),null;case Jr.ASTType.IfClause:case Jr.ASTType.ElseifClause:case Jr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:Y_.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}Sd.buildFoldingRanges=J2});var vC=m(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.activate=void 0;var Q2=bC();function Z2(t){t.connection.languages.foldingRange.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(0,Q2.buildFoldingRanges)(r)})}kd.activate=Z2});var Ed=m((sV,kC)=>{var Ju=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,eU=typeof AbortController=="function",wd=eU?AbortController:class{constructor(){this.signal=new _C}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})}},tU=typeof AbortSignal=="function",nU=typeof wd.AbortSignal=="function",_C=tU?AbortSignal:nU?wd.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))}},eT=new Set,J_=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;xd(n)&&tT(n,`${t} option`,`options.${e}`,pa)},Q_=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(xd(n)){let{prototype:r}=pa,{get:s}=Object.getOwnPropertyDescriptor(r,t);tT(n,`${t} method`,`cache.${e}()`,s)}},rU=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(xd(n)){let{prototype:r}=pa,{get:s}=Object.getOwnPropertyDescriptor(r,t);tT(n,`${t} property`,`cache.${e}`,s)}},TC=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},xd=t=>!eT.has(t),tT=(t,e,n,r)=>{eT.add(t);let s=`The ${e} is deprecated. Please use ${n} instead.`;TC(s,"DeprecationWarning",t,r)},ri=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),SC=t=>ri(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?da:null:null,da=class extends Array{constructor(e){super(e),this.fill(0)}},Z_=class{constructor(e){if(e===0)return[];let n=SC(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},pa=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,fetchContext:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e,{length:G,maxAge:se,stale:ue}=e instanceof t?{}:e;if(n!==0&&!ri(n))throw new TypeError("max option must be a nonnegative integer");let z=n?SC(n):Array;if(!z)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=b||G,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=O||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=A,!this.fetchMethod&&A!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new z(n),this.prev=new z(n),this.head=0,this.tail=0,this.free=new Z_(n),this.initialFill=1,this.size=0,typeof l=="function"&&(this.dispose=l),typeof c=="function"?(this.disposeAfter=c,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!ri(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!ri(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!ue,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ri(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=r||se||0,this.ttl){if(!ri(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 C="LRU_CACHE_UNBOUNDED";xd(C)&&(eT.add(C),TC("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,t))}ue&&J_("stale","allowStale"),se&&J_("maxAge","ttl"),G&&J_("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new da(this.max),this.starts=new da(this.max),this.setItemTTL=(r,s,i=Ju.now())=>{if(this.starts[r]=s!==0?i:0,this.ttls[r]=s,s!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},s+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Ju.now():0},this.statusTTL=(r,s)=>{r&&(r.ttl=this.ttls[s],r.start=this.starts[s],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Ju.now();if(this.ttlResolution>0){e=r;let s=setTimeout(()=>e=0,this.ttlResolution);s.unref&&s.unref()}return r};this.getRemainingTTL=r=>{let s=this.keyMap.get(r);return s===void 0?0:this.ttls[s]===0||this.starts[s]===0?1/0:this.starts[s]+this.ttls[s]-(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 da(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,s)=>{if(this.isBackgroundFetch(n))return 0;if(!ri(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(n,e),!ri(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 s=this.maxSize-this.sizes[e];for(;this.calculatedSize>s;)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,s){if(r||s)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 s=this.valList[r],i=this.isBackgroundFetch(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let s=this.valList[r],i=this.isBackgroundFetch(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(n,i,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let s=this.valList[r],i=this.isBackgroundFetch(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(n,i,this.keyList[r],this)}}get prune(){return Q_("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],s=this.valList[n],i=this.isBackgroundFetch(s)?s.__staleWhileFetching:s;if(i===void 0)continue;let o={value:i};if(this.ttls){o.ttl=this.ttls[n];let a=Ju.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let s=Date.now()-r.start;r.start=Ju.now()-s}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:s,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:l}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let c=this.size===0?void 0:this.keyMap.get(e);if(c===void 0)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=n,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,o,l),l&&(l.set="add"),u=!1;else{this.moveToTail(c);let h=this.valList[c];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):i||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(c),this.valList[c]=n,this.addItemSize(c,o,l),l){l.set="replace";let f=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(c,r,s),this.statusTTL(l,c),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],s=this.valList[n];return this.isBackgroundFetch(s)?s.__abortController.abort(new Error("evicted")):(this.dispose(s,r,"evict"),this.disposeAfter&&this.disposed.push([s,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 s=this.keyMap.get(e);if(s!==void 0)if(this.isStale(s))r&&(r.has="stale",this.statusTTL(r,s));else return n&&this.updateItemAge(s),r&&(r.has="hit"),this.statusTTL(r,s),!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 s=this.valList[r];return this.isBackgroundFetch(s)?s.__staleWhileFetching:s}}backgroundFetch(e,n,r,s){let i=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(i))return i;let o=new wd;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:s},u=(g,v=!1)=>{let{aborted:b}=o.signal,O=r.ignoreFetchAbort&&g!==void 0;return r.status&&(b&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,O&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!O&&!v?c(o.signal.reason):(this.valList[n]===f&&(g===void 0?f.__staleWhileFetching?this.valList[n]=f.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},l=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),c(g)),c=g=>{let{aborted:v}=o.signal,b=v&&r.allowStaleOnFetchAbort,O=b||r.allowStaleOnFetchRejection,A=O||r.noDeleteOnFetchRejection;if(this.valList[n]===f&&(!A||f.__staleWhileFetching===void 0?this.delete(e):b||(this.valList[n]=f.__staleWhileFetching)),O)return r.status&&f.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw g},h=(g,v)=>{this.fetchMethod(e,i,a).then(b=>g(b),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=b=>u(b,!0)))})};r.status&&(r.status.fetchDispatched=!0);let f=new Promise(h).then(u,l);return f.__abortController=o,f.__staleWhileFetching=i,f.__returned=null,n===void 0?(this.set(e,f,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=f,f}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:s=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:b=!1,status:O,signal:A}={}){if(!this.fetchMethod)return O&&(O.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:O});let k={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:i,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:f,status:O,signal:A},S=this.keyMap.get(e);if(S===void 0){O&&(O.fetch="miss");let _=this.backgroundFetch(e,S,k,v);return _.__returned=_}else{let _=this.valList[S];if(this.isBackgroundFetch(_)){let ue=n&&_.__staleWhileFetching!==void 0;return O&&(O.fetch="inflight",ue&&(O.returnedStale=!0)),ue?_.__staleWhileFetching:_.__returned=_}let N=this.isStale(S);if(!b&&!N)return O&&(O.fetch="hit"),this.moveToTail(S),r&&this.updateItemAge(S),this.statusTTL(O,S),_;let R=this.backgroundFetch(e,S,k,v),G=R.__staleWhileFetching!==void 0,se=G&&n;return O&&(O.fetch=G&&N?"stale":"refresh",se&&N&&(O.returnedStale=!0)),se?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:i}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(i,o),this.isStale(o)?(i&&(i.get="stale"),u?(i&&(i.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(s||this.delete(e),i&&(i.returnedStale=n),n?a:void 0)):(i&&(i.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else i&&(i.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 Q_("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 s=this.valList[r];this.isBackgroundFetch(s)?s.__abortController.abort(new Error("deleted")):(this.dispose(s,e,"delete"),this.disposeAfter&&this.disposed.push([s,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 Q_("reset","clear"),this.clear}get length(){return rU("length","size"),this.size}static get AbortController(){return wd}static get AbortSignal(){return _C}};kC.exports=pa});var RC=m((iV,CC)=>{var iT=Object.defineProperty,sU=Object.getOwnPropertyDescriptor,iU=Object.getOwnPropertyNames,oU=Object.prototype.hasOwnProperty,aU=(t,e)=>{for(var n in e)iT(t,n,{get:e[n],enumerable:!0})},uU=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of iU(e))!oU.call(t,s)&&s!==n&&iT(t,s,{get:()=>e[s],enumerable:!(r=sU(e,s))||r.enumerable});return t},lU=t=>uU(iT({},"__esModule",{value:!0}),t),wC={};aU(wC,{ScheduleIntervalHelper:()=>nT,SchedulePostMessageHelper:()=>rT,ScheduleSetImmmediateHelper:()=>sT,schedule:()=>fU,scheduleProvider:()=>OC});CC.exports=lU(wC);var cU=Promise.prototype.then.bind(Promise.resolve()),oT=class Ad{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,Ad.QUEUE_LIMIT);this.queue=this.queue.slice(Ad.QUEUE_LIMIT);for(let r=0;r<n;cU(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Ad.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},nT=class xC extends oT{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new xC;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}},hU=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},rT=class EC extends oT{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!hU()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new EC;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}},sT=class AC extends oT{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new AC;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 OC(){if(sT.isApplicable())return sT.createCallback();if(rT.isApplicable())return rT.createCallback();if(nT.isApplicable())return nT.createCallback();throw new Error("No schedule helper fulfills requirements!")}var fU=OC()});var PC=m($n=>{"use strict";var lT=$n&&$n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($n,"__esModule",{value:!0});$n.DocumentManager=$n.PROCESSING_TIMEOUT=$n.ActiveDocument=$n.DocumentURIBuilder=void 0;var dU=lT(require("events")),pU=Vr(),gU=lT(Ed()),aT=RC(),ga=pd(),mU=lT(Yu()),Od=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."),ga.Utils.joinPath(this.rootPath,e).toString()):ga.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return ga.Utils.joinPath(this.rootPath,e).toString()}};$n.DocumentURIBuilder=Od;var Cd=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 ga.Utils.joinPath(ga.URI.parse(this.textDocument.uri),"..")}async getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),s=this.documentManager.context,i=new Od(r,e),o=u=>u.startsWith("/")?s.fs.findExistingPath(i.getFromWorkspaceFolder(u),i.getFromWorkspaceFolder(`${u}.src`)):s.fs.findExistingPath(i.getFromRootPath(u),i.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(ga.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]),s=async i=>{let o=await i.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 s(u))}};return await s(this),Array.from(n)}};$n.ActiveDocument=Cd;$n.PROCESSING_TIMEOUT=100;var uT=class extends dU.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=$n.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new gU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,aT.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 s=n[r];e-s.createdAt>this.processingTimeout&&(0,aT.schedule)(()=>this.refresh(s.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 pU.Parser(n,{unsafe:!0}),s=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),mU.default.analyze(e.uri,s),new Cd({documentManager:this,content:n,textDocument:e,document:s,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,aT.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let s=()=>{this.removeListener("parsed",i),r(this.get(e))},i=a=>{a.uri===e.uri&&(this.removeListener("parsed",i),clearTimeout(o),r(this.get(e)))},o=setTimeout(s,n);this.addListener("parsed",i)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};$n.DocumentManager=uT});var IC=m((aV,cT)=>{cT.exports=function(t){return DC(yU(t),t)};cT.exports.array=DC;function DC(t,e){var n=t.length,r=new Array(n),s={},i=n,o=bU(e),a=vU(t);for(e.forEach(function(l){if(!a.has(l[0])||!a.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)s[i]||u(t[i],i,new Set);return r;function u(l,c,h){if(h.has(l)){var f;try{f=", node was:"+JSON.stringify(l)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!s[c]){s[c]=!0;var g=o.get(l)||new Set;if(g=Array.from(g),c=g.length){h.add(l);do{var v=g[--c];u(v,a.get(v),h)}while(c);h.delete(l)}r[--n]=l}}}function yU(t){for(var e=new Set,n=0,r=t.length;n<r;n++){var s=t[n];e.add(s[0]),e.add(s[1])}return Array.from(e)}function bU(t){for(var e=new Map,n=0,r=t.length;n<r;n++){var s=t[n];e.has(s[0])||e.set(s[0],new Set),e.has(s[1])||e.set(s[1],new Set),e.get(s[0]).add(s[1])}return e}function vU(t){for(var e=new Map,n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}});var MC=m(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.hash=void 0;function _U(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Rd.hash=_U});var NC=m(ma=>{"use strict";var fT=ma&&ma.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ma,"__esModule",{value:!0});ma.DocumentMerger=void 0;var TU=fT(Ed()),SU=fT(IC()),kU=bi(),LC=MC(),Pd=fT(Yu()),hT=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new TU.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,LC.hash)(`main-${e.uri}-${e.version}`);for(let s=0;s<n.length;s++){let i=n[s];r^=(0,LC.hash)(`${i.textDocument.uri}-${i.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let s=e.uri;if(r.has(s))return r.get(s);let i=Pd.default.get(s);if(r.set(s,null),!i)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,s);let l=await n.documentManager.get(e).getDependencies();await Promise.all(l.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,r);b!==null&&o.push(b)}));let c=i.merge(...o);return r.set(s,c),this.results.set(u,c),c}async buildByDependencies(e,n){let r=e.uri,s=Pd.default.get(r);if(!s)return null;let i=[],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(),l=new Map([[r,null]]);await Promise.all(u.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,l);b!==null&&i.push(b)}));let c=s.merge(...i);return this.results.set(a,c),c}async buildByWorkspace(e,n){let r=e.uri,s=Pd.default.get(r);if(!s)return null;let i=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let l=a.map(g=>g.textDocument.uri),c=await Promise.all(a.map(async g=>(await g.getDependencies()).map(b=>[g.textDocument.uri,b]))),h=SU.default.array(l,c.flat());for(let g=h.length-1;g>=0;g--){let v=h[g];if(v===r)continue;let b=Pd.default.get(v);if(b===null)return;i.push(b)}let f=s.merge(...i);return this.results.set(u,f),f}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===kU.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};ma.DocumentMerger=hT});var FC=m(ya=>{"use strict";var wU=ya&&ya.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ya,"__esModule",{value:!0});ya.CoreContext=void 0;var xU=wU(require("events")),Qu=bi(),qC=_d();function jC(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):Qu.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??Qu.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??Qu.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var dT=class extends xU.default{constructor(){super(),this._configuration=jC(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Qu.ConfigurationNamespace),n=jC(e),r=n.typeAnalyzer,s=this._configuration.typeAnalyzer;(r.strategy!==s.strategy||r.exclude!==s.exclude)&&this.documentMerger.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Qu.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:qC.semanticTokensLegend.tokenTypes,tokenModifiers:qC.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()}};ya.CoreContext=dT});var Dd=m(X=>{"use strict";var EU=X&&X.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),AU=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OU=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&EU(e,t,n);return AU(e,t),e},CU=X&&X.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(X,"__esModule",{value:!0});X.CoreContext=X.buildTokens=X.semanticTokensLegend=X.lookupBase=X.lookupIdentifier=X.typeAnalyzer=X.appendTooltipHeader=X.appendTooltipBody=X.formatTypes=X.formatDefaultValue=X.createTooltipHeader=X.createSignatureInfo=X.createHover=X.MarkdownString=X.LookupHelper=X.DocumentMerger=X.DocumentManager=X.ActiveDocument=X.ASTScraper=X.activateFoldingRange=X.activateSemantic=X.activateSymbol=X.activateSubscriptions=X.activateSignature=X.activateHover=X.activateFormatter=X.activateDiagnostic=X.activateDefinition=X.activateColor=X.activateAutocomplete=X.DefaultFileExtensions=X.TypeAnalyzerStrategy=X.ConfigurationNamespace=X.LanguageId=X.IndentationType=void 0;var Zu=bi();Object.defineProperty(X,"IndentationType",{enumerable:!0,get:function(){return Zu.IndentationType}});Object.defineProperty(X,"LanguageId",{enumerable:!0,get:function(){return Zu.LanguageId}});Object.defineProperty(X,"ConfigurationNamespace",{enumerable:!0,get:function(){return Zu.ConfigurationNamespace}});Object.defineProperty(X,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return Zu.TypeAnalyzerStrategy}});Object.defineProperty(X,"DefaultFileExtensions",{enumerable:!0,get:function(){return Zu.DefaultFileExtensions}});var RU=nO();Object.defineProperty(X,"activateAutocomplete",{enumerable:!0,get:function(){return RU.activate}});var PU=fO();Object.defineProperty(X,"activateColor",{enumerable:!0,get:function(){return PU.activate}});var DU=dO();Object.defineProperty(X,"activateDefinition",{enumerable:!0,get:function(){return DU.activate}});var IU=pO();Object.defineProperty(X,"activateDiagnostic",{enumerable:!0,get:function(){return IU.activate}});var MU=UO();Object.defineProperty(X,"activateFormatter",{enumerable:!0,get:function(){return MU.activate}});var LU=VO();Object.defineProperty(X,"activateHover",{enumerable:!0,get:function(){return LU.activate}});var NU=YO();Object.defineProperty(X,"activateSignature",{enumerable:!0,get:function(){return NU.activate}});var qU=QO();Object.defineProperty(X,"activateSubscriptions",{enumerable:!0,get:function(){return qU.activate}});var jU=pC();Object.defineProperty(X,"activateSymbol",{enumerable:!0,get:function(){return jU.activate}});var FU=yC();Object.defineProperty(X,"activateSemantic",{enumerable:!0,get:function(){return FU.activate}});var $U=vC();Object.defineProperty(X,"activateFoldingRange",{enumerable:!0,get:function(){return $U.activate}});X.ASTScraper=OU(Cf());var $C=PC();Object.defineProperty(X,"ActiveDocument",{enumerable:!0,get:function(){return $C.ActiveDocument}});Object.defineProperty(X,"DocumentManager",{enumerable:!0,get:function(){return $C.DocumentManager}});var BU=NC();Object.defineProperty(X,"DocumentMerger",{enumerable:!0,get:function(){return BU.DocumentMerger}});var UU=Qo();Object.defineProperty(X,"LookupHelper",{enumerable:!0,get:function(){return UU.LookupHelper}});var WU=md();Object.defineProperty(X,"MarkdownString",{enumerable:!0,get:function(){return WU.MarkdownString}});var Gi=yd();Object.defineProperty(X,"createHover",{enumerable:!0,get:function(){return Gi.createHover}});Object.defineProperty(X,"createSignatureInfo",{enumerable:!0,get:function(){return Gi.createSignatureInfo}});Object.defineProperty(X,"createTooltipHeader",{enumerable:!0,get:function(){return Gi.createTooltipHeader}});Object.defineProperty(X,"formatDefaultValue",{enumerable:!0,get:function(){return Gi.formatDefaultValue}});Object.defineProperty(X,"formatTypes",{enumerable:!0,get:function(){return Gi.formatTypes}});Object.defineProperty(X,"appendTooltipBody",{enumerable:!0,get:function(){return Gi.appendTooltipBody}});Object.defineProperty(X,"appendTooltipHeader",{enumerable:!0,get:function(){return Gi.appendTooltipHeader}});var HU=Yu();Object.defineProperty(X,"typeAnalyzer",{enumerable:!0,get:function(){return CU(HU).default}});var BC=Qv();Object.defineProperty(X,"lookupIdentifier",{enumerable:!0,get:function(){return BC.lookupIdentifier}});Object.defineProperty(X,"lookupBase",{enumerable:!0,get:function(){return BC.lookupBase}});var UC=_d();Object.defineProperty(X,"semanticTokensLegend",{enumerable:!0,get:function(){return UC.semanticTokensLegend}});Object.defineProperty(X,"buildTokens",{enumerable:!0,get:function(){return UC.buildTokens}});var GU=FC();Object.defineProperty(X,"CoreContext",{enumerable:!0,get:function(){return GU.CoreContext}})});var zC={};lP(zC,{TextDocument:()=>pT});function gT(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),s=t.slice(n);gT(r,e),gT(s,e);let i=0,o=0,a=0;for(;i<r.length&&o<s.length;)e(r[i],s[o])<=0?t[a++]=r[i++]:t[a++]=s[o++];for(;i<r.length;)t[a++]=r[i++];for(;o<s.length;)t[a++]=s[o++];return t}function WC(t,e,n=0){let r=e?[n]:[];for(let s=0;s<t.length;s++){let i=t.charCodeAt(s);HC(i)&&(i===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,r.push(n+s+1))}return r}function HC(t){return t===13||t===10}function GC(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 zU(t){let e=GC(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Id,pT,KC=uP(()=>{"use strict";Id=class t{constructor(e,n,r,s){this._uri=e,this._languageId=n,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let 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 s=GC(r.range),i=this.offsetAt(s.start),o=this.offsetAt(s.end);this._content=this._content.substring(0,i)+r.text+this._content.substring(o,this._content.length);let a=Math.max(s.start.line,0),u=Math.max(s.end.line,0),l=this._lineOffsets,c=WC(r.text,!1,i);if(u-a===c.length)for(let f=0,g=c.length;f<g;f++)l[f+a+1]=c[f];else c.length<1e4?l.splice(a+1,u-a,...c):this._lineOffsets=l=l.slice(0,a+1).concat(c,l.slice(u+1));let h=r.text.length-(o-i);if(h!==0)for(let f=a+1+c.length,g=l.length;f<g;f++)l[f]=l[f]+h}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=WC(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,s=n.length;if(s===0)return{line:0,character:e};for(;r<s;){let o=Math.floor((r+s)/2);n[o]>e?s=o:r=o+1}let i=r-1;return e=this.ensureBeforeEOL(e,n[i]),{line:i,character:e-n[i]}}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 s=e.line+1<n.length?n[e.line+1]:this._content.length,i=Math.min(r+e.character,s);return this.ensureBeforeEOL(i,r)}ensureBeforeEOL(e,n){for(;e>n&&HC(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(s,i,o,a){return new Id(s,i,o,a)}t.create=e;function n(s,i,o){if(s instanceof Id)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(s,i){let o=s.getText(),a=gT(i.map(zU),(c,h)=>{let f=c.range.start.line-h.range.start.line;return f===0?c.range.start.character-h.range.start.character:f}),u=0,l=[];for(let c of a){let h=s.offsetAt(c.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&l.push(o.substring(u,h)),c.newText.length&&l.push(c.newText),u=s.offsetAt(c.range.end)}return l.push(o.substr(u)),l.join("")}t.applyEdits=r})(pT||(pT={}))});var QC=m((fV,JC)=>{"use strict";JC.exports=XC;function XC(t,e,n){t instanceof RegExp&&(t=VC(t,n)),e instanceof RegExp&&(e=VC(e,n));var r=YC(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function VC(t,e){var n=e.match(t);return n?n[0]:null}XC.range=YC;function YC(t,e,n){var r,s,i,o,a,u=n.indexOf(t),l=n.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(r=[],i=n.length;c>=0&&!a;)c==u?(r.push(c),u=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),l]:(s=r.pop(),s<i&&(i=s,o=l),l=n.indexOf(e,c+1)),c=u<l&&u>=0?u:l;r.length&&(a=[i,o])}return a}});var oR=m((dV,iR)=>{var ZC=QC();iR.exports=XU;var eR="\0SLASH"+Math.random()+"\0",tR="\0OPEN"+Math.random()+"\0",yT="\0CLOSE"+Math.random()+"\0",nR="\0COMMA"+Math.random()+"\0",rR="\0PERIOD"+Math.random()+"\0";function mT(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function KU(t){return t.split("\\\\").join(eR).split("\\{").join(tR).split("\\}").join(yT).split("\\,").join(nR).split("\\.").join(rR)}function VU(t){return t.split(eR).join("\\").split(tR).join("{").split(yT).join("}").split(nR).join(",").split(rR).join(".")}function sR(t){if(!t)return[""];var e=[],n=ZC("{","}",t);if(!n)return t.split(",");var r=n.pre,s=n.body,i=n.post,o=r.split(",");o[o.length-1]+="{"+s+"}";var a=sR(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function XU(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),el(KU(t),!0).map(VU)):[]}function YU(t){return"{"+t+"}"}function JU(t){return/^-?0\d/.test(t)}function QU(t,e){return t<=e}function ZU(t,e){return t>=e}function el(t,e){var n=[],r=ZC("{","}",t);if(!r)return[t];var s=r.pre,i=r.post.length?el(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<i.length;o++){var a=s+"{"+r.body+"}"+i[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),c=u||l,h=r.body.indexOf(",")>=0;if(!c&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+yT+r.post,el(t)):[t];var f;if(c)f=r.body.split(/\.\./);else if(f=sR(r.body),f.length===1&&(f=el(f[0],!1).map(YU),f.length===1))return i.map(function(z){return r.pre+f[0]+z});var g;if(c){var v=mT(f[0]),b=mT(f[1]),O=Math.max(f[0].length,f[1].length),A=f.length==3?Math.abs(mT(f[2])):1,k=QU,S=b<v;S&&(A*=-1,k=ZU);var _=f.some(JU);g=[];for(var N=v;k(N,b);N+=A){var R;if(l)R=String.fromCharCode(N),R==="\\"&&(R="");else if(R=String(N),_){var G=O-R.length;if(G>0){var se=new Array(G+1).join("0");N<0?R="-"+se+R.slice(1):R=se+R}}g.push(R)}}else{g=[];for(var ue=0;ue<f.length;ue++)g.push.apply(g,el(f[ue],!1))}for(var ue=0;ue<g.length;ue++)for(var o=0;o<i.length;o++){var a=s+g[ue]+i[o];(!e||c||a)&&n.push(a)}}return n}});var aR=m(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.assertValidPattern=void 0;var eW=1024*64,tW=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>eW)throw new TypeError("pattern is too long")};Md.assertValidPattern=tW});var lR=m(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.parseClass=void 0;var nW={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},tl=t=>t.replace(/[[\]\\-]/g,"\\$&"),rW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),uR=t=>t.join(""),sW=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],s=[],i=n+1,o=!1,a=!1,u=!1,l=!1,c=n,h="";e:for(;i<t.length;){let b=t.charAt(i);if((b==="!"||b==="^")&&i===n+1){l=!0,i++;continue}if(b==="]"&&o&&!u){c=i+1;break}if(o=!0,b==="\\"&&!u){u=!0,i++;continue}if(b==="["&&!u){for(let[O,[A,k,S]]of Object.entries(nW))if(t.startsWith(O,i)){if(h)return["$.",!1,t.length-n,!0];i+=O.length,S?s.push(A):r.push(A),a=a||k;continue e}}if(u=!1,h){b>h?r.push(tl(h)+"-"+tl(b)):b===h&&r.push(tl(b)),h="",i++;continue}if(t.startsWith("-]",i+1)){r.push(tl(b+"-")),i+=2;continue}if(t.startsWith("-",i+1)){h=b,i+=2;continue}r.push(tl(b)),i++}if(c<i)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,t.length-n,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let b=r[0].length===2?r[0].slice(-1):r[0];return[rW(b),!1,c-n,!1]}let f="["+(l?"^":"")+uR(r)+"]",g="["+(l?"":"^")+uR(s)+"]";return[r.length&&s.length?"("+f+"|"+g+")":r.length?f:g,a,c-n,!0]};Ld.parseClass=sW});var qd=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.unescape=void 0;var iW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Nd.unescape=iW});var _T=m($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.AST=void 0;var oW=lR(),jd=qd(),aW=new Set(["!","?","+","*","@"]),cR=t=>aW.has(t),uW="(?!(?:^|/)\\.\\.?(?:$|/))",Fd="(?!\\.)",lW=new Set(["[","."]),cW=new Set(["..","."]),hW=new Set("().*{}+?[]^$\\!"),fW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),vT="[^/]",hR=vT+"*?",fR=vT+"+?",bT=class t{type;#e;#t;#i=!1;#r=[];#o;#_;#l;#h=!1;#a;#u;#s=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#h&&this.#l.push(this),this.#_=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let s=n.#_+1;!r.type&&s<r.#r.length;s++)for(let i of e.#r){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#r[s])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#_===0)return!0;let e=this.#o;for(let n=0;n<this.#_;n++){let r=e.#r[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#r.length:0;return this.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#r)n.copyIn(r);return n}static#y(e,n,r,s){let i=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,v="";for(;g<e.length;){let b=e.charAt(g++);if(i||b==="\\"){i=!i,v+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(u=!0):b==="]"&&!(g===a+2&&u)&&(o=!1),v+=b;continue}else if(b==="["){o=!0,a=g,u=!1,v+=b;continue}if(!s.noext&&cR(b)&&e.charAt(g)==="("){n.push(v),v="";let O=new t(b,n);g=t.#y(e,O,g,s),n.push(O);continue}v+=b}return n.push(v),g}let l=r+1,c=new t(null,n),h=[],f="";for(;l<e.length;){let g=e.charAt(l++);if(i||g==="\\"){i=!i,f+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(l===a+2&&u)&&(o=!1),f+=g;continue}else if(g==="["){o=!0,a=l,u=!1,f+=g;continue}if(cR(g)&&e.charAt(l)==="("){c.push(f),f="";let v=new t(g,c);c.push(v),l=t.#y(e,v,l,s);continue}if(g==="|"){c.push(f),f="",h.push(c),c=new t(null,n);continue}if(g===")")return f===""&&n.#r.length===0&&(n.#s=!0),c.push(f),f="",n.push(...h,c),l;f+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,s,i]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#m(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(g=>{let[v,b,O,A]=typeof g=="string"?t.#f(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||O,this.#i=this.#i||A,v}).join(""),c="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&cW.has(this.#r[0]))){let v=lW,b=n&&v.has(l.charAt(0))||l.startsWith("\\.")&&v.has(l.charAt(2))||l.startsWith("\\.\\.")&&v.has(l.charAt(4)),O=!n&&!e&&v.has(l.charAt(0));c=b?uW:O?Fd:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[c+l+h,(0,jd.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#d(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,jd.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Fd?"":this.#d(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!n?Fd:"")+fR;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Fd:"")+hR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+u}return[a,(0,jd.unescape)(i),this.#t=!!this.#t,this.#i]}#d(e){return this.#r.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,s,i,o]=n.toRegExpSource(e);return this.#i=this.#i||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#f(e,n,r=!1){let s=!1,i="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(s){s=!1,i+=(hW.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(u==="["){let[l,c,h,f]=(0,oW.parseClass)(e,a);if(h){i+=l,o=o||c,a+=h-1,n=n||f;continue}}if(u==="*"){r&&e==="*"?i+=fR:i+=hR,n=!0;continue}if(u==="?"){i+=vT,n=!0;continue}i+=fW(u)}return[i,(0,jd.unescape)(e),!!n,o]}};$d.AST=bT});var TT=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.escape=void 0;var dW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");Bd.escape=dW});var si=m(re=>{"use strict";var pW=re&&re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.unescape=re.escape=re.AST=re.Minimatch=re.match=re.makeRe=re.braceExpand=re.defaults=re.filter=re.GLOBSTAR=re.sep=re.minimatch=void 0;var gW=pW(oR()),Ud=aR(),gR=_T(),mW=TT(),yW=qd(),bW=(t,e,n={})=>((0,Ud.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new zi(e,n).match(t));re.minimatch=bW;var vW=/^\*+([^+@!?\*\[\(]*)$/,_W=t=>e=>!e.startsWith(".")&&e.endsWith(t),TW=t=>e=>e.endsWith(t),SW=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),kW=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),wW=/^\*+\.\*+$/,xW=t=>!t.startsWith(".")&&t.includes("."),EW=t=>t!=="."&&t!==".."&&t.includes("."),AW=/^\.\*+$/,OW=t=>t!=="."&&t!==".."&&t.startsWith("."),CW=/^\*+$/,RW=t=>t.length!==0&&!t.startsWith("."),PW=t=>t.length!==0&&t!=="."&&t!=="..",DW=/^\?+([^+@!?\*\[\(]*)?$/,IW=([t,e=""])=>{let n=mR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},MW=([t,e=""])=>{let n=yR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},LW=([t,e=""])=>{let n=yR([t]);return e?r=>n(r)&&r.endsWith(e):n},NW=([t,e=""])=>{let n=mR([t]);return e?r=>n(r)&&r.endsWith(e):n},mR=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},yR=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},bR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",dR={win32:{sep:"\\"},posix:{sep:"/"}};re.sep=bR==="win32"?dR.win32.sep:dR.posix.sep;re.minimatch.sep=re.sep;re.GLOBSTAR=Symbol("globstar **");re.minimatch.GLOBSTAR=re.GLOBSTAR;var qW="[^/]",jW=qW+"*?",FW="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",$W="(?:(?!(?:\\/|^)\\.).)*?",BW=(t,e={})=>n=>(0,re.minimatch)(n,t,e);re.filter=BW;re.minimatch.filter=re.filter;var ur=(t,e={})=>Object.assign({},t,e),UW=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return re.minimatch;let e=re.minimatch;return Object.assign((r,s,i={})=>e(r,s,ur(t,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,ur(t,i))}static defaults(s){return e.defaults(ur(t,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,ur(t,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,ur(t,i))}},unescape:(r,s={})=>e.unescape(r,ur(t,s)),escape:(r,s={})=>e.escape(r,ur(t,s)),filter:(r,s={})=>e.filter(r,ur(t,s)),defaults:r=>e.defaults(ur(t,r)),makeRe:(r,s={})=>e.makeRe(r,ur(t,s)),braceExpand:(r,s={})=>e.braceExpand(r,ur(t,s)),match:(r,s,i={})=>e.match(r,s,ur(t,i)),sep:e.sep,GLOBSTAR:re.GLOBSTAR})};re.defaults=UW;re.minimatch.defaults=re.defaults;var WW=(t,e={})=>((0,Ud.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,gW.default)(t));re.braceExpand=WW;re.minimatch.braceExpand=re.braceExpand;var HW=(t,e={})=>new zi(t,e).makeRe();re.makeRe=HW;re.minimatch.makeRe=re.makeRe;var GW=(t,e,n={})=>{let r=new zi(e,n);return t=t.filter(s=>r.match(s)),r.options.nonull&&!t.length&&t.push(e),t};re.match=GW;re.minimatch.match=re.match;var pR=/[?*]|[+@!]\(.*?\)|\[|\]/,zW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),zi=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Ud.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||bR,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=i[0]===""&&i[1]===""&&(i[2]==="?"||!pR.test(i[2]))&&!pR.test(i[3]),l=/^[a-z]:/i.test(i[0]);if(u)return[...i.slice(0,4),...i.slice(4).map(c=>this.parse(c))];if(l)return[i[0],...i.slice(1).map(c=>this.parse(c))]}return i.map(u=>this.parse(u))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let s=r;for(;n[s+1]==="**";)s++;s!==r&&n.splice(r,s-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,s)=>{let i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let i=e[s];s===1&&i===""&&e[0]===""||(i==="."||i==="")&&(n=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let o=s;for(;r[o+1]==="**";)o++;o>s&&r.splice(s+1,o-s);let a=r[s+1],u=r[s+2],l=r[s+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(s,1);let c=r.slice(0);c[s]="**",e.push(c),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let o=r[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...u),r.length===0&&r.push(""),i-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let s=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(s){e[n]=[],e[r]=s;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let s=0,i=0,o=[],a="";for(;s<e.length&&i<n.length;)if(e[s]===n[i])o.push(a==="b"?n[i]:e[s]),s++,i++;else if(r&&e[s]==="**"&&n[i]===e[s+1])o.push(e[s]),s++;else if(r&&n[i]==="**"&&e[s]===n[i+1])o.push(n[i]),i++;else if(e[s]==="*"&&n[i]&&(this.options.dot||!n[i].startsWith("."))&&n[i]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,i++}else if(n[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(n[i]),s++,i++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let s=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),O=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),S=O?3:b?0:void 0,_=k?3:A?0:void 0;if(typeof S=="number"&&typeof _=="number"){let[N,R]=[e[S],n[_]];N.toLowerCase()===R.toLowerCase()&&(n[_]=N,_>S?n=n.slice(_):S>_&&(e=e.slice(S)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,u=e.length,l=n.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=n[a],h=e[o];if(this.debug(n,c,h),c===!1)return!1;if(c===re.GLOBSTAR){this.debug("GLOBSTAR",[n,c,h]);var f=o,g=a+1;if(g===l){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<u;){var v=e[f];if(this.debug(`
197
+ globstar while`,e,f,n,g,v),this.matchOne(e.slice(f),n.slice(g),r))return this.debug("globstar found match!",f,u,v),!0;if(v==="."||v===".."||!s.dot&&v.charAt(0)==="."){this.debug("dot detected!",e,f,n,g);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
198
+ >>> no match, partial?`,e,f,n,g),f===u))}let b;if(typeof c=="string"?(b=h===c,this.debug("string match",c,h,b)):(b=c.test(h),this.debug("pattern match",c,h,b)),!b)return!1}if(o===u&&a===l)return!0;if(o===u)return r;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,re.braceExpand)(this.pattern,this.options)}parse(e){(0,Ud.assertValidPattern)(e);let n=this.options;if(e==="**")return re.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(CW))?s=n.dot?PW:RW:(r=e.match(vW))?s=(n.nocase?n.dot?kW:SW:n.dot?TW:_W)(r[1]):(r=e.match(DW))?s=(n.nocase?n.dot?MW:IW:n.dot?LW:NW)(r):(r=e.match(wW))?s=n.dot?EW:xW:(r=e.match(AW))&&(s=OW);let i=gR.AST.fromGlob(e,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?jW:n.dot?FW:$W,s=new Set(n.nocase?["i"]:[]),i=e.map(u=>{let l=u.map(c=>{if(c instanceof RegExp)for(let h of c.flags.split(""))s.add(h);return typeof c=="string"?zW(c):c===re.GLOBSTAR?re.GLOBSTAR:c._src});return l.forEach((c,h)=>{let f=l[h+1],g=l[h-1];c!==re.GLOBSTAR||g===re.GLOBSTAR||(g===void 0?f!==void 0&&f!==re.GLOBSTAR?l[h+1]="(?:\\/|"+r+"\\/)?"+f:l[h]=r:f===void 0?l[h-1]=g+"(?:\\/|"+r+")?":f!==re.GLOBSTAR&&(l[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+f,l[h+1]=re.GLOBSTAR))}),l.filter(c=>c!==re.GLOBSTAR).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let i=this.set;this.debug(this.pattern,"set",i);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<i.length;a++){let u=i[a],l=s;if(r.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return re.minimatch.defaults(e).Minimatch}};re.Minimatch=zi;var KW=_T();Object.defineProperty(re,"AST",{enumerable:!0,get:function(){return KW.AST}});var VW=TT();Object.defineProperty(re,"escape",{enumerable:!0,get:function(){return VW.escape}});var XW=qd();Object.defineProperty(re,"unescape",{enumerable:!0,get:function(){return XW.unescape}});re.minimatch.AST=gR.AST;re.minimatch.Minimatch=zi;re.minimatch.escape=mW.escape;re.minimatch.unescape=yW.unescape});var kR=m(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.LRUCache=void 0;var ba=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,_R=new Set,ST=typeof process=="object"&&process?process:{},TR=(t,e,n,r)=>{typeof ST.emitWarning=="function"?ST.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},Wd=globalThis.AbortController,vR=globalThis.AbortSignal;if(typeof Wd>"u"){vR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},Wd=class{constructor(){e()}signal=new vR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let t=ST.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,TR("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var YW=t=>!_R.has(t),wV=Symbol("type"),ii=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),SR=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?va:null:null,va=class extends Array{constructor(e){super(e),this.fill(0)}},kT=class t{heap;length;static#e=!1;static create(e){let n=SR(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},wT=class t{#e;#t;#i;#r;#o;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#h;#a;#u;#s;#m;#y;#d;#f;#k;#g;#w;#x;#v;#T;#S;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#v,sizes:e.#w,keyMap:e.#a,keyList:e.#u,valList:e.#s,next:e.#m,prev:e.#y,get head(){return e.#d},get tail(){return e.#f},free:e.#k,isBackgroundFetch:n=>e.#c(n),backgroundFetch:(n,r,s,i)=>e.#j(n,r,s,i),moveToTail:n=>e.#$(n),indexes:n=>e.#A(n),rindexes:n=>e.#O(n),isStale:n=>e.#b(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#_}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:n=0,ttl:r,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,memoMethod:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e;if(n!==0&&!ii(n))throw new TypeError("max option must be a nonnegative integer");let G=n?SR(n):Array;if(!G)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=g,this.maxEntrySize=v||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=A,O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=O,this.#S=!!O,this.#a=new Map,this.#u=new Array(n).fill(void 0),this.#s=new Array(n).fill(void 0),this.#m=new G(n),this.#y=new G(n),this.#d=0,this.#f=0,this.#k=kT.create(n),this.#l=0,this.#h=0,typeof l=="function"&&(this.#i=l),typeof c=="function"?(this.#r=c,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#T=!!this.#i,this.#p=!!this.#r,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!ii(this.#t))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.#R()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ii(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!ii(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let se="LRU_CACHE_UNBOUNDED";YW(se)&&(_R.add(se),TR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",se,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new va(this.#e),n=new va(this.#e);this.#v=e,this.#x=n,this.#D=(i,o,a=ba.now())=>{if(n[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#b(i)&&this.#P(this.#u[i],"expire")},o+1);u.unref&&u.unref()}},this.#E=i=>{n[i]=e[i]!==0?ba.now():0},this.#n=(i,o)=>{if(e[o]){let a=e[o],u=n[o];if(!a||!u)return;i.ttl=a,i.start=u,i.now=r||s();let l=i.now-u;i.remainingTTL=a-l}};let r=0,s=()=>{let i=ba.now();if(this.ttlResolution>0){r=i;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=this.#a.get(i);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let l=(r||s())-u;return a-l},this.#b=i=>{let o=n[i],a=e[i];return!!a&&!!o&&(r||s())-o>a}}#E=()=>{};#n=()=>{};#D=()=>{};#b=()=>!1;#R(){let e=new va(this.#e);this.#h=0,this.#w=e,this.#I=n=>{this.#h-=e[n],e[n]=0},this.#L=(n,r,s,i)=>{if(this.#c(r))return 0;if(!ii(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(r,n),!ii(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#M=(n,r,s)=>{if(e[n]=r,this.#t){let i=this.#t-e[n];for(;this.#h>i;)this.#q(!0)}this.#h+=e[n],s&&(s.entrySize=r,s.totalCalculatedSize=this.#h)}}#I=e=>{};#M=(e,n,r)=>{};#L=(e,n,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#f;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#d));)n=this.#y[n]}*#O({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#d;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#f));)n=this.#m[n]}#N(e){return e!==void 0&&this.#a.get(this.#u[e])===e}*entries(){for(let e of this.#A())this.#s[e]!==void 0&&this.#u[e]!==void 0&&!this.#c(this.#s[e])&&(yield[this.#u[e],this.#s[e]])}*rentries(){for(let e of this.#O())this.#s[e]!==void 0&&this.#u[e]!==void 0&&!this.#c(this.#s[e])&&(yield[this.#u[e],this.#s[e]])}*keys(){for(let e of this.#A()){let n=this.#u[e];n!==void 0&&!this.#c(this.#s[e])&&(yield n)}}*rkeys(){for(let e of this.#O()){let n=this.#u[e];n!==void 0&&!this.#c(this.#s[e])&&(yield n)}}*values(){for(let e of this.#A())this.#s[e]!==void 0&&!this.#c(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#O())this.#s[e]!==void 0&&!this.#c(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#A()){let s=this.#s[r],i=this.#c(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(e,n=this){for(let r of this.#A()){let s=this.#s[r],i=this.#c(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(n,i,this.#u[r],this)}}rforEach(e,n=this){for(let r of this.#O()){let s=this.#s[r],i=this.#c(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(n,i,this.#u[r],this)}}purgeStale(){let e=!1;for(let n of this.#O({allowStale:!0}))this.#b(n)&&(this.#P(this.#u[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#s[n],s=this.#c(r)?r.__staleWhileFetching:r;if(s===void 0)return;let i={value:s};if(this.#v&&this.#x){let o=this.#v[n],a=this.#x[n];if(o&&a){let u=o-(ba.now()-a);i.ttl=u,i.start=Date.now()}}return this.#w&&(i.size=this.#w[n]),i}dump(){let e=[];for(let n of this.#A({allowStale:!0})){let r=this.#u[n],s=this.#s[n],i=this.#c(s)?s.__staleWhileFetching:s;if(i===void 0||r===void 0)continue;let o={value:i};if(this.#v&&this.#x){o.ttl=this.#v[n];let a=ba.now()-this.#x[n];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let s=Date.now()-r.start;r.start=ba.now()-s}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,c=this.#L(e,n,r.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#l===0?void 0:this.#a.get(e);if(h===void 0)h=this.#l===0?this.#f:this.#k.length!==0?this.#k.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#u[h]=e,this.#s[h]=n,this.#a.set(e,h),this.#m[this.#f]=h,this.#y[h]=this.#f,this.#f=h,this.#l++,this.#M(h,c,u),u&&(u.set="add"),l=!1;else{this.#$(h);let f=this.#s[h];if(n!==f){if(this.#S&&this.#c(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=f;g!==void 0&&!o&&(this.#T&&this.#i?.(g,e,"set"),this.#p&&this.#g?.push([g,e,"set"]))}else o||(this.#T&&this.#i?.(f,e,"set"),this.#p&&this.#g?.push([f,e,"set"]));if(this.#I(h),this.#M(h,c,u),this.#s[h]=n,u){u.set="replace";let g=f&&this.#c(f)?f.__staleWhileFetching:f;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(s!==0&&!this.#v&&this.#C(),this.#v&&(l||this.#D(h,s,i),u&&this.#n(u,h)),!o&&this.#p&&this.#g){let f=this.#g,g;for(;g=f?.shift();)this.#r?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#d];if(this.#q(!0),this.#c(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#r?.(...n)}}}#q(e){let n=this.#d,r=this.#u[n],s=this.#s[n];return this.#S&&this.#c(s)?s.__abortController.abort(new Error("evicted")):(this.#T||this.#p)&&(this.#T&&this.#i?.(s,r,"evict"),this.#p&&this.#g?.push([s,r,"evict"])),this.#I(n),e&&(this.#u[n]=void 0,this.#s[n]=void 0,this.#k.push(n)),this.#l===1?(this.#d=this.#f=0,this.#k.length=0):this.#d=this.#m[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=n,i=this.#a.get(e);if(i!==void 0){let o=this.#s[i];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(i))s&&(s.has="stale",this.#n(s,i));else return r&&this.#E(i),s&&(s.has="hit",this.#n(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,s=this.#a.get(e);if(s===void 0||!r&&this.#b(s))return;let i=this.#s[s];return this.#c(i)?i.__staleWhileFetching:i}#j(e,n,r,s){let i=n===void 0?void 0:this.#s[n];if(this.#c(i))return i;let o=new Wd,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:s},l=(b,O=!1)=>{let{aborted:A}=o.signal,k=r.ignoreFetchAbort&&b!==void 0;if(r.status&&(A&&!O?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,k&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!k&&!O)return h(o.signal.reason);let S=g;return this.#s[n]===g&&(b===void 0?S.__staleWhileFetching?this.#s[n]=S.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,b,u.options))),b},c=b=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=b),h(b)),h=b=>{let{aborted:O}=o.signal,A=O&&r.allowStaleOnFetchAbort,k=A||r.allowStaleOnFetchRejection,S=k||r.noDeleteOnFetchRejection,_=g;if(this.#s[n]===g&&(!S||_.__staleWhileFetching===void 0?this.#P(e,"fetch"):A||(this.#s[n]=_.__staleWhileFetching)),k)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw b},f=(b,O)=>{let A=this.#o?.(e,i,u);A&&A instanceof Promise&&A.then(k=>b(k===void 0?void 0:k),O),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(void 0),r.allowStaleOnFetchAbort&&(b=k=>l(k,!0)))})};r.status&&(r.status.fetchDispatched=!0);let g=new Promise(f).then(l,c),v=Object.assign(g,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return n===void 0?(this.set(e,v,{...u.options,status:void 0}),n=this.#a.get(e)):this.#s[n]=v,v}#c(e){if(!this.#S)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Wd}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:b,forceRefresh:O=!1,status:A,signal:k}=n;if(!this.#S)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:A});let S={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:v,ignoreFetchAbort:g,status:A,signal:k},_=this.#a.get(e);if(_===void 0){A&&(A.fetch="miss");let N=this.#j(e,_,S,b);return N.__returned=N}else{let N=this.#s[_];if(this.#c(N)){let z=r&&N.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",z&&(A.returnedStale=!0)),z?N.__staleWhileFetching:N.__returned=N}let R=this.#b(_);if(!O&&!R)return A&&(A.fetch="hit"),this.#$(_),s&&this.#E(_),A&&this.#n(A,_),N;let G=this.#j(e,_,S,b),ue=G.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=R?"stale":"refresh",ue&&R&&(A.returnedStale=!0)),ue?G.__staleWhileFetching:G.__returned=G}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#_;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=n,a=this.get(e,o);if(!i&&a!==void 0)return a;let u=r(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let u=this.#s[a],l=this.#c(u);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(i||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#$(a),s&&this.#E(a),u))}else o&&(o.get="miss")}#F(e,n){this.#y[n]=e,this.#m[e]=n}#$(e){e!==this.#f&&(e===this.#d?this.#d=this.#m[e]:this.#F(this.#y[e],this.#m[e]),this.#F(this.#f,e),this.#f=e)}delete(e){return this.#P(e,"delete")}#P(e,n){let r=!1;if(this.#l!==0){let s=this.#a.get(e);if(s!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(s);let i=this.#s[s];if(this.#c(i)?i.__abortController.abort(new Error("deleted")):(this.#T||this.#p)&&(this.#T&&this.#i?.(i,e,n),this.#p&&this.#g?.push([i,e,n])),this.#a.delete(e),this.#u[s]=void 0,this.#s[s]=void 0,s===this.#f)this.#f=this.#y[s];else if(s===this.#d)this.#d=this.#m[s];else{let o=this.#y[s];this.#m[o]=this.#m[s];let a=this.#m[s];this.#y[a]=this.#y[s]}this.#l--,this.#k.push(s)}}if(this.#p&&this.#g?.length){let s=this.#g,i;for(;i=s?.shift();)this.#r?.(...i)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#O({allowStale:!0})){let r=this.#s[n];if(this.#c(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#u[n];this.#T&&this.#i?.(r,s,e),this.#p&&this.#g?.push([r,s,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#u.fill(void 0),this.#v&&this.#x&&(this.#v.fill(0),this.#x.fill(0)),this.#w&&this.#w.fill(0),this.#d=0,this.#f=0,this.#k.length=0,this.#h=0,this.#l=0,this.#p&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};Hd.LRUCache=wT});var DT=m(vn=>{"use strict";var JW=vn&&vn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vn,"__esModule",{value:!0});vn.Minipass=vn.isWritable=vn.isReadable=vn.isStream=void 0;var wR=typeof process=="object"&&process?process:{stdout:null,stderr:null},PT=require("node:events"),OR=JW(require("node:stream")),QW=require("node:string_decoder"),ZW=t=>!!t&&typeof t=="object"&&(t instanceof Jd||t instanceof OR.default||(0,vn.isReadable)(t)||(0,vn.isWritable)(t));vn.isStream=ZW;var e5=t=>!!t&&typeof t=="object"&&t instanceof PT.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==OR.default.Writable.prototype.pipe;vn.isReadable=e5;var t5=t=>!!t&&typeof t=="object"&&t instanceof PT.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";vn.isWritable=t5;var _s=Symbol("EOF"),Ts=Symbol("maybeEmitEnd"),oi=Symbol("emittedEnd"),Gd=Symbol("emittingEnd"),nl=Symbol("emittedError"),zd=Symbol("closed"),xR=Symbol("read"),Kd=Symbol("flush"),ER=Symbol("flushChunk"),Er=Symbol("encoding"),_a=Symbol("decoder"),Ht=Symbol("flowing"),rl=Symbol("paused"),Ta=Symbol("resume"),Gt=Symbol("buffer"),bn=Symbol("pipes"),zt=Symbol("bufferLength"),xT=Symbol("bufferPush"),Vd=Symbol("bufferShift"),ln=Symbol("objectMode"),xt=Symbol("destroyed"),ET=Symbol("error"),AT=Symbol("emitData"),AR=Symbol("emitEnd"),OT=Symbol("emitEnd2"),Qr=Symbol("async"),CT=Symbol("abort"),Xd=Symbol("aborted"),sl=Symbol("signal"),Ki=Symbol("dataListeners"),Bn=Symbol("discarded"),il=t=>Promise.resolve().then(t),n5=t=>t(),r5=t=>t==="end"||t==="finish"||t==="prefinish",s5=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,i5=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Yd=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[Ta](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},RT=class extends Yd{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=s=>n.emit("error",s),e.on("error",this.proxyErrors)}},o5=t=>!!t.objectMode,a5=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Jd=class extends PT.EventEmitter{[Ht]=!1;[rl]=!1;[bn]=[];[Gt]=[];[ln];[Er];[Qr];[_a];[_s]=!1;[oi]=!1;[Gd]=!1;[zd]=!1;[nl]=null;[zt]=0;[xt]=!1;[sl];[Xd]=!1;[Ki]=0;[Bn]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");o5(n)?(this[ln]=!0,this[Er]=null):a5(n)?(this[Er]=n.encoding,this[ln]=!1):(this[ln]=!1,this[Er]=null),this[Qr]=!!n.async,this[_a]=this[Er]?new QW.StringDecoder(this[Er]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Gt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[bn]});let{signal:r}=n;r&&(this[sl]=r,r.aborted?this[CT]():r.addEventListener("abort",()=>this[CT]()))}get bufferLength(){return this[zt]}get encoding(){return this[Er]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ln]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Qr]}set async(e){this[Qr]=this[Qr]||!!e}[CT](){this[Xd]=!0,this.emit("abort",this[sl]?.reason),this.destroy(this[sl]?.reason)}get aborted(){return this[Xd]}set aborted(e){}write(e,n,r){if(this[Xd])return!1;if(this[_s])throw new Error("write after end");if(this[xt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let s=this[Qr]?il:n5;if(!this[ln]&&!Buffer.isBuffer(e)){if(i5(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(s5(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ln]?(this[Ht]&&this[zt]!==0&&this[Kd](!0),this[Ht]?this.emit("data",e):this[xT](e),this[zt]!==0&&this.emit("readable"),r&&s(r),this[Ht]):e.length?(typeof e=="string"&&!(n===this[Er]&&!this[_a]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Er]&&(e=this[_a].write(e)),this[Ht]&&this[zt]!==0&&this[Kd](!0),this[Ht]?this.emit("data",e):this[xT](e),this[zt]!==0&&this.emit("readable"),r&&s(r),this[Ht]):(this[zt]!==0&&this.emit("readable"),r&&s(r),this[Ht])}read(e){if(this[xt])return null;if(this[Bn]=!1,this[zt]===0||e===0||e&&e>this[zt])return this[Ts](),null;this[ln]&&(e=null),this[Gt].length>1&&!this[ln]&&(this[Gt]=[this[Er]?this[Gt].join(""):Buffer.concat(this[Gt],this[zt])]);let n=this[xR](e||null,this[Gt][0]);return this[Ts](),n}[xR](e,n){if(this[ln])this[Vd]();else{let r=n;e===r.length||e===null?this[Vd]():typeof r=="string"?(this[Gt][0]=r.slice(e),n=r.slice(0,e),this[zt]-=e):(this[Gt][0]=r.subarray(e),n=r.subarray(0,e),this[zt]-=e)}return this.emit("data",n),!this[Gt].length&&!this[_s]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[_s]=!0,this.writable=!1,(this[Ht]||!this[rl])&&this[Ts](),this}[Ta](){this[xt]||(!this[Ki]&&!this[bn].length&&(this[Bn]=!0),this[rl]=!1,this[Ht]=!0,this.emit("resume"),this[Gt].length?this[Kd]():this[_s]?this[Ts]():this.emit("drain"))}resume(){return this[Ta]()}pause(){this[Ht]=!1,this[rl]=!0,this[Bn]=!1}get destroyed(){return this[xt]}get flowing(){return this[Ht]}get paused(){return this[rl]}[xT](e){this[ln]?this[zt]+=1:this[zt]+=e.length,this[Gt].push(e)}[Vd](){return this[ln]?this[zt]-=1:this[zt]-=this[Gt][0].length,this[Gt].shift()}[Kd](e=!1){do;while(this[ER](this[Vd]())&&this[Gt].length);!e&&!this[Gt].length&&!this[_s]&&this.emit("drain")}[ER](e){return this.emit("data",e),this[Ht]}pipe(e,n){if(this[xt])return e;this[Bn]=!1;let r=this[oi];return n=n||{},e===wR.stdout||e===wR.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[bn].push(n.proxyErrors?new RT(this,e,n):new Yd(this,e,n)),this[Qr]?il(()=>this[Ta]()):this[Ta]()),e}unpipe(e){let n=this[bn].find(r=>r.dest===e);n&&(this[bn].length===1?(this[Ht]&&this[Ki]===0&&(this[Ht]=!1),this[bn]=[]):this[bn].splice(this[bn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[Bn]=!1,this[Ki]++,!this[bn].length&&!this[Ht]&&this[Ta]();else if(e==="readable"&&this[zt]!==0)super.emit("readable");else if(r5(e)&&this[oi])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[nl]){let s=n;this[Qr]?il(()=>s.call(this,this[nl])):s.call(this,this[nl])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Ki]=this.listeners("data").length,this[Ki]===0&&!this[Bn]&&!this[bn].length&&(this[Ht]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ki]=0,!this[Bn]&&!this[bn].length&&(this[Ht]=!1)),n}get emittedEnd(){return this[oi]}[Ts](){!this[Gd]&&!this[oi]&&!this[xt]&&this[Gt].length===0&&this[_s]&&(this[Gd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[zd]&&this.emit("close"),this[Gd]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==xt&&this[xt])return!1;if(e==="data")return!this[ln]&&!r?!1:this[Qr]?(il(()=>this[AT](r)),!0):this[AT](r);if(e==="end")return this[AR]();if(e==="close"){if(this[zd]=!0,!this[oi]&&!this[xt])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[nl]=r,super.emit(ET,r);let i=!this[sl]||this.listeners("error").length?super.emit("error",r):!1;return this[Ts](),i}else if(e==="resume"){let i=super.emit("resume");return this[Ts](),i}else if(e==="finish"||e==="prefinish"){let i=super.emit(e);return this.removeAllListeners(e),i}let s=super.emit(e,...n);return this[Ts](),s}[AT](e){for(let r of this[bn])r.dest.write(e)===!1&&this.pause();let n=this[Bn]?!1:super.emit("data",e);return this[Ts](),n}[AR](){return this[oi]?!1:(this[oi]=!0,this.readable=!1,this[Qr]?(il(()=>this[OT]()),!0):this[OT]())}[OT](){if(this[_a]){let n=this[_a].end();if(n){for(let r of this[bn])r.dest.write(n);this[Bn]||super.emit("data",n)}}for(let n of this[bn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ln]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[ln]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[ln])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Er]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(xt,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Bn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[_s])return n();let i,o,a=h=>{this.off("data",u),this.off("end",l),this.off(xt,c),n(),o(h)},u=h=>{this.off("error",a),this.off("end",l),this.off(xt,c),this.pause(),i({value:h,done:!!this[_s]})},l=()=>{this.off("error",a),this.off("data",u),this.off(xt,c),n(),i({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((h,f)=>{o=f,i=h,this.once(xt,c),this.once("error",a),this.once("end",l),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Bn]=!1;let e=!1,n=()=>(this.pause(),this.off(ET,n),this.off(xt,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let s=this.read();return s===null?n():{done:!1,value:s}};return this.once("end",n),this.once(ET,n),this.once(xt,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[xt])return e?this.emit("error",e):this.emit(xt),this;this[xt]=!0,this[Bn]=!0,this[Gt].length=0,this[zt]=0;let n=this;return typeof n.close=="function"&&!this[zd]&&n.close(),e?this.emit("error",e):this.emit(xt),this}static get isStream(){return vn.isStream}};vn.Minipass=Jd});var WR=m(Be=>{"use strict";var u5=Be&&Be.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),l5=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c5=Be&&Be.__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)&&u5(e,t,n);return l5(e,t),e};Object.defineProperty(Be,"__esModule",{value:!0});Be.PathScurry=Be.Path=Be.PathScurryDarwin=Be.PathScurryPosix=Be.PathScurryWin32=Be.PathScurryBase=Be.PathPosix=Be.PathWin32=Be.PathBase=Be.ChildrenCache=Be.ResolveCache=void 0;var MR=kR(),np=require("node:path"),h5=require("node:url"),al=require("fs"),f5=c5(require("node:fs")),d5=al.realpathSync.native,Qd=require("node:fs/promises"),CR=DT(),ul={lstatSync:al.lstatSync,readdir:al.readdir,readdirSync:al.readdirSync,readlinkSync:al.readlinkSync,realpathSync:d5,promises:{lstat:Qd.lstat,readdir:Qd.readdir,readlink:Qd.readlink,realpath:Qd.realpath}},LR=t=>!t||t===ul||t===f5?ul:{...ul,...t,promises:{...ul.promises,...t.promises||{}}},NR=/^\\\\\?\\([a-z]:)\\?$/i,p5=t=>t.replace(/\//g,"\\").replace(NR,"$1\\"),g5=/[\\\/]/,cr=0,qR=1,jR=2,Zr=4,FR=6,$R=8,Vi=10,BR=12,lr=15,ol=~lr,IT=16,RR=32,ll=64,Ar=128,Zd=256,tp=512,PR=ll|Ar|tp,m5=1023,MT=t=>t.isFile()?$R:t.isDirectory()?Zr:t.isSymbolicLink()?Vi:t.isCharacterDevice()?jR:t.isBlockDevice()?FR:t.isSocket()?BR:t.isFIFO()?qR:cr,DR=new Map,cl=t=>{let e=DR.get(t);if(e)return e;let n=t.normalize("NFKD");return DR.set(t,n),n},IR=new Map,ep=t=>{let e=IR.get(t);if(e)return e;let n=cl(t.toLowerCase());return IR.set(t,n),n},hl=class extends MR.LRUCache{constructor(){super({max:256})}};Be.ResolveCache=hl;var rp=class extends MR.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};Be.ChildrenCache=rp;var UR=Symbol("PathScurry setAsCwd"),Qt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#_;get gid(){return this.#_}#l;get rdev(){return this.#l}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#u;get size(){return this.#u}#s;get blocks(){return this.#s}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#d;get ctimeMs(){return this.#d}#f;get birthtimeMs(){return this.#f}#k;get atime(){return this.#k}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#x;get birthtime(){return this.#x}#v;#T;#S;#p;#C;#E;#n;#D;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=cr,r,s,i,o,a){this.name=e,this.#v=i?ep(e):cl(e),this.#n=n&m5,this.nocase=i,this.roots=s,this.root=r||this,this.#D=o,this.#S=a.fullpath,this.#C=a.relative,this.#E=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=LR(a.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let n=this.getRootString(e),s=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(s):this.#I(s)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#D.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#D.set(this,n),this.#n&=~IT,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?ep(e):cl(e);for(let u of r)if(u.#v===s)return u;let i=this.parent?this.sep:"",o=this.#S?this.#S+i+e:void 0,a=this.newChild(e,cr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Ar),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,n=this.parent;if(!n)return this.#C=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,n=this.parent;if(!n)return this.#E=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,n=this.parent;if(!n)return this.#S=this.name;let s=n.fullpath()+(n.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#p=`//?/${s}`:this.#p=s}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&lr)===cr}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&lr)===$R}isDirectory(){return(this.#n&lr)===Zr}isCharacterDevice(){return(this.#n&lr)===jR}isBlockDevice(){return(this.#n&lr)===FR}isFIFO(){return(this.#n&lr)===qR}isSocket(){return(this.#n&lr)===BR}isSymbolicLink(){return(this.#n&Vi)===Vi}lstatCached(){return this.#n&RR?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&lr;return!(e!==cr&&e!==Vi||this.#n&Zd||this.#n&Ar)}calledReaddir(){return!!(this.#n&IT)}isENOENT(){return!!(this.#n&Ar)}isNamed(e){return this.nocase?this.#v===ep(e):this.#v===cl(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#b=r}catch(n){this.#c(n.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#b=r}catch(n){this.#c(n.code);return}}#M(e){this.#n|=IT;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#L()}}#L(){this.#n&Ar||(this.#n=(this.#n|Ar)&ol,this.#A())}#A(){let e=this.children();e.provisional=0;for(let n of e)n.#L()}#O(){this.#n|=tp,this.#N()}#N(){if(this.#n&ll)return;let e=this.#n;(e&lr)===Zr&&(e&=ol),this.#n=e|ll,this.#A()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#L()}#c(e=""){let n=this.#n;n|=Zd,e==="ENOENT"&&(n|=Ar),(e==="EINVAL"||e==="UNKNOWN")&&(n&=ol),this.#n=n,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#F(e,n){return this.#P(e,n)||this.#$(e,n)}#$(e,n){let r=MT(e),s=this.newChild(e.name,r,{parent:this}),i=s.#n&lr;return i!==Zr&&i!==Vi&&i!==cr&&(s.#n|=ll),n.unshift(s),n.provisional++,s}#P(e,n){for(let r=n.provisional;r<n.length;r++){let s=n[r];if((this.nocase?ep(e.name):cl(e.name))===s.#v)return this.#B(e,s,r,n)}}#B(e,n,r,s){let i=n.name;return n.#n=n.#n&ol|MT(e),i!==e.name&&(n.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(n)),s.provisional++,n}async lstat(){if(!(this.#n&Ar))try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if(!(this.#n&Ar))try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:n,atimeMs:r,birthtime:s,birthtimeMs:i,blksize:o,blocks:a,ctime:u,ctimeMs:l,dev:c,gid:h,ino:f,mode:g,mtime:v,mtimeMs:b,nlink:O,rdev:A,size:k,uid:S}=e;this.#k=n,this.#m=r,this.#x=s,this.#f=i,this.#h=o,this.#s=a,this.#w=u,this.#d=l,this.#t=c,this.#_=h,this.#a=f,this.#i=g,this.#g=v,this.#y=b,this.#r=O,this.#l=A,this.#u=k,this.#o=S;let _=MT(e);this.#n=this.#n&ol|_|RR,_!==cr&&_!==Zr&&_!==Vi&&(this.#n|=ll)}#W=[];#H=!1;#z(e){this.#H=!1;let n=this.#W.slice();this.#W.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let i=r.slice(0,r.provisional);n?e(null,i):queueMicrotask(()=>e(null,i));return}if(this.#W.push(e),this.#H)return;this.#H=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(i,o)=>{if(i)this.#q(i.code),r.provisional=0;else{for(let a of o)this.#F(a,r);this.#M(r)}this.#z(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#F(s,e);this.#M(e)}catch(s){this.#q(s.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#F(r,e);this.#M(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&PR)return!1;let e=lr&this.#n;return e===cr||e===Zr||e===Vi}shouldWalk(e,n){return(this.#n&Zr)===Zr&&!(this.#n&PR)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((tp|Zd|Ar)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#R)return this.#R;if(!((tp|Zd|Ar)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#O()}}[UR](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],s=this;for(;s&&s.parent;)n.add(s),s.#C=r.join(this.sep),s.#E=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!n.has(s);)s.#C=void 0,s.#E=void 0,s=s.parent}};Be.PathBase=Qt;var fl=class t extends Qt{sep="\\";splitSep=g5;constructor(e,n=cr,r,s,i,o,a){super(e,n,r,s,i,o,a)}newChild(e,n=cr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return np.win32.parse(e).root}getRoot(e){if(e=p5(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new gl(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(NR,"$1\\"),e===n}};Be.PathWin32=fl;var dl=class t extends Qt{splitSep="/";sep="/";constructor(e,n=cr,r,s,i,o,a){super(e,n,r,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=cr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};Be.PathPosix=dl;var pl=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),n,r,{nocase:s,childrenCacheSize:i=16*1024,fs:o=ul}={}){this.#r=LR(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,h5.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new hl,this.#t=new hl,this.#i=new rp(i);let u=a.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,c=u.length-1,h=n.sep,f=this.rootPath,g=!1;for(let v of u){let b=c--;l=l.child(v,{relative:new Array(b).fill("..").join(h),relativePosix:new Array(b).fill("..").join("/"),fullpath:f+=(g?"":h)+v}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let n="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let s=this.cwd.resolve(n).fullpath();return this.#e.set(n,s),s}resolvePosix(...e){let n="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let s=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(i=>i.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let u=new Set,l=(h,f)=>{u.add(h),h.readdirCB((g,v)=>{if(g)return f(g);let b=v.length;if(!b)return f();let O=()=>{--b===0&&f()};for(let A of v)(!i||i(A))&&a.push(r?A:A.fullpath()),s&&A.isSymbolicLink()?A.realpath().then(k=>k?.isUnknown()?k.lstat():k).then(k=>k?.shouldWalk(u,o)?l(k,O):O()):A.shouldWalk(u,o)?l(A,O):O()},!0)},c=e;return new Promise((h,f)=>{l(c,g=>{if(g)return f(g);h(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let u=new Set([e]);for(let l of u){let c=l.readdirSync();for(let h of c){(!i||i(h))&&a.push(r?h:h.fullpath());let f=h;if(h.isSymbolicLink()){if(!(s&&(f=h.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(u,o)&&u.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n;(!i||i(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let u of a){let l=u.readdirSync();for(let c of l){(!i||i(c))&&(yield r?c:c.fullpath());let h=c;if(c.isSymbolicLink()){if(!(s&&(h=c.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=new CR.Minipass({objectMode:!0});(!i||i(e))&&a.write(r?e:e.fullpath());let u=new Set,l=[e],c=0,h=()=>{let f=!1;for(;!f;){let g=l.shift();if(!g){c===0&&a.end();return}c++,u.add(g);let v=(O,A,k=!1)=>{if(O)return a.emit("error",O);if(s&&!k){let S=[];for(let _ of A)_.isSymbolicLink()&&S.push(_.realpath().then(N=>N?.isUnknown()?N.lstat():N));if(S.length){Promise.all(S).then(()=>v(null,A,!0));return}}for(let S of A)S&&(!i||i(S))&&(a.write(r?S:S.fullpath())||(f=!0));c--;for(let S of A){let _=S.realpathCached()||S;_.shouldWalk(u,o)&&l.push(_)}f&&!a.flowing?a.once("drain",h):b||h()},b=!0;g.readdirCB(v,!0),b=!1}};return h(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=new CR.Minipass({objectMode:!0}),u=new Set;(!i||i(e))&&a.write(r?e:e.fullpath());let l=[e],c=0,h=()=>{let f=!1;for(;!f;){let g=l.shift();if(!g){c===0&&a.end();return}c++,u.add(g);let v=g.readdirSync();for(let b of v)(!i||i(b))&&(a.write(r?b:b.fullpath())||(f=!0));c--;for(let b of v){let O=b;if(b.isSymbolicLink()){if(!(s&&(O=b.realpathSync())))continue;O.isUnknown()&&O.lstatSync()}O.shouldWalk(u,o)&&l.push(O)}}f&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[UR](n)}};Be.PathScurryBase=pl;var gl=class extends pl{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,np.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return np.win32.parse(e).root.toUpperCase()}newRoot(e){return new fl(this.rootPath,Zr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};Be.PathScurryWin32=gl;var ml=class extends pl{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,np.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new dl(this.rootPath,Zr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};Be.PathScurryPosix=ml;var sp=class extends ml{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};Be.PathScurryDarwin=sp;Be.Path=process.platform==="win32"?fl:dl;Be.PathScurry=process.platform==="win32"?gl:process.platform==="darwin"?sp:ml});var NT=m(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.Pattern=void 0;var y5=si(),b5=t=>t.length>=1,v5=t=>t.length>=1,LT=class t{#e;#t;#i;length;#r;#o;#_;#l;#h;#a;#u=!0;constructor(e,n,r,s){if(!b5(e))throw new TypeError("empty pattern list");if(!v5(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#i=r,this.#r=s,this.#i===0){if(this.isUNC()){let[i,o,a,u,...l]=this.#e,[c,h,f,g,...v]=this.#t;l[0]===""&&(l.shift(),v.shift());let b=[i,o,a,u,""].join("/"),O=[c,h,f,g,""].join("/");this.#e=[b,...l],this.#t=[O,...v],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=this.#e,[a,...u]=this.#t;o[0]===""&&(o.shift(),u.shift());let l=i+"/",c=a+"/";this.#e=[l,...o],this.#t=[c,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===y5.GLOBSTAR}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#_=this.#_||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#i+1,this.#r),this.#o.#a=this.#a,this.#o.#h=this.#h,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#r==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};ip.Pattern=LT});var jT=m(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.Ignore=void 0;var HR=si(),_5=NT(),T5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",qT=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:s,noglobstar:i,platform:o=T5}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:s,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new HR.Minimatch(e,this.mmopts);for(let r=0;r<n.set.length;r++){let s=n.set[r],i=n.globParts[r];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new _5.Pattern(s,i,0,this.platform),a=new HR.Minimatch(o.globString(),this.mmopts),u=i[i.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),u&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,s=e.relative()||".",i=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(i))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(n))return!0;return!1}};op.Ignore=qT});var zR=m(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.Processor=es.SubWalks=es.MatchRecord=es.HasWalkedCache=void 0;var GR=si(),ap=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),s=this.store.get(r);s?s.add(n.globString()):this.store.set(r,new Set([n.globString()]))}};es.HasWalkedCache=ap;var up=class{store=new Map;add(e,n,r){let s=(n?2:0)|(r?1:0),i=this.store.get(e);this.store.set(e,i===void 0?s:s&i)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}};es.MatchRecord=up;var lp=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};es.SubWalks=lp;var FT=class t{hasWalkedCache;matches=new up;subwalks=new lp;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new ap}processPatterns(e,n){this.patterns=n;let r=n.map(s=>[e,s]);for(let[s,i]of r){this.hasWalkedCache.storeWalked(s,i);let o=i.root(),a=i.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=i.rest();if(h)i=h;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let u,l,c=!1;for(;typeof(u=i.pattern())=="string"&&(l=i.rest());)s=s.resolve(u),i=l,c=!0;if(u=i.pattern(),l=i.rest(),c){if(this.hasWalkedCache.hasWalked(s,i))continue;this.hasWalkedCache.storeWalked(s,i)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(s.resolve(u),a,h);continue}else if(u===GR.GLOBSTAR){(!s.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(s,i);let h=l?.pattern(),f=l?.rest();if(!l||(h===""||h===".")&&!f)this.matches.add(s,a,h===""||h===".");else if(h===".."){let g=s.parent||s;f?this.hasWalkedCache.hasWalked(g,f)||this.subwalks.add(g,f):this.matches.add(g,a,!0)}}else u instanceof RegExp&&this.subwalks.add(s,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),s=this.child();for(let i of n)for(let o of r){let a=o.isAbsolute(),u=o.pattern(),l=o.rest();u===GR.GLOBSTAR?s.testGlobstar(i,o,l,a):u instanceof RegExp?s.testRegExp(i,u,l,a):s.testString(i,u,l,a)}return s}testGlobstar(e,n,r,s){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let i=r.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(e,i,r.rest(),s);else if(i===".."){let o=e.parent||e;this.subwalks.add(o,r)}else i instanceof RegExp&&this.testRegExp(e,i,r.rest(),s)}}testRegExp(e,n,r,s){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,n,r,s){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};es.Processor=FT});var XR=m(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.GlobStream=ai.GlobWalker=ai.GlobUtil=void 0;var S5=DT(),KR=jT(),VR=zR(),k5=(t,e)=>typeof t=="string"?new KR.Ignore([t],e):Array.isArray(t)?new KR.Ignore(t,e):t,yl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=k5(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=i.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,n)}matchFinish(e,n){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let i=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(i+s)}else{let i=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!i.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(i?o+i+s:"."+s)}}async match(e,n,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,n)}matchSync(e,n,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new VR.Processor(this.opts),r)}walkCB2(e,n,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,s));return}r.processPatterns(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,u,l]of r.matches.entries())this.#r(a)||(i++,this.match(a,u,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,r,o):a.readdirCB((l,c)=>this.walkCB3(a,c,r,o),!0)}o()}walkCB3(e,n,r,s){r=r.filterEntries(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,u,l]of r.matches.entries())this.#r(a)||(i++,this.match(a,u,l).then(()=>o()));for(let[a,u]of r.subwalks.entries())i++,this.walkCB2(a,u,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new VR.Processor(this.opts),r)}walkCB2Sync(e,n,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,s));return}r.processPatterns(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,u,l]of r.matches.entries())this.#r(a)||this.matchSync(a,u,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let u=a.readdirSync();this.walkCB3Sync(a,u,r,o)}o()}walkCB3Sync(e,n,r,s){r=r.filterEntries(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,u,l]of r.matches.entries())this.#r(a)||this.matchSync(a,u,l);for(let[a,u]of r.subwalks.entries())i++,this.walkCB2Sync(a,u,r.child(),o);o()}};ai.GlobUtil=yl;var $T=class extends yl{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};ai.GlobWalker=$T;var BT=class extends yl{results;constructor(e,n,r){super(e,n,r),this.results=new S5.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};ai.GlobStream=BT});var WT=m(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.Glob=void 0;var w5=si(),x5=require("node:url"),cp=WR(),E5=NT(),hp=XR(),A5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",UT=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,x5.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=n.platform||A5,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=n.platform==="win32"?cp.PathScurryWin32:n.platform==="darwin"?cp.PathScurryDarwin:n.platform?cp.PathScurryPosix:cp.PathScurry;this.scurry=new u(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(u=>new w5.Minimatch(u,s)),[o,a]=i.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=o.map((u,l)=>{let c=a[l];if(!c)throw new Error("invalid pattern object");return new E5.Pattern(u,c,0,this.platform)})}async walk(){return[...await new hp.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new hp.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new hp.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new hp.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};fp.Glob=UT});var HT=m(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.hasMagic=void 0;var O5=si(),C5=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new O5.Minimatch(n,e).hasMagic())return!0;return!1};dp.hasMagic=C5});var ZR=m(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.glob=Ee.sync=Ee.iterate=Ee.iterateSync=Ee.stream=Ee.streamSync=Ee.Ignore=Ee.hasMagic=Ee.Glob=Ee.unescape=Ee.escape=void 0;Ee.globStreamSync=bl;Ee.globStream=GT;Ee.globSync=zT;Ee.globIterateSync=vl;Ee.globIterate=KT;var YR=si(),Xi=WT(),R5=HT(),QR=si();Object.defineProperty(Ee,"escape",{enumerable:!0,get:function(){return QR.escape}});Object.defineProperty(Ee,"unescape",{enumerable:!0,get:function(){return QR.unescape}});var P5=WT();Object.defineProperty(Ee,"Glob",{enumerable:!0,get:function(){return P5.Glob}});var D5=HT();Object.defineProperty(Ee,"hasMagic",{enumerable:!0,get:function(){return D5.hasMagic}});var I5=jT();Object.defineProperty(Ee,"Ignore",{enumerable:!0,get:function(){return I5.Ignore}});function bl(t,e={}){return new Xi.Glob(t,e).streamSync()}function GT(t,e={}){return new Xi.Glob(t,e).stream()}function zT(t,e={}){return new Xi.Glob(t,e).walkSync()}async function JR(t,e={}){return new Xi.Glob(t,e).walk()}function vl(t,e={}){return new Xi.Glob(t,e).iterateSync()}function KT(t,e={}){return new Xi.Glob(t,e).iterate()}Ee.streamSync=bl;Ee.stream=Object.assign(GT,{sync:bl});Ee.iterateSync=vl;Ee.iterate=Object.assign(KT,{sync:vl});Ee.sync=Object.assign(zT,{stream:bl,iterate:vl});Ee.glob=Object.assign(JR,{glob:JR,globSync:zT,sync:Ee.sync,globStream:GT,stream:Ee.stream,globStreamSync:bl,streamSync:Ee.streamSync,globIterate:KT,iterate:Ee.iterate,globIterateSync:vl,iterateSync:Ee.iterateSync,Glob:Xi.Glob,hasMagic:R5.hasMagic,escape:YR.escape,unescape:YR.unescape});Ee.glob.glob=Ee.glob});var tP=m(Sa=>{"use strict";var XT=Sa&&Sa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.FileSystem=void 0;var M5=mm(),eP=(KC(),hP(zC)),L5=XT(require("events")),pp=pd(),N5=XT(require("fs")),q5=Dd(),j5=XT(Ed()),F5=ZR(),VT=class extends L5.default{constructor(e){super(),this._context=e,this._textDocumentManager=new M5.TextDocuments(eP.TextDocument),this._tempTextDocumentCache=new j5.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=>pp.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async getWorkspaceRelatedFiles(){let e=this._context.getConfiguration(),n=e.fileExtensions,r=e.typeAnalyzer.exclude,s=await this.getWorkspaceFolderUris();return(await Promise.all(s.flatMap(async o=>(0,F5.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>pp.URI.file(o))}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=pp.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let s=null;try{let i=await N5.default.promises.readFile(n.fsPath,{encoding:"utf-8"});s=eP.TextDocument.create(e,q5.LanguageId,0,i)}catch{}return this._tempTextDocumentCache.set(e,s),s}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(pp.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)})}};Sa.FileSystem=VT});var nP=m(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.NodeContext=void 0;var YT=mm(),JT=Dd(),$5=tP(),QT=class extends JT.CoreContext{constructor(){super(),this.documentManager=new JT.DocumentManager().setContext(this),this.documentMerger=new JT.DocumentMerger,this.connection=(0,YT.createConnection)(YT.ProposedFeatures.all),this.fs=new $5.FileSystem(this)}createSemanticTokensBuilder(){return new YT.SemanticTokensBuilder}};gp.NodeContext=QT});Object.defineProperty(exports,"__esModule",{value:!0});var B5=nP(),Or=Dd(),rP=new B5.NodeContext;rP.on("ready",t=>{(0,Or.activateAutocomplete)(t),(0,Or.activateColor)(t),(0,Or.activateDefinition)(t),(0,Or.activateDiagnostic)(t),(0,Or.activateFormatter)(t),(0,Or.activateHover)(t),(0,Or.activateSignature)(t),(0,Or.activateSubscriptions)(t),(0,Or.activateSymbol)(t),(0,Or.activateSemantic)(t),(0,Or.activateFoldingRange)(t)});rP.listen();