monaco-languageclient-examples 6.6.2-next.1 → 7.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,155 +1,157 @@
1
- (()=>{var mN=Object.create;var Sh=Object.defineProperty;var hN=Object.getOwnPropertyDescriptor;var gN=Object.getOwnPropertyNames;var yN=Object.getPrototypeOf,vN=Object.prototype.hasOwnProperty;var Wl=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var $=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),TN=(t,e)=>{for(var r in e)Sh(t,r,{get:e[r],enumerable:!0})},RN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of gN(e))!vN.call(t,i)&&i!==r&&Sh(t,i,{get:()=>e[i],enumerable:!(n=hN(e,i))||n.enumerable});return t};var Ie=(t,e,r)=>(r=t!=null?mN(yN(t)):{},RN(e||!t||!t.__esModule?Sh(r,"default",{value:t,enumerable:!0}):r,t));var eo=$(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});var kh;function Ch(){if(kh===void 0)throw new Error("No runtime abstraction layer installed");return kh}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");kh=r}t.install=e})(Ch||(Ch={}));wh.default=Ch});var Dh=$(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.Disposable=void 0;var xN;(function(t){function e(r){return{dispose:r}}t.create=e})(xN=Yc.Disposable||(Yc.Disposable={}))});var vs=$(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.Emitter=ys.Event=void 0;var bN=eo(),_N;(function(t){let e={dispose(){}};t.None=function(){return e}})(_N=ys.Event||(ys.Event={}));var Eh=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,bN.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Hl=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Eh),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.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)}};ys.Emitter=Hl;Hl._noop=function(){}});var GR=$(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.AbstractMessageBuffer=void 0;var SN=13,kN=10,CN=`\r
2
- `,Ph=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,r=0,n=0,i=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(n=0;n<c.length;){switch(c[n]){case SN:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case kN:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}i+=c.byteLength,r++}if(e!==4)return;let o=this._read(i+n),s=new Map,a=this.toString(o,"ascii").split(CN);if(a.length<2)return s;for(let c=0;c<a.length-2;c++){let f=a[c],p=f.indexOf(":");if(p===-1)throw new Error("Message header must separate key and value using :");let m=f.substr(0,p),T=f.substr(p+1).trim();s.set(m,T)}return s}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 o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);r.set(s,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};Gl.AbstractMessageBuffer=Ph});var zR=$(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var BR=eo(),ra=Dh(),wN=vs(),DN=GR(),Bl=class t extends DN.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}};Bl.emptyBuffer=new Uint8Array(0);var Ah=class{constructor(e){this.socket=e,this._onData=new wN.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,BR.default)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),ra.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),ra.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),ra.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}},Nh=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),ra.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),ra.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),ra.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},EN=new TextEncoder,KR=Object.freeze({messageBuffer:Object.freeze({create:t=>new Bl(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(EN.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new Ah(t),asWritableStream:t=>new Nh(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Ih(){return KR}(function(t){function e(){BR.default.install(KR)}t.install=e})(Ih||(Ih={}));Oh.default=Ih});var na=$(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.stringArray=qr.array=qr.func=qr.error=qr.number=qr.string=qr.boolean=void 0;function PN(t){return t===!0||t===!1}qr.boolean=PN;function VR(t){return typeof t=="string"||t instanceof String}qr.string=VR;function AN(t){return typeof t=="number"||t instanceof Number}qr.number=AN;function NN(t){return t instanceof Error}qr.error=NN;function IN(t){return typeof t=="function"}qr.func=IN;function XR(t){return Array.isArray(t)}qr.array=XR;function ON(t){return XR(t)&&t.every(e=>VR(e))}qr.stringArray=ON});var ig=$(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.Message=se.NotificationType9=se.NotificationType8=se.NotificationType7=se.NotificationType6=se.NotificationType5=se.NotificationType4=se.NotificationType3=se.NotificationType2=se.NotificationType1=se.NotificationType0=se.NotificationType=se.RequestType9=se.RequestType8=se.RequestType7=se.RequestType6=se.RequestType5=se.RequestType4=se.RequestType3=se.RequestType2=se.RequestType1=se.RequestType=se.RequestType0=se.AbstractMessageSignature=se.ParameterStructures=se.ResponseError=se.ErrorCodes=void 0;var Ts=na(),YR;(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})(YR=se.ErrorCodes||(se.ErrorCodes={}));var Lh=class t extends Error{constructor(e,r,n){super(r),this.code=Ts.number(e)?e:YR.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};se.ResponseError=Lh;var cn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};se.ParameterStructures=cn;cn.auto=new cn("auto");cn.byPosition=new cn("byPosition");cn.byName=new cn("byName");var yt=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return cn.auto}};se.AbstractMessageSignature=yt;var Mh=class extends yt{constructor(e){super(e,0)}};se.RequestType0=Mh;var $h=class extends yt{constructor(e,r=cn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};se.RequestType=$h;var qh=class extends yt{constructor(e,r=cn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};se.RequestType1=qh;var Fh=class extends yt{constructor(e){super(e,2)}};se.RequestType2=Fh;var jh=class extends yt{constructor(e){super(e,3)}};se.RequestType3=jh;var Uh=class extends yt{constructor(e){super(e,4)}};se.RequestType4=Uh;var Wh=class extends yt{constructor(e){super(e,5)}};se.RequestType5=Wh;var Hh=class extends yt{constructor(e){super(e,6)}};se.RequestType6=Hh;var Gh=class extends yt{constructor(e){super(e,7)}};se.RequestType7=Gh;var Bh=class extends yt{constructor(e){super(e,8)}};se.RequestType8=Bh;var Kh=class extends yt{constructor(e){super(e,9)}};se.RequestType9=Kh;var zh=class extends yt{constructor(e,r=cn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};se.NotificationType=zh;var Vh=class extends yt{constructor(e){super(e,0)}};se.NotificationType0=Vh;var Xh=class extends yt{constructor(e,r=cn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};se.NotificationType1=Xh;var Yh=class extends yt{constructor(e){super(e,2)}};se.NotificationType2=Yh;var Jh=class extends yt{constructor(e){super(e,3)}};se.NotificationType3=Jh;var Qh=class extends yt{constructor(e){super(e,4)}};se.NotificationType4=Qh;var Zh=class extends yt{constructor(e){super(e,5)}};se.NotificationType5=Zh;var eg=class extends yt{constructor(e){super(e,6)}};se.NotificationType6=eg;var tg=class extends yt{constructor(e){super(e,7)}};se.NotificationType7=tg;var rg=class extends yt{constructor(e){super(e,8)}};se.NotificationType8=rg;var ng=class extends yt{constructor(e){super(e,9)}};se.NotificationType9=ng;var LN;(function(t){function e(i){let o=i;return o&&Ts.string(o.method)&&(Ts.string(o.id)||Ts.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Ts.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Ts.string(o.id)||Ts.number(o.id)||o.id===null)}t.isResponse=n})(LN=se.Message||(se.Message={}))});var sg=$(to=>{"use strict";var JR;Object.defineProperty(to,"__esModule",{value:!0});to.LRUCache=to.LinkedMap=to.Touch=void 0;var zr;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(zr=to.Touch||(to.Touch={}));var Kl=class{constructor(){this[JR]="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,r=zr.None){let n=this._map.get(e);if(n)return r!==zr.None&&this.touch(n,r),n.value}set(e,r,n=zr.None){let i=this._map.get(e);if(i)i.value=r,n!==zr.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case zr.None:this.addItemLast(i);break;case zr.First:this.addItemFirst(i);break;case zr.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 r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.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,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(JR=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.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 r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==zr.First&&r!==zr.Last)){if(r===zr.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===zr.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};to.LinkedMap=Kl;var og=class extends Kl{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),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,r=zr.AsNew){return super.get(e,r)}peek(e){return super.get(e,zr.None)}set(e,r){return super.set(e,r,zr.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};to.LRUCache=og});var lg=$(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.CancellationTokenSource=Rs.CancellationToken=void 0;var MN=eo(),$N=na(),ag=vs(),cg;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ag.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ag.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||$N.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(cg=Rs.CancellationToken||(Rs.CancellationToken={}));var qN=Object.freeze(function(t,e){let r=(0,MN.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),zl=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?qN:(this._emitter||(this._emitter=new ag.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},ug=class{get token(){return this._token||(this._token=new zl),this._token}cancel(){this._token?this._token.cancel():this._token=cg.Cancelled}dispose(){this._token?this._token instanceof zl&&this._token.dispose():this._token=cg.None}};Rs.CancellationTokenSource=ug});var QR=$(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.ReadableStreamMessageReader=ro.AbstractMessageReader=ro.MessageReader=void 0;var dg=eo(),ia=na(),fg=vs(),FN;(function(t){function e(r){let n=r;return n&&ia.func(n.listen)&&ia.func(n.dispose)&&ia.func(n.onError)&&ia.func(n.onClose)&&ia.func(n.onPartialMessage)}t.is=e})(FN=ro.MessageReader||(ro.MessageReader={}));var Vl=class{constructor(){this.errorEmitter=new fg.Emitter,this.closeEmitter=new fg.Emitter,this.partialMessageEmitter=new fg.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: ${ia.string(e.message)?e.message:"unknown"}`)}};ro.AbstractMessageReader=Vl;var pg;(function(t){function e(r){let n,i,o,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,s.set(o.name,o)),r.contentDecoders!==void 0)for(let f of r.contentDecoders)s.set(f.name,f);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let f of r.contentTypeDecoders)c.set(f.name,f)}return a===void 0&&(a=(0,dg.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(pg||(pg={}));var mg=class extends Vl{constructor(e,r){super(),this.readable=e,this.options=pg.fromOptions(r),this.buffer=(0,dg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}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 r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders();if(!i)return;let o=i.get("Content-Length");if(!o)throw new Error("Header must provide a Content-Length property.");let s=parseInt(o);if(isNaN(s))throw new Error("Content-Length value must be a number.");this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let n;this.options.contentDecoder!==void 0?n=this.options.contentDecoder.decode(r):n=Promise.resolve(r),n.then(i=>{this.options.contentTypeDecoder.decode(i,this.options).then(o=>{this.callback(o)},o=>{this.fireError(o)})},i=>{this.fireError(i)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,dg.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ro.ReadableStreamMessageReader=mg});var ZR=$(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Semaphore=void 0;var jN=eo(),hg=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((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,jN.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 r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Xl.Semaphore=hg});var nx=$(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.WriteableStreamMessageWriter=no.AbstractMessageWriter=no.MessageWriter=void 0;var ex=eo(),Jc=na(),UN=ZR(),tx=vs(),WN="Content-Length: ",rx=`\r
3
- `,HN;(function(t){function e(r){let n=r;return n&&Jc.func(n.dispose)&&Jc.func(n.onClose)&&Jc.func(n.onError)&&Jc.func(n.write)}t.is=e})(HN=no.MessageWriter||(no.MessageWriter={}));var Yl=class{constructor(){this.errorEmitter=new tx.Emitter,this.closeEmitter=new tx.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}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: ${Jc.string(e.message)?e.message:"unknown"}`)}};no.AbstractMessageWriter=Yl;var gg;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,ex.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,ex.default)().applicationJson.encoder}}t.fromOptions=e})(gg||(gg={}));var yg=class extends Yl{constructor(e,r){super(),this.writable=e,this.options=gg.fromOptions(r),this.errorCount=0,this.writeSemaphore=new UN.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(WN,n.byteLength.toString(),rx),i.push(rx),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};no.WriteableStreamMessageWriter=yg});var ux=$(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.createMessageConnection=he.ConnectionOptions=he.CancellationStrategy=he.CancellationSenderStrategy=he.CancellationReceiverStrategy=he.ConnectionStrategy=he.ConnectionError=he.ConnectionErrors=he.LogTraceNotification=he.SetTraceNotification=he.TraceFormat=he.TraceValues=he.Trace=he.NullLogger=he.ProgressType=he.ProgressToken=void 0;var ix=eo(),cr=na(),ye=ig(),ox=sg(),Qc=vs(),vg=lg(),eu;(function(t){t.type=new ye.NotificationType("$/cancelRequest")})(eu||(eu={}));var sx;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(sx=he.ProgressToken||(he.ProgressToken={}));var Zc;(function(t){t.type=new ye.NotificationType("$/progress")})(Zc||(Zc={}));var Tg=class{constructor(){}};he.ProgressType=Tg;var Rg;(function(t){function e(r){return cr.func(r)}t.is=e})(Rg||(Rg={}));he.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ve;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ve=he.Trace||(he.Trace={}));var GN;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(GN=he.TraceValues||(he.TraceValues={}));(function(t){function e(n){if(!cr.string(n))return t.Off;switch(n=n.toLowerCase(),n){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 r(n){switch(n){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=r})(Ve=he.Trace||(he.Trace={}));var Jn;(function(t){t.Text="text",t.JSON="json"})(Jn=he.TraceFormat||(he.TraceFormat={}));(function(t){function e(r){return cr.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Jn=he.TraceFormat||(he.TraceFormat={}));var ax;(function(t){t.type=new ye.NotificationType("$/setTrace")})(ax=he.SetTraceNotification||(he.SetTraceNotification={}));var xg;(function(t){t.type=new ye.NotificationType("$/logTrace")})(xg=he.LogTraceNotification||(he.LogTraceNotification={}));var Jl;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Jl=he.ConnectionErrors||(he.ConnectionErrors={}));var oa=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};he.ConnectionError=oa;var cx;(function(t){function e(r){let n=r;return n&&cr.func(n.cancelUndispatched)}t.is=e})(cx=he.ConnectionStrategy||(he.ConnectionStrategy={}));var bg;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new vg.CancellationTokenSource}});function e(r){let n=r;return n&&cr.func(n.createCancellationTokenSource)}t.is=e})(bg=he.CancellationReceiverStrategy||(he.CancellationReceiverStrategy={}));var _g;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(eu.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&cr.func(n.sendCancellation)&&cr.func(n.cleanup)}t.is=e})(_g=he.CancellationSenderStrategy||(he.CancellationSenderStrategy={}));var Sg;(function(t){t.Message=Object.freeze({receiver:bg.Message,sender:_g.Message});function e(r){let n=r;return n&&bg.is(n.receiver)&&_g.is(n.sender)}t.is=e})(Sg=he.CancellationStrategy||(he.CancellationStrategy={}));var BN;(function(t){function e(r){let n=r;return n&&(Sg.is(n.cancellationStrategy)||cx.is(n.connectionStrategy))}t.is=e})(BN=he.ConnectionOptions||(he.ConnectionOptions={}));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 KN(t,e,r,n){let i=r!==void 0?r:he.NullLogger,o=0,s=0,a=0,c="2.0",f,p=new Map,m,T=new Map,k=new Map,A,N=new ox.LinkedMap,O=new Map,P=new Set,y=new Map,h=Ve.Off,C=Jn.Text,M,z=Qn.New,ce=new Qc.Emitter,we=new Qc.Emitter,Rt=new Qc.Emitter,tt=new Qc.Emitter,U=new Qc.Emitter,I=n&&n.cancellationStrategy?n.cancellationStrategy:Sg.Message;function K(D){if(D===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+D.toString()}function V(D){return D===null?"res-unknown-"+(++a).toString():"res-"+D.toString()}function Ce(){return"not-"+(++s).toString()}function me(D,R){ye.Message.isRequest(R)?D.set(K(R.id),R):ye.Message.isResponse(R)?D.set(V(R.id),R):D.set(Ce(),R)}function fe(D){}function gt(){return z===Qn.Listening}function ze(){return z===Qn.Closed}function _e(){return z===Qn.Disposed}function sr(){(z===Qn.New||z===Qn.Listening)&&(z=Qn.Closed,we.fire(void 0))}function Lr(D){ce.fire([D,void 0,void 0])}function Yi(D){ce.fire(D)}t.onClose(sr),t.onError(Lr),e.onClose(sr),e.onError(Yi);function Pn(){A||N.size===0||(A=(0,ix.default)().timer.setImmediate(()=>{A=void 0,zt()}))}function zt(){if(N.size===0)return;let D=N.shift();try{ye.Message.isRequest(D)?xt(D):ye.Message.isNotification(D)?sn(D):ye.Message.isResponse(D)?Vt(D):Ht(D)}finally{Pn()}}let bi=D=>{try{if(ye.Message.isNotification(D)&&D.method===eu.type.method){let R=D.params.id,E=K(R),L=N.get(E);if(ye.Message.isRequest(L)){let ue=n?.connectionStrategy,le=ue&&ue.cancelUndispatched?ue.cancelUndispatched(L,fe):void 0;if(le&&(le.error!==void 0||le.result!==void 0)){N.delete(E),y.delete(R),le.id=L.id,mr(le,D.method,Date.now()),e.write(le).catch(()=>i.error("Sending response for canceled message failed."));return}}let j=y.get(R);if(j!==void 0){j.cancel(),An(D);return}else P.add(R)}me(N,D)}finally{Pn()}};function xt(D){if(_e())return;function R(oe,te,ne){let de={jsonrpc:c,id:D.id};oe instanceof ye.ResponseError?de.error=oe.toJson():de.result=oe===void 0?null:oe,mr(de,te,ne),e.write(de).catch(()=>i.error("Sending response failed."))}function E(oe,te,ne){let de={jsonrpc:c,id:D.id,error:oe.toJson()};mr(de,te,ne),e.write(de).catch(()=>i.error("Sending response failed."))}function L(oe,te,ne){oe===void 0&&(oe=null);let de={jsonrpc:c,id:D.id,result:oe};mr(de,te,ne),e.write(de).catch(()=>i.error("Sending response failed."))}an(D);let j=p.get(D.method),ue,le;j&&(ue=j.type,le=j.handler);let Te=Date.now();if(le||f){let oe=D.id??String(Date.now()),te=I.receiver.createCancellationTokenSource(oe);D.id!==null&&P.has(D.id)&&te.cancel(),D.id!==null&&y.set(oe,te);try{let ne;if(le)if(D.params===void 0){if(ue!==void 0&&ue.numberOfParams!==0){E(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${D.method} defines ${ue.numberOfParams} params but received none.`),D.method,Te);return}ne=le(te.token)}else if(Array.isArray(D.params)){if(ue!==void 0&&ue.parameterStructures===ye.ParameterStructures.byName){E(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${D.method} defines parameters by name but received parameters by position`),D.method,Te);return}ne=le(...D.params,te.token)}else{if(ue!==void 0&&ue.parameterStructures===ye.ParameterStructures.byPosition){E(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${D.method} defines parameters by position but received parameters by name`),D.method,Te);return}ne=le(D.params,te.token)}else f&&(ne=f(D.method,D.params,te.token));let de=ne;ne?de.then?de.then(Ae=>{y.delete(oe),R(Ae,D.method,Te)},Ae=>{y.delete(oe),Ae instanceof ye.ResponseError?E(Ae,D.method,Te):Ae&&cr.string(Ae.message)?E(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${D.method} failed with message: ${Ae.message}`),D.method,Te):E(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${D.method} failed unexpectedly without providing any details.`),D.method,Te)}):(y.delete(oe),R(ne,D.method,Te)):(y.delete(oe),L(ne,D.method,Te))}catch(ne){y.delete(oe),ne instanceof ye.ResponseError?R(ne,D.method,Te):ne&&cr.string(ne.message)?E(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${D.method} failed with message: ${ne.message}`),D.method,Te):E(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${D.method} failed unexpectedly without providing any details.`),D.method,Te)}}else E(new ye.ResponseError(ye.ErrorCodes.MethodNotFound,`Unhandled method ${D.method}`),D.method,Te)}function Vt(D){if(!_e())if(D.id===null)D.error?i.error(`Received response message without id: Error is:
4
- ${JSON.stringify(D.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let R=D.id,E=O.get(R);if(Ji(D,E),E!==void 0){O.delete(R);try{if(D.error){let L=D.error;E.reject(new ye.ResponseError(L.code,L.message,L.data))}else if(D.result!==void 0)E.resolve(D.result);else throw new Error("Should never happen.")}catch(L){L.message?i.error(`Response handler '${E.method}' failed with message: ${L.message}`):i.error(`Response handler '${E.method}' failed unexpectedly.`)}}}}function sn(D){if(_e())return;let R,E;if(D.method===eu.type.method){let L=D.params.id;P.delete(L),An(D);return}else{let L=T.get(D.method);L&&(E=L.handler,R=L.type)}if(E||m)try{if(An(D),E)if(D.params===void 0)R!==void 0&&R.numberOfParams!==0&&R.parameterStructures!==ye.ParameterStructures.byName&&i.error(`Notification ${D.method} defines ${R.numberOfParams} params but received none.`),E();else if(Array.isArray(D.params)){let L=D.params;D.method===Zc.type.method&&L.length===2&&sx.is(L[0])?E({token:L[0],value:L[1]}):(R!==void 0&&(R.parameterStructures===ye.ParameterStructures.byName&&i.error(`Notification ${D.method} defines parameters by name but received parameters by position`),R.numberOfParams!==D.params.length&&i.error(`Notification ${D.method} defines ${R.numberOfParams} params but received ${L.length} arguments`)),E(...L))}else R!==void 0&&R.parameterStructures===ye.ParameterStructures.byPosition&&i.error(`Notification ${D.method} defines parameters by position but received parameters by name`),E(D.params);else m&&m(D.method,D.params)}catch(L){L.message?i.error(`Notification handler '${D.method}' failed with message: ${L.message}`):i.error(`Notification handler '${D.method}' failed unexpectedly.`)}else Rt.fire(D)}function Ht(D){if(!D){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
5
- ${JSON.stringify(D,null,4)}`);let R=D;if(cr.string(R.id)||cr.number(R.id)){let E=R.id,L=O.get(E);L&&L.reject(new Error("The received response has neither a result nor an error property."))}}function rt(D){if(D!=null)switch(h){case Ve.Verbose:return JSON.stringify(D,null,4);case Ve.Compact:return JSON.stringify(D);default:return}}function wt(D){if(!(h===Ve.Off||!M))if(C===Jn.Text){let R;(h===Ve.Verbose||h===Ve.Compact)&&D.params&&(R=`Params: ${rt(D.params)}
1
+ (()=>{var RL=Object.create;var tf=Object.defineProperty;var xL=Object.getOwnPropertyDescriptor;var bL=Object.getOwnPropertyNames;var _L=Object.getPrototypeOf,SL=Object.prototype.hasOwnProperty;var Lb=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var kL=(t,e)=>()=>(t&&(e=t(t=0)),e);var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Mb=(t,e)=>{for(var r in e)tf(t,r,{get:e[r],enumerable:!0})},$b=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bL(e))!SL.call(t,i)&&i!==r&&tf(t,i,{get:()=>e[i],enumerable:!(n=xL(e,i))||n.enumerable});return t};var De=(t,e,r)=>(r=t!=null?RL(_L(t)):{},$b(e||!t||!t.__esModule?tf(r,"default",{value:t,enumerable:!0}):r,t)),ug=t=>$b(tf({},"__esModule",{value:!0}),t);var Ki=M(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});var lg;function fg(){if(lg===void 0)throw new Error("No runtime abstraction layer installed");return lg}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");lg=r}t.install=e})(fg||(fg={}));dg.default=fg});var pg=M(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.Disposable=void 0;var wL;(function(t){function e(r){return{dispose:r}}t.create=e})(wL=uu.Disposable||(uu.Disposable={}))});var vs=M(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.Emitter=ys.Event=void 0;var CL=Ki(),EL;(function(t){let e={dispose(){}};t.None=function(){return e}})(EL=ys.Event||(ys.Event={}));var mg=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,CL.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},rf=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new mg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.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)}};ys.Emitter=rf;rf._noop=function(){}});var Fb=M(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.AbstractMessageBuffer=void 0;var PL=13,AL=10,DL=`\r
2
+ `,hg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,r=0,n=0,i=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(n=0;n<c.length;){switch(c[n]){case PL:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case AL:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}i+=c.byteLength,r++}if(e!==4)return;let o=this._read(i+n),s=new Map,a=this.toString(o,"ascii").split(DL);if(a.length<2)return s;for(let c=0;c<a.length-2;c++){let u=a[c],l=u.indexOf(":");if(l===-1)throw new Error("Message header must separate key and value using :");let f=u.substr(0,l),g=u.substr(l+1).trim();s.set(f,g)}return s}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 o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);r.set(s,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};nf.AbstractMessageBuffer=hg});var Ub=M(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});var qb=Ki(),na=pg(),NL=vs(),IL=Fb(),of=class t extends IL.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}};of.emptyBuffer=new Uint8Array(0);var gg=class{constructor(e){this.socket=e,this._onData=new NL.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,qb.default)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),na.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),na.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),na.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}},yg=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),na.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),na.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),na.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},OL=new TextEncoder,jb=Object.freeze({messageBuffer:Object.freeze({create:t=>new of(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(OL.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new gg(t),asWritableStream:t=>new yg(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function vg(){return jb}(function(t){function e(){qb.default.install(jb)}t.install=e})(vg||(vg={}));Tg.default=vg});var ia=M(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.stringArray=Ar.array=Ar.func=Ar.error=Ar.number=Ar.string=Ar.boolean=void 0;function LL(t){return t===!0||t===!1}Ar.boolean=LL;function Wb(t){return typeof t=="string"||t instanceof String}Ar.string=Wb;function ML(t){return typeof t=="number"||t instanceof Number}Ar.number=ML;function $L(t){return t instanceof Error}Ar.error=$L;function FL(t){return typeof t=="function"}Ar.func=FL;function Hb(t){return Array.isArray(t)}Ar.array=Hb;function qL(t){return Hb(t)&&t.every(e=>Wb(e))}Ar.stringArray=qL});var Hg=M(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.Message=re.NotificationType9=re.NotificationType8=re.NotificationType7=re.NotificationType6=re.NotificationType5=re.NotificationType4=re.NotificationType3=re.NotificationType2=re.NotificationType1=re.NotificationType0=re.NotificationType=re.RequestType9=re.RequestType8=re.RequestType7=re.RequestType6=re.RequestType5=re.RequestType4=re.RequestType3=re.RequestType2=re.RequestType1=re.RequestType=re.RequestType0=re.AbstractMessageSignature=re.ParameterStructures=re.ResponseError=re.ErrorCodes=void 0;var Ts=ia(),Gb;(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})(Gb=re.ErrorCodes||(re.ErrorCodes={}));var Rg=class t extends Error{constructor(e,r,n){super(r),this.code=Ts.number(e)?e:Gb.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};re.ResponseError=Rg;var Zr=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};re.ParameterStructures=Zr;Zr.auto=new Zr("auto");Zr.byPosition=new Zr("byPosition");Zr.byName=new Zr("byName");var pt=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Zr.auto}};re.AbstractMessageSignature=pt;var xg=class extends pt{constructor(e){super(e,0)}};re.RequestType0=xg;var bg=class extends pt{constructor(e,r=Zr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};re.RequestType=bg;var _g=class extends pt{constructor(e,r=Zr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};re.RequestType1=_g;var Sg=class extends pt{constructor(e){super(e,2)}};re.RequestType2=Sg;var kg=class extends pt{constructor(e){super(e,3)}};re.RequestType3=kg;var wg=class extends pt{constructor(e){super(e,4)}};re.RequestType4=wg;var Cg=class extends pt{constructor(e){super(e,5)}};re.RequestType5=Cg;var Eg=class extends pt{constructor(e){super(e,6)}};re.RequestType6=Eg;var Pg=class extends pt{constructor(e){super(e,7)}};re.RequestType7=Pg;var Ag=class extends pt{constructor(e){super(e,8)}};re.RequestType8=Ag;var Dg=class extends pt{constructor(e){super(e,9)}};re.RequestType9=Dg;var Ng=class extends pt{constructor(e,r=Zr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};re.NotificationType=Ng;var Ig=class extends pt{constructor(e){super(e,0)}};re.NotificationType0=Ig;var Og=class extends pt{constructor(e,r=Zr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};re.NotificationType1=Og;var Lg=class extends pt{constructor(e){super(e,2)}};re.NotificationType2=Lg;var Mg=class extends pt{constructor(e){super(e,3)}};re.NotificationType3=Mg;var $g=class extends pt{constructor(e){super(e,4)}};re.NotificationType4=$g;var Fg=class extends pt{constructor(e){super(e,5)}};re.NotificationType5=Fg;var qg=class extends pt{constructor(e){super(e,6)}};re.NotificationType6=qg;var jg=class extends pt{constructor(e){super(e,7)}};re.NotificationType7=jg;var Ug=class extends pt{constructor(e){super(e,8)}};re.NotificationType8=Ug;var Wg=class extends pt{constructor(e){super(e,9)}};re.NotificationType9=Wg;var jL;(function(t){function e(i){let o=i;return o&&Ts.string(o.method)&&(Ts.string(o.id)||Ts.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Ts.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Ts.string(o.id)||Ts.number(o.id)||o.id===null)}t.isResponse=n})(jL=re.Message||(re.Message={}))});var Bg=M(zi=>{"use strict";var Bb;Object.defineProperty(zi,"__esModule",{value:!0});zi.LRUCache=zi.LinkedMap=zi.Touch=void 0;var Hr;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Hr=zi.Touch||(zi.Touch={}));var sf=class{constructor(){this[Bb]="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,r=Hr.None){let n=this._map.get(e);if(n)return r!==Hr.None&&this.touch(n,r),n.value}set(e,r,n=Hr.None){let i=this._map.get(e);if(i)i.value=r,n!==Hr.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Hr.None:this.addItemLast(i);break;case Hr.First:this.addItemFirst(i);break;case Hr.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 r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.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,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(Bb=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.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 r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Hr.First&&r!==Hr.Last)){if(r===Hr.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Hr.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};zi.LinkedMap=sf;var Gg=class extends sf{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),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,r=Hr.AsNew){return super.get(e,r)}peek(e){return super.get(e,Hr.None)}set(e,r){return super.set(e,r,Hr.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};zi.LRUCache=Gg});var Xg=M(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.CancellationTokenSource=Rs.CancellationToken=void 0;var UL=Ki(),WL=ia(),Kg=vs(),zg;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Kg.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Kg.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||WL.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(zg=Rs.CancellationToken||(Rs.CancellationToken={}));var HL=Object.freeze(function(t,e){let r=(0,UL.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),af=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?HL:(this._emitter||(this._emitter=new Kg.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Vg=class{get token(){return this._token||(this._token=new af),this._token}cancel(){this._token?this._token.cancel():this._token=zg.Cancelled}dispose(){this._token?this._token instanceof af&&this._token.dispose():this._token=zg.None}};Rs.CancellationTokenSource=Vg});var Kb=M(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.ReadableStreamMessageReader=Vi.AbstractMessageReader=Vi.MessageReader=void 0;var Jg=Ki(),oa=ia(),Yg=vs(),GL;(function(t){function e(r){let n=r;return n&&oa.func(n.listen)&&oa.func(n.dispose)&&oa.func(n.onError)&&oa.func(n.onClose)&&oa.func(n.onPartialMessage)}t.is=e})(GL=Vi.MessageReader||(Vi.MessageReader={}));var cf=class{constructor(){this.errorEmitter=new Yg.Emitter,this.closeEmitter=new Yg.Emitter,this.partialMessageEmitter=new Yg.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: ${oa.string(e.message)?e.message:"unknown"}`)}};Vi.AbstractMessageReader=cf;var Qg;(function(t){function e(r){let n,i,o,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,s.set(o.name,o)),r.contentDecoders!==void 0)for(let u of r.contentDecoders)s.set(u.name,u);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let u of r.contentTypeDecoders)c.set(u.name,u)}return a===void 0&&(a=(0,Jg.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(Qg||(Qg={}));var Zg=class extends cf{constructor(e,r){super(),this.readable=e,this.options=Qg.fromOptions(r),this.buffer=(0,Jg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}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 r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders();if(!i)return;let o=i.get("Content-Length");if(!o)throw new Error("Header must provide a Content-Length property.");let s=parseInt(o);if(isNaN(s))throw new Error("Content-Length value must be a number.");this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let n;this.options.contentDecoder!==void 0?n=this.options.contentDecoder.decode(r):n=Promise.resolve(r),n.then(i=>{this.options.contentTypeDecoder.decode(i,this.options).then(o=>{this.callback(o)},o=>{this.fireError(o)})},i=>{this.fireError(i)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Jg.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Vi.ReadableStreamMessageReader=Zg});var zb=M(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.Semaphore=void 0;var BL=Ki(),ey=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((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,BL.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 r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};uf.Semaphore=ey});var Jb=M(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.WriteableStreamMessageWriter=Xi.AbstractMessageWriter=Xi.MessageWriter=void 0;var Vb=Ki(),lu=ia(),KL=zb(),Xb=vs(),zL="Content-Length: ",Yb=`\r
3
+ `,VL;(function(t){function e(r){let n=r;return n&&lu.func(n.dispose)&&lu.func(n.onClose)&&lu.func(n.onError)&&lu.func(n.write)}t.is=e})(VL=Xi.MessageWriter||(Xi.MessageWriter={}));var lf=class{constructor(){this.errorEmitter=new Xb.Emitter,this.closeEmitter=new Xb.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}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: ${lu.string(e.message)?e.message:"unknown"}`)}};Xi.AbstractMessageWriter=lf;var ty;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,Vb.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,Vb.default)().applicationJson.encoder}}t.fromOptions=e})(ty||(ty={}));var ry=class extends lf{constructor(e,r){super(),this.writable=e,this.options=ty.fromOptions(r),this.errorCount=0,this.writeSemaphore=new KL.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(zL,n.byteLength.toString(),Yb),i.push(Yb),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Xi.WriteableStreamMessageWriter=ry});var n_=M(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.createMessageConnection=le.ConnectionOptions=le.CancellationStrategy=le.CancellationSenderStrategy=le.CancellationReceiverStrategy=le.ConnectionStrategy=le.ConnectionError=le.ConnectionErrors=le.LogTraceNotification=le.SetTraceNotification=le.TraceFormat=le.TraceValues=le.Trace=le.NullLogger=le.ProgressType=le.ProgressToken=void 0;var Qb=Ki(),nr=ia(),pe=Hg(),Zb=Bg(),fu=vs(),ny=Xg(),pu;(function(t){t.type=new pe.NotificationType("$/cancelRequest")})(pu||(pu={}));var e_;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(e_=le.ProgressToken||(le.ProgressToken={}));var du;(function(t){t.type=new pe.NotificationType("$/progress")})(du||(du={}));var iy=class{constructor(){}};le.ProgressType=iy;var oy;(function(t){function e(r){return nr.func(r)}t.is=e})(oy||(oy={}));le.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ke;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ke=le.Trace||(le.Trace={}));var XL;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(XL=le.TraceValues||(le.TraceValues={}));(function(t){function e(n){if(!nr.string(n))return t.Off;switch(n=n.toLowerCase(),n){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 r(n){switch(n){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=r})(Ke=le.Trace||(le.Trace={}));var Xn;(function(t){t.Text="text",t.JSON="json"})(Xn=le.TraceFormat||(le.TraceFormat={}));(function(t){function e(r){return nr.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Xn=le.TraceFormat||(le.TraceFormat={}));var t_;(function(t){t.type=new pe.NotificationType("$/setTrace")})(t_=le.SetTraceNotification||(le.SetTraceNotification={}));var sy;(function(t){t.type=new pe.NotificationType("$/logTrace")})(sy=le.LogTraceNotification||(le.LogTraceNotification={}));var ff;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ff=le.ConnectionErrors||(le.ConnectionErrors={}));var sa=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};le.ConnectionError=sa;var r_;(function(t){function e(r){let n=r;return n&&nr.func(n.cancelUndispatched)}t.is=e})(r_=le.ConnectionStrategy||(le.ConnectionStrategy={}));var ay;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new ny.CancellationTokenSource}});function e(r){let n=r;return n&&nr.func(n.createCancellationTokenSource)}t.is=e})(ay=le.CancellationReceiverStrategy||(le.CancellationReceiverStrategy={}));var cy;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(pu.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&nr.func(n.sendCancellation)&&nr.func(n.cleanup)}t.is=e})(cy=le.CancellationSenderStrategy||(le.CancellationSenderStrategy={}));var uy;(function(t){t.Message=Object.freeze({receiver:ay.Message,sender:cy.Message});function e(r){let n=r;return n&&ay.is(n.receiver)&&cy.is(n.sender)}t.is=e})(uy=le.CancellationStrategy||(le.CancellationStrategy={}));var YL;(function(t){function e(r){let n=r;return n&&(uy.is(n.cancellationStrategy)||r_.is(n.connectionStrategy))}t.is=e})(YL=le.ConnectionOptions||(le.ConnectionOptions={}));var Yn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Yn||(Yn={}));function JL(t,e,r,n){let i=r!==void 0?r:le.NullLogger,o=0,s=0,a=0,c="2.0",u,l=new Map,f,g=new Map,T=new Map,C,P=new Zb.LinkedMap,O=new Map,E=new Set,m=new Map,d=Ke.Off,_=Xn.Text,$,X=Yn.New,ke=new fu.Emitter,Me=new fu.Emitter,Bt=new fu.Emitter,_t=new fu.Emitter,G=new fu.Emitter,A=n&&n.cancellationStrategy?n.cancellationStrategy:uy.Message;function z(b){if(b===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+b.toString()}function Y(b){return b===null?"res-unknown-"+(++a).toString():"res-"+b.toString()}function Ce(){return"not-"+(++s).toString()}function fe(b,y){pe.Message.isRequest(y)?b.set(z(y.id),y):pe.Message.isResponse(y)?b.set(Y(y.id),y):b.set(Ce(),y)}function ce(b){}function St(){return X===Yn.Listening}function ft(){return X===Yn.Closed}function be(){return X===Yn.Disposed}function Er(){(X===Yn.New||X===Yn.Listening)&&(X=Yn.Closed,Me.fire(void 0))}function Bn(b){ke.fire([b,void 0,void 0])}function ms(b){ke.fire(b)}t.onClose(Er),t.onError(Bn),e.onClose(Er),e.onError(ms);function mi(){C||P.size===0||(C=(0,Qb.default)().timer.setImmediate(()=>{C=void 0,cr()}))}function cr(){if(P.size===0)return;let b=P.shift();try{pe.Message.isRequest(b)?Nt(b):pe.Message.isNotification(b)?Sn(b):pe.Message.isResponse(b)?ur(b):rr(b)}finally{mi()}}let _o=b=>{try{if(pe.Message.isNotification(b)&&b.method===pu.type.method){let y=b.params.id,k=z(y),L=P.get(k);if(pe.Message.isRequest(L)){let se=n?.connectionStrategy,ae=se&&se.cancelUndispatched?se.cancelUndispatched(L,ce):void 0;if(ae&&(ae.error!==void 0||ae.result!==void 0)){P.delete(k),m.delete(y),ae.id=L.id,Pr(ae,b.method,Date.now()),e.write(ae).catch(()=>i.error("Sending response for canceled message failed."));return}}let U=m.get(y);if(U!==void 0){U.cancel(),hi(b);return}else E.add(y)}fe(P,b)}finally{mi()}};function Nt(b){if(be())return;function y(ne,te,ie){let ue={jsonrpc:c,id:b.id};ne instanceof pe.ResponseError?ue.error=ne.toJson():ue.result=ne===void 0?null:ne,Pr(ue,te,ie),e.write(ue).catch(()=>i.error("Sending response failed."))}function k(ne,te,ie){let ue={jsonrpc:c,id:b.id,error:ne.toJson()};Pr(ue,te,ie),e.write(ue).catch(()=>i.error("Sending response failed."))}function L(ne,te,ie){ne===void 0&&(ne=null);let ue={jsonrpc:c,id:b.id,result:ne};Pr(ue,te,ie),e.write(ue).catch(()=>i.error("Sending response failed."))}kn(b);let U=l.get(b.method),se,ae;U&&(se=U.type,ae=U.handler);let ye=Date.now();if(ae||u){let ne=b.id??String(Date.now()),te=A.receiver.createCancellationTokenSource(ne);b.id!==null&&E.has(b.id)&&te.cancel(),b.id!==null&&m.set(ne,te);try{let ie;if(ae)if(b.params===void 0){if(se!==void 0&&se.numberOfParams!==0){k(new pe.ResponseError(pe.ErrorCodes.InvalidParams,`Request ${b.method} defines ${se.numberOfParams} params but received none.`),b.method,ye);return}ie=ae(te.token)}else if(Array.isArray(b.params)){if(se!==void 0&&se.parameterStructures===pe.ParameterStructures.byName){k(new pe.ResponseError(pe.ErrorCodes.InvalidParams,`Request ${b.method} defines parameters by name but received parameters by position`),b.method,ye);return}ie=ae(...b.params,te.token)}else{if(se!==void 0&&se.parameterStructures===pe.ParameterStructures.byPosition){k(new pe.ResponseError(pe.ErrorCodes.InvalidParams,`Request ${b.method} defines parameters by position but received parameters by name`),b.method,ye);return}ie=ae(b.params,te.token)}else u&&(ie=u(b.method,b.params,te.token));let ue=ie;ie?ue.then?ue.then(Ee=>{m.delete(ne),y(Ee,b.method,ye)},Ee=>{m.delete(ne),Ee instanceof pe.ResponseError?k(Ee,b.method,ye):Ee&&nr.string(Ee.message)?k(new pe.ResponseError(pe.ErrorCodes.InternalError,`Request ${b.method} failed with message: ${Ee.message}`),b.method,ye):k(new pe.ResponseError(pe.ErrorCodes.InternalError,`Request ${b.method} failed unexpectedly without providing any details.`),b.method,ye)}):(m.delete(ne),y(ie,b.method,ye)):(m.delete(ne),L(ie,b.method,ye))}catch(ie){m.delete(ne),ie instanceof pe.ResponseError?y(ie,b.method,ye):ie&&nr.string(ie.message)?k(new pe.ResponseError(pe.ErrorCodes.InternalError,`Request ${b.method} failed with message: ${ie.message}`),b.method,ye):k(new pe.ResponseError(pe.ErrorCodes.InternalError,`Request ${b.method} failed unexpectedly without providing any details.`),b.method,ye)}}else k(new pe.ResponseError(pe.ErrorCodes.MethodNotFound,`Unhandled method ${b.method}`),b.method,ye)}function ur(b){if(!be())if(b.id===null)b.error?i.error(`Received response message without id: Error is:
4
+ ${JSON.stringify(b.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let y=b.id,k=O.get(y);if(hs(b,k),k!==void 0){O.delete(y);try{if(b.error){let L=b.error;k.reject(new pe.ResponseError(L.code,L.message,L.data))}else if(b.result!==void 0)k.resolve(b.result);else throw new Error("Should never happen.")}catch(L){L.message?i.error(`Response handler '${k.method}' failed with message: ${L.message}`):i.error(`Response handler '${k.method}' failed unexpectedly.`)}}}}function Sn(b){if(be())return;let y,k;if(b.method===pu.type.method){let L=b.params.id;E.delete(L),hi(b);return}else{let L=g.get(b.method);L&&(k=L.handler,y=L.type)}if(k||f)try{if(hi(b),k)if(b.params===void 0)y!==void 0&&y.numberOfParams!==0&&y.parameterStructures!==pe.ParameterStructures.byName&&i.error(`Notification ${b.method} defines ${y.numberOfParams} params but received none.`),k();else if(Array.isArray(b.params)){let L=b.params;b.method===du.type.method&&L.length===2&&e_.is(L[0])?k({token:L[0],value:L[1]}):(y!==void 0&&(y.parameterStructures===pe.ParameterStructures.byName&&i.error(`Notification ${b.method} defines parameters by name but received parameters by position`),y.numberOfParams!==b.params.length&&i.error(`Notification ${b.method} defines ${y.numberOfParams} params but received ${L.length} arguments`)),k(...L))}else y!==void 0&&y.parameterStructures===pe.ParameterStructures.byPosition&&i.error(`Notification ${b.method} defines parameters by position but received parameters by name`),k(b.params);else f&&f(b.method,b.params)}catch(L){L.message?i.error(`Notification handler '${b.method}' failed with message: ${L.message}`):i.error(`Notification handler '${b.method}' failed unexpectedly.`)}else Bt.fire(b)}function rr(b){if(!b){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
5
+ ${JSON.stringify(b,null,4)}`);let y=b;if(nr.string(y.id)||nr.number(y.id)){let k=y.id,L=O.get(k);L&&L.reject(new Error("The received response has neither a result nor an error property."))}}function gt(b){if(b!=null)switch(d){case Ke.Verbose:return JSON.stringify(b,null,4);case Ke.Compact:return JSON.stringify(b);default:return}}function qt(b){if(!(d===Ke.Off||!$))if(_===Xn.Text){let y;(d===Ke.Verbose||d===Ke.Compact)&&b.params&&(y=`Params: ${gt(b.params)}
6
6
 
7
- `),M.log(`Sending request '${D.method} - (${D.id})'.`,R)}else Nn("send-request",D)}function xr(D){if(!(h===Ve.Off||!M))if(C===Jn.Text){let R;(h===Ve.Verbose||h===Ve.Compact)&&(D.params?R=`Params: ${rt(D.params)}
7
+ `),$.log(`Sending request '${b.method} - (${b.id})'.`,y)}else gi("send-request",b)}function Wr(b){if(!(d===Ke.Off||!$))if(_===Xn.Text){let y;(d===Ke.Verbose||d===Ke.Compact)&&(b.params?y=`Params: ${gt(b.params)}
8
8
 
9
- `:R=`No parameters provided.
9
+ `:y=`No parameters provided.
10
10
 
11
- `),M.log(`Sending notification '${D.method}'.`,R)}else Nn("send-notification",D)}function mr(D,R,E){if(!(h===Ve.Off||!M))if(C===Jn.Text){let L;(h===Ve.Verbose||h===Ve.Compact)&&(D.error&&D.error.data?L=`Error data: ${rt(D.error.data)}
11
+ `),$.log(`Sending notification '${b.method}'.`,y)}else gi("send-notification",b)}function Pr(b,y,k){if(!(d===Ke.Off||!$))if(_===Xn.Text){let L;(d===Ke.Verbose||d===Ke.Compact)&&(b.error&&b.error.data?L=`Error data: ${gt(b.error.data)}
12
12
 
13
- `:D.result?L=`Result: ${rt(D.result)}
13
+ `:b.result?L=`Result: ${gt(b.result)}
14
14
 
15
- `:D.error===void 0&&(L=`No result returned.
15
+ `:b.error===void 0&&(L=`No result returned.
16
16
 
17
- `)),M.log(`Sending response '${R} - (${D.id})'. Processing request took ${Date.now()-E}ms`,L)}else Nn("send-response",D)}function an(D){if(!(h===Ve.Off||!M))if(C===Jn.Text){let R;(h===Ve.Verbose||h===Ve.Compact)&&D.params&&(R=`Params: ${rt(D.params)}
17
+ `)),$.log(`Sending response '${y} - (${b.id})'. Processing request took ${Date.now()-k}ms`,L)}else gi("send-response",b)}function kn(b){if(!(d===Ke.Off||!$))if(_===Xn.Text){let y;(d===Ke.Verbose||d===Ke.Compact)&&b.params&&(y=`Params: ${gt(b.params)}
18
18
 
19
- `),M.log(`Received request '${D.method} - (${D.id})'.`,R)}else Nn("receive-request",D)}function An(D){if(!(h===Ve.Off||!M||D.method===xg.type.method))if(C===Jn.Text){let R;(h===Ve.Verbose||h===Ve.Compact)&&(D.params?R=`Params: ${rt(D.params)}
19
+ `),$.log(`Received request '${b.method} - (${b.id})'.`,y)}else gi("receive-request",b)}function hi(b){if(!(d===Ke.Off||!$||b.method===sy.type.method))if(_===Xn.Text){let y;(d===Ke.Verbose||d===Ke.Compact)&&(b.params?y=`Params: ${gt(b.params)}
20
20
 
21
- `:R=`No parameters provided.
21
+ `:y=`No parameters provided.
22
22
 
23
- `),M.log(`Received notification '${D.method}'.`,R)}else Nn("receive-notification",D)}function Ji(D,R){if(!(h===Ve.Off||!M))if(C===Jn.Text){let E;if((h===Ve.Verbose||h===Ve.Compact)&&(D.error&&D.error.data?E=`Error data: ${rt(D.error.data)}
23
+ `),$.log(`Received notification '${b.method}'.`,y)}else gi("receive-notification",b)}function hs(b,y){if(!(d===Ke.Off||!$))if(_===Xn.Text){let k;if((d===Ke.Verbose||d===Ke.Compact)&&(b.error&&b.error.data?k=`Error data: ${gt(b.error.data)}
24
24
 
25
- `:D.result?E=`Result: ${rt(D.result)}
25
+ `:b.result?k=`Result: ${gt(b.result)}
26
26
 
27
- `:D.error===void 0&&(E=`No result returned.
27
+ `:b.error===void 0&&(k=`No result returned.
28
28
 
29
- `)),R){let L=D.error?` Request failed: ${D.error.message} (${D.error.code}).`:"";M.log(`Received response '${R.method} - (${D.id})' in ${Date.now()-R.timerStart}ms.${L}`,E)}else M.log(`Received response ${D.id} without active response promise.`,E)}else Nn("receive-response",D)}function Nn(D,R){if(!M||h===Ve.Off)return;let E={isLSPMessage:!0,type:D,message:R,timestamp:Date.now()};M.log(E)}function Mr(){if(ze())throw new oa(Jl.Closed,"Connection is closed.");if(_e())throw new oa(Jl.Disposed,"Connection is disposed.")}function Xn(){if(gt())throw new oa(Jl.AlreadyListening,"Connection is already listening")}function gs(){if(!gt())throw new Error("Call listen() first.")}function Yn(D){return D===void 0?null:D}function $r(D){if(D!==null)return D}function Qi(D){return D!=null&&!Array.isArray(D)&&typeof D=="object"}function _i(D,R){switch(D){case ye.ParameterStructures.auto:return Qi(R)?$r(R):[Yn(R)];case ye.ParameterStructures.byName:if(!Qi(R))throw new Error("Received parameters by name but param is not an object literal.");return $r(R);case ye.ParameterStructures.byPosition:return[Yn(R)];default:throw new Error(`Unknown parameter structure ${D.toString()}`)}}function Si(D,R){let E,L=D.numberOfParams;switch(L){case 0:E=void 0;break;case 1:E=_i(D.parameterStructures,R[0]);break;default:E=[];for(let j=0;j<R.length&&j<L;j++)E.push(Yn(R[j]));if(R.length<L)for(let j=R.length;j<L;j++)E.push(null);break}return E}let yn={sendNotification:(D,...R)=>{Mr();let E,L;if(cr.string(D)){E=D;let ue=R[0],le=0,Te=ye.ParameterStructures.auto;ye.ParameterStructures.is(ue)&&(le=1,Te=ue);let oe=R.length,te=oe-le;switch(te){case 0:L=void 0;break;case 1:L=_i(Te,R[le]);break;default:if(Te===ye.ParameterStructures.byName)throw new Error(`Received ${te} parameters for 'by Name' notification parameter structure.`);L=R.slice(le,oe).map(ne=>Yn(ne));break}}else{let ue=R;E=D.method,L=Si(D,ue)}let j={jsonrpc:c,method:E,params:L};return xr(j),e.write(j).catch(()=>i.error("Sending notification failed."))},onNotification:(D,R)=>{Mr();let E;return cr.func(D)?m=D:R&&(cr.string(D)?(E=D,T.set(D,{type:void 0,handler:R})):(E=D.method,T.set(D.method,{type:D,handler:R}))),{dispose:()=>{E!==void 0?T.delete(E):m=void 0}}},onProgress:(D,R,E)=>{if(k.has(R))throw new Error(`Progress handler for token ${R} already registered`);return k.set(R,E),{dispose:()=>{k.delete(R)}}},sendProgress:(D,R,E)=>yn.sendNotification(Zc.type,{token:R,value:E}),onUnhandledProgress:tt.event,sendRequest:(D,...R)=>{Mr(),gs();let E,L,j;if(cr.string(D)){E=D;let oe=R[0],te=R[R.length-1],ne=0,de=ye.ParameterStructures.auto;ye.ParameterStructures.is(oe)&&(ne=1,de=oe);let Ae=R.length;vg.CancellationToken.is(te)&&(Ae=Ae-1,j=te);let ot=Ae-ne;switch(ot){case 0:L=void 0;break;case 1:L=_i(de,R[ne]);break;default:if(de===ye.ParameterStructures.byName)throw new Error(`Received ${ot} parameters for 'by Name' request parameter structure.`);L=R.slice(ne,Ae).map(Dt=>Yn(Dt));break}}else{let oe=R;E=D.method,L=Si(D,oe);let te=D.numberOfParams;j=vg.CancellationToken.is(oe[te])?oe[te]:void 0}let ue=o++,le;return j&&(le=j.onCancellationRequested(()=>{let oe=I.sender.sendCancellation(yn,ue);return oe===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${ue}`),Promise.resolve()):oe.catch(()=>{i.log(`Sending cancellation messages for id ${ue} failed`)})})),new Promise((oe,te)=>{let ne={jsonrpc:c,id:ue,method:E,params:L},de=Dt=>{oe(Dt),I.sender.cleanup(ue),le?.dispose()},Ae=Dt=>{te(Dt),I.sender.cleanup(ue),le?.dispose()},ot={method:E,timerStart:Date.now(),resolve:de,reject:Ae};wt(ne);try{e.write(ne).catch(()=>i.error("Sending request failed."))}catch(Dt){ot.reject(new ye.ResponseError(ye.ErrorCodes.MessageWriteError,Dt.message?Dt.message:"Unknown reason")),ot=null}ot&&O.set(ue,ot)})},onRequest:(D,R)=>{Mr();let E=null;return Rg.is(D)?(E=void 0,f=D):cr.string(D)?(E=null,R!==void 0&&(E=D,p.set(D,{handler:R,type:void 0}))):R!==void 0&&(E=D.method,p.set(D.method,{type:D,handler:R})),{dispose:()=>{E!==null&&(E!==void 0?p.delete(E):f=void 0)}}},hasPendingResponse:()=>O.size>0,trace:async(D,R,E)=>{let L=!1,j=Jn.Text;E!==void 0&&(cr.boolean(E)?L=E:(L=E.sendNotification||!1,j=E.traceFormat||Jn.Text)),h=D,C=j,h===Ve.Off?M=void 0:M=R,L&&!ze()&&!_e()&&await yn.sendNotification(ax.type,{value:Ve.toString(D)})},onError:ce.event,onClose:we.event,onUnhandledNotification:Rt.event,onDispose:U.event,end:()=>{e.end()},dispose:()=>{if(_e())return;z=Qn.Disposed,U.fire(void 0);let D=new ye.ResponseError(ye.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let R of O.values())R.reject(D);O=new Map,y=new Map,P=new Set,N=new ox.LinkedMap,cr.func(e.dispose)&&e.dispose(),cr.func(t.dispose)&&t.dispose()},listen:()=>{Mr(),Xn(),z=Qn.Listening,t.listen(bi)},inspect:()=>{(0,ix.default)().console.log("inspect")}};return yn.onNotification(xg.type,D=>{if(h===Ve.Off||!M)return;let R=h===Ve.Verbose||h===Ve.Compact;M.log(D.message,R?D.verbose:void 0)}),yn.onNotification(Zc.type,D=>{let R=k.get(D.token);R?R(D.value):tt.fire(D)}),yn}he.createMessageConnection=KN});var Dg=$(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.TraceFormat=F.TraceValues=F.Trace=F.ProgressType=F.ProgressToken=F.createMessageConnection=F.NullLogger=F.ConnectionOptions=F.ConnectionStrategy=F.WriteableStreamMessageWriter=F.AbstractMessageWriter=F.MessageWriter=F.ReadableStreamMessageReader=F.AbstractMessageReader=F.MessageReader=F.CancellationToken=F.CancellationTokenSource=F.Emitter=F.Event=F.Disposable=F.LRUCache=F.Touch=F.LinkedMap=F.ParameterStructures=F.NotificationType9=F.NotificationType8=F.NotificationType7=F.NotificationType6=F.NotificationType5=F.NotificationType4=F.NotificationType3=F.NotificationType2=F.NotificationType1=F.NotificationType0=F.NotificationType=F.ErrorCodes=F.ResponseError=F.RequestType9=F.RequestType8=F.RequestType7=F.RequestType6=F.RequestType5=F.RequestType4=F.RequestType3=F.RequestType2=F.RequestType1=F.RequestType0=F.RequestType=F.Message=F.RAL=void 0;F.CancellationStrategy=F.CancellationSenderStrategy=F.CancellationReceiverStrategy=F.ConnectionError=F.ConnectionErrors=F.LogTraceNotification=F.SetTraceNotification=void 0;var ct=ig();Object.defineProperty(F,"Message",{enumerable:!0,get:function(){return ct.Message}});Object.defineProperty(F,"RequestType",{enumerable:!0,get:function(){return ct.RequestType}});Object.defineProperty(F,"RequestType0",{enumerable:!0,get:function(){return ct.RequestType0}});Object.defineProperty(F,"RequestType1",{enumerable:!0,get:function(){return ct.RequestType1}});Object.defineProperty(F,"RequestType2",{enumerable:!0,get:function(){return ct.RequestType2}});Object.defineProperty(F,"RequestType3",{enumerable:!0,get:function(){return ct.RequestType3}});Object.defineProperty(F,"RequestType4",{enumerable:!0,get:function(){return ct.RequestType4}});Object.defineProperty(F,"RequestType5",{enumerable:!0,get:function(){return ct.RequestType5}});Object.defineProperty(F,"RequestType6",{enumerable:!0,get:function(){return ct.RequestType6}});Object.defineProperty(F,"RequestType7",{enumerable:!0,get:function(){return ct.RequestType7}});Object.defineProperty(F,"RequestType8",{enumerable:!0,get:function(){return ct.RequestType8}});Object.defineProperty(F,"RequestType9",{enumerable:!0,get:function(){return ct.RequestType9}});Object.defineProperty(F,"ResponseError",{enumerable:!0,get:function(){return ct.ResponseError}});Object.defineProperty(F,"ErrorCodes",{enumerable:!0,get:function(){return ct.ErrorCodes}});Object.defineProperty(F,"NotificationType",{enumerable:!0,get:function(){return ct.NotificationType}});Object.defineProperty(F,"NotificationType0",{enumerable:!0,get:function(){return ct.NotificationType0}});Object.defineProperty(F,"NotificationType1",{enumerable:!0,get:function(){return ct.NotificationType1}});Object.defineProperty(F,"NotificationType2",{enumerable:!0,get:function(){return ct.NotificationType2}});Object.defineProperty(F,"NotificationType3",{enumerable:!0,get:function(){return ct.NotificationType3}});Object.defineProperty(F,"NotificationType4",{enumerable:!0,get:function(){return ct.NotificationType4}});Object.defineProperty(F,"NotificationType5",{enumerable:!0,get:function(){return ct.NotificationType5}});Object.defineProperty(F,"NotificationType6",{enumerable:!0,get:function(){return ct.NotificationType6}});Object.defineProperty(F,"NotificationType7",{enumerable:!0,get:function(){return ct.NotificationType7}});Object.defineProperty(F,"NotificationType8",{enumerable:!0,get:function(){return ct.NotificationType8}});Object.defineProperty(F,"NotificationType9",{enumerable:!0,get:function(){return ct.NotificationType9}});Object.defineProperty(F,"ParameterStructures",{enumerable:!0,get:function(){return ct.ParameterStructures}});var kg=sg();Object.defineProperty(F,"LinkedMap",{enumerable:!0,get:function(){return kg.LinkedMap}});Object.defineProperty(F,"LRUCache",{enumerable:!0,get:function(){return kg.LRUCache}});Object.defineProperty(F,"Touch",{enumerable:!0,get:function(){return kg.Touch}});var zN=Dh();Object.defineProperty(F,"Disposable",{enumerable:!0,get:function(){return zN.Disposable}});var lx=vs();Object.defineProperty(F,"Event",{enumerable:!0,get:function(){return lx.Event}});Object.defineProperty(F,"Emitter",{enumerable:!0,get:function(){return lx.Emitter}});var fx=lg();Object.defineProperty(F,"CancellationTokenSource",{enumerable:!0,get:function(){return fx.CancellationTokenSource}});Object.defineProperty(F,"CancellationToken",{enumerable:!0,get:function(){return fx.CancellationToken}});var Cg=QR();Object.defineProperty(F,"MessageReader",{enumerable:!0,get:function(){return Cg.MessageReader}});Object.defineProperty(F,"AbstractMessageReader",{enumerable:!0,get:function(){return Cg.AbstractMessageReader}});Object.defineProperty(F,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Cg.ReadableStreamMessageReader}});var wg=nx();Object.defineProperty(F,"MessageWriter",{enumerable:!0,get:function(){return wg.MessageWriter}});Object.defineProperty(F,"AbstractMessageWriter",{enumerable:!0,get:function(){return wg.AbstractMessageWriter}});Object.defineProperty(F,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return wg.WriteableStreamMessageWriter}});var Fr=ux();Object.defineProperty(F,"ConnectionStrategy",{enumerable:!0,get:function(){return Fr.ConnectionStrategy}});Object.defineProperty(F,"ConnectionOptions",{enumerable:!0,get:function(){return Fr.ConnectionOptions}});Object.defineProperty(F,"NullLogger",{enumerable:!0,get:function(){return Fr.NullLogger}});Object.defineProperty(F,"createMessageConnection",{enumerable:!0,get:function(){return Fr.createMessageConnection}});Object.defineProperty(F,"ProgressToken",{enumerable:!0,get:function(){return Fr.ProgressToken}});Object.defineProperty(F,"ProgressType",{enumerable:!0,get:function(){return Fr.ProgressType}});Object.defineProperty(F,"Trace",{enumerable:!0,get:function(){return Fr.Trace}});Object.defineProperty(F,"TraceValues",{enumerable:!0,get:function(){return Fr.TraceValues}});Object.defineProperty(F,"TraceFormat",{enumerable:!0,get:function(){return Fr.TraceFormat}});Object.defineProperty(F,"SetTraceNotification",{enumerable:!0,get:function(){return Fr.SetTraceNotification}});Object.defineProperty(F,"LogTraceNotification",{enumerable:!0,get:function(){return Fr.LogTraceNotification}});Object.defineProperty(F,"ConnectionErrors",{enumerable:!0,get:function(){return Fr.ConnectionErrors}});Object.defineProperty(F,"ConnectionError",{enumerable:!0,get:function(){return Fr.ConnectionError}});Object.defineProperty(F,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Fr.CancellationReceiverStrategy}});Object.defineProperty(F,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Fr.CancellationSenderStrategy}});Object.defineProperty(F,"CancellationStrategy",{enumerable:!0,get:function(){return Fr.CancellationStrategy}});var VN=eo();F.RAL=VN.default});var io=$(Tn=>{"use strict";var XN=Tn&&Tn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),YN=Tn&&Tn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XN(e,t,r)};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.createMessageConnection=Tn.BrowserMessageWriter=Tn.BrowserMessageReader=void 0;var JN=zR();JN.default.install();var sa=Dg();YN(Dg(),Tn);var Eg=class extends sa.AbstractMessageReader{constructor(e){super(),this._onData=new sa.Emitter,this._messageListener=r=>{this._onData.fire(r.data)},e.addEventListener("error",r=>this.fireError(r)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}};Tn.BrowserMessageReader=Eg;var Pg=class extends sa.AbstractMessageWriter{constructor(e){super(),this.context=e,this.errorCount=0,e.addEventListener("error",r=>this.fireError(r))}write(e){try{return this.context.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Tn.BrowserMessageWriter=Pg;function QN(t,e,r,n){return r===void 0&&(r=sa.NullLogger),sa.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,sa.createMessageConnection)(t,e,r,n)}Tn.createMessageConnection=QN});var Ag=$((g4,dx)=>{"use strict";dx.exports=io()});var xs=$((px,Ql)=>{(function(t){if(typeof Ql=="object"&&typeof Ql.exports=="object"){var e=t(Wl,px);e!==void 0&&(Ql.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.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 r;(function(l){function g(v){return typeof v=="string"}l.is=g})(r=e.DocumentUri||(e.DocumentUri={}));var n;(function(l){function g(v){return typeof v=="string"}l.is=g})(n=e.URI||(e.URI={}));var i;(function(l){l.MIN_VALUE=-2147483648,l.MAX_VALUE=2147483647;function g(v){return typeof v=="number"&&l.MIN_VALUE<=v&&v<=l.MAX_VALUE}l.is=g})(i=e.integer||(e.integer={}));var o;(function(l){l.MIN_VALUE=0,l.MAX_VALUE=2147483647;function g(v){return typeof v=="number"&&l.MIN_VALUE<=v&&v<=l.MAX_VALUE}l.is=g})(o=e.uinteger||(e.uinteger={}));var s;(function(l){function g(d,u){return d===Number.MAX_VALUE&&(d=o.MAX_VALUE),u===Number.MAX_VALUE&&(u=o.MAX_VALUE),{line:d,character:u}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.uinteger(u.line)&&x.uinteger(u.character)}l.is=v})(s=e.Position||(e.Position={}));var a;(function(l){function g(d,u,b,w){if(x.uinteger(d)&&x.uinteger(u)&&x.uinteger(b)&&x.uinteger(w))return{start:s.create(d,u),end:s.create(b,w)};if(s.is(d)&&s.is(u))return{start:d,end:u};throw new Error("Range#create called with invalid arguments[".concat(d,", ").concat(u,", ").concat(b,", ").concat(w,"]"))}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&s.is(u.start)&&s.is(u.end)}l.is=v})(a=e.Range||(e.Range={}));var c;(function(l){function g(d,u){return{uri:d,range:u}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&a.is(u.range)&&(x.string(u.uri)||x.undefined(u.uri))}l.is=v})(c=e.Location||(e.Location={}));var f;(function(l){function g(d,u,b,w){return{targetUri:d,targetRange:u,targetSelectionRange:b,originSelectionRange:w}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&a.is(u.targetRange)&&x.string(u.targetUri)&&a.is(u.targetSelectionRange)&&(a.is(u.originSelectionRange)||x.undefined(u.originSelectionRange))}l.is=v})(f=e.LocationLink||(e.LocationLink={}));var p;(function(l){function g(d,u,b,w){return{red:d,green:u,blue:b,alpha:w}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.numberRange(u.red,0,1)&&x.numberRange(u.green,0,1)&&x.numberRange(u.blue,0,1)&&x.numberRange(u.alpha,0,1)}l.is=v})(p=e.Color||(e.Color={}));var m;(function(l){function g(d,u){return{range:d,color:u}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&a.is(u.range)&&p.is(u.color)}l.is=v})(m=e.ColorInformation||(e.ColorInformation={}));var T;(function(l){function g(d,u,b){return{label:d,textEdit:u,additionalTextEdits:b}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.string(u.label)&&(x.undefined(u.textEdit)||M.is(u))&&(x.undefined(u.additionalTextEdits)||x.typedArray(u.additionalTextEdits,M.is))}l.is=v})(T=e.ColorPresentation||(e.ColorPresentation={}));var k;(function(l){l.Comment="comment",l.Imports="imports",l.Region="region"})(k=e.FoldingRangeKind||(e.FoldingRangeKind={}));var A;(function(l){function g(d,u,b,w,W,Re){var pe={startLine:d,endLine:u};return x.defined(b)&&(pe.startCharacter=b),x.defined(w)&&(pe.endCharacter=w),x.defined(W)&&(pe.kind=W),x.defined(Re)&&(pe.collapsedText=Re),pe}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.uinteger(u.startLine)&&x.uinteger(u.startLine)&&(x.undefined(u.startCharacter)||x.uinteger(u.startCharacter))&&(x.undefined(u.endCharacter)||x.uinteger(u.endCharacter))&&(x.undefined(u.kind)||x.string(u.kind))}l.is=v})(A=e.FoldingRange||(e.FoldingRange={}));var N;(function(l){function g(d,u){return{location:d,message:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&c.is(u.location)&&x.string(u.message)}l.is=v})(N=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var O;(function(l){l.Error=1,l.Warning=2,l.Information=3,l.Hint=4})(O=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var P;(function(l){l.Unnecessary=1,l.Deprecated=2})(P=e.DiagnosticTag||(e.DiagnosticTag={}));var y;(function(l){function g(v){var d=v;return x.objectLiteral(d)&&x.string(d.href)}l.is=g})(y=e.CodeDescription||(e.CodeDescription={}));var h;(function(l){function g(d,u,b,w,W,Re){var pe={range:d,message:u};return x.defined(b)&&(pe.severity=b),x.defined(w)&&(pe.code=w),x.defined(W)&&(pe.source=W),x.defined(Re)&&(pe.relatedInformation=Re),pe}l.create=g;function v(d){var u,b=d;return x.defined(b)&&a.is(b.range)&&x.string(b.message)&&(x.number(b.severity)||x.undefined(b.severity))&&(x.integer(b.code)||x.string(b.code)||x.undefined(b.code))&&(x.undefined(b.codeDescription)||x.string((u=b.codeDescription)===null||u===void 0?void 0:u.href))&&(x.string(b.source)||x.undefined(b.source))&&(x.undefined(b.relatedInformation)||x.typedArray(b.relatedInformation,N.is))}l.is=v})(h=e.Diagnostic||(e.Diagnostic={}));var C;(function(l){function g(d,u){for(var b=[],w=2;w<arguments.length;w++)b[w-2]=arguments[w];var W={title:d,command:u};return x.defined(b)&&b.length>0&&(W.arguments=b),W}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.title)&&x.string(u.command)}l.is=v})(C=e.Command||(e.Command={}));var M;(function(l){function g(b,w){return{range:b,newText:w}}l.replace=g;function v(b,w){return{range:{start:b,end:b},newText:w}}l.insert=v;function d(b){return{range:b,newText:""}}l.del=d;function u(b){var w=b;return x.objectLiteral(w)&&x.string(w.newText)&&a.is(w.range)}l.is=u})(M=e.TextEdit||(e.TextEdit={}));var z;(function(l){function g(d,u,b){var w={label:d};return u!==void 0&&(w.needsConfirmation=u),b!==void 0&&(w.description=b),w}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.string(u.label)&&(x.boolean(u.needsConfirmation)||u.needsConfirmation===void 0)&&(x.string(u.description)||u.description===void 0)}l.is=v})(z=e.ChangeAnnotation||(e.ChangeAnnotation={}));var ce;(function(l){function g(v){var d=v;return x.string(d)}l.is=g})(ce=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var we;(function(l){function g(b,w,W){return{range:b,newText:w,annotationId:W}}l.replace=g;function v(b,w,W){return{range:{start:b,end:b},newText:w,annotationId:W}}l.insert=v;function d(b,w){return{range:b,newText:"",annotationId:w}}l.del=d;function u(b){var w=b;return M.is(w)&&(z.is(w.annotationId)||ce.is(w.annotationId))}l.is=u})(we=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var Rt;(function(l){function g(d,u){return{textDocument:d,edits:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&ze.is(u.textDocument)&&Array.isArray(u.edits)}l.is=v})(Rt=e.TextDocumentEdit||(e.TextDocumentEdit={}));var tt;(function(l){function g(d,u,b){var w={kind:"create",uri:d};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(w.options=u),b!==void 0&&(w.annotationId=b),w}l.create=g;function v(d){var u=d;return u&&u.kind==="create"&&x.string(u.uri)&&(u.options===void 0||(u.options.overwrite===void 0||x.boolean(u.options.overwrite))&&(u.options.ignoreIfExists===void 0||x.boolean(u.options.ignoreIfExists)))&&(u.annotationId===void 0||ce.is(u.annotationId))}l.is=v})(tt=e.CreateFile||(e.CreateFile={}));var U;(function(l){function g(d,u,b,w){var W={kind:"rename",oldUri:d,newUri:u};return b!==void 0&&(b.overwrite!==void 0||b.ignoreIfExists!==void 0)&&(W.options=b),w!==void 0&&(W.annotationId=w),W}l.create=g;function v(d){var u=d;return u&&u.kind==="rename"&&x.string(u.oldUri)&&x.string(u.newUri)&&(u.options===void 0||(u.options.overwrite===void 0||x.boolean(u.options.overwrite))&&(u.options.ignoreIfExists===void 0||x.boolean(u.options.ignoreIfExists)))&&(u.annotationId===void 0||ce.is(u.annotationId))}l.is=v})(U=e.RenameFile||(e.RenameFile={}));var I;(function(l){function g(d,u,b){var w={kind:"delete",uri:d};return u!==void 0&&(u.recursive!==void 0||u.ignoreIfNotExists!==void 0)&&(w.options=u),b!==void 0&&(w.annotationId=b),w}l.create=g;function v(d){var u=d;return u&&u.kind==="delete"&&x.string(u.uri)&&(u.options===void 0||(u.options.recursive===void 0||x.boolean(u.options.recursive))&&(u.options.ignoreIfNotExists===void 0||x.boolean(u.options.ignoreIfNotExists)))&&(u.annotationId===void 0||ce.is(u.annotationId))}l.is=v})(I=e.DeleteFile||(e.DeleteFile={}));var K;(function(l){function g(v){var d=v;return d&&(d.changes!==void 0||d.documentChanges!==void 0)&&(d.documentChanges===void 0||d.documentChanges.every(function(u){return x.string(u.kind)?tt.is(u)||U.is(u)||I.is(u):Rt.is(u)}))}l.is=g})(K=e.WorkspaceEdit||(e.WorkspaceEdit={}));var V=function(){function l(g,v){this.edits=g,this.changeAnnotations=v}return l.prototype.insert=function(g,v,d){var u,b;if(d===void 0?u=M.insert(g,v):ce.is(d)?(b=d,u=we.insert(g,v,d)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(d),u=we.insert(g,v,b)),this.edits.push(u),b!==void 0)return b},l.prototype.replace=function(g,v,d){var u,b;if(d===void 0?u=M.replace(g,v):ce.is(d)?(b=d,u=we.replace(g,v,d)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(d),u=we.replace(g,v,b)),this.edits.push(u),b!==void 0)return b},l.prototype.delete=function(g,v){var d,u;if(v===void 0?d=M.del(g):ce.is(v)?(u=v,d=we.del(g,v)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(v),d=we.del(g,u)),this.edits.push(d),u!==void 0)return u},l.prototype.add=function(g){this.edits.push(g)},l.prototype.all=function(){return this.edits},l.prototype.clear=function(){this.edits.splice(0,this.edits.length)},l.prototype.assertChangeAnnotations=function(g){if(g===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},l}(),Ce=function(){function l(g){this._annotations=g===void 0?Object.create(null):g,this._counter=0,this._size=0}return l.prototype.all=function(){return this._annotations},Object.defineProperty(l.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),l.prototype.manage=function(g,v){var d;if(ce.is(g)?d=g:(d=this.nextId(),v=g),this._annotations[d]!==void 0)throw new Error("Id ".concat(d," is already in use."));if(v===void 0)throw new Error("No annotation provided for id ".concat(d));return this._annotations[d]=v,this._size++,d},l.prototype.nextId=function(){return this._counter++,this._counter.toString()},l}(),me=function(){function l(g){var v=this;this._textEditChanges=Object.create(null),g!==void 0?(this._workspaceEdit=g,g.documentChanges?(this._changeAnnotations=new Ce(g.changeAnnotations),g.changeAnnotations=this._changeAnnotations.all(),g.documentChanges.forEach(function(d){if(Rt.is(d)){var u=new V(d.edits,v._changeAnnotations);v._textEditChanges[d.textDocument.uri]=u}})):g.changes&&Object.keys(g.changes).forEach(function(d){var u=new V(g.changes[d]);v._textEditChanges[d]=u})):this._workspaceEdit={}}return Object.defineProperty(l.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}),l.prototype.getTextEditChange=function(g){if(ze.is(g)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var v={uri:g.uri,version:g.version},d=this._textEditChanges[v.uri];if(!d){var u=[],b={textDocument:v,edits:u};this._workspaceEdit.documentChanges.push(b),d=new V(u,this._changeAnnotations),this._textEditChanges[v.uri]=d}return d}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var d=this._textEditChanges[g];if(!d){var u=[];this._workspaceEdit.changes[g]=u,d=new V(u),this._textEditChanges[g]=d}return d}},l.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ce,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},l.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},l.prototype.createFile=function(g,v,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var u;z.is(v)||ce.is(v)?u=v:d=v;var b,w;if(u===void 0?b=tt.create(g,d):(w=ce.is(u)?u:this._changeAnnotations.manage(u),b=tt.create(g,d,w)),this._workspaceEdit.documentChanges.push(b),w!==void 0)return w},l.prototype.renameFile=function(g,v,d,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var b;z.is(d)||ce.is(d)?b=d:u=d;var w,W;if(b===void 0?w=U.create(g,v,u):(W=ce.is(b)?b:this._changeAnnotations.manage(b),w=U.create(g,v,u,W)),this._workspaceEdit.documentChanges.push(w),W!==void 0)return W},l.prototype.deleteFile=function(g,v,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var u;z.is(v)||ce.is(v)?u=v:d=v;var b,w;if(u===void 0?b=I.create(g,d):(w=ce.is(u)?u:this._changeAnnotations.manage(u),b=I.create(g,d,w)),this._workspaceEdit.documentChanges.push(b),w!==void 0)return w},l}();e.WorkspaceChange=me;var fe;(function(l){function g(d){return{uri:d}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.uri)}l.is=v})(fe=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var gt;(function(l){function g(d,u){return{uri:d,version:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.uri)&&x.integer(u.version)}l.is=v})(gt=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var ze;(function(l){function g(d,u){return{uri:d,version:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.uri)&&(u.version===null||x.integer(u.version))}l.is=v})(ze=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var _e;(function(l){function g(d,u,b,w){return{uri:d,languageId:u,version:b,text:w}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.uri)&&x.string(u.languageId)&&x.integer(u.version)&&x.string(u.text)}l.is=v})(_e=e.TextDocumentItem||(e.TextDocumentItem={}));var sr;(function(l){l.PlainText="plaintext",l.Markdown="markdown";function g(v){var d=v;return d===l.PlainText||d===l.Markdown}l.is=g})(sr=e.MarkupKind||(e.MarkupKind={}));var Lr;(function(l){function g(v){var d=v;return x.objectLiteral(v)&&sr.is(d.kind)&&x.string(d.value)}l.is=g})(Lr=e.MarkupContent||(e.MarkupContent={}));var Yi;(function(l){l.Text=1,l.Method=2,l.Function=3,l.Constructor=4,l.Field=5,l.Variable=6,l.Class=7,l.Interface=8,l.Module=9,l.Property=10,l.Unit=11,l.Value=12,l.Enum=13,l.Keyword=14,l.Snippet=15,l.Color=16,l.File=17,l.Reference=18,l.Folder=19,l.EnumMember=20,l.Constant=21,l.Struct=22,l.Event=23,l.Operator=24,l.TypeParameter=25})(Yi=e.CompletionItemKind||(e.CompletionItemKind={}));var Pn;(function(l){l.PlainText=1,l.Snippet=2})(Pn=e.InsertTextFormat||(e.InsertTextFormat={}));var zt;(function(l){l.Deprecated=1})(zt=e.CompletionItemTag||(e.CompletionItemTag={}));var bi;(function(l){function g(d,u,b){return{newText:d,insert:u,replace:b}}l.create=g;function v(d){var u=d;return u&&x.string(u.newText)&&a.is(u.insert)&&a.is(u.replace)}l.is=v})(bi=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var xt;(function(l){l.asIs=1,l.adjustIndentation=2})(xt=e.InsertTextMode||(e.InsertTextMode={}));var Vt;(function(l){function g(v){var d=v;return d&&(x.string(d.detail)||d.detail===void 0)&&(x.string(d.description)||d.description===void 0)}l.is=g})(Vt=e.CompletionItemLabelDetails||(e.CompletionItemLabelDetails={}));var sn;(function(l){function g(v){return{label:v}}l.create=g})(sn=e.CompletionItem||(e.CompletionItem={}));var Ht;(function(l){function g(v,d){return{items:v||[],isIncomplete:!!d}}l.create=g})(Ht=e.CompletionList||(e.CompletionList={}));var rt;(function(l){function g(d){return d.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}l.fromPlainText=g;function v(d){var u=d;return x.string(u)||x.objectLiteral(u)&&x.string(u.language)&&x.string(u.value)}l.is=v})(rt=e.MarkedString||(e.MarkedString={}));var wt;(function(l){function g(v){var d=v;return!!d&&x.objectLiteral(d)&&(Lr.is(d.contents)||rt.is(d.contents)||x.typedArray(d.contents,rt.is))&&(v.range===void 0||a.is(v.range))}l.is=g})(wt=e.Hover||(e.Hover={}));var xr;(function(l){function g(v,d){return d?{label:v,documentation:d}:{label:v}}l.create=g})(xr=e.ParameterInformation||(e.ParameterInformation={}));var mr;(function(l){function g(v,d){for(var u=[],b=2;b<arguments.length;b++)u[b-2]=arguments[b];var w={label:v};return x.defined(d)&&(w.documentation=d),x.defined(u)?w.parameters=u:w.parameters=[],w}l.create=g})(mr=e.SignatureInformation||(e.SignatureInformation={}));var an;(function(l){l.Text=1,l.Read=2,l.Write=3})(an=e.DocumentHighlightKind||(e.DocumentHighlightKind={}));var An;(function(l){function g(v,d){var u={range:v};return x.number(d)&&(u.kind=d),u}l.create=g})(An=e.DocumentHighlight||(e.DocumentHighlight={}));var Ji;(function(l){l.File=1,l.Module=2,l.Namespace=3,l.Package=4,l.Class=5,l.Method=6,l.Property=7,l.Field=8,l.Constructor=9,l.Enum=10,l.Interface=11,l.Function=12,l.Variable=13,l.Constant=14,l.String=15,l.Number=16,l.Boolean=17,l.Array=18,l.Object=19,l.Key=20,l.Null=21,l.EnumMember=22,l.Struct=23,l.Event=24,l.Operator=25,l.TypeParameter=26})(Ji=e.SymbolKind||(e.SymbolKind={}));var Nn;(function(l){l.Deprecated=1})(Nn=e.SymbolTag||(e.SymbolTag={}));var Mr;(function(l){function g(v,d,u,b,w){var W={name:v,kind:d,location:{uri:b,range:u}};return w&&(W.containerName=w),W}l.create=g})(Mr=e.SymbolInformation||(e.SymbolInformation={}));var Xn;(function(l){function g(v,d,u,b){return b!==void 0?{name:v,kind:d,location:{uri:u,range:b}}:{name:v,kind:d,location:{uri:u}}}l.create=g})(Xn=e.WorkspaceSymbol||(e.WorkspaceSymbol={}));var gs;(function(l){function g(d,u,b,w,W,Re){var pe={name:d,detail:u,kind:b,range:w,selectionRange:W};return Re!==void 0&&(pe.children=Re),pe}l.create=g;function v(d){var u=d;return u&&x.string(u.name)&&x.number(u.kind)&&a.is(u.range)&&a.is(u.selectionRange)&&(u.detail===void 0||x.string(u.detail))&&(u.deprecated===void 0||x.boolean(u.deprecated))&&(u.children===void 0||Array.isArray(u.children))&&(u.tags===void 0||Array.isArray(u.tags))}l.is=v})(gs=e.DocumentSymbol||(e.DocumentSymbol={}));var Yn;(function(l){l.Empty="",l.QuickFix="quickfix",l.Refactor="refactor",l.RefactorExtract="refactor.extract",l.RefactorInline="refactor.inline",l.RefactorRewrite="refactor.rewrite",l.Source="source",l.SourceOrganizeImports="source.organizeImports",l.SourceFixAll="source.fixAll"})(Yn=e.CodeActionKind||(e.CodeActionKind={}));var $r;(function(l){l.Invoked=1,l.Automatic=2})($r=e.CodeActionTriggerKind||(e.CodeActionTriggerKind={}));var Qi;(function(l){function g(d,u,b){var w={diagnostics:d};return u!=null&&(w.only=u),b!=null&&(w.triggerKind=b),w}l.create=g;function v(d){var u=d;return x.defined(u)&&x.typedArray(u.diagnostics,h.is)&&(u.only===void 0||x.typedArray(u.only,x.string))&&(u.triggerKind===void 0||u.triggerKind===$r.Invoked||u.triggerKind===$r.Automatic)}l.is=v})(Qi=e.CodeActionContext||(e.CodeActionContext={}));var _i;(function(l){function g(d,u,b){var w={title:d},W=!0;return typeof u=="string"?(W=!1,w.kind=u):C.is(u)?w.command=u:w.edit=u,W&&b!==void 0&&(w.kind=b),w}l.create=g;function v(d){var u=d;return u&&x.string(u.title)&&(u.diagnostics===void 0||x.typedArray(u.diagnostics,h.is))&&(u.kind===void 0||x.string(u.kind))&&(u.edit!==void 0||u.command!==void 0)&&(u.command===void 0||C.is(u.command))&&(u.isPreferred===void 0||x.boolean(u.isPreferred))&&(u.edit===void 0||K.is(u.edit))}l.is=v})(_i=e.CodeAction||(e.CodeAction={}));var Si;(function(l){function g(d,u){var b={range:d};return x.defined(u)&&(b.data=u),b}l.create=g;function v(d){var u=d;return x.defined(u)&&a.is(u.range)&&(x.undefined(u.command)||C.is(u.command))}l.is=v})(Si=e.CodeLens||(e.CodeLens={}));var yn;(function(l){function g(d,u){return{tabSize:d,insertSpaces:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.uinteger(u.tabSize)&&x.boolean(u.insertSpaces)}l.is=v})(yn=e.FormattingOptions||(e.FormattingOptions={}));var D;(function(l){function g(d,u,b){return{range:d,target:u,data:b}}l.create=g;function v(d){var u=d;return x.defined(u)&&a.is(u.range)&&(x.undefined(u.target)||x.string(u.target))}l.is=v})(D=e.DocumentLink||(e.DocumentLink={}));var R;(function(l){function g(d,u){return{range:d,parent:u}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&a.is(u.range)&&(u.parent===void 0||l.is(u.parent))}l.is=v})(R=e.SelectionRange||(e.SelectionRange={}));var E;(function(l){l.namespace="namespace",l.type="type",l.class="class",l.enum="enum",l.interface="interface",l.struct="struct",l.typeParameter="typeParameter",l.parameter="parameter",l.variable="variable",l.property="property",l.enumMember="enumMember",l.event="event",l.function="function",l.method="method",l.macro="macro",l.keyword="keyword",l.modifier="modifier",l.comment="comment",l.string="string",l.number="number",l.regexp="regexp",l.operator="operator",l.decorator="decorator"})(E=e.SemanticTokenTypes||(e.SemanticTokenTypes={}));var L;(function(l){l.declaration="declaration",l.definition="definition",l.readonly="readonly",l.static="static",l.deprecated="deprecated",l.abstract="abstract",l.async="async",l.modification="modification",l.documentation="documentation",l.defaultLibrary="defaultLibrary"})(L=e.SemanticTokenModifiers||(e.SemanticTokenModifiers={}));var j;(function(l){function g(v){var d=v;return x.objectLiteral(d)&&(d.resultId===void 0||typeof d.resultId=="string")&&Array.isArray(d.data)&&(d.data.length===0||typeof d.data[0]=="number")}l.is=g})(j=e.SemanticTokens||(e.SemanticTokens={}));var ue;(function(l){function g(d,u){return{range:d,text:u}}l.create=g;function v(d){var u=d;return u!=null&&a.is(u.range)&&x.string(u.text)}l.is=v})(ue=e.InlineValueText||(e.InlineValueText={}));var le;(function(l){function g(d,u,b){return{range:d,variableName:u,caseSensitiveLookup:b}}l.create=g;function v(d){var u=d;return u!=null&&a.is(u.range)&&x.boolean(u.caseSensitiveLookup)&&(x.string(u.variableName)||u.variableName===void 0)}l.is=v})(le=e.InlineValueVariableLookup||(e.InlineValueVariableLookup={}));var Te;(function(l){function g(d,u){return{range:d,expression:u}}l.create=g;function v(d){var u=d;return u!=null&&a.is(u.range)&&(x.string(u.expression)||u.expression===void 0)}l.is=v})(Te=e.InlineValueEvaluatableExpression||(e.InlineValueEvaluatableExpression={}));var oe;(function(l){function g(d,u){return{frameId:d,stoppedLocation:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&a.is(d.stoppedLocation)}l.is=v})(oe=e.InlineValueContext||(e.InlineValueContext={}));var te;(function(l){l.Type=1,l.Parameter=2;function g(v){return v===1||v===2}l.is=g})(te=e.InlayHintKind||(e.InlayHintKind={}));var ne;(function(l){function g(d){return{value:d}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&(u.tooltip===void 0||x.string(u.tooltip)||Lr.is(u.tooltip))&&(u.location===void 0||c.is(u.location))&&(u.command===void 0||C.is(u.command))}l.is=v})(ne=e.InlayHintLabelPart||(e.InlayHintLabelPart={}));var de;(function(l){function g(d,u,b){var w={position:d,label:u};return b!==void 0&&(w.kind=b),w}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&s.is(u.position)&&(x.string(u.label)||x.typedArray(u.label,ne.is))&&(u.kind===void 0||te.is(u.kind))&&u.textEdits===void 0||x.typedArray(u.textEdits,M.is)&&(u.tooltip===void 0||x.string(u.tooltip)||Lr.is(u.tooltip))&&(u.paddingLeft===void 0||x.boolean(u.paddingLeft))&&(u.paddingRight===void 0||x.boolean(u.paddingRight))}l.is=v})(de=e.InlayHint||(e.InlayHint={}));var Ae;(function(l){function g(v){var d=v;return x.objectLiteral(d)&&n.is(d.uri)&&x.string(d.name)}l.is=g})(Ae=e.WorkspaceFolder||(e.WorkspaceFolder={})),e.EOL=[`
29
+ `)),y){let L=b.error?` Request failed: ${b.error.message} (${b.error.code}).`:"";$.log(`Received response '${y.method} - (${b.id})' in ${Date.now()-y.timerStart}ms.${L}`,k)}else $.log(`Received response ${b.id} without active response promise.`,k)}else gi("receive-response",b)}function gi(b,y){if(!$||d===Ke.Off)return;let k={isLSPMessage:!0,type:b,message:y,timestamp:Date.now()};$.log(k)}function Qr(){if(ft())throw new sa(ff.Closed,"Connection is closed.");if(be())throw new sa(ff.Disposed,"Connection is disposed.")}function Hi(){if(St())throw new sa(ff.AlreadyListening,"Connection is already listening")}function cu(){if(!St())throw new Error("Call listen() first.")}function Gi(b){return b===void 0?null:b}function wn(b){if(b!==null)return b}function gs(b){return b!=null&&!Array.isArray(b)&&typeof b=="object"}function So(b,y){switch(b){case pe.ParameterStructures.auto:return gs(y)?wn(y):[Gi(y)];case pe.ParameterStructures.byName:if(!gs(y))throw new Error("Received parameters by name but param is not an object literal.");return wn(y);case pe.ParameterStructures.byPosition:return[Gi(y)];default:throw new Error(`Unknown parameter structure ${b.toString()}`)}}function ko(b,y){let k,L=b.numberOfParams;switch(L){case 0:k=void 0;break;case 1:k=So(b.parameterStructures,y[0]);break;default:k=[];for(let U=0;U<y.length&&U<L;U++)k.push(Gi(y[U]));if(y.length<L)for(let U=y.length;U<L;U++)k.push(null);break}return k}let Kn={sendNotification:(b,...y)=>{Qr();let k,L;if(nr.string(b)){k=b;let se=y[0],ae=0,ye=pe.ParameterStructures.auto;pe.ParameterStructures.is(se)&&(ae=1,ye=se);let ne=y.length,te=ne-ae;switch(te){case 0:L=void 0;break;case 1:L=So(ye,y[ae]);break;default:if(ye===pe.ParameterStructures.byName)throw new Error(`Received ${te} parameters for 'by Name' notification parameter structure.`);L=y.slice(ae,ne).map(ie=>Gi(ie));break}}else{let se=y;k=b.method,L=ko(b,se)}let U={jsonrpc:c,method:k,params:L};return Wr(U),e.write(U).catch(()=>i.error("Sending notification failed."))},onNotification:(b,y)=>{Qr();let k;return nr.func(b)?f=b:y&&(nr.string(b)?(k=b,g.set(b,{type:void 0,handler:y})):(k=b.method,g.set(b.method,{type:b,handler:y}))),{dispose:()=>{k!==void 0?g.delete(k):f=void 0}}},onProgress:(b,y,k)=>{if(T.has(y))throw new Error(`Progress handler for token ${y} already registered`);return T.set(y,k),{dispose:()=>{T.delete(y)}}},sendProgress:(b,y,k)=>Kn.sendNotification(du.type,{token:y,value:k}),onUnhandledProgress:_t.event,sendRequest:(b,...y)=>{Qr(),cu();let k,L,U;if(nr.string(b)){k=b;let ne=y[0],te=y[y.length-1],ie=0,ue=pe.ParameterStructures.auto;pe.ParameterStructures.is(ne)&&(ie=1,ue=ne);let Ee=y.length;ny.CancellationToken.is(te)&&(Ee=Ee-1,U=te);let dt=Ee-ie;switch(dt){case 0:L=void 0;break;case 1:L=So(ue,y[ie]);break;default:if(ue===pe.ParameterStructures.byName)throw new Error(`Received ${dt} parameters for 'by Name' request parameter structure.`);L=y.slice(ie,Ee).map(jt=>Gi(jt));break}}else{let ne=y;k=b.method,L=ko(b,ne);let te=b.numberOfParams;U=ny.CancellationToken.is(ne[te])?ne[te]:void 0}let se=o++,ae;return U&&(ae=U.onCancellationRequested(()=>{let ne=A.sender.sendCancellation(Kn,se);return ne===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${se}`),Promise.resolve()):ne.catch(()=>{i.log(`Sending cancellation messages for id ${se} failed`)})})),new Promise((ne,te)=>{let ie={jsonrpc:c,id:se,method:k,params:L},ue=jt=>{ne(jt),A.sender.cleanup(se),ae?.dispose()},Ee=jt=>{te(jt),A.sender.cleanup(se),ae?.dispose()},dt={method:k,timerStart:Date.now(),resolve:ue,reject:Ee};qt(ie);try{e.write(ie).catch(()=>i.error("Sending request failed."))}catch(jt){dt.reject(new pe.ResponseError(pe.ErrorCodes.MessageWriteError,jt.message?jt.message:"Unknown reason")),dt=null}dt&&O.set(se,dt)})},onRequest:(b,y)=>{Qr();let k=null;return oy.is(b)?(k=void 0,u=b):nr.string(b)?(k=null,y!==void 0&&(k=b,l.set(b,{handler:y,type:void 0}))):y!==void 0&&(k=b.method,l.set(b.method,{type:b,handler:y})),{dispose:()=>{k!==null&&(k!==void 0?l.delete(k):u=void 0)}}},hasPendingResponse:()=>O.size>0,trace:async(b,y,k)=>{let L=!1,U=Xn.Text;k!==void 0&&(nr.boolean(k)?L=k:(L=k.sendNotification||!1,U=k.traceFormat||Xn.Text)),d=b,_=U,d===Ke.Off?$=void 0:$=y,L&&!ft()&&!be()&&await Kn.sendNotification(t_.type,{value:Ke.toString(b)})},onError:ke.event,onClose:Me.event,onUnhandledNotification:Bt.event,onDispose:G.event,end:()=>{e.end()},dispose:()=>{if(be())return;X=Yn.Disposed,G.fire(void 0);let b=new pe.ResponseError(pe.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let y of O.values())y.reject(b);O=new Map,m=new Map,E=new Set,P=new Zb.LinkedMap,nr.func(e.dispose)&&e.dispose(),nr.func(t.dispose)&&t.dispose()},listen:()=>{Qr(),Hi(),X=Yn.Listening,t.listen(_o)},inspect:()=>{(0,Qb.default)().console.log("inspect")}};return Kn.onNotification(sy.type,b=>{if(d===Ke.Off||!$)return;let y=d===Ke.Verbose||d===Ke.Compact;$.log(b.message,y?b.verbose:void 0)}),Kn.onNotification(du.type,b=>{let y=T.get(b.token);y?y(b.value):_t.fire(b)}),Kn}le.createMessageConnection=JL});var py=M(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.TraceFormat=q.TraceValues=q.Trace=q.ProgressType=q.ProgressToken=q.createMessageConnection=q.NullLogger=q.ConnectionOptions=q.ConnectionStrategy=q.WriteableStreamMessageWriter=q.AbstractMessageWriter=q.MessageWriter=q.ReadableStreamMessageReader=q.AbstractMessageReader=q.MessageReader=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.CancellationStrategy=q.CancellationSenderStrategy=q.CancellationReceiverStrategy=q.ConnectionError=q.ConnectionErrors=q.LogTraceNotification=q.SetTraceNotification=void 0;var nt=Hg();Object.defineProperty(q,"Message",{enumerable:!0,get:function(){return nt.Message}});Object.defineProperty(q,"RequestType",{enumerable:!0,get:function(){return nt.RequestType}});Object.defineProperty(q,"RequestType0",{enumerable:!0,get:function(){return nt.RequestType0}});Object.defineProperty(q,"RequestType1",{enumerable:!0,get:function(){return nt.RequestType1}});Object.defineProperty(q,"RequestType2",{enumerable:!0,get:function(){return nt.RequestType2}});Object.defineProperty(q,"RequestType3",{enumerable:!0,get:function(){return nt.RequestType3}});Object.defineProperty(q,"RequestType4",{enumerable:!0,get:function(){return nt.RequestType4}});Object.defineProperty(q,"RequestType5",{enumerable:!0,get:function(){return nt.RequestType5}});Object.defineProperty(q,"RequestType6",{enumerable:!0,get:function(){return nt.RequestType6}});Object.defineProperty(q,"RequestType7",{enumerable:!0,get:function(){return nt.RequestType7}});Object.defineProperty(q,"RequestType8",{enumerable:!0,get:function(){return nt.RequestType8}});Object.defineProperty(q,"RequestType9",{enumerable:!0,get:function(){return nt.RequestType9}});Object.defineProperty(q,"ResponseError",{enumerable:!0,get:function(){return nt.ResponseError}});Object.defineProperty(q,"ErrorCodes",{enumerable:!0,get:function(){return nt.ErrorCodes}});Object.defineProperty(q,"NotificationType",{enumerable:!0,get:function(){return nt.NotificationType}});Object.defineProperty(q,"NotificationType0",{enumerable:!0,get:function(){return nt.NotificationType0}});Object.defineProperty(q,"NotificationType1",{enumerable:!0,get:function(){return nt.NotificationType1}});Object.defineProperty(q,"NotificationType2",{enumerable:!0,get:function(){return nt.NotificationType2}});Object.defineProperty(q,"NotificationType3",{enumerable:!0,get:function(){return nt.NotificationType3}});Object.defineProperty(q,"NotificationType4",{enumerable:!0,get:function(){return nt.NotificationType4}});Object.defineProperty(q,"NotificationType5",{enumerable:!0,get:function(){return nt.NotificationType5}});Object.defineProperty(q,"NotificationType6",{enumerable:!0,get:function(){return nt.NotificationType6}});Object.defineProperty(q,"NotificationType7",{enumerable:!0,get:function(){return nt.NotificationType7}});Object.defineProperty(q,"NotificationType8",{enumerable:!0,get:function(){return nt.NotificationType8}});Object.defineProperty(q,"NotificationType9",{enumerable:!0,get:function(){return nt.NotificationType9}});Object.defineProperty(q,"ParameterStructures",{enumerable:!0,get:function(){return nt.ParameterStructures}});var ly=Bg();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return ly.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return ly.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return ly.Touch}});var QL=pg();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return QL.Disposable}});var i_=vs();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return i_.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return i_.Emitter}});var o_=Xg();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return o_.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return o_.CancellationToken}});var fy=Kb();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return fy.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return fy.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return fy.ReadableStreamMessageReader}});var dy=Jb();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return dy.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return dy.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return dy.WriteableStreamMessageWriter}});var Dr=n_();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return Dr.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return Dr.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return Dr.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return Dr.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return Dr.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return Dr.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return Dr.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return Dr.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return Dr.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return Dr.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return Dr.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return Dr.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return Dr.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Dr.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Dr.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return Dr.CancellationStrategy}});var ZL=Ki();q.RAL=ZL.default});var Yi=M(dn=>{"use strict";var eM=dn&&dn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tM=dn&&dn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eM(e,t,r)};Object.defineProperty(dn,"__esModule",{value:!0});dn.createMessageConnection=dn.BrowserMessageWriter=dn.BrowserMessageReader=void 0;var rM=Ub();rM.default.install();var aa=py();tM(py(),dn);var my=class extends aa.AbstractMessageReader{constructor(e){super(),this._onData=new aa.Emitter,this._messageListener=r=>{this._onData.fire(r.data)},e.addEventListener("error",r=>this.fireError(r)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}};dn.BrowserMessageReader=my;var hy=class extends aa.AbstractMessageWriter{constructor(e){super(),this.context=e,this.errorCount=0,e.addEventListener("error",r=>this.fireError(r))}write(e){try{return this.context.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};dn.BrowserMessageWriter=hy;function nM(t,e,r,n){return r===void 0&&(r=aa.NullLogger),aa.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,aa.createMessageConnection)(t,e,r,n)}dn.createMessageConnection=nM});var gy=M((f6,s_)=>{"use strict";s_.exports=Yi()});var xs=M((a_,df)=>{(function(t){if(typeof df=="object"&&typeof df.exports=="object"){var e=t(Lb,a_);e!==void 0&&(df.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.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 r;(function(h){function S(w){return typeof w=="string"}h.is=S})(r=e.DocumentUri||(e.DocumentUri={}));var n;(function(h){function S(w){return typeof w=="string"}h.is=S})(n=e.URI||(e.URI={}));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||(e.integer={}));var o;(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})(o=e.uinteger||(e.uinteger={}));var s;(function(h){function S(R,p){return R===Number.MAX_VALUE&&(R=o.MAX_VALUE),p===Number.MAX_VALUE&&(p=o.MAX_VALUE),{line:R,character:p}}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&D.uinteger(p.line)&&D.uinteger(p.character)}h.is=w})(s=e.Position||(e.Position={}));var a;(function(h){function S(R,p,I,j){if(D.uinteger(R)&&D.uinteger(p)&&D.uinteger(I)&&D.uinteger(j))return{start:s.create(R,p),end:s.create(I,j)};if(s.is(R)&&s.is(p))return{start:R,end:p};throw new Error("Range#create called with invalid arguments[".concat(R,", ").concat(p,", ").concat(I,", ").concat(j,"]"))}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&s.is(p.start)&&s.is(p.end)}h.is=w})(a=e.Range||(e.Range={}));var c;(function(h){function S(R,p){return{uri:R,range:p}}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&a.is(p.range)&&(D.string(p.uri)||D.undefined(p.uri))}h.is=w})(c=e.Location||(e.Location={}));var u;(function(h){function S(R,p,I,j){return{targetUri:R,targetRange:p,targetSelectionRange:I,originSelectionRange:j}}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&a.is(p.targetRange)&&D.string(p.targetUri)&&a.is(p.targetSelectionRange)&&(a.is(p.originSelectionRange)||D.undefined(p.originSelectionRange))}h.is=w})(u=e.LocationLink||(e.LocationLink={}));var l;(function(h){function S(R,p,I,j){return{red:R,green:p,blue:I,alpha:j}}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&D.numberRange(p.red,0,1)&&D.numberRange(p.green,0,1)&&D.numberRange(p.blue,0,1)&&D.numberRange(p.alpha,0,1)}h.is=w})(l=e.Color||(e.Color={}));var f;(function(h){function S(R,p){return{range:R,color:p}}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&a.is(p.range)&&l.is(p.color)}h.is=w})(f=e.ColorInformation||(e.ColorInformation={}));var g;(function(h){function S(R,p,I){return{label:R,textEdit:p,additionalTextEdits:I}}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&D.string(p.label)&&(D.undefined(p.textEdit)||$.is(p))&&(D.undefined(p.additionalTextEdits)||D.typedArray(p.additionalTextEdits,$.is))}h.is=w})(g=e.ColorPresentation||(e.ColorPresentation={}));var T;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(T=e.FoldingRangeKind||(e.FoldingRangeKind={}));var C;(function(h){function S(R,p,I,j,ve,It){var rt={startLine:R,endLine:p};return D.defined(I)&&(rt.startCharacter=I),D.defined(j)&&(rt.endCharacter=j),D.defined(ve)&&(rt.kind=ve),D.defined(It)&&(rt.collapsedText=It),rt}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&D.uinteger(p.startLine)&&D.uinteger(p.startLine)&&(D.undefined(p.startCharacter)||D.uinteger(p.startCharacter))&&(D.undefined(p.endCharacter)||D.uinteger(p.endCharacter))&&(D.undefined(p.kind)||D.string(p.kind))}h.is=w})(C=e.FoldingRange||(e.FoldingRange={}));var P;(function(h){function S(R,p){return{location:R,message:p}}h.create=S;function w(R){var p=R;return D.defined(p)&&c.is(p.location)&&D.string(p.message)}h.is=w})(P=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var O;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(O=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var E;(function(h){h.Unnecessary=1,h.Deprecated=2})(E=e.DiagnosticTag||(e.DiagnosticTag={}));var m;(function(h){function S(w){var R=w;return D.objectLiteral(R)&&D.string(R.href)}h.is=S})(m=e.CodeDescription||(e.CodeDescription={}));var d;(function(h){function S(R,p,I,j,ve,It){var rt={range:R,message:p};return D.defined(I)&&(rt.severity=I),D.defined(j)&&(rt.code=j),D.defined(ve)&&(rt.source=ve),D.defined(It)&&(rt.relatedInformation=It),rt}h.create=S;function w(R){var p,I=R;return D.defined(I)&&a.is(I.range)&&D.string(I.message)&&(D.number(I.severity)||D.undefined(I.severity))&&(D.integer(I.code)||D.string(I.code)||D.undefined(I.code))&&(D.undefined(I.codeDescription)||D.string((p=I.codeDescription)===null||p===void 0?void 0:p.href))&&(D.string(I.source)||D.undefined(I.source))&&(D.undefined(I.relatedInformation)||D.typedArray(I.relatedInformation,P.is))}h.is=w})(d=e.Diagnostic||(e.Diagnostic={}));var _;(function(h){function S(R,p){for(var I=[],j=2;j<arguments.length;j++)I[j-2]=arguments[j];var ve={title:R,command:p};return D.defined(I)&&I.length>0&&(ve.arguments=I),ve}h.create=S;function w(R){var p=R;return D.defined(p)&&D.string(p.title)&&D.string(p.command)}h.is=w})(_=e.Command||(e.Command={}));var $;(function(h){function S(I,j){return{range:I,newText:j}}h.replace=S;function w(I,j){return{range:{start:I,end:I},newText:j}}h.insert=w;function R(I){return{range:I,newText:""}}h.del=R;function p(I){var j=I;return D.objectLiteral(j)&&D.string(j.newText)&&a.is(j.range)}h.is=p})($=e.TextEdit||(e.TextEdit={}));var X;(function(h){function S(R,p,I){var j={label:R};return p!==void 0&&(j.needsConfirmation=p),I!==void 0&&(j.description=I),j}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&D.string(p.label)&&(D.boolean(p.needsConfirmation)||p.needsConfirmation===void 0)&&(D.string(p.description)||p.description===void 0)}h.is=w})(X=e.ChangeAnnotation||(e.ChangeAnnotation={}));var ke;(function(h){function S(w){var R=w;return D.string(R)}h.is=S})(ke=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var Me;(function(h){function S(I,j,ve){return{range:I,newText:j,annotationId:ve}}h.replace=S;function w(I,j,ve){return{range:{start:I,end:I},newText:j,annotationId:ve}}h.insert=w;function R(I,j){return{range:I,newText:"",annotationId:j}}h.del=R;function p(I){var j=I;return $.is(j)&&(X.is(j.annotationId)||ke.is(j.annotationId))}h.is=p})(Me=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var Bt;(function(h){function S(R,p){return{textDocument:R,edits:p}}h.create=S;function w(R){var p=R;return D.defined(p)&&ft.is(p.textDocument)&&Array.isArray(p.edits)}h.is=w})(Bt=e.TextDocumentEdit||(e.TextDocumentEdit={}));var _t;(function(h){function S(R,p,I){var j={kind:"create",uri:R};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(j.options=p),I!==void 0&&(j.annotationId=I),j}h.create=S;function w(R){var p=R;return p&&p.kind==="create"&&D.string(p.uri)&&(p.options===void 0||(p.options.overwrite===void 0||D.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||D.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||ke.is(p.annotationId))}h.is=w})(_t=e.CreateFile||(e.CreateFile={}));var G;(function(h){function S(R,p,I,j){var ve={kind:"rename",oldUri:R,newUri:p};return I!==void 0&&(I.overwrite!==void 0||I.ignoreIfExists!==void 0)&&(ve.options=I),j!==void 0&&(ve.annotationId=j),ve}h.create=S;function w(R){var p=R;return p&&p.kind==="rename"&&D.string(p.oldUri)&&D.string(p.newUri)&&(p.options===void 0||(p.options.overwrite===void 0||D.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||D.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||ke.is(p.annotationId))}h.is=w})(G=e.RenameFile||(e.RenameFile={}));var A;(function(h){function S(R,p,I){var j={kind:"delete",uri:R};return p!==void 0&&(p.recursive!==void 0||p.ignoreIfNotExists!==void 0)&&(j.options=p),I!==void 0&&(j.annotationId=I),j}h.create=S;function w(R){var p=R;return p&&p.kind==="delete"&&D.string(p.uri)&&(p.options===void 0||(p.options.recursive===void 0||D.boolean(p.options.recursive))&&(p.options.ignoreIfNotExists===void 0||D.boolean(p.options.ignoreIfNotExists)))&&(p.annotationId===void 0||ke.is(p.annotationId))}h.is=w})(A=e.DeleteFile||(e.DeleteFile={}));var z;(function(h){function S(w){var R=w;return R&&(R.changes!==void 0||R.documentChanges!==void 0)&&(R.documentChanges===void 0||R.documentChanges.every(function(p){return D.string(p.kind)?_t.is(p)||G.is(p)||A.is(p):Bt.is(p)}))}h.is=S})(z=e.WorkspaceEdit||(e.WorkspaceEdit={}));var Y=function(){function h(S,w){this.edits=S,this.changeAnnotations=w}return h.prototype.insert=function(S,w,R){var p,I;if(R===void 0?p=$.insert(S,w):ke.is(R)?(I=R,p=Me.insert(S,w,R)):(this.assertChangeAnnotations(this.changeAnnotations),I=this.changeAnnotations.manage(R),p=Me.insert(S,w,I)),this.edits.push(p),I!==void 0)return I},h.prototype.replace=function(S,w,R){var p,I;if(R===void 0?p=$.replace(S,w):ke.is(R)?(I=R,p=Me.replace(S,w,R)):(this.assertChangeAnnotations(this.changeAnnotations),I=this.changeAnnotations.manage(R),p=Me.replace(S,w,I)),this.edits.push(p),I!==void 0)return I},h.prototype.delete=function(S,w){var R,p;if(w===void 0?R=$.del(S):ke.is(w)?(p=w,R=Me.del(S,w)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(w),R=Me.del(S,p)),this.edits.push(R),p!==void 0)return p},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}(),Ce=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 R;if(ke.is(S)?R=S:(R=this.nextId(),w=S),this._annotations[R]!==void 0)throw new Error("Id ".concat(R," is already in use."));if(w===void 0)throw new Error("No annotation provided for id ".concat(R));return this._annotations[R]=w,this._size++,R},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 Ce(S.changeAnnotations),S.changeAnnotations=this._changeAnnotations.all(),S.documentChanges.forEach(function(R){if(Bt.is(R)){var p=new Y(R.edits,w._changeAnnotations);w._textEditChanges[R.textDocument.uri]=p}})):S.changes&&Object.keys(S.changes).forEach(function(R){var p=new Y(S.changes[R]);w._textEditChanges[R]=p})):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(ft.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},R=this._textEditChanges[w.uri];if(!R){var p=[],I={textDocument:w,edits:p};this._workspaceEdit.documentChanges.push(I),R=new Y(p,this._changeAnnotations),this._textEditChanges[w.uri]=R}return R}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var R=this._textEditChanges[S];if(!R){var p=[];this._workspaceEdit.changes[S]=p,R=new Y(p),this._textEditChanges[S]=R}return R}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ce,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,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;X.is(w)||ke.is(w)?p=w:R=w;var I,j;if(p===void 0?I=_t.create(S,R):(j=ke.is(p)?p:this._changeAnnotations.manage(p),I=_t.create(S,R,j)),this._workspaceEdit.documentChanges.push(I),j!==void 0)return j},h.prototype.renameFile=function(S,w,R,p){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var I;X.is(R)||ke.is(R)?I=R:p=R;var j,ve;if(I===void 0?j=G.create(S,w,p):(ve=ke.is(I)?I:this._changeAnnotations.manage(I),j=G.create(S,w,p,ve)),this._workspaceEdit.documentChanges.push(j),ve!==void 0)return ve},h.prototype.deleteFile=function(S,w,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;X.is(w)||ke.is(w)?p=w:R=w;var I,j;if(p===void 0?I=A.create(S,R):(j=ke.is(p)?p:this._changeAnnotations.manage(p),I=A.create(S,R,j)),this._workspaceEdit.documentChanges.push(I),j!==void 0)return j},h}();e.WorkspaceChange=fe;var ce;(function(h){function S(R){return{uri:R}}h.create=S;function w(R){var p=R;return D.defined(p)&&D.string(p.uri)}h.is=w})(ce=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var St;(function(h){function S(R,p){return{uri:R,version:p}}h.create=S;function w(R){var p=R;return D.defined(p)&&D.string(p.uri)&&D.integer(p.version)}h.is=w})(St=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var ft;(function(h){function S(R,p){return{uri:R,version:p}}h.create=S;function w(R){var p=R;return D.defined(p)&&D.string(p.uri)&&(p.version===null||D.integer(p.version))}h.is=w})(ft=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var be;(function(h){function S(R,p,I,j){return{uri:R,languageId:p,version:I,text:j}}h.create=S;function w(R){var p=R;return D.defined(p)&&D.string(p.uri)&&D.string(p.languageId)&&D.integer(p.version)&&D.string(p.text)}h.is=w})(be=e.TextDocumentItem||(e.TextDocumentItem={}));var Er;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function S(w){var R=w;return R===h.PlainText||R===h.Markdown}h.is=S})(Er=e.MarkupKind||(e.MarkupKind={}));var Bn;(function(h){function S(w){var R=w;return D.objectLiteral(w)&&Er.is(R.kind)&&D.string(R.value)}h.is=S})(Bn=e.MarkupContent||(e.MarkupContent={}));var ms;(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})(ms=e.CompletionItemKind||(e.CompletionItemKind={}));var mi;(function(h){h.PlainText=1,h.Snippet=2})(mi=e.InsertTextFormat||(e.InsertTextFormat={}));var cr;(function(h){h.Deprecated=1})(cr=e.CompletionItemTag||(e.CompletionItemTag={}));var _o;(function(h){function S(R,p,I){return{newText:R,insert:p,replace:I}}h.create=S;function w(R){var p=R;return p&&D.string(p.newText)&&a.is(p.insert)&&a.is(p.replace)}h.is=w})(_o=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var Nt;(function(h){h.asIs=1,h.adjustIndentation=2})(Nt=e.InsertTextMode||(e.InsertTextMode={}));var ur;(function(h){function S(w){var R=w;return R&&(D.string(R.detail)||R.detail===void 0)&&(D.string(R.description)||R.description===void 0)}h.is=S})(ur=e.CompletionItemLabelDetails||(e.CompletionItemLabelDetails={}));var Sn;(function(h){function S(w){return{label:w}}h.create=S})(Sn=e.CompletionItem||(e.CompletionItem={}));var rr;(function(h){function S(w,R){return{items:w||[],isIncomplete:!!R}}h.create=S})(rr=e.CompletionList||(e.CompletionList={}));var gt;(function(h){function S(R){return R.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=S;function w(R){var p=R;return D.string(p)||D.objectLiteral(p)&&D.string(p.language)&&D.string(p.value)}h.is=w})(gt=e.MarkedString||(e.MarkedString={}));var qt;(function(h){function S(w){var R=w;return!!R&&D.objectLiteral(R)&&(Bn.is(R.contents)||gt.is(R.contents)||D.typedArray(R.contents,gt.is))&&(w.range===void 0||a.is(w.range))}h.is=S})(qt=e.Hover||(e.Hover={}));var Wr;(function(h){function S(w,R){return R?{label:w,documentation:R}:{label:w}}h.create=S})(Wr=e.ParameterInformation||(e.ParameterInformation={}));var Pr;(function(h){function S(w,R){for(var p=[],I=2;I<arguments.length;I++)p[I-2]=arguments[I];var j={label:w};return D.defined(R)&&(j.documentation=R),D.defined(p)?j.parameters=p:j.parameters=[],j}h.create=S})(Pr=e.SignatureInformation||(e.SignatureInformation={}));var kn;(function(h){h.Text=1,h.Read=2,h.Write=3})(kn=e.DocumentHighlightKind||(e.DocumentHighlightKind={}));var hi;(function(h){function S(w,R){var p={range:w};return D.number(R)&&(p.kind=R),p}h.create=S})(hi=e.DocumentHighlight||(e.DocumentHighlight={}));var hs;(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})(hs=e.SymbolKind||(e.SymbolKind={}));var gi;(function(h){h.Deprecated=1})(gi=e.SymbolTag||(e.SymbolTag={}));var Qr;(function(h){function S(w,R,p,I,j){var ve={name:w,kind:R,location:{uri:I,range:p}};return j&&(ve.containerName=j),ve}h.create=S})(Qr=e.SymbolInformation||(e.SymbolInformation={}));var Hi;(function(h){function S(w,R,p,I){return I!==void 0?{name:w,kind:R,location:{uri:p,range:I}}:{name:w,kind:R,location:{uri:p}}}h.create=S})(Hi=e.WorkspaceSymbol||(e.WorkspaceSymbol={}));var cu;(function(h){function S(R,p,I,j,ve,It){var rt={name:R,detail:p,kind:I,range:j,selectionRange:ve};return It!==void 0&&(rt.children=It),rt}h.create=S;function w(R){var p=R;return p&&D.string(p.name)&&D.number(p.kind)&&a.is(p.range)&&a.is(p.selectionRange)&&(p.detail===void 0||D.string(p.detail))&&(p.deprecated===void 0||D.boolean(p.deprecated))&&(p.children===void 0||Array.isArray(p.children))&&(p.tags===void 0||Array.isArray(p.tags))}h.is=w})(cu=e.DocumentSymbol||(e.DocumentSymbol={}));var Gi;(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"})(Gi=e.CodeActionKind||(e.CodeActionKind={}));var wn;(function(h){h.Invoked=1,h.Automatic=2})(wn=e.CodeActionTriggerKind||(e.CodeActionTriggerKind={}));var gs;(function(h){function S(R,p,I){var j={diagnostics:R};return p!=null&&(j.only=p),I!=null&&(j.triggerKind=I),j}h.create=S;function w(R){var p=R;return D.defined(p)&&D.typedArray(p.diagnostics,d.is)&&(p.only===void 0||D.typedArray(p.only,D.string))&&(p.triggerKind===void 0||p.triggerKind===wn.Invoked||p.triggerKind===wn.Automatic)}h.is=w})(gs=e.CodeActionContext||(e.CodeActionContext={}));var So;(function(h){function S(R,p,I){var j={title:R},ve=!0;return typeof p=="string"?(ve=!1,j.kind=p):_.is(p)?j.command=p:j.edit=p,ve&&I!==void 0&&(j.kind=I),j}h.create=S;function w(R){var p=R;return p&&D.string(p.title)&&(p.diagnostics===void 0||D.typedArray(p.diagnostics,d.is))&&(p.kind===void 0||D.string(p.kind))&&(p.edit!==void 0||p.command!==void 0)&&(p.command===void 0||_.is(p.command))&&(p.isPreferred===void 0||D.boolean(p.isPreferred))&&(p.edit===void 0||z.is(p.edit))}h.is=w})(So=e.CodeAction||(e.CodeAction={}));var ko;(function(h){function S(R,p){var I={range:R};return D.defined(p)&&(I.data=p),I}h.create=S;function w(R){var p=R;return D.defined(p)&&a.is(p.range)&&(D.undefined(p.command)||_.is(p.command))}h.is=w})(ko=e.CodeLens||(e.CodeLens={}));var Kn;(function(h){function S(R,p){return{tabSize:R,insertSpaces:p}}h.create=S;function w(R){var p=R;return D.defined(p)&&D.uinteger(p.tabSize)&&D.boolean(p.insertSpaces)}h.is=w})(Kn=e.FormattingOptions||(e.FormattingOptions={}));var b;(function(h){function S(R,p,I){return{range:R,target:p,data:I}}h.create=S;function w(R){var p=R;return D.defined(p)&&a.is(p.range)&&(D.undefined(p.target)||D.string(p.target))}h.is=w})(b=e.DocumentLink||(e.DocumentLink={}));var y;(function(h){function S(R,p){return{range:R,parent:p}}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&a.is(p.range)&&(p.parent===void 0||h.is(p.parent))}h.is=w})(y=e.SelectionRange||(e.SelectionRange={}));var k;(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"})(k=e.SemanticTokenTypes||(e.SemanticTokenTypes={}));var L;(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"})(L=e.SemanticTokenModifiers||(e.SemanticTokenModifiers={}));var U;(function(h){function S(w){var R=w;return D.objectLiteral(R)&&(R.resultId===void 0||typeof R.resultId=="string")&&Array.isArray(R.data)&&(R.data.length===0||typeof R.data[0]=="number")}h.is=S})(U=e.SemanticTokens||(e.SemanticTokens={}));var se;(function(h){function S(R,p){return{range:R,text:p}}h.create=S;function w(R){var p=R;return p!=null&&a.is(p.range)&&D.string(p.text)}h.is=w})(se=e.InlineValueText||(e.InlineValueText={}));var ae;(function(h){function S(R,p,I){return{range:R,variableName:p,caseSensitiveLookup:I}}h.create=S;function w(R){var p=R;return p!=null&&a.is(p.range)&&D.boolean(p.caseSensitiveLookup)&&(D.string(p.variableName)||p.variableName===void 0)}h.is=w})(ae=e.InlineValueVariableLookup||(e.InlineValueVariableLookup={}));var ye;(function(h){function S(R,p){return{range:R,expression:p}}h.create=S;function w(R){var p=R;return p!=null&&a.is(p.range)&&(D.string(p.expression)||p.expression===void 0)}h.is=w})(ye=e.InlineValueEvaluatableExpression||(e.InlineValueEvaluatableExpression={}));var ne;(function(h){function S(R,p){return{frameId:R,stoppedLocation:p}}h.create=S;function w(R){var p=R;return D.defined(p)&&a.is(R.stoppedLocation)}h.is=w})(ne=e.InlineValueContext||(e.InlineValueContext={}));var te;(function(h){h.Type=1,h.Parameter=2;function S(w){return w===1||w===2}h.is=S})(te=e.InlayHintKind||(e.InlayHintKind={}));var ie;(function(h){function S(R){return{value:R}}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&(p.tooltip===void 0||D.string(p.tooltip)||Bn.is(p.tooltip))&&(p.location===void 0||c.is(p.location))&&(p.command===void 0||_.is(p.command))}h.is=w})(ie=e.InlayHintLabelPart||(e.InlayHintLabelPart={}));var ue;(function(h){function S(R,p,I){var j={position:R,label:p};return I!==void 0&&(j.kind=I),j}h.create=S;function w(R){var p=R;return D.objectLiteral(p)&&s.is(p.position)&&(D.string(p.label)||D.typedArray(p.label,ie.is))&&(p.kind===void 0||te.is(p.kind))&&p.textEdits===void 0||D.typedArray(p.textEdits,$.is)&&(p.tooltip===void 0||D.string(p.tooltip)||Bn.is(p.tooltip))&&(p.paddingLeft===void 0||D.boolean(p.paddingLeft))&&(p.paddingRight===void 0||D.boolean(p.paddingRight))}h.is=w})(ue=e.InlayHint||(e.InlayHint={}));var Ee;(function(h){function S(w){var R=w;return D.objectLiteral(R)&&n.is(R.uri)&&D.string(R.name)}h.is=S})(Ee=e.WorkspaceFolder||(e.WorkspaceFolder={})),e.EOL=[`
30
30
  `,`\r
31
- `,"\r"];var ot;(function(l){function g(b,w,W,Re){return new Dt(b,w,W,Re)}l.create=g;function v(b){var w=b;return!!(x.defined(w)&&x.string(w.uri)&&(x.undefined(w.languageId)||x.string(w.languageId))&&x.uinteger(w.lineCount)&&x.func(w.getText)&&x.func(w.positionAt)&&x.func(w.offsetAt))}l.is=v;function d(b,w){for(var W=b.getText(),Re=u(w,function(vn,Zi){var Xc=vn.range.start.line-Zi.range.start.line;return Xc===0?vn.range.start.character-Zi.range.start.character:Xc}),pe=W.length,Et=Re.length-1;Et>=0;Et--){var Pt=Re[Et],ar=b.offsetAt(Pt.range.start),J=b.offsetAt(Pt.range.end);if(J<=pe)W=W.substring(0,ar)+Pt.newText+W.substring(J,W.length);else throw new Error("Overlapping edit");pe=ar}return W}l.applyEdits=d;function u(b,w){if(b.length<=1)return b;var W=b.length/2|0,Re=b.slice(0,W),pe=b.slice(W);u(Re,w),u(pe,w);for(var Et=0,Pt=0,ar=0;Et<Re.length&&Pt<pe.length;){var J=w(Re[Et],pe[Pt]);J<=0?b[ar++]=Re[Et++]:b[ar++]=pe[Pt++]}for(;Et<Re.length;)b[ar++]=Re[Et++];for(;Pt<pe.length;)b[ar++]=pe[Pt++];return b}})(ot=e.TextDocument||(e.TextDocument={}));var Dt=function(){function l(g,v,d,u){this._uri=g,this._languageId=v,this._version=d,this._content=u,this._lineOffsets=void 0}return Object.defineProperty(l.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),l.prototype.getText=function(g){if(g){var v=this.offsetAt(g.start),d=this.offsetAt(g.end);return this._content.substring(v,d)}return this._content},l.prototype.update=function(g,v){this._content=g.text,this._version=v,this._lineOffsets=void 0},l.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var g=[],v=this._content,d=!0,u=0;u<v.length;u++){d&&(g.push(u),d=!1);var b=v.charAt(u);d=b==="\r"||b===`
32
- `,b==="\r"&&u+1<v.length&&v.charAt(u+1)===`
33
- `&&u++}d&&v.length>0&&g.push(v.length),this._lineOffsets=g}return this._lineOffsets},l.prototype.positionAt=function(g){g=Math.max(Math.min(g,this._content.length),0);var v=this.getLineOffsets(),d=0,u=v.length;if(u===0)return s.create(0,g);for(;d<u;){var b=Math.floor((d+u)/2);v[b]>g?u=b:d=b+1}var w=d-1;return s.create(w,g-v[w])},l.prototype.offsetAt=function(g){var v=this.getLineOffsets();if(g.line>=v.length)return this._content.length;if(g.line<0)return 0;var d=v[g.line],u=g.line+1<v.length?v[g.line+1]:this._content.length;return Math.max(Math.min(d+g.character,u),d)},Object.defineProperty(l.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),l}(),x;(function(l){var g=Object.prototype.toString;function v(J){return typeof J<"u"}l.defined=v;function d(J){return typeof J>"u"}l.undefined=d;function u(J){return J===!0||J===!1}l.boolean=u;function b(J){return g.call(J)==="[object String]"}l.string=b;function w(J){return g.call(J)==="[object Number]"}l.number=w;function W(J,vn,Zi){return g.call(J)==="[object Number]"&&vn<=J&&J<=Zi}l.numberRange=W;function Re(J){return g.call(J)==="[object Number]"&&-2147483648<=J&&J<=2147483647}l.integer=Re;function pe(J){return g.call(J)==="[object Number]"&&0<=J&&J<=2147483647}l.uinteger=pe;function Et(J){return g.call(J)==="[object Function]"}l.func=Et;function Pt(J){return J!==null&&typeof J=="object"}l.objectLiteral=Pt;function ar(J,vn){return Array.isArray(J)&&J.every(vn)}l.typedArray=ar})(x||(x={}))})});var At=$(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ProtocolNotificationType=Vr.ProtocolNotificationType0=Vr.ProtocolRequestType=Vr.ProtocolRequestType0=Vr.RegistrationType=Vr.MessageDirection=void 0;var aa=io(),ZN;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(ZN=Vr.MessageDirection||(Vr.MessageDirection={}));var Ng=class{constructor(e){this.method=e}};Vr.RegistrationType=Ng;var Ig=class extends aa.RequestType0{constructor(e){super(e)}};Vr.ProtocolRequestType0=Ig;var Og=class extends aa.RequestType{constructor(e){super(e,aa.ParameterStructures.byName)}};Vr.ProtocolRequestType=Og;var Lg=class extends aa.NotificationType0{constructor(e){super(e)}};Vr.ProtocolNotificationType0=Lg;var Mg=class extends aa.NotificationType{constructor(e){super(e,aa.ParameterStructures.byName)}};Vr.ProtocolNotificationType=Mg});var Zl=$(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.objectLiteral=Xt.typedArray=Xt.stringArray=Xt.array=Xt.func=Xt.error=Xt.number=Xt.string=Xt.boolean=void 0;function eI(t){return t===!0||t===!1}Xt.boolean=eI;function mx(t){return typeof t=="string"||t instanceof String}Xt.string=mx;function tI(t){return typeof t=="number"||t instanceof Number}Xt.number=tI;function rI(t){return t instanceof Error}Xt.error=rI;function nI(t){return typeof t=="function"}Xt.func=nI;function hx(t){return Array.isArray(t)}Xt.array=hx;function iI(t){return hx(t)&&t.every(e=>mx(e))}Xt.stringArray=iI;function oI(t,e){return Array.isArray(t)&&t.every(e)}Xt.typedArray=oI;function sI(t){return t!==null&&typeof t=="object"}Xt.objectLiteral=sI});var yx=$(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.ImplementationRequest=void 0;var gx=At(),aI;(function(t){t.method="textDocument/implementation",t.messageDirection=gx.MessageDirection.clientToServer,t.type=new gx.ProtocolRequestType(t.method)})(aI=tu.ImplementationRequest||(tu.ImplementationRequest={}))});var Tx=$(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.TypeDefinitionRequest=void 0;var vx=At(),cI;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=vx.MessageDirection.clientToServer,t.type=new vx.ProtocolRequestType(t.method)})(cI=ru.TypeDefinitionRequest||(ru.TypeDefinitionRequest={}))});var Rx=$(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.DidChangeWorkspaceFoldersNotification=Io.WorkspaceFoldersRequest=void 0;var ef=At(),uI;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ef.MessageDirection.serverToClient,t.type=new ef.ProtocolRequestType0(t.method)})(uI=Io.WorkspaceFoldersRequest||(Io.WorkspaceFoldersRequest={}));var lI;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ef.MessageDirection.clientToServer,t.type=new ef.ProtocolNotificationType(t.method)})(lI=Io.DidChangeWorkspaceFoldersNotification||(Io.DidChangeWorkspaceFoldersNotification={}))});var bx=$(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.ConfigurationRequest=void 0;var xx=At(),fI;(function(t){t.method="workspace/configuration",t.messageDirection=xx.MessageDirection.serverToClient,t.type=new xx.ProtocolRequestType(t.method)})(fI=nu.ConfigurationRequest||(nu.ConfigurationRequest={}))});var _x=$(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.ColorPresentationRequest=Oo.DocumentColorRequest=void 0;var tf=At(),dI;(function(t){t.method="textDocument/documentColor",t.messageDirection=tf.MessageDirection.clientToServer,t.type=new tf.ProtocolRequestType(t.method)})(dI=Oo.DocumentColorRequest||(Oo.DocumentColorRequest={}));var pI;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=tf.MessageDirection.clientToServer,t.type=new tf.ProtocolRequestType(t.method)})(pI=Oo.ColorPresentationRequest||(Oo.ColorPresentationRequest={}))});var kx=$(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.FoldingRangeRequest=void 0;var Sx=At(),mI;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Sx.MessageDirection.clientToServer,t.type=new Sx.ProtocolRequestType(t.method)})(mI=iu.FoldingRangeRequest||(iu.FoldingRangeRequest={}))});var wx=$(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.DeclarationRequest=void 0;var Cx=At(),hI;(function(t){t.method="textDocument/declaration",t.messageDirection=Cx.MessageDirection.clientToServer,t.type=new Cx.ProtocolRequestType(t.method)})(hI=ou.DeclarationRequest||(ou.DeclarationRequest={}))});var Ex=$(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.SelectionRangeRequest=void 0;var Dx=At(),gI;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Dx.MessageDirection.clientToServer,t.type=new Dx.ProtocolRequestType(t.method)})(gI=su.SelectionRangeRequest||(su.SelectionRangeRequest={}))});var Px=$(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.WorkDoneProgressCancelNotification=Zn.WorkDoneProgressCreateRequest=Zn.WorkDoneProgress=void 0;var yI=io(),rf=At(),vI;(function(t){t.type=new yI.ProgressType;function e(r){return r===t.type}t.is=e})(vI=Zn.WorkDoneProgress||(Zn.WorkDoneProgress={}));var TI;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=rf.MessageDirection.serverToClient,t.type=new rf.ProtocolRequestType(t.method)})(TI=Zn.WorkDoneProgressCreateRequest||(Zn.WorkDoneProgressCreateRequest={}));var RI;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=rf.MessageDirection.clientToServer,t.type=new rf.ProtocolNotificationType(t.method)})(RI=Zn.WorkDoneProgressCancelNotification||(Zn.WorkDoneProgressCancelNotification={}))});var Ax=$(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.CallHierarchyOutgoingCallsRequest=ei.CallHierarchyIncomingCallsRequest=ei.CallHierarchyPrepareRequest=void 0;var ca=At(),xI;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ca.MessageDirection.clientToServer,t.type=new ca.ProtocolRequestType(t.method)})(xI=ei.CallHierarchyPrepareRequest||(ei.CallHierarchyPrepareRequest={}));var bI;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ca.MessageDirection.clientToServer,t.type=new ca.ProtocolRequestType(t.method)})(bI=ei.CallHierarchyIncomingCallsRequest||(ei.CallHierarchyIncomingCallsRequest={}));var _I;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ca.MessageDirection.clientToServer,t.type=new ca.ProtocolRequestType(t.method)})(_I=ei.CallHierarchyOutgoingCallsRequest||(ei.CallHierarchyOutgoingCallsRequest={}))});var Nx=$(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.SemanticTokensRefreshRequest=Yt.SemanticTokensRangeRequest=Yt.SemanticTokensDeltaRequest=Yt.SemanticTokensRequest=Yt.SemanticTokensRegistrationType=Yt.TokenFormat=void 0;var oo=At(),SI;(function(t){t.Relative="relative"})(SI=Yt.TokenFormat||(Yt.TokenFormat={}));var nf;(function(t){t.method="textDocument/semanticTokens",t.type=new oo.RegistrationType(t.method)})(nf=Yt.SemanticTokensRegistrationType||(Yt.SemanticTokensRegistrationType={}));var kI;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=oo.MessageDirection.clientToServer,t.type=new oo.ProtocolRequestType(t.method),t.registrationMethod=nf.method})(kI=Yt.SemanticTokensRequest||(Yt.SemanticTokensRequest={}));var CI;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=oo.MessageDirection.clientToServer,t.type=new oo.ProtocolRequestType(t.method),t.registrationMethod=nf.method})(CI=Yt.SemanticTokensDeltaRequest||(Yt.SemanticTokensDeltaRequest={}));var wI;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=oo.MessageDirection.clientToServer,t.type=new oo.ProtocolRequestType(t.method),t.registrationMethod=nf.method})(wI=Yt.SemanticTokensRangeRequest||(Yt.SemanticTokensRangeRequest={}));var DI;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=oo.MessageDirection.clientToServer,t.type=new oo.ProtocolRequestType0(t.method)})(DI=Yt.SemanticTokensRefreshRequest||(Yt.SemanticTokensRefreshRequest={}))});var Ox=$(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.ShowDocumentRequest=void 0;var Ix=At(),EI;(function(t){t.method="window/showDocument",t.messageDirection=Ix.MessageDirection.serverToClient,t.type=new Ix.ProtocolRequestType(t.method)})(EI=au.ShowDocumentRequest||(au.ShowDocumentRequest={}))});var Mx=$(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.LinkedEditingRangeRequest=void 0;var Lx=At(),PI;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Lx.MessageDirection.clientToServer,t.type=new Lx.ProtocolRequestType(t.method)})(PI=cu.LinkedEditingRangeRequest||(cu.LinkedEditingRangeRequest={}))});var $x=$(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.WillDeleteFilesRequest=Nt.DidDeleteFilesNotification=Nt.DidRenameFilesNotification=Nt.WillRenameFilesRequest=Nt.DidCreateFilesNotification=Nt.WillCreateFilesRequest=Nt.FileOperationPatternKind=void 0;var In=At(),AI;(function(t){t.file="file",t.folder="folder"})(AI=Nt.FileOperationPatternKind||(Nt.FileOperationPatternKind={}));var NI;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=In.MessageDirection.clientToServer,t.type=new In.ProtocolRequestType(t.method)})(NI=Nt.WillCreateFilesRequest||(Nt.WillCreateFilesRequest={}));var II;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=In.MessageDirection.clientToServer,t.type=new In.ProtocolNotificationType(t.method)})(II=Nt.DidCreateFilesNotification||(Nt.DidCreateFilesNotification={}));var OI;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=In.MessageDirection.clientToServer,t.type=new In.ProtocolRequestType(t.method)})(OI=Nt.WillRenameFilesRequest||(Nt.WillRenameFilesRequest={}));var LI;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=In.MessageDirection.clientToServer,t.type=new In.ProtocolNotificationType(t.method)})(LI=Nt.DidRenameFilesNotification||(Nt.DidRenameFilesNotification={}));var MI;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=In.MessageDirection.clientToServer,t.type=new In.ProtocolNotificationType(t.method)})(MI=Nt.DidDeleteFilesNotification||(Nt.DidDeleteFilesNotification={}));var $I;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=In.MessageDirection.clientToServer,t.type=new In.ProtocolRequestType(t.method)})($I=Nt.WillDeleteFilesRequest||(Nt.WillDeleteFilesRequest={}))});var Fx=$(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.MonikerRequest=ti.MonikerKind=ti.UniquenessLevel=void 0;var qx=At(),qI;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(qI=ti.UniquenessLevel||(ti.UniquenessLevel={}));var FI;(function(t){t.$import="import",t.$export="export",t.local="local"})(FI=ti.MonikerKind||(ti.MonikerKind={}));var jI;(function(t){t.method="textDocument/moniker",t.messageDirection=qx.MessageDirection.clientToServer,t.type=new qx.ProtocolRequestType(t.method)})(jI=ti.MonikerRequest||(ti.MonikerRequest={}))});var jx=$(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.TypeHierarchySubtypesRequest=ri.TypeHierarchySupertypesRequest=ri.TypeHierarchyPrepareRequest=void 0;var ua=At(),UI;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=ua.MessageDirection.clientToServer,t.type=new ua.ProtocolRequestType(t.method)})(UI=ri.TypeHierarchyPrepareRequest||(ri.TypeHierarchyPrepareRequest={}));var WI;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=ua.MessageDirection.clientToServer,t.type=new ua.ProtocolRequestType(t.method)})(WI=ri.TypeHierarchySupertypesRequest||(ri.TypeHierarchySupertypesRequest={}));var HI;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=ua.MessageDirection.clientToServer,t.type=new ua.ProtocolRequestType(t.method)})(HI=ri.TypeHierarchySubtypesRequest||(ri.TypeHierarchySubtypesRequest={}))});var Ux=$(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.InlineValueRefreshRequest=Lo.InlineValueRequest=void 0;var of=At(),GI;(function(t){t.method="textDocument/inlineValue",t.messageDirection=of.MessageDirection.clientToServer,t.type=new of.ProtocolRequestType(t.method)})(GI=Lo.InlineValueRequest||(Lo.InlineValueRequest={}));var BI;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=of.MessageDirection.clientToServer,t.type=new of.ProtocolRequestType0(t.method)})(BI=Lo.InlineValueRefreshRequest||(Lo.InlineValueRefreshRequest={}))});var Wx=$(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.InlayHintRefreshRequest=ni.InlayHintResolveRequest=ni.InlayHintRequest=void 0;var la=At(),KI;(function(t){t.method="textDocument/inlayHint",t.messageDirection=la.MessageDirection.clientToServer,t.type=new la.ProtocolRequestType(t.method)})(KI=ni.InlayHintRequest||(ni.InlayHintRequest={}));var zI;(function(t){t.method="inlayHint/resolve",t.messageDirection=la.MessageDirection.clientToServer,t.type=new la.ProtocolRequestType(t.method)})(zI=ni.InlayHintResolveRequest||(ni.InlayHintResolveRequest={}));var VI;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=la.MessageDirection.clientToServer,t.type=new la.ProtocolRequestType0(t.method)})(VI=ni.InlayHintRefreshRequest||(ni.InlayHintRefreshRequest={}))});var Gx=$(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.DiagnosticRefreshRequest=br.WorkspaceDiagnosticRequest=br.DocumentDiagnosticRequest=br.DocumentDiagnosticReportKind=br.DiagnosticServerCancellationData=void 0;var Hx=io(),XI=Zl(),fa=At(),YI;(function(t){function e(r){let n=r;return n&&XI.boolean(n.retriggerRequest)}t.is=e})(YI=br.DiagnosticServerCancellationData||(br.DiagnosticServerCancellationData={}));var JI;(function(t){t.Full="full",t.Unchanged="unchanged"})(JI=br.DocumentDiagnosticReportKind||(br.DocumentDiagnosticReportKind={}));var QI;(function(t){t.method="textDocument/diagnostic",t.messageDirection=fa.MessageDirection.clientToServer,t.type=new fa.ProtocolRequestType(t.method),t.partialResult=new Hx.ProgressType})(QI=br.DocumentDiagnosticRequest||(br.DocumentDiagnosticRequest={}));var ZI;(function(t){t.method="workspace/diagnostic",t.messageDirection=fa.MessageDirection.clientToServer,t.type=new fa.ProtocolRequestType(t.method),t.partialResult=new Hx.ProgressType})(ZI=br.WorkspaceDiagnosticRequest||(br.WorkspaceDiagnosticRequest={}));var e0;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=fa.MessageDirection.clientToServer,t.type=new fa.ProtocolRequestType0(t.method)})(e0=br.DiagnosticRefreshRequest||(br.DiagnosticRefreshRequest={}))});var zx=$(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.DidCloseNotebookDocumentNotification=Fe.DidSaveNotebookDocumentNotification=Fe.DidChangeNotebookDocumentNotification=Fe.NotebookCellArrayChange=Fe.DidOpenNotebookDocumentNotification=Fe.NotebookDocumentSyncRegistrationType=Fe.NotebookDocument=Fe.NotebookCell=Fe.ExecutionSummary=Fe.NotebookCellKind=void 0;var uu=xs(),ii=Zl(),ki=At(),Bx;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Bx=Fe.NotebookCellKind||(Fe.NotebookCellKind={}));var Kx;(function(t){function e(i,o){let s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}t.create=e;function r(i){let o=i;return ii.objectLiteral(o)&&uu.uinteger.is(o.executionOrder)&&(o.success===void 0||ii.boolean(o.success))}t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=n})(Kx=Fe.ExecutionSummary||(Fe.ExecutionSummary={}));var $g;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return ii.objectLiteral(s)&&Bx.is(s.kind)&&uu.DocumentUri.is(s.document)&&(s.metadata===void 0||ii.objectLiteral(s.metadata))}t.is=r;function n(o,s){let a=new Set;return o.document!==s.document&&a.add("document"),o.kind!==s.kind&&a.add("kind"),o.executionSummary!==s.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!Kx.equals(o.executionSummary,s.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!="object")return!1;let a=Array.isArray(o),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(o.length!==s.length)return!1;for(let f=0;f<o.length;f++)if(!i(o[f],s[f]))return!1}if(ii.objectLiteral(o)&&ii.objectLiteral(s)){let f=Object.keys(o),p=Object.keys(s);if(f.length!==p.length||(f.sort(),p.sort(),!i(f,p)))return!1;for(let m=0;m<f.length;m++){let T=f[m];if(!i(o[T],s[T]))return!1}}return!0}})($g=Fe.NotebookCell||(Fe.NotebookCell={}));var t0;(function(t){function e(n,i,o,s){return{uri:n,notebookType:i,version:o,cells:s}}t.create=e;function r(n){let i=n;return ii.objectLiteral(i)&&ii.string(i.uri)&&uu.integer.is(i.version)&&ii.typedArray(i.cells,$g.is)}t.is=r})(t0=Fe.NotebookDocument||(Fe.NotebookDocument={}));var lu;(function(t){t.method="notebookDocument/sync",t.messageDirection=ki.MessageDirection.clientToServer,t.type=new ki.RegistrationType(t.method)})(lu=Fe.NotebookDocumentSyncRegistrationType||(Fe.NotebookDocumentSyncRegistrationType={}));var r0;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=ki.MessageDirection.clientToServer,t.type=new ki.ProtocolNotificationType(t.method),t.registrationMethod=lu.method})(r0=Fe.DidOpenNotebookDocumentNotification||(Fe.DidOpenNotebookDocumentNotification={}));var n0;(function(t){function e(n){let i=n;return ii.objectLiteral(i)&&uu.uinteger.is(i.start)&&uu.uinteger.is(i.deleteCount)&&(i.cells===void 0||ii.typedArray(i.cells,$g.is))}t.is=e;function r(n,i,o){let s={start:n,deleteCount:i};return o!==void 0&&(s.cells=o),s}t.create=r})(n0=Fe.NotebookCellArrayChange||(Fe.NotebookCellArrayChange={}));var i0;(function(t){t.method="notebookDocument/didChange",t.messageDirection=ki.MessageDirection.clientToServer,t.type=new ki.ProtocolNotificationType(t.method),t.registrationMethod=lu.method})(i0=Fe.DidChangeNotebookDocumentNotification||(Fe.DidChangeNotebookDocumentNotification={}));var o0;(function(t){t.method="notebookDocument/didSave",t.messageDirection=ki.MessageDirection.clientToServer,t.type=new ki.ProtocolNotificationType(t.method),t.registrationMethod=lu.method})(o0=Fe.DidSaveNotebookDocumentNotification||(Fe.DidSaveNotebookDocumentNotification={}));var s0;(function(t){t.method="notebookDocument/didClose",t.messageDirection=ki.MessageDirection.clientToServer,t.type=new ki.ProtocolNotificationType(t.method),t.registrationMethod=lu.method})(s0=Fe.DidCloseNotebookDocumentNotification||(Fe.DidCloseNotebookDocumentNotification={}))});var rb=$(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.WorkspaceSymbolRequest=_.CodeActionResolveRequest=_.CodeActionRequest=_.DocumentSymbolRequest=_.DocumentHighlightRequest=_.ReferencesRequest=_.DefinitionRequest=_.SignatureHelpRequest=_.SignatureHelpTriggerKind=_.HoverRequest=_.CompletionResolveRequest=_.CompletionRequest=_.CompletionTriggerKind=_.PublishDiagnosticsNotification=_.WatchKind=_.RelativePattern=_.FileChangeType=_.DidChangeWatchedFilesNotification=_.WillSaveTextDocumentWaitUntilRequest=_.WillSaveTextDocumentNotification=_.TextDocumentSaveReason=_.DidSaveTextDocumentNotification=_.DidCloseTextDocumentNotification=_.DidChangeTextDocumentNotification=_.TextDocumentContentChangeEvent=_.DidOpenTextDocumentNotification=_.TextDocumentSyncKind=_.TelemetryEventNotification=_.LogMessageNotification=_.ShowMessageRequest=_.ShowMessageNotification=_.MessageType=_.DidChangeConfigurationNotification=_.ExitNotification=_.ShutdownRequest=_.InitializedNotification=_.InitializeErrorCodes=_.InitializeRequest=_.WorkDoneProgressOptions=_.TextDocumentRegistrationOptions=_.StaticRegistrationOptions=_.PositionEncodingKind=_.FailureHandlingKind=_.ResourceOperationKind=_.UnregistrationRequest=_.RegistrationRequest=_.DocumentSelector=_.NotebookCellTextDocumentFilter=_.NotebookDocumentFilter=_.TextDocumentFilter=void 0;_.TypeHierarchySubtypesRequest=_.TypeHierarchyPrepareRequest=_.MonikerRequest=_.MonikerKind=_.UniquenessLevel=_.WillDeleteFilesRequest=_.DidDeleteFilesNotification=_.WillRenameFilesRequest=_.DidRenameFilesNotification=_.WillCreateFilesRequest=_.DidCreateFilesNotification=_.FileOperationPatternKind=_.LinkedEditingRangeRequest=_.ShowDocumentRequest=_.SemanticTokensRegistrationType=_.SemanticTokensRefreshRequest=_.SemanticTokensRangeRequest=_.SemanticTokensDeltaRequest=_.SemanticTokensRequest=_.TokenFormat=_.CallHierarchyPrepareRequest=_.CallHierarchyOutgoingCallsRequest=_.CallHierarchyIncomingCallsRequest=_.WorkDoneProgressCancelNotification=_.WorkDoneProgressCreateRequest=_.WorkDoneProgress=_.SelectionRangeRequest=_.DeclarationRequest=_.FoldingRangeRequest=_.ColorPresentationRequest=_.DocumentColorRequest=_.ConfigurationRequest=_.DidChangeWorkspaceFoldersNotification=_.WorkspaceFoldersRequest=_.TypeDefinitionRequest=_.ImplementationRequest=_.ApplyWorkspaceEditRequest=_.ExecuteCommandRequest=_.PrepareRenameRequest=_.RenameRequest=_.PrepareSupportDefaultBehavior=_.DocumentOnTypeFormattingRequest=_.DocumentRangeFormattingRequest=_.DocumentFormattingRequest=_.DocumentLinkResolveRequest=_.DocumentLinkRequest=_.CodeLensRefreshRequest=_.CodeLensResolveRequest=_.CodeLensRequest=_.WorkspaceSymbolResolveRequest=void 0;_.DidCloseNotebookDocumentNotification=_.DidSaveNotebookDocumentNotification=_.DidChangeNotebookDocumentNotification=_.NotebookCellArrayChange=_.DidOpenNotebookDocumentNotification=_.NotebookDocumentSyncRegistrationType=_.NotebookDocument=_.NotebookCell=_.ExecutionSummary=_.NotebookCellKind=_.DiagnosticRefreshRequest=_.WorkspaceDiagnosticRequest=_.DocumentDiagnosticRequest=_.DocumentDiagnosticReportKind=_.DiagnosticServerCancellationData=_.InlayHintRefreshRequest=_.InlayHintResolveRequest=_.InlayHintRequest=_.InlineValueRefreshRequest=_.InlineValueRequest=_.TypeHierarchySupertypesRequest=void 0;var H=At(),Vx=xs(),_r=Zl(),a0=yx();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return a0.ImplementationRequest}});var c0=Tx();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c0.TypeDefinitionRequest}});var Xx=Rx();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Xx.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Xx.DidChangeWorkspaceFoldersNotification}});var u0=bx();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return u0.ConfigurationRequest}});var Yx=_x();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return Yx.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return Yx.ColorPresentationRequest}});var l0=kx();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return l0.FoldingRangeRequest}});var f0=wx();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return f0.DeclarationRequest}});var d0=Ex();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return d0.SelectionRangeRequest}});var qg=Px();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return qg.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return qg.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return qg.WorkDoneProgressCancelNotification}});var Fg=Ax();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Fg.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Fg.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Fg.CallHierarchyPrepareRequest}});var da=Nx();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return da.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return da.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return da.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return da.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return da.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return da.SemanticTokensRegistrationType}});var p0=Ox();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return p0.ShowDocumentRequest}});var m0=Mx();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return m0.LinkedEditingRangeRequest}});var bs=$x();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return bs.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return bs.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return bs.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return bs.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return bs.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return bs.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return bs.WillDeleteFilesRequest}});var jg=Fx();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return jg.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return jg.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return jg.MonikerRequest}});var Ug=jx();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ug.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Ug.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Ug.TypeHierarchySupertypesRequest}});var Jx=Ux();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return Jx.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Jx.InlineValueRefreshRequest}});var Wg=Wx();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return Wg.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Wg.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Wg.InlayHintRefreshRequest}});var fu=Gx();Object.defineProperty(_,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return fu.DiagnosticServerCancellationData}});Object.defineProperty(_,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return fu.DocumentDiagnosticReportKind}});Object.defineProperty(_,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return fu.DocumentDiagnosticRequest}});Object.defineProperty(_,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return fu.WorkspaceDiagnosticRequest}});Object.defineProperty(_,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return fu.DiagnosticRefreshRequest}});var Ci=zx();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return Ci.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return Ci.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return Ci.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return Ci.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Ci.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Ci.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Ci.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Ci.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Ci.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Ci.DidCloseNotebookDocumentNotification}});var Qx;(function(t){function e(r){let n=r;return _r.string(n.language)||_r.string(n.scheme)||_r.string(n.pattern)}t.is=e})(Qx=_.TextDocumentFilter||(_.TextDocumentFilter={}));var Zx;(function(t){function e(r){let n=r;return _r.objectLiteral(n)&&(_r.string(n.notebookType)||_r.string(n.scheme)||_r.string(n.pattern))}t.is=e})(Zx=_.NotebookDocumentFilter||(_.NotebookDocumentFilter={}));var eb;(function(t){function e(r){let n=r;return _r.objectLiteral(n)&&(_r.string(n.notebook)||Zx.is(n.notebook))&&(n.language===void 0||_r.string(n.language))}t.is=e})(eb=_.NotebookCellTextDocumentFilter||(_.NotebookCellTextDocumentFilter={}));var tb;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!_r.string(n)&&!Qx.is(n)&&!eb.is(n))return!1;return!0}t.is=e})(tb=_.DocumentSelector||(_.DocumentSelector={}));var h0;(function(t){t.method="client/registerCapability",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(h0=_.RegistrationRequest||(_.RegistrationRequest={}));var g0;(function(t){t.method="client/unregisterCapability",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(g0=_.UnregistrationRequest||(_.UnregistrationRequest={}));var y0;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(y0=_.ResourceOperationKind||(_.ResourceOperationKind={}));var v0;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(v0=_.FailureHandlingKind||(_.FailureHandlingKind={}));var T0;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(T0=_.PositionEncodingKind||(_.PositionEncodingKind={}));var R0;(function(t){function e(r){let n=r;return n&&_r.string(n.id)&&n.id.length>0}t.hasId=e})(R0=_.StaticRegistrationOptions||(_.StaticRegistrationOptions={}));var x0;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||tb.is(n.documentSelector))}t.is=e})(x0=_.TextDocumentRegistrationOptions||(_.TextDocumentRegistrationOptions={}));var b0;(function(t){function e(n){let i=n;return _r.objectLiteral(i)&&(i.workDoneProgress===void 0||_r.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&_r.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(b0=_.WorkDoneProgressOptions||(_.WorkDoneProgressOptions={}));var _0;(function(t){t.method="initialize",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(_0=_.InitializeRequest||(_.InitializeRequest={}));var S0;(function(t){t.unknownProtocolVersion=1})(S0=_.InitializeErrorCodes||(_.InitializeErrorCodes={}));var k0;(function(t){t.method="initialized",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(k0=_.InitializedNotification||(_.InitializedNotification={}));var C0;(function(t){t.method="shutdown",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType0(t.method)})(C0=_.ShutdownRequest||(_.ShutdownRequest={}));var w0;(function(t){t.method="exit",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType0(t.method)})(w0=_.ExitNotification||(_.ExitNotification={}));var D0;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(D0=_.DidChangeConfigurationNotification||(_.DidChangeConfigurationNotification={}));var E0;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(E0=_.MessageType||(_.MessageType={}));var P0;(function(t){t.method="window/showMessage",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(P0=_.ShowMessageNotification||(_.ShowMessageNotification={}));var A0;(function(t){t.method="window/showMessageRequest",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(A0=_.ShowMessageRequest||(_.ShowMessageRequest={}));var N0;(function(t){t.method="window/logMessage",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(N0=_.LogMessageNotification||(_.LogMessageNotification={}));var I0;(function(t){t.method="telemetry/event",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(I0=_.TelemetryEventNotification||(_.TelemetryEventNotification={}));var O0;(function(t){t.None=0,t.Full=1,t.Incremental=2})(O0=_.TextDocumentSyncKind||(_.TextDocumentSyncKind={}));var L0;(function(t){t.method="textDocument/didOpen",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(L0=_.DidOpenTextDocumentNotification||(_.DidOpenTextDocumentNotification={}));var M0;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(M0=_.TextDocumentContentChangeEvent||(_.TextDocumentContentChangeEvent={}));var $0;(function(t){t.method="textDocument/didChange",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})($0=_.DidChangeTextDocumentNotification||(_.DidChangeTextDocumentNotification={}));var q0;(function(t){t.method="textDocument/didClose",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(q0=_.DidCloseTextDocumentNotification||(_.DidCloseTextDocumentNotification={}));var F0;(function(t){t.method="textDocument/didSave",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(F0=_.DidSaveTextDocumentNotification||(_.DidSaveTextDocumentNotification={}));var j0;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(j0=_.TextDocumentSaveReason||(_.TextDocumentSaveReason={}));var U0;(function(t){t.method="textDocument/willSave",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(U0=_.WillSaveTextDocumentNotification||(_.WillSaveTextDocumentNotification={}));var W0;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(W0=_.WillSaveTextDocumentWaitUntilRequest||(_.WillSaveTextDocumentWaitUntilRequest={}));var H0;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(H0=_.DidChangeWatchedFilesNotification||(_.DidChangeWatchedFilesNotification={}));var G0;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(G0=_.FileChangeType||(_.FileChangeType={}));var B0;(function(t){function e(r){let n=r;return _r.objectLiteral(n)&&(Vx.URI.is(n.baseUri)||Vx.WorkspaceFolder.is(n.baseUri))&&_r.string(n.pattern)}t.is=e})(B0=_.RelativePattern||(_.RelativePattern={}));var K0;(function(t){t.Create=1,t.Change=2,t.Delete=4})(K0=_.WatchKind||(_.WatchKind={}));var z0;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(z0=_.PublishDiagnosticsNotification||(_.PublishDiagnosticsNotification={}));var V0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(V0=_.CompletionTriggerKind||(_.CompletionTriggerKind={}));var X0;(function(t){t.method="textDocument/completion",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(X0=_.CompletionRequest||(_.CompletionRequest={}));var Y0;(function(t){t.method="completionItem/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(Y0=_.CompletionResolveRequest||(_.CompletionResolveRequest={}));var J0;(function(t){t.method="textDocument/hover",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(J0=_.HoverRequest||(_.HoverRequest={}));var Q0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Q0=_.SignatureHelpTriggerKind||(_.SignatureHelpTriggerKind={}));var Z0;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(Z0=_.SignatureHelpRequest||(_.SignatureHelpRequest={}));var eO;(function(t){t.method="textDocument/definition",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(eO=_.DefinitionRequest||(_.DefinitionRequest={}));var tO;(function(t){t.method="textDocument/references",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(tO=_.ReferencesRequest||(_.ReferencesRequest={}));var rO;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(rO=_.DocumentHighlightRequest||(_.DocumentHighlightRequest={}));var nO;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(nO=_.DocumentSymbolRequest||(_.DocumentSymbolRequest={}));var iO;(function(t){t.method="textDocument/codeAction",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(iO=_.CodeActionRequest||(_.CodeActionRequest={}));var oO;(function(t){t.method="codeAction/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(oO=_.CodeActionResolveRequest||(_.CodeActionResolveRequest={}));var sO;(function(t){t.method="workspace/symbol",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(sO=_.WorkspaceSymbolRequest||(_.WorkspaceSymbolRequest={}));var aO;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(aO=_.WorkspaceSymbolResolveRequest||(_.WorkspaceSymbolResolveRequest={}));var cO;(function(t){t.method="textDocument/codeLens",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(cO=_.CodeLensRequest||(_.CodeLensRequest={}));var uO;(function(t){t.method="codeLens/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(uO=_.CodeLensResolveRequest||(_.CodeLensResolveRequest={}));var lO;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType0(t.method)})(lO=_.CodeLensRefreshRequest||(_.CodeLensRefreshRequest={}));var fO;(function(t){t.method="textDocument/documentLink",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(fO=_.DocumentLinkRequest||(_.DocumentLinkRequest={}));var dO;(function(t){t.method="documentLink/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(dO=_.DocumentLinkResolveRequest||(_.DocumentLinkResolveRequest={}));var pO;(function(t){t.method="textDocument/formatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(pO=_.DocumentFormattingRequest||(_.DocumentFormattingRequest={}));var mO;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(mO=_.DocumentRangeFormattingRequest||(_.DocumentRangeFormattingRequest={}));var hO;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(hO=_.DocumentOnTypeFormattingRequest||(_.DocumentOnTypeFormattingRequest={}));var gO;(function(t){t.Identifier=1})(gO=_.PrepareSupportDefaultBehavior||(_.PrepareSupportDefaultBehavior={}));var yO;(function(t){t.method="textDocument/rename",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(yO=_.RenameRequest||(_.RenameRequest={}));var vO;(function(t){t.method="textDocument/prepareRename",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(vO=_.PrepareRenameRequest||(_.PrepareRenameRequest={}));var TO;(function(t){t.method="workspace/executeCommand",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(TO=_.ExecuteCommandRequest||(_.ExecuteCommandRequest={}));var RO;(function(t){t.method="workspace/applyEdit",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType("workspace/applyEdit")})(RO=_.ApplyWorkspaceEditRequest||(_.ApplyWorkspaceEditRequest={}))});var ib=$(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.createProtocolConnection=void 0;var nb=io();function xO(t,e,r,n){return nb.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,nb.createMessageConnection)(t,e,r,n)}sf.createProtocolConnection=xO});var ob=$(Xr=>{"use strict";var bO=Xr&&Xr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),af=Xr&&Xr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bO(e,t,r)};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.LSPErrorCodes=Xr.createProtocolConnection=void 0;af(io(),Xr);af(xs(),Xr);af(At(),Xr);af(rb(),Xr);var _O=ib();Object.defineProperty(Xr,"createProtocolConnection",{enumerable:!0,get:function(){return _O.createProtocolConnection}});var SO;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(SO=Xr.LSPErrorCodes||(Xr.LSPErrorCodes={}))});var Jt=$(wi=>{"use strict";var kO=wi&&wi.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),sb=wi&&wi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kO(e,t,r)};Object.defineProperty(wi,"__esModule",{value:!0});wi.createProtocolConnection=void 0;var CO=Ag();sb(Ag(),wi);sb(ob(),wi);function wO(t,e,r,n){return(0,CO.createMessageConnection)(t,e,r,n)}wi.createProtocolConnection=wO});var Gg=$(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.SemanticTokensBuilder=Mo.SemanticTokensDiff=Mo.SemanticTokensFeature=void 0;var cf=Jt(),DO=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(cf.SemanticTokensRefreshRequest.type),on:e=>{let r=cf.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=cf.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=cf.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Mo.SemanticTokensFeature=DO;var uf=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,o=r-1;for(;i>=n&&o>=n&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<n||o<n)&&(i++,o++);let s=i-n+1,a=this.modifiedSequence.slice(n,o+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:s-1}]:[{start:n,deleteCount:s,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};Mo.SemanticTokensDiff=uf;var Hg=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,r,n,i,o){let s=e,a=r;this._dataLen>0&&(s-=this._prevLine,s===0&&(a-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=r}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 uf(this._prevData,this._data).computeDiff()}:this.build()}};Mo.SemanticTokensBuilder=Hg});var Kg=$(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.TextDocuments=void 0;var _s=Jt(),Bg=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new _s.Emitter,this._onDidOpen=new _s.Emitter,this._onDidClose=new _s.Emitter,this._onDidSave=new _s.Emitter,this._onWillSave=new _s.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=_s.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,o=n.contentChanges;if(o.length===0)return;let{version:s}=i;if(s==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,o,s),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let o=this._syncedDocuments.get(n.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),_s.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};lf.TextDocuments=Bg});var Vg=$(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.NotebookDocuments=pa.NotebookSyncFeature=void 0;var On=Jt(),ab=Kg(),EO=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(On.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(On.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(On.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(On.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};pa.NotebookSyncFeature=EO;var ff=class t{onDidOpenTextDocument(e){return this.openHandler=e,On.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,On.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,On.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}};ff.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var zg=class{constructor(e){e instanceof ab.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ab.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new On.Emitter,this._onDidChange=new On.Emitter,this._onDidSave=new On.Emitter,this._onDidClose=new On.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new ff,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)r.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let s=o.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,o.metadata=c.metadata);let f=[],p=[],m=[],T=[];if(c.cells!==void 0){let P=c.cells;if(P.structure!==void 0){let y=P.structure.array;if(o.cells.splice(y.start,y.deleteCount,...y.cells!==void 0?y.cells:[]),P.structure.didOpen!==void 0)for(let h of P.structure.didOpen)r.openTextDocument({textDocument:h}),f.push(h.uri);if(P.structure.didClose)for(let h of P.structure.didClose)r.closeTextDocument({textDocument:h}),p.push(h.uri)}if(P.data!==void 0){let y=new Map(P.data.map(h=>[h.document,h]));for(let h=0;h<=o.cells.length;h++){let C=y.get(o.cells[h].document);if(C!==void 0){let M=o.cells.splice(h,1,C);if(m.push({old:M[0],new:C}),y.delete(C.document),y.size===0)break}}}if(P.textContent!==void 0)for(let y of P.textContent)r.changeTextDocument({textDocument:y.document,contentChanges:y.changes}),T.push(y.document.uri)}this.updateCellMap(o);let k={notebookDocument:o};a&&(k.metadata={old:s,new:o.metadata});let A=[];for(let P of f)A.push(this.getNotebookCell(P));let N=[];for(let P of p)N.push(this.getNotebookCell(P));let O=[];for(let P of T)O.push(this.getNotebookCell(P));(A.length>0||N.length>0||m.length>0||O.length>0)&&(k.cells={added:A,removed:N,changed:{data:m,textContent:O}}),(k.metadata!==void 0||k.cells!==void 0)&&this._onDidChange.fire(k)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let s of i.cellTextDocuments)r.closeTextDocument({textDocument:s});this.notebookDocuments.delete(i.notebookDocument.uri);for(let s of o.cells)this.notebookCellMap.delete(s.document)}})),On.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};pa.NotebookDocuments=zg});var Xg=$(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.thenable=Qt.typedArray=Qt.stringArray=Qt.array=Qt.func=Qt.error=Qt.number=Qt.string=Qt.boolean=void 0;function PO(t){return t===!0||t===!1}Qt.boolean=PO;function cb(t){return typeof t=="string"||t instanceof String}Qt.string=cb;function AO(t){return typeof t=="number"||t instanceof Number}Qt.number=AO;function NO(t){return t instanceof Error}Qt.error=NO;function ub(t){return typeof t=="function"}Qt.func=ub;function lb(t){return Array.isArray(t)}Qt.array=lb;function IO(t){return lb(t)&&t.every(e=>cb(e))}Qt.stringArray=IO;function OO(t,e){return Array.isArray(t)&&t.every(e)}Qt.typedArray=OO;function LO(t){return t&&ub(t.then)}Qt.thenable=LO});var Yg=$(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.generateUuid=Ln.parse=Ln.isUUID=Ln.v4=Ln.empty=void 0;var du=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},pu=class t extends du{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(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}};pu._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];pu._timeHighBits=["8","9","a","b"];Ln.empty=new du("00000000-0000-0000-0000-000000000000");function fb(){return new pu}Ln.v4=fb;var MO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function db(t){return MO.test(t)}Ln.isUUID=db;function $O(t){if(!db(t))throw new Error("invalid uuid");return new du(t)}Ln.parse=$O;function qO(){return fb().asHex()}Ln.generateUuid=qO});var pb=$(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.attachPartialResult=qo.ProgressFeature=qo.attachWorkDone=void 0;var $o=Jt(),FO=Yg(),Ss=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let o={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress($o.WorkDoneProgress.type,this._token,o)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress($o.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress($o.WorkDoneProgress.type,this._token,{kind:"end"})}};Ss.Instances=new Map;var df=class extends Ss{constructor(e,r){super(e,r),this._source=new $o.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},mu=class{constructor(){}begin(){}report(){}done(){}},pf=class extends mu{constructor(){super(),this._source=new $o.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function jO(t,e){if(e===void 0||e.workDoneToken===void 0)return new mu;let r=e.workDoneToken;return delete e.workDoneToken,new Ss(t,r)}qo.attachWorkDone=jO;var UO=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification($o.WorkDoneProgressCancelNotification.type,r=>{let n=Ss.Instances.get(r.token);(n instanceof df||n instanceof pf)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new mu:new Ss(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,FO.generateUuid)();return this.connection.sendRequest($o.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new df(this.connection,e))}else return Promise.resolve(new pf)}};qo.ProgressFeature=UO;var Jg;(function(t){t.type=new $o.ProgressType})(Jg||(Jg={}));var Qg=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(Jg.type,this._token,e)}};function WO(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new Qg(t,r)}qo.attachPartialResult=WO});var mb=$(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.ConfigurationFeature=void 0;var HO=Jt(),GO=Xg(),BO=t=>class extends t{getConfiguration(e){return e?GO.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(HO.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};mf.ConfigurationFeature=BO});var hb=$(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.WorkspaceFoldersFeature=void 0;var hf=Jt(),KO=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new hf.Emitter,this.connection.onNotification(hf.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(hf.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(hf.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};gf.WorkspaceFoldersFeature=KO});var gb=$(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.CallHierarchyFeature=void 0;var Zg=Jt(),zO=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Zg.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=Zg.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=Zg.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};yf.CallHierarchyFeature=zO});var yb=$(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.ShowDocumentFeature=void 0;var VO=Jt(),XO=t=>class extends t{showDocument(e){return this.connection.sendRequest(VO.ShowDocumentRequest.type,e)}};vf.ShowDocumentFeature=XO});var vb=$(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.FileOperationsFeature=void 0;var ma=Jt(),YO=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(ma.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(ma.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(ma.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(ma.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(ma.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(ma.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};Tf.FileOperationsFeature=YO});var Tb=$(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.LinkedEditingRangeFeature=void 0;var JO=Jt(),QO=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(JO.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};Rf.LinkedEditingRangeFeature=QO});var Rb=$(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.TypeHierarchyFeature=void 0;var ey=Jt(),ZO=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(ey.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=ey.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=ey.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};xf.TypeHierarchyFeature=ZO});var bb=$(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.InlineValueFeature=void 0;var xb=Jt(),eL=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(xb.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(xb.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};bf.InlineValueFeature=eL});var _b=$(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.InlayHintFeature=void 0;var ty=Jt(),tL=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(ty.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(ty.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(ty.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};_f.InlayHintFeature=tL});var Sb=$(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.DiagnosticFeature=void 0;var hu=Jt(),rL=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(hu.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(hu.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(hu.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(hu.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(hu.WorkspaceDiagnosticRequest.partialResult,r)))}}};Sf.DiagnosticFeature=rL});var kb=$(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.MonikerFeature=void 0;var nL=Jt(),iL=t=>class extends t{get moniker(){return{on:e=>{let r=nL.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};kf.MonikerFeature=iL});var qb=$(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 X=Jt(),Mn=Xg(),ny=Yg(),xe=pb(),oL=mb(),sL=hb(),aL=gb(),cL=Gg(),uL=yb(),lL=vb(),fL=Tb(),dL=Rb(),pL=bb(),mL=_b(),hL=Sb(),gL=Vg(),yL=kb();function ry(t){if(t!==null)return t}var iy=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Le.ErrorMessageTracker=iy;var Cf=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)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(X.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,X.RAL)().console.error("Sending log message failed")})}},oy=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,...r){let n={type:X.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(X.ShowMessageRequest.type,n).then(ry)}showWarningMessage(e,...r){let n={type:X.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(X.ShowMessageRequest.type,n).then(ry)}showInformationMessage(e,...r){let n={type:X.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(X.ShowMessageRequest.type,n).then(ry)}},Cb=(0,uL.ShowDocumentFeature)((0,xe.ProgressFeature)(oy)),vL;(function(t){function e(){return new wf}t.create=e})(vL=Le.BulkRegistration||(Le.BulkRegistration={}));var wf=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Mn.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=ny.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},TL;(function(t){function e(){return new gu(void 0,[])}t.create=e})(TL=Le.BulkUnregistration||(Le.BulkUnregistration={}));var gu=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(X.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Mn.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(X.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},o=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},Df=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,r,n){return e instanceof wf?this.registerMany(e):e instanceof gu?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=Mn.string(r)?r:r.method,o=ny.generateUuid(),s={registrations:[{id:o,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(X.RegistrationRequest.type,s).then(a=>(e.add({id:o,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=Mn.string(e)?e:e.method,i=ny.generateUuid(),o={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(X.RegistrationRequest.type,o).then(s=>X.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(s)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(X.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(X.RegistrationRequest.type,r).then(()=>new gu(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},sy=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 r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(X.ApplyWorkspaceEditRequest.type,n)}},wb=(0,lL.FileOperationsFeature)((0,sL.WorkspaceFoldersFeature)((0,oL.ConfigurationFeature)(sy))),Ef=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,r){this._trace!==X.Trace.Off&&this.connection.sendNotification(X.LogTraceNotification.type,{message:e,verbose:this._trace===X.Trace.Verbose?r:void 0}).catch(()=>{})}},Pf=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")})}},Af=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,xe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xe.attachPartialResult)(this.connection,r)}};Le._LanguagesImpl=Af;var Db=(0,yL.MonikerFeature)((0,hL.DiagnosticFeature)((0,mL.InlayHintFeature)((0,pL.InlineValueFeature)((0,dL.TypeHierarchyFeature)((0,fL.LinkedEditingRangeFeature)((0,cL.SemanticTokensFeature)((0,aL.CallHierarchyFeature)(Af)))))))),Nf=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,xe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xe.attachPartialResult)(this.connection,r)}};Le._NotebooksImpl=Nf;var Eb=(0,gL.NotebookSyncFeature)(Nf);function Pb(t,e){return function(r){return e(t(r))}}Le.combineConsoleFeatures=Pb;function Ab(t,e){return function(r){return e(t(r))}}Le.combineTelemetryFeatures=Ab;function Nb(t,e){return function(r){return e(t(r))}}Le.combineTracerFeatures=Nb;function Ib(t,e){return function(r){return e(t(r))}}Le.combineClientFeatures=Ib;function Ob(t,e){return function(r){return e(t(r))}}Le.combineWindowFeatures=Ob;function Lb(t,e){return function(r){return e(t(r))}}Le.combineWorkspaceFeatures=Lb;function Mb(t,e){return function(r){return e(t(r))}}Le.combineLanguagesFeatures=Mb;function $b(t,e){return function(r){return e(t(r))}}Le.combineNotebooksFeatures=$b;function RL(t,e){function r(i,o,s){return i&&o?s(i,o):i||o}return{__brand:"features",console:r(t.console,e.console,Pb),tracer:r(t.tracer,e.tracer,Nb),telemetry:r(t.telemetry,e.telemetry,Ab),client:r(t.client,e.client,Ib),window:r(t.window,e.window,Ob),workspace:r(t.workspace,e.workspace,Lb),languages:r(t.languages,e.languages,Mb),notebooks:r(t.notebooks,e.notebooks,$b)}}Le.combineFeatures=RL;function xL(t,e,r){let n=r&&r.console?new(r.console(Cf)):new Cf,i=t(n);n.rawAttach(i);let o=r&&r.tracer?new(r.tracer(Ef)):new Ef,s=r&&r.telemetry?new(r.telemetry(Pf)):new Pf,a=r&&r.client?new(r.client(Df)):new Df,c=r&&r.window?new(r.window(Cb)):new Cb,f=r&&r.workspace?new(r.workspace(wb)):new wb,p=r&&r.languages?new(r.languages(Db)):new Db,m=r&&r.notebooks?new(r.notebooks(Eb)):new Eb,T=[n,o,s,a,c,f,p,m];function k(y){return y instanceof Promise?y:Mn.thenable(y)?new Promise((h,C)=>{y.then(M=>h(M),M=>C(M))}):Promise.resolve(y)}let A,N,O,P={listen:()=>i.listen(),sendRequest:(y,...h)=>i.sendRequest(Mn.string(y)?y:y.method,...h),onRequest:(y,h)=>i.onRequest(y,h),sendNotification:(y,h)=>{let C=Mn.string(y)?y:y.method;return arguments.length===1?i.sendNotification(C):i.sendNotification(C,h)},onNotification:(y,h)=>i.onNotification(y,h),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:y=>(N=y,{dispose:()=>{N=void 0}}),onInitialized:y=>i.onNotification(X.InitializedNotification.type,y),onShutdown:y=>(A=y,{dispose:()=>{A=void 0}}),onExit:y=>(O=y,{dispose:()=>{O=void 0}}),get console(){return n},get telemetry(){return s},get tracer(){return o},get client(){return a},get window(){return c},get workspace(){return f},get languages(){return p},get notebooks(){return m},onDidChangeConfiguration:y=>i.onNotification(X.DidChangeConfigurationNotification.type,y),onDidChangeWatchedFiles:y=>i.onNotification(X.DidChangeWatchedFilesNotification.type,y),__textDocumentSync:void 0,onDidOpenTextDocument:y=>i.onNotification(X.DidOpenTextDocumentNotification.type,y),onDidChangeTextDocument:y=>i.onNotification(X.DidChangeTextDocumentNotification.type,y),onDidCloseTextDocument:y=>i.onNotification(X.DidCloseTextDocumentNotification.type,y),onWillSaveTextDocument:y=>i.onNotification(X.WillSaveTextDocumentNotification.type,y),onWillSaveTextDocumentWaitUntil:y=>i.onRequest(X.WillSaveTextDocumentWaitUntilRequest.type,y),onDidSaveTextDocument:y=>i.onNotification(X.DidSaveTextDocumentNotification.type,y),sendDiagnostics:y=>i.sendNotification(X.PublishDiagnosticsNotification.type,y),onHover:y=>i.onRequest(X.HoverRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),void 0)),onCompletion:y=>i.onRequest(X.CompletionRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onCompletionResolve:y=>i.onRequest(X.CompletionResolveRequest.type,y),onSignatureHelp:y=>i.onRequest(X.SignatureHelpRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),void 0)),onDeclaration:y=>i.onRequest(X.DeclarationRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onDefinition:y=>i.onRequest(X.DefinitionRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onTypeDefinition:y=>i.onRequest(X.TypeDefinitionRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onImplementation:y=>i.onRequest(X.ImplementationRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onReferences:y=>i.onRequest(X.ReferencesRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onDocumentHighlight:y=>i.onRequest(X.DocumentHighlightRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onDocumentSymbol:y=>i.onRequest(X.DocumentSymbolRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onWorkspaceSymbol:y=>i.onRequest(X.WorkspaceSymbolRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onWorkspaceSymbolResolve:y=>i.onRequest(X.WorkspaceSymbolResolveRequest.type,y),onCodeAction:y=>i.onRequest(X.CodeActionRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onCodeActionResolve:y=>i.onRequest(X.CodeActionResolveRequest.type,(h,C)=>y(h,C)),onCodeLens:y=>i.onRequest(X.CodeLensRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onCodeLensResolve:y=>i.onRequest(X.CodeLensResolveRequest.type,(h,C)=>y(h,C)),onDocumentFormatting:y=>i.onRequest(X.DocumentFormattingRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),void 0)),onDocumentRangeFormatting:y=>i.onRequest(X.DocumentRangeFormattingRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),void 0)),onDocumentOnTypeFormatting:y=>i.onRequest(X.DocumentOnTypeFormattingRequest.type,(h,C)=>y(h,C)),onRenameRequest:y=>i.onRequest(X.RenameRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),void 0)),onPrepareRename:y=>i.onRequest(X.PrepareRenameRequest.type,(h,C)=>y(h,C)),onDocumentLinks:y=>i.onRequest(X.DocumentLinkRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onDocumentLinkResolve:y=>i.onRequest(X.DocumentLinkResolveRequest.type,(h,C)=>y(h,C)),onDocumentColor:y=>i.onRequest(X.DocumentColorRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onColorPresentation:y=>i.onRequest(X.ColorPresentationRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onFoldingRanges:y=>i.onRequest(X.FoldingRangeRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onSelectionRanges:y=>i.onRequest(X.SelectionRangeRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),(0,xe.attachPartialResult)(i,h))),onExecuteCommand:y=>i.onRequest(X.ExecuteCommandRequest.type,(h,C)=>y(h,C,(0,xe.attachWorkDone)(i,h),void 0)),dispose:()=>i.dispose()};for(let y of T)y.attach(P);return i.onRequest(X.InitializeRequest.type,y=>{e.initialize(y),Mn.string(y.trace)&&(o.trace=X.Trace.fromString(y.trace));for(let h of T)h.initialize(y.capabilities);if(N){let h=N(y,new X.CancellationTokenSource().token,(0,xe.attachWorkDone)(i,y),void 0);return k(h).then(C=>{if(C instanceof X.ResponseError)return C;let M=C;M||(M={capabilities:{}});let z=M.capabilities;z||(z={},M.capabilities=z),z.textDocumentSync===void 0||z.textDocumentSync===null?z.textDocumentSync=Mn.number(P.__textDocumentSync)?P.__textDocumentSync:X.TextDocumentSyncKind.None:!Mn.number(z.textDocumentSync)&&!Mn.number(z.textDocumentSync.change)&&(z.textDocumentSync.change=Mn.number(P.__textDocumentSync)?P.__textDocumentSync:X.TextDocumentSyncKind.None);for(let ce of T)ce.fillServerCapabilities(z);return M})}else{let h={capabilities:{textDocumentSync:X.TextDocumentSyncKind.None}};for(let C of T)C.fillServerCapabilities(h.capabilities);return h}}),i.onRequest(X.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new X.CancellationTokenSource().token)}),i.onNotification(X.ExitNotification.type,()=>{try{O&&O()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(X.SetTraceNotification.type,y=>{o.trace=X.Trace.fromString(y.value)}),P}Le.createConnection=xL});var ay=$(Sr=>{"use strict";var bL=Sr&&Sr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Fb=Sr&&Sr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bL(e,t,r)};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.ProposedFeatures=Sr.NotebookDocuments=Sr.TextDocuments=Sr.SemanticTokensBuilder=void 0;var _L=Gg();Object.defineProperty(Sr,"SemanticTokensBuilder",{enumerable:!0,get:function(){return _L.SemanticTokensBuilder}});Fb(Jt(),Sr);var SL=Kg();Object.defineProperty(Sr,"TextDocuments",{enumerable:!0,get:function(){return SL.TextDocuments}});var kL=Vg();Object.defineProperty(Sr,"NotebookDocuments",{enumerable:!0,get:function(){return kL.NotebookDocuments}});Fb(qb(),Sr);var CL;(function(t){t.all={__brand:"features"}})(CL=Sr.ProposedFeatures||(Sr.ProposedFeatures={}))});var Ub=$((_8,jb)=>{"use strict";jb.exports=Jt()});var Xe=$(Di=>{"use strict";var wL=Di&&Di.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Hb=Di&&Di.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wL(e,t,r)};Object.defineProperty(Di,"__esModule",{value:!0});Di.createConnection=void 0;var If=ay();Hb(Ub(),Di);Hb(ay(),Di);var Wb=!1,DL={initialize:t=>{},get shutdownReceived(){return Wb},set shutdownReceived(t){Wb=t},exit:t=>{}};function EL(t,e,r,n){let i,o,s,a;t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),If.ConnectionStrategy.is(t)||If.ConnectionOptions.is(t)?a=t:(o=t,s=e,a=r);let c=f=>(0,If.createProtocolConnection)(o,s,f,a);return(0,If.createConnection)(c,DL,i)}Di.createConnection=EL});var Lc=$(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.stringArray=Kr.array=Kr.func=Kr.error=Kr.number=Kr.string=Kr.boolean=void 0;function OK(t){return t===!0||t===!1}Kr.boolean=OK;function rP(t){return typeof t=="string"||t instanceof String}Kr.string=rP;function LK(t){return typeof t=="number"||t instanceof Number}Kr.number=LK;function MK(t){return t instanceof Error}Kr.error=MK;function $K(t){return typeof t=="function"}Kr.func=$K;function nP(t){return Array.isArray(t)}Kr.array=nP;function qK(t){return nP(t)&&t.every(e=>rP(e))}Kr.stringArray=qK});var CT=$(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.Message=ae.NotificationType9=ae.NotificationType8=ae.NotificationType7=ae.NotificationType6=ae.NotificationType5=ae.NotificationType4=ae.NotificationType3=ae.NotificationType2=ae.NotificationType1=ae.NotificationType0=ae.NotificationType=ae.RequestType9=ae.RequestType8=ae.RequestType7=ae.RequestType6=ae.RequestType5=ae.RequestType4=ae.RequestType3=ae.RequestType2=ae.RequestType1=ae.RequestType=ae.RequestType0=ae.AbstractMessageSignature=ae.ParameterStructures=ae.ResponseError=ae.ErrorCodes=void 0;var Xs=Lc(),iP;(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})(iP=ae.ErrorCodes||(ae.ErrorCodes={}));var nT=class t extends Error{constructor(e,r,n){super(r),this.code=Xs.number(e)?e:iP.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ae.ResponseError=nT;var gn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ae.ParameterStructures=gn;gn.auto=new gn("auto");gn.byPosition=new gn("byPosition");gn.byName=new gn("byName");var Tt=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return gn.auto}};ae.AbstractMessageSignature=Tt;var iT=class extends Tt{constructor(e){super(e,0)}};ae.RequestType0=iT;var oT=class extends Tt{constructor(e,r=gn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType=oT;var sT=class extends Tt{constructor(e,r=gn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType1=sT;var aT=class extends Tt{constructor(e){super(e,2)}};ae.RequestType2=aT;var cT=class extends Tt{constructor(e){super(e,3)}};ae.RequestType3=cT;var uT=class extends Tt{constructor(e){super(e,4)}};ae.RequestType4=uT;var lT=class extends Tt{constructor(e){super(e,5)}};ae.RequestType5=lT;var fT=class extends Tt{constructor(e){super(e,6)}};ae.RequestType6=fT;var dT=class extends Tt{constructor(e){super(e,7)}};ae.RequestType7=dT;var pT=class extends Tt{constructor(e){super(e,8)}};ae.RequestType8=pT;var mT=class extends Tt{constructor(e){super(e,9)}};ae.RequestType9=mT;var hT=class extends Tt{constructor(e,r=gn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType=hT;var gT=class extends Tt{constructor(e){super(e,0)}};ae.NotificationType0=gT;var yT=class extends Tt{constructor(e,r=gn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType1=yT;var vT=class extends Tt{constructor(e){super(e,2)}};ae.NotificationType2=vT;var TT=class extends Tt{constructor(e){super(e,3)}};ae.NotificationType3=TT;var RT=class extends Tt{constructor(e){super(e,4)}};ae.NotificationType4=RT;var xT=class extends Tt{constructor(e){super(e,5)}};ae.NotificationType5=xT;var bT=class extends Tt{constructor(e){super(e,6)}};ae.NotificationType6=bT;var _T=class extends Tt{constructor(e){super(e,7)}};ae.NotificationType7=_T;var ST=class extends Tt{constructor(e){super(e,8)}};ae.NotificationType8=ST;var kT=class extends Tt{constructor(e){super(e,9)}};ae.NotificationType9=kT;var FK;(function(t){function e(i){let o=i;return o&&Xs.string(o.method)&&(Xs.string(o.id)||Xs.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Xs.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Xs.string(o.id)||Xs.number(o.id)||o.id===null)}t.isResponse=n})(FK=ae.Message||(ae.Message={}))});var DT=$(Eo=>{"use strict";var oP;Object.defineProperty(Eo,"__esModule",{value:!0});Eo.LRUCache=Eo.LinkedMap=Eo.Touch=void 0;var rn;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(rn=Eo.Touch||(Eo.Touch={}));var Em=class{constructor(){this[oP]="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,r=rn.None){let n=this._map.get(e);if(n)return r!==rn.None&&this.touch(n,r),n.value}set(e,r,n=rn.None){let i=this._map.get(e);if(i)i.value=r,n!==rn.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case rn.None:this.addItemLast(i);break;case rn.First:this.addItemFirst(i);break;case rn.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 r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.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,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(oP=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.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 r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==rn.First&&r!==rn.Last)){if(r===rn.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===rn.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Eo.LinkedMap=Em;var wT=class extends Em{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),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,r=rn.AsNew){return super.get(e,r)}peek(e){return super.get(e,rn.None)}set(e,r){return super.set(e,r,rn.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Eo.LRUCache=wT});var sP=$(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.Disposable=void 0;var jK;(function(t){function e(r){return{dispose:r}}t.create=e})(jK=Tl.Disposable||(Tl.Disposable={}))});var cs=$(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});var ET;function PT(){if(ET===void 0)throw new Error("No runtime abstraction layer installed");return ET}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");ET=r}t.install=e})(PT||(PT={}));AT.default=PT});var Mc=$(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.Emitter=Ys.Event=void 0;var UK=cs(),WK;(function(t){let e={dispose(){}};t.None=function(){return e}})(WK=Ys.Event||(Ys.Event={}));var NT=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,UK.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Pm=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new NT),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.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)}};Ys.Emitter=Pm;Pm._noop=function(){}});var Nm=$(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.CancellationTokenSource=Js.CancellationToken=void 0;var HK=cs(),GK=Lc(),IT=Mc(),OT;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:IT.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:IT.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||GK.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(OT=Js.CancellationToken||(Js.CancellationToken={}));var BK=Object.freeze(function(t,e){let r=(0,HK.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Am=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?BK:(this._emitter||(this._emitter=new IT.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},LT=class{get token(){return this._token||(this._token=new Am),this._token}cancel(){this._token?this._token.cancel():this._token=OT.Cancelled}dispose(){this._token?this._token instanceof Am&&this._token.dispose():this._token=OT.None}};Js.CancellationTokenSource=LT});var aP=$($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.SharedArrayReceiverStrategy=$c.SharedArraySenderStrategy=void 0;var KK=Nm(),Rl;(function(t){t.Continue=0,t.Cancelled=1})(Rl||(Rl={}));var MT=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Rl.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,Rl.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};$c.SharedArraySenderStrategy=MT;var $T=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Rl.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},qT=class{constructor(e){this.token=new $T(e)}cancel(){}dispose(){}},FT=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new KK.CancellationTokenSource:new qT(r)}};$c.SharedArrayReceiverStrategy=FT});var UT=$(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.Semaphore=void 0;var zK=cs(),jT=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((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,zK.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 r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Im.Semaphore=jT});var cP=$(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ReadableStreamMessageReader=Po.AbstractMessageReader=Po.MessageReader=void 0;var HT=cs(),qc=Lc(),WT=Mc(),VK=UT(),XK;(function(t){function e(r){let n=r;return n&&qc.func(n.listen)&&qc.func(n.dispose)&&qc.func(n.onError)&&qc.func(n.onClose)&&qc.func(n.onPartialMessage)}t.is=e})(XK=Po.MessageReader||(Po.MessageReader={}));var Om=class{constructor(){this.errorEmitter=new WT.Emitter,this.closeEmitter=new WT.Emitter,this.partialMessageEmitter=new WT.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: ${qc.string(e.message)?e.message:"unknown"}`)}};Po.AbstractMessageReader=Om;var GT;(function(t){function e(r){let n,i,o,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,s.set(o.name,o)),r.contentDecoders!==void 0)for(let f of r.contentDecoders)s.set(f.name,f);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let f of r.contentTypeDecoders)c.set(f.name,f)}return a===void 0&&(a=(0,HT.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(GT||(GT={}));var BT=class extends Om{constructor(e,r){super(),this.readable=e,this.options=GT.fromOptions(r),this.buffer=(0,HT.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new VK.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 r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error("Header must provide a Content-Length property."));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error("Content-Length value must be a number."));return}this.nextMessageLength=o}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,HT.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Po.ReadableStreamMessageReader=BT});var dP=$(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.WriteableStreamMessageWriter=Ao.AbstractMessageWriter=Ao.MessageWriter=void 0;var uP=cs(),xl=Lc(),YK=UT(),lP=Mc(),JK="Content-Length: ",fP=`\r
34
- `,QK;(function(t){function e(r){let n=r;return n&&xl.func(n.dispose)&&xl.func(n.onClose)&&xl.func(n.onError)&&xl.func(n.write)}t.is=e})(QK=Ao.MessageWriter||(Ao.MessageWriter={}));var Lm=class{constructor(){this.errorEmitter=new lP.Emitter,this.closeEmitter=new lP.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}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: ${xl.string(e.message)?e.message:"unknown"}`)}};Ao.AbstractMessageWriter=Lm;var KT;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,uP.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,uP.default)().applicationJson.encoder}}t.fromOptions=e})(KT||(KT={}));var zT=class extends Lm{constructor(e,r){super(),this.writable=e,this.options=KT.fromOptions(r),this.errorCount=0,this.writeSemaphore=new YK.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(JK,n.byteLength.toString(),fP),i.push(fP),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Ao.WriteableStreamMessageWriter=zT});var pP=$(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});Mm.AbstractMessageBuffer=void 0;var ZK=13,ez=10,tz=`\r
35
- `,VT=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,o=0;e:for(;n<this._chunks.length;){let f=this._chunks[n];for(i=0;i<f.length;){switch(f[i]){case ZK:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case ez:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}o+=f.byteLength,n++}if(r!==4)return;let s=this._read(o+i),a=new Map,c=this.toString(s,"ascii").split(tz);if(c.length<2)return a;for(let f=0;f<c.length-2;f++){let p=c[f],m=p.indexOf(":");if(m===-1)throw new Error("Message header must separate key and value using :");let T=p.substr(0,m),k=p.substr(m+1).trim();a.set(e?T.toLowerCase():T,k)}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 o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);r.set(s,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};Mm.AbstractMessageBuffer=VT});var RP=$(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.createMessageConnection=ie.ConnectionOptions=ie.MessageStrategy=ie.CancellationStrategy=ie.CancellationSenderStrategy=ie.CancellationReceiverStrategy=ie.RequestCancellationReceiverStrategy=ie.IdCancellationReceiverStrategy=ie.ConnectionStrategy=ie.ConnectionError=ie.ConnectionErrors=ie.LogTraceNotification=ie.SetTraceNotification=ie.TraceFormat=ie.TraceValues=ie.Trace=ie.NullLogger=ie.ProgressType=ie.ProgressToken=void 0;var mP=cs(),$t=Lc(),ve=CT(),hP=DT(),bl=Mc(),XT=Nm(),Sl;(function(t){t.type=new ve.NotificationType("$/cancelRequest")})(Sl||(Sl={}));var gP;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(gP=ie.ProgressToken||(ie.ProgressToken={}));var _l;(function(t){t.type=new ve.NotificationType("$/progress")})(_l||(_l={}));var YT=class{constructor(){}};ie.ProgressType=YT;var JT;(function(t){function e(r){return $t.func(r)}t.is=e})(JT||(JT={}));ie.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var et;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(et=ie.Trace||(ie.Trace={}));var rz;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(rz=ie.TraceValues||(ie.TraceValues={}));(function(t){function e(n){if(!$t.string(n))return t.Off;switch(n=n.toLowerCase(),n){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 r(n){switch(n){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=r})(et=ie.Trace||(ie.Trace={}));var mi;(function(t){t.Text="text",t.JSON="json"})(mi=ie.TraceFormat||(ie.TraceFormat={}));(function(t){function e(r){return $t.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(mi=ie.TraceFormat||(ie.TraceFormat={}));var yP;(function(t){t.type=new ve.NotificationType("$/setTrace")})(yP=ie.SetTraceNotification||(ie.SetTraceNotification={}));var QT;(function(t){t.type=new ve.NotificationType("$/logTrace")})(QT=ie.LogTraceNotification||(ie.LogTraceNotification={}));var $m;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})($m=ie.ConnectionErrors||(ie.ConnectionErrors={}));var Fc=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ie.ConnectionError=Fc;var vP;(function(t){function e(r){let n=r;return n&&$t.func(n.cancelUndispatched)}t.is=e})(vP=ie.ConnectionStrategy||(ie.ConnectionStrategy={}));var tR;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&$t.func(n.createCancellationTokenSource)&&(n.dispose===void 0||$t.func(n.dispose))}t.is=e})(tR=ie.IdCancellationReceiverStrategy||(ie.IdCancellationReceiverStrategy={}));var TP;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&$t.func(n.createCancellationTokenSource)&&(n.dispose===void 0||$t.func(n.dispose))}t.is=e})(TP=ie.RequestCancellationReceiverStrategy||(ie.RequestCancellationReceiverStrategy={}));var ZT;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new XT.CancellationTokenSource}});function e(r){return tR.is(r)||TP.is(r)}t.is=e})(ZT=ie.CancellationReceiverStrategy||(ie.CancellationReceiverStrategy={}));var eR;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Sl.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&$t.func(n.sendCancellation)&&$t.func(n.cleanup)}t.is=e})(eR=ie.CancellationSenderStrategy||(ie.CancellationSenderStrategy={}));var rR;(function(t){t.Message=Object.freeze({receiver:ZT.Message,sender:eR.Message});function e(r){let n=r;return n&&ZT.is(n.receiver)&&eR.is(n.sender)}t.is=e})(rR=ie.CancellationStrategy||(ie.CancellationStrategy={}));var nR;(function(t){function e(r){let n=r;return n&&$t.func(n.handleMessage)}t.is=e})(nR=ie.MessageStrategy||(ie.MessageStrategy={}));var nz;(function(t){function e(r){let n=r;return n&&(rR.is(n.cancellationStrategy)||vP.is(n.connectionStrategy)||nR.is(n.messageStrategy))}t.is=e})(nz=ie.ConnectionOptions||(ie.ConnectionOptions={}));var hi;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(hi||(hi={}));function iz(t,e,r,n){let i=r!==void 0?r:ie.NullLogger,o=0,s=0,a=0,c="2.0",f,p=new Map,m,T=new Map,k=new Map,A,N=new hP.LinkedMap,O=new Map,P=new Set,y=new Map,h=et.Off,C=mi.Text,M,z=hi.New,ce=new bl.Emitter,we=new bl.Emitter,Rt=new bl.Emitter,tt=new bl.Emitter,U=new bl.Emitter,I=n&&n.cancellationStrategy?n.cancellationStrategy:rR.Message;function K(R){if(R===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+R.toString()}function V(R){return R===null?"res-unknown-"+(++a).toString():"res-"+R.toString()}function Ce(){return"not-"+(++s).toString()}function me(R,E){ve.Message.isRequest(E)?R.set(K(E.id),E):ve.Message.isResponse(E)?R.set(V(E.id),E):R.set(Ce(),E)}function fe(R){}function gt(){return z===hi.Listening}function ze(){return z===hi.Closed}function _e(){return z===hi.Disposed}function sr(){(z===hi.New||z===hi.Listening)&&(z=hi.Closed,we.fire(void 0))}function Lr(R){ce.fire([R,void 0,void 0])}function Yi(R){ce.fire(R)}t.onClose(sr),t.onError(Lr),e.onClose(sr),e.onError(Yi);function Pn(){A||N.size===0||(A=(0,mP.default)().timer.setImmediate(()=>{A=void 0,bi()}))}function zt(R){ve.Message.isRequest(R)?Vt(R):ve.Message.isNotification(R)?Ht(R):ve.Message.isResponse(R)?sn(R):rt(R)}function bi(){if(N.size===0)return;let R=N.shift();try{let E=n?.messageStrategy;nR.is(E)?E.handleMessage(R,zt):zt(R)}finally{Pn()}}let xt=R=>{try{if(ve.Message.isNotification(R)&&R.method===Sl.type.method){let E=R.params.id,L=K(E),j=N.get(L);if(ve.Message.isRequest(j)){let le=n?.connectionStrategy,Te=le&&le.cancelUndispatched?le.cancelUndispatched(j,fe):void 0;if(Te&&(Te.error!==void 0||Te.result!==void 0)){N.delete(L),y.delete(E),Te.id=j.id,an(Te,R.method,Date.now()),e.write(Te).catch(()=>i.error("Sending response for canceled message failed."));return}}let ue=y.get(E);if(ue!==void 0){ue.cancel(),Ji(R);return}else P.add(E)}me(N,R)}finally{Pn()}};function Vt(R){if(_e())return;function E(te,ne,de){let Ae={jsonrpc:c,id:R.id};te instanceof ve.ResponseError?Ae.error=te.toJson():Ae.result=te===void 0?null:te,an(Ae,ne,de),e.write(Ae).catch(()=>i.error("Sending response failed."))}function L(te,ne,de){let Ae={jsonrpc:c,id:R.id,error:te.toJson()};an(Ae,ne,de),e.write(Ae).catch(()=>i.error("Sending response failed."))}function j(te,ne,de){te===void 0&&(te=null);let Ae={jsonrpc:c,id:R.id,result:te};an(Ae,ne,de),e.write(Ae).catch(()=>i.error("Sending response failed."))}An(R);let ue=p.get(R.method),le,Te;ue&&(le=ue.type,Te=ue.handler);let oe=Date.now();if(Te||f){let te=R.id??String(Date.now()),ne=tR.is(I.receiver)?I.receiver.createCancellationTokenSource(te):I.receiver.createCancellationTokenSource(R);R.id!==null&&P.has(R.id)&&ne.cancel(),R.id!==null&&y.set(te,ne);try{let de;if(Te)if(R.params===void 0){if(le!==void 0&&le.numberOfParams!==0){L(new ve.ResponseError(ve.ErrorCodes.InvalidParams,`Request ${R.method} defines ${le.numberOfParams} params but received none.`),R.method,oe);return}de=Te(ne.token)}else if(Array.isArray(R.params)){if(le!==void 0&&le.parameterStructures===ve.ParameterStructures.byName){L(new ve.ResponseError(ve.ErrorCodes.InvalidParams,`Request ${R.method} defines parameters by name but received parameters by position`),R.method,oe);return}de=Te(...R.params,ne.token)}else{if(le!==void 0&&le.parameterStructures===ve.ParameterStructures.byPosition){L(new ve.ResponseError(ve.ErrorCodes.InvalidParams,`Request ${R.method} defines parameters by position but received parameters by name`),R.method,oe);return}de=Te(R.params,ne.token)}else f&&(de=f(R.method,R.params,ne.token));let Ae=de;de?Ae.then?Ae.then(ot=>{y.delete(te),E(ot,R.method,oe)},ot=>{y.delete(te),ot instanceof ve.ResponseError?L(ot,R.method,oe):ot&&$t.string(ot.message)?L(new ve.ResponseError(ve.ErrorCodes.InternalError,`Request ${R.method} failed with message: ${ot.message}`),R.method,oe):L(new ve.ResponseError(ve.ErrorCodes.InternalError,`Request ${R.method} failed unexpectedly without providing any details.`),R.method,oe)}):(y.delete(te),E(de,R.method,oe)):(y.delete(te),j(de,R.method,oe))}catch(de){y.delete(te),de instanceof ve.ResponseError?E(de,R.method,oe):de&&$t.string(de.message)?L(new ve.ResponseError(ve.ErrorCodes.InternalError,`Request ${R.method} failed with message: ${de.message}`),R.method,oe):L(new ve.ResponseError(ve.ErrorCodes.InternalError,`Request ${R.method} failed unexpectedly without providing any details.`),R.method,oe)}}else L(new ve.ResponseError(ve.ErrorCodes.MethodNotFound,`Unhandled method ${R.method}`),R.method,oe)}function sn(R){if(!_e())if(R.id===null)R.error?i.error(`Received response message without id: Error is:
36
- ${JSON.stringify(R.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let E=R.id,L=O.get(E);if(Nn(R,L),L!==void 0){O.delete(E);try{if(R.error){let j=R.error;L.reject(new ve.ResponseError(j.code,j.message,j.data))}else if(R.result!==void 0)L.resolve(R.result);else throw new Error("Should never happen.")}catch(j){j.message?i.error(`Response handler '${L.method}' failed with message: ${j.message}`):i.error(`Response handler '${L.method}' failed unexpectedly.`)}}}}function Ht(R){if(_e())return;let E,L;if(R.method===Sl.type.method){let j=R.params.id;P.delete(j),Ji(R);return}else{let j=T.get(R.method);j&&(L=j.handler,E=j.type)}if(L||m)try{if(Ji(R),L)if(R.params===void 0)E!==void 0&&E.numberOfParams!==0&&E.parameterStructures!==ve.ParameterStructures.byName&&i.error(`Notification ${R.method} defines ${E.numberOfParams} params but received none.`),L();else if(Array.isArray(R.params)){let j=R.params;R.method===_l.type.method&&j.length===2&&gP.is(j[0])?L({token:j[0],value:j[1]}):(E!==void 0&&(E.parameterStructures===ve.ParameterStructures.byName&&i.error(`Notification ${R.method} defines parameters by name but received parameters by position`),E.numberOfParams!==R.params.length&&i.error(`Notification ${R.method} defines ${E.numberOfParams} params but received ${j.length} arguments`)),L(...j))}else E!==void 0&&E.parameterStructures===ve.ParameterStructures.byPosition&&i.error(`Notification ${R.method} defines parameters by position but received parameters by name`),L(R.params);else m&&m(R.method,R.params)}catch(j){j.message?i.error(`Notification handler '${R.method}' failed with message: ${j.message}`):i.error(`Notification handler '${R.method}' failed unexpectedly.`)}else Rt.fire(R)}function rt(R){if(!R){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
37
- ${JSON.stringify(R,null,4)}`);let E=R;if($t.string(E.id)||$t.number(E.id)){let L=E.id,j=O.get(L);j&&j.reject(new Error("The received response has neither a result nor an error property."))}}function wt(R){if(R!=null)switch(h){case et.Verbose:return JSON.stringify(R,null,4);case et.Compact:return JSON.stringify(R);default:return}}function xr(R){if(!(h===et.Off||!M))if(C===mi.Text){let E;(h===et.Verbose||h===et.Compact)&&R.params&&(E=`Params: ${wt(R.params)}
31
+ `,"\r"];var dt;(function(h){function S(I,j,ve,It){return new jt(I,j,ve,It)}h.create=S;function w(I){var j=I;return!!(D.defined(j)&&D.string(j.uri)&&(D.undefined(j.languageId)||D.string(j.languageId))&&D.uinteger(j.lineCount)&&D.func(j.getText)&&D.func(j.positionAt)&&D.func(j.offsetAt))}h.is=w;function R(I,j){for(var ve=I.getText(),It=p(j,function(ra,ef){var Ob=ra.range.start.line-ef.range.start.line;return Ob===0?ra.range.start.character-ef.range.start.character:Ob}),rt=ve.length,zn=It.length-1;zn>=0;zn--){var Vn=It[zn],Bi=I.offsetAt(Vn.range.start),Ae=I.offsetAt(Vn.range.end);if(Ae<=rt)ve=ve.substring(0,Bi)+Vn.newText+ve.substring(Ae,ve.length);else throw new Error("Overlapping edit");rt=Bi}return ve}h.applyEdits=R;function p(I,j){if(I.length<=1)return I;var ve=I.length/2|0,It=I.slice(0,ve),rt=I.slice(ve);p(It,j),p(rt,j);for(var zn=0,Vn=0,Bi=0;zn<It.length&&Vn<rt.length;){var Ae=j(It[zn],rt[Vn]);Ae<=0?I[Bi++]=It[zn++]:I[Bi++]=rt[Vn++]}for(;zn<It.length;)I[Bi++]=It[zn++];for(;Vn<rt.length;)I[Bi++]=rt[Vn++];return I}})(dt=e.TextDocument||(e.TextDocument={}));var jt=function(){function h(S,w,R,p){this._uri=S,this._languageId=w,this._version=R,this._content=p,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),R=this.offsetAt(S.end);return this._content.substring(w,R)}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,R=!0,p=0;p<w.length;p++){R&&(S.push(p),R=!1);var I=w.charAt(p);R=I==="\r"||I===`
32
+ `,I==="\r"&&p+1<w.length&&w.charAt(p+1)===`
33
+ `&&p++}R&&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(),R=0,p=w.length;if(p===0)return s.create(0,S);for(;R<p;){var I=Math.floor((R+p)/2);w[I]>S?p=I:R=I+1}var j=R-1;return s.create(j,S-w[j])},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 R=w[S.line],p=S.line+1<w.length?w[S.line+1]:this._content.length;return Math.max(Math.min(R+S.character,p),R)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var S=Object.prototype.toString;function w(Ae){return typeof Ae<"u"}h.defined=w;function R(Ae){return typeof Ae>"u"}h.undefined=R;function p(Ae){return Ae===!0||Ae===!1}h.boolean=p;function I(Ae){return S.call(Ae)==="[object String]"}h.string=I;function j(Ae){return S.call(Ae)==="[object Number]"}h.number=j;function ve(Ae,ra,ef){return S.call(Ae)==="[object Number]"&&ra<=Ae&&Ae<=ef}h.numberRange=ve;function It(Ae){return S.call(Ae)==="[object Number]"&&-2147483648<=Ae&&Ae<=2147483647}h.integer=It;function rt(Ae){return S.call(Ae)==="[object Number]"&&0<=Ae&&Ae<=2147483647}h.uinteger=rt;function zn(Ae){return S.call(Ae)==="[object Function]"}h.func=zn;function Vn(Ae){return Ae!==null&&typeof Ae=="object"}h.objectLiteral=Vn;function Bi(Ae,ra){return Array.isArray(Ae)&&Ae.every(ra)}h.typedArray=Bi})(D||(D={}))})});var kt=M(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.ProtocolNotificationType=Gr.ProtocolNotificationType0=Gr.ProtocolRequestType=Gr.ProtocolRequestType0=Gr.RegistrationType=Gr.MessageDirection=void 0;var ca=Yi(),iM;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(iM=Gr.MessageDirection||(Gr.MessageDirection={}));var yy=class{constructor(e){this.method=e}};Gr.RegistrationType=yy;var vy=class extends ca.RequestType0{constructor(e){super(e)}};Gr.ProtocolRequestType0=vy;var Ty=class extends ca.RequestType{constructor(e){super(e,ca.ParameterStructures.byName)}};Gr.ProtocolRequestType=Ty;var Ry=class extends ca.NotificationType0{constructor(e){super(e)}};Gr.ProtocolNotificationType0=Ry;var xy=class extends ca.NotificationType{constructor(e){super(e,ca.ParameterStructures.byName)}};Gr.ProtocolNotificationType=xy});var pf=M(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 oM(t){return t===!0||t===!1}Kt.boolean=oM;function c_(t){return typeof t=="string"||t instanceof String}Kt.string=c_;function sM(t){return typeof t=="number"||t instanceof Number}Kt.number=sM;function aM(t){return t instanceof Error}Kt.error=aM;function cM(t){return typeof t=="function"}Kt.func=cM;function u_(t){return Array.isArray(t)}Kt.array=u_;function uM(t){return u_(t)&&t.every(e=>c_(e))}Kt.stringArray=uM;function lM(t,e){return Array.isArray(t)&&t.every(e)}Kt.typedArray=lM;function fM(t){return t!==null&&typeof t=="object"}Kt.objectLiteral=fM});var f_=M(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.ImplementationRequest=void 0;var l_=kt(),dM;(function(t){t.method="textDocument/implementation",t.messageDirection=l_.MessageDirection.clientToServer,t.type=new l_.ProtocolRequestType(t.method)})(dM=mu.ImplementationRequest||(mu.ImplementationRequest={}))});var p_=M(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.TypeDefinitionRequest=void 0;var d_=kt(),pM;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=d_.MessageDirection.clientToServer,t.type=new d_.ProtocolRequestType(t.method)})(pM=hu.TypeDefinitionRequest||(hu.TypeDefinitionRequest={}))});var m_=M(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.DidChangeWorkspaceFoldersNotification=wo.WorkspaceFoldersRequest=void 0;var mf=kt(),mM;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=mf.MessageDirection.serverToClient,t.type=new mf.ProtocolRequestType0(t.method)})(mM=wo.WorkspaceFoldersRequest||(wo.WorkspaceFoldersRequest={}));var hM;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=mf.MessageDirection.clientToServer,t.type=new mf.ProtocolNotificationType(t.method)})(hM=wo.DidChangeWorkspaceFoldersNotification||(wo.DidChangeWorkspaceFoldersNotification={}))});var g_=M(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.ConfigurationRequest=void 0;var h_=kt(),gM;(function(t){t.method="workspace/configuration",t.messageDirection=h_.MessageDirection.serverToClient,t.type=new h_.ProtocolRequestType(t.method)})(gM=gu.ConfigurationRequest||(gu.ConfigurationRequest={}))});var y_=M(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ColorPresentationRequest=Co.DocumentColorRequest=void 0;var hf=kt(),yM;(function(t){t.method="textDocument/documentColor",t.messageDirection=hf.MessageDirection.clientToServer,t.type=new hf.ProtocolRequestType(t.method)})(yM=Co.DocumentColorRequest||(Co.DocumentColorRequest={}));var vM;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=hf.MessageDirection.clientToServer,t.type=new hf.ProtocolRequestType(t.method)})(vM=Co.ColorPresentationRequest||(Co.ColorPresentationRequest={}))});var T_=M(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.FoldingRangeRequest=void 0;var v_=kt(),TM;(function(t){t.method="textDocument/foldingRange",t.messageDirection=v_.MessageDirection.clientToServer,t.type=new v_.ProtocolRequestType(t.method)})(TM=yu.FoldingRangeRequest||(yu.FoldingRangeRequest={}))});var x_=M(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.DeclarationRequest=void 0;var R_=kt(),RM;(function(t){t.method="textDocument/declaration",t.messageDirection=R_.MessageDirection.clientToServer,t.type=new R_.ProtocolRequestType(t.method)})(RM=vu.DeclarationRequest||(vu.DeclarationRequest={}))});var __=M(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.SelectionRangeRequest=void 0;var b_=kt(),xM;(function(t){t.method="textDocument/selectionRange",t.messageDirection=b_.MessageDirection.clientToServer,t.type=new b_.ProtocolRequestType(t.method)})(xM=Tu.SelectionRangeRequest||(Tu.SelectionRangeRequest={}))});var S_=M(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WorkDoneProgressCancelNotification=Jn.WorkDoneProgressCreateRequest=Jn.WorkDoneProgress=void 0;var bM=Yi(),gf=kt(),_M;(function(t){t.type=new bM.ProgressType;function e(r){return r===t.type}t.is=e})(_M=Jn.WorkDoneProgress||(Jn.WorkDoneProgress={}));var SM;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=gf.MessageDirection.serverToClient,t.type=new gf.ProtocolRequestType(t.method)})(SM=Jn.WorkDoneProgressCreateRequest||(Jn.WorkDoneProgressCreateRequest={}));var kM;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=gf.MessageDirection.clientToServer,t.type=new gf.ProtocolNotificationType(t.method)})(kM=Jn.WorkDoneProgressCancelNotification||(Jn.WorkDoneProgressCancelNotification={}))});var k_=M(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CallHierarchyOutgoingCallsRequest=Qn.CallHierarchyIncomingCallsRequest=Qn.CallHierarchyPrepareRequest=void 0;var ua=kt(),wM;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ua.MessageDirection.clientToServer,t.type=new ua.ProtocolRequestType(t.method)})(wM=Qn.CallHierarchyPrepareRequest||(Qn.CallHierarchyPrepareRequest={}));var CM;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ua.MessageDirection.clientToServer,t.type=new ua.ProtocolRequestType(t.method)})(CM=Qn.CallHierarchyIncomingCallsRequest||(Qn.CallHierarchyIncomingCallsRequest={}));var EM;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ua.MessageDirection.clientToServer,t.type=new ua.ProtocolRequestType(t.method)})(EM=Qn.CallHierarchyOutgoingCallsRequest||(Qn.CallHierarchyOutgoingCallsRequest={}))});var w_=M(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.SemanticTokensRefreshRequest=zt.SemanticTokensRangeRequest=zt.SemanticTokensDeltaRequest=zt.SemanticTokensRequest=zt.SemanticTokensRegistrationType=zt.TokenFormat=void 0;var Ji=kt(),PM;(function(t){t.Relative="relative"})(PM=zt.TokenFormat||(zt.TokenFormat={}));var yf;(function(t){t.method="textDocument/semanticTokens",t.type=new Ji.RegistrationType(t.method)})(yf=zt.SemanticTokensRegistrationType||(zt.SemanticTokensRegistrationType={}));var AM;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Ji.MessageDirection.clientToServer,t.type=new Ji.ProtocolRequestType(t.method),t.registrationMethod=yf.method})(AM=zt.SemanticTokensRequest||(zt.SemanticTokensRequest={}));var DM;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Ji.MessageDirection.clientToServer,t.type=new Ji.ProtocolRequestType(t.method),t.registrationMethod=yf.method})(DM=zt.SemanticTokensDeltaRequest||(zt.SemanticTokensDeltaRequest={}));var NM;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Ji.MessageDirection.clientToServer,t.type=new Ji.ProtocolRequestType(t.method),t.registrationMethod=yf.method})(NM=zt.SemanticTokensRangeRequest||(zt.SemanticTokensRangeRequest={}));var IM;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Ji.MessageDirection.clientToServer,t.type=new Ji.ProtocolRequestType0(t.method)})(IM=zt.SemanticTokensRefreshRequest||(zt.SemanticTokensRefreshRequest={}))});var E_=M(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.ShowDocumentRequest=void 0;var C_=kt(),OM;(function(t){t.method="window/showDocument",t.messageDirection=C_.MessageDirection.serverToClient,t.type=new C_.ProtocolRequestType(t.method)})(OM=Ru.ShowDocumentRequest||(Ru.ShowDocumentRequest={}))});var A_=M(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.LinkedEditingRangeRequest=void 0;var P_=kt(),LM;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=P_.MessageDirection.clientToServer,t.type=new P_.ProtocolRequestType(t.method)})(LM=xu.LinkedEditingRangeRequest||(xu.LinkedEditingRangeRequest={}))});var D_=M(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.WillDeleteFilesRequest=wt.DidDeleteFilesNotification=wt.DidRenameFilesNotification=wt.WillRenameFilesRequest=wt.DidCreateFilesNotification=wt.WillCreateFilesRequest=wt.FileOperationPatternKind=void 0;var Cn=kt(),MM;(function(t){t.file="file",t.folder="folder"})(MM=wt.FileOperationPatternKind||(wt.FileOperationPatternKind={}));var $M;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})($M=wt.WillCreateFilesRequest||(wt.WillCreateFilesRequest={}));var FM;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(FM=wt.DidCreateFilesNotification||(wt.DidCreateFilesNotification={}));var qM;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})(qM=wt.WillRenameFilesRequest||(wt.WillRenameFilesRequest={}));var jM;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(jM=wt.DidRenameFilesNotification||(wt.DidRenameFilesNotification={}));var UM;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolNotificationType(t.method)})(UM=wt.DidDeleteFilesNotification||(wt.DidDeleteFilesNotification={}));var WM;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method)})(WM=wt.WillDeleteFilesRequest||(wt.WillDeleteFilesRequest={}))});var I_=M(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.MonikerRequest=Zn.MonikerKind=Zn.UniquenessLevel=void 0;var N_=kt(),HM;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(HM=Zn.UniquenessLevel||(Zn.UniquenessLevel={}));var GM;(function(t){t.$import="import",t.$export="export",t.local="local"})(GM=Zn.MonikerKind||(Zn.MonikerKind={}));var BM;(function(t){t.method="textDocument/moniker",t.messageDirection=N_.MessageDirection.clientToServer,t.type=new N_.ProtocolRequestType(t.method)})(BM=Zn.MonikerRequest||(Zn.MonikerRequest={}))});var O_=M(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.TypeHierarchySubtypesRequest=ei.TypeHierarchySupertypesRequest=ei.TypeHierarchyPrepareRequest=void 0;var la=kt(),KM;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=la.MessageDirection.clientToServer,t.type=new la.ProtocolRequestType(t.method)})(KM=ei.TypeHierarchyPrepareRequest||(ei.TypeHierarchyPrepareRequest={}));var zM;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=la.MessageDirection.clientToServer,t.type=new la.ProtocolRequestType(t.method)})(zM=ei.TypeHierarchySupertypesRequest||(ei.TypeHierarchySupertypesRequest={}));var VM;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=la.MessageDirection.clientToServer,t.type=new la.ProtocolRequestType(t.method)})(VM=ei.TypeHierarchySubtypesRequest||(ei.TypeHierarchySubtypesRequest={}))});var L_=M(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.InlineValueRefreshRequest=Eo.InlineValueRequest=void 0;var vf=kt(),XM;(function(t){t.method="textDocument/inlineValue",t.messageDirection=vf.MessageDirection.clientToServer,t.type=new vf.ProtocolRequestType(t.method)})(XM=Eo.InlineValueRequest||(Eo.InlineValueRequest={}));var YM;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=vf.MessageDirection.clientToServer,t.type=new vf.ProtocolRequestType0(t.method)})(YM=Eo.InlineValueRefreshRequest||(Eo.InlineValueRefreshRequest={}))});var M_=M(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.InlayHintRefreshRequest=ti.InlayHintResolveRequest=ti.InlayHintRequest=void 0;var fa=kt(),JM;(function(t){t.method="textDocument/inlayHint",t.messageDirection=fa.MessageDirection.clientToServer,t.type=new fa.ProtocolRequestType(t.method)})(JM=ti.InlayHintRequest||(ti.InlayHintRequest={}));var QM;(function(t){t.method="inlayHint/resolve",t.messageDirection=fa.MessageDirection.clientToServer,t.type=new fa.ProtocolRequestType(t.method)})(QM=ti.InlayHintResolveRequest||(ti.InlayHintResolveRequest={}));var ZM;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=fa.MessageDirection.clientToServer,t.type=new fa.ProtocolRequestType0(t.method)})(ZM=ti.InlayHintRefreshRequest||(ti.InlayHintRefreshRequest={}))});var F_=M(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.DiagnosticRefreshRequest=yr.WorkspaceDiagnosticRequest=yr.DocumentDiagnosticRequest=yr.DocumentDiagnosticReportKind=yr.DiagnosticServerCancellationData=void 0;var $_=Yi(),e$=pf(),da=kt(),t$;(function(t){function e(r){let n=r;return n&&e$.boolean(n.retriggerRequest)}t.is=e})(t$=yr.DiagnosticServerCancellationData||(yr.DiagnosticServerCancellationData={}));var r$;(function(t){t.Full="full",t.Unchanged="unchanged"})(r$=yr.DocumentDiagnosticReportKind||(yr.DocumentDiagnosticReportKind={}));var n$;(function(t){t.method="textDocument/diagnostic",t.messageDirection=da.MessageDirection.clientToServer,t.type=new da.ProtocolRequestType(t.method),t.partialResult=new $_.ProgressType})(n$=yr.DocumentDiagnosticRequest||(yr.DocumentDiagnosticRequest={}));var i$;(function(t){t.method="workspace/diagnostic",t.messageDirection=da.MessageDirection.clientToServer,t.type=new da.ProtocolRequestType(t.method),t.partialResult=new $_.ProgressType})(i$=yr.WorkspaceDiagnosticRequest||(yr.WorkspaceDiagnosticRequest={}));var o$;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=da.MessageDirection.clientToServer,t.type=new da.ProtocolRequestType0(t.method)})(o$=yr.DiagnosticRefreshRequest||(yr.DiagnosticRefreshRequest={}))});var U_=M($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.DidCloseNotebookDocumentNotification=$e.DidSaveNotebookDocumentNotification=$e.DidChangeNotebookDocumentNotification=$e.NotebookCellArrayChange=$e.DidOpenNotebookDocumentNotification=$e.NotebookDocumentSyncRegistrationType=$e.NotebookDocument=$e.NotebookCell=$e.ExecutionSummary=$e.NotebookCellKind=void 0;var bu=xs(),ri=pf(),yi=kt(),q_;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(q_=$e.NotebookCellKind||($e.NotebookCellKind={}));var j_;(function(t){function e(i,o){let s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}t.create=e;function r(i){let o=i;return ri.objectLiteral(o)&&bu.uinteger.is(o.executionOrder)&&(o.success===void 0||ri.boolean(o.success))}t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=n})(j_=$e.ExecutionSummary||($e.ExecutionSummary={}));var by;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return ri.objectLiteral(s)&&q_.is(s.kind)&&bu.DocumentUri.is(s.document)&&(s.metadata===void 0||ri.objectLiteral(s.metadata))}t.is=r;function n(o,s){let a=new Set;return o.document!==s.document&&a.add("document"),o.kind!==s.kind&&a.add("kind"),o.executionSummary!==s.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!j_.equals(o.executionSummary,s.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!="object")return!1;let a=Array.isArray(o),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(o.length!==s.length)return!1;for(let u=0;u<o.length;u++)if(!i(o[u],s[u]))return!1}if(ri.objectLiteral(o)&&ri.objectLiteral(s)){let u=Object.keys(o),l=Object.keys(s);if(u.length!==l.length||(u.sort(),l.sort(),!i(u,l)))return!1;for(let f=0;f<u.length;f++){let g=u[f];if(!i(o[g],s[g]))return!1}}return!0}})(by=$e.NotebookCell||($e.NotebookCell={}));var s$;(function(t){function e(n,i,o,s){return{uri:n,notebookType:i,version:o,cells:s}}t.create=e;function r(n){let i=n;return ri.objectLiteral(i)&&ri.string(i.uri)&&bu.integer.is(i.version)&&ri.typedArray(i.cells,by.is)}t.is=r})(s$=$e.NotebookDocument||($e.NotebookDocument={}));var _u;(function(t){t.method="notebookDocument/sync",t.messageDirection=yi.MessageDirection.clientToServer,t.type=new yi.RegistrationType(t.method)})(_u=$e.NotebookDocumentSyncRegistrationType||($e.NotebookDocumentSyncRegistrationType={}));var a$;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=yi.MessageDirection.clientToServer,t.type=new yi.ProtocolNotificationType(t.method),t.registrationMethod=_u.method})(a$=$e.DidOpenNotebookDocumentNotification||($e.DidOpenNotebookDocumentNotification={}));var c$;(function(t){function e(n){let i=n;return ri.objectLiteral(i)&&bu.uinteger.is(i.start)&&bu.uinteger.is(i.deleteCount)&&(i.cells===void 0||ri.typedArray(i.cells,by.is))}t.is=e;function r(n,i,o){let s={start:n,deleteCount:i};return o!==void 0&&(s.cells=o),s}t.create=r})(c$=$e.NotebookCellArrayChange||($e.NotebookCellArrayChange={}));var u$;(function(t){t.method="notebookDocument/didChange",t.messageDirection=yi.MessageDirection.clientToServer,t.type=new yi.ProtocolNotificationType(t.method),t.registrationMethod=_u.method})(u$=$e.DidChangeNotebookDocumentNotification||($e.DidChangeNotebookDocumentNotification={}));var l$;(function(t){t.method="notebookDocument/didSave",t.messageDirection=yi.MessageDirection.clientToServer,t.type=new yi.ProtocolNotificationType(t.method),t.registrationMethod=_u.method})(l$=$e.DidSaveNotebookDocumentNotification||($e.DidSaveNotebookDocumentNotification={}));var f$;(function(t){t.method="notebookDocument/didClose",t.messageDirection=yi.MessageDirection.clientToServer,t.type=new yi.ProtocolNotificationType(t.method),t.registrationMethod=_u.method})(f$=$e.DidCloseNotebookDocumentNotification||($e.DidCloseNotebookDocumentNotification={}))});var Y_=M(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.WorkspaceSymbolRequest=v.CodeActionResolveRequest=v.CodeActionRequest=v.DocumentSymbolRequest=v.DocumentHighlightRequest=v.ReferencesRequest=v.DefinitionRequest=v.SignatureHelpRequest=v.SignatureHelpTriggerKind=v.HoverRequest=v.CompletionResolveRequest=v.CompletionRequest=v.CompletionTriggerKind=v.PublishDiagnosticsNotification=v.WatchKind=v.RelativePattern=v.FileChangeType=v.DidChangeWatchedFilesNotification=v.WillSaveTextDocumentWaitUntilRequest=v.WillSaveTextDocumentNotification=v.TextDocumentSaveReason=v.DidSaveTextDocumentNotification=v.DidCloseTextDocumentNotification=v.DidChangeTextDocumentNotification=v.TextDocumentContentChangeEvent=v.DidOpenTextDocumentNotification=v.TextDocumentSyncKind=v.TelemetryEventNotification=v.LogMessageNotification=v.ShowMessageRequest=v.ShowMessageNotification=v.MessageType=v.DidChangeConfigurationNotification=v.ExitNotification=v.ShutdownRequest=v.InitializedNotification=v.InitializeErrorCodes=v.InitializeRequest=v.WorkDoneProgressOptions=v.TextDocumentRegistrationOptions=v.StaticRegistrationOptions=v.PositionEncodingKind=v.FailureHandlingKind=v.ResourceOperationKind=v.UnregistrationRequest=v.RegistrationRequest=v.DocumentSelector=v.NotebookCellTextDocumentFilter=v.NotebookDocumentFilter=v.TextDocumentFilter=void 0;v.TypeHierarchySubtypesRequest=v.TypeHierarchyPrepareRequest=v.MonikerRequest=v.MonikerKind=v.UniquenessLevel=v.WillDeleteFilesRequest=v.DidDeleteFilesNotification=v.WillRenameFilesRequest=v.DidRenameFilesNotification=v.WillCreateFilesRequest=v.DidCreateFilesNotification=v.FileOperationPatternKind=v.LinkedEditingRangeRequest=v.ShowDocumentRequest=v.SemanticTokensRegistrationType=v.SemanticTokensRefreshRequest=v.SemanticTokensRangeRequest=v.SemanticTokensDeltaRequest=v.SemanticTokensRequest=v.TokenFormat=v.CallHierarchyPrepareRequest=v.CallHierarchyOutgoingCallsRequest=v.CallHierarchyIncomingCallsRequest=v.WorkDoneProgressCancelNotification=v.WorkDoneProgressCreateRequest=v.WorkDoneProgress=v.SelectionRangeRequest=v.DeclarationRequest=v.FoldingRangeRequest=v.ColorPresentationRequest=v.DocumentColorRequest=v.ConfigurationRequest=v.DidChangeWorkspaceFoldersNotification=v.WorkspaceFoldersRequest=v.TypeDefinitionRequest=v.ImplementationRequest=v.ApplyWorkspaceEditRequest=v.ExecuteCommandRequest=v.PrepareRenameRequest=v.RenameRequest=v.PrepareSupportDefaultBehavior=v.DocumentOnTypeFormattingRequest=v.DocumentRangeFormattingRequest=v.DocumentFormattingRequest=v.DocumentLinkResolveRequest=v.DocumentLinkRequest=v.CodeLensRefreshRequest=v.CodeLensResolveRequest=v.CodeLensRequest=v.WorkspaceSymbolResolveRequest=void 0;v.DidCloseNotebookDocumentNotification=v.DidSaveNotebookDocumentNotification=v.DidChangeNotebookDocumentNotification=v.NotebookCellArrayChange=v.DidOpenNotebookDocumentNotification=v.NotebookDocumentSyncRegistrationType=v.NotebookDocument=v.NotebookCell=v.ExecutionSummary=v.NotebookCellKind=v.DiagnosticRefreshRequest=v.WorkspaceDiagnosticRequest=v.DocumentDiagnosticRequest=v.DocumentDiagnosticReportKind=v.DiagnosticServerCancellationData=v.InlayHintRefreshRequest=v.InlayHintResolveRequest=v.InlayHintRequest=v.InlineValueRefreshRequest=v.InlineValueRequest=v.TypeHierarchySupertypesRequest=void 0;var H=kt(),W_=xs(),vr=pf(),d$=f_();Object.defineProperty(v,"ImplementationRequest",{enumerable:!0,get:function(){return d$.ImplementationRequest}});var p$=p_();Object.defineProperty(v,"TypeDefinitionRequest",{enumerable:!0,get:function(){return p$.TypeDefinitionRequest}});var H_=m_();Object.defineProperty(v,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return H_.WorkspaceFoldersRequest}});Object.defineProperty(v,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return H_.DidChangeWorkspaceFoldersNotification}});var m$=g_();Object.defineProperty(v,"ConfigurationRequest",{enumerable:!0,get:function(){return m$.ConfigurationRequest}});var G_=y_();Object.defineProperty(v,"DocumentColorRequest",{enumerable:!0,get:function(){return G_.DocumentColorRequest}});Object.defineProperty(v,"ColorPresentationRequest",{enumerable:!0,get:function(){return G_.ColorPresentationRequest}});var h$=T_();Object.defineProperty(v,"FoldingRangeRequest",{enumerable:!0,get:function(){return h$.FoldingRangeRequest}});var g$=x_();Object.defineProperty(v,"DeclarationRequest",{enumerable:!0,get:function(){return g$.DeclarationRequest}});var y$=__();Object.defineProperty(v,"SelectionRangeRequest",{enumerable:!0,get:function(){return y$.SelectionRangeRequest}});var _y=S_();Object.defineProperty(v,"WorkDoneProgress",{enumerable:!0,get:function(){return _y.WorkDoneProgress}});Object.defineProperty(v,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return _y.WorkDoneProgressCreateRequest}});Object.defineProperty(v,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return _y.WorkDoneProgressCancelNotification}});var Sy=k_();Object.defineProperty(v,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Sy.CallHierarchyIncomingCallsRequest}});Object.defineProperty(v,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Sy.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(v,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Sy.CallHierarchyPrepareRequest}});var pa=w_();Object.defineProperty(v,"TokenFormat",{enumerable:!0,get:function(){return pa.TokenFormat}});Object.defineProperty(v,"SemanticTokensRequest",{enumerable:!0,get:function(){return pa.SemanticTokensRequest}});Object.defineProperty(v,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return pa.SemanticTokensDeltaRequest}});Object.defineProperty(v,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return pa.SemanticTokensRangeRequest}});Object.defineProperty(v,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return pa.SemanticTokensRefreshRequest}});Object.defineProperty(v,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return pa.SemanticTokensRegistrationType}});var v$=E_();Object.defineProperty(v,"ShowDocumentRequest",{enumerable:!0,get:function(){return v$.ShowDocumentRequest}});var T$=A_();Object.defineProperty(v,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return T$.LinkedEditingRangeRequest}});var bs=D_();Object.defineProperty(v,"FileOperationPatternKind",{enumerable:!0,get:function(){return bs.FileOperationPatternKind}});Object.defineProperty(v,"DidCreateFilesNotification",{enumerable:!0,get:function(){return bs.DidCreateFilesNotification}});Object.defineProperty(v,"WillCreateFilesRequest",{enumerable:!0,get:function(){return bs.WillCreateFilesRequest}});Object.defineProperty(v,"DidRenameFilesNotification",{enumerable:!0,get:function(){return bs.DidRenameFilesNotification}});Object.defineProperty(v,"WillRenameFilesRequest",{enumerable:!0,get:function(){return bs.WillRenameFilesRequest}});Object.defineProperty(v,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return bs.DidDeleteFilesNotification}});Object.defineProperty(v,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return bs.WillDeleteFilesRequest}});var ky=I_();Object.defineProperty(v,"UniquenessLevel",{enumerable:!0,get:function(){return ky.UniquenessLevel}});Object.defineProperty(v,"MonikerKind",{enumerable:!0,get:function(){return ky.MonikerKind}});Object.defineProperty(v,"MonikerRequest",{enumerable:!0,get:function(){return ky.MonikerRequest}});var wy=O_();Object.defineProperty(v,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return wy.TypeHierarchyPrepareRequest}});Object.defineProperty(v,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return wy.TypeHierarchySubtypesRequest}});Object.defineProperty(v,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return wy.TypeHierarchySupertypesRequest}});var B_=L_();Object.defineProperty(v,"InlineValueRequest",{enumerable:!0,get:function(){return B_.InlineValueRequest}});Object.defineProperty(v,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return B_.InlineValueRefreshRequest}});var Cy=M_();Object.defineProperty(v,"InlayHintRequest",{enumerable:!0,get:function(){return Cy.InlayHintRequest}});Object.defineProperty(v,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Cy.InlayHintResolveRequest}});Object.defineProperty(v,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Cy.InlayHintRefreshRequest}});var Su=F_();Object.defineProperty(v,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Su.DiagnosticServerCancellationData}});Object.defineProperty(v,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Su.DocumentDiagnosticReportKind}});Object.defineProperty(v,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Su.DocumentDiagnosticRequest}});Object.defineProperty(v,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Su.WorkspaceDiagnosticRequest}});Object.defineProperty(v,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Su.DiagnosticRefreshRequest}});var vi=U_();Object.defineProperty(v,"NotebookCellKind",{enumerable:!0,get:function(){return vi.NotebookCellKind}});Object.defineProperty(v,"ExecutionSummary",{enumerable:!0,get:function(){return vi.ExecutionSummary}});Object.defineProperty(v,"NotebookCell",{enumerable:!0,get:function(){return vi.NotebookCell}});Object.defineProperty(v,"NotebookDocument",{enumerable:!0,get:function(){return vi.NotebookDocument}});Object.defineProperty(v,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return vi.NotebookDocumentSyncRegistrationType}});Object.defineProperty(v,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return vi.DidOpenNotebookDocumentNotification}});Object.defineProperty(v,"NotebookCellArrayChange",{enumerable:!0,get:function(){return vi.NotebookCellArrayChange}});Object.defineProperty(v,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return vi.DidChangeNotebookDocumentNotification}});Object.defineProperty(v,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return vi.DidSaveNotebookDocumentNotification}});Object.defineProperty(v,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return vi.DidCloseNotebookDocumentNotification}});var K_;(function(t){function e(r){let n=r;return vr.string(n.language)||vr.string(n.scheme)||vr.string(n.pattern)}t.is=e})(K_=v.TextDocumentFilter||(v.TextDocumentFilter={}));var z_;(function(t){function e(r){let n=r;return vr.objectLiteral(n)&&(vr.string(n.notebookType)||vr.string(n.scheme)||vr.string(n.pattern))}t.is=e})(z_=v.NotebookDocumentFilter||(v.NotebookDocumentFilter={}));var V_;(function(t){function e(r){let n=r;return vr.objectLiteral(n)&&(vr.string(n.notebook)||z_.is(n.notebook))&&(n.language===void 0||vr.string(n.language))}t.is=e})(V_=v.NotebookCellTextDocumentFilter||(v.NotebookCellTextDocumentFilter={}));var X_;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!vr.string(n)&&!K_.is(n)&&!V_.is(n))return!1;return!0}t.is=e})(X_=v.DocumentSelector||(v.DocumentSelector={}));var R$;(function(t){t.method="client/registerCapability",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(R$=v.RegistrationRequest||(v.RegistrationRequest={}));var x$;(function(t){t.method="client/unregisterCapability",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(x$=v.UnregistrationRequest||(v.UnregistrationRequest={}));var b$;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(b$=v.ResourceOperationKind||(v.ResourceOperationKind={}));var _$;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(_$=v.FailureHandlingKind||(v.FailureHandlingKind={}));var S$;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(S$=v.PositionEncodingKind||(v.PositionEncodingKind={}));var k$;(function(t){function e(r){let n=r;return n&&vr.string(n.id)&&n.id.length>0}t.hasId=e})(k$=v.StaticRegistrationOptions||(v.StaticRegistrationOptions={}));var w$;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||X_.is(n.documentSelector))}t.is=e})(w$=v.TextDocumentRegistrationOptions||(v.TextDocumentRegistrationOptions={}));var C$;(function(t){function e(n){let i=n;return vr.objectLiteral(i)&&(i.workDoneProgress===void 0||vr.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&vr.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(C$=v.WorkDoneProgressOptions||(v.WorkDoneProgressOptions={}));var E$;(function(t){t.method="initialize",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(E$=v.InitializeRequest||(v.InitializeRequest={}));var P$;(function(t){t.unknownProtocolVersion=1})(P$=v.InitializeErrorCodes||(v.InitializeErrorCodes={}));var A$;(function(t){t.method="initialized",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(A$=v.InitializedNotification||(v.InitializedNotification={}));var D$;(function(t){t.method="shutdown",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType0(t.method)})(D$=v.ShutdownRequest||(v.ShutdownRequest={}));var N$;(function(t){t.method="exit",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType0(t.method)})(N$=v.ExitNotification||(v.ExitNotification={}));var I$;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(I$=v.DidChangeConfigurationNotification||(v.DidChangeConfigurationNotification={}));var O$;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(O$=v.MessageType||(v.MessageType={}));var L$;(function(t){t.method="window/showMessage",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(L$=v.ShowMessageNotification||(v.ShowMessageNotification={}));var M$;(function(t){t.method="window/showMessageRequest",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(M$=v.ShowMessageRequest||(v.ShowMessageRequest={}));var $$;(function(t){t.method="window/logMessage",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})($$=v.LogMessageNotification||(v.LogMessageNotification={}));var F$;(function(t){t.method="telemetry/event",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(F$=v.TelemetryEventNotification||(v.TelemetryEventNotification={}));var q$;(function(t){t.None=0,t.Full=1,t.Incremental=2})(q$=v.TextDocumentSyncKind||(v.TextDocumentSyncKind={}));var j$;(function(t){t.method="textDocument/didOpen",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(j$=v.DidOpenTextDocumentNotification||(v.DidOpenTextDocumentNotification={}));var U$;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(U$=v.TextDocumentContentChangeEvent||(v.TextDocumentContentChangeEvent={}));var W$;(function(t){t.method="textDocument/didChange",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(W$=v.DidChangeTextDocumentNotification||(v.DidChangeTextDocumentNotification={}));var H$;(function(t){t.method="textDocument/didClose",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(H$=v.DidCloseTextDocumentNotification||(v.DidCloseTextDocumentNotification={}));var G$;(function(t){t.method="textDocument/didSave",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(G$=v.DidSaveTextDocumentNotification||(v.DidSaveTextDocumentNotification={}));var B$;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(B$=v.TextDocumentSaveReason||(v.TextDocumentSaveReason={}));var K$;(function(t){t.method="textDocument/willSave",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(K$=v.WillSaveTextDocumentNotification||(v.WillSaveTextDocumentNotification={}));var z$;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(z$=v.WillSaveTextDocumentWaitUntilRequest||(v.WillSaveTextDocumentWaitUntilRequest={}));var V$;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(V$=v.DidChangeWatchedFilesNotification||(v.DidChangeWatchedFilesNotification={}));var X$;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(X$=v.FileChangeType||(v.FileChangeType={}));var Y$;(function(t){function e(r){let n=r;return vr.objectLiteral(n)&&(W_.URI.is(n.baseUri)||W_.WorkspaceFolder.is(n.baseUri))&&vr.string(n.pattern)}t.is=e})(Y$=v.RelativePattern||(v.RelativePattern={}));var J$;(function(t){t.Create=1,t.Change=2,t.Delete=4})(J$=v.WatchKind||(v.WatchKind={}));var Q$;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(Q$=v.PublishDiagnosticsNotification||(v.PublishDiagnosticsNotification={}));var Z$;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Z$=v.CompletionTriggerKind||(v.CompletionTriggerKind={}));var eF;(function(t){t.method="textDocument/completion",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(eF=v.CompletionRequest||(v.CompletionRequest={}));var tF;(function(t){t.method="completionItem/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(tF=v.CompletionResolveRequest||(v.CompletionResolveRequest={}));var rF;(function(t){t.method="textDocument/hover",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(rF=v.HoverRequest||(v.HoverRequest={}));var nF;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(nF=v.SignatureHelpTriggerKind||(v.SignatureHelpTriggerKind={}));var iF;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(iF=v.SignatureHelpRequest||(v.SignatureHelpRequest={}));var oF;(function(t){t.method="textDocument/definition",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(oF=v.DefinitionRequest||(v.DefinitionRequest={}));var sF;(function(t){t.method="textDocument/references",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(sF=v.ReferencesRequest||(v.ReferencesRequest={}));var aF;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(aF=v.DocumentHighlightRequest||(v.DocumentHighlightRequest={}));var cF;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(cF=v.DocumentSymbolRequest||(v.DocumentSymbolRequest={}));var uF;(function(t){t.method="textDocument/codeAction",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(uF=v.CodeActionRequest||(v.CodeActionRequest={}));var lF;(function(t){t.method="codeAction/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(lF=v.CodeActionResolveRequest||(v.CodeActionResolveRequest={}));var fF;(function(t){t.method="workspace/symbol",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(fF=v.WorkspaceSymbolRequest||(v.WorkspaceSymbolRequest={}));var dF;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(dF=v.WorkspaceSymbolResolveRequest||(v.WorkspaceSymbolResolveRequest={}));var pF;(function(t){t.method="textDocument/codeLens",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(pF=v.CodeLensRequest||(v.CodeLensRequest={}));var mF;(function(t){t.method="codeLens/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(mF=v.CodeLensResolveRequest||(v.CodeLensResolveRequest={}));var hF;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType0(t.method)})(hF=v.CodeLensRefreshRequest||(v.CodeLensRefreshRequest={}));var gF;(function(t){t.method="textDocument/documentLink",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(gF=v.DocumentLinkRequest||(v.DocumentLinkRequest={}));var yF;(function(t){t.method="documentLink/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(yF=v.DocumentLinkResolveRequest||(v.DocumentLinkResolveRequest={}));var vF;(function(t){t.method="textDocument/formatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(vF=v.DocumentFormattingRequest||(v.DocumentFormattingRequest={}));var TF;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(TF=v.DocumentRangeFormattingRequest||(v.DocumentRangeFormattingRequest={}));var RF;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(RF=v.DocumentOnTypeFormattingRequest||(v.DocumentOnTypeFormattingRequest={}));var xF;(function(t){t.Identifier=1})(xF=v.PrepareSupportDefaultBehavior||(v.PrepareSupportDefaultBehavior={}));var bF;(function(t){t.method="textDocument/rename",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(bF=v.RenameRequest||(v.RenameRequest={}));var _F;(function(t){t.method="textDocument/prepareRename",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(_F=v.PrepareRenameRequest||(v.PrepareRenameRequest={}));var SF;(function(t){t.method="workspace/executeCommand",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(SF=v.ExecuteCommandRequest||(v.ExecuteCommandRequest={}));var kF;(function(t){t.method="workspace/applyEdit",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType("workspace/applyEdit")})(kF=v.ApplyWorkspaceEditRequest||(v.ApplyWorkspaceEditRequest={}))});var Q_=M(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.createProtocolConnection=void 0;var J_=Yi();function wF(t,e,r,n){return J_.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,J_.createMessageConnection)(t,e,r,n)}Tf.createProtocolConnection=wF});var Z_=M(Br=>{"use strict";var CF=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Rf=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CF(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.LSPErrorCodes=Br.createProtocolConnection=void 0;Rf(Yi(),Br);Rf(xs(),Br);Rf(kt(),Br);Rf(Y_(),Br);var EF=Q_();Object.defineProperty(Br,"createProtocolConnection",{enumerable:!0,get:function(){return EF.createProtocolConnection}});var PF;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(PF=Br.LSPErrorCodes||(Br.LSPErrorCodes={}))});var Vt=M(Ti=>{"use strict";var AF=Ti&&Ti.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),eS=Ti&&Ti.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AF(e,t,r)};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.createProtocolConnection=void 0;var DF=gy();eS(gy(),Ti);eS(Z_(),Ti);function NF(t,e,r,n){return(0,DF.createMessageConnection)(t,e,r,n)}Ti.createProtocolConnection=NF});var Py=M(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.SemanticTokensBuilder=Po.SemanticTokensDiff=Po.SemanticTokensFeature=void 0;var xf=Vt(),IF=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(xf.SemanticTokensRefreshRequest.type),on:e=>{let r=xf.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=xf.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=xf.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Po.SemanticTokensFeature=IF;var bf=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,o=r-1;for(;i>=n&&o>=n&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<n||o<n)&&(i++,o++);let s=i-n+1,a=this.modifiedSequence.slice(n,o+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:s-1}]:[{start:n,deleteCount:s,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};Po.SemanticTokensDiff=bf;var Ey=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,r,n,i,o){let s=e,a=r;this._dataLen>0&&(s-=this._prevLine,s===0&&(a-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=r}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 bf(this._prevData,this._data).computeDiff()}:this.build()}};Po.SemanticTokensBuilder=Ey});var Dy=M(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.TextDocuments=void 0;var _s=Vt(),Ay=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new _s.Emitter,this._onDidOpen=new _s.Emitter,this._onDidClose=new _s.Emitter,this._onDidSave=new _s.Emitter,this._onWillSave=new _s.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=_s.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,o=n.contentChanges;if(o.length===0)return;let{version:s}=i;if(s==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,o,s),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let o=this._syncedDocuments.get(n.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),_s.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};_f.TextDocuments=Ay});var Iy=M(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.NotebookDocuments=ma.NotebookSyncFeature=void 0;var En=Vt(),tS=Dy(),OF=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(En.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(En.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(En.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(En.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};ma.NotebookSyncFeature=OF;var Sf=class t{onDidOpenTextDocument(e){return this.openHandler=e,En.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,En.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,En.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}};Sf.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Ny=class{constructor(e){e instanceof tS.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new tS.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new En.Emitter,this._onDidChange=new En.Emitter,this._onDidSave=new En.Emitter,this._onDidClose=new En.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new Sf,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)r.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let s=o.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,o.metadata=c.metadata);let u=[],l=[],f=[],g=[];if(c.cells!==void 0){let E=c.cells;if(E.structure!==void 0){let m=E.structure.array;if(o.cells.splice(m.start,m.deleteCount,...m.cells!==void 0?m.cells:[]),E.structure.didOpen!==void 0)for(let d of E.structure.didOpen)r.openTextDocument({textDocument:d}),u.push(d.uri);if(E.structure.didClose)for(let d of E.structure.didClose)r.closeTextDocument({textDocument:d}),l.push(d.uri)}if(E.data!==void 0){let m=new Map(E.data.map(d=>[d.document,d]));for(let d=0;d<=o.cells.length;d++){let _=m.get(o.cells[d].document);if(_!==void 0){let $=o.cells.splice(d,1,_);if(f.push({old:$[0],new:_}),m.delete(_.document),m.size===0)break}}}if(E.textContent!==void 0)for(let m of E.textContent)r.changeTextDocument({textDocument:m.document,contentChanges:m.changes}),g.push(m.document.uri)}this.updateCellMap(o);let T={notebookDocument:o};a&&(T.metadata={old:s,new:o.metadata});let C=[];for(let E of u)C.push(this.getNotebookCell(E));let P=[];for(let E of l)P.push(this.getNotebookCell(E));let O=[];for(let E of g)O.push(this.getNotebookCell(E));(C.length>0||P.length>0||f.length>0||O.length>0)&&(T.cells={added:C,removed:P,changed:{data:f,textContent:O}}),(T.metadata!==void 0||T.cells!==void 0)&&this._onDidChange.fire(T)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let s of i.cellTextDocuments)r.closeTextDocument({textDocument:s});this.notebookDocuments.delete(i.notebookDocument.uri);for(let s of o.cells)this.notebookCellMap.delete(s.document)}})),En.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};ma.NotebookDocuments=Ny});var Oy=M(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.thenable=Xt.typedArray=Xt.stringArray=Xt.array=Xt.func=Xt.error=Xt.number=Xt.string=Xt.boolean=void 0;function LF(t){return t===!0||t===!1}Xt.boolean=LF;function rS(t){return typeof t=="string"||t instanceof String}Xt.string=rS;function MF(t){return typeof t=="number"||t instanceof Number}Xt.number=MF;function $F(t){return t instanceof Error}Xt.error=$F;function nS(t){return typeof t=="function"}Xt.func=nS;function iS(t){return Array.isArray(t)}Xt.array=iS;function FF(t){return iS(t)&&t.every(e=>rS(e))}Xt.stringArray=FF;function qF(t,e){return Array.isArray(t)&&t.every(e)}Xt.typedArray=qF;function jF(t){return t&&nS(t.then)}Xt.thenable=jF});var Ly=M(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.generateUuid=Pn.parse=Pn.isUUID=Pn.v4=Pn.empty=void 0;var ku=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},wu=class t extends ku{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(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}};wu._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];wu._timeHighBits=["8","9","a","b"];Pn.empty=new ku("00000000-0000-0000-0000-000000000000");function oS(){return new wu}Pn.v4=oS;var UF=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function sS(t){return UF.test(t)}Pn.isUUID=sS;function WF(t){if(!sS(t))throw new Error("invalid uuid");return new ku(t)}Pn.parse=WF;function HF(){return oS().asHex()}Pn.generateUuid=HF});var aS=M(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.attachPartialResult=Do.ProgressFeature=Do.attachWorkDone=void 0;var Ao=Vt(),GF=Ly(),Ss=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let o={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(Ao.WorkDoneProgress.type,this._token,o)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(Ao.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Ao.WorkDoneProgress.type,this._token,{kind:"end"})}};Ss.Instances=new Map;var kf=class extends Ss{constructor(e,r){super(e,r),this._source=new Ao.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Cu=class{constructor(){}begin(){}report(){}done(){}},wf=class extends Cu{constructor(){super(),this._source=new Ao.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function BF(t,e){if(e===void 0||e.workDoneToken===void 0)return new Cu;let r=e.workDoneToken;return delete e.workDoneToken,new Ss(t,r)}Do.attachWorkDone=BF;var KF=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Ao.WorkDoneProgressCancelNotification.type,r=>{let n=Ss.Instances.get(r.token);(n instanceof kf||n instanceof wf)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Cu:new Ss(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,GF.generateUuid)();return this.connection.sendRequest(Ao.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new kf(this.connection,e))}else return Promise.resolve(new wf)}};Do.ProgressFeature=KF;var My;(function(t){t.type=new Ao.ProgressType})(My||(My={}));var $y=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(My.type,this._token,e)}};function zF(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new $y(t,r)}Do.attachPartialResult=zF});var cS=M(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.ConfigurationFeature=void 0;var VF=Vt(),XF=Oy(),YF=t=>class extends t{getConfiguration(e){return e?XF.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(VF.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Cf.ConfigurationFeature=YF});var uS=M(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.WorkspaceFoldersFeature=void 0;var Ef=Vt(),JF=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Ef.Emitter,this.connection.onNotification(Ef.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Ef.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(Ef.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Pf.WorkspaceFoldersFeature=JF});var lS=M(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.CallHierarchyFeature=void 0;var Fy=Vt(),QF=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Fy.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=Fy.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=Fy.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Af.CallHierarchyFeature=QF});var fS=M(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.ShowDocumentFeature=void 0;var ZF=Vt(),eq=t=>class extends t{showDocument(e){return this.connection.sendRequest(ZF.ShowDocumentRequest.type,e)}};Df.ShowDocumentFeature=eq});var dS=M(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.FileOperationsFeature=void 0;var ha=Vt(),tq=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(ha.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(ha.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(ha.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(ha.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(ha.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(ha.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};Nf.FileOperationsFeature=tq});var pS=M(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.LinkedEditingRangeFeature=void 0;var rq=Vt(),nq=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(rq.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};If.LinkedEditingRangeFeature=nq});var mS=M(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.TypeHierarchyFeature=void 0;var qy=Vt(),iq=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(qy.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=qy.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=qy.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Of.TypeHierarchyFeature=iq});var gS=M(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.InlineValueFeature=void 0;var hS=Vt(),oq=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(hS.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(hS.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Lf.InlineValueFeature=oq});var yS=M(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.InlayHintFeature=void 0;var jy=Vt(),sq=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(jy.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(jy.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(jy.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};Mf.InlayHintFeature=sq});var vS=M($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.DiagnosticFeature=void 0;var Eu=Vt(),aq=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Eu.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Eu.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Eu.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(Eu.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Eu.WorkspaceDiagnosticRequest.partialResult,r)))}}};$f.DiagnosticFeature=aq});var TS=M(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.MonikerFeature=void 0;var cq=Vt(),uq=t=>class extends t{get moniker(){return{on:e=>{let r=cq.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Ff.MonikerFeature=uq});var NS=M(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createConnection=Ie.combineFeatures=Ie.combineNotebooksFeatures=Ie.combineLanguagesFeatures=Ie.combineWorkspaceFeatures=Ie.combineWindowFeatures=Ie.combineClientFeatures=Ie.combineTracerFeatures=Ie.combineTelemetryFeatures=Ie.combineConsoleFeatures=Ie._NotebooksImpl=Ie._LanguagesImpl=Ie.BulkUnregistration=Ie.BulkRegistration=Ie.ErrorMessageTracker=void 0;var V=Vt(),An=Oy(),Wy=Ly(),he=aS(),lq=cS(),fq=uS(),dq=lS(),pq=Py(),mq=fS(),hq=dS(),gq=pS(),yq=mS(),vq=gS(),Tq=yS(),Rq=vS(),xq=Iy(),bq=TS();function Uy(t){if(t!==null)return t}var Hy=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Ie.ErrorMessageTracker=Hy;var qf=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(V.MessageType.Error,e)}warn(e){this.send(V.MessageType.Warning,e)}info(e){this.send(V.MessageType.Info,e)}log(e){this.send(V.MessageType.Log,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(V.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,V.RAL)().console.error("Sending log message failed")})}},Gy=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,...r){let n={type:V.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Uy)}showWarningMessage(e,...r){let n={type:V.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Uy)}showInformationMessage(e,...r){let n={type:V.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Uy)}},RS=(0,mq.ShowDocumentFeature)((0,he.ProgressFeature)(Gy)),_q;(function(t){function e(){return new jf}t.create=e})(_q=Ie.BulkRegistration||(Ie.BulkRegistration={}));var jf=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=An.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=Wy.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Sq;(function(t){function e(){return new Pu(void 0,[])}t.create=e})(Sq=Ie.BulkUnregistration||(Ie.BulkUnregistration={}));var Pu=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(V.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=An.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(V.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},o=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},Uf=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,r,n){return e instanceof jf?this.registerMany(e):e instanceof Pu?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=An.string(r)?r:r.method,o=Wy.generateUuid(),s={registrations:[{id:o,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(V.RegistrationRequest.type,s).then(a=>(e.add({id:o,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=An.string(e)?e:e.method,i=Wy.generateUuid(),o={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(V.RegistrationRequest.type,o).then(s=>V.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(s)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(V.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(V.RegistrationRequest.type,r).then(()=>new Pu(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},By=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 r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(V.ApplyWorkspaceEditRequest.type,n)}},xS=(0,hq.FileOperationsFeature)((0,fq.WorkspaceFoldersFeature)((0,lq.ConfigurationFeature)(By))),Wf=class{constructor(){this._trace=V.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==V.Trace.Off&&this.connection.sendNotification(V.LogTraceNotification.type,{message:e,verbose:this._trace===V.Trace.Verbose?r:void 0}).catch(()=>{})}},Hf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(V.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Gf=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,he.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,he.attachPartialResult)(this.connection,r)}};Ie._LanguagesImpl=Gf;var bS=(0,bq.MonikerFeature)((0,Rq.DiagnosticFeature)((0,Tq.InlayHintFeature)((0,vq.InlineValueFeature)((0,yq.TypeHierarchyFeature)((0,gq.LinkedEditingRangeFeature)((0,pq.SemanticTokensFeature)((0,dq.CallHierarchyFeature)(Gf)))))))),Bf=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,he.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,he.attachPartialResult)(this.connection,r)}};Ie._NotebooksImpl=Bf;var _S=(0,xq.NotebookSyncFeature)(Bf);function SS(t,e){return function(r){return e(t(r))}}Ie.combineConsoleFeatures=SS;function kS(t,e){return function(r){return e(t(r))}}Ie.combineTelemetryFeatures=kS;function wS(t,e){return function(r){return e(t(r))}}Ie.combineTracerFeatures=wS;function CS(t,e){return function(r){return e(t(r))}}Ie.combineClientFeatures=CS;function ES(t,e){return function(r){return e(t(r))}}Ie.combineWindowFeatures=ES;function PS(t,e){return function(r){return e(t(r))}}Ie.combineWorkspaceFeatures=PS;function AS(t,e){return function(r){return e(t(r))}}Ie.combineLanguagesFeatures=AS;function DS(t,e){return function(r){return e(t(r))}}Ie.combineNotebooksFeatures=DS;function kq(t,e){function r(i,o,s){return i&&o?s(i,o):i||o}return{__brand:"features",console:r(t.console,e.console,SS),tracer:r(t.tracer,e.tracer,wS),telemetry:r(t.telemetry,e.telemetry,kS),client:r(t.client,e.client,CS),window:r(t.window,e.window,ES),workspace:r(t.workspace,e.workspace,PS),languages:r(t.languages,e.languages,AS),notebooks:r(t.notebooks,e.notebooks,DS)}}Ie.combineFeatures=kq;function wq(t,e,r){let n=r&&r.console?new(r.console(qf)):new qf,i=t(n);n.rawAttach(i);let o=r&&r.tracer?new(r.tracer(Wf)):new Wf,s=r&&r.telemetry?new(r.telemetry(Hf)):new Hf,a=r&&r.client?new(r.client(Uf)):new Uf,c=r&&r.window?new(r.window(RS)):new RS,u=r&&r.workspace?new(r.workspace(xS)):new xS,l=r&&r.languages?new(r.languages(bS)):new bS,f=r&&r.notebooks?new(r.notebooks(_S)):new _S,g=[n,o,s,a,c,u,l,f];function T(m){return m instanceof Promise?m:An.thenable(m)?new Promise((d,_)=>{m.then($=>d($),$=>_($))}):Promise.resolve(m)}let C,P,O,E={listen:()=>i.listen(),sendRequest:(m,...d)=>i.sendRequest(An.string(m)?m:m.method,...d),onRequest:(m,d)=>i.onRequest(m,d),sendNotification:(m,d)=>{let _=An.string(m)?m:m.method;return arguments.length===1?i.sendNotification(_):i.sendNotification(_,d)},onNotification:(m,d)=>i.onNotification(m,d),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:m=>(P=m,{dispose:()=>{P=void 0}}),onInitialized:m=>i.onNotification(V.InitializedNotification.type,m),onShutdown:m=>(C=m,{dispose:()=>{C=void 0}}),onExit:m=>(O=m,{dispose:()=>{O=void 0}}),get console(){return n},get telemetry(){return s},get tracer(){return o},get client(){return a},get window(){return c},get workspace(){return u},get languages(){return l},get notebooks(){return f},onDidChangeConfiguration:m=>i.onNotification(V.DidChangeConfigurationNotification.type,m),onDidChangeWatchedFiles:m=>i.onNotification(V.DidChangeWatchedFilesNotification.type,m),__textDocumentSync:void 0,onDidOpenTextDocument:m=>i.onNotification(V.DidOpenTextDocumentNotification.type,m),onDidChangeTextDocument:m=>i.onNotification(V.DidChangeTextDocumentNotification.type,m),onDidCloseTextDocument:m=>i.onNotification(V.DidCloseTextDocumentNotification.type,m),onWillSaveTextDocument:m=>i.onNotification(V.WillSaveTextDocumentNotification.type,m),onWillSaveTextDocumentWaitUntil:m=>i.onRequest(V.WillSaveTextDocumentWaitUntilRequest.type,m),onDidSaveTextDocument:m=>i.onNotification(V.DidSaveTextDocumentNotification.type,m),sendDiagnostics:m=>i.sendNotification(V.PublishDiagnosticsNotification.type,m),onHover:m=>i.onRequest(V.HoverRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),void 0)),onCompletion:m=>i.onRequest(V.CompletionRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onCompletionResolve:m=>i.onRequest(V.CompletionResolveRequest.type,m),onSignatureHelp:m=>i.onRequest(V.SignatureHelpRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),void 0)),onDeclaration:m=>i.onRequest(V.DeclarationRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onDefinition:m=>i.onRequest(V.DefinitionRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onTypeDefinition:m=>i.onRequest(V.TypeDefinitionRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onImplementation:m=>i.onRequest(V.ImplementationRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onReferences:m=>i.onRequest(V.ReferencesRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onDocumentHighlight:m=>i.onRequest(V.DocumentHighlightRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onDocumentSymbol:m=>i.onRequest(V.DocumentSymbolRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onWorkspaceSymbol:m=>i.onRequest(V.WorkspaceSymbolRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onWorkspaceSymbolResolve:m=>i.onRequest(V.WorkspaceSymbolResolveRequest.type,m),onCodeAction:m=>i.onRequest(V.CodeActionRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onCodeActionResolve:m=>i.onRequest(V.CodeActionResolveRequest.type,(d,_)=>m(d,_)),onCodeLens:m=>i.onRequest(V.CodeLensRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onCodeLensResolve:m=>i.onRequest(V.CodeLensResolveRequest.type,(d,_)=>m(d,_)),onDocumentFormatting:m=>i.onRequest(V.DocumentFormattingRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),void 0)),onDocumentRangeFormatting:m=>i.onRequest(V.DocumentRangeFormattingRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),void 0)),onDocumentOnTypeFormatting:m=>i.onRequest(V.DocumentOnTypeFormattingRequest.type,(d,_)=>m(d,_)),onRenameRequest:m=>i.onRequest(V.RenameRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),void 0)),onPrepareRename:m=>i.onRequest(V.PrepareRenameRequest.type,(d,_)=>m(d,_)),onDocumentLinks:m=>i.onRequest(V.DocumentLinkRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onDocumentLinkResolve:m=>i.onRequest(V.DocumentLinkResolveRequest.type,(d,_)=>m(d,_)),onDocumentColor:m=>i.onRequest(V.DocumentColorRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onColorPresentation:m=>i.onRequest(V.ColorPresentationRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onFoldingRanges:m=>i.onRequest(V.FoldingRangeRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onSelectionRanges:m=>i.onRequest(V.SelectionRangeRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),(0,he.attachPartialResult)(i,d))),onExecuteCommand:m=>i.onRequest(V.ExecuteCommandRequest.type,(d,_)=>m(d,_,(0,he.attachWorkDone)(i,d),void 0)),dispose:()=>i.dispose()};for(let m of g)m.attach(E);return i.onRequest(V.InitializeRequest.type,m=>{e.initialize(m),An.string(m.trace)&&(o.trace=V.Trace.fromString(m.trace));for(let d of g)d.initialize(m.capabilities);if(P){let d=P(m,new V.CancellationTokenSource().token,(0,he.attachWorkDone)(i,m),void 0);return T(d).then(_=>{if(_ instanceof V.ResponseError)return _;let $=_;$||($={capabilities:{}});let X=$.capabilities;X||(X={},$.capabilities=X),X.textDocumentSync===void 0||X.textDocumentSync===null?X.textDocumentSync=An.number(E.__textDocumentSync)?E.__textDocumentSync:V.TextDocumentSyncKind.None:!An.number(X.textDocumentSync)&&!An.number(X.textDocumentSync.change)&&(X.textDocumentSync.change=An.number(E.__textDocumentSync)?E.__textDocumentSync:V.TextDocumentSyncKind.None);for(let ke of g)ke.fillServerCapabilities(X);return $})}else{let d={capabilities:{textDocumentSync:V.TextDocumentSyncKind.None}};for(let _ of g)_.fillServerCapabilities(d.capabilities);return d}}),i.onRequest(V.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,C)return C(new V.CancellationTokenSource().token)}),i.onNotification(V.ExitNotification.type,()=>{try{O&&O()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(V.SetTraceNotification.type,m=>{o.trace=V.Trace.fromString(m.value)}),E}Ie.createConnection=wq});var Ky=M(Tr=>{"use strict";var Cq=Tr&&Tr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),IS=Tr&&Tr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cq(e,t,r)};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.ProposedFeatures=Tr.NotebookDocuments=Tr.TextDocuments=Tr.SemanticTokensBuilder=void 0;var Eq=Py();Object.defineProperty(Tr,"SemanticTokensBuilder",{enumerable:!0,get:function(){return Eq.SemanticTokensBuilder}});IS(Vt(),Tr);var Pq=Dy();Object.defineProperty(Tr,"TextDocuments",{enumerable:!0,get:function(){return Pq.TextDocuments}});var Aq=Iy();Object.defineProperty(Tr,"NotebookDocuments",{enumerable:!0,get:function(){return Aq.NotebookDocuments}});IS(NS(),Tr);var Dq;(function(t){t.all={__brand:"features"}})(Dq=Tr.ProposedFeatures||(Tr.ProposedFeatures={}))});var LS=M((v9,OS)=>{"use strict";OS.exports=Vt()});var ze=M(Ri=>{"use strict";var Nq=Ri&&Ri.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$S=Ri&&Ri.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nq(e,t,r)};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.createConnection=void 0;var Kf=Ky();$S(LS(),Ri);$S(Ky(),Ri);var MS=!1,Iq={initialize:t=>{},get shutdownReceived(){return MS},set shutdownReceived(t){MS=t},exit:t=>{}};function Oq(t,e,r,n){let i,o,s,a;t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),Kf.ConnectionStrategy.is(t)||Kf.ConnectionOptions.is(t)?a=t:(o=t,s=e,a=r);let c=u=>(0,Kf.createProtocolConnection)(o,s,u,a);return(0,Kf.createConnection)(c,Iq,i)}Ri.createConnection=Oq});var Mc=M(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.stringArray=Fr.array=Fr.func=Fr.error=Fr.number=Fr.string=Fr.boolean=void 0;function q3(t){return t===!0||t===!1}Fr.boolean=q3;function YD(t){return typeof t=="string"||t instanceof String}Fr.string=YD;function j3(t){return typeof t=="number"||t instanceof Number}Fr.number=j3;function U3(t){return t instanceof Error}Fr.error=U3;function W3(t){return typeof t=="function"}Fr.func=W3;function JD(t){return Array.isArray(t)}Fr.array=JD;function H3(t){return JD(t)&&t.every(e=>YD(e))}Fr.stringArray=H3});var dR=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 Xs=Mc(),WT;(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})(WT||(oe.ErrorCodes=WT={}));var HT=class t extends Error{constructor(e,r,n){super(r),this.code=Xs.number(e)?e:WT.UnknownErrorCode,this.data=n,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=HT;var cn=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=cn;cn.auto=new cn("auto");cn.byPosition=new cn("byPosition");cn.byName=new cn("byName");var ht=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return cn.auto}};oe.AbstractMessageSignature=ht;var GT=class extends ht{constructor(e){super(e,0)}};oe.RequestType0=GT;var BT=class extends ht{constructor(e,r=cn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};oe.RequestType=BT;var KT=class extends ht{constructor(e,r=cn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};oe.RequestType1=KT;var zT=class extends ht{constructor(e){super(e,2)}};oe.RequestType2=zT;var VT=class extends ht{constructor(e){super(e,3)}};oe.RequestType3=VT;var XT=class extends ht{constructor(e){super(e,4)}};oe.RequestType4=XT;var YT=class extends ht{constructor(e){super(e,5)}};oe.RequestType5=YT;var JT=class extends ht{constructor(e){super(e,6)}};oe.RequestType6=JT;var QT=class extends ht{constructor(e){super(e,7)}};oe.RequestType7=QT;var ZT=class extends ht{constructor(e){super(e,8)}};oe.RequestType8=ZT;var eR=class extends ht{constructor(e){super(e,9)}};oe.RequestType9=eR;var tR=class extends ht{constructor(e,r=cn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};oe.NotificationType=tR;var rR=class extends ht{constructor(e){super(e,0)}};oe.NotificationType0=rR;var nR=class extends ht{constructor(e,r=cn.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};oe.NotificationType1=nR;var iR=class extends ht{constructor(e){super(e,2)}};oe.NotificationType2=iR;var oR=class extends ht{constructor(e){super(e,3)}};oe.NotificationType3=oR;var sR=class extends ht{constructor(e){super(e,4)}};oe.NotificationType4=sR;var aR=class extends ht{constructor(e){super(e,5)}};oe.NotificationType5=aR;var cR=class extends ht{constructor(e){super(e,6)}};oe.NotificationType6=cR;var uR=class extends ht{constructor(e){super(e,7)}};oe.NotificationType7=uR;var lR=class extends ht{constructor(e){super(e,8)}};oe.NotificationType8=lR;var fR=class extends ht{constructor(e){super(e,9)}};oe.NotificationType9=fR;var QD;(function(t){function e(i){let o=i;return o&&Xs.string(o.method)&&(Xs.string(o.id)||Xs.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Xs.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Xs.string(o.id)||Xs.number(o.id)||o.id===null)}t.isResponse=n})(QD||(oe.Message=QD={}))});var mR=M(ts=>{"use strict";var ZD;Object.defineProperty(ts,"__esModule",{value:!0});ts.LRUCache=ts.LinkedMap=ts.Touch=void 0;var qr;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(qr||(ts.Touch=qr={}));var Wm=class{constructor(){this[ZD]="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,r=qr.None){let n=this._map.get(e);if(n)return r!==qr.None&&this.touch(n,r),n.value}set(e,r,n=qr.None){let i=this._map.get(e);if(i)i.value=r,n!==qr.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case qr.None:this.addItemLast(i);break;case qr.First:this.addItemFirst(i);break;case qr.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 r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.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,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(ZD=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.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 r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==qr.First&&r!==qr.Last)){if(r===qr.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===qr.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};ts.LinkedMap=Wm;var pR=class extends Wm{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),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,r=qr.AsNew){return super.get(e,r)}peek(e){return super.get(e,qr.None)}set(e,r){return super.set(e,r,qr.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};ts.LRUCache=pR});var tN=M(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.Disposable=void 0;var eN;(function(t){function e(r){return{dispose:r}}t.create=e})(eN||(Hm.Disposable=eN={}))});var rs=M(yR=>{"use strict";Object.defineProperty(yR,"__esModule",{value:!0});var hR;function gR(){if(hR===void 0)throw new Error("No runtime abstraction layer installed");return hR}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");hR=r}t.install=e})(gR||(gR={}));yR.default=gR});var Fc=M($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.Emitter=$c.Event=void 0;var G3=rs(),rN;(function(t){let e={dispose(){}};t.None=function(){return e}})(rN||($c.Event=rN={}));var vR=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,G3.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Gm=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new vR),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.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)}};$c.Emitter=Gm;Gm._noop=function(){}});var zm=M(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.CancellationTokenSource=qc.CancellationToken=void 0;var B3=rs(),K3=Mc(),TR=Fc(),Bm;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:TR.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:TR.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||K3.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Bm||(qc.CancellationToken=Bm={}));var z3=Object.freeze(function(t,e){let r=(0,B3.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Km=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?z3:(this._emitter||(this._emitter=new TR.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},RR=class{get token(){return this._token||(this._token=new Km),this._token}cancel(){this._token?this._token.cancel():this._token=Bm.Cancelled}dispose(){this._token?this._token instanceof Km&&this._token.dispose():this._token=Bm.None}};qc.CancellationTokenSource=RR});var nN=M(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.SharedArrayReceiverStrategy=jc.SharedArraySenderStrategy=void 0;var V3=zm(),Nl;(function(t){t.Continue=0,t.Cancelled=1})(Nl||(Nl={}));var xR=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Nl.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,Nl.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};jc.SharedArraySenderStrategy=xR;var bR=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Nl.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},_R=class{constructor(e){this.token=new bR(e)}cancel(){}dispose(){}},SR=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new V3.CancellationTokenSource:new _R(r)}};jc.SharedArrayReceiverStrategy=SR});var wR=M(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.Semaphore=void 0;var X3=rs(),kR=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((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,X3.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 r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Vm.Semaphore=kR});var oN=M(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.ReadableStreamMessageReader=ns.AbstractMessageReader=ns.MessageReader=void 0;var ER=rs(),Uc=Mc(),CR=Fc(),Y3=wR(),iN;(function(t){function e(r){let n=r;return n&&Uc.func(n.listen)&&Uc.func(n.dispose)&&Uc.func(n.onError)&&Uc.func(n.onClose)&&Uc.func(n.onPartialMessage)}t.is=e})(iN||(ns.MessageReader=iN={}));var Xm=class{constructor(){this.errorEmitter=new CR.Emitter,this.closeEmitter=new CR.Emitter,this.partialMessageEmitter=new CR.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: ${Uc.string(e.message)?e.message:"unknown"}`)}};ns.AbstractMessageReader=Xm;var PR;(function(t){function e(r){let n,i,o,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,s.set(o.name,o)),r.contentDecoders!==void 0)for(let u of r.contentDecoders)s.set(u.name,u);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let u of r.contentTypeDecoders)c.set(u.name,u)}return a===void 0&&(a=(0,ER.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(PR||(PR={}));var AR=class extends Xm{constructor(e,r){super(),this.readable=e,this.options=PR.fromOptions(r),this.buffer=(0,ER.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Y3.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 r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
34
+ ${JSON.stringify(Object.fromEntries(n))}`));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ER.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ns.ReadableStreamMessageReader=AR});var lN=M(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.WriteableStreamMessageWriter=is.AbstractMessageWriter=is.MessageWriter=void 0;var sN=rs(),Il=Mc(),J3=wR(),aN=Fc(),Q3="Content-Length: ",cN=`\r
35
+ `,uN;(function(t){function e(r){let n=r;return n&&Il.func(n.dispose)&&Il.func(n.onClose)&&Il.func(n.onError)&&Il.func(n.write)}t.is=e})(uN||(is.MessageWriter=uN={}));var Ym=class{constructor(){this.errorEmitter=new aN.Emitter,this.closeEmitter=new aN.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}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: ${Il.string(e.message)?e.message:"unknown"}`)}};is.AbstractMessageWriter=Ym;var DR;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,sN.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,sN.default)().applicationJson.encoder}}t.fromOptions=e})(DR||(DR={}));var NR=class extends Ym{constructor(e,r){super(),this.writable=e,this.options=DR.fromOptions(r),this.errorCount=0,this.writeSemaphore=new J3.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(Q3,n.byteLength.toString(),cN),i.push(cN),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};is.WriteableStreamMessageWriter=NR});var fN=M(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.AbstractMessageBuffer=void 0;var Z3=13,e4=10,t4=`\r
36
+ `,IR=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,o=0;e:for(;n<this._chunks.length;){let u=this._chunks[n];for(i=0;i<u.length;){switch(u[i]){case Z3:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case e4:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}o+=u.byteLength,n++}if(r!==4)return;let s=this._read(o+i),a=new Map,c=this.toString(s,"ascii").split(t4);if(c.length<2)return a;for(let u=0;u<c.length-2;u++){let l=c[u],f=l.indexOf(":");if(f===-1)throw new Error(`Message header must separate key and value using ':'
37
+ ${l}`);let g=l.substr(0,f),T=l.substr(f+1).trim();a.set(e?g.toLowerCase():g,T)}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 o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);r.set(s,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};Jm.AbstractMessageBuffer=IR});var gN=M(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.createMessageConnection=Re.ConnectionOptions=Re.MessageStrategy=Re.CancellationStrategy=Re.CancellationSenderStrategy=Re.CancellationReceiverStrategy=Re.RequestCancellationReceiverStrategy=Re.IdCancellationReceiverStrategy=Re.ConnectionStrategy=Re.ConnectionError=Re.ConnectionErrors=Re.LogTraceNotification=Re.SetTraceNotification=Re.TraceFormat=Re.TraceValues=Re.Trace=Re.NullLogger=Re.ProgressType=Re.ProgressToken=void 0;var dN=rs(),Dt=Mc(),me=dR(),pN=mR(),Ol=Fc(),OR=zm(),$l;(function(t){t.type=new me.NotificationType("$/cancelRequest")})($l||($l={}));var LR;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(LR||(Re.ProgressToken=LR={}));var Ll;(function(t){t.type=new me.NotificationType("$/progress")})(Ll||(Ll={}));var MR=class{constructor(){}};Re.ProgressType=MR;var $R;(function(t){function e(r){return Dt.func(r)}t.is=e})($R||($R={}));Re.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ue;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ue||(Re.Trace=Ue={}));var mN;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(mN||(Re.TraceValues=mN={}));(function(t){function e(n){if(!Dt.string(n))return t.Off;switch(n=n.toLowerCase(),n){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 r(n){switch(n){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=r})(Ue||(Re.Trace=Ue={}));var bn;(function(t){t.Text="text",t.JSON="json"})(bn||(Re.TraceFormat=bn={}));(function(t){function e(r){return Dt.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(bn||(Re.TraceFormat=bn={}));var FR;(function(t){t.type=new me.NotificationType("$/setTrace")})(FR||(Re.SetTraceNotification=FR={}));var Qm;(function(t){t.type=new me.NotificationType("$/logTrace")})(Qm||(Re.LogTraceNotification=Qm={}));var Ml;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Ml||(Re.ConnectionErrors=Ml={}));var Wc=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Re.ConnectionError=Wc;var qR;(function(t){function e(r){let n=r;return n&&Dt.func(n.cancelUndispatched)}t.is=e})(qR||(Re.ConnectionStrategy=qR={}));var Zm;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Dt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Dt.func(n.dispose))}t.is=e})(Zm||(Re.IdCancellationReceiverStrategy=Zm={}));var jR;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Dt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Dt.func(n.dispose))}t.is=e})(jR||(Re.RequestCancellationReceiverStrategy=jR={}));var eh;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new OR.CancellationTokenSource}});function e(r){return Zm.is(r)||jR.is(r)}t.is=e})(eh||(Re.CancellationReceiverStrategy=eh={}));var th;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification($l.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Dt.func(n.sendCancellation)&&Dt.func(n.cleanup)}t.is=e})(th||(Re.CancellationSenderStrategy=th={}));var rh;(function(t){t.Message=Object.freeze({receiver:eh.Message,sender:th.Message});function e(r){let n=r;return n&&eh.is(n.receiver)&&th.is(n.sender)}t.is=e})(rh||(Re.CancellationStrategy=rh={}));var nh;(function(t){function e(r){let n=r;return n&&Dt.func(n.handleMessage)}t.is=e})(nh||(Re.MessageStrategy=nh={}));var hN;(function(t){function e(r){let n=r;return n&&(rh.is(n.cancellationStrategy)||qR.is(n.connectionStrategy)||nh.is(n.messageStrategy))}t.is=e})(hN||(Re.ConnectionOptions=hN={}));var di;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(di||(di={}));function r4(t,e,r,n){let i=r!==void 0?r:Re.NullLogger,o=0,s=0,a=0,c="2.0",u,l=new Map,f,g=new Map,T=new Map,C,P=new pN.LinkedMap,O=new Map,E=new Set,m=new Map,d=Ue.Off,_=bn.Text,$,X=di.New,ke=new Ol.Emitter,Me=new Ol.Emitter,Bt=new Ol.Emitter,_t=new Ol.Emitter,G=new Ol.Emitter,A=n&&n.cancellationStrategy?n.cancellationStrategy:rh.Message;function z(y){if(y===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+y.toString()}function Y(y){return y===null?"res-unknown-"+(++a).toString():"res-"+y.toString()}function Ce(){return"not-"+(++s).toString()}function fe(y,k){me.Message.isRequest(k)?y.set(z(k.id),k):me.Message.isResponse(k)?y.set(Y(k.id),k):y.set(Ce(),k)}function ce(y){}function St(){return X===di.Listening}function ft(){return X===di.Closed}function be(){return X===di.Disposed}function Er(){(X===di.New||X===di.Listening)&&(X=di.Closed,Me.fire(void 0))}function Bn(y){ke.fire([y,void 0,void 0])}function ms(y){ke.fire(y)}t.onClose(Er),t.onError(Bn),e.onClose(Er),e.onError(ms);function mi(){C||P.size===0||(C=(0,dN.default)().timer.setImmediate(()=>{C=void 0,_o()}))}function cr(y){me.Message.isRequest(y)?ur(y):me.Message.isNotification(y)?rr(y):me.Message.isResponse(y)?Sn(y):gt(y)}function _o(){if(P.size===0)return;let y=P.shift();try{let k=n?.messageStrategy;nh.is(k)?k.handleMessage(y,cr):cr(y)}finally{mi()}}let Nt=y=>{try{if(me.Message.isNotification(y)&&y.method===$l.type.method){let k=y.params.id,L=z(k),U=P.get(L);if(me.Message.isRequest(U)){let ae=n?.connectionStrategy,ye=ae&&ae.cancelUndispatched?ae.cancelUndispatched(U,ce):void 0;if(ye&&(ye.error!==void 0||ye.result!==void 0)){P.delete(L),m.delete(k),ye.id=U.id,kn(ye,y.method,Date.now()),e.write(ye).catch(()=>i.error("Sending response for canceled message failed."));return}}let se=m.get(k);if(se!==void 0){se.cancel(),hs(y);return}else E.add(k)}fe(P,y)}finally{mi()}};function ur(y){if(be())return;function k(te,ie,ue){let Ee={jsonrpc:c,id:y.id};te instanceof me.ResponseError?Ee.error=te.toJson():Ee.result=te===void 0?null:te,kn(Ee,ie,ue),e.write(Ee).catch(()=>i.error("Sending response failed."))}function L(te,ie,ue){let Ee={jsonrpc:c,id:y.id,error:te.toJson()};kn(Ee,ie,ue),e.write(Ee).catch(()=>i.error("Sending response failed."))}function U(te,ie,ue){te===void 0&&(te=null);let Ee={jsonrpc:c,id:y.id,result:te};kn(Ee,ie,ue),e.write(Ee).catch(()=>i.error("Sending response failed."))}hi(y);let se=l.get(y.method),ae,ye;se&&(ae=se.type,ye=se.handler);let ne=Date.now();if(ye||u){let te=y.id??String(Date.now()),ie=Zm.is(A.receiver)?A.receiver.createCancellationTokenSource(te):A.receiver.createCancellationTokenSource(y);y.id!==null&&E.has(y.id)&&ie.cancel(),y.id!==null&&m.set(te,ie);try{let ue;if(ye)if(y.params===void 0){if(ae!==void 0&&ae.numberOfParams!==0){L(new me.ResponseError(me.ErrorCodes.InvalidParams,`Request ${y.method} defines ${ae.numberOfParams} params but received none.`),y.method,ne);return}ue=ye(ie.token)}else if(Array.isArray(y.params)){if(ae!==void 0&&ae.parameterStructures===me.ParameterStructures.byName){L(new me.ResponseError(me.ErrorCodes.InvalidParams,`Request ${y.method} defines parameters by name but received parameters by position`),y.method,ne);return}ue=ye(...y.params,ie.token)}else{if(ae!==void 0&&ae.parameterStructures===me.ParameterStructures.byPosition){L(new me.ResponseError(me.ErrorCodes.InvalidParams,`Request ${y.method} defines parameters by position but received parameters by name`),y.method,ne);return}ue=ye(y.params,ie.token)}else u&&(ue=u(y.method,y.params,ie.token));let Ee=ue;ue?Ee.then?Ee.then(dt=>{m.delete(te),k(dt,y.method,ne)},dt=>{m.delete(te),dt instanceof me.ResponseError?L(dt,y.method,ne):dt&&Dt.string(dt.message)?L(new me.ResponseError(me.ErrorCodes.InternalError,`Request ${y.method} failed with message: ${dt.message}`),y.method,ne):L(new me.ResponseError(me.ErrorCodes.InternalError,`Request ${y.method} failed unexpectedly without providing any details.`),y.method,ne)}):(m.delete(te),k(ue,y.method,ne)):(m.delete(te),U(ue,y.method,ne))}catch(ue){m.delete(te),ue instanceof me.ResponseError?k(ue,y.method,ne):ue&&Dt.string(ue.message)?L(new me.ResponseError(me.ErrorCodes.InternalError,`Request ${y.method} failed with message: ${ue.message}`),y.method,ne):L(new me.ResponseError(me.ErrorCodes.InternalError,`Request ${y.method} failed unexpectedly without providing any details.`),y.method,ne)}}else L(new me.ResponseError(me.ErrorCodes.MethodNotFound,`Unhandled method ${y.method}`),y.method,ne)}function Sn(y){if(!be())if(y.id===null)y.error?i.error(`Received response message without id: Error is:
38
+ ${JSON.stringify(y.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let k=y.id,L=O.get(k);if(gi(y,L),L!==void 0){O.delete(k);try{if(y.error){let U=y.error;L.reject(new me.ResponseError(U.code,U.message,U.data))}else if(y.result!==void 0)L.resolve(y.result);else throw new Error("Should never happen.")}catch(U){U.message?i.error(`Response handler '${L.method}' failed with message: ${U.message}`):i.error(`Response handler '${L.method}' failed unexpectedly.`)}}}}function rr(y){if(be())return;let k,L;if(y.method===$l.type.method){let U=y.params.id;E.delete(U),hs(y);return}else{let U=g.get(y.method);U&&(L=U.handler,k=U.type)}if(L||f)try{if(hs(y),L)if(y.params===void 0)k!==void 0&&k.numberOfParams!==0&&k.parameterStructures!==me.ParameterStructures.byName&&i.error(`Notification ${y.method} defines ${k.numberOfParams} params but received none.`),L();else if(Array.isArray(y.params)){let U=y.params;y.method===Ll.type.method&&U.length===2&&LR.is(U[0])?L({token:U[0],value:U[1]}):(k!==void 0&&(k.parameterStructures===me.ParameterStructures.byName&&i.error(`Notification ${y.method} defines parameters by name but received parameters by position`),k.numberOfParams!==y.params.length&&i.error(`Notification ${y.method} defines ${k.numberOfParams} params but received ${U.length} arguments`)),L(...U))}else k!==void 0&&k.parameterStructures===me.ParameterStructures.byPosition&&i.error(`Notification ${y.method} defines parameters by position but received parameters by name`),L(y.params);else f&&f(y.method,y.params)}catch(U){U.message?i.error(`Notification handler '${y.method}' failed with message: ${U.message}`):i.error(`Notification handler '${y.method}' failed unexpectedly.`)}else Bt.fire(y)}function gt(y){if(!y){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
39
+ ${JSON.stringify(y,null,4)}`);let k=y;if(Dt.string(k.id)||Dt.number(k.id)){let L=k.id,U=O.get(L);U&&U.reject(new Error("The received response has neither a result nor an error property."))}}function qt(y){if(y!=null)switch(d){case Ue.Verbose:return JSON.stringify(y,null,4);case Ue.Compact:return JSON.stringify(y);default:return}}function Wr(y){if(!(d===Ue.Off||!$))if(_===bn.Text){let k;(d===Ue.Verbose||d===Ue.Compact)&&y.params&&(k=`Params: ${qt(y.params)}
38
40
 
39
- `),M.log(`Sending request '${R.method} - (${R.id})'.`,E)}else Mr("send-request",R)}function mr(R){if(!(h===et.Off||!M))if(C===mi.Text){let E;(h===et.Verbose||h===et.Compact)&&(R.params?E=`Params: ${wt(R.params)}
41
+ `),$.log(`Sending request '${y.method} - (${y.id})'.`,k)}else Qr("send-request",y)}function Pr(y){if(!(d===Ue.Off||!$))if(_===bn.Text){let k;(d===Ue.Verbose||d===Ue.Compact)&&(y.params?k=`Params: ${qt(y.params)}
40
42
 
41
- `:E=`No parameters provided.
43
+ `:k=`No parameters provided.
42
44
 
43
- `),M.log(`Sending notification '${R.method}'.`,E)}else Mr("send-notification",R)}function an(R,E,L){if(!(h===et.Off||!M))if(C===mi.Text){let j;(h===et.Verbose||h===et.Compact)&&(R.error&&R.error.data?j=`Error data: ${wt(R.error.data)}
45
+ `),$.log(`Sending notification '${y.method}'.`,k)}else Qr("send-notification",y)}function kn(y,k,L){if(!(d===Ue.Off||!$))if(_===bn.Text){let U;(d===Ue.Verbose||d===Ue.Compact)&&(y.error&&y.error.data?U=`Error data: ${qt(y.error.data)}
44
46
 
45
- `:R.result?j=`Result: ${wt(R.result)}
47
+ `:y.result?U=`Result: ${qt(y.result)}
46
48
 
47
- `:R.error===void 0&&(j=`No result returned.
49
+ `:y.error===void 0&&(U=`No result returned.
48
50
 
49
- `)),M.log(`Sending response '${E} - (${R.id})'. Processing request took ${Date.now()-L}ms`,j)}else Mr("send-response",R)}function An(R){if(!(h===et.Off||!M))if(C===mi.Text){let E;(h===et.Verbose||h===et.Compact)&&R.params&&(E=`Params: ${wt(R.params)}
51
+ `)),$.log(`Sending response '${k} - (${y.id})'. Processing request took ${Date.now()-L}ms`,U)}else Qr("send-response",y)}function hi(y){if(!(d===Ue.Off||!$))if(_===bn.Text){let k;(d===Ue.Verbose||d===Ue.Compact)&&y.params&&(k=`Params: ${qt(y.params)}
50
52
 
51
- `),M.log(`Received request '${R.method} - (${R.id})'.`,E)}else Mr("receive-request",R)}function Ji(R){if(!(h===et.Off||!M||R.method===QT.type.method))if(C===mi.Text){let E;(h===et.Verbose||h===et.Compact)&&(R.params?E=`Params: ${wt(R.params)}
53
+ `),$.log(`Received request '${y.method} - (${y.id})'.`,k)}else Qr("receive-request",y)}function hs(y){if(!(d===Ue.Off||!$||y.method===Qm.type.method))if(_===bn.Text){let k;(d===Ue.Verbose||d===Ue.Compact)&&(y.params?k=`Params: ${qt(y.params)}
52
54
 
53
- `:E=`No parameters provided.
55
+ `:k=`No parameters provided.
54
56
 
55
- `),M.log(`Received notification '${R.method}'.`,E)}else Mr("receive-notification",R)}function Nn(R,E){if(!(h===et.Off||!M))if(C===mi.Text){let L;if((h===et.Verbose||h===et.Compact)&&(R.error&&R.error.data?L=`Error data: ${wt(R.error.data)}
57
+ `),$.log(`Received notification '${y.method}'.`,k)}else Qr("receive-notification",y)}function gi(y,k){if(!(d===Ue.Off||!$))if(_===bn.Text){let L;if((d===Ue.Verbose||d===Ue.Compact)&&(y.error&&y.error.data?L=`Error data: ${qt(y.error.data)}
56
58
 
57
- `:R.result?L=`Result: ${wt(R.result)}
59
+ `:y.result?L=`Result: ${qt(y.result)}
58
60
 
59
- `:R.error===void 0&&(L=`No result returned.
61
+ `:y.error===void 0&&(L=`No result returned.
60
62
 
61
- `)),E){let j=R.error?` Request failed: ${R.error.message} (${R.error.code}).`:"";M.log(`Received response '${E.method} - (${R.id})' in ${Date.now()-E.timerStart}ms.${j}`,L)}else M.log(`Received response ${R.id} without active response promise.`,L)}else Mr("receive-response",R)}function Mr(R,E){if(!M||h===et.Off)return;let L={isLSPMessage:!0,type:R,message:E,timestamp:Date.now()};M.log(L)}function Xn(){if(ze())throw new Fc($m.Closed,"Connection is closed.");if(_e())throw new Fc($m.Disposed,"Connection is disposed.")}function gs(){if(gt())throw new Fc($m.AlreadyListening,"Connection is already listening")}function Yn(){if(!gt())throw new Error("Call listen() first.")}function $r(R){return R===void 0?null:R}function Qi(R){if(R!==null)return R}function _i(R){return R!=null&&!Array.isArray(R)&&typeof R=="object"}function Si(R,E){switch(R){case ve.ParameterStructures.auto:return _i(E)?Qi(E):[$r(E)];case ve.ParameterStructures.byName:if(!_i(E))throw new Error("Received parameters by name but param is not an object literal.");return Qi(E);case ve.ParameterStructures.byPosition:return[$r(E)];default:throw new Error(`Unknown parameter structure ${R.toString()}`)}}function yn(R,E){let L,j=R.numberOfParams;switch(j){case 0:L=void 0;break;case 1:L=Si(R.parameterStructures,E[0]);break;default:L=[];for(let ue=0;ue<E.length&&ue<j;ue++)L.push($r(E[ue]));if(E.length<j)for(let ue=E.length;ue<j;ue++)L.push(null);break}return L}let D={sendNotification:(R,...E)=>{Xn();let L,j;if($t.string(R)){L=R;let le=E[0],Te=0,oe=ve.ParameterStructures.auto;ve.ParameterStructures.is(le)&&(Te=1,oe=le);let te=E.length,ne=te-Te;switch(ne){case 0:j=void 0;break;case 1:j=Si(oe,E[Te]);break;default:if(oe===ve.ParameterStructures.byName)throw new Error(`Received ${ne} parameters for 'by Name' notification parameter structure.`);j=E.slice(Te,te).map(de=>$r(de));break}}else{let le=E;L=R.method,j=yn(R,le)}let ue={jsonrpc:c,method:L,params:j};return mr(ue),e.write(ue).catch(le=>{throw i.error("Sending notification failed."),le})},onNotification:(R,E)=>{Xn();let L;return $t.func(R)?m=R:E&&($t.string(R)?(L=R,T.set(R,{type:void 0,handler:E})):(L=R.method,T.set(R.method,{type:R,handler:E}))),{dispose:()=>{L!==void 0?T.delete(L):m=void 0}}},onProgress:(R,E,L)=>{if(k.has(E))throw new Error(`Progress handler for token ${E} already registered`);return k.set(E,L),{dispose:()=>{k.delete(E)}}},sendProgress:(R,E,L)=>D.sendNotification(_l.type,{token:E,value:L}),onUnhandledProgress:tt.event,sendRequest:(R,...E)=>{Xn(),Yn();let L,j,ue;if($t.string(R)){L=R;let te=E[0],ne=E[E.length-1],de=0,Ae=ve.ParameterStructures.auto;ve.ParameterStructures.is(te)&&(de=1,Ae=te);let ot=E.length;XT.CancellationToken.is(ne)&&(ot=ot-1,ue=ne);let Dt=ot-de;switch(Dt){case 0:j=void 0;break;case 1:j=Si(Ae,E[de]);break;default:if(Ae===ve.ParameterStructures.byName)throw new Error(`Received ${Dt} parameters for 'by Name' request parameter structure.`);j=E.slice(de,ot).map(x=>$r(x));break}}else{let te=E;L=R.method,j=yn(R,te);let ne=R.numberOfParams;ue=XT.CancellationToken.is(te[ne])?te[ne]:void 0}let le=o++,Te;ue&&(Te=ue.onCancellationRequested(()=>{let te=I.sender.sendCancellation(D,le);return te===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${le}`),Promise.resolve()):te.catch(()=>{i.log(`Sending cancellation messages for id ${le} failed`)})}));let oe={jsonrpc:c,id:le,method:L,params:j};return xr(oe),typeof I.sender.enableCancellation=="function"&&I.sender.enableCancellation(oe),new Promise(async(te,ne)=>{let de=Dt=>{te(Dt),I.sender.cleanup(le),Te?.dispose()},Ae=Dt=>{ne(Dt),I.sender.cleanup(le),Te?.dispose()},ot={method:L,timerStart:Date.now(),resolve:de,reject:Ae};try{await e.write(oe),O.set(le,ot)}catch(Dt){throw i.error("Sending request failed."),ot.reject(new ve.ResponseError(ve.ErrorCodes.MessageWriteError,Dt.message?Dt.message:"Unknown reason")),Dt}})},onRequest:(R,E)=>{Xn();let L=null;return JT.is(R)?(L=void 0,f=R):$t.string(R)?(L=null,E!==void 0&&(L=R,p.set(R,{handler:E,type:void 0}))):E!==void 0&&(L=R.method,p.set(R.method,{type:R,handler:E})),{dispose:()=>{L!==null&&(L!==void 0?p.delete(L):f=void 0)}}},hasPendingResponse:()=>O.size>0,trace:async(R,E,L)=>{let j=!1,ue=mi.Text;L!==void 0&&($t.boolean(L)?j=L:(j=L.sendNotification||!1,ue=L.traceFormat||mi.Text)),h=R,C=ue,h===et.Off?M=void 0:M=E,j&&!ze()&&!_e()&&await D.sendNotification(yP.type,{value:et.toString(R)})},onError:ce.event,onClose:we.event,onUnhandledNotification:Rt.event,onDispose:U.event,end:()=>{e.end()},dispose:()=>{if(_e())return;z=hi.Disposed,U.fire(void 0);let R=new ve.ResponseError(ve.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let E of O.values())E.reject(R);O=new Map,y=new Map,P=new Set,N=new hP.LinkedMap,$t.func(e.dispose)&&e.dispose(),$t.func(t.dispose)&&t.dispose()},listen:()=>{Xn(),gs(),z=hi.Listening,t.listen(xt)},inspect:()=>{(0,mP.default)().console.log("inspect")}};return D.onNotification(QT.type,R=>{if(h===et.Off||!M)return;let E=h===et.Verbose||h===et.Compact;M.log(R.message,E?R.verbose:void 0)}),D.onNotification(_l.type,R=>{let E=k.get(R.token);E?E(R.value):tt.fire(R)}),D}ie.createMessageConnection=iz});var qm=$(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 ht=CT();Object.defineProperty(q,"Message",{enumerable:!0,get:function(){return ht.Message}});Object.defineProperty(q,"RequestType",{enumerable:!0,get:function(){return ht.RequestType}});Object.defineProperty(q,"RequestType0",{enumerable:!0,get:function(){return ht.RequestType0}});Object.defineProperty(q,"RequestType1",{enumerable:!0,get:function(){return ht.RequestType1}});Object.defineProperty(q,"RequestType2",{enumerable:!0,get:function(){return ht.RequestType2}});Object.defineProperty(q,"RequestType3",{enumerable:!0,get:function(){return ht.RequestType3}});Object.defineProperty(q,"RequestType4",{enumerable:!0,get:function(){return ht.RequestType4}});Object.defineProperty(q,"RequestType5",{enumerable:!0,get:function(){return ht.RequestType5}});Object.defineProperty(q,"RequestType6",{enumerable:!0,get:function(){return ht.RequestType6}});Object.defineProperty(q,"RequestType7",{enumerable:!0,get:function(){return ht.RequestType7}});Object.defineProperty(q,"RequestType8",{enumerable:!0,get:function(){return ht.RequestType8}});Object.defineProperty(q,"RequestType9",{enumerable:!0,get:function(){return ht.RequestType9}});Object.defineProperty(q,"ResponseError",{enumerable:!0,get:function(){return ht.ResponseError}});Object.defineProperty(q,"ErrorCodes",{enumerable:!0,get:function(){return ht.ErrorCodes}});Object.defineProperty(q,"NotificationType",{enumerable:!0,get:function(){return ht.NotificationType}});Object.defineProperty(q,"NotificationType0",{enumerable:!0,get:function(){return ht.NotificationType0}});Object.defineProperty(q,"NotificationType1",{enumerable:!0,get:function(){return ht.NotificationType1}});Object.defineProperty(q,"NotificationType2",{enumerable:!0,get:function(){return ht.NotificationType2}});Object.defineProperty(q,"NotificationType3",{enumerable:!0,get:function(){return ht.NotificationType3}});Object.defineProperty(q,"NotificationType4",{enumerable:!0,get:function(){return ht.NotificationType4}});Object.defineProperty(q,"NotificationType5",{enumerable:!0,get:function(){return ht.NotificationType5}});Object.defineProperty(q,"NotificationType6",{enumerable:!0,get:function(){return ht.NotificationType6}});Object.defineProperty(q,"NotificationType7",{enumerable:!0,get:function(){return ht.NotificationType7}});Object.defineProperty(q,"NotificationType8",{enumerable:!0,get:function(){return ht.NotificationType8}});Object.defineProperty(q,"NotificationType9",{enumerable:!0,get:function(){return ht.NotificationType9}});Object.defineProperty(q,"ParameterStructures",{enumerable:!0,get:function(){return ht.ParameterStructures}});var iR=DT();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return iR.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return iR.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return iR.Touch}});var oz=sP();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return oz.Disposable}});var xP=Mc();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return xP.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return xP.Emitter}});var bP=Nm();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return bP.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return bP.CancellationToken}});var _P=aP();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return _P.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return _P.SharedArrayReceiverStrategy}});var oR=cP();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return oR.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return oR.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return oR.ReadableStreamMessageReader}});var sR=dP();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return sR.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return sR.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return sR.WriteableStreamMessageWriter}});var sz=pP();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return sz.AbstractMessageBuffer}});var Ar=RP();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return Ar.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return Ar.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return Ar.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return Ar.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return Ar.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return Ar.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return Ar.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return Ar.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return Ar.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return Ar.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return Ar.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return Ar.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return Ar.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ar.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ar.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return Ar.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return Ar.MessageStrategy}});var az=cs();q.RAL=az.default});var kP=$(lR=>{"use strict";Object.defineProperty(lR,"__esModule",{value:!0});var Bi=qm(),Fm=class t extends Bi.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}};Fm.emptyBuffer=new Uint8Array(0);var aR=class{constructor(e){this.socket=e,this._onData=new Bi.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Bi.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Bi.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Bi.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Bi.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}},cR=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Bi.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Bi.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Bi.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},cz=new TextEncoder,SP=Object.freeze({messageBuffer:Object.freeze({create:t=>new Fm(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(cz.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new aR(t),asWritableStream:t=>new cR(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function uR(){return SP}(function(t){function e(){Bi.RAL.install(SP)}t.install=e})(uR||(uR={}));lR.default=uR});var Qs=$(En=>{"use strict";var uz=En&&En.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lz=En&&En.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uz(e,t,r)};Object.defineProperty(En,"__esModule",{value:!0});En.createMessageConnection=En.BrowserMessageWriter=En.BrowserMessageReader=void 0;var fz=kP();fz.default.install();var jc=qm();lz(qm(),En);var fR=class extends jc.AbstractMessageReader{constructor(e){super(),this._onData=new jc.Emitter,this._messageListener=r=>{this._onData.fire(r.data)},e.addEventListener("error",r=>this.fireError(r)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}};En.BrowserMessageReader=fR;var dR=class extends jc.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};En.BrowserMessageWriter=dR;function dz(t,e,r,n){return r===void 0&&(r=jc.NullLogger),jc.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,jc.createMessageConnection)(t,e,r,n)}En.createMessageConnection=dz});var pR=$((cve,CP)=>{"use strict";CP.exports=Qs()});var Um=$((wP,jm)=>{(function(t){if(typeof jm=="object"&&typeof jm.exports=="object"){var e=t(Wl,wP);e!==void 0&&(jm.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.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 r;(function(l){function g(v){return typeof v=="string"}l.is=g})(r=e.DocumentUri||(e.DocumentUri={}));var n;(function(l){function g(v){return typeof v=="string"}l.is=g})(n=e.URI||(e.URI={}));var i;(function(l){l.MIN_VALUE=-2147483648,l.MAX_VALUE=2147483647;function g(v){return typeof v=="number"&&l.MIN_VALUE<=v&&v<=l.MAX_VALUE}l.is=g})(i=e.integer||(e.integer={}));var o;(function(l){l.MIN_VALUE=0,l.MAX_VALUE=2147483647;function g(v){return typeof v=="number"&&l.MIN_VALUE<=v&&v<=l.MAX_VALUE}l.is=g})(o=e.uinteger||(e.uinteger={}));var s;(function(l){function g(d,u){return d===Number.MAX_VALUE&&(d=o.MAX_VALUE),u===Number.MAX_VALUE&&(u=o.MAX_VALUE),{line:d,character:u}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.uinteger(u.line)&&x.uinteger(u.character)}l.is=v})(s=e.Position||(e.Position={}));var a;(function(l){function g(d,u,b,w){if(x.uinteger(d)&&x.uinteger(u)&&x.uinteger(b)&&x.uinteger(w))return{start:s.create(d,u),end:s.create(b,w)};if(s.is(d)&&s.is(u))return{start:d,end:u};throw new Error("Range#create called with invalid arguments[".concat(d,", ").concat(u,", ").concat(b,", ").concat(w,"]"))}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&s.is(u.start)&&s.is(u.end)}l.is=v})(a=e.Range||(e.Range={}));var c;(function(l){function g(d,u){return{uri:d,range:u}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&a.is(u.range)&&(x.string(u.uri)||x.undefined(u.uri))}l.is=v})(c=e.Location||(e.Location={}));var f;(function(l){function g(d,u,b,w){return{targetUri:d,targetRange:u,targetSelectionRange:b,originSelectionRange:w}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&a.is(u.targetRange)&&x.string(u.targetUri)&&a.is(u.targetSelectionRange)&&(a.is(u.originSelectionRange)||x.undefined(u.originSelectionRange))}l.is=v})(f=e.LocationLink||(e.LocationLink={}));var p;(function(l){function g(d,u,b,w){return{red:d,green:u,blue:b,alpha:w}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.numberRange(u.red,0,1)&&x.numberRange(u.green,0,1)&&x.numberRange(u.blue,0,1)&&x.numberRange(u.alpha,0,1)}l.is=v})(p=e.Color||(e.Color={}));var m;(function(l){function g(d,u){return{range:d,color:u}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&a.is(u.range)&&p.is(u.color)}l.is=v})(m=e.ColorInformation||(e.ColorInformation={}));var T;(function(l){function g(d,u,b){return{label:d,textEdit:u,additionalTextEdits:b}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.string(u.label)&&(x.undefined(u.textEdit)||M.is(u))&&(x.undefined(u.additionalTextEdits)||x.typedArray(u.additionalTextEdits,M.is))}l.is=v})(T=e.ColorPresentation||(e.ColorPresentation={}));var k;(function(l){l.Comment="comment",l.Imports="imports",l.Region="region"})(k=e.FoldingRangeKind||(e.FoldingRangeKind={}));var A;(function(l){function g(d,u,b,w,W,Re){var pe={startLine:d,endLine:u};return x.defined(b)&&(pe.startCharacter=b),x.defined(w)&&(pe.endCharacter=w),x.defined(W)&&(pe.kind=W),x.defined(Re)&&(pe.collapsedText=Re),pe}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.uinteger(u.startLine)&&x.uinteger(u.startLine)&&(x.undefined(u.startCharacter)||x.uinteger(u.startCharacter))&&(x.undefined(u.endCharacter)||x.uinteger(u.endCharacter))&&(x.undefined(u.kind)||x.string(u.kind))}l.is=v})(A=e.FoldingRange||(e.FoldingRange={}));var N;(function(l){function g(d,u){return{location:d,message:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&c.is(u.location)&&x.string(u.message)}l.is=v})(N=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var O;(function(l){l.Error=1,l.Warning=2,l.Information=3,l.Hint=4})(O=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var P;(function(l){l.Unnecessary=1,l.Deprecated=2})(P=e.DiagnosticTag||(e.DiagnosticTag={}));var y;(function(l){function g(v){var d=v;return x.objectLiteral(d)&&x.string(d.href)}l.is=g})(y=e.CodeDescription||(e.CodeDescription={}));var h;(function(l){function g(d,u,b,w,W,Re){var pe={range:d,message:u};return x.defined(b)&&(pe.severity=b),x.defined(w)&&(pe.code=w),x.defined(W)&&(pe.source=W),x.defined(Re)&&(pe.relatedInformation=Re),pe}l.create=g;function v(d){var u,b=d;return x.defined(b)&&a.is(b.range)&&x.string(b.message)&&(x.number(b.severity)||x.undefined(b.severity))&&(x.integer(b.code)||x.string(b.code)||x.undefined(b.code))&&(x.undefined(b.codeDescription)||x.string((u=b.codeDescription)===null||u===void 0?void 0:u.href))&&(x.string(b.source)||x.undefined(b.source))&&(x.undefined(b.relatedInformation)||x.typedArray(b.relatedInformation,N.is))}l.is=v})(h=e.Diagnostic||(e.Diagnostic={}));var C;(function(l){function g(d,u){for(var b=[],w=2;w<arguments.length;w++)b[w-2]=arguments[w];var W={title:d,command:u};return x.defined(b)&&b.length>0&&(W.arguments=b),W}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.title)&&x.string(u.command)}l.is=v})(C=e.Command||(e.Command={}));var M;(function(l){function g(b,w){return{range:b,newText:w}}l.replace=g;function v(b,w){return{range:{start:b,end:b},newText:w}}l.insert=v;function d(b){return{range:b,newText:""}}l.del=d;function u(b){var w=b;return x.objectLiteral(w)&&x.string(w.newText)&&a.is(w.range)}l.is=u})(M=e.TextEdit||(e.TextEdit={}));var z;(function(l){function g(d,u,b){var w={label:d};return u!==void 0&&(w.needsConfirmation=u),b!==void 0&&(w.description=b),w}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&x.string(u.label)&&(x.boolean(u.needsConfirmation)||u.needsConfirmation===void 0)&&(x.string(u.description)||u.description===void 0)}l.is=v})(z=e.ChangeAnnotation||(e.ChangeAnnotation={}));var ce;(function(l){function g(v){var d=v;return x.string(d)}l.is=g})(ce=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var we;(function(l){function g(b,w,W){return{range:b,newText:w,annotationId:W}}l.replace=g;function v(b,w,W){return{range:{start:b,end:b},newText:w,annotationId:W}}l.insert=v;function d(b,w){return{range:b,newText:"",annotationId:w}}l.del=d;function u(b){var w=b;return M.is(w)&&(z.is(w.annotationId)||ce.is(w.annotationId))}l.is=u})(we=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var Rt;(function(l){function g(d,u){return{textDocument:d,edits:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&ze.is(u.textDocument)&&Array.isArray(u.edits)}l.is=v})(Rt=e.TextDocumentEdit||(e.TextDocumentEdit={}));var tt;(function(l){function g(d,u,b){var w={kind:"create",uri:d};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(w.options=u),b!==void 0&&(w.annotationId=b),w}l.create=g;function v(d){var u=d;return u&&u.kind==="create"&&x.string(u.uri)&&(u.options===void 0||(u.options.overwrite===void 0||x.boolean(u.options.overwrite))&&(u.options.ignoreIfExists===void 0||x.boolean(u.options.ignoreIfExists)))&&(u.annotationId===void 0||ce.is(u.annotationId))}l.is=v})(tt=e.CreateFile||(e.CreateFile={}));var U;(function(l){function g(d,u,b,w){var W={kind:"rename",oldUri:d,newUri:u};return b!==void 0&&(b.overwrite!==void 0||b.ignoreIfExists!==void 0)&&(W.options=b),w!==void 0&&(W.annotationId=w),W}l.create=g;function v(d){var u=d;return u&&u.kind==="rename"&&x.string(u.oldUri)&&x.string(u.newUri)&&(u.options===void 0||(u.options.overwrite===void 0||x.boolean(u.options.overwrite))&&(u.options.ignoreIfExists===void 0||x.boolean(u.options.ignoreIfExists)))&&(u.annotationId===void 0||ce.is(u.annotationId))}l.is=v})(U=e.RenameFile||(e.RenameFile={}));var I;(function(l){function g(d,u,b){var w={kind:"delete",uri:d};return u!==void 0&&(u.recursive!==void 0||u.ignoreIfNotExists!==void 0)&&(w.options=u),b!==void 0&&(w.annotationId=b),w}l.create=g;function v(d){var u=d;return u&&u.kind==="delete"&&x.string(u.uri)&&(u.options===void 0||(u.options.recursive===void 0||x.boolean(u.options.recursive))&&(u.options.ignoreIfNotExists===void 0||x.boolean(u.options.ignoreIfNotExists)))&&(u.annotationId===void 0||ce.is(u.annotationId))}l.is=v})(I=e.DeleteFile||(e.DeleteFile={}));var K;(function(l){function g(v){var d=v;return d&&(d.changes!==void 0||d.documentChanges!==void 0)&&(d.documentChanges===void 0||d.documentChanges.every(function(u){return x.string(u.kind)?tt.is(u)||U.is(u)||I.is(u):Rt.is(u)}))}l.is=g})(K=e.WorkspaceEdit||(e.WorkspaceEdit={}));var V=function(){function l(g,v){this.edits=g,this.changeAnnotations=v}return l.prototype.insert=function(g,v,d){var u,b;if(d===void 0?u=M.insert(g,v):ce.is(d)?(b=d,u=we.insert(g,v,d)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(d),u=we.insert(g,v,b)),this.edits.push(u),b!==void 0)return b},l.prototype.replace=function(g,v,d){var u,b;if(d===void 0?u=M.replace(g,v):ce.is(d)?(b=d,u=we.replace(g,v,d)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(d),u=we.replace(g,v,b)),this.edits.push(u),b!==void 0)return b},l.prototype.delete=function(g,v){var d,u;if(v===void 0?d=M.del(g):ce.is(v)?(u=v,d=we.del(g,v)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(v),d=we.del(g,u)),this.edits.push(d),u!==void 0)return u},l.prototype.add=function(g){this.edits.push(g)},l.prototype.all=function(){return this.edits},l.prototype.clear=function(){this.edits.splice(0,this.edits.length)},l.prototype.assertChangeAnnotations=function(g){if(g===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},l}(),Ce=function(){function l(g){this._annotations=g===void 0?Object.create(null):g,this._counter=0,this._size=0}return l.prototype.all=function(){return this._annotations},Object.defineProperty(l.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),l.prototype.manage=function(g,v){var d;if(ce.is(g)?d=g:(d=this.nextId(),v=g),this._annotations[d]!==void 0)throw new Error("Id ".concat(d," is already in use."));if(v===void 0)throw new Error("No annotation provided for id ".concat(d));return this._annotations[d]=v,this._size++,d},l.prototype.nextId=function(){return this._counter++,this._counter.toString()},l}(),me=function(){function l(g){var v=this;this._textEditChanges=Object.create(null),g!==void 0?(this._workspaceEdit=g,g.documentChanges?(this._changeAnnotations=new Ce(g.changeAnnotations),g.changeAnnotations=this._changeAnnotations.all(),g.documentChanges.forEach(function(d){if(Rt.is(d)){var u=new V(d.edits,v._changeAnnotations);v._textEditChanges[d.textDocument.uri]=u}})):g.changes&&Object.keys(g.changes).forEach(function(d){var u=new V(g.changes[d]);v._textEditChanges[d]=u})):this._workspaceEdit={}}return Object.defineProperty(l.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}),l.prototype.getTextEditChange=function(g){if(ze.is(g)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var v={uri:g.uri,version:g.version},d=this._textEditChanges[v.uri];if(!d){var u=[],b={textDocument:v,edits:u};this._workspaceEdit.documentChanges.push(b),d=new V(u,this._changeAnnotations),this._textEditChanges[v.uri]=d}return d}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var d=this._textEditChanges[g];if(!d){var u=[];this._workspaceEdit.changes[g]=u,d=new V(u),this._textEditChanges[g]=d}return d}},l.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ce,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},l.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},l.prototype.createFile=function(g,v,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var u;z.is(v)||ce.is(v)?u=v:d=v;var b,w;if(u===void 0?b=tt.create(g,d):(w=ce.is(u)?u:this._changeAnnotations.manage(u),b=tt.create(g,d,w)),this._workspaceEdit.documentChanges.push(b),w!==void 0)return w},l.prototype.renameFile=function(g,v,d,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var b;z.is(d)||ce.is(d)?b=d:u=d;var w,W;if(b===void 0?w=U.create(g,v,u):(W=ce.is(b)?b:this._changeAnnotations.manage(b),w=U.create(g,v,u,W)),this._workspaceEdit.documentChanges.push(w),W!==void 0)return W},l.prototype.deleteFile=function(g,v,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var u;z.is(v)||ce.is(v)?u=v:d=v;var b,w;if(u===void 0?b=I.create(g,d):(w=ce.is(u)?u:this._changeAnnotations.manage(u),b=I.create(g,d,w)),this._workspaceEdit.documentChanges.push(b),w!==void 0)return w},l}();e.WorkspaceChange=me;var fe;(function(l){function g(d){return{uri:d}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.uri)}l.is=v})(fe=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var gt;(function(l){function g(d,u){return{uri:d,version:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.uri)&&x.integer(u.version)}l.is=v})(gt=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var ze;(function(l){function g(d,u){return{uri:d,version:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.uri)&&(u.version===null||x.integer(u.version))}l.is=v})(ze=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var _e;(function(l){function g(d,u,b,w){return{uri:d,languageId:u,version:b,text:w}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.string(u.uri)&&x.string(u.languageId)&&x.integer(u.version)&&x.string(u.text)}l.is=v})(_e=e.TextDocumentItem||(e.TextDocumentItem={}));var sr;(function(l){l.PlainText="plaintext",l.Markdown="markdown";function g(v){var d=v;return d===l.PlainText||d===l.Markdown}l.is=g})(sr=e.MarkupKind||(e.MarkupKind={}));var Lr;(function(l){function g(v){var d=v;return x.objectLiteral(v)&&sr.is(d.kind)&&x.string(d.value)}l.is=g})(Lr=e.MarkupContent||(e.MarkupContent={}));var Yi;(function(l){l.Text=1,l.Method=2,l.Function=3,l.Constructor=4,l.Field=5,l.Variable=6,l.Class=7,l.Interface=8,l.Module=9,l.Property=10,l.Unit=11,l.Value=12,l.Enum=13,l.Keyword=14,l.Snippet=15,l.Color=16,l.File=17,l.Reference=18,l.Folder=19,l.EnumMember=20,l.Constant=21,l.Struct=22,l.Event=23,l.Operator=24,l.TypeParameter=25})(Yi=e.CompletionItemKind||(e.CompletionItemKind={}));var Pn;(function(l){l.PlainText=1,l.Snippet=2})(Pn=e.InsertTextFormat||(e.InsertTextFormat={}));var zt;(function(l){l.Deprecated=1})(zt=e.CompletionItemTag||(e.CompletionItemTag={}));var bi;(function(l){function g(d,u,b){return{newText:d,insert:u,replace:b}}l.create=g;function v(d){var u=d;return u&&x.string(u.newText)&&a.is(u.insert)&&a.is(u.replace)}l.is=v})(bi=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var xt;(function(l){l.asIs=1,l.adjustIndentation=2})(xt=e.InsertTextMode||(e.InsertTextMode={}));var Vt;(function(l){function g(v){var d=v;return d&&(x.string(d.detail)||d.detail===void 0)&&(x.string(d.description)||d.description===void 0)}l.is=g})(Vt=e.CompletionItemLabelDetails||(e.CompletionItemLabelDetails={}));var sn;(function(l){function g(v){return{label:v}}l.create=g})(sn=e.CompletionItem||(e.CompletionItem={}));var Ht;(function(l){function g(v,d){return{items:v||[],isIncomplete:!!d}}l.create=g})(Ht=e.CompletionList||(e.CompletionList={}));var rt;(function(l){function g(d){return d.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}l.fromPlainText=g;function v(d){var u=d;return x.string(u)||x.objectLiteral(u)&&x.string(u.language)&&x.string(u.value)}l.is=v})(rt=e.MarkedString||(e.MarkedString={}));var wt;(function(l){function g(v){var d=v;return!!d&&x.objectLiteral(d)&&(Lr.is(d.contents)||rt.is(d.contents)||x.typedArray(d.contents,rt.is))&&(v.range===void 0||a.is(v.range))}l.is=g})(wt=e.Hover||(e.Hover={}));var xr;(function(l){function g(v,d){return d?{label:v,documentation:d}:{label:v}}l.create=g})(xr=e.ParameterInformation||(e.ParameterInformation={}));var mr;(function(l){function g(v,d){for(var u=[],b=2;b<arguments.length;b++)u[b-2]=arguments[b];var w={label:v};return x.defined(d)&&(w.documentation=d),x.defined(u)?w.parameters=u:w.parameters=[],w}l.create=g})(mr=e.SignatureInformation||(e.SignatureInformation={}));var an;(function(l){l.Text=1,l.Read=2,l.Write=3})(an=e.DocumentHighlightKind||(e.DocumentHighlightKind={}));var An;(function(l){function g(v,d){var u={range:v};return x.number(d)&&(u.kind=d),u}l.create=g})(An=e.DocumentHighlight||(e.DocumentHighlight={}));var Ji;(function(l){l.File=1,l.Module=2,l.Namespace=3,l.Package=4,l.Class=5,l.Method=6,l.Property=7,l.Field=8,l.Constructor=9,l.Enum=10,l.Interface=11,l.Function=12,l.Variable=13,l.Constant=14,l.String=15,l.Number=16,l.Boolean=17,l.Array=18,l.Object=19,l.Key=20,l.Null=21,l.EnumMember=22,l.Struct=23,l.Event=24,l.Operator=25,l.TypeParameter=26})(Ji=e.SymbolKind||(e.SymbolKind={}));var Nn;(function(l){l.Deprecated=1})(Nn=e.SymbolTag||(e.SymbolTag={}));var Mr;(function(l){function g(v,d,u,b,w){var W={name:v,kind:d,location:{uri:b,range:u}};return w&&(W.containerName=w),W}l.create=g})(Mr=e.SymbolInformation||(e.SymbolInformation={}));var Xn;(function(l){function g(v,d,u,b){return b!==void 0?{name:v,kind:d,location:{uri:u,range:b}}:{name:v,kind:d,location:{uri:u}}}l.create=g})(Xn=e.WorkspaceSymbol||(e.WorkspaceSymbol={}));var gs;(function(l){function g(d,u,b,w,W,Re){var pe={name:d,detail:u,kind:b,range:w,selectionRange:W};return Re!==void 0&&(pe.children=Re),pe}l.create=g;function v(d){var u=d;return u&&x.string(u.name)&&x.number(u.kind)&&a.is(u.range)&&a.is(u.selectionRange)&&(u.detail===void 0||x.string(u.detail))&&(u.deprecated===void 0||x.boolean(u.deprecated))&&(u.children===void 0||Array.isArray(u.children))&&(u.tags===void 0||Array.isArray(u.tags))}l.is=v})(gs=e.DocumentSymbol||(e.DocumentSymbol={}));var Yn;(function(l){l.Empty="",l.QuickFix="quickfix",l.Refactor="refactor",l.RefactorExtract="refactor.extract",l.RefactorInline="refactor.inline",l.RefactorRewrite="refactor.rewrite",l.Source="source",l.SourceOrganizeImports="source.organizeImports",l.SourceFixAll="source.fixAll"})(Yn=e.CodeActionKind||(e.CodeActionKind={}));var $r;(function(l){l.Invoked=1,l.Automatic=2})($r=e.CodeActionTriggerKind||(e.CodeActionTriggerKind={}));var Qi;(function(l){function g(d,u,b){var w={diagnostics:d};return u!=null&&(w.only=u),b!=null&&(w.triggerKind=b),w}l.create=g;function v(d){var u=d;return x.defined(u)&&x.typedArray(u.diagnostics,h.is)&&(u.only===void 0||x.typedArray(u.only,x.string))&&(u.triggerKind===void 0||u.triggerKind===$r.Invoked||u.triggerKind===$r.Automatic)}l.is=v})(Qi=e.CodeActionContext||(e.CodeActionContext={}));var _i;(function(l){function g(d,u,b){var w={title:d},W=!0;return typeof u=="string"?(W=!1,w.kind=u):C.is(u)?w.command=u:w.edit=u,W&&b!==void 0&&(w.kind=b),w}l.create=g;function v(d){var u=d;return u&&x.string(u.title)&&(u.diagnostics===void 0||x.typedArray(u.diagnostics,h.is))&&(u.kind===void 0||x.string(u.kind))&&(u.edit!==void 0||u.command!==void 0)&&(u.command===void 0||C.is(u.command))&&(u.isPreferred===void 0||x.boolean(u.isPreferred))&&(u.edit===void 0||K.is(u.edit))}l.is=v})(_i=e.CodeAction||(e.CodeAction={}));var Si;(function(l){function g(d,u){var b={range:d};return x.defined(u)&&(b.data=u),b}l.create=g;function v(d){var u=d;return x.defined(u)&&a.is(u.range)&&(x.undefined(u.command)||C.is(u.command))}l.is=v})(Si=e.CodeLens||(e.CodeLens={}));var yn;(function(l){function g(d,u){return{tabSize:d,insertSpaces:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&x.uinteger(u.tabSize)&&x.boolean(u.insertSpaces)}l.is=v})(yn=e.FormattingOptions||(e.FormattingOptions={}));var D;(function(l){function g(d,u,b){return{range:d,target:u,data:b}}l.create=g;function v(d){var u=d;return x.defined(u)&&a.is(u.range)&&(x.undefined(u.target)||x.string(u.target))}l.is=v})(D=e.DocumentLink||(e.DocumentLink={}));var R;(function(l){function g(d,u){return{range:d,parent:u}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&a.is(u.range)&&(u.parent===void 0||l.is(u.parent))}l.is=v})(R=e.SelectionRange||(e.SelectionRange={}));var E;(function(l){l.namespace="namespace",l.type="type",l.class="class",l.enum="enum",l.interface="interface",l.struct="struct",l.typeParameter="typeParameter",l.parameter="parameter",l.variable="variable",l.property="property",l.enumMember="enumMember",l.event="event",l.function="function",l.method="method",l.macro="macro",l.keyword="keyword",l.modifier="modifier",l.comment="comment",l.string="string",l.number="number",l.regexp="regexp",l.operator="operator",l.decorator="decorator"})(E=e.SemanticTokenTypes||(e.SemanticTokenTypes={}));var L;(function(l){l.declaration="declaration",l.definition="definition",l.readonly="readonly",l.static="static",l.deprecated="deprecated",l.abstract="abstract",l.async="async",l.modification="modification",l.documentation="documentation",l.defaultLibrary="defaultLibrary"})(L=e.SemanticTokenModifiers||(e.SemanticTokenModifiers={}));var j;(function(l){function g(v){var d=v;return x.objectLiteral(d)&&(d.resultId===void 0||typeof d.resultId=="string")&&Array.isArray(d.data)&&(d.data.length===0||typeof d.data[0]=="number")}l.is=g})(j=e.SemanticTokens||(e.SemanticTokens={}));var ue;(function(l){function g(d,u){return{range:d,text:u}}l.create=g;function v(d){var u=d;return u!=null&&a.is(u.range)&&x.string(u.text)}l.is=v})(ue=e.InlineValueText||(e.InlineValueText={}));var le;(function(l){function g(d,u,b){return{range:d,variableName:u,caseSensitiveLookup:b}}l.create=g;function v(d){var u=d;return u!=null&&a.is(u.range)&&x.boolean(u.caseSensitiveLookup)&&(x.string(u.variableName)||u.variableName===void 0)}l.is=v})(le=e.InlineValueVariableLookup||(e.InlineValueVariableLookup={}));var Te;(function(l){function g(d,u){return{range:d,expression:u}}l.create=g;function v(d){var u=d;return u!=null&&a.is(u.range)&&(x.string(u.expression)||u.expression===void 0)}l.is=v})(Te=e.InlineValueEvaluatableExpression||(e.InlineValueEvaluatableExpression={}));var oe;(function(l){function g(d,u){return{frameId:d,stoppedLocation:u}}l.create=g;function v(d){var u=d;return x.defined(u)&&a.is(d.stoppedLocation)}l.is=v})(oe=e.InlineValueContext||(e.InlineValueContext={}));var te;(function(l){l.Type=1,l.Parameter=2;function g(v){return v===1||v===2}l.is=g})(te=e.InlayHintKind||(e.InlayHintKind={}));var ne;(function(l){function g(d){return{value:d}}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&(u.tooltip===void 0||x.string(u.tooltip)||Lr.is(u.tooltip))&&(u.location===void 0||c.is(u.location))&&(u.command===void 0||C.is(u.command))}l.is=v})(ne=e.InlayHintLabelPart||(e.InlayHintLabelPart={}));var de;(function(l){function g(d,u,b){var w={position:d,label:u};return b!==void 0&&(w.kind=b),w}l.create=g;function v(d){var u=d;return x.objectLiteral(u)&&s.is(u.position)&&(x.string(u.label)||x.typedArray(u.label,ne.is))&&(u.kind===void 0||te.is(u.kind))&&u.textEdits===void 0||x.typedArray(u.textEdits,M.is)&&(u.tooltip===void 0||x.string(u.tooltip)||Lr.is(u.tooltip))&&(u.paddingLeft===void 0||x.boolean(u.paddingLeft))&&(u.paddingRight===void 0||x.boolean(u.paddingRight))}l.is=v})(de=e.InlayHint||(e.InlayHint={}));var Ae;(function(l){function g(v){var d=v;return x.objectLiteral(d)&&n.is(d.uri)&&x.string(d.name)}l.is=g})(Ae=e.WorkspaceFolder||(e.WorkspaceFolder={})),e.EOL=[`
63
+ `)),k){let U=y.error?` Request failed: ${y.error.message} (${y.error.code}).`:"";$.log(`Received response '${k.method} - (${y.id})' in ${Date.now()-k.timerStart}ms.${U}`,L)}else $.log(`Received response ${y.id} without active response promise.`,L)}else Qr("receive-response",y)}function Qr(y,k){if(!$||d===Ue.Off)return;let L={isLSPMessage:!0,type:y,message:k,timestamp:Date.now()};$.log(L)}function Hi(){if(ft())throw new Wc(Ml.Closed,"Connection is closed.");if(be())throw new Wc(Ml.Disposed,"Connection is disposed.")}function cu(){if(St())throw new Wc(Ml.AlreadyListening,"Connection is already listening")}function Gi(){if(!St())throw new Error("Call listen() first.")}function wn(y){return y===void 0?null:y}function gs(y){if(y!==null)return y}function So(y){return y!=null&&!Array.isArray(y)&&typeof y=="object"}function ko(y,k){switch(y){case me.ParameterStructures.auto:return So(k)?gs(k):[wn(k)];case me.ParameterStructures.byName:if(!So(k))throw new Error("Received parameters by name but param is not an object literal.");return gs(k);case me.ParameterStructures.byPosition:return[wn(k)];default:throw new Error(`Unknown parameter structure ${y.toString()}`)}}function Kn(y,k){let L,U=y.numberOfParams;switch(U){case 0:L=void 0;break;case 1:L=ko(y.parameterStructures,k[0]);break;default:L=[];for(let se=0;se<k.length&&se<U;se++)L.push(wn(k[se]));if(k.length<U)for(let se=k.length;se<U;se++)L.push(null);break}return L}let b={sendNotification:(y,...k)=>{Hi();let L,U;if(Dt.string(y)){L=y;let ae=k[0],ye=0,ne=me.ParameterStructures.auto;me.ParameterStructures.is(ae)&&(ye=1,ne=ae);let te=k.length,ie=te-ye;switch(ie){case 0:U=void 0;break;case 1:U=ko(ne,k[ye]);break;default:if(ne===me.ParameterStructures.byName)throw new Error(`Received ${ie} parameters for 'by Name' notification parameter structure.`);U=k.slice(ye,te).map(ue=>wn(ue));break}}else{let ae=k;L=y.method,U=Kn(y,ae)}let se={jsonrpc:c,method:L,params:U};return Pr(se),e.write(se).catch(ae=>{throw i.error("Sending notification failed."),ae})},onNotification:(y,k)=>{Hi();let L;return Dt.func(y)?f=y:k&&(Dt.string(y)?(L=y,g.set(y,{type:void 0,handler:k})):(L=y.method,g.set(y.method,{type:y,handler:k}))),{dispose:()=>{L!==void 0?g.delete(L):f=void 0}}},onProgress:(y,k,L)=>{if(T.has(k))throw new Error(`Progress handler for token ${k} already registered`);return T.set(k,L),{dispose:()=>{T.delete(k)}}},sendProgress:(y,k,L)=>b.sendNotification(Ll.type,{token:k,value:L}),onUnhandledProgress:_t.event,sendRequest:(y,...k)=>{Hi(),Gi();let L,U,se;if(Dt.string(y)){L=y;let te=k[0],ie=k[k.length-1],ue=0,Ee=me.ParameterStructures.auto;me.ParameterStructures.is(te)&&(ue=1,Ee=te);let dt=k.length;OR.CancellationToken.is(ie)&&(dt=dt-1,se=ie);let jt=dt-ue;switch(jt){case 0:U=void 0;break;case 1:U=ko(Ee,k[ue]);break;default:if(Ee===me.ParameterStructures.byName)throw new Error(`Received ${jt} parameters for 'by Name' request parameter structure.`);U=k.slice(ue,dt).map(D=>wn(D));break}}else{let te=k;L=y.method,U=Kn(y,te);let ie=y.numberOfParams;se=OR.CancellationToken.is(te[ie])?te[ie]:void 0}let ae=o++,ye;se&&(ye=se.onCancellationRequested(()=>{let te=A.sender.sendCancellation(b,ae);return te===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${ae}`),Promise.resolve()):te.catch(()=>{i.log(`Sending cancellation messages for id ${ae} failed`)})}));let ne={jsonrpc:c,id:ae,method:L,params:U};return Wr(ne),typeof A.sender.enableCancellation=="function"&&A.sender.enableCancellation(ne),new Promise(async(te,ie)=>{let ue=jt=>{te(jt),A.sender.cleanup(ae),ye?.dispose()},Ee=jt=>{ie(jt),A.sender.cleanup(ae),ye?.dispose()},dt={method:L,timerStart:Date.now(),resolve:ue,reject:Ee};try{await e.write(ne),O.set(ae,dt)}catch(jt){throw i.error("Sending request failed."),dt.reject(new me.ResponseError(me.ErrorCodes.MessageWriteError,jt.message?jt.message:"Unknown reason")),jt}})},onRequest:(y,k)=>{Hi();let L=null;return $R.is(y)?(L=void 0,u=y):Dt.string(y)?(L=null,k!==void 0&&(L=y,l.set(y,{handler:k,type:void 0}))):k!==void 0&&(L=y.method,l.set(y.method,{type:y,handler:k})),{dispose:()=>{L!==null&&(L!==void 0?l.delete(L):u=void 0)}}},hasPendingResponse:()=>O.size>0,trace:async(y,k,L)=>{let U=!1,se=bn.Text;L!==void 0&&(Dt.boolean(L)?U=L:(U=L.sendNotification||!1,se=L.traceFormat||bn.Text)),d=y,_=se,d===Ue.Off?$=void 0:$=k,U&&!ft()&&!be()&&await b.sendNotification(FR.type,{value:Ue.toString(y)})},onError:ke.event,onClose:Me.event,onUnhandledNotification:Bt.event,onDispose:G.event,end:()=>{e.end()},dispose:()=>{if(be())return;X=di.Disposed,G.fire(void 0);let y=new me.ResponseError(me.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let k of O.values())k.reject(y);O=new Map,m=new Map,E=new Set,P=new pN.LinkedMap,Dt.func(e.dispose)&&e.dispose(),Dt.func(t.dispose)&&t.dispose()},listen:()=>{Hi(),cu(),X=di.Listening,t.listen(Nt)},inspect:()=>{(0,dN.default)().console.log("inspect")}};return b.onNotification(Qm.type,y=>{if(d===Ue.Off||!$)return;let k=d===Ue.Verbose||d===Ue.Compact;$.log(y.message,k?y.verbose:void 0)}),b.onNotification(Ll.type,y=>{let k=T.get(y.token);k?k(y.value):_t.fire(y)}),b}Re.createMessageConnection=r4});var ih=M(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.ProgressType=F.ProgressToken=F.createMessageConnection=F.NullLogger=F.ConnectionOptions=F.ConnectionStrategy=F.AbstractMessageBuffer=F.WriteableStreamMessageWriter=F.AbstractMessageWriter=F.MessageWriter=F.ReadableStreamMessageReader=F.AbstractMessageReader=F.MessageReader=F.SharedArrayReceiverStrategy=F.SharedArraySenderStrategy=F.CancellationToken=F.CancellationTokenSource=F.Emitter=F.Event=F.Disposable=F.LRUCache=F.Touch=F.LinkedMap=F.ParameterStructures=F.NotificationType9=F.NotificationType8=F.NotificationType7=F.NotificationType6=F.NotificationType5=F.NotificationType4=F.NotificationType3=F.NotificationType2=F.NotificationType1=F.NotificationType0=F.NotificationType=F.ErrorCodes=F.ResponseError=F.RequestType9=F.RequestType8=F.RequestType7=F.RequestType6=F.RequestType5=F.RequestType4=F.RequestType3=F.RequestType2=F.RequestType1=F.RequestType0=F.RequestType=F.Message=F.RAL=void 0;F.MessageStrategy=F.CancellationStrategy=F.CancellationSenderStrategy=F.CancellationReceiverStrategy=F.ConnectionError=F.ConnectionErrors=F.LogTraceNotification=F.SetTraceNotification=F.TraceFormat=F.TraceValues=F.Trace=void 0;var lt=dR();Object.defineProperty(F,"Message",{enumerable:!0,get:function(){return lt.Message}});Object.defineProperty(F,"RequestType",{enumerable:!0,get:function(){return lt.RequestType}});Object.defineProperty(F,"RequestType0",{enumerable:!0,get:function(){return lt.RequestType0}});Object.defineProperty(F,"RequestType1",{enumerable:!0,get:function(){return lt.RequestType1}});Object.defineProperty(F,"RequestType2",{enumerable:!0,get:function(){return lt.RequestType2}});Object.defineProperty(F,"RequestType3",{enumerable:!0,get:function(){return lt.RequestType3}});Object.defineProperty(F,"RequestType4",{enumerable:!0,get:function(){return lt.RequestType4}});Object.defineProperty(F,"RequestType5",{enumerable:!0,get:function(){return lt.RequestType5}});Object.defineProperty(F,"RequestType6",{enumerable:!0,get:function(){return lt.RequestType6}});Object.defineProperty(F,"RequestType7",{enumerable:!0,get:function(){return lt.RequestType7}});Object.defineProperty(F,"RequestType8",{enumerable:!0,get:function(){return lt.RequestType8}});Object.defineProperty(F,"RequestType9",{enumerable:!0,get:function(){return lt.RequestType9}});Object.defineProperty(F,"ResponseError",{enumerable:!0,get:function(){return lt.ResponseError}});Object.defineProperty(F,"ErrorCodes",{enumerable:!0,get:function(){return lt.ErrorCodes}});Object.defineProperty(F,"NotificationType",{enumerable:!0,get:function(){return lt.NotificationType}});Object.defineProperty(F,"NotificationType0",{enumerable:!0,get:function(){return lt.NotificationType0}});Object.defineProperty(F,"NotificationType1",{enumerable:!0,get:function(){return lt.NotificationType1}});Object.defineProperty(F,"NotificationType2",{enumerable:!0,get:function(){return lt.NotificationType2}});Object.defineProperty(F,"NotificationType3",{enumerable:!0,get:function(){return lt.NotificationType3}});Object.defineProperty(F,"NotificationType4",{enumerable:!0,get:function(){return lt.NotificationType4}});Object.defineProperty(F,"NotificationType5",{enumerable:!0,get:function(){return lt.NotificationType5}});Object.defineProperty(F,"NotificationType6",{enumerable:!0,get:function(){return lt.NotificationType6}});Object.defineProperty(F,"NotificationType7",{enumerable:!0,get:function(){return lt.NotificationType7}});Object.defineProperty(F,"NotificationType8",{enumerable:!0,get:function(){return lt.NotificationType8}});Object.defineProperty(F,"NotificationType9",{enumerable:!0,get:function(){return lt.NotificationType9}});Object.defineProperty(F,"ParameterStructures",{enumerable:!0,get:function(){return lt.ParameterStructures}});var UR=mR();Object.defineProperty(F,"LinkedMap",{enumerable:!0,get:function(){return UR.LinkedMap}});Object.defineProperty(F,"LRUCache",{enumerable:!0,get:function(){return UR.LRUCache}});Object.defineProperty(F,"Touch",{enumerable:!0,get:function(){return UR.Touch}});var n4=tN();Object.defineProperty(F,"Disposable",{enumerable:!0,get:function(){return n4.Disposable}});var yN=Fc();Object.defineProperty(F,"Event",{enumerable:!0,get:function(){return yN.Event}});Object.defineProperty(F,"Emitter",{enumerable:!0,get:function(){return yN.Emitter}});var vN=zm();Object.defineProperty(F,"CancellationTokenSource",{enumerable:!0,get:function(){return vN.CancellationTokenSource}});Object.defineProperty(F,"CancellationToken",{enumerable:!0,get:function(){return vN.CancellationToken}});var TN=nN();Object.defineProperty(F,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return TN.SharedArraySenderStrategy}});Object.defineProperty(F,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return TN.SharedArrayReceiverStrategy}});var WR=oN();Object.defineProperty(F,"MessageReader",{enumerable:!0,get:function(){return WR.MessageReader}});Object.defineProperty(F,"AbstractMessageReader",{enumerable:!0,get:function(){return WR.AbstractMessageReader}});Object.defineProperty(F,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return WR.ReadableStreamMessageReader}});var HR=lN();Object.defineProperty(F,"MessageWriter",{enumerable:!0,get:function(){return HR.MessageWriter}});Object.defineProperty(F,"AbstractMessageWriter",{enumerable:!0,get:function(){return HR.AbstractMessageWriter}});Object.defineProperty(F,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return HR.WriteableStreamMessageWriter}});var i4=fN();Object.defineProperty(F,"AbstractMessageBuffer",{enumerable:!0,get:function(){return i4.AbstractMessageBuffer}});var wr=gN();Object.defineProperty(F,"ConnectionStrategy",{enumerable:!0,get:function(){return wr.ConnectionStrategy}});Object.defineProperty(F,"ConnectionOptions",{enumerable:!0,get:function(){return wr.ConnectionOptions}});Object.defineProperty(F,"NullLogger",{enumerable:!0,get:function(){return wr.NullLogger}});Object.defineProperty(F,"createMessageConnection",{enumerable:!0,get:function(){return wr.createMessageConnection}});Object.defineProperty(F,"ProgressToken",{enumerable:!0,get:function(){return wr.ProgressToken}});Object.defineProperty(F,"ProgressType",{enumerable:!0,get:function(){return wr.ProgressType}});Object.defineProperty(F,"Trace",{enumerable:!0,get:function(){return wr.Trace}});Object.defineProperty(F,"TraceValues",{enumerable:!0,get:function(){return wr.TraceValues}});Object.defineProperty(F,"TraceFormat",{enumerable:!0,get:function(){return wr.TraceFormat}});Object.defineProperty(F,"SetTraceNotification",{enumerable:!0,get:function(){return wr.SetTraceNotification}});Object.defineProperty(F,"LogTraceNotification",{enumerable:!0,get:function(){return wr.LogTraceNotification}});Object.defineProperty(F,"ConnectionErrors",{enumerable:!0,get:function(){return wr.ConnectionErrors}});Object.defineProperty(F,"ConnectionError",{enumerable:!0,get:function(){return wr.ConnectionError}});Object.defineProperty(F,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return wr.CancellationReceiverStrategy}});Object.defineProperty(F,"CancellationSenderStrategy",{enumerable:!0,get:function(){return wr.CancellationSenderStrategy}});Object.defineProperty(F,"CancellationStrategy",{enumerable:!0,get:function(){return wr.CancellationStrategy}});Object.defineProperty(F,"MessageStrategy",{enumerable:!0,get:function(){return wr.MessageStrategy}});var o4=rs();F.RAL=o4.default});var xN=M(zR=>{"use strict";Object.defineProperty(zR,"__esModule",{value:!0});var $i=ih(),oh=class t extends $i.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}};oh.emptyBuffer=new Uint8Array(0);var GR=class{constructor(e){this.socket=e,this._onData=new $i.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,$i.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),$i.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),$i.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),$i.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}},BR=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),$i.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),$i.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),$i.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},s4=new TextEncoder,RN=Object.freeze({messageBuffer:Object.freeze({create:t=>new oh(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(s4.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new GR(t),asWritableStream:t=>new BR(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function KR(){return RN}(function(t){function e(){$i.RAL.install(RN)}t.install=e})(KR||(KR={}));zR.default=KR});var Ys=M(_n=>{"use strict";var a4=_n&&_n.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),c4=_n&&_n.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a4(e,t,r)};Object.defineProperty(_n,"__esModule",{value:!0});_n.createMessageConnection=_n.BrowserMessageWriter=_n.BrowserMessageReader=void 0;var u4=xN();u4.default.install();var Hc=ih();c4(ih(),_n);var VR=class extends Hc.AbstractMessageReader{constructor(e){super(),this._onData=new Hc.Emitter,this._messageListener=r=>{this._onData.fire(r.data)},e.addEventListener("error",r=>this.fireError(r)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}};_n.BrowserMessageReader=VR;var XR=class extends Hc.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};_n.BrowserMessageWriter=XR;function l4(t,e,r,n){return r===void 0&&(r=Hc.NullLogger),Hc.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Hc.createMessageConnection)(t,e,r,n)}_n.createMessageConnection=l4});var YR=M((nRe,bN)=>{"use strict";bN.exports=Ys()});var mh={};Mb(mh,{AnnotatedTextEdit:()=>xo,ChangeAnnotation:()=>Js,ChangeAnnotationIdentifier:()=>Cr,CodeAction:()=>Dx,CodeActionContext:()=>Ax,CodeActionKind:()=>Px,CodeActionTriggerKind:()=>Gl,CodeDescription:()=>sx,CodeLens:()=>Nx,Color:()=>ah,ColorInformation:()=>ex,ColorPresentation:()=>tx,Command:()=>Qs,CompletionItem:()=>yx,CompletionItemKind:()=>fx,CompletionItemLabelDetails:()=>gx,CompletionItemTag:()=>px,CompletionList:()=>vx,CreateFile:()=>Bc,DeleteFile:()=>zc,Diagnostic:()=>jl,DiagnosticRelatedInformation:()=>ch,DiagnosticSeverity:()=>ix,DiagnosticTag:()=>ox,DocumentHighlight:()=>_x,DocumentHighlightKind:()=>bx,DocumentLink:()=>Ox,DocumentSymbol:()=>Ex,DocumentUri:()=>JR,EOL:()=>f4,FoldingRange:()=>nx,FoldingRangeKind:()=>rx,FormattingOptions:()=>Ix,Hover:()=>Tx,InlayHint:()=>Hx,InlayHintKind:()=>dh,InlayHintLabelPart:()=>ph,InlineCompletionContext:()=>Xx,InlineCompletionItem:()=>Bx,InlineCompletionList:()=>Kx,InlineCompletionTriggerKind:()=>zx,InlineValueContext:()=>Wx,InlineValueEvaluatableExpression:()=>Ux,InlineValueText:()=>qx,InlineValueVariableLookup:()=>jx,InsertReplaceEdit:()=>mx,InsertTextFormat:()=>dx,InsertTextMode:()=>hx,Location:()=>ql,LocationLink:()=>ZR,MarkedString:()=>Hl,MarkupContent:()=>Vc,MarkupKind:()=>fh,OptionalVersionedTextDocumentIdentifier:()=>Wl,ParameterInformation:()=>Rx,Position:()=>qn,Range:()=>$t,RenameFile:()=>Kc,SelectedCompletionInfo:()=>Vx,SelectionRange:()=>Lx,SemanticTokenModifiers:()=>$x,SemanticTokenTypes:()=>Mx,SemanticTokens:()=>Fx,SignatureInformation:()=>xx,StringValue:()=>Gx,SymbolInformation:()=>wx,SymbolKind:()=>Sx,SymbolTag:()=>kx,TextDocument:()=>Jx,TextDocumentEdit:()=>Ul,TextDocumentIdentifier:()=>cx,TextDocumentItem:()=>lx,TextEdit:()=>Fi,URI:()=>sh,VersionedTextDocumentIdentifier:()=>ux,WorkspaceChange:()=>ax,WorkspaceEdit:()=>uh,WorkspaceFolder:()=>Yx,WorkspaceSymbol:()=>Cx,integer:()=>QR,uinteger:()=>Fl});var JR,sh,QR,Fl,qn,$t,ql,ZR,ah,ex,tx,rx,nx,ch,ix,ox,sx,jl,Qs,Fi,Js,Cr,xo,Ul,Bc,Kc,zc,uh,Gc,lh,ax,cx,ux,Wl,lx,fh,Vc,fx,dx,px,mx,hx,gx,yx,vx,Hl,Tx,Rx,xx,bx,_x,Sx,kx,wx,Cx,Ex,Px,Gl,Ax,Dx,Nx,Ix,Ox,Lx,Mx,$x,Fx,qx,jx,Ux,Wx,dh,ph,Hx,Gx,Bx,Kx,zx,Vx,Xx,Yx,f4,Jx,Qx,N,hh=kL(()=>{"use strict";(function(t){function e(r){return typeof r=="string"}t.is=e})(JR||(JR={}));(function(t){function e(r){return typeof r=="string"}t.is=e})(sh||(sh={}));(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(QR||(QR={}));(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Fl||(Fl={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Fl.MAX_VALUE),i===Number.MAX_VALUE&&(i=Fl.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&N.uinteger(i.line)&&N.uinteger(i.character)}t.is=r})(qn||(qn={}));(function(t){function e(n,i,o,s){if(N.uinteger(n)&&N.uinteger(i)&&N.uinteger(o)&&N.uinteger(s))return{start:qn.create(n,i),end:qn.create(o,s)};if(qn.is(n)&&qn.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${o}, ${s}]`)}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&qn.is(i.start)&&qn.is(i.end)}t.is=r})($t||($t={}));(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&$t.is(i.range)&&(N.string(i.uri)||N.undefined(i.uri))}t.is=r})(ql||(ql={}));(function(t){function e(n,i,o,s){return{targetUri:n,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&$t.is(i.targetRange)&&N.string(i.targetUri)&&$t.is(i.targetSelectionRange)&&($t.is(i.originSelectionRange)||N.undefined(i.originSelectionRange))}t.is=r})(ZR||(ZR={}));(function(t){function e(n,i,o,s){return{red:n,green:i,blue:o,alpha:s}}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&N.numberRange(i.red,0,1)&&N.numberRange(i.green,0,1)&&N.numberRange(i.blue,0,1)&&N.numberRange(i.alpha,0,1)}t.is=r})(ah||(ah={}));(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&$t.is(i.range)&&ah.is(i.color)}t.is=r})(ex||(ex={}));(function(t){function e(n,i,o){return{label:n,textEdit:i,additionalTextEdits:o}}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&N.string(i.label)&&(N.undefined(i.textEdit)||Fi.is(i))&&(N.undefined(i.additionalTextEdits)||N.typedArray(i.additionalTextEdits,Fi.is))}t.is=r})(tx||(tx={}));(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(rx||(rx={}));(function(t){function e(n,i,o,s,a,c){let u={startLine:n,endLine:i};return N.defined(o)&&(u.startCharacter=o),N.defined(s)&&(u.endCharacter=s),N.defined(a)&&(u.kind=a),N.defined(c)&&(u.collapsedText=c),u}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&N.uinteger(i.startLine)&&N.uinteger(i.startLine)&&(N.undefined(i.startCharacter)||N.uinteger(i.startCharacter))&&(N.undefined(i.endCharacter)||N.uinteger(i.endCharacter))&&(N.undefined(i.kind)||N.string(i.kind))}t.is=r})(nx||(nx={}));(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return N.defined(i)&&ql.is(i.location)&&N.string(i.message)}t.is=r})(ch||(ch={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(ix||(ix={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(ox||(ox={}));(function(t){function e(r){let n=r;return N.objectLiteral(n)&&N.string(n.href)}t.is=e})(sx||(sx={}));(function(t){function e(n,i,o,s,a,c){let u={range:n,message:i};return N.defined(o)&&(u.severity=o),N.defined(s)&&(u.code=s),N.defined(a)&&(u.source=a),N.defined(c)&&(u.relatedInformation=c),u}t.create=e;function r(n){var i;let o=n;return N.defined(o)&&$t.is(o.range)&&N.string(o.message)&&(N.number(o.severity)||N.undefined(o.severity))&&(N.integer(o.code)||N.string(o.code)||N.undefined(o.code))&&(N.undefined(o.codeDescription)||N.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(N.string(o.source)||N.undefined(o.source))&&(N.undefined(o.relatedInformation)||N.typedArray(o.relatedInformation,ch.is))}t.is=r})(jl||(jl={}));(function(t){function e(n,i,...o){let s={title:n,command:i};return N.defined(o)&&o.length>0&&(s.arguments=o),s}t.create=e;function r(n){let i=n;return N.defined(i)&&N.string(i.title)&&N.string(i.command)}t.is=r})(Qs||(Qs={}));(function(t){function e(o,s){return{range:o,newText:s}}t.replace=e;function r(o,s){return{range:{start:o,end:o},newText:s}}t.insert=r;function n(o){return{range:o,newText:""}}t.del=n;function i(o){let s=o;return N.objectLiteral(s)&&N.string(s.newText)&&$t.is(s.range)}t.is=i})(Fi||(Fi={}));(function(t){function e(n,i,o){let s={label:n};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&N.string(i.label)&&(N.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(N.string(i.description)||i.description===void 0)}t.is=r})(Js||(Js={}));(function(t){function e(r){let n=r;return N.string(n)}t.is=e})(Cr||(Cr={}));(function(t){function e(o,s,a){return{range:o,newText:s,annotationId:a}}t.replace=e;function r(o,s,a){return{range:{start:o,end:o},newText:s,annotationId:a}}t.insert=r;function n(o,s){return{range:o,newText:"",annotationId:s}}t.del=n;function i(o){let s=o;return Fi.is(s)&&(Js.is(s.annotationId)||Cr.is(s.annotationId))}t.is=i})(xo||(xo={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return N.defined(i)&&Wl.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Ul||(Ul={}));(function(t){function e(n,i,o){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&N.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||N.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||N.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Cr.is(i.annotationId))}t.is=r})(Bc||(Bc={}));(function(t){function e(n,i,o,s){let a={kind:"rename",oldUri:n,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),s!==void 0&&(a.annotationId=s),a}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&N.string(i.oldUri)&&N.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||N.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||N.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Cr.is(i.annotationId))}t.is=r})(Kc||(Kc={}));(function(t){function e(n,i,o){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&N.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||N.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||N.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Cr.is(i.annotationId))}t.is=r})(zc||(zc={}));(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>N.string(i.kind)?Bc.is(i)||Kc.is(i)||zc.is(i):Ul.is(i)))}t.is=e})(uh||(uh={}));Gc=class{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,o;if(n===void 0?i=Fi.insert(e,r):Cr.is(n)?(o=n,i=xo.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=xo.insert(e,r,o)),this.edits.push(i),o!==void 0)return o}replace(e,r,n){let i,o;if(n===void 0?i=Fi.replace(e,r):Cr.is(n)?(o=n,i=xo.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=xo.replace(e,r,o)),this.edits.push(i),o!==void 0)return o}delete(e,r){let n,i;if(r===void 0?n=Fi.del(e):Cr.is(r)?(i=r,n=xo.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=xo.del(e,i)),this.edits.push(n),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},lh=class{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,r){let n;if(Cr.is(e)?n=e:(n=this.nextId(),r=e),this._annotations[n]!==void 0)throw new Error(`Id ${n} is already in use.`);if(r===void 0)throw new Error(`No annotation provided for id ${n}`);return this._annotations[n]=r,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},ax=class{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new lh(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Ul.is(r)){let n=new Gc(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{let n=new Gc(e.changes[r]);this._textEditChanges[r]=n})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Wl.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r={uri:e.uri,version:e.version},n=this._textEditChanges[r.uri];if(!n){let i=[],o={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(o),n=new Gc(i,this._changeAnnotations),this._textEditChanges[r.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let r=this._textEditChanges[e];if(!r){let n=[];this._workspaceEdit.changes[e]=n,r=new Gc(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new lh,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Js.is(r)||Cr.is(r)?i=r:n=r;let o,s;if(i===void 0?o=Bc.create(e,n):(s=Cr.is(i)?i:this._changeAnnotations.manage(i),o=Bc.create(e,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}renameFile(e,r,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;Js.is(n)||Cr.is(n)?o=n:i=n;let s,a;if(o===void 0?s=Kc.create(e,r,i):(a=Cr.is(o)?o:this._changeAnnotations.manage(o),s=Kc.create(e,r,i,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}deleteFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Js.is(r)||Cr.is(r)?i=r:n=r;let o,s;if(i===void 0?o=zc.create(e,n):(s=Cr.is(i)?i:this._changeAnnotations.manage(i),o=zc.create(e,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}};(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return N.defined(i)&&N.string(i.uri)}t.is=r})(cx||(cx={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return N.defined(i)&&N.string(i.uri)&&N.integer(i.version)}t.is=r})(ux||(ux={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return N.defined(i)&&N.string(i.uri)&&(i.version===null||N.integer(i.version))}t.is=r})(Wl||(Wl={}));(function(t){function e(n,i,o,s){return{uri:n,languageId:i,version:o,text:s}}t.create=e;function r(n){let i=n;return N.defined(i)&&N.string(i.uri)&&N.string(i.languageId)&&N.integer(i.version)&&N.string(i.text)}t.is=r})(lx||(lx={}));(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(fh||(fh={}));(function(t){function e(r){let n=r;return N.objectLiteral(r)&&fh.is(n.kind)&&N.string(n.value)}t.is=e})(Vc||(Vc={}));(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(fx||(fx={}));(function(t){t.PlainText=1,t.Snippet=2})(dx||(dx={}));(function(t){t.Deprecated=1})(px||(px={}));(function(t){function e(n,i,o){return{newText:n,insert:i,replace:o}}t.create=e;function r(n){let i=n;return i&&N.string(i.newText)&&$t.is(i.insert)&&$t.is(i.replace)}t.is=r})(mx||(mx={}));(function(t){t.asIs=1,t.adjustIndentation=2})(hx||(hx={}));(function(t){function e(r){let n=r;return n&&(N.string(n.detail)||n.detail===void 0)&&(N.string(n.description)||n.description===void 0)}t.is=e})(gx||(gx={}));(function(t){function e(r){return{label:r}}t.create=e})(yx||(yx={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(vx||(vx={}));(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return N.string(i)||N.objectLiteral(i)&&N.string(i.language)&&N.string(i.value)}t.is=r})(Hl||(Hl={}));(function(t){function e(r){let n=r;return!!n&&N.objectLiteral(n)&&(Vc.is(n.contents)||Hl.is(n.contents)||N.typedArray(n.contents,Hl.is))&&(r.range===void 0||$t.is(r.range))}t.is=e})(Tx||(Tx={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Rx||(Rx={}));(function(t){function e(r,n,...i){let o={label:r};return N.defined(n)&&(o.documentation=n),N.defined(i)?o.parameters=i:o.parameters=[],o}t.create=e})(xx||(xx={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(bx||(bx={}));(function(t){function e(r,n){let i={range:r};return N.number(n)&&(i.kind=n),i}t.create=e})(_x||(_x={}));(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Sx||(Sx={}));(function(t){t.Deprecated=1})(kx||(kx={}));(function(t){function e(r,n,i,o,s){let a={name:r,kind:n,location:{uri:o,range:i}};return s&&(a.containerName=s),a}t.create=e})(wx||(wx={}));(function(t){function e(r,n,i,o){return o!==void 0?{name:r,kind:n,location:{uri:i,range:o}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(Cx||(Cx={}));(function(t){function e(n,i,o,s,a,c){let u={name:n,detail:i,kind:o,range:s,selectionRange:a};return c!==void 0&&(u.children=c),u}t.create=e;function r(n){let i=n;return i&&N.string(i.name)&&N.number(i.kind)&&$t.is(i.range)&&$t.is(i.selectionRange)&&(i.detail===void 0||N.string(i.detail))&&(i.deprecated===void 0||N.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Ex||(Ex={}));(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Px||(Px={}));(function(t){t.Invoked=1,t.Automatic=2})(Gl||(Gl={}));(function(t){function e(n,i,o){let s={diagnostics:n};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}t.create=e;function r(n){let i=n;return N.defined(i)&&N.typedArray(i.diagnostics,jl.is)&&(i.only===void 0||N.typedArray(i.only,N.string))&&(i.triggerKind===void 0||i.triggerKind===Gl.Invoked||i.triggerKind===Gl.Automatic)}t.is=r})(Ax||(Ax={}));(function(t){function e(n,i,o){let s={title:n},a=!0;return typeof i=="string"?(a=!1,s.kind=i):Qs.is(i)?s.command=i:s.edit=i,a&&o!==void 0&&(s.kind=o),s}t.create=e;function r(n){let i=n;return i&&N.string(i.title)&&(i.diagnostics===void 0||N.typedArray(i.diagnostics,jl.is))&&(i.kind===void 0||N.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Qs.is(i.command))&&(i.isPreferred===void 0||N.boolean(i.isPreferred))&&(i.edit===void 0||uh.is(i.edit))}t.is=r})(Dx||(Dx={}));(function(t){function e(n,i){let o={range:n};return N.defined(i)&&(o.data=i),o}t.create=e;function r(n){let i=n;return N.defined(i)&&$t.is(i.range)&&(N.undefined(i.command)||Qs.is(i.command))}t.is=r})(Nx||(Nx={}));(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return N.defined(i)&&N.uinteger(i.tabSize)&&N.boolean(i.insertSpaces)}t.is=r})(Ix||(Ix={}));(function(t){function e(n,i,o){return{range:n,target:i,data:o}}t.create=e;function r(n){let i=n;return N.defined(i)&&$t.is(i.range)&&(N.undefined(i.target)||N.string(i.target))}t.is=r})(Ox||(Ox={}));(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&$t.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Lx||(Lx={}));(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Mx||(Mx={}));(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})($x||($x={}));(function(t){function e(r){let n=r;return N.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(Fx||(Fx={}));(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&$t.is(i.range)&&N.string(i.text)}t.is=r})(qx||(qx={}));(function(t){function e(n,i,o){return{range:n,variableName:i,caseSensitiveLookup:o}}t.create=e;function r(n){let i=n;return i!=null&&$t.is(i.range)&&N.boolean(i.caseSensitiveLookup)&&(N.string(i.variableName)||i.variableName===void 0)}t.is=r})(jx||(jx={}));(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&$t.is(i.range)&&(N.string(i.expression)||i.expression===void 0)}t.is=r})(Ux||(Ux={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return N.defined(i)&&$t.is(n.stoppedLocation)}t.is=r})(Wx||(Wx={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(dh||(dh={}));(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&(i.tooltip===void 0||N.string(i.tooltip)||Vc.is(i.tooltip))&&(i.location===void 0||ql.is(i.location))&&(i.command===void 0||Qs.is(i.command))}t.is=r})(ph||(ph={}));(function(t){function e(n,i,o){let s={position:n,label:i};return o!==void 0&&(s.kind=o),s}t.create=e;function r(n){let i=n;return N.objectLiteral(i)&&qn.is(i.position)&&(N.string(i.label)||N.typedArray(i.label,ph.is))&&(i.kind===void 0||dh.is(i.kind))&&i.textEdits===void 0||N.typedArray(i.textEdits,Fi.is)&&(i.tooltip===void 0||N.string(i.tooltip)||Vc.is(i.tooltip))&&(i.paddingLeft===void 0||N.boolean(i.paddingLeft))&&(i.paddingRight===void 0||N.boolean(i.paddingRight))}t.is=r})(Hx||(Hx={}));(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Gx||(Gx={}));(function(t){function e(r,n,i,o){return{insertText:r,filterText:n,range:i,command:o}}t.create=e})(Bx||(Bx={}));(function(t){function e(r){return{items:r}}t.create=e})(Kx||(Kx={}));(function(t){t.Invoked=0,t.Automatic=1})(zx||(zx={}));(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Vx||(Vx={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Xx||(Xx={}));(function(t){function e(r){let n=r;return N.objectLiteral(n)&&sh.is(n.uri)&&N.string(n.name)}t.is=e})(Yx||(Yx={}));f4=[`
62
64
  `,`\r
63
- `,"\r"];var ot;(function(l){function g(b,w,W,Re){return new Dt(b,w,W,Re)}l.create=g;function v(b){var w=b;return!!(x.defined(w)&&x.string(w.uri)&&(x.undefined(w.languageId)||x.string(w.languageId))&&x.uinteger(w.lineCount)&&x.func(w.getText)&&x.func(w.positionAt)&&x.func(w.offsetAt))}l.is=v;function d(b,w){for(var W=b.getText(),Re=u(w,function(vn,Zi){var Xc=vn.range.start.line-Zi.range.start.line;return Xc===0?vn.range.start.character-Zi.range.start.character:Xc}),pe=W.length,Et=Re.length-1;Et>=0;Et--){var Pt=Re[Et],ar=b.offsetAt(Pt.range.start),J=b.offsetAt(Pt.range.end);if(J<=pe)W=W.substring(0,ar)+Pt.newText+W.substring(J,W.length);else throw new Error("Overlapping edit");pe=ar}return W}l.applyEdits=d;function u(b,w){if(b.length<=1)return b;var W=b.length/2|0,Re=b.slice(0,W),pe=b.slice(W);u(Re,w),u(pe,w);for(var Et=0,Pt=0,ar=0;Et<Re.length&&Pt<pe.length;){var J=w(Re[Et],pe[Pt]);J<=0?b[ar++]=Re[Et++]:b[ar++]=pe[Pt++]}for(;Et<Re.length;)b[ar++]=Re[Et++];for(;Pt<pe.length;)b[ar++]=pe[Pt++];return b}})(ot=e.TextDocument||(e.TextDocument={}));var Dt=function(){function l(g,v,d,u){this._uri=g,this._languageId=v,this._version=d,this._content=u,this._lineOffsets=void 0}return Object.defineProperty(l.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),l.prototype.getText=function(g){if(g){var v=this.offsetAt(g.start),d=this.offsetAt(g.end);return this._content.substring(v,d)}return this._content},l.prototype.update=function(g,v){this._content=g.text,this._version=v,this._lineOffsets=void 0},l.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var g=[],v=this._content,d=!0,u=0;u<v.length;u++){d&&(g.push(u),d=!1);var b=v.charAt(u);d=b==="\r"||b===`
64
- `,b==="\r"&&u+1<v.length&&v.charAt(u+1)===`
65
- `&&u++}d&&v.length>0&&g.push(v.length),this._lineOffsets=g}return this._lineOffsets},l.prototype.positionAt=function(g){g=Math.max(Math.min(g,this._content.length),0);var v=this.getLineOffsets(),d=0,u=v.length;if(u===0)return s.create(0,g);for(;d<u;){var b=Math.floor((d+u)/2);v[b]>g?u=b:d=b+1}var w=d-1;return s.create(w,g-v[w])},l.prototype.offsetAt=function(g){var v=this.getLineOffsets();if(g.line>=v.length)return this._content.length;if(g.line<0)return 0;var d=v[g.line],u=g.line+1<v.length?v[g.line+1]:this._content.length;return Math.max(Math.min(d+g.character,u),d)},Object.defineProperty(l.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),l}(),x;(function(l){var g=Object.prototype.toString;function v(J){return typeof J<"u"}l.defined=v;function d(J){return typeof J>"u"}l.undefined=d;function u(J){return J===!0||J===!1}l.boolean=u;function b(J){return g.call(J)==="[object String]"}l.string=b;function w(J){return g.call(J)==="[object Number]"}l.number=w;function W(J,vn,Zi){return g.call(J)==="[object Number]"&&vn<=J&&J<=Zi}l.numberRange=W;function Re(J){return g.call(J)==="[object Number]"&&-2147483648<=J&&J<=2147483647}l.integer=Re;function pe(J){return g.call(J)==="[object Number]"&&0<=J&&J<=2147483647}l.uinteger=pe;function Et(J){return g.call(J)==="[object Function]"}l.func=Et;function Pt(J){return J!==null&&typeof J=="object"}l.objectLiteral=Pt;function ar(J,vn){return Array.isArray(J)&&J.every(vn)}l.typedArray=ar})(x||(x={}))})});var qt=$(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.ProtocolNotificationType=nn.ProtocolNotificationType0=nn.ProtocolRequestType=nn.ProtocolRequestType0=nn.RegistrationType=nn.MessageDirection=void 0;var Uc=Qs(),pz;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(pz=nn.MessageDirection||(nn.MessageDirection={}));var mR=class{constructor(e){this.method=e}};nn.RegistrationType=mR;var hR=class extends Uc.RequestType0{constructor(e){super(e)}};nn.ProtocolRequestType0=hR;var gR=class extends Uc.RequestType{constructor(e){super(e,Uc.ParameterStructures.byName)}};nn.ProtocolRequestType=gR;var yR=class extends Uc.NotificationType0{constructor(e){super(e)}};nn.ProtocolNotificationType0=yR;var vR=class extends Uc.NotificationType{constructor(e){super(e,Uc.ParameterStructures.byName)}};nn.ProtocolNotificationType=vR});var Wm=$(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.objectLiteral=nr.typedArray=nr.stringArray=nr.array=nr.func=nr.error=nr.number=nr.string=nr.boolean=void 0;function mz(t){return t===!0||t===!1}nr.boolean=mz;function DP(t){return typeof t=="string"||t instanceof String}nr.string=DP;function hz(t){return typeof t=="number"||t instanceof Number}nr.number=hz;function gz(t){return t instanceof Error}nr.error=gz;function yz(t){return typeof t=="function"}nr.func=yz;function EP(t){return Array.isArray(t)}nr.array=EP;function vz(t){return EP(t)&&t.every(e=>DP(e))}nr.stringArray=vz;function Tz(t,e){return Array.isArray(t)&&t.every(e)}nr.typedArray=Tz;function Rz(t){return t!==null&&typeof t=="object"}nr.objectLiteral=Rz});var AP=$(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.ImplementationRequest=void 0;var PP=qt(),xz;(function(t){t.method="textDocument/implementation",t.messageDirection=PP.MessageDirection.clientToServer,t.type=new PP.ProtocolRequestType(t.method)})(xz=kl.ImplementationRequest||(kl.ImplementationRequest={}))});var IP=$(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.TypeDefinitionRequest=void 0;var NP=qt(),bz;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=NP.MessageDirection.clientToServer,t.type=new NP.ProtocolRequestType(t.method)})(bz=Cl.TypeDefinitionRequest||(Cl.TypeDefinitionRequest={}))});var OP=$(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.DidChangeWorkspaceFoldersNotification=us.WorkspaceFoldersRequest=void 0;var Hm=qt(),_z;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Hm.MessageDirection.serverToClient,t.type=new Hm.ProtocolRequestType0(t.method)})(_z=us.WorkspaceFoldersRequest||(us.WorkspaceFoldersRequest={}));var Sz;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Hm.MessageDirection.clientToServer,t.type=new Hm.ProtocolNotificationType(t.method)})(Sz=us.DidChangeWorkspaceFoldersNotification||(us.DidChangeWorkspaceFoldersNotification={}))});var MP=$(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.ConfigurationRequest=void 0;var LP=qt(),kz;(function(t){t.method="workspace/configuration",t.messageDirection=LP.MessageDirection.serverToClient,t.type=new LP.ProtocolRequestType(t.method)})(kz=wl.ConfigurationRequest||(wl.ConfigurationRequest={}))});var $P=$(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.ColorPresentationRequest=ls.DocumentColorRequest=void 0;var Gm=qt(),Cz;(function(t){t.method="textDocument/documentColor",t.messageDirection=Gm.MessageDirection.clientToServer,t.type=new Gm.ProtocolRequestType(t.method)})(Cz=ls.DocumentColorRequest||(ls.DocumentColorRequest={}));var wz;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Gm.MessageDirection.clientToServer,t.type=new Gm.ProtocolRequestType(t.method)})(wz=ls.ColorPresentationRequest||(ls.ColorPresentationRequest={}))});var FP=$(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.FoldingRangeRequest=void 0;var qP=qt(),Dz;(function(t){t.method="textDocument/foldingRange",t.messageDirection=qP.MessageDirection.clientToServer,t.type=new qP.ProtocolRequestType(t.method)})(Dz=Dl.FoldingRangeRequest||(Dl.FoldingRangeRequest={}))});var UP=$(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.DeclarationRequest=void 0;var jP=qt(),Ez;(function(t){t.method="textDocument/declaration",t.messageDirection=jP.MessageDirection.clientToServer,t.type=new jP.ProtocolRequestType(t.method)})(Ez=El.DeclarationRequest||(El.DeclarationRequest={}))});var HP=$(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.SelectionRangeRequest=void 0;var WP=qt(),Pz;(function(t){t.method="textDocument/selectionRange",t.messageDirection=WP.MessageDirection.clientToServer,t.type=new WP.ProtocolRequestType(t.method)})(Pz=Pl.SelectionRangeRequest||(Pl.SelectionRangeRequest={}))});var GP=$(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.WorkDoneProgressCancelNotification=gi.WorkDoneProgressCreateRequest=gi.WorkDoneProgress=void 0;var Az=Qs(),Bm=qt(),Nz;(function(t){t.type=new Az.ProgressType;function e(r){return r===t.type}t.is=e})(Nz=gi.WorkDoneProgress||(gi.WorkDoneProgress={}));var Iz;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Bm.MessageDirection.serverToClient,t.type=new Bm.ProtocolRequestType(t.method)})(Iz=gi.WorkDoneProgressCreateRequest||(gi.WorkDoneProgressCreateRequest={}));var Oz;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Bm.MessageDirection.clientToServer,t.type=new Bm.ProtocolNotificationType(t.method)})(Oz=gi.WorkDoneProgressCancelNotification||(gi.WorkDoneProgressCancelNotification={}))});var BP=$(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.CallHierarchyOutgoingCallsRequest=yi.CallHierarchyIncomingCallsRequest=yi.CallHierarchyPrepareRequest=void 0;var Wc=qt(),Lz;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Wc.MessageDirection.clientToServer,t.type=new Wc.ProtocolRequestType(t.method)})(Lz=yi.CallHierarchyPrepareRequest||(yi.CallHierarchyPrepareRequest={}));var Mz;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Wc.MessageDirection.clientToServer,t.type=new Wc.ProtocolRequestType(t.method)})(Mz=yi.CallHierarchyIncomingCallsRequest||(yi.CallHierarchyIncomingCallsRequest={}));var $z;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Wc.MessageDirection.clientToServer,t.type=new Wc.ProtocolRequestType(t.method)})($z=yi.CallHierarchyOutgoingCallsRequest||(yi.CallHierarchyOutgoingCallsRequest={}))});var KP=$(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.SemanticTokensRefreshRequest=ir.SemanticTokensRangeRequest=ir.SemanticTokensDeltaRequest=ir.SemanticTokensRequest=ir.SemanticTokensRegistrationType=ir.TokenFormat=void 0;var No=qt(),qz;(function(t){t.Relative="relative"})(qz=ir.TokenFormat||(ir.TokenFormat={}));var Km;(function(t){t.method="textDocument/semanticTokens",t.type=new No.RegistrationType(t.method)})(Km=ir.SemanticTokensRegistrationType||(ir.SemanticTokensRegistrationType={}));var Fz;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=No.MessageDirection.clientToServer,t.type=new No.ProtocolRequestType(t.method),t.registrationMethod=Km.method})(Fz=ir.SemanticTokensRequest||(ir.SemanticTokensRequest={}));var jz;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=No.MessageDirection.clientToServer,t.type=new No.ProtocolRequestType(t.method),t.registrationMethod=Km.method})(jz=ir.SemanticTokensDeltaRequest||(ir.SemanticTokensDeltaRequest={}));var Uz;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=No.MessageDirection.clientToServer,t.type=new No.ProtocolRequestType(t.method),t.registrationMethod=Km.method})(Uz=ir.SemanticTokensRangeRequest||(ir.SemanticTokensRangeRequest={}));var Wz;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=No.MessageDirection.serverToClient,t.type=new No.ProtocolRequestType0(t.method)})(Wz=ir.SemanticTokensRefreshRequest||(ir.SemanticTokensRefreshRequest={}))});var VP=$(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.ShowDocumentRequest=void 0;var zP=qt(),Hz;(function(t){t.method="window/showDocument",t.messageDirection=zP.MessageDirection.serverToClient,t.type=new zP.ProtocolRequestType(t.method)})(Hz=Al.ShowDocumentRequest||(Al.ShowDocumentRequest={}))});var YP=$(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.LinkedEditingRangeRequest=void 0;var XP=qt(),Gz;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=XP.MessageDirection.clientToServer,t.type=new XP.ProtocolRequestType(t.method)})(Gz=Nl.LinkedEditingRangeRequest||(Nl.LinkedEditingRangeRequest={}))});var JP=$(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.WillDeleteFilesRequest=Ft.DidDeleteFilesNotification=Ft.DidRenameFilesNotification=Ft.WillRenameFilesRequest=Ft.DidCreateFilesNotification=Ft.WillCreateFilesRequest=Ft.FileOperationPatternKind=void 0;var Bn=qt(),Bz;(function(t){t.file="file",t.folder="folder"})(Bz=Ft.FileOperationPatternKind||(Ft.FileOperationPatternKind={}));var Kz;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolRequestType(t.method)})(Kz=Ft.WillCreateFilesRequest||(Ft.WillCreateFilesRequest={}));var zz;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolNotificationType(t.method)})(zz=Ft.DidCreateFilesNotification||(Ft.DidCreateFilesNotification={}));var Vz;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolRequestType(t.method)})(Vz=Ft.WillRenameFilesRequest||(Ft.WillRenameFilesRequest={}));var Xz;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolNotificationType(t.method)})(Xz=Ft.DidRenameFilesNotification||(Ft.DidRenameFilesNotification={}));var Yz;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolNotificationType(t.method)})(Yz=Ft.DidDeleteFilesNotification||(Ft.DidDeleteFilesNotification={}));var Jz;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolRequestType(t.method)})(Jz=Ft.WillDeleteFilesRequest||(Ft.WillDeleteFilesRequest={}))});var ZP=$(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.MonikerRequest=vi.MonikerKind=vi.UniquenessLevel=void 0;var QP=qt(),Qz;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Qz=vi.UniquenessLevel||(vi.UniquenessLevel={}));var Zz;(function(t){t.$import="import",t.$export="export",t.local="local"})(Zz=vi.MonikerKind||(vi.MonikerKind={}));var e2;(function(t){t.method="textDocument/moniker",t.messageDirection=QP.MessageDirection.clientToServer,t.type=new QP.ProtocolRequestType(t.method)})(e2=vi.MonikerRequest||(vi.MonikerRequest={}))});var eA=$(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.TypeHierarchySubtypesRequest=Ti.TypeHierarchySupertypesRequest=Ti.TypeHierarchyPrepareRequest=void 0;var Hc=qt(),t2;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Hc.MessageDirection.clientToServer,t.type=new Hc.ProtocolRequestType(t.method)})(t2=Ti.TypeHierarchyPrepareRequest||(Ti.TypeHierarchyPrepareRequest={}));var r2;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Hc.MessageDirection.clientToServer,t.type=new Hc.ProtocolRequestType(t.method)})(r2=Ti.TypeHierarchySupertypesRequest||(Ti.TypeHierarchySupertypesRequest={}));var n2;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Hc.MessageDirection.clientToServer,t.type=new Hc.ProtocolRequestType(t.method)})(n2=Ti.TypeHierarchySubtypesRequest||(Ti.TypeHierarchySubtypesRequest={}))});var tA=$(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.InlineValueRefreshRequest=fs.InlineValueRequest=void 0;var zm=qt(),i2;(function(t){t.method="textDocument/inlineValue",t.messageDirection=zm.MessageDirection.clientToServer,t.type=new zm.ProtocolRequestType(t.method)})(i2=fs.InlineValueRequest||(fs.InlineValueRequest={}));var o2;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=zm.MessageDirection.serverToClient,t.type=new zm.ProtocolRequestType0(t.method)})(o2=fs.InlineValueRefreshRequest||(fs.InlineValueRefreshRequest={}))});var rA=$(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.InlayHintRefreshRequest=Ri.InlayHintResolveRequest=Ri.InlayHintRequest=void 0;var Gc=qt(),s2;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Gc.MessageDirection.clientToServer,t.type=new Gc.ProtocolRequestType(t.method)})(s2=Ri.InlayHintRequest||(Ri.InlayHintRequest={}));var a2;(function(t){t.method="inlayHint/resolve",t.messageDirection=Gc.MessageDirection.clientToServer,t.type=new Gc.ProtocolRequestType(t.method)})(a2=Ri.InlayHintResolveRequest||(Ri.InlayHintResolveRequest={}));var c2;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Gc.MessageDirection.serverToClient,t.type=new Gc.ProtocolRequestType0(t.method)})(c2=Ri.InlayHintRefreshRequest||(Ri.InlayHintRefreshRequest={}))});var iA=$(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.DiagnosticRefreshRequest=Nr.WorkspaceDiagnosticRequest=Nr.DocumentDiagnosticRequest=Nr.DocumentDiagnosticReportKind=Nr.DiagnosticServerCancellationData=void 0;var nA=Qs(),u2=Wm(),Bc=qt(),l2;(function(t){function e(r){let n=r;return n&&u2.boolean(n.retriggerRequest)}t.is=e})(l2=Nr.DiagnosticServerCancellationData||(Nr.DiagnosticServerCancellationData={}));var f2;(function(t){t.Full="full",t.Unchanged="unchanged"})(f2=Nr.DocumentDiagnosticReportKind||(Nr.DocumentDiagnosticReportKind={}));var d2;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Bc.MessageDirection.clientToServer,t.type=new Bc.ProtocolRequestType(t.method),t.partialResult=new nA.ProgressType})(d2=Nr.DocumentDiagnosticRequest||(Nr.DocumentDiagnosticRequest={}));var p2;(function(t){t.method="workspace/diagnostic",t.messageDirection=Bc.MessageDirection.clientToServer,t.type=new Bc.ProtocolRequestType(t.method),t.partialResult=new nA.ProgressType})(p2=Nr.WorkspaceDiagnosticRequest||(Nr.WorkspaceDiagnosticRequest={}));var m2;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Bc.MessageDirection.serverToClient,t.type=new Bc.ProtocolRequestType0(t.method)})(m2=Nr.DiagnosticRefreshRequest||(Nr.DiagnosticRefreshRequest={}))});var aA=$(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.DidCloseNotebookDocumentNotification=We.DidSaveNotebookDocumentNotification=We.DidChangeNotebookDocumentNotification=We.NotebookCellArrayChange=We.DidOpenNotebookDocumentNotification=We.NotebookDocumentSyncRegistrationType=We.NotebookDocument=We.NotebookCell=We.ExecutionSummary=We.NotebookCellKind=void 0;var Il=Um(),xi=Wm(),Ki=qt(),oA;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(oA=We.NotebookCellKind||(We.NotebookCellKind={}));var sA;(function(t){function e(i,o){let s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}t.create=e;function r(i){let o=i;return xi.objectLiteral(o)&&Il.uinteger.is(o.executionOrder)&&(o.success===void 0||xi.boolean(o.success))}t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=n})(sA=We.ExecutionSummary||(We.ExecutionSummary={}));var TR;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return xi.objectLiteral(s)&&oA.is(s.kind)&&Il.DocumentUri.is(s.document)&&(s.metadata===void 0||xi.objectLiteral(s.metadata))}t.is=r;function n(o,s){let a=new Set;return o.document!==s.document&&a.add("document"),o.kind!==s.kind&&a.add("kind"),o.executionSummary!==s.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!sA.equals(o.executionSummary,s.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!="object")return!1;let a=Array.isArray(o),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(o.length!==s.length)return!1;for(let f=0;f<o.length;f++)if(!i(o[f],s[f]))return!1}if(xi.objectLiteral(o)&&xi.objectLiteral(s)){let f=Object.keys(o),p=Object.keys(s);if(f.length!==p.length||(f.sort(),p.sort(),!i(f,p)))return!1;for(let m=0;m<f.length;m++){let T=f[m];if(!i(o[T],s[T]))return!1}}return!0}})(TR=We.NotebookCell||(We.NotebookCell={}));var h2;(function(t){function e(n,i,o,s){return{uri:n,notebookType:i,version:o,cells:s}}t.create=e;function r(n){let i=n;return xi.objectLiteral(i)&&xi.string(i.uri)&&Il.integer.is(i.version)&&xi.typedArray(i.cells,TR.is)}t.is=r})(h2=We.NotebookDocument||(We.NotebookDocument={}));var Ol;(function(t){t.method="notebookDocument/sync",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.RegistrationType(t.method)})(Ol=We.NotebookDocumentSyncRegistrationType||(We.NotebookDocumentSyncRegistrationType={}));var g2;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.ProtocolNotificationType(t.method),t.registrationMethod=Ol.method})(g2=We.DidOpenNotebookDocumentNotification||(We.DidOpenNotebookDocumentNotification={}));var y2;(function(t){function e(n){let i=n;return xi.objectLiteral(i)&&Il.uinteger.is(i.start)&&Il.uinteger.is(i.deleteCount)&&(i.cells===void 0||xi.typedArray(i.cells,TR.is))}t.is=e;function r(n,i,o){let s={start:n,deleteCount:i};return o!==void 0&&(s.cells=o),s}t.create=r})(y2=We.NotebookCellArrayChange||(We.NotebookCellArrayChange={}));var v2;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.ProtocolNotificationType(t.method),t.registrationMethod=Ol.method})(v2=We.DidChangeNotebookDocumentNotification||(We.DidChangeNotebookDocumentNotification={}));var T2;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.ProtocolNotificationType(t.method),t.registrationMethod=Ol.method})(T2=We.DidSaveNotebookDocumentNotification||(We.DidSaveNotebookDocumentNotification={}));var R2;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.ProtocolNotificationType(t.method),t.registrationMethod=Ol.method})(R2=We.DidCloseNotebookDocumentNotification||(We.DidCloseNotebookDocumentNotification={}))});var gA=$(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.WorkspaceSymbolRequest=S.CodeActionResolveRequest=S.CodeActionRequest=S.DocumentSymbolRequest=S.DocumentHighlightRequest=S.ReferencesRequest=S.DefinitionRequest=S.SignatureHelpRequest=S.SignatureHelpTriggerKind=S.HoverRequest=S.CompletionResolveRequest=S.CompletionRequest=S.CompletionTriggerKind=S.PublishDiagnosticsNotification=S.WatchKind=S.RelativePattern=S.FileChangeType=S.DidChangeWatchedFilesNotification=S.WillSaveTextDocumentWaitUntilRequest=S.WillSaveTextDocumentNotification=S.TextDocumentSaveReason=S.DidSaveTextDocumentNotification=S.DidCloseTextDocumentNotification=S.DidChangeTextDocumentNotification=S.TextDocumentContentChangeEvent=S.DidOpenTextDocumentNotification=S.TextDocumentSyncKind=S.TelemetryEventNotification=S.LogMessageNotification=S.ShowMessageRequest=S.ShowMessageNotification=S.MessageType=S.DidChangeConfigurationNotification=S.ExitNotification=S.ShutdownRequest=S.InitializedNotification=S.InitializeErrorCodes=S.InitializeRequest=S.WorkDoneProgressOptions=S.TextDocumentRegistrationOptions=S.StaticRegistrationOptions=S.PositionEncodingKind=S.FailureHandlingKind=S.ResourceOperationKind=S.UnregistrationRequest=S.RegistrationRequest=S.DocumentSelector=S.NotebookCellTextDocumentFilter=S.NotebookDocumentFilter=S.TextDocumentFilter=void 0;S.TypeHierarchySubtypesRequest=S.TypeHierarchyPrepareRequest=S.MonikerRequest=S.MonikerKind=S.UniquenessLevel=S.WillDeleteFilesRequest=S.DidDeleteFilesNotification=S.WillRenameFilesRequest=S.DidRenameFilesNotification=S.WillCreateFilesRequest=S.DidCreateFilesNotification=S.FileOperationPatternKind=S.LinkedEditingRangeRequest=S.ShowDocumentRequest=S.SemanticTokensRegistrationType=S.SemanticTokensRefreshRequest=S.SemanticTokensRangeRequest=S.SemanticTokensDeltaRequest=S.SemanticTokensRequest=S.TokenFormat=S.CallHierarchyPrepareRequest=S.CallHierarchyOutgoingCallsRequest=S.CallHierarchyIncomingCallsRequest=S.WorkDoneProgressCancelNotification=S.WorkDoneProgressCreateRequest=S.WorkDoneProgress=S.SelectionRangeRequest=S.DeclarationRequest=S.FoldingRangeRequest=S.ColorPresentationRequest=S.DocumentColorRequest=S.ConfigurationRequest=S.DidChangeWorkspaceFoldersNotification=S.WorkspaceFoldersRequest=S.TypeDefinitionRequest=S.ImplementationRequest=S.ApplyWorkspaceEditRequest=S.ExecuteCommandRequest=S.PrepareRenameRequest=S.RenameRequest=S.PrepareSupportDefaultBehavior=S.DocumentOnTypeFormattingRequest=S.DocumentRangeFormattingRequest=S.DocumentFormattingRequest=S.DocumentLinkResolveRequest=S.DocumentLinkRequest=S.CodeLensRefreshRequest=S.CodeLensResolveRequest=S.CodeLensRequest=S.WorkspaceSymbolResolveRequest=void 0;S.DidCloseNotebookDocumentNotification=S.DidSaveNotebookDocumentNotification=S.DidChangeNotebookDocumentNotification=S.NotebookCellArrayChange=S.DidOpenNotebookDocumentNotification=S.NotebookDocumentSyncRegistrationType=S.NotebookDocument=S.NotebookCell=S.ExecutionSummary=S.NotebookCellKind=S.DiagnosticRefreshRequest=S.WorkspaceDiagnosticRequest=S.DocumentDiagnosticRequest=S.DocumentDiagnosticReportKind=S.DiagnosticServerCancellationData=S.InlayHintRefreshRequest=S.InlayHintResolveRequest=S.InlayHintRequest=S.InlineValueRefreshRequest=S.InlineValueRequest=S.TypeHierarchySupertypesRequest=void 0;var G=qt(),cA=Um(),Ir=Wm(),x2=AP();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return x2.ImplementationRequest}});var b2=IP();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return b2.TypeDefinitionRequest}});var uA=OP();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return uA.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return uA.DidChangeWorkspaceFoldersNotification}});var _2=MP();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return _2.ConfigurationRequest}});var lA=$P();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return lA.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return lA.ColorPresentationRequest}});var S2=FP();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return S2.FoldingRangeRequest}});var k2=UP();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return k2.DeclarationRequest}});var C2=HP();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return C2.SelectionRangeRequest}});var RR=GP();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return RR.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return RR.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return RR.WorkDoneProgressCancelNotification}});var xR=BP();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return xR.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return xR.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return xR.CallHierarchyPrepareRequest}});var Kc=KP();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return Kc.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return Kc.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Kc.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Kc.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Kc.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Kc.SemanticTokensRegistrationType}});var w2=VP();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return w2.ShowDocumentRequest}});var D2=YP();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return D2.LinkedEditingRangeRequest}});var Zs=JP();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return Zs.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Zs.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Zs.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Zs.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Zs.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Zs.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Zs.WillDeleteFilesRequest}});var bR=ZP();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return bR.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return bR.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return bR.MonikerRequest}});var _R=eA();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return _R.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return _R.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return _R.TypeHierarchySupertypesRequest}});var fA=tA();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return fA.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return fA.InlineValueRefreshRequest}});var SR=rA();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return SR.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return SR.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return SR.InlayHintRefreshRequest}});var Ll=iA();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ll.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ll.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ll.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ll.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ll.DiagnosticRefreshRequest}});var zi=aA();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return zi.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return zi.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return zi.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return zi.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return zi.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return zi.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return zi.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return zi.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return zi.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return zi.DidCloseNotebookDocumentNotification}});var dA;(function(t){function e(r){let n=r;return Ir.string(n.language)||Ir.string(n.scheme)||Ir.string(n.pattern)}t.is=e})(dA=S.TextDocumentFilter||(S.TextDocumentFilter={}));var pA;(function(t){function e(r){let n=r;return Ir.objectLiteral(n)&&(Ir.string(n.notebookType)||Ir.string(n.scheme)||Ir.string(n.pattern))}t.is=e})(pA=S.NotebookDocumentFilter||(S.NotebookDocumentFilter={}));var mA;(function(t){function e(r){let n=r;return Ir.objectLiteral(n)&&(Ir.string(n.notebook)||pA.is(n.notebook))&&(n.language===void 0||Ir.string(n.language))}t.is=e})(mA=S.NotebookCellTextDocumentFilter||(S.NotebookCellTextDocumentFilter={}));var hA;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Ir.string(n)&&!dA.is(n)&&!mA.is(n))return!1;return!0}t.is=e})(hA=S.DocumentSelector||(S.DocumentSelector={}));var E2;(function(t){t.method="client/registerCapability",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(E2=S.RegistrationRequest||(S.RegistrationRequest={}));var P2;(function(t){t.method="client/unregisterCapability",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(P2=S.UnregistrationRequest||(S.UnregistrationRequest={}));var A2;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(A2=S.ResourceOperationKind||(S.ResourceOperationKind={}));var N2;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(N2=S.FailureHandlingKind||(S.FailureHandlingKind={}));var I2;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(I2=S.PositionEncodingKind||(S.PositionEncodingKind={}));var O2;(function(t){function e(r){let n=r;return n&&Ir.string(n.id)&&n.id.length>0}t.hasId=e})(O2=S.StaticRegistrationOptions||(S.StaticRegistrationOptions={}));var L2;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||hA.is(n.documentSelector))}t.is=e})(L2=S.TextDocumentRegistrationOptions||(S.TextDocumentRegistrationOptions={}));var M2;(function(t){function e(n){let i=n;return Ir.objectLiteral(i)&&(i.workDoneProgress===void 0||Ir.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Ir.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(M2=S.WorkDoneProgressOptions||(S.WorkDoneProgressOptions={}));var $2;(function(t){t.method="initialize",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})($2=S.InitializeRequest||(S.InitializeRequest={}));var q2;(function(t){t.unknownProtocolVersion=1})(q2=S.InitializeErrorCodes||(S.InitializeErrorCodes={}));var F2;(function(t){t.method="initialized",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(F2=S.InitializedNotification||(S.InitializedNotification={}));var j2;(function(t){t.method="shutdown",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType0(t.method)})(j2=S.ShutdownRequest||(S.ShutdownRequest={}));var U2;(function(t){t.method="exit",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType0(t.method)})(U2=S.ExitNotification||(S.ExitNotification={}));var W2;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(W2=S.DidChangeConfigurationNotification||(S.DidChangeConfigurationNotification={}));var H2;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(H2=S.MessageType||(S.MessageType={}));var G2;(function(t){t.method="window/showMessage",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(G2=S.ShowMessageNotification||(S.ShowMessageNotification={}));var B2;(function(t){t.method="window/showMessageRequest",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(B2=S.ShowMessageRequest||(S.ShowMessageRequest={}));var K2;(function(t){t.method="window/logMessage",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(K2=S.LogMessageNotification||(S.LogMessageNotification={}));var z2;(function(t){t.method="telemetry/event",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(z2=S.TelemetryEventNotification||(S.TelemetryEventNotification={}));var V2;(function(t){t.None=0,t.Full=1,t.Incremental=2})(V2=S.TextDocumentSyncKind||(S.TextDocumentSyncKind={}));var X2;(function(t){t.method="textDocument/didOpen",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(X2=S.DidOpenTextDocumentNotification||(S.DidOpenTextDocumentNotification={}));var Y2;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(Y2=S.TextDocumentContentChangeEvent||(S.TextDocumentContentChangeEvent={}));var J2;(function(t){t.method="textDocument/didChange",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(J2=S.DidChangeTextDocumentNotification||(S.DidChangeTextDocumentNotification={}));var Q2;(function(t){t.method="textDocument/didClose",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(Q2=S.DidCloseTextDocumentNotification||(S.DidCloseTextDocumentNotification={}));var Z2;(function(t){t.method="textDocument/didSave",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(Z2=S.DidSaveTextDocumentNotification||(S.DidSaveTextDocumentNotification={}));var eV;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(eV=S.TextDocumentSaveReason||(S.TextDocumentSaveReason={}));var tV;(function(t){t.method="textDocument/willSave",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(tV=S.WillSaveTextDocumentNotification||(S.WillSaveTextDocumentNotification={}));var rV;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(rV=S.WillSaveTextDocumentWaitUntilRequest||(S.WillSaveTextDocumentWaitUntilRequest={}));var nV;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(nV=S.DidChangeWatchedFilesNotification||(S.DidChangeWatchedFilesNotification={}));var iV;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(iV=S.FileChangeType||(S.FileChangeType={}));var oV;(function(t){function e(r){let n=r;return Ir.objectLiteral(n)&&(cA.URI.is(n.baseUri)||cA.WorkspaceFolder.is(n.baseUri))&&Ir.string(n.pattern)}t.is=e})(oV=S.RelativePattern||(S.RelativePattern={}));var sV;(function(t){t.Create=1,t.Change=2,t.Delete=4})(sV=S.WatchKind||(S.WatchKind={}));var aV;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(aV=S.PublishDiagnosticsNotification||(S.PublishDiagnosticsNotification={}));var cV;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(cV=S.CompletionTriggerKind||(S.CompletionTriggerKind={}));var uV;(function(t){t.method="textDocument/completion",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(uV=S.CompletionRequest||(S.CompletionRequest={}));var lV;(function(t){t.method="completionItem/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(lV=S.CompletionResolveRequest||(S.CompletionResolveRequest={}));var fV;(function(t){t.method="textDocument/hover",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(fV=S.HoverRequest||(S.HoverRequest={}));var dV;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(dV=S.SignatureHelpTriggerKind||(S.SignatureHelpTriggerKind={}));var pV;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(pV=S.SignatureHelpRequest||(S.SignatureHelpRequest={}));var mV;(function(t){t.method="textDocument/definition",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(mV=S.DefinitionRequest||(S.DefinitionRequest={}));var hV;(function(t){t.method="textDocument/references",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(hV=S.ReferencesRequest||(S.ReferencesRequest={}));var gV;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(gV=S.DocumentHighlightRequest||(S.DocumentHighlightRequest={}));var yV;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(yV=S.DocumentSymbolRequest||(S.DocumentSymbolRequest={}));var vV;(function(t){t.method="textDocument/codeAction",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(vV=S.CodeActionRequest||(S.CodeActionRequest={}));var TV;(function(t){t.method="codeAction/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(TV=S.CodeActionResolveRequest||(S.CodeActionResolveRequest={}));var RV;(function(t){t.method="workspace/symbol",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(RV=S.WorkspaceSymbolRequest||(S.WorkspaceSymbolRequest={}));var xV;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(xV=S.WorkspaceSymbolResolveRequest||(S.WorkspaceSymbolResolveRequest={}));var bV;(function(t){t.method="textDocument/codeLens",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(bV=S.CodeLensRequest||(S.CodeLensRequest={}));var _V;(function(t){t.method="codeLens/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(_V=S.CodeLensResolveRequest||(S.CodeLensResolveRequest={}));var SV;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType0(t.method)})(SV=S.CodeLensRefreshRequest||(S.CodeLensRefreshRequest={}));var kV;(function(t){t.method="textDocument/documentLink",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(kV=S.DocumentLinkRequest||(S.DocumentLinkRequest={}));var CV;(function(t){t.method="documentLink/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(CV=S.DocumentLinkResolveRequest||(S.DocumentLinkResolveRequest={}));var wV;(function(t){t.method="textDocument/formatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(wV=S.DocumentFormattingRequest||(S.DocumentFormattingRequest={}));var DV;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(DV=S.DocumentRangeFormattingRequest||(S.DocumentRangeFormattingRequest={}));var EV;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(EV=S.DocumentOnTypeFormattingRequest||(S.DocumentOnTypeFormattingRequest={}));var PV;(function(t){t.Identifier=1})(PV=S.PrepareSupportDefaultBehavior||(S.PrepareSupportDefaultBehavior={}));var AV;(function(t){t.method="textDocument/rename",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(AV=S.RenameRequest||(S.RenameRequest={}));var NV;(function(t){t.method="textDocument/prepareRename",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(NV=S.PrepareRenameRequest||(S.PrepareRenameRequest={}));var IV;(function(t){t.method="workspace/executeCommand",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(IV=S.ExecuteCommandRequest||(S.ExecuteCommandRequest={}));var OV;(function(t){t.method="workspace/applyEdit",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType("workspace/applyEdit")})(OV=S.ApplyWorkspaceEditRequest||(S.ApplyWorkspaceEditRequest={}))});var vA=$(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.createProtocolConnection=void 0;var yA=Qs();function LV(t,e,r,n){return yA.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,yA.createMessageConnection)(t,e,r,n)}Vm.createProtocolConnection=LV});var TA=$(on=>{"use strict";var MV=on&&on.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Xm=on&&on.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MV(e,t,r)};Object.defineProperty(on,"__esModule",{value:!0});on.LSPErrorCodes=on.createProtocolConnection=void 0;Xm(Qs(),on);Xm(Um(),on);Xm(qt(),on);Xm(gA(),on);var $V=vA();Object.defineProperty(on,"createProtocolConnection",{enumerable:!0,get:function(){return $V.createProtocolConnection}});var qV;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(qV=on.LSPErrorCodes||(on.LSPErrorCodes={}))});var pr=$(Vi=>{"use strict";var FV=Vi&&Vi.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),RA=Vi&&Vi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FV(e,t,r)};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.createProtocolConnection=void 0;var jV=pR();RA(pR(),Vi);RA(TA(),Vi);function UV(t,e,r,n){return(0,jV.createMessageConnection)(t,e,r,n)}Vi.createProtocolConnection=UV});var CR=$(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.SemanticTokensBuilder=ds.SemanticTokensDiff=ds.SemanticTokensFeature=void 0;var Ym=pr(),WV=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ym.SemanticTokensRefreshRequest.type),on:e=>{let r=Ym.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Ym.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Ym.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ds.SemanticTokensFeature=WV;var Jm=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,o=r-1;for(;i>=n&&o>=n&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<n||o<n)&&(i++,o++);let s=i-n+1,a=this.modifiedSequence.slice(n,o+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:s-1}]:[{start:n,deleteCount:s,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};ds.SemanticTokensDiff=Jm;var kR=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,r,n,i,o){let s=e,a=r;this._dataLen>0&&(s-=this._prevLine,s===0&&(a-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=r}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 Jm(this._prevData,this._data).computeDiff()}:this.build()}};ds.SemanticTokensBuilder=kR});var DR=$(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.TextDocuments=void 0;var ea=pr(),wR=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ea.Emitter,this._onDidOpen=new ea.Emitter,this._onDidClose=new ea.Emitter,this._onDidSave=new ea.Emitter,this._onWillSave=new ea.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=ea.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,o=n.contentChanges;if(o.length===0)return;let{version:s}=i;if(s==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,o,s),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let o=this._syncedDocuments.get(n.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ea.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};Qm.TextDocuments=wR});var PR=$(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.NotebookDocuments=zc.NotebookSyncFeature=void 0;var Kn=pr(),xA=DR(),HV=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Kn.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Kn.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Kn.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Kn.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};zc.NotebookSyncFeature=HV;var Zm=class t{onDidOpenTextDocument(e){return this.openHandler=e,Kn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Kn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Kn.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}};Zm.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var ER=class{constructor(e){e instanceof xA.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new xA.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Kn.Emitter,this._onDidChange=new Kn.Emitter,this._onDidSave=new Kn.Emitter,this._onDidClose=new Kn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new Zm,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)r.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let s=o.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,o.metadata=c.metadata);let f=[],p=[],m=[],T=[];if(c.cells!==void 0){let P=c.cells;if(P.structure!==void 0){let y=P.structure.array;if(o.cells.splice(y.start,y.deleteCount,...y.cells!==void 0?y.cells:[]),P.structure.didOpen!==void 0)for(let h of P.structure.didOpen)r.openTextDocument({textDocument:h}),f.push(h.uri);if(P.structure.didClose)for(let h of P.structure.didClose)r.closeTextDocument({textDocument:h}),p.push(h.uri)}if(P.data!==void 0){let y=new Map(P.data.map(h=>[h.document,h]));for(let h=0;h<=o.cells.length;h++){let C=y.get(o.cells[h].document);if(C!==void 0){let M=o.cells.splice(h,1,C);if(m.push({old:M[0],new:C}),y.delete(C.document),y.size===0)break}}}if(P.textContent!==void 0)for(let y of P.textContent)r.changeTextDocument({textDocument:y.document,contentChanges:y.changes}),T.push(y.document.uri)}this.updateCellMap(o);let k={notebookDocument:o};a&&(k.metadata={old:s,new:o.metadata});let A=[];for(let P of f)A.push(this.getNotebookCell(P));let N=[];for(let P of p)N.push(this.getNotebookCell(P));let O=[];for(let P of T)O.push(this.getNotebookCell(P));(A.length>0||N.length>0||m.length>0||O.length>0)&&(k.cells={added:A,removed:N,changed:{data:m,textContent:O}}),(k.metadata!==void 0||k.cells!==void 0)&&this._onDidChange.fire(k)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let s of i.cellTextDocuments)r.closeTextDocument({textDocument:s});this.notebookDocuments.delete(i.notebookDocument.uri);for(let s of o.cells)this.notebookCellMap.delete(s.document)}})),Kn.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};zc.NotebookDocuments=ER});var AR=$(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.thenable=or.typedArray=or.stringArray=or.array=or.func=or.error=or.number=or.string=or.boolean=void 0;function GV(t){return t===!0||t===!1}or.boolean=GV;function bA(t){return typeof t=="string"||t instanceof String}or.string=bA;function BV(t){return typeof t=="number"||t instanceof Number}or.number=BV;function KV(t){return t instanceof Error}or.error=KV;function _A(t){return typeof t=="function"}or.func=_A;function SA(t){return Array.isArray(t)}or.array=SA;function zV(t){return SA(t)&&t.every(e=>bA(e))}or.stringArray=zV;function VV(t,e){return Array.isArray(t)&&t.every(e)}or.typedArray=VV;function XV(t){return t&&_A(t.then)}or.thenable=XV});var NR=$(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.generateUuid=zn.parse=zn.isUUID=zn.v4=zn.empty=void 0;var Ml=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},$l=class t extends Ml{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(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}};$l._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];$l._timeHighBits=["8","9","a","b"];zn.empty=new Ml("00000000-0000-0000-0000-000000000000");function kA(){return new $l}zn.v4=kA;var YV=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function CA(t){return YV.test(t)}zn.isUUID=CA;function JV(t){if(!CA(t))throw new Error("invalid uuid");return new Ml(t)}zn.parse=JV;function QV(){return kA().asHex()}zn.generateUuid=QV});var wA=$(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.attachPartialResult=ms.ProgressFeature=ms.attachWorkDone=void 0;var ps=pr(),ZV=NR(),ta=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let o={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(ps.WorkDoneProgress.type,this._token,o)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(ps.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(ps.WorkDoneProgress.type,this._token,{kind:"end"})}};ta.Instances=new Map;var eh=class extends ta{constructor(e,r){super(e,r),this._source=new ps.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ql=class{constructor(){}begin(){}report(){}done(){}},th=class extends ql{constructor(){super(),this._source=new ps.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function e3(t,e){if(e===void 0||e.workDoneToken===void 0)return new ql;let r=e.workDoneToken;return delete e.workDoneToken,new ta(t,r)}ms.attachWorkDone=e3;var t3=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ps.WorkDoneProgressCancelNotification.type,r=>{let n=ta.Instances.get(r.token);(n instanceof eh||n instanceof th)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ql:new ta(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,ZV.generateUuid)();return this.connection.sendRequest(ps.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new eh(this.connection,e))}else return Promise.resolve(new th)}};ms.ProgressFeature=t3;var IR;(function(t){t.type=new ps.ProgressType})(IR||(IR={}));var OR=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(IR.type,this._token,e)}};function r3(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new OR(t,r)}ms.attachPartialResult=r3});var DA=$(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.ConfigurationFeature=void 0;var n3=pr(),i3=AR(),o3=t=>class extends t{getConfiguration(e){return e?i3.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(n3.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};rh.ConfigurationFeature=o3});var EA=$(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.WorkspaceFoldersFeature=void 0;var nh=pr(),s3=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new nh.Emitter,this.connection.onNotification(nh.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(nh.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(nh.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};ih.WorkspaceFoldersFeature=s3});var PA=$(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.CallHierarchyFeature=void 0;var LR=pr(),a3=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(LR.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=LR.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=LR.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};oh.CallHierarchyFeature=a3});var AA=$(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.ShowDocumentFeature=void 0;var c3=pr(),u3=t=>class extends t{showDocument(e){return this.connection.sendRequest(c3.ShowDocumentRequest.type,e)}};sh.ShowDocumentFeature=u3});var NA=$(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.FileOperationsFeature=void 0;var Vc=pr(),l3=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Vc.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Vc.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Vc.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Vc.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Vc.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Vc.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};ah.FileOperationsFeature=l3});var IA=$(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.LinkedEditingRangeFeature=void 0;var f3=pr(),d3=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(f3.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};ch.LinkedEditingRangeFeature=d3});var OA=$(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.TypeHierarchyFeature=void 0;var MR=pr(),p3=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(MR.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=MR.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=MR.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};uh.TypeHierarchyFeature=p3});var MA=$(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.InlineValueFeature=void 0;var LA=pr(),m3=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(LA.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(LA.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};lh.InlineValueFeature=m3});var $A=$(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.InlayHintFeature=void 0;var $R=pr(),h3=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest($R.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest($R.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest($R.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};fh.InlayHintFeature=h3});var qA=$(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh.DiagnosticFeature=void 0;var Fl=pr(),g3=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Fl.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Fl.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Fl.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(Fl.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Fl.WorkspaceDiagnosticRequest.partialResult,r)))}}};dh.DiagnosticFeature=g3});var FA=$(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.MonikerFeature=void 0;var y3=pr(),v3=t=>class extends t{get moniker(){return{on:e=>{let r=y3.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ph.MonikerFeature=v3});var QA=$($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.createConnection=$e.combineFeatures=$e.combineNotebooksFeatures=$e.combineLanguagesFeatures=$e.combineWorkspaceFeatures=$e.combineWindowFeatures=$e.combineClientFeatures=$e.combineTracerFeatures=$e.combineTelemetryFeatures=$e.combineConsoleFeatures=$e._NotebooksImpl=$e._LanguagesImpl=$e.BulkUnregistration=$e.BulkRegistration=$e.ErrorMessageTracker=void 0;var Y=pr(),Vn=AR(),FR=NR(),be=wA(),T3=DA(),R3=EA(),x3=PA(),b3=CR(),_3=AA(),S3=NA(),k3=IA(),C3=OA(),w3=MA(),D3=$A(),E3=qA(),P3=PR(),A3=FA();function qR(t){if(t!==null)return t}var jR=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};$e.ErrorMessageTracker=jR;var mh=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)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Y.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Y.RAL)().console.error("Sending log message failed")})}},UR=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,...r){let n={type:Y.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Y.ShowMessageRequest.type,n).then(qR)}showWarningMessage(e,...r){let n={type:Y.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Y.ShowMessageRequest.type,n).then(qR)}showInformationMessage(e,...r){let n={type:Y.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Y.ShowMessageRequest.type,n).then(qR)}},jA=(0,_3.ShowDocumentFeature)((0,be.ProgressFeature)(UR)),N3;(function(t){function e(){return new hh}t.create=e})(N3=$e.BulkRegistration||($e.BulkRegistration={}));var hh=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Vn.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=FR.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},I3;(function(t){function e(){return new jl(void 0,[])}t.create=e})(I3=$e.BulkUnregistration||($e.BulkUnregistration={}));var jl=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(Y.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Vn.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(Y.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},o=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},gh=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,r,n){return e instanceof hh?this.registerMany(e):e instanceof jl?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=Vn.string(r)?r:r.method,o=FR.generateUuid(),s={registrations:[{id:o,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Y.RegistrationRequest.type,s).then(a=>(e.add({id:o,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=Vn.string(e)?e:e.method,i=FR.generateUuid(),o={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Y.RegistrationRequest.type,o).then(s=>Y.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(s)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(Y.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(Y.RegistrationRequest.type,r).then(()=>new jl(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},WR=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 r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(Y.ApplyWorkspaceEditRequest.type,n)}},UA=(0,S3.FileOperationsFeature)((0,R3.WorkspaceFoldersFeature)((0,T3.ConfigurationFeature)(WR))),yh=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,r){this._trace!==Y.Trace.Off&&this.connection.sendNotification(Y.LogTraceNotification.type,{message:e,verbose:this._trace===Y.Trace.Verbose?r:void 0}).catch(()=>{})}},vh=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")})}},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){}attachWorkDoneProgress(e){return(0,be.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,be.attachPartialResult)(this.connection,r)}};$e._LanguagesImpl=Th;var WA=(0,A3.MonikerFeature)((0,E3.DiagnosticFeature)((0,D3.InlayHintFeature)((0,w3.InlineValueFeature)((0,C3.TypeHierarchyFeature)((0,k3.LinkedEditingRangeFeature)((0,b3.SemanticTokensFeature)((0,x3.CallHierarchyFeature)(Th)))))))),Rh=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,be.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,be.attachPartialResult)(this.connection,r)}};$e._NotebooksImpl=Rh;var HA=(0,P3.NotebookSyncFeature)(Rh);function GA(t,e){return function(r){return e(t(r))}}$e.combineConsoleFeatures=GA;function BA(t,e){return function(r){return e(t(r))}}$e.combineTelemetryFeatures=BA;function KA(t,e){return function(r){return e(t(r))}}$e.combineTracerFeatures=KA;function zA(t,e){return function(r){return e(t(r))}}$e.combineClientFeatures=zA;function VA(t,e){return function(r){return e(t(r))}}$e.combineWindowFeatures=VA;function XA(t,e){return function(r){return e(t(r))}}$e.combineWorkspaceFeatures=XA;function YA(t,e){return function(r){return e(t(r))}}$e.combineLanguagesFeatures=YA;function JA(t,e){return function(r){return e(t(r))}}$e.combineNotebooksFeatures=JA;function O3(t,e){function r(i,o,s){return i&&o?s(i,o):i||o}return{__brand:"features",console:r(t.console,e.console,GA),tracer:r(t.tracer,e.tracer,KA),telemetry:r(t.telemetry,e.telemetry,BA),client:r(t.client,e.client,zA),window:r(t.window,e.window,VA),workspace:r(t.workspace,e.workspace,XA),languages:r(t.languages,e.languages,YA),notebooks:r(t.notebooks,e.notebooks,JA)}}$e.combineFeatures=O3;function L3(t,e,r){let n=r&&r.console?new(r.console(mh)):new mh,i=t(n);n.rawAttach(i);let o=r&&r.tracer?new(r.tracer(yh)):new yh,s=r&&r.telemetry?new(r.telemetry(vh)):new vh,a=r&&r.client?new(r.client(gh)):new gh,c=r&&r.window?new(r.window(jA)):new jA,f=r&&r.workspace?new(r.workspace(UA)):new UA,p=r&&r.languages?new(r.languages(WA)):new WA,m=r&&r.notebooks?new(r.notebooks(HA)):new HA,T=[n,o,s,a,c,f,p,m];function k(y){return y instanceof Promise?y:Vn.thenable(y)?new Promise((h,C)=>{y.then(M=>h(M),M=>C(M))}):Promise.resolve(y)}let A,N,O,P={listen:()=>i.listen(),sendRequest:(y,...h)=>i.sendRequest(Vn.string(y)?y:y.method,...h),onRequest:(y,h)=>i.onRequest(y,h),sendNotification:(y,h)=>{let C=Vn.string(y)?y:y.method;return arguments.length===1?i.sendNotification(C):i.sendNotification(C,h)},onNotification:(y,h)=>i.onNotification(y,h),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:y=>(N=y,{dispose:()=>{N=void 0}}),onInitialized:y=>i.onNotification(Y.InitializedNotification.type,y),onShutdown:y=>(A=y,{dispose:()=>{A=void 0}}),onExit:y=>(O=y,{dispose:()=>{O=void 0}}),get console(){return n},get telemetry(){return s},get tracer(){return o},get client(){return a},get window(){return c},get workspace(){return f},get languages(){return p},get notebooks(){return m},onDidChangeConfiguration:y=>i.onNotification(Y.DidChangeConfigurationNotification.type,y),onDidChangeWatchedFiles:y=>i.onNotification(Y.DidChangeWatchedFilesNotification.type,y),__textDocumentSync:void 0,onDidOpenTextDocument:y=>i.onNotification(Y.DidOpenTextDocumentNotification.type,y),onDidChangeTextDocument:y=>i.onNotification(Y.DidChangeTextDocumentNotification.type,y),onDidCloseTextDocument:y=>i.onNotification(Y.DidCloseTextDocumentNotification.type,y),onWillSaveTextDocument:y=>i.onNotification(Y.WillSaveTextDocumentNotification.type,y),onWillSaveTextDocumentWaitUntil:y=>i.onRequest(Y.WillSaveTextDocumentWaitUntilRequest.type,y),onDidSaveTextDocument:y=>i.onNotification(Y.DidSaveTextDocumentNotification.type,y),sendDiagnostics:y=>i.sendNotification(Y.PublishDiagnosticsNotification.type,y),onHover:y=>i.onRequest(Y.HoverRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),void 0)),onCompletion:y=>i.onRequest(Y.CompletionRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onCompletionResolve:y=>i.onRequest(Y.CompletionResolveRequest.type,y),onSignatureHelp:y=>i.onRequest(Y.SignatureHelpRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),void 0)),onDeclaration:y=>i.onRequest(Y.DeclarationRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onDefinition:y=>i.onRequest(Y.DefinitionRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onTypeDefinition:y=>i.onRequest(Y.TypeDefinitionRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onImplementation:y=>i.onRequest(Y.ImplementationRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onReferences:y=>i.onRequest(Y.ReferencesRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onDocumentHighlight:y=>i.onRequest(Y.DocumentHighlightRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onDocumentSymbol:y=>i.onRequest(Y.DocumentSymbolRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onWorkspaceSymbol:y=>i.onRequest(Y.WorkspaceSymbolRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onWorkspaceSymbolResolve:y=>i.onRequest(Y.WorkspaceSymbolResolveRequest.type,y),onCodeAction:y=>i.onRequest(Y.CodeActionRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onCodeActionResolve:y=>i.onRequest(Y.CodeActionResolveRequest.type,(h,C)=>y(h,C)),onCodeLens:y=>i.onRequest(Y.CodeLensRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onCodeLensResolve:y=>i.onRequest(Y.CodeLensResolveRequest.type,(h,C)=>y(h,C)),onDocumentFormatting:y=>i.onRequest(Y.DocumentFormattingRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),void 0)),onDocumentRangeFormatting:y=>i.onRequest(Y.DocumentRangeFormattingRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),void 0)),onDocumentOnTypeFormatting:y=>i.onRequest(Y.DocumentOnTypeFormattingRequest.type,(h,C)=>y(h,C)),onRenameRequest:y=>i.onRequest(Y.RenameRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),void 0)),onPrepareRename:y=>i.onRequest(Y.PrepareRenameRequest.type,(h,C)=>y(h,C)),onDocumentLinks:y=>i.onRequest(Y.DocumentLinkRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onDocumentLinkResolve:y=>i.onRequest(Y.DocumentLinkResolveRequest.type,(h,C)=>y(h,C)),onDocumentColor:y=>i.onRequest(Y.DocumentColorRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onColorPresentation:y=>i.onRequest(Y.ColorPresentationRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onFoldingRanges:y=>i.onRequest(Y.FoldingRangeRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onSelectionRanges:y=>i.onRequest(Y.SelectionRangeRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),(0,be.attachPartialResult)(i,h))),onExecuteCommand:y=>i.onRequest(Y.ExecuteCommandRequest.type,(h,C)=>y(h,C,(0,be.attachWorkDone)(i,h),void 0)),dispose:()=>i.dispose()};for(let y of T)y.attach(P);return i.onRequest(Y.InitializeRequest.type,y=>{e.initialize(y),Vn.string(y.trace)&&(o.trace=Y.Trace.fromString(y.trace));for(let h of T)h.initialize(y.capabilities);if(N){let h=N(y,new Y.CancellationTokenSource().token,(0,be.attachWorkDone)(i,y),void 0);return k(h).then(C=>{if(C instanceof Y.ResponseError)return C;let M=C;M||(M={capabilities:{}});let z=M.capabilities;z||(z={},M.capabilities=z),z.textDocumentSync===void 0||z.textDocumentSync===null?z.textDocumentSync=Vn.number(P.__textDocumentSync)?P.__textDocumentSync:Y.TextDocumentSyncKind.None:!Vn.number(z.textDocumentSync)&&!Vn.number(z.textDocumentSync.change)&&(z.textDocumentSync.change=Vn.number(P.__textDocumentSync)?P.__textDocumentSync:Y.TextDocumentSyncKind.None);for(let ce of T)ce.fillServerCapabilities(z);return M})}else{let h={capabilities:{textDocumentSync:Y.TextDocumentSyncKind.None}};for(let C of T)C.fillServerCapabilities(h.capabilities);return h}}),i.onRequest(Y.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Y.CancellationTokenSource().token)}),i.onNotification(Y.ExitNotification.type,()=>{try{O&&O()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(Y.SetTraceNotification.type,y=>{o.trace=Y.Trace.fromString(y.value)}),P}$e.createConnection=L3});var HR=$(Or=>{"use strict";var M3=Or&&Or.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZA=Or&&Or.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&M3(e,t,r)};Object.defineProperty(Or,"__esModule",{value:!0});Or.ProposedFeatures=Or.NotebookDocuments=Or.TextDocuments=Or.SemanticTokensBuilder=void 0;var $3=CR();Object.defineProperty(Or,"SemanticTokensBuilder",{enumerable:!0,get:function(){return $3.SemanticTokensBuilder}});ZA(pr(),Or);var q3=DR();Object.defineProperty(Or,"TextDocuments",{enumerable:!0,get:function(){return q3.TextDocuments}});var F3=PR();Object.defineProperty(Or,"NotebookDocuments",{enumerable:!0,get:function(){return F3.NotebookDocuments}});ZA(QA(),Or);var j3;(function(t){t.all={__brand:"features"}})(j3=Or.ProposedFeatures||(Or.ProposedFeatures={}))});var tN=$((hTe,eN)=>{"use strict";eN.exports=pr()});var iN=$(Xi=>{"use strict";var U3=Xi&&Xi.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),nN=Xi&&Xi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U3(e,t,r)};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.createConnection=void 0;var xh=HR();nN(tN(),Xi);nN(HR(),Xi);var rN=!1,W3={initialize:t=>{},get shutdownReceived(){return rN},set shutdownReceived(t){rN=t},exit:t=>{}};function H3(t,e,r,n){let i,o,s,a;t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),xh.ConnectionStrategy.is(t)||xh.ConnectionOptions.is(t)?a=t:(o=t,s=e,a=r);let c=f=>(0,xh.createProtocolConnection)(o,s,f,a);return(0,xh.createConnection)(c,W3,i)}Xi.createConnection=H3});var sN=$((yTe,oN)=>{"use strict";oN.exports=iN()});var tP=Ie(Xe(),1);var Of=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,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 r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=Bb(n.range),o=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,o)+n.text+this._content.substring(s,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),f=this._lineOffsets,p=Gb(n.text,!1,o);if(c-a===p.length)for(let T=0,k=p.length;T<k;T++)f[T+a+1]=p[T];else p.length<1e4?f.splice(a+1,c-a,...p):this._lineOffsets=f=f.slice(0,a+1).concat(p,f.slice(c+1));let m=n.text.length-(s-o);if(m!==0)for(let T=a+1+p.length,k=f.length;T<k;T++)f[T]=f[T]+m}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Gb(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return{line:o,character:e-r[o]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},ha;(function(t){function e(i,o,s,a){return new Of(i,o,s,a)}t.create=e;function r(i,o,s){if(i instanceof Of)return i.update(o,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,o){let s=i.getText(),a=cy(o.map(PL),(p,m)=>{let T=p.range.start.line-m.range.start.line;return T===0?p.range.start.character-m.range.start.character:T}),c=0,f=[];for(let p of a){let m=i.offsetAt(p.range.start);if(m<c)throw new Error("Overlapping edit");m>c&&f.push(s.substring(c,m)),p.newText.length&&f.push(p.newText),c=i.offsetAt(p.range.end)}return f.push(s.substr(c)),f.join("")}t.applyEdits=n})(ha||(ha={}));function cy(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);cy(n,e),cy(i,e);let o=0,s=0,a=0;for(;o<n.length&&s<i.length;)e(n[o],i[s])<=0?t[a++]=n[o++]:t[a++]=i[s++];for(;o<n.length;)t[a++]=n[o++];for(;s<i.length;)t[a++]=i[s++];return t}function Gb(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);(o===13||o===10)&&(o===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function Bb(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function PL(t){let e=Bb(t.range);return e!==t.range?{newText:t.newText,range:e}:t}function Zt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function so(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function Kb(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ga(t){return typeof t=="object"&&t!==null&&Zt(t.container)&&so(t.reference)&&typeof t.message=="string"}var ks=class{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return Zt(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let o=this.computeIsSubtype(e,r);return n[r]=o,o}}getAllSubTypes(e){let r=this.allSubtypes[e];if(r)return r;{let n=this.getAllTypes(),i=[];for(let o of n)this.isSubtype(o,e)&&i.push(o);return this.allSubtypes[e]=i,i}}};function Ei(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Cs(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function zb(t){return Ei(t)&&typeof t.fullText=="string"}var Rn=class t{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){let r=e[Symbol.iterator]();return new t(()=>({first:this.startFn(),firstDone:!1}),n=>{let i;if(!n.firstDone){do if(i=this.nextFn(n.first),!i.done)return i;while(!i.done);n.firstDone=!0}do if(i=r.next(),!i.done)return i;while(!i.done);return Yr})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=AL(i.value)),o=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,o=n.next();for(;!o.done;){if(i>=r&&o.value===e)return i;o=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?Yr:{done:!1,value:e(i)}})}filter(e){return new t(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Yr})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,o=n.next();for(;!o.done;)i===void 0?i=o.value:i=e(i,o.value),o=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let o=this.recursiveReduce(e,r,n);return o===void 0?i.value:r(o,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}let{done:n,value:i}=this.nextFn(r.this);if(!n){let o=e(i);if(Lf(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return Yr})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new t(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}let{done:i,value:o}=r.nextFn(n.this);if(!i)if(Lf(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return Yr})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new t(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new t(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Yr:this.nextFn(r.state)))}distinct(e){let r=new Set;return this.filter(n=>{let i=e?e(n):n;return r.has(i)?!1:(r.add(i),!0)})}exclude(e,r){let n=new Set;for(let i of e){let o=r?r(i):i;n.add(o)}return this.filter(i=>{let o=r?r(i):i;return!n.has(o)})}};function AL(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Lf(t){return!!t&&typeof t[Symbol.iterator]=="function"}var ya=new Rn(()=>{},()=>Yr),Yr=Object.freeze({done:!0,value:void 0});function ke(...t){if(t.length===1){let e=t[0];if(e instanceof Rn)return e;if(Lf(e))return new Rn(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Rn(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Yr)}return t.length>1?new Rn(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){let r=t[e.collIndex++];Lf(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Yr}):ya}var $n=class extends Rn{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Yr})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},yu;(function(t){function e(o){return o.reduce((s,a)=>s+a,0)}t.sum=e;function r(o){return o.reduce((s,a)=>s*a,0)}t.product=r;function n(o){return o.reduce((s,a)=>Math.min(s,a))}t.min=n;function i(o){return o.reduce((s,a)=>Math.max(s,a))}t.max=i})(yu=yu||(yu={}));function uy(t){return new $n(t,e=>Ei(e)?e.content:[],{includeRoot:!0})}function Yb(t){return uy(t).filter(Cs)}function Jb(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function vu(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function jr(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var ao;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside"})(ao=ao||(ao={}));function NL(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<t.start.character)return ao.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>e.end.character)return ao.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?ao.Inside:r?ao.OverlapBack:ao.OverlapFront}function Mf(t,e){return NL(t,e)>ao.After}var ly=/^[\w\p{L}]$/u;function ur(t,e,r=ly){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return un(t,e)}}function Qb(t,e){if(t){let r=IL(t,!0);if(r&&Vb(r,e))return r;if(zb(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(Vb(o,e))return o}}}}function Vb(t,e){return Cs(t)&&e.includes(t.tokenType.name)}function un(t,e){if(Cs(t))return t;if(Ei(t)){let r=0,n=t.content.length-1;for(;r<n;){let i=Math.floor((r+n)/2),o=t.content[i];if(o.offset>e)n=i-1;else if(o.end<=e)r=i+1;else return un(o,e)}if(r===n)return un(t.content[r],e)}}function IL(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t);for(;n>0;){n--;let i=r.content[n];if(e||!i.hidden)return i}t=r}}function Zb(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;n<i;){n++;let o=r.content[n];if(e||!o.hidden)return o}t=r}}function e_(t,e){let r=OL(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function OL(t,e){let r=Xb(t),n=Xb(e),i;for(let o=0;o<r.length&&o<n.length;o++){let s=r[o],a=n[o];if(s.parent===a.parent)i={parent:s.parent,a:s.index,b:a.index};else break}return i}function Xb(t){let e=[];for(;t.container;){let r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}function ws(t,e,r,n){let i=[t,e,r,n].reduce(i_,{});return n_(i)}var fy=Symbol("isProxy");function $f(t){if(t&&t[fy])for(let e of Object.values(t))$f(e);return t}function n_(t,e){let r=new Proxy({},{deleteProperty:()=>!1,get:(n,i)=>r_(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(r_(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Reflect.ownKeys(t),fy]});return r[fy]=!0,r}var t_=Symbol();function r_(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===t_)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=t_;try{t[e]=typeof i=="function"?i(n):n_(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function i_(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!==void 0){let i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=i_(i,n):t[r]=n}}return t}var Ye=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return yu.sum(ke(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ke(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ke(this.map.keys())}values(){return ke(this.map.values()).flat()}entriesGroupedByKey(){return ke(this.map.entries())}};var dy="AbstractRule";var Ds="AbstractType";var LL="Condition";var ML="TypeDefinition";var py="AbstractElement";function va(t){return Ne.isInstance(t,py)}var o_="ArrayType";function Es(t){return Ne.isInstance(t,o_)}var s_="Conjunction";function a_(t){return Ne.isInstance(t,s_)}var c_="Disjunction";function u_(t){return Ne.isInstance(t,c_)}var l_="Grammar";function Ta(t){return Ne.isInstance(t,l_)}var $L="GrammarImport";function qf(t){return Ne.isInstance(t,$L)}var qL="InferredType";function Ra(t){return Ne.isInstance(t,qL)}var Ru="Interface";function ln(t){return Ne.isInstance(t,Ru)}var f_="LiteralCondition";function d_(t){return Ne.isInstance(t,f_)}var p_="Negation";function m_(t){return Ne.isInstance(t,p_)}var h_="Parameter";function g_(t){return Ne.isInstance(t,h_)}var y_="ParameterReference";function xa(t){return Ne.isInstance(t,y_)}var v_="ParserRule";function Z(t){return Ne.isInstance(t,v_)}var T_="ReferenceType";function Ps(t){return Ne.isInstance(t,T_)}var FL="ReturnType";function ba(t){return Ne.isInstance(t,FL)}var R_="SimpleType";function Ur(t){return Ne.isInstance(t,R_)}var my="TerminalRule";function He(t){return Ne.isInstance(t,my)}var xu="Type";function hr(t){return Ne.isInstance(t,xu)}var jL="TypeAttribute";function Ff(t){return Ne.isInstance(t,jL)}var x_="UnionType";function qn(t){return Ne.isInstance(t,x_)}var b_="Action";function Je(t){return Ne.isInstance(t,b_)}var __="Alternatives";function xn(t){return Ne.isInstance(t,__)}var S_="Assignment";function je(t){return Ne.isInstance(t,S_)}var k_="CharacterRange";function jf(t){return Ne.isInstance(t,k_)}var C_="CrossReference";function kr(t){return Ne.isInstance(t,C_)}var w_="Group";function gr(t){return Ne.isInstance(t,w_)}var D_="Keyword";function jt(t){return Ne.isInstance(t,D_)}var E_="NegatedToken";function P_(t){return Ne.isInstance(t,E_)}var A_="RegexToken";function N_(t){return Ne.isInstance(t,A_)}var I_="RuleCall";function Qe(t){return Ne.isInstance(t,I_)}var O_="TerminalAlternatives";function L_(t){return Ne.isInstance(t,O_)}var M_="TerminalGroup";function $_(t){return Ne.isInstance(t,M_)}var q_="TerminalRuleCall";function Uf(t){return Ne.isInstance(t,q_)}var F_="UnorderedGroup";function bn(t){return Ne.isInstance(t,F_)}var j_="UntilToken";function U_(t){return Ne.isInstance(t,j_)}var W_="Wildcard";function H_(t){return Ne.isInstance(t,W_)}var Tu=class extends ks{getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayType","Assignment","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","LiteralCondition","NamedArgument","NegatedToken","Negation","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","Wildcard"]}computeIsSubtype(e,r){switch(e){case b_:return this.isSubtype(py,r)||this.isSubtype(Ds,r);case __:case S_:case k_:case C_:case w_:case D_:case E_:case A_:case I_:case O_:case M_:case q_:case F_:case j_:case W_:return this.isSubtype(py,r);case o_:case T_:case R_:case x_:return this.isSubtype(ML,r);case s_:case c_:case f_:case p_:case y_:return this.isSubtype(LL,r);case Ru:case xu:return this.isSubtype(Ds,r);case v_:return this.isSubtype(dy,r)||this.isSubtype(Ds,r);case my:return this.isSubtype(dy,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Ds;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return dy;case"Grammar:usedGrammars":return l_;case"NamedArgument:parameter":case"ParameterReference:parameter":return h_;case"TerminalRuleCall:rule":return my;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"Grammar":return{name:"Grammar",mandatory:[{name:"definesHiddenTokens",type:"boolean"},{name:"hiddenTokens",type:"array"},{name:"imports",type:"array"},{name:"interfaces",type:"array"},{name:"isDeclared",type:"boolean"},{name:"rules",type:"array"},{name:"types",type:"array"},{name:"usedGrammars",type:"array"}]};case"Interface":return{name:"Interface",mandatory:[{name:"attributes",type:"array"},{name:"superTypes",type:"array"}]};case"LiteralCondition":return{name:"LiteralCondition",mandatory:[{name:"true",type:"boolean"}]};case"NamedArgument":return{name:"NamedArgument",mandatory:[{name:"calledByName",type:"boolean"}]};case"ParserRule":return{name:"ParserRule",mandatory:[{name:"definesHiddenTokens",type:"boolean"},{name:"entry",type:"boolean"},{name:"fragment",type:"boolean"},{name:"hiddenTokens",type:"array"},{name:"parameters",type:"array"},{name:"wildcard",type:"boolean"}]};case"TerminalRule":return{name:"TerminalRule",mandatory:[{name:"fragment",type:"boolean"},{name:"hidden",type:"boolean"}]};case"TypeAttribute":return{name:"TypeAttribute",mandatory:[{name:"isOptional",type:"boolean"}]};case"UnionType":return{name:"UnionType",mandatory:[{name:"types",type:"array"}]};case"Alternatives":return{name:"Alternatives",mandatory:[{name:"elements",type:"array"}]};case"CrossReference":return{name:"CrossReference",mandatory:[{name:"deprecatedSyntax",type:"boolean"}]};case"Group":return{name:"Group",mandatory:[{name:"elements",type:"array"}]};case"RuleCall":return{name:"RuleCall",mandatory:[{name:"arguments",type:"array"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",mandatory:[{name:"elements",type:"array"}]};case"TerminalGroup":return{name:"TerminalGroup",mandatory:[{name:"elements",type:"array"}]};case"UnorderedGroup":return{name:"UnorderedGroup",mandatory:[{name:"elements",type:"array"}]};default:return{name:e,mandatory:[]}}}},Ne=new Tu;function G_(t){for(let[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{Zt(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):Zt(r)&&(r.$container=t,r.$containerProperty=e))}function Ze(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function Se(t){let r=Wf(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Wf(t){for(;t.$container;)t=t.$container;return t}function Fo(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new Rn(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){let i=n.keys[n.keyIndex];if(!i.startsWith("$")){let o=t[i];if(Zt(o)){if(n.keyIndex++,hy(o,r))return{done:!1,value:o}}else if(Array.isArray(o)){for(;n.arrayIndex<o.length;){let s=n.arrayIndex++,a=o[s];if(Zt(a)&&hy(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return Yr})}function bt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new $n(t,r=>Fo(r,e))}function uo(t,e){if(t){if(e?.range&&!hy(t,e.range))return new $n(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new $n(t,r=>Fo(r,e),{includeRoot:!0})}function hy(t,e){var r;if(!e)return!0;let n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?Mf(n,e):!1}function Hf(t){return new Rn(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(so(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(so(o))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Yr})}function B_(t){var e,r;if(t){if("astNode"in t)return HL(t);if(Array.isArray(t))return t.reduce(K_,void 0);{let n=t,i=UL(n)?WL((r=(e=n?.root)===null||e===void 0?void 0:e.astNode)!==null&&r!==void 0?r:n?.astNode):void 0;return _a(n,i)}}else return}function UL(t){return typeof t<"u"&&"element"in t&&"text"in t}function WL(t){try{return Se(t).uri.toString()}catch{return}}function HL(t){var e,r;let{astNode:n,property:i,index:o}=t??{},s=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||s===void 0)){if(i===void 0)return _a(s,gy(n));{let a=c=>o!==void 0&&o>-1&&Array.isArray(n[i])?o<c.length?c[o]:void 0:c.reduce(K_,void 0);if(!((r=s.assignments)===null||r===void 0)&&r[i]){let c=a(s.assignments[i]);return c&&_a(c,gy(n))}else if(n.$cstNode){let c=a(jo(n.$cstNode,i));return c&&_a(c,gy(n))}else return}}}function gy(t){var e,r,n,i;return t.$cstNode?(r=(e=Se(t))===null||e===void 0?void 0:e.uri)===null||r===void 0?void 0:r.toString():t.$textRegion?t.$textRegion.documentURI||((i=(n=new $n(t,o=>o.$container?[o.$container]:[]).find(o=>{var s;return(s=o.$textRegion)===null||s===void 0?void 0:s.documentURI}))===null||n===void 0?void 0:n.$textRegion)===null||i===void 0?void 0:i.documentURI):void 0}function _a(t,e){var r,n;let i={offset:t.offset,end:(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,length:(n=t.length)!==null&&n!==void 0?n:t.end-t.offset};return t.range&&(i.range=t.range),e??(e=t.fileURI),e&&(i.fileURI=e),i}function K_(t,e){var r,n;if(t){if(!e)return t&&_a(t)}else return e&&_a(e);let i=(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,o=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,s=Math.min(t.offset,e.offset),a=Math.max(i,o),c=a-s,f={offset:s,end:a,length:c};if(t.range&&e.range&&(f.range={start:e.range.start.line<t.range.start.line||e.range.start.line===t.range.start.line&&e.range.start.character<t.range.start.character?e.range.start:t.range.start,end:e.range.end.line>t.range.end.line||e.range.end.line===t.range.end.line&&e.range.end.character>t.range.end.character?e.range.end:t.range.end}),t.fileURI||e.fileURI){let p=t.fileURI,m=e.fileURI,T=p&&m&&p!==m?`<unmergable text regions of ${p}, ${m}>`:p??m;f.fileURI=T}return f}var yy=class{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}get currentPosition(){return{offset:this.content.length,line:this.currentLineNumber,character:this.currentLineContent.length}}append(e,r){if(e.length>0){let n=r&&this.currentPosition;this.lines[this.currentLineNumber].push(e),n&&this.indentPendingTraceRegions(n)}}indentPendingTraceRegions(e){for(let r=this.traceData.length-1;r>=0;r--){let n=this.traceData[r];n.targetStart&&n.targetStart.offset===e.offset&&(n.targetStart=this.currentPosition)}}increaseIndent(e){this.currentIndents.push(e),e.indentImmediately||this.recentNonImmediateIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(e=>!this.recentNonImmediateIndents.includes(e))}resetCurrentLine(){this.lines[this.currentLineNumber]=[],this.pendingIndent=!0}addNewLine(){this.pendingIndent=!0,this.lines.push([]),this.recentNonImmediateIndents.length=0}pushTraceRegion(e){let r=GL(e,this.currentPosition,n=>{var i,o;return(o=(i=this.traceData[this.traceData.length-1])===null||i===void 0?void 0:i.children)===null||o===void 0?void 0:o.push(n)});return this.traceData.push(r),r}popTraceRegion(e){let r=this.traceData.pop();return this.assertTrue(r===e,"Trace region mismatch!"),r}getParentTraceSourceFileURI(){var e;for(let r=this.traceData.length-1;r>-1;r--){let n=(e=this.traceData[r].sourceRegion)===null||e===void 0?void 0:e.fileURI;if(n)return n}}assertTrue(e,r){if(!e)throw new Error(r)}};function GL(t,e,r){let n={sourceRegion:t,targetRegion:void 0,children:[],targetStart:e,complete:i=>{var o,s;return n.targetRegion={offset:n.targetStart.offset,end:i.offset,length:i.offset-n.targetStart.offset,range:{start:{line:n.targetStart.line,character:n.targetStart.character},end:{line:i.line,character:i.character}}},delete n.targetStart,((o=n.children)===null||o===void 0?void 0:o.length)===0&&delete n.children,!((s=n.targetRegion)===null||s===void 0)&&s.length&&r(n),delete n.complete,n}};return n}function z_(t,e){let r=new yy(e),n=r.pushTraceRegion(void 0);V_(t,r),r.popTraceRegion(n),n.complete&&n.complete(r.currentPosition);let i=n.children&&n.children.length===1?n.children[0]:void 0,o=i?.targetRegion,s=n.targetRegion;return o&&i.sourceRegion&&o.offset===s.offset&&o.length===s.length?{text:r.content,trace:i}:{text:r.content,trace:n}}function V_(t,e){typeof t=="string"?BL(t,e):t instanceof Sa?KL(t,e):t instanceof Cr?J_(t,e):t instanceof Uo&&zL(t,e)}function X_(t,e){return typeof t=="string"?t.length!==0:t instanceof Cr?t.contents.some(r=>X_(r,e)):t instanceof Uo?!(t.ifNotEmpty&&e.currentLineContent.length===0):!1}function BL(t,e){t&&(e.pendingIndent&&Y_(e,!1),e.append(t))}function Y_(t,e){var r;let n="";for(let i of t.relevantIndents.filter(o=>o.indentEmptyLines||!e))n+=(r=i.indentation)!==null&&r!==void 0?r:t.defaultIndentation;t.append(n,!0),t.pendingIndent=!1}function J_(t,e){let r,n=B_(t.tracedSource);n&&(r=e.pushTraceRegion(n));for(let i of t.contents)V_(i,e);if(r){e.popTraceRegion(r);let i=e.getParentTraceSourceFileURI();i&&n?.fileURI===i&&delete n.fileURI,r.complete&&r.complete(e.currentPosition)}}function KL(t,e){var r;if(X_(t,e)){t.indentImmediately&&!e.pendingIndent&&e.append((r=t.indentation)!==null&&r!==void 0?r:e.defaultIndentation,!0);try{e.increaseIndent(t),J_(t,e)}finally{e.decreaseIndent()}}}function zL(t,e){t.ifNotEmpty&&!VL(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&Y_(e,!0),e.append(t.lineDelimiter),e.addNewLine())}function VL(t){return t.trimStart()!==""}var z8=Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__"),bu=/\r?\n/g,XL=/\S|$/;function Q_(t){let e=t.filter(n=>n.length>0).map(n=>n.search(XL)),r=e.length===0?0:Math.min(...e);return Math.max(0,r)}function Ty(t,...e){let r=YL(t),n=JL(t,e,r);return ZL(n)}function tS(t,e,r){return(n,...i)=>Ry(t,e,r)(Ty(n,...i))}function YL(t){let e=t.join("_").split(bu),r=e.length>1&&e[0].trim().length===0,n=r&&e.length>1&&e[e.length-1].trim().length===0;if(e.length===1||e.length!==0&&e[0].trim().length!==0||e.length===2&&e[1].trim().length===0)return{indentation:0,omitFirstLine:r,omitLastLine:n,trimLastLine:e.length!==1&&e[e.length-1].trim().length===0};{let i=r?e.slice(1):e;i=n?i.slice(0,i.length-1):i,i=i.filter(s=>s.length!==0);let o=Q_(i);return{indentation:o,omitFirstLine:r,omitLastLine:n&&(e[e.length-1].length<o||!e[e.length-1].startsWith(i[0].substring(0,o)))}}}function JL(t,e,{indentation:r,omitFirstLine:n,omitLastLine:i,trimLastLine:o}){let s=[];t.forEach((f,p)=>{s.push(...f.split(bu).map((m,T)=>T===0||m.length<r?m:m.substring(r)).reduce(p===0?(m,T,k)=>k===0?n?[]:[T]:k===1&&m.length===0?[T]:m.concat(Gf,T):(m,T,k)=>k===0?[T]:m.concat(Gf,T),[]).filter(m=>!(typeof m=="string"&&m.length===0)).concat(_u(e[p])?e[p]:e[p]!==void 0?{content:String(e[p])}:p<e.length?rS:[]))});let a=s.length,c=a!==0?s[a-1]:void 0;return(i||o)&&typeof c=="string"&&c.trim().length===0?n&&a!==1&&s[a-2]===Gf?s.slice(0,a-2):s.slice(0,a-1):s}var Gf={isNewLine:!0},rS={isUndefinedSegment:!0},eS=t=>t===Gf,vy=t=>t===rS,QL=t=>t.content!==void 0;function ZL(t){return t.reduce((r,n,i)=>vy(n)?r:eS(n)?{node:i!==0&&(vy(t[i-1])||_u(t[i-1]))||i>1&&typeof t[i-1]=="string"&&(vy(t[i-2])||_u(t[i-2]))?r.node.appendNewLineIfNotEmpty():r.node.appendNewLine()}:(()=>{var o;let s=(i===0||eS(t[i-1]))&&typeof n=="string"&&n.length!==0?"".padStart(n.length-n.trimStart().length):"",a=QL(n)?n.content:n,c;return{node:r.indented?r.node:s.length!==0?r.node.indent({indentation:s,indentImmediately:!1,indentedChildren:f=>c=f.append(a)}):r.node.append(a),indented:c??((o=r.indented)===null||o===void 0?void 0:o.append(a))}})(),{node:new Cr}).node}var Z_=typeof process>"u"?`
65
+ `,"\r"];(function(t){function e(o,s,a,c){return new Qx(o,s,a,c)}t.create=e;function r(o){let s=o;return!!(N.defined(s)&&N.string(s.uri)&&(N.undefined(s.languageId)||N.string(s.languageId))&&N.uinteger(s.lineCount)&&N.func(s.getText)&&N.func(s.positionAt)&&N.func(s.offsetAt))}t.is=r;function n(o,s){let a=o.getText(),c=i(s,(l,f)=>{let g=l.range.start.line-f.range.start.line;return g===0?l.range.start.character-f.range.start.character:g}),u=a.length;for(let l=c.length-1;l>=0;l--){let f=c[l],g=o.offsetAt(f.range.start),T=o.offsetAt(f.range.end);if(T<=u)a=a.substring(0,g)+f.newText+a.substring(T,a.length);else throw new Error("Overlapping edit");u=g}return a}t.applyEdits=n;function i(o,s){if(o.length<=1)return o;let a=o.length/2|0,c=o.slice(0,a),u=o.slice(a);i(c,s),i(u,s);let l=0,f=0,g=0;for(;l<c.length&&f<u.length;)s(c[l],u[f])<=0?o[g++]=c[l++]:o[g++]=u[f++];for(;l<c.length;)o[g++]=c[l++];for(;f<u.length;)o[g++]=u[f++];return o}})(Jx||(Jx={}));Qx=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,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 r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let o=r.charAt(i);n=o==="\r"||o===`
66
+ `,o==="\r"&&i+1<r.length&&r.charAt(i+1)===`
67
+ `&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return qn.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return qn.create(o,e-r[o])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}};(function(t){let e=Object.prototype.toString;function r(T){return typeof T<"u"}t.defined=r;function n(T){return typeof T>"u"}t.undefined=n;function i(T){return T===!0||T===!1}t.boolean=i;function o(T){return e.call(T)==="[object String]"}t.string=o;function s(T){return e.call(T)==="[object Number]"}t.number=s;function a(T,C,P){return e.call(T)==="[object Number]"&&C<=T&&T<=P}t.numberRange=a;function c(T){return e.call(T)==="[object Number]"&&-2147483648<=T&&T<=2147483647}t.integer=c;function u(T){return e.call(T)==="[object Number]"&&0<=T&&T<=2147483647}t.uinteger=u;function l(T){return e.call(T)==="[object Function]"}t.func=l;function f(T){return T!==null&&typeof T=="object"}t.objectLiteral=f;function g(T,C){return Array.isArray(T)&&T.every(C)}t.typedArray=g})(N||(N={}))});var bt=M(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.ProtocolNotificationType=un.ProtocolNotificationType0=un.ProtocolRequestType=un.ProtocolRequestType0=un.RegistrationType=un.MessageDirection=void 0;var Xc=Ys(),_N;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(_N||(un.MessageDirection=_N={}));var Zx=class{constructor(e){this.method=e}};un.RegistrationType=Zx;var eb=class extends Xc.RequestType0{constructor(e){super(e)}};un.ProtocolRequestType0=eb;var tb=class extends Xc.RequestType{constructor(e){super(e,Xc.ParameterStructures.byName)}};un.ProtocolRequestType=tb;var rb=class extends Xc.NotificationType0{constructor(e){super(e)}};un.ProtocolNotificationType0=rb;var nb=class extends Xc.NotificationType{constructor(e){super(e,Xc.ParameterStructures.byName)}};un.ProtocolNotificationType=nb});var gh=M(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.objectLiteral=er.typedArray=er.stringArray=er.array=er.func=er.error=er.number=er.string=er.boolean=void 0;function d4(t){return t===!0||t===!1}er.boolean=d4;function SN(t){return typeof t=="string"||t instanceof String}er.string=SN;function p4(t){return typeof t=="number"||t instanceof Number}er.number=p4;function m4(t){return t instanceof Error}er.error=m4;function h4(t){return typeof t=="function"}er.func=h4;function kN(t){return Array.isArray(t)}er.array=kN;function g4(t){return kN(t)&&t.every(e=>SN(e))}er.stringArray=g4;function y4(t,e){return Array.isArray(t)&&t.every(e)}er.typedArray=y4;function v4(t){return t!==null&&typeof t=="object"}er.objectLiteral=v4});var EN=M(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.ImplementationRequest=void 0;var wN=bt(),CN;(function(t){t.method="textDocument/implementation",t.messageDirection=wN.MessageDirection.clientToServer,t.type=new wN.ProtocolRequestType(t.method)})(CN||(yh.ImplementationRequest=CN={}))});var DN=M(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.TypeDefinitionRequest=void 0;var PN=bt(),AN;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=PN.MessageDirection.clientToServer,t.type=new PN.ProtocolRequestType(t.method)})(AN||(vh.TypeDefinitionRequest=AN={}))});var ON=M(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.DidChangeWorkspaceFoldersNotification=Yc.WorkspaceFoldersRequest=void 0;var Th=bt(),NN;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Th.MessageDirection.serverToClient,t.type=new Th.ProtocolRequestType0(t.method)})(NN||(Yc.WorkspaceFoldersRequest=NN={}));var IN;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Th.MessageDirection.clientToServer,t.type=new Th.ProtocolNotificationType(t.method)})(IN||(Yc.DidChangeWorkspaceFoldersNotification=IN={}))});var $N=M(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.ConfigurationRequest=void 0;var LN=bt(),MN;(function(t){t.method="workspace/configuration",t.messageDirection=LN.MessageDirection.serverToClient,t.type=new LN.ProtocolRequestType(t.method)})(MN||(Rh.ConfigurationRequest=MN={}))});var jN=M(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.ColorPresentationRequest=Jc.DocumentColorRequest=void 0;var xh=bt(),FN;(function(t){t.method="textDocument/documentColor",t.messageDirection=xh.MessageDirection.clientToServer,t.type=new xh.ProtocolRequestType(t.method)})(FN||(Jc.DocumentColorRequest=FN={}));var qN;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=xh.MessageDirection.clientToServer,t.type=new xh.ProtocolRequestType(t.method)})(qN||(Jc.ColorPresentationRequest=qN={}))});var HN=M(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.FoldingRangeRefreshRequest=Qc.FoldingRangeRequest=void 0;var bh=bt(),UN;(function(t){t.method="textDocument/foldingRange",t.messageDirection=bh.MessageDirection.clientToServer,t.type=new bh.ProtocolRequestType(t.method)})(UN||(Qc.FoldingRangeRequest=UN={}));var WN;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=bh.MessageDirection.serverToClient,t.type=new bh.ProtocolRequestType0(t.method)})(WN||(Qc.FoldingRangeRefreshRequest=WN={}))});var KN=M(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.DeclarationRequest=void 0;var GN=bt(),BN;(function(t){t.method="textDocument/declaration",t.messageDirection=GN.MessageDirection.clientToServer,t.type=new GN.ProtocolRequestType(t.method)})(BN||(_h.DeclarationRequest=BN={}))});var XN=M(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.SelectionRangeRequest=void 0;var zN=bt(),VN;(function(t){t.method="textDocument/selectionRange",t.messageDirection=zN.MessageDirection.clientToServer,t.type=new zN.ProtocolRequestType(t.method)})(VN||(Sh.SelectionRangeRequest=VN={}))});var ZN=M(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.WorkDoneProgressCancelNotification=os.WorkDoneProgressCreateRequest=os.WorkDoneProgress=void 0;var T4=Ys(),kh=bt(),YN;(function(t){t.type=new T4.ProgressType;function e(r){return r===t.type}t.is=e})(YN||(os.WorkDoneProgress=YN={}));var JN;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=kh.MessageDirection.serverToClient,t.type=new kh.ProtocolRequestType(t.method)})(JN||(os.WorkDoneProgressCreateRequest=JN={}));var QN;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=kh.MessageDirection.clientToServer,t.type=new kh.ProtocolNotificationType(t.method)})(QN||(os.WorkDoneProgressCancelNotification=QN={}))});var nI=M(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.CallHierarchyOutgoingCallsRequest=ss.CallHierarchyIncomingCallsRequest=ss.CallHierarchyPrepareRequest=void 0;var Zc=bt(),eI;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Zc.MessageDirection.clientToServer,t.type=new Zc.ProtocolRequestType(t.method)})(eI||(ss.CallHierarchyPrepareRequest=eI={}));var tI;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Zc.MessageDirection.clientToServer,t.type=new Zc.ProtocolRequestType(t.method)})(tI||(ss.CallHierarchyIncomingCallsRequest=tI={}));var rI;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Zc.MessageDirection.clientToServer,t.type=new Zc.ProtocolRequestType(t.method)})(rI||(ss.CallHierarchyOutgoingCallsRequest=rI={}))});var uI=M(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.SemanticTokensRefreshRequest=ln.SemanticTokensRangeRequest=ln.SemanticTokensDeltaRequest=ln.SemanticTokensRequest=ln.SemanticTokensRegistrationType=ln.TokenFormat=void 0;var bo=bt(),iI;(function(t){t.Relative="relative"})(iI||(ln.TokenFormat=iI={}));var Bl;(function(t){t.method="textDocument/semanticTokens",t.type=new bo.RegistrationType(t.method)})(Bl||(ln.SemanticTokensRegistrationType=Bl={}));var oI;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.registrationMethod=Bl.method})(oI||(ln.SemanticTokensRequest=oI={}));var sI;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.registrationMethod=Bl.method})(sI||(ln.SemanticTokensDeltaRequest=sI={}));var aI;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.registrationMethod=Bl.method})(aI||(ln.SemanticTokensRangeRequest=aI={}));var cI;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=bo.MessageDirection.serverToClient,t.type=new bo.ProtocolRequestType0(t.method)})(cI||(ln.SemanticTokensRefreshRequest=cI={}))});var dI=M(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.ShowDocumentRequest=void 0;var lI=bt(),fI;(function(t){t.method="window/showDocument",t.messageDirection=lI.MessageDirection.serverToClient,t.type=new lI.ProtocolRequestType(t.method)})(fI||(wh.ShowDocumentRequest=fI={}))});var hI=M(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.LinkedEditingRangeRequest=void 0;var pI=bt(),mI;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=pI.MessageDirection.clientToServer,t.type=new pI.ProtocolRequestType(t.method)})(mI||(Ch.LinkedEditingRangeRequest=mI={}))});var _I=M(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.WillDeleteFilesRequest=jr.DidDeleteFilesNotification=jr.DidRenameFilesNotification=jr.WillRenameFilesRequest=jr.DidCreateFilesNotification=jr.WillCreateFilesRequest=jr.FileOperationPatternKind=void 0;var jn=bt(),gI;(function(t){t.file="file",t.folder="folder"})(gI||(jr.FileOperationPatternKind=gI={}));var yI;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method)})(yI||(jr.WillCreateFilesRequest=yI={}));var vI;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolNotificationType(t.method)})(vI||(jr.DidCreateFilesNotification=vI={}));var TI;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method)})(TI||(jr.WillRenameFilesRequest=TI={}));var RI;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolNotificationType(t.method)})(RI||(jr.DidRenameFilesNotification=RI={}));var xI;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolNotificationType(t.method)})(xI||(jr.DidDeleteFilesNotification=xI={}));var bI;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method)})(bI||(jr.WillDeleteFilesRequest=bI={}))});var EI=M(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.MonikerRequest=as.MonikerKind=as.UniquenessLevel=void 0;var SI=bt(),kI;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(kI||(as.UniquenessLevel=kI={}));var wI;(function(t){t.$import="import",t.$export="export",t.local="local"})(wI||(as.MonikerKind=wI={}));var CI;(function(t){t.method="textDocument/moniker",t.messageDirection=SI.MessageDirection.clientToServer,t.type=new SI.ProtocolRequestType(t.method)})(CI||(as.MonikerRequest=CI={}))});var NI=M(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.TypeHierarchySubtypesRequest=cs.TypeHierarchySupertypesRequest=cs.TypeHierarchyPrepareRequest=void 0;var eu=bt(),PI;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=eu.MessageDirection.clientToServer,t.type=new eu.ProtocolRequestType(t.method)})(PI||(cs.TypeHierarchyPrepareRequest=PI={}));var AI;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=eu.MessageDirection.clientToServer,t.type=new eu.ProtocolRequestType(t.method)})(AI||(cs.TypeHierarchySupertypesRequest=AI={}));var DI;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=eu.MessageDirection.clientToServer,t.type=new eu.ProtocolRequestType(t.method)})(DI||(cs.TypeHierarchySubtypesRequest=DI={}))});var LI=M(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.InlineValueRefreshRequest=tu.InlineValueRequest=void 0;var Eh=bt(),II;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Eh.MessageDirection.clientToServer,t.type=new Eh.ProtocolRequestType(t.method)})(II||(tu.InlineValueRequest=II={}));var OI;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Eh.MessageDirection.serverToClient,t.type=new Eh.ProtocolRequestType0(t.method)})(OI||(tu.InlineValueRefreshRequest=OI={}))});var qI=M(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.InlayHintRefreshRequest=us.InlayHintResolveRequest=us.InlayHintRequest=void 0;var ru=bt(),MI;(function(t){t.method="textDocument/inlayHint",t.messageDirection=ru.MessageDirection.clientToServer,t.type=new ru.ProtocolRequestType(t.method)})(MI||(us.InlayHintRequest=MI={}));var $I;(function(t){t.method="inlayHint/resolve",t.messageDirection=ru.MessageDirection.clientToServer,t.type=new ru.ProtocolRequestType(t.method)})($I||(us.InlayHintResolveRequest=$I={}));var FI;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=ru.MessageDirection.serverToClient,t.type=new ru.ProtocolRequestType0(t.method)})(FI||(us.InlayHintRefreshRequest=FI={}))});var KI=M(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.DiagnosticRefreshRequest=Un.WorkspaceDiagnosticRequest=Un.DocumentDiagnosticRequest=Un.DocumentDiagnosticReportKind=Un.DiagnosticServerCancellationData=void 0;var BI=Ys(),R4=gh(),nu=bt(),jI;(function(t){function e(r){let n=r;return n&&R4.boolean(n.retriggerRequest)}t.is=e})(jI||(Un.DiagnosticServerCancellationData=jI={}));var UI;(function(t){t.Full="full",t.Unchanged="unchanged"})(UI||(Un.DocumentDiagnosticReportKind=UI={}));var WI;(function(t){t.method="textDocument/diagnostic",t.messageDirection=nu.MessageDirection.clientToServer,t.type=new nu.ProtocolRequestType(t.method),t.partialResult=new BI.ProgressType})(WI||(Un.DocumentDiagnosticRequest=WI={}));var HI;(function(t){t.method="workspace/diagnostic",t.messageDirection=nu.MessageDirection.clientToServer,t.type=new nu.ProtocolRequestType(t.method),t.partialResult=new BI.ProgressType})(HI||(Un.WorkspaceDiagnosticRequest=HI={}));var GI;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=nu.MessageDirection.serverToClient,t.type=new nu.ProtocolRequestType0(t.method)})(GI||(Un.DiagnosticRefreshRequest=GI={}))});var ZI=M(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.DidCloseNotebookDocumentNotification=Ft.DidSaveNotebookDocumentNotification=Ft.DidChangeNotebookDocumentNotification=Ft.NotebookCellArrayChange=Ft.DidOpenNotebookDocumentNotification=Ft.NotebookDocumentSyncRegistrationType=Ft.NotebookDocument=Ft.NotebookCell=Ft.ExecutionSummary=Ft.NotebookCellKind=void 0;var Kl=(hh(),ug(mh)),pi=gh(),qi=bt(),ib;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(ib||(Ft.NotebookCellKind=ib={}));var ob;(function(t){function e(i,o){let s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}t.create=e;function r(i){let o=i;return pi.objectLiteral(o)&&Kl.uinteger.is(o.executionOrder)&&(o.success===void 0||pi.boolean(o.success))}t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=n})(ob||(Ft.ExecutionSummary=ob={}));var Ph;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return pi.objectLiteral(s)&&ib.is(s.kind)&&Kl.DocumentUri.is(s.document)&&(s.metadata===void 0||pi.objectLiteral(s.metadata))}t.is=r;function n(o,s){let a=new Set;return o.document!==s.document&&a.add("document"),o.kind!==s.kind&&a.add("kind"),o.executionSummary!==s.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!ob.equals(o.executionSummary,s.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!="object")return!1;let a=Array.isArray(o),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(o.length!==s.length)return!1;for(let u=0;u<o.length;u++)if(!i(o[u],s[u]))return!1}if(pi.objectLiteral(o)&&pi.objectLiteral(s)){let u=Object.keys(o),l=Object.keys(s);if(u.length!==l.length||(u.sort(),l.sort(),!i(u,l)))return!1;for(let f=0;f<u.length;f++){let g=u[f];if(!i(o[g],s[g]))return!1}}return!0}})(Ph||(Ft.NotebookCell=Ph={}));var zI;(function(t){function e(n,i,o,s){return{uri:n,notebookType:i,version:o,cells:s}}t.create=e;function r(n){let i=n;return pi.objectLiteral(i)&&pi.string(i.uri)&&Kl.integer.is(i.version)&&pi.typedArray(i.cells,Ph.is)}t.is=r})(zI||(Ft.NotebookDocument=zI={}));var iu;(function(t){t.method="notebookDocument/sync",t.messageDirection=qi.MessageDirection.clientToServer,t.type=new qi.RegistrationType(t.method)})(iu||(Ft.NotebookDocumentSyncRegistrationType=iu={}));var VI;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=qi.MessageDirection.clientToServer,t.type=new qi.ProtocolNotificationType(t.method),t.registrationMethod=iu.method})(VI||(Ft.DidOpenNotebookDocumentNotification=VI={}));var XI;(function(t){function e(n){let i=n;return pi.objectLiteral(i)&&Kl.uinteger.is(i.start)&&Kl.uinteger.is(i.deleteCount)&&(i.cells===void 0||pi.typedArray(i.cells,Ph.is))}t.is=e;function r(n,i,o){let s={start:n,deleteCount:i};return o!==void 0&&(s.cells=o),s}t.create=r})(XI||(Ft.NotebookCellArrayChange=XI={}));var YI;(function(t){t.method="notebookDocument/didChange",t.messageDirection=qi.MessageDirection.clientToServer,t.type=new qi.ProtocolNotificationType(t.method),t.registrationMethod=iu.method})(YI||(Ft.DidChangeNotebookDocumentNotification=YI={}));var JI;(function(t){t.method="notebookDocument/didSave",t.messageDirection=qi.MessageDirection.clientToServer,t.type=new qi.ProtocolNotificationType(t.method),t.registrationMethod=iu.method})(JI||(Ft.DidSaveNotebookDocumentNotification=JI={}));var QI;(function(t){t.method="notebookDocument/didClose",t.messageDirection=qi.MessageDirection.clientToServer,t.type=new qi.ProtocolNotificationType(t.method),t.registrationMethod=iu.method})(QI||(Ft.DidCloseNotebookDocumentNotification=QI={}))});var r0=M(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.InlineCompletionRequest=void 0;var e0=bt(),t0;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=e0.MessageDirection.clientToServer,t.type=new e0.ProtocolRequestType(t.method)})(t0||(Ah.InlineCompletionRequest=t0={}))});var hO=M(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.WorkspaceSymbolRequest=x.CodeActionResolveRequest=x.CodeActionRequest=x.DocumentSymbolRequest=x.DocumentHighlightRequest=x.ReferencesRequest=x.DefinitionRequest=x.SignatureHelpRequest=x.SignatureHelpTriggerKind=x.HoverRequest=x.CompletionResolveRequest=x.CompletionRequest=x.CompletionTriggerKind=x.PublishDiagnosticsNotification=x.WatchKind=x.RelativePattern=x.FileChangeType=x.DidChangeWatchedFilesNotification=x.WillSaveTextDocumentWaitUntilRequest=x.WillSaveTextDocumentNotification=x.TextDocumentSaveReason=x.DidSaveTextDocumentNotification=x.DidCloseTextDocumentNotification=x.DidChangeTextDocumentNotification=x.TextDocumentContentChangeEvent=x.DidOpenTextDocumentNotification=x.TextDocumentSyncKind=x.TelemetryEventNotification=x.LogMessageNotification=x.ShowMessageRequest=x.ShowMessageNotification=x.MessageType=x.DidChangeConfigurationNotification=x.ExitNotification=x.ShutdownRequest=x.InitializedNotification=x.InitializeErrorCodes=x.InitializeRequest=x.WorkDoneProgressOptions=x.TextDocumentRegistrationOptions=x.StaticRegistrationOptions=x.PositionEncodingKind=x.FailureHandlingKind=x.ResourceOperationKind=x.UnregistrationRequest=x.RegistrationRequest=x.DocumentSelector=x.NotebookCellTextDocumentFilter=x.NotebookDocumentFilter=x.TextDocumentFilter=void 0;x.MonikerRequest=x.MonikerKind=x.UniquenessLevel=x.WillDeleteFilesRequest=x.DidDeleteFilesNotification=x.WillRenameFilesRequest=x.DidRenameFilesNotification=x.WillCreateFilesRequest=x.DidCreateFilesNotification=x.FileOperationPatternKind=x.LinkedEditingRangeRequest=x.ShowDocumentRequest=x.SemanticTokensRegistrationType=x.SemanticTokensRefreshRequest=x.SemanticTokensRangeRequest=x.SemanticTokensDeltaRequest=x.SemanticTokensRequest=x.TokenFormat=x.CallHierarchyPrepareRequest=x.CallHierarchyOutgoingCallsRequest=x.CallHierarchyIncomingCallsRequest=x.WorkDoneProgressCancelNotification=x.WorkDoneProgressCreateRequest=x.WorkDoneProgress=x.SelectionRangeRequest=x.DeclarationRequest=x.FoldingRangeRefreshRequest=x.FoldingRangeRequest=x.ColorPresentationRequest=x.DocumentColorRequest=x.ConfigurationRequest=x.DidChangeWorkspaceFoldersNotification=x.WorkspaceFoldersRequest=x.TypeDefinitionRequest=x.ImplementationRequest=x.ApplyWorkspaceEditRequest=x.ExecuteCommandRequest=x.PrepareRenameRequest=x.RenameRequest=x.PrepareSupportDefaultBehavior=x.DocumentOnTypeFormattingRequest=x.DocumentRangesFormattingRequest=x.DocumentRangeFormattingRequest=x.DocumentFormattingRequest=x.DocumentLinkResolveRequest=x.DocumentLinkRequest=x.CodeLensRefreshRequest=x.CodeLensResolveRequest=x.CodeLensRequest=x.WorkspaceSymbolResolveRequest=void 0;x.InlineCompletionRequest=x.DidCloseNotebookDocumentNotification=x.DidSaveNotebookDocumentNotification=x.DidChangeNotebookDocumentNotification=x.NotebookCellArrayChange=x.DidOpenNotebookDocumentNotification=x.NotebookDocumentSyncRegistrationType=x.NotebookDocument=x.NotebookCell=x.ExecutionSummary=x.NotebookCellKind=x.DiagnosticRefreshRequest=x.WorkspaceDiagnosticRequest=x.DocumentDiagnosticRequest=x.DocumentDiagnosticReportKind=x.DiagnosticServerCancellationData=x.InlayHintRefreshRequest=x.InlayHintResolveRequest=x.InlayHintRequest=x.InlineValueRefreshRequest=x.InlineValueRequest=x.TypeHierarchySupertypesRequest=x.TypeHierarchySubtypesRequest=x.TypeHierarchyPrepareRequest=void 0;var W=bt(),n0=(hh(),ug(mh)),gr=gh(),x4=EN();Object.defineProperty(x,"ImplementationRequest",{enumerable:!0,get:function(){return x4.ImplementationRequest}});var b4=DN();Object.defineProperty(x,"TypeDefinitionRequest",{enumerable:!0,get:function(){return b4.TypeDefinitionRequest}});var fO=ON();Object.defineProperty(x,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return fO.WorkspaceFoldersRequest}});Object.defineProperty(x,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return fO.DidChangeWorkspaceFoldersNotification}});var _4=$N();Object.defineProperty(x,"ConfigurationRequest",{enumerable:!0,get:function(){return _4.ConfigurationRequest}});var dO=jN();Object.defineProperty(x,"DocumentColorRequest",{enumerable:!0,get:function(){return dO.DocumentColorRequest}});Object.defineProperty(x,"ColorPresentationRequest",{enumerable:!0,get:function(){return dO.ColorPresentationRequest}});var pO=HN();Object.defineProperty(x,"FoldingRangeRequest",{enumerable:!0,get:function(){return pO.FoldingRangeRequest}});Object.defineProperty(x,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return pO.FoldingRangeRefreshRequest}});var S4=KN();Object.defineProperty(x,"DeclarationRequest",{enumerable:!0,get:function(){return S4.DeclarationRequest}});var k4=XN();Object.defineProperty(x,"SelectionRangeRequest",{enumerable:!0,get:function(){return k4.SelectionRangeRequest}});var lb=ZN();Object.defineProperty(x,"WorkDoneProgress",{enumerable:!0,get:function(){return lb.WorkDoneProgress}});Object.defineProperty(x,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return lb.WorkDoneProgressCreateRequest}});Object.defineProperty(x,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return lb.WorkDoneProgressCancelNotification}});var fb=nI();Object.defineProperty(x,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return fb.CallHierarchyIncomingCallsRequest}});Object.defineProperty(x,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return fb.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(x,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return fb.CallHierarchyPrepareRequest}});var ou=uI();Object.defineProperty(x,"TokenFormat",{enumerable:!0,get:function(){return ou.TokenFormat}});Object.defineProperty(x,"SemanticTokensRequest",{enumerable:!0,get:function(){return ou.SemanticTokensRequest}});Object.defineProperty(x,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ou.SemanticTokensDeltaRequest}});Object.defineProperty(x,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ou.SemanticTokensRangeRequest}});Object.defineProperty(x,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ou.SemanticTokensRefreshRequest}});Object.defineProperty(x,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ou.SemanticTokensRegistrationType}});var w4=dI();Object.defineProperty(x,"ShowDocumentRequest",{enumerable:!0,get:function(){return w4.ShowDocumentRequest}});var C4=hI();Object.defineProperty(x,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return C4.LinkedEditingRangeRequest}});var Zs=_I();Object.defineProperty(x,"FileOperationPatternKind",{enumerable:!0,get:function(){return Zs.FileOperationPatternKind}});Object.defineProperty(x,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Zs.DidCreateFilesNotification}});Object.defineProperty(x,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Zs.WillCreateFilesRequest}});Object.defineProperty(x,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Zs.DidRenameFilesNotification}});Object.defineProperty(x,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Zs.WillRenameFilesRequest}});Object.defineProperty(x,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Zs.DidDeleteFilesNotification}});Object.defineProperty(x,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Zs.WillDeleteFilesRequest}});var db=EI();Object.defineProperty(x,"UniquenessLevel",{enumerable:!0,get:function(){return db.UniquenessLevel}});Object.defineProperty(x,"MonikerKind",{enumerable:!0,get:function(){return db.MonikerKind}});Object.defineProperty(x,"MonikerRequest",{enumerable:!0,get:function(){return db.MonikerRequest}});var pb=NI();Object.defineProperty(x,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return pb.TypeHierarchyPrepareRequest}});Object.defineProperty(x,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return pb.TypeHierarchySubtypesRequest}});Object.defineProperty(x,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return pb.TypeHierarchySupertypesRequest}});var mO=LI();Object.defineProperty(x,"InlineValueRequest",{enumerable:!0,get:function(){return mO.InlineValueRequest}});Object.defineProperty(x,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return mO.InlineValueRefreshRequest}});var mb=qI();Object.defineProperty(x,"InlayHintRequest",{enumerable:!0,get:function(){return mb.InlayHintRequest}});Object.defineProperty(x,"InlayHintResolveRequest",{enumerable:!0,get:function(){return mb.InlayHintResolveRequest}});Object.defineProperty(x,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return mb.InlayHintRefreshRequest}});var zl=KI();Object.defineProperty(x,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return zl.DiagnosticServerCancellationData}});Object.defineProperty(x,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return zl.DocumentDiagnosticReportKind}});Object.defineProperty(x,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return zl.DocumentDiagnosticRequest}});Object.defineProperty(x,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return zl.WorkspaceDiagnosticRequest}});Object.defineProperty(x,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return zl.DiagnosticRefreshRequest}});var ji=ZI();Object.defineProperty(x,"NotebookCellKind",{enumerable:!0,get:function(){return ji.NotebookCellKind}});Object.defineProperty(x,"ExecutionSummary",{enumerable:!0,get:function(){return ji.ExecutionSummary}});Object.defineProperty(x,"NotebookCell",{enumerable:!0,get:function(){return ji.NotebookCell}});Object.defineProperty(x,"NotebookDocument",{enumerable:!0,get:function(){return ji.NotebookDocument}});Object.defineProperty(x,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ji.NotebookDocumentSyncRegistrationType}});Object.defineProperty(x,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ji.DidOpenNotebookDocumentNotification}});Object.defineProperty(x,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ji.NotebookCellArrayChange}});Object.defineProperty(x,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ji.DidChangeNotebookDocumentNotification}});Object.defineProperty(x,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ji.DidSaveNotebookDocumentNotification}});Object.defineProperty(x,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ji.DidCloseNotebookDocumentNotification}});var E4=r0();Object.defineProperty(x,"InlineCompletionRequest",{enumerable:!0,get:function(){return E4.InlineCompletionRequest}});var sb;(function(t){function e(r){let n=r;return gr.string(n)||gr.string(n.language)||gr.string(n.scheme)||gr.string(n.pattern)}t.is=e})(sb||(x.TextDocumentFilter=sb={}));var ab;(function(t){function e(r){let n=r;return gr.objectLiteral(n)&&(gr.string(n.notebookType)||gr.string(n.scheme)||gr.string(n.pattern))}t.is=e})(ab||(x.NotebookDocumentFilter=ab={}));var cb;(function(t){function e(r){let n=r;return gr.objectLiteral(n)&&(gr.string(n.notebook)||ab.is(n.notebook))&&(n.language===void 0||gr.string(n.language))}t.is=e})(cb||(x.NotebookCellTextDocumentFilter=cb={}));var ub;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!gr.string(n)&&!sb.is(n)&&!cb.is(n))return!1;return!0}t.is=e})(ub||(x.DocumentSelector=ub={}));var i0;(function(t){t.method="client/registerCapability",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(i0||(x.RegistrationRequest=i0={}));var o0;(function(t){t.method="client/unregisterCapability",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(o0||(x.UnregistrationRequest=o0={}));var s0;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(s0||(x.ResourceOperationKind=s0={}));var a0;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(a0||(x.FailureHandlingKind=a0={}));var c0;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(c0||(x.PositionEncodingKind=c0={}));var u0;(function(t){function e(r){let n=r;return n&&gr.string(n.id)&&n.id.length>0}t.hasId=e})(u0||(x.StaticRegistrationOptions=u0={}));var l0;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||ub.is(n.documentSelector))}t.is=e})(l0||(x.TextDocumentRegistrationOptions=l0={}));var f0;(function(t){function e(n){let i=n;return gr.objectLiteral(i)&&(i.workDoneProgress===void 0||gr.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&gr.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(f0||(x.WorkDoneProgressOptions=f0={}));var d0;(function(t){t.method="initialize",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(d0||(x.InitializeRequest=d0={}));var p0;(function(t){t.unknownProtocolVersion=1})(p0||(x.InitializeErrorCodes=p0={}));var m0;(function(t){t.method="initialized",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(m0||(x.InitializedNotification=m0={}));var h0;(function(t){t.method="shutdown",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType0(t.method)})(h0||(x.ShutdownRequest=h0={}));var g0;(function(t){t.method="exit",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType0(t.method)})(g0||(x.ExitNotification=g0={}));var y0;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(y0||(x.DidChangeConfigurationNotification=y0={}));var v0;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(v0||(x.MessageType=v0={}));var T0;(function(t){t.method="window/showMessage",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(T0||(x.ShowMessageNotification=T0={}));var R0;(function(t){t.method="window/showMessageRequest",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(R0||(x.ShowMessageRequest=R0={}));var x0;(function(t){t.method="window/logMessage",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(x0||(x.LogMessageNotification=x0={}));var b0;(function(t){t.method="telemetry/event",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(b0||(x.TelemetryEventNotification=b0={}));var _0;(function(t){t.None=0,t.Full=1,t.Incremental=2})(_0||(x.TextDocumentSyncKind=_0={}));var S0;(function(t){t.method="textDocument/didOpen",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(S0||(x.DidOpenTextDocumentNotification=S0={}));var k0;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(k0||(x.TextDocumentContentChangeEvent=k0={}));var w0;(function(t){t.method="textDocument/didChange",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(w0||(x.DidChangeTextDocumentNotification=w0={}));var C0;(function(t){t.method="textDocument/didClose",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(C0||(x.DidCloseTextDocumentNotification=C0={}));var E0;(function(t){t.method="textDocument/didSave",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(E0||(x.DidSaveTextDocumentNotification=E0={}));var P0;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(P0||(x.TextDocumentSaveReason=P0={}));var A0;(function(t){t.method="textDocument/willSave",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(A0||(x.WillSaveTextDocumentNotification=A0={}));var D0;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(D0||(x.WillSaveTextDocumentWaitUntilRequest=D0={}));var N0;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(N0||(x.DidChangeWatchedFilesNotification=N0={}));var I0;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(I0||(x.FileChangeType=I0={}));var O0;(function(t){function e(r){let n=r;return gr.objectLiteral(n)&&(n0.URI.is(n.baseUri)||n0.WorkspaceFolder.is(n.baseUri))&&gr.string(n.pattern)}t.is=e})(O0||(x.RelativePattern=O0={}));var L0;(function(t){t.Create=1,t.Change=2,t.Delete=4})(L0||(x.WatchKind=L0={}));var M0;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(M0||(x.PublishDiagnosticsNotification=M0={}));var $0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})($0||(x.CompletionTriggerKind=$0={}));var F0;(function(t){t.method="textDocument/completion",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(F0||(x.CompletionRequest=F0={}));var q0;(function(t){t.method="completionItem/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(q0||(x.CompletionResolveRequest=q0={}));var j0;(function(t){t.method="textDocument/hover",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(j0||(x.HoverRequest=j0={}));var U0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(U0||(x.SignatureHelpTriggerKind=U0={}));var W0;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(W0||(x.SignatureHelpRequest=W0={}));var H0;(function(t){t.method="textDocument/definition",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(H0||(x.DefinitionRequest=H0={}));var G0;(function(t){t.method="textDocument/references",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(G0||(x.ReferencesRequest=G0={}));var B0;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(B0||(x.DocumentHighlightRequest=B0={}));var K0;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(K0||(x.DocumentSymbolRequest=K0={}));var z0;(function(t){t.method="textDocument/codeAction",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(z0||(x.CodeActionRequest=z0={}));var V0;(function(t){t.method="codeAction/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(V0||(x.CodeActionResolveRequest=V0={}));var X0;(function(t){t.method="workspace/symbol",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(X0||(x.WorkspaceSymbolRequest=X0={}));var Y0;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Y0||(x.WorkspaceSymbolResolveRequest=Y0={}));var J0;(function(t){t.method="textDocument/codeLens",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(J0||(x.CodeLensRequest=J0={}));var Q0;(function(t){t.method="codeLens/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Q0||(x.CodeLensResolveRequest=Q0={}));var Z0;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType0(t.method)})(Z0||(x.CodeLensRefreshRequest=Z0={}));var eO;(function(t){t.method="textDocument/documentLink",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(eO||(x.DocumentLinkRequest=eO={}));var tO;(function(t){t.method="documentLink/resolve",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(tO||(x.DocumentLinkResolveRequest=tO={}));var rO;(function(t){t.method="textDocument/formatting",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(rO||(x.DocumentFormattingRequest=rO={}));var nO;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(nO||(x.DocumentRangeFormattingRequest=nO={}));var iO;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(iO||(x.DocumentRangesFormattingRequest=iO={}));var oO;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(oO||(x.DocumentOnTypeFormattingRequest=oO={}));var sO;(function(t){t.Identifier=1})(sO||(x.PrepareSupportDefaultBehavior=sO={}));var aO;(function(t){t.method="textDocument/rename",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(aO||(x.RenameRequest=aO={}));var cO;(function(t){t.method="textDocument/prepareRename",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(cO||(x.PrepareRenameRequest=cO={}));var uO;(function(t){t.method="workspace/executeCommand",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(uO||(x.ExecuteCommandRequest=uO={}));var lO;(function(t){t.method="workspace/applyEdit",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType("workspace/applyEdit")})(lO||(x.ApplyWorkspaceEditRequest=lO={}))});var yO=M(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.createProtocolConnection=void 0;var gO=Ys();function P4(t,e,r,n){return gO.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,gO.createMessageConnection)(t,e,r,n)}Dh.createProtocolConnection=P4});var TO=M(fn=>{"use strict";var A4=fn&&fn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Nh=fn&&fn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A4(e,t,r)};Object.defineProperty(fn,"__esModule",{value:!0});fn.LSPErrorCodes=fn.createProtocolConnection=void 0;Nh(Ys(),fn);Nh((hh(),ug(mh)),fn);Nh(bt(),fn);Nh(hO(),fn);var D4=yO();Object.defineProperty(fn,"createProtocolConnection",{enumerable:!0,get:function(){return D4.createProtocolConnection}});var vO;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(vO||(fn.LSPErrorCodes=vO={}))});var Gt=M(Ui=>{"use strict";var N4=Ui&&Ui.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),RO=Ui&&Ui.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N4(e,t,r)};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.createProtocolConnection=void 0;var I4=YR();RO(YR(),Ui);RO(TO(),Ui);function O4(t,e,r,n){return(0,I4.createMessageConnection)(t,e,r,n)}Ui.createProtocolConnection=O4});var gb=M(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.SemanticTokensBuilder=ls.SemanticTokensDiff=ls.SemanticTokensFeature=void 0;var Ih=Gt(),L4=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ih.SemanticTokensRefreshRequest.type),on:e=>{let r=Ih.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Ih.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Ih.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ls.SemanticTokensFeature=L4;var Oh=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,o=r-1;for(;i>=n&&o>=n&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<n||o<n)&&(i++,o++);let s=i-n+1,a=this.modifiedSequence.slice(n,o+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:s-1}]:[{start:n,deleteCount:s,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};ls.SemanticTokensDiff=Oh;var hb=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,r,n,i,o){let s=e,a=r;this._dataLen>0&&(s-=this._prevLine,s===0&&(a-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=r}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 Oh(this._prevData,this._data).computeDiff()}:this.build()}};ls.SemanticTokensBuilder=hb});var xO=M(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.InlineCompletionFeature=void 0;var M4=Gt(),$4=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(M4.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Lh.InlineCompletionFeature=$4});var vb=M(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.TextDocuments=void 0;var ea=Gt(),yb=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ea.Emitter,this._onDidOpen=new ea.Emitter,this._onDidClose=new ea.Emitter,this._onDidSave=new ea.Emitter,this._onWillSave=new ea.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=ea.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,o=n.contentChanges;if(o.length===0)return;let{version:s}=i;if(s==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,o,s),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let o=this._syncedDocuments.get(n.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ea.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};Mh.TextDocuments=yb});var Rb=M(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.NotebookDocuments=su.NotebookSyncFeature=void 0;var Wn=Gt(),bO=vb(),F4=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Wn.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Wn.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Wn.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Wn.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};su.NotebookSyncFeature=F4;var $h=class t{onDidOpenTextDocument(e){return this.openHandler=e,Wn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Wn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Wn.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}};$h.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Tb=class{constructor(e){e instanceof bO.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new bO.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Wn.Emitter,this._onDidChange=new Wn.Emitter,this._onDidSave=new Wn.Emitter,this._onDidClose=new Wn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new $h,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)r.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let s=o.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,o.metadata=c.metadata);let u=[],l=[],f=[],g=[];if(c.cells!==void 0){let E=c.cells;if(E.structure!==void 0){let m=E.structure.array;if(o.cells.splice(m.start,m.deleteCount,...m.cells!==void 0?m.cells:[]),E.structure.didOpen!==void 0)for(let d of E.structure.didOpen)r.openTextDocument({textDocument:d}),u.push(d.uri);if(E.structure.didClose)for(let d of E.structure.didClose)r.closeTextDocument({textDocument:d}),l.push(d.uri)}if(E.data!==void 0){let m=new Map(E.data.map(d=>[d.document,d]));for(let d=0;d<=o.cells.length;d++){let _=m.get(o.cells[d].document);if(_!==void 0){let $=o.cells.splice(d,1,_);if(f.push({old:$[0],new:_}),m.delete(_.document),m.size===0)break}}}if(E.textContent!==void 0)for(let m of E.textContent)r.changeTextDocument({textDocument:m.document,contentChanges:m.changes}),g.push(m.document.uri)}this.updateCellMap(o);let T={notebookDocument:o};a&&(T.metadata={old:s,new:o.metadata});let C=[];for(let E of u)C.push(this.getNotebookCell(E));let P=[];for(let E of l)P.push(this.getNotebookCell(E));let O=[];for(let E of g)O.push(this.getNotebookCell(E));(C.length>0||P.length>0||f.length>0||O.length>0)&&(T.cells={added:C,removed:P,changed:{data:f,textContent:O}}),(T.metadata!==void 0||T.cells!==void 0)&&this._onDidChange.fire(T)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let s of i.cellTextDocuments)r.closeTextDocument({textDocument:s});this.notebookDocuments.delete(i.notebookDocument.uri);for(let s of o.cells)this.notebookCellMap.delete(s.document)}})),Wn.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};su.NotebookDocuments=Tb});var xb=M(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.thenable=tr.typedArray=tr.stringArray=tr.array=tr.func=tr.error=tr.number=tr.string=tr.boolean=void 0;function q4(t){return t===!0||t===!1}tr.boolean=q4;function _O(t){return typeof t=="string"||t instanceof String}tr.string=_O;function j4(t){return typeof t=="number"||t instanceof Number}tr.number=j4;function U4(t){return t instanceof Error}tr.error=U4;function SO(t){return typeof t=="function"}tr.func=SO;function kO(t){return Array.isArray(t)}tr.array=kO;function W4(t){return kO(t)&&t.every(e=>_O(e))}tr.stringArray=W4;function H4(t,e){return Array.isArray(t)&&t.every(e)}tr.typedArray=H4;function G4(t){return t&&SO(t.then)}tr.thenable=G4});var bb=M(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.generateUuid=Hn.parse=Hn.isUUID=Hn.v4=Hn.empty=void 0;var Vl=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Xl=class t extends Vl{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(""))}};Xl._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Xl._timeHighBits=["8","9","a","b"];Hn.empty=new Vl("00000000-0000-0000-0000-000000000000");function wO(){return new Xl}Hn.v4=wO;var B4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function CO(t){return B4.test(t)}Hn.isUUID=CO;function K4(t){if(!CO(t))throw new Error("invalid uuid");return new Vl(t)}Hn.parse=K4;function z4(){return wO().asHex()}Hn.generateUuid=z4});var EO=M(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.attachPartialResult=ds.ProgressFeature=ds.attachWorkDone=void 0;var fs=Gt(),V4=bb(),ta=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let o={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(fs.WorkDoneProgress.type,this._token,o)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(fs.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(fs.WorkDoneProgress.type,this._token,{kind:"end"})}};ta.Instances=new Map;var Fh=class extends ta{constructor(e,r){super(e,r),this._source=new fs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Yl=class{constructor(){}begin(){}report(){}done(){}},qh=class extends Yl{constructor(){super(),this._source=new fs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function X4(t,e){if(e===void 0||e.workDoneToken===void 0)return new Yl;let r=e.workDoneToken;return delete e.workDoneToken,new ta(t,r)}ds.attachWorkDone=X4;var Y4=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(fs.WorkDoneProgressCancelNotification.type,r=>{let n=ta.Instances.get(r.token);(n instanceof Fh||n instanceof qh)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Yl:new ta(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,V4.generateUuid)();return this.connection.sendRequest(fs.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Fh(this.connection,e))}else return Promise.resolve(new qh)}};ds.ProgressFeature=Y4;var _b;(function(t){t.type=new fs.ProgressType})(_b||(_b={}));var Sb=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(_b.type,this._token,e)}};function J4(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new Sb(t,r)}ds.attachPartialResult=J4});var PO=M(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.ConfigurationFeature=void 0;var Q4=Gt(),Z4=xb(),e8=t=>class extends t{getConfiguration(e){return e?Z4.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Q4.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};jh.ConfigurationFeature=e8});var AO=M(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.WorkspaceFoldersFeature=void 0;var Uh=Gt(),t8=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Uh.Emitter,this.connection.onNotification(Uh.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Uh.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(Uh.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Wh.WorkspaceFoldersFeature=t8});var DO=M(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.CallHierarchyFeature=void 0;var kb=Gt(),r8=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(kb.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=kb.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=kb.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Hh.CallHierarchyFeature=r8});var NO=M(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.ShowDocumentFeature=void 0;var n8=Gt(),i8=t=>class extends t{showDocument(e){return this.connection.sendRequest(n8.ShowDocumentRequest.type,e)}};Gh.ShowDocumentFeature=i8});var IO=M(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.FileOperationsFeature=void 0;var au=Gt(),o8=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(au.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(au.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(au.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(au.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(au.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(au.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};Bh.FileOperationsFeature=o8});var OO=M(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.LinkedEditingRangeFeature=void 0;var s8=Gt(),a8=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(s8.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};Kh.LinkedEditingRangeFeature=a8});var LO=M(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.TypeHierarchyFeature=void 0;var wb=Gt(),c8=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(wb.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=wb.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=wb.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};zh.TypeHierarchyFeature=c8});var $O=M(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.InlineValueFeature=void 0;var MO=Gt(),u8=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(MO.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(MO.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Vh.InlineValueFeature=u8});var qO=M(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.FoldingRangeFeature=void 0;var FO=Gt(),l8=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(FO.FoldingRangeRefreshRequest.type),on:e=>{let r=FO.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Xh.FoldingRangeFeature=l8});var jO=M(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.InlayHintFeature=void 0;var Cb=Gt(),f8=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Cb.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Cb.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(Cb.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};Yh.InlayHintFeature=f8});var UO=M(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.DiagnosticFeature=void 0;var Jl=Gt(),d8=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Jl.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Jl.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Jl.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(Jl.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Jl.WorkspaceDiagnosticRequest.partialResult,r)))}}};Jh.DiagnosticFeature=d8});var WO=M(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.MonikerFeature=void 0;var p8=Gt(),m8=t=>class extends t{get moniker(){return{on:e=>{let r=p8.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Qh.MonikerFeature=m8});var nL=M(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.createConnection=je.combineFeatures=je.combineNotebooksFeatures=je.combineLanguagesFeatures=je.combineWorkspaceFeatures=je.combineWindowFeatures=je.combineClientFeatures=je.combineTracerFeatures=je.combineTelemetryFeatures=je.combineConsoleFeatures=je._NotebooksImpl=je._LanguagesImpl=je.BulkUnregistration=je.BulkRegistration=je.ErrorMessageTracker=void 0;var K=Gt(),Gn=xb(),Pb=bb(),ge=EO(),h8=PO(),g8=AO(),y8=DO(),v8=gb(),T8=NO(),R8=IO(),x8=OO(),b8=LO(),_8=$O(),S8=qO(),k8=jO(),w8=UO(),C8=Rb(),E8=WO();function Eb(t){if(t!==null)return t}var Ab=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};je.ErrorMessageTracker=Ab;var Zh=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(K.MessageType.Error,e)}warn(e){this.send(K.MessageType.Warning,e)}info(e){this.send(K.MessageType.Info,e)}log(e){this.send(K.MessageType.Log,e)}debug(e){this.send(K.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(K.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,K.RAL)().console.error("Sending log message failed")})}},Db=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,...r){let n={type:K.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(Eb)}showWarningMessage(e,...r){let n={type:K.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(Eb)}showInformationMessage(e,...r){let n={type:K.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(Eb)}},HO=(0,T8.ShowDocumentFeature)((0,ge.ProgressFeature)(Db)),GO;(function(t){function e(){return new eg}t.create=e})(GO||(je.BulkRegistration=GO={}));var eg=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Gn.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=Pb.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},BO;(function(t){function e(){return new Ql(void 0,[])}t.create=e})(BO||(je.BulkUnregistration=BO={}));var Ql=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(K.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Gn.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(K.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},o=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},tg=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,r,n){return e instanceof eg?this.registerMany(e):e instanceof Ql?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=Gn.string(r)?r:r.method,o=Pb.generateUuid(),s={registrations:[{id:o,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(K.RegistrationRequest.type,s).then(a=>(e.add({id:o,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=Gn.string(e)?e:e.method,i=Pb.generateUuid(),o={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(K.RegistrationRequest.type,o).then(s=>K.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(s)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(K.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(K.RegistrationRequest.type,r).then(()=>new Ql(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},Nb=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 r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(K.ApplyWorkspaceEditRequest.type,n)}},KO=(0,R8.FileOperationsFeature)((0,g8.WorkspaceFoldersFeature)((0,h8.ConfigurationFeature)(Nb))),rg=class{constructor(){this._trace=K.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==K.Trace.Off&&this.connection.sendNotification(K.LogTraceNotification.type,{message:e,verbose:this._trace===K.Trace.Verbose?r:void 0}).catch(()=>{})}},ng=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(K.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},ig=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,r){return(0,ge.attachPartialResult)(this.connection,r)}};je._LanguagesImpl=ig;var zO=(0,S8.FoldingRangeFeature)((0,E8.MonikerFeature)((0,w8.DiagnosticFeature)((0,k8.InlayHintFeature)((0,_8.InlineValueFeature)((0,b8.TypeHierarchyFeature)((0,x8.LinkedEditingRangeFeature)((0,v8.SemanticTokensFeature)((0,y8.CallHierarchyFeature)(ig))))))))),og=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,r){return(0,ge.attachPartialResult)(this.connection,r)}};je._NotebooksImpl=og;var VO=(0,C8.NotebookSyncFeature)(og);function XO(t,e){return function(r){return e(t(r))}}je.combineConsoleFeatures=XO;function YO(t,e){return function(r){return e(t(r))}}je.combineTelemetryFeatures=YO;function JO(t,e){return function(r){return e(t(r))}}je.combineTracerFeatures=JO;function QO(t,e){return function(r){return e(t(r))}}je.combineClientFeatures=QO;function ZO(t,e){return function(r){return e(t(r))}}je.combineWindowFeatures=ZO;function eL(t,e){return function(r){return e(t(r))}}je.combineWorkspaceFeatures=eL;function tL(t,e){return function(r){return e(t(r))}}je.combineLanguagesFeatures=tL;function rL(t,e){return function(r){return e(t(r))}}je.combineNotebooksFeatures=rL;function P8(t,e){function r(i,o,s){return i&&o?s(i,o):i||o}return{__brand:"features",console:r(t.console,e.console,XO),tracer:r(t.tracer,e.tracer,JO),telemetry:r(t.telemetry,e.telemetry,YO),client:r(t.client,e.client,QO),window:r(t.window,e.window,ZO),workspace:r(t.workspace,e.workspace,eL),languages:r(t.languages,e.languages,tL),notebooks:r(t.notebooks,e.notebooks,rL)}}je.combineFeatures=P8;function A8(t,e,r){let n=r&&r.console?new(r.console(Zh)):new Zh,i=t(n);n.rawAttach(i);let o=r&&r.tracer?new(r.tracer(rg)):new rg,s=r&&r.telemetry?new(r.telemetry(ng)):new ng,a=r&&r.client?new(r.client(tg)):new tg,c=r&&r.window?new(r.window(HO)):new HO,u=r&&r.workspace?new(r.workspace(KO)):new KO,l=r&&r.languages?new(r.languages(zO)):new zO,f=r&&r.notebooks?new(r.notebooks(VO)):new VO,g=[n,o,s,a,c,u,l,f];function T(m){return m instanceof Promise?m:Gn.thenable(m)?new Promise((d,_)=>{m.then($=>d($),$=>_($))}):Promise.resolve(m)}let C,P,O,E={listen:()=>i.listen(),sendRequest:(m,...d)=>i.sendRequest(Gn.string(m)?m:m.method,...d),onRequest:(m,d)=>i.onRequest(m,d),sendNotification:(m,d)=>{let _=Gn.string(m)?m:m.method;return i.sendNotification(_,d)},onNotification:(m,d)=>i.onNotification(m,d),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:m=>(P=m,{dispose:()=>{P=void 0}}),onInitialized:m=>i.onNotification(K.InitializedNotification.type,m),onShutdown:m=>(C=m,{dispose:()=>{C=void 0}}),onExit:m=>(O=m,{dispose:()=>{O=void 0}}),get console(){return n},get telemetry(){return s},get tracer(){return o},get client(){return a},get window(){return c},get workspace(){return u},get languages(){return l},get notebooks(){return f},onDidChangeConfiguration:m=>i.onNotification(K.DidChangeConfigurationNotification.type,m),onDidChangeWatchedFiles:m=>i.onNotification(K.DidChangeWatchedFilesNotification.type,m),__textDocumentSync:void 0,onDidOpenTextDocument:m=>i.onNotification(K.DidOpenTextDocumentNotification.type,m),onDidChangeTextDocument:m=>i.onNotification(K.DidChangeTextDocumentNotification.type,m),onDidCloseTextDocument:m=>i.onNotification(K.DidCloseTextDocumentNotification.type,m),onWillSaveTextDocument:m=>i.onNotification(K.WillSaveTextDocumentNotification.type,m),onWillSaveTextDocumentWaitUntil:m=>i.onRequest(K.WillSaveTextDocumentWaitUntilRequest.type,m),onDidSaveTextDocument:m=>i.onNotification(K.DidSaveTextDocumentNotification.type,m),sendDiagnostics:m=>i.sendNotification(K.PublishDiagnosticsNotification.type,m),onHover:m=>i.onRequest(K.HoverRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),void 0)),onCompletion:m=>i.onRequest(K.CompletionRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onCompletionResolve:m=>i.onRequest(K.CompletionResolveRequest.type,m),onSignatureHelp:m=>i.onRequest(K.SignatureHelpRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),void 0)),onDeclaration:m=>i.onRequest(K.DeclarationRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onDefinition:m=>i.onRequest(K.DefinitionRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onTypeDefinition:m=>i.onRequest(K.TypeDefinitionRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onImplementation:m=>i.onRequest(K.ImplementationRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onReferences:m=>i.onRequest(K.ReferencesRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onDocumentHighlight:m=>i.onRequest(K.DocumentHighlightRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onDocumentSymbol:m=>i.onRequest(K.DocumentSymbolRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onWorkspaceSymbol:m=>i.onRequest(K.WorkspaceSymbolRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onWorkspaceSymbolResolve:m=>i.onRequest(K.WorkspaceSymbolResolveRequest.type,m),onCodeAction:m=>i.onRequest(K.CodeActionRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onCodeActionResolve:m=>i.onRequest(K.CodeActionResolveRequest.type,(d,_)=>m(d,_)),onCodeLens:m=>i.onRequest(K.CodeLensRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onCodeLensResolve:m=>i.onRequest(K.CodeLensResolveRequest.type,(d,_)=>m(d,_)),onDocumentFormatting:m=>i.onRequest(K.DocumentFormattingRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),void 0)),onDocumentRangeFormatting:m=>i.onRequest(K.DocumentRangeFormattingRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),void 0)),onDocumentOnTypeFormatting:m=>i.onRequest(K.DocumentOnTypeFormattingRequest.type,(d,_)=>m(d,_)),onRenameRequest:m=>i.onRequest(K.RenameRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),void 0)),onPrepareRename:m=>i.onRequest(K.PrepareRenameRequest.type,(d,_)=>m(d,_)),onDocumentLinks:m=>i.onRequest(K.DocumentLinkRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onDocumentLinkResolve:m=>i.onRequest(K.DocumentLinkResolveRequest.type,(d,_)=>m(d,_)),onDocumentColor:m=>i.onRequest(K.DocumentColorRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onColorPresentation:m=>i.onRequest(K.ColorPresentationRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onFoldingRanges:m=>i.onRequest(K.FoldingRangeRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onSelectionRanges:m=>i.onRequest(K.SelectionRangeRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),(0,ge.attachPartialResult)(i,d))),onExecuteCommand:m=>i.onRequest(K.ExecuteCommandRequest.type,(d,_)=>m(d,_,(0,ge.attachWorkDone)(i,d),void 0)),dispose:()=>i.dispose()};for(let m of g)m.attach(E);return i.onRequest(K.InitializeRequest.type,m=>{e.initialize(m),Gn.string(m.trace)&&(o.trace=K.Trace.fromString(m.trace));for(let d of g)d.initialize(m.capabilities);if(P){let d=P(m,new K.CancellationTokenSource().token,(0,ge.attachWorkDone)(i,m),void 0);return T(d).then(_=>{if(_ instanceof K.ResponseError)return _;let $=_;$||($={capabilities:{}});let X=$.capabilities;X||(X={},$.capabilities=X),X.textDocumentSync===void 0||X.textDocumentSync===null?X.textDocumentSync=Gn.number(E.__textDocumentSync)?E.__textDocumentSync:K.TextDocumentSyncKind.None:!Gn.number(X.textDocumentSync)&&!Gn.number(X.textDocumentSync.change)&&(X.textDocumentSync.change=Gn.number(E.__textDocumentSync)?E.__textDocumentSync:K.TextDocumentSyncKind.None);for(let ke of g)ke.fillServerCapabilities(X);return $})}else{let d={capabilities:{textDocumentSync:K.TextDocumentSyncKind.None}};for(let _ of g)_.fillServerCapabilities(d.capabilities);return d}}),i.onRequest(K.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,C)return C(new K.CancellationTokenSource().token)}),i.onNotification(K.ExitNotification.type,()=>{try{O&&O()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(K.SetTraceNotification.type,m=>{o.trace=K.Trace.fromString(m.value)}),E}je.createConnection=A8});var Ib=M(Ur=>{"use strict";var D8=Ur&&Ur.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),oL=Ur&&Ur.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D8(e,t,r)};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ProposedFeatures=Ur.NotebookDocuments=Ur.TextDocuments=Ur.SemanticTokensBuilder=void 0;var N8=gb();Object.defineProperty(Ur,"SemanticTokensBuilder",{enumerable:!0,get:function(){return N8.SemanticTokensBuilder}});var I8=xO();oL(Gt(),Ur);var O8=vb();Object.defineProperty(Ur,"TextDocuments",{enumerable:!0,get:function(){return O8.TextDocuments}});var L8=Rb();Object.defineProperty(Ur,"NotebookDocuments",{enumerable:!0,get:function(){return L8.NotebookDocuments}});oL(nL(),Ur);var iL;(function(t){t.all={__brand:"features",languages:I8.InlineCompletionFeature}})(iL||(Ur.ProposedFeatures=iL={}))});var aL=M((mxe,sL)=>{"use strict";sL.exports=Gt()});var lL=M(Wi=>{"use strict";var M8=Wi&&Wi.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uL=Wi&&Wi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&M8(e,t,r)};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.createConnection=void 0;var sg=Ib();uL(aL(),Wi);uL(Ib(),Wi);var cL=!1,$8={initialize:t=>{},get shutdownReceived(){return cL},set shutdownReceived(t){cL=t},exit:t=>{}};function F8(t,e,r,n){let i,o,s,a;t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),sg.ConnectionStrategy.is(t)||sg.ConnectionOptions.is(t)?a=t:(o=t,s=e,a=r);let c=u=>(0,sg.createProtocolConnection)(o,s,u,a);return(0,sg.createConnection)(c,$8,i)}Wi.createConnection=F8});var dL=M((gxe,fL)=>{"use strict";fL.exports=lL()});var XD=De(ze(),1);var zf=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,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 r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=qS(n.range),o=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,o)+n.text+this._content.substring(s,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),u=this._lineOffsets,l=FS(n.text,!1,o);if(c-a===l.length)for(let g=0,T=l.length;g<T;g++)u[g+a+1]=l[g];else l.length<1e4?u.splice(a+1,c-a,...l):this._lineOffsets=u=u.slice(0,a+1).concat(l,u.slice(c+1));let f=n.text.length-(s-o);if(f!==0)for(let g=a+1+l.length,T=u.length;g<T;g++)u[g]=u[g]+f}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=FS(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return{line:o,character:e-r[o]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},ga;(function(t){function e(i,o,s,a){return new zf(i,o,s,a)}t.create=e;function r(i,o,s){if(i instanceof zf)return i.update(o,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,o){let s=i.getText(),a=zy(o.map(Lq),(l,f)=>{let g=l.range.start.line-f.range.start.line;return g===0?l.range.start.character-f.range.start.character:g}),c=0,u=[];for(let l of a){let f=i.offsetAt(l.range.start);if(f<c)throw new Error("Overlapping edit");f>c&&u.push(s.substring(c,f)),l.newText.length&&u.push(l.newText),c=i.offsetAt(l.range.end)}return u.push(s.substr(c)),u.join("")}t.applyEdits=n})(ga||(ga={}));function zy(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);zy(n,e),zy(i,e);let o=0,s=0,a=0;for(;o<n.length&&s<i.length;)e(n[o],i[s])<=0?t[a++]=n[o++]:t[a++]=i[s++];for(;o<n.length;)t[a++]=n[o++];for(;s<i.length;)t[a++]=i[s++];return t}function FS(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);(o===13||o===10)&&(o===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function qS(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Lq(t){let e=qS(t.range);return e!==t.range?{newText:t.newText,range:e}:t}function Yt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Qi(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function jS(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ya(t){return typeof t=="object"&&t!==null&&Yt(t.container)&&Qi(t.reference)&&typeof t.message=="string"}var ks=class{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return Yt(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let o=this.computeIsSubtype(e,r);return n[r]=o,o}}getAllSubTypes(e){let r=this.allSubtypes[e];if(r)return r;{let n=this.getAllTypes(),i=[];for(let o of n)this.isSubtype(o,e)&&i.push(o);return this.allSubtypes[e]=i,i}}};function xi(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ws(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function US(t){return xi(t)&&typeof t.fullText=="string"}var pn=class t{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){let r=e[Symbol.iterator]();return new t(()=>({first:this.startFn(),firstDone:!1}),n=>{let i;if(!n.firstDone){do if(i=this.nextFn(n.first),!i.done)return i;while(!i.done);n.firstDone=!0}do if(i=r.next(),!i.done)return i;while(!i.done);return Kr})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=Mq(i.value)),o=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,o=n.next();for(;!o.done;){if(i>=r&&o.value===e)return i;o=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?Kr:{done:!1,value:e(i)}})}filter(e){return new t(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Kr})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,o=n.next();for(;!o.done;)i===void 0?i=o.value:i=e(i,o.value),o=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let o=this.recursiveReduce(e,r,n);return o===void 0?i.value:r(o,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}let{done:n,value:i}=this.nextFn(r.this);if(!n){let o=e(i);if(Vf(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return Kr})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new t(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}let{done:i,value:o}=r.nextFn(n.this);if(!i)if(Vf(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return Kr})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new t(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new t(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Kr:this.nextFn(r.state)))}distinct(e){let r=new Set;return this.filter(n=>{let i=e?e(n):n;return r.has(i)?!1:(r.add(i),!0)})}exclude(e,r){let n=new Set;for(let i of e){let o=r?r(i):i;n.add(o)}return this.filter(i=>{let o=r?r(i):i;return!n.has(o)})}};function Mq(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Vf(t){return!!t&&typeof t[Symbol.iterator]=="function"}var va=new pn(()=>{},()=>Kr),Kr=Object.freeze({done:!0,value:void 0});function xe(...t){if(t.length===1){let e=t[0];if(e instanceof pn)return e;if(Vf(e))return new pn(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new pn(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Kr)}return t.length>1?new pn(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){let r=t[e.collIndex++];Vf(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Kr}):va}var Dn=class extends pn{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Kr})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},Au;(function(t){function e(o){return o.reduce((s,a)=>s+a,0)}t.sum=e;function r(o){return o.reduce((s,a)=>s*a,0)}t.product=r;function n(o){return o.reduce((s,a)=>Math.min(s,a))}t.min=n;function i(o){return o.reduce((s,a)=>Math.max(s,a))}t.max=i})(Au=Au||(Au={}));function Vy(t){return new Dn(t,e=>xi(e)?e.content:[],{includeRoot:!0})}function GS(t){return Vy(t).filter(ws)}function BS(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Du(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Nr(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var Zi;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside"})(Zi=Zi||(Zi={}));function $q(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<t.start.character)return Zi.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>e.end.character)return Zi.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?Zi.Inside:r?Zi.OverlapBack:Zi.OverlapFront}function Xf(t,e){return $q(t,e)>Zi.After}var Xy=/^[\w\p{L}]$/u;function ir(t,e,r=Xy){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return en(t,e)}}function KS(t,e){if(t){let r=Fq(t,!0);if(r&&WS(r,e))return r;if(US(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(WS(o,e))return o}}}}function WS(t,e){return ws(t)&&e.includes(t.tokenType.name)}function en(t,e){if(ws(t))return t;if(xi(t)){let r=0,n=t.content.length-1;for(;r<n;){let i=Math.floor((r+n)/2),o=t.content[i];if(o.offset>e)n=i-1;else if(o.end<=e)r=i+1;else return en(o,e)}if(r===n)return en(t.content[r],e)}}function Fq(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t);for(;n>0;){n--;let i=r.content[n];if(e||!i.hidden)return i}t=r}}function zS(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;n<i;){n++;let o=r.content[n];if(e||!o.hidden)return o}t=r}}function VS(t,e){let r=qq(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function qq(t,e){let r=HS(t),n=HS(e),i;for(let o=0;o<r.length&&o<n.length;o++){let s=r[o],a=n[o];if(s.parent===a.parent)i={parent:s.parent,a:s.index,b:a.index};else break}return i}function HS(t){let e=[];for(;t.container;){let r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}function Cs(t,e,r,n){let i=[t,e,r,n].reduce(QS,{});return JS(i)}var Yy=Symbol("isProxy");function Yf(t){if(t&&t[Yy])for(let e of Object.values(t))Yf(e);return t}function JS(t,e){let r=new Proxy({},{deleteProperty:()=>!1,get:(n,i)=>YS(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(YS(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Reflect.ownKeys(t),Yy]});return r[Yy]=!0,r}var XS=Symbol();function YS(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===XS)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=XS;try{t[e]=typeof i=="function"?i(n):JS(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function QS(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!==void 0){let i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=QS(i,n):t[r]=n}}return t}var Ve=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return Au.sum(xe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return xe(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return xe(this.map.keys())}values(){return xe(this.map.values()).flat()}entriesGroupedByKey(){return xe(this.map.entries())}};var Jy="AbstractRule";var Es="AbstractType";var jq="Condition";var Uq="TypeDefinition";var Qy="AbstractElement";function Ta(t){return Pe.isInstance(t,Qy)}var ZS="ArrayType";function Ps(t){return Pe.isInstance(t,ZS)}var ek="Conjunction";function tk(t){return Pe.isInstance(t,ek)}var rk="Disjunction";function nk(t){return Pe.isInstance(t,rk)}var ik="Grammar";function Ra(t){return Pe.isInstance(t,ik)}var Wq="GrammarImport";function Jf(t){return Pe.isInstance(t,Wq)}var Hq="InferredType";function xa(t){return Pe.isInstance(t,Hq)}var Iu="Interface";function tn(t){return Pe.isInstance(t,Iu)}var ok="LiteralCondition";function sk(t){return Pe.isInstance(t,ok)}var ak="Negation";function ck(t){return Pe.isInstance(t,ak)}var uk="Parameter";function lk(t){return Pe.isInstance(t,uk)}var fk="ParameterReference";function ba(t){return Pe.isInstance(t,fk)}var dk="ParserRule";function Q(t){return Pe.isInstance(t,dk)}var pk="ReferenceType";function As(t){return Pe.isInstance(t,pk)}var Gq="ReturnType";function _a(t){return Pe.isInstance(t,Gq)}var mk="SimpleType";function Ir(t){return Pe.isInstance(t,mk)}var Zy="TerminalRule";function We(t){return Pe.isInstance(t,Zy)}var Ou="Type";function lr(t){return Pe.isInstance(t,Ou)}var Bq="TypeAttribute";function Qf(t){return Pe.isInstance(t,Bq)}var hk="UnionType";function Nn(t){return Pe.isInstance(t,hk)}var gk="Action";function Xe(t){return Pe.isInstance(t,gk)}var yk="Alternatives";function mn(t){return Pe.isInstance(t,yk)}var vk="Assignment";function Fe(t){return Pe.isInstance(t,vk)}var Tk="CharacterRange";function Zf(t){return Pe.isInstance(t,Tk)}var Rk="CrossReference";function Rr(t){return Pe.isInstance(t,Rk)}var xk="Group";function fr(t){return Pe.isInstance(t,xk)}var bk="Keyword";function Ot(t){return Pe.isInstance(t,bk)}var _k="NegatedToken";function Sk(t){return Pe.isInstance(t,_k)}var kk="RegexToken";function wk(t){return Pe.isInstance(t,kk)}var Ck="RuleCall";function Ye(t){return Pe.isInstance(t,Ck)}var Ek="TerminalAlternatives";function Pk(t){return Pe.isInstance(t,Ek)}var Ak="TerminalGroup";function Dk(t){return Pe.isInstance(t,Ak)}var Nk="TerminalRuleCall";function ed(t){return Pe.isInstance(t,Nk)}var Ik="UnorderedGroup";function hn(t){return Pe.isInstance(t,Ik)}var Ok="UntilToken";function Lk(t){return Pe.isInstance(t,Ok)}var Mk="Wildcard";function $k(t){return Pe.isInstance(t,Mk)}var Nu=class extends ks{getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayType","Assignment","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","LiteralCondition","NamedArgument","NegatedToken","Negation","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","Wildcard"]}computeIsSubtype(e,r){switch(e){case gk:return this.isSubtype(Qy,r)||this.isSubtype(Es,r);case yk:case vk:case Tk:case Rk:case xk:case bk:case _k:case kk:case Ck:case Ek:case Ak:case Nk:case Ik:case Ok:case Mk:return this.isSubtype(Qy,r);case ZS:case pk:case mk:case hk:return this.isSubtype(Uq,r);case ek:case rk:case ok:case ak:case fk:return this.isSubtype(jq,r);case Iu:case Ou:return this.isSubtype(Es,r);case dk:return this.isSubtype(Jy,r)||this.isSubtype(Es,r);case Zy:return this.isSubtype(Jy,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Es;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Jy;case"Grammar:usedGrammars":return ik;case"NamedArgument:parameter":case"ParameterReference:parameter":return uk;case"TerminalRuleCall:rule":return Zy;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"Grammar":return{name:"Grammar",mandatory:[{name:"definesHiddenTokens",type:"boolean"},{name:"hiddenTokens",type:"array"},{name:"imports",type:"array"},{name:"interfaces",type:"array"},{name:"isDeclared",type:"boolean"},{name:"rules",type:"array"},{name:"types",type:"array"},{name:"usedGrammars",type:"array"}]};case"Interface":return{name:"Interface",mandatory:[{name:"attributes",type:"array"},{name:"superTypes",type:"array"}]};case"LiteralCondition":return{name:"LiteralCondition",mandatory:[{name:"true",type:"boolean"}]};case"NamedArgument":return{name:"NamedArgument",mandatory:[{name:"calledByName",type:"boolean"}]};case"ParserRule":return{name:"ParserRule",mandatory:[{name:"definesHiddenTokens",type:"boolean"},{name:"entry",type:"boolean"},{name:"fragment",type:"boolean"},{name:"hiddenTokens",type:"array"},{name:"parameters",type:"array"},{name:"wildcard",type:"boolean"}]};case"TerminalRule":return{name:"TerminalRule",mandatory:[{name:"fragment",type:"boolean"},{name:"hidden",type:"boolean"}]};case"TypeAttribute":return{name:"TypeAttribute",mandatory:[{name:"isOptional",type:"boolean"}]};case"UnionType":return{name:"UnionType",mandatory:[{name:"types",type:"array"}]};case"Alternatives":return{name:"Alternatives",mandatory:[{name:"elements",type:"array"}]};case"CrossReference":return{name:"CrossReference",mandatory:[{name:"deprecatedSyntax",type:"boolean"}]};case"Group":return{name:"Group",mandatory:[{name:"elements",type:"array"}]};case"RuleCall":return{name:"RuleCall",mandatory:[{name:"arguments",type:"array"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",mandatory:[{name:"elements",type:"array"}]};case"TerminalGroup":return{name:"TerminalGroup",mandatory:[{name:"elements",type:"array"}]};case"UnorderedGroup":return{name:"UnorderedGroup",mandatory:[{name:"elements",type:"array"}]};default:return{name:e,mandatory:[]}}}},Pe=new Nu;function Fk(t){for(let[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{Yt(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):Yt(r)&&(r.$container=t,r.$containerProperty=e))}function Je(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function Te(t){let r=td(t).$document;if(!r)throw new Error("AST node has no document.");return r}function td(t){for(;t.$container;)t=t.$container;return t}function No(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new pn(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){let i=n.keys[n.keyIndex];if(!i.startsWith("$")){let o=t[i];if(Yt(o)){if(n.keyIndex++,ev(o,r))return{done:!1,value:o}}else if(Array.isArray(o)){for(;n.arrayIndex<o.length;){let s=n.arrayIndex++,a=o[s];if(Yt(a)&&ev(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return Kr})}function yt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Dn(t,r=>No(r,e))}function to(t,e){if(t){if(e?.range&&!ev(t,e.range))return new Dn(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Dn(t,r=>No(r,e),{includeRoot:!0})}function ev(t,e){var r;if(!e)return!0;let n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?Xf(n,e):!1}function rd(t){return new pn(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(Qi(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(Qi(o))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Kr})}function qk(t){var e,r;if(t){if("astNode"in t)return Vq(t);if(Array.isArray(t))return t.reduce(jk,void 0);{let n=t,i=Kq(n)?zq((r=(e=n?.root)===null||e===void 0?void 0:e.astNode)!==null&&r!==void 0?r:n?.astNode):void 0;return Sa(n,i)}}else return}function Kq(t){return typeof t<"u"&&"element"in t&&"text"in t}function zq(t){try{return Te(t).uri.toString()}catch{return}}function Vq(t){var e,r;let{astNode:n,property:i,index:o}=t??{},s=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||s===void 0)){if(i===void 0)return Sa(s,tv(n));{let a=c=>o!==void 0&&o>-1&&Array.isArray(n[i])?o<c.length?c[o]:void 0:c.reduce(jk,void 0);if(!((r=s.assignments)===null||r===void 0)&&r[i]){let c=a(s.assignments[i]);return c&&Sa(c,tv(n))}else if(n.$cstNode){let c=a(Io(n.$cstNode,i));return c&&Sa(c,tv(n))}else return}}}function tv(t){var e,r,n,i;return t.$cstNode?(r=(e=Te(t))===null||e===void 0?void 0:e.uri)===null||r===void 0?void 0:r.toString():t.$textRegion?t.$textRegion.documentURI||((i=(n=new Dn(t,o=>o.$container?[o.$container]:[]).find(o=>{var s;return(s=o.$textRegion)===null||s===void 0?void 0:s.documentURI}))===null||n===void 0?void 0:n.$textRegion)===null||i===void 0?void 0:i.documentURI):void 0}function Sa(t,e){var r,n;let i={offset:t.offset,end:(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,length:(n=t.length)!==null&&n!==void 0?n:t.end-t.offset};return t.range&&(i.range=t.range),e??(e=t.fileURI),e&&(i.fileURI=e),i}function jk(t,e){var r,n;if(t){if(!e)return t&&Sa(t)}else return e&&Sa(e);let i=(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,o=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,s=Math.min(t.offset,e.offset),a=Math.max(i,o),c=a-s,u={offset:s,end:a,length:c};if(t.range&&e.range&&(u.range={start:e.range.start.line<t.range.start.line||e.range.start.line===t.range.start.line&&e.range.start.character<t.range.start.character?e.range.start:t.range.start,end:e.range.end.line>t.range.end.line||e.range.end.line===t.range.end.line&&e.range.end.character>t.range.end.character?e.range.end:t.range.end}),t.fileURI||e.fileURI){let l=t.fileURI,f=e.fileURI,g=l&&f&&l!==f?`<unmergable text regions of ${l}, ${f}>`:l??f;u.fileURI=g}return u}var rv=class{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}get currentPosition(){return{offset:this.content.length,line:this.currentLineNumber,character:this.currentLineContent.length}}append(e,r){if(e.length>0){let n=r&&this.currentPosition;this.lines[this.currentLineNumber].push(e),n&&this.indentPendingTraceRegions(n)}}indentPendingTraceRegions(e){for(let r=this.traceData.length-1;r>=0;r--){let n=this.traceData[r];n.targetStart&&n.targetStart.offset===e.offset&&(n.targetStart=this.currentPosition)}}increaseIndent(e){this.currentIndents.push(e),e.indentImmediately||this.recentNonImmediateIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(e=>!this.recentNonImmediateIndents.includes(e))}resetCurrentLine(){this.lines[this.currentLineNumber]=[],this.pendingIndent=!0}addNewLine(){this.pendingIndent=!0,this.lines.push([]),this.recentNonImmediateIndents.length=0}pushTraceRegion(e){let r=Xq(e,this.currentPosition,n=>{var i,o;return(o=(i=this.traceData[this.traceData.length-1])===null||i===void 0?void 0:i.children)===null||o===void 0?void 0:o.push(n)});return this.traceData.push(r),r}popTraceRegion(e){let r=this.traceData.pop();return this.assertTrue(r===e,"Trace region mismatch!"),r}getParentTraceSourceFileURI(){var e;for(let r=this.traceData.length-1;r>-1;r--){let n=(e=this.traceData[r].sourceRegion)===null||e===void 0?void 0:e.fileURI;if(n)return n}}assertTrue(e,r){if(!e)throw new Error(r)}};function Xq(t,e,r){let n={sourceRegion:t,targetRegion:void 0,children:[],targetStart:e,complete:i=>{var o,s;return n.targetRegion={offset:n.targetStart.offset,end:i.offset,length:i.offset-n.targetStart.offset,range:{start:{line:n.targetStart.line,character:n.targetStart.character},end:{line:i.line,character:i.character}}},delete n.targetStart,((o=n.children)===null||o===void 0?void 0:o.length)===0&&delete n.children,!((s=n.targetRegion)===null||s===void 0)&&s.length&&r(n),delete n.complete,n}};return n}function Uk(t,e){let r=new rv(e),n=r.pushTraceRegion(void 0);Wk(t,r),r.popTraceRegion(n),n.complete&&n.complete(r.currentPosition);let i=n.children&&n.children.length===1?n.children[0]:void 0,o=i?.targetRegion,s=n.targetRegion;return o&&i.sourceRegion&&o.offset===s.offset&&o.length===s.length?{text:r.content,trace:i}:{text:r.content,trace:n}}function Wk(t,e){typeof t=="string"?Yq(t,e):t instanceof ka?Jq(t,e):t instanceof xr?Bk(t,e):t instanceof Oo&&Qq(t,e)}function Hk(t,e){return typeof t=="string"?t.length!==0:t instanceof xr?t.contents.some(r=>Hk(r,e)):t instanceof Oo?!(t.ifNotEmpty&&e.currentLineContent.length===0):!1}function Yq(t,e){t&&(e.pendingIndent&&Gk(e,!1),e.append(t))}function Gk(t,e){var r;let n="";for(let i of t.relevantIndents.filter(o=>o.indentEmptyLines||!e))n+=(r=i.indentation)!==null&&r!==void 0?r:t.defaultIndentation;t.append(n,!0),t.pendingIndent=!1}function Bk(t,e){let r,n=qk(t.tracedSource);n&&(r=e.pushTraceRegion(n));for(let i of t.contents)Wk(i,e);if(r){e.popTraceRegion(r);let i=e.getParentTraceSourceFileURI();i&&n?.fileURI===i&&delete n.fileURI,r.complete&&r.complete(e.currentPosition)}}function Jq(t,e){var r;if(Hk(t,e)){t.indentImmediately&&!e.pendingIndent&&e.append((r=t.indentation)!==null&&r!==void 0?r:e.defaultIndentation,!0);try{e.increaseIndent(t),Bk(t,e)}finally{e.decreaseIndent()}}}function Qq(t,e){t.ifNotEmpty&&!Zq(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&Gk(e,!0),e.append(t.lineDelimiter),e.addNewLine())}function Zq(t){return t.trimStart()!==""}var W9=Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__"),Lu=/\r?\n/g,e1=/\S|$/;function Kk(t){let e=t.filter(n=>n.length>0).map(n=>n.search(e1)),r=e.length===0?0:Math.min(...e);return Math.max(0,r)}function iv(t,...e){let r=t1(t),n=r1(t,e,r);return i1(n)}function Xk(t,e,r){return(n,...i)=>ov(t,e,r)(iv(n,...i))}function t1(t){let e=t.join("_").split(Lu),r=e.length>1&&e[0].trim().length===0,n=r&&e.length>1&&e[e.length-1].trim().length===0;if(e.length===1||e.length!==0&&e[0].trim().length!==0||e.length===2&&e[1].trim().length===0)return{indentation:0,omitFirstLine:r,omitLastLine:n,trimLastLine:e.length!==1&&e[e.length-1].trim().length===0};{let i=r?e.slice(1):e;i=n?i.slice(0,i.length-1):i,i=i.filter(s=>s.length!==0);let o=Kk(i);return{indentation:o,omitFirstLine:r,omitLastLine:n&&(e[e.length-1].length<o||!e[e.length-1].startsWith(i[0].substring(0,o)))}}}function r1(t,e,{indentation:r,omitFirstLine:n,omitLastLine:i,trimLastLine:o}){let s=[];t.forEach((u,l)=>{s.push(...u.split(Lu).map((f,g)=>g===0||f.length<r?f:f.substring(r)).reduce(l===0?(f,g,T)=>T===0?n?[]:[g]:T===1&&f.length===0?[g]:f.concat(nd,g):(f,g,T)=>T===0?[g]:f.concat(nd,g),[]).filter(f=>!(typeof f=="string"&&f.length===0)).concat(Mu(e[l])?e[l]:e[l]!==void 0?{content:String(e[l])}:l<e.length?Yk:[]))});let a=s.length,c=a!==0?s[a-1]:void 0;return(i||o)&&typeof c=="string"&&c.trim().length===0?n&&a!==1&&s[a-2]===nd?s.slice(0,a-2):s.slice(0,a-1):s}var nd={isNewLine:!0},Yk={isUndefinedSegment:!0},Vk=t=>t===nd,nv=t=>t===Yk,n1=t=>t.content!==void 0;function i1(t){return t.reduce((r,n,i)=>nv(n)?r:Vk(n)?{node:i!==0&&(nv(t[i-1])||Mu(t[i-1]))||i>1&&typeof t[i-1]=="string"&&(nv(t[i-2])||Mu(t[i-2]))?r.node.appendNewLineIfNotEmpty():r.node.appendNewLine()}:(()=>{var o;let s=(i===0||Vk(t[i-1]))&&typeof n=="string"&&n.length!==0?"".padStart(n.length-n.trimStart().length):"",a=n1(n)?n.content:n,c;return{node:r.indented?r.node:s.length!==0?r.node.indent({indentation:s,indentImmediately:!1,indentedChildren:u=>c=u.append(a)}):r.node.append(a),indented:c??((o=r.indented)===null||o===void 0?void 0:o.append(a))}})(),{node:new xr}).node}var zk=typeof process>"u"?`
66
68
  `:process.platform==="win32"?`\r
67
69
  `:`
68
- `;function _u(t){return t instanceof Cr||t instanceof Sa||t instanceof Uo}function ka(t,e){return _u(t)?z_(t,e).text:String(t)}var Cr=class t{constructor(...e){this.contents=[],this.append(...e)}isEmpty(){return this.contents.length===0}trace(e,r,n){if(Zt(e)){if(this.tracedSource={astNode:e,property:r,index:n},this.tracedSource.property===void 0&&this.tracedSource.index!==void 0&&this.tracedSource.index>-1)throw new Error("Generation support: 'property' argument must not be 'undefined' if a non-negative value is assigned to 'index' in 'CompositeGeneratorNode.trace(...)'.")}else this.tracedSource=e;return this}append(...e){for(let r of e)typeof r=="function"?r(this):r&&this.contents.push(r);return this}appendIf(e,...r){return e?this.append(...r):this}appendNewLine(){return this.append(It)}appendNewLineIf(e){return e?this.append(It):this}appendNewLineIfNotEmpty(){return this.append(eM)}appendNewLineIfNotEmptyIf(e){return e?this.appendNewLineIfNotEmpty():this}appendTemplate(e,...r){return this.append(Ty(e,...r))}appendTemplateIf(e){return e?(r,...n)=>this.appendTemplate(r,...n):()=>this}indent(e){let{indentedChildren:r,indentation:n,indentEmptyLines:i,indentImmediately:o}=Array.isArray(e)||typeof e=="function"?{indentedChildren:e}:typeof e=="object"?e:{},s=new Sa(n,o,i);return this.contents.push(s),Array.isArray(r)?s.append(...r):r&&s.append(r),this}appendTraced(e,r,n){return i=>this.append(new t().trace(e,r,n).append(i))}appendTracedIf(e,r,n,i){return e?this.appendTraced(typeof r=="function"?r():r,n,i):()=>this}appendTracedTemplate(e,r,n){return(i,...o)=>this.append(tS(e,r,n)(i,...o))}appendTracedTemplateIf(e,r,n,i){return e?this.appendTracedTemplate(typeof r=="function"?r():r,n,i):()=>this}};function Ry(t,e,r){return n=>n instanceof Cr&&n.tracedSource===void 0?n.trace(t,e,r):new Cr().trace(t,e,r).append(n)}var Sa=class extends Cr{constructor(e,r=!0,n=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof e=="string"?this.indentation=e:typeof e=="number"&&(this.indentation="".padStart(e)),this.indentImmediately=r,this.indentEmptyLines=n}},Uo=class{constructor(e,r=!1){this.ifNotEmpty=!1,this.lineDelimiter=e??Z_,this.ifNotEmpty=r}},It=new Uo,eM=new Uo(void 0,!0);function lo(t){return"referenceType"in t}function fo(t){return"elementType"in t}function lr(t){return"types"in t}function _y(t){if(lr(t)){let e=[];for(let r of t.types)e.push(..._y(r));return e}else return[t]}function _n(t){return"value"in t}function Sn(t){return"primitive"in t}function Pi(t){return"string"in t}function oi(t){return t&&"type"in t}function ai(t){return t&&"properties"in t}var Kf=class{constructor(e,r){var n;this.superTypes=new Set,this.subTypes=new Set,this.typeNames=new Set,this.name=e,this.declared=(n=r?.declared)!==null&&n!==void 0?n:!1,this.dataType=r?.dataType}toAstTypesString(e){let r=new Cr;return r.append(`export type ${this.name} = ${si(this.type,"AstType")};`,It),e&&(r.append(It),oS(r,this.name)),this.dataType&&tM(r,this),ka(r)}toDeclaredTypesString(e){let r=new Cr;return r.append(`type ${Sy(this.name,e)} = ${si(this.type,"DeclaredType")};`,It),ka(r)}},Ca=class t{get superProperties(){return this.getSuperProperties(new Set)}getSuperProperties(e){if(e.has(this.name))return[];e.add(this.name);let r=new Map;for(let n of this.properties)r.set(n.name,n);for(let n of this.interfaceSuperTypes){let i=n.getSuperProperties(e);for(let o of i)r.has(o.name)||r.set(o.name,o)}return Array.from(r.values())}get allProperties(){let e=new Map(this.superProperties.map(n=>[n.name,n]));for(let n of this.subTypes)this.getSubTypeProperties(n,e,new Set);return Array.from(e.values())}getSubTypeProperties(e,r,n){if(n.has(this.name))return;n.add(this.name);let i=ai(e)?e.properties:[];for(let o of i)r.has(o.name)||r.set(o.name,o);for(let o of e.subTypes)this.getSubTypeProperties(o,r,n)}get interfaceSuperTypes(){return Array.from(this.superTypes).filter(e=>e instanceof t)}constructor(e,r,n){this.superTypes=new Set,this.subTypes=new Set,this.containerTypes=new Set,this.typeNames=new Set,this.declared=!1,this.abstract=!1,this.properties=[],this.name=e,this.declared=r,this.abstract=n}toAstTypesString(e){let r=new Cr,n=this.interfaceSuperTypes.map(o=>o.name),i=n.length>0?As([...n]):["AstNode"];return r.append(`export interface ${this.name} extends ${i.join(", ")} {`,It),r.indent(o=>{this.containerTypes.size>0&&o.append(`readonly $container: ${As([...this.containerTypes].map(s=>s.name)).join(" | ")};`,It),this.typeNames.size>0&&o.append(`readonly $type: ${As([...this.typeNames]).map(s=>`'${s}'`).join(" | ")};`,It),nS(o,this.properties,"AstType")}),r.append("}",It),e&&(r.append(It),oS(r,this.name)),ka(r)}toDeclaredTypesString(e){let r=new Cr,n=Sy(this.name,e),i=As(this.interfaceSuperTypes.map(o=>o.name)).join(", ");return r.append(`interface ${n}${i.length>0?` extends ${i}`:""} {`,It),r.indent(o=>nS(o,this.properties,"DeclaredType",e)),r.append("}",It),ka(r)}},zf=class extends Error{constructor(e,r){super(e),this.name="TypeResolutionError",this.target=r}};function ku(t,e){return Wo(t,e,new Map)}function Wo(t,e,r){let n=`${Su(t)}\xBB${Su(e)}`,i=r.get(n);return i!==void 0||(r.set(n,!1),i=!1,lr(t)?i=t.types.every(o=>Wo(o,e,r)):lr(e)?i=e.types.some(o=>Wo(t,o,r)):_n(e)&&oi(e.value)?_n(t)&&oi(t.value)&&e.value.name===t.value.name?i=!0:i=Wo(t,e.value.type,r):lo(t)?i=lo(e)&&Wo(t.referenceType,e.referenceType,r):fo(t)?i=fo(e)&&Wo(t.elementType,e.elementType,r):_n(t)?oi(t.value)?i=Wo(t.value.type,e,r):_n(e)?oi(e.value)?i=Wo(t,e.value.type,r):i=iS(t.value,e.value,new Set):i=!1:Sn(t)?i=Sn(e)&&t.primitive===e.primitive:Pi(t)&&(i=Sn(e)&&e.primitive==="string"||Pi(e)&&e.string===t.string),i&&r.set(n,i)),i}function iS(t,e,r){let n=t.name;if(r.has(n))return!1;if(r.add(n),t.name===e.name)return!0;for(let i of t.superTypes)if(ai(i)&&iS(i,e,r))return!0;return!1}function Su(t){if(lo(t))return`@(${Su(t.referenceType)})}`;if(fo(t))return`(${Su(t.elementType)})[]`;if(lr(t)){let e=t.types.map(r=>Su(r)).join(" | ");return t.types.length<=1?`Union<${e}>`:e}else{if(_n(t))return`Value<${t.value.name}>`;if(Sn(t))return t.primitive;if(Pi(t))return`'${t.string}'`}throw new Error("Invalid type")}function si(t,e="AstType"){if(lo(t)){let r=si(t.referenceType,e);return e==="AstType"?`Reference<${r}>`:`@${xy(t.referenceType,r)}`}else if(fo(t)){let r=si(t.elementType,e);return e==="AstType"?`Array<${r}>`:`${xy(t.elementType,r)}[]`}else if(lr(t)){let r=t.types.map(n=>xy(n,si(n,e)));return As(r).join(" | ")}else{if(_n(t))return t.value.name;if(Sn(t))return t.primitive;if(Pi(t)){let r=e==="AstType"?"'":'"';return`${r}${t.string}${r}`}}throw new Error("Invalid type")}function xy(t,e){return lr(t)&&(e=`(${e})`),e}function nS(t,e,r,n=new Set){function i(o){let s=r==="AstType"?o.name:Sy(o.name,n),a=o.optional&&!Vf(o.type),c=si(o.type,r);return`${s}${a?"?":""}: ${c}`}As(e,(o,s)=>o.name.localeCompare(s.name)).forEach(o=>t.append(i(o),It))}function Vf(t){return fo(t)?!0:lo(t)?!1:lr(t)?t.types.every(e=>Vf(e)):Sn(t)?t.primitive==="boolean":!1}function oS(t,e){t.append(`export const ${e} = '${e}';`,It),t.append(It),t.append(`export function is${e}(item: unknown): item is ${e} {`,It),t.indent(r=>r.append(`return reflection.isInstance(item, ${e});`,It)),t.append("}",It)}function tM(t,e){switch(e.dataType){case"string":if(by(e.type)){let r=Array.from(e.subTypes).map(o=>o.name),n=sS(e.type),i=aS(e.type);if(r.length===0&&n.length===0&&i.length===0)Bf(t,e.name,`typeof item === '${e.dataType}'`);else{let o=rM(r,n,i);Bf(t,e.name,o)}}break;case"number":case"boolean":case"bigint":Bf(t,e.name,`typeof item === '${e.dataType}'`);break;case"Date":Bf(t,e.name,"item instanceof Date");break;default:return}}function by(t){let e=!0;if(Sn(t))return t.primitive==="string";if(Pi(t))return!0;if(lr(t)){for(let r of t.types)if(_n(r))if(oi(r.value)){if(!by(r.value.type))return!1}else return!1;else if(Sn(r)){if(r.primitive!=="string"||!r.regex)return!1}else if(lr(r))e=by(r);else if(!Pi(r))return!1}else return!1;return e}function rM(t,e,r){let n=[...t.map(i=>`is${i}(item)`),...e.map(i=>`item === '${i}'`)];if(r.length>0){let i=r.map(o=>`${o}.test(item)`).join(" || ");n.push(`(typeof item === 'string' && (${i}))`)}return n.join(" || ")}function Sy(t,e){return e.has(t)?`^${t}`:t}function sS(t){let e=[];if(Pi(t))return[t.string];if(lr(t))for(let r of t.types)Pi(r)?e.push(r.string):lr(r)&&e.push(...sS(r));return e}function aS(t){let e=[];if(Sn(t)&&t.primitive==="string"&&t.regex&&e.push(t.regex),lr(t))for(let r of t.types)Sn(r)&&r.primitive==="string"&&r.regex?e.push(r.regex):lr(r)&&e.push(...aS(r));return e}function Bf(t,e,r){t.append(It,`export function is${e}(item: unknown): item is ${e} {`,It),t.indent(n=>n.append(`return ${r};`,It)),t.append("}",It)}function As(t,e){return Array.from(new Set(t)).sort(e)}function ky(t,e,r,n){let i=new Set;return i.add(t),e.findReferences(t,{}).forEach(s=>{let a=r.getOrCreateDocument(s.sourceUri),c=n.getAstNode(a.parseResult.value,s.sourcePath);ln(c)?(i.add(c),ky(c,e,r,n).forEach(p=>i.add(p))):c&&hr(c.$container)&&i.add(c.$container)}),i}function Cu(t){let e=new Set;if(ln(t))e.add(t),t.superTypes.forEach(r=>{if(ln(r.ref)){e.add(r.ref);let n=Cu(r.ref);for(let i of n)e.add(i)}});else if(hr(t)){let r=cS(t.type);for(let n of r){let i=Cu(n);for(let o of i)e.add(o)}}return e}function cS(t){var e;if(qn(t))return t.types.flatMap(r=>cS(r));if(Ur(t)){let r=(e=t.typeRef)===null||e===void 0?void 0:e.ref;if(hr(r)||ln(r))return[r]}return[]}function Cy(t,e){return t.interfaces.concat(e.interfaces)}function Yf(t){return t.interfaces.concat(t.unions)}function uS(t){let e=t.sort((i,o)=>i.name.localeCompare(o.name)).map(i=>({value:i,nodes:[]}));for(let i of e)i.nodes=e.filter(o=>i.value.superTypes.has(o.value.name));let r=[],n=e.filter(i=>i.nodes.length===0);for(;n.length>0;){let i=n.shift();r.includes(i)||(r.push(i),e.filter(o=>o.nodes.includes(i)).forEach(o=>n.push(o)))}return r.map(i=>i.value)}function lS(t){return Xf(t,new Set)}function Xf(t,e){if(e.has(t))return[];if(e.add(t),lr(t))return t.types.flatMap(r=>Xf(r,e));if(_n(t)){let r=t.value;return"type"in r?Xf(r.type,e):[r.name]}else if(fo(t))return Xf(t.elementType,e);return[]}function wu(t){return typeof t.name=="string"}var wa=class{getName(e){if(wu(e))return e.name}getNameNode(e){return wr(e.$cstNode,"name")}};function ge(t){return t.charCodeAt(0)}function Jf(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Da(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Ns(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Du(){throw Error("Internal Error - Should never get here!")}function wy(t){return t.type==="Character"}var Eu=[];for(let t=ge("0");t<=ge("9");t++)Eu.push(t);var Pu=[ge("_")].concat(Eu);for(let t=ge("a");t<=ge("z");t++)Pu.push(t);for(let t=ge("A");t<=ge("Z");t++)Pu.push(t);var Dy=[ge(" "),ge("\f"),ge(`
69
- `),ge("\r"),ge(" "),ge("\v"),ge(" "),ge("\xA0"),ge("\u1680"),ge("\u2000"),ge("\u2001"),ge("\u2002"),ge("\u2003"),ge("\u2004"),ge("\u2005"),ge("\u2006"),ge("\u2007"),ge("\u2008"),ge("\u2009"),ge("\u200A"),ge("\u2028"),ge("\u2029"),ge("\u202F"),ge("\u205F"),ge("\u3000"),ge("\uFEFF")];var nM=/[0-9a-fA-F]/,Qf=/[0-9]/,iM=/[1-9]/,Is=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Da(n,"global");break;case"i":Da(n,"ignoreCase");break;case"m":Da(n,"multiLine");break;case"u":Da(n,"unicode");break;case"y":Da(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Ns(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Du()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Ns(r);break}if(!(e===!0&&r===void 0)&&Ns(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ns(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Du()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ge(`
70
- `),ge("\r"),ge("\u2028"),ge("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Eu;break;case"D":e=Eu,r=!0;break;case"s":e=Dy;break;case"S":e=Dy,r=!0;break;case"w":e=Pu;break;case"W":e=Pu,r=!0;break}return Ns(e)?{type:"Set",value:e,complement:r}:Du()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ge("\f");break;case"n":e=ge(`
71
- `);break;case"r":e=ge("\r");break;case"t":e=ge(" ");break;case"v":e=ge("\v");break}return Ns(e)?{type:"Character",value:e}:Du()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ge("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:ge(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
72
- `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:ge(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(wy(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(wy(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else Jf(n.value,e),e.push(ge("-")),Jf(o.value,e)}else Jf(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
73
- `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:ge("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(iM.test(e)===!1)throw Error("Expecting a positive integer");for(;Qf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Qf.test(e)===!1)throw Error("Expecting an integer");for(;Qf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
74
- `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:ge(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Qf.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
70
+ `;function Mu(t){return t instanceof xr||t instanceof ka||t instanceof Oo}function wa(t,e){return Mu(t)?Uk(t,e).text:String(t)}var xr=class t{constructor(...e){this.contents=[],this.append(...e)}isEmpty(){return this.contents.length===0}trace(e,r,n){if(Yt(e)){if(this.tracedSource={astNode:e,property:r,index:n},this.tracedSource.property===void 0&&this.tracedSource.index!==void 0&&this.tracedSource.index>-1)throw new Error("Generation support: 'property' argument must not be 'undefined' if a non-negative value is assigned to 'index' in 'CompositeGeneratorNode.trace(...)'.")}else this.tracedSource=e;return this}append(...e){for(let r of e)typeof r=="function"?r(this):r&&this.contents.push(r);return this}appendIf(e,...r){return e?this.append(...r):this}appendNewLine(){return this.append(Ct)}appendNewLineIf(e){return e?this.append(Ct):this}appendNewLineIfNotEmpty(){return this.append(o1)}appendNewLineIfNotEmptyIf(e){return e?this.appendNewLineIfNotEmpty():this}appendTemplate(e,...r){return this.append(iv(e,...r))}appendTemplateIf(e){return e?(r,...n)=>this.appendTemplate(r,...n):()=>this}indent(e){let{indentedChildren:r,indentation:n,indentEmptyLines:i,indentImmediately:o}=Array.isArray(e)||typeof e=="function"?{indentedChildren:e}:typeof e=="object"?e:{},s=new ka(n,o,i);return this.contents.push(s),Array.isArray(r)?s.append(...r):r&&s.append(r),this}appendTraced(e,r,n){return i=>this.append(new t().trace(e,r,n).append(i))}appendTracedIf(e,r,n,i){return e?this.appendTraced(typeof r=="function"?r():r,n,i):()=>this}appendTracedTemplate(e,r,n){return(i,...o)=>this.append(Xk(e,r,n)(i,...o))}appendTracedTemplateIf(e,r,n,i){return e?this.appendTracedTemplate(typeof r=="function"?r():r,n,i):()=>this}};function ov(t,e,r){return n=>n instanceof xr&&n.tracedSource===void 0?n.trace(t,e,r):new xr().trace(t,e,r).append(n)}var ka=class extends xr{constructor(e,r=!0,n=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof e=="string"?this.indentation=e:typeof e=="number"&&(this.indentation="".padStart(e)),this.indentImmediately=r,this.indentEmptyLines=n}},Oo=class{constructor(e,r=!1){this.ifNotEmpty=!1,this.lineDelimiter=e??zk,this.ifNotEmpty=r}},Ct=new Oo,o1=new Oo(void 0,!0);function ro(t){return"referenceType"in t}function no(t){return"elementType"in t}function or(t){return"types"in t}function cv(t){if(or(t)){let e=[];for(let r of t.types)e.push(...cv(r));return e}else return[t]}function gn(t){return"value"in t}function yn(t){return"primitive"in t}function bi(t){return"string"in t}function ni(t){return t&&"type"in t}function oi(t){return t&&"properties"in t}var od=class{constructor(e,r){var n;this.superTypes=new Set,this.subTypes=new Set,this.typeNames=new Set,this.name=e,this.declared=(n=r?.declared)!==null&&n!==void 0?n:!1,this.dataType=r?.dataType}toAstTypesString(e){let r=new xr;return r.append(`export type ${this.name} = ${ii(this.type,"AstType")};`,Ct),e&&(r.append(Ct),Zk(r,this.name)),this.dataType&&s1(r,this),wa(r)}toDeclaredTypesString(e){let r=new xr;return r.append(`type ${uv(this.name,e)} = ${ii(this.type,"DeclaredType")};`,Ct),wa(r)}},Ca=class t{get superProperties(){return this.getSuperProperties(new Set)}getSuperProperties(e){if(e.has(this.name))return[];e.add(this.name);let r=new Map;for(let n of this.properties)r.set(n.name,n);for(let n of this.interfaceSuperTypes){let i=n.getSuperProperties(e);for(let o of i)r.has(o.name)||r.set(o.name,o)}return Array.from(r.values())}get allProperties(){let e=new Map(this.superProperties.map(n=>[n.name,n]));for(let n of this.subTypes)this.getSubTypeProperties(n,e,new Set);return Array.from(e.values())}getSubTypeProperties(e,r,n){if(n.has(this.name))return;n.add(this.name);let i=oi(e)?e.properties:[];for(let o of i)r.has(o.name)||r.set(o.name,o);for(let o of e.subTypes)this.getSubTypeProperties(o,r,n)}get interfaceSuperTypes(){return Array.from(this.superTypes).filter(e=>e instanceof t)}constructor(e,r,n){this.superTypes=new Set,this.subTypes=new Set,this.containerTypes=new Set,this.typeNames=new Set,this.declared=!1,this.abstract=!1,this.properties=[],this.name=e,this.declared=r,this.abstract=n}toAstTypesString(e){let r=new xr,n=this.interfaceSuperTypes.map(o=>o.name),i=n.length>0?Ds([...n]):["AstNode"];return r.append(`export interface ${this.name} extends ${i.join(", ")} {`,Ct),r.indent(o=>{this.containerTypes.size>0&&o.append(`readonly $container: ${Ds([...this.containerTypes].map(s=>s.name)).join(" | ")};`,Ct),this.typeNames.size>0&&o.append(`readonly $type: ${Ds([...this.typeNames]).map(s=>`'${s}'`).join(" | ")};`,Ct),Jk(o,this.properties,"AstType")}),r.append("}",Ct),e&&(r.append(Ct),Zk(r,this.name)),wa(r)}toDeclaredTypesString(e){let r=new xr,n=uv(this.name,e),i=Ds(this.interfaceSuperTypes.map(o=>o.name)).join(", ");return r.append(`interface ${n}${i.length>0?` extends ${i}`:""} {`,Ct),r.indent(o=>Jk(o,this.properties,"DeclaredType",e)),r.append("}",Ct),wa(r)}},sd=class extends Error{constructor(e,r){super(e),this.name="TypeResolutionError",this.target=r}};function Fu(t,e){return Lo(t,e,new Map)}function Lo(t,e,r){let n=`${$u(t)}\xBB${$u(e)}`,i=r.get(n);return i!==void 0||(r.set(n,!1),i=!1,or(t)?i=t.types.every(o=>Lo(o,e,r)):or(e)?i=e.types.some(o=>Lo(t,o,r)):gn(e)&&ni(e.value)?gn(t)&&ni(t.value)&&e.value.name===t.value.name?i=!0:i=Lo(t,e.value.type,r):ro(t)?i=ro(e)&&Lo(t.referenceType,e.referenceType,r):no(t)?i=no(e)&&Lo(t.elementType,e.elementType,r):gn(t)?ni(t.value)?i=Lo(t.value.type,e,r):gn(e)?ni(e.value)?i=Lo(t,e.value.type,r):i=Qk(t.value,e.value,new Set):i=!1:yn(t)?i=yn(e)&&t.primitive===e.primitive:bi(t)&&(i=yn(e)&&e.primitive==="string"||bi(e)&&e.string===t.string),i&&r.set(n,i)),i}function Qk(t,e,r){let n=t.name;if(r.has(n))return!1;if(r.add(n),t.name===e.name)return!0;for(let i of t.superTypes)if(oi(i)&&Qk(i,e,r))return!0;return!1}function $u(t){if(ro(t))return`@(${$u(t.referenceType)})}`;if(no(t))return`(${$u(t.elementType)})[]`;if(or(t)){let e=t.types.map(r=>$u(r)).join(" | ");return t.types.length<=1?`Union<${e}>`:e}else{if(gn(t))return`Value<${t.value.name}>`;if(yn(t))return t.primitive;if(bi(t))return`'${t.string}'`}throw new Error("Invalid type")}function ii(t,e="AstType"){if(ro(t)){let r=ii(t.referenceType,e);return e==="AstType"?`Reference<${r}>`:`@${sv(t.referenceType,r)}`}else if(no(t)){let r=ii(t.elementType,e);return e==="AstType"?`Array<${r}>`:`${sv(t.elementType,r)}[]`}else if(or(t)){let r=t.types.map(n=>sv(n,ii(n,e)));return Ds(r).join(" | ")}else{if(gn(t))return t.value.name;if(yn(t))return t.primitive;if(bi(t)){let r=e==="AstType"?"'":'"';return`${r}${t.string}${r}`}}throw new Error("Invalid type")}function sv(t,e){return or(t)&&(e=`(${e})`),e}function Jk(t,e,r,n=new Set){function i(o){let s=r==="AstType"?o.name:uv(o.name,n),a=o.optional&&!ad(o.type),c=ii(o.type,r);return`${s}${a?"?":""}: ${c}`}Ds(e,(o,s)=>o.name.localeCompare(s.name)).forEach(o=>t.append(i(o),Ct))}function ad(t){return no(t)?!0:ro(t)?!1:or(t)?t.types.every(e=>ad(e)):yn(t)?t.primitive==="boolean":!1}function Zk(t,e){t.append(`export const ${e} = '${e}';`,Ct),t.append(Ct),t.append(`export function is${e}(item: unknown): item is ${e} {`,Ct),t.indent(r=>r.append(`return reflection.isInstance(item, ${e});`,Ct)),t.append("}",Ct)}function s1(t,e){switch(e.dataType){case"string":if(av(e.type)){let r=Array.from(e.subTypes).map(o=>o.name),n=ew(e.type),i=tw(e.type);if(r.length===0&&n.length===0&&i.length===0)id(t,e.name,`typeof item === '${e.dataType}'`);else{let o=a1(r,n,i);id(t,e.name,o)}}break;case"number":case"boolean":case"bigint":id(t,e.name,`typeof item === '${e.dataType}'`);break;case"Date":id(t,e.name,"item instanceof Date");break;default:return}}function av(t){let e=!0;if(yn(t))return t.primitive==="string";if(bi(t))return!0;if(or(t)){for(let r of t.types)if(gn(r))if(ni(r.value)){if(!av(r.value.type))return!1}else return!1;else if(yn(r)){if(r.primitive!=="string"||!r.regex)return!1}else if(or(r))e=av(r);else if(!bi(r))return!1}else return!1;return e}function a1(t,e,r){let n=[...t.map(i=>`is${i}(item)`),...e.map(i=>`item === '${i}'`)];if(r.length>0){let i=r.map(o=>`${o}.test(item)`).join(" || ");n.push(`(typeof item === 'string' && (${i}))`)}return n.join(" || ")}function uv(t,e){return e.has(t)?`^${t}`:t}function ew(t){let e=[];if(bi(t))return[t.string];if(or(t))for(let r of t.types)bi(r)?e.push(r.string):or(r)&&e.push(...ew(r));return e}function tw(t){let e=[];if(yn(t)&&t.primitive==="string"&&t.regex&&e.push(t.regex),or(t))for(let r of t.types)yn(r)&&r.primitive==="string"&&r.regex?e.push(r.regex):or(r)&&e.push(...tw(r));return e}function id(t,e,r){t.append(Ct,`export function is${e}(item: unknown): item is ${e} {`,Ct),t.indent(n=>n.append(`return ${r};`,Ct)),t.append("}",Ct)}function Ds(t,e){return Array.from(new Set(t)).sort(e)}function lv(t,e,r,n){let i=new Set;return i.add(t),e.findReferences(t,{}).forEach(s=>{let a=r.getOrCreateDocument(s.sourceUri),c=n.getAstNode(a.parseResult.value,s.sourcePath);tn(c)?(i.add(c),lv(c,e,r,n).forEach(l=>i.add(l))):c&&lr(c.$container)&&i.add(c.$container)}),i}function qu(t){let e=new Set;if(tn(t))e.add(t),t.superTypes.forEach(r=>{if(tn(r.ref)){e.add(r.ref);let n=qu(r.ref);for(let i of n)e.add(i)}});else if(lr(t)){let r=rw(t.type);for(let n of r){let i=qu(n);for(let o of i)e.add(o)}}return e}function rw(t){var e;if(Nn(t))return t.types.flatMap(r=>rw(r));if(Ir(t)){let r=(e=t.typeRef)===null||e===void 0?void 0:e.ref;if(lr(r)||tn(r))return[r]}return[]}function fv(t,e){return t.interfaces.concat(e.interfaces)}function ud(t){return t.interfaces.concat(t.unions)}function nw(t){let e=t.sort((i,o)=>i.name.localeCompare(o.name)).map(i=>({value:i,nodes:[]}));for(let i of e)i.nodes=e.filter(o=>i.value.superTypes.has(o.value.name));let r=[],n=e.filter(i=>i.nodes.length===0);for(;n.length>0;){let i=n.shift();r.includes(i)||(r.push(i),e.filter(o=>o.nodes.includes(i)).forEach(o=>n.push(o)))}return r.map(i=>i.value)}function iw(t){return cd(t,new Set)}function cd(t,e){if(e.has(t))return[];if(e.add(t),or(t))return t.types.flatMap(r=>cd(r,e));if(gn(t)){let r=t.value;return"type"in r?cd(r.type,e):[r.name]}else if(no(t))return cd(t.elementType,e);return[]}function ju(t){return typeof t.name=="string"}var Ea=class{getName(e){if(ju(e))return e.name}getNameNode(e){return br(e.$cstNode,"name")}};function de(t){return t.charCodeAt(0)}function ld(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Pa(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Ns(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Uu(){throw Error("Internal Error - Should never get here!")}function dv(t){return t.type==="Character"}var Wu=[];for(let t=de("0");t<=de("9");t++)Wu.push(t);var Hu=[de("_")].concat(Wu);for(let t=de("a");t<=de("z");t++)Hu.push(t);for(let t=de("A");t<=de("Z");t++)Hu.push(t);var pv=[de(" "),de("\f"),de(`
71
+ `),de("\r"),de(" "),de("\v"),de(" "),de("\xA0"),de("\u1680"),de("\u2000"),de("\u2001"),de("\u2002"),de("\u2003"),de("\u2004"),de("\u2005"),de("\u2006"),de("\u2007"),de("\u2008"),de("\u2009"),de("\u200A"),de("\u2028"),de("\u2029"),de("\u202F"),de("\u205F"),de("\u3000"),de("\uFEFF")];var c1=/[0-9a-fA-F]/,fd=/[0-9]/,u1=/[1-9]/,Is=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Pa(n,"global");break;case"i":Pa(n,"ignoreCase");break;case"m":Pa(n,"multiLine");break;case"u":Pa(n,"unicode");break;case"y":Pa(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Ns(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Uu()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Ns(r);break}if(!(e===!0&&r===void 0)&&Ns(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ns(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Uu()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[de(`
72
+ `),de("\r"),de("\u2028"),de("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Wu;break;case"D":e=Wu,r=!0;break;case"s":e=pv;break;case"S":e=pv,r=!0;break;case"w":e=Hu;break;case"W":e=Hu,r=!0;break}return Ns(e)?{type:"Set",value:e,complement:r}:Uu()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=de("\f");break;case"n":e=de(`
73
+ `);break;case"r":e=de("\r");break;case"t":e=de(" ");break;case"v":e=de("\v");break}return Ns(e)?{type:"Character",value:e}:Uu()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:de("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:de(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
74
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:de(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(dv(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(dv(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else ld(n.value,e),e.push(de("-")),ld(o.value,e)}else ld(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
75
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:de("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(u1.test(e)===!1)throw Error("Expecting a positive integer");for(;fd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(fd.test(e)===!1)throw Error("Expecting an integer");for(;fd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
76
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:de(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return fd.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
75
77
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
76
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(nM.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var Ai=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var oM=new Is,Py=class extends Ai{constructor(){super(...arguments),this.isStarting=!0,this.endRegexStack=[],this.multiline=!1}get endRegex(){return this.endRegexStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegex="",this.isStarting=!0,this.endRegexStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===`
77
- `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexStack=[];else{let n=po(r);this.endRegexStack.push(n),this.isStarting&&(this.startRegex+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
78
- `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexStack.push(r),this.isStarting&&(this.startRegex+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},Ey=new Py;function fS(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Ey.reset(t),Ey.visit(oM.pattern(t)),Ey.multiline}catch{return!1}}function Ay(t){return(typeof t=="string"?new RegExp(t):t).test(" ")}function po(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dS(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:po(e)).join("")}function pS(t,e){let r=sM(t),n=e.match(r);return!!n&&n[0].length>0}function sM(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let o="",s;function a(f){o+=r.substr(n,f),n+=f}function c(f){o+="(?:"+r.substr(n,f)+"|$)",n+=f}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?r[n+2]==="{"?c(r.indexOf("}",n)-n+1):c(6):c(2);break;case"p":case"P":e.unicode?c(r.indexOf("}",n)-n+1):c(2);break;case"k":c(r.indexOf(">",n)-n+1);break;default:c(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],c(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?a(s[0].length):c(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":o+="(?:",n+=3,o+=i()+"|$)";break;case"=":o+="(?=",n+=3,o+=i()+")";break;case"!":s=n,n+=3,i(),o+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),o+=r.substr(s,n-s);break;default:a(r.indexOf(">",n)-n+1),o+=i()+"|$)";break}break}else a(1),o+=i()+"|$)";break;case")":return++n,o;default:c(1);break}return o}return new RegExp(i(),t.flags)}var Ny={};TN(Ny,{URI:()=>aM,Utils:()=>cM});var mS;(()=>{"use strict";var t={470:i=>{function o(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function s(c,f){for(var p,m="",T=0,k=-1,A=0,N=0;N<=c.length;++N){if(N<c.length)p=c.charCodeAt(N);else{if(p===47)break;p=47}if(p===47){if(!(k===N-1||A===1))if(k!==N-1&&A===2){if(m.length<2||T!==2||m.charCodeAt(m.length-1)!==46||m.charCodeAt(m.length-2)!==46){if(m.length>2){var O=m.lastIndexOf("/");if(O!==m.length-1){O===-1?(m="",T=0):T=(m=m.slice(0,O)).length-1-m.lastIndexOf("/"),k=N,A=0;continue}}else if(m.length===2||m.length===1){m="",T=0,k=N,A=0;continue}}f&&(m.length>0?m+="/..":m="..",T=2)}else m.length>0?m+="/"+c.slice(k+1,N):m=c.slice(k+1,N),T=N-k-1;k=N,A=0}else p===46&&A!==-1?++A:A=-1}return m}var a={resolve:function(){for(var c,f="",p=!1,m=arguments.length-1;m>=-1&&!p;m--){var T;m>=0?T=arguments[m]:(c===void 0&&(c=process.cwd()),T=c),o(T),T.length!==0&&(f=T+"/"+f,p=T.charCodeAt(0)===47)}return f=s(f,!p),p?f.length>0?"/"+f:"/":f.length>0?f:"."},normalize:function(c){if(o(c),c.length===0)return".";var f=c.charCodeAt(0)===47,p=c.charCodeAt(c.length-1)===47;return(c=s(c,!f)).length!==0||f||(c="."),c.length>0&&p&&(c+="/"),f?"/"+c:c},isAbsolute:function(c){return o(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,f=0;f<arguments.length;++f){var p=arguments[f];o(p),p.length>0&&(c===void 0?c=p:c+="/"+p)}return c===void 0?".":a.normalize(c)},relative:function(c,f){if(o(c),o(f),c===f||(c=a.resolve(c))===(f=a.resolve(f)))return"";for(var p=1;p<c.length&&c.charCodeAt(p)===47;++p);for(var m=c.length,T=m-p,k=1;k<f.length&&f.charCodeAt(k)===47;++k);for(var A=f.length-k,N=T<A?T:A,O=-1,P=0;P<=N;++P){if(P===N){if(A>N){if(f.charCodeAt(k+P)===47)return f.slice(k+P+1);if(P===0)return f.slice(k+P)}else T>N&&(c.charCodeAt(p+P)===47?O=P:P===0&&(O=0));break}var y=c.charCodeAt(p+P);if(y!==f.charCodeAt(k+P))break;y===47&&(O=P)}var h="";for(P=p+O+1;P<=m;++P)P!==m&&c.charCodeAt(P)!==47||(h.length===0?h+="..":h+="/..");return h.length>0?h+f.slice(k+O):(k+=O,f.charCodeAt(k)===47&&++k,f.slice(k))},_makeLong:function(c){return c},dirname:function(c){if(o(c),c.length===0)return".";for(var f=c.charCodeAt(0),p=f===47,m=-1,T=!0,k=c.length-1;k>=1;--k)if((f=c.charCodeAt(k))===47){if(!T){m=k;break}}else T=!1;return m===-1?p?"/":".":p&&m===1?"//":c.slice(0,m)},basename:function(c,f){if(f!==void 0&&typeof f!="string")throw new TypeError('"ext" argument must be a string');o(c);var p,m=0,T=-1,k=!0;if(f!==void 0&&f.length>0&&f.length<=c.length){if(f.length===c.length&&f===c)return"";var A=f.length-1,N=-1;for(p=c.length-1;p>=0;--p){var O=c.charCodeAt(p);if(O===47){if(!k){m=p+1;break}}else N===-1&&(k=!1,N=p+1),A>=0&&(O===f.charCodeAt(A)?--A==-1&&(T=p):(A=-1,T=N))}return m===T?T=N:T===-1&&(T=c.length),c.slice(m,T)}for(p=c.length-1;p>=0;--p)if(c.charCodeAt(p)===47){if(!k){m=p+1;break}}else T===-1&&(k=!1,T=p+1);return T===-1?"":c.slice(m,T)},extname:function(c){o(c);for(var f=-1,p=0,m=-1,T=!0,k=0,A=c.length-1;A>=0;--A){var N=c.charCodeAt(A);if(N!==47)m===-1&&(T=!1,m=A+1),N===46?f===-1?f=A:k!==1&&(k=1):f!==-1&&(k=-1);else if(!T){p=A+1;break}}return f===-1||m===-1||k===0||k===1&&f===m-1&&f===p+1?"":c.slice(f,m)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(f,p){var m=p.dir||p.root,T=p.base||(p.name||"")+(p.ext||"");return m?m===p.root?m+T:m+"/"+T:T}(0,c)},parse:function(c){o(c);var f={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return f;var p,m=c.charCodeAt(0),T=m===47;T?(f.root="/",p=1):p=0;for(var k=-1,A=0,N=-1,O=!0,P=c.length-1,y=0;P>=p;--P)if((m=c.charCodeAt(P))!==47)N===-1&&(O=!1,N=P+1),m===46?k===-1?k=P:y!==1&&(y=1):k!==-1&&(y=-1);else if(!O){A=P+1;break}return k===-1||N===-1||y===0||y===1&&k===N-1&&k===A+1?N!==-1&&(f.base=f.name=A===0&&T?c.slice(1,N):c.slice(A,N)):(A===0&&T?(f.name=c.slice(1,k),f.base=c.slice(1,N)):(f.name=c.slice(A,k),f.base=c.slice(A,N)),f.ext=c.slice(k,N)),A>0?f.dir=c.slice(0,A-1):T&&(f.dir="/"),f},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a}},e={};function r(i){var o=e[i];if(o!==void 0)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.d=(i,o)=>{for(var s in o)r.o(o,s)&&!r.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:o[s]})},r.o=(i,o)=>Object.prototype.hasOwnProperty.call(i,o),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:()=>T,Utils:()=>tt}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let o=/^\w[\w\d+.-]*$/,s=/^\//,a=/^\/\//;function c(U,I){if(!U.scheme&&I)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${U.authority}", path: "${U.path}", query: "${U.query}", fragment: "${U.fragment}"}`);if(U.scheme&&!o.test(U.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(U.path){if(U.authority){if(!s.test(U.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(a.test(U.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="",p="/",m=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class T{static isUri(I){return I instanceof T||!!I&&typeof I.authority=="string"&&typeof I.fragment=="string"&&typeof I.path=="string"&&typeof I.query=="string"&&typeof I.scheme=="string"&&typeof I.fsPath=="string"&&typeof I.with=="function"&&typeof I.toString=="function"}scheme;authority;path;query;fragment;constructor(I,K,V,Ce,me,fe=!1){typeof I=="object"?(this.scheme=I.scheme||f,this.authority=I.authority||f,this.path=I.path||f,this.query=I.query||f,this.fragment=I.fragment||f):(this.scheme=function(gt,ze){return gt||ze?gt:"file"}(I,fe),this.authority=K||f,this.path=function(gt,ze){switch(gt){case"https":case"http":case"file":ze?ze[0]!==p&&(ze=p+ze):ze=p}return ze}(this.scheme,V||f),this.query=Ce||f,this.fragment=me||f,c(this,fe))}get fsPath(){return y(this,!1)}with(I){if(!I)return this;let{scheme:K,authority:V,path:Ce,query:me,fragment:fe}=I;return K===void 0?K=this.scheme:K===null&&(K=f),V===void 0?V=this.authority:V===null&&(V=f),Ce===void 0?Ce=this.path:Ce===null&&(Ce=f),me===void 0?me=this.query:me===null&&(me=f),fe===void 0?fe=this.fragment:fe===null&&(fe=f),K===this.scheme&&V===this.authority&&Ce===this.path&&me===this.query&&fe===this.fragment?this:new A(K,V,Ce,me,fe)}static parse(I,K=!1){let V=m.exec(I);return V?new A(V[2]||f,z(V[4]||f),z(V[5]||f),z(V[7]||f),z(V[9]||f),K):new A(f,f,f,f,f)}static file(I){let K=f;if(i&&(I=I.replace(/\\/g,p)),I[0]===p&&I[1]===p){let V=I.indexOf(p,2);V===-1?(K=I.substring(2),I=p):(K=I.substring(2,V),I=I.substring(V)||p)}return new A("file",K,I,f,f)}static from(I){let K=new A(I.scheme,I.authority,I.path,I.query,I.fragment);return c(K,!0),K}toString(I=!1){return h(this,I)}toJSON(){return this}static revive(I){if(I){if(I instanceof T)return I;{let K=new A(I);return K._formatted=I.external,K._fsPath=I._sep===k?I.fsPath:null,K}}return I}}let k=i?1:void 0;class A extends T{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=y(this,!1)),this._fsPath}toString(I=!1){return I?h(this,!0):(this._formatted||(this._formatted=h(this,!1)),this._formatted)}toJSON(){let I={$mid:1};return this._fsPath&&(I.fsPath=this._fsPath,I._sep=k),this._formatted&&(I.external=this._formatted),this.path&&(I.path=this.path),this.scheme&&(I.scheme=this.scheme),this.authority&&(I.authority=this.authority),this.query&&(I.query=this.query),this.fragment&&(I.fragment=this.fragment),I}}let N={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 O(U,I,K){let V,Ce=-1;for(let me=0;me<U.length;me++){let fe=U.charCodeAt(me);if(fe>=97&&fe<=122||fe>=65&&fe<=90||fe>=48&&fe<=57||fe===45||fe===46||fe===95||fe===126||I&&fe===47||K&&fe===91||K&&fe===93||K&&fe===58)Ce!==-1&&(V+=encodeURIComponent(U.substring(Ce,me)),Ce=-1),V!==void 0&&(V+=U.charAt(me));else{V===void 0&&(V=U.substr(0,me));let gt=N[fe];gt!==void 0?(Ce!==-1&&(V+=encodeURIComponent(U.substring(Ce,me)),Ce=-1),V+=gt):Ce===-1&&(Ce=me)}}return Ce!==-1&&(V+=encodeURIComponent(U.substring(Ce))),V!==void 0?V:U}function P(U){let I;for(let K=0;K<U.length;K++){let V=U.charCodeAt(K);V===35||V===63?(I===void 0&&(I=U.substr(0,K)),I+=N[V]):I!==void 0&&(I+=U[K])}return I!==void 0?I:U}function y(U,I){let K;return K=U.authority&&U.path.length>1&&U.scheme==="file"?`//${U.authority}${U.path}`:U.path.charCodeAt(0)===47&&(U.path.charCodeAt(1)>=65&&U.path.charCodeAt(1)<=90||U.path.charCodeAt(1)>=97&&U.path.charCodeAt(1)<=122)&&U.path.charCodeAt(2)===58?I?U.path.substr(1):U.path[1].toLowerCase()+U.path.substr(2):U.path,i&&(K=K.replace(/\//g,"\\")),K}function h(U,I){let K=I?P:O,V="",{scheme:Ce,authority:me,path:fe,query:gt,fragment:ze}=U;if(Ce&&(V+=Ce,V+=":"),(me||Ce==="file")&&(V+=p,V+=p),me){let _e=me.indexOf("@");if(_e!==-1){let sr=me.substr(0,_e);me=me.substr(_e+1),_e=sr.lastIndexOf(":"),_e===-1?V+=K(sr,!1,!1):(V+=K(sr.substr(0,_e),!1,!1),V+=":",V+=K(sr.substr(_e+1),!1,!0)),V+="@"}me=me.toLowerCase(),_e=me.lastIndexOf(":"),_e===-1?V+=K(me,!1,!0):(V+=K(me.substr(0,_e),!1,!0),V+=me.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)}`)}V+=K(fe,!0,!1)}return gt&&(V+="?",V+=K(gt,!1,!1)),ze&&(V+="#",V+=I?ze:O(ze,!1,!1)),V}function C(U){try{return decodeURIComponent(U)}catch{return U.length>3?U.substr(0,3)+C(U.substr(3)):U}}let M=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function z(U){return U.match(M)?U.replace(M,I=>C(I)):U}var ce=r(470);let we=ce.posix||ce,Rt="/";var tt;(function(U){U.joinPath=function(I,...K){return I.with({path:we.join(I.path,...K)})},U.resolvePath=function(I,...K){let V=I.path,Ce=!1;V[0]!==Rt&&(V=Rt+V,Ce=!0);let me=we.resolve(V,...K);return Ce&&me[0]===Rt&&!I.authority&&(me=me.substring(1)),I.with({path:me})},U.dirname=function(I){if(I.path.length===0||I.path===Rt)return I;let K=we.dirname(I.path);return K.length===1&&K.charCodeAt(0)===46&&(K=""),I.with({path:K})},U.basename=function(I){return we.basename(I.path)},U.extname=function(I){return we.extname(I.path)}})(tt||(tt={}))})(),mS=n})();var{URI:aM,Utils:cM}=mS;var mo=Ny;"default"in mo&&(mo=mo.default);var Dr=mo.URI;var qe;(function(t){t.basename=mo.Utils.basename,t.dirname=mo.Utils.dirname,t.extname=mo.Utils.extname,t.joinPath=mo.Utils.joinPath,t.resolvePath=mo.Utils.resolvePath;function e(n,i){return n?.toString()===i?.toString()}t.equals=e;function r(n,i){let o=typeof n=="string"?n:n.path,s=typeof i=="string"?i:i.path,a=o.split("/").filter(T=>T.length>0),c=s.split("/").filter(T=>T.length>0),f=0;for(;f<a.length&&a[f]===c[f];f++);let p="../".repeat(a.length-f),m=c.slice(f).join("/");return p+m}t.relative=r})(qe=qe||(qe={}));var _6=qe.equals,S6=qe.relative;var Zf,hS=()=>Zf??(Zf=ed(`{"$type":"Grammar","isDeclared":true,"name":"LangiumGrammar","rules":[{"$type":"ParserRule","name":"Grammar","entry":true,"definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"isDeclared","operator":"?=","terminal":{"$type":"Keyword","value":"grammar"}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"usedGrammars","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"usedGrammars","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"definesHiddenTokens","operator":"?=","terminal":{"$type":"Keyword","value":"hidden"}},{"$type":"Keyword","value":"("},{"$type":"Group","elements":[{"$type":"Assignment","feature":"hiddenTokens","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"hiddenTokens","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"interfaces","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"types","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"+"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Interface","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"interface"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"superTypes","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"superTypes","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SchemaType","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"attributes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypeAttribute","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}},{"$type":"Assignment","feature":"isOptional","operator":"?=","terminal":{"$type":"Keyword","value":"?"},"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypeDefinition","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"UnionType","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"UnionType"},"feature":"types","operator":"+="},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"types","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrayType","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ArrayType"},"feature":"elementType","operator":"="},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ReferenceType","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ReferenceType"}},{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"referenceType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SimpleType","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"SimpleType"}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"typeRef","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"primitiveType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"stringType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PrimitiveType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"string"},{"$type":"Keyword","value":"number"},{"$type":"Keyword","value":"boolean"},{"$type":"Keyword","value":"Date"},{"$type":"Keyword","value":"bigint"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Type","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"type"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AbstractRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GrammarImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParserRule","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"entry","operator":"?=","terminal":{"$type":"Keyword","value":"entry"}},{"$type":"Assignment","feature":"fragment","operator":"?=","terminal":{"$type":"Keyword","value":"fragment"}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"wildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Group","elements":[{"$type":"Keyword","value":"returns"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"returnType","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Assignment","feature":"inferredType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[{"$type":"NamedArgument","value":{"$type":"LiteralCondition","true":false},"calledByName":false}]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"definesHiddenTokens","operator":"?=","terminal":{"$type":"Keyword","value":"hidden"}},{"$type":"Keyword","value":"("},{"$type":"Group","elements":[{"$type":"Assignment","feature":"hiddenTokens","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"hiddenTokens","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InferredType","parameters":[{"$type":"Parameter","name":"imperative"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@14/parameters@0"}},"elements":[{"$type":"Keyword","value":"infer"}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@14/parameters@0"}}},"elements":[{"$type":"Keyword","value":"infers"}]}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"RuleNameAndParams","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"<"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"parameters","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"parameters","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":">"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Parameter","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Alternatives","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Alternatives"},"feature":"elements","operator":"+="},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ConditionalBranch","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Group"}},{"$type":"Keyword","value":"<"},{"$type":"Assignment","feature":"guardCondition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":">"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"+"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"UnorderedGroup","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"UnorderedGroup"},"feature":"elements","operator":"+="},{"$type":"Group","elements":[{"$type":"Keyword","value":"&"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Group"},"feature":"elements","operator":"+="},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AbstractToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AbstractTokenWithCardinality","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}]},{"$type":"Assignment","feature":"cardinality","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"*"},{"$type":"Keyword","value":"+"}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Action","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Action"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"inferredType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[{"$type":"NamedArgument","value":{"$type":"LiteralCondition","true":true},"calledByName":false}]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"feature","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"+="}]}},{"$type":"Keyword","value":"current"}],"cardinality":"?"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AbstractTerminal","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Keyword","definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RuleCall","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rule","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"<"},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":">"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NamedArgument","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"parameter","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@16"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"calledByName","operator":"?=","terminal":{"$type":"Keyword","value":"="}}],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LiteralCondition","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"true","operator":"?=","terminal":{"$type":"Keyword","value":"true"}},{"$type":"Keyword","value":"false"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Disjunction","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Disjunction"},"feature":"left","operator":"="},{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Conjunction","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Conjunction"},"feature":"left","operator":"="},{"$type":"Keyword","value":"&"},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Negation","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Negation"}},{"$type":"Keyword","value":"!"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Atom","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParenthesizedCondition","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParameterReference","definition":{"$type":"Assignment","feature":"parameter","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@16"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PredicatedKeyword","inferredType":{"$type":"InferredType","name":"Keyword"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=>"},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PredicatedRuleCall","inferredType":{"$type":"InferredType","name":"RuleCall"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=>"},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"rule","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"<"},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":">"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Assignment","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Assignment"}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=>"},{"$type":"Keyword","value":"->"}],"cardinality":"?"},{"$type":"Assignment","feature":"feature","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"+="},{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"?="}]}},{"$type":"Assignment","feature":"terminal","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AssignableTerminal","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParenthesizedAssignableElement","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AssignableAlternatives","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Alternatives"},"feature":"elements","operator":"+="},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]}}],"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CrossReference","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"CrossReference"}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"deprecatedSyntax","operator":"?=","terminal":{"$type":"Keyword","value":"|"}},{"$type":"Keyword","value":":"}]},{"$type":"Assignment","feature":"terminal","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CrossReferenceableTerminal","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParenthesizedElement","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PredicatedGroup","inferredType":{"$type":"InferredType","name":"Group"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=>"},{"$type":"Keyword","value":"->"}]},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ReturnType","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalRule","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"hidden","operator":"?=","terminal":{"$type":"Keyword","value":"hidden"},"cardinality":"?"},{"$type":"Keyword","value":"terminal"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"fragment","operator":"?=","terminal":{"$type":"Keyword","value":"fragment"}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"returns"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}}],"cardinality":"?"}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalAlternatives","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"TerminalAlternatives"},"feature":"elements","operator":"+="},{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalGroup","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"TerminalGroup"},"feature":"elements","operator":"+="},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"Assignment","feature":"cardinality","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"*"},{"$type":"Keyword","value":"+"}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalTokenElement","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParenthesizedTerminalElement","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"lookahead","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"?="},{"$type":"Keyword","value":"?!"}]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalRuleCall","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"TerminalRuleCall"}},{"$type":"Assignment","feature":"rule","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@46"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NegatedToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"NegatedToken"}},{"$type":"Keyword","value":"!"},{"$type":"Assignment","feature":"terminal","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"UntilToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"UntilToken"}},{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"terminal","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RegexToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RegexToken"}},{"$type":"Assignment","feature":"regex","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Wildcard","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Wildcard"}},{"$type":"Keyword","value":"."}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CharacterRange","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"CharacterRange"}},{"$type":"Assignment","feature":"left","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":".."},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FeatureName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"current"},{"$type":"Keyword","value":"entry"},{"$type":"Keyword","value":"extends"},{"$type":"Keyword","value":"false"},{"$type":"Keyword","value":"fragment"},{"$type":"Keyword","value":"grammar"},{"$type":"Keyword","value":"hidden"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"interface"},{"$type":"Keyword","value":"returns"},{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"true"},{"$type":"Keyword","value":"type"},{"$type":"Keyword","value":"infer"},{"$type":"Keyword","value":"infers"},{"$type":"Keyword","value":"with"},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/\\\\^?[_a-zA-Z][\\\\w_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"|'(\\\\\\\\.|[^'\\\\\\\\])*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RegexLiteral","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\/(?![*+?])(?:[^\\\\r\\\\n\\\\[/\\\\\\\\]|\\\\\\\\.|\\\\[(?:[^\\\\r\\\\n\\\\]\\\\\\\\]|\\\\\\\\.)*\\\\])+\\\\/[a-z]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false}],"types":[{"$type":"Type","name":"AbstractType","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@1"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@23/definition/elements@0"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@13"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`));var nd=Ie(xs(),1);var Au=Ie(io(),1);function uM(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}var gS=0,lM=10;var yS=Symbol("OperationCancelled");function Os(t){return t===yS}async function _t(t){if(t===Au.CancellationToken.None)return;let e=Date.now();if(e-gS>=lM&&(gS=e,await uM()),t.isCancellationRequested)throw yS}var td=class{constructor(){this.previousAction=Promise.resolve(),this.previousTokenSource=new Au.CancellationTokenSource}lock(e){this.cancel();let r=new Au.CancellationTokenSource;return this.previousTokenSource=r,this.previousAction=this.previousAction.then(()=>e(r.token).catch(n=>{Os(n)||console.error("Error: ",n)}))}cancel(){this.previousTokenSource.cancel()}};function kn(t){return{code:t}}var Ea;(function(t){t.all=["fast","slow","built-in"]})(Ea=Ea||(Ea={}));var rd=class{constructor(e){this.entries=new Ye,this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(let[i,o]of Object.entries(e)){let s=o;if(Array.isArray(s))for(let a of s){let c={check:this.wrapValidationException(a,r),category:n};this.addEntry(i,c)}else if(typeof s=="function"){let a={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,a)}}}wrapValidationException(e,r){return async(n,i,o)=>{try{await e.call(r,n,i,o)}catch(s){if(Os(s))throw s;console.error("An error occurred during validation:",s);let a=s instanceof Error?s.message:String(s);s instanceof Error&&s.stack&&console.error(s.stack),i("error","An error occurred during validation: "+a,{node:n})}}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=ke(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}};function vS(t,e){let r={unions:[],interfaces:[]};for(let n of t){let i=[];for(let a of n.attributes)i.push({name:a.name,optional:a.isOptional,astNodes:new Set([a]),type:Ls(a.type)});let o=new Set;for(let a of n.superTypes)a.ref&&o.add(ci(a.ref));let s={name:n.name,declared:!0,abstract:!1,properties:i,superTypes:o,subTypes:new Set};r.interfaces.push(s)}for(let n of e){let i={name:n.name,declared:!0,type:Ls(n.type),superTypes:new Set,subTypes:new Set};r.unions.push(i)}return r}function Ls(t){if(Es(t))return{elementType:Ls(t.elementType)};if(Ps(t))return{referenceType:Ls(t.referenceType)};if(qn(t))return{types:t.types.map(Ls)};if(Ur(t)){let e;if(t.primitiveType)return e=t.primitiveType,{primitive:e};if(t.stringType)return e=t.stringType,{string:e};if(t.typeRef){let r=t.typeRef.ref,n=Ni(r);if(n)return Pa(n)?{primitive:n}:{value:n}}}return{primitive:"unknown"}}function Aa(t){return"referenceType"in t}function Iy(t){return"elementType"in t}function TS(t){return"types"in t}function Oy(t){return"value"in t}function fM(t){return"primitive"in t}function dM(t){return"string"in t}function RS(t){let e=new Map,r=new Map;for(let n of t.interfaces){let i=new Ca(n.name,n.declared,n.abstract);e.set(n.name,i)}for(let n of t.unions){let i=new Kf(n.name,{declared:n.declared,dataType:n.dataType});r.set(n.name,i)}for(let n of t.interfaces){let i=e.get(n.name);for(let o of n.superTypes){let s=e.get(o)||r.get(o);s&&i.superTypes.add(s)}for(let o of n.subTypes){let s=e.get(o)||r.get(o);s&&i.subTypes.add(s)}for(let o of n.properties){let s=pM(o,e,r);i.properties.push(s)}}for(let n of t.unions){let i=r.get(n.name);i.type=Nu(n.type,i,e,r)}return{interfaces:Array.from(e.values()),unions:Array.from(r.values())}}function pM(t,e,r){return{name:t.name,optional:t.optional,astNodes:t.astNodes,type:Nu(t.type,void 0,e,r)}}function Nu(t,e,r,n){if(Iy(t))return{elementType:Nu(t.elementType,e,r,n)};if(Aa(t))return{referenceType:Nu(t.referenceType,void 0,r,n)};if(TS(t))return{types:t.types.map(i=>Nu(i,e,r,n))};if(dM(t))return{string:t.string};if(fM(t))return{primitive:t.primitive,regex:t.regex};if(Oy(t)){let i=r.get(t.value)||n.get(t.value);return i?(e&&e.subTypes.add(i),{value:i}):{primitive:"unknown"}}else throw new Error("Invalid property type")}function My(t,e){let r=Iu(t),n=Iu(e);for(let i of n)mM(r,i)||r.push(i);return r.length===1?r[0]:{types:r}}function mM(t,e){return t.some(r=>Ly(r,e))}function Ly(t,e){return Iy(t)&&Iy(e)?Ly(t.elementType,e.elementType):Aa(t)&&Aa(e)?Ly(t.referenceType,e.referenceType):Oy(t)&&Oy(e)?t.value===e.value:!1}function Iu(t){return TS(t)?t.types.flatMap(e=>Iu(e)):[t]}function xS(t){let e=t.validation.ValidationRegistry,r=t.validation.LangiumGrammarValidator,n={Action:[r.checkAssignmentReservedName],AbstractRule:r.checkRuleName,Assignment:[r.checkAssignmentWithFeatureName,r.checkAssignmentToFragmentRule,r.checkAssignmentTypes,r.checkAssignmentReservedName],ParserRule:[r.checkParserRuleDataType,r.checkRuleParametersUsed,r.checkParserRuleReservedName],TerminalRule:[r.checkTerminalRuleReturnType,r.checkHiddenTerminalRule,r.checkEmptyTerminalRule],InferredType:r.checkTypeReservedName,Keyword:r.checkKeyword,UnorderedGroup:r.checkUnorderedGroup,Grammar:[r.checkGrammarName,r.checkEntryGrammarRule,r.checkUniqueRuleName,r.checkUniqueTypeName,r.checkUniqueImportedRules,r.checkDuplicateImportedGrammar,r.checkGrammarHiddenTokens,r.checkGrammarForUnusedRules,r.checkGrammarTypeInfer,r.checkClashingTerminalNames],GrammarImport:r.checkPackageImport,CharacterRange:r.checkInvalidCharacterRange,Interface:[r.checkTypeReservedName,r.checkInterfacePropertyTypes],Type:[r.checkTypeReservedName],TypeAttribute:r.checkTypeReservedName,RuleCall:[r.checkUsedHiddenTerminalRule,r.checkUsedFragmentTerminalRule,r.checkRuleCallParameters],TerminalRuleCall:r.checkUsedHiddenTerminalRule,CrossReference:[r.checkCrossReferenceSyntax,r.checkCrossRefNameAssignment,r.checkCrossRefTerminalType,r.checkCrossRefType,r.checkCrossReferenceToTypeUnion],SimpleType:r.checkFragmentsInTypes,ReferenceType:r.checkReferenceTypeUnion,RegexToken:[r.checkInvalidRegexFlags,r.checkDirectlyUsedRegexFlags]};e.register(n,r)}var Ge;(function(t){t.GrammarNameUppercase="grammar-name-uppercase",t.RuleNameUppercase="rule-name-uppercase",t.HiddenGrammarTokens="hidden-grammar-tokens",t.UseRegexTokens="use-regex-tokens",t.EntryRuleTokenSyntax="entry-rule-token-syntax",t.CrossRefTokenSyntax="cross-ref-token-syntax",t.UnnecessaryFileExtension="unnecessary-file-extension",t.InvalidReturns="invalid-returns",t.InvalidInfers="invalid-infers",t.MissingInfer="missing-infer",t.MissingReturns="missing-returns",t.SuperfluousInfer="superfluous-infer",t.OptionalUnorderedGroup="optional-unordered-group"})(Ge=Ge||(Ge={}));var id=class{constructor(e){this.references=e.references.References,this.documents=e.shared.workspace.LangiumDocuments}checkGrammarName(e,r){if(e.name){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","Grammar name should start with an upper case letter.",{node:e,property:"name",data:kn(Ge.GrammarNameUppercase)})}}checkEntryGrammarRule(e,r){if(e.isDeclared&&!e.name)return;let n=e.rules.filter(i=>Z(i)&&i.entry);if(e.isDeclared&&n.length===0){let i=e.rules.find(o=>Z(o)&&!Cn(o));i?r("error","The grammar is missing an entry parser rule. This rule can be an entry one.",{node:i,property:"name",data:kn(Ge.EntryRuleTokenSyntax)}):r("error","This grammar is missing an entry parser rule.",{node:e,property:"name"})}else!e.isDeclared&&n.length>=1?n.forEach(i=>r("error","Cannot declare entry rules for unnamed grammars.",{node:i,property:"name"})):n.length>1?n.forEach(i=>r("error","The entry rule has to be unique.",{node:i,property:"name"})):n.length===1&&Cn(n[0])&&r("error","The entry rule cannot be a data type rule.",{node:n[0],property:"name"})}checkUniqueRuleName(e,r){let n=i=>ke(i.rules).filter(o=>!Ou(o));this.checkUniqueName(e,r,n,"rule")}checkUniqueTypeName(e,r){let n=i=>ke(i.types).concat(i.interfaces);this.checkUniqueName(e,r,n,"type")}checkUniqueName(e,r,n,i){let o=new Ye;n(e).forEach(c=>o.add(c.name,c));for(let[,c]of o.entriesGroupedByKey())c.length>1&&c.forEach(f=>{r("error",`A ${i}'s name has to be unique.`,{node:f,property:"name"})});let s=new Set,a=Lu(this.documents,e);for(let c of a)n(c).forEach(f=>s.add(f.name));for(let c of o.keys())s.has(c)&&o.get(c).forEach(p=>{r("error",`A ${i} with the name '${p.name}' already exists in an imported grammar.`,{node:p,property:"name"})})}checkDuplicateImportedGrammar(e,r){let n=new Ye;for(let i of e.imports){let o=ho(this.documents,i);o&&n.add(o,i)}for(let[,i]of n.entriesGroupedByKey())i.length>1&&i.forEach((o,s)=>{s>0&&r("warning","The grammar is already being directly imported.",{node:o,tags:[nd.DiagnosticTag.Unnecessary]})})}checkUniqueImportedRules(e,r){let n=new Map;for(let o of e.imports){let s=Lu(this.documents,o);n.set(o,s)}let i=new Ye;for(let o of e.imports){let s=n.get(o);for(let a of e.imports){if(o===a)continue;let c=n.get(a),f=this.getDuplicateExportedRules(s,c);for(let p of f)i.add(o,p)}}for(let o of e.imports){let s=i.get(o);s.length>0&&r("error","Some rules exported by this grammar are also included in other imports: "+ke(s).distinct().join(", "),{node:o,property:"path"})}}getDuplicateExportedRules(e,r){let i=e.filter(a=>!r.includes(a)).flatMap(a=>a.rules),o=r.flatMap(a=>a.rules),s=new Set;for(let a of i){let c=a.name;for(let f of o){let p=f.name;c===p&&s.add(f.name)}}return s}checkGrammarTypeInfer(e,r){var n,i,o;let s=new Set;for(let c of e.types)s.add(c.name);for(let c of e.interfaces)s.add(c.name);for(let c of Lu(this.documents,e))c.types.forEach(f=>s.add(f.name)),c.interfaces.forEach(f=>s.add(f.name));for(let c of e.rules.filter(Z)){if(Ou(c))continue;let f=Cn(c),p=!c.returnType&&!c.dataType,m=Ni(c);if(!f&&m&&s.has(m)===p){if((p||((n=c.returnType)===null||n===void 0?void 0:n.ref)!==void 0)&&c.inferredType===void 0)r("error",a(m,p),{node:c,property:"name",data:kn(Ge.MissingReturns)});else if(p||((i=c.returnType)===null||i===void 0?void 0:i.ref)!==void 0){let T=Fn(c.inferredType.$cstNode,"infers");r("error",a(m,p),{node:c.inferredType,property:"name",data:{code:Ge.InvalidInfers,actionSegment:jr(T)}})}}else if(f&&p){let T=Fn(c.$cstNode,"infer");r("error","Data type rules cannot infer a type.",{node:c,property:"inferredType",data:{code:Ge.InvalidInfers,actionSegment:jr(T)}})}}for(let c of bt(e).filter(Je)){let f=this.getActionType(c);if(f){let p=!!c.inferredType,m=Ni(c);if(c.type&&m&&s.has(m)===p){let T=p?Fn(c.$cstNode,"infer"):Fn(c.$cstNode,"{");r("error",a(m,p),{node:c,property:"type",data:{code:p?Ge.SuperfluousInfer:Ge.MissingInfer,actionSegment:jr(T)}})}else if(f&&m&&s.has(m)&&p&&c.$cstNode){let T=wr((o=c.inferredType)===null||o===void 0?void 0:o.$cstNode,"name"),k=Fn(c.$cstNode,"{");T&&k&&r("error",`${m} is a declared type and cannot be redefined.`,{node:c,property:"type",data:{code:Ge.SuperfluousInfer,actionRange:{start:k.range.end,end:T.range.start}}})}}}function a(c,f){return f?`The type '${c}' is already explicitly declared and cannot be inferred.`:`The type '${c}' is not explicitly declared and must be inferred.`}}getActionType(e){var r;if(e.type)return(r=e.type)===null||r===void 0?void 0:r.ref;if(e.inferredType)return e.inferredType}checkGrammarHiddenTokens(e,r){e.definesHiddenTokens&&r("error","Hidden terminals are declared at the terminal definition.",{node:e,property:"definesHiddenTokens",data:kn(Ge.HiddenGrammarTokens)})}checkHiddenTerminalRule(e,r){e.hidden&&e.fragment&&r("error","Cannot use terminal fragments as hidden tokens.",{node:e,property:"hidden"})}checkEmptyTerminalRule(e,r){try{let n=Un(e);new RegExp(n).test("")&&r("error","This terminal could match an empty string.",{node:e,property:"name"})}catch{}}checkInvalidRegexFlags(e,r){let n=e.regex;if(n){let i=n.lastIndexOf("/"),o=n.substring(i+1),s="gmy",c=s+"isu",f=new Set,p=new Set;for(let T=0;T<o.length;T++){let k=o.charAt(T);c.includes(k)?s.includes(k)&&p.add(k):f.add(k)}let m=this.getFlagRange(e);m&&(f.size>0?r("error",`'${Array.from(f).join("")}' ${f.size>1?"are":"is"} not valid regular expression flag${f.size>1?"s":""}.`,{node:e,range:m}):p.size>0&&r("warning",`'${Array.from(p).join("")}' regular expression flag${p.size>1?"s":""} will be ignored by Langium.`,{node:e,range:m}))}}checkDirectlyUsedRegexFlags(e,r){if(!He(e.$container)){let n=this.getFlagRange(e);n&&r("warning","Regular expression flags are only applied if the terminal is not a composition",{node:e,range:n})}}getFlagRange(e){let r=wr(e.$cstNode,"regex");if(!r||!e.regex)return;let n=e.regex,i=n.lastIndexOf("/")+1;return{start:{line:r.range.end.line,character:r.range.end.character-n.length+i},end:r.range.end}}checkUsedHiddenTerminalRule(e,r){let n=Ze(e,i=>He(i)||Z(i));if(n){if("hidden"in n&&n.hidden)return;let i=e.rule.ref;He(i)&&i.hidden&&r("error","Cannot use hidden terminal in non-hidden rule",{node:e,property:"rule"})}}checkUsedFragmentTerminalRule(e,r){let n=e.rule.ref;He(n)&&n.fragment&&Ze(e,Z)&&r("error","Cannot use terminal fragments as part of parser rules.",{node:e,property:"rule"})}checkCrossReferenceSyntax(e,r){e.deprecatedSyntax&&r("error","'|' is deprecated. Please, use ':' instead.",{node:e,property:"deprecatedSyntax",data:kn(Ge.CrossRefTokenSyntax)})}checkPackageImport(e,r){ho(this.documents,e)===void 0?r("error","Import cannot be resolved.",{node:e,property:"path"}):e.path.endsWith(".langium")&&r("warning","Imports do not need file extensions.",{node:e,property:"path",data:kn(Ge.UnnecessaryFileExtension)})}checkInvalidCharacterRange(e,r){if(e.right){let n="Character ranges cannot use more than one character",i=!1;e.left.value.length>1&&(i=!0,r("error",n,{node:e.left,property:"value"})),e.right.value.length>1&&(i=!0,r("error",n,{node:e.right,property:"value"})),i||r("hint","Consider using regex instead of character ranges",{node:e,data:kn(Ge.UseRegexTokens)})}}checkGrammarForUnusedRules(e,r){let n=Na(e,!0);for(let i of e.rules)He(i)&&i.hidden||Ou(i)||n.has(i)||r("hint","This rule is declared but never referenced.",{node:i,property:"name",tags:[nd.DiagnosticTag.Unnecessary]})}checkClashingTerminalNames(e,r){let n=new Ye,i=new Set;for(let f of e.rules)He(f)&&f.name&&n.add(f.name,f),Z(f)&&bt(f).filter(jt).forEach(m=>i.add(m.value));let o=new Ye,s=new Ye;for(let f of e.imports){let p=Lu(this.documents,f);for(let m of p)for(let T of m.rules)He(T)&&T.name?o.add(T.name,f):Z(T)&&T.name&&bt(T).filter(jt).forEach(A=>s.add(A.value,f))}for(let f of n.values())if(i.has(f.name))r("error","Terminal name clashes with existing keyword.",{node:f,property:"name"});else if(s.has(f.name)){let p=s.get(f.name);r("error",`Terminal name clashes with imported keyword from "${p[0].path}".`,{node:f,property:"name"})}let a=new Ye;for(let f of i)for(let p of o.get(f))a.add(p,f);for(let[f,p]of a.entriesGroupedByKey())p.length>0&&r("error",`Imported terminals (${p.join(", ")}) clash with locally defined keywords.`,{node:f,property:"path"});let c=new Ye;for(let[f,p]of o.entriesGroupedByKey()){let m=s.get(f);m.length>0&&p.filter(T=>!m.includes(T)).forEach(T=>c.add(T,f))}for(let[f,p]of c.entriesGroupedByKey())p.length>0&&r("error",`Imported terminals (${p.join(", ")}) clash with imported keywords.`,{node:f,property:"path"})}checkRuleName(e,r){if(e.name&&!Ou(e)){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","Rule name should start with an upper case letter.",{node:e,property:"name",data:kn(Ge.RuleNameUppercase)})}}checkTypeReservedName(e,r){this.checkReservedName(e,"name",r)}checkAssignmentReservedName(e,r){this.checkReservedName(e,"feature",r)}checkParserRuleReservedName(e,r){e.inferredType||this.checkReservedName(e,"name",r)}checkReservedName(e,r,n){let i=e[r];typeof i=="string"&&hM.has(i)&&n("error",`'${i}' is a reserved name of the JavaScript runtime.`,{node:e,property:r})}checkKeyword(e,r){Ze(e,Z)&&(e.value.length===0?r("error","Keywords cannot be empty.",{node:e}):e.value.trim().length===0?r("error","Keywords cannot only consist of whitespace characters.",{node:e}):/\s/g.test(e.value)&&r("warning","Keywords should not contain whitespace characters.",{node:e}))}checkUnorderedGroup(e,r){e.elements.forEach(n=>{jn(n.cardinality)&&r("error","Optional elements in Unordered groups are currently not supported",{node:n,data:kn(Ge.OptionalUnorderedGroup)})})}checkRuleParametersUsed(e,r){let n=e.parameters;if(n.length>0){let i=bt(e).filter(xa);for(let o of n)i.some(s=>s.parameter.ref===o)||r("hint",`Parameter '${o.name}' is unused.`,{node:o,tags:[nd.DiagnosticTag.Unnecessary]})}}checkParserRuleDataType(e,r){if(Ou(e))return;let n=_S(e),i=Cn(e);!n&&i?r("error","This parser rule does not create an object. Add a primitive return type or an action to the start of the rule to force object instantiation.",{node:e,property:"name"}):n&&!i&&r("error","Normal parser rules are not allowed to return a primitive value. Use a datatype rule for that.",{node:e,property:e.dataType?"dataType":"returnType"})}checkAssignmentToFragmentRule(e,r){e.terminal&&Qe(e.terminal)&&Z(e.terminal.rule.ref)&&e.terminal.rule.ref.fragment&&r("error",`Cannot use fragment rule '${e.terminal.rule.ref.name}' for assignment of property '${e.feature}'.`,{node:e,property:"terminal"})}checkAssignmentTypes(e,r){if(!e.terminal)return;let n;bt(e.terminal).map(o=>kr(o)?"ref":"other").find(o=>n?o!==n:(n=o,!1))&&r("error",this.createMixedTypeError(e.feature),{node:e,property:"terminal"})}checkInterfacePropertyTypes(e,r){for(let n of e.attributes)if(n.type){let i=Ls(n.type),o=Iu(i),s=!1,a=!1;for(let c of o)Aa(c)?s=!0:Aa(c)||(a=!0);s&&a&&r("error",this.createMixedTypeError(n.name),{node:n,property:"type"})}}createMixedTypeError(e){return`Mixing a cross-reference with other types is not supported. Consider splitting property "${e}" into two or more different properties.`}checkTerminalRuleReturnType(e,r){var n;!((n=e.type)===null||n===void 0)&&n.name&&!Pa(e.type.name)&&r("error","Terminal rules can only return primitive types like 'string', 'boolean', 'number', 'Date' or 'bigint'.",{node:e.type,property:"name"})}checkRuleCallParameters(e,r){let n=e.rule.ref;if(Z(n)){let i=n.parameters.length,o=e.arguments.length;i!==o&&r("error",`Rule '${n.name}' expects ${i} arguments, but got ${o}.`,{node:e})}else He(n)&&e.arguments.length>0&&r("error","Terminal rules do not accept any arguments",{node:e})}checkCrossRefNameAssignment(e,r){!e.terminal&&e.type.ref&&!Mu(e.type.ref)&&r("error","Cannot infer terminal or data type rule for cross-reference.",{node:e,property:"type"})}checkCrossRefTerminalType(e,r){var n;let i=e.terminal;if(Qe(i)){let o=i.rule.ref;Z(o)&&!Cn(o)?r("error","Parser rules cannot be used for cross-references.",{node:i,property:"rule"}):Z(o)&&!SS(o)?r("error","Data type rules for cross-references must be of type string.",{node:i,property:"rule"}):He(o)&&(!((n=o.type)===null||n===void 0)&&n.name)&&o.type.name!=="string"&&r("error","Terminal rules for cross-references must be of type string.",{node:i,property:"rule"})}}checkCrossRefType(e,r){let n=this.checkReferenceToRuleButNotType(e?.type);n&&r("error",n,{node:e,property:"type"})}checkCrossReferenceToTypeUnion(e,r){if(hr(e.type.ref)&&qn(e.type.ref.type)){let n=bS(e.type.ref.type);n.length>0&&r("error",`Cross-reference on type union is only valid if all alternatives are AST nodes. ${n.join(", ")} ${n.length>1?"are":"is"} not ${n.length>1?"":"an "}AST node${n.length>1?"s":""}.`,{node:e,property:"type"})}}checkFragmentsInTypes(e,r){var n,i;Z((n=e.typeRef)===null||n===void 0?void 0:n.ref)&&(!((i=e.typeRef)===null||i===void 0)&&i.ref.fragment)&&r("error","Cannot use rule fragments in types.",{node:e,property:"typeRef"})}checkReferenceTypeUnion(e,r){Ur(e.referenceType)||r("error","Only direct rule references are allowed in reference types.",{node:e,property:"referenceType"})}checkReferenceToRuleButNotType(e){if(e&&Z(e.ref)&&!Cn(e.ref)&&(e.ref.returnType||e.ref.inferredType)){let r=Ni(e.ref);if(r)return`Use the rule type '${r}' instead of the typed rule name '${e.ref.name}' for cross-references.`}}checkAssignmentWithFeatureName(e,r){e.feature==="name"&&kr(e.terminal)&&r("warning",'The "name" property is not recommended for cross-references.',{node:e,property:"feature"})}};function Ou(t){return!t.definition||!t.definition.$cstNode||t.definition.$cstNode.length===0}var hM=new Set(["Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","Map","Set","WeakMap","WeakSet","Error","AggregateError","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","BigInt","RegExp","Number","Object","Function","Symbol","String","Math","NaN","Infinity","isFinite","isNaN","Buffer","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","globalThis","decodeURIComponent","decodeURI","encodeURIComponent","encodeURI","parseInt","parseFloat","Promise","Generator","GeneratorFunction","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Reflect","Proxy","Date","Intl","eval","undefined"]);function bS(t){let e=[];return t.types.forEach(r=>{var n;Ur(r)&&(!((n=r.typeRef)===null||n===void 0)&&n.ref?hr(r.typeRef.ref)&&(qn(r.typeRef.ref.type)?e.push(...bS(r.typeRef.ref.type)):e.push(r.typeRef.ref.name)):r.stringType?e.push(`"${r.stringType}"`):r.primitiveType&&e.push(r.primitiveType))}),Array.from(new Set(e))}function jn(t,e){return t==="?"||t==="*"||gr(e)&&!!e.guardCondition}function kS(t){return t==="*"||t==="+"}function Cn(t){return CS(t,new Set)}function CS(t,e){if(e.has(t))return!0;e.add(t);for(let r of bt(t))if(Qe(r)){if(!r.rule.ref||Z(r.rule.ref)&&!CS(r.rule.ref,e))return!1}else{if(je(r))return!1;if(Je(r))return!1}return!!t.definition}function _S(t){var e;let r=(e=t.returnType)===null||e===void 0?void 0:e.ref;return t.dataType!==void 0||hr(r)&&gM(r)}function gM(t){return qy(t.type,new Set)}function qy(t,e){if(e.has(t))return!0;if(e.add(t),Es(t))return!1;if(Ps(t))return!1;if(qn(t))return t.types.every(r=>qy(r,e));if(Ur(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){let r=t.typeRef.ref;return hr(r)?qy(r.type,e):!1}else return!1}else return!1}function SS(t){return $u(t,new Set)}function $u(t,e){var r,n;if(e.has(t))return!0;if(e.add(t),Z(t)){if(t.dataType)return t.dataType==="string";if(!((r=t.returnType)===null||r===void 0)&&r.ref)return $u(t.returnType.ref,e)}else{if(hr(t))return $u(t.type,e);if(Es(t))return!1;if(Ps(t))return!1;if(qn(t))return t.types.every(i=>$u(i,e));if(Ur(t)){if(t.primitiveType==="string")return!0;if(t.stringType)return!0;if(!((n=t.typeRef)===null||n===void 0)&&n.ref)return $u(t.typeRef.ref,e)}}return!1}function jy(t){let e=t.$container;if(gr(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(Je(o))return o;{let s=bt(r[i]).find(Je);if(s)return s}}}if(va(e))return jy(e)}function ci(t){var e;if(Z(t))return Cn(t)?t.name:(e=Oa(t))!==null&&e!==void 0?e:t.name;if(ln(t)||hr(t)||ba(t))return t.name;if(Je(t)){let r=La(t);if(r)return r}else if(Ra(t))return t.name;throw new zf("Cannot get name of Unknown Type",t.$cstNode)}function Ni(t){if(t)try{return ci(t)}catch{return}}function Oa(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e){if(Z(e))return e.name;if(ln(e)||hr(e))return e.name}}}function La(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return ci(t.type.ref)}function Ms(t){var e,r,n;return He(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":Cn(t)?t.name:(n=Oa(t))!==null&&n!==void 0?n:t.name}function Un(t){let e={s:!1,i:!1,u:!1},r=Ma(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}var Uy=/[\s\S]/.source;function Ma(t,e){if(L_(t))return yM(t);if($_(t))return vM(t);if(jf(t))return xM(t);if(Uf(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return go(Ma(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(P_(t))return RM(t);if(U_(t))return TM(t);if(N_(t)){let r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),go(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(H_(t))return go(Uy,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function yM(t){return go(t.elements.map(e=>Ma(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function vM(t){return go(t.elements.map(e=>Ma(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function TM(t){return go(`${Uy}*?${Ma(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function RM(t){return go(`(?!${Ma(t.terminal)})${Uy}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function xM(t){return t.right?go(`[${$y(t.left)}-${$y(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):go($y(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function $y(t){return po(t.value)}function go(t,e){var r;return(e.wrap!==!1||e.lookahead)&&(t=`(${(r=e.lookahead)!==null&&r!==void 0?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function Wy(t){if(t.path===void 0||t.path.length===0)return;let e=qe.dirname(Se(t).uri),r=t.path;return r.endsWith(".langium")||(r+=".langium"),qe.resolvePath(e,r)}function ho(t,e){let r=Wy(e);try{if(r){let i=t.getOrCreateDocument(r).parseResult.value;if(Ta(i))return i}}catch{}}function Lu(t,e){if(qf(e)){let r=ho(t,e);if(r){let n=Fy(t,r);return n.push(r),n}return[]}else return Fy(t,e)}function Fy(t,e,r=e,n=new Set,i=new Set){let o=Se(e);if(r!==e&&i.add(e),!n.has(o.uri)){n.add(o.uri);for(let s of e.imports){let a=ho(t,s);a&&Fy(t,a,r,n,i)}}return Array.from(i)}function Ia(t){return je(t)?[t]:xn(t)||gr(t)||bn(t)?t.elements.flatMap(e=>Ia(e)):Qe(t)&&t.rule.ref?Ia(t.rule.ref.definition):[]}var bM=["string","number","boolean","Date","bigint"];function Pa(t){return bM.includes(t)}var Hy=class{constructor(e,r){this.context=e,this.root=r}getTypes(){let e={name:this.root.name,properties:this.root.properties,ruleCalls:this.root.ruleCalls,super:[]};return this.root.children.length===0?[{alt:e,next:[]}]:this.applyNext(this.root,{alt:e,next:this.root.children})}applyNext(e,r){let n=this.splitType(r.alt,r.next.length),i=[];for(let o=0;o<r.next.length;o++){let s=n[o],a=r.next[o];a.actionWithAssignment&&i.push({alt:wS(s),next:[]}),a.name!==void 0&&a.name!==s.name&&(a.actionWithAssignment?(s.properties=[],s.ruleCalls=[],s.super=[e.name],s.name=a.name):(s.super=[s.name,...s.ruleCalls],s.properties=[],s.ruleCalls=[],s.name=a.name)),s.properties.push(...a.properties),s.ruleCalls.push(...a.ruleCalls);let c={alt:s,next:a.children};c.next.length===0?(c.alt.super=c.alt.super.filter(f=>f!==c.alt.name),i.push(c)):i.push(...this.applyNext(e,c))}return NS(i)}splitType(e,r){let n=[];for(let i=0;i<r;i++)n.push(wS(e));return n}getSuperTypes(e){let r=new Set;return this.collectSuperTypes(e,e,r),Array.from(r)}collectSuperTypes(e,r,n){if(r.ruleCalls.length>0){for(let i of r.ruleCalls)n.add(i);return}for(let i of r.parents)e.name===void 0?this.collectSuperTypes(i,i,n):i.name!==void 0&&i.name!==e.name?n.add(i.name):this.collectSuperTypes(e,i,n);r.parents.length===0&&r.name&&n.add(r.name)}connect(e,r){return r.parents.push(e),e.children.push(r),r}merge(...e){if(e.length===1)return e[0];if(e.length===0)throw new Error("No parts to merge");let r=$s();r.parents=e;for(let n of e)n.children.push(r);return r}hasLeafNode(e){return this.partHasLeafNode(e)}partHasLeafNode(e,r){return e.children.some(n=>n!==r)?!0:e.name?!1:e.parents.some(n=>this.partHasLeafNode(n,e))}};function _M(t){return{name:t.name,children:[],parents:[],actionWithAssignment:t.actionWithAssignment,ruleCalls:[...t.ruleCalls],properties:t.properties.map(DS)}}function wS(t){return{name:t.name,super:t.super,ruleCalls:t.ruleCalls,properties:t.properties.map(e=>DS(e))}}function DS(t){return{name:t.name,optional:t.optional,type:t.type,astNodes:t.astNodes}}function ES(t,e,r){let n=[],i={fragments:new Map};for(let c of t)n.push(...PS(i,c));let o=EM(n),s=PM(o),a=AM(o,s,r);for(let c of e){let f=SM(c);a.unions.push({name:c.name,declared:!1,type:f,subTypes:new Set,superTypes:new Set,dataType:c.dataType})}return a}function SM(t){if(t.dataType&&t.dataType!=="string")return{primitive:t.dataType};let e=!1,r=()=>(e=!0,{primitive:"unknown"}),n=Gy(t.definition,r);return e?{primitive:"string"}:n}function Gy(t,e){var r,n,i;if(t.cardinality)return e();if(xn(t))return{types:t.elements.map(o=>Gy(o,e))};if(gr(t)||bn(t))return t.elements.length!==1?e():Gy(t.elements[0],e);if(Qe(t)){let o=(r=t.rule)===null||r===void 0?void 0:r.ref;return o?He(o)?{primitive:(i=(n=o.type)===null||n===void 0?void 0:n.name)!==null&&i!==void 0?i:"string",regex:Un(o).toString()}:{value:o.name}:e()}else if(jt(t))return{string:t.value};return e()}function PS(t,e){let r=$s(e),n=new Hy(t,r);return e.definition&&By(n,n.root,e.definition),n.getTypes()}function $s(t){return{name:Z(t)||Je(t)?Ni(t):t,properties:[],ruleCalls:[],children:[],parents:[],actionWithAssignment:!1}}function By(t,e,r){let n=jn(r.cardinality,r);if(xn(r)){let i=[];n&&i.push(t.connect(e,$s()));for(let o of r.elements){let s=t.connect(e,$s());i.push(By(t,s,o))}return t.merge(...i)}else if(gr(r)||bn(r)){let i=t.connect(e,$s()),o;n&&(o=t.connect(e,$s()));for(let s of r.elements)i=By(t,i,s);return o?t.merge(o,i):i}else{if(Je(r))return kM(t,e,r);je(r)?CM(e,r):Qe(r)&&wM(t,e,r)}return e}function kM(t,e,r){var n;if(!t.hasLeafNode(e)){let o=_M(e);t.connect(e,o)}let i=t.connect(e,$s(r));if(r.type){let o=(n=r.type)===null||n===void 0?void 0:n.ref;o&&wu(o)&&(i.name=o.name)}return r.feature&&r.operator&&(i.actionWithAssignment=!0,i.properties.push({name:r.feature,optional:!1,type:qs(r.operator==="+=",!1,t.root.ruleCalls.length!==0?t.root.ruleCalls:t.getSuperTypes(i)),astNodes:new Set([r])})),i}function CM(t,e){let r={types:new Set,reference:!1};AS(e.terminal,r);let n=qs(e.operator==="+=",r.reference,e.operator==="?="?["boolean"]:Array.from(r.types));t.properties.push({name:e.feature,optional:jn(e.cardinality),type:n,astNodes:new Set([e])})}function AS(t,e){if(xn(t)||bn(t)||gr(t))for(let r of t.elements)AS(r,e);else if(jt(t))e.types.add(`'${t.value}'`);else if(Qe(t)&&t.rule.ref)e.types.add(Ms(t.rule.ref));else if(kr(t)&&t.type.ref){let r=Ni(t.type.ref);r&&e.types.add(r),e.reference=!0}}function wM(t,e,r){let n=r.rule.ref;if(Z(n)&&n.fragment){let i=DM(n,t.context);jn(r.cardinality)?e.properties.push(...i.map(o=>Object.assign(Object.assign({},o),{optional:!0}))):e.properties.push(...i)}else Z(n)&&e.ruleCalls.push(Ms(n))}function DM(t,e){let r=e.fragments.get(t);if(r)return r;let n=[];e.fragments.set(t,n);let i=Ni(t),o=PS(e,t).filter(s=>s.alt.name===i);return n.push(...o.flatMap(s=>s.alt.properties)),n}function EM(t){let e=new Map,r=[],n=NS(t).map(i=>i.alt);for(let i of n){let o={name:i.name,properties:i.properties,superTypes:new Set(i.super),subTypes:new Set,declared:!1,abstract:!1};e.set(o.name,o),i.ruleCalls.length>0&&(r.push(i),i.ruleCalls.forEach(s=>{s!==o.name&&o.subTypes.add(s)}))}for(let i of r)for(let o of i.ruleCalls){let s=e.get(o);s&&s.name!==i.name&&s.superTypes.add(i.name)}return Array.from(e.values())}function NS(t){let e=t.reduce((n,i)=>n.add(i.alt.name,i),new Ye),r=[];for(let[n,i]of e.entriesGroupedByKey()){let o=[],s=new Set,a={alt:{name:n,properties:o,ruleCalls:[],super:[]},next:[]};for(let c of i){let f=c.alt;a.alt.super.push(...f.super),a.next.push(...c.next);let p=f.properties;for(let m of p){let T=o.find(k=>k.name===m.name);T?(T.type=My(T.type,m.type),m.astNodes.forEach(k=>T.astNodes.add(k))):o.push(Object.assign({},m))}f.ruleCalls.forEach(m=>s.add(m))}for(let c of i){let f=c.alt;if(f.ruleCalls.length===0)for(let p of o)f.properties.find(m=>m.name===p.name)||(p.optional=!0)}a.alt.ruleCalls=Array.from(s),r.push(a)}return r}function PM(t){let e=new Map(t.map(i=>[i.name,i])),r=[],n=new Ye;for(let i of t)for(let o of i.superTypes)n.add(o,i.name);for(let[i,o]of n.entriesGroupedByKey())if(!e.has(i)){let s={declared:!1,name:i,subTypes:new Set,superTypes:new Set,type:qs(!1,!1,o)};r.push(s)}return r}function AM(t,e,r){let n=new Ye;for(let a of t)for(let c of a.superTypes)n.add(c,a.name);let i=new Set(r.interfaces.map(a=>a.name)),o={interfaces:[],unions:e},s=new Map(e.map(a=>[a.name,a]));for(let a of t){let c=new Set(n.get(a.name));if(a.properties.length===0&&c.size>0)if(i.has(a.name))a.abstract=!0,o.interfaces.push(a);else{let f=qs(!1,!1,Array.from(c)),p=s.get(a.name);if(p)p.type=My(p.type,f);else{let m={name:a.name,declared:!1,subTypes:c,superTypes:a.superTypes,type:f};o.unions.push(m),s.set(a.name,m)}}else o.interfaces.push(a)}for(let a of o.interfaces)a.superTypes=new Set([...a.superTypes].filter(c=>!s.has(c)));return o}function qs(t,e,r){if(t)return{elementType:qs(!1,e,r)};if(e)return{referenceType:qs(!1,!1,r)};if(r.length===1){let n=r[0];return n.startsWith("'")?{string:n.substring(1,n.length-1)}:Pa(n)?{primitive:n}:{value:n}}else return{types:r.map(n=>qs(!1,!1,[n]))}}function IS(t,e){let r=OS(t,e),n=vS(r.interfaces,r.types),i=ES(r.parserRules,r.datatypeRules,n);return{astResources:r,inferred:i,declared:n}}function OS(t,e,r=new Set,n={parserRules:[],datatypeRules:[],interfaces:[],types:[]}){Array.isArray(t)||(t=[t]);for(let i of t){let o=Se(i);if(!r.has(o.uri)){r.add(o.uri);for(let s of i.rules)Z(s)&&!s.fragment&&(Cn(s)?n.datatypeRules.push(s):n.parserRules.push(s));if(i.interfaces.forEach(s=>n.interfaces.push(s)),i.types.forEach(s=>n.types.push(s)),e){let s=i.imports.map(a=>ho(e,a)).filter(a=>a!==void 0);OS(s,e,r,n)}}}return n}function $S(t,e){let{inferred:r,declared:n,astResources:i}=IS(t,e);return{astResources:i,inferred:LS(n,r),declared:LS(r,n)}}function LS(t,e){var r,n;let i={interfaces:uS(MS(...t.interfaces,...(r=e?.interfaces)!==null&&r!==void 0?r:[])),unions:MS(...t.unions,...(n=e?.unions)!==null&&n!==void 0?n:[])},o=RS(i);return NM(o),o}function MS(...t){return Array.from(t.reduce((e,r)=>(e.set(r.name,r),e),new Map).values()).sort((e,r)=>e.name.localeCompare(r.name))}function NM(t){let e=OM(t),r=Array.from(e.values());LM(r),MM(t.interfaces),IM(r)}function IM(t){let e=new Set,r=n=>{if(!e.has(n)){e.add(n),n.typeNames.add(n.name);for(let i of n.subTypes)r(i),i.typeNames.forEach(o=>n.typeNames.add(o))}};t.forEach(r)}function OM({interfaces:t,unions:e}){let r=t.concat(e).reduce((i,o)=>(i.set(o.name,o),i),new Map),n=new Map;for(let i of e)n.set(i,Ky(i.type,new Set));for(let[i,o]of n)o&&r.delete(i.name);return r}function Ky(t,e){if(e.has(t))return!0;if(e.add(t),lr(t))return t.types.every(r=>Ky(r,e));if(_n(t)){let r=t.value;return oi(r)?Ky(r.type,e):!1}else return Sn(t)||Pi(t)}function LM(t){for(let e of t)for(let r of e.superTypes)r.subTypes.add(e)}function MM(t){var e;let r=t.reduce((s,a)=>(s.set(a.name,a),s),new Map);for(let s of t){let a=s.properties.flatMap(c=>lS(c.type));for(let c of a)(e=r.get(c))===null||e===void 0||e.containerTypes.add(s)}let n=new Set,i=t.filter(s=>s.subTypes.size===0),o=new Set(i);for(;i.length>0;){let s=i.shift();if(s)for(let a of s.superTypes)ai(a)&&(s.containerTypes.size===0?(n.add(a.name),a.containerTypes.clear()):n.has(a.name)||s.containerTypes.forEach(c=>a.containerTypes.add(c)),o.has(a)||(o.add(a),i.push(a)))}}var $M={languageId:"langium",fileExtensions:[".langium"],caseInsensitive:!1},qM={maxLookahead:3},qS={AstReflection:()=>new Tu},FS={Grammar:()=>hS(),LanguageMetaData:()=>$M,parser:{ParserConfig:()=>qM}};var qu=class{constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}},$a=class{constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1;for(let o of e){let s=this.caseInsensitive?o.name.toLowerCase():o.name;this.elements.set(s,o)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=ke(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},jS={getElement(){},getAllElements(){return ya}};var od=Ie(io(),1);var qa=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=od.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=Fo,i=od.CancellationToken.None){let o=[];this.exportNode(e,o,r);for(let s of n(e))await _t(i),this.exportNode(s,o,r);return o}exportNode(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=od.CancellationToken.None){let n=e.parseResult.value,i=new Ye;for(let o of bt(n))await _t(r),this.processNode(o,e,i);return i}processNode(e,r,n){let i=e.$container;if(i){let o=this.nameProvider.getName(e);o&&n.add(i,this.descriptions.createDescription(e,o,r))}}};var sd=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},zy=class extends sd{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){let n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},ad=class extends sd{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let o=n();return i.set(r,o),o}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}};var cd=class extends zy{constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var Fa=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new cd(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=Se(e.container).precomputedScopes;if(i){let s=e.container;do{let a=i.get(s);a.length>0&&r.push(ke(a).filter(c=>this.reflection.isSubtype(c.type,n))),s=s.$container}while(s)}let o=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)o=this.createScope(r[s],o);return o}createScope(e,r,n){return new qu(ke(e),r,n)}createScopeForNodes(e,r,n){let i=ke(e).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new qu(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new $a(this.indexManager.allElements(e)))}};var ud=class extends Fa{constructor(e){super(e),this.langiumDocuments=e.shared.workspace.LangiumDocuments}getScope(e){let r=this.reflection.getReferenceType(e);return r===Ds?this.getTypeScope(r,e):super.getScope(e)}getTypeScope(e,r){let n,i=Se(r.container).precomputedScopes,o=Wf(r.container);if(i&&o){let a=i.get(o);a.length>0&&(n=ke(a).filter(c=>c.type===Ru||c.type===xu))}let s=this.getGlobalScope(e,r);return n?this.createScope(n,s):s}getGlobalScope(e,r){let n=Ze(r.container,Ta);if(!n)return jS;let i=new Set;this.gatherImports(n,i);let o=this.indexManager.allElements(e,i);return e===Ds&&(o=o.filter(s=>s.type===Ru||s.type===xu)),new $a(o)}gatherImports(e,r){for(let n of e.imports){let i=Wy(n);if(i&&!r.has(i.toString())&&(r.add(i.toString()),this.langiumDocuments.hasDocument(i))){let s=this.langiumDocuments.getOrCreateDocument(i).parseResult.value;Ta(s)&&this.gatherImports(s,r)}}}},ld=class extends qa{constructor(e){super(e),this.astNodeLocator=e.workspace.AstNodeLocator}exportNode(e,r,n){var i;if(super.exportNode(e,r,n),Z(e)){if(!e.returnType&&!e.dataType){let o=(i=e.inferredType)!==null&&i!==void 0?i:e;r.push(this.createInterfaceDescription(o,o.name,n))}bt(e).forEach(o=>{if(Je(o)&&o.inferredType){let s=La(o);s&&r.push(this.createInterfaceDescription(o,s,n))}})}}processNode(e,r,n){ba(e)||(this.processTypeNode(e,r,n),this.processActionNode(e,r,n),super.processNode(e,r,n))}processTypeNode(e,r,n){var i;let o=e.$container;if(o&&Z(e)&&!e.returnType&&!e.dataType){let s=(i=e.inferredType)!==null&&i!==void 0?i:e;n.add(o,this.createInterfaceDescription(s,s.name,r))}}processActionNode(e,r,n){let i=Wf(e);if(i&&Je(e)&&e.inferredType){let o=La(e);o&&n.add(i,this.createInterfaceDescription(e,o,r))}}createInterfaceDescription(e,r,n=Se(e)){let i,o=()=>{var s;return i??(i=jr((s=this.nameProvider.getNameNode(e))!==null&&s!==void 0?s:e.$cstNode))};return{node:e,name:r,get nameSegment(){return o()},selectionSegment:jr(e.$cstNode),type:"Interface",documentUri:n.uri,path:this.astNodeLocator.getAstNodePath(e)}}};var wn=Ie(Xe(),1);var Wr=Ie(Xe(),1);var fd=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=Wr.CancellationToken.None){let i=e.parseResult,o=[];if(await _t(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,o,r),r.stopAfterLexingErrors&&o.some(s=>{var a;return((a=s.data)===null||a===void 0?void 0:a.code)===ui.LexingError})||(this.processParsingErrors(i,o,r),r.stopAfterParsingErrors&&o.some(s=>{var a;return((a=s.data)===null||a===void 0?void 0:a.code)===ui.ParsingError}))||(this.processLinkingErrors(e,o,r),r.stopAfterLinkingErrors&&o.some(s=>{var a;return((a=s.data)===null||a===void 0?void 0:a.code)===ui.LinkingError}))))return o;try{o.push(...await this.validateAst(i.value,r,n))}catch(s){if(Os(s))throw s;console.error("An error occurred during validation:",s)}return await _t(n),o}processLexingErrors(e,r,n){for(let i of e.lexerErrors){let o={severity:Wr.DiagnosticSeverity.Error,range:{start:{line:i.line-1,character:i.column-1},end:{line:i.line-1,character:i.column+i.length-1}},message:i.message,data:kn(ui.LexingError),source:this.getSource()};r.push(o)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let o;if(isNaN(i.token.startOffset)){if("previousToken"in i){let s=i.previousToken;if(isNaN(s.startOffset))o=Wr.Range.create(0,0,0,0);else{let a=Wr.Position.create(s.endLine-1,s.endColumn);o=Wr.Range.create(a,a)}}}else o=vu(i.token);if(o){let s={severity:Wr.DiagnosticSeverity.Error,range:o,message:i.message,data:kn(ui.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(let i of e.references){let o=i.error;if(o){let s={node:o.container,property:o.property,index:o.index,data:{code:ui.LinkingError,containerType:o.container.$type,property:o.property,refText:o.reference.$refText}};r.push(this.toDiagnostic("error",o.message,s))}}}async validateAst(e,r,n=Wr.CancellationToken.None){let i=[],o=(s,a,c)=>{i.push(this.toDiagnostic(s,a,c))};return await Promise.all(uo(e).map(async s=>{await _t(n);let a=this.validationRegistry.getChecks(s.$type,r.categories);for(let c of a)await c(s,o,n)})),i}toDiagnostic(e,r,n){return{message:r,range:FM(n),severity:jM(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function FM(t){if(Wr.Range.is(t.range))return t.range;let e;return typeof t.property=="string"?e=wr(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Fn(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function jM(t){switch(t){case"error":return Wr.DiagnosticSeverity.Error;case"warning":return Wr.DiagnosticSeverity.Warning;case"info":return Wr.DiagnosticSeverity.Information;case"hint":return Wr.DiagnosticSeverity.Hint;default:throw new Error("Invalid diagnostic severity: "+t)}}var ui;(function(t){t.LexingError="lexing-error",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(ui=ui||(ui={}));var dd=class{constructor(e){this.reflection=e.shared.AstReflection,this.indexManager=e.shared.workspace.IndexManager}getCodeActions(e,r){let n=[],i=o=>o&&n.push(o);for(let o of r.context.diagnostics)this.createCodeActions(o,e,i);return n}createCodeActions(e,r,n){var i;switch((i=e.data)===null||i===void 0?void 0:i.code){case Ge.GrammarNameUppercase:case Ge.RuleNameUppercase:n(this.makeUpperCase(e,r));break;case Ge.HiddenGrammarTokens:n(this.fixHiddenTerminals(e,r));break;case Ge.UseRegexTokens:n(this.fixRegexTokens(e,r));break;case Ge.EntryRuleTokenSyntax:n(this.addEntryKeyword(e,r));break;case Ge.CrossRefTokenSyntax:n(this.fixCrossRefSyntax(e,r));break;case Ge.UnnecessaryFileExtension:n(this.fixUnnecessaryFileExtension(e,r));break;case Ge.MissingReturns:n(this.fixMissingReturns(e,r));break;case Ge.InvalidInfers:case Ge.InvalidReturns:n(this.fixInvalidReturnsInfers(e,r));break;case Ge.MissingInfer:n(this.fixMissingInfer(e,r));break;case Ge.SuperfluousInfer:n(this.fixSuperfluousInfer(e,r));break;case ui.LinkingError:{let o=e.data;o&&o.containerType==="RuleCall"&&o.property==="rule"&&n(this.addNewRule(e,o,r)),o&&this.lookInGlobalScope(e,o,r).forEach(n);break}}}fixMissingReturns(e,r){let n=r.textDocument.getText(e.range);if(n)return{title:`Add explicit return type for parser rule ${n}`,kind:wn.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:e.range,newText:`${n} returns ${n}`}]}}}}fixInvalidReturnsInfers(e,r){let n=e.data;if(n&&n.actionSegment){let i=r.textDocument.getText(n.actionSegment.range);return{title:`Correct ${i} usage`,kind:wn.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:n.actionSegment.range,newText:i==="infers"?"returns":"infers"}]}}}}}fixMissingInfer(e,r){let n=e.data;if(n&&n.actionSegment)return{title:"Correct 'infer' usage",kind:wn.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:{start:n.actionSegment.range.end,end:n.actionSegment.range.end},newText:"infer "}]}}}}fixSuperfluousInfer(e,r){let n=e.data;if(n&&n.actionRange)return{title:"Remove the 'infer' keyword",kind:wn.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:n.actionRange,newText:""}]}}}}fixUnnecessaryFileExtension(e,r){let n=Object.assign({},e.range.end);n.character-=1;let i=Object.assign({},n);return i.character-=8,{title:"Remove file extension",kind:wn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:i,end:n},newText:""}]}}}}makeUpperCase(e,r){let n={start:e.range.start,end:{line:e.range.start.line,character:e.range.start.character+1}};return{title:"First letter to upper case",kind:wn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:n,newText:r.textDocument.getText(n).toUpperCase()}]}}}}addEntryKeyword(e,r){return{title:"Add entry keyword",kind:wn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:e.range.start,end:e.range.start},newText:"entry "}]}}}}fixRegexTokens(e,r){let n=r.textDocument.offsetAt(e.range.start),i=r.parseResult.value.$cstNode;if(i){let o=un(i,n),s=Ze(o?.astNode,jf);if(s&&s.right&&s.$cstNode){let a=s.left.value,c=s.right.value;return{title:"Refactor into regular expression",kind:wn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:s.$cstNode.range,newText:`/[${po(a)}-${po(c)}]/`}]}}}}}}fixCrossRefSyntax(e,r){return{title:"Replace '|' with ':'",kind:wn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:e.range,newText:":"}]}}}}fixHiddenTerminals(e,r){let n=r.parseResult.value,i=n.hiddenTokens,o=[],s=wr(n.$cstNode,"definesHiddenTokens");if(s){let a=s.range.start,c=s.offset,f=n.$cstNode.text.indexOf(")",c)+1;o.push({newText:"",range:{start:a,end:r.textDocument.positionAt(f)}})}for(let a of i){let c=a.ref;if(c&&He(c)&&!c.hidden&&c.$cstNode){let f=c.$cstNode.range.start;o.push({newText:"hidden ",range:{start:f,end:f}})}}return{title:"Fix hidden terminals",kind:wn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:o}}}}addNewRule(e,r,n){let i=n.textDocument.offsetAt(e.range.start),o=n.parseResult.value.$cstNode;if(o){let s=un(o,i),a=Ze(s?.astNode,Z);if(a&&a.$cstNode)return{title:`Add new rule '${r.refText}'`,kind:wn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!1,edit:{changes:{[n.textDocument.uri]:[{range:{start:a.$cstNode.range.end,end:a.$cstNode.range.end},newText:`
78
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(c1.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var _i=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var l1=new Is,hv=class extends _i{constructor(){super(...arguments),this.isStarting=!0,this.endRegexStack=[],this.multiline=!1}get endRegex(){return this.endRegexStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegex="",this.isStarting=!0,this.endRegexStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===`
79
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexStack=[];else{let n=io(r);this.endRegexStack.push(n),this.isStarting&&(this.startRegex+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
80
+ `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexStack.push(r),this.isStarting&&(this.startRegex+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},mv=new hv;function ow(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),mv.reset(t),mv.visit(l1.pattern(t)),mv.multiline}catch{return!1}}function gv(t){return(typeof t=="string"?new RegExp(t):t).test(" ")}function io(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sw(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:io(e)).join("")}function aw(t,e){let r=f1(t),n=e.match(r);return!!n&&n[0].length>0}function f1(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let o="",s;function a(u){o+=r.substr(n,u),n+=u}function c(u){o+="(?:"+r.substr(n,u)+"|$)",n+=u}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?r[n+2]==="{"?c(r.indexOf("}",n)-n+1):c(6):c(2);break;case"p":case"P":e.unicode?c(r.indexOf("}",n)-n+1):c(2);break;case"k":c(r.indexOf(">",n)-n+1);break;default:c(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],c(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?a(s[0].length):c(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":o+="(?:",n+=3,o+=i()+"|$)";break;case"=":o+="(?=",n+=3,o+=i()+")";break;case"!":s=n,n+=3,i(),o+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),o+=r.substr(s,n-s);break;default:a(r.indexOf(">",n)-n+1),o+=i()+"|$)";break}break}else a(1),o+=i()+"|$)";break;case")":return++n,o;default:c(1);break}return o}return new RegExp(i(),t.flags)}var yv={};Mb(yv,{URI:()=>d1,Utils:()=>p1});var cw;(()=>{"use strict";var t={470:i=>{function o(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function s(c,u){for(var l,f="",g=0,T=-1,C=0,P=0;P<=c.length;++P){if(P<c.length)l=c.charCodeAt(P);else{if(l===47)break;l=47}if(l===47){if(!(T===P-1||C===1))if(T!==P-1&&C===2){if(f.length<2||g!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var O=f.lastIndexOf("/");if(O!==f.length-1){O===-1?(f="",g=0):g=(f=f.slice(0,O)).length-1-f.lastIndexOf("/"),T=P,C=0;continue}}else if(f.length===2||f.length===1){f="",g=0,T=P,C=0;continue}}u&&(f.length>0?f+="/..":f="..",g=2)}else f.length>0?f+="/"+c.slice(T+1,P):f=c.slice(T+1,P),g=P-T-1;T=P,C=0}else l===46&&C!==-1?++C:C=-1}return f}var a={resolve:function(){for(var c,u="",l=!1,f=arguments.length-1;f>=-1&&!l;f--){var g;f>=0?g=arguments[f]:(c===void 0&&(c=process.cwd()),g=c),o(g),g.length!==0&&(u=g+"/"+u,l=g.charCodeAt(0)===47)}return u=s(u,!l),l?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(c){if(o(c),c.length===0)return".";var u=c.charCodeAt(0)===47,l=c.charCodeAt(c.length-1)===47;return(c=s(c,!u)).length!==0||u||(c="."),c.length>0&&l&&(c+="/"),u?"/"+c:c},isAbsolute:function(c){return o(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,u=0;u<arguments.length;++u){var l=arguments[u];o(l),l.length>0&&(c===void 0?c=l:c+="/"+l)}return c===void 0?".":a.normalize(c)},relative:function(c,u){if(o(c),o(u),c===u||(c=a.resolve(c))===(u=a.resolve(u)))return"";for(var l=1;l<c.length&&c.charCodeAt(l)===47;++l);for(var f=c.length,g=f-l,T=1;T<u.length&&u.charCodeAt(T)===47;++T);for(var C=u.length-T,P=g<C?g:C,O=-1,E=0;E<=P;++E){if(E===P){if(C>P){if(u.charCodeAt(T+E)===47)return u.slice(T+E+1);if(E===0)return u.slice(T+E)}else g>P&&(c.charCodeAt(l+E)===47?O=E:E===0&&(O=0));break}var m=c.charCodeAt(l+E);if(m!==u.charCodeAt(T+E))break;m===47&&(O=E)}var d="";for(E=l+O+1;E<=f;++E)E!==f&&c.charCodeAt(E)!==47||(d.length===0?d+="..":d+="/..");return d.length>0?d+u.slice(T+O):(T+=O,u.charCodeAt(T)===47&&++T,u.slice(T))},_makeLong:function(c){return c},dirname:function(c){if(o(c),c.length===0)return".";for(var u=c.charCodeAt(0),l=u===47,f=-1,g=!0,T=c.length-1;T>=1;--T)if((u=c.charCodeAt(T))===47){if(!g){f=T;break}}else g=!1;return f===-1?l?"/":".":l&&f===1?"//":c.slice(0,f)},basename:function(c,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');o(c);var l,f=0,g=-1,T=!0;if(u!==void 0&&u.length>0&&u.length<=c.length){if(u.length===c.length&&u===c)return"";var C=u.length-1,P=-1;for(l=c.length-1;l>=0;--l){var O=c.charCodeAt(l);if(O===47){if(!T){f=l+1;break}}else P===-1&&(T=!1,P=l+1),C>=0&&(O===u.charCodeAt(C)?--C==-1&&(g=l):(C=-1,g=P))}return f===g?g=P:g===-1&&(g=c.length),c.slice(f,g)}for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!T){f=l+1;break}}else g===-1&&(T=!1,g=l+1);return g===-1?"":c.slice(f,g)},extname:function(c){o(c);for(var u=-1,l=0,f=-1,g=!0,T=0,C=c.length-1;C>=0;--C){var P=c.charCodeAt(C);if(P!==47)f===-1&&(g=!1,f=C+1),P===46?u===-1?u=C:T!==1&&(T=1):u!==-1&&(T=-1);else if(!g){l=C+1;break}}return u===-1||f===-1||T===0||T===1&&u===f-1&&u===l+1?"":c.slice(u,f)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(u,l){var f=l.dir||l.root,g=l.base||(l.name||"")+(l.ext||"");return f?f===l.root?f+g:f+"/"+g:g}(0,c)},parse:function(c){o(c);var u={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return u;var l,f=c.charCodeAt(0),g=f===47;g?(u.root="/",l=1):l=0;for(var T=-1,C=0,P=-1,O=!0,E=c.length-1,m=0;E>=l;--E)if((f=c.charCodeAt(E))!==47)P===-1&&(O=!1,P=E+1),f===46?T===-1?T=E:m!==1&&(m=1):T!==-1&&(m=-1);else if(!O){C=E+1;break}return T===-1||P===-1||m===0||m===1&&T===P-1&&T===C+1?P!==-1&&(u.base=u.name=C===0&&g?c.slice(1,P):c.slice(C,P)):(C===0&&g?(u.name=c.slice(1,T),u.base=c.slice(1,P)):(u.name=c.slice(C,T),u.base=c.slice(C,P)),u.ext=c.slice(T,P)),C>0?u.dir=c.slice(0,C-1):g&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a}},e={};function r(i){var o=e[i];if(o!==void 0)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.d=(i,o)=>{for(var s in o)r.o(o,s)&&!r.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:o[s]})},r.o=(i,o)=>Object.prototype.hasOwnProperty.call(i,o),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:()=>g,Utils:()=>_t}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let o=/^\w[\w\d+.-]*$/,s=/^\//,a=/^\/\//;function c(G,A){if(!G.scheme&&A)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${G.authority}", path: "${G.path}", query: "${G.query}", fragment: "${G.fragment}"}`);if(G.scheme&&!o.test(G.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(G.path){if(G.authority){if(!s.test(G.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(G.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let u="",l="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class g{static isUri(A){return A instanceof g||!!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,z,Y,Ce,fe,ce=!1){typeof A=="object"?(this.scheme=A.scheme||u,this.authority=A.authority||u,this.path=A.path||u,this.query=A.query||u,this.fragment=A.fragment||u):(this.scheme=function(St,ft){return St||ft?St:"file"}(A,ce),this.authority=z||u,this.path=function(St,ft){switch(St){case"https":case"http":case"file":ft?ft[0]!==l&&(ft=l+ft):ft=l}return ft}(this.scheme,Y||u),this.query=Ce||u,this.fragment=fe||u,c(this,ce))}get fsPath(){return m(this,!1)}with(A){if(!A)return this;let{scheme:z,authority:Y,path:Ce,query:fe,fragment:ce}=A;return z===void 0?z=this.scheme:z===null&&(z=u),Y===void 0?Y=this.authority:Y===null&&(Y=u),Ce===void 0?Ce=this.path:Ce===null&&(Ce=u),fe===void 0?fe=this.query:fe===null&&(fe=u),ce===void 0?ce=this.fragment:ce===null&&(ce=u),z===this.scheme&&Y===this.authority&&Ce===this.path&&fe===this.query&&ce===this.fragment?this:new C(z,Y,Ce,fe,ce)}static parse(A,z=!1){let Y=f.exec(A);return Y?new C(Y[2]||u,X(Y[4]||u),X(Y[5]||u),X(Y[7]||u),X(Y[9]||u),z):new C(u,u,u,u,u)}static file(A){let z=u;if(i&&(A=A.replace(/\\/g,l)),A[0]===l&&A[1]===l){let Y=A.indexOf(l,2);Y===-1?(z=A.substring(2),A=l):(z=A.substring(2,Y),A=A.substring(Y)||l)}return new C("file",z,A,u,u)}static from(A){let z=new C(A.scheme,A.authority,A.path,A.query,A.fragment);return c(z,!0),z}toString(A=!1){return d(this,A)}toJSON(){return this}static revive(A){if(A){if(A instanceof g)return A;{let z=new C(A);return z._formatted=A.external,z._fsPath=A._sep===T?A.fsPath:null,z}}return A}}let T=i?1:void 0;class C extends g{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=m(this,!1)),this._fsPath}toString(A=!1){return A?d(this,!0):(this._formatted||(this._formatted=d(this,!1)),this._formatted)}toJSON(){let A={$mid:1};return this._fsPath&&(A.fsPath=this._fsPath,A._sep=T),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 P={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 O(G,A,z){let Y,Ce=-1;for(let fe=0;fe<G.length;fe++){let ce=G.charCodeAt(fe);if(ce>=97&&ce<=122||ce>=65&&ce<=90||ce>=48&&ce<=57||ce===45||ce===46||ce===95||ce===126||A&&ce===47||z&&ce===91||z&&ce===93||z&&ce===58)Ce!==-1&&(Y+=encodeURIComponent(G.substring(Ce,fe)),Ce=-1),Y!==void 0&&(Y+=G.charAt(fe));else{Y===void 0&&(Y=G.substr(0,fe));let St=P[ce];St!==void 0?(Ce!==-1&&(Y+=encodeURIComponent(G.substring(Ce,fe)),Ce=-1),Y+=St):Ce===-1&&(Ce=fe)}}return Ce!==-1&&(Y+=encodeURIComponent(G.substring(Ce))),Y!==void 0?Y:G}function E(G){let A;for(let z=0;z<G.length;z++){let Y=G.charCodeAt(z);Y===35||Y===63?(A===void 0&&(A=G.substr(0,z)),A+=P[Y]):A!==void 0&&(A+=G[z])}return A!==void 0?A:G}function m(G,A){let z;return z=G.authority&&G.path.length>1&&G.scheme==="file"?`//${G.authority}${G.path}`:G.path.charCodeAt(0)===47&&(G.path.charCodeAt(1)>=65&&G.path.charCodeAt(1)<=90||G.path.charCodeAt(1)>=97&&G.path.charCodeAt(1)<=122)&&G.path.charCodeAt(2)===58?A?G.path.substr(1):G.path[1].toLowerCase()+G.path.substr(2):G.path,i&&(z=z.replace(/\//g,"\\")),z}function d(G,A){let z=A?E:O,Y="",{scheme:Ce,authority:fe,path:ce,query:St,fragment:ft}=G;if(Ce&&(Y+=Ce,Y+=":"),(fe||Ce==="file")&&(Y+=l,Y+=l),fe){let be=fe.indexOf("@");if(be!==-1){let Er=fe.substr(0,be);fe=fe.substr(be+1),be=Er.lastIndexOf(":"),be===-1?Y+=z(Er,!1,!1):(Y+=z(Er.substr(0,be),!1,!1),Y+=":",Y+=z(Er.substr(be+1),!1,!0)),Y+="@"}fe=fe.toLowerCase(),be=fe.lastIndexOf(":"),be===-1?Y+=z(fe,!1,!0):(Y+=z(fe.substr(0,be),!1,!0),Y+=fe.substr(be))}if(ce){if(ce.length>=3&&ce.charCodeAt(0)===47&&ce.charCodeAt(2)===58){let be=ce.charCodeAt(1);be>=65&&be<=90&&(ce=`/${String.fromCharCode(be+32)}:${ce.substr(3)}`)}else if(ce.length>=2&&ce.charCodeAt(1)===58){let be=ce.charCodeAt(0);be>=65&&be<=90&&(ce=`${String.fromCharCode(be+32)}:${ce.substr(2)}`)}Y+=z(ce,!0,!1)}return St&&(Y+="?",Y+=z(St,!1,!1)),ft&&(Y+="#",Y+=A?ft:O(ft,!1,!1)),Y}function _(G){try{return decodeURIComponent(G)}catch{return G.length>3?G.substr(0,3)+_(G.substr(3)):G}}let $=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function X(G){return G.match($)?G.replace($,A=>_(A)):G}var ke=r(470);let Me=ke.posix||ke,Bt="/";var _t;(function(G){G.joinPath=function(A,...z){return A.with({path:Me.join(A.path,...z)})},G.resolvePath=function(A,...z){let Y=A.path,Ce=!1;Y[0]!==Bt&&(Y=Bt+Y,Ce=!0);let fe=Me.resolve(Y,...z);return Ce&&fe[0]===Bt&&!A.authority&&(fe=fe.substring(1)),A.with({path:fe})},G.dirname=function(A){if(A.path.length===0||A.path===Bt)return A;let z=Me.dirname(A.path);return z.length===1&&z.charCodeAt(0)===46&&(z=""),A.with({path:z})},G.basename=function(A){return Me.basename(A.path)},G.extname=function(A){return Me.extname(A.path)}})(_t||(_t={}))})(),cw=n})();var{URI:d1,Utils:p1}=cw;var oo=yv;"default"in oo&&(oo=oo.default);var _r=oo.URI;var Le;(function(t){t.basename=oo.Utils.basename,t.dirname=oo.Utils.dirname,t.extname=oo.Utils.extname,t.joinPath=oo.Utils.joinPath,t.resolvePath=oo.Utils.resolvePath;function e(n,i){return n?.toString()===i?.toString()}t.equals=e;function r(n,i){let o=typeof n=="string"?n:n.path,s=typeof i=="string"?i:i.path,a=o.split("/").filter(g=>g.length>0),c=s.split("/").filter(g=>g.length>0),u=0;for(;u<a.length&&a[u]===c[u];u++);let l="../".repeat(a.length-u),f=c.slice(u).join("/");return l+f}t.relative=r})(Le=Le||(Le={}));var v5=Le.equals,T5=Le.relative;var dd,uw=()=>dd??(dd=pd(`{"$type":"Grammar","isDeclared":true,"name":"LangiumGrammar","rules":[{"$type":"ParserRule","name":"Grammar","entry":true,"definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"isDeclared","operator":"?=","terminal":{"$type":"Keyword","value":"grammar"}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"usedGrammars","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"usedGrammars","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"definesHiddenTokens","operator":"?=","terminal":{"$type":"Keyword","value":"hidden"}},{"$type":"Keyword","value":"("},{"$type":"Group","elements":[{"$type":"Assignment","feature":"hiddenTokens","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"hiddenTokens","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"interfaces","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"types","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"+"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Interface","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"interface"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"superTypes","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"superTypes","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SchemaType","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"attributes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypeAttribute","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}},{"$type":"Assignment","feature":"isOptional","operator":"?=","terminal":{"$type":"Keyword","value":"?"},"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypeDefinition","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"UnionType","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"UnionType"},"feature":"types","operator":"+="},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"types","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrayType","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ArrayType"},"feature":"elementType","operator":"="},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ReferenceType","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ReferenceType"}},{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"referenceType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SimpleType","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"SimpleType"}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"typeRef","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"primitiveType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"stringType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PrimitiveType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"string"},{"$type":"Keyword","value":"number"},{"$type":"Keyword","value":"boolean"},{"$type":"Keyword","value":"Date"},{"$type":"Keyword","value":"bigint"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Type","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"type"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AbstractRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GrammarImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParserRule","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"entry","operator":"?=","terminal":{"$type":"Keyword","value":"entry"}},{"$type":"Assignment","feature":"fragment","operator":"?=","terminal":{"$type":"Keyword","value":"fragment"}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"wildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Group","elements":[{"$type":"Keyword","value":"returns"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"returnType","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Assignment","feature":"inferredType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[{"$type":"NamedArgument","value":{"$type":"LiteralCondition","true":false},"calledByName":false}]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"definesHiddenTokens","operator":"?=","terminal":{"$type":"Keyword","value":"hidden"}},{"$type":"Keyword","value":"("},{"$type":"Group","elements":[{"$type":"Assignment","feature":"hiddenTokens","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"hiddenTokens","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InferredType","parameters":[{"$type":"Parameter","name":"imperative"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@14/parameters@0"}},"elements":[{"$type":"Keyword","value":"infer"}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@14/parameters@0"}}},"elements":[{"$type":"Keyword","value":"infers"}]}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"RuleNameAndParams","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"<"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"parameters","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"parameters","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":">"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Parameter","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Alternatives","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Alternatives"},"feature":"elements","operator":"+="},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ConditionalBranch","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Group"}},{"$type":"Keyword","value":"<"},{"$type":"Assignment","feature":"guardCondition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":">"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"+"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"UnorderedGroup","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"UnorderedGroup"},"feature":"elements","operator":"+="},{"$type":"Group","elements":[{"$type":"Keyword","value":"&"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Group"},"feature":"elements","operator":"+="},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AbstractToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AbstractTokenWithCardinality","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}]},{"$type":"Assignment","feature":"cardinality","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"*"},{"$type":"Keyword","value":"+"}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Action","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Action"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"inferredType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[{"$type":"NamedArgument","value":{"$type":"LiteralCondition","true":true},"calledByName":false}]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"feature","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"+="}]}},{"$type":"Keyword","value":"current"}],"cardinality":"?"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AbstractTerminal","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Keyword","definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RuleCall","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rule","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"<"},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":">"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NamedArgument","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"parameter","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@16"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"calledByName","operator":"?=","terminal":{"$type":"Keyword","value":"="}}],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LiteralCondition","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"true","operator":"?=","terminal":{"$type":"Keyword","value":"true"}},{"$type":"Keyword","value":"false"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Disjunction","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Disjunction"},"feature":"left","operator":"="},{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Conjunction","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Conjunction"},"feature":"left","operator":"="},{"$type":"Keyword","value":"&"},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Negation","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Negation"}},{"$type":"Keyword","value":"!"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Atom","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParenthesizedCondition","inferredType":{"$type":"InferredType","name":"Condition"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParameterReference","definition":{"$type":"Assignment","feature":"parameter","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@16"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PredicatedKeyword","inferredType":{"$type":"InferredType","name":"Keyword"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=>"},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PredicatedRuleCall","inferredType":{"$type":"InferredType","name":"RuleCall"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=>"},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"rule","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@11"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"<"},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":">"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Assignment","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Assignment"}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=>"},{"$type":"Keyword","value":"->"}],"cardinality":"?"},{"$type":"Assignment","feature":"feature","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"+="},{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"?="}]}},{"$type":"Assignment","feature":"terminal","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AssignableTerminal","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParenthesizedAssignableElement","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"AssignableAlternatives","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Alternatives"},"feature":"elements","operator":"+="},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]}}],"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CrossReference","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"CrossReference"}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"deprecatedSyntax","operator":"?=","terminal":{"$type":"Keyword","value":"|"}},{"$type":"Keyword","value":":"}]},{"$type":"Assignment","feature":"terminal","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CrossReferenceableTerminal","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParenthesizedElement","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PredicatedGroup","inferredType":{"$type":"InferredType","name":"Group"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=>"},{"$type":"Keyword","value":"->"}]},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ReturnType","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalRule","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"hidden","operator":"?=","terminal":{"$type":"Keyword","value":"hidden"},"cardinality":"?"},{"$type":"Keyword","value":"terminal"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"fragment","operator":"?=","terminal":{"$type":"Keyword","value":"fragment"}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"returns"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}}],"cardinality":"?"}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalAlternatives","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"TerminalAlternatives"},"feature":"elements","operator":"+="},{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalGroup","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"TerminalGroup"},"feature":"elements","operator":"+="},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"Assignment","feature":"cardinality","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"*"},{"$type":"Keyword","value":"+"}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalTokenElement","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ParenthesizedTerminalElement","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"lookahead","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"?="},{"$type":"Keyword","value":"?!"}]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalRuleCall","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"TerminalRuleCall"}},{"$type":"Assignment","feature":"rule","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@46"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NegatedToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"NegatedToken"}},{"$type":"Keyword","value":"!"},{"$type":"Assignment","feature":"terminal","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"UntilToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"UntilToken"}},{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"terminal","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RegexToken","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RegexToken"}},{"$type":"Assignment","feature":"regex","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Wildcard","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Wildcard"}},{"$type":"Keyword","value":"."}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CharacterRange","inferredType":{"$type":"InferredType","name":"AbstractElement"},"definition":{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"CharacterRange"}},{"$type":"Assignment","feature":"left","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":".."},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FeatureName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"current"},{"$type":"Keyword","value":"entry"},{"$type":"Keyword","value":"extends"},{"$type":"Keyword","value":"false"},{"$type":"Keyword","value":"fragment"},{"$type":"Keyword","value":"grammar"},{"$type":"Keyword","value":"hidden"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"interface"},{"$type":"Keyword","value":"returns"},{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"true"},{"$type":"Keyword","value":"type"},{"$type":"Keyword","value":"infer"},{"$type":"Keyword","value":"infers"},{"$type":"Keyword","value":"with"},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/\\\\^?[_a-zA-Z][\\\\w_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"|'(\\\\\\\\.|[^'\\\\\\\\])*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RegexLiteral","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\/(?![*+?])(?:[^\\\\r\\\\n\\\\[/\\\\\\\\]|\\\\\\\\.|\\\\[(?:[^\\\\r\\\\n\\\\]\\\\\\\\]|\\\\\\\\.)*\\\\])+\\\\/[a-z]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false}],"types":[{"$type":"Type","name":"AbstractType","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@1"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@23/definition/elements@0"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@13"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`));var gd=De(xs(),1);var Gu=De(Yi(),1);function m1(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}var lw=0,h1=10;var fw=Symbol("OperationCancelled");function Os(t){return t===fw}async function vt(t){if(t===Gu.CancellationToken.None)return;let e=Date.now();if(e-lw>=h1&&(lw=e,await m1()),t.isCancellationRequested)throw fw}var md=class{constructor(){this.previousAction=Promise.resolve(),this.previousTokenSource=new Gu.CancellationTokenSource}lock(e){this.cancel();let r=new Gu.CancellationTokenSource;return this.previousTokenSource=r,this.previousAction=this.previousAction.then(()=>e(r.token).catch(n=>{Os(n)||console.error("Error: ",n)}))}cancel(){this.previousTokenSource.cancel()}};function vn(t){return{code:t}}var Aa;(function(t){t.all=["fast","slow","built-in"]})(Aa=Aa||(Aa={}));var hd=class{constructor(e){this.entries=new Ve,this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(let[i,o]of Object.entries(e)){let s=o;if(Array.isArray(s))for(let a of s){let c={check:this.wrapValidationException(a,r),category:n};this.addEntry(i,c)}else if(typeof s=="function"){let a={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,a)}}}wrapValidationException(e,r){return async(n,i,o)=>{try{await e.call(r,n,i,o)}catch(s){if(Os(s))throw s;console.error("An error occurred during validation:",s);let a=s instanceof Error?s.message:String(s);s instanceof Error&&s.stack&&console.error(s.stack),i("error","An error occurred during validation: "+a,{node:n})}}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=xe(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}};function dw(t,e){let r={unions:[],interfaces:[]};for(let n of t){let i=[];for(let a of n.attributes)i.push({name:a.name,optional:a.isOptional,astNodes:new Set([a]),type:Ls(a.type)});let o=new Set;for(let a of n.superTypes)a.ref&&o.add(si(a.ref));let s={name:n.name,declared:!0,abstract:!1,properties:i,superTypes:o,subTypes:new Set};r.interfaces.push(s)}for(let n of e){let i={name:n.name,declared:!0,type:Ls(n.type),superTypes:new Set,subTypes:new Set};r.unions.push(i)}return r}function Ls(t){if(Ps(t))return{elementType:Ls(t.elementType)};if(As(t))return{referenceType:Ls(t.referenceType)};if(Nn(t))return{types:t.types.map(Ls)};if(Ir(t)){let e;if(t.primitiveType)return e=t.primitiveType,{primitive:e};if(t.stringType)return e=t.stringType,{string:e};if(t.typeRef){let r=t.typeRef.ref,n=Si(r);if(n)return Da(n)?{primitive:n}:{value:n}}}return{primitive:"unknown"}}function Na(t){return"referenceType"in t}function vv(t){return"elementType"in t}function pw(t){return"types"in t}function Tv(t){return"value"in t}function g1(t){return"primitive"in t}function y1(t){return"string"in t}function mw(t){let e=new Map,r=new Map;for(let n of t.interfaces){let i=new Ca(n.name,n.declared,n.abstract);e.set(n.name,i)}for(let n of t.unions){let i=new od(n.name,{declared:n.declared,dataType:n.dataType});r.set(n.name,i)}for(let n of t.interfaces){let i=e.get(n.name);for(let o of n.superTypes){let s=e.get(o)||r.get(o);s&&i.superTypes.add(s)}for(let o of n.subTypes){let s=e.get(o)||r.get(o);s&&i.subTypes.add(s)}for(let o of n.properties){let s=v1(o,e,r);i.properties.push(s)}}for(let n of t.unions){let i=r.get(n.name);i.type=Bu(n.type,i,e,r)}return{interfaces:Array.from(e.values()),unions:Array.from(r.values())}}function v1(t,e,r){return{name:t.name,optional:t.optional,astNodes:t.astNodes,type:Bu(t.type,void 0,e,r)}}function Bu(t,e,r,n){if(vv(t))return{elementType:Bu(t.elementType,e,r,n)};if(Na(t))return{referenceType:Bu(t.referenceType,void 0,r,n)};if(pw(t))return{types:t.types.map(i=>Bu(i,e,r,n))};if(y1(t))return{string:t.string};if(g1(t))return{primitive:t.primitive,regex:t.regex};if(Tv(t)){let i=r.get(t.value)||n.get(t.value);return i?(e&&e.subTypes.add(i),{value:i}):{primitive:"unknown"}}else throw new Error("Invalid property type")}function xv(t,e){let r=Ku(t),n=Ku(e);for(let i of n)T1(r,i)||r.push(i);return r.length===1?r[0]:{types:r}}function T1(t,e){return t.some(r=>Rv(r,e))}function Rv(t,e){return vv(t)&&vv(e)?Rv(t.elementType,e.elementType):Na(t)&&Na(e)?Rv(t.referenceType,e.referenceType):Tv(t)&&Tv(e)?t.value===e.value:!1}function Ku(t){return pw(t)?t.types.flatMap(e=>Ku(e)):[t]}function hw(t){let e=t.validation.ValidationRegistry,r=t.validation.LangiumGrammarValidator,n={Action:[r.checkAssignmentReservedName],AbstractRule:r.checkRuleName,Assignment:[r.checkAssignmentWithFeatureName,r.checkAssignmentToFragmentRule,r.checkAssignmentTypes,r.checkAssignmentReservedName],ParserRule:[r.checkParserRuleDataType,r.checkRuleParametersUsed,r.checkParserRuleReservedName],TerminalRule:[r.checkTerminalRuleReturnType,r.checkHiddenTerminalRule,r.checkEmptyTerminalRule],InferredType:r.checkTypeReservedName,Keyword:r.checkKeyword,UnorderedGroup:r.checkUnorderedGroup,Grammar:[r.checkGrammarName,r.checkEntryGrammarRule,r.checkUniqueRuleName,r.checkUniqueTypeName,r.checkUniqueImportedRules,r.checkDuplicateImportedGrammar,r.checkGrammarHiddenTokens,r.checkGrammarForUnusedRules,r.checkGrammarTypeInfer,r.checkClashingTerminalNames],GrammarImport:r.checkPackageImport,CharacterRange:r.checkInvalidCharacterRange,Interface:[r.checkTypeReservedName,r.checkInterfacePropertyTypes],Type:[r.checkTypeReservedName],TypeAttribute:r.checkTypeReservedName,RuleCall:[r.checkUsedHiddenTerminalRule,r.checkUsedFragmentTerminalRule,r.checkRuleCallParameters],TerminalRuleCall:r.checkUsedHiddenTerminalRule,CrossReference:[r.checkCrossReferenceSyntax,r.checkCrossRefNameAssignment,r.checkCrossRefTerminalType,r.checkCrossRefType,r.checkCrossReferenceToTypeUnion],SimpleType:r.checkFragmentsInTypes,ReferenceType:r.checkReferenceTypeUnion,RegexToken:[r.checkInvalidRegexFlags,r.checkDirectlyUsedRegexFlags]};e.register(n,r)}var He;(function(t){t.GrammarNameUppercase="grammar-name-uppercase",t.RuleNameUppercase="rule-name-uppercase",t.HiddenGrammarTokens="hidden-grammar-tokens",t.UseRegexTokens="use-regex-tokens",t.EntryRuleTokenSyntax="entry-rule-token-syntax",t.CrossRefTokenSyntax="cross-ref-token-syntax",t.UnnecessaryFileExtension="unnecessary-file-extension",t.InvalidReturns="invalid-returns",t.InvalidInfers="invalid-infers",t.MissingInfer="missing-infer",t.MissingReturns="missing-returns",t.SuperfluousInfer="superfluous-infer",t.OptionalUnorderedGroup="optional-unordered-group"})(He=He||(He={}));var yd=class{constructor(e){this.references=e.references.References,this.documents=e.shared.workspace.LangiumDocuments}checkGrammarName(e,r){if(e.name){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","Grammar name should start with an upper case letter.",{node:e,property:"name",data:vn(He.GrammarNameUppercase)})}}checkEntryGrammarRule(e,r){if(e.isDeclared&&!e.name)return;let n=e.rules.filter(i=>Q(i)&&i.entry);if(e.isDeclared&&n.length===0){let i=e.rules.find(o=>Q(o)&&!Tn(o));i?r("error","The grammar is missing an entry parser rule. This rule can be an entry one.",{node:i,property:"name",data:vn(He.EntryRuleTokenSyntax)}):r("error","This grammar is missing an entry parser rule.",{node:e,property:"name"})}else!e.isDeclared&&n.length>=1?n.forEach(i=>r("error","Cannot declare entry rules for unnamed grammars.",{node:i,property:"name"})):n.length>1?n.forEach(i=>r("error","The entry rule has to be unique.",{node:i,property:"name"})):n.length===1&&Tn(n[0])&&r("error","The entry rule cannot be a data type rule.",{node:n[0],property:"name"})}checkUniqueRuleName(e,r){let n=i=>xe(i.rules).filter(o=>!zu(o));this.checkUniqueName(e,r,n,"rule")}checkUniqueTypeName(e,r){let n=i=>xe(i.types).concat(i.interfaces);this.checkUniqueName(e,r,n,"type")}checkUniqueName(e,r,n,i){let o=new Ve;n(e).forEach(c=>o.add(c.name,c));for(let[,c]of o.entriesGroupedByKey())c.length>1&&c.forEach(u=>{r("error",`A ${i}'s name has to be unique.`,{node:u,property:"name"})});let s=new Set,a=Vu(this.documents,e);for(let c of a)n(c).forEach(u=>s.add(u.name));for(let c of o.keys())s.has(c)&&o.get(c).forEach(l=>{r("error",`A ${i} with the name '${l.name}' already exists in an imported grammar.`,{node:l,property:"name"})})}checkDuplicateImportedGrammar(e,r){let n=new Ve;for(let i of e.imports){let o=so(this.documents,i);o&&n.add(o,i)}for(let[,i]of n.entriesGroupedByKey())i.length>1&&i.forEach((o,s)=>{s>0&&r("warning","The grammar is already being directly imported.",{node:o,tags:[gd.DiagnosticTag.Unnecessary]})})}checkUniqueImportedRules(e,r){let n=new Map;for(let o of e.imports){let s=Vu(this.documents,o);n.set(o,s)}let i=new Ve;for(let o of e.imports){let s=n.get(o);for(let a of e.imports){if(o===a)continue;let c=n.get(a),u=this.getDuplicateExportedRules(s,c);for(let l of u)i.add(o,l)}}for(let o of e.imports){let s=i.get(o);s.length>0&&r("error","Some rules exported by this grammar are also included in other imports: "+xe(s).distinct().join(", "),{node:o,property:"path"})}}getDuplicateExportedRules(e,r){let i=e.filter(a=>!r.includes(a)).flatMap(a=>a.rules),o=r.flatMap(a=>a.rules),s=new Set;for(let a of i){let c=a.name;for(let u of o){let l=u.name;c===l&&s.add(u.name)}}return s}checkGrammarTypeInfer(e,r){var n,i,o;let s=new Set;for(let c of e.types)s.add(c.name);for(let c of e.interfaces)s.add(c.name);for(let c of Vu(this.documents,e))c.types.forEach(u=>s.add(u.name)),c.interfaces.forEach(u=>s.add(u.name));for(let c of e.rules.filter(Q)){if(zu(c))continue;let u=Tn(c),l=!c.returnType&&!c.dataType,f=Si(c);if(!u&&f&&s.has(f)===l){if((l||((n=c.returnType)===null||n===void 0?void 0:n.ref)!==void 0)&&c.inferredType===void 0)r("error",a(f,l),{node:c,property:"name",data:vn(He.MissingReturns)});else if(l||((i=c.returnType)===null||i===void 0?void 0:i.ref)!==void 0){let g=In(c.inferredType.$cstNode,"infers");r("error",a(f,l),{node:c.inferredType,property:"name",data:{code:He.InvalidInfers,actionSegment:Nr(g)}})}}else if(u&&l){let g=In(c.$cstNode,"infer");r("error","Data type rules cannot infer a type.",{node:c,property:"inferredType",data:{code:He.InvalidInfers,actionSegment:Nr(g)}})}}for(let c of yt(e).filter(Xe)){let u=this.getActionType(c);if(u){let l=!!c.inferredType,f=Si(c);if(c.type&&f&&s.has(f)===l){let g=l?In(c.$cstNode,"infer"):In(c.$cstNode,"{");r("error",a(f,l),{node:c,property:"type",data:{code:l?He.SuperfluousInfer:He.MissingInfer,actionSegment:Nr(g)}})}else if(u&&f&&s.has(f)&&l&&c.$cstNode){let g=br((o=c.inferredType)===null||o===void 0?void 0:o.$cstNode,"name"),T=In(c.$cstNode,"{");g&&T&&r("error",`${f} is a declared type and cannot be redefined.`,{node:c,property:"type",data:{code:He.SuperfluousInfer,actionRange:{start:T.range.end,end:g.range.start}}})}}}function a(c,u){return u?`The type '${c}' is already explicitly declared and cannot be inferred.`:`The type '${c}' is not explicitly declared and must be inferred.`}}getActionType(e){var r;if(e.type)return(r=e.type)===null||r===void 0?void 0:r.ref;if(e.inferredType)return e.inferredType}checkGrammarHiddenTokens(e,r){e.definesHiddenTokens&&r("error","Hidden terminals are declared at the terminal definition.",{node:e,property:"definesHiddenTokens",data:vn(He.HiddenGrammarTokens)})}checkHiddenTerminalRule(e,r){e.hidden&&e.fragment&&r("error","Cannot use terminal fragments as hidden tokens.",{node:e,property:"hidden"})}checkEmptyTerminalRule(e,r){try{let n=Ln(e);new RegExp(n).test("")&&r("error","This terminal could match an empty string.",{node:e,property:"name"})}catch{}}checkInvalidRegexFlags(e,r){let n=e.regex;if(n){let i=n.lastIndexOf("/"),o=n.substring(i+1),s="gmy",c=s+"isu",u=new Set,l=new Set;for(let g=0;g<o.length;g++){let T=o.charAt(g);c.includes(T)?s.includes(T)&&l.add(T):u.add(T)}let f=this.getFlagRange(e);f&&(u.size>0?r("error",`'${Array.from(u).join("")}' ${u.size>1?"are":"is"} not valid regular expression flag${u.size>1?"s":""}.`,{node:e,range:f}):l.size>0&&r("warning",`'${Array.from(l).join("")}' regular expression flag${l.size>1?"s":""} will be ignored by Langium.`,{node:e,range:f}))}}checkDirectlyUsedRegexFlags(e,r){if(!We(e.$container)){let n=this.getFlagRange(e);n&&r("warning","Regular expression flags are only applied if the terminal is not a composition",{node:e,range:n})}}getFlagRange(e){let r=br(e.$cstNode,"regex");if(!r||!e.regex)return;let n=e.regex,i=n.lastIndexOf("/")+1;return{start:{line:r.range.end.line,character:r.range.end.character-n.length+i},end:r.range.end}}checkUsedHiddenTerminalRule(e,r){let n=Je(e,i=>We(i)||Q(i));if(n){if("hidden"in n&&n.hidden)return;let i=e.rule.ref;We(i)&&i.hidden&&r("error","Cannot use hidden terminal in non-hidden rule",{node:e,property:"rule"})}}checkUsedFragmentTerminalRule(e,r){let n=e.rule.ref;We(n)&&n.fragment&&Je(e,Q)&&r("error","Cannot use terminal fragments as part of parser rules.",{node:e,property:"rule"})}checkCrossReferenceSyntax(e,r){e.deprecatedSyntax&&r("error","'|' is deprecated. Please, use ':' instead.",{node:e,property:"deprecatedSyntax",data:vn(He.CrossRefTokenSyntax)})}checkPackageImport(e,r){so(this.documents,e)===void 0?r("error","Import cannot be resolved.",{node:e,property:"path"}):e.path.endsWith(".langium")&&r("warning","Imports do not need file extensions.",{node:e,property:"path",data:vn(He.UnnecessaryFileExtension)})}checkInvalidCharacterRange(e,r){if(e.right){let n="Character ranges cannot use more than one character",i=!1;e.left.value.length>1&&(i=!0,r("error",n,{node:e.left,property:"value"})),e.right.value.length>1&&(i=!0,r("error",n,{node:e.right,property:"value"})),i||r("hint","Consider using regex instead of character ranges",{node:e,data:vn(He.UseRegexTokens)})}}checkGrammarForUnusedRules(e,r){let n=Ia(e,!0);for(let i of e.rules)We(i)&&i.hidden||zu(i)||n.has(i)||r("hint","This rule is declared but never referenced.",{node:i,property:"name",tags:[gd.DiagnosticTag.Unnecessary]})}checkClashingTerminalNames(e,r){let n=new Ve,i=new Set;for(let u of e.rules)We(u)&&u.name&&n.add(u.name,u),Q(u)&&yt(u).filter(Ot).forEach(f=>i.add(f.value));let o=new Ve,s=new Ve;for(let u of e.imports){let l=Vu(this.documents,u);for(let f of l)for(let g of f.rules)We(g)&&g.name?o.add(g.name,u):Q(g)&&g.name&&yt(g).filter(Ot).forEach(C=>s.add(C.value,u))}for(let u of n.values())if(i.has(u.name))r("error","Terminal name clashes with existing keyword.",{node:u,property:"name"});else if(s.has(u.name)){let l=s.get(u.name);r("error",`Terminal name clashes with imported keyword from "${l[0].path}".`,{node:u,property:"name"})}let a=new Ve;for(let u of i)for(let l of o.get(u))a.add(l,u);for(let[u,l]of a.entriesGroupedByKey())l.length>0&&r("error",`Imported terminals (${l.join(", ")}) clash with locally defined keywords.`,{node:u,property:"path"});let c=new Ve;for(let[u,l]of o.entriesGroupedByKey()){let f=s.get(u);f.length>0&&l.filter(g=>!f.includes(g)).forEach(g=>c.add(g,u))}for(let[u,l]of c.entriesGroupedByKey())l.length>0&&r("error",`Imported terminals (${l.join(", ")}) clash with imported keywords.`,{node:u,property:"path"})}checkRuleName(e,r){if(e.name&&!zu(e)){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","Rule name should start with an upper case letter.",{node:e,property:"name",data:vn(He.RuleNameUppercase)})}}checkTypeReservedName(e,r){this.checkReservedName(e,"name",r)}checkAssignmentReservedName(e,r){this.checkReservedName(e,"feature",r)}checkParserRuleReservedName(e,r){e.inferredType||this.checkReservedName(e,"name",r)}checkReservedName(e,r,n){let i=e[r];typeof i=="string"&&R1.has(i)&&n("error",`'${i}' is a reserved name of the JavaScript runtime.`,{node:e,property:r})}checkKeyword(e,r){Je(e,Q)&&(e.value.length===0?r("error","Keywords cannot be empty.",{node:e}):e.value.trim().length===0?r("error","Keywords cannot only consist of whitespace characters.",{node:e}):/\s/g.test(e.value)&&r("warning","Keywords should not contain whitespace characters.",{node:e}))}checkUnorderedGroup(e,r){e.elements.forEach(n=>{On(n.cardinality)&&r("error","Optional elements in Unordered groups are currently not supported",{node:n,data:vn(He.OptionalUnorderedGroup)})})}checkRuleParametersUsed(e,r){let n=e.parameters;if(n.length>0){let i=yt(e).filter(ba);for(let o of n)i.some(s=>s.parameter.ref===o)||r("hint",`Parameter '${o.name}' is unused.`,{node:o,tags:[gd.DiagnosticTag.Unnecessary]})}}checkParserRuleDataType(e,r){if(zu(e))return;let n=yw(e),i=Tn(e);!n&&i?r("error","This parser rule does not create an object. Add a primitive return type or an action to the start of the rule to force object instantiation.",{node:e,property:"name"}):n&&!i&&r("error","Normal parser rules are not allowed to return a primitive value. Use a datatype rule for that.",{node:e,property:e.dataType?"dataType":"returnType"})}checkAssignmentToFragmentRule(e,r){e.terminal&&Ye(e.terminal)&&Q(e.terminal.rule.ref)&&e.terminal.rule.ref.fragment&&r("error",`Cannot use fragment rule '${e.terminal.rule.ref.name}' for assignment of property '${e.feature}'.`,{node:e,property:"terminal"})}checkAssignmentTypes(e,r){if(!e.terminal)return;let n;yt(e.terminal).map(o=>Rr(o)?"ref":"other").find(o=>n?o!==n:(n=o,!1))&&r("error",this.createMixedTypeError(e.feature),{node:e,property:"terminal"})}checkInterfacePropertyTypes(e,r){for(let n of e.attributes)if(n.type){let i=Ls(n.type),o=Ku(i),s=!1,a=!1;for(let c of o)Na(c)?s=!0:Na(c)||(a=!0);s&&a&&r("error",this.createMixedTypeError(n.name),{node:n,property:"type"})}}createMixedTypeError(e){return`Mixing a cross-reference with other types is not supported. Consider splitting property "${e}" into two or more different properties.`}checkTerminalRuleReturnType(e,r){var n;!((n=e.type)===null||n===void 0)&&n.name&&!Da(e.type.name)&&r("error","Terminal rules can only return primitive types like 'string', 'boolean', 'number', 'Date' or 'bigint'.",{node:e.type,property:"name"})}checkRuleCallParameters(e,r){let n=e.rule.ref;if(Q(n)){let i=n.parameters.length,o=e.arguments.length;i!==o&&r("error",`Rule '${n.name}' expects ${i} arguments, but got ${o}.`,{node:e})}else We(n)&&e.arguments.length>0&&r("error","Terminal rules do not accept any arguments",{node:e})}checkCrossRefNameAssignment(e,r){!e.terminal&&e.type.ref&&!Xu(e.type.ref)&&r("error","Cannot infer terminal or data type rule for cross-reference.",{node:e,property:"type"})}checkCrossRefTerminalType(e,r){var n;let i=e.terminal;if(Ye(i)){let o=i.rule.ref;Q(o)&&!Tn(o)?r("error","Parser rules cannot be used for cross-references.",{node:i,property:"rule"}):Q(o)&&!vw(o)?r("error","Data type rules for cross-references must be of type string.",{node:i,property:"rule"}):We(o)&&(!((n=o.type)===null||n===void 0)&&n.name)&&o.type.name!=="string"&&r("error","Terminal rules for cross-references must be of type string.",{node:i,property:"rule"})}}checkCrossRefType(e,r){let n=this.checkReferenceToRuleButNotType(e?.type);n&&r("error",n,{node:e,property:"type"})}checkCrossReferenceToTypeUnion(e,r){if(lr(e.type.ref)&&Nn(e.type.ref.type)){let n=gw(e.type.ref.type);n.length>0&&r("error",`Cross-reference on type union is only valid if all alternatives are AST nodes. ${n.join(", ")} ${n.length>1?"are":"is"} not ${n.length>1?"":"an "}AST node${n.length>1?"s":""}.`,{node:e,property:"type"})}}checkFragmentsInTypes(e,r){var n,i;Q((n=e.typeRef)===null||n===void 0?void 0:n.ref)&&(!((i=e.typeRef)===null||i===void 0)&&i.ref.fragment)&&r("error","Cannot use rule fragments in types.",{node:e,property:"typeRef"})}checkReferenceTypeUnion(e,r){Ir(e.referenceType)||r("error","Only direct rule references are allowed in reference types.",{node:e,property:"referenceType"})}checkReferenceToRuleButNotType(e){if(e&&Q(e.ref)&&!Tn(e.ref)&&(e.ref.returnType||e.ref.inferredType)){let r=Si(e.ref);if(r)return`Use the rule type '${r}' instead of the typed rule name '${e.ref.name}' for cross-references.`}}checkAssignmentWithFeatureName(e,r){e.feature==="name"&&Rr(e.terminal)&&r("warning",'The "name" property is not recommended for cross-references.',{node:e,property:"feature"})}};function zu(t){return!t.definition||!t.definition.$cstNode||t.definition.$cstNode.length===0}var R1=new Set(["Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","Map","Set","WeakMap","WeakSet","Error","AggregateError","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","BigInt","RegExp","Number","Object","Function","Symbol","String","Math","NaN","Infinity","isFinite","isNaN","Buffer","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","globalThis","decodeURIComponent","decodeURI","encodeURIComponent","encodeURI","parseInt","parseFloat","Promise","Generator","GeneratorFunction","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Reflect","Proxy","Date","Intl","eval","undefined"]);function gw(t){let e=[];return t.types.forEach(r=>{var n;Ir(r)&&(!((n=r.typeRef)===null||n===void 0)&&n.ref?lr(r.typeRef.ref)&&(Nn(r.typeRef.ref.type)?e.push(...gw(r.typeRef.ref.type)):e.push(r.typeRef.ref.name)):r.stringType?e.push(`"${r.stringType}"`):r.primitiveType&&e.push(r.primitiveType))}),Array.from(new Set(e))}function On(t,e){return t==="?"||t==="*"||fr(e)&&!!e.guardCondition}function Tw(t){return t==="*"||t==="+"}function Tn(t){return Rw(t,new Set)}function Rw(t,e){if(e.has(t))return!0;e.add(t);for(let r of yt(t))if(Ye(r)){if(!r.rule.ref||Q(r.rule.ref)&&!Rw(r.rule.ref,e))return!1}else{if(Fe(r))return!1;if(Xe(r))return!1}return!!t.definition}function yw(t){var e;let r=(e=t.returnType)===null||e===void 0?void 0:e.ref;return t.dataType!==void 0||lr(r)&&x1(r)}function x1(t){return _v(t.type,new Set)}function _v(t,e){if(e.has(t))return!0;if(e.add(t),Ps(t))return!1;if(As(t))return!1;if(Nn(t))return t.types.every(r=>_v(r,e));if(Ir(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){let r=t.typeRef.ref;return lr(r)?_v(r.type,e):!1}else return!1}else return!1}function vw(t){return Yu(t,new Set)}function Yu(t,e){var r,n;if(e.has(t))return!0;if(e.add(t),Q(t)){if(t.dataType)return t.dataType==="string";if(!((r=t.returnType)===null||r===void 0)&&r.ref)return Yu(t.returnType.ref,e)}else{if(lr(t))return Yu(t.type,e);if(Ps(t))return!1;if(As(t))return!1;if(Nn(t))return t.types.every(i=>Yu(i,e));if(Ir(t)){if(t.primitiveType==="string")return!0;if(t.stringType)return!0;if(!((n=t.typeRef)===null||n===void 0)&&n.ref)return Yu(t.typeRef.ref,e)}}return!1}function kv(t){let e=t.$container;if(fr(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(Xe(o))return o;{let s=yt(r[i]).find(Xe);if(s)return s}}}if(Ta(e))return kv(e)}function si(t){var e;if(Q(t))return Tn(t)?t.name:(e=La(t))!==null&&e!==void 0?e:t.name;if(tn(t)||lr(t)||_a(t))return t.name;if(Xe(t)){let r=Ma(t);if(r)return r}else if(xa(t))return t.name;throw new sd("Cannot get name of Unknown Type",t.$cstNode)}function Si(t){if(t)try{return si(t)}catch{return}}function La(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e){if(Q(e))return e.name;if(tn(e)||lr(e))return e.name}}}function Ma(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return si(t.type.ref)}function Ms(t){var e,r,n;return We(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":Tn(t)?t.name:(n=La(t))!==null&&n!==void 0?n:t.name}function Ln(t){let e={s:!1,i:!1,u:!1},r=$a(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}var wv=/[\s\S]/.source;function $a(t,e){if(Pk(t))return b1(t);if(Dk(t))return _1(t);if(Zf(t))return w1(t);if(ed(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return ao($a(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(Sk(t))return k1(t);if(Lk(t))return S1(t);if(wk(t)){let r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ao(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if($k(t))return ao(wv,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function b1(t){return ao(t.elements.map(e=>$a(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function _1(t){return ao(t.elements.map(e=>$a(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function S1(t){return ao(`${wv}*?${$a(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function k1(t){return ao(`(?!${$a(t.terminal)})${wv}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function w1(t){return t.right?ao(`[${bv(t.left)}-${bv(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ao(bv(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function bv(t){return io(t.value)}function ao(t,e){var r;return(e.wrap!==!1||e.lookahead)&&(t=`(${(r=e.lookahead)!==null&&r!==void 0?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function Cv(t){if(t.path===void 0||t.path.length===0)return;let e=Le.dirname(Te(t).uri),r=t.path;return r.endsWith(".langium")||(r+=".langium"),Le.resolvePath(e,r)}function so(t,e){let r=Cv(e);try{if(r){let i=t.getOrCreateDocument(r).parseResult.value;if(Ra(i))return i}}catch{}}function Vu(t,e){if(Jf(e)){let r=so(t,e);if(r){let n=Sv(t,r);return n.push(r),n}return[]}else return Sv(t,e)}function Sv(t,e,r=e,n=new Set,i=new Set){let o=Te(e);if(r!==e&&i.add(e),!n.has(o.uri)){n.add(o.uri);for(let s of e.imports){let a=so(t,s);a&&Sv(t,a,r,n,i)}}return Array.from(i)}function Oa(t){return Fe(t)?[t]:mn(t)||fr(t)||hn(t)?t.elements.flatMap(e=>Oa(e)):Ye(t)&&t.rule.ref?Oa(t.rule.ref.definition):[]}var C1=["string","number","boolean","Date","bigint"];function Da(t){return C1.includes(t)}var Ev=class{constructor(e,r){this.context=e,this.root=r}getTypes(){let e={name:this.root.name,properties:this.root.properties,ruleCalls:this.root.ruleCalls,super:[]};return this.root.children.length===0?[{alt:e,next:[]}]:this.applyNext(this.root,{alt:e,next:this.root.children})}applyNext(e,r){let n=this.splitType(r.alt,r.next.length),i=[];for(let o=0;o<r.next.length;o++){let s=n[o],a=r.next[o];a.actionWithAssignment&&i.push({alt:xw(s),next:[]}),a.name!==void 0&&a.name!==s.name&&(a.actionWithAssignment?(s.properties=[],s.ruleCalls=[],s.super=[e.name],s.name=a.name):(s.super=[s.name,...s.ruleCalls],s.properties=[],s.ruleCalls=[],s.name=a.name)),s.properties.push(...a.properties),s.ruleCalls.push(...a.ruleCalls);let c={alt:s,next:a.children};c.next.length===0?(c.alt.super=c.alt.super.filter(u=>u!==c.alt.name),i.push(c)):i.push(...this.applyNext(e,c))}return ww(i)}splitType(e,r){let n=[];for(let i=0;i<r;i++)n.push(xw(e));return n}getSuperTypes(e){let r=new Set;return this.collectSuperTypes(e,e,r),Array.from(r)}collectSuperTypes(e,r,n){if(r.ruleCalls.length>0){for(let i of r.ruleCalls)n.add(i);return}for(let i of r.parents)e.name===void 0?this.collectSuperTypes(i,i,n):i.name!==void 0&&i.name!==e.name?n.add(i.name):this.collectSuperTypes(e,i,n);r.parents.length===0&&r.name&&n.add(r.name)}connect(e,r){return r.parents.push(e),e.children.push(r),r}merge(...e){if(e.length===1)return e[0];if(e.length===0)throw new Error("No parts to merge");let r=$s();r.parents=e;for(let n of e)n.children.push(r);return r}hasLeafNode(e){return this.partHasLeafNode(e)}partHasLeafNode(e,r){return e.children.some(n=>n!==r)?!0:e.name?!1:e.parents.some(n=>this.partHasLeafNode(n,e))}};function E1(t){return{name:t.name,children:[],parents:[],actionWithAssignment:t.actionWithAssignment,ruleCalls:[...t.ruleCalls],properties:t.properties.map(bw)}}function xw(t){return{name:t.name,super:t.super,ruleCalls:t.ruleCalls,properties:t.properties.map(e=>bw(e))}}function bw(t){return{name:t.name,optional:t.optional,type:t.type,astNodes:t.astNodes}}function _w(t,e,r){let n=[],i={fragments:new Map};for(let c of t)n.push(...Sw(i,c));let o=O1(n),s=L1(o),a=M1(o,s,r);for(let c of e){let u=P1(c);a.unions.push({name:c.name,declared:!1,type:u,subTypes:new Set,superTypes:new Set,dataType:c.dataType})}return a}function P1(t){if(t.dataType&&t.dataType!=="string")return{primitive:t.dataType};let e=!1,r=()=>(e=!0,{primitive:"unknown"}),n=Pv(t.definition,r);return e?{primitive:"string"}:n}function Pv(t,e){var r,n,i;if(t.cardinality)return e();if(mn(t))return{types:t.elements.map(o=>Pv(o,e))};if(fr(t)||hn(t))return t.elements.length!==1?e():Pv(t.elements[0],e);if(Ye(t)){let o=(r=t.rule)===null||r===void 0?void 0:r.ref;return o?We(o)?{primitive:(i=(n=o.type)===null||n===void 0?void 0:n.name)!==null&&i!==void 0?i:"string",regex:Ln(o).toString()}:{value:o.name}:e()}else if(Ot(t))return{string:t.value};return e()}function Sw(t,e){let r=$s(e),n=new Ev(t,r);return e.definition&&Av(n,n.root,e.definition),n.getTypes()}function $s(t){return{name:Q(t)||Xe(t)?Si(t):t,properties:[],ruleCalls:[],children:[],parents:[],actionWithAssignment:!1}}function Av(t,e,r){let n=On(r.cardinality,r);if(mn(r)){let i=[];n&&i.push(t.connect(e,$s()));for(let o of r.elements){let s=t.connect(e,$s());i.push(Av(t,s,o))}return t.merge(...i)}else if(fr(r)||hn(r)){let i=t.connect(e,$s()),o;n&&(o=t.connect(e,$s()));for(let s of r.elements)i=Av(t,i,s);return o?t.merge(o,i):i}else{if(Xe(r))return A1(t,e,r);Fe(r)?D1(e,r):Ye(r)&&N1(t,e,r)}return e}function A1(t,e,r){var n;if(!t.hasLeafNode(e)){let o=E1(e);t.connect(e,o)}let i=t.connect(e,$s(r));if(r.type){let o=(n=r.type)===null||n===void 0?void 0:n.ref;o&&ju(o)&&(i.name=o.name)}return r.feature&&r.operator&&(i.actionWithAssignment=!0,i.properties.push({name:r.feature,optional:!1,type:Fs(r.operator==="+=",!1,t.root.ruleCalls.length!==0?t.root.ruleCalls:t.getSuperTypes(i)),astNodes:new Set([r])})),i}function D1(t,e){let r={types:new Set,reference:!1};kw(e.terminal,r);let n=Fs(e.operator==="+=",r.reference,e.operator==="?="?["boolean"]:Array.from(r.types));t.properties.push({name:e.feature,optional:On(e.cardinality),type:n,astNodes:new Set([e])})}function kw(t,e){if(mn(t)||hn(t)||fr(t))for(let r of t.elements)kw(r,e);else if(Ot(t))e.types.add(`'${t.value}'`);else if(Ye(t)&&t.rule.ref)e.types.add(Ms(t.rule.ref));else if(Rr(t)&&t.type.ref){let r=Si(t.type.ref);r&&e.types.add(r),e.reference=!0}}function N1(t,e,r){let n=r.rule.ref;if(Q(n)&&n.fragment){let i=I1(n,t.context);On(r.cardinality)?e.properties.push(...i.map(o=>Object.assign(Object.assign({},o),{optional:!0}))):e.properties.push(...i)}else Q(n)&&e.ruleCalls.push(Ms(n))}function I1(t,e){let r=e.fragments.get(t);if(r)return r;let n=[];e.fragments.set(t,n);let i=Si(t),o=Sw(e,t).filter(s=>s.alt.name===i);return n.push(...o.flatMap(s=>s.alt.properties)),n}function O1(t){let e=new Map,r=[],n=ww(t).map(i=>i.alt);for(let i of n){let o={name:i.name,properties:i.properties,superTypes:new Set(i.super),subTypes:new Set,declared:!1,abstract:!1};e.set(o.name,o),i.ruleCalls.length>0&&(r.push(i),i.ruleCalls.forEach(s=>{s!==o.name&&o.subTypes.add(s)}))}for(let i of r)for(let o of i.ruleCalls){let s=e.get(o);s&&s.name!==i.name&&s.superTypes.add(i.name)}return Array.from(e.values())}function ww(t){let e=t.reduce((n,i)=>n.add(i.alt.name,i),new Ve),r=[];for(let[n,i]of e.entriesGroupedByKey()){let o=[],s=new Set,a={alt:{name:n,properties:o,ruleCalls:[],super:[]},next:[]};for(let c of i){let u=c.alt;a.alt.super.push(...u.super),a.next.push(...c.next);let l=u.properties;for(let f of l){let g=o.find(T=>T.name===f.name);g?(g.type=xv(g.type,f.type),f.astNodes.forEach(T=>g.astNodes.add(T))):o.push(Object.assign({},f))}u.ruleCalls.forEach(f=>s.add(f))}for(let c of i){let u=c.alt;if(u.ruleCalls.length===0)for(let l of o)u.properties.find(f=>f.name===l.name)||(l.optional=!0)}a.alt.ruleCalls=Array.from(s),r.push(a)}return r}function L1(t){let e=new Map(t.map(i=>[i.name,i])),r=[],n=new Ve;for(let i of t)for(let o of i.superTypes)n.add(o,i.name);for(let[i,o]of n.entriesGroupedByKey())if(!e.has(i)){let s={declared:!1,name:i,subTypes:new Set,superTypes:new Set,type:Fs(!1,!1,o)};r.push(s)}return r}function M1(t,e,r){let n=new Ve;for(let a of t)for(let c of a.superTypes)n.add(c,a.name);let i=new Set(r.interfaces.map(a=>a.name)),o={interfaces:[],unions:e},s=new Map(e.map(a=>[a.name,a]));for(let a of t){let c=new Set(n.get(a.name));if(a.properties.length===0&&c.size>0)if(i.has(a.name))a.abstract=!0,o.interfaces.push(a);else{let u=Fs(!1,!1,Array.from(c)),l=s.get(a.name);if(l)l.type=xv(l.type,u);else{let f={name:a.name,declared:!1,subTypes:c,superTypes:a.superTypes,type:u};o.unions.push(f),s.set(a.name,f)}}else o.interfaces.push(a)}for(let a of o.interfaces)a.superTypes=new Set([...a.superTypes].filter(c=>!s.has(c)));return o}function Fs(t,e,r){if(t)return{elementType:Fs(!1,e,r)};if(e)return{referenceType:Fs(!1,!1,r)};if(r.length===1){let n=r[0];return n.startsWith("'")?{string:n.substring(1,n.length-1)}:Da(n)?{primitive:n}:{value:n}}else return{types:r.map(n=>Fs(!1,!1,[n]))}}function Cw(t,e){let r=Ew(t,e),n=dw(r.interfaces,r.types),i=_w(r.parserRules,r.datatypeRules,n);return{astResources:r,inferred:i,declared:n}}function Ew(t,e,r=new Set,n={parserRules:[],datatypeRules:[],interfaces:[],types:[]}){Array.isArray(t)||(t=[t]);for(let i of t){let o=Te(i);if(!r.has(o.uri)){r.add(o.uri);for(let s of i.rules)Q(s)&&!s.fragment&&(Tn(s)?n.datatypeRules.push(s):n.parserRules.push(s));if(i.interfaces.forEach(s=>n.interfaces.push(s)),i.types.forEach(s=>n.types.push(s)),e){let s=i.imports.map(a=>so(e,a)).filter(a=>a!==void 0);Ew(s,e,r,n)}}}return n}function Dw(t,e){let{inferred:r,declared:n,astResources:i}=Cw(t,e);return{astResources:i,inferred:Pw(n,r),declared:Pw(r,n)}}function Pw(t,e){var r,n;let i={interfaces:nw(Aw(...t.interfaces,...(r=e?.interfaces)!==null&&r!==void 0?r:[])),unions:Aw(...t.unions,...(n=e?.unions)!==null&&n!==void 0?n:[])},o=mw(i);return $1(o),o}function Aw(...t){return Array.from(t.reduce((e,r)=>(e.set(r.name,r),e),new Map).values()).sort((e,r)=>e.name.localeCompare(r.name))}function $1(t){let e=q1(t),r=Array.from(e.values());j1(r),U1(t.interfaces),F1(r)}function F1(t){let e=new Set,r=n=>{if(!e.has(n)){e.add(n),n.typeNames.add(n.name);for(let i of n.subTypes)r(i),i.typeNames.forEach(o=>n.typeNames.add(o))}};t.forEach(r)}function q1({interfaces:t,unions:e}){let r=t.concat(e).reduce((i,o)=>(i.set(o.name,o),i),new Map),n=new Map;for(let i of e)n.set(i,Dv(i.type,new Set));for(let[i,o]of n)o&&r.delete(i.name);return r}function Dv(t,e){if(e.has(t))return!0;if(e.add(t),or(t))return t.types.every(r=>Dv(r,e));if(gn(t)){let r=t.value;return ni(r)?Dv(r.type,e):!1}else return yn(t)||bi(t)}function j1(t){for(let e of t)for(let r of e.superTypes)r.subTypes.add(e)}function U1(t){var e;let r=t.reduce((s,a)=>(s.set(a.name,a),s),new Map);for(let s of t){let a=s.properties.flatMap(c=>iw(c.type));for(let c of a)(e=r.get(c))===null||e===void 0||e.containerTypes.add(s)}let n=new Set,i=t.filter(s=>s.subTypes.size===0),o=new Set(i);for(;i.length>0;){let s=i.shift();if(s)for(let a of s.superTypes)oi(a)&&(s.containerTypes.size===0?(n.add(a.name),a.containerTypes.clear()):n.has(a.name)||s.containerTypes.forEach(c=>a.containerTypes.add(c)),o.has(a)||(o.add(a),i.push(a)))}}var W1={languageId:"langium",fileExtensions:[".langium"],caseInsensitive:!1},H1={maxLookahead:3},Nw={AstReflection:()=>new Nu},Iw={Grammar:()=>uw(),LanguageMetaData:()=>W1,parser:{ParserConfig:()=>H1}};var Ju=class{constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}},Fa=class{constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1;for(let o of e){let s=this.caseInsensitive?o.name.toLowerCase():o.name;this.elements.set(s,o)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=xe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},Ow={getElement(){},getAllElements(){return va}};var vd=De(Yi(),1);var qa=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=vd.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=No,i=vd.CancellationToken.None){let o=[];this.exportNode(e,o,r);for(let s of n(e))await vt(i),this.exportNode(s,o,r);return o}exportNode(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=vd.CancellationToken.None){let n=e.parseResult.value,i=new Ve;for(let o of yt(n))await vt(r),this.processNode(o,e,i);return i}processNode(e,r,n){let i=e.$container;if(i){let o=this.nameProvider.getName(e);o&&n.add(i,this.descriptions.createDescription(e,o,r))}}};var Td=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},Nv=class extends Td{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){let n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Rd=class extends Td{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let o=n();return i.set(r,o),o}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}};var xd=class extends Nv{constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var ja=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new xd(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=Te(e.container).precomputedScopes;if(i){let s=e.container;do{let a=i.get(s);a.length>0&&r.push(xe(a).filter(c=>this.reflection.isSubtype(c.type,n))),s=s.$container}while(s)}let o=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)o=this.createScope(r[s],o);return o}createScope(e,r,n){return new Ju(xe(e),r,n)}createScopeForNodes(e,r,n){let i=xe(e).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new Ju(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Fa(this.indexManager.allElements(e)))}};var bd=class extends ja{constructor(e){super(e),this.langiumDocuments=e.shared.workspace.LangiumDocuments}getScope(e){let r=this.reflection.getReferenceType(e);return r===Es?this.getTypeScope(r,e):super.getScope(e)}getTypeScope(e,r){let n,i=Te(r.container).precomputedScopes,o=td(r.container);if(i&&o){let a=i.get(o);a.length>0&&(n=xe(a).filter(c=>c.type===Iu||c.type===Ou))}let s=this.getGlobalScope(e,r);return n?this.createScope(n,s):s}getGlobalScope(e,r){let n=Je(r.container,Ra);if(!n)return Ow;let i=new Set;this.gatherImports(n,i);let o=this.indexManager.allElements(e,i);return e===Es&&(o=o.filter(s=>s.type===Iu||s.type===Ou)),new Fa(o)}gatherImports(e,r){for(let n of e.imports){let i=Cv(n);if(i&&!r.has(i.toString())&&(r.add(i.toString()),this.langiumDocuments.hasDocument(i))){let s=this.langiumDocuments.getOrCreateDocument(i).parseResult.value;Ra(s)&&this.gatherImports(s,r)}}}},_d=class extends qa{constructor(e){super(e),this.astNodeLocator=e.workspace.AstNodeLocator}exportNode(e,r,n){var i;if(super.exportNode(e,r,n),Q(e)){if(!e.returnType&&!e.dataType){let o=(i=e.inferredType)!==null&&i!==void 0?i:e;r.push(this.createInterfaceDescription(o,o.name,n))}yt(e).forEach(o=>{if(Xe(o)&&o.inferredType){let s=Ma(o);s&&r.push(this.createInterfaceDescription(o,s,n))}})}}processNode(e,r,n){_a(e)||(this.processTypeNode(e,r,n),this.processActionNode(e,r,n),super.processNode(e,r,n))}processTypeNode(e,r,n){var i;let o=e.$container;if(o&&Q(e)&&!e.returnType&&!e.dataType){let s=(i=e.inferredType)!==null&&i!==void 0?i:e;n.add(o,this.createInterfaceDescription(s,s.name,r))}}processActionNode(e,r,n){let i=td(e);if(i&&Xe(e)&&e.inferredType){let o=Ma(e);o&&n.add(i,this.createInterfaceDescription(e,o,r))}}createInterfaceDescription(e,r,n=Te(e)){let i,o=()=>{var s;return i??(i=Nr((s=this.nameProvider.getNameNode(e))!==null&&s!==void 0?s:e.$cstNode))};return{node:e,name:r,get nameSegment(){return o()},selectionSegment:Nr(e.$cstNode),type:"Interface",documentUri:n.uri,path:this.astNodeLocator.getAstNodePath(e)}}};var Rn=De(ze(),1);var Or=De(ze(),1);var Sd=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=Or.CancellationToken.None){let i=e.parseResult,o=[];if(await vt(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,o,r),r.stopAfterLexingErrors&&o.some(s=>{var a;return((a=s.data)===null||a===void 0?void 0:a.code)===ai.LexingError})||(this.processParsingErrors(i,o,r),r.stopAfterParsingErrors&&o.some(s=>{var a;return((a=s.data)===null||a===void 0?void 0:a.code)===ai.ParsingError}))||(this.processLinkingErrors(e,o,r),r.stopAfterLinkingErrors&&o.some(s=>{var a;return((a=s.data)===null||a===void 0?void 0:a.code)===ai.LinkingError}))))return o;try{o.push(...await this.validateAst(i.value,r,n))}catch(s){if(Os(s))throw s;console.error("An error occurred during validation:",s)}return await vt(n),o}processLexingErrors(e,r,n){for(let i of e.lexerErrors){let o={severity:Or.DiagnosticSeverity.Error,range:{start:{line:i.line-1,character:i.column-1},end:{line:i.line-1,character:i.column+i.length-1}},message:i.message,data:vn(ai.LexingError),source:this.getSource()};r.push(o)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let o;if(isNaN(i.token.startOffset)){if("previousToken"in i){let s=i.previousToken;if(isNaN(s.startOffset))o=Or.Range.create(0,0,0,0);else{let a=Or.Position.create(s.endLine-1,s.endColumn);o=Or.Range.create(a,a)}}}else o=Du(i.token);if(o){let s={severity:Or.DiagnosticSeverity.Error,range:o,message:i.message,data:vn(ai.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(let i of e.references){let o=i.error;if(o){let s={node:o.container,property:o.property,index:o.index,data:{code:ai.LinkingError,containerType:o.container.$type,property:o.property,refText:o.reference.$refText}};r.push(this.toDiagnostic("error",o.message,s))}}}async validateAst(e,r,n=Or.CancellationToken.None){let i=[],o=(s,a,c)=>{i.push(this.toDiagnostic(s,a,c))};return await Promise.all(to(e).map(async s=>{await vt(n);let a=this.validationRegistry.getChecks(s.$type,r.categories);for(let c of a)await c(s,o,n)})),i}toDiagnostic(e,r,n){return{message:r,range:G1(n),severity:B1(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function G1(t){if(Or.Range.is(t.range))return t.range;let e;return typeof t.property=="string"?e=br(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=In(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function B1(t){switch(t){case"error":return Or.DiagnosticSeverity.Error;case"warning":return Or.DiagnosticSeverity.Warning;case"info":return Or.DiagnosticSeverity.Information;case"hint":return Or.DiagnosticSeverity.Hint;default:throw new Error("Invalid diagnostic severity: "+t)}}var ai;(function(t){t.LexingError="lexing-error",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(ai=ai||(ai={}));var kd=class{constructor(e){this.reflection=e.shared.AstReflection,this.indexManager=e.shared.workspace.IndexManager}getCodeActions(e,r){let n=[],i=o=>o&&n.push(o);for(let o of r.context.diagnostics)this.createCodeActions(o,e,i);return n}createCodeActions(e,r,n){var i;switch((i=e.data)===null||i===void 0?void 0:i.code){case He.GrammarNameUppercase:case He.RuleNameUppercase:n(this.makeUpperCase(e,r));break;case He.HiddenGrammarTokens:n(this.fixHiddenTerminals(e,r));break;case He.UseRegexTokens:n(this.fixRegexTokens(e,r));break;case He.EntryRuleTokenSyntax:n(this.addEntryKeyword(e,r));break;case He.CrossRefTokenSyntax:n(this.fixCrossRefSyntax(e,r));break;case He.UnnecessaryFileExtension:n(this.fixUnnecessaryFileExtension(e,r));break;case He.MissingReturns:n(this.fixMissingReturns(e,r));break;case He.InvalidInfers:case He.InvalidReturns:n(this.fixInvalidReturnsInfers(e,r));break;case He.MissingInfer:n(this.fixMissingInfer(e,r));break;case He.SuperfluousInfer:n(this.fixSuperfluousInfer(e,r));break;case ai.LinkingError:{let o=e.data;o&&o.containerType==="RuleCall"&&o.property==="rule"&&n(this.addNewRule(e,o,r)),o&&this.lookInGlobalScope(e,o,r).forEach(n);break}}}fixMissingReturns(e,r){let n=r.textDocument.getText(e.range);if(n)return{title:`Add explicit return type for parser rule ${n}`,kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:e.range,newText:`${n} returns ${n}`}]}}}}fixInvalidReturnsInfers(e,r){let n=e.data;if(n&&n.actionSegment){let i=r.textDocument.getText(n.actionSegment.range);return{title:`Correct ${i} usage`,kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:n.actionSegment.range,newText:i==="infers"?"returns":"infers"}]}}}}}fixMissingInfer(e,r){let n=e.data;if(n&&n.actionSegment)return{title:"Correct 'infer' usage",kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:{start:n.actionSegment.range.end,end:n.actionSegment.range.end},newText:"infer "}]}}}}fixSuperfluousInfer(e,r){let n=e.data;if(n&&n.actionRange)return{title:"Remove the 'infer' keyword",kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:n.actionRange,newText:""}]}}}}fixUnnecessaryFileExtension(e,r){let n=Object.assign({},e.range.end);n.character-=1;let i=Object.assign({},n);return i.character-=8,{title:"Remove file extension",kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:i,end:n},newText:""}]}}}}makeUpperCase(e,r){let n={start:e.range.start,end:{line:e.range.start.line,character:e.range.start.character+1}};return{title:"First letter to upper case",kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:n,newText:r.textDocument.getText(n).toUpperCase()}]}}}}addEntryKeyword(e,r){return{title:"Add entry keyword",kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:e.range.start,end:e.range.start},newText:"entry "}]}}}}fixRegexTokens(e,r){let n=r.textDocument.offsetAt(e.range.start),i=r.parseResult.value.$cstNode;if(i){let o=en(i,n),s=Je(o?.astNode,Zf);if(s&&s.right&&s.$cstNode){let a=s.left.value,c=s.right.value;return{title:"Refactor into regular expression",kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:s.$cstNode.range,newText:`/[${io(a)}-${io(c)}]/`}]}}}}}}fixCrossRefSyntax(e,r){return{title:"Replace '|' with ':'",kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:e.range,newText:":"}]}}}}fixHiddenTerminals(e,r){let n=r.parseResult.value,i=n.hiddenTokens,o=[],s=br(n.$cstNode,"definesHiddenTokens");if(s){let a=s.range.start,c=s.offset,u=n.$cstNode.text.indexOf(")",c)+1;o.push({newText:"",range:{start:a,end:r.textDocument.positionAt(u)}})}for(let a of i){let c=a.ref;if(c&&We(c)&&!c.hidden&&c.$cstNode){let u=c.$cstNode.range.start;o.push({newText:"hidden ",range:{start:u,end:u}})}}return{title:"Fix hidden terminals",kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:o}}}}addNewRule(e,r,n){let i=n.textDocument.offsetAt(e.range.start),o=n.parseResult.value.$cstNode;if(o){let s=en(o,i),a=Je(s?.astNode,Q);if(a&&a.$cstNode)return{title:`Add new rule '${r.refText}'`,kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!1,edit:{changes:{[n.textDocument.uri]:[{range:{start:a.$cstNode.range.end,end:a.$cstNode.range.end},newText:`
79
81
 
80
82
  `+r.refText+`:
81
- /* TODO implement rule */ {infer `+r.refText+"};"}]}}}}}lookInGlobalScope(e,r,n){var i,o;let s={container:{$type:r.containerType},property:r.property,reference:{$refText:r.refText}},a=this.reflection.getReferenceType(s),c=this.indexManager.allElements(a).filter(T=>T.name===r.refText),f=[],p=-1,m=-1;for(let T of c){if(qe.equals(T.documentUri,n.uri))continue;let k=UM(n.uri,T.documentUri),A,N="",O=n.parseResult.value,P=O.imports.find(y=>y.path&&k<y.path);if(P)A=(i=P.$cstNode)===null||i===void 0?void 0:i.range.start;else if(O.imports.length>0){let y=O.imports[O.imports.length-1].$cstNode.range.end;y&&(A={line:y.line+1,character:0})}else O.rules.length>0&&(A=(o=O.rules[0].$cstNode)===null||o===void 0?void 0:o.range.start,N=`
82
- `);A&&((p<0||k.length<m)&&(p=f.length,m=k.length),f.push({title:`Add import to '${k}'`,kind:wn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!1,edit:{changes:{[n.textDocument.uri]:[{range:{start:A,end:A},newText:`import '${k}'
83
- ${N}`}]}}}))}return p>=0&&(f[p].isPreferred=!0),f}};function UM(t,e){let r=qe.dirname(t),n=qe.relative(r,e);return!n.startsWith("./")&&!n.startsWith("../")&&(n="./"+n),n.endsWith(".langium")&&(n=n.substring(0,n.length-8)),n}var GS=Ie(xs(),1);var Wa=Ie(Xe(),1);function Vy(t,e){let r={stacks:t,tokens:e};return WM(r),r.stacks.flat().forEach(i=>{i.property=void 0}),WS(r.stacks).map(i=>i[i.length-1])}function Xy(t){let{next:e,cardinalities:r,visited:n,plus:i}=t,o=[],s=e.feature;if(n.has(s))return[];n.add(s);let a,c=s;for(;c.$container;)if(gr(c.$container)){a=c.$container;break}else if(va(c.$container))c=c.$container;else break;if(kS(c.cardinality)){let f=ja({next:{feature:c,type:e.type,new:!1},cardinalities:r,visited:n,plus:i});for(let p of f)i.add(p.feature);o.push(...f)}if(a){let f=a.elements.indexOf(c);f!==void 0&&f<a.elements.length-1&&o.push(...US({feature:a,type:e.type,new:!1},f+1,r,n,i)),o.every(p=>jn(p.feature.cardinality,p.feature)||jn(r.get(p.feature))||i.has(p.feature))&&o.push(...Xy({next:{feature:a,type:e.type,new:!1},cardinalities:r,visited:n,plus:i}))}return o}function Fu(t){return Zt(t)&&(t={feature:t}),ja({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function ja(t){var e,r,n;let{next:i,cardinalities:o,visited:s,plus:a}=t;if(i===void 0)return[];let{feature:c,type:f}=i;if(gr(c)){if(s.has(c))return[];s.add(c)}if(gr(c))return US(i,0,o,s,a).map(p=>pd(p,c.cardinality,o));if(xn(c)||bn(c))return c.elements.flatMap(p=>ja({next:{feature:p,new:!1,type:f},cardinalities:o,visited:s,plus:a})).map(p=>pd(p,c.cardinality,o));if(je(c)){let p={feature:c.terminal,new:!1,type:f,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return ja({next:p,cardinalities:o,visited:s,plus:a}).map(m=>pd(m,c.cardinality,o))}else{if(Je(c))return Xy({next:{feature:c,new:!0,type:ci(c),property:(r=i.property)!==null&&r!==void 0?r:c.feature},cardinalities:o,visited:s,plus:a});if(Qe(c)&&Z(c.rule.ref)){let p=c.rule.ref,m={feature:p.definition,new:!0,type:p.fragment?void 0:(n=Oa(p))!==null&&n!==void 0?n:p.name,property:i.property};return ja({next:m,cardinalities:o,visited:s,plus:a}).map(T=>pd(T,c.cardinality,o))}else return[i]}}function pd(t,e,r){return r.set(t.feature,e),t}function US(t,e,r,n,i){var o;let s=[],a;for(;e<t.feature.elements.length&&(a={feature:t.feature.elements[e++],new:!1,type:t.type},s.push(...ja({next:a,cardinalities:r,visited:n,plus:i})),!!jn((o=a.feature.cardinality)!==null&&o!==void 0?o:r.get(a.feature),a.feature)););return s}function WM(t){for(let e of t.tokens){let r=WS(t.stacks,e);t.stacks=r}}function WS(t,e){let r=[];for(let n of t)r.push(...HM(n,e));return r}function HM(t,e){let r=new Map,n=new Set(t.map(o=>o.feature).filter(GM)),i=[];for(;t.length>0;){let o=t.pop(),s=Xy({next:o,cardinalities:r,plus:n,visited:new Set}).filter(a=>e?Yy(a.feature,e):!0);for(let a of s)i.push([...t,a]);if(!s.every(a=>jn(a.feature.cardinality,a.feature)||jn(r.get(a.feature))))break}return i}function GM(t){if(t.cardinality==="+")return!0;let e=Ze(t,je);return!!(e&&e.cardinality==="+")}function Yy(t,e){if(jt(t))return t.value===e.image;if(Qe(t))return BM(t.rule.ref,e);if(kr(t)){let r=md(t);if(r)return Yy(r,e)}return!1}function BM(t,e){return Z(t)?Fu(t.definition).some(n=>Yy(n.feature,e)):He(t)?Un(t).test(e.image):!1}function HS(t){let e=Array.from(new Set(t.flatMap(n=>{var i;return(i=n?.triggerCharacters)!==null&&i!==void 0?i:[]}))),r=Array.from(new Set(t.flatMap(n=>{var i;return(i=n?.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:r.length>0?r:void 0}}var Ua=class{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig}async getCompletion(e,r){let n=[],i=this.buildContexts(e,r.position),o=(c,f)=>{let p=this.fillCompletionItem(c,f);p&&n.push(p)},s=c=>jt(c.feature)?c.feature.value:c.feature,a=[];for(let c of i)if(await Promise.all(ke(c.features).distinct(s).exclude(a).map(f=>this.completionFor(c,f,o))),a.push(...c.features),!this.continueCompletion(n))break;return Wa.CompletionList.create(this.deduplicateItems(n),!0)}deduplicateItems(e){return ke(e).distinct(r=>`${r.kind}_${r.label}_${r.detail}`).toArray()}findFeaturesAt(e,r){let n=e.getText({start:Wa.Position.create(0,0),end:e.positionAt(r)}),i=this.completionParser.parse(n),o=i.tokens;if(i.tokenIndex===0){let c=hd(this.grammar),f=Fu({feature:c.definition,new:!0,type:Oa(c)});return o.length>0?(o.shift(),Vy(f.map(p=>[p]),o)):f}let s=[...o].splice(i.tokenIndex);return Vy([i.elementStack.map(c=>({feature:c}))],s)}*buildContexts(e,r){var n,i,o,s,a;let c=e.parseResult.value.$cstNode;if(!c)return;let f=e.textDocument,p=f.getText(),m=f.offsetAt(r),T={document:e,textDocument:f,offset:m,position:r},k=this.findDataTypeRuleStart(c,m);if(k){let[h,C]=k,M=(n=un(c,h))===null||n===void 0?void 0:n.astNode,z=this.findFeaturesAt(f,h);yield Object.assign(Object.assign({},T),{node:M,tokenOffset:h,tokenEndOffset:C,features:z})}let{nextTokenStart:A,nextTokenEnd:N,previousTokenStart:O,previousTokenEnd:P}=this.backtrackToAnyToken(p,m),y;if(O!==void 0&&P!==void 0&&P===m){y=(i=un(c,O))===null||i===void 0?void 0:i.astNode;let h=this.findFeaturesAt(f,O);yield Object.assign(Object.assign({},T),{node:y,tokenOffset:O,tokenEndOffset:P,features:h})}if(y=(s=(o=un(c,A))===null||o===void 0?void 0:o.astNode)!==null&&s!==void 0?s:O===void 0||(a=un(c,O))===null||a===void 0?void 0:a.astNode,y){let h=this.findFeaturesAt(f,A);yield Object.assign(Object.assign({},T),{node:y,tokenOffset:A,tokenEndOffset:N,features:h})}else{let h=hd(this.grammar),C=Fu(h.definition);yield Object.assign(Object.assign({},T),{tokenOffset:A,tokenEndOffset:N,features:C})}}findDataTypeRuleStart(e,r){var n,i;let o=ur(e,r,this.grammarConfig.nameRegexp),s=!!(!((n=Ze(o?.grammarSource,Z))===null||n===void 0)&&n.dataType);if(s){for(;s;)o=o?.container,s=!!(!((i=Ze(o?.grammarSource,Z))===null||i===void 0)&&i.dataType);if(o)return[o.offset,o.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,r){let n=this.lexer.tokenize(e).tokens;if(n.length===0)return{nextTokenStart:r,nextTokenEnd:r};let i;for(let o of n){if(o.startOffset>=r)return{nextTokenStart:r,nextTokenEnd:r,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(o.endOffset>=r)return{nextTokenStart:o.startOffset,nextTokenEnd:o.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=o}return{nextTokenStart:r,nextTokenEnd:r,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}async completionForRule(e,r,n){if(Z(r)){let i=Fu(r.definition);await Promise.all(i.map(o=>this.completionFor(e,o,n)))}}completionFor(e,r,n){if(jt(r.feature))return this.completionForKeyword(e,r.feature,n);if(kr(r.feature)&&e.node)return this.completionForCrossReference(e,r,n)}completionForCrossReference(e,r,n){let i=Ze(r.feature,je),o=e.node;if(i&&o){if(r.type&&(r.new||o.$type!==r.type)&&(o={$type:r.type,$container:o,$containerProperty:r.property}),!e)return;let s={reference:{},container:o,property:i.feature};try{let a=this.scopeProvider.getScope(s),c=new Set;a.getAllElements().forEach(f=>{!c.has(f.name)&&this.filterCrossReference(f)&&(n(e,this.createReferenceCompletionItem(f)),c.add(f.name))})}catch(a){console.error(a)}}}createReferenceCompletionItem(e){return{nodeDescription:e,kind:this.nodeKindProvider.getCompletionItemKind(e),detail:e.type,sortText:"0"}}filterCrossReference(e){return!0}completionForKeyword(e,r,n){r.value.match(/[\w]/)&&n(e,{label:r.value,kind:Wa.CompletionItemKind.Keyword,detail:"Keyword",sortText:"1"})}fillCompletionItem(e,r){var n,i;let o;if(typeof r.label=="string")o=r.label;else if("node"in r){let f=this.nameProvider.getName(r.node);if(!f)return;o=f}else if("nodeDescription"in r)o=r.nodeDescription.name;else return;let s;typeof((n=r.textEdit)===null||n===void 0?void 0:n.newText)=="string"?s=r.textEdit.newText:typeof r.insertText=="string"?s=r.insertText:s=o;let a=(i=r.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(e,o,s);return a?{additionalTextEdits:r.additionalTextEdits,command:r.command,commitCharacters:r.commitCharacters,data:r.data,detail:r.detail,documentation:r.documentation,filterText:r.filterText,insertText:r.insertText,insertTextFormat:r.insertTextFormat,insertTextMode:r.insertTextMode,kind:r.kind,labelDetails:r.labelDetails,preselect:r.preselect,sortText:r.sortText,tags:r.tags,textEditText:r.textEditText,textEdit:a,label:o}:void 0}buildCompletionTextEdit(e,r,n){let o=e.textDocument.getText().substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(o,r)){let s=e.textDocument.positionAt(e.tokenOffset),a=e.position;return{newText:n,range:{start:s,end:a}}}else return}};var gd=class extends Ua{constructor(e){super(e),this.documents=()=>e.shared.workspace.LangiumDocuments}completionFor(e,r,n){let i=Ze(r.feature,je);if(i?.feature==="path")this.completeImportPath(e,n);else return super.completionFor(e,r,n)}completeImportPath(e,r){let i=e.textDocument.getText().substring(e.tokenOffset,e.offset),o=this.getAllFiles(e.document),s={start:e.position,end:e.position};if(i.length>0){let a=i.substring(1);o=o.filter(p=>p.startsWith(a));let c=e.textDocument.positionAt(e.tokenOffset+1),f=e.textDocument.positionAt(e.tokenEndOffset-1);s={start:c,end:f}}for(let a of o){let c=i.length>0?"":'"',f=`${c}${a}${c}`;r(e,{label:a,textEdit:{newText:f,range:s},kind:GS.CompletionItemKind.File,sortText:"0"})}}getAllFiles(e){let r=this.documents().all,n=e.uri.toString(),i=qe.dirname(e.uri).toString(),o=[];for(let s of r)if(!qe.equals(s.uri,n)){let a=s.uri.toString(),c=a.substring(0,a.length-qe.extname(s.uri).length),f=qe.relative(i,c);f.startsWith(".")||(f=`./${f}`),o.push(f)}return o}};var ju=Ie(Xe(),1);var Ha=class{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e){let r=[],n=i=>r.push(i);return this.collectFolding(e,n),r}collectFolding(e,r){var n;let i=(n=e.parseResult)===null||n===void 0?void 0:n.value;if(i){if(this.shouldProcessContent(i)){let o=bt(i).iterator(),s;do if(s=o.next(),!s.done){let a=s.value;this.shouldProcess(a)&&this.collectObjectFolding(e,a,r),this.shouldProcessContent(a)||o.prune()}while(!s.done)}this.collectCommentFolding(e,i,r)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,r,n){let i=r.$cstNode;if(i){let o=this.toFoldingRange(e,i);o&&n(o)}}collectCommentFolding(e,r,n){let i=r.$cstNode;if(i){for(let o of Yb(i))if(this.commentNames.includes(o.tokenType.name)){let s=this.toFoldingRange(e,o,ju.FoldingRangeKind.Comment);s&&n(s)}}}toFoldingRange(e,r,n){let i=r.range,o=i.start,s=i.end;if(!(s.line-o.line<2))return this.includeLastFoldingLine(r,n)||(s=e.textDocument.positionAt(e.textDocument.offsetAt({line:s.line,character:0})-1)),ju.FoldingRange.create(o.line,s.line,o.character,s.character,n)}includeLastFoldingLine(e,r){if(r===ju.FoldingRangeKind.Comment)return!1;let n=e.text,i=n.charAt(n.length-1);return!(i==="}"||i===")"||i==="]")}};var yd=class extends Ha{shouldProcessContent(e){return!Z(e)}};var vd=class{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new Jy(e,this.collector)}formatDocument(e,r){let n=e.parseResult;return n.lexerErrors.length===0&&n.parserErrors.length===0?this.doDocumentFormat(e,r.options):[]}isFormatRangeErrorFree(e,r){let n=e.parseResult;return n.lexerErrors.length||n.parserErrors.length?Math.min(...n.lexerErrors.map(o=>{var s;return(s=o.line)!==null&&s!==void 0?s:Number.MAX_VALUE}),...n.parserErrors.map(o=>{var s;return(s=o.token.startLine)!==null&&s!==void 0?s:Number.MAX_VALUE}))>r.end.line:!0}formatDocumentRange(e,r){return this.isFormatRangeErrorFree(e,r.range)?this.doDocumentFormat(e,r.options,r.range):[]}formatDocumentOnType(e,r){let n={start:{character:0,line:r.position.line},end:r.position};return this.isFormatRangeErrorFree(e,n)?this.doDocumentFormat(e,r.options,n):[]}get formatOnTypeOptions(){}doDocumentFormat(e,r,n){let i=new Map,o=(a,c,f)=>{var p,m;let T=this.nodeModeToKey(a,c),k=i.get(T),A=(p=f.options.priority)!==null&&p!==void 0?p:0,N=(m=k?.options.priority)!==null&&m!==void 0?m:0;(!k||N<=A)&&i.set(T,f)};this.collector=o,this.iterateAstFormatting(e,n);let s=this.iterateCstFormatting(e,i,r,n);return this.avoidOverlappingEdits(e.textDocument,s)}avoidOverlappingEdits(e,r){let n=[];for(let i of r){let o=n[n.length-1];if(o){let s=e.offsetAt(i.range.start),a=e.offsetAt(o.range.end);s<a&&n.pop()}n.push(i)}return n}iterateAstFormatting(e,r){let n=e.parseResult.value;this.format(n);let i=bt(n).iterator(),o;do if(o=i.next(),!o.done){let s=o.value;this.insideRange(s.$cstNode.range,r)?this.format(s):i.prune()}while(!o.done)}nodeModeToKey(e,r){return`${e.offset}:${e.end}:${r}`}insideRange(e,r){return!r||e.start.line<=r.start.line&&e.end.line>=r.end.line||e.start.line>=r.start.line&&e.end.line<=r.end.line||e.start.line<=r.end.line&&e.end.line>=r.end.line}isNecessary(e,r){return r.getText(e.range)!==e.newText}iterateCstFormatting(e,r,n,i){let o={indentation:0,options:n,document:e.textDocument},s=[],c=this.iterateCstTree(e,o).iterator(),f,p;do if(p=c.next(),!p.done){let m=p.value,T=Cs(m),k=this.nodeModeToKey(m,"prepend"),A=r.get(k);if(r.delete(k),A){let P=this.createTextEdit(f,m,A,o);for(let y of P)y&&this.insideRange(y.range,i)&&this.isNecessary(y,e.textDocument)&&s.push(y)}let N=this.nodeModeToKey(m,"append"),O=r.get(N);if(r.delete(N),O){let P=Zb(m);if(P){let y=this.createTextEdit(m,P,O,o);for(let h of y)h&&this.insideRange(h.range,i)&&this.isNecessary(h,e.textDocument)&&s.push(h)}}if(!A&&m.hidden){let P=this.createHiddenTextEdits(f,m,void 0,o);for(let y of P)y&&this.insideRange(y.range,i)&&this.isNecessary(y,e.textDocument)&&s.push(y)}T&&(f=m)}while(!p.done);return s}createHiddenTextEdits(e,r,n,i){var o;let s=r.range.start.line;if(e&&e.range.end.line===s)return[];let a=[],c={start:{character:0,line:s},end:r.range.start},f=i.document.getText(c),p=this.findFittingMove(c,(o=n?.moves)!==null&&o!==void 0?o:[],i),m=this.getExistingIndentationCharacterCount(f,i),k=this.getIndentationCharacterCount(i,p)-m;if(k===0)return[];let A="";k>0&&(A=(i.options.insertSpaces?" ":" ").repeat(k));let N=r.text.split(`
84
- `);N[0]=f+N[0];for(let O=0;O<N.length;O++){let P=s+O,y={character:0,line:P};if(k>0)a.push({newText:A,range:{start:y,end:y}});else{let h=N[O],C=0;for(;C<h.length;C++){let M=h.charAt(C);if(M!==" "&&M!==" ")break}a.push({newText:"",range:{start:y,end:{line:P,character:Math.min(C,Math.abs(k))}}})}}return a}getExistingIndentationCharacterCount(e,r){let n=" ".repeat(r.options.tabSize);return(r.options.insertSpaces?e.replaceAll(" ",n):e.replaceAll(n," ")).length}getIndentationCharacterCount(e,r){let n=e.indentation;return r&&r.tabs&&(n+=r.tabs),(e.options.insertSpaces?e.options.tabSize:1)*n}createTextEdit(e,r,n,i){var o;if(r.hidden)return this.createHiddenTextEdits(e,r,n,i);let s={start:(o=e?.range.end)!==null&&o!==void 0?o:{character:0,line:0},end:r.range.start},a=this.findFittingMove(s,n.moves,i);if(!a)return[];let c=a.characters,f=a.lines,p=a.tabs,m=i.indentation;i.indentation+=p??0;let T=[];return c!==void 0?T.push(this.createSpaceTextEdit(s,c,n.options)):f!==void 0?T.push(this.createLineTextEdit(s,f,i,n.options)):p!==void 0&&T.push(this.createTabTextEdit(s,!!e,i)),Cs(r)&&(i.indentation=m),T}createSpaceTextEdit(e,r,n){if(e.start.line===e.end.line){let o=e.end.character-e.start.character;r=this.fitIntoOptions(r,o,n)}return{newText:" ".repeat(r),range:e}}createLineTextEdit(e,r,n,i){let o=e.end.line-e.start.line;r=this.fitIntoOptions(r,o,i);let a=(n.options.insertSpaces?" ".repeat(n.options.tabSize):" ").repeat(n.indentation);return{newText:`${`
83
+ /* TODO implement rule */ {infer `+r.refText+"};"}]}}}}}lookInGlobalScope(e,r,n){var i,o;let s={container:{$type:r.containerType},property:r.property,reference:{$refText:r.refText}},a=this.reflection.getReferenceType(s),c=this.indexManager.allElements(a).filter(g=>g.name===r.refText),u=[],l=-1,f=-1;for(let g of c){if(Le.equals(g.documentUri,n.uri))continue;let T=K1(n.uri,g.documentUri),C,P="",O=n.parseResult.value,E=O.imports.find(m=>m.path&&T<m.path);if(E)C=(i=E.$cstNode)===null||i===void 0?void 0:i.range.start;else if(O.imports.length>0){let m=O.imports[O.imports.length-1].$cstNode.range.end;m&&(C={line:m.line+1,character:0})}else O.rules.length>0&&(C=(o=O.rules[0].$cstNode)===null||o===void 0?void 0:o.range.start,P=`
84
+ `);C&&((l<0||T.length<f)&&(l=u.length,f=T.length),u.push({title:`Add import to '${T}'`,kind:Rn.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!1,edit:{changes:{[n.textDocument.uri]:[{range:{start:C,end:C},newText:`import '${T}'
85
+ ${P}`}]}}}))}return l>=0&&(u[l].isPreferred=!0),u}};function K1(t,e){let r=Le.dirname(t),n=Le.relative(r,e);return!n.startsWith("./")&&!n.startsWith("../")&&(n="./"+n),n.endsWith(".langium")&&(n=n.substring(0,n.length-8)),n}var Fw=De(xs(),1);var Ha=De(ze(),1);function Iv(t,e){let r={stacks:t,tokens:e};return z1(r),r.stacks.flat().forEach(i=>{i.property=void 0}),Mw(r.stacks).map(i=>i[i.length-1])}function Ov(t){let{next:e,cardinalities:r,visited:n,plus:i}=t,o=[],s=e.feature;if(n.has(s))return[];n.add(s);let a,c=s;for(;c.$container;)if(fr(c.$container)){a=c.$container;break}else if(Ta(c.$container))c=c.$container;else break;if(Tw(c.cardinality)){let u=Ua({next:{feature:c,type:e.type,new:!1},cardinalities:r,visited:n,plus:i});for(let l of u)i.add(l.feature);o.push(...u)}if(a){let u=a.elements.indexOf(c);u!==void 0&&u<a.elements.length-1&&o.push(...Lw({feature:a,type:e.type,new:!1},u+1,r,n,i)),o.every(l=>On(l.feature.cardinality,l.feature)||On(r.get(l.feature))||i.has(l.feature))&&o.push(...Ov({next:{feature:a,type:e.type,new:!1},cardinalities:r,visited:n,plus:i}))}return o}function Qu(t){return Yt(t)&&(t={feature:t}),Ua({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function Ua(t){var e,r,n;let{next:i,cardinalities:o,visited:s,plus:a}=t;if(i===void 0)return[];let{feature:c,type:u}=i;if(fr(c)){if(s.has(c))return[];s.add(c)}if(fr(c))return Lw(i,0,o,s,a).map(l=>wd(l,c.cardinality,o));if(mn(c)||hn(c))return c.elements.flatMap(l=>Ua({next:{feature:l,new:!1,type:u},cardinalities:o,visited:s,plus:a})).map(l=>wd(l,c.cardinality,o));if(Fe(c)){let l={feature:c.terminal,new:!1,type:u,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return Ua({next:l,cardinalities:o,visited:s,plus:a}).map(f=>wd(f,c.cardinality,o))}else{if(Xe(c))return Ov({next:{feature:c,new:!0,type:si(c),property:(r=i.property)!==null&&r!==void 0?r:c.feature},cardinalities:o,visited:s,plus:a});if(Ye(c)&&Q(c.rule.ref)){let l=c.rule.ref,f={feature:l.definition,new:!0,type:l.fragment?void 0:(n=La(l))!==null&&n!==void 0?n:l.name,property:i.property};return Ua({next:f,cardinalities:o,visited:s,plus:a}).map(g=>wd(g,c.cardinality,o))}else return[i]}}function wd(t,e,r){return r.set(t.feature,e),t}function Lw(t,e,r,n,i){var o;let s=[],a;for(;e<t.feature.elements.length&&(a={feature:t.feature.elements[e++],new:!1,type:t.type},s.push(...Ua({next:a,cardinalities:r,visited:n,plus:i})),!!On((o=a.feature.cardinality)!==null&&o!==void 0?o:r.get(a.feature),a.feature)););return s}function z1(t){for(let e of t.tokens){let r=Mw(t.stacks,e);t.stacks=r}}function Mw(t,e){let r=[];for(let n of t)r.push(...V1(n,e));return r}function V1(t,e){let r=new Map,n=new Set(t.map(o=>o.feature).filter(X1)),i=[];for(;t.length>0;){let o=t.pop(),s=Ov({next:o,cardinalities:r,plus:n,visited:new Set}).filter(a=>e?Lv(a.feature,e):!0);for(let a of s)i.push([...t,a]);if(!s.every(a=>On(a.feature.cardinality,a.feature)||On(r.get(a.feature))))break}return i}function X1(t){if(t.cardinality==="+")return!0;let e=Je(t,Fe);return!!(e&&e.cardinality==="+")}function Lv(t,e){if(Ot(t))return t.value===e.image;if(Ye(t))return Y1(t.rule.ref,e);if(Rr(t)){let r=Cd(t);if(r)return Lv(r,e)}return!1}function Y1(t,e){return Q(t)?Qu(t.definition).some(n=>Lv(n.feature,e)):We(t)?Ln(t).test(e.image):!1}function $w(t){let e=Array.from(new Set(t.flatMap(n=>{var i;return(i=n?.triggerCharacters)!==null&&i!==void 0?i:[]}))),r=Array.from(new Set(t.flatMap(n=>{var i;return(i=n?.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:r.length>0?r:void 0}}var Wa=class{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig}async getCompletion(e,r){let n=[],i=this.buildContexts(e,r.position),o=(c,u)=>{let l=this.fillCompletionItem(c,u);l&&n.push(l)},s=c=>Ot(c.feature)?c.feature.value:c.feature,a=[];for(let c of i)if(await Promise.all(xe(c.features).distinct(s).exclude(a).map(u=>this.completionFor(c,u,o))),a.push(...c.features),!this.continueCompletion(n))break;return Ha.CompletionList.create(this.deduplicateItems(n),!0)}deduplicateItems(e){return xe(e).distinct(r=>`${r.kind}_${r.label}_${r.detail}`).toArray()}findFeaturesAt(e,r){let n=e.getText({start:Ha.Position.create(0,0),end:e.positionAt(r)}),i=this.completionParser.parse(n),o=i.tokens;if(i.tokenIndex===0){let c=Ed(this.grammar),u=Qu({feature:c.definition,new:!0,type:La(c)});return o.length>0?(o.shift(),Iv(u.map(l=>[l]),o)):u}let s=[...o].splice(i.tokenIndex);return Iv([i.elementStack.map(c=>({feature:c}))],s)}*buildContexts(e,r){var n,i,o,s,a;let c=e.parseResult.value.$cstNode;if(!c)return;let u=e.textDocument,l=u.getText(),f=u.offsetAt(r),g={document:e,textDocument:u,offset:f,position:r},T=this.findDataTypeRuleStart(c,f);if(T){let[d,_]=T,$=(n=en(c,d))===null||n===void 0?void 0:n.astNode,X=this.findFeaturesAt(u,d);yield Object.assign(Object.assign({},g),{node:$,tokenOffset:d,tokenEndOffset:_,features:X})}let{nextTokenStart:C,nextTokenEnd:P,previousTokenStart:O,previousTokenEnd:E}=this.backtrackToAnyToken(l,f),m;if(O!==void 0&&E!==void 0&&E===f){m=(i=en(c,O))===null||i===void 0?void 0:i.astNode;let d=this.findFeaturesAt(u,O);yield Object.assign(Object.assign({},g),{node:m,tokenOffset:O,tokenEndOffset:E,features:d})}if(m=(s=(o=en(c,C))===null||o===void 0?void 0:o.astNode)!==null&&s!==void 0?s:O===void 0||(a=en(c,O))===null||a===void 0?void 0:a.astNode,m){let d=this.findFeaturesAt(u,C);yield Object.assign(Object.assign({},g),{node:m,tokenOffset:C,tokenEndOffset:P,features:d})}else{let d=Ed(this.grammar),_=Qu(d.definition);yield Object.assign(Object.assign({},g),{tokenOffset:C,tokenEndOffset:P,features:_})}}findDataTypeRuleStart(e,r){var n,i;let o=ir(e,r,this.grammarConfig.nameRegexp),s=!!(!((n=Je(o?.grammarSource,Q))===null||n===void 0)&&n.dataType);if(s){for(;s;)o=o?.container,s=!!(!((i=Je(o?.grammarSource,Q))===null||i===void 0)&&i.dataType);if(o)return[o.offset,o.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,r){let n=this.lexer.tokenize(e).tokens;if(n.length===0)return{nextTokenStart:r,nextTokenEnd:r};let i;for(let o of n){if(o.startOffset>=r)return{nextTokenStart:r,nextTokenEnd:r,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(o.endOffset>=r)return{nextTokenStart:o.startOffset,nextTokenEnd:o.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=o}return{nextTokenStart:r,nextTokenEnd:r,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}async completionForRule(e,r,n){if(Q(r)){let i=Qu(r.definition);await Promise.all(i.map(o=>this.completionFor(e,o,n)))}}completionFor(e,r,n){if(Ot(r.feature))return this.completionForKeyword(e,r.feature,n);if(Rr(r.feature)&&e.node)return this.completionForCrossReference(e,r,n)}completionForCrossReference(e,r,n){let i=Je(r.feature,Fe),o=e.node;if(i&&o){if(r.type&&(r.new||o.$type!==r.type)&&(o={$type:r.type,$container:o,$containerProperty:r.property}),!e)return;let s={reference:{},container:o,property:i.feature};try{let a=this.scopeProvider.getScope(s),c=new Set;a.getAllElements().forEach(u=>{!c.has(u.name)&&this.filterCrossReference(u)&&(n(e,this.createReferenceCompletionItem(u)),c.add(u.name))})}catch(a){console.error(a)}}}createReferenceCompletionItem(e){return{nodeDescription:e,kind:this.nodeKindProvider.getCompletionItemKind(e),detail:e.type,sortText:"0"}}filterCrossReference(e){return!0}completionForKeyword(e,r,n){r.value.match(/[\w]/)&&n(e,{label:r.value,kind:Ha.CompletionItemKind.Keyword,detail:"Keyword",sortText:"1"})}fillCompletionItem(e,r){var n,i;let o;if(typeof r.label=="string")o=r.label;else if("node"in r){let u=this.nameProvider.getName(r.node);if(!u)return;o=u}else if("nodeDescription"in r)o=r.nodeDescription.name;else return;let s;typeof((n=r.textEdit)===null||n===void 0?void 0:n.newText)=="string"?s=r.textEdit.newText:typeof r.insertText=="string"?s=r.insertText:s=o;let a=(i=r.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(e,o,s);return a?{additionalTextEdits:r.additionalTextEdits,command:r.command,commitCharacters:r.commitCharacters,data:r.data,detail:r.detail,documentation:r.documentation,filterText:r.filterText,insertText:r.insertText,insertTextFormat:r.insertTextFormat,insertTextMode:r.insertTextMode,kind:r.kind,labelDetails:r.labelDetails,preselect:r.preselect,sortText:r.sortText,tags:r.tags,textEditText:r.textEditText,textEdit:a,label:o}:void 0}buildCompletionTextEdit(e,r,n){let o=e.textDocument.getText().substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(o,r)){let s=e.textDocument.positionAt(e.tokenOffset),a=e.position;return{newText:n,range:{start:s,end:a}}}else return}};var Pd=class extends Wa{constructor(e){super(e),this.documents=()=>e.shared.workspace.LangiumDocuments}completionFor(e,r,n){let i=Je(r.feature,Fe);if(i?.feature==="path")this.completeImportPath(e,n);else return super.completionFor(e,r,n)}completeImportPath(e,r){let i=e.textDocument.getText().substring(e.tokenOffset,e.offset),o=this.getAllFiles(e.document),s={start:e.position,end:e.position};if(i.length>0){let a=i.substring(1);o=o.filter(l=>l.startsWith(a));let c=e.textDocument.positionAt(e.tokenOffset+1),u=e.textDocument.positionAt(e.tokenEndOffset-1);s={start:c,end:u}}for(let a of o){let c=i.length>0?"":'"',u=`${c}${a}${c}`;r(e,{label:a,textEdit:{newText:u,range:s},kind:Fw.CompletionItemKind.File,sortText:"0"})}}getAllFiles(e){let r=this.documents().all,n=e.uri.toString(),i=Le.dirname(e.uri).toString(),o=[];for(let s of r)if(!Le.equals(s.uri,n)){let a=s.uri.toString(),c=a.substring(0,a.length-Le.extname(s.uri).length),u=Le.relative(i,c);u.startsWith(".")||(u=`./${u}`),o.push(u)}return o}};var Zu=De(ze(),1);var Ga=class{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e){let r=[],n=i=>r.push(i);return this.collectFolding(e,n),r}collectFolding(e,r){var n;let i=(n=e.parseResult)===null||n===void 0?void 0:n.value;if(i){if(this.shouldProcessContent(i)){let o=yt(i).iterator(),s;do if(s=o.next(),!s.done){let a=s.value;this.shouldProcess(a)&&this.collectObjectFolding(e,a,r),this.shouldProcessContent(a)||o.prune()}while(!s.done)}this.collectCommentFolding(e,i,r)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,r,n){let i=r.$cstNode;if(i){let o=this.toFoldingRange(e,i);o&&n(o)}}collectCommentFolding(e,r,n){let i=r.$cstNode;if(i){for(let o of GS(i))if(this.commentNames.includes(o.tokenType.name)){let s=this.toFoldingRange(e,o,Zu.FoldingRangeKind.Comment);s&&n(s)}}}toFoldingRange(e,r,n){let i=r.range,o=i.start,s=i.end;if(!(s.line-o.line<2))return this.includeLastFoldingLine(r,n)||(s=e.textDocument.positionAt(e.textDocument.offsetAt({line:s.line,character:0})-1)),Zu.FoldingRange.create(o.line,s.line,o.character,s.character,n)}includeLastFoldingLine(e,r){if(r===Zu.FoldingRangeKind.Comment)return!1;let n=e.text,i=n.charAt(n.length-1);return!(i==="}"||i===")"||i==="]")}};var Ad=class extends Ga{shouldProcessContent(e){return!Q(e)}};var Dd=class{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new Mv(e,this.collector)}formatDocument(e,r){let n=e.parseResult;return n.lexerErrors.length===0&&n.parserErrors.length===0?this.doDocumentFormat(e,r.options):[]}isFormatRangeErrorFree(e,r){let n=e.parseResult;return n.lexerErrors.length||n.parserErrors.length?Math.min(...n.lexerErrors.map(o=>{var s;return(s=o.line)!==null&&s!==void 0?s:Number.MAX_VALUE}),...n.parserErrors.map(o=>{var s;return(s=o.token.startLine)!==null&&s!==void 0?s:Number.MAX_VALUE}))>r.end.line:!0}formatDocumentRange(e,r){return this.isFormatRangeErrorFree(e,r.range)?this.doDocumentFormat(e,r.options,r.range):[]}formatDocumentOnType(e,r){let n={start:{character:0,line:r.position.line},end:r.position};return this.isFormatRangeErrorFree(e,n)?this.doDocumentFormat(e,r.options,n):[]}get formatOnTypeOptions(){}doDocumentFormat(e,r,n){let i=new Map,o=(a,c,u)=>{var l,f;let g=this.nodeModeToKey(a,c),T=i.get(g),C=(l=u.options.priority)!==null&&l!==void 0?l:0,P=(f=T?.options.priority)!==null&&f!==void 0?f:0;(!T||P<=C)&&i.set(g,u)};this.collector=o,this.iterateAstFormatting(e,n);let s=this.iterateCstFormatting(e,i,r,n);return this.avoidOverlappingEdits(e.textDocument,s)}avoidOverlappingEdits(e,r){let n=[];for(let i of r){let o=n[n.length-1];if(o){let s=e.offsetAt(i.range.start),a=e.offsetAt(o.range.end);s<a&&n.pop()}n.push(i)}return n}iterateAstFormatting(e,r){let n=e.parseResult.value;this.format(n);let i=yt(n).iterator(),o;do if(o=i.next(),!o.done){let s=o.value;this.insideRange(s.$cstNode.range,r)?this.format(s):i.prune()}while(!o.done)}nodeModeToKey(e,r){return`${e.offset}:${e.end}:${r}`}insideRange(e,r){return!r||e.start.line<=r.start.line&&e.end.line>=r.end.line||e.start.line>=r.start.line&&e.end.line<=r.end.line||e.start.line<=r.end.line&&e.end.line>=r.end.line}isNecessary(e,r){return r.getText(e.range)!==e.newText}iterateCstFormatting(e,r,n,i){let o={indentation:0,options:n,document:e.textDocument},s=[],c=this.iterateCstTree(e,o).iterator(),u,l;do if(l=c.next(),!l.done){let f=l.value,g=ws(f),T=this.nodeModeToKey(f,"prepend"),C=r.get(T);if(r.delete(T),C){let E=this.createTextEdit(u,f,C,o);for(let m of E)m&&this.insideRange(m.range,i)&&this.isNecessary(m,e.textDocument)&&s.push(m)}let P=this.nodeModeToKey(f,"append"),O=r.get(P);if(r.delete(P),O){let E=zS(f);if(E){let m=this.createTextEdit(f,E,O,o);for(let d of m)d&&this.insideRange(d.range,i)&&this.isNecessary(d,e.textDocument)&&s.push(d)}}if(!C&&f.hidden){let E=this.createHiddenTextEdits(u,f,void 0,o);for(let m of E)m&&this.insideRange(m.range,i)&&this.isNecessary(m,e.textDocument)&&s.push(m)}g&&(u=f)}while(!l.done);return s}createHiddenTextEdits(e,r,n,i){var o;let s=r.range.start.line;if(e&&e.range.end.line===s)return[];let a=[],c={start:{character:0,line:s},end:r.range.start},u=i.document.getText(c),l=this.findFittingMove(c,(o=n?.moves)!==null&&o!==void 0?o:[],i),f=this.getExistingIndentationCharacterCount(u,i),T=this.getIndentationCharacterCount(i,l)-f;if(T===0)return[];let C="";T>0&&(C=(i.options.insertSpaces?" ":" ").repeat(T));let P=r.text.split(`
86
+ `);P[0]=u+P[0];for(let O=0;O<P.length;O++){let E=s+O,m={character:0,line:E};if(T>0)a.push({newText:C,range:{start:m,end:m}});else{let d=P[O],_=0;for(;_<d.length;_++){let $=d.charAt(_);if($!==" "&&$!==" ")break}a.push({newText:"",range:{start:m,end:{line:E,character:Math.min(_,Math.abs(T))}}})}}return a}getExistingIndentationCharacterCount(e,r){let n=" ".repeat(r.options.tabSize);return(r.options.insertSpaces?e.replaceAll(" ",n):e.replaceAll(n," ")).length}getIndentationCharacterCount(e,r){let n=e.indentation;return r&&r.tabs&&(n+=r.tabs),(e.options.insertSpaces?e.options.tabSize:1)*n}createTextEdit(e,r,n,i){var o;if(r.hidden)return this.createHiddenTextEdits(e,r,n,i);let s={start:(o=e?.range.end)!==null&&o!==void 0?o:{character:0,line:0},end:r.range.start},a=this.findFittingMove(s,n.moves,i);if(!a)return[];let c=a.characters,u=a.lines,l=a.tabs,f=i.indentation;i.indentation+=l??0;let g=[];return c!==void 0?g.push(this.createSpaceTextEdit(s,c,n.options)):u!==void 0?g.push(this.createLineTextEdit(s,u,i,n.options)):l!==void 0&&g.push(this.createTabTextEdit(s,!!e,i)),ws(r)&&(i.indentation=f),g}createSpaceTextEdit(e,r,n){if(e.start.line===e.end.line){let o=e.end.character-e.start.character;r=this.fitIntoOptions(r,o,n)}return{newText:" ".repeat(r),range:e}}createLineTextEdit(e,r,n,i){let o=e.end.line-e.start.line;r=this.fitIntoOptions(r,o,i);let a=(n.options.insertSpaces?" ".repeat(n.options.tabSize):" ").repeat(n.indentation);return{newText:`${`
85
87
  `.repeat(r)}${a}`,range:e}}createTabTextEdit(e,r,n){let o=(n.options.insertSpaces?" ".repeat(n.options.tabSize):" ").repeat(n.indentation),s=r?1:0,a=Math.max(e.end.line-e.start.line,s);return{newText:`${`
86
- `.repeat(a)}${o}`,range:e}}fitIntoOptions(e,r,n){return n.allowMore?e=Math.max(r,e):n.allowLess&&(e=Math.min(r,e)),e}findFittingMove(e,r,n){if(r.length===0)return;if(r.length===1)return r[0];let i=e.end.line-e.start.line;for(let o of r){if(o.lines!==void 0&&i<=o.lines)return o;if(o.lines===void 0&&i===0)return o}return r[r.length-1]}iterateCstTree(e,r){let i=e.parseResult.value.$cstNode;return i?new $n(i,o=>this.iterateCst(o,r)):ya}iterateCst(e,r){if(!Ei(e))return ya;let n=r.indentation;return new Rn(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(r.indentation=n,Yr))}},Jy=class{constructor(e,r){this.astNode=e,this.collector=r}node(e){return new li(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){let r=[];for(let n of e)n.$cstNode&&r.push(n.$cstNode);return new li(r,this.collector)}property(e,r){let n=wr(this.astNode.$cstNode,e,r);return new li(n?[n]:[],this.collector)}properties(...e){let r=[];for(let n of e){let i=jo(this.astNode.$cstNode,n);r.push(...i)}return new li(r,this.collector)}keyword(e,r){let n=Fn(this.astNode.$cstNode,e,r);return new li(n?[n]:[],this.collector)}keywords(...e){let r=[];for(let n of e){let i=Td(this.astNode.$cstNode,n);r.push(...i)}return new li(r,this.collector)}cst(e){return new li([...e],this.collector)}interior(e,r){let n=e.nodes,i=r.nodes;if(n.length!==1||i.length!==1)return new li([],this.collector);let o=n[0],s=i[0];if(o.offset>s.offset){let a=o;o=s,s=a}return new li(e_(o,s),this.collector)}},li=class t{constructor(e,r){this.nodes=e,this.collector=r}prepend(e){for(let r of this.nodes)this.collector(r,"prepend",e);return this}append(e){for(let r of this.nodes)this.collector(r,"append",e);return this}surround(e){for(let r of this.nodes)this.collector(r,"prepend",e),this.collector(r,"append",e);return this}slice(e,r){return new t(this.nodes.slice(e,r),this.collector)}},Me;(function(t){function e(...p){return{options:{},moves:p.flatMap(m=>m.moves).sort(f)}}t.fit=e;function r(p){return i(0,p)}t.noSpace=r;function n(p){return i(1,p)}t.oneSpace=n;function i(p,m){return{options:m??{},moves:[{characters:p}]}}t.spaces=i;function o(p){return s(1,p)}t.newLine=o;function s(p,m){return{options:m??{},moves:[{lines:p}]}}t.newLines=s;function a(p){return{options:p??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function c(p){return{options:p??{},moves:[{tabs:0}]}}t.noIndent=c;function f(p,m){var T,k,A,N,O,P;let y=(T=p.lines)!==null&&T!==void 0?T:0,h=(k=m.lines)!==null&&k!==void 0?k:0,C=(A=p.tabs)!==null&&A!==void 0?A:0,M=(N=m.tabs)!==null&&N!==void 0?N:0,z=(O=p.characters)!==null&&O!==void 0?O:0,ce=(P=m.characters)!==null&&P!==void 0?P:0;return y<h?-1:y>h?1:C<M?-1:C>M?1:z<ce?-1:z>ce?1:0}})(Me=Me||(Me={}));var Rd=class extends vd{format(e){if(kr(e))this.getNodeFormatter(e).properties("type","terminal").surround(Me.noSpace());else if(Z(e)){let r=this.getNodeFormatter(e);r.keywords("entry","fragment","returns").append(Me.oneSpace()),(e.inferredType||e.returnType||e.dataType)&&e.parameters.length===0?r.property("name").append(Me.oneSpace()):r.property("name").append(Me.noSpace()),r.properties("parameters").append(Me.noSpace()),r.keywords(",").append(Me.oneSpace()),r.keywords("<").append(Me.noSpace());let n=r.keyword(";"),i=r.keyword(":");i.prepend(Me.noSpace()),r.interior(i,n).prepend(Me.indent()),n.prepend(Me.fit(Me.noSpace(),Me.newLine())),r.node(e).prepend(Me.noIndent())}else if(He(e)){let r=this.getNodeFormatter(e);e.type&&(r.property("name").append(Me.oneSpace()),r.keyword("returns").append(Me.oneSpace())),r.keywords("hidden","terminal","fragment").append(Me.oneSpace()),r.keyword(":").prepend(Me.noSpace()),r.keyword(";").prepend(Me.fit(Me.noSpace(),Me.newLine())),r.node(e).prepend(Me.noIndent())}else if(Je(e)){let r=this.getNodeFormatter(e);r.keyword("{").append(Me.noSpace()),r.keywords(".","+=","=").surround(Me.noSpace()),r.keyword("}").prepend(Me.noSpace())}else if(Ra(e))this.getNodeFormatter(e).keywords("infer","infers").append(Me.oneSpace());else if(je(e))this.getNodeFormatter(e).keywords("=","+=","?=").surround(Me.noSpace());else if(Qe(e)){let r=this.getNodeFormatter(e);r.keyword("<").surround(Me.noSpace()),r.keyword(",").append(Me.oneSpace()),r.properties("arguments").append(Me.noSpace())}va(e)&&this.getNodeFormatter(e).property("cardinality").prepend(Me.noSpace())}};var yo=Ie(Xe(),1);var De=Ie(Xe(),1);var ev={[De.SemanticTokenTypes.class]:0,[De.SemanticTokenTypes.comment]:1,[De.SemanticTokenTypes.enum]:2,[De.SemanticTokenTypes.enumMember]:3,[De.SemanticTokenTypes.event]:4,[De.SemanticTokenTypes.function]:5,[De.SemanticTokenTypes.interface]:6,[De.SemanticTokenTypes.keyword]:7,[De.SemanticTokenTypes.macro]:8,[De.SemanticTokenTypes.method]:9,[De.SemanticTokenTypes.modifier]:10,[De.SemanticTokenTypes.namespace]:11,[De.SemanticTokenTypes.number]:12,[De.SemanticTokenTypes.operator]:13,[De.SemanticTokenTypes.parameter]:14,[De.SemanticTokenTypes.property]:15,[De.SemanticTokenTypes.regexp]:16,[De.SemanticTokenTypes.string]:17,[De.SemanticTokenTypes.struct]:18,[De.SemanticTokenTypes.type]:19,[De.SemanticTokenTypes.typeParameter]:20,[De.SemanticTokenTypes.variable]:21},BS={[De.SemanticTokenModifiers.abstract]:1,[De.SemanticTokenModifiers.async]:2,[De.SemanticTokenModifiers.declaration]:4,[De.SemanticTokenModifiers.defaultLibrary]:8,[De.SemanticTokenModifiers.definition]:16,[De.SemanticTokenModifiers.deprecated]:32,[De.SemanticTokenModifiers.documentation]:64,[De.SemanticTokenModifiers.modification]:128,[De.SemanticTokenModifiers.readonly]:256,[De.SemanticTokenModifiers.static]:512},KS={legend:{tokenTypes:Object.keys(ev),tokenModifiers:Object.keys(BS)},full:{delta:!0},range:!0},Zy=class extends De.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,r,n,i,o){this._tokens.push({line:e,char:r,length:n,tokenType:i,tokenModifiers:o})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}applyTokens(){for(let e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,r){return e.line===r.line?e.char-r.char:e.line-r.line}},xd=class{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(r=>{this.tokensBuilders.delete(r.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(r=>{var n;this.initialize((n=r.capabilities.textDocument)===null||n===void 0?void 0:n.semanticTokens)})}initialize(e){this.clientCapabilities=e}async semanticHighlight(e,r,n=De.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),await this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}async semanticHighlightRange(e,r,n=De.CancellationToken.None){return this.currentRange=r.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),await this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,r,n=De.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(r.previousResultId),await this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.buildEdits()}createAcceptor(){return r=>{"line"in r?this.highlightToken({range:{start:{line:r.line,character:r.char},end:{line:r.line,character:r.char+r.length}},type:r.type,modifier:r.modifier}):"range"in r?this.highlightToken(r):"keyword"in r?this.highlightKeyword(r):"property"in r?this.highlightProperty(r):this.highlightNode({node:r.cst,type:r.type,modifier:r.modifier})}}getDocumentTokensBuilder(e){let r=this.tokensBuilders.get(e.uri.toString());if(r)return r;let n=new Zy;return this.tokensBuilders.set(e.uri.toString(),n),n}async computeHighlighting(e,r,n){let i=e.parseResult.value,o=uo(i,{range:this.currentRange}).iterator(),s;do if(s=o.next(),!s.done){await _t(n);let a=s.value;this.highlightElement(a,r)==="prune"&&o.prune()}while(!s.done)}highlightToken(e){var r;let{range:n,type:i}=e,o=e.modifier;if(this.currentRange&&!Mf(n,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;let s=ev[i],a=0;if(o!==void 0){typeof o=="string"&&(o=[o]);for(let p of o){let m=BS[p];a|=m}}let c=n.start.line,f=n.end.line;if(c===f){let p=n.start.character,m=n.end.character-p;this.currentTokensBuilder.push(c,p,m,s,a)}else if(!((r=this.clientCapabilities)===null||r===void 0)&&r.multilineTokenSupport){let p=n.start.character,m=this.currentDocument.textDocument.offsetAt(n.start),T=this.currentDocument.textDocument.offsetAt(n.end);this.currentTokensBuilder.push(c,p,T-m,s,a)}else{let p=n.start,m=this.currentDocument.textDocument.offsetAt({line:c+1,character:0});this.currentTokensBuilder.push(p.line,p.character,m-p.character-1,s,a);for(let T=c+1;T<f;T++){let k=m;m=this.currentDocument.textDocument.offsetAt({line:T+1,character:0}),this.currentTokensBuilder.push(T,0,m-k-1,s,a)}this.currentTokensBuilder.push(f,0,n.end.character,s,a)}}highlightProperty(e){let r=[];if(typeof e.index=="number"){let o=wr(e.node.$cstNode,e.property,e.index);o&&r.push(o)}else r.push(...jo(e.node.$cstNode,e.property));let{type:n,modifier:i}=e;for(let o of r)this.highlightNode({node:o,type:n,modifier:i})}highlightKeyword(e){let{node:r,keyword:n,type:i,index:o,modifier:s}=e,a=[];if(typeof o=="number"){let c=Fn(r.$cstNode,n,o);c&&a.push(c)}else a.push(...Td(r.$cstNode,n));for(let c of a)this.highlightNode({node:c,type:i,modifier:s})}highlightNode(e){let{node:r,type:n,modifier:i}=e,o=r.range;this.highlightToken({range:o,type:n,modifier:i})}},Qy;(function(t){function e(n,i){let o=new Map;Object.entries(ev).forEach(([c,f])=>o.set(f,c));let s=0,a=0;return r(n.data,5).map(c=>{s+=c[0],c[0]!==0&&(a=0),a+=c[1];let f=c[2];return{offset:i.textDocument.offsetAt({line:s,character:a}),tokenType:o.get(c[3]),tokenModifiers:c[4],text:i.textDocument.getText({start:{line:s,character:a},end:{line:s,character:a+f}})}})}t.decode=e;function r(n,i){let o=[];for(let s=0;s<n.length;s+=i){let a=n.slice(s,s+i);o.push(a)}return o}})(Qy=Qy||(Qy={}));var bd=class extends xd{highlightElement(e,r){var n;je(e)?r({node:e,property:"feature",type:yo.SemanticTokenTypes.property}):Je(e)?e.feature&&r({node:e,property:"feature",type:yo.SemanticTokenTypes.property}):ba(e)?r({node:e,property:"name",type:yo.SemanticTokenTypes.type}):Ur(e)?(e.primitiveType||e.typeRef)&&r({node:e,property:e.primitiveType?"primitiveType":"typeRef",type:yo.SemanticTokenTypes.type}):g_(e)?r({node:e,property:"name",type:yo.SemanticTokenTypes.parameter}):xa(e)?r({node:e,property:"parameter",type:yo.SemanticTokenTypes.parameter}):Qe(e)?!((n=e.rule.ref)===null||n===void 0)&&n.fragment&&r({node:e,property:"rule",type:yo.SemanticTokenTypes.type}):Ff(e)&&r({node:e,property:"name",type:yo.SemanticTokenTypes.property})}};var _d=class extends wa{getName(e){return je(e)?e.feature:super.getName(e)}getNameNode(e){return je(e)?wr(e.$cstNode,"feature"):super.getNameNode(e)}};var Ga=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){let r=Ba(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(so(i))return i.ref;if(Array.isArray(i)){for(let o of i)if(so(o)&&o.$refNode&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return o.ref}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||Jb(e,i)))return n}}}findDeclarationNode(e){let r=this.findDeclaration(e);if(r?.$cstNode){let n=this.nameProvider.getNameNode(r);return n??r.$cstNode}}findReferences(e,r){let n=[];if(r.includeDeclaration){let o=this.getReferenceToSelf(e);o&&n.push(o)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(o=>qe.equals(o.sourceUri,r.documentUri))),n.push(...i),ke(n)}getReferenceToSelf(e){let r=this.nameProvider.getNameNode(e);if(r){let n=Se(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:jr(r),local:!0}}}};var Sd=class extends Ga{constructor(e){super(e),this.documents=e.shared.workspace.LangiumDocuments}findDeclaration(e){let r=e.astNode,n=Ba(e);if(n&&n.feature==="feature"){if(je(r))return this.findAssignmentDeclaration(r);if(Je(r))return this.findActionDeclaration(r)}return super.findDeclaration(e)}findReferences(e,r){var n;return Ff(e)?this.findReferencesToTypeAttribute(e,(n=r.includeDeclaration)!==null&&n!==void 0?n:!1):super.findReferences(e,r)}findReferencesToTypeAttribute(e,r){let n=[],i=Ze(e,ln);if(i){if(r){let a=this.getReferenceToSelf(e);a&&n.push(a)}let o=ky(i,this,this.documents,this.nodeLocator),s=[];o.forEach(a=>{let c=this.findRulesWithReturnType(a);s.push(...c)}),s.forEach(a=>{let c=this.createReferencesToAttribute(a,e);n.push(...c)})}return ke(n)}createReferencesToAttribute(e,r){let n=[];if(Z(e)){let i=Ia(e.definition).find(o=>o.feature===r.name);if(i?.$cstNode){let o=this.nameProvider.getNameNode(i);o&&n.push({sourceUri:Se(i).uri,sourcePath:this.nodeLocator.getAstNodePath(i),targetUri:Se(r).uri,targetPath:this.nodeLocator.getAstNodePath(r),segment:jr(o),local:qe.equals(Se(i).uri,Se(r).uri)})}}else{if(e.feature===r.name){let o=wr(e.$cstNode,"feature");o&&n.push({sourceUri:Se(e).uri,sourcePath:this.nodeLocator.getAstNodePath(e),targetUri:Se(r).uri,targetPath:this.nodeLocator.getAstNodePath(r),segment:jr(o),local:qe.equals(Se(e).uri,Se(r).uri)})}let i=Ze(e,Z);n.push(...this.createReferencesToAttribute(i,r))}return n}findAssignmentDeclaration(e){var r;let n=Ze(e,Z),i=jy(e);if(i){let o=this.findActionDeclaration(i,e.feature);if(o)return o}if(!((r=n?.returnType)===null||r===void 0)&&r.ref&&(ln(n.returnType.ref)||hr(n.returnType.ref))){let o=Cu(n.returnType.ref);for(let s of o){let a=s.attributes.find(c=>c.name===e.feature);if(a)return a}}return e}findActionDeclaration(e,r){var n;if(!((n=e.type)===null||n===void 0)&&n.ref){let i=r??e.feature,o=Cu(e.type.ref);for(let s of o){let a=s.attributes.find(c=>c.name===i);if(a)return a}}}findRulesWithReturnType(e){let r=[];return this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)).forEach(i=>{let o=this.documents.getOrCreateDocument(i.sourceUri),s=this.nodeLocator.getAstNode(o.parseResult.value,i.sourcePath);(Z(s)||Je(s))&&r.push(s)}),r}};var Uu=Ie(Xe(),1);var zS=Ie(Xe(),1);var kd=class{constructor(e){this.grammarConfig=e.parser.GrammarConfig,this.nameProvider=e.references.NameProvider,this.documents=e.shared.workspace.LangiumDocuments,this.references=e.references.References}prepareCallHierarchy(e,r){let n=e.parseResult.value,i=ur(n.$cstNode,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findDeclarationNode(i);if(o)return this.getCallHierarchyItems(o.astNode,e)}getCallHierarchyItems(e,r){let n=this.nameProvider.getNameNode(e),i=this.nameProvider.getName(e);if(!(!n||!e.$cstNode||i===void 0))return[Object.assign({kind:zS.SymbolKind.Method,name:i,range:e.$cstNode.range,selectionRange:n.range,uri:r.uri.toString()},this.getCallHierarchyItem(e))]}getCallHierarchyItem(e){}incomingCalls(e){let r=this.documents.getOrCreateDocument(Dr.parse(e.item.uri)),n=r.parseResult.value,i=ur(n.$cstNode,r.textDocument.offsetAt(e.item.range.start),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findReferences(i.astNode,{includeDeclaration:!1});return this.getIncomingCalls(i.astNode,o)}outgoingCalls(e){let r=this.documents.getOrCreateDocument(Dr.parse(e.item.uri)),n=r.parseResult.value,i=ur(n.$cstNode,r.textDocument.offsetAt(e.item.range.start),this.grammarConfig.nameRegexp);if(i)return this.getOutgoingCalls(i.astNode)}};var VS=Ie(Xe(),1);var Ka=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,r){let n=e.parseResult.value;if(n.$cstNode){let i=n.$cstNode,o=ur(i,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(o)return this.collectLocationLinks(o,r)}}collectLocationLinks(e,r){var n;let i=this.findLink(e);if(i)return[VS.LocationLink.create(i.targetDocument.textDocument.uri,((n=i.target.astNode.$cstNode)!==null&&n!==void 0?n:i.target).range,i.target.range,i.source.range)]}findLink(e){let r=this.references.findDeclarationNode(e);if(r?.astNode){let n=Se(r.astNode);if(r&&n)return{source:e,target:r,targetDocument:n}}}};var XS=Ie(Xe(),1);var Cd=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,r){let n=e.parseResult.value.$cstNode;if(!n)return;let i=ur(n,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findDeclaration(i);if(o){let s=qe.equals(Se(o).uri,e.uri),a={documentUri:e.uri,includeDeclaration:s};return this.references.findReferences(o,a).map(f=>this.createDocumentHighlight(f)).toArray()}}createDocumentHighlight(e){return XS.DocumentHighlight.create(e.segment.range)}};var wd=class{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,r){let n=r.$cstNode,i=this.nameProvider.getNameNode(r);if(i&&n){let o=this.nameProvider.getName(r);return[{kind:this.nodeKindProvider.getSymbolKind(r),name:o??i.text,range:n.range,selectionRange:i.range,children:this.getChildSymbols(e,r)}]}else return this.getChildSymbols(e,r)||[]}getChildSymbols(e,r){let n=[];for(let i of Fo(r)){let o=this.getSymbol(e,i);n.push(...o)}if(n.length>0)return n}};var KM=Ie(Xe(),1);var Dd=class{match(e,r){if(e.length===0)return!0;r=r.toLowerCase();let n=!1,i,o=0,s=r.length;for(let a=0;a<s;a++){let c=r.charCodeAt(a),f=e.charCodeAt(o);if((c===f||this.toUpperCharCode(c)===this.toUpperCharCode(f))&&(n||(n=i===void 0||this.isWordTransition(i,c)),n&&o++,o===e.length))return!0;i=c}return!1}isWordTransition(e,r){return YS<=e&&e<=JS&&zM<=r&&r<=VM||e===QS&&r!==QS}toUpperCharCode(e){return YS<=e&&e<=JS?e-32:e}},YS="a".charCodeAt(0),JS="z".charCodeAt(0),zM="A".charCodeAt(0),VM="Z".charCodeAt(0),QS="_".charCodeAt(0);var tv=class{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,r){var n,i;let o=(i=(n=e.parseResult)===null||n===void 0?void 0:n.value)===null||i===void 0?void 0:i.$cstNode;if(o){let s=e.textDocument.offsetAt(r.position),a=ur(o,s,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>s){let c=this.references.findDeclaration(a);if(c)return this.getAstNodeHoverContent(c)}}}},Ed=class extends tv{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){let r=this.documentationProvider.getDocumentation(e);if(r)return{contents:{kind:"markdown",value:r}}}};var XM=Ie(Xe(),1);var YM=Ie(Xe(),1);var Wn=Ie(Xe(),1);var nt;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(nt=nt||(nt={}));var Pd=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}fromTextDocument(e,r){return this.create(r??Dr.parse(e.uri),e)}fromString(e,r){return this.create(r,e)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r){if(r??(r=this.textDocuments.get(e.toString())),r??(r=this.getContentFromFileSystem(e)),typeof r=="string"){let n=this.parse(e,r);return this.createLangiumDocument(n,e,void 0,r)}else if("$model"in r){let n={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{let n=this.parse(e,r.getText());return this.createLangiumDocument(n,e,r)}}createLangiumDocument(e,r,n,i){let o;if(n)o={parseResult:e,uri:r,state:nt.Parsed,references:[],textDocument:n};else{let s=this.createTextDocumentGetter(r,i);o={parseResult:e,uri:r,state:nt.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=o,o}update(e){let r=this.textDocuments.get(e.uri.toString()),n=r?r.getText():this.getContentFromFileSystem(e.uri);if(r)Object.defineProperty(e,"textDocument",{value:r});else{let i=this.createTextDocumentGetter(e.uri,n);Object.defineProperty(e,"textDocument",{get:i})}return e.parseResult=this.parse(e.uri,n),e.parseResult.value.$document=e,e}getContentFromFileSystem(e){return this.fileSystemProvider.readFileSync(e)}parse(e,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r)}createTextDocumentGetter(e,r){let n=this.serviceRegistry,i;return()=>i??(i=ha.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},Ad=class{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory}get all(){return ke(this.documentMap.values())}addDocument(e){let r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getOrCreateDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n||(n=this.langiumDocumentFactory.create(e),this.documentMap.set(r,n),n)}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=nt.Changed,n.precomputedScopes=void 0,n.references=[],n.diagnostics=void 0),n}deleteDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=nt.Changed,this.documentMap.delete(r)),n}};var JM=Ie(Xe(),1);function ZS(t){let e=[],r=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&r.push(...i.retriggerCharacters)});let n={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:r.length>0?Array.from(new Set(r)).sort():void 0};return n.triggerCharacters?n:void 0}var Nd=class{constructor(e){this.onInitializeEmitter=new Wn.Emitter,this.onInitializedEmitter=new Wn.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){$f(this.services),this.services.ServiceRegistry.all.forEach(e=>$f(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var r;let n=this.services.ServiceRegistry.all,i=this.hasService(I=>I.lsp.Formatter),o=n.map(I=>{var K;return(K=I.lsp.Formatter)===null||K===void 0?void 0:K.formatOnTypeOptions}).find(I=>!!I),s=this.hasService(I=>I.lsp.CodeActionProvider),a=this.hasService(I=>I.lsp.SemanticTokenProvider),c=(r=this.services.lsp.ExecuteCommandHandler)===null||r===void 0?void 0:r.commands,f=this.hasService(I=>I.lsp.DocumentLinkProvider),p=ZS(n.map(I=>{var K;return(K=I.lsp.SignatureHelp)===null||K===void 0?void 0:K.signatureHelpOptions})),m=this.hasService(I=>I.lsp.TypeProvider),T=this.hasService(I=>I.lsp.ImplementationProvider),k=this.hasService(I=>I.lsp.CompletionProvider),A=HS(n.map(I=>{var K;return(K=I.lsp.CompletionProvider)===null||K===void 0?void 0:K.completionOptions})),N=this.hasService(I=>I.lsp.ReferencesProvider),O=this.hasService(I=>I.lsp.DocumentSymbolProvider),P=this.hasService(I=>I.lsp.DefinitionProvider),y=this.hasService(I=>I.lsp.DocumentHighlightProvider),h=this.hasService(I=>I.lsp.FoldingRangeProvider),C=this.hasService(I=>I.lsp.HoverProvider),M=this.hasService(I=>I.lsp.RenameProvider),z=this.hasService(I=>I.lsp.CallHierarchyProvider),ce=this.hasService(I=>I.lsp.CodeLensProvider),we=this.hasService(I=>I.lsp.DeclarationProvider),Rt=this.hasService(I=>I.lsp.InlayHintProvider),tt=this.services.lsp.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0}},executeCommandProvider:c&&{commands:c},textDocumentSync:Wn.TextDocumentSyncKind.Incremental,completionProvider:k?A:void 0,referencesProvider:N,documentSymbolProvider:O,definitionProvider:P,typeDefinitionProvider:m,documentHighlightProvider:y,codeActionProvider:s,documentFormattingProvider:i,documentRangeFormattingProvider:i,documentOnTypeFormattingProvider:o,foldingRangeProvider:h,hoverProvider:C,renameProvider:M?{prepareProvider:!0}:void 0,semanticTokensProvider:a?KS:void 0,signatureHelpProvider:p,implementationProvider:T,callHierarchyProvider:z?{}:void 0,documentLinkProvider:f?{resolveProvider:!1}:void 0,codeLensProvider:ce?{resolveProvider:!1}:void 0,declarationProvider:we,inlayHintProvider:Rt?{resolveProvider:!1}:void 0,workspaceSymbolProvider:tt?{resolveProvider:!!tt.resolveSymbol}:void 0}}}async initialized(e){this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}};function tk(t){let e=t.lsp.Connection;if(!e)throw new Error("Starting a language server requires the languageServer.Connection service to be set.");QM(e,t),ZM(e,t),e$(e,t),t$(e,t),n$(e,t),i$(e,t),o$(e,t),s$(e,t),c$(e,t),l$(e,t),f$(e,t),r$(e,t),d$(e,t),u$(e,t),p$(e,t),m$(e,t),g$(e,t),v$(e,t),x$(e,t),T$(e,t),y$(e,t),h$(e,t),a$(e,t),R$(e,t),e.onInitialize(n=>t.lsp.LanguageServer.initialize(n)),e.onInitialized(n=>t.lsp.LanguageServer.initialized(n)),t.workspace.TextDocuments.listen(e),e.listen()}function QM(t,e){let r=e.workspace.DocumentBuilder,n=e.workspace.MutexLock;function i(s,a){n.lock(c=>r.update(s,a,c))}e.workspace.TextDocuments.onDidChangeContent(s=>{i([Dr.parse(s.document.uri)],[])}),t.onDidChangeWatchedFiles(s=>{let a=[],c=[];for(let f of s.changes){let p=Dr.parse(f.uri);f.type===Wn.FileChangeType.Deleted?c.push(p):a.push(p)}i(a,c)})}function ZM(t,e){e.workspace.DocumentBuilder.onBuildPhase(nt.Validated,async(n,i)=>{for(let o of n)if(o.diagnostics&&t.sendDiagnostics({uri:o.uri.toString(),diagnostics:o.diagnostics}),i.isCancellationRequested)return})}function e$(t,e){t.onCompletion(Hr((r,n,i,o)=>{var s;return(s=r.lsp.CompletionProvider)===null||s===void 0?void 0:s.getCompletion(n,i,o)},e))}function t$(t,e){t.onReferences(Hr((r,n,i,o)=>{var s;return(s=r.lsp.ReferencesProvider)===null||s===void 0?void 0:s.findReferences(n,i,o)},e))}function r$(t,e){t.onCodeAction(Hr((r,n,i,o)=>{var s;return(s=r.lsp.CodeActionProvider)===null||s===void 0?void 0:s.getCodeActions(n,i,o)},e))}function n$(t,e){t.onDocumentSymbol(Hr((r,n,i,o)=>{var s;return(s=r.lsp.DocumentSymbolProvider)===null||s===void 0?void 0:s.getSymbols(n,i,o)},e))}function i$(t,e){t.onDefinition(Hr((r,n,i,o)=>{var s;return(s=r.lsp.DefinitionProvider)===null||s===void 0?void 0:s.getDefinition(n,i,o)},e))}function o$(t,e){t.onTypeDefinition(Hr((r,n,i,o)=>{var s;return(s=r.lsp.TypeProvider)===null||s===void 0?void 0:s.getTypeDefinition(n,i,o)},e))}function s$(t,e){t.onImplementation(Hr((r,n,i,o)=>{var s;return(s=r.lsp.ImplementationProvider)===null||s===void 0?void 0:s.getImplementation(n,i,o)},e))}function a$(t,e){t.onDeclaration(Hr((r,n,i,o)=>{var s;return(s=r.lsp.DeclarationProvider)===null||s===void 0?void 0:s.getDeclaration(n,i,o)},e))}function c$(t,e){t.onDocumentHighlight(Hr((r,n,i,o)=>{var s;return(s=r.lsp.DocumentHighlightProvider)===null||s===void 0?void 0:s.getDocumentHighlight(n,i,o)},e))}function u$(t,e){t.onHover(Hr((r,n,i,o)=>{var s;return(s=r.lsp.HoverProvider)===null||s===void 0?void 0:s.getHoverContent(n,i,o)},e))}function l$(t,e){t.onFoldingRanges(Hr((r,n,i,o)=>{var s;return(s=r.lsp.FoldingRangeProvider)===null||s===void 0?void 0:s.getFoldingRanges(n,i,o)},e))}function f$(t,e){t.onDocumentFormatting(Hr((r,n,i,o)=>{var s;return(s=r.lsp.Formatter)===null||s===void 0?void 0:s.formatDocument(n,i,o)},e)),t.onDocumentRangeFormatting(Hr((r,n,i,o)=>{var s;return(s=r.lsp.Formatter)===null||s===void 0?void 0:s.formatDocumentRange(n,i,o)},e)),t.onDocumentOnTypeFormatting(Hr((r,n,i,o)=>{var s;return(s=r.lsp.Formatter)===null||s===void 0?void 0:s.formatDocumentOnType(n,i,o)},e))}function d$(t,e){t.onRenameRequest(Hr((r,n,i,o)=>{var s;return(s=r.lsp.RenameProvider)===null||s===void 0?void 0:s.rename(n,i,o)},e)),t.onPrepareRename(Hr((r,n,i,o)=>{var s;return(s=r.lsp.RenameProvider)===null||s===void 0?void 0:s.prepareRename(n,i,o)},e))}function p$(t,e){t.languages.inlayHint.on(Ho((r,n,i,o)=>{var s;return(s=r.lsp.InlayHintProvider)===null||s===void 0?void 0:s.getInlayHints(n,i,o)},e))}function m$(t,e){let r={data:[]};t.languages.semanticTokens.on(Ho((n,i,o,s)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlight(i,o,s):r,e)),t.languages.semanticTokens.onDelta(Ho((n,i,o,s)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlightDelta(i,o,s):r,e)),t.languages.semanticTokens.onRange(Ho((n,i,o,s)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlightRange(i,o,s):r,e))}function h$(t,e){t.onDidChangeConfiguration(r=>{r.settings&&e.workspace.ConfigurationProvider.updateConfiguration(r)})}function g$(t,e){let r=e.lsp.ExecuteCommandHandler;r&&t.onExecuteCommand(async(n,i)=>{var o;try{return await r.executeCommand(n.command,(o=n.arguments)!==null&&o!==void 0?o:[],i)}catch(s){return za(s)}})}function y$(t,e){t.onDocumentLinks(Ho((r,n,i,o)=>{var s;return(s=r.lsp.DocumentLinkProvider)===null||s===void 0?void 0:s.getDocumentLinks(n,i,o)},e))}function v$(t,e){t.onSignatureHelp(Ho((r,n,i,o)=>{var s;return(s=r.lsp.SignatureHelp)===null||s===void 0?void 0:s.provideSignatureHelp(n,i,o)},e))}function T$(t,e){t.onCodeLens(Ho((r,n,i,o)=>{var s;return(s=r.lsp.CodeLensProvider)===null||s===void 0?void 0:s.provideCodeLens(n,i,o)},e))}function R$(t,e){var r;let n=e.lsp.WorkspaceSymbolProvider;if(n){t.onWorkspaceSymbol(async(o,s)=>{try{return await n.getSymbols(o,s)}catch(a){return za(a)}});let i=(r=n.resolveSymbol)===null||r===void 0?void 0:r.bind(n);i&&t.onWorkspaceSymbolResolve(async(o,s)=>{try{return await i(o,s)}catch(a){return za(a)}})}}function x$(t,e){t.languages.callHierarchy.onPrepare(Ho((r,n,i,o)=>{var s;return r.lsp.CallHierarchyProvider&&(s=r.lsp.CallHierarchyProvider.prepareCallHierarchy(n,i,o))!==null&&s!==void 0?s:null},e)),t.languages.callHierarchy.onIncomingCalls(ek((r,n,i)=>{var o;return r.lsp.CallHierarchyProvider&&(o=r.lsp.CallHierarchyProvider.incomingCalls(n,i))!==null&&o!==void 0?o:null},e)),t.languages.callHierarchy.onOutgoingCalls(ek((r,n,i)=>{var o;return r.lsp.CallHierarchyProvider&&(o=r.lsp.CallHierarchyProvider.outgoingCalls(n,i))!==null&&o!==void 0?o:null},e))}function ek(t,e){let r=e.ServiceRegistry;return async(n,i)=>{let o=Dr.parse(n.item.uri),s=r.getServices(o);if(!s){let a=`Could not find service instance for uri: '${o.toString()}'`;throw console.error(a),new Error(a)}try{return await t(s,n,i)}catch(a){return za(a)}}}function Ho(t,e){let r=e.workspace.LangiumDocuments,n=e.ServiceRegistry;return async(i,o)=>{let s=Dr.parse(i.textDocument.uri),a=n.getServices(s);if(!a)throw console.error(`Could not find service instance for uri: '${s.toString()}'`),new Error;let c=r.getOrCreateDocument(s);if(!c)throw new Error;try{return await t(a,c,i,o)}catch(f){return za(f)}}}function Hr(t,e){let r=e.workspace.LangiumDocuments,n=e.ServiceRegistry;return async(i,o)=>{let s=Dr.parse(i.textDocument.uri),a=n.getServices(s);if(!a)return console.error(`Could not find service instance for uri: '${s.toString()}'`),null;let c=r.getOrCreateDocument(s);if(!c)return null;try{return await t(a,c,i,o)}catch(f){return za(f)}}}function za(t){if(Os(t))return new Wn.ResponseError(Wn.LSPErrorCodes.RequestCancelled,"The request has been cancelled.");if(t instanceof Wn.ResponseError)return t;throw t}var Od=Ie(Xe(),1),Id=class{getSymbolKind(){return Od.SymbolKind.Field}getCompletionItemKind(){return Od.CompletionItemKind.Reference}};var rk=Ie(Xe(),1);var Ld=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,r){let n=e.parseResult.value.$cstNode;if(!n)return[];let i=ur(n,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);return i?this.getReferences(i,r,e):[]}getReferences(e,r,n){let i=[],o=this.references.findDeclaration(e);if(o){let s={includeDeclaration:r.context.includeDeclaration};this.references.findReferences(o,s).forEach(a=>{i.push(rk.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}};var nk=Ie(Xe(),1);var Md=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,r){let n={},i=e.parseResult.value.$cstNode;if(!i)return;let o=e.textDocument.offsetAt(r.position),s=ur(i,o,this.grammarConfig.nameRegexp);if(!s)return;let a=this.references.findDeclaration(s);if(!a)return;let c={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(a,c).forEach(p=>{let m=nk.TextEdit.replace(p.segment.range,r.newName),T=p.sourceUri.toString();n[T]?n[T].push(m):n[T]=[m]}),{changes:n}}prepareRename(e,r){return this.renameNodeRange(e,r.position)}renameNodeRange(e,r){let n=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(r);if(n&&i){let o=ur(n,i,this.grammarConfig.nameRegexp);if(!o)return;if(this.references.findDeclaration(o)||this.isNameNode(o))return o.range}}isNameNode(e){return e?.astNode&&wu(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}};var b$=Ie(Xe(),1);var ik=Ie(Xe(),1);var $d=class{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,r=ik.CancellationToken.None){let n=[],i=e.query.toLowerCase();for(let o of this.indexManager.allElements())if(await _t(r),this.fuzzyMatcher.match(i,o.name)){let s=this.getWorkspaceSymbol(o);s&&n.push(s)}return n}getWorkspaceSymbol(e){let r=e.nameSegment;if(r)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:r.range,uri:e.documentUri.toString()}}}};var qd=class extends Ka{constructor(e){super(e),this.documents=e.shared.workspace.LangiumDocuments}collectLocationLinks(e,r){var n,i,o,s,a,c;let f="path";if(qf(e.astNode)&&((n=Ba(e))===null||n===void 0?void 0:n.feature)===f){let p=ho(this.documents,e.astNode);if(p?.$document){let m=(i=this.findTargetObject(p))!==null&&i!==void 0?i:p,T=(s=(o=this.nameProvider.getNameNode(m))===null||o===void 0?void 0:o.range)!==null&&s!==void 0?s:Uu.Range.create(0,0,0,0),k=(c=(a=m.$cstNode)===null||a===void 0?void 0:a.range)!==null&&c!==void 0?c:Uu.Range.create(0,0,0,0);return[Uu.LocationLink.create(p.$document.uri.toString(),k,T,e.range)]}return}return super.collectLocationLinks(e,r)}findTargetObject(e){return e.isDeclared?e:Fo(e).head()}};var rv=Ie(Xe(),1);var Fd=class extends kd{getIncomingCalls(e,r){if(!Z(e))return;let n=new Map;if(r.forEach(i=>{let s=this.documents.getOrCreateDocument(i.sourceUri).parseResult.value;if(!s.$cstNode)return;let a=un(s.$cstNode,i.segment.offset);if(!a)return;let c=Ze(a.astNode,Z);if(!c||!c.$cstNode)return;let f=this.nameProvider.getNameNode(c);if(!f)return;let p=i.sourceUri.toString(),m=p+"@"+f.text;n.has(m)?n.set(m,{parserRule:c.$cstNode,nameNode:f,targetNodes:[...n.get(m).targetNodes,a],docUri:p}):n.set(m,{parserRule:c.$cstNode,nameNode:f,targetNodes:[a],docUri:p})}),n.size!==0)return Array.from(n.values()).map(i=>({from:{kind:rv.SymbolKind.Method,name:i.nameNode.text,range:i.parserRule.range,selectionRange:i.nameNode.range,uri:i.docUri},fromRanges:i.targetNodes.map(o=>o.range)}))}getOutgoingCalls(e){if(!Z(e))return;let r=bt(e).filter(Qe).toArray(),n=new Map;if(r.forEach(i=>{var o;let s=i.$cstNode;if(!s)return;let a=(o=i.rule.ref)===null||o===void 0?void 0:o.$cstNode;if(!a)return;let c=this.nameProvider.getNameNode(a.astNode);if(!c)return;let f=Se(a.astNode).uri.toString(),p=f+"@"+c.text;n.has(p)?n.set(p,{refCstNode:a,to:c,from:[...n.get(p).from,s.range],docUri:f}):n.set(p,{refCstNode:a,to:c,from:[s.range],docUri:f})}),n.size!==0)return Array.from(n.values()).map(i=>({to:{kind:rv.SymbolKind.Method,name:i.to.text,range:i.refCstNode.range,selectionRange:i.to.range,uri:i.docUri},fromRanges:i.from}))}};var jd=class{constructor(e){this.documents=e.shared.workspace.LangiumDocuments}collectValidationResources(e){let r=$S(e,this.documents);return{typeToValidationInfo:this.collectValidationInfo(r),typeToSuperProperties:this.collectSuperProperties(r)}}collectValidationInfo({astResources:e,inferred:r,declared:n}){let i=new Map,o=_$(e);for(let a of Yf(r))i.set(a.name,{inferred:a,inferredNodes:o.get(a.name)});let s=ke(e.interfaces).concat(e.types).reduce((a,c)=>a.set(c.name,c),new Map);for(let a of Yf(n)){let c=s.get(a.name);if(c){let f=i.get(a.name);i.set(a.name,Object.assign(Object.assign({},f??{}),{declared:a,declaredNode:c}))}}return i}collectSuperProperties({inferred:e,declared:r}){let n=new Map,i=Cy(e,r),o=new Map(i.map(s=>[s.name,s]));for(let s of Cy(e,r))n.set(s.name,this.addSuperProperties(s,o,new Set));return n}addSuperProperties(e,r,n){if(n.has(e.name))return[];n.add(e.name);let i=[...e.properties];for(let o of e.superTypes){let s=r.get(o.name);s&&i.push(...this.addSuperProperties(s,r,n))}return i}};function _$({parserRules:t,datatypeRules:e}){let r=new Ye;ke(t).concat(e).forEach(i=>r.add(Ms(i),i));function n(i){if(Je(i)){let o=La(i);o&&r.add(o,i)}(xn(i)||gr(i)||bn(i))&&i.elements.forEach(o=>n(o))}return t.forEach(i=>n(i.definition)),r}function ok(t){return t&&"declared"in t}function sk(t){return t&&"inferred"in t}function ak(t){return t&&"inferred"in t&&"declared"in t}function uk(t){let e=t.validation.ValidationRegistry,r=t.validation.LangiumGrammarTypesValidator,n={Action:[r.checkActionIsNotUnionType],Grammar:[r.checkDeclaredTypesConsistency,r.checkDeclaredAndInferredTypesConsistency],Interface:[r.checkCyclicInterface],Type:[r.checkCyclicType]};e.register(n,r)}var Ud=class{checkCyclicType(e,r){Go(e,new Set)&&r("error",`Type alias '${e.name}' circularly references itself.`,{node:e,property:"name"})}checkCyclicInterface(e,r){Go(e,new Set)&&r("error",`Type '${e.name}' recursively references itself as a base type.`,{node:e,property:"name"})}checkDeclaredTypesConsistency(e,r){var n;let i=(n=e.$document)===null||n===void 0?void 0:n.validationResources;if(i){for(let o of i.typeToValidationInfo.values())if(ok(o)&&ai(o.declared)&&ln(o.declaredNode)){let s=o;k$(s,r),C$(s,r)}}}checkDeclaredAndInferredTypesConsistency(e,r){var n;let i=(n=e.$document)===null||n===void 0?void 0:n.validationResources;if(i)for(let o of i.typeToValidationInfo.values())sk(o)&&o.inferred instanceof Ca&&S$(o.inferred,r),ak(o)&&E$(o,i,r)}checkActionIsNotUnionType(e,r){hr(e.type)&&r("error","Actions cannot create union types.",{node:e,property:"type"})}};function Go(t,e){var r;if(e.has(t))return!0;if(e.add(t),hr(t))return Go(t.type,e);if(ln(t))return t.superTypes.some(n=>n.ref&&Go(n.ref,new Set(e)));if(Ur(t)){if(!((r=t.typeRef)===null||r===void 0)&&r.ref)return Go(t.typeRef.ref,e)}else{if(Ps(t))return Go(t.referenceType,e);if(Es(t))return Go(t.elementType,e);if(qn(t))return t.types.some(n=>Go(n,new Set(e)))}return!1}function S$(t,e){t.properties.forEach(r=>{var n;let i=_y(r.type);if(i.length>1){let o=a=>lo(a)?"ref":"other",s=o(i[0]);if(i.slice(1).some(a=>o(a)!==s)){let a=(n=r.astNodes.values().next())===null||n===void 0?void 0:n.value;a&&e("error",`Mixing a cross-reference with other types is not supported. Consider splitting property "${r.name}" into two or more different properties.`,{node:a})}}})}function k$({declared:t,declaredNode:e},r){Array.from(t.superTypes).forEach((n,i)=>{n&&(oi(n)&&r("error","Interfaces cannot extend union types.",{node:e,property:"superTypes",index:i}),n.declared||r("error","Extending an inferred type is discouraged.",{node:e,property:"superTypes",index:i}))})}function C$({declared:t,declaredNode:e},r){let n=t.properties.reduce((s,a)=>s.add(a.name,a),new Ye);for(let[s,a]of n.entriesGroupedByKey())if(a.length>1)for(let c of a)r("error",`Cannot have two properties with the same name '${s}'.`,{node:Array.from(c.astNodes)[0],property:"name"});let i=Array.from(t.superTypes);for(let s=0;s<i.length;s++)for(let a=s+1;a<i.length;a++){let c=i[s],f=i[a],p=ai(c)?c.superProperties:[],m=ai(f)?f.superProperties:[],T=w$(p,m);T.length>0&&r("error",`Cannot simultaneously inherit from '${c}' and '${f}'. Their ${T.map(k=>"'"+k+"'").join(", ")} properties are not identical.`,{node:e,property:"name"})}let o=new Set;for(let s of i){let a=ai(s)?s.superProperties:[];for(let c of a)o.add(c.name)}for(let s of t.properties)if(o.has(s.name)){let a=e.attributes.find(c=>c.name===s.name);a&&r("error",`Cannot redeclare property '${s.name}'. It is already inherited from another interface.`,{node:a,property:"name"})}}function w$(t,e){let r=[];for(let n of t){let i=e.find(o=>o.name===n.name);i&&!D$(n,i)&&r.push(n.name)}return r}function D$(t,e){return ku(t.type,e.type)&&ku(e.type,t.type)}function E$(t,e,r){let{inferred:n,declared:i,declaredNode:o,inferredNodes:s}=t,a=i.name,c=m=>T=>s.forEach(k=>r("error",`${T}${m?` ${m}`:""}.`,k?.inferredType?{node:k?.inferredType,property:"name"}:{node:k,property:Je(k)?"type":"name"})),f=(m,T)=>m.forEach(k=>r("error",T,{node:k,property:je(k)||Je(k)?"feature":"name"})),p=m=>{s.forEach(T=>{Z(T)&&Ia(T.definition).find(A=>A.feature===m)===void 0&&r("error",`Property '${m}' is missing in a rule '${T.name}', but is required in type '${a}'.`,{node:T,property:"parameters"})})};if(oi(n)&&oi(i))P$(n.type,i.type,c(`in a rule that returns type '${a}'`));else if(ai(n)&&ai(i))A$(n,i,e,c(`in a rule that returns type '${a}'`),f,p);else{let m=`Inferred and declared versions of type '${a}' both have to be interfaces or unions.`;c()(m),r("error",m,{node:o,property:"name"})}}function P$(t,e,r){ku(t,e)||r(`Cannot assign type '${si(t,"DeclaredType")}' to '${si(e,"DeclaredType")}'`)}function ck(t){return t.optional||Vf(t.type)}function A$(t,e,r,n,i,o){let s=new Set(t.properties.map(m=>m.name)),a=new Map(t.allProperties.map(m=>[m.name,m])),c=new Map(e.superProperties.map(m=>[m.name,m])),f=m=>{if(lr(m))return{types:m.types.map(T=>f(T))};if(lo(m))return{referenceType:f(m.referenceType)};if(fo(m))return{elementType:f(m.elementType)};if(_n(m)){let T=r.typeToValidationInfo.get(m.value.name);return T?{value:"declared"in T?T.declared:T.inferred}:m}return m};for(let[m,T]of a.entries()){let k=c.get(m);if(k){let A=si(T.type,"DeclaredType"),N=si(k.type,"DeclaredType");if(!ku(f(T.type),k.type)&&N!=="unknown"){let P=`The assigned type '${A}' is not compatible with the declared property '${m}' of type '${N}'.`;i(T.astNodes,P)}T.optional&&!ck(k)&&o(m)}else s.has(m)&&i(T.astNodes,`A property '${m}' is not expected.`)}let p=new Set;for(let[m,T]of c.entries())!a.get(m)&&!ck(T)&&p.add(m);if(p.size>0){let m=p.size>1?"Properties":"A property",T=p.size>1?"are expected":"is expected",k=Array.from(p).map(A=>`'${A}'`).sort().join(", ");n(`${m} ${k} ${T}.`)}}var N$={validation:{LangiumGrammarValidator:t=>new id(t),ValidationResourcesCollector:t=>new jd(t),LangiumGrammarTypesValidator:()=>new Ud},lsp:{FoldingRangeProvider:t=>new yd(t),CodeActionProvider:t=>new dd(t),SemanticTokenProvider:t=>new bd(t),Formatter:()=>new Rd,DefinitionProvider:t=>new qd(t),CallHierarchyProvider:t=>new Fd(t),CompletionProvider:t=>new gd(t)},references:{ScopeComputation:t=>new ld(t),ScopeProvider:t=>new ud(t),References:t=>new Sd(t),NameProvider:()=>new _d}};function lk(t,e){let r=ws(Hu(t),qS,e),n=ws(Wu({shared:r}),FS,N$);return I$(r,n),r.ServiceRegistry.register(n),xS(n),uk(n),{shared:r,grammar:n}}function I$(t,e){t.workspace.DocumentBuilder.onBuildPhase(nt.IndexedReferences,async(n,i)=>{for(let o of n){await _t(i);let s=e.validation.ValidationResourcesCollector,a=o.parseResult.value;o.validationResources=s.collectValidationResources(a)}})}var nv=class{readFile(){throw new Error("Method not implemented.")}readFileSync(){throw new Error("Method not implemented.")}async readDirectory(){return[]}},Wd={fileSystemProvider:()=>new nv};function hd(t){return t.rules.find(e=>Z(e)&&e.entry)}function O$(t){return t.rules.filter(e=>He(e)&&e.hidden)}function Na(t,e){let r=new Set,n=hd(t);if(!n)return new Set(t.rules);let i=[n].concat(O$(t));for(let s of i)fk(s,r,e);let o=new Set;for(let s of t.rules)(r.has(s.name)||He(s)&&s.hidden)&&o.add(s);return o}function fk(t,e,r){e.add(t.name),bt(t).forEach(n=>{if(Qe(n)||r&&Uf(n)){let i=n.rule.ref;i&&!e.has(i.name)&&fk(i,e,r)}})}function md(t){if(t.terminal)return t.terminal;if(t.type.ref){let e=Mu(t.type.ref);return e?.terminal}}function dk(t){return t.hidden&&!Un(t).test(" ")}function jo(t,e){return!t||!e?[]:iv(t,e,t.astNode,!0)}function wr(t,e,r){if(!t||!e)return;let n=iv(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function iv(t,e,r,n){if(!n){let i=Ze(t.grammarSource,je);if(i&&i.feature===e)return[t]}return Ei(t)&&t.astNode===r?t.content.flatMap(i=>iv(i,e,r,!1)):[]}function Td(t,e){return t?pk(t,e,t?.astNode):[]}function Fn(t,e,r){if(!t)return;let n=pk(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function pk(t,e,r){if(t.astNode!==r)return[];if(jt(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=uy(t).iterator(),i,o=[];do if(i=n.next(),!i.done){let s=i.value;s.astNode===r?jt(s.grammarSource)&&s.grammarSource.value===e&&o.push(s):n.prune()}while(!i.done);return o}function Ba(t){var e;let r=t.astNode;for(;r===((e=t.container)===null||e===void 0?void 0:e.astNode);){let n=Ze(t.grammarSource,je);if(n)return n;t=t.container}}function Mu(t){return Ra(t)&&(t=t.$container),mk(t,new Map)}function mk(t,e){var r;function n(i,o){let s;return Ze(i,je)||(s=mk(o,e)),e.set(t,s),s}if(e.has(t))return e.get(t);e.set(t,void 0);for(let i of bt(t)){if(je(i)&&i.feature.toLowerCase()==="name")return e.set(t,i),i;if(Qe(i)&&Z(i.rule.ref))return n(i,i.rule.ref);if(Ur(i)&&(!((r=i.typeRef)===null||r===void 0)&&r.ref))return n(i,i.typeRef.ref)}}function ed(t){var e;let r=lk(Wd).grammar,n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,Dr.parse(`memory://${(e=n.name)!==null&&e!==void 0?e:"grammar"}.langium`)),n}function hk(t){let e=[],r=t.Grammar;for(let n of r.rules)He(n)&&dk(n)&&fS(Un(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:ly}}var L$=typeof global=="object"&&global&&global.Object===Object&&global,Hd=L$;var M$=typeof self=="object"&&self&&self.Object===Object&&self,$$=Hd||M$||Function("return this")(),er=$$;var q$=er.Symbol,yr=q$;var gk=Object.prototype,F$=gk.hasOwnProperty,j$=gk.toString,Gu=yr?yr.toStringTag:void 0;function U$(t){var e=F$.call(t,Gu),r=t[Gu];try{t[Gu]=void 0;var n=!0}catch{}var i=j$.call(t);return n&&(e?t[Gu]=r:delete t[Gu]),i}var yk=U$;var W$=Object.prototype,H$=W$.toString;function G$(t){return H$.call(t)}var vk=G$;var B$="[object Null]",K$="[object Undefined]",Tk=yr?yr.toStringTag:void 0;function z$(t){return t==null?t===void 0?K$:B$:Tk&&Tk in Object(t)?yk(t):vk(t)}var Jr=z$;function V$(t){return t!=null&&typeof t=="object"}var Gt=V$;var X$="[object Symbol]";function Y$(t){return typeof t=="symbol"||Gt(t)&&Jr(t)==X$}var Ii=Y$;function J$(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Oi=J$;var Q$=Array.isArray,re=Q$;var Z$=1/0,Rk=yr?yr.prototype:void 0,xk=Rk?Rk.toString:void 0;function bk(t){if(typeof t=="string")return t;if(re(t))return Oi(t,bk)+"";if(Ii(t))return xk?xk.call(t):"";var e=t+"";return e=="0"&&1/t==-Z$?"-0":e}var _k=bk;var eq=/\s/;function tq(t){for(var e=t.length;e--&&eq.test(t.charAt(e)););return e}var Sk=tq;var rq=/^\s+/;function nq(t){return t&&t.slice(0,Sk(t)+1).replace(rq,"")}var kk=nq;function iq(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ot=iq;var Ck=0/0,oq=/^[-+]0x[0-9a-f]+$/i,sq=/^0b[01]+$/i,aq=/^0o[0-7]+$/i,cq=parseInt;function uq(t){if(typeof t=="number")return t;if(Ii(t))return Ck;if(Ot(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ot(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=kk(t);var r=sq.test(t);return r||aq.test(t)?cq(t.slice(2),r?2:8):oq.test(t)?Ck:+t}var wk=uq;var Dk=1/0,lq=17976931348623157e292;function fq(t){if(!t)return t===0?t:0;if(t=wk(t),t===Dk||t===-Dk){var e=t<0?-1:1;return e*lq}return t===t?t:0}var Ek=fq;function dq(t){var e=Ek(t),r=e%1;return e===e?r?e-r:e:0}var Li=dq;function pq(t){return t}var fn=pq;var mq="[object AsyncFunction]",hq="[object Function]",gq="[object GeneratorFunction]",yq="[object Proxy]";function vq(t){if(!Ot(t))return!1;var e=Jr(t);return e==hq||e==gq||e==mq||e==yq}var Qr=vq;var Tq=er["__core-js_shared__"],Gd=Tq;var Pk=function(){var t=/[^.]+$/.exec(Gd&&Gd.keys&&Gd.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Rq(t){return!!Pk&&Pk in t}var Ak=Rq;var xq=Function.prototype,bq=xq.toString;function _q(t){if(t!=null){try{return bq.call(t)}catch{}try{return t+""}catch{}}return""}var vo=_q;var Sq=/[\\^$.*+?()[\]{}|]/g,kq=/^\[object .+?Constructor\]$/,Cq=Function.prototype,wq=Object.prototype,Dq=Cq.toString,Eq=wq.hasOwnProperty,Pq=RegExp("^"+Dq.call(Eq).replace(Sq,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Aq(t){if(!Ot(t)||Ak(t))return!1;var e=Qr(t)?Pq:kq;return e.test(vo(t))}var Nk=Aq;function Nq(t,e){return t?.[e]}var Ik=Nq;function Iq(t,e){var r=Ik(t,e);return Nk(r)?r:void 0}var dn=Iq;var Oq=dn(er,"WeakMap"),Bd=Oq;var Ok=Object.create,Lq=function(){function t(){}return function(e){if(!Ot(e))return{};if(Ok)return Ok(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Lk=Lq;function Mq(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Mk=Mq;function $q(){}var Lt=$q;function qq(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var $k=qq;var Fq=800,jq=16,Uq=Date.now;function Wq(t){var e=0,r=0;return function(){var n=Uq(),i=jq-(n-r);if(r=n,i>0){if(++e>=Fq)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var qk=Wq;function Hq(t){return function(){return t}}var Fk=Hq;var Gq=function(){try{var t=dn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Va=Gq;var Bq=Va?function(t,e){return Va(t,"toString",{configurable:!0,enumerable:!1,value:Fk(e),writable:!0})}:fn,jk=Bq;var Kq=qk(jk),Uk=Kq;function zq(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var Kd=zq;function Vq(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var zd=Vq;function Xq(t){return t!==t}var Wk=Xq;function Yq(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var Hk=Yq;function Jq(t,e,r){return e===e?Hk(t,e,r):zd(t,Wk,r)}var Xa=Jq;function Qq(t,e){var r=t==null?0:t.length;return!!r&&Xa(t,e,0)>-1}var Vd=Qq;var Zq=9007199254740991,eF=/^(?:0|[1-9]\d*)$/;function tF(t,e){var r=typeof t;return e=e??Zq,!!e&&(r=="number"||r!="symbol"&&eF.test(t))&&t>-1&&t%1==0&&t<e}var Bo=tF;function rF(t,e,r){e=="__proto__"&&Va?Va(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Ya=rF;function nF(t,e){return t===e||t!==t&&e!==e}var Mi=nF;var iF=Object.prototype,oF=iF.hasOwnProperty;function sF(t,e,r){var n=t[e];(!(oF.call(t,e)&&Mi(n,r))||r===void 0&&!(e in t))&&Ya(t,e,r)}var Ko=sF;function aF(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=n?n(r[a],t[a],a,r,t):void 0;c===void 0&&(c=t[a]),i?Ya(r,a,c):Ko(r,a,c)}return r}var $i=aF;var Gk=Math.max;function cF(t,e,r){return e=Gk(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Gk(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Mk(t,this,a)}}var Bk=cF;function uF(t,e){return Uk(Bk(t,e,fn),t+"")}var Ja=uF;var lF=9007199254740991;function fF(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=lF}var Qa=fF;function dF(t){return t!=null&&Qa(t.length)&&!Qr(t)}var tr=dF;function pF(t,e,r){if(!Ot(r))return!1;var n=typeof e;return(n=="number"?tr(r)&&Bo(e,r.length):n=="string"&&e in r)?Mi(r[e],t):!1}var zo=pF;function mF(t){return Ja(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&zo(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}var Kk=mF;var hF=Object.prototype;function gF(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||hF;return t===r}var qi=gF;function yF(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var zk=yF;var vF="[object Arguments]";function TF(t){return Gt(t)&&Jr(t)==vF}var ov=TF;var Vk=Object.prototype,RF=Vk.hasOwnProperty,xF=Vk.propertyIsEnumerable,bF=ov(function(){return arguments}())?ov:function(t){return Gt(t)&&RF.call(t,"callee")&&!xF.call(t,"callee")},Vo=bF;function _F(){return!1}var Xk=_F;var Qk=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yk=Qk&&typeof module=="object"&&module&&!module.nodeType&&module,SF=Yk&&Yk.exports===Qk,Jk=SF?er.Buffer:void 0,kF=Jk?Jk.isBuffer:void 0,CF=kF||Xk,To=CF;var wF="[object Arguments]",DF="[object Array]",EF="[object Boolean]",PF="[object Date]",AF="[object Error]",NF="[object Function]",IF="[object Map]",OF="[object Number]",LF="[object Object]",MF="[object RegExp]",$F="[object Set]",qF="[object String]",FF="[object WeakMap]",jF="[object ArrayBuffer]",UF="[object DataView]",WF="[object Float32Array]",HF="[object Float64Array]",GF="[object Int8Array]",BF="[object Int16Array]",KF="[object Int32Array]",zF="[object Uint8Array]",VF="[object Uint8ClampedArray]",XF="[object Uint16Array]",YF="[object Uint32Array]",vt={};vt[WF]=vt[HF]=vt[GF]=vt[BF]=vt[KF]=vt[zF]=vt[VF]=vt[XF]=vt[YF]=!0;vt[wF]=vt[DF]=vt[jF]=vt[EF]=vt[UF]=vt[PF]=vt[AF]=vt[NF]=vt[IF]=vt[OF]=vt[LF]=vt[MF]=vt[$F]=vt[qF]=vt[FF]=!1;function JF(t){return Gt(t)&&Qa(t.length)&&!!vt[Jr(t)]}var Zk=JF;function QF(t){return function(e){return t(e)}}var Fi=QF;var eC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bu=eC&&typeof module=="object"&&module&&!module.nodeType&&module,ZF=Bu&&Bu.exports===eC,sv=ZF&&Hd.process,e1=function(){try{var t=Bu&&Bu.require&&Bu.require("util").types;return t||sv&&sv.binding&&sv.binding("util")}catch{}}(),Hn=e1;var tC=Hn&&Hn.isTypedArray,t1=tC?Fi(tC):Zk,Za=t1;var r1=Object.prototype,n1=r1.hasOwnProperty;function i1(t,e){var r=re(t),n=!r&&Vo(t),i=!r&&!n&&To(t),o=!r&&!n&&!i&&Za(t),s=r||n||i||o,a=s?zk(t.length,String):[],c=a.length;for(var f in t)(e||n1.call(t,f))&&!(s&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Bo(f,c)))&&a.push(f);return a}var Xd=i1;function o1(t,e){return function(r){return t(e(r))}}var Yd=o1;var s1=Yd(Object.keys,Object),rC=s1;var a1=Object.prototype,c1=a1.hasOwnProperty;function u1(t){if(!qi(t))return rC(t);var e=[];for(var r in Object(t))c1.call(t,r)&&r!="constructor"&&e.push(r);return e}var Jd=u1;function l1(t){return tr(t)?Xd(t):Jd(t)}var ut=l1;var f1=Object.prototype,d1=f1.hasOwnProperty,p1=Kk(function(t,e){if(qi(e)||tr(e)){$i(e,ut(e),t);return}for(var r in e)d1.call(e,r)&&Ko(t,r,e[r])}),Er=p1;function m1(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var nC=m1;var h1=Object.prototype,g1=h1.hasOwnProperty;function y1(t){if(!Ot(t))return nC(t);var e=qi(t),r=[];for(var n in t)n=="constructor"&&(e||!g1.call(t,n))||r.push(n);return r}var iC=y1;function v1(t){return tr(t)?Xd(t,!0):iC(t)}var Xo=v1;var T1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R1=/^\w*$/;function x1(t,e){if(re(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ii(t)?!0:R1.test(t)||!T1.test(t)||e!=null&&t in Object(e)}var ec=x1;var b1=dn(Object,"create"),Ro=b1;function _1(){this.__data__=Ro?Ro(null):{},this.size=0}var oC=_1;function S1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var sC=S1;var k1="__lodash_hash_undefined__",C1=Object.prototype,w1=C1.hasOwnProperty;function D1(t){var e=this.__data__;if(Ro){var r=e[t];return r===k1?void 0:r}return w1.call(e,t)?e[t]:void 0}var aC=D1;var E1=Object.prototype,P1=E1.hasOwnProperty;function A1(t){var e=this.__data__;return Ro?e[t]!==void 0:P1.call(e,t)}var cC=A1;var N1="__lodash_hash_undefined__";function I1(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ro&&e===void 0?N1:e,this}var uC=I1;function tc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}tc.prototype.clear=oC;tc.prototype.delete=sC;tc.prototype.get=aC;tc.prototype.has=cC;tc.prototype.set=uC;var av=tc;function O1(){this.__data__=[],this.size=0}var lC=O1;function L1(t,e){for(var r=t.length;r--;)if(Mi(t[r][0],e))return r;return-1}var Yo=L1;var M1=Array.prototype,$1=M1.splice;function q1(t){var e=this.__data__,r=Yo(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():$1.call(e,r,1),--this.size,!0}var fC=q1;function F1(t){var e=this.__data__,r=Yo(e,t);return r<0?void 0:e[r][1]}var dC=F1;function j1(t){return Yo(this.__data__,t)>-1}var pC=j1;function U1(t,e){var r=this.__data__,n=Yo(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var mC=U1;function rc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rc.prototype.clear=lC;rc.prototype.delete=fC;rc.prototype.get=dC;rc.prototype.has=pC;rc.prototype.set=mC;var Jo=rc;var W1=dn(er,"Map"),Qo=W1;function H1(){this.size=0,this.__data__={hash:new av,map:new(Qo||Jo),string:new av}}var hC=H1;function G1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var gC=G1;function B1(t,e){var r=t.__data__;return gC(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Zo=B1;function K1(t){var e=Zo(this,t).delete(t);return this.size-=e?1:0,e}var yC=K1;function z1(t){return Zo(this,t).get(t)}var vC=z1;function V1(t){return Zo(this,t).has(t)}var TC=V1;function X1(t,e){var r=Zo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var RC=X1;function nc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}nc.prototype.clear=hC;nc.prototype.delete=yC;nc.prototype.get=vC;nc.prototype.has=TC;nc.prototype.set=RC;var Fs=nc;var Y1="Expected a function";function cv(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Y1);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(cv.Cache||Fs),r}cv.Cache=Fs;var xC=cv;var J1=500;function Q1(t){var e=xC(t,function(n){return r.size===J1&&r.clear(),n}),r=e.cache;return e}var bC=Q1;var Z1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ej=/\\(\\)?/g,tj=bC(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Z1,function(r,n,i,o){e.push(i?o.replace(ej,"$1"):n||r)}),e}),_C=tj;function rj(t){return t==null?"":_k(t)}var SC=rj;function nj(t,e){return re(t)?t:ec(t,e)?[t]:_C(SC(t))}var es=nj;var ij=1/0;function oj(t){if(typeof t=="string"||Ii(t))return t;var e=t+"";return e=="0"&&1/t==-ij?"-0":e}var ji=oj;function sj(t,e){e=es(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[ji(e[r++])];return r&&r==n?t:void 0}var ic=sj;function aj(t,e,r){var n=t==null?void 0:ic(t,e);return n===void 0?r:n}var kC=aj;function cj(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var oc=cj;var CC=yr?yr.isConcatSpreadable:void 0;function uj(t){return re(t)||Vo(t)||!!(CC&&t&&t[CC])}var wC=uj;function DC(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=wC),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?DC(a,e-1,r,n,i):oc(i,a):n||(i[i.length]=a)}return i}var sc=DC;function lj(t){var e=t==null?0:t.length;return e?sc(t,1):[]}var Bt=lj;var fj=Yd(Object.getPrototypeOf,Object),Qd=fj;function dj(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var Zd=dj;function pj(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var EC=pj;function mj(){this.__data__=new Jo,this.size=0}var PC=mj;function hj(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var AC=hj;function gj(t){return this.__data__.get(t)}var NC=gj;function yj(t){return this.__data__.has(t)}var IC=yj;var vj=200;function Tj(t,e){var r=this.__data__;if(r instanceof Jo){var n=r.__data__;if(!Qo||n.length<vj-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Fs(n)}return r.set(t,e),this.size=r.size,this}var OC=Tj;function ac(t){var e=this.__data__=new Jo(t);this.size=e.size}ac.prototype.clear=PC;ac.prototype.delete=AC;ac.prototype.get=NC;ac.prototype.has=IC;ac.prototype.set=OC;var ts=ac;function Rj(t,e){return t&&$i(e,ut(e),t)}var LC=Rj;function xj(t,e){return t&&$i(e,Xo(e),t)}var MC=xj;var jC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$C=jC&&typeof module=="object"&&module&&!module.nodeType&&module,bj=$C&&$C.exports===jC,qC=bj?er.Buffer:void 0,FC=qC?qC.allocUnsafe:void 0;function _j(t,e){if(e)return t.slice();var r=t.length,n=FC?FC(r):new t.constructor(r);return t.copy(n),n}var UC=_j;function Sj(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var cc=Sj;function kj(){return[]}var ep=kj;var Cj=Object.prototype,wj=Cj.propertyIsEnumerable,WC=Object.getOwnPropertySymbols,Dj=WC?function(t){return t==null?[]:(t=Object(t),cc(WC(t),function(e){return wj.call(t,e)}))}:ep,uc=Dj;function Ej(t,e){return $i(t,uc(t),e)}var HC=Ej;var Pj=Object.getOwnPropertySymbols,Aj=Pj?function(t){for(var e=[];t;)oc(e,uc(t)),t=Qd(t);return e}:ep,tp=Aj;function Nj(t,e){return $i(t,tp(t),e)}var GC=Nj;function Ij(t,e,r){var n=e(t);return re(t)?n:oc(n,r(t))}var rp=Ij;function Oj(t){return rp(t,ut,uc)}var Ku=Oj;function Lj(t){return rp(t,Xo,tp)}var np=Lj;var Mj=dn(er,"DataView"),ip=Mj;var $j=dn(er,"Promise"),op=$j;var qj=dn(er,"Set"),rs=qj;var BC="[object Map]",Fj="[object Object]",KC="[object Promise]",zC="[object Set]",VC="[object WeakMap]",XC="[object DataView]",jj=vo(ip),Uj=vo(Qo),Wj=vo(op),Hj=vo(rs),Gj=vo(Bd),js=Jr;(ip&&js(new ip(new ArrayBuffer(1)))!=XC||Qo&&js(new Qo)!=BC||op&&js(op.resolve())!=KC||rs&&js(new rs)!=zC||Bd&&js(new Bd)!=VC)&&(js=function(t){var e=Jr(t),r=e==Fj?t.constructor:void 0,n=r?vo(r):"";if(n)switch(n){case jj:return XC;case Uj:return BC;case Wj:return KC;case Hj:return zC;case Gj:return VC}return e});var fi=js;var Bj=Object.prototype,Kj=Bj.hasOwnProperty;function zj(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Kj.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var YC=zj;var Vj=er.Uint8Array,lc=Vj;function Xj(t){var e=new t.constructor(t.byteLength);return new lc(e).set(new lc(t)),e}var fc=Xj;function Yj(t,e){var r=e?fc(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var JC=Yj;var Jj=/\w*$/;function Qj(t){var e=new t.constructor(t.source,Jj.exec(t));return e.lastIndex=t.lastIndex,e}var QC=Qj;var ZC=yr?yr.prototype:void 0,ew=ZC?ZC.valueOf:void 0;function Zj(t){return ew?Object(ew.call(t)):{}}var tw=Zj;function eU(t,e){var r=e?fc(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var rw=eU;var tU="[object Boolean]",rU="[object Date]",nU="[object Map]",iU="[object Number]",oU="[object RegExp]",sU="[object Set]",aU="[object String]",cU="[object Symbol]",uU="[object ArrayBuffer]",lU="[object DataView]",fU="[object Float32Array]",dU="[object Float64Array]",pU="[object Int8Array]",mU="[object Int16Array]",hU="[object Int32Array]",gU="[object Uint8Array]",yU="[object Uint8ClampedArray]",vU="[object Uint16Array]",TU="[object Uint32Array]";function RU(t,e,r){var n=t.constructor;switch(e){case uU:return fc(t);case tU:case rU:return new n(+t);case lU:return JC(t,r);case fU:case dU:case pU:case mU:case hU:case gU:case yU:case vU:case TU:return rw(t,r);case nU:return new n;case iU:case aU:return new n(t);case oU:return QC(t);case sU:return new n;case cU:return tw(t)}}var nw=RU;function xU(t){return typeof t.constructor=="function"&&!qi(t)?Lk(Qd(t)):{}}var iw=xU;var bU="[object Map]";function _U(t){return Gt(t)&&fi(t)==bU}var ow=_U;var sw=Hn&&Hn.isMap,SU=sw?Fi(sw):ow,aw=SU;var kU="[object Set]";function CU(t){return Gt(t)&&fi(t)==kU}var cw=CU;var uw=Hn&&Hn.isSet,wU=uw?Fi(uw):cw,lw=wU;var DU=1,EU=2,PU=4,fw="[object Arguments]",AU="[object Array]",NU="[object Boolean]",IU="[object Date]",OU="[object Error]",dw="[object Function]",LU="[object GeneratorFunction]",MU="[object Map]",$U="[object Number]",pw="[object Object]",qU="[object RegExp]",FU="[object Set]",jU="[object String]",UU="[object Symbol]",WU="[object WeakMap]",HU="[object ArrayBuffer]",GU="[object DataView]",BU="[object Float32Array]",KU="[object Float64Array]",zU="[object Int8Array]",VU="[object Int16Array]",XU="[object Int32Array]",YU="[object Uint8Array]",JU="[object Uint8ClampedArray]",QU="[object Uint16Array]",ZU="[object Uint32Array]",lt={};lt[fw]=lt[AU]=lt[HU]=lt[GU]=lt[NU]=lt[IU]=lt[BU]=lt[KU]=lt[zU]=lt[VU]=lt[XU]=lt[MU]=lt[$U]=lt[pw]=lt[qU]=lt[FU]=lt[jU]=lt[UU]=lt[YU]=lt[JU]=lt[QU]=lt[ZU]=!0;lt[OU]=lt[dw]=lt[WU]=!1;function sp(t,e,r,n,i,o){var s,a=e&DU,c=e&EU,f=e&PU;if(r&&(s=i?r(t,n,i,o):r(t)),s!==void 0)return s;if(!Ot(t))return t;var p=re(t);if(p){if(s=YC(t),!a)return $k(t,s)}else{var m=fi(t),T=m==dw||m==LU;if(To(t))return UC(t,a);if(m==pw||m==fw||T&&!i){if(s=c||T?{}:iw(t),!a)return c?GC(t,MC(s,t)):HC(t,LC(s,t))}else{if(!lt[m])return i?t:{};s=nw(t,m,a)}}o||(o=new ts);var k=o.get(t);if(k)return k;o.set(t,s),lw(t)?t.forEach(function(O){s.add(sp(O,e,r,O,t,o))}):aw(t)&&t.forEach(function(O,P){s.set(P,sp(O,e,r,P,t,o))});var A=f?c?np:Ku:c?Xo:ut,N=p?void 0:A(t);return Kd(N||t,function(O,P){N&&(P=O,O=t[P]),Ko(s,P,sp(O,e,r,P,t,o))}),s}var mw=sp;var eW=4;function tW(t){return mw(t,eW)}var ft=tW;function rW(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var Ui=rW;var nW="__lodash_hash_undefined__";function iW(t){return this.__data__.set(t,nW),this}var hw=iW;function oW(t){return this.__data__.has(t)}var gw=oW;function ap(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Fs;++e<r;)this.add(t[e])}ap.prototype.add=ap.prototype.push=hw;ap.prototype.has=gw;var dc=ap;function sW(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var cp=sW;function aW(t,e){return t.has(e)}var pc=aW;var cW=1,uW=2;function lW(t,e,r,n,i,o){var s=r&cW,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var f=o.get(t),p=o.get(e);if(f&&p)return f==e&&p==t;var m=-1,T=!0,k=r&uW?new dc:void 0;for(o.set(t,e),o.set(e,t);++m<a;){var A=t[m],N=e[m];if(n)var O=s?n(N,A,m,e,t,o):n(A,N,m,t,e,o);if(O!==void 0){if(O)continue;T=!1;break}if(k){if(!cp(e,function(P,y){if(!pc(k,y)&&(A===P||i(A,P,r,n,o)))return k.push(y)})){T=!1;break}}else if(!(A===N||i(A,N,r,n,o))){T=!1;break}}return o.delete(t),o.delete(e),T}var up=lW;function fW(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var yw=fW;function dW(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var mc=dW;var pW=1,mW=2,hW="[object Boolean]",gW="[object Date]",yW="[object Error]",vW="[object Map]",TW="[object Number]",RW="[object RegExp]",xW="[object Set]",bW="[object String]",_W="[object Symbol]",SW="[object ArrayBuffer]",kW="[object DataView]",vw=yr?yr.prototype:void 0,uv=vw?vw.valueOf:void 0;function CW(t,e,r,n,i,o,s){switch(r){case kW:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case SW:return!(t.byteLength!=e.byteLength||!o(new lc(t),new lc(e)));case hW:case gW:case TW:return Mi(+t,+e);case yW:return t.name==e.name&&t.message==e.message;case RW:case bW:return t==e+"";case vW:var a=yw;case xW:var c=n&pW;if(a||(a=mc),t.size!=e.size&&!c)return!1;var f=s.get(t);if(f)return f==e;n|=mW,s.set(t,e);var p=up(a(t),a(e),n,i,o,s);return s.delete(t),p;case _W:if(uv)return uv.call(t)==uv.call(e)}return!1}var Tw=CW;var wW=1,DW=Object.prototype,EW=DW.hasOwnProperty;function PW(t,e,r,n,i,o){var s=r&wW,a=Ku(t),c=a.length,f=Ku(e),p=f.length;if(c!=p&&!s)return!1;for(var m=c;m--;){var T=a[m];if(!(s?T in e:EW.call(e,T)))return!1}var k=o.get(t),A=o.get(e);if(k&&A)return k==e&&A==t;var N=!0;o.set(t,e),o.set(e,t);for(var O=s;++m<c;){T=a[m];var P=t[T],y=e[T];if(n)var h=s?n(y,P,T,e,t,o):n(P,y,T,t,e,o);if(!(h===void 0?P===y||i(P,y,r,n,o):h)){N=!1;break}O||(O=T=="constructor")}if(N&&!O){var C=t.constructor,M=e.constructor;C!=M&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof M=="function"&&M instanceof M)&&(N=!1)}return o.delete(t),o.delete(e),N}var Rw=PW;var AW=1,xw="[object Arguments]",bw="[object Array]",lp="[object Object]",NW=Object.prototype,_w=NW.hasOwnProperty;function IW(t,e,r,n,i,o){var s=re(t),a=re(e),c=s?bw:fi(t),f=a?bw:fi(e);c=c==xw?lp:c,f=f==xw?lp:f;var p=c==lp,m=f==lp,T=c==f;if(T&&To(t)){if(!To(e))return!1;s=!0,p=!1}if(T&&!p)return o||(o=new ts),s||Za(t)?up(t,e,r,n,i,o):Tw(t,e,c,r,n,i,o);if(!(r&AW)){var k=p&&_w.call(t,"__wrapped__"),A=m&&_w.call(e,"__wrapped__");if(k||A){var N=k?t.value():t,O=A?e.value():e;return o||(o=new ts),i(N,O,r,n,o)}}return T?(o||(o=new ts),Rw(t,e,r,n,i,o)):!1}var Sw=IW;function kw(t,e,r,n,i){return t===e?!0:t==null||e==null||!Gt(t)&&!Gt(e)?t!==t&&e!==e:Sw(t,e,r,n,kw,i)}var fp=kw;var OW=1,LW=2;function MW(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var c=a[0],f=t[c],p=a[1];if(s&&a[2]){if(f===void 0&&!(c in t))return!1}else{var m=new ts;if(n)var T=n(f,p,c,t,e,m);if(!(T===void 0?fp(p,f,OW|LW,n,m):T))return!1}}return!0}var Cw=MW;function $W(t){return t===t&&!Ot(t)}var dp=$W;function qW(t){for(var e=ut(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,dp(i)]}return e}var ww=qW;function FW(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var pp=FW;function jW(t){var e=ww(t);return e.length==1&&e[0][2]?pp(e[0][0],e[0][1]):function(r){return r===t||Cw(r,t,e)}}var Dw=jW;function UW(t,e){return t!=null&&e in Object(t)}var Ew=UW;function WW(t,e,r){e=es(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=ji(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Qa(i)&&Bo(s,i)&&(re(t)||Vo(t)))}var mp=WW;function HW(t,e){return t!=null&&mp(t,e,Ew)}var Pw=HW;var GW=1,BW=2;function KW(t,e){return ec(t)&&dp(e)?pp(ji(t),e):function(r){var n=kC(r,t);return n===void 0&&n===e?Pw(r,t):fp(e,n,GW|BW)}}var Aw=KW;function zW(t){return function(e){return e?.[t]}}var Nw=zW;function VW(t){return function(e){return ic(e,t)}}var Iw=VW;function XW(t){return ec(t)?Nw(ji(t)):Iw(t)}var Ow=XW;function YW(t){return typeof t=="function"?t:t==null?fn:typeof t=="object"?re(t)?Aw(t[0],t[1]):Dw(t):Ow(t)}var Ut=YW;function JW(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}var Lw=JW;function QW(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var c=s[t?a:++i];if(r(o[c],c,o)===!1)break}return e}}var Mw=QW;var ZW=Mw(),$w=ZW;function eH(t,e){return t&&$w(t,e,ut)}var qw=eH;function tH(t,e){return function(r,n){if(r==null)return r;if(!tr(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var Fw=tH;var rH=Fw(qw),pn=rH;function nH(t,e,r,n){return pn(t,function(i,o,s){e(n,i,r(i),s)}),n}var jw=nH;function iH(t,e){return function(r,n){var i=re(r)?Lw:jw,o=e?e():{};return i(r,t,Ut(n,2),o)}}var Uw=iH;var Ww=Object.prototype,oH=Ww.hasOwnProperty,sH=Ja(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&zo(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=Xo(o),a=-1,c=s.length;++a<c;){var f=s[a],p=t[f];(p===void 0||Mi(p,Ww[f])&&!oH.call(t,f))&&(t[f]=o[f])}return t}),hc=sH;function aH(t){return Gt(t)&&tr(t)}var lv=aH;function cH(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var hp=cH;var uH=200;function lH(t,e,r,n){var i=-1,o=Vd,s=!0,a=t.length,c=[],f=e.length;if(!a)return c;r&&(e=Oi(e,Fi(r))),n?(o=hp,s=!1):e.length>=uH&&(o=pc,s=!1,e=new dc(e));e:for(;++i<a;){var p=t[i],m=r==null?p:r(p);if(p=n||p!==0?p:0,s&&m===m){for(var T=f;T--;)if(e[T]===m)continue e;c.push(p)}else o(e,m,n)||c.push(p)}return c}var Hw=lH;var fH=Ja(function(t,e){return lv(t)?Hw(t,sc(e,1,lv,!0)):[]}),ns=fH;function dH(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var Wi=dH;function pH(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Li(e),Zd(t,e<0?0:e,n)):[]}var Kt=pH;function mH(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Li(e),e=n-e,Zd(t,0,e<0?0:e)):[]}var xo=mH;function hH(t){return typeof t=="function"?t:fn}var Gw=hH;function gH(t,e){var r=re(t)?Kd:pn;return r(t,Gw(e))}var Q=gH;function yH(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var Bw=yH;function vH(t,e){var r=!0;return pn(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var Kw=vH;function TH(t,e,r){var n=re(t)?Bw:Kw;return r&&zo(t,e,r)&&(e=void 0),n(t,Ut(e,3))}var Gr=TH;function RH(t,e){var r=[];return pn(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var gp=RH;function xH(t,e){var r=re(t)?cc:gp;return r(t,Ut(e,3))}var vr=xH;function bH(t){return function(e,r,n){var i=Object(e);if(!tr(e)){var o=Ut(r,3);e=ut(e),r=function(a){return o(i[a],a,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}var zw=bH;var _H=Math.max;function SH(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Li(r);return i<0&&(i=_H(n+i,0)),zd(t,Ut(e,3),i)}var Vw=SH;var kH=zw(Vw),Hi=kH;function CH(t){return t&&t.length?t[0]:void 0}var Tr=CH;function wH(t,e){var r=-1,n=tr(t)?Array(t.length):[];return pn(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Xw=wH;function DH(t,e){var r=re(t)?Oi:Xw;return r(t,Ut(e,3))}var B=DH;function EH(t,e){return sc(B(t,e),1)}var Pr=EH;var PH=Object.prototype,AH=PH.hasOwnProperty,NH=Uw(function(t,e,r){AH.call(t,r)?t[r].push(e):Ya(t,r,[e])}),fv=NH;var IH=Object.prototype,OH=IH.hasOwnProperty;function LH(t,e){return t!=null&&OH.call(t,e)}var Yw=LH;function MH(t,e){return t!=null&&mp(t,e,Yw)}var ee=MH;var $H="[object String]";function qH(t){return typeof t=="string"||!re(t)&&Gt(t)&&Jr(t)==$H}var fr=qH;function FH(t,e){return Oi(e,function(r){return t[r]})}var Jw=FH;function jH(t){return t==null?[]:Jw(t,ut(t))}var it=jH;var UH=Math.max;function WH(t,e,r,n){t=tr(t)?t:it(t),r=r&&!n?Li(r):0;var i=t.length;return r<0&&(r=UH(i+r,0)),fr(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Xa(t,e,r)>-1}var St=WH;var HH=Math.max;function GH(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Li(r);return i<0&&(i=HH(n+i,0)),Xa(t,e,i)}var yp=GH;var BH="[object Map]",KH="[object Set]",zH=Object.prototype,VH=zH.hasOwnProperty;function XH(t){if(t==null)return!0;if(tr(t)&&(re(t)||typeof t=="string"||typeof t.splice=="function"||To(t)||Za(t)||Vo(t)))return!t.length;var e=fi(t);if(e==BH||e==KH)return!t.size;if(qi(t))return!Jd(t).length;for(var r in t)if(VH.call(t,r))return!1;return!0}var Ee=XH;var YH="[object RegExp]";function JH(t){return Gt(t)&&Jr(t)==YH}var Qw=JH;var Zw=Hn&&Hn.isRegExp,QH=Zw?Fi(Zw):Qw,Gn=QH;function ZH(t){return t===void 0}var Br=ZH;function eG(t,e){return t<e}var eD=eG;function tG(t,e,r){for(var n=-1,i=t.length;++n<i;){var o=t[n],s=e(o);if(s!=null&&(a===void 0?s===s&&!Ii(s):r(s,a)))var a=s,c=o}return c}var tD=tG;function rG(t){return t&&t.length?tD(t,fn,eD):void 0}var rD=rG;var nG="Expected a function";function iG(t){if(typeof t!="function")throw new TypeError(nG);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var nD=iG;function oG(t,e,r,n){if(!Ot(t))return t;e=es(e,t);for(var i=-1,o=e.length,s=o-1,a=t;a!=null&&++i<o;){var c=ji(e[i]),f=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=s){var p=a[c];f=n?n(p,c,a):void 0,f===void 0&&(f=Ot(p)?p:Bo(e[i+1])?[]:{})}Ko(a,c,f),a=a[c]}return t}var iD=oG;function sG(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=ic(t,s);r(a,s)&&iD(o,es(s,t),a)}return o}var oD=sG;function aG(t,e){if(t==null)return{};var r=Oi(np(t),function(n){return[n]});return e=Ut(e),oD(t,r,function(n,i){return e(n,i[0])})}var mn=aG;function cG(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var sD=cG;function uG(t,e,r){var n=re(t)?EC:sD,i=arguments.length<3;return n(t,Ut(e,4),r,i,pn)}var Mt=uG;function lG(t,e){var r=re(t)?cc:gp;return r(t,nD(Ut(e,3)))}var is=lG;function fG(t,e){var r;return pn(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var aD=fG;function dG(t,e,r){var n=re(t)?cp:aD;return r&&zo(t,e,r)&&(e=void 0),n(t,Ut(e,3))}var zu=dG;var pG=1/0,mG=rs&&1/mc(new rs([,-0]))[1]==pG?function(t){return new rs(t)}:Lt,cD=mG;var hG=200;function gG(t,e,r){var n=-1,i=Vd,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=hp;else if(o>=hG){var f=e?null:cD(t);if(f)return mc(f);s=!1,i=pc,c=new dc}else c=e?[]:a;e:for(;++n<o;){var p=t[n],m=e?e(p):p;if(p=r||p!==0?p:0,s&&m===m){for(var T=c.length;T--;)if(c[T]===m)continue e;e&&c.push(m),a.push(p)}else i(c,m,r)||(c!==a&&c.push(m),a.push(p))}return a}var vp=gG;function yG(t){return t&&t.length?vp(t):[]}var gc=yG;function vG(t,e){return t&&t.length?vp(t,Ut(e,2)):[]}var uD=vG;function yc(t){console&&console.error&&console.error(`Error: ${t}`)}function Vu(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Xu(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Yu(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function TG(t){return RG(t)?t.LABEL:t.name}function RG(t){return fr(t.LABEL)&&t.LABEL!==""}var Dn=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Q(this.definition,r=>{r.accept(e)})}},Be=class extends Dn{constructor(e){super([]),this.idx=1,Er(this,mn(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Zr=class extends Dn{constructor(e){super(e.definition),this.orgText="",Er(this,mn(e,r=>r!==void 0))}},dt=class extends Dn{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Er(this,mn(e,r=>r!==void 0))}},Ke=class extends Dn{constructor(e){super(e.definition),this.idx=1,Er(this,mn(e,r=>r!==void 0))}},pt=class extends Dn{constructor(e){super(e.definition),this.idx=1,Er(this,mn(e,r=>r!==void 0))}},mt=class extends Dn{constructor(e){super(e.definition),this.idx=1,Er(this,mn(e,r=>r!==void 0))}},Oe=class extends Dn{constructor(e){super(e.definition),this.idx=1,Er(this,mn(e,r=>r!==void 0))}},st=class extends Dn{constructor(e){super(e.definition),this.idx=1,Er(this,mn(e,r=>r!==void 0))}},at=class extends Dn{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Er(this,mn(e,r=>r!==void 0))}},Pe=class{constructor(e){this.idx=1,Er(this,mn(e,r=>r!==void 0))}accept(e){e.visit(this)}};function Tp(t){return B(t,vc)}function vc(t){function e(r){return B(r,vc)}if(t instanceof Be){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return fr(t.label)&&(r.label=t.label),r}else{if(t instanceof dt)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ke)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof pt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof mt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:vc(new Pe({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof st)return{type:"RepetitionWithSeparator",idx:t.idx,separator:vc(new Pe({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Oe)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof at)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Pe){let r={type:"Terminal",name:t.terminalType.name,label:TG(t.terminalType),idx:t.idx};fr(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Gn(n)?n.source:n),r}else{if(t instanceof Zr)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var en=class{visit(e){let r=e;switch(r.constructor){case Be:return this.visitNonTerminal(r);case dt:return this.visitAlternative(r);case Ke:return this.visitOption(r);case pt:return this.visitRepetitionMandatory(r);case mt:return this.visitRepetitionMandatoryWithSeparator(r);case st:return this.visitRepetitionWithSeparator(r);case Oe:return this.visitRepetition(r);case at:return this.visitAlternation(r);case Pe:return this.visitTerminal(r);case Zr:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function dv(t){return t instanceof dt||t instanceof Ke||t instanceof Oe||t instanceof pt||t instanceof mt||t instanceof st||t instanceof Pe||t instanceof Zr}function Us(t,e=[]){return t instanceof Ke||t instanceof Oe||t instanceof st?!0:t instanceof at?zu(t.definition,n=>Us(n,e)):t instanceof Be&&St(e,t)?!1:t instanceof Dn?(t instanceof Be&&e.push(t),Gr(t.definition,n=>Us(n,e))):!1}function pv(t){return t instanceof at}function hn(t){if(t instanceof Be)return"SUBRULE";if(t instanceof Ke)return"OPTION";if(t instanceof at)return"OR";if(t instanceof pt)return"AT_LEAST_ONE";if(t instanceof mt)return"AT_LEAST_ONE_SEP";if(t instanceof st)return"MANY_SEP";if(t instanceof Oe)return"MANY";if(t instanceof Pe)return"CONSUME";throw Error("non exhaustive match")}var bo=class{walk(e,r=[]){Q(e.definition,(n,i)=>{let o=Kt(e.definition,i+1);if(n instanceof Be)this.walkProdRef(n,o,r);else if(n instanceof Pe)this.walkTerminal(n,o,r);else if(n instanceof dt)this.walkFlat(n,o,r);else if(n instanceof Ke)this.walkOption(n,o,r);else if(n instanceof pt)this.walkAtLeastOne(n,o,r);else if(n instanceof mt)this.walkAtLeastOneSep(n,o,r);else if(n instanceof st)this.walkManySep(n,o,r);else if(n instanceof Oe)this.walkMany(n,o,r);else if(n instanceof at)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Ke({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=lD(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Ke({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=lD(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);Q(e.definition,o=>{let s=new dt({definition:[o]});this.walk(s,i)})}};function lD(t,e,r){return[new Ke({definition:[new Pe({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Ws(t){if(t instanceof Be)return Ws(t.referencedRule);if(t instanceof Pe)return _G(t);if(dv(t))return xG(t);if(pv(t))return bG(t);throw Error("non exhaustive match")}function xG(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=Us(o),e=e.concat(Ws(o)),n=n+1,i=r.length>n;return gc(e)}function bG(t){let e=B(t.definition,r=>Ws(r));return gc(Bt(e))}function _G(t){return[t.terminalType]}var Rp="_~IN~_";var mv=class extends bo{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=SG(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new dt({definition:o}),a=Ws(s);this.follows[i]=a}};function fD(t){let e={};return Q(t,r=>{let n=new mv(r).startWalking();Er(e,n)}),e}function SG(t,e){return t.name+e+Rp}var xp={},kG=new Is;function Tc(t){let e=t.toString();if(xp.hasOwnProperty(e))return xp[e];{let r=kG.pattern(e);return xp[e]=r,r}}function dD(){xp={}}var mD="Complement Sets are not supported for first char optimization",Ju=`Unable to use "first char" lexer optimizations:
87
- `;function hD(t,e=!1){try{let r=Tc(t);return hv(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===mD)e&&Vu(`${Ju} Unable to optimize: < ${t.toString()} >
88
+ `.repeat(a)}${o}`,range:e}}fitIntoOptions(e,r,n){return n.allowMore?e=Math.max(r,e):n.allowLess&&(e=Math.min(r,e)),e}findFittingMove(e,r,n){if(r.length===0)return;if(r.length===1)return r[0];let i=e.end.line-e.start.line;for(let o of r){if(o.lines!==void 0&&i<=o.lines)return o;if(o.lines===void 0&&i===0)return o}return r[r.length-1]}iterateCstTree(e,r){let i=e.parseResult.value.$cstNode;return i?new Dn(i,o=>this.iterateCst(o,r)):va}iterateCst(e,r){if(!xi(e))return va;let n=r.indentation;return new pn(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(r.indentation=n,Kr))}},Mv=class{constructor(e,r){this.astNode=e,this.collector=r}node(e){return new ci(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){let r=[];for(let n of e)n.$cstNode&&r.push(n.$cstNode);return new ci(r,this.collector)}property(e,r){let n=br(this.astNode.$cstNode,e,r);return new ci(n?[n]:[],this.collector)}properties(...e){let r=[];for(let n of e){let i=Io(this.astNode.$cstNode,n);r.push(...i)}return new ci(r,this.collector)}keyword(e,r){let n=In(this.astNode.$cstNode,e,r);return new ci(n?[n]:[],this.collector)}keywords(...e){let r=[];for(let n of e){let i=Nd(this.astNode.$cstNode,n);r.push(...i)}return new ci(r,this.collector)}cst(e){return new ci([...e],this.collector)}interior(e,r){let n=e.nodes,i=r.nodes;if(n.length!==1||i.length!==1)return new ci([],this.collector);let o=n[0],s=i[0];if(o.offset>s.offset){let a=o;o=s,s=a}return new ci(VS(o,s),this.collector)}},ci=class t{constructor(e,r){this.nodes=e,this.collector=r}prepend(e){for(let r of this.nodes)this.collector(r,"prepend",e);return this}append(e){for(let r of this.nodes)this.collector(r,"append",e);return this}surround(e){for(let r of this.nodes)this.collector(r,"prepend",e),this.collector(r,"append",e);return this}slice(e,r){return new t(this.nodes.slice(e,r),this.collector)}},Oe;(function(t){function e(...l){return{options:{},moves:l.flatMap(f=>f.moves).sort(u)}}t.fit=e;function r(l){return i(0,l)}t.noSpace=r;function n(l){return i(1,l)}t.oneSpace=n;function i(l,f){return{options:f??{},moves:[{characters:l}]}}t.spaces=i;function o(l){return s(1,l)}t.newLine=o;function s(l,f){return{options:f??{},moves:[{lines:l}]}}t.newLines=s;function a(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function c(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=c;function u(l,f){var g,T,C,P,O,E;let m=(g=l.lines)!==null&&g!==void 0?g:0,d=(T=f.lines)!==null&&T!==void 0?T:0,_=(C=l.tabs)!==null&&C!==void 0?C:0,$=(P=f.tabs)!==null&&P!==void 0?P:0,X=(O=l.characters)!==null&&O!==void 0?O:0,ke=(E=f.characters)!==null&&E!==void 0?E:0;return m<d?-1:m>d?1:_<$?-1:_>$?1:X<ke?-1:X>ke?1:0}})(Oe=Oe||(Oe={}));var Id=class extends Dd{format(e){if(Rr(e))this.getNodeFormatter(e).properties("type","terminal").surround(Oe.noSpace());else if(Q(e)){let r=this.getNodeFormatter(e);r.keywords("entry","fragment","returns").append(Oe.oneSpace()),(e.inferredType||e.returnType||e.dataType)&&e.parameters.length===0?r.property("name").append(Oe.oneSpace()):r.property("name").append(Oe.noSpace()),r.properties("parameters").append(Oe.noSpace()),r.keywords(",").append(Oe.oneSpace()),r.keywords("<").append(Oe.noSpace());let n=r.keyword(";"),i=r.keyword(":");i.prepend(Oe.noSpace()),r.interior(i,n).prepend(Oe.indent()),n.prepend(Oe.fit(Oe.noSpace(),Oe.newLine())),r.node(e).prepend(Oe.noIndent())}else if(We(e)){let r=this.getNodeFormatter(e);e.type&&(r.property("name").append(Oe.oneSpace()),r.keyword("returns").append(Oe.oneSpace())),r.keywords("hidden","terminal","fragment").append(Oe.oneSpace()),r.keyword(":").prepend(Oe.noSpace()),r.keyword(";").prepend(Oe.fit(Oe.noSpace(),Oe.newLine())),r.node(e).prepend(Oe.noIndent())}else if(Xe(e)){let r=this.getNodeFormatter(e);r.keyword("{").append(Oe.noSpace()),r.keywords(".","+=","=").surround(Oe.noSpace()),r.keyword("}").prepend(Oe.noSpace())}else if(xa(e))this.getNodeFormatter(e).keywords("infer","infers").append(Oe.oneSpace());else if(Fe(e))this.getNodeFormatter(e).keywords("=","+=","?=").surround(Oe.noSpace());else if(Ye(e)){let r=this.getNodeFormatter(e);r.keyword("<").surround(Oe.noSpace()),r.keyword(",").append(Oe.oneSpace()),r.properties("arguments").append(Oe.noSpace())}Ta(e)&&this.getNodeFormatter(e).property("cardinality").prepend(Oe.noSpace())}};var co=De(ze(),1);var _e=De(ze(),1);var qv={[_e.SemanticTokenTypes.class]:0,[_e.SemanticTokenTypes.comment]:1,[_e.SemanticTokenTypes.enum]:2,[_e.SemanticTokenTypes.enumMember]:3,[_e.SemanticTokenTypes.event]:4,[_e.SemanticTokenTypes.function]:5,[_e.SemanticTokenTypes.interface]:6,[_e.SemanticTokenTypes.keyword]:7,[_e.SemanticTokenTypes.macro]:8,[_e.SemanticTokenTypes.method]:9,[_e.SemanticTokenTypes.modifier]:10,[_e.SemanticTokenTypes.namespace]:11,[_e.SemanticTokenTypes.number]:12,[_e.SemanticTokenTypes.operator]:13,[_e.SemanticTokenTypes.parameter]:14,[_e.SemanticTokenTypes.property]:15,[_e.SemanticTokenTypes.regexp]:16,[_e.SemanticTokenTypes.string]:17,[_e.SemanticTokenTypes.struct]:18,[_e.SemanticTokenTypes.type]:19,[_e.SemanticTokenTypes.typeParameter]:20,[_e.SemanticTokenTypes.variable]:21},qw={[_e.SemanticTokenModifiers.abstract]:1,[_e.SemanticTokenModifiers.async]:2,[_e.SemanticTokenModifiers.declaration]:4,[_e.SemanticTokenModifiers.defaultLibrary]:8,[_e.SemanticTokenModifiers.definition]:16,[_e.SemanticTokenModifiers.deprecated]:32,[_e.SemanticTokenModifiers.documentation]:64,[_e.SemanticTokenModifiers.modification]:128,[_e.SemanticTokenModifiers.readonly]:256,[_e.SemanticTokenModifiers.static]:512},jw={legend:{tokenTypes:Object.keys(qv),tokenModifiers:Object.keys(qw)},full:{delta:!0},range:!0},Fv=class extends _e.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,r,n,i,o){this._tokens.push({line:e,char:r,length:n,tokenType:i,tokenModifiers:o})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}applyTokens(){for(let e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,r){return e.line===r.line?e.char-r.char:e.line-r.line}},Od=class{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(r=>{this.tokensBuilders.delete(r.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(r=>{var n;this.initialize((n=r.capabilities.textDocument)===null||n===void 0?void 0:n.semanticTokens)})}initialize(e){this.clientCapabilities=e}async semanticHighlight(e,r,n=_e.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),await this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}async semanticHighlightRange(e,r,n=_e.CancellationToken.None){return this.currentRange=r.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),await this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,r,n=_e.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(r.previousResultId),await this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.buildEdits()}createAcceptor(){return r=>{"line"in r?this.highlightToken({range:{start:{line:r.line,character:r.char},end:{line:r.line,character:r.char+r.length}},type:r.type,modifier:r.modifier}):"range"in r?this.highlightToken(r):"keyword"in r?this.highlightKeyword(r):"property"in r?this.highlightProperty(r):this.highlightNode({node:r.cst,type:r.type,modifier:r.modifier})}}getDocumentTokensBuilder(e){let r=this.tokensBuilders.get(e.uri.toString());if(r)return r;let n=new Fv;return this.tokensBuilders.set(e.uri.toString(),n),n}async computeHighlighting(e,r,n){let i=e.parseResult.value,o=to(i,{range:this.currentRange}).iterator(),s;do if(s=o.next(),!s.done){await vt(n);let a=s.value;this.highlightElement(a,r)==="prune"&&o.prune()}while(!s.done)}highlightToken(e){var r;let{range:n,type:i}=e,o=e.modifier;if(this.currentRange&&!Xf(n,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;let s=qv[i],a=0;if(o!==void 0){typeof o=="string"&&(o=[o]);for(let l of o){let f=qw[l];a|=f}}let c=n.start.line,u=n.end.line;if(c===u){let l=n.start.character,f=n.end.character-l;this.currentTokensBuilder.push(c,l,f,s,a)}else if(!((r=this.clientCapabilities)===null||r===void 0)&&r.multilineTokenSupport){let l=n.start.character,f=this.currentDocument.textDocument.offsetAt(n.start),g=this.currentDocument.textDocument.offsetAt(n.end);this.currentTokensBuilder.push(c,l,g-f,s,a)}else{let l=n.start,f=this.currentDocument.textDocument.offsetAt({line:c+1,character:0});this.currentTokensBuilder.push(l.line,l.character,f-l.character-1,s,a);for(let g=c+1;g<u;g++){let T=f;f=this.currentDocument.textDocument.offsetAt({line:g+1,character:0}),this.currentTokensBuilder.push(g,0,f-T-1,s,a)}this.currentTokensBuilder.push(u,0,n.end.character,s,a)}}highlightProperty(e){let r=[];if(typeof e.index=="number"){let o=br(e.node.$cstNode,e.property,e.index);o&&r.push(o)}else r.push(...Io(e.node.$cstNode,e.property));let{type:n,modifier:i}=e;for(let o of r)this.highlightNode({node:o,type:n,modifier:i})}highlightKeyword(e){let{node:r,keyword:n,type:i,index:o,modifier:s}=e,a=[];if(typeof o=="number"){let c=In(r.$cstNode,n,o);c&&a.push(c)}else a.push(...Nd(r.$cstNode,n));for(let c of a)this.highlightNode({node:c,type:i,modifier:s})}highlightNode(e){let{node:r,type:n,modifier:i}=e,o=r.range;this.highlightToken({range:o,type:n,modifier:i})}},$v;(function(t){function e(n,i){let o=new Map;Object.entries(qv).forEach(([c,u])=>o.set(u,c));let s=0,a=0;return r(n.data,5).map(c=>{s+=c[0],c[0]!==0&&(a=0),a+=c[1];let u=c[2];return{offset:i.textDocument.offsetAt({line:s,character:a}),tokenType:o.get(c[3]),tokenModifiers:c[4],text:i.textDocument.getText({start:{line:s,character:a},end:{line:s,character:a+u}})}})}t.decode=e;function r(n,i){let o=[];for(let s=0;s<n.length;s+=i){let a=n.slice(s,s+i);o.push(a)}return o}})($v=$v||($v={}));var Ld=class extends Od{highlightElement(e,r){var n;Fe(e)?r({node:e,property:"feature",type:co.SemanticTokenTypes.property}):Xe(e)?e.feature&&r({node:e,property:"feature",type:co.SemanticTokenTypes.property}):_a(e)?r({node:e,property:"name",type:co.SemanticTokenTypes.type}):Ir(e)?(e.primitiveType||e.typeRef)&&r({node:e,property:e.primitiveType?"primitiveType":"typeRef",type:co.SemanticTokenTypes.type}):lk(e)?r({node:e,property:"name",type:co.SemanticTokenTypes.parameter}):ba(e)?r({node:e,property:"parameter",type:co.SemanticTokenTypes.parameter}):Ye(e)?!((n=e.rule.ref)===null||n===void 0)&&n.fragment&&r({node:e,property:"rule",type:co.SemanticTokenTypes.type}):Qf(e)&&r({node:e,property:"name",type:co.SemanticTokenTypes.property})}};var Md=class extends Ea{getName(e){return Fe(e)?e.feature:super.getName(e)}getNameNode(e){return Fe(e)?br(e.$cstNode,"feature"):super.getNameNode(e)}};var Ba=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){let r=Ka(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(Qi(i))return i.ref;if(Array.isArray(i)){for(let o of i)if(Qi(o)&&o.$refNode&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return o.ref}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||BS(e,i)))return n}}}findDeclarationNode(e){let r=this.findDeclaration(e);if(r?.$cstNode){let n=this.nameProvider.getNameNode(r);return n??r.$cstNode}}findReferences(e,r){let n=[];if(r.includeDeclaration){let o=this.getReferenceToSelf(e);o&&n.push(o)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(o=>Le.equals(o.sourceUri,r.documentUri))),n.push(...i),xe(n)}getReferenceToSelf(e){let r=this.nameProvider.getNameNode(e);if(r){let n=Te(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:Nr(r),local:!0}}}};var $d=class extends Ba{constructor(e){super(e),this.documents=e.shared.workspace.LangiumDocuments}findDeclaration(e){let r=e.astNode,n=Ka(e);if(n&&n.feature==="feature"){if(Fe(r))return this.findAssignmentDeclaration(r);if(Xe(r))return this.findActionDeclaration(r)}return super.findDeclaration(e)}findReferences(e,r){var n;return Qf(e)?this.findReferencesToTypeAttribute(e,(n=r.includeDeclaration)!==null&&n!==void 0?n:!1):super.findReferences(e,r)}findReferencesToTypeAttribute(e,r){let n=[],i=Je(e,tn);if(i){if(r){let a=this.getReferenceToSelf(e);a&&n.push(a)}let o=lv(i,this,this.documents,this.nodeLocator),s=[];o.forEach(a=>{let c=this.findRulesWithReturnType(a);s.push(...c)}),s.forEach(a=>{let c=this.createReferencesToAttribute(a,e);n.push(...c)})}return xe(n)}createReferencesToAttribute(e,r){let n=[];if(Q(e)){let i=Oa(e.definition).find(o=>o.feature===r.name);if(i?.$cstNode){let o=this.nameProvider.getNameNode(i);o&&n.push({sourceUri:Te(i).uri,sourcePath:this.nodeLocator.getAstNodePath(i),targetUri:Te(r).uri,targetPath:this.nodeLocator.getAstNodePath(r),segment:Nr(o),local:Le.equals(Te(i).uri,Te(r).uri)})}}else{if(e.feature===r.name){let o=br(e.$cstNode,"feature");o&&n.push({sourceUri:Te(e).uri,sourcePath:this.nodeLocator.getAstNodePath(e),targetUri:Te(r).uri,targetPath:this.nodeLocator.getAstNodePath(r),segment:Nr(o),local:Le.equals(Te(e).uri,Te(r).uri)})}let i=Je(e,Q);n.push(...this.createReferencesToAttribute(i,r))}return n}findAssignmentDeclaration(e){var r;let n=Je(e,Q),i=kv(e);if(i){let o=this.findActionDeclaration(i,e.feature);if(o)return o}if(!((r=n?.returnType)===null||r===void 0)&&r.ref&&(tn(n.returnType.ref)||lr(n.returnType.ref))){let o=qu(n.returnType.ref);for(let s of o){let a=s.attributes.find(c=>c.name===e.feature);if(a)return a}}return e}findActionDeclaration(e,r){var n;if(!((n=e.type)===null||n===void 0)&&n.ref){let i=r??e.feature,o=qu(e.type.ref);for(let s of o){let a=s.attributes.find(c=>c.name===i);if(a)return a}}}findRulesWithReturnType(e){let r=[];return this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)).forEach(i=>{let o=this.documents.getOrCreateDocument(i.sourceUri),s=this.nodeLocator.getAstNode(o.parseResult.value,i.sourcePath);(Q(s)||Xe(s))&&r.push(s)}),r}};var el=De(ze(),1);var Uw=De(ze(),1);var Fd=class{constructor(e){this.grammarConfig=e.parser.GrammarConfig,this.nameProvider=e.references.NameProvider,this.documents=e.shared.workspace.LangiumDocuments,this.references=e.references.References}prepareCallHierarchy(e,r){let n=e.parseResult.value,i=ir(n.$cstNode,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findDeclarationNode(i);if(o)return this.getCallHierarchyItems(o.astNode,e)}getCallHierarchyItems(e,r){let n=this.nameProvider.getNameNode(e),i=this.nameProvider.getName(e);if(!(!n||!e.$cstNode||i===void 0))return[Object.assign({kind:Uw.SymbolKind.Method,name:i,range:e.$cstNode.range,selectionRange:n.range,uri:r.uri.toString()},this.getCallHierarchyItem(e))]}getCallHierarchyItem(e){}incomingCalls(e){let r=this.documents.getOrCreateDocument(_r.parse(e.item.uri)),n=r.parseResult.value,i=ir(n.$cstNode,r.textDocument.offsetAt(e.item.range.start),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findReferences(i.astNode,{includeDeclaration:!1});return this.getIncomingCalls(i.astNode,o)}outgoingCalls(e){let r=this.documents.getOrCreateDocument(_r.parse(e.item.uri)),n=r.parseResult.value,i=ir(n.$cstNode,r.textDocument.offsetAt(e.item.range.start),this.grammarConfig.nameRegexp);if(i)return this.getOutgoingCalls(i.astNode)}};var Ww=De(ze(),1);var za=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,r){let n=e.parseResult.value;if(n.$cstNode){let i=n.$cstNode,o=ir(i,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(o)return this.collectLocationLinks(o,r)}}collectLocationLinks(e,r){var n;let i=this.findLink(e);if(i)return[Ww.LocationLink.create(i.targetDocument.textDocument.uri,((n=i.target.astNode.$cstNode)!==null&&n!==void 0?n:i.target).range,i.target.range,i.source.range)]}findLink(e){let r=this.references.findDeclarationNode(e);if(r?.astNode){let n=Te(r.astNode);if(r&&n)return{source:e,target:r,targetDocument:n}}}};var Hw=De(ze(),1);var qd=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,r){let n=e.parseResult.value.$cstNode;if(!n)return;let i=ir(n,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findDeclaration(i);if(o){let s=Le.equals(Te(o).uri,e.uri),a={documentUri:e.uri,includeDeclaration:s};return this.references.findReferences(o,a).map(u=>this.createDocumentHighlight(u)).toArray()}}createDocumentHighlight(e){return Hw.DocumentHighlight.create(e.segment.range)}};var jd=class{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,r){let n=r.$cstNode,i=this.nameProvider.getNameNode(r);if(i&&n){let o=this.nameProvider.getName(r);return[{kind:this.nodeKindProvider.getSymbolKind(r),name:o??i.text,range:n.range,selectionRange:i.range,children:this.getChildSymbols(e,r)}]}else return this.getChildSymbols(e,r)||[]}getChildSymbols(e,r){let n=[];for(let i of No(r)){let o=this.getSymbol(e,i);n.push(...o)}if(n.length>0)return n}};var J1=De(ze(),1);var Ud=class{match(e,r){if(e.length===0)return!0;r=r.toLowerCase();let n=!1,i,o=0,s=r.length;for(let a=0;a<s;a++){let c=r.charCodeAt(a),u=e.charCodeAt(o);if((c===u||this.toUpperCharCode(c)===this.toUpperCharCode(u))&&(n||(n=i===void 0||this.isWordTransition(i,c)),n&&o++,o===e.length))return!0;i=c}return!1}isWordTransition(e,r){return Gw<=e&&e<=Bw&&Q1<=r&&r<=Z1||e===Kw&&r!==Kw}toUpperCharCode(e){return Gw<=e&&e<=Bw?e-32:e}},Gw="a".charCodeAt(0),Bw="z".charCodeAt(0),Q1="A".charCodeAt(0),Z1="Z".charCodeAt(0),Kw="_".charCodeAt(0);var jv=class{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,r){var n,i;let o=(i=(n=e.parseResult)===null||n===void 0?void 0:n.value)===null||i===void 0?void 0:i.$cstNode;if(o){let s=e.textDocument.offsetAt(r.position),a=ir(o,s,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>s){let c=this.references.findDeclaration(a);if(c)return this.getAstNodeHoverContent(c)}}}},Wd=class extends jv{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){let r=this.documentationProvider.getDocumentation(e);if(r)return{contents:{kind:"markdown",value:r}}}};var ej=De(ze(),1);var tj=De(ze(),1);var Mn=De(ze(),1);var Qe;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Qe=Qe||(Qe={}));var Hd=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}fromTextDocument(e,r){return this.create(r??_r.parse(e.uri),e)}fromString(e,r){return this.create(r,e)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r){if(r??(r=this.textDocuments.get(e.toString())),r??(r=this.getContentFromFileSystem(e)),typeof r=="string"){let n=this.parse(e,r);return this.createLangiumDocument(n,e,void 0,r)}else if("$model"in r){let n={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{let n=this.parse(e,r.getText());return this.createLangiumDocument(n,e,r)}}createLangiumDocument(e,r,n,i){let o;if(n)o={parseResult:e,uri:r,state:Qe.Parsed,references:[],textDocument:n};else{let s=this.createTextDocumentGetter(r,i);o={parseResult:e,uri:r,state:Qe.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=o,o}update(e){let r=this.textDocuments.get(e.uri.toString()),n=r?r.getText():this.getContentFromFileSystem(e.uri);if(r)Object.defineProperty(e,"textDocument",{value:r});else{let i=this.createTextDocumentGetter(e.uri,n);Object.defineProperty(e,"textDocument",{get:i})}return e.parseResult=this.parse(e.uri,n),e.parseResult.value.$document=e,e}getContentFromFileSystem(e){return this.fileSystemProvider.readFileSync(e)}parse(e,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r)}createTextDocumentGetter(e,r){let n=this.serviceRegistry,i;return()=>i??(i=ga.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},Gd=class{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory}get all(){return xe(this.documentMap.values())}addDocument(e){let r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getOrCreateDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n||(n=this.langiumDocumentFactory.create(e),this.documentMap.set(r,n),n)}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=Qe.Changed,n.precomputedScopes=void 0,n.references=[],n.diagnostics=void 0),n}deleteDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=Qe.Changed,this.documentMap.delete(r)),n}};var rj=De(ze(),1);function zw(t){let e=[],r=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&r.push(...i.retriggerCharacters)});let n={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:r.length>0?Array.from(new Set(r)).sort():void 0};return n.triggerCharacters?n:void 0}var Bd=class{constructor(e){this.onInitializeEmitter=new Mn.Emitter,this.onInitializedEmitter=new Mn.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){Yf(this.services),this.services.ServiceRegistry.all.forEach(e=>Yf(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var r;let n=this.services.ServiceRegistry.all,i=this.hasService(A=>A.lsp.Formatter),o=n.map(A=>{var z;return(z=A.lsp.Formatter)===null||z===void 0?void 0:z.formatOnTypeOptions}).find(A=>!!A),s=this.hasService(A=>A.lsp.CodeActionProvider),a=this.hasService(A=>A.lsp.SemanticTokenProvider),c=(r=this.services.lsp.ExecuteCommandHandler)===null||r===void 0?void 0:r.commands,u=this.hasService(A=>A.lsp.DocumentLinkProvider),l=zw(n.map(A=>{var z;return(z=A.lsp.SignatureHelp)===null||z===void 0?void 0:z.signatureHelpOptions})),f=this.hasService(A=>A.lsp.TypeProvider),g=this.hasService(A=>A.lsp.ImplementationProvider),T=this.hasService(A=>A.lsp.CompletionProvider),C=$w(n.map(A=>{var z;return(z=A.lsp.CompletionProvider)===null||z===void 0?void 0:z.completionOptions})),P=this.hasService(A=>A.lsp.ReferencesProvider),O=this.hasService(A=>A.lsp.DocumentSymbolProvider),E=this.hasService(A=>A.lsp.DefinitionProvider),m=this.hasService(A=>A.lsp.DocumentHighlightProvider),d=this.hasService(A=>A.lsp.FoldingRangeProvider),_=this.hasService(A=>A.lsp.HoverProvider),$=this.hasService(A=>A.lsp.RenameProvider),X=this.hasService(A=>A.lsp.CallHierarchyProvider),ke=this.hasService(A=>A.lsp.CodeLensProvider),Me=this.hasService(A=>A.lsp.DeclarationProvider),Bt=this.hasService(A=>A.lsp.InlayHintProvider),_t=this.services.lsp.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0}},executeCommandProvider:c&&{commands:c},textDocumentSync:Mn.TextDocumentSyncKind.Incremental,completionProvider:T?C:void 0,referencesProvider:P,documentSymbolProvider:O,definitionProvider:E,typeDefinitionProvider:f,documentHighlightProvider:m,codeActionProvider:s,documentFormattingProvider:i,documentRangeFormattingProvider:i,documentOnTypeFormattingProvider:o,foldingRangeProvider:d,hoverProvider:_,renameProvider:$?{prepareProvider:!0}:void 0,semanticTokensProvider:a?jw:void 0,signatureHelpProvider:l,implementationProvider:g,callHierarchyProvider:X?{}:void 0,documentLinkProvider:u?{resolveProvider:!1}:void 0,codeLensProvider:ke?{resolveProvider:!1}:void 0,declarationProvider:Me,inlayHintProvider:Bt?{resolveProvider:!1}:void 0,workspaceSymbolProvider:_t?{resolveProvider:!!_t.resolveSymbol}:void 0}}}async initialized(e){this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}};function Xw(t){let e=t.lsp.Connection;if(!e)throw new Error("Starting a language server requires the languageServer.Connection service to be set.");nj(e,t),ij(e,t),oj(e,t),sj(e,t),cj(e,t),uj(e,t),lj(e,t),fj(e,t),pj(e,t),hj(e,t),gj(e,t),aj(e,t),yj(e,t),mj(e,t),vj(e,t),Tj(e,t),xj(e,t),_j(e,t),wj(e,t),Sj(e,t),bj(e,t),Rj(e,t),dj(e,t),kj(e,t),e.onInitialize(n=>t.lsp.LanguageServer.initialize(n)),e.onInitialized(n=>t.lsp.LanguageServer.initialized(n)),t.workspace.TextDocuments.listen(e),e.listen()}function nj(t,e){let r=e.workspace.DocumentBuilder,n=e.workspace.MutexLock;function i(s,a){n.lock(c=>r.update(s,a,c))}e.workspace.TextDocuments.onDidChangeContent(s=>{i([_r.parse(s.document.uri)],[])}),t.onDidChangeWatchedFiles(s=>{let a=[],c=[];for(let u of s.changes){let l=_r.parse(u.uri);u.type===Mn.FileChangeType.Deleted?c.push(l):a.push(l)}i(a,c)})}function ij(t,e){e.workspace.DocumentBuilder.onBuildPhase(Qe.Validated,async(n,i)=>{for(let o of n)if(o.diagnostics&&t.sendDiagnostics({uri:o.uri.toString(),diagnostics:o.diagnostics}),i.isCancellationRequested)return})}function oj(t,e){t.onCompletion(Lr((r,n,i,o)=>{var s;return(s=r.lsp.CompletionProvider)===null||s===void 0?void 0:s.getCompletion(n,i,o)},e))}function sj(t,e){t.onReferences(Lr((r,n,i,o)=>{var s;return(s=r.lsp.ReferencesProvider)===null||s===void 0?void 0:s.findReferences(n,i,o)},e))}function aj(t,e){t.onCodeAction(Lr((r,n,i,o)=>{var s;return(s=r.lsp.CodeActionProvider)===null||s===void 0?void 0:s.getCodeActions(n,i,o)},e))}function cj(t,e){t.onDocumentSymbol(Lr((r,n,i,o)=>{var s;return(s=r.lsp.DocumentSymbolProvider)===null||s===void 0?void 0:s.getSymbols(n,i,o)},e))}function uj(t,e){t.onDefinition(Lr((r,n,i,o)=>{var s;return(s=r.lsp.DefinitionProvider)===null||s===void 0?void 0:s.getDefinition(n,i,o)},e))}function lj(t,e){t.onTypeDefinition(Lr((r,n,i,o)=>{var s;return(s=r.lsp.TypeProvider)===null||s===void 0?void 0:s.getTypeDefinition(n,i,o)},e))}function fj(t,e){t.onImplementation(Lr((r,n,i,o)=>{var s;return(s=r.lsp.ImplementationProvider)===null||s===void 0?void 0:s.getImplementation(n,i,o)},e))}function dj(t,e){t.onDeclaration(Lr((r,n,i,o)=>{var s;return(s=r.lsp.DeclarationProvider)===null||s===void 0?void 0:s.getDeclaration(n,i,o)},e))}function pj(t,e){t.onDocumentHighlight(Lr((r,n,i,o)=>{var s;return(s=r.lsp.DocumentHighlightProvider)===null||s===void 0?void 0:s.getDocumentHighlight(n,i,o)},e))}function mj(t,e){t.onHover(Lr((r,n,i,o)=>{var s;return(s=r.lsp.HoverProvider)===null||s===void 0?void 0:s.getHoverContent(n,i,o)},e))}function hj(t,e){t.onFoldingRanges(Lr((r,n,i,o)=>{var s;return(s=r.lsp.FoldingRangeProvider)===null||s===void 0?void 0:s.getFoldingRanges(n,i,o)},e))}function gj(t,e){t.onDocumentFormatting(Lr((r,n,i,o)=>{var s;return(s=r.lsp.Formatter)===null||s===void 0?void 0:s.formatDocument(n,i,o)},e)),t.onDocumentRangeFormatting(Lr((r,n,i,o)=>{var s;return(s=r.lsp.Formatter)===null||s===void 0?void 0:s.formatDocumentRange(n,i,o)},e)),t.onDocumentOnTypeFormatting(Lr((r,n,i,o)=>{var s;return(s=r.lsp.Formatter)===null||s===void 0?void 0:s.formatDocumentOnType(n,i,o)},e))}function yj(t,e){t.onRenameRequest(Lr((r,n,i,o)=>{var s;return(s=r.lsp.RenameProvider)===null||s===void 0?void 0:s.rename(n,i,o)},e)),t.onPrepareRename(Lr((r,n,i,o)=>{var s;return(s=r.lsp.RenameProvider)===null||s===void 0?void 0:s.prepareRename(n,i,o)},e))}function vj(t,e){t.languages.inlayHint.on(Mo((r,n,i,o)=>{var s;return(s=r.lsp.InlayHintProvider)===null||s===void 0?void 0:s.getInlayHints(n,i,o)},e))}function Tj(t,e){let r={data:[]};t.languages.semanticTokens.on(Mo((n,i,o,s)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlight(i,o,s):r,e)),t.languages.semanticTokens.onDelta(Mo((n,i,o,s)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlightDelta(i,o,s):r,e)),t.languages.semanticTokens.onRange(Mo((n,i,o,s)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlightRange(i,o,s):r,e))}function Rj(t,e){t.onDidChangeConfiguration(r=>{r.settings&&e.workspace.ConfigurationProvider.updateConfiguration(r)})}function xj(t,e){let r=e.lsp.ExecuteCommandHandler;r&&t.onExecuteCommand(async(n,i)=>{var o;try{return await r.executeCommand(n.command,(o=n.arguments)!==null&&o!==void 0?o:[],i)}catch(s){return Va(s)}})}function bj(t,e){t.onDocumentLinks(Mo((r,n,i,o)=>{var s;return(s=r.lsp.DocumentLinkProvider)===null||s===void 0?void 0:s.getDocumentLinks(n,i,o)},e))}function _j(t,e){t.onSignatureHelp(Mo((r,n,i,o)=>{var s;return(s=r.lsp.SignatureHelp)===null||s===void 0?void 0:s.provideSignatureHelp(n,i,o)},e))}function Sj(t,e){t.onCodeLens(Mo((r,n,i,o)=>{var s;return(s=r.lsp.CodeLensProvider)===null||s===void 0?void 0:s.provideCodeLens(n,i,o)},e))}function kj(t,e){var r;let n=e.lsp.WorkspaceSymbolProvider;if(n){t.onWorkspaceSymbol(async(o,s)=>{try{return await n.getSymbols(o,s)}catch(a){return Va(a)}});let i=(r=n.resolveSymbol)===null||r===void 0?void 0:r.bind(n);i&&t.onWorkspaceSymbolResolve(async(o,s)=>{try{return await i(o,s)}catch(a){return Va(a)}})}}function wj(t,e){t.languages.callHierarchy.onPrepare(Mo((r,n,i,o)=>{var s;return r.lsp.CallHierarchyProvider&&(s=r.lsp.CallHierarchyProvider.prepareCallHierarchy(n,i,o))!==null&&s!==void 0?s:null},e)),t.languages.callHierarchy.onIncomingCalls(Vw((r,n,i)=>{var o;return r.lsp.CallHierarchyProvider&&(o=r.lsp.CallHierarchyProvider.incomingCalls(n,i))!==null&&o!==void 0?o:null},e)),t.languages.callHierarchy.onOutgoingCalls(Vw((r,n,i)=>{var o;return r.lsp.CallHierarchyProvider&&(o=r.lsp.CallHierarchyProvider.outgoingCalls(n,i))!==null&&o!==void 0?o:null},e))}function Vw(t,e){let r=e.ServiceRegistry;return async(n,i)=>{let o=_r.parse(n.item.uri),s=r.getServices(o);if(!s){let a=`Could not find service instance for uri: '${o.toString()}'`;throw console.error(a),new Error(a)}try{return await t(s,n,i)}catch(a){return Va(a)}}}function Mo(t,e){let r=e.workspace.LangiumDocuments,n=e.ServiceRegistry;return async(i,o)=>{let s=_r.parse(i.textDocument.uri),a=n.getServices(s);if(!a)throw console.error(`Could not find service instance for uri: '${s.toString()}'`),new Error;let c=r.getOrCreateDocument(s);if(!c)throw new Error;try{return await t(a,c,i,o)}catch(u){return Va(u)}}}function Lr(t,e){let r=e.workspace.LangiumDocuments,n=e.ServiceRegistry;return async(i,o)=>{let s=_r.parse(i.textDocument.uri),a=n.getServices(s);if(!a)return console.error(`Could not find service instance for uri: '${s.toString()}'`),null;let c=r.getOrCreateDocument(s);if(!c)return null;try{return await t(a,c,i,o)}catch(u){return Va(u)}}}function Va(t){if(Os(t))return new Mn.ResponseError(Mn.LSPErrorCodes.RequestCancelled,"The request has been cancelled.");if(t instanceof Mn.ResponseError)return t;throw t}var zd=De(ze(),1),Kd=class{getSymbolKind(){return zd.SymbolKind.Field}getCompletionItemKind(){return zd.CompletionItemKind.Reference}};var Yw=De(ze(),1);var Vd=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,r){let n=e.parseResult.value.$cstNode;if(!n)return[];let i=ir(n,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);return i?this.getReferences(i,r,e):[]}getReferences(e,r,n){let i=[],o=this.references.findDeclaration(e);if(o){let s={includeDeclaration:r.context.includeDeclaration};this.references.findReferences(o,s).forEach(a=>{i.push(Yw.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}};var Jw=De(ze(),1);var Xd=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,r){let n={},i=e.parseResult.value.$cstNode;if(!i)return;let o=e.textDocument.offsetAt(r.position),s=ir(i,o,this.grammarConfig.nameRegexp);if(!s)return;let a=this.references.findDeclaration(s);if(!a)return;let c={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(a,c).forEach(l=>{let f=Jw.TextEdit.replace(l.segment.range,r.newName),g=l.sourceUri.toString();n[g]?n[g].push(f):n[g]=[f]}),{changes:n}}prepareRename(e,r){return this.renameNodeRange(e,r.position)}renameNodeRange(e,r){let n=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(r);if(n&&i){let o=ir(n,i,this.grammarConfig.nameRegexp);if(!o)return;if(this.references.findDeclaration(o)||this.isNameNode(o))return o.range}}isNameNode(e){return e?.astNode&&ju(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}};var Cj=De(ze(),1);var Qw=De(ze(),1);var Yd=class{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,r=Qw.CancellationToken.None){let n=[],i=e.query.toLowerCase();for(let o of this.indexManager.allElements())if(await vt(r),this.fuzzyMatcher.match(i,o.name)){let s=this.getWorkspaceSymbol(o);s&&n.push(s)}return n}getWorkspaceSymbol(e){let r=e.nameSegment;if(r)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:r.range,uri:e.documentUri.toString()}}}};var Jd=class extends za{constructor(e){super(e),this.documents=e.shared.workspace.LangiumDocuments}collectLocationLinks(e,r){var n,i,o,s,a,c;let u="path";if(Jf(e.astNode)&&((n=Ka(e))===null||n===void 0?void 0:n.feature)===u){let l=so(this.documents,e.astNode);if(l?.$document){let f=(i=this.findTargetObject(l))!==null&&i!==void 0?i:l,g=(s=(o=this.nameProvider.getNameNode(f))===null||o===void 0?void 0:o.range)!==null&&s!==void 0?s:el.Range.create(0,0,0,0),T=(c=(a=f.$cstNode)===null||a===void 0?void 0:a.range)!==null&&c!==void 0?c:el.Range.create(0,0,0,0);return[el.LocationLink.create(l.$document.uri.toString(),T,g,e.range)]}return}return super.collectLocationLinks(e,r)}findTargetObject(e){return e.isDeclared?e:No(e).head()}};var Uv=De(ze(),1);var Qd=class extends Fd{getIncomingCalls(e,r){if(!Q(e))return;let n=new Map;if(r.forEach(i=>{let s=this.documents.getOrCreateDocument(i.sourceUri).parseResult.value;if(!s.$cstNode)return;let a=en(s.$cstNode,i.segment.offset);if(!a)return;let c=Je(a.astNode,Q);if(!c||!c.$cstNode)return;let u=this.nameProvider.getNameNode(c);if(!u)return;let l=i.sourceUri.toString(),f=l+"@"+u.text;n.has(f)?n.set(f,{parserRule:c.$cstNode,nameNode:u,targetNodes:[...n.get(f).targetNodes,a],docUri:l}):n.set(f,{parserRule:c.$cstNode,nameNode:u,targetNodes:[a],docUri:l})}),n.size!==0)return Array.from(n.values()).map(i=>({from:{kind:Uv.SymbolKind.Method,name:i.nameNode.text,range:i.parserRule.range,selectionRange:i.nameNode.range,uri:i.docUri},fromRanges:i.targetNodes.map(o=>o.range)}))}getOutgoingCalls(e){if(!Q(e))return;let r=yt(e).filter(Ye).toArray(),n=new Map;if(r.forEach(i=>{var o;let s=i.$cstNode;if(!s)return;let a=(o=i.rule.ref)===null||o===void 0?void 0:o.$cstNode;if(!a)return;let c=this.nameProvider.getNameNode(a.astNode);if(!c)return;let u=Te(a.astNode).uri.toString(),l=u+"@"+c.text;n.has(l)?n.set(l,{refCstNode:a,to:c,from:[...n.get(l).from,s.range],docUri:u}):n.set(l,{refCstNode:a,to:c,from:[s.range],docUri:u})}),n.size!==0)return Array.from(n.values()).map(i=>({to:{kind:Uv.SymbolKind.Method,name:i.to.text,range:i.refCstNode.range,selectionRange:i.to.range,uri:i.docUri},fromRanges:i.from}))}};var Zd=class{constructor(e){this.documents=e.shared.workspace.LangiumDocuments}collectValidationResources(e){let r=Dw(e,this.documents);return{typeToValidationInfo:this.collectValidationInfo(r),typeToSuperProperties:this.collectSuperProperties(r)}}collectValidationInfo({astResources:e,inferred:r,declared:n}){let i=new Map,o=Ej(e);for(let a of ud(r))i.set(a.name,{inferred:a,inferredNodes:o.get(a.name)});let s=xe(e.interfaces).concat(e.types).reduce((a,c)=>a.set(c.name,c),new Map);for(let a of ud(n)){let c=s.get(a.name);if(c){let u=i.get(a.name);i.set(a.name,Object.assign(Object.assign({},u??{}),{declared:a,declaredNode:c}))}}return i}collectSuperProperties({inferred:e,declared:r}){let n=new Map,i=fv(e,r),o=new Map(i.map(s=>[s.name,s]));for(let s of fv(e,r))n.set(s.name,this.addSuperProperties(s,o,new Set));return n}addSuperProperties(e,r,n){if(n.has(e.name))return[];n.add(e.name);let i=[...e.properties];for(let o of e.superTypes){let s=r.get(o.name);s&&i.push(...this.addSuperProperties(s,r,n))}return i}};function Ej({parserRules:t,datatypeRules:e}){let r=new Ve;xe(t).concat(e).forEach(i=>r.add(Ms(i),i));function n(i){if(Xe(i)){let o=Ma(i);o&&r.add(o,i)}(mn(i)||fr(i)||hn(i))&&i.elements.forEach(o=>n(o))}return t.forEach(i=>n(i.definition)),r}function Zw(t){return t&&"declared"in t}function eC(t){return t&&"inferred"in t}function tC(t){return t&&"inferred"in t&&"declared"in t}function nC(t){let e=t.validation.ValidationRegistry,r=t.validation.LangiumGrammarTypesValidator,n={Action:[r.checkActionIsNotUnionType],Grammar:[r.checkDeclaredTypesConsistency,r.checkDeclaredAndInferredTypesConsistency],Interface:[r.checkCyclicInterface],Type:[r.checkCyclicType]};e.register(n,r)}var ep=class{checkCyclicType(e,r){$o(e,new Set)&&r("error",`Type alias '${e.name}' circularly references itself.`,{node:e,property:"name"})}checkCyclicInterface(e,r){$o(e,new Set)&&r("error",`Type '${e.name}' recursively references itself as a base type.`,{node:e,property:"name"})}checkDeclaredTypesConsistency(e,r){var n;let i=(n=e.$document)===null||n===void 0?void 0:n.validationResources;if(i){for(let o of i.typeToValidationInfo.values())if(Zw(o)&&oi(o.declared)&&tn(o.declaredNode)){let s=o;Aj(s,r),Dj(s,r)}}}checkDeclaredAndInferredTypesConsistency(e,r){var n;let i=(n=e.$document)===null||n===void 0?void 0:n.validationResources;if(i)for(let o of i.typeToValidationInfo.values())eC(o)&&o.inferred instanceof Ca&&Pj(o.inferred,r),tC(o)&&Oj(o,i,r)}checkActionIsNotUnionType(e,r){lr(e.type)&&r("error","Actions cannot create union types.",{node:e,property:"type"})}};function $o(t,e){var r;if(e.has(t))return!0;if(e.add(t),lr(t))return $o(t.type,e);if(tn(t))return t.superTypes.some(n=>n.ref&&$o(n.ref,new Set(e)));if(Ir(t)){if(!((r=t.typeRef)===null||r===void 0)&&r.ref)return $o(t.typeRef.ref,e)}else{if(As(t))return $o(t.referenceType,e);if(Ps(t))return $o(t.elementType,e);if(Nn(t))return t.types.some(n=>$o(n,new Set(e)))}return!1}function Pj(t,e){t.properties.forEach(r=>{var n;let i=cv(r.type);if(i.length>1){let o=a=>ro(a)?"ref":"other",s=o(i[0]);if(i.slice(1).some(a=>o(a)!==s)){let a=(n=r.astNodes.values().next())===null||n===void 0?void 0:n.value;a&&e("error",`Mixing a cross-reference with other types is not supported. Consider splitting property "${r.name}" into two or more different properties.`,{node:a})}}})}function Aj({declared:t,declaredNode:e},r){Array.from(t.superTypes).forEach((n,i)=>{n&&(ni(n)&&r("error","Interfaces cannot extend union types.",{node:e,property:"superTypes",index:i}),n.declared||r("error","Extending an inferred type is discouraged.",{node:e,property:"superTypes",index:i}))})}function Dj({declared:t,declaredNode:e},r){let n=t.properties.reduce((s,a)=>s.add(a.name,a),new Ve);for(let[s,a]of n.entriesGroupedByKey())if(a.length>1)for(let c of a)r("error",`Cannot have two properties with the same name '${s}'.`,{node:Array.from(c.astNodes)[0],property:"name"});let i=Array.from(t.superTypes);for(let s=0;s<i.length;s++)for(let a=s+1;a<i.length;a++){let c=i[s],u=i[a],l=oi(c)?c.superProperties:[],f=oi(u)?u.superProperties:[],g=Nj(l,f);g.length>0&&r("error",`Cannot simultaneously inherit from '${c}' and '${u}'. Their ${g.map(T=>"'"+T+"'").join(", ")} properties are not identical.`,{node:e,property:"name"})}let o=new Set;for(let s of i){let a=oi(s)?s.superProperties:[];for(let c of a)o.add(c.name)}for(let s of t.properties)if(o.has(s.name)){let a=e.attributes.find(c=>c.name===s.name);a&&r("error",`Cannot redeclare property '${s.name}'. It is already inherited from another interface.`,{node:a,property:"name"})}}function Nj(t,e){let r=[];for(let n of t){let i=e.find(o=>o.name===n.name);i&&!Ij(n,i)&&r.push(n.name)}return r}function Ij(t,e){return Fu(t.type,e.type)&&Fu(e.type,t.type)}function Oj(t,e,r){let{inferred:n,declared:i,declaredNode:o,inferredNodes:s}=t,a=i.name,c=f=>g=>s.forEach(T=>r("error",`${g}${f?` ${f}`:""}.`,T?.inferredType?{node:T?.inferredType,property:"name"}:{node:T,property:Xe(T)?"type":"name"})),u=(f,g)=>f.forEach(T=>r("error",g,{node:T,property:Fe(T)||Xe(T)?"feature":"name"})),l=f=>{s.forEach(g=>{Q(g)&&Oa(g.definition).find(C=>C.feature===f)===void 0&&r("error",`Property '${f}' is missing in a rule '${g.name}', but is required in type '${a}'.`,{node:g,property:"parameters"})})};if(ni(n)&&ni(i))Lj(n.type,i.type,c(`in a rule that returns type '${a}'`));else if(oi(n)&&oi(i))Mj(n,i,e,c(`in a rule that returns type '${a}'`),u,l);else{let f=`Inferred and declared versions of type '${a}' both have to be interfaces or unions.`;c()(f),r("error",f,{node:o,property:"name"})}}function Lj(t,e,r){Fu(t,e)||r(`Cannot assign type '${ii(t,"DeclaredType")}' to '${ii(e,"DeclaredType")}'`)}function rC(t){return t.optional||ad(t.type)}function Mj(t,e,r,n,i,o){let s=new Set(t.properties.map(f=>f.name)),a=new Map(t.allProperties.map(f=>[f.name,f])),c=new Map(e.superProperties.map(f=>[f.name,f])),u=f=>{if(or(f))return{types:f.types.map(g=>u(g))};if(ro(f))return{referenceType:u(f.referenceType)};if(no(f))return{elementType:u(f.elementType)};if(gn(f)){let g=r.typeToValidationInfo.get(f.value.name);return g?{value:"declared"in g?g.declared:g.inferred}:f}return f};for(let[f,g]of a.entries()){let T=c.get(f);if(T){let C=ii(g.type,"DeclaredType"),P=ii(T.type,"DeclaredType");if(!Fu(u(g.type),T.type)&&P!=="unknown"){let E=`The assigned type '${C}' is not compatible with the declared property '${f}' of type '${P}'.`;i(g.astNodes,E)}g.optional&&!rC(T)&&o(f)}else s.has(f)&&i(g.astNodes,`A property '${f}' is not expected.`)}let l=new Set;for(let[f,g]of c.entries())!a.get(f)&&!rC(g)&&l.add(f);if(l.size>0){let f=l.size>1?"Properties":"A property",g=l.size>1?"are expected":"is expected",T=Array.from(l).map(C=>`'${C}'`).sort().join(", ");n(`${f} ${T} ${g}.`)}}var $j={validation:{LangiumGrammarValidator:t=>new yd(t),ValidationResourcesCollector:t=>new Zd(t),LangiumGrammarTypesValidator:()=>new ep},lsp:{FoldingRangeProvider:t=>new Ad(t),CodeActionProvider:t=>new kd(t),SemanticTokenProvider:t=>new Ld(t),Formatter:()=>new Id,DefinitionProvider:t=>new Jd(t),CallHierarchyProvider:t=>new Qd(t),CompletionProvider:t=>new Pd(t)},references:{ScopeComputation:t=>new _d(t),ScopeProvider:t=>new bd(t),References:t=>new $d(t),NameProvider:()=>new Md}};function iC(t,e){let r=Cs(rl(t),Nw,e),n=Cs(tl({shared:r}),Iw,$j);return Fj(r,n),r.ServiceRegistry.register(n),hw(n),nC(n),{shared:r,grammar:n}}function Fj(t,e){t.workspace.DocumentBuilder.onBuildPhase(Qe.IndexedReferences,async(n,i)=>{for(let o of n){await vt(i);let s=e.validation.ValidationResourcesCollector,a=o.parseResult.value;o.validationResources=s.collectValidationResources(a)}})}var Wv=class{readFile(){throw new Error("Method not implemented.")}readFileSync(){throw new Error("Method not implemented.")}async readDirectory(){return[]}},tp={fileSystemProvider:()=>new Wv};function Ed(t){return t.rules.find(e=>Q(e)&&e.entry)}function qj(t){return t.rules.filter(e=>We(e)&&e.hidden)}function Ia(t,e){let r=new Set,n=Ed(t);if(!n)return new Set(t.rules);let i=[n].concat(qj(t));for(let s of i)oC(s,r,e);let o=new Set;for(let s of t.rules)(r.has(s.name)||We(s)&&s.hidden)&&o.add(s);return o}function oC(t,e,r){e.add(t.name),yt(t).forEach(n=>{if(Ye(n)||r&&ed(n)){let i=n.rule.ref;i&&!e.has(i.name)&&oC(i,e,r)}})}function Cd(t){if(t.terminal)return t.terminal;if(t.type.ref){let e=Xu(t.type.ref);return e?.terminal}}function sC(t){return t.hidden&&!Ln(t).test(" ")}function Io(t,e){return!t||!e?[]:Hv(t,e,t.astNode,!0)}function br(t,e,r){if(!t||!e)return;let n=Hv(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Hv(t,e,r,n){if(!n){let i=Je(t.grammarSource,Fe);if(i&&i.feature===e)return[t]}return xi(t)&&t.astNode===r?t.content.flatMap(i=>Hv(i,e,r,!1)):[]}function Nd(t,e){return t?aC(t,e,t?.astNode):[]}function In(t,e,r){if(!t)return;let n=aC(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function aC(t,e,r){if(t.astNode!==r)return[];if(Ot(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=Vy(t).iterator(),i,o=[];do if(i=n.next(),!i.done){let s=i.value;s.astNode===r?Ot(s.grammarSource)&&s.grammarSource.value===e&&o.push(s):n.prune()}while(!i.done);return o}function Ka(t){var e;let r=t.astNode;for(;r===((e=t.container)===null||e===void 0?void 0:e.astNode);){let n=Je(t.grammarSource,Fe);if(n)return n;t=t.container}}function Xu(t){return xa(t)&&(t=t.$container),cC(t,new Map)}function cC(t,e){var r;function n(i,o){let s;return Je(i,Fe)||(s=cC(o,e)),e.set(t,s),s}if(e.has(t))return e.get(t);e.set(t,void 0);for(let i of yt(t)){if(Fe(i)&&i.feature.toLowerCase()==="name")return e.set(t,i),i;if(Ye(i)&&Q(i.rule.ref))return n(i,i.rule.ref);if(Ir(i)&&(!((r=i.typeRef)===null||r===void 0)&&r.ref))return n(i,i.typeRef.ref)}}function pd(t){var e;let r=iC(tp).grammar,n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,_r.parse(`memory://${(e=n.name)!==null&&e!==void 0?e:"grammar"}.langium`)),n}function uC(t){let e=[],r=t.Grammar;for(let n of r.rules)We(n)&&sC(n)&&ow(Ln(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Xy}}var jj=typeof global=="object"&&global&&global.Object===Object&&global,rp=jj;var Uj=typeof self=="object"&&self&&self.Object===Object&&self,Wj=rp||Uj||Function("return this")(),Jt=Wj;var Hj=Jt.Symbol,dr=Hj;var lC=Object.prototype,Gj=lC.hasOwnProperty,Bj=lC.toString,nl=dr?dr.toStringTag:void 0;function Kj(t){var e=Gj.call(t,nl),r=t[nl];try{t[nl]=void 0;var n=!0}catch{}var i=Bj.call(t);return n&&(e?t[nl]=r:delete t[nl]),i}var fC=Kj;var zj=Object.prototype,Vj=zj.toString;function Xj(t){return Vj.call(t)}var dC=Xj;var Yj="[object Null]",Jj="[object Undefined]",pC=dr?dr.toStringTag:void 0;function Qj(t){return t==null?t===void 0?Jj:Yj:pC&&pC in Object(t)?fC(t):dC(t)}var zr=Qj;function Zj(t){return t!=null&&typeof t=="object"}var Ut=Zj;var eU="[object Symbol]";function tU(t){return typeof t=="symbol"||Ut(t)&&zr(t)==eU}var ki=tU;function rU(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var wi=rU;var nU=Array.isArray,ee=nU;var iU=1/0,mC=dr?dr.prototype:void 0,hC=mC?mC.toString:void 0;function gC(t){if(typeof t=="string")return t;if(ee(t))return wi(t,gC)+"";if(ki(t))return hC?hC.call(t):"";var e=t+"";return e=="0"&&1/t==-iU?"-0":e}var yC=gC;var oU=/\s/;function sU(t){for(var e=t.length;e--&&oU.test(t.charAt(e)););return e}var vC=sU;var aU=/^\s+/;function cU(t){return t&&t.slice(0,vC(t)+1).replace(aU,"")}var TC=cU;function uU(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Et=uU;var RC=0/0,lU=/^[-+]0x[0-9a-f]+$/i,fU=/^0b[01]+$/i,dU=/^0o[0-7]+$/i,pU=parseInt;function mU(t){if(typeof t=="number")return t;if(ki(t))return RC;if(Et(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Et(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=TC(t);var r=fU.test(t);return r||dU.test(t)?pU(t.slice(2),r?2:8):lU.test(t)?RC:+t}var xC=mU;var bC=1/0,hU=17976931348623157e292;function gU(t){if(!t)return t===0?t:0;if(t=xC(t),t===bC||t===-bC){var e=t<0?-1:1;return e*hU}return t===t?t:0}var _C=gU;function yU(t){var e=_C(t),r=e%1;return e===e?r?e-r:e:0}var Ci=yU;function vU(t){return t}var rn=vU;var TU="[object AsyncFunction]",RU="[object Function]",xU="[object GeneratorFunction]",bU="[object Proxy]";function _U(t){if(!Et(t))return!1;var e=zr(t);return e==RU||e==xU||e==TU||e==bU}var Vr=_U;var SU=Jt["__core-js_shared__"],np=SU;var SC=function(){var t=/[^.]+$/.exec(np&&np.keys&&np.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function kU(t){return!!SC&&SC in t}var kC=kU;var wU=Function.prototype,CU=wU.toString;function EU(t){if(t!=null){try{return CU.call(t)}catch{}try{return t+""}catch{}}return""}var uo=EU;var PU=/[\\^$.*+?()[\]{}|]/g,AU=/^\[object .+?Constructor\]$/,DU=Function.prototype,NU=Object.prototype,IU=DU.toString,OU=NU.hasOwnProperty,LU=RegExp("^"+IU.call(OU).replace(PU,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function MU(t){if(!Et(t)||kC(t))return!1;var e=Vr(t)?LU:AU;return e.test(uo(t))}var wC=MU;function $U(t,e){return t?.[e]}var CC=$U;function FU(t,e){var r=CC(t,e);return wC(r)?r:void 0}var nn=FU;var qU=nn(Jt,"WeakMap"),ip=qU;var EC=Object.create,jU=function(){function t(){}return function(e){if(!Et(e))return{};if(EC)return EC(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),PC=jU;function UU(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var AC=UU;function WU(){}var Pt=WU;function HU(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var DC=HU;var GU=800,BU=16,KU=Date.now;function zU(t){var e=0,r=0;return function(){var n=KU(),i=BU-(n-r);if(r=n,i>0){if(++e>=GU)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var NC=zU;function VU(t){return function(){return t}}var IC=VU;var XU=function(){try{var t=nn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Xa=XU;var YU=Xa?function(t,e){return Xa(t,"toString",{configurable:!0,enumerable:!1,value:IC(e),writable:!0})}:rn,OC=YU;var JU=NC(OC),LC=JU;function QU(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var op=QU;function ZU(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var sp=ZU;function eW(t){return t!==t}var MC=eW;function tW(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var $C=tW;function rW(t,e,r){return e===e?$C(t,e,r):sp(t,MC,r)}var Ya=rW;function nW(t,e){var r=t==null?0:t.length;return!!r&&Ya(t,e,0)>-1}var ap=nW;var iW=9007199254740991,oW=/^(?:0|[1-9]\d*)$/;function sW(t,e){var r=typeof t;return e=e??iW,!!e&&(r=="number"||r!="symbol"&&oW.test(t))&&t>-1&&t%1==0&&t<e}var Fo=sW;function aW(t,e,r){e=="__proto__"&&Xa?Xa(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Ja=aW;function cW(t,e){return t===e||t!==t&&e!==e}var Ei=cW;var uW=Object.prototype,lW=uW.hasOwnProperty;function fW(t,e,r){var n=t[e];(!(lW.call(t,e)&&Ei(n,r))||r===void 0&&!(e in t))&&Ja(t,e,r)}var qo=fW;function dW(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=n?n(r[a],t[a],a,r,t):void 0;c===void 0&&(c=t[a]),i?Ja(r,a,c):qo(r,a,c)}return r}var Pi=dW;var FC=Math.max;function pW(t,e,r){return e=FC(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=FC(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),AC(t,this,a)}}var qC=pW;function mW(t,e){return LC(qC(t,e,rn),t+"")}var Qa=mW;var hW=9007199254740991;function gW(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=hW}var Za=gW;function yW(t){return t!=null&&Za(t.length)&&!Vr(t)}var Qt=yW;function vW(t,e,r){if(!Et(r))return!1;var n=typeof e;return(n=="number"?Qt(r)&&Fo(e,r.length):n=="string"&&e in r)?Ei(r[e],t):!1}var jo=vW;function TW(t){return Qa(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&jo(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}var jC=TW;var RW=Object.prototype;function xW(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||RW;return t===r}var Ai=xW;function bW(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var UC=bW;var _W="[object Arguments]";function SW(t){return Ut(t)&&zr(t)==_W}var Gv=SW;var WC=Object.prototype,kW=WC.hasOwnProperty,wW=WC.propertyIsEnumerable,CW=Gv(function(){return arguments}())?Gv:function(t){return Ut(t)&&kW.call(t,"callee")&&!wW.call(t,"callee")},Uo=CW;function EW(){return!1}var HC=EW;var KC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,GC=KC&&typeof module=="object"&&module&&!module.nodeType&&module,PW=GC&&GC.exports===KC,BC=PW?Jt.Buffer:void 0,AW=BC?BC.isBuffer:void 0,DW=AW||HC,lo=DW;var NW="[object Arguments]",IW="[object Array]",OW="[object Boolean]",LW="[object Date]",MW="[object Error]",$W="[object Function]",FW="[object Map]",qW="[object Number]",jW="[object Object]",UW="[object RegExp]",WW="[object Set]",HW="[object String]",GW="[object WeakMap]",BW="[object ArrayBuffer]",KW="[object DataView]",zW="[object Float32Array]",VW="[object Float64Array]",XW="[object Int8Array]",YW="[object Int16Array]",JW="[object Int32Array]",QW="[object Uint8Array]",ZW="[object Uint8ClampedArray]",eH="[object Uint16Array]",tH="[object Uint32Array]",mt={};mt[zW]=mt[VW]=mt[XW]=mt[YW]=mt[JW]=mt[QW]=mt[ZW]=mt[eH]=mt[tH]=!0;mt[NW]=mt[IW]=mt[BW]=mt[OW]=mt[KW]=mt[LW]=mt[MW]=mt[$W]=mt[FW]=mt[qW]=mt[jW]=mt[UW]=mt[WW]=mt[HW]=mt[GW]=!1;function rH(t){return Ut(t)&&Za(t.length)&&!!mt[zr(t)]}var zC=rH;function nH(t){return function(e){return t(e)}}var Di=nH;var VC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,il=VC&&typeof module=="object"&&module&&!module.nodeType&&module,iH=il&&il.exports===VC,Bv=iH&&rp.process,oH=function(){try{var t=il&&il.require&&il.require("util").types;return t||Bv&&Bv.binding&&Bv.binding("util")}catch{}}(),$n=oH;var XC=$n&&$n.isTypedArray,sH=XC?Di(XC):zC,ec=sH;var aH=Object.prototype,cH=aH.hasOwnProperty;function uH(t,e){var r=ee(t),n=!r&&Uo(t),i=!r&&!n&&lo(t),o=!r&&!n&&!i&&ec(t),s=r||n||i||o,a=s?UC(t.length,String):[],c=a.length;for(var u in t)(e||cH.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Fo(u,c)))&&a.push(u);return a}var cp=uH;function lH(t,e){return function(r){return t(e(r))}}var up=lH;var fH=up(Object.keys,Object),YC=fH;var dH=Object.prototype,pH=dH.hasOwnProperty;function mH(t){if(!Ai(t))return YC(t);var e=[];for(var r in Object(t))pH.call(t,r)&&r!="constructor"&&e.push(r);return e}var lp=mH;function hH(t){return Qt(t)?cp(t):lp(t)}var it=hH;var gH=Object.prototype,yH=gH.hasOwnProperty,vH=jC(function(t,e){if(Ai(e)||Qt(e)){Pi(e,it(e),t);return}for(var r in e)yH.call(e,r)&&qo(t,r,e[r])}),Sr=vH;function TH(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var JC=TH;var RH=Object.prototype,xH=RH.hasOwnProperty;function bH(t){if(!Et(t))return JC(t);var e=Ai(t),r=[];for(var n in t)n=="constructor"&&(e||!xH.call(t,n))||r.push(n);return r}var QC=bH;function _H(t){return Qt(t)?cp(t,!0):QC(t)}var Wo=_H;var SH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kH=/^\w*$/;function wH(t,e){if(ee(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||ki(t)?!0:kH.test(t)||!SH.test(t)||e!=null&&t in Object(e)}var tc=wH;var CH=nn(Object,"create"),fo=CH;function EH(){this.__data__=fo?fo(null):{},this.size=0}var ZC=EH;function PH(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var eE=PH;var AH="__lodash_hash_undefined__",DH=Object.prototype,NH=DH.hasOwnProperty;function IH(t){var e=this.__data__;if(fo){var r=e[t];return r===AH?void 0:r}return NH.call(e,t)?e[t]:void 0}var tE=IH;var OH=Object.prototype,LH=OH.hasOwnProperty;function MH(t){var e=this.__data__;return fo?e[t]!==void 0:LH.call(e,t)}var rE=MH;var $H="__lodash_hash_undefined__";function FH(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=fo&&e===void 0?$H:e,this}var nE=FH;function rc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rc.prototype.clear=ZC;rc.prototype.delete=eE;rc.prototype.get=tE;rc.prototype.has=rE;rc.prototype.set=nE;var Kv=rc;function qH(){this.__data__=[],this.size=0}var iE=qH;function jH(t,e){for(var r=t.length;r--;)if(Ei(t[r][0],e))return r;return-1}var Ho=jH;var UH=Array.prototype,WH=UH.splice;function HH(t){var e=this.__data__,r=Ho(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():WH.call(e,r,1),--this.size,!0}var oE=HH;function GH(t){var e=this.__data__,r=Ho(e,t);return r<0?void 0:e[r][1]}var sE=GH;function BH(t){return Ho(this.__data__,t)>-1}var aE=BH;function KH(t,e){var r=this.__data__,n=Ho(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var cE=KH;function nc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}nc.prototype.clear=iE;nc.prototype.delete=oE;nc.prototype.get=sE;nc.prototype.has=aE;nc.prototype.set=cE;var Go=nc;var zH=nn(Jt,"Map"),Bo=zH;function VH(){this.size=0,this.__data__={hash:new Kv,map:new(Bo||Go),string:new Kv}}var uE=VH;function XH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var lE=XH;function YH(t,e){var r=t.__data__;return lE(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ko=YH;function JH(t){var e=Ko(this,t).delete(t);return this.size-=e?1:0,e}var fE=JH;function QH(t){return Ko(this,t).get(t)}var dE=QH;function ZH(t){return Ko(this,t).has(t)}var pE=ZH;function eG(t,e){var r=Ko(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var mE=eG;function ic(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ic.prototype.clear=uE;ic.prototype.delete=fE;ic.prototype.get=dE;ic.prototype.has=pE;ic.prototype.set=mE;var qs=ic;var tG="Expected a function";function zv(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(tG);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(zv.Cache||qs),r}zv.Cache=qs;var hE=zv;var rG=500;function nG(t){var e=hE(t,function(n){return r.size===rG&&r.clear(),n}),r=e.cache;return e}var gE=nG;var iG=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oG=/\\(\\)?/g,sG=gE(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(iG,function(r,n,i,o){e.push(i?o.replace(oG,"$1"):n||r)}),e}),yE=sG;function aG(t){return t==null?"":yC(t)}var vE=aG;function cG(t,e){return ee(t)?t:tc(t,e)?[t]:yE(vE(t))}var zo=cG;var uG=1/0;function lG(t){if(typeof t=="string"||ki(t))return t;var e=t+"";return e=="0"&&1/t==-uG?"-0":e}var Ni=lG;function fG(t,e){e=zo(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ni(e[r++])];return r&&r==n?t:void 0}var oc=fG;function dG(t,e,r){var n=t==null?void 0:oc(t,e);return n===void 0?r:n}var TE=dG;function pG(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var sc=pG;var RE=dr?dr.isConcatSpreadable:void 0;function mG(t){return ee(t)||Uo(t)||!!(RE&&t&&t[RE])}var xE=mG;function bE(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=xE),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?bE(a,e-1,r,n,i):sc(i,a):n||(i[i.length]=a)}return i}var ac=bE;function hG(t){var e=t==null?0:t.length;return e?ac(t,1):[]}var Wt=hG;var gG=up(Object.getPrototypeOf,Object),fp=gG;function yG(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var dp=yG;function vG(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var _E=vG;function TG(){this.__data__=new Go,this.size=0}var SE=TG;function RG(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var kE=RG;function xG(t){return this.__data__.get(t)}var wE=xG;function bG(t){return this.__data__.has(t)}var CE=bG;var _G=200;function SG(t,e){var r=this.__data__;if(r instanceof Go){var n=r.__data__;if(!Bo||n.length<_G-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new qs(n)}return r.set(t,e),this.size=r.size,this}var EE=SG;function cc(t){var e=this.__data__=new Go(t);this.size=e.size}cc.prototype.clear=SE;cc.prototype.delete=kE;cc.prototype.get=wE;cc.prototype.has=CE;cc.prototype.set=EE;var Vo=cc;function kG(t,e){return t&&Pi(e,it(e),t)}var PE=kG;function wG(t,e){return t&&Pi(e,Wo(e),t)}var AE=wG;var OE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,DE=OE&&typeof module=="object"&&module&&!module.nodeType&&module,CG=DE&&DE.exports===OE,NE=CG?Jt.Buffer:void 0,IE=NE?NE.allocUnsafe:void 0;function EG(t,e){if(e)return t.slice();var r=t.length,n=IE?IE(r):new t.constructor(r);return t.copy(n),n}var LE=EG;function PG(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var uc=PG;function AG(){return[]}var pp=AG;var DG=Object.prototype,NG=DG.propertyIsEnumerable,ME=Object.getOwnPropertySymbols,IG=ME?function(t){return t==null?[]:(t=Object(t),uc(ME(t),function(e){return NG.call(t,e)}))}:pp,lc=IG;function OG(t,e){return Pi(t,lc(t),e)}var $E=OG;var LG=Object.getOwnPropertySymbols,MG=LG?function(t){for(var e=[];t;)sc(e,lc(t)),t=fp(t);return e}:pp,mp=MG;function $G(t,e){return Pi(t,mp(t),e)}var FE=$G;function FG(t,e,r){var n=e(t);return ee(t)?n:sc(n,r(t))}var hp=FG;function qG(t){return hp(t,it,lc)}var ol=qG;function jG(t){return hp(t,Wo,mp)}var gp=jG;var UG=nn(Jt,"DataView"),yp=UG;var WG=nn(Jt,"Promise"),vp=WG;var HG=nn(Jt,"Set"),Xo=HG;var qE="[object Map]",GG="[object Object]",jE="[object Promise]",UE="[object Set]",WE="[object WeakMap]",HE="[object DataView]",BG=uo(yp),KG=uo(Bo),zG=uo(vp),VG=uo(Xo),XG=uo(ip),js=zr;(yp&&js(new yp(new ArrayBuffer(1)))!=HE||Bo&&js(new Bo)!=qE||vp&&js(vp.resolve())!=jE||Xo&&js(new Xo)!=UE||ip&&js(new ip)!=WE)&&(js=function(t){var e=zr(t),r=e==GG?t.constructor:void 0,n=r?uo(r):"";if(n)switch(n){case BG:return HE;case KG:return qE;case zG:return jE;case VG:return UE;case XG:return WE}return e});var ui=js;var YG=Object.prototype,JG=YG.hasOwnProperty;function QG(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&JG.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var GE=QG;var ZG=Jt.Uint8Array,fc=ZG;function eB(t){var e=new t.constructor(t.byteLength);return new fc(e).set(new fc(t)),e}var dc=eB;function tB(t,e){var r=e?dc(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var BE=tB;var rB=/\w*$/;function nB(t){var e=new t.constructor(t.source,rB.exec(t));return e.lastIndex=t.lastIndex,e}var KE=nB;var zE=dr?dr.prototype:void 0,VE=zE?zE.valueOf:void 0;function iB(t){return VE?Object(VE.call(t)):{}}var XE=iB;function oB(t,e){var r=e?dc(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var YE=oB;var sB="[object Boolean]",aB="[object Date]",cB="[object Map]",uB="[object Number]",lB="[object RegExp]",fB="[object Set]",dB="[object String]",pB="[object Symbol]",mB="[object ArrayBuffer]",hB="[object DataView]",gB="[object Float32Array]",yB="[object Float64Array]",vB="[object Int8Array]",TB="[object Int16Array]",RB="[object Int32Array]",xB="[object Uint8Array]",bB="[object Uint8ClampedArray]",_B="[object Uint16Array]",SB="[object Uint32Array]";function kB(t,e,r){var n=t.constructor;switch(e){case mB:return dc(t);case sB:case aB:return new n(+t);case hB:return BE(t,r);case gB:case yB:case vB:case TB:case RB:case xB:case bB:case _B:case SB:return YE(t,r);case cB:return new n;case uB:case dB:return new n(t);case lB:return KE(t);case fB:return new n;case pB:return XE(t)}}var JE=kB;function wB(t){return typeof t.constructor=="function"&&!Ai(t)?PC(fp(t)):{}}var QE=wB;var CB="[object Map]";function EB(t){return Ut(t)&&ui(t)==CB}var ZE=EB;var eP=$n&&$n.isMap,PB=eP?Di(eP):ZE,tP=PB;var AB="[object Set]";function DB(t){return Ut(t)&&ui(t)==AB}var rP=DB;var nP=$n&&$n.isSet,NB=nP?Di(nP):rP,iP=NB;var IB=1,OB=2,LB=4,oP="[object Arguments]",MB="[object Array]",$B="[object Boolean]",FB="[object Date]",qB="[object Error]",sP="[object Function]",jB="[object GeneratorFunction]",UB="[object Map]",WB="[object Number]",aP="[object Object]",HB="[object RegExp]",GB="[object Set]",BB="[object String]",KB="[object Symbol]",zB="[object WeakMap]",VB="[object ArrayBuffer]",XB="[object DataView]",YB="[object Float32Array]",JB="[object Float64Array]",QB="[object Int8Array]",ZB="[object Int16Array]",eK="[object Int32Array]",tK="[object Uint8Array]",rK="[object Uint8ClampedArray]",nK="[object Uint16Array]",iK="[object Uint32Array]",ot={};ot[oP]=ot[MB]=ot[VB]=ot[XB]=ot[$B]=ot[FB]=ot[YB]=ot[JB]=ot[QB]=ot[ZB]=ot[eK]=ot[UB]=ot[WB]=ot[aP]=ot[HB]=ot[GB]=ot[BB]=ot[KB]=ot[tK]=ot[rK]=ot[nK]=ot[iK]=!0;ot[qB]=ot[sP]=ot[zB]=!1;function Tp(t,e,r,n,i,o){var s,a=e&IB,c=e&OB,u=e&LB;if(r&&(s=i?r(t,n,i,o):r(t)),s!==void 0)return s;if(!Et(t))return t;var l=ee(t);if(l){if(s=GE(t),!a)return DC(t,s)}else{var f=ui(t),g=f==sP||f==jB;if(lo(t))return LE(t,a);if(f==aP||f==oP||g&&!i){if(s=c||g?{}:QE(t),!a)return c?FE(t,AE(s,t)):$E(t,PE(s,t))}else{if(!ot[f])return i?t:{};s=JE(t,f,a)}}o||(o=new Vo);var T=o.get(t);if(T)return T;o.set(t,s),iP(t)?t.forEach(function(O){s.add(Tp(O,e,r,O,t,o))}):tP(t)&&t.forEach(function(O,E){s.set(E,Tp(O,e,r,E,t,o))});var C=u?c?gp:ol:c?Wo:it,P=l?void 0:C(t);return op(P||t,function(O,E){P&&(E=O,O=t[E]),qo(s,E,Tp(O,e,r,E,t,o))}),s}var cP=Tp;var oK=4;function sK(t){return cP(t,oK)}var st=sK;function aK(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var Ii=aK;var cK="__lodash_hash_undefined__";function uK(t){return this.__data__.set(t,cK),this}var uP=uK;function lK(t){return this.__data__.has(t)}var lP=lK;function Rp(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new qs;++e<r;)this.add(t[e])}Rp.prototype.add=Rp.prototype.push=uP;Rp.prototype.has=lP;var pc=Rp;function fK(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var xp=fK;function dK(t,e){return t.has(e)}var mc=dK;var pK=1,mK=2;function hK(t,e,r,n,i,o){var s=r&pK,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(t),l=o.get(e);if(u&&l)return u==e&&l==t;var f=-1,g=!0,T=r&mK?new pc:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var C=t[f],P=e[f];if(n)var O=s?n(P,C,f,e,t,o):n(C,P,f,t,e,o);if(O!==void 0){if(O)continue;g=!1;break}if(T){if(!xp(e,function(E,m){if(!mc(T,m)&&(C===E||i(C,E,r,n,o)))return T.push(m)})){g=!1;break}}else if(!(C===P||i(C,P,r,n,o))){g=!1;break}}return o.delete(t),o.delete(e),g}var bp=hK;function gK(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var fP=gK;function yK(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var hc=yK;var vK=1,TK=2,RK="[object Boolean]",xK="[object Date]",bK="[object Error]",_K="[object Map]",SK="[object Number]",kK="[object RegExp]",wK="[object Set]",CK="[object String]",EK="[object Symbol]",PK="[object ArrayBuffer]",AK="[object DataView]",dP=dr?dr.prototype:void 0,Vv=dP?dP.valueOf:void 0;function DK(t,e,r,n,i,o,s){switch(r){case AK:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case PK:return!(t.byteLength!=e.byteLength||!o(new fc(t),new fc(e)));case RK:case xK:case SK:return Ei(+t,+e);case bK:return t.name==e.name&&t.message==e.message;case kK:case CK:return t==e+"";case _K:var a=fP;case wK:var c=n&vK;if(a||(a=hc),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=TK,s.set(t,e);var l=bp(a(t),a(e),n,i,o,s);return s.delete(t),l;case EK:if(Vv)return Vv.call(t)==Vv.call(e)}return!1}var pP=DK;var NK=1,IK=Object.prototype,OK=IK.hasOwnProperty;function LK(t,e,r,n,i,o){var s=r&NK,a=ol(t),c=a.length,u=ol(e),l=u.length;if(c!=l&&!s)return!1;for(var f=c;f--;){var g=a[f];if(!(s?g in e:OK.call(e,g)))return!1}var T=o.get(t),C=o.get(e);if(T&&C)return T==e&&C==t;var P=!0;o.set(t,e),o.set(e,t);for(var O=s;++f<c;){g=a[f];var E=t[g],m=e[g];if(n)var d=s?n(m,E,g,e,t,o):n(E,m,g,t,e,o);if(!(d===void 0?E===m||i(E,m,r,n,o):d)){P=!1;break}O||(O=g=="constructor")}if(P&&!O){var _=t.constructor,$=e.constructor;_!=$&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof $=="function"&&$ instanceof $)&&(P=!1)}return o.delete(t),o.delete(e),P}var mP=LK;var MK=1,hP="[object Arguments]",gP="[object Array]",_p="[object Object]",$K=Object.prototype,yP=$K.hasOwnProperty;function FK(t,e,r,n,i,o){var s=ee(t),a=ee(e),c=s?gP:ui(t),u=a?gP:ui(e);c=c==hP?_p:c,u=u==hP?_p:u;var l=c==_p,f=u==_p,g=c==u;if(g&&lo(t)){if(!lo(e))return!1;s=!0,l=!1}if(g&&!l)return o||(o=new Vo),s||ec(t)?bp(t,e,r,n,i,o):pP(t,e,c,r,n,i,o);if(!(r&MK)){var T=l&&yP.call(t,"__wrapped__"),C=f&&yP.call(e,"__wrapped__");if(T||C){var P=T?t.value():t,O=C?e.value():e;return o||(o=new Vo),i(P,O,r,n,o)}}return g?(o||(o=new Vo),mP(t,e,r,n,i,o)):!1}var vP=FK;function TP(t,e,r,n,i){return t===e?!0:t==null||e==null||!Ut(t)&&!Ut(e)?t!==t&&e!==e:vP(t,e,r,n,TP,i)}var Sp=TP;var qK=1,jK=2;function UK(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var c=a[0],u=t[c],l=a[1];if(s&&a[2]){if(u===void 0&&!(c in t))return!1}else{var f=new Vo;if(n)var g=n(u,l,c,t,e,f);if(!(g===void 0?Sp(l,u,qK|jK,n,f):g))return!1}}return!0}var RP=UK;function WK(t){return t===t&&!Et(t)}var kp=WK;function HK(t){for(var e=it(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,kp(i)]}return e}var xP=HK;function GK(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var wp=GK;function BK(t){var e=xP(t);return e.length==1&&e[0][2]?wp(e[0][0],e[0][1]):function(r){return r===t||RP(r,t,e)}}var bP=BK;function KK(t,e){return t!=null&&e in Object(t)}var _P=KK;function zK(t,e,r){e=zo(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=Ni(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Za(i)&&Fo(s,i)&&(ee(t)||Uo(t)))}var Cp=zK;function VK(t,e){return t!=null&&Cp(t,e,_P)}var SP=VK;var XK=1,YK=2;function JK(t,e){return tc(t)&&kp(e)?wp(Ni(t),e):function(r){var n=TE(r,t);return n===void 0&&n===e?SP(r,t):Sp(e,n,XK|YK)}}var kP=JK;function QK(t){return function(e){return e?.[t]}}var wP=QK;function ZK(t){return function(e){return oc(e,t)}}var CP=ZK;function ez(t){return tc(t)?wP(Ni(t)):CP(t)}var EP=ez;function tz(t){return typeof t=="function"?t:t==null?rn:typeof t=="object"?ee(t)?kP(t[0],t[1]):bP(t):EP(t)}var Lt=tz;function rz(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}var PP=rz;function nz(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var c=s[t?a:++i];if(r(o[c],c,o)===!1)break}return e}}var AP=nz;var iz=AP(),DP=iz;function oz(t,e){return t&&DP(t,e,it)}var NP=oz;function sz(t,e){return function(r,n){if(r==null)return r;if(!Qt(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var IP=sz;var az=IP(NP),on=az;function cz(t,e,r,n){return on(t,function(i,o,s){e(n,i,r(i),s)}),n}var OP=cz;function uz(t,e){return function(r,n){var i=ee(r)?PP:OP,o=e?e():{};return i(r,t,Lt(n,2),o)}}var LP=uz;var MP=Object.prototype,lz=MP.hasOwnProperty,fz=Qa(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&jo(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=Wo(o),a=-1,c=s.length;++a<c;){var u=s[a],l=t[u];(l===void 0||Ei(l,MP[u])&&!lz.call(t,u))&&(t[u]=o[u])}return t}),gc=fz;function dz(t){return Ut(t)&&Qt(t)}var Xv=dz;function pz(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var Ep=pz;var mz=200;function hz(t,e,r,n){var i=-1,o=ap,s=!0,a=t.length,c=[],u=e.length;if(!a)return c;r&&(e=wi(e,Di(r))),n?(o=Ep,s=!1):e.length>=mz&&(o=mc,s=!1,e=new pc(e));e:for(;++i<a;){var l=t[i],f=r==null?l:r(l);if(l=n||l!==0?l:0,s&&f===f){for(var g=u;g--;)if(e[g]===f)continue e;c.push(l)}else o(e,f,n)||c.push(l)}return c}var $P=hz;var gz=Qa(function(t,e){return Xv(t)?$P(t,ac(e,1,Xv,!0)):[]}),Yo=gz;function yz(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var Oi=yz;function vz(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Ci(e),dp(t,e<0?0:e,n)):[]}var Ht=vz;function Tz(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Ci(e),e=n-e,dp(t,0,e<0?0:e)):[]}var po=Tz;function Rz(t){return typeof t=="function"?t:rn}var FP=Rz;function xz(t,e){var r=ee(t)?op:on;return r(t,FP(e))}var J=xz;function bz(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var qP=bz;function _z(t,e){var r=!0;return on(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var jP=_z;function Sz(t,e,r){var n=ee(t)?qP:jP;return r&&jo(t,e,r)&&(e=void 0),n(t,Lt(e,3))}var Mr=Sz;function kz(t,e){var r=[];return on(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var Pp=kz;function wz(t,e){var r=ee(t)?uc:Pp;return r(t,Lt(e,3))}var pr=wz;function Cz(t){return function(e,r,n){var i=Object(e);if(!Qt(e)){var o=Lt(r,3);e=it(e),r=function(a){return o(i[a],a,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}var UP=Cz;var Ez=Math.max;function Pz(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Ci(r);return i<0&&(i=Ez(n+i,0)),sp(t,Lt(e,3),i)}var WP=Pz;var Az=UP(WP),Li=Az;function Dz(t){return t&&t.length?t[0]:void 0}var mr=Dz;function Nz(t,e){var r=-1,n=Qt(t)?Array(t.length):[];return on(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var HP=Nz;function Iz(t,e){var r=ee(t)?wi:HP;return r(t,Lt(e,3))}var B=Iz;function Oz(t,e){return ac(B(t,e),1)}var kr=Oz;var Lz=Object.prototype,Mz=Lz.hasOwnProperty,$z=LP(function(t,e,r){Mz.call(t,r)?t[r].push(e):Ja(t,r,[e])}),Yv=$z;var Fz=Object.prototype,qz=Fz.hasOwnProperty;function jz(t,e){return t!=null&&qz.call(t,e)}var GP=jz;function Uz(t,e){return t!=null&&Cp(t,e,GP)}var Z=Uz;var Wz="[object String]";function Hz(t){return typeof t=="string"||!ee(t)&&Ut(t)&&zr(t)==Wz}var sr=Hz;function Gz(t,e){return wi(e,function(r){return t[r]})}var BP=Gz;function Bz(t){return t==null?[]:BP(t,it(t))}var Ze=Bz;var Kz=Math.max;function zz(t,e,r,n){t=Qt(t)?t:Ze(t),r=r&&!n?Ci(r):0;var i=t.length;return r<0&&(r=Kz(i+r,0)),sr(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Ya(t,e,r)>-1}var Tt=zz;var Vz=Math.max;function Xz(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Ci(r);return i<0&&(i=Vz(n+i,0)),Ya(t,e,i)}var Ap=Xz;var Yz="[object Map]",Jz="[object Set]",Qz=Object.prototype,Zz=Qz.hasOwnProperty;function e2(t){if(t==null)return!0;if(Qt(t)&&(ee(t)||typeof t=="string"||typeof t.splice=="function"||lo(t)||ec(t)||Uo(t)))return!t.length;var e=ui(t);if(e==Yz||e==Jz)return!t.size;if(Ai(t))return!lp(t).length;for(var r in t)if(Zz.call(t,r))return!1;return!0}var Se=e2;var t2="[object RegExp]";function r2(t){return Ut(t)&&zr(t)==t2}var KP=r2;var zP=$n&&$n.isRegExp,n2=zP?Di(zP):KP,Fn=n2;function i2(t){return t===void 0}var $r=i2;function o2(t,e){return t<e}var VP=o2;function s2(t,e,r){for(var n=-1,i=t.length;++n<i;){var o=t[n],s=e(o);if(s!=null&&(a===void 0?s===s&&!ki(s):r(s,a)))var a=s,c=o}return c}var XP=s2;function a2(t){return t&&t.length?XP(t,rn,VP):void 0}var YP=a2;var c2="Expected a function";function u2(t){if(typeof t!="function")throw new TypeError(c2);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var JP=u2;function l2(t,e,r,n){if(!Et(t))return t;e=zo(e,t);for(var i=-1,o=e.length,s=o-1,a=t;a!=null&&++i<o;){var c=Ni(e[i]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=s){var l=a[c];u=n?n(l,c,a):void 0,u===void 0&&(u=Et(l)?l:Fo(e[i+1])?[]:{})}qo(a,c,u),a=a[c]}return t}var QP=l2;function f2(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=oc(t,s);r(a,s)&&QP(o,zo(s,t),a)}return o}var ZP=f2;function d2(t,e){if(t==null)return{};var r=wi(gp(t),function(n){return[n]});return e=Lt(e),ZP(t,r,function(n,i){return e(n,i[0])})}var sn=d2;function p2(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var eA=p2;function m2(t,e,r){var n=ee(t)?_E:eA,i=arguments.length<3;return n(t,Lt(e,4),r,i,on)}var At=m2;function h2(t,e){var r=ee(t)?uc:Pp;return r(t,JP(Lt(e,3)))}var Jo=h2;function g2(t,e){var r;return on(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var tA=g2;function y2(t,e,r){var n=ee(t)?xp:tA;return r&&jo(t,e,r)&&(e=void 0),n(t,Lt(e,3))}var sl=y2;var v2=1/0,T2=Xo&&1/hc(new Xo([,-0]))[1]==v2?function(t){return new Xo(t)}:Pt,rA=T2;var R2=200;function x2(t,e,r){var n=-1,i=ap,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=Ep;else if(o>=R2){var u=e?null:rA(t);if(u)return hc(u);s=!1,i=mc,c=new pc}else c=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var g=c.length;g--;)if(c[g]===f)continue e;e&&c.push(f),a.push(l)}else i(c,f,r)||(c!==a&&c.push(f),a.push(l))}return a}var Dp=x2;function b2(t){return t&&t.length?Dp(t):[]}var yc=b2;function _2(t,e){return t&&t.length?Dp(t,Lt(e,2)):[]}var nA=_2;function vc(t){console&&console.error&&console.error(`Error: ${t}`)}function al(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function cl(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function ul(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function S2(t){return k2(t)?t.LABEL:t.name}function k2(t){return sr(t.LABEL)&&t.LABEL!==""}var xn=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),J(this.definition,r=>{r.accept(e)})}},Ge=class extends xn{constructor(e){super([]),this.idx=1,Sr(this,sn(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Xr=class extends xn{constructor(e){super(e.definition),this.orgText="",Sr(this,sn(e,r=>r!==void 0))}},at=class extends xn{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Sr(this,sn(e,r=>r!==void 0))}},Be=class extends xn{constructor(e){super(e.definition),this.idx=1,Sr(this,sn(e,r=>r!==void 0))}},ct=class extends xn{constructor(e){super(e.definition),this.idx=1,Sr(this,sn(e,r=>r!==void 0))}},ut=class extends xn{constructor(e){super(e.definition),this.idx=1,Sr(this,sn(e,r=>r!==void 0))}},Ne=class extends xn{constructor(e){super(e.definition),this.idx=1,Sr(this,sn(e,r=>r!==void 0))}},et=class extends xn{constructor(e){super(e.definition),this.idx=1,Sr(this,sn(e,r=>r!==void 0))}},tt=class extends xn{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Sr(this,sn(e,r=>r!==void 0))}},we=class{constructor(e){this.idx=1,Sr(this,sn(e,r=>r!==void 0))}accept(e){e.visit(this)}};function Np(t){return B(t,Tc)}function Tc(t){function e(r){return B(r,Tc)}if(t instanceof Ge){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return sr(t.label)&&(r.label=t.label),r}else{if(t instanceof at)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Be)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof ct)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ut)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Tc(new we({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof et)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Tc(new we({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Ne)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof tt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof we){let r={type:"Terminal",name:t.terminalType.name,label:S2(t.terminalType),idx:t.idx};sr(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Fn(n)?n.source:n),r}else{if(t instanceof Xr)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var Yr=class{visit(e){let r=e;switch(r.constructor){case Ge:return this.visitNonTerminal(r);case at:return this.visitAlternative(r);case Be:return this.visitOption(r);case ct:return this.visitRepetitionMandatory(r);case ut:return this.visitRepetitionMandatoryWithSeparator(r);case et:return this.visitRepetitionWithSeparator(r);case Ne:return this.visitRepetition(r);case tt:return this.visitAlternation(r);case we:return this.visitTerminal(r);case Xr:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function Jv(t){return t instanceof at||t instanceof Be||t instanceof Ne||t instanceof ct||t instanceof ut||t instanceof et||t instanceof we||t instanceof Xr}function Us(t,e=[]){return t instanceof Be||t instanceof Ne||t instanceof et?!0:t instanceof tt?sl(t.definition,n=>Us(n,e)):t instanceof Ge&&Tt(e,t)?!1:t instanceof xn?(t instanceof Ge&&e.push(t),Mr(t.definition,n=>Us(n,e))):!1}function Qv(t){return t instanceof tt}function an(t){if(t instanceof Ge)return"SUBRULE";if(t instanceof Be)return"OPTION";if(t instanceof tt)return"OR";if(t instanceof ct)return"AT_LEAST_ONE";if(t instanceof ut)return"AT_LEAST_ONE_SEP";if(t instanceof et)return"MANY_SEP";if(t instanceof Ne)return"MANY";if(t instanceof we)return"CONSUME";throw Error("non exhaustive match")}var mo=class{walk(e,r=[]){J(e.definition,(n,i)=>{let o=Ht(e.definition,i+1);if(n instanceof Ge)this.walkProdRef(n,o,r);else if(n instanceof we)this.walkTerminal(n,o,r);else if(n instanceof at)this.walkFlat(n,o,r);else if(n instanceof Be)this.walkOption(n,o,r);else if(n instanceof ct)this.walkAtLeastOne(n,o,r);else if(n instanceof ut)this.walkAtLeastOneSep(n,o,r);else if(n instanceof et)this.walkManySep(n,o,r);else if(n instanceof Ne)this.walkMany(n,o,r);else if(n instanceof tt)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Be({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=iA(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Be({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=iA(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);J(e.definition,o=>{let s=new at({definition:[o]});this.walk(s,i)})}};function iA(t,e,r){return[new Be({definition:[new we({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Ws(t){if(t instanceof Ge)return Ws(t.referencedRule);if(t instanceof we)return E2(t);if(Jv(t))return w2(t);if(Qv(t))return C2(t);throw Error("non exhaustive match")}function w2(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=Us(o),e=e.concat(Ws(o)),n=n+1,i=r.length>n;return yc(e)}function C2(t){let e=B(t.definition,r=>Ws(r));return yc(Wt(e))}function E2(t){return[t.terminalType]}var Ip="_~IN~_";var Zv=class extends mo{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=P2(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new at({definition:o}),a=Ws(s);this.follows[i]=a}};function oA(t){let e={};return J(t,r=>{let n=new Zv(r).startWalking();Sr(e,n)}),e}function P2(t,e){return t.name+e+Ip}var Op={},A2=new Is;function Rc(t){let e=t.toString();if(Op.hasOwnProperty(e))return Op[e];{let r=A2.pattern(e);return Op[e]=r,r}}function sA(){Op={}}var cA="Complement Sets are not supported for first char optimization",ll=`Unable to use "first char" lexer optimizations:
89
+ `;function uA(t,e=!1){try{let r=Rc(t);return eT(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===cA)e&&al(`${ll} Unable to optimize: < ${t.toString()} >
88
90
  Complement Sets cannot be automatically optimized.
89
91
  This will disable the lexer's first char optimizations.
90
92
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
91
93
  This will disable the lexer's first char optimizations.
92
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),yc(`${Ju}
94
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),vc(`${ll}
93
95
  Failed parsing: < ${t.toString()} >
94
96
  Using the @chevrotain/regexp-to-ast library
95
- Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function hv(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)hv(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":bp(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(mD);Q(s.value,c=>{if(typeof c=="number")bp(c,e,r);else{let f=c;if(r===!0)for(let p=f.from;p<=f.to;p++)bp(p,e,r);else{for(let p=f.from;p<=f.to&&p<Rc;p++)bp(p,e,r);if(f.to>=Rc){let p=f.from>=Rc?f.from:Rc,m=f.to,T=Gi(p),k=Gi(m);for(let A=T;A<=k;A++)e[A]=A}}}});break;case"Group":hv(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&gv(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return it(e)}function bp(t,e,r){let n=Gi(t);e[n]=n,r===!0&&CG(t,e)}function CG(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Gi(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=Gi(i.charCodeAt(0));e[o]=o}}}function pD(t,e){return Hi(t.value,r=>{if(typeof r=="number")return St(e,r);{let n=r;return Hi(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function gv(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?re(t.value)?Gr(t.value,gv):gv(t.value):!1}var yv=class extends Ai{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){St(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?pD(e,this.targetCharCodes)===void 0&&(this.found=!0):pD(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function _p(t,e){if(e instanceof RegExp){let r=Tc(e),n=new yv(t);return n.visit(r),n.found}else return Hi(e,r=>St(t,r.charCodeAt(0)))!==void 0}var Hs="PATTERN",xc="defaultMode",Sp="modes",Tv=typeof new RegExp("(?:)").sticky=="boolean";function vD(t,e){e=hc(e,{useSticky:Tv,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
96
- `],tracer:(y,h)=>h()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{GG()});let n;r("Reject Lexer.NA",()=>{n=is(t,y=>y[Hs]===Wt.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=B(n,y=>{let h=y[Hs];if(Gn(h)){let C=h.source;return C.length===1&&C!=="^"&&C!=="$"&&C!=="."&&!h.ignoreCase?C:C.length===2&&C[0]==="\\"&&!St(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],C[1])?C[1]:e.useSticky?yD(h):gD(h)}else{if(Qr(h))return i=!0,{exec:h};if(typeof h=="object")return i=!0,h;if(typeof h=="string"){if(h.length===1)return h;{let C=h.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),M=new RegExp(C);return e.useSticky?yD(M):gD(M)}}else throw Error("non exhaustive match")}})});let s,a,c,f,p;r("misc mapping",()=>{s=B(n,y=>y.tokenTypeIdx),a=B(n,y=>{let h=y.GROUP;if(h!==Wt.SKIPPED){if(fr(h))return h;if(Br(h))return!1;throw Error("non exhaustive match")}}),c=B(n,y=>{let h=y.LONGER_ALT;if(h)return re(h)?B(h,M=>yp(n,M)):[yp(n,h)]}),f=B(n,y=>y.PUSH_MODE),p=B(n,y=>ee(y,"POP_MODE"))});let m;r("Line Terminator Handling",()=>{let y=CD(e.lineTerminatorCharacters);m=B(n,h=>!1),e.positionTracking!=="onlyOffset"&&(m=B(n,h=>ee(h,"LINE_BREAKS")?!!h.LINE_BREAKS:kD(h,y)===!1&&_p(y,h.PATTERN)))});let T,k,A,N;r("Misc Mapping #2",()=>{T=B(n,_D),k=B(o,WG),A=Mt(n,(y,h)=>{let C=h.GROUP;return fr(C)&&C!==Wt.SKIPPED&&(y[C]=[]),y},{}),N=B(o,(y,h)=>({pattern:o[h],longerAlt:c[h],canLineTerminator:m[h],isCustom:T[h],short:k[h],group:a[h],push:f[h],pop:p[h],tokenTypeIdx:s[h],tokenType:n[h]}))});let O=!0,P=[];return e.safeMode||r("First Char Optimization",()=>{P=Mt(n,(y,h,C)=>{if(typeof h.PATTERN=="string"){let M=h.PATTERN.charCodeAt(0),z=Gi(M);vv(y,z,N[C])}else if(re(h.START_CHARS_HINT)){let M;Q(h.START_CHARS_HINT,z=>{let ce=typeof z=="string"?z.charCodeAt(0):z,we=Gi(ce);M!==we&&(M=we,vv(y,we,N[C]))})}else if(Gn(h.PATTERN))if(h.PATTERN.unicode)O=!1,e.ensureOptimizations&&yc(`${Ju} Unable to analyze < ${h.PATTERN.toString()} > pattern.
97
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function eT(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)eT(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":Lp(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(cA);J(s.value,c=>{if(typeof c=="number")Lp(c,e,r);else{let u=c;if(r===!0)for(let l=u.from;l<=u.to;l++)Lp(l,e,r);else{for(let l=u.from;l<=u.to&&l<xc;l++)Lp(l,e,r);if(u.to>=xc){let l=u.from>=xc?u.from:xc,f=u.to,g=Mi(l),T=Mi(f);for(let C=g;C<=T;C++)e[C]=C}}}});break;case"Group":eT(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&tT(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Ze(e)}function Lp(t,e,r){let n=Mi(t);e[n]=n,r===!0&&D2(t,e)}function D2(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Mi(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=Mi(i.charCodeAt(0));e[o]=o}}}function aA(t,e){return Li(t.value,r=>{if(typeof r=="number")return Tt(e,r);{let n=r;return Li(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function tT(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?ee(t.value)?Mr(t.value,tT):tT(t.value):!1}var rT=class extends _i{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){Tt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?aA(e,this.targetCharCodes)===void 0&&(this.found=!0):aA(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Mp(t,e){if(e instanceof RegExp){let r=Rc(e),n=new rT(t);return n.visit(r),n.found}else return Li(e,r=>Tt(t,r.charCodeAt(0)))!==void 0}var Hs="PATTERN",bc="defaultMode",$p="modes",iT=typeof new RegExp("(?:)").sticky=="boolean";function dA(t,e){e=gc(e,{useSticky:iT,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
98
+ `],tracer:(m,d)=>d()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{X2()});let n;r("Reject Lexer.NA",()=>{n=Jo(t,m=>m[Hs]===Mt.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=B(n,m=>{let d=m[Hs];if(Fn(d)){let _=d.source;return _.length===1&&_!=="^"&&_!=="$"&&_!=="."&&!d.ignoreCase?_:_.length===2&&_[0]==="\\"&&!Tt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],_[1])?_[1]:e.useSticky?fA(d):lA(d)}else{if(Vr(d))return i=!0,{exec:d};if(typeof d=="object")return i=!0,d;if(typeof d=="string"){if(d.length===1)return d;{let _=d.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),$=new RegExp(_);return e.useSticky?fA($):lA($)}}else throw Error("non exhaustive match")}})});let s,a,c,u,l;r("misc mapping",()=>{s=B(n,m=>m.tokenTypeIdx),a=B(n,m=>{let d=m.GROUP;if(d!==Mt.SKIPPED){if(sr(d))return d;if($r(d))return!1;throw Error("non exhaustive match")}}),c=B(n,m=>{let d=m.LONGER_ALT;if(d)return ee(d)?B(d,$=>Ap(n,$)):[Ap(n,d)]}),u=B(n,m=>m.PUSH_MODE),l=B(n,m=>Z(m,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let m=RA(e.lineTerminatorCharacters);f=B(n,d=>!1),e.positionTracking!=="onlyOffset"&&(f=B(n,d=>Z(d,"LINE_BREAKS")?!!d.LINE_BREAKS:TA(d,m)===!1&&Mp(m,d.PATTERN)))});let g,T,C,P;r("Misc Mapping #2",()=>{g=B(n,yA),T=B(o,z2),C=At(n,(m,d)=>{let _=d.GROUP;return sr(_)&&_!==Mt.SKIPPED&&(m[_]=[]),m},{}),P=B(o,(m,d)=>({pattern:o[d],longerAlt:c[d],canLineTerminator:f[d],isCustom:g[d],short:T[d],group:a[d],push:u[d],pop:l[d],tokenTypeIdx:s[d],tokenType:n[d]}))});let O=!0,E=[];return e.safeMode||r("First Char Optimization",()=>{E=At(n,(m,d,_)=>{if(typeof d.PATTERN=="string"){let $=d.PATTERN.charCodeAt(0),X=Mi($);nT(m,X,P[_])}else if(ee(d.START_CHARS_HINT)){let $;J(d.START_CHARS_HINT,X=>{let ke=typeof X=="string"?X.charCodeAt(0):X,Me=Mi(ke);$!==Me&&($=Me,nT(m,Me,P[_]))})}else if(Fn(d.PATTERN))if(d.PATTERN.unicode)O=!1,e.ensureOptimizations&&vc(`${ll} Unable to analyze < ${d.PATTERN.toString()} > pattern.
97
99
  The regexp unicode flag is not currently supported by the regexp-to-ast library.
98
100
  This will disable the lexer's first char optimizations.
99
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let M=hD(h.PATTERN,e.ensureOptimizations);Ee(M)&&(O=!1),Q(M,z=>{vv(y,z,N[C])})}else e.ensureOptimizations&&yc(`${Ju} TokenType: <${h.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
101
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let $=uA(d.PATTERN,e.ensureOptimizations);Se($)&&(O=!1),J($,X=>{nT(m,X,P[_])})}else e.ensureOptimizations&&vc(`${ll} TokenType: <${d.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
100
102
  This will disable the lexer's first char optimizations.
101
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),O=!1;return y},[])}),{emptyGroups:A,patternIdxToConfig:N,charCodeToPatternIdxToConfig:P,hasCustom:i,canBeOptimized:O}}function TD(t,e){let r=[],n=DG(t);r=r.concat(n.errors);let i=EG(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(wG(o)),r=r.concat($G(o)),r=r.concat(qG(o,e)),r=r.concat(FG(o)),r}function wG(t){let e=[],r=vr(t,n=>Gn(n[Hs]));return e=e.concat(AG(r)),e=e.concat(OG(r)),e=e.concat(LG(r)),e=e.concat(MG(r)),e=e.concat(NG(r)),e}function DG(t){let e=vr(t,i=>!ee(i,Hs)),r=B(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:kt.MISSING_PATTERN,tokenTypes:[i]})),n=ns(t,e);return{errors:r,valid:n}}function EG(t){let e=vr(t,i=>{let o=i[Hs];return!Gn(o)&&!Qr(o)&&!ee(o,"exec")&&!fr(o)}),r=B(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:kt.INVALID_PATTERN,tokenTypes:[i]})),n=ns(t,e);return{errors:r,valid:n}}var PG=/[^\\][$]/;function AG(t){class e extends Ai{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=vr(t,i=>{let o=i.PATTERN;try{let s=Tc(o),a=new e;return a.visit(s),a.found}catch{return PG.test(o.source)}});return B(r,i=>({message:`Unexpected RegExp Anchor Error:
103
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),O=!1;return m},[])}),{emptyGroups:C,patternIdxToConfig:P,charCodeToPatternIdxToConfig:E,hasCustom:i,canBeOptimized:O}}function pA(t,e){let r=[],n=I2(t);r=r.concat(n.errors);let i=O2(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(N2(o)),r=r.concat(W2(o)),r=r.concat(H2(o,e)),r=r.concat(G2(o)),r}function N2(t){let e=[],r=pr(t,n=>Fn(n[Hs]));return e=e.concat(M2(r)),e=e.concat(q2(r)),e=e.concat(j2(r)),e=e.concat(U2(r)),e=e.concat($2(r)),e}function I2(t){let e=pr(t,i=>!Z(i,Hs)),r=B(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Rt.MISSING_PATTERN,tokenTypes:[i]})),n=Yo(t,e);return{errors:r,valid:n}}function O2(t){let e=pr(t,i=>{let o=i[Hs];return!Fn(o)&&!Vr(o)&&!Z(o,"exec")&&!sr(o)}),r=B(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Rt.INVALID_PATTERN,tokenTypes:[i]})),n=Yo(t,e);return{errors:r,valid:n}}var L2=/[^\\][$]/;function M2(t){class e extends _i{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=pr(t,i=>{let o=i.PATTERN;try{let s=Rc(o),a=new e;return a.visit(s),a.found}catch{return L2.test(o.source)}});return B(r,i=>({message:`Unexpected RegExp Anchor Error:
102
104
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
103
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:kt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function NG(t){let e=vr(t,n=>n.PATTERN.test(""));return B(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:kt.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var IG=/[^\\[][\^]|^\^/;function OG(t){class e extends Ai{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=vr(t,i=>{let o=i.PATTERN;try{let s=Tc(o),a=new e;return a.visit(s),a.found}catch{return IG.test(o.source)}});return B(r,i=>({message:`Unexpected RegExp Anchor Error:
105
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Rt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function $2(t){let e=pr(t,n=>n.PATTERN.test(""));return B(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Rt.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var F2=/[^\\[][\^]|^\^/;function q2(t){class e extends _i{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=pr(t,i=>{let o=i.PATTERN;try{let s=Rc(o),a=new e;return a.visit(s),a.found}catch{return F2.test(o.source)}});return B(r,i=>({message:`Unexpected RegExp Anchor Error:
104
106
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
105
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:kt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function LG(t){let e=vr(t,n=>{let i=n[Hs];return i instanceof RegExp&&(i.multiline||i.global)});return B(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:kt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function MG(t){let e=[],r=B(t,o=>Mt(t,(s,a)=>(o.PATTERN.source===a.PATTERN.source&&!St(e,a)&&a.PATTERN!==Wt.NA&&(e.push(a),s.push(a)),s),[]));r=Ui(r);let n=vr(r,o=>o.length>1);return B(n,o=>{let s=B(o,c=>c.name);return{message:`The same RegExp pattern ->${Tr(o).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:kt.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function $G(t){let e=vr(t,n=>{if(!ee(n,"GROUP"))return!1;let i=n.GROUP;return i!==Wt.SKIPPED&&i!==Wt.NA&&!fr(i)});return B(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:kt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function qG(t,e){let r=vr(t,i=>i.PUSH_MODE!==void 0&&!St(e,i.PUSH_MODE));return B(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:kt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function FG(t){let e=[],r=Mt(t,(n,i,o)=>{let s=i.PATTERN;return s===Wt.NA||(fr(s)?n.push({str:s,idx:o,tokenType:i}):Gn(s)&&UG(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return Q(t,(n,i)=>{Q(r,({str:o,idx:s,tokenType:a})=>{if(i<s&&jG(o,n.PATTERN)){let c=`Token: ->${a.name}<- can never be matched.
107
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Rt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function j2(t){let e=pr(t,n=>{let i=n[Hs];return i instanceof RegExp&&(i.multiline||i.global)});return B(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Rt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function U2(t){let e=[],r=B(t,o=>At(t,(s,a)=>(o.PATTERN.source===a.PATTERN.source&&!Tt(e,a)&&a.PATTERN!==Mt.NA&&(e.push(a),s.push(a)),s),[]));r=Ii(r);let n=pr(r,o=>o.length>1);return B(n,o=>{let s=B(o,c=>c.name);return{message:`The same RegExp pattern ->${mr(o).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Rt.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function W2(t){let e=pr(t,n=>{if(!Z(n,"GROUP"))return!1;let i=n.GROUP;return i!==Mt.SKIPPED&&i!==Mt.NA&&!sr(i)});return B(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Rt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function H2(t,e){let r=pr(t,i=>i.PUSH_MODE!==void 0&&!Tt(e,i.PUSH_MODE));return B(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Rt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function G2(t){let e=[],r=At(t,(n,i,o)=>{let s=i.PATTERN;return s===Mt.NA||(sr(s)?n.push({str:s,idx:o,tokenType:i}):Fn(s)&&K2(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return J(t,(n,i)=>{J(r,({str:o,idx:s,tokenType:a})=>{if(i<s&&B2(o,n.PATTERN)){let c=`Token: ->${a.name}<- can never be matched.
106
108
  Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
107
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:kt.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function jG(t,e){if(Gn(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(Qr(e))return e(t,0,[],{});if(ee(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function UG(t){return Hi([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function gD(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function yD(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function RD(t,e,r){let n=[];return ee(t,xc)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+xc+`> property in its definition
108
- `,type:kt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),ee(t,Sp)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Sp+`> property in its definition
109
- `,type:kt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),ee(t,Sp)&&ee(t,xc)&&!ee(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${xc}: <${t.defaultMode}>which does not exist
110
- `,type:kt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),ee(t,Sp)&&Q(t.modes,(i,o)=>{Q(i,(s,a)=>{if(Br(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${a}>
111
- `,type:kt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(ee(s,"LONGER_ALT")){let c=re(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];Q(c,f=>{!Br(f)&&!St(i,f)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${f.name}> on token <${s.name}> outside of mode <${o}>
112
- `,type:kt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function xD(t,e,r){let n=[],i=!1,o=Ui(Bt(it(t.modes))),s=is(o,c=>c[Hs]===Wt.NA),a=CD(r);return e&&Q(s,c=>{let f=kD(c,a);if(f!==!1){let m={message:HG(c,f),type:f.issue,tokenType:c};n.push(m)}else ee(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):_p(a,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
109
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Rt.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function B2(t,e){if(Fn(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(Vr(e))return e(t,0,[],{});if(Z(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function K2(t){return Li([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function lA(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function fA(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function mA(t,e,r){let n=[];return Z(t,bc)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+bc+`> property in its definition
110
+ `,type:Rt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Z(t,$p)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+$p+`> property in its definition
111
+ `,type:Rt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Z(t,$p)&&Z(t,bc)&&!Z(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${bc}: <${t.defaultMode}>which does not exist
112
+ `,type:Rt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Z(t,$p)&&J(t.modes,(i,o)=>{J(i,(s,a)=>{if($r(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${a}>
113
+ `,type:Rt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Z(s,"LONGER_ALT")){let c=ee(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];J(c,u=>{!$r(u)&&!Tt(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${o}>
114
+ `,type:Rt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function hA(t,e,r){let n=[],i=!1,o=Ii(Wt(Ze(t.modes))),s=Jo(o,c=>c[Hs]===Mt.NA),a=RA(r);return e&&J(s,c=>{let u=TA(c,a);if(u!==!1){let f={message:V2(c,u),type:u.issue,tokenType:c};n.push(f)}else Z(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Mp(a,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
113
115
  This Lexer has been defined to track line and column information,
114
116
  But none of the Token Types can be identified as matching a line terminator.
115
117
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
116
- for details.`,type:kt.NO_LINE_BREAKS_FLAGS}),n}function bD(t){let e={},r=ut(t);return Q(r,n=>{let i=t[n];if(re(i))e[n]=[];else throw Error("non exhaustive match")}),e}function _D(t){let e=t.PATTERN;if(Gn(e))return!1;if(Qr(e))return!0;if(ee(e,"exec"))return!0;if(fr(e))return!1;throw Error("non exhaustive match")}function WG(t){return fr(t)&&t.length===1?t.charCodeAt(0):!1}var SD={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function kD(t,e){if(ee(t,"LINE_BREAKS"))return!1;if(Gn(t.PATTERN)){try{_p(e,t.PATTERN)}catch(r){return{issue:kt.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(fr(t.PATTERN))return!1;if(_D(t))return{issue:kt.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function HG(t,e){if(e.issue===kt.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
118
+ for details.`,type:Rt.NO_LINE_BREAKS_FLAGS}),n}function gA(t){let e={},r=it(t);return J(r,n=>{let i=t[n];if(ee(i))e[n]=[];else throw Error("non exhaustive match")}),e}function yA(t){let e=t.PATTERN;if(Fn(e))return!1;if(Vr(e))return!0;if(Z(e,"exec"))return!0;if(sr(e))return!1;throw Error("non exhaustive match")}function z2(t){return sr(t)&&t.length===1?t.charCodeAt(0):!1}var vA={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function TA(t,e){if(Z(t,"LINE_BREAKS"))return!1;if(Fn(t.PATTERN)){try{Mp(e,t.PATTERN)}catch(r){return{issue:Rt.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(sr(t.PATTERN))return!1;if(yA(t))return{issue:Rt.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function V2(t,e){if(e.issue===Rt.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
117
119
  The problem is in the <${t.name}> Token Type
118
120
  Root cause: ${e.errMsg}.
119
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===kt.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
121
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Rt.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
120
122
  The problem is in the <${t.name}> Token Type
121
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function CD(t){return B(t,r=>fr(r)?r.charCodeAt(0):r)}function vv(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Rc=256,kp=[];function Gi(t){return t<Rc?t:kp[t]}function GG(){if(Ee(kp)){kp=new Array(65536);for(let t=0;t<65536;t++)kp[t]=t>255?255+~~(t/255):t}}function _o(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function bc(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var wD=1,ED={};function So(t){let e=BG(t);KG(e),VG(e),zG(e),Q(e,r=>{r.isParent=r.categoryMatches.length>0})}function BG(t){let e=ft(t),r=t,n=!0;for(;n;){r=Ui(Bt(B(r,o=>o.CATEGORIES)));let i=ns(r,e);e=e.concat(i),Ee(i)?n=!1:r=i}return e}function KG(t){Q(t,e=>{Rv(e)||(ED[wD]=e,e.tokenTypeIdx=wD++),DD(e)&&!re(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),DD(e)||(e.CATEGORIES=[]),XG(e)||(e.categoryMatches=[]),YG(e)||(e.categoryMatchesMap={})})}function zG(t){Q(t,e=>{e.categoryMatches=[],Q(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(ED[n].tokenTypeIdx)})})}function VG(t){Q(t,e=>{PD([],e)})}function PD(t,e){Q(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Q(e.CATEGORIES,r=>{let n=t.concat(e);St(n,r)||PD(n,r)})}function Rv(t){return ee(t,"tokenTypeIdx")}function DD(t){return ee(t,"CATEGORIES")}function XG(t){return ee(t,"categoryMatches")}function YG(t){return ee(t,"categoryMatchesMap")}function AD(t){return ee(t,"tokenTypeIdx")}var xv={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var kt;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(kt||(kt={}));var Qu={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
122
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:xv,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Qu);var Wt=class{constructor(e,r=Qu){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:c}=Xu(o),f=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&f(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
123
- a boolean 2nd argument is no longer supported`);this.config=Er({},Qu,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Qu.lineTerminatorsPattern)this.config.lineTerminatorsPattern=SD;else if(this.config.lineTerminatorCharacters===Qu.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
124
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),re(e)?i={modes:{defaultMode:ft(e)},defaultMode:xc}:(o=!1,i=ft(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(RD(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(xD(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Q(i.modes,(a,c)=>{i.modes[c]=is(a,f=>Br(f))});let s=ut(i.modes);if(Q(i.modes,(a,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(TD(a,s))}),Ee(this.lexerDefinitionErrors)){So(a);let f;this.TRACE_INIT("analyzeTokenTypes",()=>{f=vD(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=f.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=f.charCodeToPatternIdxToConfig,this.emptyGroups=Er({},this.emptyGroups,f.emptyGroups),this.hasCustom=f.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=f.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Ee(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let c=B(this.lexerDefinitionErrors,f=>f.message).join(`-----------------------
123
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function RA(t){return B(t,r=>sr(r)?r.charCodeAt(0):r)}function nT(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var xc=256,Fp=[];function Mi(t){return t<xc?t:Fp[t]}function X2(){if(Se(Fp)){Fp=new Array(65536);for(let t=0;t<65536;t++)Fp[t]=t>255?255+~~(t/255):t}}function ho(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function _c(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var xA=1,_A={};function go(t){let e=Y2(t);J2(e),Z2(e),Q2(e),J(e,r=>{r.isParent=r.categoryMatches.length>0})}function Y2(t){let e=st(t),r=t,n=!0;for(;n;){r=Ii(Wt(B(r,o=>o.CATEGORIES)));let i=Yo(r,e);e=e.concat(i),Se(i)?n=!1:r=i}return e}function J2(t){J(t,e=>{oT(e)||(_A[xA]=e,e.tokenTypeIdx=xA++),bA(e)&&!ee(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),bA(e)||(e.CATEGORIES=[]),eV(e)||(e.categoryMatches=[]),tV(e)||(e.categoryMatchesMap={})})}function Q2(t){J(t,e=>{e.categoryMatches=[],J(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(_A[n].tokenTypeIdx)})})}function Z2(t){J(t,e=>{SA([],e)})}function SA(t,e){J(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),J(e.CATEGORIES,r=>{let n=t.concat(e);Tt(n,r)||SA(n,r)})}function oT(t){return Z(t,"tokenTypeIdx")}function bA(t){return Z(t,"CATEGORIES")}function eV(t){return Z(t,"categoryMatches")}function tV(t){return Z(t,"categoryMatchesMap")}function kA(t){return Z(t,"tokenTypeIdx")}var sT={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var Rt;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Rt||(Rt={}));var fl={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
124
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:sT,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(fl);var Mt=class{constructor(e,r=fl){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:c}=cl(o),u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
125
+ a boolean 2nd argument is no longer supported`);this.config=Sr({},fl,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===fl.lineTerminatorsPattern)this.config.lineTerminatorsPattern=vA;else if(this.config.lineTerminatorCharacters===fl.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
126
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),ee(e)?i={modes:{defaultMode:st(e)},defaultMode:bc}:(o=!1,i=st(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(mA(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(hA(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},J(i.modes,(a,c)=>{i.modes[c]=Jo(a,u=>$r(u))});let s=it(i.modes);if(J(i.modes,(a,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(pA(a,s))}),Se(this.lexerDefinitionErrors)){go(a);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=dA(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Sr({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Se(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let c=B(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
125
127
  `);throw new Error(`Errors detected in definition of Lexer:
126
- `+c)}Q(this.lexerDefinitionWarning,a=>{Vu(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Tv?(this.chopInput=fn,this.match=this.matchWithTest):(this.updateLastIndex=Lt,this.match=this.matchWithExec),o&&(this.handleModes=Lt),this.trackStartLines===!1&&(this.computeNewColumn=fn),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Lt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=Mt(this.canModeBeOptimized,(c,f,p)=>(f===!1&&c.push(p),c),[]);if(r.ensureOptimizations&&!Ee(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
128
+ `+c)}J(this.lexerDefinitionWarning,a=>{al(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(iT?(this.chopInput=rn,this.match=this.matchWithTest):(this.updateLastIndex=Pt,this.match=this.matchWithExec),o&&(this.handleModes=Pt),this.trackStartLines===!1&&(this.computeNewColumn=rn),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Pt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=At(this.canModeBeOptimized,(c,u,l)=>(u===!1&&c.push(l),c),[]);if(r.ensureOptimizations&&!Se(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
127
129
  Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
128
- Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{dD()}),this.TRACE_INIT("toFastProperties",()=>{Yu(this)})})}tokenize(e,r=this.defaultMode){if(!Ee(this.lexerDefinitionErrors)){let i=B(this.lexerDefinitionErrors,o=>o.message).join(`-----------------------
130
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{sA()}),this.TRACE_INIT("toFastProperties",()=>{ul(this)})})}tokenize(e,r=this.defaultMode){if(!Se(this.lexerDefinitionErrors)){let i=B(this.lexerDefinitionErrors,o=>o.message).join(`-----------------------
129
131
  `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
130
- `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,c,f,p,m,T,k,A,N,O,P,y,h=e,C=h.length,M=0,z=0,ce=this.hasCustom?0:Math.floor(e.length/10),we=new Array(ce),Rt=[],tt=this.trackStartLines?1:void 0,U=this.trackStartLines?1:void 0,I=bD(this.emptyGroups),K=this.trackStartLines,V=this.config.lineTerminatorsPattern,Ce=0,me=[],fe=[],gt=[],ze=[];Object.freeze(ze);let _e;function sr(){return me}function Lr(xt){let Vt=Gi(xt),sn=fe[Vt];return sn===void 0?ze:sn}let Yi=xt=>{if(gt.length===1&&xt.tokenType.PUSH_MODE===void 0){let Vt=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(xt);Rt.push({offset:xt.startOffset,line:xt.startLine,column:xt.startColumn,length:xt.image.length,message:Vt})}else{gt.pop();let Vt=Wi(gt);me=this.patternIdxToConfig[Vt],fe=this.charCodeToPatternIdxToConfig[Vt],Ce=me.length;let sn=this.canModeBeOptimized[Vt]&&this.config.safeMode===!1;fe&&sn?_e=Lr:_e=sr}};function Pn(xt){gt.push(xt),fe=this.charCodeToPatternIdxToConfig[xt],me=this.patternIdxToConfig[xt],Ce=me.length,Ce=me.length;let Vt=this.canModeBeOptimized[xt]&&this.config.safeMode===!1;fe&&Vt?_e=Lr:_e=sr}Pn.call(this,r);let zt,bi=this.config.recoveryEnabled;for(;M<C;){c=null;let xt=h.charCodeAt(M),Vt=_e(xt),sn=Vt.length;for(n=0;n<sn;n++){zt=Vt[n];let Ht=zt.pattern;f=null;let rt=zt.short;if(rt!==!1?xt===rt&&(c=Ht):zt.isCustom===!0?(y=Ht.exec(h,M,we,I),y!==null?(c=y[0],y.payload!==void 0&&(f=y.payload)):c=null):(this.updateLastIndex(Ht,M),c=this.match(Ht,e,M)),c!==null){if(a=zt.longerAlt,a!==void 0){let wt=a.length;for(o=0;o<wt;o++){let xr=me[a[o]],mr=xr.pattern;if(p=null,xr.isCustom===!0?(y=mr.exec(h,M,we,I),y!==null?(s=y[0],y.payload!==void 0&&(p=y.payload)):s=null):(this.updateLastIndex(mr,M),s=this.match(mr,e,M)),s&&s.length>c.length){c=s,f=p,zt=xr;break}}}break}}if(c!==null){if(m=c.length,T=zt.group,T!==void 0&&(k=zt.tokenTypeIdx,A=this.createTokenInstance(c,M,k,zt.tokenType,tt,U,m),this.handlePayload(A,f),T===!1?z=this.addToken(we,z,A):I[T].push(A)),e=this.chopInput(e,m),M=M+m,U=this.computeNewColumn(U,m),K===!0&&zt.canLineTerminator===!0){let Ht=0,rt,wt;V.lastIndex=0;do rt=V.test(c),rt===!0&&(wt=V.lastIndex-1,Ht++);while(rt===!0);Ht!==0&&(tt=tt+Ht,U=m-wt,this.updateTokenEndLineColumnLocation(A,T,wt,Ht,tt,U,m))}this.handleModes(zt,Yi,Pn,A)}else{let Ht=M,rt=tt,wt=U,xr=bi===!1;for(;xr===!1&&M<C;)for(e=this.chopInput(e,1),M++,i=0;i<Ce;i++){let mr=me[i],an=mr.pattern,An=mr.short;if(An!==!1?h.charCodeAt(M)===An&&(xr=!0):mr.isCustom===!0?xr=an.exec(h,M,we,I)!==null:(this.updateLastIndex(an,M),xr=an.exec(e)!==null),xr===!0)break}if(N=M-Ht,U=this.computeNewColumn(U,N),P=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(h,Ht,N,rt,wt),Rt.push({offset:Ht,line:rt,column:wt,length:N,message:P}),bi===!1)break}}return this.hasCustom||(we.length=z),{tokens:we,groups:I,errors:Rt}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let c,f;r!==void 0&&(c=n===a-1,f=c?-1:0,i===1&&c===!0||(e.endLine=o+f,e.endColumn=s-1+-f))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Wt.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Wt.NA=/NOT_APPLICABLE/;function ko(t){return bv(t)?t.LABEL:t.name}function bv(t){return fr(t.LABEL)&&t.LABEL!==""}var JG="parent",ND="categories",ID="label",OD="group",LD="push_mode",MD="pop_mode",$D="longer_alt",qD="line_breaks",FD="start_chars_hint";function Cp(t){return QG(t)}function QG(t){let e=t.pattern,r={};if(r.name=t.name,Br(e)||(r.PATTERN=e),ee(t,JG))throw`The parent property is no longer supported.
131
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return ee(t,ND)&&(r.CATEGORIES=t[ND]),So([r]),ee(t,ID)&&(r.LABEL=t[ID]),ee(t,OD)&&(r.GROUP=t[OD]),ee(t,MD)&&(r.POP_MODE=t[MD]),ee(t,LD)&&(r.PUSH_MODE=t[LD]),ee(t,$D)&&(r.LONGER_ALT=t[$D]),ee(t,qD)&&(r.LINE_BREAKS=t[qD]),ee(t,FD)&&(r.START_CHARS_HINT=t[FD]),r}var di=Cp({name:"EOF",pattern:Wt.NA});So([di]);function Gs(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Zu(t,e){return _o(t,e)}var Co={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${bv(t)?`--> ${ko(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
132
- but found: '`+Tr(e).image+"'";if(n)return o+n+a;{let c=Mt(t,(T,k)=>T.concat(k),[]),f=B(c,T=>`[${B(T,k=>ko(k)).join(", ")}]`),m=`one of these possible Token sequences:
133
- ${B(f,(T,k)=>` ${k+1}. ${T}`).join(`
134
- `)}`;return o+m+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",s=`
135
- but found: '`+Tr(e).image+"'";if(r)return i+r+s;{let c=`expecting at least one iteration which starts with one of these possible Token sequences::
136
- <${B(t,f=>`[${B(f,p=>ko(p)).join(",")}]`).join(" ,")}>`;return i+c+s}}};Object.freeze(Co);var jD={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
137
- inside top level rule: ->`+t.name+"<-"}},pi={buildDuplicateFoundError(t,e){function r(p){return p instanceof Pe?p.terminalType.name:p instanceof Be?p.nonTerminalName:""}let n=t.name,i=Tr(e),o=i.idx,s=hn(i),a=r(i),c=o>0,f=`->${s}${c?o:""}<- ${a?`with argument: ->${a}<-`:""}
132
+ `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,c,u,l,f,g,T,C,P,O,E,m,d=e,_=d.length,$=0,X=0,ke=this.hasCustom?0:Math.floor(e.length/10),Me=new Array(ke),Bt=[],_t=this.trackStartLines?1:void 0,G=this.trackStartLines?1:void 0,A=gA(this.emptyGroups),z=this.trackStartLines,Y=this.config.lineTerminatorsPattern,Ce=0,fe=[],ce=[],St=[],ft=[];Object.freeze(ft);let be;function Er(){return fe}function Bn(Nt){let ur=Mi(Nt),Sn=ce[ur];return Sn===void 0?ft:Sn}let ms=Nt=>{if(St.length===1&&Nt.tokenType.PUSH_MODE===void 0){let ur=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Nt);Bt.push({offset:Nt.startOffset,line:Nt.startLine,column:Nt.startColumn,length:Nt.image.length,message:ur})}else{St.pop();let ur=Oi(St);fe=this.patternIdxToConfig[ur],ce=this.charCodeToPatternIdxToConfig[ur],Ce=fe.length;let Sn=this.canModeBeOptimized[ur]&&this.config.safeMode===!1;ce&&Sn?be=Bn:be=Er}};function mi(Nt){St.push(Nt),ce=this.charCodeToPatternIdxToConfig[Nt],fe=this.patternIdxToConfig[Nt],Ce=fe.length,Ce=fe.length;let ur=this.canModeBeOptimized[Nt]&&this.config.safeMode===!1;ce&&ur?be=Bn:be=Er}mi.call(this,r);let cr,_o=this.config.recoveryEnabled;for(;$<_;){c=null;let Nt=d.charCodeAt($),ur=be(Nt),Sn=ur.length;for(n=0;n<Sn;n++){cr=ur[n];let rr=cr.pattern;u=null;let gt=cr.short;if(gt!==!1?Nt===gt&&(c=rr):cr.isCustom===!0?(m=rr.exec(d,$,Me,A),m!==null?(c=m[0],m.payload!==void 0&&(u=m.payload)):c=null):(this.updateLastIndex(rr,$),c=this.match(rr,e,$)),c!==null){if(a=cr.longerAlt,a!==void 0){let qt=a.length;for(o=0;o<qt;o++){let Wr=fe[a[o]],Pr=Wr.pattern;if(l=null,Wr.isCustom===!0?(m=Pr.exec(d,$,Me,A),m!==null?(s=m[0],m.payload!==void 0&&(l=m.payload)):s=null):(this.updateLastIndex(Pr,$),s=this.match(Pr,e,$)),s&&s.length>c.length){c=s,u=l,cr=Wr;break}}}break}}if(c!==null){if(f=c.length,g=cr.group,g!==void 0&&(T=cr.tokenTypeIdx,C=this.createTokenInstance(c,$,T,cr.tokenType,_t,G,f),this.handlePayload(C,u),g===!1?X=this.addToken(Me,X,C):A[g].push(C)),e=this.chopInput(e,f),$=$+f,G=this.computeNewColumn(G,f),z===!0&&cr.canLineTerminator===!0){let rr=0,gt,qt;Y.lastIndex=0;do gt=Y.test(c),gt===!0&&(qt=Y.lastIndex-1,rr++);while(gt===!0);rr!==0&&(_t=_t+rr,G=f-qt,this.updateTokenEndLineColumnLocation(C,g,qt,rr,_t,G,f))}this.handleModes(cr,ms,mi,C)}else{let rr=$,gt=_t,qt=G,Wr=_o===!1;for(;Wr===!1&&$<_;)for(e=this.chopInput(e,1),$++,i=0;i<Ce;i++){let Pr=fe[i],kn=Pr.pattern,hi=Pr.short;if(hi!==!1?d.charCodeAt($)===hi&&(Wr=!0):Pr.isCustom===!0?Wr=kn.exec(d,$,Me,A)!==null:(this.updateLastIndex(kn,$),Wr=kn.exec(e)!==null),Wr===!0)break}if(P=$-rr,G=this.computeNewColumn(G,P),E=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(d,rr,P,gt,qt),Bt.push({offset:rr,line:gt,column:qt,length:P,message:E}),_o===!1)break}}return this.hasCustom||(Me.length=X),{tokens:Me,groups:A,errors:Bt}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let c,u;r!==void 0&&(c=n===a-1,u=c?-1:0,i===1&&c===!0||(e.endLine=o+u,e.endColumn=s-1+-u))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Mt.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Mt.NA=/NOT_APPLICABLE/;function yo(t){return aT(t)?t.LABEL:t.name}function aT(t){return sr(t.LABEL)&&t.LABEL!==""}var rV="parent",wA="categories",CA="label",EA="group",PA="push_mode",AA="pop_mode",DA="longer_alt",NA="line_breaks",IA="start_chars_hint";function qp(t){return nV(t)}function nV(t){let e=t.pattern,r={};if(r.name=t.name,$r(e)||(r.PATTERN=e),Z(t,rV))throw`The parent property is no longer supported.
133
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Z(t,wA)&&(r.CATEGORIES=t[wA]),go([r]),Z(t,CA)&&(r.LABEL=t[CA]),Z(t,EA)&&(r.GROUP=t[EA]),Z(t,AA)&&(r.POP_MODE=t[AA]),Z(t,PA)&&(r.PUSH_MODE=t[PA]),Z(t,DA)&&(r.LONGER_ALT=t[DA]),Z(t,NA)&&(r.LINE_BREAKS=t[NA]),Z(t,IA)&&(r.START_CHARS_HINT=t[IA]),r}var li=qp({name:"EOF",pattern:Mt.NA});go([li]);function Gs(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function dl(t,e){return ho(t,e)}var vo={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${aT(t)?`--> ${yo(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
134
+ but found: '`+mr(e).image+"'";if(n)return o+n+a;{let c=At(t,(g,T)=>g.concat(T),[]),u=B(c,g=>`[${B(g,T=>yo(T)).join(", ")}]`),f=`one of these possible Token sequences:
135
+ ${B(u,(g,T)=>` ${T+1}. ${g}`).join(`
136
+ `)}`;return o+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",s=`
137
+ but found: '`+mr(e).image+"'";if(r)return i+r+s;{let c=`expecting at least one iteration which starts with one of these possible Token sequences::
138
+ <${B(t,u=>`[${B(u,l=>yo(l)).join(",")}]`).join(" ,")}>`;return i+c+s}}};Object.freeze(vo);var OA={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
139
+ inside top level rule: ->`+t.name+"<-"}},fi={buildDuplicateFoundError(t,e){function r(l){return l instanceof we?l.terminalType.name:l instanceof Ge?l.nonTerminalName:""}let n=t.name,i=mr(e),o=i.idx,s=an(i),a=r(i),c=o>0,u=`->${s}${c?o:""}<- ${a?`with argument: ->${a}<-`:""}
138
140
  appears more than once (${e.length} times) in the top level rule: ->${n}<-.
139
141
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
140
- `;return f=f.replace(/[ \t]+/g," "),f=f.replace(/\s\s+/g,`
141
- `),f},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
142
+ `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
143
+ `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
142
144
  The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
143
145
  To resolve this make sure each Terminal and Non-Terminal names are unique
144
146
  This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
145
- and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=B(t.prefixPath,i=>ko(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
147
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=B(t.prefixPath,i=>yo(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
146
148
  in <OR${r}> inside <${t.topLevelRule.name}> Rule,
147
149
  <${e}> may appears as a prefix path in all these alternatives.
148
150
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
149
- For Further details.`},buildAlternationAmbiguityError(t){let e=B(t.prefixPath,i=>ko(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
151
+ For Further details.`},buildAlternationAmbiguityError(t){let e=B(t.prefixPath,i=>yo(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
150
152
  <${e}> may appears as a prefix path in all these alternatives.
151
153
  `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
152
- For Further details.`,n},buildEmptyRepetitionError(t){let e=hn(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
154
+ For Further details.`,n},buildEmptyRepetitionError(t){let e=an(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
153
155
  This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
154
156
  Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
155
157
  <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
@@ -158,43 +160,43 @@ rule: <${e}> can be invoked from itself (directly or indirectly)
158
160
  without consuming any Tokens. The grammar path that causes this is:
159
161
  ${n}
160
162
  To fix this refactor your grammar to remove the left recursion.
161
- see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Zr?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function UD(t,e){let r=new _v(t,e);return r.resolveRefs(),r.errors}var _v=class extends en{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Q(it(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:dr.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var Sv=class extends bo{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=ft(this.path.ruleStack).reverse(),this.occurrenceStack=ft(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Ee(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},wp=class extends Sv{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new dt({definition:i});this.possibleTokTypes=Ws(o),this.found=!0}}},_c=class extends bo{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Dp=class extends _c{walkMany(e,r,n){if(e.idx===this.occurrence){let i=Tr(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pe&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},el=class extends _c{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=Tr(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pe&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Ep=class extends _c{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=Tr(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pe&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},tl=class extends _c{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=Tr(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pe&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function Pp(t,e,r=[]){r=ft(r);let n=[],i=0;function o(a){return a.concat(Kt(t,i+1))}function s(a){let c=Pp(o(a),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof dt)return s(a.definition);if(a instanceof Be)return s(a.definition);if(a instanceof Ke)n=s(a.definition);else if(a instanceof pt){let c=a.definition.concat([new Oe({definition:a.definition})]);return s(c)}else if(a instanceof mt){let c=[new dt({definition:a.definition}),new Oe({definition:[new Pe({terminalType:a.separator})].concat(a.definition)})];return s(c)}else if(a instanceof st){let c=a.definition.concat([new Oe({definition:[new Pe({terminalType:a.separator})].concat(a.definition)})]);n=s(c)}else if(a instanceof Oe){let c=a.definition.concat([new Oe({definition:a.definition})]);n=s(c)}else{if(a instanceof at)return Q(a.definition,c=>{Ee(c.definition)===!1&&(n=s(c.definition))}),n;if(a instanceof Pe)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Kt(t,i)}),n}function Ap(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,c=e.length,f=c-n-1,p=[],m=[];for(m.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Ee(m);){let T=m.pop();if(T===s){a&&Wi(m).idx<=f&&m.pop();continue}let k=T.def,A=T.idx,N=T.ruleStack,O=T.occurrenceStack;if(Ee(k))continue;let P=k[0];if(P===i){let y={idx:A,def:Kt(k),ruleStack:xo(N),occurrenceStack:xo(O)};m.push(y)}else if(P instanceof Pe)if(A<c-1){let y=A+1,h=e[y];if(r(h,P.terminalType)){let C={idx:y,def:Kt(k),ruleStack:N,occurrenceStack:O};m.push(C)}}else if(A===c-1)p.push({nextTokenType:P.terminalType,nextTokenOccurrence:P.idx,ruleStack:N,occurrenceStack:O}),a=!0;else throw Error("non exhaustive match");else if(P instanceof Be){let y=ft(N);y.push(P.nonTerminalName);let h=ft(O);h.push(P.idx);let C={idx:A,def:P.definition.concat(o,Kt(k)),ruleStack:y,occurrenceStack:h};m.push(C)}else if(P instanceof Ke){let y={idx:A,def:Kt(k),ruleStack:N,occurrenceStack:O};m.push(y),m.push(s);let h={idx:A,def:P.definition.concat(Kt(k)),ruleStack:N,occurrenceStack:O};m.push(h)}else if(P instanceof pt){let y=new Oe({definition:P.definition,idx:P.idx}),h=P.definition.concat([y],Kt(k)),C={idx:A,def:h,ruleStack:N,occurrenceStack:O};m.push(C)}else if(P instanceof mt){let y=new Pe({terminalType:P.separator}),h=new Oe({definition:[y].concat(P.definition),idx:P.idx}),C=P.definition.concat([h],Kt(k)),M={idx:A,def:C,ruleStack:N,occurrenceStack:O};m.push(M)}else if(P instanceof st){let y={idx:A,def:Kt(k),ruleStack:N,occurrenceStack:O};m.push(y),m.push(s);let h=new Pe({terminalType:P.separator}),C=new Oe({definition:[h].concat(P.definition),idx:P.idx}),M=P.definition.concat([C],Kt(k)),z={idx:A,def:M,ruleStack:N,occurrenceStack:O};m.push(z)}else if(P instanceof Oe){let y={idx:A,def:Kt(k),ruleStack:N,occurrenceStack:O};m.push(y),m.push(s);let h=new Oe({definition:P.definition,idx:P.idx}),C=P.definition.concat([h],Kt(k)),M={idx:A,def:C,ruleStack:N,occurrenceStack:O};m.push(M)}else if(P instanceof at)for(let y=P.definition.length-1;y>=0;y--){let h=P.definition[y],C={idx:A,def:h.definition.concat(Kt(k)),ruleStack:N,occurrenceStack:O};m.push(C),m.push(s)}else if(P instanceof dt)m.push({idx:A,def:P.definition.concat(Kt(k)),ruleStack:N,occurrenceStack:O});else if(P instanceof Zr)m.push(ZG(P,A,N,O));else throw Error("non exhaustive match")}return p}function ZG(t,e,r,n){let i=ft(r);i.push(t.name);let o=ft(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var Ct;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Ct||(Ct={}));function rl(t){if(t instanceof Ke||t==="Option")return Ct.OPTION;if(t instanceof Oe||t==="Repetition")return Ct.REPETITION;if(t instanceof pt||t==="RepetitionMandatory")return Ct.REPETITION_MANDATORY;if(t instanceof mt||t==="RepetitionMandatoryWithSeparator")return Ct.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof st||t==="RepetitionWithSeparator")return Ct.REPETITION_WITH_SEPARATOR;if(t instanceof at||t==="Alternation")return Ct.ALTERNATION;throw Error("non exhaustive match")}function Ip(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,o=rl(n);return o===Ct.ALTERNATION?Sc(e,r,i):kc(e,r,o,i)}function HD(t,e,r,n,i,o){let s=Sc(t,e,r),a=XD(s)?bc:_o;return o(s,n,a,i)}function GD(t,e,r,n,i,o){let s=kc(t,e,i,r),a=XD(s)?bc:_o;return o(s[0],a,n)}function BD(t,e,r,n){let i=t.length,o=Gr(t,s=>Gr(s,a=>a.length===1));if(e)return function(s){let a=B(s,c=>c.GATE);for(let c=0;c<i;c++){let f=t[c],p=f.length,m=a[c];if(!(m!==void 0&&m.call(this)===!1))e:for(let T=0;T<p;T++){let k=f[T],A=k.length;for(let N=0;N<A;N++){let O=this.LA(N+1);if(r(O,k[N])===!1)continue e}return c}}};if(o&&!n){let s=B(t,c=>Bt(c)),a=Mt(s,(c,f,p)=>(Q(f,m=>{ee(c,m.tokenTypeIdx)||(c[m.tokenTypeIdx]=p),Q(m.categoryMatches,T=>{ee(c,T)||(c[T]=p)})}),c),{});return function(){let c=this.LA(1);return a[c.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],c=a.length;e:for(let f=0;f<c;f++){let p=a[f],m=p.length;for(let T=0;T<m;T++){let k=this.LA(T+1);if(r(k,p[T])===!1)continue e}return s}}}}function KD(t,e,r){let n=Gr(t,o=>o.length===1),i=t.length;if(n&&!r){let o=Bt(t);if(o.length===1&&Ee(o[0].categoryMatches)){let a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let s=Mt(o,(a,c,f)=>(a[c.tokenTypeIdx]=!0,Q(c.categoryMatches,p=>{a[p]=!0}),a),[]);return function(){let a=this.LA(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let c=0;c<a;c++){let f=this.LA(c+1);if(e(f,s[c])===!1)continue e}return!0}return!1}}var Cv=class extends bo{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Ct.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Ct.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Ct.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Ct.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Ct.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},Np=class extends en{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Ct.OPTION)}visitRepetition(e){this.checkIsTarget(e,Ct.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Ct.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Ct.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Ct.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Ct.ALTERNATION)}};function WD(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function kv(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let c="_"+n.categoryMatches[a];i.push(s+c)}}e=i}return e}function eB(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function zD(t,e){let r=B(t,s=>Pp([s],1)),n=WD(r.length),i=B(r,s=>{let a={};return Q(s,c=>{let f=kv(c.partialPath);Q(f,p=>{a[p]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=WD(a.length);for(let c=0;c<a.length;c++){let f=a[c];for(let p=0;p<f.length;p++){let m=f[p].partialPath,T=f[p].suffixDef,k=kv(m);if(eB(i,k,c)||Ee(T)||m.length===e){let N=n[c];if(Op(N,m)===!1){N.push(m);for(let O=0;O<k.length;O++){let P=k[O];i[c][P]=!0}}}else{let N=Pp(T,s+1,m);o[c]=o[c].concat(N),Q(N,O=>{let P=kv(O.partialPath);Q(P,y=>{i[c][y]=!0})})}}}}return n}function Sc(t,e,r,n){let i=new Np(t,Ct.ALTERNATION,n);return e.accept(i),zD(i.result,r)}function kc(t,e,r,n){let i=new Np(t,r);e.accept(i);let o=i.result,a=new Cv(e,t,r).startWalking(),c=new dt({definition:o}),f=new dt({definition:a});return zD([c,f],n)}function Op(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function VD(t,e){return t.length<e.length&&Gr(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function XD(t){return Gr(t,e=>Gr(e,r=>Gr(r,n=>Ee(n.categoryMatches))))}function YD(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return B(e,r=>Object.assign({type:dr.CUSTOM_LOOKAHEAD_VALIDATION},r))}function JD(t,e,r,n){let i=Pr(t,c=>tB(c,r)),o=aB(t,e,r),s=Pr(t,c=>iB(c,r)),a=Pr(t,c=>nB(c,t,n,r));return i.concat(o,s,a)}function tB(t,e){let r=new wv;t.accept(r);let n=r.allProductions,i=fv(n,rB),o=mn(i,a=>a.length>1);return B(it(o),a=>{let c=Tr(a),f=e.buildDuplicateFoundError(t,a),p=hn(c),m={message:f,type:dr.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:p,occurrence:c.idx},T=QD(c);return T&&(m.parameter=T),m})}function rB(t){return`${hn(t)}_#_${t.idx}_#_${QD(t)}`}function QD(t){return t instanceof Pe?t.terminalType.name:t instanceof Be?t.nonTerminalName:""}var wv=class extends en{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function nB(t,e,r,n){let i=[];if(Mt(e,(s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:dr.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function ZD(t,e,r){let n=[],i;return St(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:dr.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Ev(t,e,r,n=[]){let i=[],o=Lp(e.definition);if(Ee(o))return[];{let s=t.name;St(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:dr.LEFT_RECURSION,ruleName:s});let c=ns(o,n.concat([t])),f=Pr(c,p=>{let m=ft(n);return m.push(p),Ev(t,p,r,m)});return i.concat(f)}}function Lp(t){let e=[];if(Ee(t))return e;let r=Tr(t);if(r instanceof Be)e.push(r.referencedRule);else if(r instanceof dt||r instanceof Ke||r instanceof pt||r instanceof mt||r instanceof st||r instanceof Oe)e=e.concat(Lp(r.definition));else if(r instanceof at)e=Bt(B(r.definition,o=>Lp(o.definition)));else if(!(r instanceof Pe))throw Error("non exhaustive match");let n=Us(r),i=t.length>1;if(n&&i){let o=Kt(t);return e.concat(Lp(o))}else return e}var nl=class extends en{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function eE(t,e){let r=new nl;t.accept(r);let n=r.alternations;return Pr(n,o=>{let s=xo(o.definition);return Pr(s,(a,c)=>{let f=Ap([a],[],_o,1);return Ee(f)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:c}),type:dr.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:c+1}]:[]})})}function tE(t,e,r){let n=new nl;t.accept(n);let i=n.alternations;return i=is(i,s=>s.ignoreAmbiguities===!0),Pr(i,s=>{let a=s.idx,c=s.maxLookahead||e,f=Sc(a,t,c,s),p=oB(f,s,t,r),m=sB(f,s,t,r);return p.concat(m)})}var Dv=class extends en{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function iB(t,e){let r=new nl;t.accept(r);let n=r.alternations;return Pr(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:dr.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function rE(t,e,r){let n=[];return Q(t,i=>{let o=new Dv;i.accept(o);let s=o.allProductions;Q(s,a=>{let c=rl(a),f=a.maxLookahead||e,p=a.idx,T=kc(p,i,c,f)[0];if(Ee(Bt(T))){let k=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:k,type:dr.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function oB(t,e,r,n){let i=[],o=Mt(t,(a,c,f)=>(e.definition[f].ignoreAmbiguities===!0||Q(c,p=>{let m=[f];Q(t,(T,k)=>{f!==k&&Op(T,p)&&e.definition[k].ignoreAmbiguities!==!0&&m.push(k)}),m.length>1&&!Op(i,p)&&(i.push(p),a.push({alts:m,path:p}))}),a),[]);return B(o,a=>{let c=B(a.alts,p=>p+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:dr.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function sB(t,e,r,n){let i=Mt(t,(s,a,c)=>{let f=B(a,p=>({idx:c,path:p}));return s.concat(f)},[]);return Ui(Pr(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let c=s.idx,f=s.path,p=vr(i,T=>e.definition[T.idx].ignoreAmbiguities!==!0&&T.idx<c&&VD(T.path,f));return B(p,T=>{let k=[T.idx+1,c+1],A=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:k,prefixPath:T.path}),type:dr.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:A,alternatives:k}})}))}function aB(t,e,r){let n=[],i=B(e,o=>o.name);return Q(t,o=>{let s=o.name;if(St(i,s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:dr.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function nE(t){let e=hc(t,{errMsgProvider:jD}),r={};return Q(t.rules,n=>{r[n.name]=n}),UD(r,e.errMsgProvider)}function iE(t){return t=hc(t,{errMsgProvider:pi}),JD(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var oE="MismatchedTokenException",sE="NoViableAltException",aE="EarlyExitException",cE="NotAllInputParsedException",uE=[oE,sE,aE,cE];Object.freeze(uE);function os(t){return St(uE,t.name)}var Cc=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Bs=class extends Cc{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=oE}},il=class extends Cc{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=sE}},ol=class extends Cc{constructor(e,r){super(e,r),this.name=cE}},sl=class extends Cc{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=aE}};var Pv={},Nv="InRuleRecoveryException",Av=class extends Error{constructor(e){super(e),this.name=Nv}},Mp=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=ee(e,"recoveryEnabled")?e.recoveryEnabled:tn.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=cB)}getTokenToInsert(e){let r=Gs(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],c=!1,f=this.LA(1),p=this.LA(1),m=()=>{let T=this.LA(0),k=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:f,previous:T,ruleName:this.getCurrRuleFullName()}),A=new Bs(k,f,this.LA(0));A.resyncedTokens=xo(a),this.SAVE_ERROR(A)};for(;!c;)if(this.tokenMatcher(p,i)){m();return}else if(n.call(this)){m(),e.apply(this,r);return}else this.tokenMatcher(p,o)?c=!0:(p=this.SKIP_TOKEN(),this.addToResyncTokens(p,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Av("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Ee(r))return!1;let n=this.LA(1);return Hi(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return St(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Hi(e,o=>Zu(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Pv;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return B(e,(n,i)=>i===0?Pv:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=B(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Bt(e)}getFollowSetFromFollowKey(e){if(e===Pv)return[di];let r=e.ruleName+e.idxInCallingRule+Rp+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,di)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return xo(r)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=ft(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return B(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function cB(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[a];if(c===void 0){let T=this.getCurrRuleFullName(),k=this.getGAstProductions()[T];c=new o(k,i).startWalking(),this.firstAfterRepMap[a]=c}let f=c.token,p=c.occurrence,m=c.isEndOfRule;this.RULE_STACK.length===1&&m&&f===void 0&&(f=di,p=1),!(f===void 0||p===void 0)&&this.shouldInRepetitionRecoveryBeTried(f,p,s)&&this.tryInRepetitionRecovery(t,e,r,f)}function $p(t,e,r){return r|e|t}var Wfe=32-8;var wo=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:tn.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Ee(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return Pr(e,r=>Ev(r,r,pi))}validateEmptyOrAlternatives(e){return Pr(e,r=>eE(r,pi))}validateAmbiguousAlternationAlternatives(e,r){return Pr(e,n=>tE(n,r,pi))}validateSomeNonEmptyLookaheadPath(e,r){return rE(e,r,pi)}buildLookaheadForAlternation(e){return HD(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,BD)}buildLookaheadForOptional(e){return GD(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,rl(e.prodType),KD)}};var Fp=class{initLooksAhead(e){this.dynamicTokensEnabled=ee(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:tn.dynamicTokensEnabled,this.maxLookahead=ee(e,"maxLookahead")?e.maxLookahead:tn.maxLookahead,this.lookaheadStrategy=ee(e,"lookaheadStrategy")?e.lookaheadStrategy:new wo({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Q(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=uB(r);Q(n,f=>{let p=f.idx===0?"":f.idx;this.TRACE_INIT(`${hn(f)}${p}`,()=>{let m=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:f.idx,rule:r,maxLookahead:f.maxLookahead||this.maxLookahead,hasPredicates:f.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),T=$p(this.fullRuleNameToShort[r.name],256,f.idx);this.setLaFuncCache(T,m)})}),Q(i,f=>{this.computeLookaheadFunc(r,f.idx,768,"Repetition",f.maxLookahead,hn(f))}),Q(o,f=>{this.computeLookaheadFunc(r,f.idx,512,"Option",f.maxLookahead,hn(f))}),Q(s,f=>{this.computeLookaheadFunc(r,f.idx,1024,"RepetitionMandatory",f.maxLookahead,hn(f))}),Q(a,f=>{this.computeLookaheadFunc(r,f.idx,1536,"RepetitionMandatoryWithSeparator",f.maxLookahead,hn(f))}),Q(c,f=>{this.computeLookaheadFunc(r,f.idx,1280,"RepetitionWithSeparator",f.maxLookahead,hn(f))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=$p(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return $p(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Iv=class extends en{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},qp=new Iv;function uB(t){qp.reset(),t.accept(qp);let e=qp.dslMethods;return qp.reset(),e}function Mv(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function $v(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function lE(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function fE(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var lB="name";function qv(t,e){Object.defineProperty(t,lB,{enumerable:!1,configurable:!0,writable:!1,value:e})}function fB(t,e){let r=ut(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let c=0;c<a;c++){let f=s[c];f.tokenTypeIdx===void 0&&this[f.name](f.children,e)}}}function dE(t,e){let r=function(){};qv(r,t+"BaseSemantics");let n={visit:function(i,o){if(re(i)&&(i=i[0]),!Br(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=dB(this,e);if(!Ee(i)){let o=B(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
163
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Xr?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function LA(t,e){let r=new cT(t,e);return r.resolveRefs(),r.errors}var cT=class extends Yr{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){J(Ze(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:ar.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var uT=class extends mo{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=st(this.path.ruleStack).reverse(),this.occurrenceStack=st(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Se(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},jp=class extends uT{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new at({definition:i});this.possibleTokTypes=Ws(o),this.found=!0}}},Sc=class extends mo{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Up=class extends Sc{walkMany(e,r,n){if(e.idx===this.occurrence){let i=mr(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof we&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},pl=class extends Sc{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=mr(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof we&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Wp=class extends Sc{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=mr(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof we&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},ml=class extends Sc{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=mr(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof we&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function Hp(t,e,r=[]){r=st(r);let n=[],i=0;function o(a){return a.concat(Ht(t,i+1))}function s(a){let c=Hp(o(a),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof at)return s(a.definition);if(a instanceof Ge)return s(a.definition);if(a instanceof Be)n=s(a.definition);else if(a instanceof ct){let c=a.definition.concat([new Ne({definition:a.definition})]);return s(c)}else if(a instanceof ut){let c=[new at({definition:a.definition}),new Ne({definition:[new we({terminalType:a.separator})].concat(a.definition)})];return s(c)}else if(a instanceof et){let c=a.definition.concat([new Ne({definition:[new we({terminalType:a.separator})].concat(a.definition)})]);n=s(c)}else if(a instanceof Ne){let c=a.definition.concat([new Ne({definition:a.definition})]);n=s(c)}else{if(a instanceof tt)return J(a.definition,c=>{Se(c.definition)===!1&&(n=s(c.definition))}),n;if(a instanceof we)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Ht(t,i)}),n}function Gp(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,c=e.length,u=c-n-1,l=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Se(f);){let g=f.pop();if(g===s){a&&Oi(f).idx<=u&&f.pop();continue}let T=g.def,C=g.idx,P=g.ruleStack,O=g.occurrenceStack;if(Se(T))continue;let E=T[0];if(E===i){let m={idx:C,def:Ht(T),ruleStack:po(P),occurrenceStack:po(O)};f.push(m)}else if(E instanceof we)if(C<c-1){let m=C+1,d=e[m];if(r(d,E.terminalType)){let _={idx:m,def:Ht(T),ruleStack:P,occurrenceStack:O};f.push(_)}}else if(C===c-1)l.push({nextTokenType:E.terminalType,nextTokenOccurrence:E.idx,ruleStack:P,occurrenceStack:O}),a=!0;else throw Error("non exhaustive match");else if(E instanceof Ge){let m=st(P);m.push(E.nonTerminalName);let d=st(O);d.push(E.idx);let _={idx:C,def:E.definition.concat(o,Ht(T)),ruleStack:m,occurrenceStack:d};f.push(_)}else if(E instanceof Be){let m={idx:C,def:Ht(T),ruleStack:P,occurrenceStack:O};f.push(m),f.push(s);let d={idx:C,def:E.definition.concat(Ht(T)),ruleStack:P,occurrenceStack:O};f.push(d)}else if(E instanceof ct){let m=new Ne({definition:E.definition,idx:E.idx}),d=E.definition.concat([m],Ht(T)),_={idx:C,def:d,ruleStack:P,occurrenceStack:O};f.push(_)}else if(E instanceof ut){let m=new we({terminalType:E.separator}),d=new Ne({definition:[m].concat(E.definition),idx:E.idx}),_=E.definition.concat([d],Ht(T)),$={idx:C,def:_,ruleStack:P,occurrenceStack:O};f.push($)}else if(E instanceof et){let m={idx:C,def:Ht(T),ruleStack:P,occurrenceStack:O};f.push(m),f.push(s);let d=new we({terminalType:E.separator}),_=new Ne({definition:[d].concat(E.definition),idx:E.idx}),$=E.definition.concat([_],Ht(T)),X={idx:C,def:$,ruleStack:P,occurrenceStack:O};f.push(X)}else if(E instanceof Ne){let m={idx:C,def:Ht(T),ruleStack:P,occurrenceStack:O};f.push(m),f.push(s);let d=new Ne({definition:E.definition,idx:E.idx}),_=E.definition.concat([d],Ht(T)),$={idx:C,def:_,ruleStack:P,occurrenceStack:O};f.push($)}else if(E instanceof tt)for(let m=E.definition.length-1;m>=0;m--){let d=E.definition[m],_={idx:C,def:d.definition.concat(Ht(T)),ruleStack:P,occurrenceStack:O};f.push(_),f.push(s)}else if(E instanceof at)f.push({idx:C,def:E.definition.concat(Ht(T)),ruleStack:P,occurrenceStack:O});else if(E instanceof Xr)f.push(iV(E,C,P,O));else throw Error("non exhaustive match")}return l}function iV(t,e,r,n){let i=st(r);i.push(t.name);let o=st(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var xt;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(xt||(xt={}));function hl(t){if(t instanceof Be||t==="Option")return xt.OPTION;if(t instanceof Ne||t==="Repetition")return xt.REPETITION;if(t instanceof ct||t==="RepetitionMandatory")return xt.REPETITION_MANDATORY;if(t instanceof ut||t==="RepetitionMandatoryWithSeparator")return xt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof et||t==="RepetitionWithSeparator")return xt.REPETITION_WITH_SEPARATOR;if(t instanceof tt||t==="Alternation")return xt.ALTERNATION;throw Error("non exhaustive match")}function Kp(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,o=hl(n);return o===xt.ALTERNATION?kc(e,r,i):wc(e,r,o,i)}function $A(t,e,r,n,i,o){let s=kc(t,e,r),a=HA(s)?_c:ho;return o(s,n,a,i)}function FA(t,e,r,n,i,o){let s=wc(t,e,i,r),a=HA(s)?_c:ho;return o(s[0],a,n)}function qA(t,e,r,n){let i=t.length,o=Mr(t,s=>Mr(s,a=>a.length===1));if(e)return function(s){let a=B(s,c=>c.GATE);for(let c=0;c<i;c++){let u=t[c],l=u.length,f=a[c];if(!(f!==void 0&&f.call(this)===!1))e:for(let g=0;g<l;g++){let T=u[g],C=T.length;for(let P=0;P<C;P++){let O=this.LA(P+1);if(r(O,T[P])===!1)continue e}return c}}};if(o&&!n){let s=B(t,c=>Wt(c)),a=At(s,(c,u,l)=>(J(u,f=>{Z(c,f.tokenTypeIdx)||(c[f.tokenTypeIdx]=l),J(f.categoryMatches,g=>{Z(c,g)||(c[g]=l)})}),c),{});return function(){let c=this.LA(1);return a[c.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],c=a.length;e:for(let u=0;u<c;u++){let l=a[u],f=l.length;for(let g=0;g<f;g++){let T=this.LA(g+1);if(r(T,l[g])===!1)continue e}return s}}}}function jA(t,e,r){let n=Mr(t,o=>o.length===1),i=t.length;if(n&&!r){let o=Wt(t);if(o.length===1&&Se(o[0].categoryMatches)){let a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let s=At(o,(a,c,u)=>(a[c.tokenTypeIdx]=!0,J(c.categoryMatches,l=>{a[l]=!0}),a),[]);return function(){let a=this.LA(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let c=0;c<a;c++){let u=this.LA(c+1);if(e(u,s[c])===!1)continue e}return!0}return!1}}var fT=class extends mo{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,xt.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,xt.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,xt.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,xt.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,xt.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},Bp=class extends Yr{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,xt.OPTION)}visitRepetition(e){this.checkIsTarget(e,xt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,xt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,xt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,xt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,xt.ALTERNATION)}};function MA(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function lT(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let c="_"+n.categoryMatches[a];i.push(s+c)}}e=i}return e}function oV(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function UA(t,e){let r=B(t,s=>Hp([s],1)),n=MA(r.length),i=B(r,s=>{let a={};return J(s,c=>{let u=lT(c.partialPath);J(u,l=>{a[l]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=MA(a.length);for(let c=0;c<a.length;c++){let u=a[c];for(let l=0;l<u.length;l++){let f=u[l].partialPath,g=u[l].suffixDef,T=lT(f);if(oV(i,T,c)||Se(g)||f.length===e){let P=n[c];if(zp(P,f)===!1){P.push(f);for(let O=0;O<T.length;O++){let E=T[O];i[c][E]=!0}}}else{let P=Hp(g,s+1,f);o[c]=o[c].concat(P),J(P,O=>{let E=lT(O.partialPath);J(E,m=>{i[c][m]=!0})})}}}}return n}function kc(t,e,r,n){let i=new Bp(t,xt.ALTERNATION,n);return e.accept(i),UA(i.result,r)}function wc(t,e,r,n){let i=new Bp(t,r);e.accept(i);let o=i.result,a=new fT(e,t,r).startWalking(),c=new at({definition:o}),u=new at({definition:a});return UA([c,u],n)}function zp(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function WA(t,e){return t.length<e.length&&Mr(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function HA(t){return Mr(t,e=>Mr(e,r=>Mr(r,n=>Se(n.categoryMatches))))}function GA(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return B(e,r=>Object.assign({type:ar.CUSTOM_LOOKAHEAD_VALIDATION},r))}function BA(t,e,r,n){let i=kr(t,c=>sV(c,r)),o=dV(t,e,r),s=kr(t,c=>uV(c,r)),a=kr(t,c=>cV(c,t,n,r));return i.concat(o,s,a)}function sV(t,e){let r=new dT;t.accept(r);let n=r.allProductions,i=Yv(n,aV),o=sn(i,a=>a.length>1);return B(Ze(o),a=>{let c=mr(a),u=e.buildDuplicateFoundError(t,a),l=an(c),f={message:u,type:ar.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:c.idx},g=KA(c);return g&&(f.parameter=g),f})}function aV(t){return`${an(t)}_#_${t.idx}_#_${KA(t)}`}function KA(t){return t instanceof we?t.terminalType.name:t instanceof Ge?t.nonTerminalName:""}var dT=class extends Yr{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function cV(t,e,r,n){let i=[];if(At(e,(s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:ar.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function zA(t,e,r){let n=[],i;return Tt(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:ar.INVALID_RULE_OVERRIDE,ruleName:t})),n}function mT(t,e,r,n=[]){let i=[],o=Vp(e.definition);if(Se(o))return[];{let s=t.name;Tt(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:ar.LEFT_RECURSION,ruleName:s});let c=Yo(o,n.concat([t])),u=kr(c,l=>{let f=st(n);return f.push(l),mT(t,l,r,f)});return i.concat(u)}}function Vp(t){let e=[];if(Se(t))return e;let r=mr(t);if(r instanceof Ge)e.push(r.referencedRule);else if(r instanceof at||r instanceof Be||r instanceof ct||r instanceof ut||r instanceof et||r instanceof Ne)e=e.concat(Vp(r.definition));else if(r instanceof tt)e=Wt(B(r.definition,o=>Vp(o.definition)));else if(!(r instanceof we))throw Error("non exhaustive match");let n=Us(r),i=t.length>1;if(n&&i){let o=Ht(t);return e.concat(Vp(o))}else return e}var gl=class extends Yr{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function VA(t,e){let r=new gl;t.accept(r);let n=r.alternations;return kr(n,o=>{let s=po(o.definition);return kr(s,(a,c)=>{let u=Gp([a],[],ho,1);return Se(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:c}),type:ar.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:c+1}]:[]})})}function XA(t,e,r){let n=new gl;t.accept(n);let i=n.alternations;return i=Jo(i,s=>s.ignoreAmbiguities===!0),kr(i,s=>{let a=s.idx,c=s.maxLookahead||e,u=kc(a,t,c,s),l=lV(u,s,t,r),f=fV(u,s,t,r);return l.concat(f)})}var pT=class extends Yr{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function uV(t,e){let r=new gl;t.accept(r);let n=r.alternations;return kr(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:ar.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function YA(t,e,r){let n=[];return J(t,i=>{let o=new pT;i.accept(o);let s=o.allProductions;J(s,a=>{let c=hl(a),u=a.maxLookahead||e,l=a.idx,g=wc(l,i,c,u)[0];if(Se(Wt(g))){let T=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:T,type:ar.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function lV(t,e,r,n){let i=[],o=At(t,(a,c,u)=>(e.definition[u].ignoreAmbiguities===!0||J(c,l=>{let f=[u];J(t,(g,T)=>{u!==T&&zp(g,l)&&e.definition[T].ignoreAmbiguities!==!0&&f.push(T)}),f.length>1&&!zp(i,l)&&(i.push(l),a.push({alts:f,path:l}))}),a),[]);return B(o,a=>{let c=B(a.alts,l=>l+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:ar.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function fV(t,e,r,n){let i=At(t,(s,a,c)=>{let u=B(a,l=>({idx:c,path:l}));return s.concat(u)},[]);return Ii(kr(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let c=s.idx,u=s.path,l=pr(i,g=>e.definition[g.idx].ignoreAmbiguities!==!0&&g.idx<c&&WA(g.path,u));return B(l,g=>{let T=[g.idx+1,c+1],C=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:T,prefixPath:g.path}),type:ar.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:C,alternatives:T}})}))}function dV(t,e,r){let n=[],i=B(e,o=>o.name);return J(t,o=>{let s=o.name;if(Tt(i,s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:ar.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function JA(t){let e=gc(t,{errMsgProvider:OA}),r={};return J(t.rules,n=>{r[n.name]=n}),LA(r,e.errMsgProvider)}function QA(t){return t=gc(t,{errMsgProvider:fi}),BA(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var ZA="MismatchedTokenException",eD="NoViableAltException",tD="EarlyExitException",rD="NotAllInputParsedException",nD=[ZA,eD,tD,rD];Object.freeze(nD);function Qo(t){return Tt(nD,t.name)}var Cc=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Bs=class extends Cc{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=ZA}},yl=class extends Cc{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=eD}},vl=class extends Cc{constructor(e,r){super(e,r),this.name=rD}},Tl=class extends Cc{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=tD}};var hT={},yT="InRuleRecoveryException",gT=class extends Error{constructor(e){super(e),this.name=yT}},Xp=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Z(e,"recoveryEnabled")?e.recoveryEnabled:Jr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=pV)}getTokenToInsert(e){let r=Gs(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],c=!1,u=this.LA(1),l=this.LA(1),f=()=>{let g=this.LA(0),T=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:g,ruleName:this.getCurrRuleFullName()}),C=new Bs(T,u,this.LA(0));C.resyncedTokens=po(a),this.SAVE_ERROR(C)};for(;!c;)if(this.tokenMatcher(l,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(l,o)?c=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new gT("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Se(r))return!1;let n=this.LA(1);return Li(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Tt(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Li(e,o=>dl(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return hT;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return B(e,(n,i)=>i===0?hT:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=B(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Wt(e)}getFollowSetFromFollowKey(e){if(e===hT)return[li];let r=e.ruleName+e.idxInCallingRule+Ip+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,li)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return po(r)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=st(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return B(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function pV(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[a];if(c===void 0){let g=this.getCurrRuleFullName(),T=this.getGAstProductions()[g];c=new o(T,i).startWalking(),this.firstAfterRepMap[a]=c}let u=c.token,l=c.occurrence,f=c.isEndOfRule;this.RULE_STACK.length===1&&f&&u===void 0&&(u=li,l=1),!(u===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,l,s)&&this.tryInRepetitionRecovery(t,e,r,u)}function Yp(t,e,r){return r|e|t}var $pe=32-8;var To=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:Jr.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Se(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return kr(e,r=>mT(r,r,fi))}validateEmptyOrAlternatives(e){return kr(e,r=>VA(r,fi))}validateAmbiguousAlternationAlternatives(e,r){return kr(e,n=>XA(n,r,fi))}validateSomeNonEmptyLookaheadPath(e,r){return YA(e,r,fi)}buildLookaheadForAlternation(e){return $A(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,qA)}buildLookaheadForOptional(e){return FA(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,hl(e.prodType),jA)}};var Qp=class{initLooksAhead(e){this.dynamicTokensEnabled=Z(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Jr.dynamicTokensEnabled,this.maxLookahead=Z(e,"maxLookahead")?e.maxLookahead:Jr.maxLookahead,this.lookaheadStrategy=Z(e,"lookaheadStrategy")?e.lookaheadStrategy:new To({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){J(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=mV(r);J(n,u=>{let l=u.idx===0?"":u.idx;this.TRACE_INIT(`${an(u)}${l}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),g=Yp(this.fullRuleNameToShort[r.name],256,u.idx);this.setLaFuncCache(g,f)})}),J(i,u=>{this.computeLookaheadFunc(r,u.idx,768,"Repetition",u.maxLookahead,an(u))}),J(o,u=>{this.computeLookaheadFunc(r,u.idx,512,"Option",u.maxLookahead,an(u))}),J(s,u=>{this.computeLookaheadFunc(r,u.idx,1024,"RepetitionMandatory",u.maxLookahead,an(u))}),J(a,u=>{this.computeLookaheadFunc(r,u.idx,1536,"RepetitionMandatoryWithSeparator",u.maxLookahead,an(u))}),J(c,u=>{this.computeLookaheadFunc(r,u.idx,1280,"RepetitionWithSeparator",u.maxLookahead,an(u))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=Yp(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return Yp(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},vT=class extends Yr{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},Jp=new vT;function mV(t){Jp.reset(),t.accept(Jp);let e=Jp.dslMethods;return Jp.reset(),e}function xT(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function bT(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function iD(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function oD(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var hV="name";function _T(t,e){Object.defineProperty(t,hV,{enumerable:!1,configurable:!0,writable:!1,value:e})}function gV(t,e){let r=it(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let c=0;c<a;c++){let u=s[c];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function sD(t,e){let r=function(){};_T(r,t+"BaseSemantics");let n={visit:function(i,o){if(ee(i)&&(i=i[0]),!$r(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=yV(this,e);if(!Se(i)){let o=B(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
162
164
  ${o.join(`
163
165
 
164
166
  `).replace(/\n/g,`
165
- `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function pE(t,e,r){let n=function(){};qv(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return Q(e,o=>{i[o]=fB}),n.prototype=i,n.prototype.constructor=n,n}var Fv;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Fv||(Fv={}));function dB(t,e){return pB(t,e)}function pB(t,e){let r=vr(e,i=>Qr(t[i])===!1),n=B(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Fv.MISSING_METHOD,methodName:i}));return Ui(n)}var Hp=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=ee(e,"nodeLocationTracking")?e.nodeLocationTracking:tn.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Lt,this.cstFinallyStateUpdate=Lt,this.cstPostTerminal=Lt,this.cstPostNonTerminal=Lt,this.cstPostRule=Lt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$v,this.setNodeLocationFromNode=$v,this.cstPostRule=Lt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Lt,this.setNodeLocationFromNode=Lt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Mv,this.setNodeLocationFromNode=Mv,this.cstPostRule=Lt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Lt,this.setNodeLocationFromNode=Lt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Lt,this.setNodeLocationFromNode=Lt,this.cstPostRule=Lt,this.setInitialNodeLocation=Lt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];lE(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];fE(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Br(this.baseCstVisitorConstructor)){let e=dE(this.className,ut(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Br(this.baseCstVisitorWithDefaultsConstructor)){let e=pE(this.className,ut(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var Gp=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):wc}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?wc:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var Bp=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Dc){if(St(this.definedRulesNames,e)){let s={message:pi.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:dr.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Dc){let i=ZD(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(os(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Tp(it(this.gastProductionsCache))}};var Kp=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=bc,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},ee(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
167
+ `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function aD(t,e,r){let n=function(){};_T(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return J(e,o=>{i[o]=gV}),n.prototype=i,n.prototype.constructor=n,n}var ST;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(ST||(ST={}));function yV(t,e){return vV(t,e)}function vV(t,e){let r=pr(e,i=>Vr(t[i])===!1),n=B(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:ST.MISSING_METHOD,methodName:i}));return Ii(n)}var rm=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Z(e,"nodeLocationTracking")?e.nodeLocationTracking:Jr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Pt,this.cstFinallyStateUpdate=Pt,this.cstPostTerminal=Pt,this.cstPostNonTerminal=Pt,this.cstPostRule=Pt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=bT,this.setNodeLocationFromNode=bT,this.cstPostRule=Pt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Pt,this.setNodeLocationFromNode=Pt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=xT,this.setNodeLocationFromNode=xT,this.cstPostRule=Pt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Pt,this.setNodeLocationFromNode=Pt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Pt,this.setNodeLocationFromNode=Pt,this.cstPostRule=Pt,this.setInitialNodeLocation=Pt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];iD(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];oD(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if($r(this.baseCstVisitorConstructor)){let e=sD(this.className,it(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if($r(this.baseCstVisitorWithDefaultsConstructor)){let e=aD(this.className,it(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var nm=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Ec}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Ec:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var im=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Pc){if(Tt(this.definedRulesNames,e)){let s={message:fi.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ar.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Pc){let i=zA(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(Qo(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Np(Ze(this.gastProductionsCache))}};var om=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=_c,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Z(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
166
168
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
167
- For Further details.`);if(re(e)){if(Ee(e))throw Error(`A Token Vocabulary cannot be empty.
169
+ For Further details.`);if(ee(e)){if(Se(e))throw Error(`A Token Vocabulary cannot be empty.
168
170
  Note that the first argument for the parser constructor
169
171
  is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
170
172
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
171
- For Further details.`)}if(re(e))this.tokensMap=Mt(e,(o,s)=>(o[s.name]=s,o),{});else if(ee(e,"modes")&&Gr(Bt(it(e.modes)),AD)){let o=Bt(it(e.modes)),s=gc(o);this.tokensMap=Mt(s,(a,c)=>(a[c.name]=c,a),{})}else if(Ot(e))this.tokensMap=ft(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=di;let n=ee(e,"modes")?Bt(it(e.modes)):it(e),i=Gr(n,o=>Ee(o.categoryMatches));this.tokenMatcher=i?bc:_o,So(it(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
172
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=ee(n,"resyncEnabled")?n.resyncEnabled:Dc.resyncEnabled,o=ee(n,"recoveryValueFunc")?n.recoveryValueFunc:Dc.recoveryValueFunc,s=this.ruleShortNameIdx<<4+8;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...p){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,p);let m=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(m),m}catch(m){return this.invokeRuleCatch(m,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...p){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,p)}catch(m){return this.invokeRuleCatch(m,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(os(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(e);else{if(this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,s.partialCstResult=c}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,Ct.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Ep)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,tl],a,1536,e,tl)}else throw this.raiseEarlyExitException(e,Ct.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let c=i;i=()=>a.call(this)&&c.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,Dp,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,el],a,1280,e,el)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=re(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new ol(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw os(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Bs(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===Nv?n:o}}else throw n}saveRecogState(){let e=this.errors,r=ft(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),di)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var zp=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=ee(e,"errorMessageProvider")?e.errorMessageProvider:tn.errorMessageProvider}SAVE_ERROR(e){if(os(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:ft(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return ft(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=kc(e,o,r,this.maxLookahead)[0],c=[];for(let p=1;p<=this.maxLookahead;p++)c.push(this.LA(p));let f=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new sl(f,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=Sc(e,i,this.maxLookahead),s=[];for(let f=1;f<=this.maxLookahead;f++)s.push(this.LA(f));let a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new il(c,this.LA(1),a))}};var Vp=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(Br(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Ap([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=Tr(e.ruleStack),i=this.getGAstProductions()[r];return new wp(i,e).startWalking()}};var Jp={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Jp);var mE=!0,hE=Math.pow(2,8)-1,yE=Cp({name:"RECORDING_PHASE_TOKEN",pattern:Wt.NA});So([yE]);var vE=Gs(yE,`This IToken indicates the Parser is in Recording Phase
173
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(vE);var hB={name:`This CSTNode indicates the Parser is in Recording Phase
174
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Xp=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return wc}topLevelRuleRecord(e,r){try{let n=new Zr({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
173
+ For Further details.`)}if(ee(e))this.tokensMap=At(e,(o,s)=>(o[s.name]=s,o),{});else if(Z(e,"modes")&&Mr(Wt(Ze(e.modes)),kA)){let o=Wt(Ze(e.modes)),s=yc(o);this.tokensMap=At(s,(a,c)=>(a[c.name]=c,a),{})}else if(Et(e))this.tokensMap=st(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=li;let n=Z(e,"modes")?Wt(Ze(e.modes)):Ze(e),i=Mr(n,o=>Se(o.categoryMatches));this.tokenMatcher=i?_c:ho,go(Ze(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
174
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Z(n,"resyncEnabled")?n.resyncEnabled:Pc.resyncEnabled,o=Z(n,"recoveryValueFunc")?n.recoveryValueFunc:Pc.recoveryValueFunc,s=this.ruleShortNameIdx<<4+8;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...l){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,l);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...l){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,l)}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(Qo(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(e);else{if(this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,s.partialCstResult=c}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,xt.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Wp)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,ml],a,1536,e,ml)}else throw this.raiseEarlyExitException(e,xt.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let c=i;i=()=>a.call(this)&&c.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,Up,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,pl],a,1280,e,pl)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=ee(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new vl(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw Qo(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Bs(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===yT?n:o}}else throw n}saveRecogState(){let e=this.errors,r=st(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),li)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var sm=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Z(e,"errorMessageProvider")?e.errorMessageProvider:Jr.errorMessageProvider}SAVE_ERROR(e){if(Qo(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:st(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return st(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=wc(e,o,r,this.maxLookahead)[0],c=[];for(let l=1;l<=this.maxLookahead;l++)c.push(this.LA(l));let u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Tl(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=kc(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));let a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new yl(c,this.LA(1),a))}};var am=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if($r(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Gp([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=mr(e.ruleStack),i=this.getGAstProductions()[r];return new jp(i,e).startWalking()}};var lm={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(lm);var cD=!0,uD=Math.pow(2,8)-1,fD=qp({name:"RECORDING_PHASE_TOKEN",pattern:Mt.NA});go([fD]);var dD=Gs(fD,`This IToken indicates the Parser is in Recording Phase
175
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(dD);var RV={name:`This CSTNode indicates the Parser is in Recording Phase
176
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},cm=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Ec}topLevelRuleRecord(e,r){try{let n=new Xr({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
175
177
  This error was thrown during the "grammar recording phase" For more info see:
176
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return cl.call(this,Ke,e,r)}atLeastOneInternalRecord(e,r){cl.call(this,pt,r,e)}atLeastOneSepFirstInternalRecord(e,r){cl.call(this,mt,r,e,mE)}manyInternalRecord(e,r){cl.call(this,Oe,r,e)}manySepFirstInternalRecord(e,r){cl.call(this,st,r,e,mE)}orInternalRecord(e,r){return gB.call(this,e,r)}subruleInternalRecord(e,r,n){if(Yp(r),!e||ee(e,"ruleName")===!1){let a=new Error(`<SUBRULE${gE(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
177
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=Wi(this.recordingProdStack),o=e.ruleName,s=new Be({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?hB:Jp}consumeInternalRecord(e,r,n){if(Yp(r),!Rv(e)){let s=new Error(`<CONSUME${gE(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
178
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=Wi(this.recordingProdStack),o=new Pe({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),vE}};function cl(t,e,r,n=!1){Yp(r);let i=Wi(this.recordingProdStack),o=Qr(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),ee(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),Jp}function gB(t,e){Yp(e);let r=Wi(this.recordingProdStack),n=re(t)===!1,i=n===!1?t:t.DEF,o=new at({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});ee(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=zu(i,a=>Qr(a.GATE));return o.hasPredicates=s,r.definition.push(o),Q(i,a=>{let c=new dt({definition:[]});o.definition.push(c),ee(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:ee(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),Jp}function gE(t){return t===0?"":`${t}`}function Yp(t){if(t<0||t>hE){let e=new Error(`Invalid DSL Method idx value: <${t}>
179
- Idx value must be a none negative value smaller than ${hE+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var Qp=class{initPerformanceTracer(e){if(ee(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=tn.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=Xu(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function TE(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var wc=Gs(di,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(wc);var tn=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Co,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Dc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),dr;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(dr||(dr={}));function Zp(t=void 0){return function(){return t}}var ul=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Yu(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Q(this.definedRulesNames,i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=nE({rules:it(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Ee(n)&&this.skipValidations===!1){let i=iE({rules:it(this.gastProductionsCache),tokenTypes:it(this.tokensMap),errMsgProvider:pi,grammarName:r}),o=YD({lookaheadStrategy:this.lookaheadStrategy,rules:it(this.gastProductionsCache),tokenTypes:it(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),Ee(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=fD(it(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:it(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(it(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Ee(this.definitionErrors))throw e=B(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
178
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return xl.call(this,Be,e,r)}atLeastOneInternalRecord(e,r){xl.call(this,ct,r,e)}atLeastOneSepFirstInternalRecord(e,r){xl.call(this,ut,r,e,cD)}manyInternalRecord(e,r){xl.call(this,Ne,r,e)}manySepFirstInternalRecord(e,r){xl.call(this,et,r,e,cD)}orInternalRecord(e,r){return xV.call(this,e,r)}subruleInternalRecord(e,r,n){if(um(r),!e||Z(e,"ruleName")===!1){let a=new Error(`<SUBRULE${lD(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
179
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=Oi(this.recordingProdStack),o=e.ruleName,s=new Ge({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?RV:lm}consumeInternalRecord(e,r,n){if(um(r),!oT(e)){let s=new Error(`<CONSUME${lD(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
180
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=Oi(this.recordingProdStack),o=new we({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),dD}};function xl(t,e,r,n=!1){um(r);let i=Oi(this.recordingProdStack),o=Vr(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Z(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),lm}function xV(t,e){um(e);let r=Oi(this.recordingProdStack),n=ee(t)===!1,i=n===!1?t:t.DEF,o=new tt({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Z(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=sl(i,a=>Vr(a.GATE));return o.hasPredicates=s,r.definition.push(o),J(i,a=>{let c=new at({definition:[]});o.definition.push(c),Z(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Z(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),lm}function lD(t){return t===0?"":`${t}`}function um(t){if(t<0||t>uD){let e=new Error(`Invalid DSL Method idx value: <${t}>
181
+ Idx value must be a none negative value smaller than ${uD+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var fm=class{initPerformanceTracer(e){if(Z(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Jr.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=cl(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function pD(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var Ec=Gs(li,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Ec);var Jr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:vo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Pc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),ar;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ar||(ar={}));function dm(t=void 0){return function(){return t}}var bl=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{ul(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),J(this.definedRulesNames,i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=JA({rules:Ze(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Se(n)&&this.skipValidations===!1){let i=QA({rules:Ze(this.gastProductionsCache),tokenTypes:Ze(this.tokensMap),errMsgProvider:fi,grammarName:r}),o=GA({lookaheadStrategy:this.lookaheadStrategy,rules:Ze(this.gastProductionsCache),tokenTypes:Ze(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),Se(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=oA(Ze(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Ze(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Ze(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Se(this.definitionErrors))throw e=B(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
180
182
  ${e.join(`
181
183
  -------------------------------
182
- `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),ee(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
184
+ `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),Z(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
183
185
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
184
186
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
185
- For further details.`);this.skipValidations=ee(r,"skipValidations")?r.skipValidations:tn.skipValidations}};ul.DEFER_DEFINITION_ERRORS_HANDLING=!1;TE(ul,[Mp,Fp,Hp,Gp,Kp,Bp,zp,Vp,Xp,Qp]);var ll=class extends ul{constructor(e,r=tn){let n=ft(r);n.outputCst=!1,super(e,n)}};function Ks(t,e,r){return`${t.name}_${e}_${r}`}var ss=1,vB=2,RE=4,xE=5;var Ac=7,TB=8,RB=9,xB=10,bB=11,bE=12,fl=class{constructor(e){this.target=e}isEpsilon(){return!1}},Ec=class extends fl{constructor(e,r){super(e),this.tokenType=r}},dl=class extends fl{constructor(e){super(e)}isEpsilon(){return!0}},Pc=class extends fl{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function _E(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};_B(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],o=zs(e,i,i);o!==void 0&&OB(e,i,o)}return e}function _B(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],o=Rr(t,i,void 0,{type:vB}),s=Rr(t,i,void 0,{type:Ac});o.stop=s,t.ruleToStartState.set(i,o),t.ruleToStopState.set(i,s)}}function SE(t,e,r){return r instanceof Pe?Uv(t,e,r.terminalType,r):r instanceof Be?IB(t,e,r):r instanceof at?DB(t,e,r):r instanceof Ke?EB(t,e,r):r instanceof Oe?SB(t,e,r):r instanceof st?kB(t,e,r):r instanceof pt?CB(t,e,r):r instanceof mt?wB(t,e,r):zs(t,e,r)}function SB(t,e,r){let n=Rr(t,e,r,{type:xE});as(t,n);let i=Nc(t,e,n,r,zs(t,e,r));return CE(t,e,r,i)}function kB(t,e,r){let n=Rr(t,e,r,{type:xE});as(t,n);let i=Nc(t,e,n,r,zs(t,e,r)),o=Uv(t,e,r.separator,r);return CE(t,e,r,i,o)}function CB(t,e,r){let n=Rr(t,e,r,{type:RE});as(t,n);let i=Nc(t,e,n,r,zs(t,e,r));return kE(t,e,r,i)}function wB(t,e,r){let n=Rr(t,e,r,{type:RE});as(t,n);let i=Nc(t,e,n,r,zs(t,e,r)),o=Uv(t,e,r.separator,r);return kE(t,e,r,i,o)}function DB(t,e,r){let n=Rr(t,e,r,{type:ss});as(t,n);let i=B(r.definition,s=>SE(t,e,s));return Nc(t,e,n,r,...i)}function EB(t,e,r){let n=Rr(t,e,r,{type:ss});as(t,n);let i=Nc(t,e,n,r,zs(t,e,r));return PB(t,e,r,i)}function zs(t,e,r){let n=vr(B(r.definition,i=>SE(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:NB(t,n)}function kE(t,e,r,n,i){let o=n.left,s=n.right,a=Rr(t,e,r,{type:bB});as(t,a);let c=Rr(t,e,r,{type:bE});return o.loopback=a,c.loopback=a,t.decisionMap[Ks(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=a,rr(s,a),i===void 0?(rr(a,o),rr(a,c)):(rr(a,c),rr(a,i.left),rr(i.right,o)),{left:o,right:c}}function CE(t,e,r,n,i){let o=n.left,s=n.right,a=Rr(t,e,r,{type:xB});as(t,a);let c=Rr(t,e,r,{type:bE}),f=Rr(t,e,r,{type:RB});return a.loopback=f,c.loopback=f,rr(a,o),rr(a,c),rr(s,f),i!==void 0?(rr(f,c),rr(f,i.left),rr(i.right,o)):rr(f,a),t.decisionMap[Ks(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=a,{left:a,right:c}}function PB(t,e,r,n){let i=n.left,o=n.right;return rr(i,o),t.decisionMap[Ks(e,"Option",r.idx)]=i,n}function as(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Nc(t,e,r,n,...i){let o=Rr(t,e,n,{type:TB,start:r});r.end=o;for(let a of i)a!==void 0?(rr(r,a.left),rr(a.right,o)):rr(r,o);let s={left:r,right:o};return t.decisionMap[Ks(e,AB(n),n.idx)]=r,s}function AB(t){if(t instanceof at)return"Alternation";if(t instanceof Ke)return"Option";if(t instanceof Oe)return"Repetition";if(t instanceof st)return"RepetitionWithSeparator";if(t instanceof pt)return"RepetitionMandatory";if(t instanceof mt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function NB(t,e){let r=e.length;for(let o=0;o<r-1;o++){let s=e[o],a;s.left.transitions.length===1&&(a=s.left.transitions[0]);let c=a instanceof Pc,f=a,p=e[o+1].left;s.left.type===ss&&s.right.type===ss&&a!==void 0&&(c&&f.followState===s.right||a.target===s.right)?(c?f.followState=p:a.target=p,LB(t,s.right)):rr(s.right,p)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Uv(t,e,r,n){let i=Rr(t,e,n,{type:ss}),o=Rr(t,e,n,{type:ss});return Wv(i,new Ec(o,r)),{left:i,right:o}}function IB(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),o=Rr(t,e,r,{type:ss}),s=Rr(t,e,r,{type:ss}),a=new Pc(i,n,s);return Wv(o,a),{left:o,right:s}}function OB(t,e,r){let n=t.ruleToStartState.get(e);rr(n,r.left);let i=t.ruleToStopState.get(e);return rr(r.right,i),{left:n,right:i}}function rr(t,e){let r=new dl(e);Wv(t,r)}function Rr(t,e,r,n){let i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function Wv(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function LB(t,e){t.states.splice(t.states.indexOf(e),1)}var pl={},Ic=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=Hv(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return B(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function Hv(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function MB(t,e){let r={};return n=>{let i=n.toString(),o=r[i];return o!==void 0||(o={atnStartState:t,decision:e,states:{}},r[i]=o),o}}var em=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="",r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}},wE=new em,ml=class extends wo{constructor(e){var r;super(),this.logging=(r=e?.logging)!==null&&r!==void 0?r:n=>console.log(n)}initialize(e){this.atn=_E(e.rules),this.dfas=$B(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=Ks(n,"Alternation",r),p=this.atn.decisionMap[c].decision,m=B(Ip({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),T=>B(T,k=>k[0]));if(DE(m,!1)&&!o){let T=Mt(m,(k,A,N)=>(Q(A,O=>{O&&(k[O.tokenTypeIdx]=N,Q(O.categoryMatches,P=>{k[P]=N}))}),k),{});return i?function(k){var A;let N=this.LA(1),O=T[N.tokenTypeIdx];if(k!==void 0&&O!==void 0){let P=(A=k[O])===null||A===void 0?void 0:A.GATE;if(P!==void 0&&P.call(this)===!1)return}return O}:function(){let k=this.LA(1);return T[k.tokenTypeIdx]}}else return i?function(T){let k=new em,A=T===void 0?0:T.length;for(let O=0;O<A;O++){let P=T?.[O].GATE;k.set(O,P===void 0||P.call(this))}let N=Gv.call(this,s,p,k,a);return typeof N=="number"?N:void 0}:function(){let T=Gv.call(this,s,p,wE,a);return typeof T=="number"?T:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=Ks(n,i,r),p=this.atn.decisionMap[c].decision,m=B(Ip({maxLookahead:1,occurrence:r,prodType:i,rule:n}),T=>B(T,k=>k[0]));if(DE(m)&&m[0][0]&&!o){let T=m[0],k=Bt(T);if(k.length===1&&Ee(k[0].categoryMatches)){let N=k[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===N}}else{let A=Mt(k,(N,O)=>(O!==void 0&&(N[O.tokenTypeIdx]=!0,Q(O.categoryMatches,P=>{N[P]=!0})),N),{});return function(){let N=this.LA(1);return A[N.tokenTypeIdx]===!0}}}return function(){let T=Gv.call(this,s,p,wE,a);return typeof T=="object"?!1:T===0}}};function DE(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let o of n){if(o===void 0){if(e)break;return!1}let s=[o.tokenTypeIdx].concat(o.categoryMatches);for(let a of s)if(r.has(a)){if(!i.has(a))return!1}else r.add(a),i.add(a)}}return!0}function $B(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=MB(t.decisionStates[n],n);return r}function Gv(t,e,r,n){let i=t[e](r),o=i.start;if(o===void 0){let a=VB(i.atnStartState);o=AE(i,PE(a)),i.start=o}return qB.apply(this,[i,o,r,n])}function qB(t,e,r,n){let i=e,o=1,s=[],a=this.LA(o++);for(;;){let c=GB(i,a);if(c===void 0&&(c=FB.apply(this,[t,i,a,o,r,n])),c===pl)return HB(s,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,s.push(a),a=this.LA(o++)}}function FB(t,e,r,n,i,o){let s=BB(e.configs,r,i);if(s.size===0)return EE(t,e,r,pl),pl;let a=PE(s),c=zB(s,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(QB(s)){let f=rD(s.alts);a.isAcceptState=!0,a.prediction=f,a.configs.uniqueAlt=f,jB.apply(this,[t,n,s.alts,o])}return a=EE(t,e,r,a),a}function jB(t,e,r,n){let i=[];for(let f=1;f<=e;f++)i.push(this.LA(f).tokenType);let o=t.atnStartState,s=o.rule,a=o.production,c=UB({topLevelRule:s,ambiguityIndices:r,production:a,prefixPath:i});n(c)}function UB(t){let e=B(t.prefixPath,i=>ko(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${WB(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
187
+ For further details.`);this.skipValidations=Z(r,"skipValidations")?r.skipValidations:Jr.skipValidations}};bl.DEFER_DEFINITION_ERRORS_HANDLING=!1;pD(bl,[Xp,Qp,rm,nm,om,im,sm,am,cm,fm]);var _l=class extends bl{constructor(e,r=Jr){let n=st(r);n.outputCst=!1,super(e,n)}};function Ks(t,e,r){return`${t.name}_${e}_${r}`}var Zo=1,_V=2,mD=4,hD=5;var Nc=7,SV=8,kV=9,wV=10,CV=11,gD=12,Sl=class{constructor(e){this.target=e}isEpsilon(){return!1}},Ac=class extends Sl{constructor(e,r){super(e),this.tokenType=r}},kl=class extends Sl{constructor(e){super(e)}isEpsilon(){return!0}},Dc=class extends Sl{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function yD(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};EV(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],o=zs(e,i,i);o!==void 0&&qV(e,i,o)}return e}function EV(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],o=hr(t,i,void 0,{type:_V}),s=hr(t,i,void 0,{type:Nc});o.stop=s,t.ruleToStartState.set(i,o),t.ruleToStopState.set(i,s)}}function vD(t,e,r){return r instanceof we?wT(t,e,r.terminalType,r):r instanceof Ge?FV(t,e,r):r instanceof tt?IV(t,e,r):r instanceof Be?OV(t,e,r):r instanceof Ne?PV(t,e,r):r instanceof et?AV(t,e,r):r instanceof ct?DV(t,e,r):r instanceof ut?NV(t,e,r):zs(t,e,r)}function PV(t,e,r){let n=hr(t,e,r,{type:hD});es(t,n);let i=Ic(t,e,n,r,zs(t,e,r));return RD(t,e,r,i)}function AV(t,e,r){let n=hr(t,e,r,{type:hD});es(t,n);let i=Ic(t,e,n,r,zs(t,e,r)),o=wT(t,e,r.separator,r);return RD(t,e,r,i,o)}function DV(t,e,r){let n=hr(t,e,r,{type:mD});es(t,n);let i=Ic(t,e,n,r,zs(t,e,r));return TD(t,e,r,i)}function NV(t,e,r){let n=hr(t,e,r,{type:mD});es(t,n);let i=Ic(t,e,n,r,zs(t,e,r)),o=wT(t,e,r.separator,r);return TD(t,e,r,i,o)}function IV(t,e,r){let n=hr(t,e,r,{type:Zo});es(t,n);let i=B(r.definition,s=>vD(t,e,s));return Ic(t,e,n,r,...i)}function OV(t,e,r){let n=hr(t,e,r,{type:Zo});es(t,n);let i=Ic(t,e,n,r,zs(t,e,r));return LV(t,e,r,i)}function zs(t,e,r){let n=pr(B(r.definition,i=>vD(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:$V(t,n)}function TD(t,e,r,n,i){let o=n.left,s=n.right,a=hr(t,e,r,{type:CV});es(t,a);let c=hr(t,e,r,{type:gD});return o.loopback=a,c.loopback=a,t.decisionMap[Ks(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=a,Zt(s,a),i===void 0?(Zt(a,o),Zt(a,c)):(Zt(a,c),Zt(a,i.left),Zt(i.right,o)),{left:o,right:c}}function RD(t,e,r,n,i){let o=n.left,s=n.right,a=hr(t,e,r,{type:wV});es(t,a);let c=hr(t,e,r,{type:gD}),u=hr(t,e,r,{type:kV});return a.loopback=u,c.loopback=u,Zt(a,o),Zt(a,c),Zt(s,u),i!==void 0?(Zt(u,c),Zt(u,i.left),Zt(i.right,o)):Zt(u,a),t.decisionMap[Ks(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=a,{left:a,right:c}}function LV(t,e,r,n){let i=n.left,o=n.right;return Zt(i,o),t.decisionMap[Ks(e,"Option",r.idx)]=i,n}function es(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Ic(t,e,r,n,...i){let o=hr(t,e,n,{type:SV,start:r});r.end=o;for(let a of i)a!==void 0?(Zt(r,a.left),Zt(a.right,o)):Zt(r,o);let s={left:r,right:o};return t.decisionMap[Ks(e,MV(n),n.idx)]=r,s}function MV(t){if(t instanceof tt)return"Alternation";if(t instanceof Be)return"Option";if(t instanceof Ne)return"Repetition";if(t instanceof et)return"RepetitionWithSeparator";if(t instanceof ct)return"RepetitionMandatory";if(t instanceof ut)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function $V(t,e){let r=e.length;for(let o=0;o<r-1;o++){let s=e[o],a;s.left.transitions.length===1&&(a=s.left.transitions[0]);let c=a instanceof Dc,u=a,l=e[o+1].left;s.left.type===Zo&&s.right.type===Zo&&a!==void 0&&(c&&u.followState===s.right||a.target===s.right)?(c?u.followState=l:a.target=l,jV(t,s.right)):Zt(s.right,l)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function wT(t,e,r,n){let i=hr(t,e,n,{type:Zo}),o=hr(t,e,n,{type:Zo});return CT(i,new Ac(o,r)),{left:i,right:o}}function FV(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),o=hr(t,e,r,{type:Zo}),s=hr(t,e,r,{type:Zo}),a=new Dc(i,n,s);return CT(o,a),{left:o,right:s}}function qV(t,e,r){let n=t.ruleToStartState.get(e);Zt(n,r.left);let i=t.ruleToStopState.get(e);return Zt(r.right,i),{left:n,right:i}}function Zt(t,e){let r=new kl(e);CT(t,r)}function hr(t,e,r,n){let i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function CT(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function jV(t,e){t.states.splice(t.states.indexOf(e),1)}var wl={},Oc=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=ET(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return B(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function ET(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function UV(t,e){let r={};return n=>{let i=n.toString(),o=r[i];return o!==void 0||(o={atnStartState:t,decision:e,states:{}},r[i]=o),o}}var pm=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="",r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}},xD=new pm,Cl=class extends To{constructor(e){var r;super(),this.logging=(r=e?.logging)!==null&&r!==void 0?r:n=>console.log(n)}initialize(e){this.atn=yD(e.rules),this.dfas=WV(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=Ks(n,"Alternation",r),l=this.atn.decisionMap[c].decision,f=B(Kp({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),g=>B(g,T=>T[0]));if(bD(f,!1)&&!o){let g=At(f,(T,C,P)=>(J(C,O=>{O&&(T[O.tokenTypeIdx]=P,J(O.categoryMatches,E=>{T[E]=P}))}),T),{});return i?function(T){var C;let P=this.LA(1),O=g[P.tokenTypeIdx];if(T!==void 0&&O!==void 0){let E=(C=T[O])===null||C===void 0?void 0:C.GATE;if(E!==void 0&&E.call(this)===!1)return}return O}:function(){let T=this.LA(1);return g[T.tokenTypeIdx]}}else return i?function(g){let T=new pm,C=g===void 0?0:g.length;for(let O=0;O<C;O++){let E=g?.[O].GATE;T.set(O,E===void 0||E.call(this))}let P=PT.call(this,s,l,T,a);return typeof P=="number"?P:void 0}:function(){let g=PT.call(this,s,l,xD,a);return typeof g=="number"?g:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=Ks(n,i,r),l=this.atn.decisionMap[c].decision,f=B(Kp({maxLookahead:1,occurrence:r,prodType:i,rule:n}),g=>B(g,T=>T[0]));if(bD(f)&&f[0][0]&&!o){let g=f[0],T=Wt(g);if(T.length===1&&Se(T[0].categoryMatches)){let P=T[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===P}}else{let C=At(T,(P,O)=>(O!==void 0&&(P[O.tokenTypeIdx]=!0,J(O.categoryMatches,E=>{P[E]=!0})),P),{});return function(){let P=this.LA(1);return C[P.tokenTypeIdx]===!0}}}return function(){let g=PT.call(this,s,l,xD,a);return typeof g=="object"?!1:g===0}}};function bD(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let o of n){if(o===void 0){if(e)break;return!1}let s=[o.tokenTypeIdx].concat(o.categoryMatches);for(let a of s)if(r.has(a)){if(!i.has(a))return!1}else r.add(a),i.add(a)}}return!0}function WV(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=UV(t.decisionStates[n],n);return r}function PT(t,e,r,n){let i=t[e](r),o=i.start;if(o===void 0){let a=ZV(i.atnStartState);o=kD(i,SD(a)),i.start=o}return HV.apply(this,[i,o,r,n])}function HV(t,e,r,n){let i=e,o=1,s=[],a=this.LA(o++);for(;;){let c=XV(i,a);if(c===void 0&&(c=GV.apply(this,[t,i,a,o,r,n])),c===wl)return VV(s,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,s.push(a),a=this.LA(o++)}}function GV(t,e,r,n,i,o){let s=YV(e.configs,r,i);if(s.size===0)return _D(t,e,r,wl),wl;let a=SD(s),c=QV(s,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(n3(s)){let u=YP(s.alts);a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u,BV.apply(this,[t,n,s.alts,o])}return a=_D(t,e,r,a),a}function BV(t,e,r,n){let i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);let o=t.atnStartState,s=o.rule,a=o.production,c=KV({topLevelRule:s,ambiguityIndices:r,production:a,prefixPath:i});n(c)}function KV(t){let e=B(t.prefixPath,i=>yo(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${zV(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
186
188
  <${e}> may appears as a prefix path in all these alternatives.
187
189
  `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
188
- For Further details.`,n}function WB(t){if(t instanceof Be)return"SUBRULE";if(t instanceof Ke)return"OPTION";if(t instanceof at)return"OR";if(t instanceof pt)return"AT_LEAST_ONE";if(t instanceof mt)return"AT_LEAST_ONE_SEP";if(t instanceof st)return"MANY_SEP";if(t instanceof Oe)return"MANY";if(t instanceof Pe)return"CONSUME";throw Error("non exhaustive match")}function HB(t,e,r){let n=Pr(e.configs.elements,o=>o.state.transitions),i=uD(n.filter(o=>o instanceof Ec).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function GB(t,e){return t.edges[e.tokenTypeIdx]}function BB(t,e,r){let n=new Ic,i=[];for(let s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Ac){i.push(s);continue}let a=s.state.transitions.length;for(let c=0;c<a;c++){let f=s.state.transitions[c],p=KB(f,e);p!==void 0&&n.add({state:p,alt:s.alt,stack:s.stack})}}let o;if(i.length===0&&n.size===1&&(o=n),o===void 0){o=new Ic;for(let s of n.elements)tm(s,o)}if(i.length>0&&!YB(o))for(let s of i)o.add(s);return o}function KB(t,e){if(t instanceof Ec&&Zu(e,t.tokenType))return t.target}function zB(t,e){let r;for(let n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function PE(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function EE(t,e,r,n){return n=AE(t,n),e.edges[r.tokenTypeIdx]=n,n}function AE(t,e){if(e===pl)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function VB(t){let e=new Ic,r=t.transitions.length;for(let n=0;n<r;n++){let o={state:t.transitions[n].target,alt:n,stack:[]};tm(o,e)}return e}function tm(t,e){let r=t.state;if(r.type===Ac){if(t.stack.length>0){let i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};tm(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i<n;i++){let o=r.transitions[i],s=XB(t,o);s!==void 0&&tm(s,e)}}function XB(t,e){if(e instanceof dl)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Pc){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function YB(t){for(let e of t.elements)if(e.state.type===Ac)return!0;return!1}function JB(t){for(let e of t.elements)if(e.state.type!==Ac)return!1;return!0}function QB(t){if(JB(t))return!0;let e=ZB(t.elements);return eK(e)&&!tK(e)}function ZB(t){let e=new Map;for(let r of t){let n=Hv(r,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function eK(t){for(let e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function tK(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var Bv=Ie(xs(),1);var rm=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new zv(e),this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new om;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new im(e.startOffset,e.image.length,vu(e),e.tokenType,!1);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let r=e.container;if(r){let n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}construct(e){let r=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}addHiddenTokens(e){for(let r of e){let n=new im(r.startOffset,r.image.length,vu(r),r.tokenType,!0);n.root=this.rootNode,this.addHiddenToken(this.rootNode,n)}}addHiddenToken(e,r){let{offset:n,end:i}=r;for(let o=0;o<e.content.length;o++){let s=e.content[o],{offset:a,end:c}=s;if(Ei(s)&&n>a&&i<c){this.addHiddenToken(s,r);return}else if(i<=a){e.content.splice(o,0,r);return}}e.content.push(r)}},nm=class{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,r;let n=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(r=this.container)===null||r===void 0?void 0:r.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}},im=class extends nm{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,o=!1){super(),this._hidden=o,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},om=class extends nm{constructor(){super(...arguments),this.content=new Kv(this)}get children(){return this.content}get offset(){var e,r;return(r=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&r!==void 0?r:0}get length(){return this.end-this.offset}get end(){var e,r;return(r=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&r!==void 0?r:0}get range(){let e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:Bv.Position.create(0,0),end:Bv.Position.create(0,0)}}get firstNonHiddenNode(){for(let e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){let r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},Kv=class t extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.container=this.parent}},zv=class extends om{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var Xv=Symbol("Datatype");function Vv(t){return t.$type===Xv}var NE="\u200B",IE=t=>t.endsWith(NE)?t:t+NE,sm=class{constructor(e){this._unorderedGroups=new Map,this.lexer=e.parser.Lexer;let r=this.lexer.definition;this.wrapper=new Jv(r,Object.assign(Object.assign({},e.parser.ParserConfig),{errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},am=class extends sm{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new rm,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){let n=e.fragment?void 0:Cn(e)?Xv:ci(e),i=this.wrapper.DEFINE_RULE(IE(e.name),this.startImplementation(n,r).bind(this));return e.entry&&(this.mainRule=i),i}parse(e){this.nodeBuilder.buildRootNode(e);let r=this.lexer.tokenize(e);this.wrapper.input=r.tokens;let n=this.mainRule.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(r.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:r.errors,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{if(!this.isRecording()){let o={$type:e};this.stack.push(o),e===Xv&&(o.value="")}let i;try{i=r(n)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&!i.isInsertedInRecovery){let o=this.nodeBuilder.buildLeafNode(i,n),{assignment:s,isCrossRef:a}=this.getAssignment(n),c=this.current;if(s){let f=jt(n)?i.image:this.converter.convert(i.image,o);this.assign(s.operator,s.feature,f,o,a)}else if(Vv(c)){let f=i.image;jt(n)||(f=this.converter.convert(f,o).toString()),c.value+=f}}}subrule(e,r,n,i){let o;this.isRecording()||(o=this.nodeBuilder.buildCompositeNode(n));let s=this.wrapper.wrapSubrule(e,r,i);!this.isRecording()&&o&&o.length>0&&this.performSubruleAssignment(s,n,o)}performSubruleAssignment(e,r,n){let{assignment:i,isCrossRef:o}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,o);else if(!i){let s=this.current;if(Vv(s))s.value+=e.toString();else{let a=e.$type,c=this.assignWithoutOverride(e,s);a&&(c.$type=a);let f=c;this.stack.pop(),this.stack.push(f)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&r.feature&&r.operator){n=this.construct(!1);let o=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(o)}let i={$type:e};this.stack.pop(),this.stack.push(i),r.feature&&r.operator&&this.assign(r.operator,r.feature,n,n.$cstNode,!1)}}construct(e=!0){if(this.isRecording())return;let r=this.current;return G_(r),this.nodeBuilder.construct(r),e&&this.stack.pop(),Vv(r)?this.converter.convert(r.value,r.$cstNode):(this.assignMandatoryProperties(r),r)}assignMandatoryProperties(e){let r=this.astReflection.getTypeMetaData(e.$type);for(let n of r.mandatory){let i=e[n.name];n.type==="array"&&!Array.isArray(i)?e[n.name]=[]:n.type==="boolean"&&i===void 0&&(e[n.name]=!1)}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=Ze(e,je);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?kr(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,o){let s=this.current,a;switch(o&&typeof n=="string"?a=this.linker.buildReference(s,r,i,n):a=n,e){case"=":{s[r]=a;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(a)}}assignWithoutOverride(e,r){for(let[n,i]of Object.entries(r)){let o=e[n];o===void 0?e[n]=i:Array.isArray(o)&&Array.isArray(i)&&(i.push(...o),e[n]=i)}return e}get definitionErrors(){return this.wrapper.definitionErrors}},Yv=class{buildMismatchTokenMessage(e){return Co.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Co.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Co.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Co.buildEarlyExitMessage(e)}},hl=class extends Yv{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},cm=class extends sm{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e);return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(IE(e.name),this.startImplementation(r).bind(this));return e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i){this.before(n),this.wrapper.wrapSubrule(e,r,i),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},rK={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new hl},Jv=class extends ll{constructor(e,r){let n=r&&"maxLookahead"in r;super(e,Object.assign(Object.assign(Object.assign({},rK),{lookaheadStrategy:n?new wo({maxLookahead:r.maxLookahead}):new ml}),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}};var gl=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function um(t){throw new Error("Error! The input value was not handled.")}function fm(t,e,r){return nK({parser:e,tokens:r,rules:new Map,ruleNames:new Map},t),e}function nK(t,e){let r=Na(e,!1),n=ke(e.rules).filter(Z).filter(i=>r.has(i));for(let i of n){let o=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});o.rules.set(i.name,t.parser.rule(i,Vs(o,i.definition)))}}function Vs(t,e,r=!1){let n;if(jt(e))n=lK(t,e);else if(Je(e))n=iK(t,e);else if(je(e))n=Vs(t,e.terminal);else if(kr(e))n=OE(t,e);else if(Qe(e))n=oK(t,e);else if(xn(e))n=aK(t,e);else if(bn(e))n=cK(t,e);else if(gr(e))n=uK(t,e);else throw new gl(e.$cstNode,`Unexpected element type: ${e.$type}`);return LE(t,r?void 0:lm(e),n,e.cardinality)}function iK(t,e){let r=ci(e);return()=>t.parser.action(r,e)}function oK(t,e){let r=e.rule.ref;if(Z(r)){let n=t.subrule++,i=e.arguments.length>0?sK(r,e.arguments):()=>({});return o=>t.parser.subrule(n,ME(t,r),e,i(o))}else if(He(r)){let n=t.consume++,i=Qv(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)um(r);else throw new gl(e.$cstNode,`Undefined rule type: ${e.$type}`)}function sK(t,e){let r=e.map(n=>Do(n.value));return n=>{let i={};for(let o=0;o<r.length;o++){let s=t.parameters[o],a=r[o];i[s.name]=a(n)}return i}}function Do(t){if(u_(t)){let e=Do(t.left),r=Do(t.right);return n=>e(n)||r(n)}else if(a_(t)){let e=Do(t.left),r=Do(t.right);return n=>e(n)&&r(n)}else if(m_(t)){let e=Do(t.value);return r=>!e(r)}else if(xa(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(d_(t)){let e=!!t.true;return()=>e}um(t)}function aK(t,e){if(e.elements.length===1)return Vs(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:Vs(t,i,!0)},s=lm(i);s&&(o.GATE=Do(s)),r.push(o)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(o=>{let s={ALT:()=>o.ALT(i)},a=o.GATE;return a&&(s.GATE=()=>a(i)),s}))}}function cK(t,e){if(e.elements.length===1)return Vs(t,e.elements[0]);let r=[];for(let a of e.elements){let c={ALT:Vs(t,a,!0)},f=lm(a);f&&(c.GATE=Do(f)),r.push(c)}let n=t.or++,i=(a,c)=>{let f=c.getRuleStack().join("-");return`uGroup_${a}_${f}`},o=a=>t.parser.alternatives(n,r.map((c,f)=>{let p={ALT:()=>!0},m=t.parser;p.ALT=()=>{if(c.ALT(a),!m.isRecording()){let k=i(n,m);m.unorderedGroups.get(k)||m.unorderedGroups.set(k,[]);let A=m.unorderedGroups.get(k);typeof A?.[f]>"u"&&(A[f]=!0)}};let T=c.GATE;return T?p.GATE=()=>T(a):p.GATE=()=>{let k=m.unorderedGroups.get(i(n,m));return!k?.[f]},p})),s=LE(t,lm(e),o,"*");return a=>{s(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function uK(t,e){let r=e.elements.map(n=>Vs(t,n));return n=>r.forEach(i=>i(n))}function lm(t){if(gr(t))return t.guardCondition}function OE(t,e,r=e.terminal){if(r)if(Qe(r)&&Z(r.rule.ref)){let n=t.subrule++;return i=>t.parser.subrule(n,ME(t,r.rule.ref),e,i)}else if(Qe(r)&&He(r.rule.ref)){let n=t.consume++,i=Qv(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(jt(r)){let n=t.consume++,i=Qv(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let n=Mu(e.type.ref),i=n?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+ci(e.type.ref));return OE(t,e,i)}}function lK(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function LE(t,e,r,n){let i=e&&Do(e);if(!n)if(i){let o=t.or++;return s=>t.parser.alternatives(o,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:Zp(),GATE:()=>!i(s)}])}else return r;if(n==="*"){let o=t.many++;return s=>t.parser.many(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){let o=t.many++;if(i){let s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(o,{DEF:()=>r(a)}),GATE:()=>i(a)},{ALT:Zp(),GATE:()=>!i(a)}])}else return s=>t.parser.atLeastOne(o,{DEF:()=>r(s)})}else if(n==="?"){let o=t.optional++;return s=>t.parser.optional(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else um(n)}function ME(t,e){let r=fK(t,e),n=t.rules.get(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function fK(t,e){if(Z(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Z(n);)(gr(n)||xn(n)||bn(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function Qv(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function $E(t){let e=t.Grammar,r=t.parser.Lexer,n=new cm(t);return fm(e,n,r.definition),n.finalize(),n}function qE(t){let e=dK(t);return e.finalize(),e}function dK(t){let e=t.Grammar,r=t.parser.Lexer,n=new am(t);return fm(e,n,r.definition)}var dm=class{buildTokens(e,r){let n=ke(Na(e,!1)),i=this.buildTerminalTokens(n),o=this.buildKeywordTokens(n,i,r);return i.forEach(s=>{let a=s.PATTERN;typeof a=="object"&&a&&"test"in a&&Ay(a)?o.unshift(s):o.push(s)}),o}buildTerminalTokens(e){return e.filter(He).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=Un(e),n=r.flags.includes("u")?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n,LINE_BREAKS:!0};return e.hidden&&(i.GROUP=Ay(r)?Wt.SKIPPED:"hidden"),i}regexPatternFunction(e){let r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Z).flatMap(i=>bt(i).filter(jt)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){return{name:e.value,PATTERN:this.buildKeywordPattern(e,n),LONGER_ALT:this.findLongerAlt(e,r)}}buildKeywordPattern(e,r){return r?new RegExp(dS(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&pS("^"+o.source+"$",e.value)&&n.push(i),n},[])}};var pm=class{convert(e,r){let n=r.grammarSource;if(kr(n)&&(n=md(n)),Qe(n)){let i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return gK(r);case"STRING":return pK(r);case"ID":return hK(r)}switch((i=Ms(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return TK(r);case"boolean":return RK(r);case"bigint":return yK(r);case"date":return vK(r);default:return r}}};function pK(t){let e="";for(let r=1;r<t.length-1;r++){let n=t.charAt(r);if(n==="\\"){let i=t.charAt(++r);e+=mK(i)}else e+=n}return e}function mK(t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return`
189
- `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return t}}function hK(t){return t.charAt(0)==="^"?t.substring(1):t}function gK(t){return parseInt(t)}function yK(t){return BigInt(t)}function vK(t){return new Date(t)}function TK(t){return Number(t)}function RK(t){return t.toLowerCase()==="true"}var FE=Ie(Xe(),1);var mm=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=FE.CancellationToken.None){for(let n of uo(e.parseResult.value))await _t(r),Hf(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if(n._ref===void 0)try{let i=this.getCandidate(e);if(ga(i))n._ref=i;else if(n._nodeDescription=i,this.langiumDocuments().hasDocument(i.documentUri)){let o=this.loadAstNode(i);n._ref=o??this.createLinkingError(e,i)}}catch(i){n._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${i}`})}r.references.push(n)}unlink(e){for(let r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){let n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,r,n,i){let o=this,s={$refNode:n,$refText:i,get ref(){var a;if(Zt(this._ref))return this._ref;if(Kb(this._nodeDescription)){let c=o.loadAstNode(this._nodeDescription);this._ref=c??o.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){let c=o.getLinkedNode({reference:s,container:e,property:r});if(c.error&&Se(e).state<nt.ComputedScopes)return;this._ref=(a=c.node)!==null&&a!==void 0?a:c.error,this._nodeDescription=c.descr}return Zt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return ga(this._ref)?this._ref:void 0}};return s}getLinkedNode(e){try{let r=this.getCandidate(e);if(ga(r))return{error:r};let n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`})}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getOrCreateDocument(e.documentUri);return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){let n=Se(e.container);n.state<nt.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}};function UE(t){return typeof t.$comment=="string"}function jE(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}var hm=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){let n=r?.replacer,i=(s,a)=>this.replacer(s,a,r);return JSON.stringify(e,n?(s,a)=>n(s,a,i):i,r?.space)}deserialize(e){let r=JSON.parse(e);return this.linkNode(r,r),r}replacer(e,r,{refText:n,sourceText:i,textRegions:o,comments:s}={}){var a,c,f;if(!this.ignoreProperties.has(e))if(so(r)){let p=r.ref,m=n?r.$refText:void 0;return p?{$refText:m,$ref:"#"+(p&&this.astNodeLocator.getAstNodePath(p))}:{$refText:m,$error:(c=(a=r.error)===null||a===void 0?void 0:a.message)!==null&&c!==void 0?c:"Could not resolve reference"}}else{let p;if(o&&Zt(r)&&(p=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&p?.$textRegion))try{p.$textRegion.documentURI=Se(r).uri.toString()}catch{}return i&&!e&&Zt(r)&&(p??(p=Object.assign({},r)),p.$sourceText=(f=r.$cstNode)===null||f===void 0?void 0:f.text),s&&Zt(r)&&(p??(p=Object.assign({},r)),p.$comment=this.commentProvider.getComment(r)),p??r}}addAstNodeRegionWithAssignmentsTo(e){let r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(o=>!o.startsWith("$")).forEach(o=>{let s=jo(e.$cstNode,o).map(r);s.length!==0&&(i[o]=s)}),e}}linkNode(e,r,n,i,o){for(let[a,c]of Object.entries(e))if(Array.isArray(c))for(let f=0;f<c.length;f++){let p=c[f];jE(p)?c[f]=this.reviveReference(e,a,r,p):Zt(p)&&this.linkNode(p,r,e,a,f)}else jE(c)?e[a]=this.reviveReference(e,a,r,c):Zt(c)&&this.linkNode(c,r,e,a);let s=e;s.$container=n,s.$containerProperty=i,s.$containerIndex=o}reviveReference(e,r,n,i){let o=i.$refText;if(i.$ref){let s=this.getRefNode(n,i.$ref);return o||(o=this.nameProvider.getName(s)),{$refText:o??"",ref:s}}else if(i.$error){let s={$refText:o??""};return s.error={container:e,property:r,message:i.$error,reference:s},s}else return}getRefNode(e,r){return this.astNodeLocator.getAstNode(e,r.substring(1))}};var gm=class{register(e){if(!this.singleton&&!this.map){this.singleton=e;return}if(!this.map&&(this.map={},this.singleton)){for(let r of this.singleton.LanguageMetaData.fileExtensions)this.map[r]=this.singleton;this.singleton=void 0}for(let r of e.LanguageMetaData.fileExtensions)this.map[r]!==void 0&&this.map[r]!==e&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${e.LanguageMetaData.languageId}'.`),this.map[r]=e}getServices(e){if(this.singleton!==void 0)return this.singleton;if(this.map===void 0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let r=qe.extname(e),n=this.map[r];if(!n)throw new Error(`The service registry contains no services for the extension '${r}'.`);return n}get all(){return this.singleton!==void 0?[this.singleton]:this.map!==void 0?Object.values(this.map):[]}};var WE=Ie(Xe(),1);var ym=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n=Se(e)){r??(r=this.nameProvider.getName(e));let i=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${i} has no name.`);let o,s=()=>{var a;return o??(o=jr((a=this.nameProvider.getNameNode(e))!==null&&a!==void 0?a:e.$cstNode))};return{node:e,name:r,get nameSegment(){return s()},selectionSegment:jr(e.$cstNode),type:e.$type,documentUri:n.uri,path:i}}},vm=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=WE.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of uo(i))await _t(r),Hf(o).filter(s=>!ga(s)).forEach(s=>{let a=this.createDescription(s);a&&n.push(a)});return n}createDescription(e){let r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;let i=Se(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:jr(n),local:qe.equals(r.documentUri,i)}}};var Tm=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let s=o.indexOf(this.indexSeparator);if(s>0){let a=o.substring(0,s),c=parseInt(o.substring(s+1)),f=i[a];return f?.[c]}return i[o]},e)}};var HE=Ie(Jt(),1),Rm=class{constructor(e){this.settings={},this.workspaceConfig=!1,this.initialized=!1,this.serviceRegistry=e.ServiceRegistry,this.connection=e.lsp.Connection,e.lsp.LanguageServer.onInitialize(r=>{var n,i;this.workspaceConfig=(i=(n=r.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&i!==void 0?i:!1}),e.lsp.LanguageServer.onInitialized(r=>{var n;let i=this.serviceRegistry.all;(n=e.lsp.Connection)===null||n===void 0||n.client.register(HE.DidChangeConfigurationNotification.type,{section:i.map(o=>this.toSectionName(o.LanguageMetaData.languageId))})})}async initialize(){if(this.workspaceConfig&&this.connection){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await this.connection.workspace.getConfiguration(r);r.forEach((i,o)=>{this.updateSectionConfiguration(i.section,n[o])})}this.initialized=!0}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{this.updateSectionConfiguration(r,e.settings[r])})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){this.initialized||await this.initialize();let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}};var Oc=Ie(Xe(),1);var xm=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ye,this.buildState=new Map,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Oc.CancellationToken.None){var i,o;for(let s of e){let a=s.uri.toString();if(s.state===nt.Validated){if(typeof r.validation=="boolean"&&r.validation)s.state=nt.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(a);else if(typeof r.validation=="object"){let c=this.buildState.get(a),f=(i=c?.result)===null||i===void 0?void 0:i.validationChecks;if(f){let m=((o=r.validation.categories)!==null&&o!==void 0?o:Ea.all).filter(T=>!f.includes(T));m.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:m})},result:c.result}),s.state=nt.IndexedReferences)}}}else this.buildState.delete(a)}await this.buildDocuments(e,r,n)}async update(e,r,n=Oc.CancellationToken.None){for(let s of r)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString());this.indexManager.remove(r);for(let s of e)this.langiumDocuments.invalidateDocument(s)||this.langiumDocuments.getOrCreateDocument(s),this.buildState.delete(s.toString());let i=ke(e).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!i.has(s.uri.toString())&&this.shouldRelink(s,i)).forEach(s=>{this.serviceRegistry.getServices(s.uri).references.Linker.unlink(s),s.state=Math.min(s.state,nt.ComputedScopes),s.diagnostics=void 0});for(let s of this.updateListeners)s(e,r);await _t(n);let o=this.langiumDocuments.all.filter(s=>{var a;return s.state<nt.Linked||!(!((a=this.buildState.get(s.uri.toString()))===null||a===void 0)&&a.completed)}).toArray();await this.buildDocuments(o,this.updateBuildOptions,n)}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Oc.Disposable.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,nt.Parsed,n,o=>{this.langiumDocumentFactory.update(o)}),await this.runCancelable(e,nt.IndexedContent,n,o=>this.indexManager.updateContent(o,n)),await this.runCancelable(e,nt.ComputedScopes,n,async o=>{let s=this.serviceRegistry.getServices(o.uri).references.ScopeComputation;o.precomputedScopes=await s.computeLocalScopes(o,n)}),await this.runCancelable(e,nt.Linked,n,o=>this.serviceRegistry.getServices(o.uri).references.Linker.link(o,n)),await this.runCancelable(e,nt.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));let i=e.filter(o=>this.shouldValidate(o));await this.runCancelable(i,nt.Validated,n,o=>this.validate(o,n));for(let o of e){let s=this.buildState.get(o.uri.toString());s&&(s.completed=!0)}}prepareBuild(e,r){for(let n of e){let i=n.uri.toString(),o=this.buildState.get(i);(!o||o.completed)&&this.buildState.set(i,{completed:!1,options:r,result:o?.result})}}async runCancelable(e,r,n,i){let o=e.filter(s=>s.state<r);for(let s of o)await _t(n),await i(s),s.state=r;await this.notifyBuildPhase(o,r,n)}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Oc.Disposable.create(()=>{this.buildPhaseListeners.delete(e,r)})}async notifyBuildPhase(e,r,n){if(e.length===0)return;let i=this.buildPhaseListeners.get(r);for(let o of i)await _t(n),await o(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;let o=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,a=typeof s=="object"?s:void 0,c=await o.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...c):e.diagnostics=c;let f=this.buildState.get(e.uri.toString());if(f){(n=f.result)!==null&&n!==void 0||(f.result={});let p=(i=a?.categories)!==null&&i!==void 0?i:Ea.all;f.result.validationChecks?f.result.validationChecks.push(...p):f.result.validationChecks=[...p]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}};var Zv=Ie(Xe(),1);var bm=class{constructor(e){this.simpleIndex=new Map,this.simpleTypeIndex=new ad,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=Se(e).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(s=>{qe.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ke(i)}allElements(e,r){let n=ke(this.simpleIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.simpleTypeIndex.get(e,r,()=>{var o;return((o=this.simpleIndex.get(e))!==null&&o!==void 0?o:[]).filter(a=>this.astReflection.isSubtype(a.type,r))}):(n=this.simpleIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){for(let r of e){let n=r.toString();this.simpleIndex.delete(n),this.simpleTypeIndex.clear(n),this.referenceIndex.delete(n)}}async updateContent(e,r=Zv.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r);for(let s of i)s.node=void 0;let o=e.uri.toString();this.simpleIndex.set(o,i),this.simpleTypeIndex.clear(o)}async updateReferences(e,r=Zv.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}};var GE=Ie(Xe(),1);var _m=class{constructor(e){this.initialBuildOptions={},this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.MutexLock,e.lsp.LanguageServer.onInitialize(r=>{var n;this.folders=(n=r.workspaceFolders)!==null&&n!==void 0?n:void 0}),e.lsp.LanguageServer.onInitialized(r=>{this.mutex.lock(n=>{var i;return this.initializeWorkspace((i=this.folders)!==null&&i!==void 0?i:[],n)})})}async initializeWorkspace(e,r=GE.CancellationToken.None){let n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),i=[],o=s=>{i.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(e,o),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,o))),await _t(r),await this.documentBuilder.build(i,this.initialBuildOptions,r)}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Dr.parse(e.uri)}async traverseFolder(e,r,n,i){let o=await this.fileSystemProvider.readDirectory(r);await Promise.all(o.map(async s=>{if(this.includeEntry(e,s,n)){if(s.isDirectory)await this.traverseFolder(e,s.uri,n,i);else if(s.isFile){let a=this.langiumDocuments.getOrCreateDocument(s.uri);i(a)}}}))}includeEntry(e,r,n){let i=qe.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){let o=qe.extname(r.uri);return n.includes(o)}return!1}};var Sm=class{constructor(e){let r=e.parser.TokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);let n=BE(r)?Object.values(r):r;this.chevrotainLexer=new Wt(n,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e){var r;let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:(r=n.groups.hidden)!==null&&r!==void 0?r:[]}}toTokenTypeDictionary(e){if(BE(e))return e;let r=KE(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function xK(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function KE(t){return t&&"modes"in t&&"defaultMode"in t}function BE(t){return!xK(t)&&!KE(t)}var Ue=Ie(Xe(),1);function XE(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Ue.Position.create(0,0));let o=JE(t),s=rT(n),a=_K({lines:o,position:i,options:s});return DK({index:0,tokens:a,position:i})}function YE(t,e){let r=rT(e),n=JE(t);if(n.length===0)return!1;let i=n[0],o=n[n.length-1],s=r.start,a=r.end;return!!s?.exec(i)&&!!a?.exec(o)}function JE(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(bu)}var zE=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,bK=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function _K(t){var e,r,n;let i=[],o=t.position.line,s=t.position.character;for(let a=0;a<t.lines.length;a++){let c=a===0,f=a===t.lines.length-1,p=t.lines[a],m=0;if(c&&t.options.start){let k=(e=t.options.start)===null||e===void 0?void 0:e.exec(p);k&&(m=k.index+k[0].length)}else{let k=(r=t.options.line)===null||r===void 0?void 0:r.exec(p);k&&(m=k.index+k[0].length)}if(f){let k=(n=t.options.end)===null||n===void 0?void 0:n.exec(p);k&&(p=p.substring(0,k.index))}if(p=p.substring(0,wK(p)),tT(p,0)>=p.length){if(i.length>0){let k=Ue.Position.create(o,s);i.push({type:"break",content:"",range:Ue.Range.create(k,k)})}}else{zE.lastIndex=m;let k=zE.exec(p);if(k){let A=k[0],N=k[1],O=Ue.Position.create(o,s+m),P=Ue.Position.create(o,s+m+A.length);i.push({type:"tag",content:N,range:Ue.Range.create(O,P)}),m+=A.length,m=tT(p,m)}if(m<p.length){let A=p.substring(m),N=Array.from(A.matchAll(bK));i.push(...SK(N,A,o,s+m))}}o++,s=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function SK(t,e,r,n){let i=[];if(t.length===0){let o=Ue.Position.create(r,n),s=Ue.Position.create(r,n+e.length);i.push({type:"text",content:e,range:Ue.Range.create(o,s)})}else{let o=0;for(let a of t){let c=a.index,f=e.substring(o,c);f.length>0&&i.push({type:"text",content:e.substring(o,c),range:Ue.Range.create(Ue.Position.create(r,o+n),Ue.Position.create(r,c+n))});let p=f.length+1,m=a[1];if(i.push({type:"inline-tag",content:m,range:Ue.Range.create(Ue.Position.create(r,o+p+n),Ue.Position.create(r,o+p+m.length+n))}),p+=m.length,a.length===4){p+=a[2].length;let T=a[3];i.push({type:"text",content:T,range:Ue.Range.create(Ue.Position.create(r,o+p+n),Ue.Position.create(r,o+p+T.length+n))})}else i.push({type:"text",content:"",range:Ue.Range.create(Ue.Position.create(r,o+p+n),Ue.Position.create(r,o+p+n))});o=c+a[0].length}let s=e.substring(o);s.length>0&&i.push({type:"text",content:s,range:Ue.Range.create(Ue.Position.create(r,o+n),Ue.Position.create(r,o+n+s.length))})}return i}var kK=/\S/,CK=/\s*$/;function tT(t,e){let r=t.substring(e).match(kK);return r?e+r.index:t.length}function wK(t){let e=t.match(CK);if(e&&typeof e.index=="number")return e.index}function DK(t){var e,r,n,i;let o=Ue.Position.create(t.position.line,t.position.character);if(t.tokens.length===0)return new km([],Ue.Range.create(o,o));let s=[];for(;t.index<t.tokens.length;){let f=EK(t,s[s.length-1]);f&&s.push(f)}let a=(r=(e=s[0])===null||e===void 0?void 0:e.range.start)!==null&&r!==void 0?r:o,c=(i=(n=s[s.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:o;return new km(s,Ue.Range.create(a,c))}function EK(t,e){let r=t.tokens[t.index];if(r.type==="tag")return ZE(t,!1);if(r.type==="text"||r.type==="inline-tag")return QE(t);PK(r,e),t.index++}function PK(t,e){if(e){let r=new Cm("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function QE(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(AK(t)),n=e,e=t.tokens[t.index];return new vl(i,Ue.Range.create(r.range.start,n.range.end))}function AK(t){return t.tokens[t.index].type==="inline-tag"?ZE(t,!0):eP(t)}function ZE(t,e){let r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){let o=eP(t);return new yl(n,new vl([o],o.range),e,Ue.Range.create(r.range.start,o.range.end))}else{let o=QE(t);return new yl(n,o,e,Ue.Range.create(r.range.start,o.range.end))}else{let o=r.range;return new yl(n,new vl([],o),e,o)}}function eP(t){let e=t.tokens[t.index++];return new Cm(e.content,e.range)}function rT(t){if(!t)return rT({start:"/**",end:"*/",line:"*"});let{start:e,end:r,line:n}=t;return{start:eT(e,!0),end:eT(r,!1),line:eT(n,!0)}}function eT(t,e){if(typeof t=="string"||typeof t=="object"){let r=typeof t=="string"?po(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}var km=class{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(let r of this.elements)if(e.length===0)e=r.toString();else{let n=r.toString();e+=VE(e)+n}return e.trim()}toMarkdown(e){let r="";for(let n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{let i=n.toMarkdown(e);r+=VE(r)+i}return r.trim()}},yl=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
190
- ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){let r=this.content.toMarkdown(e);if(this.inline){let o=NK(this.name,r,e??{});if(typeof o=="string")return o}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \u2014 ${r}`:this.content.inlines.length>1&&(i=`${i}
191
- ${r}`),this.inline?`{${i}}`:i}};function NK(t,e,r){var n,i;if(t==="linkplain"||t==="linkcode"||t==="link"){let o=e.indexOf(" "),s=e;if(o>0){let c=tT(e,o);s=e.substring(c),e=e.substring(0,o)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),(i=(n=r.renderLink)===null||n===void 0?void 0:n.call(r,e,s))!==null&&i!==void 0?i:IK(e,s)}}function IK(t,e){try{return Dr.parse(t,!0),`[${e}](${t})`}catch{return t}}var vl=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){let n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
190
+ For Further details.`,n}function zV(t){if(t instanceof Ge)return"SUBRULE";if(t instanceof Be)return"OPTION";if(t instanceof tt)return"OR";if(t instanceof ct)return"AT_LEAST_ONE";if(t instanceof ut)return"AT_LEAST_ONE_SEP";if(t instanceof et)return"MANY_SEP";if(t instanceof Ne)return"MANY";if(t instanceof we)return"CONSUME";throw Error("non exhaustive match")}function VV(t,e,r){let n=kr(e.configs.elements,o=>o.state.transitions),i=nA(n.filter(o=>o instanceof Ac).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function XV(t,e){return t.edges[e.tokenTypeIdx]}function YV(t,e,r){let n=new Oc,i=[];for(let s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Nc){i.push(s);continue}let a=s.state.transitions.length;for(let c=0;c<a;c++){let u=s.state.transitions[c],l=JV(u,e);l!==void 0&&n.add({state:l,alt:s.alt,stack:s.stack})}}let o;if(i.length===0&&n.size===1&&(o=n),o===void 0){o=new Oc;for(let s of n.elements)mm(s,o)}if(i.length>0&&!t3(o))for(let s of i)o.add(s);return o}function JV(t,e){if(t instanceof Ac&&dl(e,t.tokenType))return t.target}function QV(t,e){let r;for(let n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function SD(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function _D(t,e,r,n){return n=kD(t,n),e.edges[r.tokenTypeIdx]=n,n}function kD(t,e){if(e===wl)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function ZV(t){let e=new Oc,r=t.transitions.length;for(let n=0;n<r;n++){let o={state:t.transitions[n].target,alt:n,stack:[]};mm(o,e)}return e}function mm(t,e){let r=t.state;if(r.type===Nc){if(t.stack.length>0){let i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};mm(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i<n;i++){let o=r.transitions[i],s=e3(t,o);s!==void 0&&mm(s,e)}}function e3(t,e){if(e instanceof kl)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Dc){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function t3(t){for(let e of t.elements)if(e.state.type===Nc)return!0;return!1}function r3(t){for(let e of t.elements)if(e.state.type!==Nc)return!1;return!0}function n3(t){if(r3(t))return!0;let e=i3(t.elements);return o3(e)&&!s3(e)}function i3(t){let e=new Map;for(let r of t){let n=ET(r,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function o3(t){for(let e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function s3(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var AT=De(xs(),1);var hm=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new NT(e),this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new vm;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new ym(e.startOffset,e.image.length,Du(e),e.tokenType,!1);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let r=e.container;if(r){let n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}construct(e){let r=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}addHiddenTokens(e){for(let r of e){let n=new ym(r.startOffset,r.image.length,Du(r),r.tokenType,!0);n.root=this.rootNode,this.addHiddenToken(this.rootNode,n)}}addHiddenToken(e,r){let{offset:n,end:i}=r;for(let o=0;o<e.content.length;o++){let s=e.content[o],{offset:a,end:c}=s;if(xi(s)&&n>a&&i<c){this.addHiddenToken(s,r);return}else if(i<=a){e.content.splice(o,0,r);return}}e.content.push(r)}},gm=class{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,r;let n=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(r=this.container)===null||r===void 0?void 0:r.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}},ym=class extends gm{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,o=!1){super(),this._hidden=o,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},vm=class extends gm{constructor(){super(...arguments),this.content=new DT(this)}get children(){return this.content}get offset(){var e,r;return(r=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&r!==void 0?r:0}get length(){return this.end-this.offset}get end(){var e,r;return(r=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&r!==void 0?r:0}get range(){let e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:AT.Position.create(0,0),end:AT.Position.create(0,0)}}get firstNonHiddenNode(){for(let e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){let r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},DT=class t extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.container=this.parent}},NT=class extends vm{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var OT=Symbol("Datatype");function IT(t){return t.$type===OT}var wD="\u200B",CD=t=>t.endsWith(wD)?t:t+wD,Tm=class{constructor(e){this._unorderedGroups=new Map,this.lexer=e.parser.Lexer;let r=this.lexer.definition;this.wrapper=new MT(r,Object.assign(Object.assign({},e.parser.ParserConfig),{errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},Rm=class extends Tm{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new hm,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){let n=e.fragment?void 0:Tn(e)?OT:si(e),i=this.wrapper.DEFINE_RULE(CD(e.name),this.startImplementation(n,r).bind(this));return e.entry&&(this.mainRule=i),i}parse(e){this.nodeBuilder.buildRootNode(e);let r=this.lexer.tokenize(e);this.wrapper.input=r.tokens;let n=this.mainRule.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(r.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:r.errors,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{if(!this.isRecording()){let o={$type:e};this.stack.push(o),e===OT&&(o.value="")}let i;try{i=r(n)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&!i.isInsertedInRecovery){let o=this.nodeBuilder.buildLeafNode(i,n),{assignment:s,isCrossRef:a}=this.getAssignment(n),c=this.current;if(s){let u=Ot(n)?i.image:this.converter.convert(i.image,o);this.assign(s.operator,s.feature,u,o,a)}else if(IT(c)){let u=i.image;Ot(n)||(u=this.converter.convert(u,o).toString()),c.value+=u}}}subrule(e,r,n,i){let o;this.isRecording()||(o=this.nodeBuilder.buildCompositeNode(n));let s=this.wrapper.wrapSubrule(e,r,i);!this.isRecording()&&o&&o.length>0&&this.performSubruleAssignment(s,n,o)}performSubruleAssignment(e,r,n){let{assignment:i,isCrossRef:o}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,o);else if(!i){let s=this.current;if(IT(s))s.value+=e.toString();else{let a=e.$type,c=this.assignWithoutOverride(e,s);a&&(c.$type=a);let u=c;this.stack.pop(),this.stack.push(u)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&r.feature&&r.operator){n=this.construct(!1);let o=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(o)}let i={$type:e};this.stack.pop(),this.stack.push(i),r.feature&&r.operator&&this.assign(r.operator,r.feature,n,n.$cstNode,!1)}}construct(e=!0){if(this.isRecording())return;let r=this.current;return Fk(r),this.nodeBuilder.construct(r),e&&this.stack.pop(),IT(r)?this.converter.convert(r.value,r.$cstNode):(this.assignMandatoryProperties(r),r)}assignMandatoryProperties(e){let r=this.astReflection.getTypeMetaData(e.$type);for(let n of r.mandatory){let i=e[n.name];n.type==="array"&&!Array.isArray(i)?e[n.name]=[]:n.type==="boolean"&&i===void 0&&(e[n.name]=!1)}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=Je(e,Fe);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?Rr(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,o){let s=this.current,a;switch(o&&typeof n=="string"?a=this.linker.buildReference(s,r,i,n):a=n,e){case"=":{s[r]=a;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(a)}}assignWithoutOverride(e,r){for(let[n,i]of Object.entries(r)){let o=e[n];o===void 0?e[n]=i:Array.isArray(o)&&Array.isArray(i)&&(i.push(...o),e[n]=i)}return e}get definitionErrors(){return this.wrapper.definitionErrors}},LT=class{buildMismatchTokenMessage(e){return vo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return vo.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return vo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return vo.buildEarlyExitMessage(e)}},El=class extends LT{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},xm=class extends Tm{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e);return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(CD(e.name),this.startImplementation(r).bind(this));return e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i){this.before(n),this.wrapper.wrapSubrule(e,r,i),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},a3={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new El},MT=class extends _l{constructor(e,r){let n=r&&"maxLookahead"in r;super(e,Object.assign(Object.assign(Object.assign({},a3),{lookaheadStrategy:n?new To({maxLookahead:r.maxLookahead}):new Cl}),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}};var Pl=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function bm(t){throw new Error("Error! The input value was not handled.")}function Sm(t,e,r){return c3({parser:e,tokens:r,rules:new Map,ruleNames:new Map},t),e}function c3(t,e){let r=Ia(e,!1),n=xe(e.rules).filter(Q).filter(i=>r.has(i));for(let i of n){let o=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});o.rules.set(i.name,t.parser.rule(i,Vs(o,i.definition)))}}function Vs(t,e,r=!1){let n;if(Ot(e))n=h3(t,e);else if(Xe(e))n=u3(t,e);else if(Fe(e))n=Vs(t,e.terminal);else if(Rr(e))n=ED(t,e);else if(Ye(e))n=l3(t,e);else if(mn(e))n=d3(t,e);else if(hn(e))n=p3(t,e);else if(fr(e))n=m3(t,e);else throw new Pl(e.$cstNode,`Unexpected element type: ${e.$type}`);return PD(t,r?void 0:_m(e),n,e.cardinality)}function u3(t,e){let r=si(e);return()=>t.parser.action(r,e)}function l3(t,e){let r=e.rule.ref;if(Q(r)){let n=t.subrule++,i=e.arguments.length>0?f3(r,e.arguments):()=>({});return o=>t.parser.subrule(n,AD(t,r),e,i(o))}else if(We(r)){let n=t.consume++,i=$T(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)bm(r);else throw new Pl(e.$cstNode,`Undefined rule type: ${e.$type}`)}function f3(t,e){let r=e.map(n=>Ro(n.value));return n=>{let i={};for(let o=0;o<r.length;o++){let s=t.parameters[o],a=r[o];i[s.name]=a(n)}return i}}function Ro(t){if(nk(t)){let e=Ro(t.left),r=Ro(t.right);return n=>e(n)||r(n)}else if(tk(t)){let e=Ro(t.left),r=Ro(t.right);return n=>e(n)&&r(n)}else if(ck(t)){let e=Ro(t.value);return r=>!e(r)}else if(ba(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(sk(t)){let e=!!t.true;return()=>e}bm(t)}function d3(t,e){if(e.elements.length===1)return Vs(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:Vs(t,i,!0)},s=_m(i);s&&(o.GATE=Ro(s)),r.push(o)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(o=>{let s={ALT:()=>o.ALT(i)},a=o.GATE;return a&&(s.GATE=()=>a(i)),s}))}}function p3(t,e){if(e.elements.length===1)return Vs(t,e.elements[0]);let r=[];for(let a of e.elements){let c={ALT:Vs(t,a,!0)},u=_m(a);u&&(c.GATE=Ro(u)),r.push(c)}let n=t.or++,i=(a,c)=>{let u=c.getRuleStack().join("-");return`uGroup_${a}_${u}`},o=a=>t.parser.alternatives(n,r.map((c,u)=>{let l={ALT:()=>!0},f=t.parser;l.ALT=()=>{if(c.ALT(a),!f.isRecording()){let T=i(n,f);f.unorderedGroups.get(T)||f.unorderedGroups.set(T,[]);let C=f.unorderedGroups.get(T);typeof C?.[u]>"u"&&(C[u]=!0)}};let g=c.GATE;return g?l.GATE=()=>g(a):l.GATE=()=>{let T=f.unorderedGroups.get(i(n,f));return!T?.[u]},l})),s=PD(t,_m(e),o,"*");return a=>{s(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function m3(t,e){let r=e.elements.map(n=>Vs(t,n));return n=>r.forEach(i=>i(n))}function _m(t){if(fr(t))return t.guardCondition}function ED(t,e,r=e.terminal){if(r)if(Ye(r)&&Q(r.rule.ref)){let n=t.subrule++;return i=>t.parser.subrule(n,AD(t,r.rule.ref),e,i)}else if(Ye(r)&&We(r.rule.ref)){let n=t.consume++,i=$T(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Ot(r)){let n=t.consume++,i=$T(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let n=Xu(e.type.ref),i=n?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+si(e.type.ref));return ED(t,e,i)}}function h3(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function PD(t,e,r,n){let i=e&&Ro(e);if(!n)if(i){let o=t.or++;return s=>t.parser.alternatives(o,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:dm(),GATE:()=>!i(s)}])}else return r;if(n==="*"){let o=t.many++;return s=>t.parser.many(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){let o=t.many++;if(i){let s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(o,{DEF:()=>r(a)}),GATE:()=>i(a)},{ALT:dm(),GATE:()=>!i(a)}])}else return s=>t.parser.atLeastOne(o,{DEF:()=>r(s)})}else if(n==="?"){let o=t.optional++;return s=>t.parser.optional(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else bm(n)}function AD(t,e){let r=g3(t,e),n=t.rules.get(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function g3(t,e){if(Q(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Q(n);)(fr(n)||mn(n)||hn(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function $T(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function DD(t){let e=t.Grammar,r=t.parser.Lexer,n=new xm(t);return Sm(e,n,r.definition),n.finalize(),n}function ND(t){let e=y3(t);return e.finalize(),e}function y3(t){let e=t.Grammar,r=t.parser.Lexer,n=new Rm(t);return Sm(e,n,r.definition)}var km=class{buildTokens(e,r){let n=xe(Ia(e,!1)),i=this.buildTerminalTokens(n),o=this.buildKeywordTokens(n,i,r);return i.forEach(s=>{let a=s.PATTERN;typeof a=="object"&&a&&"test"in a&&gv(a)?o.unshift(s):o.push(s)}),o}buildTerminalTokens(e){return e.filter(We).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=Ln(e),n=r.flags.includes("u")?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n,LINE_BREAKS:!0};return e.hidden&&(i.GROUP=gv(r)?Mt.SKIPPED:"hidden"),i}regexPatternFunction(e){let r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Q).flatMap(i=>yt(i).filter(Ot)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){return{name:e.value,PATTERN:this.buildKeywordPattern(e,n),LONGER_ALT:this.findLongerAlt(e,r)}}buildKeywordPattern(e,r){return r?new RegExp(sw(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&aw("^"+o.source+"$",e.value)&&n.push(i),n},[])}};var wm=class{convert(e,r){let n=r.grammarSource;if(Rr(n)&&(n=Cd(n)),Ye(n)){let i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return x3(r);case"STRING":return v3(r);case"ID":return R3(r)}switch((i=Ms(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return S3(r);case"boolean":return k3(r);case"bigint":return b3(r);case"date":return _3(r);default:return r}}};function v3(t){let e="";for(let r=1;r<t.length-1;r++){let n=t.charAt(r);if(n==="\\"){let i=t.charAt(++r);e+=T3(i)}else e+=n}return e}function T3(t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return`
191
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return t}}function R3(t){return t.charAt(0)==="^"?t.substring(1):t}function x3(t){return parseInt(t)}function b3(t){return BigInt(t)}function _3(t){return new Date(t)}function S3(t){return Number(t)}function k3(t){return t.toLowerCase()==="true"}var ID=De(ze(),1);var Cm=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=ID.CancellationToken.None){for(let n of to(e.parseResult.value))await vt(r),rd(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if(n._ref===void 0)try{let i=this.getCandidate(e);if(ya(i))n._ref=i;else if(n._nodeDescription=i,this.langiumDocuments().hasDocument(i.documentUri)){let o=this.loadAstNode(i);n._ref=o??this.createLinkingError(e,i)}}catch(i){n._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${i}`})}r.references.push(n)}unlink(e){for(let r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){let n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,r,n,i){let o=this,s={$refNode:n,$refText:i,get ref(){var a;if(Yt(this._ref))return this._ref;if(jS(this._nodeDescription)){let c=o.loadAstNode(this._nodeDescription);this._ref=c??o.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){let c=o.getLinkedNode({reference:s,container:e,property:r});if(c.error&&Te(e).state<Qe.ComputedScopes)return;this._ref=(a=c.node)!==null&&a!==void 0?a:c.error,this._nodeDescription=c.descr}return Yt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return ya(this._ref)?this._ref:void 0}};return s}getLinkedNode(e){try{let r=this.getCandidate(e);if(ya(r))return{error:r};let n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`})}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getOrCreateDocument(e.documentUri);return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){let n=Te(e.container);n.state<Qe.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}};function LD(t){return typeof t.$comment=="string"}function OD(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}var Em=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){let n=r?.replacer,i=(s,a)=>this.replacer(s,a,r);return JSON.stringify(e,n?(s,a)=>n(s,a,i):i,r?.space)}deserialize(e){let r=JSON.parse(e);return this.linkNode(r,r),r}replacer(e,r,{refText:n,sourceText:i,textRegions:o,comments:s}={}){var a,c,u;if(!this.ignoreProperties.has(e))if(Qi(r)){let l=r.ref,f=n?r.$refText:void 0;return l?{$refText:f,$ref:"#"+(l&&this.astNodeLocator.getAstNodePath(l))}:{$refText:f,$error:(c=(a=r.error)===null||a===void 0?void 0:a.message)!==null&&c!==void 0?c:"Could not resolve reference"}}else{let l;if(o&&Yt(r)&&(l=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&l?.$textRegion))try{l.$textRegion.documentURI=Te(r).uri.toString()}catch{}return i&&!e&&Yt(r)&&(l??(l=Object.assign({},r)),l.$sourceText=(u=r.$cstNode)===null||u===void 0?void 0:u.text),s&&Yt(r)&&(l??(l=Object.assign({},r)),l.$comment=this.commentProvider.getComment(r)),l??r}}addAstNodeRegionWithAssignmentsTo(e){let r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(o=>!o.startsWith("$")).forEach(o=>{let s=Io(e.$cstNode,o).map(r);s.length!==0&&(i[o]=s)}),e}}linkNode(e,r,n,i,o){for(let[a,c]of Object.entries(e))if(Array.isArray(c))for(let u=0;u<c.length;u++){let l=c[u];OD(l)?c[u]=this.reviveReference(e,a,r,l):Yt(l)&&this.linkNode(l,r,e,a,u)}else OD(c)?e[a]=this.reviveReference(e,a,r,c):Yt(c)&&this.linkNode(c,r,e,a);let s=e;s.$container=n,s.$containerProperty=i,s.$containerIndex=o}reviveReference(e,r,n,i){let o=i.$refText;if(i.$ref){let s=this.getRefNode(n,i.$ref);return o||(o=this.nameProvider.getName(s)),{$refText:o??"",ref:s}}else if(i.$error){let s={$refText:o??""};return s.error={container:e,property:r,message:i.$error,reference:s},s}else return}getRefNode(e,r){return this.astNodeLocator.getAstNode(e,r.substring(1))}};var Pm=class{register(e){if(!this.singleton&&!this.map){this.singleton=e;return}if(!this.map&&(this.map={},this.singleton)){for(let r of this.singleton.LanguageMetaData.fileExtensions)this.map[r]=this.singleton;this.singleton=void 0}for(let r of e.LanguageMetaData.fileExtensions)this.map[r]!==void 0&&this.map[r]!==e&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${e.LanguageMetaData.languageId}'.`),this.map[r]=e}getServices(e){if(this.singleton!==void 0)return this.singleton;if(this.map===void 0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let r=Le.extname(e),n=this.map[r];if(!n)throw new Error(`The service registry contains no services for the extension '${r}'.`);return n}get all(){return this.singleton!==void 0?[this.singleton]:this.map!==void 0?Object.values(this.map):[]}};var MD=De(ze(),1);var Am=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n=Te(e)){r??(r=this.nameProvider.getName(e));let i=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${i} has no name.`);let o,s=()=>{var a;return o??(o=Nr((a=this.nameProvider.getNameNode(e))!==null&&a!==void 0?a:e.$cstNode))};return{node:e,name:r,get nameSegment(){return s()},selectionSegment:Nr(e.$cstNode),type:e.$type,documentUri:n.uri,path:i}}},Dm=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=MD.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of to(i))await vt(r),rd(o).filter(s=>!ya(s)).forEach(s=>{let a=this.createDescription(s);a&&n.push(a)});return n}createDescription(e){let r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;let i=Te(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:Nr(n),local:Le.equals(r.documentUri,i)}}};var Nm=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let s=o.indexOf(this.indexSeparator);if(s>0){let a=o.substring(0,s),c=parseInt(o.substring(s+1)),u=i[a];return u?.[c]}return i[o]},e)}};var $D=De(Vt(),1),Im=class{constructor(e){this.settings={},this.workspaceConfig=!1,this.initialized=!1,this.serviceRegistry=e.ServiceRegistry,this.connection=e.lsp.Connection,e.lsp.LanguageServer.onInitialize(r=>{var n,i;this.workspaceConfig=(i=(n=r.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&i!==void 0?i:!1}),e.lsp.LanguageServer.onInitialized(r=>{var n;let i=this.serviceRegistry.all;(n=e.lsp.Connection)===null||n===void 0||n.client.register($D.DidChangeConfigurationNotification.type,{section:i.map(o=>this.toSectionName(o.LanguageMetaData.languageId))})})}async initialize(){if(this.workspaceConfig&&this.connection){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await this.connection.workspace.getConfiguration(r);r.forEach((i,o)=>{this.updateSectionConfiguration(i.section,n[o])})}this.initialized=!0}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{this.updateSectionConfiguration(r,e.settings[r])})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){this.initialized||await this.initialize();let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}};var Lc=De(ze(),1);var Om=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ve,this.buildState=new Map,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Lc.CancellationToken.None){var i,o;for(let s of e){let a=s.uri.toString();if(s.state===Qe.Validated){if(typeof r.validation=="boolean"&&r.validation)s.state=Qe.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(a);else if(typeof r.validation=="object"){let c=this.buildState.get(a),u=(i=c?.result)===null||i===void 0?void 0:i.validationChecks;if(u){let f=((o=r.validation.categories)!==null&&o!==void 0?o:Aa.all).filter(g=>!u.includes(g));f.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:f})},result:c.result}),s.state=Qe.IndexedReferences)}}}else this.buildState.delete(a)}await this.buildDocuments(e,r,n)}async update(e,r,n=Lc.CancellationToken.None){for(let s of r)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString());this.indexManager.remove(r);for(let s of e)this.langiumDocuments.invalidateDocument(s)||this.langiumDocuments.getOrCreateDocument(s),this.buildState.delete(s.toString());let i=xe(e).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!i.has(s.uri.toString())&&this.shouldRelink(s,i)).forEach(s=>{this.serviceRegistry.getServices(s.uri).references.Linker.unlink(s),s.state=Math.min(s.state,Qe.ComputedScopes),s.diagnostics=void 0});for(let s of this.updateListeners)s(e,r);await vt(n);let o=this.langiumDocuments.all.filter(s=>{var a;return s.state<Qe.Linked||!(!((a=this.buildState.get(s.uri.toString()))===null||a===void 0)&&a.completed)}).toArray();await this.buildDocuments(o,this.updateBuildOptions,n)}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Lc.Disposable.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Qe.Parsed,n,o=>{this.langiumDocumentFactory.update(o)}),await this.runCancelable(e,Qe.IndexedContent,n,o=>this.indexManager.updateContent(o,n)),await this.runCancelable(e,Qe.ComputedScopes,n,async o=>{let s=this.serviceRegistry.getServices(o.uri).references.ScopeComputation;o.precomputedScopes=await s.computeLocalScopes(o,n)}),await this.runCancelable(e,Qe.Linked,n,o=>this.serviceRegistry.getServices(o.uri).references.Linker.link(o,n)),await this.runCancelable(e,Qe.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));let i=e.filter(o=>this.shouldValidate(o));await this.runCancelable(i,Qe.Validated,n,o=>this.validate(o,n));for(let o of e){let s=this.buildState.get(o.uri.toString());s&&(s.completed=!0)}}prepareBuild(e,r){for(let n of e){let i=n.uri.toString(),o=this.buildState.get(i);(!o||o.completed)&&this.buildState.set(i,{completed:!1,options:r,result:o?.result})}}async runCancelable(e,r,n,i){let o=e.filter(s=>s.state<r);for(let s of o)await vt(n),await i(s),s.state=r;await this.notifyBuildPhase(o,r,n)}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Lc.Disposable.create(()=>{this.buildPhaseListeners.delete(e,r)})}async notifyBuildPhase(e,r,n){if(e.length===0)return;let i=this.buildPhaseListeners.get(r);for(let o of i)await vt(n),await o(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;let o=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,a=typeof s=="object"?s:void 0,c=await o.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...c):e.diagnostics=c;let u=this.buildState.get(e.uri.toString());if(u){(n=u.result)!==null&&n!==void 0||(u.result={});let l=(i=a?.categories)!==null&&i!==void 0?i:Aa.all;u.result.validationChecks?u.result.validationChecks.push(...l):u.result.validationChecks=[...l]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}};var FT=De(ze(),1);var Lm=class{constructor(e){this.simpleIndex=new Map,this.simpleTypeIndex=new Rd,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=Te(e).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(s=>{Le.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),xe(i)}allElements(e,r){let n=xe(this.simpleIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.simpleTypeIndex.get(e,r,()=>{var o;return((o=this.simpleIndex.get(e))!==null&&o!==void 0?o:[]).filter(a=>this.astReflection.isSubtype(a.type,r))}):(n=this.simpleIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){for(let r of e){let n=r.toString();this.simpleIndex.delete(n),this.simpleTypeIndex.clear(n),this.referenceIndex.delete(n)}}async updateContent(e,r=FT.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r);for(let s of i)s.node=void 0;let o=e.uri.toString();this.simpleIndex.set(o,i),this.simpleTypeIndex.clear(o)}async updateReferences(e,r=FT.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}};var FD=De(ze(),1);var Mm=class{constructor(e){this.initialBuildOptions={},this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.MutexLock,e.lsp.LanguageServer.onInitialize(r=>{var n;this.folders=(n=r.workspaceFolders)!==null&&n!==void 0?n:void 0}),e.lsp.LanguageServer.onInitialized(r=>{this.mutex.lock(n=>{var i;return this.initializeWorkspace((i=this.folders)!==null&&i!==void 0?i:[],n)})})}async initializeWorkspace(e,r=FD.CancellationToken.None){let n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),i=[],o=s=>{i.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(e,o),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,o))),await vt(r),await this.documentBuilder.build(i,this.initialBuildOptions,r)}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return _r.parse(e.uri)}async traverseFolder(e,r,n,i){let o=await this.fileSystemProvider.readDirectory(r);await Promise.all(o.map(async s=>{if(this.includeEntry(e,s,n)){if(s.isDirectory)await this.traverseFolder(e,s.uri,n,i);else if(s.isFile){let a=this.langiumDocuments.getOrCreateDocument(s.uri);i(a)}}}))}includeEntry(e,r,n){let i=Le.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){let o=Le.extname(r.uri);return n.includes(o)}return!1}};var $m=class{constructor(e){let r=e.parser.TokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);let n=qD(r)?Object.values(r):r;this.chevrotainLexer=new Mt(n,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e){var r;let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:(r=n.groups.hidden)!==null&&r!==void 0?r:[]}}toTokenTypeDictionary(e){if(qD(e))return e;let r=jD(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function w3(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function jD(t){return t&&"modes"in t&&"defaultMode"in t}function qD(t){return!w3(t)&&!jD(t)}var qe=De(ze(),1);function HD(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=qe.Position.create(0,0));let o=BD(t),s=UT(n),a=E3({lines:o,position:i,options:s});return I3({index:0,tokens:a,position:i})}function GD(t,e){let r=UT(e),n=BD(t);if(n.length===0)return!1;let i=n[0],o=n[n.length-1],s=r.start,a=r.end;return!!s?.exec(i)&&!!a?.exec(o)}function BD(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Lu)}var UD=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,C3=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function E3(t){var e,r,n;let i=[],o=t.position.line,s=t.position.character;for(let a=0;a<t.lines.length;a++){let c=a===0,u=a===t.lines.length-1,l=t.lines[a],f=0;if(c&&t.options.start){let T=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);T&&(f=T.index+T[0].length)}else{let T=(r=t.options.line)===null||r===void 0?void 0:r.exec(l);T&&(f=T.index+T[0].length)}if(u){let T=(n=t.options.end)===null||n===void 0?void 0:n.exec(l);T&&(l=l.substring(0,T.index))}if(l=l.substring(0,N3(l)),jT(l,0)>=l.length){if(i.length>0){let T=qe.Position.create(o,s);i.push({type:"break",content:"",range:qe.Range.create(T,T)})}}else{UD.lastIndex=f;let T=UD.exec(l);if(T){let C=T[0],P=T[1],O=qe.Position.create(o,s+f),E=qe.Position.create(o,s+f+C.length);i.push({type:"tag",content:P,range:qe.Range.create(O,E)}),f+=C.length,f=jT(l,f)}if(f<l.length){let C=l.substring(f),P=Array.from(C.matchAll(C3));i.push(...P3(P,C,o,s+f))}}o++,s=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function P3(t,e,r,n){let i=[];if(t.length===0){let o=qe.Position.create(r,n),s=qe.Position.create(r,n+e.length);i.push({type:"text",content:e,range:qe.Range.create(o,s)})}else{let o=0;for(let a of t){let c=a.index,u=e.substring(o,c);u.length>0&&i.push({type:"text",content:e.substring(o,c),range:qe.Range.create(qe.Position.create(r,o+n),qe.Position.create(r,c+n))});let l=u.length+1,f=a[1];if(i.push({type:"inline-tag",content:f,range:qe.Range.create(qe.Position.create(r,o+l+n),qe.Position.create(r,o+l+f.length+n))}),l+=f.length,a.length===4){l+=a[2].length;let g=a[3];i.push({type:"text",content:g,range:qe.Range.create(qe.Position.create(r,o+l+n),qe.Position.create(r,o+l+g.length+n))})}else i.push({type:"text",content:"",range:qe.Range.create(qe.Position.create(r,o+l+n),qe.Position.create(r,o+l+n))});o=c+a[0].length}let s=e.substring(o);s.length>0&&i.push({type:"text",content:s,range:qe.Range.create(qe.Position.create(r,o+n),qe.Position.create(r,o+n+s.length))})}return i}var A3=/\S/,D3=/\s*$/;function jT(t,e){let r=t.substring(e).match(A3);return r?e+r.index:t.length}function N3(t){let e=t.match(D3);if(e&&typeof e.index=="number")return e.index}function I3(t){var e,r,n,i;let o=qe.Position.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Fm([],qe.Range.create(o,o));let s=[];for(;t.index<t.tokens.length;){let u=O3(t,s[s.length-1]);u&&s.push(u)}let a=(r=(e=s[0])===null||e===void 0?void 0:e.range.start)!==null&&r!==void 0?r:o,c=(i=(n=s[s.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:o;return new Fm(s,qe.Range.create(a,c))}function O3(t,e){let r=t.tokens[t.index];if(r.type==="tag")return zD(t,!1);if(r.type==="text"||r.type==="inline-tag")return KD(t);L3(r,e),t.index++}function L3(t,e){if(e){let r=new qm("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function KD(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(M3(t)),n=e,e=t.tokens[t.index];return new Dl(i,qe.Range.create(r.range.start,n.range.end))}function M3(t){return t.tokens[t.index].type==="inline-tag"?zD(t,!0):VD(t)}function zD(t,e){let r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){let o=VD(t);return new Al(n,new Dl([o],o.range),e,qe.Range.create(r.range.start,o.range.end))}else{let o=KD(t);return new Al(n,o,e,qe.Range.create(r.range.start,o.range.end))}else{let o=r.range;return new Al(n,new Dl([],o),e,o)}}function VD(t){let e=t.tokens[t.index++];return new qm(e.content,e.range)}function UT(t){if(!t)return UT({start:"/**",end:"*/",line:"*"});let{start:e,end:r,line:n}=t;return{start:qT(e,!0),end:qT(r,!1),line:qT(n,!0)}}function qT(t,e){if(typeof t=="string"||typeof t=="object"){let r=typeof t=="string"?io(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}var Fm=class{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(let r of this.elements)if(e.length===0)e=r.toString();else{let n=r.toString();e+=WD(e)+n}return e.trim()}toMarkdown(e){let r="";for(let n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{let i=n.toMarkdown(e);r+=WD(r)+i}return r.trim()}},Al=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
192
+ ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){let r=this.content.toMarkdown(e);if(this.inline){let o=$3(this.name,r,e??{});if(typeof o=="string")return o}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \u2014 ${r}`:this.content.inlines.length>1&&(i=`${i}
193
+ ${r}`),this.inline?`{${i}}`:i}};function $3(t,e,r){var n,i;if(t==="linkplain"||t==="linkcode"||t==="link"){let o=e.indexOf(" "),s=e;if(o>0){let c=jT(e,o);s=e.substring(c),e=e.substring(0,o)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),(i=(n=r.renderLink)===null||n===void 0?void 0:n.call(r,e,s))!==null&&i!==void 0?i:F3(e,s)}}function F3(t,e){try{return _r.parse(t,!0),`[${e}](${t})`}catch{return t}}var Dl=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){let n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
192
194
  `)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){let i=this.inlines[n],o=this.inlines[n+1];r+=i.toMarkdown(e),o&&o.range.start.line>i.range.start.line&&(r+=`
193
- `)}return r}},Cm=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function VE(t){return t.endsWith(`
195
+ `)}return r}},qm=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function WD(t){return t.endsWith(`
194
196
  `)?`
195
197
  `:`
196
198
 
197
- `}var wm=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&YE(r))return XE(r).toMarkdown({renderLink:(i,o)=>this.documentationLinkRenderer(e,i,o)})}documentationLinkRenderer(e,r,n){var i;let o=(i=this.findNameInPrecomputedScopes(e,r))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,r);if(o&&o.nameSegment){let s=o.nameSegment.range.start.line+1,a=o.nameSegment.range.start.character+1,c=o.documentUri.with({fragment:`L${s},${a}`});return`[${n}](${c.toString()})`}else return}findNameInPrecomputedScopes(e,r){let i=Se(e).precomputedScopes;if(!i)return;let o=e;do{let a=i.get(o).find(c=>c.name===r);if(a)return a;o=o.$container}while(o)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}};var Dm=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return UE(e)?e.$comment:(r=Qb(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||r===void 0?void 0:r.text}};function Wu(t){return{documentation:{CommentProvider:e=>new Dm(e),DocumentationProvider:e=>new wm(e)},parser:{GrammarConfig:e=>hk(e),LangiumParser:e=>qE(e),CompletionParser:e=>$E(e),ValueConverter:()=>new pm,TokenBuilder:()=>new dm,Lexer:e=>new Sm(e),ParserErrorMessageProvider:()=>new hl},lsp:{CompletionProvider:e=>new Ua(e),DocumentSymbolProvider:e=>new wd(e),HoverProvider:e=>new Ed(e),FoldingRangeProvider:e=>new Ha(e),ReferencesProvider:e=>new Ld(e),DefinitionProvider:e=>new Ka(e),DocumentHighlightProvider:e=>new Cd(e),RenameProvider:e=>new Md(e)},workspace:{AstNodeLocator:()=>new Tm,AstNodeDescriptionProvider:e=>new ym(e),ReferenceDescriptionProvider:e=>new vm(e)},references:{Linker:e=>new mm(e),NameProvider:()=>new wa,ScopeProvider:e=>new Fa(e),ScopeComputation:e=>new qa(e),References:e=>new Ga(e)},serializer:{JsonSerializer:e=>new hm(e)},validation:{DocumentValidator:e=>new fd(e),ValidationRegistry:e=>new rd(e)},shared:()=>t.shared}}function Hu(t){return{ServiceRegistry:()=>new gm,lsp:{Connection:()=>t.connection,LanguageServer:e=>new Nd(e),WorkspaceSymbolProvider:e=>new $d(e),NodeKindProvider:()=>new Id,FuzzyMatcher:()=>new Dd},workspace:{LangiumDocuments:e=>new Ad(e),LangiumDocumentFactory:e=>new Pd(e),DocumentBuilder:e=>new xm(e),TextDocuments:()=>new tP.TextDocuments(ha),IndexManager:e=>new bm(e),WorkspaceManager:e=>new _m(e),FileSystemProvider:e=>t.fileSystemProvider(e),MutexLock:()=>new td,ConfigurationProvider:e=>new Rm(e)}}}var hs=Ie(sN(),1);var G3="Command";var B3="Event";var K3="State";var Ul=class extends ks{getAllTypes(){return["Command","Event","State","Statemachine","Transition"]}computeIsSubtype(e,r){switch(e){default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"State:actions":return G3;case"Statemachine:init":case"Transition:state":return K3;case"Transition:event":return B3;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"State":return{name:"State",mandatory:[{name:"actions",type:"array"},{name:"transitions",type:"array"}]};case"Statemachine":return{name:"Statemachine",mandatory:[{name:"commands",type:"array"},{name:"events",type:"array"},{name:"states",type:"array"}]};default:return{name:e,mandatory:[]}}}},TTe=new Ul;var bh,aN=()=>bh??(bh=ed(`{
199
+ `}var jm=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&GD(r))return HD(r).toMarkdown({renderLink:(i,o)=>this.documentationLinkRenderer(e,i,o)})}documentationLinkRenderer(e,r,n){var i;let o=(i=this.findNameInPrecomputedScopes(e,r))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,r);if(o&&o.nameSegment){let s=o.nameSegment.range.start.line+1,a=o.nameSegment.range.start.character+1,c=o.documentUri.with({fragment:`L${s},${a}`});return`[${n}](${c.toString()})`}else return}findNameInPrecomputedScopes(e,r){let i=Te(e).precomputedScopes;if(!i)return;let o=e;do{let a=i.get(o).find(c=>c.name===r);if(a)return a;o=o.$container}while(o)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}};var Um=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return LD(e)?e.$comment:(r=KS(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||r===void 0?void 0:r.text}};function tl(t){return{documentation:{CommentProvider:e=>new Um(e),DocumentationProvider:e=>new jm(e)},parser:{GrammarConfig:e=>uC(e),LangiumParser:e=>ND(e),CompletionParser:e=>DD(e),ValueConverter:()=>new wm,TokenBuilder:()=>new km,Lexer:e=>new $m(e),ParserErrorMessageProvider:()=>new El},lsp:{CompletionProvider:e=>new Wa(e),DocumentSymbolProvider:e=>new jd(e),HoverProvider:e=>new Wd(e),FoldingRangeProvider:e=>new Ga(e),ReferencesProvider:e=>new Vd(e),DefinitionProvider:e=>new za(e),DocumentHighlightProvider:e=>new qd(e),RenameProvider:e=>new Xd(e)},workspace:{AstNodeLocator:()=>new Nm,AstNodeDescriptionProvider:e=>new Am(e),ReferenceDescriptionProvider:e=>new Dm(e)},references:{Linker:e=>new Cm(e),NameProvider:()=>new Ea,ScopeProvider:e=>new ja(e),ScopeComputation:e=>new qa(e),References:e=>new Ba(e)},serializer:{JsonSerializer:e=>new Em(e)},validation:{DocumentValidator:e=>new Sd(e),ValidationRegistry:e=>new hd(e)},shared:()=>t.shared}}function rl(t){return{ServiceRegistry:()=>new Pm,lsp:{Connection:()=>t.connection,LanguageServer:e=>new Bd(e),WorkspaceSymbolProvider:e=>new Yd(e),NodeKindProvider:()=>new Kd,FuzzyMatcher:()=>new Ud},workspace:{LangiumDocuments:e=>new Gd(e),LangiumDocumentFactory:e=>new Hd(e),DocumentBuilder:e=>new Om(e),TextDocuments:()=>new XD.TextDocuments(ga),IndexManager:e=>new Lm(e),WorkspaceManager:e=>new Mm(e),FileSystemProvider:e=>t.fileSystemProvider(e),MutexLock:()=>new md,ConfigurationProvider:e=>new Im(e)}}}var ps=De(dL(),1);var q8="Command";var j8="Event";var U8="State";var Zl=class extends ks{getAllTypes(){return["Command","Event","State","Statemachine","Transition"]}computeIsSubtype(e,r){switch(e){default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"State:actions":return q8;case"Statemachine:init":case"Transition:state":return U8;case"Transition:event":return j8;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"State":return{name:"State",mandatory:[{name:"actions",type:"array"},{name:"transitions",type:"array"}]};case"Statemachine":return{name:"Statemachine",mandatory:[{name:"commands",type:"array"},{name:"events",type:"array"},{name:"states",type:"array"}]};default:return{name:e,mandatory:[]}}}},vxe=new Zl;var ag,pL=()=>ag??(ag=pd(`{
198
200
  "$type": "Grammar",
199
201
  "isDeclared": true,
200
202
  "name": "Statemachine",
@@ -518,7 +520,7 @@ ${r}`),this.inline?`{${i}}`:i}};function NK(t,e,r){var n,i;if(t==="linkplain"||t
518
520
  "interfaces": [],
519
521
  "types": [],
520
522
  "usedGrammars": []
521
- }`));var z3={languageId:"statemachine",fileExtensions:[".statemachine"],caseInsensitive:!1},cN={AstReflection:()=>new Ul},uN={Grammar:()=>aN(),LanguageMetaData:()=>z3,parser:{}};function lN(t){let e=t.validation.ValidationRegistry,r=t.validation.StatemachineValidator,n={State:r.checkStateNameStartsWithCapital,Statemachine:r.checkUniqueStatesAndEvents};e.register(n,r)}var _h=class{checkStateNameStartsWithCapital(e,r){if(e.name){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","State name should start with a capital letter.",{node:e,property:"name"})}}checkUniqueStatesAndEvents(e,r){let n=new Ye,i=[...e.states,...e.events];for(let o of i)n.add(o.name,o);for(let[o,s]of n.entriesGroupedByKey())if(s.length>1)for(let a of s)r("error",`Duplicate identifier name: ${o}`,{node:a,property:"name"})}};var V3={validation:{StatemachineValidator:()=>new _h}};function fN(t){let e=ws(Hu(t),cN),r=ws(Wu({shared:e}),uN,V3);return e.ServiceRegistry.register(r),lN(r),{shared:e,statemachine:r}}var X3=new hs.BrowserMessageReader(self),Y3=new hs.BrowserMessageWriter(self),dN=(0,hs.createConnection)(X3,Y3),{shared:pN,statemachine:J3}=fN(Object.assign({connection:dN},Wd));tk(pN);var Q3=new hs.NotificationType("browser/DocumentChange"),Z3=J3.serializer.JsonSerializer;pN.workspace.DocumentBuilder.onBuildPhase(nt.Validated,t=>{var e;for(let r of t){let n=Z3.serialize(r.parseResult.value);dN.sendNotification(Q3,{uri:r.uri.toString(),content:n,diagnostics:(e=r.diagnostics)!==null&&e!==void 0?e:[]})}});})();
523
+ }`));var W8={languageId:"statemachine",fileExtensions:[".statemachine"],caseInsensitive:!1},mL={AstReflection:()=>new Zl},hL={Grammar:()=>pL(),LanguageMetaData:()=>W8,parser:{}};function gL(t){let e=t.validation.ValidationRegistry,r=t.validation.StatemachineValidator,n={State:r.checkStateNameStartsWithCapital,Statemachine:r.checkUniqueStatesAndEvents};e.register(n,r)}var cg=class{checkStateNameStartsWithCapital(e,r){if(e.name){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","State name should start with a capital letter.",{node:e,property:"name"})}}checkUniqueStatesAndEvents(e,r){let n=new Ve,i=[...e.states,...e.events];for(let o of i)n.add(o.name,o);for(let[o,s]of n.entriesGroupedByKey())if(s.length>1)for(let a of s)r("error",`Duplicate identifier name: ${o}`,{node:a,property:"name"})}};var H8={validation:{StatemachineValidator:()=>new cg}};function yL(t){let e=Cs(rl(t),mL),r=Cs(tl({shared:e}),hL,H8);return e.ServiceRegistry.register(r),gL(r),{shared:e,statemachine:r}}var G8=new ps.BrowserMessageReader(self),B8=new ps.BrowserMessageWriter(self),vL=(0,ps.createConnection)(G8,B8),{shared:TL,statemachine:K8}=yL(Object.assign({connection:vL},tp));Xw(TL);var z8=new ps.NotificationType("browser/DocumentChange"),V8=K8.serializer.JsonSerializer;TL.workspace.DocumentBuilder.onBuildPhase(Qe.Validated,t=>{var e;for(let r of t){let n=V8.serialize(r.parseResult.value);vL.sendNotification(z8,{uri:r.uri.toString(),content:n,diagnostics:(e=r.diagnostics)!==null&&e!==void 0?e:[]})}});})();
522
524
  /*! Bundled license information:
523
525
 
524
526
  lodash-es/lodash.js: