UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

126 lines 307 kB
import{A as se,B as Js,C as et,D as be,G as ol,I as Ve,L as ae,M as zt,O as ki,R as an,S as al,a as ue,b as gt,c as Ie,d as fe,e as te,g as yt,i as on,j as Vt,k as xt,l as de,m as Pt,n as I,o as Pe,p as Re,q as Tt,r as Ne,s as R,t as Se,w as sl,x as N,y as Ce,z as re}from"./chunk-BKDDFIKN.mjs";import{d as M}from"./chunk-YPUTD6PB.mjs";import{M as Ys,d as il,e as it,z as me}from"./chunk-6BY5RJGC.mjs";import{a as o,b as vi,c as jt,d as G,e as nl}from"./chunk-GTKDMUJJ.mjs";var wc=vi(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});var Sc;function Cc(){if(Sc===void 0)throw new Error("No runtime abstraction layer installed");return Sc}o(Cc,"RAL");(function(r){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Sc=t}o(e,"install"),r.install=e})(Cc||(Cc={}));_c.default=Cc});var ad=vi(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.stringArray=we.array=we.func=we.error=we.number=we.string=we.boolean=void 0;function ym(r){return r===!0||r===!1}o(ym,"boolean");we.boolean=ym;function sd(r){return typeof r=="string"||r instanceof String}o(sd,"string");we.string=sd;function xm(r){return typeof r=="number"||r instanceof Number}o(xm,"number");we.number=xm;function Tm(r){return r instanceof Error}o(Tm,"error");we.error=Tm;function Em(r){return typeof r=="function"}o(Em,"func");we.func=Em;function od(r){return Array.isArray(r)}o(od,"array");we.array=od;function Rm(r){return od(r)&&r.every(e=>sd(e))}o(Rm,"stringArray");we.stringArray=Rm});var Oc=vi(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.Emitter=Jr.Event=void 0;var Am=wc(),cd;(function(r){let e={dispose(){}};r.None=function(){return e}})(cd||(Jr.Event=cd={}));var Lc=class{static{o(this,"CallbackList")}add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:o(()=>this.remove(e,t),"dispose")})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===t){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 t=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,a=n.length;s<a;s++)try{t.push(n[s].apply(i[s],e))}catch(c){(0,Am.default)().console.error(c)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ds=class r{static{o(this,"Emitter")}constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{this._callbacks||(this._callbacks=new Lc),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let i={dispose:o(()=>{this._callbacks&&(this._callbacks.remove(e,t),i.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};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)}};Jr.Emitter=Ds;Ds._noop=function(){}});var ld=vi(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.CancellationTokenSource=Qr.CancellationToken=void 0;var vm=wc(),km=ad(),Pc=Oc(),Fs;(function(r){r.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Pc.Event.None}),r.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Pc.Event.None});function e(t){let n=t;return n&&(n===r.None||n===r.Cancelled||km.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}o(e,"is"),r.is=e})(Fs||(Qr.CancellationToken=Fs={}));var Im=Object.freeze(function(r,e){let t=(0,vm.default)().timer.setTimeout(r.bind(e),0);return{dispose(){t.dispose()}}}),Us=class{static{o(this,"MutableToken")}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?Im:(this._emitter||(this._emitter=new Pc.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},bc=class{static{o(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new Us),this._token}cancel(){this._token?this._token.cancel():this._token=Fs.Cancelled}dispose(){this._token?this._token instanceof Us&&this._token.dispose():this._token=Fs.None}};Qr.CancellationTokenSource=bc});var pe={};jt(pe,{AbstractAstReflection:()=>Kt,AbstractCstNode:()=>zn,AbstractLangiumParser:()=>Kn,AbstractParserErrorMessageProvider:()=>bs,AbstractThreadedAsyncParser:()=>Kc,AstUtils:()=>Fi,BiMap:()=>gr,Cancellation:()=>w,CompositeCstNodeImpl:()=>dr,ContextCache:()=>yr,CstNodeBuilder:()=>Vn,CstUtils:()=>Si,DONE_RESULT:()=>$e,DatatypeSymbol:()=>Ps,DefaultAstNodeDescriptionProvider:()=>ci,DefaultAstNodeLocator:()=>ui,DefaultAsyncParser:()=>Ei,DefaultCommentProvider:()=>Ti,DefaultConfigurationProvider:()=>fi,DefaultDocumentBuilder:()=>di,DefaultDocumentValidator:()=>ai,DefaultHydrator:()=>Ai,DefaultIndexManager:()=>hi,DefaultJsonSerializer:()=>ii,DefaultLangiumDocumentFactory:()=>Xn,DefaultLangiumDocuments:()=>Yn,DefaultLexer:()=>mi,DefaultLinker:()=>Jn,DefaultNameProvider:()=>Qn,DefaultReferenceDescriptionProvider:()=>li,DefaultReferences:()=>Zn,DefaultScopeComputation:()=>ei,DefaultScopeProvider:()=>ni,DefaultServiceRegistry:()=>si,DefaultTokenBuilder:()=>pr,DefaultValueConverter:()=>mr,DefaultWorkspaceLock:()=>Ri,DefaultWorkspaceManager:()=>pi,Deferred:()=>Ue,Disposable:()=>xr,DisposableCache:()=>rn,DocumentCache:()=>Bs,DocumentState:()=>Y,DocumentValidator:()=>wt,EMPTY_SCOPE:()=>Sm,EMPTY_STREAM:()=>ln,EmptyFileSystem:()=>Qc,EmptyFileSystemProvider:()=>qs,ErrorWithLocation:()=>Yt,GrammarAST:()=>pn,GrammarUtils:()=>Vi,JSDocDocumentationProvider:()=>xi,LangiumCompletionParser:()=>qn,LangiumParser:()=>Hn,LangiumParserErrorMessageProvider:()=>Yr,LeafCstNodeImpl:()=>fr,MapScope:()=>ti,Module:()=>Yc,MultiMap:()=>ft,OperationCancelled:()=>ut,ParserWorker:()=>Hc,Reduction:()=>Ar,RegExpUtils:()=>Wi,RootCstNodeImpl:()=>Xr,SimpleCache:()=>ri,StreamImpl:()=>Ke,StreamScope:()=>tn,TextDocument:()=>Zr,TreeStreamImpl:()=>st,URI:()=>We,UriUtils:()=>Ge,ValidationCategory:()=>sn,ValidationRegistry:()=>oi,ValueConverter:()=>lt,WorkspaceCache:()=>nn,assertUnreachable:()=>$t,createCompletionParser:()=>Ic,createDefaultCoreModule:()=>qc,createDefaultSharedCoreModule:()=>Xc,createGrammarConfig:()=>Sa,createLangiumParser:()=>Nc,delayNextTick:()=>Mc,diagnosticData:()=>Ws,eagerLoad:()=>_d,getDiagnosticRange:()=>Td,inject:()=>Hs,interruptAndCheck:()=>xe,isAstNode:()=>oe,isAstNodeDescription:()=>Qs,isAstNodeWithComment:()=>Fc,isCompositeCstNode:()=>ze,isIMultiModeLexerDefinition:()=>Gc,isJSDoc:()=>Vc,isLeafCstNode:()=>bt,isLinkingError:()=>Ht,isNamed:()=>yd,isOperationCancelled:()=>Gt,isReference:()=>Ae,isRootCstNode:()=>cn,isTokenTypeArray:()=>Ed,isTokenTypeDictionary:()=>Uc,loadGrammarFromJson:()=>Tr,parseJSDoc:()=>jc,prepareLangiumParser:()=>id,setInterruptionPeriod:()=>dd,startCancelableOperation:()=>fd,stream:()=>V,toDiagnosticSeverity:()=>js});var Si={};jt(Si,{DefaultNameRegexp:()=>Ni,RangeComparison:()=>Et,compareRange:()=>ll,findCommentNode:()=>ro,findDeclarationNodeAtOffset:()=>jd,findLeafNodeAtOffset:()=>no,findLeafNodeBeforeOffset:()=>ul,flattenCst:()=>Wd,getInteriorNodes:()=>Kd,getNextNode:()=>Vd,getPreviousNode:()=>dl,getStartlineNode:()=>zd,inRange:()=>to,isChildNode:()=>eo,isCommentNode:()=>Zs,streamCst:()=>qt,toDocumentSegment:()=>Xt,tokenToRange:()=>vr});function oe(r){return typeof r=="object"&&r!==null&&typeof r.$type=="string"}o(oe,"isAstNode");function Ae(r){return typeof r=="object"&&r!==null&&typeof r.$refText=="string"}o(Ae,"isReference");function Qs(r){return typeof r=="object"&&r!==null&&typeof r.name=="string"&&typeof r.type=="string"&&typeof r.path=="string"}o(Qs,"isAstNodeDescription");function Ht(r){return typeof r=="object"&&r!==null&&oe(r.container)&&Ae(r.reference)&&typeof r.message=="string"}o(Ht,"isLinkingError");var Kt=class{static{o(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,t){return oe(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[t];if(i!==void 0)return i;{let s=this.computeIsSubtype(e,t);return n[t]=s,s}}getAllSubTypes(e){let t=this.allSubtypes[e];if(t)return t;{let n=this.getAllTypes(),i=[];for(let s of n)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}};function ze(r){return typeof r=="object"&&r!==null&&Array.isArray(r.content)}o(ze,"isCompositeCstNode");function bt(r){return typeof r=="object"&&r!==null&&typeof r.tokenType=="object"}o(bt,"isLeafCstNode");function cn(r){return ze(r)&&typeof r.fullText=="string"}o(cn,"isRootCstNode");var Ke=class r{static{o(this,"StreamImpl")}constructor(e,t){this.startFn=e,this.nextFn=t}iterator(){let e={state:this.startFn(),next:o(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),t=0,n=e.next();for(;!n.done;)t++,n=e.next();return t}toArray(){let e=[],t=this.iterator(),n;do n=t.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,t){let n=this.map(i=>[e?e(i):i,t?t(i):i]);return new Map(n)}toString(){return this.join()}concat(e){let t=e[Symbol.iterator]();return new r(()=>({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=t.next(),!i.done)return i;while(!i.done);return $e})}join(e=","){let t=this.iterator(),n="",i,s=!1;do i=t.next(),i.done||(s&&(n+=e),n+=Bd(i.value)),s=!0;while(!i.done);return n}indexOf(e,t=0){let n=this.iterator(),i=0,s=n.next();for(;!s.done;){if(i>=t&&s.value===e)return i;s=n.next(),i++}return-1}every(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(!e(n.value))return!1;n=t.next()}return!0}some(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(e(n.value))return!0;n=t.next()}return!1}forEach(e){let t=this.iterator(),n=0,i=t.next();for(;!i.done;)e(i.value,n),i=t.next(),n++}map(e){return new r(this.startFn,t=>{let{done:n,value:i}=this.nextFn(t);return n?$e:{done:!1,value:e(i)}})}filter(e){return new r(this.startFn,t=>{let n;do if(n=this.nextFn(t),!n.done&&e(n.value))return n;while(!n.done);return $e})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,t){let n=this.iterator(),i=t,s=n.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=n.next();return i}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,n){let i=e.next();if(i.done)return n;let s=this.recursiveReduce(e,t,n);return s===void 0?i.value:t(s,i.value)}find(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(e(n.value))return n.value;n=t.next()}}findIndex(e){let t=this.iterator(),n=0,i=t.next();for(;!i.done;){if(e(i.value))return n;i=t.next(),n++}return-1}includes(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(n.value===e)return!0;n=t.next()}return!1}flatMap(e){return new r(()=>({this:this.startFn()}),t=>{do{if(t.iterator){let s=t.iterator.next();if(s.done)t.iterator=void 0;else return s}let{done:n,value:i}=this.nextFn(t.this);if(!n){let s=e(i);if(Ii(s))t.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(t.iterator);return $e})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let t=e>1?this.flat(e-1):this;return new r(()=>({this:t.startFn()}),n=>{do{if(n.iterator){let a=n.iterator.next();if(a.done)n.iterator=void 0;else return a}let{done:i,value:s}=t.nextFn(n.this);if(!i)if(Ii(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return $e})}head(){let t=this.iterator().next();if(!t.done)return t.value}tail(e=1){return new r(()=>{let t=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(t).done)return t;return t},this.nextFn)}limit(e){return new r(()=>({size:0,state:this.startFn()}),t=>(t.size++,t.size>e?$e:this.nextFn(t.state)))}distinct(e){let t=new Set;return this.filter(n=>{let i=e?e(n):n;return t.has(i)?!1:(t.add(i),!0)})}exclude(e,t){let n=new Set;for(let i of e){let s=t?t(i):i;n.add(s)}return this.filter(i=>{let s=t?t(i):i;return!n.has(s)})}};function Bd(r){return typeof r=="string"?r:typeof r>"u"?"undefined":typeof r.toString=="function"?r.toString():Object.prototype.toString.call(r)}o(Bd,"toString");function Ii(r){return!!r&&typeof r[Symbol.iterator]=="function"}o(Ii,"isIterable");var ln=new Ke(()=>{},()=>$e),$e=Object.freeze({done:!0,value:void 0});function V(...r){if(r.length===1){let e=r[0];if(e instanceof Ke)return e;if(Ii(e))return new Ke(()=>e[Symbol.iterator](),t=>t.next());if(typeof e.length=="number")return new Ke(()=>({index:0}),t=>t.index<e.length?{done:!1,value:e[t.index++]}:$e)}return r.length>1?new Ke(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let t=e.iterator.next();if(!t.done)return t;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<r.length){let t=r[e.collIndex++];Ii(t)?e.iterator=t[Symbol.iterator]():t&&typeof t.length=="number"&&(e.array=t)}}while(e.iterator||e.array||e.collIndex<r.length);return $e}):ln}o(V,"stream");var st=class extends Ke{static{o(this,"TreeStreamImpl")}constructor(e,t,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(t(a.value)[Symbol.iterator]()),a}return $e})}iterator(){let e={state:this.startFn(),next:o(()=>this.nextFn(e.state),"next"),prune:o(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},Ar;(function(r){function e(s){return s.reduce((a,c)=>a+c,0)}o(e,"sum"),r.sum=e;function t(s){return s.reduce((a,c)=>a*c,0)}o(t,"product"),r.product=t;function n(s){return s.reduce((a,c)=>Math.min(a,c))}o(n,"min"),r.min=n;function i(s){return s.reduce((a,c)=>Math.max(a,c))}o(i,"max"),r.max=i})(Ar||(Ar={}));function qt(r){return new st(r,e=>ze(e)?e.content:[],{includeRoot:!0})}o(qt,"streamCst");function Wd(r){return qt(r).filter(bt)}o(Wd,"flattenCst");function eo(r,e){for(;r.container;)if(r=r.container,r===e)return!0;return!1}o(eo,"isChildNode");function vr(r){return{start:{character:r.startColumn-1,line:r.startLine-1},end:{character:r.endColumn,line:r.endLine-1}}}o(vr,"tokenToRange");function Xt(r){if(!r)return;let{offset:e,end:t,range:n}=r;return{range:n,offset:e,end:t,length:t-e}}o(Xt,"toDocumentSegment");var Et;(function(r){r[r.Before=0]="Before",r[r.After=1]="After",r[r.OverlapFront=2]="OverlapFront",r[r.OverlapBack=3]="OverlapBack",r[r.Inside=4]="Inside"})(Et||(Et={}));function ll(r,e){if(r.end.line<e.start.line||r.end.line===e.start.line&&r.end.character<r.start.character)return Et.Before;if(r.start.line>e.end.line||r.start.line===e.end.line&&r.start.character>e.end.character)return Et.After;let t=r.start.line>e.start.line||r.start.line===e.start.line&&r.start.character>=e.start.character,n=r.end.line<e.end.line||r.end.line===e.end.line&&r.end.character<=e.end.character;return t&&n?Et.Inside:t?Et.OverlapBack:Et.OverlapFront}o(ll,"compareRange");function to(r,e){return ll(r,e)>Et.After}o(to,"inRange");var Ni=/^[\w\p{L}]$/u;function jd(r,e,t=Ni){if(r){if(e>0){let n=e-r.offset,i=r.text.charAt(n);t.test(i)||e--}return no(r,e)}}o(jd,"findDeclarationNodeAtOffset");function ro(r,e){if(r){let t=dl(r,!0);if(t&&Zs(t,e))return t;if(cn(r)){let n=r.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let s=r.content[i];if(Zs(s,e))return s}}}}o(ro,"findCommentNode");function Zs(r,e){return bt(r)&&e.includes(r.tokenType.name)}o(Zs,"isCommentNode");function no(r,e){if(bt(r))return r;if(ze(r)){let t=fl(r,e,!1);if(t)return no(t,e)}}o(no,"findLeafNodeAtOffset");function ul(r,e){if(bt(r))return r;if(ze(r)){let t=fl(r,e,!0);if(t)return ul(t,e)}}o(ul,"findLeafNodeBeforeOffset");function fl(r,e,t){let n=0,i=r.content.length-1,s;for(;n<=i;){let a=Math.floor((n+i)/2),c=r.content[a];if(c.offset<=e&&c.end>e)return c;c.end<=e?(s=t?c:void 0,n=a+1):i=a-1}return s}o(fl,"binarySearch");function dl(r,e=!0){for(;r.container;){let t=r.container,n=t.content.indexOf(r);for(;n>0;){n--;let i=t.content[n];if(e||!i.hidden)return i}r=t}}o(dl,"getPreviousNode");function Vd(r,e=!0){for(;r.container;){let t=r.container,n=t.content.indexOf(r),i=t.content.length-1;for(;n<i;){n++;let s=t.content[n];if(e||!s.hidden)return s}r=t}}o(Vd,"getNextNode");function zd(r){if(r.range.start.character===0)return r;let e=r.range.start.line,t=r,n;for(;r.container;){let i=r.container,s=n??i.content.indexOf(r);if(s===0?(r=i,n=void 0):(n=s-1,r=i.content[n]),r.range.start.line!==e)break;t=r}return t}o(zd,"getStartlineNode");function Kd(r,e){let t=Hd(r,e);return t?t.parent.content.slice(t.a+1,t.b):[]}o(Kd,"getInteriorNodes");function Hd(r,e){let t=cl(r),n=cl(e),i;for(let s=0;s<t.length&&s<n.length;s++){let a=t[s],c=n[s];if(a.parent===c.parent)i={parent:a.parent,a:a.index,b:c.index};else break}return i}o(Hd,"getCommonParent");function cl(r){let e=[];for(;r.container;){let t=r.container,n=t.content.indexOf(r);e.push({parent:t,index:n}),r=t}return e.reverse()}o(cl,"getParentChain");var Vi={};jt(Vi,{findAssignment:()=>va,findNameAssignment:()=>ji,findNodeForKeyword:()=>Ra,findNodeForProperty:()=>En,findNodesForKeyword:()=>ph,findNodesForKeywordInternal:()=>Aa,findNodesForProperty:()=>Ta,getActionAtElement:()=>Nl,getActionType:()=>Cl,getAllReachableRules:()=>Tn,getCrossReferenceTerminal:()=>ya,getEntryRule:()=>Al,getExplicitRuleType:()=>ka,getHiddenRules:()=>vl,getRuleType:()=>Ia,getTypeName:()=>nr,isArrayCardinality:()=>gh,isArrayOperator:()=>yh,isCommentTerminal:()=>xa,isDataType:()=>xh,isDataTypeRule:()=>Rn,isOptionalCardinality:()=>mh,terminalRegex:()=>Sr});var Yt=class extends Error{static{o(this,"ErrorWithLocation")}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};function $t(r){throw new Error("Error! The input value was not handled.")}o($t,"assertUnreachable");var pn={};jt(pn,{AbstractElement:()=>so,AbstractRule:()=>un,AbstractType:()=>fn,Action:()=>bo,Alternatives:()=>$o,ArrayLiteral:()=>oo,ArrayType:()=>ao,Assignment:()=>Mo,BooleanLiteral:()=>lo,CharacterRange:()=>Do,Condition:()=>Ci,Conjunction:()=>fo,CrossReference:()=>Uo,Disjunction:()=>po,EndOfFile:()=>Go,Grammar:()=>go,GrammarImport:()=>pl,Group:()=>Wo,InferredType:()=>yo,Interface:()=>xo,Keyword:()=>jo,LangiumGrammarAstReflection:()=>kr,LangiumGrammarTerminals:()=>qd,NamedArgument:()=>ml,NegatedToken:()=>Vo,Negation:()=>To,NumberLiteral:()=>Ro,Parameter:()=>Ao,ParameterReference:()=>vo,ParserRule:()=>Io,ReferenceType:()=>No,RegexToken:()=>Ko,ReturnType:()=>gl,RuleCall:()=>qo,SimpleType:()=>_o,StringLiteral:()=>wo,TerminalAlternatives:()=>Xo,TerminalGroup:()=>Jo,TerminalRule:()=>wi,TerminalRuleCall:()=>Zo,Type:()=>Lo,TypeAttribute:()=>yl,TypeDefinition:()=>io,UnionType:()=>Oo,UnorderedGroup:()=>ea,UntilToken:()=>ta,ValueLiteral:()=>_i,Wildcard:()=>na,isAbstractElement:()=>dn,isAbstractRule:()=>Xd,isAbstractType:()=>Yd,isAction:()=>Rt,isAlternatives:()=>bi,isArrayLiteral:()=>th,isArrayType:()=>co,isAssignment:()=>tt,isBooleanLiteral:()=>uo,isCharacterRange:()=>Fo,isCondition:()=>Jd,isConjunction:()=>ho,isCrossReference:()=>Jt,isDisjunction:()=>mo,isEndOfFile:()=>Bo,isFeatureName:()=>Qd,isGrammar:()=>rh,isGrammarImport:()=>nh,isGroup:()=>Mt,isInferredType:()=>Li,isInterface:()=>Oi,isKeyword:()=>Je,isNamedArgument:()=>ih,isNegatedToken:()=>zo,isNegation:()=>Eo,isNumberLiteral:()=>sh,isParameter:()=>oh,isParameterReference:()=>ko,isParserRule:()=>_e,isPrimitiveType:()=>hl,isReferenceType:()=>So,isRegexToken:()=>Ho,isReturnType:()=>Co,isRuleCall:()=>rt,isSimpleType:()=>Pi,isStringLiteral:()=>ah,isTerminalAlternatives:()=>Yo,isTerminalGroup:()=>Qo,isTerminalRule:()=>Ye,isTerminalRuleCall:()=>$i,isType:()=>hn,isTypeAttribute:()=>ch,isTypeDefinition:()=>Zd,isUnionType:()=>Po,isUnorderedGroup:()=>Mi,isUntilToken:()=>ra,isValueLiteral:()=>eh,isWildcard:()=>ia,reflection:()=>L});var qd={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},un="AbstractRule";function Xd(r){return L.isInstance(r,un)}o(Xd,"isAbstractRule");var fn="AbstractType";function Yd(r){return L.isInstance(r,fn)}o(Yd,"isAbstractType");var Ci="Condition";function Jd(r){return L.isInstance(r,Ci)}o(Jd,"isCondition");function Qd(r){return hl(r)||r==="current"||r==="entry"||r==="extends"||r==="false"||r==="fragment"||r==="grammar"||r==="hidden"||r==="import"||r==="interface"||r==="returns"||r==="terminal"||r==="true"||r==="type"||r==="infer"||r==="infers"||r==="with"||typeof r=="string"&&/\^?[_a-zA-Z][\w_]*/.test(r)}o(Qd,"isFeatureName");function hl(r){return r==="string"||r==="number"||r==="boolean"||r==="Date"||r==="bigint"}o(hl,"isPrimitiveType");var io="TypeDefinition";function Zd(r){return L.isInstance(r,io)}o(Zd,"isTypeDefinition");var _i="ValueLiteral";function eh(r){return L.isInstance(r,_i)}o(eh,"isValueLiteral");var so="AbstractElement";function dn(r){return L.isInstance(r,so)}o(dn,"isAbstractElement");var oo="ArrayLiteral";function th(r){return L.isInstance(r,oo)}o(th,"isArrayLiteral");var ao="ArrayType";function co(r){return L.isInstance(r,ao)}o(co,"isArrayType");var lo="BooleanLiteral";function uo(r){return L.isInstance(r,lo)}o(uo,"isBooleanLiteral");var fo="Conjunction";function ho(r){return L.isInstance(r,fo)}o(ho,"isConjunction");var po="Disjunction";function mo(r){return L.isInstance(r,po)}o(mo,"isDisjunction");var go="Grammar";function rh(r){return L.isInstance(r,go)}o(rh,"isGrammar");var pl="GrammarImport";function nh(r){return L.isInstance(r,pl)}o(nh,"isGrammarImport");var yo="InferredType";function Li(r){return L.isInstance(r,yo)}o(Li,"isInferredType");var xo="Interface";function Oi(r){return L.isInstance(r,xo)}o(Oi,"isInterface");var ml="NamedArgument";function ih(r){return L.isInstance(r,ml)}o(ih,"isNamedArgument");var To="Negation";function Eo(r){return L.isInstance(r,To)}o(Eo,"isNegation");var Ro="NumberLiteral";function sh(r){return L.isInstance(r,Ro)}o(sh,"isNumberLiteral");var Ao="Parameter";function oh(r){return L.isInstance(r,Ao)}o(oh,"isParameter");var vo="ParameterReference";function ko(r){return L.isInstance(r,vo)}o(ko,"isParameterReference");var Io="ParserRule";function _e(r){return L.isInstance(r,Io)}o(_e,"isParserRule");var No="ReferenceType";function So(r){return L.isInstance(r,No)}o(So,"isReferenceType");var gl="ReturnType";function Co(r){return L.isInstance(r,gl)}o(Co,"isReturnType");var _o="SimpleType";function Pi(r){return L.isInstance(r,_o)}o(Pi,"isSimpleType");var wo="StringLiteral";function ah(r){return L.isInstance(r,wo)}o(ah,"isStringLiteral");var wi="TerminalRule";function Ye(r){return L.isInstance(r,wi)}o(Ye,"isTerminalRule");var Lo="Type";function hn(r){return L.isInstance(r,Lo)}o(hn,"isType");var yl="TypeAttribute";function ch(r){return L.isInstance(r,yl)}o(ch,"isTypeAttribute");var Oo="UnionType";function Po(r){return L.isInstance(r,Oo)}o(Po,"isUnionType");var bo="Action";function Rt(r){return L.isInstance(r,bo)}o(Rt,"isAction");var $o="Alternatives";function bi(r){return L.isInstance(r,$o)}o(bi,"isAlternatives");var Mo="Assignment";function tt(r){return L.isInstance(r,Mo)}o(tt,"isAssignment");var Do="CharacterRange";function Fo(r){return L.isInstance(r,Do)}o(Fo,"isCharacterRange");var Uo="CrossReference";function Jt(r){return L.isInstance(r,Uo)}o(Jt,"isCrossReference");var Go="EndOfFile";function Bo(r){return L.isInstance(r,Go)}o(Bo,"isEndOfFile");var Wo="Group";function Mt(r){return L.isInstance(r,Wo)}o(Mt,"isGroup");var jo="Keyword";function Je(r){return L.isInstance(r,jo)}o(Je,"isKeyword");var Vo="NegatedToken";function zo(r){return L.isInstance(r,Vo)}o(zo,"isNegatedToken");var Ko="RegexToken";function Ho(r){return L.isInstance(r,Ko)}o(Ho,"isRegexToken");var qo="RuleCall";function rt(r){return L.isInstance(r,qo)}o(rt,"isRuleCall");var Xo="TerminalAlternatives";function Yo(r){return L.isInstance(r,Xo)}o(Yo,"isTerminalAlternatives");var Jo="TerminalGroup";function Qo(r){return L.isInstance(r,Jo)}o(Qo,"isTerminalGroup");var Zo="TerminalRuleCall";function $i(r){return L.isInstance(r,Zo)}o($i,"isTerminalRuleCall");var ea="UnorderedGroup";function Mi(r){return L.isInstance(r,ea)}o(Mi,"isUnorderedGroup");var ta="UntilToken";function ra(r){return L.isInstance(r,ta)}o(ra,"isUntilToken");var na="Wildcard";function ia(r){return L.isInstance(r,na)}o(ia,"isWildcard");var kr=class extends Kt{static{o(this,"LangiumGrammarAstReflection")}getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayLiteral","ArrayType","Assignment","BooleanLiteral","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","EndOfFile","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","NamedArgument","NegatedToken","Negation","NumberLiteral","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","StringLiteral","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","ValueLiteral","Wildcard"]}computeIsSubtype(e,t){switch(e){case bo:case $o:case Mo:case Do:case Uo:case Go:case Wo:case jo:case Vo:case Ko:case qo:case Xo:case Jo:case Zo:case ea:case ta:case na:return this.isSubtype(so,t);case oo:case Ro:case wo:return this.isSubtype(_i,t);case ao:case No:case _o:case Oo:return this.isSubtype(io,t);case lo:return this.isSubtype(Ci,t)||this.isSubtype(_i,t);case fo:case po:case To:case vo:return this.isSubtype(Ci,t);case yo:case xo:case Lo:return this.isSubtype(fn,t);case Io:return this.isSubtype(un,t)||this.isSubtype(fn,t);case wi:return this.isSubtype(un,t);default:return!1}}getReferenceType(e){let t=`${e.container.$type}:${e.property}`;switch(t){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return fn;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return un;case"Grammar:usedGrammars":return go;case"NamedArgument:parameter":case"ParameterReference:parameter":return Ao;case"TerminalRuleCall:rule":return wi;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"AbstractElement":return{name:"AbstractElement",properties:[{name:"cardinality"},{name:"lookahead"}]};case"ArrayLiteral":return{name:"ArrayLiteral",properties:[{name:"elements",defaultValue:[]}]};case"ArrayType":return{name:"ArrayType",properties:[{name:"elementType"}]};case"BooleanLiteral":return{name:"BooleanLiteral",properties:[{name:"true",defaultValue:!1}]};case"Conjunction":return{name:"Conjunction",properties:[{name:"left"},{name:"right"}]};case"Disjunction":return{name:"Disjunction",properties:[{name:"left"},{name:"right"}]};case"Grammar":return{name:"Grammar",properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case"GrammarImport":return{name:"GrammarImport",properties:[{name:"path"}]};case"InferredType":return{name:"InferredType",properties:[{name:"name"}]};case"Interface":return{name:"Interface",properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case"NamedArgument":return{name:"NamedArgument",properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case"Negation":return{name:"Negation",properties:[{name:"value"}]};case"NumberLiteral":return{name:"NumberLiteral",properties:[{name:"value"}]};case"Parameter":return{name:"Parameter",properties:[{name:"name"}]};case"ParameterReference":return{name:"ParameterReference",properties:[{name:"parameter"}]};case"ParserRule":return{name:"ParserRule",properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case"ReferenceType":return{name:"ReferenceType",properties:[{name:"referenceType"}]};case"ReturnType":return{name:"ReturnType",properties:[{name:"name"}]};case"SimpleType":return{name:"SimpleType",properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case"StringLiteral":return{name:"StringLiteral",properties:[{name:"value"}]};case"TerminalRule":return{name:"TerminalRule",properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case"Type":return{name:"Type",properties:[{name:"name"},{name:"type"}]};case"TypeAttribute":return{name:"TypeAttribute",properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case"UnionType":return{name:"UnionType",properties:[{name:"types",defaultValue:[]}]};case"Action":return{name:"Action",properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case"Alternatives":return{name:"Alternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"Assignment":return{name:"Assignment",properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case"CharacterRange":return{name:"CharacterRange",properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case"CrossReference":return{name:"CrossReference",properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case"EndOfFile":return{name:"EndOfFile",properties:[{name:"cardinality"},{name:"lookahead"}]};case"Group":return{name:"Group",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case"Keyword":return{name:"Keyword",properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case"NegatedToken":return{name:"NegatedToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"RegexToken":return{name:"RegexToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case"RuleCall":return{name:"RuleCall",properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalGroup":return{name:"TerminalGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalRuleCall":return{name:"TerminalRuleCall",properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"UnorderedGroup":return{name:"UnorderedGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"UntilToken":return{name:"UntilToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"Wildcard":return{name:"Wildcard",properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}},L=new kr;var Fi={};jt(Fi,{assignMandatoryProperties:()=>aa,copyAstNode:()=>oa,findLocalReferences:()=>uh,findRootNode:()=>xl,getContainerOfType:()=>Qt,getDocument:()=>ge,hasContainerOfType:()=>lh,linkContentToContainer:()=>Di,streamAllContents:()=>ot,streamAst:()=>Qe,streamContents:()=>mn,streamReferences:()=>Ir});function Di(r){for(let[e,t]of Object.entries(r))e.startsWith("$")||(Array.isArray(t)?t.forEach((n,i)=>{oe(n)&&(n.$container=r,n.$containerProperty=e,n.$containerIndex=i)}):oe(t)&&(t.$container=r,t.$containerProperty=e))}o(Di,"linkContentToContainer");function Qt(r,e){let t=r;for(;t;){if(e(t))return t;t=t.$container}}o(Qt,"getContainerOfType");function lh(r,e){let t=r;for(;t;){if(e(t))return!0;t=t.$container}return!1}o(lh,"hasContainerOfType");function ge(r){let t=xl(r).$document;if(!t)throw new Error("AST node has no document.");return t}o(ge,"getDocument");function xl(r){for(;r.$container;)r=r.$container;return r}o(xl,"findRootNode");function mn(r,e){if(!r)throw new Error("Node must be an AstNode.");let t=e?.range;return new Ke(()=>({keys:Object.keys(r),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){let i=n.keys[n.keyIndex];if(!i.startsWith("$")){let s=r[i];if(oe(s)){if(n.keyIndex++,sa(s,t))return{done:!1,value:s}}else if(Array.isArray(s)){for(;n.arrayIndex<s.length;){let a=n.arrayIndex++,c=s[a];if(oe(c)&&sa(c,t))return{done:!1,value:c}}n.arrayIndex=0}}n.keyIndex++}return $e})}o(mn,"streamContents");function ot(r,e){if(!r)throw new Error("Root node must be an AstNode.");return new st(r,t=>mn(t,e))}o(ot,"streamAllContents");function Qe(r,e){if(r){if(e?.range&&!sa(r,e.range))return new st(r,()=>[])}else throw new Error("Root node must be an AstNode.");return new st(r,t=>mn(t,e),{includeRoot:!0})}o(Qe,"streamAst");function sa(r,e){var t;if(!e)return!0;let n=(t=r.$cstNode)===null||t===void 0?void 0:t.range;return n?to(n,e):!1}o(sa,"isAstNodeInRange");function Ir(r){return new Ke(()=>({keys:Object.keys(r),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let t=e.keys[e.keyIndex];if(!t.startsWith("$")){let n=r[t];if(Ae(n))return e.keyIndex++,{done:!1,value:{reference:n,container:r,property:t}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,s=n[i];if(Ae(s))return{done:!1,value:{reference:s,container:r,property:t,index:i}}}e.arrayIndex=0}}e.keyIndex++}return $e})}o(Ir,"streamReferences");function uh(r,e=ge(r).parseResult.value){let t=[];return Qe(e).forEach(n=>{Ir(n).forEach(i=>{i.reference.ref===r&&t.push(i.reference)})}),V(t)}o(uh,"findLocalReferences");function aa(r,e){let t=r.getTypeMetaData(e.$type),n=e;for(let i of t.properties)i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=Tl(i.defaultValue))}o(aa,"assignMandatoryProperties");function Tl(r){return Array.isArray(r)?[...r.map(Tl)]:r}o(Tl,"copyDefaultValue");function oa(r,e){let t={$type:r.$type};for(let[n,i]of Object.entries(r))if(!n.startsWith("$"))if(oe(i))t[n]=oa(i,e);else if(Ae(i))t[n]=e(t,n,i.$refNode,i.$refText);else if(Array.isArray(i)){let s=[];for(let a of i)oe(a)?s.push(oa(a,e)):Ae(a)?s.push(e(t,n,a.$refNode,a.$refText)):s.push(a);t[n]=s}else t[n]=i;return Di(t),t}o(oa,"copyAstNode");var Wi={};jt(Wi,{NEWLINE_REGEXP:()=>fa,escapeRegExp:()=>rr,getCaseInsensitivePattern:()=>ha,getTerminalParts:()=>hh,isMultilineComment:()=>da,isWhitespace:()=>Bi,partialMatches:()=>pa,partialRegExp:()=>Rl});function _(r){return r.charCodeAt(0)}o(_,"cc");function Ui(r,e){Array.isArray(r)?r.forEach(function(t){e.push(t)}):e.push(r)}o(Ui,"insertToSet");function Nr(r,e){if(r[e]===!0)throw"duplicate flag "+e;let t=r[e];r[e]=!0}o(Nr,"addFlag");function Zt(r){if(r===void 0)throw Error("Internal Error - Should never get here!");return!0}o(Zt,"ASSERT_EXISTS");function gn(){throw Error("Internal Error - Should never get here!")}o(gn,"ASSERT_NEVER_REACH_HERE");function ca(r){return r.type==="Character"}o(ca,"isCharacter");var yn=[];for(let r=_("0");r<=_("9");r++)yn.push(r);var xn=[_("_")].concat(yn);for(let r=_("a");r<=_("z");r++)xn.push(r);for(let r=_("A");r<=_("Z");r++)xn.push(r);var la=[_(" "),_("\f"),_(`
`),_("\r"),_("	"),_("\v"),_("	"),_("\xA0"),_("\u1680"),_("\u2000"),_("\u2001"),_("\u2002"),_("\u2003"),_("\u2004"),_("\u2005"),_("\u2006"),_("\u2007"),_("\u2008"),_("\u2009"),_("\u200A"),_("\u2028"),_("\u2029"),_("\u202F"),_("\u205F"),_("\u3000"),_("\uFEFF")];var fh=/[0-9a-fA-F]/,Gi=/[0-9]/,dh=/[1-9]/,er=class{static{o(this,"RegExpParser")}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 t=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":Nr(n,"global");break;case"i":Nr(n,"ignoreCase");break;case"m":Nr(n,"multiLine");break;case"u":Nr(n,"unicode");break;case"y":Nr(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}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 t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break}Zt(t);let n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return gn()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),t={atLeast:i,atMost:s}):t={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;Zt(t);break}if(!(e===!0&&t===void 0)&&Zt(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t}atom(){let e,t=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()),Zt(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):gn()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[_(`
`),_("\r"),_("\u2028"),_("\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,t=!1;switch(this.popChar()){case"d":e=yn;break;case"D":e=yn,t=!0;break;case"s":e=la;break;case"S":e=la,t=!0;break;case"w":e=xn;break;case"W":e=xn,t=!0;break}return Zt(e)?{type:"Set",value:e,complement:t}:gn()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=_("\f");break;case"n":e=_(`
`);break;case"r":e=_("\r");break;case"t":e=_("	");break;case"v":e=_("\v");break}return Zt(e)?{type:"Character",value:e}:gn()}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:_("\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:_(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:_(e)}}}characterClass(){let e=[],t=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),t=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(ca(n)&&this.isRangeDash()){this.consumeChar("-");let s=this.classAtom(),a=s.type==="Character";if(ca(s)){if(s.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:s.value})}else Ui(n.value,e),e.push(_("-")),Ui(s.value,e)}else Ui(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
`: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:_("\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 t=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(dh.test(e)===!1)throw Error("Expecting a positive integer");for(;Gi.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Gi.test(e)===!1)throw Error("Expecting an integer");for(;Gi.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
`: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:_(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 Gi.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
`: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`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let t="";for(let i=0;i<e;i++){let s=this.popChar();if(fh.test(s)===!1)throw Error("Expecting a HexDecimal digits");t+=s}return{type:"Character",value:parseInt(t,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 at=class{static{o(this,"BaseRegExpVisitor")}visitChildren(e){for(let t in e){let n=e[t];e.hasOwnProperty(t)&&(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 fa=/\r?\n/gm,El=new er,ua=class extends at{static{o(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let t=String.fromCharCode(e.value);if(!this.multiline&&t===`
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=rr(t);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){let t=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(t);this.multiline=!!`
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},tr=new ua;function hh(r){try{typeof r!="string"&&(r=r.source),r=`/${r}/`;let e=El.pattern(r),t=[];for(let n of e.value.value)tr.reset(r),tr.visit(n),t.push({start:tr.startRegexp,end:tr.endRegex});return t}catch{return[]}}o(hh,"getTerminalParts");function da(r){try{return typeof r=="string"&&(r=new RegExp(r)),r=r.toString(),tr.reset(r),tr.visit(El.pattern(r)),tr.multiline}catch{return!1}}o(da,"isMultilineComment");function Bi(r){return(typeof r=="string"?new RegExp(r):r).test(" ")}o(Bi,"isWhitespace");function rr(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(rr,"escapeRegExp");function ha(r){return Array.prototype.map.call(r,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:rr(e)).join("")}o(ha,"getCaseInsensitivePattern");function pa(r,e){let t=Rl(r),n=e.match(t);return!!n&&n[0].length>0}o(pa,"partialMatches");function Rl(r){typeof r=="string"&&(r=new RegExp(r));let e=r,t=r.source,n=0;function i(){let s="",a;function c(u){s+=t.substr(n,u),n+=u}o(c,"appendRaw");function l(u){s+="(?:"+t.substr(n,u)+"|$)",n+=u}for(o(l,"appendOptional");n<t.length;)switch(t[n]){case"\\":switch(t[n+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?t[n+2]==="{"?l(t.indexOf("}",n)-n+1):l(6):l(2);break;case"p":case"P":e.unicode?l(t.indexOf("}",n)-n+1):l(2);break;case"k":l(t.indexOf(">",n)-n+1);break;default:l(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=n,a=a.exec(t)||[],l(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":c(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=n,a=a.exec(t),a?c(a[0].length):l(1);break;case"(":if(t[n+1]==="?")switch(t[n+2]){case":":s+="(?:",n+=3,s+=i()+"|$)";break;case"=":s+="(?=",n+=3,s+=i()+")";break;case"!":a=n,n+=3,i(),s+=t.substr(a,n-a);break;case"<":switch(t[n+3]){case"=":case"!":a=n,n+=4,i(),s+=t.substr(a,n-a);break;default:c(t.indexOf(">",n)-n+1),s+=i()+"|$)";break}break}else c(1),s+=i()+"|$)";break;case")":return++n,s;default:l(1);break}return s}return o(i,"process"),new RegExp(i(),r.flags)}o(Rl,"partialRegExp");function Al(r){return r.rules.find(e=>_e(e)&&e.entry)}o(Al,"getEntryRule");function vl(r){return r.rules.filter(e=>Ye(e)&&e.hidden)}o(vl,"getHiddenRules");function Tn(r,e){let t=new Set,n=Al(r);if(!n)return new Set(r.rules);let i=[n].concat(vl(r));for(let a of i)kl(a,t,e);let s=new Set;for(let a of r.rules)(t.has(a.name)||Ye(a)&&a.hidden)&&s.add(a);return s}o(Tn,"getAllReachableRules");function kl(r,e,t){e.add(r.name),ot(r).forEach(n=>{if(rt(n)||t&&$i(n)){let i=n.rule.ref;i&&!e.has(i.name)&&kl(i,e,t)}})}o(kl,"ruleDfs");function ya(r){if(r.terminal)return r.terminal;if(r.type.ref){let e=ji(r.type.ref);return e?.terminal}}o(ya,"getCrossReferenceTerminal");function xa(r){return r.hidden&&!Sr(r).test(" ")}o(xa,"isCommentTerminal");function Ta(r,e){return!r||!e?[]:Ea(r,e,r.astNode,!0)}o(Ta,"findNodesForProperty");function En(r,e,t){if(!r||!e)return;let n=Ea(r,e,r.astNode,!0);if(n.length!==0)return t!==void 0?t=Math.max(0,Math.min(t,n.length-1)):t=0,n[t]}o(En,"findNodeForProperty");function Ea(r,e,t,n){if(!n){let i=Qt(r.grammarSource,tt);if(i&&i.feature===e)return[r]}return ze(r)&&r.astNode===t?r.content.flatMap(i=>Ea(i,e,t,!1)):[]}o(Ea,"findNodesForPropertyInternal");function ph(r,e){return r?Aa(r,e,r?.astNode):[]}o(ph,"findNodesForKeyword");function Ra(r,e,t){if(!r)return;let n=Aa(r,e,r?.astNode);if(n.length!==0)return t!==void 0?t=Math.max(0,Math.min(t,n.length-1)):t=0,n[t]}o(Ra,"findNodeForKeyword");function Aa(r,e,t){if(r.astNode!==t)return[];if(Je(r.grammarSource)&&r.grammarSource.value===e)return[r];let n=qt(r).iterator(),i,s=[];do if(i=n.next(),!i.done){let a=i.value;a.astNode===t?Je(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):n.prune()}while(!i.done);return s}o(Aa,"findNodesForKeywordInternal");function va(r){var e;let t=r.astNode;for(;t===((e=r.container)===null||e===void 0?void 0:e.astNode);){let n=Qt(r.grammarSource,tt);if(n)return n;r=r.container}}o(va,"findAssignment");function ji(r){let e=r;return Li(e)&&(Rt(e.$container)?e=e.$container.$container:_e(e.$container)?e=e.$container:$t(e.$container)),Il(r,e,new Map)}o(ji,"findNameAssignment");function Il(r,e,t){var n;function i(s,a){let c;return Qt(s,tt)||(c=Il(a,a,t)),t.set(r,c),c}if(o(i,"go"),t.has(r))return t.get(r);t.set(r,void 0);for(let s of ot(e)){if(tt(s)&&s.feature.toLowerCase()==="name")return t.set(r,s),s;if(rt(s)&&_e(s.rule.ref))return i(s,s.rule.ref);if(Pi(s)&&(!((n=s.typeRef)===null||n===void 0)&&n.ref))return i(s,s.typeRef.ref)}}o(Il,"findNameAssignmentInternal");function Nl(r){let e=r.$container;if(Mt(e)){let t=e.elements,n=t.indexOf(r);for(let i=n-1;i>=0;i--){let s=t[i];if(Rt(s))return s;{let a=ot(t[i]).find(Rt);if(a)return a}}}if(dn(e))return Nl(e)}o(Nl,"getActionAtElement");function mh(r,e){return r==="?"||r==="*"||Mt(e)&&!!e.guardCondition}o(mh,"isOptionalCardinality");function gh(r){return r==="*"||r==="+"}o(gh,"isArrayCardinality");function yh(r){return r==="+="}o(yh,"isArrayOperator");function Rn(r){return Sl(r,new Set)}o(Rn,"isDataTypeRule");function Sl(r,e){if(e.has(r))return!0;e.add(r);for(let t of ot(r))if(rt(t)){if(!t.rule.ref||_e(t.rule.ref)&&!Sl(t.rule.ref,e))return!1}else{if(tt(t))return!1;if(Rt(t))return!1}return!!r.definition}o(Sl,"isDataTypeRuleInternal");function xh(r){return ga(r.type,new Set)}o(xh,"isDataType");function ga(r,e){if(e.has(r))return!0;if(e.add(r),co(r))return!1;if(So(r))return!1;if(Po(r))return r.types.every(t=>ga(t,e));if(Pi(r)){if(r.primitiveType!==void 0)return!0;if(r.stringType!==void 0)return!0;if(r.typeRef!==void 0){let t=r.typeRef.ref;return hn(t)?ga(t.type,e):!1}else return!1}else return!1}o(ga,"isDataTypeInternal");function ka(r){if(r.inferredType)return r.inferredType.name;if(r.dataType)return r.dataType;if(r.returnType){let e=r.returnType.ref;if(e){if(_e(e))return e.name;if(Oi(e)||hn(e))return e.name}}}o(ka,"getExplicitRuleType");function nr(r){var e;if(_e(r))return Rn(r)?r.name:(e=ka(r))!==null&&e!==void 0?e:r.name;if(Oi(r)||hn(r)||Co(r))return r.name;if(Rt(r)){let t=Cl(r);if(t)return t}else if(Li(r))return r.name;throw new Error("Cannot get name of Unknown Type")}o(nr,"getTypeName");function Cl(r){var e;if(r.inferredType)return r.inferredType.name;if(!((e=r.type)===null||e===void 0)&&e.ref)return nr(r.type.ref)}o(Cl,"getActionType");function Ia(r){var e,t,n;return Ye(r)?(t=(e=r.type)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:"string":Rn(r)?r.name:(n=ka(r))!==null&&n!==void 0?n:r.name}o(Ia,"getRuleType");function Sr(r){let e={s:!1,i:!1,u:!1},t=Cr(r.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(t,n)}o(Sr,"terminalRegex");var Na=/[\s\S]/.source;function Cr(r,e){if(Yo(r))return Th(r);if(Qo(r))return Eh(r);if(Fo(r))return vh(r);if($i(r)){let t=r.rule.ref;if(!t)throw new Error("Missing rule reference.");return At(Cr(t.definition),{cardinality:r.cardinality,lookahead:r.lookahead})}else{if(zo(r))return Ah(r);if(ra(r))return Rh(r);if(Ho(r)){let t=r.regex.lastIndexOf("/"),n=r.regex.substring(1,t),i=r.regex.substring(t+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),At(n,{cardinality:r.cardinality,lookahead:r.lookahead,wrap:!1})}else{if(ia(r))return At(Na,{cardinality:r.cardinality,lookahead:r.lookahead});throw new Error(`Invalid terminal element: ${r?.$type}`)}}}o(Cr,"abstractElementToRegex");function Th(r){return At(r.elements.map(e=>Cr(e)).join("|"),{cardinality:r.cardinality,lookahead:r.lookahead})}o(Th,"terminalAlternativesToRegex");function Eh(r){return At(r.elements.map(e=>Cr(e)).join(""),{cardinality:r.cardinality,lookahead:r.lookahead})}o(Eh,"terminalGroupToRegex");function Rh(r){return At(`${Na}*?${Cr(r.terminal)}`,{cardinality:r.cardinality,lookahead:r.lookahead})}o(Rh,"untilTokenToRegex");function Ah(r){return At(`(?!${Cr(r.terminal)})${Na}*?`,{cardinality:r.cardinality,lookahead:r.lookahead})}o(Ah,"negateTokenToRegex");function vh(r){return r.right?At(`[${ma(r.left)}-${ma(r.right)}]`,{cardinality:r.cardinality,lookahead:r.lookahead,wrap:!1}):At(ma(r.left),{cardinality:r.cardinality,lookahead:r.lookahead,wrap:!1})}o(vh,"characterRangeToRegex");function ma(r){return rr(r.value)}o(ma,"keywordToRegex");function At(r,e){var t;return(e.wrap!==!1||e.lookahead)&&(r=`(${(t=e.lookahead)!==null&&t!==void 0?t:""}${r})`),e.cardinality?`${r}${e.cardinality}`:r}o(At,"withCardinality");function Sa(r){let e=[],t=r.Grammar;for(let n of t.rules)Ye(n)&&xa(n)&&da(Sr(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Ni}}o(Sa,"createGrammarConfig");function _r(r){console&&console.error&&console.error(`Error: ${r}`)}o(_r,"PRINT_ERROR");function An(r){console&&console.warn&&console.warn(`Warning: ${r}`)}o(An,"PRINT_WARNING");function vn(r){let e=new Date().getTime(),t=r();return{time:new Date().getTime()-e,value:t}}o(vn,"timer");function kn(r){function e(){}o(e,"FakeConstructor"),e.prototype=r;let t=new e;function n(){return typeof t.bar}return o(n,"fakeAccess"),n(),n(),r;(0,eval)(r)}o(kn,"toFastProperties");function kh(r){return Ih(r)?r.LABEL:r.name}o(kh,"tokenLabel");function Ih(r){return Ce(r.LABEL)&&r.LABEL!==""}o(Ih,"hasTokenLabel");var He=class{static{o(this,"AbstractProduction")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),I(this.definition,t=>{t.accept(e)})}},z=class extends He{static{o(this,"NonTerminal")}constructor(e){super([]),this.idx=1,Ie(this,Ve(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Me=class extends He{static{o(this,"Rule")}constructor(e){super(e.definition),this.orgText="",Ie(this,Ve(e,t=>t!==void 0))}},J=class extends He{static{o(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Ie(this,Ve(e,t=>t!==void 0))}},K=class extends He{static{o(this,"Option")}constructor(e){super(e.definition),this.idx=1,Ie(this,Ve(e,t=>t!==void 0))}},Q=class extends He{static{o(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,Ie(this,Ve(e,t=>t!==void 0))}},Z=class extends He{static{o(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,Ie(this,Ve(e,t=>t!==void 0))}},F=class extends He{static{o(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,Ie(this,Ve(e,t=>t!==void 0))}},q=class extends He{static{o(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,Ie(this,Ve(e,t=>t!==void 0))}},X=class extends He{static{o(this,"Alternation")}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,Ie(this,Ve(e,t=>t!==void 0))}},D=class{static{o(this,"Terminal")}constructor(e){this.idx=1,Ie(this,Ve(e,t=>t!==void 0))}accept(e){e.visit(this)}};function zi(r){return R(r,wr)}o(zi,"serializeGrammar");function wr(r){function e(t){return R(t,wr)}if(o(e,"convertDefinition"),r instanceof z){let t={type:"NonTerminal",name:r.nonTerminalName,idx:r.idx};return Ce(r.label)&&(t.label=r.label),t}else{if(r instanceof J)return{type:"Alternative",definition:e(r.definition)};if(r instanceof K)return{type:"Option",idx:r.idx,definition:e(r.definition)};if(r instanceof Q)return{type:"RepetitionMandatory",idx:r.idx,definition:e(r.definition)};if(r instanceof Z)return{type:"RepetitionMandatoryWithSeparator",idx:r.idx,separator:wr(new D({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof q)return{type:"RepetitionWithSeparator",idx:r.idx,separator:wr(new D({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof F)return{type:"Repetition",idx:r.idx,definition:e(r.definition)};if(r instanceof X)return{type:"Alternation",idx:r.idx,definition:e(r.definition)};if(r instanceof D){let t={type:"Terminal",name:r.terminalType.name,label:kh(r.terminalType),idx:r.idx};Ce(r.label)&&(t.terminalLabel=r.label);let n=r.terminalType.PATTERN;return r.terminalType.PATTERN&&(t.pattern=et(n)?n.source:n),t}else{if(r instanceof Me)return{type:"Rule",name:r.name,orgText:r.orgText,definition:e(r.definition)};throw Error("non exhaustive match")}}}o(wr,"serializeProduction");var De=class{static{o(this,"GAstVisitor")}visit(e){let t=e;switch(t.constructor){case z:return this.visitNonTerminal(t);case J:return this.visitAlternative(t);case K:return this.visitOption(t);case Q:return this.visitRepetitionMandatory(t);case Z:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case F:return this.visitRepetition(t);case X:return this.visitAlternation(t);case D:return this.visitTerminal(t);case Me:return this.visitRule(t);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 Ca(r){return r instanceof J||r instanceof K||r instanceof F||r instanceof Q||r instanceof Z||r instanceof q||r instanceof D||r instanceof Me}o(Ca,"isSequenceProd");function ir(r,e=[]){return r instanceof K||r instanceof F||r instanceof q?!0:r instanceof X?ki(r.definition,n=>ir(n,e)):r instanceof z&&se(e,r)?!1:r instanceof He?(r instanceof z&&e.push(r),Pe(r.definition,n=>ir(n,e))):!1}o(ir,"isOptionalProd");function _a(r){return r instanceof X}o(_a,"isBranchingProd");function Be(r){if(r instanceof z)return"SUBRULE";if(r instanceof K)return"OPTION";if(r instanceof X)return"OR";if(r instanceof Q)return"AT_LEAST_ONE";if(r instanceof Z)return"AT_LEAST_ONE_SEP";if(r instanceof q)return"MANY_SEP";if(r instanceof F)return"MANY";if(r instanceof D)return"CONSUME";throw Error("non exhaustive match")}o(Be,"getProductionDslName");var vt=class{static{o(this,"RestWalker")}walk(e,t=[]){I(e.definition,(n,i)=>{let s=de(e.definition,i+1);if(n instanceof z)this.walkProdRef(n,s,t);else if(n instanceof D)this.walkTerminal(n,s,t);else if(n instanceof J)this.walkFlat(n,s,t);else if(n instanceof K)this.walkOption(n,s,t);else if(n instanceof Q)this.walkAtLeastOne(n,s,t);else if(n instanceof Z)this.walkAtLeastOneSep(n,s,t);else if(n instanceof q)this.walkManySep(n,s,t);else if(n instanceof F)this.walkMany(n,s,t);else if(n instanceof X)this.walkOr(n,s,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){let i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){let i=[new K({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){let i=_l(e,t,n);this.walk(e,i)}walkMany(e,t,n){let i=[new K({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){let i=_l(e,t,n);this.walk(e,i)}walkOr(e,t,n){let i=t.concat(n);I(e.definition,s=>{let a=new J({definition:[s]});this.walk(a,i)})}};function _l(r,e,t){return[new K({definition:[new D({terminalType:r.separator})].concat(r.definition)})].concat(e,t)}o(_l,"restForRepetitionWithSeparator");function sr(r){if(r instanceof z)return sr(r.referencedRule);if(r instanceof D)return Ch(r);if(Ca(r))return Nh(r);if(_a(r))return Sh(r);throw Error("non exhaustive match")}o(sr,"first");function Nh(r){let e=[],t=r.definition,n=0,i=t.length>n,s,a=!0;for(;i&&a;)s=t[n],a=ir(s),e=e.concat(sr(s)),n=n+1,i=t.length>n;return an(e)}o(Nh,"firstForSequence");function Sh(r){let e=R(r.definition,t=>sr(t));return an(fe(e))}o(Sh,"firstForBranching");function Ch(r){return[r.terminalType]}o(Ch,"firstForTerminal");var Ki="_~IN~_";var wa=class extends vt{static{o(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let i=_h(e.referencedRule,e.idx)+this.topProd.name,s=t.concat(n),a=new J({definition:s}),c=sr(a);this.follows[i]=c}};function wl(r){let e={};return I(r,t=>{let n=new wa(t).startWalking();Ie(e,n)}),e}o(wl,"computeAllProdsFollows");function _h(r,e){return r.name+e+Ki}o(_h,"buildBetweenProdsFollowPrefix");var Hi={},wh=new er;function Lr(r){let e=r.toString();if(Hi.hasOwnProperty(e))return Hi[e];{let t=wh.pattern(e);return Hi[e]=t,t}}o(Lr,"getRegExpAst");function Ll(){Hi={}}o(Ll,"clearRegExpParserCache");var Pl="Complement Sets are not supported for first char optimization",In=`Unable to use "first char" lexer optimizations:
`;function bl(r,e=!1){try{let t=Lr(r);return La(t.value,{},t.flags.ignoreCase)}catch(t){if(t.message===Pl)e&&An(`${In}	Unable to optimize: < ${r.toString()} >
	Complement Sets cannot be automatically optimized.
	This will disable the lexer's first char optimizations.
	See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
	This will disable the lexer's first char optimizations.
	See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),_r(`${In}
	Failed parsing: < ${r.toString()} >
	Using the @chevrotain/regexp-to-ast library
	Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}o(bl,"getOptimizedStartCodesIndices");function La(r,e,t){switch(r.type){case"Disjunction":for(let i=0;i<r.value.length;i++)La(r.value[i],e,t);break;case"Alternative":let n=r.value;for(let i=0;i<n.length;i++){let s=n[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let a=s;switch(a.type){case"Character":qi(a.value,e,t);break;case"Set":if(a.complement===!0)throw Error(Pl);I(a.value,l=>{if(typeof l=="number")qi(l,e,t);else{let u=l;if(t===!0)for(let f=u.from;f<=u.to;f++)qi(f,e,t);else{for(let f=u.from;f<=u.to&&f<Or;f++)qi(f,e,t);if(u.to>=Or){let f=u.from>=Or?u.from:Or,d=u.to,p=ct(f),h=ct(d);for(let g=p;g<=h;g++)e[g]=g}}}});break;case"Group":La(a.value,e,t);break;default:throw Error("Non Exhaustive Match")}let c=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&Oa(a)===!1||a.type!=="Group"&&c===!1)break}break;default:throw Error("non exhaustive match!")}return re(e)}o(La,"firstCharOptimizedIndices");function qi(r,e,t){let n=ct(r);e[n]=n,t===!0&&Lh(r,e)}o(qi,"addOptimizedIdxToResult");function Lh(r,e){let t=String.fromCharCode(r),n=t.toUpperCase();if(n!==t){let i=ct(n.charCodeAt(0));e[i]=i}else{let i=t.toLowerCase();if(i!==t){let s=ct(i.charCodeAt(0));e[s]=s}}}o(Lh,"handleIgnoreCase");function Ol(r,e){return Tt(r.value,t=>{if(typeof t=="number")return se(e,t);{let n=t;return Tt(e,i=>n.from<=i&&i<=n.to)!==void 0}})}o(Ol,"findCode");function Oa(r){let e=r.quantifier;return e&&e.atLeast===0?!0:r.value?me(r.value)?Pe(r.value,Oa):Oa(r.value):!1}o(Oa,"isWholeOptional");var Pa=class extends at{static{o(this,"CharCodeFinder")}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){se(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Ol(e,this.targetCharCodes)===void 0&&(this.found=!0):Ol(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Xi(r,e){if(e instanceof RegExp){let t=Lr(e),n=new Pa(r);return n.visit(t),n.found}else return Tt(e,t=>se(r,t.charCodeAt(0)))!==void 0}o(Xi,"canMatchCharCode");var or="PATTERN",Pr="defaultMode",Yi="modes",$a=typeof new RegExp("(?:)").sticky=="boolean";function Dl(r,e){e=on(e,{useSticky:$a,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
`],tracer:o((A,T)=>T(),"tracer")});let t=e.tracer;t("initCharCodeToOptimizedIndexMap",()=>{Xh()});let n;t("Reject Lexer.NA",()=>{n=zt(r,A=>A[or]===ce.NA)});let i=!1,s;t("Transform Patterns",()=>{i=!1,s=R(n,A=>{let T=A[or];if(et(T)){let b=T.source;return b.length===1&&b!=="^"&&b!=="$"&&b!=="."&&!T.ignoreCase?b:b.length===2&&b[0]==="\\"&&!se(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],b[1])?b[1]:e.useSticky?Ml(T):$l(T)}else{if(it(T))return i=!0,{exec:T};if(typeof T=="object")return i=!0,T;if(typeof T=="string"){if(T.length===1)return T;{let b=T.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),$=new RegExp(b);return e.useSticky?Ml($):$l($)}}else throw Error("non exhaustive match")}})});let a,c,l,u,f;t("misc mapping",()=>{a=R(n,A=>A.tokenTypeIdx),c=R(n,A=>{let T=A.GROUP;if(T!==ce.SKIPPED){if(Ce(T))return T;if(be(T))return!1;throw Error("non exhaustive match")}}),l=R(n,A=>{let T=A.LONGER_ALT;if(T)return me(T)?R(T,$=>Js(n,$)):[Js(n,T)]}),u=R(n,A=>A.PUSH_MODE),f=R(n,A=>N(A,"POP_MODE"))});let d;t("Line Terminator Handling",()=>{let A=zl(e.lineTerminatorCharacters);d=R(n,T=>!1),e.positionTracking!=="onlyOffset"&&(d=R(n,T=>N(T,"LINE_BREAKS")?!!T.LINE_BREAKS:Vl(T,A)===!1&&Xi(A,T.PATTERN)))});let p,h,g,x;t("Misc Mapping #2",()=>{p=R(n,Wl),h=R(s,Hh),g=ae(n,(A,T)=>{let b=T.GROUP;return Ce(b)&&b!==ce.SKIPPED&&(A[b]=[]),A},{}),x=R(s,(A,T)=>({pattern:s[T],longerAlt:l[T],canLineTerminator:d[T],isCustom:p[T],short:h[T],group:c[T],push:u[T],pop:f[T],tokenTypeIdx:a[T],tokenType:n[T]}))});let k=!0,E=[];return e.safeMode||t("First Char Optimization",()=>{E=ae(n,(A,T,b)=>{if(typeof T.PATTERN=="string"){let $=T.PATTERN.charCodeAt(0),Te=ct($);ba(A,Te,x[b])}else if(me(T.START_CHARS_HINT)){let $;I(T.START_CHARS_HINT,Te=>{let Er=typeof Te=="string"?Te.charCodeAt(0):Te,ve=ct(Er);$!==ve&&($=ve,ba(A,ve,x[b]))})}else if(et(T.PATTERN))if(T.PATTERN.unicode)k=!1,e.ensureOptimizations&&_r(`${In}	Unable to analyze < ${T.PATTERN.toString()} > pattern.
	The regexp unicode flag is not currently supported by the regexp-to-ast library.
	This will disable the lexer's first char optimizations.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let $=bl(T.PATTERN,e.ensureOptimizations);M($)&&(k=!1),I($,Te=>{ba(A,Te,x[b])})}else e.ensureOptimizations&&_r(`${In}	TokenType: <${T.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
	This will disable the lexer's first char optimizations.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),k=!1;return A},[])}),{emptyGroups:g,patternIdxToConfig:x,charCodeToPatternIdxToConfig:E,hasCustom:i,canBeOptimized:k}}o(Dl,"analyzeTokenTypes");function Fl(r,e){let t=[],n=Ph(r);t=t.concat(n.errors);let i=bh(n.valid),s=i.valid;return t=t.concat(i.errors),t=t.concat(Oh(s)),t=t.concat(Wh(s)),t=t.concat(jh(s,e)),t=t.concat(Vh(s)),t}o(Fl,"validatePatterns");function Oh(r){let e=[],t=Re(r,n=>et(n[or]));return e=e.concat(Mh(t)),e=e.concat(Uh(t)),e=e.concat(Gh(t)),e=e.concat(Bh(t)),e=e.concat(Dh(t)),e}o(Oh,"validateRegExpPattern");function Ph(r){let e=Re(r,i=>!N(i,or)),t=R(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:ne.MISSING_PATTERN,tokenTypes:[i]})),n=Vt(r,e);return{errors:t,valid:n}}o(Ph,"findMissingPatterns");function bh(r){let e=Re(r,i=>{let s=i[or];return!et(s)&&!it(s)&&!N(s,"exec")&&!Ce(s)}),t=R(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:ne.INVALID_PATTERN,tokenTypes:[i]})),n=Vt(r,e);return{errors:t,valid:n}}o(bh,"findInvalidPatterns");var $h=/[^\\][$]/;function Mh(r){class e extends at{static{o(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}let t=Re(r,i=>{let s=i.PATTERN;try{let a=Lr(s),c=new e;return c.visit(a),c.found}catch{return $h.test(s.source)}});return R(t,i=>({message:`Unexpected RegExp Anchor Error:
	Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
	See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.`,type:ne.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}o(Mh,"findEndOfInputAnchor");function Dh(r){let e=Re(r,n=>n.PATTERN.test(""));return R(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:ne.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}o(Dh,"findEmptyMatchRegExps");var Fh=/[^\\[][\^]|^\^/;function Uh(r){class e extends at{static{o(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}let t=Re(r,i=>{let s=i.PATTERN;try{let a=Lr(s),c=new e;return c.visit(a),c.found}catch{return Fh.test(s.source)}});return R(t,i=>({message:`Unexpected RegExp Anchor Error:
	Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
	See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.`,type:ne.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}o(Uh,"findStartOfInputAnchor");function Gh(r){let e=Re(r,n=>{let i=n[or];return i instanceof RegExp&&(i.multiline||i.global)});return R(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ne.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}o(Gh,"findUnsupportedFlags");function Bh(r){let e=[],t=R(r,s=>ae(r,(a,c)=>(s.PATTERN.source===c.PATTERN.source&&!se(e,c)&&c.PATTERN!==ce.NA&&(e.push(c),a.push(c)),a),[]));t=yt(t);let n=Re(t,s=>s.length>1);return R(n,s=>{let a=R(s,l=>l.name);return{message:`The same RegExp pattern ->${Ne(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:ne.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}o(Bh,"findDuplicatePatterns");function Wh(r){let e=Re(r,n=>{if(!N(n,"GROUP"))return!1;let i=n.GROUP;return i!==ce.SKIPPED&&i!==ce.NA&&!Ce(i)});return R(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ne.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}o(Wh,"findInvalidGroupType");function jh(r,e){let t=Re(r,i=>i.PUSH_MODE!==void 0&&!se(e,i.PUSH_MODE));return R(t,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:ne.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}o(jh,"findModesThatDoNotExist");function Vh(r){let e=[],t=ae(r,(n,i,s)=>{let a=i.PATTERN;return a===ce.NA||(Ce(a)?n.push({str:a,idx:s,tokenType:i}):et(a)&&Kh(a)&&n.push({str:a.source,idx:s,tokenType:i})),n},[]);return I(r,(n,i)=>{I(t,({str:s,idx:a,tokenType:c})=>{if(i<a&&zh(s,n.PATTERN)){let l=`Token: ->${c.name}<- can never be matched.
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:ne.UNREACHABLE_PATTERN,tokenTypes:[n,c]})}})}),e}o(Vh,"findUnreachablePatterns");function zh(r,e){if(et(e)){let t=e.exec(r);return t!==null&&t.index===0}else{if(it(e))return e(r,0,[],{});if(N(e,"exec"))return e.exec(r,0,[],{});if(typeof e=="string")return e===r;throw Error("non exhaustive match")}}o(zh,"testTokenType");function Kh(r){return Tt([".","\\","[","]","|","^","$","(",")","?","*","+","{"],t=>r.source.indexOf(t)!==-1)===void 0}o(Kh,"noMetaChar");function $l(r){let e=r.ignoreCase?"i":"";return new RegExp(`^(?:${r.source})`,e)}o($l,"addStartOfInput");function Ml(r){let e=r.ignoreCase?"iy":"y";return new RegExp(`${r.source}`,e)}o(Ml,"addStickyFlag");function Ul(r,e,t){let n=[];return N(r,Pr)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Pr+`> property in its definition
`,type:ne.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),N(r,Yi)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Yi+`> property in its definition
`,type:ne.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),N(r,Yi)&&N(r,Pr)&&!N(r.modes,r.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Pr}: <${r.defaultMode}>which does not exist
`,type:ne.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),N(r,Yi)&&I(r.modes,(i,s)=>{I(i,(a,c)=>{if(be(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${c}>
`,type:ne.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(N(a,"LONGER_ALT")){let l=me(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];I(l,u=>{!be(u)&&!se(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${a.name}> outside of mode <${s}>
`,type:ne.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}o(Ul,"performRuntimeChecks");function Gl(r,e,t){let n=[],i=!1,s=yt(fe(re(r.modes))),a=zt(s,l=>l[or]===ce.NA),c=zl(t);return e&&I(a,l=>{let u=Vl(l,c);if(u!==!1){let d={message:qh(l,u),type:u.issue,tokenType:l};n.push(d)}else N(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Xi(c,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
	This Lexer has been defined to track line and column information,
	But none of the Token Types can be identified as matching a line terminator.
	See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS 
	for details.`,type:ne.NO_LINE_BREAKS_FLAGS}),n}o(Gl,"performWarningRuntimeChecks");function Bl(r){let e={},t=gt(r);return I(t,n=>{let i=r[n];if(me(i))e[n]=[];else throw Error("non exhaustive match")}),e}o(Bl,"cloneEmptyGroups");function Wl(r){let e=r.PATTERN;if(et(e))return!1;if(it(e))return!0;if(N(e,"exec"))return!0;if(Ce(e))return!1;throw Error("non exhaustive match")}o(Wl,"isCustomPattern");function Hh(r){return Ce(r)&&r.length===1?r.charCodeAt(0):!1}o(Hh,"isShortPattern");var jl={test:o(function(r){let e=r.length;for(let t=this.lastIndex;t<e;t++){let n=r.charCodeAt(t);if(n===10)return this.lastIndex=t+1,!0;if(n===13)return r.charCodeAt(t+1)===10?this.lastIndex=t+2:this.lastIndex=t+1,!0}return!1},"test"),lastIndex:0};function Vl(r,e){if(N(r,"LINE_BREAKS"))return!1;if(et(r.PATTERN)){try{Xi(e,r.PATTERN)}catch(t){return{issue:ne.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}else{if(Ce(r.PATTERN))return!1;if(Wl(r))return{issue:ne.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}o(Vl,"checkLineBreaksIssues");function qh(r,e){if(e.issue===ne.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
	The problem is in the <${r.name}> Token Type
	 Root cause: ${e.errMsg}.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===ne.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
	The problem is in the <${r.name}> Token Type
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}o(qh,"buildLineBreakIssueMessage");function zl(r){return R(r,t=>Ce(t)?t.charCodeAt(0):t)}o(zl,"getCharCodes");function ba(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}o(ba,"addToMapOfArrays");var Or=256,Ji=[];function ct(r){return r<Or?r:Ji[r]}o(ct,"charCodeToOptimizedIndex");function Xh(){if(M(Ji)){Ji=new Array(65536);for(let r=0;r<65536;r++)Ji[r]=r>255?255+~~(r/255):r}}o(Xh,"initCharCodeToOptimizedIndexMap");function kt(r,e){let t=r.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}o(kt,"tokenStructuredMatcher");function br(r,e){return r.tokenTypeIdx===e.tokenTypeIdx}o(br,"tokenStructuredMatcherNoCategories");var Kl=1,ql={};function It(r){let e=Yh(r);Jh(e),Zh(e),Qh(e),I(e,t=>{t.isParent=t.categoryMatches.length>0})}o(It,"augmentTokenTypes");function Yh(r){let e=te(r),t=r,n=!0;for(;n;){t=yt(fe(R(t,s=>s.CATEGORIES)));let i=Vt(t,e);e=e.concat(i),M(i)?n=!1:t=i}return e}o(Yh,"expandCategories");function Jh(r){I(r,e=>{Ma(e)||(ql[Kl]=e,e.tokenTypeIdx=Kl++),Hl(e)&&!me(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Hl(e)||(e.CATEGORIES=[]),ep(e)||(e.categoryMatches=[]),tp(e)||(e.categoryMatchesMap={})})}o(Jh,"assignTokenDefaultProps");function Qh(r){I(r,e=>{e.categoryMatches=[],I(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(ql[n].tokenTypeIdx)})})}o(Qh,"assignCategoriesTokensProp");function Zh(r){I(r,e=>{Xl([],e)})}o(Zh,"assignCategoriesMapProp");function Xl(r,e){I(r,t=>{e.categoryMatchesMap[t.tokenTypeIdx]=!0}),I(e.CATEGORIES,t=>{let n=r.concat(e);se(n,t)||Xl(n,t)})}o(Xl,"singleAssignCategoriesToksMap");function Ma(r){return N(r,"tokenTypeIdx")}o(Ma,"hasShortKeyProperty");function Hl(r){return N(r,"CATEGORIES")}o(Hl,"hasCategoriesProperty");function ep(r){return N(r,"categoryMatches")}o(ep,"hasExtendingTokensTypesProperty");function tp(r){return N(r,"categoryMatchesMap")}o(tp,"hasExtendingTokensTypesMapProperty");function Yl(r){return N(r,"tokenTypeIdx")}o(Yl,"isTokenType");var Da={buildUnableToPopLexerModeMessage(r){return`Unable to pop Lexer Mode after encountering Token ->${r.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(r,e,t,n,i){return`unexpected character: ->${r.charAt(e)}<- at offset: ${e}, skipped ${t} characters.`}};var ne;(function(r){r[r.MISSING_PATTERN=0]="MISSING_PATTERN",r[r.INVALID_PATTERN=1]="INVALID_PATTERN",r[r.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",r[r.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",r[r.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",r[r.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",r[r.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",r[r.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",r[r.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",r[r.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",r[r.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",r[r.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",r[r.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",r[r.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",r[r.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",r[r.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",r[r.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",r[r.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(ne||(ne={}));var Nn={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Da,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Nn);var ce=class{static{o(this,"Lexer")}constructor(e,t=Nn){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,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let a=new Array(this.traceInitIndent+1).join("	");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);let{time:c,value:l}=vn(s),u=c>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${a}<-- <${i}> time: ${c}ms`),this.traceInitIndent--,l}else return s()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=Ie({},Nn,t);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,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Nn.lineTerminatorsPattern)this.config.lineTerminatorsPattern=jl;else if(this.config.lineTerminatorCharacters===Nn.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.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),me(e)?i={modes:{defaultMode:te(e)},defaultMode:Pr}:(s=!1,i=te(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Ul(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Gl(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},I(i.modes,(c,l)=>{i.modes[l]=zt(c,u=>be(u))});let a=gt(i.modes);if(I(i.modes,(c,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Fl(c,a))}),M(this.lexerDefinitionErrors)){It(c);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=Dl(c,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Ie({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!M(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let l=R(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+l)}I(this.lexerDefinitionWarning,c=>{An(c.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if($a?(this.chopInput=Ys,this.match=this.matchWithTest):(this.updateLastIndex=ue,this.match=this.matchWithExec),s&&(this.handleModes=ue),this.trackStartLines===!1&&(this.computeNewColumn=Ys),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ue),/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 c=ae(this.canModeBeOptimized,(l,u,f)=>(u===!1&&l.push(f),l),[]);if(t.ensureOptimizations&&!M(c))throw Error(`Lexer Modes: < ${c.join(", ")} > cannot be optimized.
	 Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
	 Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ll()}),this.TRACE_INIT("toFastProperties",()=>{kn(this)})})}tokenize(e,t=this.defaultMode){if(!M(this.lexerDefinitionErrors)){let i=R(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+i)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,i,s,a,c,l,u,f,d,p,h,g,x,k,E,A,T=e,b=T.length,$=0,Te=0,Er=this.hasCustom?0:Math.floor(e.length/10),ve=new Array(Er),Lt=[],ht=this.trackStartLines?1:void 0,v=this.trackStartLines?1:void 0,y=Bl(this.emptyGroups),C=this.trackStartLines,S=this.config.lineTerminatorsPattern,j=0,P=[],O=[],Le=[],Oe=[];Object.freeze(Oe);let ee;function Bt(){return P}o(Bt,"getPossiblePatternsSlow");function Zc(ke){let Xe=ct(ke),Rr=O[Xe];return Rr===void 0?Oe:Rr}o(Zc,"getPossiblePatternsOptimized");let Gd=o(ke=>{if(Le.length===1&&ke.tokenType.PUSH_MODE===void 0){let Xe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ke);Lt.push({offset:ke.startOffset,line:ke.startLine,column:ke.startColumn,length:ke.image.length,message:Xe})}else{Le.pop();let Xe=xt(Le);P=this.patternIdxToConfig[Xe],O=this.charCodeToPatternIdxToConfig[Xe],j=P.length;let Rr=this.canModeBeOptimized[Xe]&&this.config.safeMode===!1;O&&Rr?ee=Zc:ee=Bt}},"pop_mode");function el(ke){Le.push(ke),O=this.charCodeToPatternIdxToConfig[ke],P=this.patternIdxToConfig[ke],j=P.length,j=P.length;let Xe=this.canModeBeOptimized[ke]&&this.config.safeMode===!1;O&&Xe?ee=Zc:ee=Bt}o(el,"push_mode"),el.call(this,t);let Ze,tl=this.config.recoveryEnabled;for(;$<b;){l=null;let ke=T.charCodeAt($),Xe=ee(ke),Rr=Xe.length;for(n=0;n<Rr;n++){Ze=Xe[n];let je=Ze.pattern;u=null;let pt=Ze.short;if(pt!==!1?ke===pt&&(l=je):Ze.isCustom===!0?(A=je.exec(T,$,ve,y),A!==null?(l=A[0],A.payload!==void 0&&(u=A.payload)):l=null):(this.updateLastIndex(je,$),l=this.match(je,e,$)),l!==null){if(c=Ze.longerAlt,c!==void 0){let Ot=c.length;for(s=0;s<Ot;s++){let mt=P[c[s]],Wt=mt.pattern;if(f=null,mt.isCustom===!0?(A=Wt.exec(T,$,ve,y),A!==null?(a=A[0],A.payload!==void 0&&(f=A.payload)):a=null):(this.updateLastIndex(Wt,$),a=this.match(Wt,e,$)),a&&a.length>l.length){l=a,u=f,Ze=mt;break}}}break}}if(l!==null){if(d=l.length,p=Ze.group,p!==void 0&&(h=Ze.tokenTypeIdx,g=this.createTokenInstance(l,$,h,Ze.tokenType,ht,v,d),this.handlePayload(g,u),p===!1?Te=this.addToken(ve,Te,g):y[p].push(g)),e=this.chopInput(e,d),$=$+d,v=this.computeNewColumn(v,d),C===!0&&Ze.canLineTerminator===!0){let je=0,pt,Ot;S.lastIndex=0;do pt=S.test(l),pt===!0&&(Ot=S.lastIndex-1,je++);while(pt===!0);je!==0&&(ht=ht+je,v=d-Ot,this.updateTokenEndLineColumnLocation(g,p,Ot,je,ht,v,d))}this.handleModes(Ze,Gd,el,g)}else{let je=$,pt=ht,Ot=v,mt=tl===!1;for(;mt===!1&&$<b;)for(e=this.chopInput(e,1),$++,i=0;i<j;i++){let Wt=P[i],Xs=Wt.pattern,rl=Wt.short;if(rl!==!1?T.charCodeAt($)===rl&&(mt=!0):Wt.isCustom===!0?mt=Xs.exec(T,$,ve,y)!==null:(this.updateLastIndex(Xs,$),mt=Xs.exec(e)!==null),mt===!0)break}if(x=$-je,v=this.computeNewColumn(v,x),E=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(T,je,x,pt,Ot),Lt.push({offset:je,line:pt,column:Ot,length:x,message:E}),tl===!1)break}}return this.hasCustom||(ve.length=Te),{tokens:ve,groups:y,errors:Lt}}handleModes(e,t,n,i){if(e.pop===!0){let s=e.push;t(i),s!==void 0&&n.call(this,s)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,t){return e.substring(t)}updateLastIndex(e,t){e.lastIndex=t}updateTokenEndLineColumnLocation(e,t,n,i,s,a,c){let l,u;t!==void 0&&(l=n===c-1,u=l?-1:0,i===1&&l===!0||(e.endLine=s+u,e.endColumn=a-1+-u))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,i){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,t,n,i,s,a){return{image:e,startOffset:t,startLine:s,startColumn:a,tokenTypeIdx:n,tokenType:i}}createFullToken(e,t,n,i,s,a,c){return{image:e,startOffset:t,endOffset:t+c-1,startLine:s,endLine:s,startColumn:a,endColumn:a+c-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,t++,t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){t!==null&&(e.payload=t)}matchWithTest(e,t,n){return e.test(t)===!0?t.substring(n,e.lastIndex):null}matchWithExec(e,t){let n=e.exec(t);return n!==null?n[0]:null}};ce.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.";ce.NA=/NOT_APPLICABLE/;function Nt(r){return Fa(r)?r.LABEL:r.name}o(Nt,"tokenLabel");function Fa(r){return Ce(r.LABEL)&&r.LABEL!==""}o(Fa,"hasTokenLabel");var rp="parent",Jl="categories",Ql="label",Zl="group",eu="push_mode",tu="pop_mode",ru="longer_alt",nu="line_breaks",iu="start_chars_hint";function Qi(r){return np(r)}o(Qi,"createToken");function np(r){let e=r.pattern,t={};if(t.name=r.name,be(e)||(t.PATTERN=e),N(r,rp))throw`The parent property is no longer supported.
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return N(r,Jl)&&(t.CATEGORIES=r[Jl]),It([t]),N(r,Ql)&&(t.LABEL=r[Ql]),N(r,Zl)&&(t.GROUP=r[Zl]),N(r,tu)&&(t.POP_MODE=r[tu]),N(r,eu)&&(t.PUSH_MODE=r[eu]),N(r,ru)&&(t.LONGER_ALT=r[ru]),N(r,nu)&&(t.LINE_BREAKS=r[nu]),N(r,iu)&&(t.START_CHARS_HINT=r[iu]),t}o(np,"createTokenInternal");var qe=Qi({name:"EOF",pattern:ce.NA});It([qe]);function ar(r,e,t,n,i,s,a,c){return{image:e,startOffset:t,endOffset:n,startLine:i,endLine:s,startColumn:a,endColumn:c,tokenTypeIdx:r.tokenTypeIdx,tokenType:r}}o(ar,"createTokenInstance");function Sn(r,e){return kt(r,e)}o(Sn,"tokenMatcher");var St={buildMismatchTokenMessage({expected:r,actual:e,previous:t,ruleName:n}){return`Expecting ${Fa(r)?`--> ${Nt(r)} <--`:`token of type --> ${r.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:r,ruleName:e}){return"Redundant input, expecting EOF but found: "+r.image},buildNoViableAltMessage({expectedPathsPerAlt:r,actual:e,previous:t,customUserDescription:n,ruleName:i}){let s="Expecting: ",c=`
but found: '`+Ne(e).image+"'";if(n)return s+n+c;{let l=ae(r,(p,h)=>p.concat(h),[]),u=R(l,p=>`[${R(p,h=>Nt(h)).join(", ")}]`),d=`one of these possible Token sequences:
${R(u,(p,h)=>`  ${h+1}. ${p}`).join(`
`)}`;return s+d+c}},buildEarlyExitMessage({expectedIterationPaths:r,actual:e,customUserDescription:t,ruleName:n}){let i="Expecting: ",a=`
but found: '`+Ne(e).image+"'";if(t)return i+t+a;{let l=`expecting at least one iteration which starts with one of these possible Token sequences::
  <${R(r,u=>`[${R(u,f=>Nt(f)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(St);var su={buildRuleNotFoundError(r,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
inside top level rule: ->`+r.name+"<-"}},nt={buildDuplicateFoundError(r,e){function t(f){return f instanceof D?f.terminalType.name:f instanceof z?f.nonTerminalName:""}o(t,"getExtraProductionArgument");let n=r.name,i=Ne(e),s=i.idx,a=Be(i),c=t(i),l=s>0,u=`->${a}${l?s:""}<- ${c?`with argument: ->${c}<-`:""}
                  appears more than once (${e.length} times) in the top level rule: ->${n}<-.                  
                  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES 
                  `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
`),u},buildNamespaceConflictError(r){return`Namespace conflict found in grammar.
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${r.name}>.
To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(r){let e=R(r.prefixPath,i=>Nt(i)).join(", "),t=r.alternation.idx===0?"":r.alternation.idx;return`Ambiguous alternatives: <${r.ambiguityIndices.join(" ,")}> due to common lookahead prefix
in <OR${t}> inside <${r.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`},buildAlternationAmbiguityError(r){let e=R(r.prefixPath,i=>Nt(i)).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,n=`Ambiguous Alternatives Detected: <${r.ambiguityIndices.join(" ,")}> in <OR${t}> inside <${r.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n},buildEmptyRepetitionError(r){let e=Be(r.repetition);return r.repetition.idx!==0&&(e+=r.repetition.idx),`The repetition <${e}> within Rule <${r.topLevelRule.name}> can never consume any tokens.
This could lead to an infinite loop.`},buildTokenNameError(r){return"deprecated"},buildEmptyAlternationError(r){return`Ambiguous empty alternative: <${r.emptyChoiceIdx+1}> in <OR${r.alternation.idx}> inside <${r.topLevelRule.name}> Rule.
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(r){return`An Alternation cannot have more than 256 alternatives:
<OR${r.alternation.idx}> inside <${r.topLevelRule.name}> Rule.
 has ${r.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(r){let e=r.topLevelRule.name,t=R(r.leftRecursionPath,s=>s.name),n=`${e} --> ${t.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
rule: <${e}> can be invoked from itself (directly or indirectly)
without consuming any Tokens. The grammar path that causes this is: 
 ${n}
 To fix this refactor your grammar to remove the left recursion.
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(r){return"deprecated"},buildDuplicateRuleNameError(r){let e;return r.topLevelRule instanceof Me?e=r.topLevelRule.name:e=r.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${r.grammarName}<-`}};function ou(r,e){let t=new Ua(r,e);return t.resolveRefs(),t.errors}o(ou,"resolveGrammar");var Ua=class extends De{static{o(this,"GastRefResolverVisitor")}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){I(re(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:ye.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var Ga=class extends vt{static{o(this,"AbstractNextPossibleTokensWalker")}constructor(e,t){super(),this.topProd=e,this.path=t,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=te(this.path.ruleStack).reverse(),this.occurrenceStack=te(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){M(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},Zi=class extends Ga{static{o(this,"NextAfterTokenWalker")}constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=t.concat(n),s=new J({definition:i});this.possibleTokTypes=sr(s),this.found=!0}}},$r=class extends vt{static{o(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},es=class extends $r{static{o(this,"NextTerminalAfterManyWalker")}walkMany(e,t,n){if(e.idx===this.occurrence){let i=Ne(t.concat(n));this.result.isEndOfRule=i===void 0,i instanceof D&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,t,n)}},Cn=class extends $r{static{o(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,n){if(e.idx===this.occurrence){let i=Ne(t.concat(n));this.result.isEndOfRule=i===void 0,i instanceof D&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,t,n)}},ts=class extends $r{static{o(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let i=Ne(t.concat(n));this.result.isEndOfRule=i===void 0,i instanceof D&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,t,n)}},_n=class extends $r{static{o(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let i=Ne(t.concat(n));this.result.isEndOfRule=i===void 0,i instanceof D&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,t,n)}};function rs(r,e,t=[]){t=te(t);let n=[],i=0;function s(c){return c.concat(de(r,i+1))}o(s,"remainingPathWith");function a(c){let l=rs(s(c),e,t);return n.concat(l)}for(o(a,"getAlternativesForProd");t.length<e&&i<r.length;){let c=r[i];if(c instanceof J)return a(c.definition);if(c instanceof z)return a(c.definition);if(c instanceof K)n=a(c.definition);else if(c instanceof Q){let l=c.definition.concat([new F({definition:c.definition})]);return a(l)}else if(c instanceof Z){let l=[new J({definition:c.definition}),new F({definition:[new D({terminalType:c.separator})].concat(c.definition)})];return a(l)}else if(c instanceof q){let l=c.definition.concat([new F({definition:[new D({terminalType:c.separator})].concat(c.definition)})]);n=a(l)}else if(c instanceof F){let l=c.definition.concat([new F({definition:c.definition})]);n=a(l)}else{if(c instanceof X)return I(c.definition,l=>{M(l.definition)===!1&&(n=a(l.definition))}),n;if(c instanceof D)t.push(c.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:t,suffixDef:de(r,i)}),n}o(rs,"possiblePathsFrom");function ns(r,e,t,n){let i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE",c=!1,l=e.length,u=l-n-1,f=[],d=[];for(d.push({idx:-1,def:r,ruleStack:[],occurrenceStack:[]});!M(d);){let p=d.pop();if(p===a){c&&xt(d).idx<=u&&d.pop();continue}let h=p.def,g=p.idx,x=p.ruleStack,k=p.occurrenceStack;if(M(h))continue;let E=h[0];if(E===i){let A={idx:g,def:de(h),ruleStack:Pt(x),occurrenceStack:Pt(k)};d.push(A)}else if(E instanceof D)if(g<l-1){let A=g+1,T=e[A];if(t(T,E.terminalType)){let b={idx:A,def:de(h),ruleStack:x,occurrenceStack:k};d.push(b)}}else if(g===l-1)f.push({nextTokenType:E.terminalType,nextTokenOccurrence:E.idx,ruleStack:x,occurrenceStack:k}),c=!0;else throw Error("non exhaustive match");else if(E instanceof z){let A=te(x);A.push(E.nonTerminalName);let T=te(k);T.push(E.idx);let b={idx:g,def:E.definition.concat(s,de(h)),ruleStack:A,occurrenceStack:T};d.push(b)}else if(E instanceof K){let A={idx:g,def:de(h),ruleStack:x,occurrenceStack:k};d.push(A),d.push(a);let T={idx:g,def:E.definition.concat(de(h)),ruleStack:x,occurrenceStack:k};d.push(T)}else if(E instanceof Q){let A=new F({definition:E.definition,idx:E.idx}),T=E.definition.concat([A],de(h)),b={idx:g,def:T,ruleStack:x,occurrenceStack:k};d.push(b)}else if(E instanceof Z){let A=new D({terminalType:E.separator}),T=new F({definition:[A].concat(E.definition),idx:E.idx}),b=E.definition.concat([T],de(h)),$={idx:g,def:b,ruleStack:x,occurrenceStack:k};d.push($)}else if(E instanceof q){let A={idx:g,def:de(h),ruleStack:x,occurrenceStack:k};d.push(A),d.push(a);let T=new D({terminalType:E.separator}),b=new F({definition:[T].concat(E.definition),idx:E.idx}),$=E.definition.concat([b],de(h)),Te={idx:g,def:$,ruleStack:x,occurrenceStack:k};d.push(Te)}else if(E instanceof F){let A={idx:g,def:de(h),ruleStack:x,occurrenceStack:k};d.push(A),d.push(a);let T=new F({definition:E.definition,idx:E.idx}),b=E.definition.concat([T],de(h)),$={idx:g,def:b,ruleStack:x,occurrenceStack:k};d.push($)}else if(E instanceof X)for(let A=E.definition.length-1;A>=0;A--){let T=E.definition[A],b={idx:g,def:T.definition.concat(de(h)),ruleStack:x,occurrenceStack:k};d.push(b),d.push(a)}else if(E instanceof J)d.push({idx:g,def:E.definition.concat(de(h)),ruleStack:x,occurrenceStack:k});else if(E instanceof Me)d.push(ip(E,g,x,k));else throw Error("non exhaustive match")}return f}o(ns,"nextPossibleTokensAfter");function ip(r,e,t,n){let i=te(t);i.push(r.name);let s=te(n);return s.push(1),{idx:e,def:r.definition,ruleStack:i,occurrenceStack:s}}o(ip,"expandTopLevelRule");var ie;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(ie||(ie={}));function wn(r){if(r instanceof K||r==="Option")return ie.OPTION;if(r instanceof F||r==="Repetition")return ie.REPETITION;if(r instanceof Q||r==="RepetitionMandatory")return ie.REPETITION_MANDATORY;if(r instanceof Z||r==="RepetitionMandatoryWithSeparator")return ie.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof q||r==="RepetitionWithSeparator")return ie.REPETITION_WITH_SEPARATOR;if(r instanceof X||r==="Alternation")return ie.ALTERNATION;throw Error("non exhaustive match")}o(wn,"getProdType");function ss(r){let{occurrence:e,rule:t,prodType:n,maxLookahead:i}=r,s=wn(n);return s===ie.ALTERNATION?Mr(e,t,i):Dr(e,t,s,i)}o(ss,"getLookaheadPaths");function cu(r,e,t,n,i,s){let a=Mr(r,e,t),c=pu(a)?br:kt;return s(a,n,c,i)}o(cu,"buildLookaheadFuncForOr");function lu(r,e,t,n,i,s){let a=Dr(r,e,i,t),c=pu(a)?br:kt;return s(a[0],c,n)}o(lu,"buildLookaheadFuncForOptionalProd");function uu(r,e,t,n){let i=r.length,s=Pe(r,a=>Pe(a,c=>c.length===1));if(e)return function(a){let c=R(a,l=>l.GATE);for(let l=0;l<i;l++){let u=r[l],f=u.length,d=c[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let p=0;p<f;p++){let h=u[p],g=h.length;for(let x=0;x<g;x++){let k=this.LA(x+1);if(t(k,h[x])===!1)continue e}return l}}};if(s&&!n){let a=R(r,l=>fe(l)),c=ae(a,(l,u,f)=>(I(u,d=>{N(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=f),I(d.categoryMatches,p=>{N(l,p)||(l[p]=f)})}),l),{});return function(){let l=this.LA(1);return c[l.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){let c=r[a],l=c.length;e:for(let u=0;u<l;u++){let f=c[u],d=f.length;for(let p=0;p<d;p++){let h=this.LA(p+1);if(t(h,f[p])===!1)continue e}return a}}}}o(uu,"buildAlternativesLookAheadFunc");function fu(r,e,t){let n=Pe(r,s=>s.length===1),i=r.length;if(n&&!t){let s=fe(r);if(s.length===1&&M(s[0].categoryMatches)){let c=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===c}}else{let a=ae(s,(c,l,u)=>(c[l.tokenTypeIdx]=!0,I(l.categoryMatches,f=>{c[f]=!0}),c),[]);return function(){let c=this.LA(1);return a[c.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){let a=r[s],c=a.length;for(let l=0;l<c;l++){let u=this.LA(l+1);if(e(u,a[l])===!1)continue e}return!0}return!1}}o(fu,"buildSingleAlternativeLookaheadFunction");var Wa=class extends vt{static{o(this,"RestDefinitionFinderWalker")}constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=n.concat(i),!0):!1}walkOption(e,t,n){this.checkIsTarget(e,ie.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,ie.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,ie.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,ie.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,ie.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}},is=class extends De{static{o(this,"InsideDefinitionFinderVisitor")}constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,ie.OPTION)}visitRepetition(e){this.checkIsTarget(e,ie.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,ie.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,ie.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,ie.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,ie.ALTERNATION)}};function au(r){let e=new Array(r);for(let t=0;t<r;t++)e[t]=[];return e}o(au,"initializeArrayOfArrays");function Ba(r){let e=[""];for(let t=0;t<r.length;t++){let n=r[t],i=[];for(let s=0;s<e.length;s++){let a=e[s];i.push(a+"_"+n.tokenTypeIdx);for(let c=0;c<n.categoryMatches.length;c++){let l="_"+n.categoryMatches[c];i.push(a+l)}}e=i}return e}o(Ba,"pathToHashKeys");function sp(r,e,t){for(let n=0;n<r.length;n++){if(n===t)continue;let i=r[n];for(let s=0;s<e.length;s++){let a=e[s];if(i[a]===!0)return!1}}return!0}o(sp,"isUniquePrefixHash");function du(r,e){let t=R(r,a=>rs([a],1)),n=au(t.length),i=R(t,a=>{let c={};return I(a,l=>{let u=Ba(l.partialPath);I(u,f=>{c[f]=!0})}),c}),s=t;for(let a=1;a<=e;a++){let c=s;s=au(c.length);for(let l=0;l<c.length;l++){let u=c[l];for(let f=0;f<u.length;f++){let d=u[f].partialPath,p=u[f].suffixDef,h=Ba(d);if(sp(i,h,l)||M(p)||d.length===e){let x=n[l];if(os(x,d)===!1){x.push(d);for(let k=0;k<h.length;k++){let E=h[k];i[l][E]=!0}}}else{let x=rs(p,a+1,d);s[l]=s[l].concat(x),I(x,k=>{let E=Ba(k.partialPath);I(E,A=>{i[l][A]=!0})})}}}}return n}o(du,"lookAheadSequenceFromAlternatives");function Mr(r,e,t,n){let i=new is(r,ie.ALTERNATION,n);return e.accept(i),du(i.result,t)}o(Mr,"getLookaheadPathsForOr");function Dr(r,e,t,n){let i=new is(r,t);e.accept(i);let s=i.result,c=new Wa(e,r,t).startWalking(),l=new J({definition:s}),u=new J({definition:c});return du([l,u],n)}o(Dr,"getLookaheadPathsForOptionalProd");function os(r,e){e:for(let t=0;t<r.length;t++){let n=r[t];if(n.length===e.length){for(let i=0;i<n.length;i++){let s=e[i],a=n[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}o(os,"containsPath");function hu(r,e){return r.length<e.length&&Pe(r,(t,n)=>{let i=e[n];return t===i||i.categoryMatchesMap[t.tokenTypeIdx]})}o(hu,"isStrictPrefixOfPath");function pu(r){return Pe(r,e=>Pe(e,t=>Pe(t,n=>M(n.categoryMatches))))}o(pu,"areTokenCategoriesNotUsed");function mu(r){let e=r.lookaheadStrategy.validate({rules:r.rules,tokenTypes:r.tokenTypes,grammarName:r.grammarName});return R(e,t=>Object.assign({type:ye.CUSTOM_LOOKAHEAD_VALIDATION},t))}o(mu,"validateLookahead");function gu(r,e,t,n){let i=Se(r,l=>op(l,t)),s=dp(r,e,t),a=Se(r,l=>lp(l,t)),c=Se(r,l=>cp(l,r,n,t));return i.concat(s,a,c)}o(gu,"validateGrammar");function op(r,e){let t=new ja;r.accept(t);let n=t.allProductions,i=sl(n,ap),s=Ve(i,c=>c.length>1);return R(re(s),c=>{let l=Ne(c),u=e.buildDuplicateFoundError(r,c),f=Be(l),d={message:u,type:ye.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:f,occurrence:l.idx},p=yu(l);return p&&(d.parameter=p),d})}o(op,"validateDuplicateProductions");function ap(r){return`${Be(r)}_#_${r.idx}_#_${yu(r)}`}o(ap,"identifyProductionForDuplicates");function yu(r){return r instanceof D?r.terminalType.name:r instanceof z?r.nonTerminalName:""}o(yu,"getExtraProductionArgument");var ja=class extends De{static{o(this,"OccurrenceValidationCollector")}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 cp(r,e,t,n){let i=[];if(ae(e,(a,c)=>c.name===r.name?a+1:a,0)>1){let a=n.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});i.push({message:a,type:ye.DUPLICATE_RULE_NAME,ruleName:r.name})}return i}o(cp,"validateRuleDoesNotAlreadyExist");function xu(r,e,t){let n=[],i;return se(e,r)||(i=`Invalid rule override, rule: ->${r}<- cannot be overridden in the grammar: ->${t}<-as it is not defined in any of the super grammars `,n.push({message:i,type:ye.INVALID_RULE_OVERRIDE,ruleName:r})),n}o(xu,"validateRuleIsOverridden");function za(r,e,t,n=[]){let i=[],s=as(e.definition);if(M(s))return[];{let a=r.name;se(s,r)&&i.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:n}),type:ye.LEFT_RECURSION,ruleName:a});let l=Vt(s,n.concat([r])),u=Se(l,f=>{let d=te(n);return d.push(f),za(r,f,t,d)});return i.concat(u)}}o(za,"validateNoLeftRecursion");function as(r){let e=[];if(M(r))return e;let t=Ne(r);if(t instanceof z)e.push(t.referencedRule);else if(t instanceof J||t instanceof K||t instanceof Q||t instanceof Z||t instanceof q||t instanceof F)e=e.concat(as(t.definition));else if(t instanceof X)e=fe(R(t.definition,s=>as(s.definition)));else if(!(t instanceof D))throw Error("non exhaustive match");let n=ir(t),i=r.length>1;if(n&&i){let s=de(r);return e.concat(as(s))}else return e}o(as,"getFirstNoneTerminal");var Ln=class extends De{static{o(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function Tu(r,e){let t=new Ln;r.accept(t);let n=t.alternations;return Se(n,s=>{let a=Pt(s.definition);return Se(a,(c,l)=>{let u=ns([c],[],kt,1);return M(u)?[{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:s,emptyChoiceIdx:l}),type:ye.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:s.idx,alternative:l+1}]:[]})})}o(Tu,"validateEmptyOrAlternative");function Eu(r,e,t){let n=new Ln;r.accept(n);let i=n.alternations;return i=zt(i,a=>a.ignoreAmbiguities===!0),Se(i,a=>{let c=a.idx,l=a.maxLookahead||e,u=Mr(c,r,l,a),f=up(u,a,r,t),d=fp(u,a,r,t);return f.concat(d)})}o(Eu,"validateAmbiguousAlternationAlternatives");var Va=class extends De{static{o(this,"RepetitionCollector")}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 lp(r,e){let t=new Ln;r.accept(t);let n=t.alternations;return Se(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:s}),type:ye.TOO_MANY_ALTS,ruleName:r.name,occurrence:s.idx}]:[])}o(lp,"validateTooManyAlts");function Ru(r,e,t){let n=[];return I(r,i=>{let s=new Va;i.accept(s);let a=s.allProductions;I(a,c=>{let l=wn(c),u=c.maxLookahead||e,f=c.idx,p=Dr(f,i,l,u)[0];if(M(fe(p))){let h=t.buildEmptyRepetitionError({topLevelRule:i,repetition:c});n.push({message:h,type:ye.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}o(Ru,"validateSomeNonEmptyLookaheadPath");function up(r,e,t,n){let i=[],s=ae(r,(c,l,u)=>(e.definition[u].ignoreAmbiguities===!0||I(l,f=>{let d=[u];I(r,(p,h)=>{u!==h&&os(p,f)&&e.definition[h].ignoreAmbiguities!==!0&&d.push(h)}),d.length>1&&!os(i,f)&&(i.push(f),c.push({alts:d,path:f}))}),c),[]);return R(s,c=>{let l=R(c.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:c.path}),type:ye.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:c.alts}})}o(up,"checkAlternativesAmbiguities");function fp(r,e,t,n){let i=ae(r,(a,c,l)=>{let u=R(c,f=>({idx:l,path:f}));return a.concat(u)},[]);return yt(Se(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];let l=a.idx,u=a.path,f=Re(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<l&&hu(p.path,u));return R(f,p=>{let h=[p.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:h,prefixPath:p.path}),type:ye.AMBIGUOUS_PREFIX_ALTS,ruleName:t.name,occurrence:g,alternatives:h}})}))}o(fp,"checkPrefixAlternativesAmbiguities");function dp(r,e,t){let n=[],i=R(e,s=>s.name);return I(r,s=>{let a=s.name;if(se(i,a)){let c=t.buildNamespaceConflictError(s);n.push({message:c,type:ye.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}o(dp,"checkTerminalAndNoneTerminalsNameSpace");function Au(r){let e=on(r,{errMsgProvider:su}),t={};return I(r.rules,n=>{t[n.name]=n}),ou(t,e.errMsgProvider)}o(Au,"resolveGrammar");function vu(r){return r=on(r,{errMsgProvider:nt}),gu(r.rules,r.tokenTypes,r.errMsgProvider,r.grammarName)}o(vu,"validateGrammar");var ku="MismatchedTokenException",Iu="NoViableAltException",Nu="EarlyExitException",Su="NotAllInputParsedException",Cu=[ku,Iu,Nu,Su];Object.freeze(Cu);function Dt(r){return se(Cu,r.name)}o(Dt,"isRecognitionException");var Fr=class extends Error{static{o(this,"RecognitionException")}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},cr=class extends Fr{static{o(this,"MismatchedTokenException")}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=ku}},On=class extends Fr{static{o(this,"NoViableAltException")}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Iu}},Pn=class extends Fr{static{o(this,"NotAllInputParsedException")}constructor(e,t){super(e,t),this.name=Su}},bn=class extends Fr{static{o(this,"EarlyExitException")}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Nu}};var Ka={},qa="InRuleRecoveryException",Ha=class extends Error{static{o(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=qa}},cs=class{static{o(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=N(e,"recoveryEnabled")?e.recoveryEnabled:Fe.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=hp)}getTokenToInsert(e){let t=ar(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,i){let s=this.findReSyncTokenType(),a=this.exportLexerState(),c=[],l=!1,u=this.LA(1),f=this.LA(1),d=o(()=>{let p=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:p,ruleName:this.getCurrRuleFullName()}),g=new cr(h,u,this.LA(0));g.resyncedTokens=Pt(c),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(f,i)){d();return}else if(n.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(f,s)?l=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,c));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Ha("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||M(t))return!1;let n=this.LA(1);return Tt(t,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(t);return se(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),n=2;for(;;){let i=Tt(e,s=>Sn(t,s));if(i!==void 0)return i;t=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Ka;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return R(e,(n,i)=>i===0?Ka:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=R(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return fe(e)}getFollowSetFromFollowKey(e){if(e===Ka)return[qe];let t=e.ruleName+e.idxInCallingRule+Ki+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,qe)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Pt(t)}attemptInRepetitionRecovery(e,t,n,i,s,a,c){}getCurrentGrammarPath(e,t){let n=this.getHumanReadableRuleStack(),i=te(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return R(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function hp(r,e,t,n,i,s,a){let c=this.getKeyForAutomaticLookahead(n,i),l=this.firstAfterRepMap[c];if(l===void 0){let p=this.getCurrRuleFullName(),h=this.getGAstProductions()[p];l=new s(h,i).startWalking(),this.firstAfterRepMap[c]=l}let u=l.token,f=l.occurrence,d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=qe,f=1),!(u===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,f,a)&&this.tryInRepetitionRecovery(r,e,t,u)}o(hp,"attemptInRepetitionRecovery");function ls(r,e,t){return t|e|r}o(ls,"getKeyForAutomaticLookahead");var Ct=class{static{o(this,"LLkLookaheadStrategy")}constructor(e){var t;this.maxLookahead=(t=e?.maxLookahead)!==null&&t!==void 0?t:Fe.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);if(M(t)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...i,...s]}return t}validateNoLeftRecursion(e){return Se(e,t=>za(t,t,nt))}validateEmptyOrAlternatives(e){return Se(e,t=>Tu(t,nt))}validateAmbiguousAlternationAlternatives(e,t){return Se(e,n=>Eu(n,t,nt))}validateSomeNonEmptyLookaheadPath(e,t){return Ru(e,t,nt)}buildLookaheadForAlternation(e){return cu(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,uu)}buildLookaheadForOptional(e){return lu(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,wn(e.prodType),fu)}};var fs=class{static{o(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=N(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Fe.dynamicTokensEnabled,this.maxLookahead=N(e,"maxLookahead")?e.maxLookahead:Fe.maxLookahead,this.lookaheadStrategy=N(e,"lookaheadStrategy")?e.lookaheadStrategy:new Ct({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){I(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:c,repetitionWithSeparator:l}=pp(t);I(n,u=>{let f=u.idx===0?"":u.idx;this.TRACE_INIT(`${Be(u)}${f}`,()=>{let d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:t,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=ls(this.fullRuleNameToShort[t.name],256,u.idx);this.setLaFuncCache(p,d)})}),I(i,u=>{this.computeLookaheadFunc(t,u.idx,768,"Repetition",u.maxLookahead,Be(u))}),I(s,u=>{this.computeLookaheadFunc(t,u.idx,512,"Option",u.maxLookahead,Be(u))}),I(a,u=>{this.computeLookaheadFunc(t,u.idx,1024,"RepetitionMandatory",u.maxLookahead,Be(u))}),I(c,u=>{this.computeLookaheadFunc(t,u.idx,1536,"RepetitionMandatoryWithSeparator",u.maxLookahead,Be(u))}),I(l,u=>{this.computeLookaheadFunc(t,u.idx,1280,"RepetitionWithSeparator",u.maxLookahead,Be(u))})})})}computeLookaheadFunc(e,t,n,i,s,a){this.TRACE_INIT(`${a}${t===0?"":t}`,()=>{let c=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=ls(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(l,c)})}getKeyForAutomaticLookahead(e,t){let n=this.getLastExplicitRuleShortName();return ls(n,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},Xa=class extends De{static{o(this,"DslMethodsCollectorVisitor")}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)}},us=new Xa;function pp(r){us.reset(),r.accept(us);let e=us.dslMethods;return us.reset(),e}o(pp,"collectMethods");function Qa(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset<e.endOffset&&(r.endOffset=e.endOffset)}o(Qa,"setNodeLocationOnlyOffset");function Za(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.startColumn=e.startColumn,r.startLine=e.startLine,r.endOffset=e.endOffset,r.endColumn=e.endColumn,r.endLine=e.endLine):r.endOffset<e.endOffset&&(r.endOffset=e.endOffset,r.endColumn=e.endColumn,r.endLine=e.endLine)}o(Za,"setNodeLocationFull");function _u(r,e,t){r.children[t]===void 0?r.children[t]=[e]:r.children[t].push(e)}o(_u,"addTerminalToCst");function wu(r,e,t){r.children[e]===void 0?r.children[e]=[t]:r.children[e].push(t)}o(wu,"addNoneTerminalToCst");var mp="name";function ec(r,e){Object.defineProperty(r,mp,{enumerable:!1,configurable:!0,writable:!1,value:e})}o(ec,"defineNameProp");function gp(r,e){let t=gt(r),n=t.length;for(let i=0;i<n;i++){let s=t[i],a=r[s],c=a.length;for(let l=0;l<c;l++){let u=a[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}o(gp,"defaultVisit");function Lu(r,e){let t=o(function(){},"derivedConstructor");ec(t,r+"BaseSemantics");let n={visit:o(function(i,s){if(me(i)&&(i=i[0]),!be(i))return this[i.name](i.children,s)},"visit"),validateVisitor:o(function(){let i=yp(this,e);if(!M(i)){let s=R(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
	${s.join(`

`).replace(/\n/g,`
	`)}`)}},"validateVisitor")};return t.prototype=n,t.prototype.constructor=t,t._RULE_NAMES=e,t}o(Lu,"createBaseSemanticVisitorConstructor");function Ou(r,e,t){let n=o(function(){},"derivedConstructor");ec(n,r+"BaseSemanticsWithDefaults");let i=Object.create(t.prototype);return I(e,s=>{i[s]=gp}),n.prototype=i,n.prototype.constructor=n,n}o(Ou,"createBaseVisitorConstructorWithDefaults");var tc;(function(r){r[r.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",r[r.MISSING_METHOD=1]="MISSING_METHOD"})(tc||(tc={}));function yp(r,e){return xp(r,e)}o(yp,"validateVisitor");function xp(r,e){let t=Re(e,i=>it(r[i])===!1),n=R(t,i=>({msg:`Missing visitor method: <${i}> on ${r.constructor.name} CST Visitor.`,type:tc.MISSING_METHOD,methodName:i}));return yt(n)}o(xp,"validateMissingCstMethods");var ms=class{static{o(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=N(e,"nodeLocationTracking")?e.nodeLocationTracking:Fe.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ue,this.cstFinallyStateUpdate=ue,this.cstPostTerminal=ue,this.cstPostNonTerminal=ue,this.cstPostRule=ue;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Za,this.setNodeLocationFromNode=Za,this.cstPostRule=ue,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ue,this.setNodeLocationFromNode=ue,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Qa,this.setNodeLocationFromNode=Qa,this.cstPostRule=ue,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ue,this.setNodeLocationFromNode=ue,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ue,this.setNodeLocationFromNode=ue,this.cstPostRule=ue,this.setInitialNodeLocation=ue;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 t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];_u(n,t,e),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];wu(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(be(this.baseCstVisitorConstructor)){let e=Lu(this.className,gt(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(be(this.baseCstVisitorWithDefaultsConstructor)){let e=Ou(this.className,gt(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 gs=class{static{o(this,"LexerAdapter")}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)):Ur}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Ur:this.tokVector[t]}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 ys=class{static{o(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}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,t,n=Gr){if(se(this.definedRulesNames,e)){let a={message:nt.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ye.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);let i=this.defineRule(e,t,n);return this[e]=i,i}OVERRIDE_RULE(e,t,n=Gr){let i=xu(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let s=this.defineRule(e,t,n);return this[e]=s,s}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,t),!0}catch(i){if(Dt(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return zi(re(this.gastProductionsCache))}};var xs=class{static{o(this,"RecognizerEngine")}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=br,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},N(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
	See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
	For Further details.`);if(me(e)){if(M(e))throw Error(`A Token Vocabulary cannot be empty.
	Note that the first argument for the parser constructor
	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.
	See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
	For Further details.`)}if(me(e))this.tokensMap=ae(e,(s,a)=>(s[a.name]=a,s),{});else if(N(e,"modes")&&Pe(fe(re(e.modes)),Yl)){let s=fe(re(e.modes)),a=an(s);this.tokensMap=ae(a,(c,l)=>(c[l.name]=l,c),{})}else if(il(e))this.tokensMap=te(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=qe;let n=N(e,"modes")?fe(re(e.modes)):re(e),i=Pe(n,s=>M(s.categoryMatches));this.tokenMatcher=i?br:kt,It(re(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=N(n,"resyncEnabled")?n.resyncEnabled:Gr.resyncEnabled,s=N(n,"recoveryValueFunc")?n.recoveryValueFunc:Gr.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let c;return this.outputCst===!0?c=o(function(...f){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):c=o(function(...f){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(c,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){let i=this.RULE_STACK.length===1,s=t&&!this.isBackTracking()&&this.recoveryEnabled;if(Dt(e)){let a=e;if(s){let c=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(c))if(a.resyncedTokens=this.reSyncTo(c),this.outputCst){let l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return n(e);else{if(this.outputCst){let l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,a.partialCstResult=l}throw a}}else{if(i)return this.moveToTerminatedState(),n(e);throw a}}else throw e}optionInternal(e,t){let n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let i=this.getLaFuncFromCache(n),s;if(typeof e!="function"){s=e.DEF;let a=e.GATE;if(a!==void 0){let c=i;i=o(()=>a.call(this)&&c.call(this),"lookAheadFunc")}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,t){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let i=this.getLaFuncFromCache(n),s;if(typeof t!="function"){s=t.DEF;let a=t.GATE;if(a!==void 0){let c=i;i=o(()=>a.call(this)&&c.call(this),"lookAheadFunc")}}else s=t;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,ie.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,1024,e,ts)}atLeastOneSepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){let i=t.DEF,s=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let c=o(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,c,i,_n],c,1536,e,_n)}else throw this.raiseEarlyExitException(e,ie.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let i=this.getLaFuncFromCache(n),s;if(typeof t!="function"){s=t.DEF;let c=t.GATE;if(c!==void 0){let l=i;i=o(()=>c.call(this)&&l.call(this),"lookaheadFunction")}}else s=t;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,es,a)}manySepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){let i=t.DEF,s=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let c=o(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,c,i,Cn],c,1280,e,Cn)}}repetitionSepSecondInternal(e,t,n,i,s){for(;n();)this.CONSUME(t),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,i,s],n,1536,e,s)}doSingleRepetition(e){let t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){let n=this.getKeyForAutomaticLookahead(256,t),i=me(e)?e:e.DEF,a=this.getLaFuncFromCache(n).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(t,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),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Pn(t,e))}}subruleInternal(e,t,n){let i;try{let s=n!==void 0?n.ARGS:void 0;return this.subruleIdx=t,i=e.apply(this,s),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,n,e.ruleName)}}subruleInternalError(e,t,n){throw Dt(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let i;try{let s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,n)}catch(s){i=this.consumeInternalRecovery(e,t,s)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,t,n){let i,s=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new cr(i,t,s))}consumeInternalRecovery(e,t,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===qa?n:s}}else throw n}saveRecogState(){let e=this.errors,t=te(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}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),qe)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var Ts=class{static{o(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=N(e,"errorMessageProvider")?e.errorMessageProvider:Fe.errorMessageProvider}SAVE_ERROR(e){if(Dt(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:te(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return te(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){let i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],c=Dr(e,s,t,this.maxLookahead)[0],l=[];for(let f=1;f<=this.maxLookahead;f++)l.push(this.LA(f));let u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:c,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new bn(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=Mr(e,i,this.maxLookahead),a=[];for(let u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));let c=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:c,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new On(l,this.LA(1),c))}};var Es=class{static{o(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,t){let n=this.gastProductionsCache[e];if(be(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return ns([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let t=Ne(e.ruleStack),i=this.getGAstProductions()[t];return new Zi(i,e).startWalking()}};var vs={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(vs);var Pu=!0,bu=Math.pow(2,8)-1,Mu=Qi({name:"RECORDING_PHASE_TOKEN",pattern:ce.NA});It([Mu]);var Du=ar(Mu,`This IToken indicates the Parser is in Recording Phase
	See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Du);var Ep={name:`This CSTNode indicates the Parser is in Recording Phase
	See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Rs=class{static{o(this,"GastRecorder")}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 t=e>0?e:"";this[`CONSUME${t}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${t}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${t}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${t}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${t}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${t}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${t}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${t}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},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 t=0;t<10;t++){let n=t>0?t:"";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,t){return()=>!0}LA_RECORD(e){return Ur}topLevelRuleRecord(e,t){try{let n=new Me({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
	 This error was thrown during the "grammar recording phase" For more info see:
	https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,t){return Mn.call(this,K,e,t)}atLeastOneInternalRecord(e,t){Mn.call(this,Q,t,e)}atLeastOneSepFirstInternalRecord(e,t){Mn.call(this,Z,t,e,Pu)}manyInternalRecord(e,t){Mn.call(this,F,t,e)}manySepFirstInternalRecord(e,t){Mn.call(this,q,t,e,Pu)}orInternalRecord(e,t){return Rp.call(this,e,t)}subruleInternalRecord(e,t,n){if(As(t),!e||N(e,"ruleName")===!1){let c=new Error(`<SUBRULE${$u(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
 inside top level rule: <${this.recordingProdStack[0].name}>`);throw c.KNOWN_RECORDER_ERROR=!0,c}let i=xt(this.recordingProdStack),s=e.ruleName,a=new z({idx:t,nonTerminalName:s,label:n?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?Ep:vs}consumeInternalRecord(e,t,n){if(As(t),!Ma(e)){let a=new Error(`<CONSUME${$u(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
 inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=xt(this.recordingProdStack),s=new D({idx:t,terminalType:e,label:n?.LABEL});return i.definition.push(s),Du}};function Mn(r,e,t,n=!1){As(t);let i=xt(this.recordingProdStack),s=it(e)?e:e.DEF,a=new r({definition:[],idx:t});return n&&(a.separator=e.SEP),N(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),vs}o(Mn,"recordProd");function Rp(r,e){As(e);let t=xt(this.recordingProdStack),n=me(r)===!1,i=n===!1?r:r.DEF,s=new X({definition:[],idx:e,ignoreAmbiguities:n&&r.IGNORE_AMBIGUITIES===!0});N(r,"MAX_LOOKAHEAD")&&(s.maxLookahead=r.MAX_LOOKAHEAD);let a=ki(i,c=>it(c.GATE));return s.hasPredicates=a,t.definition.push(s),I(i,c=>{let l=new J({definition:[]});s.definition.push(l),N(c,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=c.IGNORE_AMBIGUITIES:N(c,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),c.ALT.call(this),this.recordingProdStack.pop()}),vs}o(Rp,"recordOrProd");function $u(r){return r===0?"":`${r}`}o($u,"getIdxSuffix");function As(r){if(r<0||r>bu){let e=new Error(`Invalid DSL Method idx value: <${r}>
	Idx value must be a none negative value smaller than ${bu+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}o(As,"assertMethodIdxIsValid");var ks=class{static{o(this,"PerformanceTracer")}initPerformanceTracer(e){if(N(e,"traceInitPerf")){let t=e.traceInitPerf,n=typeof t=="number";this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Fe.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){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:s}=vn(t),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return t()}};function Fu(r,e){e.forEach(t=>{let n=t.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let s=Object.getOwnPropertyDescriptor(n,i);s&&(s.get||s.set)?Object.defineProperty(r.prototype,i,s):r.prototype[i]=t.prototype[i]})})}o(Fu,"applyMixins");var Ur=ar(qe,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Ur);var Fe=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:St,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Gr=Object.freeze({recoveryValueFunc:o(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),ye;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",r[r.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ye||(ye={}));function Is(r=void 0){return function(){return r}}o(Is,"EMPTY_ALT");var Dn=class r{static{o(this,"Parser")}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 t=this.className;this.TRACE_INIT("toFastProps",()=>{kn(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),I(this.definedRulesNames,i=>{let a=this[i].originalGrammarAction,c;this.TRACE_INIT(`${i} Rule`,()=>{c=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=c})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Au({rules:re(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(M(n)&&this.skipValidations===!1){let i=vu({rules:re(this.gastProductionsCache),tokenTypes:re(this.tokensMap),errMsgProvider:nt,grammarName:t}),s=mu({lookaheadStrategy:this.lookaheadStrategy,rules:re(this.gastProductionsCache),tokenTypes:re(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(i,s)}}),M(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=wl(re(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:re(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(re(this.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!M(this.definitionErrors))throw e=R(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
 ${e.join(`
-------------------------------
`)}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),N(t,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
	Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
	See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
	For further details.`);this.skipValidations=N(t,"skipValidations")?t.skipValidations:Fe.skipValidations}};Dn.DEFER_DEFINITION_ERRORS_HANDLING=!1;Fu(Dn,[cs,fs,ms,gs,xs,ys,Ts,Es,Rs,ks]);var Fn=class extends Dn{static{o(this,"EmbeddedActionsParser")}constructor(e,t=Fe){let n=te(t);n.outputCst=!1,super(e,n)}};function lr(r,e,t){return`${r.name}_${e}_${t}`}o(lr,"buildATNKey");var Ft=1,vp=2,Uu=4,Gu=5;var jr=7,kp=8,Ip=9,Np=10,Sp=11,Bu=12,Un=class{static{o(this,"AbstractTransition")}constructor(e){this.target=e}isEpsilon(){return!1}},Br=class extends Un{static{o(this,"AtomTransition")}constructor(e,t){super(e),this.tokenType=t}},Gn=class extends Un{static{o(this,"EpsilonTransition")}constructor(e){super(e)}isEpsilon(){return!0}},Wr=class extends Un{static{o(this,"RuleTransition")}constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}};function Wu(r){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Cp(e,r);let t=r.length;for(let n=0;n<t;n++){let i=r[n],s=ur(e,i,i);s!==void 0&&Up(e,i,s)}return e}o(Wu,"createATN");function Cp(r,e){let t=e.length;for(let n=0;n<t;n++){let i=e[n],s=Ee(r,i,void 0,{type:vp}),a=Ee(r,i,void 0,{type:jr});s.stop=a,r.ruleToStartState.set(i,s),r.ruleToStopState.set(i,a)}}o(Cp,"createRuleStartAndStopATNStates");function ju(r,e,t){return t instanceof D?nc(r,e,t.terminalType,t):t instanceof z?Fp(r,e,t):t instanceof X?Pp(r,e,t):t instanceof K?bp(r,e,t):t instanceof F?_p(r,e,t):t instanceof q?wp(r,e,t):t instanceof Q?Lp(r,e,t):t instanceof Z?Op(r,e,t):ur(r,e,t)}o(ju,"atom");function _p(r,e,t){let n=Ee(r,e,t,{type:Gu});Ut(r,n);let i=Vr(r,e,n,t,ur(r,e,t));return zu(r,e,t,i)}o(_p,"repetition");function wp(r,e,t){let n=Ee(r,e,t,{type:Gu});Ut(r,n);let i=Vr(r,e,n,t,ur(r,e,t)),s=nc(r,e,t.separator,t);return zu(r,e,t,i,s)}o(wp,"repetitionSep");function Lp(r,e,t){let n=Ee(r,e,t,{type:Uu});Ut(r,n);let i=Vr(r,e,n,t,ur(r,e,t));return Vu(r,e,t,i)}o(Lp,"repetitionMandatory");function Op(r,e,t){let n=Ee(r,e,t,{type:Uu});Ut(r,n);let i=Vr(r,e,n,t,ur(r,e,t)),s=nc(r,e,t.separator,t);return Vu(r,e,t,i,s)}o(Op,"repetitionMandatorySep");function Pp(r,e,t){let n=Ee(r,e,t,{type:Ft});Ut(r,n);let i=R(t.definition,a=>ju(r,e,a));return Vr(r,e,n,t,...i)}o(Pp,"alternation");function bp(r,e,t){let n=Ee(r,e,t,{type:Ft});Ut(r,n);let i=Vr(r,e,n,t,ur(r,e,t));return $p(r,e,t,i)}o(bp,"option");function ur(r,e,t){let n=Re(R(t.definition,i=>ju(r,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:Dp(r,n)}o(ur,"block");function Vu(r,e,t,n,i){let s=n.left,a=n.right,c=Ee(r,e,t,{type:Sp});Ut(r,c);let l=Ee(r,e,t,{type:Bu});return s.loopback=c,l.loopback=c,r.decisionMap[lr(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",t.idx)]=c,he(a,c),i===void 0?(he(c,s),he(c,l)):(he(c,l),he(c,i.left),he(i.right,s)),{left:s,right:l}}o(Vu,"plus");function zu(r,e,t,n,i){let s=n.left,a=n.right,c=Ee(r,e,t,{type:Np});Ut(r,c);let l=Ee(r,e,t,{type:Bu}),u=Ee(r,e,t,{type:Ip});return c.loopback=u,l.loopback=u,he(c,s),he(c,l),he(a,u),i!==void 0?(he(u,l),he(u,i.left),he(i.right,s)):he(u,c),r.decisionMap[lr(e,i?"RepetitionWithSeparator":"Repetition",t.idx)]=c,{left:c,right:l}}o(zu,"star");function $p(r,e,t,n){let i=n.left,s=n.right;return he(i,s),r.decisionMap[lr(e,"Option",t.idx)]=i,n}o($p,"optional");function Ut(r,e){return r.decisionStates.push(e),e.decision=r.decisionStates.length-1,e.decision}o(Ut,"defineDecisionState");function Vr(r,e,t,n,...i){let s=Ee(r,e,n,{type:kp,start:t});t.end=s;for(let c of i)c!==void 0?(he(t,c.left),he(c.right,s)):he(t,s);let a={left:t,right:s};return r.decisionMap[lr(e,Mp(n),n.idx)]=t,a}o(Vr,"makeAlts");function Mp(r){if(r instanceof X)return"Alternation";if(r instanceof K)return"Option";if(r instanceof F)return"Repetition";if(r instanceof q)return"RepetitionWithSeparator";if(r instanceof Q)return"RepetitionMandatory";if(r instanceof Z)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}o(Mp,"getProdType");function Dp(r,e){let t=e.length;for(let s=0;s<t-1;s++){let a=e[s],c;a.left.transitions.length===1&&(c=a.left.transitions[0]);let l=c instanceof Wr,u=c,f=e[s+1].left;a.left.type===Ft&&a.right.type===Ft&&c!==void 0&&(l&&u.followState===a.right||c.target===a.right)?(l?u.followState=f:c.target=f,Gp(r,a.right)):he(a.right,f)}let n=e[0],i=e[t-1];return{left:n.left,right:i.right}}o(Dp,"makeBlock");function nc(r,e,t,n){let i=Ee(r,e,n,{type:Ft}),s=Ee(r,e,n,{type:Ft});return ic(i,new Br(s,t)),{left:i,right:s}}o(nc,"tokenRef");function Fp(r,e,t){let n=t.referencedRule,i=r.ruleToStartState.get(n),s=Ee(r,e,t,{type:Ft}),a=Ee(r,e,t,{type:Ft}),c=new Wr(i,n,a);return ic(s,c),{left:s,right:a}}o(Fp,"ruleRef");function Up(r,e,t){let n=r.ruleToStartState.get(e);he(n,t.left);let i=r.ruleToStopState.get(e);return he(t.right,i),{left:n,right:i}}o(Up,"buildRuleHandle");function he(r,e){let t=new Gn(e);ic(r,t)}o(he,"epsilon");function Ee(r,e,t,n){let i=Object.assign({atn:r,production:t,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:r.states.length},n);return r.states.push(i),i}o(Ee,"newState");function ic(r,e){r.transitions.length===0&&(r.epsilonOnlyTransitions=e.isEpsilon()),r.transitions.push(e)}o(ic,"addTransition");function Gp(r,e){r.states.splice(r.states.indexOf(e),1)}o(Gp,"removeState");var Bn={},zr=class{static{o(this,"ATNConfigSet")}constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let t=sc(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return R(this.configs,e=>e.alt)}get key(){let e="";for(let t in this.map)e+=t+":";return e}};function sc(r,e=!0){return`${e?`a${r.alt}`:""}s${r.state.stateNumber}:${r.stack.map(t=>t.stateNumber.toString()).join("_")}`}o(sc,"getATNConfigKey");function Bp(r,e){let t={};return n=>{let i=n.toString(),s=t[i];return s!==void 0||(s={atnStartState:r,decision:e,states:{}},t[i]=s),s}}o(Bp,"createDFACache");var Ns=class{static{o(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="",t=this.predicates.length;for(let n=0;n<t;n++)e+=this.predicates[n]===!0?"1":"0";return e}},Ku=new Ns,Wn=class extends Ct{static{o(this,"LLStarLookaheadStrategy")}constructor(e){var t;super(),this.logging=(t=e?.logging)!==null&&t!==void 0?t:n=>console.log(n)}initialize(e){this.atn=Wu(e.rules),this.dfas=Wp(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:t,rule:n,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,c=this.logging,l=lr(n,"Alternation",t),f=this.atn.decisionMap[l].decision,d=R(ss({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:n}),p=>R(p,h=>h[0]));if(Hu(d,!1)&&!s){let p=ae(d,(h,g,x)=>(I(g,k=>{k&&(h[k.tokenTypeIdx]=x,I(k.categoryMatches,E=>{h[E]=x}))}),h),{});return i?function(h){var g;let x=this.LA(1),k=p[x.tokenTypeIdx];if(h!==void 0&&k!==void 0){let E=(g=h[k])===null||g===void 0?void 0:g.GATE;if(E!==void 0&&E.call(this)===!1)return}return k}:function(){let h=this.LA(1);return p[h.tokenTypeIdx]}}else return i?function(p){let h=new Ns,g=p===void 0?0:p.length;for(let k=0;k<g;k++){let E=p?.[k].GATE;h.set(k,E===void 0||E.call(this))}let x=oc.call(this,a,f,h,c);return typeof x=="number"?x:void 0}:function(){let p=oc.call(this,a,f,Ku,c);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:t,rule:n,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,c=this.logging,l=lr(n,i,t),f=this.atn.decisionMap[l].decision,d=R(ss({maxLookahead:1,occurrence:t,prodType:i,rule:n}),p=>R(p,h=>h[0]));if(Hu(d)&&d[0][0]&&!s){let p=d[0],h=fe(p);if(h.length===1&&M(h[0].categoryMatches)){let x=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===x}}else{let g=ae(h,(x,k)=>(k!==void 0&&(x[k.tokenTypeIdx]=!0,I(k.categoryMatches,E=>{x[E]=!0})),x),{});return function(){let x=this.LA(1);return g[x.tokenTypeIdx]===!0}}}return function(){let p=oc.call(this,a,f,Ku,c);return typeof p=="object"?!1:p===0}}};function Hu(r,e=!0){let t=new Set;for(let n of r){let i=new Set;for(let s of n){if(s===void 0){if(e)break;return!1}let a=[s.tokenTypeIdx].concat(s.categoryMatches);for(let c of a)if(t.has(c)){if(!i.has(c))return!1}else t.add(c),i.add(c)}}return!0}o(Hu,"isLL1Sequence");function Wp(r){let e=r.decisionStates.length,t=Array(e);for(let n=0;n<e;n++)t[n]=Bp(r.decisionStates[n],n);return t}o(Wp,"initATNSimulator");function oc(r,e,t,n){let i=r[e](t),s=i.start;if(s===void 0){let c=Zp(i.atnStartState);s=Yu(i,Xu(c)),i.start=s}return jp.apply(this,[i,s,t,n])}o(oc,"adaptivePredict");function jp(r,e,t,n){let i=e,s=1,a=[],c=this.LA(s++);for(;;){let l=Xp(i,c);if(l===void 0&&(l=Vp.apply(this,[r,i,c,s,t,n])),l===Bn)return qp(a,i,c);if(l.isAcceptState===!0)return l.prediction;i=l,a.push(c),c=this.LA(s++)}}o(jp,"performLookahead");function Vp(r,e,t,n,i,s){let a=Yp(e.configs,t,i);if(a.size===0)return qu(r,e,t,Bn),Bn;let c=Xu(a),l=Qp(a,i);if(l!==void 0)c.isAcceptState=!0,c.prediction=l,c.configs.uniqueAlt=l;else if(nm(a)){let u=ol(a.alts);c.isAcceptState=!0,c.prediction=u,c.configs.uniqueAlt=u,zp.apply(this,[r,n,a.alts,s])}return c=qu(r,e,t,c),c}o(Vp,"computeLookaheadTarget");function zp(r,e,t,n){let i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);let s=r.atnStartState,a=s.rule,c=s.production,l=Kp({topLevelRule:a,ambiguityIndices:t,production:c,prefixPath:i});n(l)}o(zp,"reportLookaheadAmbiguity");function Kp(r){let e=R(r.prefixPath,i=>Nt(i)).join(", "),t=r.production.idx===0?"":r.production.idx,n=`Ambiguous Alternatives Detected: <${r.ambiguityIndices.join(", ")}> in <${Hp(r.production)}${t}> inside <${r.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n}o(Kp,"buildAmbiguityError");function Hp(r){if(r instanceof z)return"SUBRULE";if(r instanceof K)return"OPTION";if(r instanceof X)return"OR";if(r instanceof Q)return"AT_LEAST_ONE";if(r instanceof Z)return"AT_LEAST_ONE_SEP";if(r instanceof q)return"MANY_SEP";if(r instanceof F)return"MANY";if(r instanceof D)return"CONSUME";throw Error("non exhaustive match")}o(Hp,"getProductionDslName");function qp(r,e,t){let n=Se(e.configs.elements,s=>s.state.transitions),i=al(n.filter(s=>s instanceof Br).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:t,possibleTokenTypes:i,tokenPath:r}}o(qp,"buildAdaptivePredictError");function Xp(r,e){return r.edges[e.tokenTypeIdx]}o(Xp,"getExistingTargetState");function Yp(r,e,t){let n=new zr,i=[];for(let a of r.elements){if(t.is(a.alt)===!1)continue;if(a.state.type===jr){i.push(a);continue}let c=a.state.transitions.length;for(let l=0;l<c;l++){let u=a.state.transitions[l],f=Jp(u,e);f!==void 0&&n.add({state:f,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&n.size===1&&(s=n),s===void 0){s=new zr;for(let a of n.elements)Ss(a,s)}if(i.length>0&&!tm(s))for(let a of i)s.add(a);return s}o(Yp,"computeReachSet");function Jp(r,e){if(r instanceof Br&&Sn(e,r.tokenType))return r.target}o(Jp,"getReachableTarget");function Qp(r,e){let t;for(let n of r.elements)if(e.is(n.alt)===!0){if(t===void 0)t=n.alt;else if(t!==n.alt)return}return t}o(Qp,"getUniqueAlt");function Xu(r){return{configs:r,edges:{},isAcceptState:!1,prediction:-1}}o(Xu,"newDFAState");function qu(r,e,t,n){return n=Yu(r,n),e.edges[t.tokenTypeIdx]=n,n}o(qu,"addDFAEdge");function Yu(r,e){if(e===Bn)return e;let t=e.configs.key,n=r.states[t];return n!==void 0?n:(e.configs.finalize(),r.states[t]=e,e)}o(Yu,"addDFAState");function Zp(r){let e=new zr,t=r.transitions.length;for(let n=0;n<t;n++){let s={state:r.transitions[n].target,alt:n,stack:[]};Ss(s,e)}return e}o(Zp,"computeStartState");function Ss(r,e){let t=r.state;if(t.type===jr){if(r.stack.length>0){let i=[...r.stack],a={state:i.pop(),alt:r.alt,stack:i};Ss(a,e)}else e.add(r);return}t.epsilonOnlyTransitions||e.add(r);let n=t.transitions.length;for(let i=0;i<n;i++){let s=t.transitions[i],a=em(r,s);a!==void 0&&Ss(a,e)}}o(Ss,"closure");function em(r,e){if(e instanceof Gn)return{state:e.target,alt:r.alt,stack:r.stack};if(e instanceof Wr){let t=[...r.stack,e.followState];return{state:e.target,alt:r.alt,stack:t}}}o(em,"getEpsilonTarget");function tm(r){for(let e of r.elements)if(e.state.type===jr)return!0;return!1}o(tm,"hasConfigInRuleStopState");function rm(r){for(let e of r.elements)if(e.state.type!==jr)return!1;return!0}o(rm,"allConfigsInRuleStopStates");function nm(r){if(rm(r))return!0;let e=im(r.elements);return sm(e)&&!om(e)}o(nm,"hasConflictTerminatingPrediction");function im(r){let e=new Map;for(let t of r){let n=sc(t,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[t.alt]=!0}return e}o(im,"getConflictingAltSets");function sm(r){for(let e of Array.from(r.values()))if(Object.keys(e).length>1)return!0;return!1}o(sm,"hasConflictingAltSet");function om(r){for(let e of Array.from(r.values()))if(Object.keys(e).length===1)return!0;return!1}o(om,"hasStateAssociatedWithOneAlt");var Ju;(function(r){function e(t){return typeof t=="string"}o(e,"is"),r.is=e})(Ju||(Ju={}));var ac;(function(r){function e(t){return typeof t=="string"}o(e,"is"),r.is=e})(ac||(ac={}));var Qu;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&r.MIN_VALUE<=t&&t<=r.MAX_VALUE}o(e,"is"),r.is=e})(Qu||(Qu={}));var Cs;(function(r){r.MIN_VALUE=0,r.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&r.MIN_VALUE<=t&&t<=r.MAX_VALUE}o(e,"is"),r.is=e})(Cs||(Cs={}));var B;(function(r){function e(n,i){return n===Number.MAX_VALUE&&(n=Cs.MAX_VALUE),i===Number.MAX_VALUE&&(i=Cs.MAX_VALUE),{line:n,character:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&m.uinteger(i.line)&&m.uinteger(i.character)}o(t,"is"),r.is=t})(B||(B={}));var U;(function(r){function e(n,i,s,a){if(m.uinteger(n)&&m.uinteger(i)&&m.uinteger(s)&&m.uinteger(a))return{start:B.create(n,i),end:B.create(s,a)};if(B.is(n)&&B.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${s}, ${a}]`)}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&B.is(i.start)&&B.is(i.end)}o(t,"is"),r.is=t})(U||(U={}));var _s;(function(r){function e(n,i){return{uri:n,range:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&U.is(i.range)&&(m.string(i.uri)||m.undefined(i.uri))}o(t,"is"),r.is=t})(_s||(_s={}));var Zu;(function(r){function e(n,i,s,a){return{targetUri:n,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&U.is(i.targetRange)&&m.string(i.targetUri)&&U.is(i.targetSelectionRange)&&(U.is(i.originSelectionRange)||m.undefined(i.originSelectionRange))}o(t,"is"),r.is=t})(Zu||(Zu={}));var cc;(function(r){function e(n,i,s,a){return{red:n,green:i,blue:s,alpha:a}}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&m.numberRange(i.red,0,1)&&m.numberRange(i.green,0,1)&&m.numberRange(i.blue,0,1)&&m.numberRange(i.alpha,0,1)}o(t,"is"),r.is=t})(cc||(cc={}));var ef;(function(r){function e(n,i){return{range:n,color:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&U.is(i.range)&&cc.is(i.color)}o(t,"is"),r.is=t})(ef||(ef={}));var tf;(function(r){function e(n,i,s){return{label:n,textEdit:i,additionalTextEdits:s}}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&m.string(i.label)&&(m.undefined(i.textEdit)||Hr.is(i))&&(m.undefined(i.additionalTextEdits)||m.typedArray(i.additionalTextEdits,Hr.is))}o(t,"is"),r.is=t})(tf||(tf={}));var rf;(function(r){r.Comment="comment",r.Imports="imports",r.Region="region"})(rf||(rf={}));var nf;(function(r){function e(n,i,s,a,c,l){let u={startLine:n,endLine:i};return m.defined(s)&&(u.startCharacter=s),m.defined(a)&&(u.endCharacter=a),m.defined(c)&&(u.kind=c),m.defined(l)&&(u.collapsedText=l),u}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&m.uinteger(i.startLine)&&m.uinteger(i.startLine)&&(m.undefined(i.startCharacter)||m.uinteger(i.startCharacter))&&(m.undefined(i.endCharacter)||m.uinteger(i.endCharacter))&&(m.undefined(i.kind)||m.string(i.kind))}o(t,"is"),r.is=t})(nf||(nf={}));var lc;(function(r){function e(n,i){return{location:n,message:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&_s.is(i.location)&&m.string(i.message)}o(t,"is"),r.is=t})(lc||(lc={}));var sf;(function(r){r.Error=1,r.Warning=2,r.Information=3,r.Hint=4})(sf||(sf={}));var of;(function(r){r.Unnecessary=1,r.Deprecated=2})(of||(of={}));var af;(function(r){function e(t){let n=t;return m.objectLiteral(n)&&m.string(n.href)}o(e,"is"),r.is=e})(af||(af={}));var ws;(function(r){function e(n,i,s,a,c,l){let u={range:n,message:i};return m.defined(s)&&(u.severity=s),m.defined(a)&&(u.code=a),m.defined(c)&&(u.source=c),m.defined(l)&&(u.relatedInformation=l),u}o(e,"create"),r.create=e;function t(n){var i;let s=n;return m.defined(s)&&U.is(s.range)&&m.string(s.message)&&(m.number(s.severity)||m.undefined(s.severity))&&(m.integer(s.code)||m.string(s.code)||m.undefined(s.code))&&(m.undefined(s.codeDescription)||m.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(m.string(s.source)||m.undefined(s.source))&&(m.undefined(s.relatedInformation)||m.typedArray(s.relatedInformation,lc.is))}o(t,"is"),r.is=t})(ws||(ws={}));var Kr;(function(r){function e(n,i,...s){let a={title:n,command:i};return m.defined(s)&&s.length>0&&(a.arguments=s),a}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&m.string(i.title)&&m.string(i.command)}o(t,"is"),r.is=t})(Kr||(Kr={}));var Hr;(function(r){function e(s,a){return{range:s,newText:a}}o(e,"replace"),r.replace=e;function t(s,a){return{range:{start:s,end:s},newText:a}}o(t,"insert"),r.insert=t;function n(s){return{range:s,newText:""}}o(n,"del"),r.del=n;function i(s){let a=s;return m.objectLiteral(a)&&m.string(a.newText)&&U.is(a.range)}o(i,"is"),r.is=i})(Hr||(Hr={}));var uc;(function(r){function e(n,i,s){let a={label:n};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&m.string(i.label)&&(m.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(m.string(i.description)||i.description===void 0)}o(t,"is"),r.is=t})(uc||(uc={}));var qr;(function(r){function e(t){let n=t;return m.string(n)}o(e,"is"),r.is=e})(qr||(qr={}));var cf;(function(r){function e(s,a,c){return{range:s,newText:a,annotationId:c}}o(e,"replace"),r.replace=e;function t(s,a,c){return{range:{start:s,end:s},newText:a,annotationId:c}}o(t,"insert"),r.insert=t;function n(s,a){return{range:s,newText:"",annotationId:a}}o(n,"del"),r.del=n;function i(s){let a=s;return Hr.is(a)&&(uc.is(a.annotationId)||qr.is(a.annotationId))}o(i,"is"),r.is=i})(cf||(cf={}));var fc;(function(r){function e(n,i){return{textDocument:n,edits:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&gc.is(i.textDocument)&&Array.isArray(i.edits)}o(t,"is"),r.is=t})(fc||(fc={}));var dc;(function(r){function e(n,i,s){let a={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}o(e,"create"),r.create=e;function t(n){let i=n;return i&&i.kind==="create"&&m.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||m.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||m.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||qr.is(i.annotationId))}o(t,"is"),r.is=t})(dc||(dc={}));var hc;(function(r){function e(n,i,s,a){let c={kind:"rename",oldUri:n,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(c.options=s),a!==void 0&&(c.annotationId=a),c}o(e,"create"),r.create=e;function t(n){let i=n;return i&&i.kind==="rename"&&m.string(i.oldUri)&&m.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||m.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||m.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||qr.is(i.annotationId))}o(t,"is"),r.is=t})(hc||(hc={}));var pc;(function(r){function e(n,i,s){let a={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}o(e,"create"),r.create=e;function t(n){let i=n;return i&&i.kind==="delete"&&m.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||m.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||m.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||qr.is(i.annotationId))}o(t,"is"),r.is=t})(pc||(pc={}));var mc;(function(r){function e(t){let n=t;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>m.string(i.kind)?dc.is(i)||hc.is(i)||pc.is(i):fc.is(i)))}o(e,"is"),r.is=e})(mc||(mc={}));var lf;(function(r){function e(n){return{uri:n}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&m.string(i.uri)}o(t,"is"),r.is=t})(lf||(lf={}));var uf;(function(r){function e(n,i){return{uri:n,version:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&m.string(i.uri)&&m.integer(i.version)}o(t,"is"),r.is=t})(uf||(uf={}));var gc;(function(r){function e(n,i){return{uri:n,version:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&m.string(i.uri)&&(i.version===null||m.integer(i.version))}o(t,"is"),r.is=t})(gc||(gc={}));var ff;(function(r){function e(n,i,s,a){return{uri:n,languageId:i,version:s,text:a}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&m.string(i.uri)&&m.string(i.languageId)&&m.integer(i.version)&&m.string(i.text)}o(t,"is"),r.is=t})(ff||(ff={}));var yc;(function(r){r.PlainText="plaintext",r.Markdown="markdown";function e(t){let n=t;return n===r.PlainText||n===r.Markdown}o(e,"is"),r.is=e})(yc||(yc={}));var jn;(function(r){function e(t){let n=t;return m.objectLiteral(t)&&yc.is(n.kind)&&m.string(n.value)}o(e,"is"),r.is=e})(jn||(jn={}));var df;(function(r){r.Text=1,r.Method=2,r.Function=3,r.Constructor=4,r.Field=5,r.Variable=6,r.Class=7,r.Interface=8,r.Module=9,r.Property=10,r.Unit=11,r.Value=12,r.Enum=13,r.Keyword=14,r.Snippet=15,r.Color=16,r.File=17,r.Reference=18,r.Folder=19,r.EnumMember=20,r.Constant=21,r.Struct=22,r.Event=23,r.Operator=24,r.TypeParameter=25})(df||(df={}));var hf;(function(r){r.PlainText=1,r.Snippet=2})(hf||(hf={}));var pf;(function(r){r.Deprecated=1})(pf||(pf={}));var mf;(function(r){function e(n,i,s){return{newText:n,insert:i,replace:s}}o(e,"create"),r.create=e;function t(n){let i=n;return i&&m.string(i.newText)&&U.is(i.insert)&&U.is(i.replace)}o(t,"is"),r.is=t})(mf||(mf={}));var gf;(function(r){r.asIs=1,r.adjustIndentation=2})(gf||(gf={}));var yf;(function(r){function e(t){let n=t;return n&&(m.string(n.detail)||n.detail===void 0)&&(m.string(n.description)||n.description===void 0)}o(e,"is"),r.is=e})(yf||(yf={}));var xf;(function(r){function e(t){return{label:t}}o(e,"create"),r.create=e})(xf||(xf={}));var Tf;(function(r){function e(t,n){return{items:t||[],isIncomplete:!!n}}o(e,"create"),r.create=e})(Tf||(Tf={}));var Ls;(function(r){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}o(e,"fromPlainText"),r.fromPlainText=e;function t(n){let i=n;return m.string(i)||m.objectLiteral(i)&&m.string(i.language)&&m.string(i.value)}o(t,"is"),r.is=t})(Ls||(Ls={}));var Ef;(function(r){function e(t){let n=t;return!!n&&m.objectLiteral(n)&&(jn.is(n.contents)||Ls.is(n.contents)||m.typedArray(n.contents,Ls.is))&&(t.range===void 0||U.is(t.range))}o(e,"is"),r.is=e})(Ef||(Ef={}));var Rf;(function(r){function e(t,n){return n?{label:t,documentation:n}:{label:t}}o(e,"create"),r.create=e})(Rf||(Rf={}));var Af;(function(r){function e(t,n,...i){let s={label:t};return m.defined(n)&&(s.documentation=n),m.defined(i)?s.parameters=i:s.parameters=[],s}o(e,"create"),r.create=e})(Af||(Af={}));var vf;(function(r){r.Text=1,r.Read=2,r.Write=3})(vf||(vf={}));var kf;(function(r){function e(t,n){let i={range:t};return m.number(n)&&(i.kind=n),i}o(e,"create"),r.create=e})(kf||(kf={}));var If;(function(r){r.File=1,r.Module=2,r.Namespace=3,r.Package=4,r.Class=5,r.Method=6,r.Property=7,r.Field=8,r.Constructor=9,r.Enum=10,r.Interface=11,r.Function=12,r.Variable=13,r.Constant=14,r.String=15,r.Number=16,r.Boolean=17,r.Array=18,r.Object=19,r.Key=20,r.Null=21,r.EnumMember=22,r.Struct=23,r.Event=24,r.Operator=25,r.TypeParameter=26})(If||(If={}));var Nf;(function(r){r.Deprecated=1})(Nf||(Nf={}));var Sf;(function(r){function e(t,n,i,s,a){let c={name:t,kind:n,location:{uri:s,range:i}};return a&&(c.containerName=a),c}o(e,"create"),r.create=e})(Sf||(Sf={}));var Cf;(function(r){function e(t,n,i,s){return s!==void 0?{name:t,kind:n,location:{uri:i,range:s}}:{name:t,kind:n,location:{uri:i}}}o(e,"create"),r.create=e})(Cf||(Cf={}));var _f;(function(r){function e(n,i,s,a,c,l){let u={name:n,detail:i,kind:s,range:a,selectionRange:c};return l!==void 0&&(u.children=l),u}o(e,"create"),r.create=e;function t(n){let i=n;return i&&m.string(i.name)&&m.number(i.kind)&&U.is(i.range)&&U.is(i.selectionRange)&&(i.detail===void 0||m.string(i.detail))&&(i.deprecated===void 0||m.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}o(t,"is"),r.is=t})(_f||(_f={}));var wf;(function(r){r.Empty="",r.QuickFix="quickfix",r.Refactor="refactor",r.RefactorExtract="refactor.extract",r.RefactorInline="refactor.inline",r.RefactorRewrite="refactor.rewrite",r.Source="source",r.SourceOrganizeImports="source.organizeImports",r.SourceFixAll="source.fixAll"})(wf||(wf={}));var Os;(function(r){r.Invoked=1,r.Automatic=2})(Os||(Os={}));var Lf;(function(r){function e(n,i,s){let a={diagnostics:n};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&m.typedArray(i.diagnostics,ws.is)&&(i.only===void 0||m.typedArray(i.only,m.string))&&(i.triggerKind===void 0||i.triggerKind===Os.Invoked||i.triggerKind===Os.Automatic)}o(t,"is"),r.is=t})(Lf||(Lf={}));var Of;(function(r){function e(n,i,s){let a={title:n},c=!0;return typeof i=="string"?(c=!1,a.kind=i):Kr.is(i)?a.command=i:a.edit=i,c&&s!==void 0&&(a.kind=s),a}o(e,"create"),r.create=e;function t(n){let i=n;return i&&m.string(i.title)&&(i.diagnostics===void 0||m.typedArray(i.diagnostics,ws.is))&&(i.kind===void 0||m.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Kr.is(i.command))&&(i.isPreferred===void 0||m.boolean(i.isPreferred))&&(i.edit===void 0||mc.is(i.edit))}o(t,"is"),r.is=t})(Of||(Of={}));var Pf;(function(r){function e(n,i){let s={range:n};return m.defined(i)&&(s.data=i),s}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&U.is(i.range)&&(m.undefined(i.command)||Kr.is(i.command))}o(t,"is"),r.is=t})(Pf||(Pf={}));var bf;(function(r){function e(n,i){return{tabSize:n,insertSpaces:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&m.uinteger(i.tabSize)&&m.boolean(i.insertSpaces)}o(t,"is"),r.is=t})(bf||(bf={}));var $f;(function(r){function e(n,i,s){return{range:n,target:i,data:s}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&U.is(i.range)&&(m.undefined(i.target)||m.string(i.target))}o(t,"is"),r.is=t})($f||($f={}));var Mf;(function(r){function e(n,i){return{range:n,parent:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&U.is(i.range)&&(i.parent===void 0||r.is(i.parent))}o(t,"is"),r.is=t})(Mf||(Mf={}));var Df;(function(r){r.namespace="namespace",r.type="type",r.class="class",r.enum="enum",r.interface="interface",r.struct="struct",r.typeParameter="typeParameter",r.parameter="parameter",r.variable="variable",r.property="property",r.enumMember="enumMember",r.event="event",r.function="function",r.method="method",r.macro="macro",r.keyword="keyword",r.modifier="modifier",r.comment="comment",r.string="string",r.number="number",r.regexp="regexp",r.operator="operator",r.decorator="decorator"})(Df||(Df={}));var Ff;(function(r){r.declaration="declaration",r.definition="definition",r.readonly="readonly",r.static="static",r.deprecated="deprecated",r.abstract="abstract",r.async="async",r.modification="modification",r.documentation="documentation",r.defaultLibrary="defaultLibrary"})(Ff||(Ff={}));var Uf;(function(r){function e(t){let n=t;return m.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}o(e,"is"),r.is=e})(Uf||(Uf={}));var Gf;(function(r){function e(n,i){return{range:n,text:i}}o(e,"create"),r.create=e;function t(n){let i=n;return i!=null&&U.is(i.range)&&m.string(i.text)}o(t,"is"),r.is=t})(Gf||(Gf={}));var Bf;(function(r){function e(n,i,s){return{range:n,variableName:i,caseSensitiveLookup:s}}o(e,"create"),r.create=e;function t(n){let i=n;return i!=null&&U.is(i.range)&&m.boolean(i.caseSensitiveLookup)&&(m.string(i.variableName)||i.variableName===void 0)}o(t,"is"),r.is=t})(Bf||(Bf={}));var Wf;(function(r){function e(n,i){return{range:n,expression:i}}o(e,"create"),r.create=e;function t(n){let i=n;return i!=null&&U.is(i.range)&&(m.string(i.expression)||i.expression===void 0)}o(t,"is"),r.is=t})(Wf||(Wf={}));var jf;(function(r){function e(n,i){return{frameId:n,stoppedLocation:i}}o(e,"create"),r.create=e;function t(n){let i=n;return m.defined(i)&&U.is(n.stoppedLocation)}o(t,"is"),r.is=t})(jf||(jf={}));var xc;(function(r){r.Type=1,r.Parameter=2;function e(t){return t===1||t===2}o(e,"is"),r.is=e})(xc||(xc={}));var Tc;(function(r){function e(n){return{value:n}}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&(i.tooltip===void 0||m.string(i.tooltip)||jn.is(i.tooltip))&&(i.location===void 0||_s.is(i.location))&&(i.command===void 0||Kr.is(i.command))}o(t,"is"),r.is=t})(Tc||(Tc={}));var Vf;(function(r){function e(n,i,s){let a={position:n,label:i};return s!==void 0&&(a.kind=s),a}o(e,"create"),r.create=e;function t(n){let i=n;return m.objectLiteral(i)&&B.is(i.position)&&(m.string(i.label)||m.typedArray(i.label,Tc.is))&&(i.kind===void 0||xc.is(i.kind))&&i.textEdits===void 0||m.typedArray(i.textEdits,Hr.is)&&(i.tooltip===void 0||m.string(i.tooltip)||jn.is(i.tooltip))&&(i.paddingLeft===void 0||m.boolean(i.paddingLeft))&&(i.paddingRight===void 0||m.boolean(i.paddingRight))}o(t,"is"),r.is=t})(Vf||(Vf={}));var zf;(function(r){function e(t){return{kind:"snippet",value:t}}o(e,"createSnippet"),r.createSnippet=e})(zf||(zf={}));var Kf;(function(r){function e(t,n,i,s){return{insertText:t,filterText:n,range:i,command:s}}o(e,"create"),r.create=e})(Kf||(Kf={}));var Hf;(function(r){function e(t){return{items:t}}o(e,"create"),r.create=e})(Hf||(Hf={}));var qf;(function(r){r.Invoked=0,r.Automatic=1})(qf||(qf={}));var Xf;(function(r){function e(t,n){return{range:t,text:n}}o(e,"create"),r.create=e})(Xf||(Xf={}));var Yf;(function(r){function e(t,n){return{triggerKind:t,selectedCompletionInfo:n}}o(e,"create"),r.create=e})(Yf||(Yf={}));var Jf;(function(r){function e(t){let n=t;return m.objectLiteral(n)&&ac.is(n.uri)&&m.string(n.name)}o(e,"is"),r.is=e})(Jf||(Jf={}));var Qf;(function(r){function e(s,a,c,l){return new Ec(s,a,c,l)}o(e,"create"),r.create=e;function t(s){let a=s;return!!(m.defined(a)&&m.string(a.uri)&&(m.undefined(a.languageId)||m.string(a.languageId))&&m.uinteger(a.lineCount)&&m.func(a.getText)&&m.func(a.positionAt)&&m.func(a.offsetAt))}o(t,"is"),r.is=t;function n(s,a){let c=s.getText(),l=i(a,(f,d)=>{let p=f.range.start.line-d.range.start.line;return p===0?f.range.start.character-d.range.start.character:p}),u=c.length;for(let f=l.length-1;f>=0;f--){let d=l[f],p=s.offsetAt(d.range.start),h=s.offsetAt(d.range.end);if(h<=u)c=c.substring(0,p)+d.newText+c.substring(h,c.length);else throw new Error("Overlapping edit");u=p}return c}o(n,"applyEdits"),r.applyEdits=n;function i(s,a){if(s.length<=1)return s;let c=s.length/2|0,l=s.slice(0,c),u=s.slice(c);i(l,a),i(u,a);let f=0,d=0,p=0;for(;f<l.length&&d<u.length;)a(l[f],u[d])<=0?s[p++]=l[f++]:s[p++]=u[d++];for(;f<l.length;)s[p++]=l[f++];for(;d<u.length;)s[p++]=u[d++];return s}o(i,"mergeSort")})(Qf||(Qf={}));var Ec=class{static{o(this,"FullTextDocument")}constructor(e,t,n,i){this._uri=e,this._languageId=t,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 t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let i=0;i<t.length;i++){n&&(e.push(i),n=!1);let s=t.charAt(i);n=s==="\r"||s===`
`,s==="\r"&&i+1<t.length&&t.charAt(i+1)===`
`&&i++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,i=t.length;if(i===0)return B.create(0,e);for(;n<i;){let a=Math.floor((n+i)/2);t[a]>e?i=a:n=a+1}let s=n-1;return B.create(s,e-t[s])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}},m;(function(r){let e=Object.prototype.toString;function t(h){return typeof h<"u"}o(t,"defined"),r.defined=t;function n(h){return typeof h>"u"}o(n,"undefined"),r.undefined=n;function i(h){return h===!0||h===!1}o(i,"boolean"),r.boolean=i;function s(h){return e.call(h)==="[object String]"}o(s,"string"),r.string=s;function a(h){return e.call(h)==="[object Number]"}o(a,"number"),r.number=a;function c(h,g,x){return e.call(h)==="[object Number]"&&g<=h&&h<=x}o(c,"numberRange"),r.numberRange=c;function l(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}o(l,"integer"),r.integer=l;function u(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}o(u,"uinteger"),r.uinteger=u;function f(h){return e.call(h)==="[object Function]"}o(f,"func"),r.func=f;function d(h){return h!==null&&typeof h=="object"}o(d,"objectLiteral"),r.objectLiteral=d;function p(h,g){return Array.isArray(h)&&h.every(g)}o(p,"typedArray"),r.typedArray=p})(m||(m={}));var Vn=class{static{o(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new Xr(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let t=new dr;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){let n=new fr(e.startOffset,e.image.length,vr(e),e.tokenType,!1);return n.grammarSource=t,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let t=e.container;if(t){let n=t.content.indexOf(e);n>=0&&t.content.splice(n,1)}}construct(e){let t=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=t;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}addHiddenTokens(e){for(let t of e){let n=new fr(t.startOffset,t.image.length,vr(t),t.tokenType,!0);n.root=this.rootNode,this.addHiddenToken(this.rootNode,n)}}addHiddenToken(e,t){let{offset:n,end:i}=t;for(let s=0;s<e.content.length;s++){let a=e.content[s],{offset:c,end:l}=a;if(ze(a)&&n>c&&i<l){this.addHiddenToken(a,t);return}else if(i<=c){e.content.splice(s,0,t);return}}e.content.push(t)}},zn=class{static{o(this,"AbstractCstNode")}get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,t;let n=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(t=this.container)===null||t===void 0?void 0:t.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)}},fr=class extends zn{static{o(this,"LeafCstNodeImpl")}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,t,n,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=t,this._range=n}},dr=class extends zn{static{o(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new Rc(this)}get children(){return this.content}get offset(){var e,t;return(t=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&t!==void 0?t:0}get length(){return this.end-this.offset}get end(){var e,t;return(t=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&t!==void 0?t:0}get range(){let e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=t;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:B.create(0,0),end:B.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 t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},Rc=class r extends Array{static{o(this,"CstNodeContainer")}constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,r.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...n){return this.addParents(n),super.splice(e,t,...n)}addParents(e){for(let t of e)t.container=this.parent}},Xr=class extends dr{static{o(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var Ps=Symbol("Datatype");function Ac(r){return r.$type===Ps}o(Ac,"isDataTypeNode");var Zf="\u200B",ed=o(r=>r.endsWith(Zf)?r:r+Zf,"withRuleSuffix"),Kn=class{static{o(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map,this.lexer=e.parser.Lexer;let t=this.lexer.definition;this.wrapper=new vc(t,Object.assign(Object.assign({},e.parser.ParserConfig),{errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},Hn=class extends Kn{static{o(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Vn,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){let n=e.fragment?void 0:Rn(e)?Ps:nr(e),i=this.wrapper.DEFINE_RULE(ed(e.name),this.startImplementation(n,t).bind(this));return e.entry&&(this.mainRule=i),i}parse(e){this.nodeBuilder.buildRootNode(e);let t=this.lexer.tokenize(e);this.wrapper.input=t.tokens;let n=this.mainRule.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(t.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:t.errors,parserErrors:this.wrapper.errors}}startImplementation(e,t){return n=>{if(!this.isRecording()){let s={$type:e};this.stack.push(s),e===Ps&&(s.value="")}let i;try{i=t(n)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,t,n){let i=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(i)){let s=this.nodeBuilder.buildLeafNode(i,n),{assignment:a,isCrossRef:c}=this.getAssignment(n),l=this.current;if(a){let u=Je(n)?i.image:this.converter.convert(i.image,s);this.assign(a.operator,a.feature,u,s,c)}else if(Ac(l)){let u=i.image;Je(n)||(u=this.converter.convert(u,s).toString()),l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,n,i){let s;this.isRecording()||(s=this.nodeBuilder.buildCompositeNode(n));let a=this.wrapper.wrapSubrule(e,t,i);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(a,n,s)}performSubruleAssignment(e,t,n){let{assignment:i,isCrossRef:s}=this.getAssignment(t);if(i)this.assign(i.operator,i.feature,e,n,s);else if(!i){let a=this.current;if(Ac(a))a.value+=e.toString();else if(typeof e=="object"&&e){let c=e.$type,l=this.assignWithoutOverride(e,a);c&&(l.$type=c);let u=l;this.stack.pop(),this.stack.push(u)}}}action(e,t){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&t.feature&&t.operator){n=this.construct(!1);let s=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(s)}let i={$type:e};this.stack.pop(),this.stack.push(i),t.feature&&t.operator&&this.assign(t.operator,t.feature,n,n.$cstNode,!1)}}construct(e=!0){if(this.isRecording())return;let t=this.current;return Di(t),this.nodeBuilder.construct(t),e&&this.stack.pop(),Ac(t)?this.converter.convert(t.value,t.$cstNode):(aa(this.astReflection,t),t)}getAssignment(e){if(!this.assignmentMap.has(e)){let t=Qt(e,tt);this.assignmentMap.set(e,{assignment:t,isCrossRef:t?Jt(t.terminal):!1})}return this.assignmentMap.get(e)}assign(e,t,n,i,s){let a=this.current,c;switch(s&&typeof n=="string"?c=this.linker.buildReference(a,t,i,n):c=n,e){case"=":{a[t]=c;break}case"?=":{a[t]=!0;break}case"+=":Array.isArray(a[t])||(a[t]=[]),a[t].push(c)}}assignWithoutOverride(e,t){for(let[n,i]of Object.entries(t)){let s=e[n];s===void 0?e[n]=i:Array.isArray(s)&&Array.isArray(i)&&(i.push(...s),e[n]=i)}return e}get definitionErrors(){return this.wrapper.definitionErrors}},bs=class{static{o(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return St.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return St.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return St.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return St.buildEarlyExitMessage(e)}},Yr=class extends bs{static{o(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:e,actual:t}){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 \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},qn=class extends Kn{static{o(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let t=this.lexer.tokenize(e);return this.tokens=t.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,t){let n=this.wrapper.DEFINE_RULE(ed(e.name),this.startImplementation(t).bind(this));return e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{let n=this.keepStackSize();try{e(t)}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,t,n){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,n,i){this.before(n),this.wrapper.wrapSubrule(e,t,i),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},am={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Yr},vc=class extends Fn{static{o(this,"ChevrotainWrapper")}constructor(e,t){let n=t&&"maxLookahead"in t;super(e,Object.assign(Object.assign(Object.assign({},am),{lookaheadStrategy:n?new Ct({maxLookahead:t.maxLookahead}):new Wn}),t))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t){return this.RULE(e,t)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t)}wrapSubrule(e,t,n){return this.subrule(e,t,{ARGS:[n]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}};function Ms(r,e,t){return cm({parser:e,tokens:t,rules:new Map,ruleNames:new Map},r),e}o(Ms,"createParser");function cm(r,e){let t=Tn(e,!1),n=V(e.rules).filter(_e).filter(i=>t.has(i));for(let i of n){let s=Object.assign(Object.assign({},r),{consume:1,optional:1,subrule:1,many:1,or:1});s.rules.set(i.name,r.parser.rule(i,hr(s,i.definition)))}}o(cm,"buildRules");function hr(r,e,t=!1){let n;if(Je(e))n=mm(r,e);else if(Rt(e))n=lm(r,e);else if(tt(e))n=hr(r,e.terminal);else if(Jt(e))n=td(r,e);else if(rt(e))n=um(r,e);else if(bi(e))n=dm(r,e);else if(Mi(e))n=hm(r,e);else if(Mt(e))n=pm(r,e);else if(Bo(e)){let i=r.consume++;n=o(()=>r.parser.consume(i,qe,e),"method")}else throw new Yt(e.$cstNode,`Unexpected element type: ${e.$type}`);return rd(r,t?void 0:$s(e),n,e.cardinality)}o(hr,"buildElement");function lm(r,e){let t=nr(e);return()=>r.parser.action(t,e)}o(lm,"buildAction");function um(r,e){let t=e.rule.ref;if(_e(t)){let n=r.subrule++,i=e.arguments.length>0?fm(t,e.arguments):()=>({});return s=>r.parser.subrule(n,nd(r,t),e,i(s))}else if(Ye(t)){let n=r.consume++,i=kc(r,t.name);return()=>r.parser.consume(n,i,e)}else if(t)$t(t);else throw new Yt(e.$cstNode,`Undefined rule type: ${e.$type}`)}o(um,"buildRuleCall");function fm(r,e){let t=e.map(n=>_t(n.value));return n=>{let i={};for(let s=0;s<t.length;s++){let a=r.parameters[s],c=t[s];i[a.name]=c(n)}return i}}o(fm,"buildRuleCallPredicate");function _t(r){if(mo(r)){let e=_t(r.left),t=_t(r.right);return n=>e(n)||t(n)}else if(ho(r)){let e=_t(r.left),t=_t(r.right);return n=>e(n)&&t(n)}else if(Eo(r)){let e=_t(r.value);return t=>!e(t)}else if(ko(r)){let e=r.parameter.ref.name;return t=>t!==void 0&&t[e]===!0}else if(uo(r)){let e=!!r.true;return()=>e}$t(r)}o(_t,"buildPredicate");function dm(r,e){if(e.elements.length===1)return hr(r,e.elements[0]);{let t=[];for(let i of e.elements){let s={ALT:hr(r,i,!0)},a=$s(i);a&&(s.GATE=_t(a)),t.push(s)}let n=r.or++;return i=>r.parser.alternatives(n,t.map(s=>{let a={ALT:o(()=>s.ALT(i),"ALT")},c=s.GATE;return c&&(a.GATE=()=>c(i)),a}))}}o(dm,"buildAlternatives");function hm(r,e){if(e.elements.length===1)return hr(r,e.elements[0]);let t=[];for(let c of e.elements){let l={ALT:hr(r,c,!0)},u=$s(c);u&&(l.GATE=_t(u)),t.push(l)}let n=r.or++,i=o((c,l)=>{let u=l.getRuleStack().join("-");return`uGroup_${c}_${u}`},"idFunc"),s=o(c=>r.parser.alternatives(n,t.map((l,u)=>{let f={ALT:o(()=>!0,"ALT")},d=r.parser;f.ALT=()=>{if(l.ALT(c),!d.isRecording()){let h=i(n,d);d.unorderedGroups.get(h)||d.unorderedGroups.set(h,[]);let g=d.unorderedGroups.get(h);typeof g?.[u]>"u"&&(g[u]=!0)}};let p=l.GATE;return p?f.GATE=()=>p(c):f.GATE=()=>{let h=d.unorderedGroups.get(i(n,d));return!h?.[u]},f})),"alternatives"),a=rd(r,$s(e),s,"*");return c=>{a(c),r.parser.isRecording()||r.parser.unorderedGroups.delete(i(n,r.parser))}}o(hm,"buildUnorderedGroup");function pm(r,e){let t=e.elements.map(n=>hr(r,n));return n=>t.forEach(i=>i(n))}o(pm,"buildGroup");function $s(r){if(Mt(r))return r.guardCondition}o($s,"getGuardCondition");function td(r,e,t=e.terminal){if(t)if(rt(t)&&_e(t.rule.ref)){let n=r.subrule++;return i=>r.parser.subrule(n,nd(r,t.rule.ref),e,i)}else if(rt(t)&&Ye(t.rule.ref)){let n=r.consume++,i=kc(r,t.rule.ref.name);return()=>r.parser.consume(n,i,e)}else if(Je(t)){let n=r.consume++,i=kc(r,t.value);return()=>r.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=ji(e.type.ref),i=n?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+nr(e.type.ref));return td(r,e,i)}}o(td,"buildCrossReference");function mm(r,e){let t=r.consume++,n=r.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>r.parser.consume(t,n,e)}o(mm,"buildKeyword");function rd(r,e,t,n){let i=e&&_t(e);if(!n)if(i){let s=r.or++;return a=>r.parser.alternatives(s,[{ALT:o(()=>t(a),"ALT"),GATE:o(()=>i(a),"GATE")},{ALT:Is(),GATE:o(()=>!i(a),"GATE")}])}else return t;if(n==="*"){let s=r.many++;return a=>r.parser.many(s,{DEF:o(()=>t(a),"DEF"),GATE:i?()=>i(a):void 0})}else if(n==="+"){let s=r.many++;if(i){let a=r.or++;return c=>r.parser.alternatives(a,[{ALT:o(()=>r.parser.atLeastOne(s,{DEF:o(()=>t(c),"DEF")}),"ALT"),GATE:o(()=>i(c),"GATE")},{ALT:Is(),GATE:o(()=>!i(c),"GATE")}])}else return a=>r.parser.atLeastOne(s,{DEF:o(()=>t(a),"DEF")})}else if(n==="?"){let s=r.optional++;return a=>r.parser.optional(s,{DEF:o(()=>t(a),"DEF"),GATE:i?()=>i(a):void 0})}else $t(n)}o(rd,"wrap");function nd(r,e){let t=gm(r,e),n=r.rules.get(t);if(!n)throw new Error(`Rule "${t}" not found."`);return n}o(nd,"getRule");function gm(r,e){if(_e(e))return e.name;if(r.ruleNames.has(e))return r.ruleNames.get(e);{let t=e,n=t.$container,i=e.$type;for(;!_e(n);)(Mt(n)||bi(n)||Mi(n))&&(i=n.elements.indexOf(t).toString()+":"+i),t=n,n=n.$container;return i=n.name+":"+i,r.ruleNames.set(e,i),i}}o(gm,"getRuleName");function kc(r,e){let t=r.tokens[e];if(!t)throw new Error(`Token "${e}" not found."`);return t}o(kc,"getToken");function Ic(r){let e=r.Grammar,t=r.parser.Lexer,n=new qn(r);return Ms(e,n,t.definition),n.finalize(),n}o(Ic,"createCompletionParser");function Nc(r){let e=id(r);return e.finalize(),e}o(Nc,"createLangiumParser");function id(r){let e=r.Grammar,t=r.parser.Lexer,n=new Hn(r);return Ms(e,n,t.definition)}o(id,"prepareLangiumParser");var pr=class{static{o(this,"DefaultTokenBuilder")}buildTokens(e,t){let n=V(Tn(e,!1)),i=this.buildTerminalTokens(n),s=this.buildKeywordTokens(n,i,t);return i.forEach(a=>{let c=a.PATTERN;typeof c=="object"&&c&&"test"in c&&Bi(c)?s.unshift(a):s.push(a)}),s}buildTerminalTokens(e){return e.filter(Ye).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){let t=Sr(e),n=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,i={name:e.name,PATTERN:n,LINE_BREAKS:!0};return e.hidden&&(i.GROUP=Bi(t)?ce.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){let t=new RegExp(e,e.flags+"y");return(n,i)=>(t.lastIndex=i,t.exec(n))}buildKeywordTokens(e,t,n){return e.filter(_e).flatMap(i=>ot(i).filter(Je)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,t,!!n?.caseInsensitive))}buildKeywordToken(e,t,n){return{name:e.value,PATTERN:this.buildKeywordPattern(e,n),LONGER_ALT:this.findLongerAlt(e,t)}}buildKeywordPattern(e,t){return t?new RegExp(ha(e.value)):e.value}findLongerAlt(e,t){return t.reduce((n,i)=>{let s=i?.PATTERN;return s?.source&&pa("^"+s.source+"$",e.value)&&n.push(i),n},[])}};var mr=class{static{o(this,"DefaultValueConverter")}convert(e,t){let n=t.grammarSource;if(Jt(n)&&(n=ya(n)),rt(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,t)}return e}runConverter(e,t,n){var i;switch(e.name.toUpperCase()){case"INT":return lt.convertInt(t);case"STRING":return lt.convertString(t);case"ID":return lt.convertID(t)}switch((i=Ia(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return lt.convertNumber(t);case"boolean":return lt.convertBoolean(t);case"bigint":return lt.convertBigint(t);case"date":return lt.convertDate(t);default:return t}}},lt;(function(r){function e(u){let f="";for(let d=1;d<u.length-1;d++){let p=u.charAt(d);if(p==="\\"){let h=u.charAt(++d);f+=t(h)}else f+=p}return f}o(e,"convertString"),r.convertString=e;function t(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
`;case"r":return"\r";case"t":return"	";case"v":return"\v";case"0":return"\0";default:return u}}o(t,"convertEscapeCharacter");function n(u){return u.charAt(0)==="^"?u.substring(1):u}o(n,"convertID"),r.convertID=n;function i(u){return parseInt(u)}o(i,"convertInt"),r.convertInt=i;function s(u){return BigInt(u)}o(s,"convertBigint"),r.convertBigint=s;function a(u){return new Date(u)}o(a,"convertDate"),r.convertDate=a;function c(u){return Number(u)}o(c,"convertNumber"),r.convertNumber=c;function l(u){return u.toLowerCase()==="true"}o(l,"convertBoolean"),r.convertBoolean=l})(lt||(lt={}));var w={};G(w,nl(ld(),1));function Mc(){return new Promise(r=>{typeof setImmediate>"u"?setTimeout(r,0):setImmediate(r)})}o(Mc,"delayNextTick");var $c=0,ud=10;function fd(){return $c=Date.now(),new w.CancellationTokenSource}o(fd,"startCancelableOperation");function dd(r){ud=r}o(dd,"setInterruptionPeriod");var ut=Symbol("OperationCancelled");function Gt(r){return r===ut}o(Gt,"isOperationCancelled");async function xe(r){if(r===w.CancellationToken.None)return;let e=Date.now();if(e-$c>=ud&&($c=e,await Mc()),r.isCancellationRequested)throw ut}o(xe,"interruptAndCheck");var Ue=class{static{o(this,"Deferred")}constructor(){this.promise=new Promise((e,t)=>{this.resolve=n=>(e(n),this),this.reject=n=>(t(n),this)})}};var Gs=class r{static{o(this,"FullTextDocument")}constructor(e,t,n,i){this._uri=e,this._languageId=t,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 t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(let n of e)if(r.isIncremental(n)){let i=md(n.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(a,this._content.length);let c=Math.max(i.start.line,0),l=Math.max(i.end.line,0),u=this._lineOffsets,f=hd(n.text,!1,s);if(l-c===f.length)for(let p=0,h=f.length;p<h;p++)u[p+c+1]=f[p];else f.length<1e4?u.splice(c+1,l-c,...f):this._lineOffsets=u=u.slice(0,c+1).concat(f,u.slice(l+1));let d=n.text.length-(a-s);if(d!==0)for(let p=c+1+f.length,h=u.length;p<h;p++)u[p]=u[p]+d}else if(r.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=hd(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,i=t.length;if(i===0)return{line:0,character:e};for(;n<i;){let a=Math.floor((n+i)/2);t[a]>e?i=a:n=a+1}let s=n-1;return e=this.ensureBeforeEOL(e,t[s]),{line:s,character:e-t[s]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line];if(e.character<=0)return n;let i=e.line+1<t.length?t[e.line+1]:this._content.length,s=Math.min(n+e.character,i);return this.ensureBeforeEOL(s,n)}ensureBeforeEOL(e,t){for(;e>t&&pd(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},Zr;(function(r){function e(i,s,a,c){return new Gs(i,s,a,c)}o(e,"create"),r.create=e;function t(i,s,a){if(i instanceof Gs)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}o(t,"update"),r.update=t;function n(i,s){let a=i.getText(),c=Dc(s.map(Nm),(f,d)=>{let p=f.range.start.line-d.range.start.line;return p===0?f.range.start.character-d.range.start.character:p}),l=0,u=[];for(let f of c){let d=i.offsetAt(f.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&u.push(a.substring(l,d)),f.newText.length&&u.push(f.newText),l=i.offsetAt(f.range.end)}return u.push(a.substr(l)),u.join("")}o(n,"applyEdits"),r.applyEdits=n})(Zr||(Zr={}));function Dc(r,e){if(r.length<=1)return r;let t=r.length/2|0,n=r.slice(0,t),i=r.slice(t);Dc(n,e),Dc(i,e);let s=0,a=0,c=0;for(;s<n.length&&a<i.length;)e(n[s],i[a])<=0?r[c++]=n[s++]:r[c++]=i[a++];for(;s<n.length;)r[c++]=n[s++];for(;a<i.length;)r[c++]=i[a++];return r}o(Dc,"mergeSort");function hd(r,e,t=0){let n=e?[t]:[];for(let i=0;i<r.length;i++){let s=r.charCodeAt(i);pd(s)&&(s===13&&i+1<r.length&&r.charCodeAt(i+1)===10&&i++,n.push(t+i+1))}return n}o(hd,"computeLineOffsets");function pd(r){return r===13||r===10}o(pd,"isEOL");function md(r){let e=r.start,t=r.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:r}o(md,"getWellformedRange");function Nm(r){let e=md(r.range);return e!==r.range?{newText:r.newText,range:e}:r}o(Nm,"getWellformedEdit");var gd;(()=>{"use strict";var r={470:i=>{function s(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}o(s,"e");function a(l,u){for(var f,d="",p=0,h=-1,g=0,x=0;x<=l.length;++x){if(x<l.length)f=l.charCodeAt(x);else{if(f===47)break;f=47}if(f===47){if(!(h===x-1||g===1))if(h!==x-1&&g===2){if(d.length<2||p!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var k=d.lastIndexOf("/");if(k!==d.length-1){k===-1?(d="",p=0):p=(d=d.slice(0,k)).length-1-d.lastIndexOf("/"),h=x,g=0;continue}}else if(d.length===2||d.length===1){d="",p=0,h=x,g=0;continue}}u&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+l.slice(h+1,x):d=l.slice(h+1,x),p=x-h-1;h=x,g=0}else f===46&&g!==-1?++g:g=-1}return d}o(a,"r");var c={resolve:o(function(){for(var l,u="",f=!1,d=arguments.length-1;d>=-1&&!f;d--){var p;d>=0?p=arguments[d]:(l===void 0&&(l=process.cwd()),p=l),s(p),p.length!==0&&(u=p+"/"+u,f=p.charCodeAt(0)===47)}return u=a(u,!f),f?u.length>0?"/"+u:"/":u.length>0?u:"."},"resolve"),normalize:o(function(l){if(s(l),l.length===0)return".";var u=l.charCodeAt(0)===47,f=l.charCodeAt(l.length-1)===47;return(l=a(l,!u)).length!==0||u||(l="."),l.length>0&&f&&(l+="/"),u?"/"+l:l},"normalize"),isAbsolute:o(function(l){return s(l),l.length>0&&l.charCodeAt(0)===47},"isAbsolute"),join:o(function(){if(arguments.length===0)return".";for(var l,u=0;u<arguments.length;++u){var f=arguments[u];s(f),f.length>0&&(l===void 0?l=f:l+="/"+f)}return l===void 0?".":c.normalize(l)},"join"),relative:o(function(l,u){if(s(l),s(u),l===u||(l=c.resolve(l))===(u=c.resolve(u)))return"";for(var f=1;f<l.length&&l.charCodeAt(f)===47;++f);for(var d=l.length,p=d-f,h=1;h<u.length&&u.charCodeAt(h)===47;++h);for(var g=u.length-h,x=p<g?p:g,k=-1,E=0;E<=x;++E){if(E===x){if(g>x){if(u.charCodeAt(h+E)===47)return u.slice(h+E+1);if(E===0)return u.slice(h+E)}else p>x&&(l.charCodeAt(f+E)===47?k=E:E===0&&(k=0));break}var A=l.charCodeAt(f+E);if(A!==u.charCodeAt(h+E))break;A===47&&(k=E)}var T="";for(E=f+k+1;E<=d;++E)E!==d&&l.charCodeAt(E)!==47||(T.length===0?T+="..":T+="/..");return T.length>0?T+u.slice(h+k):(h+=k,u.charCodeAt(h)===47&&++h,u.slice(h))},"relative"),_makeLong:o(function(l){return l},"_makeLong"),dirname:o(function(l){if(s(l),l.length===0)return".";for(var u=l.charCodeAt(0),f=u===47,d=-1,p=!0,h=l.length-1;h>=1;--h)if((u=l.charCodeAt(h))===47){if(!p){d=h;break}}else p=!1;return d===-1?f?"/":".":f&&d===1?"//":l.slice(0,d)},"dirname"),basename:o(function(l,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');s(l);var f,d=0,p=-1,h=!0;if(u!==void 0&&u.length>0&&u.length<=l.length){if(u.length===l.length&&u===l)return"";var g=u.length-1,x=-1;for(f=l.length-1;f>=0;--f){var k=l.charCodeAt(f);if(k===47){if(!h){d=f+1;break}}else x===-1&&(h=!1,x=f+1),g>=0&&(k===u.charCodeAt(g)?--g==-1&&(p=f):(g=-1,p=x))}return d===p?p=x:p===-1&&(p=l.length),l.slice(d,p)}for(f=l.length-1;f>=0;--f)if(l.charCodeAt(f)===47){if(!h){d=f+1;break}}else p===-1&&(h=!1,p=f+1);return p===-1?"":l.slice(d,p)},"basename"),extname:o(function(l){s(l);for(var u=-1,f=0,d=-1,p=!0,h=0,g=l.length-1;g>=0;--g){var x=l.charCodeAt(g);if(x!==47)d===-1&&(p=!1,d=g+1),x===46?u===-1?u=g:h!==1&&(h=1):u!==-1&&(h=-1);else if(!p){f=g+1;break}}return u===-1||d===-1||h===0||h===1&&u===d-1&&u===f+1?"":l.slice(u,d)},"extname"),format:o(function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return function(u,f){var d=f.dir||f.root,p=f.base||(f.name||"")+(f.ext||"");return d?d===f.root?d+p:d+"/"+p:p}(0,l)},"format"),parse:o(function(l){s(l);var u={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return u;var f,d=l.charCodeAt(0),p=d===47;p?(u.root="/",f=1):f=0;for(var h=-1,g=0,x=-1,k=!0,E=l.length-1,A=0;E>=f;--E)if((d=l.charCodeAt(E))!==47)x===-1&&(k=!1,x=E+1),d===46?h===-1?h=E:A!==1&&(A=1):h!==-1&&(A=-1);else if(!k){g=E+1;break}return h===-1||x===-1||A===0||A===1&&h===x-1&&h===g+1?x!==-1&&(u.base=u.name=g===0&&p?l.slice(1,x):l.slice(g,x)):(g===0&&p?(u.name=l.slice(1,h),u.base=l.slice(1,x)):(u.name=l.slice(g,h),u.base=l.slice(g,x)),u.ext=l.slice(h,x)),g>0?u.dir=l.slice(0,g-1):p&&(u.dir="/"),u},"parse"),sep:"/",delimiter:":",win32:null,posix:null};c.posix=c,i.exports=c}},e={};function t(i){var s=e[i];if(s!==void 0)return s.exports;var a=e[i]={exports:{}};return r[i](a,a.exports,t),a.exports}o(t,"r"),t.d=(i,s)=>{for(var a in s)t.o(s,a)&&!t.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},t.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),t.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;t.r(n),t.d(n,{URI:o(()=>p,"URI"),Utils:o(()=>ht,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,a=/^\//,c=/^\/\//;function l(v,y){if(!v.scheme&&y)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${v.authority}", path: "${v.path}", query: "${v.query}", fragment: "${v.fragment}"}`);if(v.scheme&&!s.test(v.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(v.path){if(v.authority){if(!a.test(v.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(c.test(v.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}o(l,"s");let u="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{static{o(this,"f")}static isUri(y){return y instanceof p||!!y&&typeof y.authority=="string"&&typeof y.fragment=="string"&&typeof y.path=="string"&&typeof y.query=="string"&&typeof y.scheme=="string"&&typeof y.fsPath=="string"&&typeof y.with=="function"&&typeof y.toString=="function"}scheme;authority;path;query;fragment;constructor(y,C,S,j,P,O=!1){typeof y=="object"?(this.scheme=y.scheme||u,this.authority=y.authority||u,this.path=y.path||u,this.query=y.query||u,this.fragment=y.fragment||u):(this.scheme=function(Le,Oe){return Le||Oe?Le:"file"}(y,O),this.authority=C||u,this.path=function(Le,Oe){switch(Le){case"https":case"http":case"file":Oe?Oe[0]!==f&&(Oe=f+Oe):Oe=f}return Oe}(this.scheme,S||u),this.query=j||u,this.fragment=P||u,l(this,O))}get fsPath(){return A(this,!1)}with(y){if(!y)return this;let{scheme:C,authority:S,path:j,query:P,fragment:O}=y;return C===void 0?C=this.scheme:C===null&&(C=u),S===void 0?S=this.authority:S===null&&(S=u),j===void 0?j=this.path:j===null&&(j=u),P===void 0?P=this.query:P===null&&(P=u),O===void 0?O=this.fragment:O===null&&(O=u),C===this.scheme&&S===this.authority&&j===this.path&&P===this.query&&O===this.fragment?this:new g(C,S,j,P,O)}static parse(y,C=!1){let S=d.exec(y);return S?new g(S[2]||u,Te(S[4]||u),Te(S[5]||u),Te(S[7]||u),Te(S[9]||u),C):new g(u,u,u,u,u)}static file(y){let C=u;if(i&&(y=y.replace(/\\/g,f)),y[0]===f&&y[1]===f){let S=y.indexOf(f,2);S===-1?(C=y.substring(2),y=f):(C=y.substring(2,S),y=y.substring(S)||f)}return new g("file",C,y,u,u)}static from(y){let C=new g(y.scheme,y.authority,y.path,y.query,y.fragment);return l(C,!0),C}toString(y=!1){return T(this,y)}toJSON(){return this}static revive(y){if(y){if(y instanceof p)return y;{let C=new g(y);return C._formatted=y.external,C._fsPath=y._sep===h?y.fsPath:null,C}}return y}}let h=i?1:void 0;class g extends p{static{o(this,"l")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=A(this,!1)),this._fsPath}toString(y=!1){return y?T(this,!0):(this._formatted||(this._formatted=T(this,!1)),this._formatted)}toJSON(){let y={$mid:1};return this._fsPath&&(y.fsPath=this._fsPath,y._sep=h),this._formatted&&(y.external=this._formatted),this.path&&(y.path=this.path),this.scheme&&(y.scheme=this.scheme),this.authority&&(y.authority=this.authority),this.query&&(y.query=this.query),this.fragment&&(y.fragment=this.fragment),y}}let x={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function k(v,y,C){let S,j=-1;for(let P=0;P<v.length;P++){let O=v.charCodeAt(P);if(O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===45||O===46||O===95||O===126||y&&O===47||C&&O===91||C&&O===93||C&&O===58)j!==-1&&(S+=encodeURIComponent(v.substring(j,P)),j=-1),S!==void 0&&(S+=v.charAt(P));else{S===void 0&&(S=v.substr(0,P));let Le=x[O];Le!==void 0?(j!==-1&&(S+=encodeURIComponent(v.substring(j,P)),j=-1),S+=Le):j===-1&&(j=P)}}return j!==-1&&(S+=encodeURIComponent(v.substring(j))),S!==void 0?S:v}o(k,"d");function E(v){let y;for(let C=0;C<v.length;C++){let S=v.charCodeAt(C);S===35||S===63?(y===void 0&&(y=v.substr(0,C)),y+=x[S]):y!==void 0&&(y+=v[C])}return y!==void 0?y:v}o(E,"p");function A(v,y){let C;return C=v.authority&&v.path.length>1&&v.scheme==="file"?`//${v.authority}${v.path}`:v.path.charCodeAt(0)===47&&(v.path.charCodeAt(1)>=65&&v.path.charCodeAt(1)<=90||v.path.charCodeAt(1)>=97&&v.path.charCodeAt(1)<=122)&&v.path.charCodeAt(2)===58?y?v.path.substr(1):v.path[1].toLowerCase()+v.path.substr(2):v.path,i&&(C=C.replace(/\//g,"\\")),C}o(A,"m");function T(v,y){let C=y?E:k,S="",{scheme:j,authority:P,path:O,query:Le,fragment:Oe}=v;if(j&&(S+=j,S+=":"),(P||j==="file")&&(S+=f,S+=f),P){let ee=P.indexOf("@");if(ee!==-1){let Bt=P.substr(0,ee);P=P.substr(ee+1),ee=Bt.lastIndexOf(":"),ee===-1?S+=C(Bt,!1,!1):(S+=C(Bt.substr(0,ee),!1,!1),S+=":",S+=C(Bt.substr(ee+1),!1,!0)),S+="@"}P=P.toLowerCase(),ee=P.lastIndexOf(":"),ee===-1?S+=C(P,!1,!0):(S+=C(P.substr(0,ee),!1,!0),S+=P.substr(ee))}if(O){if(O.length>=3&&O.charCodeAt(0)===47&&O.charCodeAt(2)===58){let ee=O.charCodeAt(1);ee>=65&&ee<=90&&(O=`/${String.fromCharCode(ee+32)}:${O.substr(3)}`)}else if(O.length>=2&&O.charCodeAt(1)===58){let ee=O.charCodeAt(0);ee>=65&&ee<=90&&(O=`${String.fromCharCode(ee+32)}:${O.substr(2)}`)}S+=C(O,!0,!1)}return Le&&(S+="?",S+=C(Le,!1,!1)),Oe&&(S+="#",S+=y?Oe:k(Oe,!1,!1)),S}o(T,"y");function b(v){try{return decodeURIComponent(v)}catch{return v.length>3?v.substr(0,3)+b(v.substr(3)):v}}o(b,"v");let $=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Te(v){return v.match($)?v.replace($,y=>b(y)):v}o(Te,"C");var Er=t(470);let ve=Er.posix||Er,Lt="/";var ht;(function(v){v.joinPath=function(y,...C){return y.with({path:ve.join(y.path,...C)})},v.resolvePath=function(y,...C){let S=y.path,j=!1;S[0]!==Lt&&(S=Lt+S,j=!0);let P=ve.resolve(S,...C);return j&&P[0]===Lt&&!y.authority&&(P=P.substring(1)),y.with({path:P})},v.dirname=function(y){if(y.path.length===0||y.path===Lt)return y;let C=ve.dirname(y.path);return C.length===1&&C.charCodeAt(0)===46&&(C=""),y.with({path:C})},v.basename=function(y){return ve.basename(y.path)},v.extname=function(y){return ve.extname(y.path)}})(ht||(ht={}))})(),gd=n})();var{URI:We,Utils:en}=gd;var Ge;(function(r){r.basename=en.basename,r.dirname=en.dirname,r.extname=en.extname,r.joinPath=en.joinPath,r.resolvePath=en.resolvePath;function e(n,i){return n?.toString()===i?.toString()}o(e,"equals"),r.equals=e;function t(n,i){let s=typeof n=="string"?n:n.path,a=typeof i=="string"?i:i.path,c=s.split("/").filter(p=>p.length>0),l=a.split("/").filter(p=>p.length>0),u=0;for(;u<c.length&&c[u]===l[u];u++);let f="../".repeat(c.length-u),d=l.slice(u).join("/");return f+d}o(t,"relative"),r.relative=t})(Ge||(Ge={}));var Y;(function(r){r[r.Changed=0]="Changed",r[r.Parsed=1]="Parsed",r[r.IndexedContent=2]="IndexedContent",r[r.ComputedScopes=3]="ComputedScopes",r[r.Linked=4]="Linked",r[r.IndexedReferences=5]="IndexedReferences",r[r.Validated=6]="Validated"})(Y||(Y={}));var Xn=class{static{o(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=w.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,t)}fromTextDocument(e,t,n){return t=t??We.parse(e.uri),n?this.createAsync(t,e,n):this.create(t,e)}fromString(e,t,n){return n?this.createAsync(t,e,n):this.create(t,e)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t){if(typeof t=="string"){let n=this.parse(e,t);return this.createLangiumDocument(n,e,void 0,t)}else if("$model"in t){let n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{let n=this.parse(e,t.getText());return this.createLangiumDocument(n,e,t)}}async createAsync(e,t,n){if(typeof t=="string"){let i=await this.parseAsync(e,t,n);return this.createLangiumDocument(i,e,void 0,t)}else{let i=await this.parseAsync(e,t.getText(),n);return this.createLangiumDocument(i,e,t)}}createLangiumDocument(e,t,n,i){let s;if(n)s={parseResult:e,uri:t,state:Y.Parsed,references:[],textDocument:n};else{let a=this.createTextDocumentGetter(t,i);s={parseResult:e,uri:t,state:Y.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,t){var n,i;let s=(n=e.parseResult.value.$cstNode)===null||n===void 0?void 0:n.root.fullText,a=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),c=a?a.getText():await this.fileSystemProvider.readFile(e.uri);if(a)Object.defineProperty(e,"textDocument",{value:a});else{let l=this.createTextDocumentGetter(e.uri,c);Object.defineProperty(e,"textDocument",{get:l})}return s!==c&&(e.parseResult=await this.parseAsync(e.uri,c,t),e.parseResult.value.$document=e),e.state=Y.Parsed,e}parse(e,t){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t)}parseAsync(e,t,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,n)}createTextDocumentGetter(e,t){let n=this.serviceRegistry,i;return()=>i??(i=Zr.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,t??""))}},Yn=class{static{o(this,"DefaultLangiumDocuments")}constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory}get all(){return V(this.documentMap.values())}addDocument(e){let t=e.uri.toString();if(this.documentMap.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentMap.set(t,e)}getDocument(e){let t=e.toString();return this.documentMap.get(t)}async getOrCreateDocument(e,t){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(n),n)}createDocument(e,t,n){if(n)return this.langiumDocumentFactory.fromString(t,e,n).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){let t=e.toString(),n=this.documentMap.get(t);return n&&(n.state=Y.Changed,n.precomputedScopes=void 0,n.references=[],n.diagnostics=void 0),n}deleteDocument(e){let t=e.toString(),n=this.documentMap.get(t);return n&&(n.state=Y.Changed,this.documentMap.delete(t)),n}};var Jn=class{static{o(this,"DefaultLinker")}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,t=w.CancellationToken.None){for(let n of Qe(e.parseResult.value))await xe(t),Ir(n).forEach(i=>this.doLink(i,e))}doLink(e,t){let n=e.reference;if(n._ref===void 0)try{let i=this.getCandidate(e);if(Ht(i))n._ref=i;else if(n._nodeDescription=i,this.langiumDocuments().hasDocument(i.documentUri)){let s=this.loadAstNode(i);n._ref=s??this.createLinkingError(e,i)}}catch(i){n._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${i}`})}t.references.push(n)}unlink(e){for(let t of e.references)delete t._ref,delete t._nodeDescription;e.references=[]}getCandidate(e){let n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,t,n,i){let s=this,a={$refNode:n,$refText:i,get ref(){var c;if(oe(this._ref))return this._ref;if(Qs(this._nodeDescription)){let l=s.loadAstNode(this._nodeDescription);this._ref=l??s.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){let l=s.getLinkedNode({reference:a,container:e,property:t});if(l.error&&ge(e).state<Y.ComputedScopes)return;this._ref=(c=l.node)!==null&&c!==void 0?c:l.error,this._nodeDescription=l.descr}return oe(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Ht(this._ref)?this._ref:void 0}};return a}getLinkedNode(e){try{let t=this.getCandidate(e);if(Ht(t))return{error:t};let n=this.loadAstNode(t);return n?{node:n,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${t}`})}}}loadAstNode(e){if(e.node)return e.node;let t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){let n=ge(e.container);n.state<Y.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:t})}};function yd(r){return typeof r.name=="string"}o(yd,"isNamed");var Qn=class{static{o(this,"DefaultNameProvider")}getName(e){if(yd(e))return e.name}getNameNode(e){return En(e.$cstNode,"name")}};var Zn=class{static{o(this,"DefaultReferences")}constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){let t=va(e),n=e.astNode;if(t&&n){let i=n[t.feature];if(Ae(i))return i.ref;if(Array.isArray(i)){for(let s of i)if(Ae(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||eo(e,i)))return n}}}findDeclarationNode(e){let t=this.findDeclaration(e);if(t?.$cstNode){let n=this.nameProvider.getNameNode(t);return n??t.$cstNode}}findReferences(e,t){let n=[];if(t.includeDeclaration){let s=this.getReferenceToSelf(e);s&&n.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(i=i.filter(s=>Ge.equals(s.sourceUri,t.documentUri))),n.push(...i),V(n)}getReferenceToSelf(e){let t=this.nameProvider.getNameNode(e);if(t){let n=ge(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:Xt(t),local:!0}}}};var ft=class{static{o(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(let[t,n]of e)this.add(t,n)}get size(){return Ar.sum(V(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(t);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var t;return(t=this.map.get(e))!==null&&t!==void 0?t:[]}has(e,t){if(t===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,n)=>t.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return V(this.map.entries()).flatMap(([e,t])=>t.map(n=>[e,n]))}keys(){return V(this.map.keys())}values(){return V(this.map.values()).flat()}entriesGroupedByKey(){return V(this.map.entries())}},gr=class{static{o(this,"BiMap")}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[t,n]of e)this.set(t,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}};var ei=class{static{o(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,t=w.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,t)}async computeExportsForNode(e,t,n=mn,i=w.CancellationToken.None){let s=[];this.exportNode(e,s,t);for(let a of n(e))await xe(i),this.exportNode(a,s,t);return s}exportNode(e,t,n){let i=this.nameProvider.getName(e);i&&t.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,t=w.CancellationToken.None){let n=e.parseResult.value,i=new ft;for(let s of ot(n))await xe(t),this.processNode(s,e,i);return i}processNode(e,t,n){let i=e.$container;if(i){let s=this.nameProvider.getName(e);s&&n.add(i,this.descriptions.createDescription(e,s,t))}}};var tn=class{static{o(this,"StreamScope")}constructor(e,t,n){var i;this.elements=e,this.outerScope=t,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 t=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(t)return t;if(this.outerScope)return this.outerScope.getElement(e)}},ti=class{static{o(this,"MapScope")}constructor(e,t,n){var i;this.elements=new Map,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1;for(let s of e){let a=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(a,s)}this.outerScope=t}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=V(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},Sm={getElement(){},getAllElements(){return ln}};var rn=class{static{o(this,"DisposableCache")}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")}},ri=class extends rn{static{o(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){let n=t();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},yr=class extends rn{static{o(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,n){this.throwIfDisposed(),this.cacheForContext(e).set(t,n)}get(e,t,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(t))return i.get(t);if(n){let s=n();return i.set(t,s),s}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){let t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){let t=this.converter(e),n=this.cache.get(t);return n||(n=new Map,this.cache.set(t,n)),n}},Bs=class extends yr{static{o(this,"DocumentCache")}constructor(e){super(t=>t.toString()),this.onDispose(e.workspace.DocumentBuilder.onUpdate((t,n)=>{let i=t.concat(n);for(let s of i)this.clear(s)}))}},nn=class extends ri{static{o(this,"WorkspaceCache")}constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var ni=class{static{o(this,"DefaultScopeProvider")}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 nn(e.shared)}getScope(e){let t=[],n=this.reflection.getReferenceType(e),i=ge(e.container).precomputedScopes;if(i){let a=e.container;do{let c=i.get(a);c.length>0&&t.push(V(c).filter(l=>this.reflection.isSubtype(l.type,n))),a=a.$container}while(a)}let s=this.getGlobalScope(n,e);for(let a=t.length-1;a>=0;a--)s=this.createScope(t[a],s);return s}createScope(e,t,n){return new tn(V(e),t,n)}createScopeForNodes(e,t,n){let i=V(e).map(s=>{let a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new tn(i,t,n)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new ti(this.indexManager.allElements(e)))}};function Fc(r){return typeof r.$comment=="string"}o(Fc,"isAstNodeWithComment");function xd(r){return typeof r=="object"&&!!r&&("$ref"in r||"$error"in r)}o(xd,"isIntermediateReference");var ii=class{static{o(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t={}){let n=t?.replacer,i=o((a,c)=>this.replacer(a,c,t),"defaultReplacer"),s=n?(a,c)=>n(a,c,i):i;try{return this.currentDocument=ge(e),JSON.stringify(e,s,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t={}){let n=JSON.parse(e);return this.linkNode(n,n,t),n}replacer(e,t,{refText:n,sourceText:i,textRegions:s,comments:a,uriConverter:c}){var l,u,f,d;if(!this.ignoreProperties.has(e))if(Ae(t)){let p=t.ref,h=n?t.$refText:void 0;if(p){let g=ge(p),x="";this.currentDocument&&this.currentDocument!==g&&(c?x=c(g.uri,t):x=g.uri.toString());let k=this.astNodeLocator.getAstNodePath(p);return{$ref:`${x}#${k}`,$refText:h}}else return{$error:(u=(l=t.error)===null||l===void 0?void 0:l.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:h}}else if(oe(t)){let p;if(s&&(p=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},t)),(!e||t.$document)&&p?.$textRegion&&(p.$textRegion.documentURI=(f=this.currentDocument)===null||f===void 0?void 0:f.uri.toString())),i&&!e&&(p??(p=Object.assign({},t)),p.$sourceText=(d=t.$cstNode)===null||d===void 0?void 0:d.text),a){p??(p=Object.assign({},t));let h=this.commentProvider.getComment(t);h&&(p.$comment=h.replace(/\r/g,""))}return p??t}else return t}addAstNodeRegionWithAssignmentsTo(e){let t=o(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){let n=e.$textRegion=t(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{let a=Ta(e.$cstNode,s).map(t);a.length!==0&&(i[s]=a)}),e}}linkNode(e,t,n,i,s,a){for(let[l,u]of Object.entries(e))if(Array.isArray(u))for(let f=0;f<u.length;f++){let d=u[f];xd(d)?u[f]=this.reviveReference(e,l,t,d,n):oe(d)&&this.linkNode(d,t,n,e,l,f)}else xd(u)?e[l]=this.reviveReference(e,l,t,u,n):oe(u)&&this.linkNode(u,t,n,e,l);let c=e;c.$container=i,c.$containerProperty=s,c.$containerIndex=a}reviveReference(e,t,n,i,s){let a=i.$refText,c=i.$error;if(i.$ref){let l=this.getRefNode(n,i.$ref,s.uriConverter);if(oe(l))return a||(a=this.nameProvider.getName(l)),{$refText:a??"",ref:l};c=l}if(c){let l={$refText:a??""};return l.error={container:e,property:t,message:c,reference:l},l}else return}getRefNode(e,t,n){try{let i=t.indexOf("#");if(i===0){let l=this.astNodeLocator.getAstNode(e,t.substring(1));return l||"Could not resolve path: "+t}if(i<0){let l=n?n(t):We.parse(t),u=this.langiumDocuments.getDocument(l);return u?u.parseResult.value:"Could not find document for URI: "+t}let s=n?n(t.substring(0,i)):We.parse(t.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+t;if(i===t.length-1)return a.parseResult.value;let c=this.astNodeLocator.getAstNode(a.parseResult.value,t.substring(i+1));return c||"Could not resolve URI: "+t}catch(i){return String(i)}}};var si=class{static{o(this,"DefaultServiceRegistry")}register(e){if(!this.singleton&&!this.map){this.singleton=e;return}if(!this.map&&(this.map={},this.singleton)){for(let t of this.singleton.LanguageMetaData.fileExtensions)this.map[t]=this.singleton;this.singleton=void 0}for(let t of e.LanguageMetaData.fileExtensions)this.map[t]!==void 0&&this.map[t]!==e&&console.warn(`The file extension ${t} is used by multiple languages. It is now assigned to '${e.LanguageMetaData.languageId}'.`),this.map[t]=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 t=Ge.extname(e),n=this.map[t];if(!n)throw new Error(`The service registry contains no services for the extension '${t}'.`);return n}get all(){return this.singleton!==void 0?[this.singleton]:this.map!==void 0?Object.values(this.map):[]}};function Ws(r){return{code:r}}o(Ws,"diagnosticData");var sn;(function(r){r.all=["fast","slow","built-in"]})(sn||(sn={}));var oi=class{static{o(this,"ValidationRegistry")}constructor(e){this.entries=new ft,this.reflection=e.shared.AstReflection}register(e,t=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,s]of Object.entries(e)){let a=s;if(Array.isArray(a))for(let c of a){let l={check:this.wrapValidationException(c,t),category:n};this.addEntry(i,l)}else if(typeof a=="function"){let c={check:this.wrapValidationException(a,t),category:n};this.addEntry(i,c)}}}wrapValidationException(e,t){return async(n,i,s)=>{try{await e.call(t,n,i,s)}catch(a){if(Gt(a))throw a;console.error("An error occurred during validation:",a);let c=a instanceof Error?a.message:String(a);a instanceof Error&&a.stack&&console.error(a.stack),i("error","An error occurred during validation: "+c,{node:n})}}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,t)}getChecks(e,t){let n=V(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(n=n.filter(i=>t.includes(i.category))),n.map(i=>i.check)}};var ai=class{static{o(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,t={},n=w.CancellationToken.None){let i=e.parseResult,s=[];if(await xe(n),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(i,s,t),t.stopAfterLexingErrors&&s.some(a=>{var c;return((c=a.data)===null||c===void 0?void 0:c.code)===wt.LexingError})||(this.processParsingErrors(i,s,t),t.stopAfterParsingErrors&&s.some(a=>{var c;return((c=a.data)===null||c===void 0?void 0:c.code)===wt.ParsingError}))||(this.processLinkingErrors(e,s,t),t.stopAfterLinkingErrors&&s.some(a=>{var c;return((c=a.data)===null||c===void 0?void 0:c.code)===wt.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,t,n))}catch(a){if(Gt(a))throw a;console.error("An error occurred during validation:",a)}return await xe(n),s}processLexingErrors(e,t,n){for(let i of e.lexerErrors){let s={severity:js("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:Ws(wt.LexingError),source:this.getSource()};t.push(s)}}processParsingErrors(e,t,n){for(let i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){let a=i.previousToken;if(isNaN(a.startOffset)){let c={line:0,character:0};s={start:c,end:c}}else{let c={line:a.endLine-1,character:a.endColumn};s={start:c,end:c}}}}else s=vr(i.token);if(s){let a={severity:js("error"),range:s,message:i.message,data:Ws(wt.ParsingError),source:this.getSource()};t.push(a)}}}processLinkingErrors(e,t,n){for(let i of e.references){let s=i.error;if(s){let a={node:s.container,property:s.property,index:s.index,data:{code:wt.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};t.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,t,n=w.CancellationToken.None){let i=[],s=o((a,c,l)=>{i.push(this.toDiagnostic(a,c,l))},"acceptor");return await Promise.all(Qe(e).map(async a=>{await xe(n);let c=this.validationRegistry.getChecks(a.$type,t.categories);for(let l of c)await l(a,s,n)})),i}toDiagnostic(e,t,n){return{message:t,range:Td(n),severity:js(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 Td(r){if(r.range)return r.range;let e;return typeof r.property=="string"?e=En(r.node.$cstNode,r.property,r.index):typeof r.keyword=="string"&&(e=Ra(r.node.$cstNode,r.keyword,r.index)),e??(e=r.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}o(Td,"getDiagnosticRange");function js(r){switch(r){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+r)}}o(js,"toDiagnosticSeverity");var wt;(function(r){r.LexingError="lexing-error",r.ParsingError="parsing-error",r.LinkingError="linking-error"})(wt||(wt={}));var ci=class{static{o(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,n=ge(e)){t??(t=this.nameProvider.getName(e));let i=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${i} has no name.`);let s,a=o(()=>{var c;return s??(s=Xt((c=this.nameProvider.getNameNode(e))!==null&&c!==void 0?c:e.$cstNode))},"nameSegmentGetter");return{node:e,name:t,get nameSegment(){return a()},selectionSegment:Xt(e.$cstNode),type:e.$type,documentUri:n.uri,path:i}}},li=class{static{o(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=w.CancellationToken.None){let n=[],i=e.parseResult.value;for(let s of Qe(i))await xe(t),Ir(s).filter(a=>!Ht(a)).forEach(a=>{let c=this.createDescription(a);c&&n.push(c)});return n}createDescription(e){let t=e.reference.$nodeDescription,n=e.reference.$refNode;if(!t||!n)return;let i=ge(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:t.documentUri,targetPath:t.path,segment:Xt(n),local:Ge.equals(t.documentUri,i)}}};var ui=class{static{o(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let t=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return t+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;let a=s.indexOf(this.indexSeparator);if(a>0){let c=s.substring(0,a),l=parseInt(s.substring(a+1)),u=i[c];return u?.[l]}return i[s]},e)}};var fi=class{static{o(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new Ue,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var t,n;this.workspaceConfig=(n=(t=e.capabilities.workspace)===null||t===void 0?void 0:t.configuration)!==null&&n!==void 0?n:!1}async initialized(e){if(this.workspaceConfig){if(e.register){let t=this.serviceRegistry.all;e.register({section:t.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let t=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(t);t.forEach((i,s)=>{this.updateSectionConfiguration(i.section,n[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(t=>{this.updateSectionConfiguration(t,e.settings[t])})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][t]}toSectionName(e){return`${e}`}};var xr;(function(r){function e(t){return{dispose:o(async()=>await t(),"dispose")}}o(e,"create"),r.create=e})(xr||(xr={}));var di=class{static{o(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new ft,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Y.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},n=w.CancellationToken.None){var i,s;for(let a of e){let c=a.uri.toString();if(a.state===Y.Validated){if(typeof t.validation=="boolean"&&t.validation)a.state=Y.IndexedReferences,a.diagnostics=void 0,this.buildState.delete(c);else if(typeof t.validation=="object"){let l=this.buildState.get(c),u=(i=l?.result)===null||i===void 0?void 0:i.validationChecks;if(u){let d=((s=t.validation.categories)!==null&&s!==void 0?s:sn.all).filter(p=>!u.includes(p));d.length>0&&(this.buildState.set(c,{completed:!1,options:{validation:Object.assign(Object.assign({},t.validation),{categories:d})},result:l.result}),a.state=Y.IndexedReferences)}}}else this.buildState.delete(c)}this.currentState=Y.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,t,n)}async update(e,t,n=w.CancellationToken.None){this.currentState=Y.Changed;for(let a of t)this.langiumDocuments.deleteDocument(a),this.buildState.delete(a.toString()),this.indexManager.remove(a);for(let a of e){if(!this.langiumDocuments.invalidateDocument(a)){let l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},a);l.state=Y.Changed,this.langiumDocuments.addDocument(l)}this.buildState.delete(a.toString())}let i=V(e).concat(t).map(a=>a.toString()).toSet();this.langiumDocuments.all.filter(a=>!i.has(a.uri.toString())&&this.shouldRelink(a,i)).forEach(a=>{this.serviceRegistry.getServices(a.uri).references.Linker.unlink(a),a.state=Math.min(a.state,Y.ComputedScopes),a.diagnostics=void 0}),await this.emitUpdate(e,t),await xe(n);let s=this.langiumDocuments.all.filter(a=>{var c;return a.state<Y.Linked||!(!((c=this.buildState.get(a.uri.toString()))===null||c===void 0)&&c.completed)}).toArray();await this.buildDocuments(s,this.updateBuildOptions,n)}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(n=>n(e,t)))}shouldRelink(e,t){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),xr.create(()=>{let t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}async buildDocuments(e,t,n){this.prepareBuild(e,t),await this.runCancelable(e,Y.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Y.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Y.ComputedScopes,n,async s=>{let a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await a.computeLocalScopes(s,n)}),await this.runCancelable(e,Y.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(e,Y.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));let i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,Y.Validated,n,s=>this.validate(s,n));for(let s of e){let a=this.buildState.get(s.uri.toString());a&&(a.completed=!0)}}prepareBuild(e,t){for(let n of e){let i=n.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:t,result:s?.result})}}async runCancelable(e,t,n,i){let s=e.filter(a=>a.state<t);for(let a of s)await xe(n),await i(a),a.state=t;await this.notifyBuildPhase(s,t,n),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),xr.create(()=>{this.buildPhaseListeners.delete(e,t)})}waitUntil(e,t,n){let i;if(t&&"path"in t?i=t:n=t,n??(n=w.CancellationToken.None),i){let s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(ut):new Promise((s,a)=>{let c=this.onBuildPhase(e,()=>{if(c.dispose(),l.dispose(),i){let u=this.langiumDocuments.getDocument(i);s(u?.uri)}else s(void 0)}),l=n.onCancellationRequested(()=>{c.dispose(),l.dispose(),a(ut)})})}async notifyBuildPhase(e,t,n){if(e.length===0)return;let i=this.buildPhaseListeners.get(t);for(let s of i)await xe(n),await s(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){var n,i;let s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e).validation,c=typeof a=="object"?a:void 0,l=await s.validateDocument(e,c,t);e.diagnostics?e.diagnostics.push(...l):e.diagnostics=l;let u=this.buildState.get(e.uri.toString());if(u){(n=u.result)!==null&&n!==void 0||(u.result={});let f=(i=c?.categories)!==null&&i!==void 0?i:sn.all;u.result.validationChecks?u.result.validationChecks.push(...f):u.result.validationChecks=[...f]}}getBuildOptions(e){var t,n;return(n=(t=this.buildState.get(e.uri.toString()))===null||t===void 0?void 0:t.options)!==null&&n!==void 0?n:{}}};var hi=class{static{o(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new yr,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){let n=ge(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{Ge.equals(a.targetUri,n)&&a.targetPath===t&&i.push(a)})}),V(i)}allElements(e,t){let n=V(this.symbolIndex.keys());return t&&(n=n.filter(i=>!t||t.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,t){var n;return t?this.symbolByTypeIndex.get(e,t,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(c=>this.astReflection.isSubtype(c.type,t))}):(n=this.symbolIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){let t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t),this.referenceIndex.delete(t)}async updateContent(e,t=w.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,t),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,t=w.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,t){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&t.has(i.targetUri.toString())):!1}};var pi=class{static{o(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new Ue,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}initialize(e){var t;this.folders=(t=e.workspaceFolders)!==null&&t!==void 0?t:void 0}initialized(e){return this.mutex.write(t=>{var n;return this.initializeWorkspace((n=this.folders)!==null&&n!==void 0?n:[],t)})}async initializeWorkspace(e,t=w.CancellationToken.None){let n=await this.performStartup(e);await xe(t),await this.documentBuilder.build(n,this.initialBuildOptions,t)}async performStartup(e){let t=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),n=[],i=o(s=>{n.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,t,i))),this._ready.resolve(),n}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return We.parse(e.uri)}async traverseFolder(e,t,n,i){let s=await this.fileSystemProvider.readDirectory(t);await Promise.all(s.map(async a=>{if(this.includeEntry(e,a,n)){if(a.isDirectory)await this.traverseFolder(e,a.uri,n,i);else if(a.isFile){let c=await this.langiumDocuments.getOrCreateDocument(a.uri);i(c)}}}))}includeEntry(e,t,n){let i=Ge.basename(t.uri);if(i.startsWith("."))return!1;if(t.isDirectory)return i!=="node_modules"&&i!=="out";if(t.isFile){let s=Ge.extname(t.uri);return n.includes(s)}return!1}};var mi=class{static{o(this,"DefaultLexer")}constructor(e){let t=e.parser.TokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);let n=Uc(t)?Object.values(t):t;this.chevrotainLexer=new ce(n,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e){var t;let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:(t=n.groups.hidden)!==null&&t!==void 0?t:[]}}toTokenTypeDictionary(e){if(Uc(e))return e;let t=Gc(e)?Object.values(e.modes).flat():e,n={};return t.forEach(i=>n[i.name]=i),n}};function Ed(r){return Array.isArray(r)&&(r.length===0||"name"in r[0])}o(Ed,"isTokenTypeArray");function Gc(r){return r&&"modes"in r&&"defaultMode"in r}o(Gc,"isIMultiModeLexerDefinition");function Uc(r){return!Ed(r)&&!Gc(r)}o(Uc,"isTokenTypeDictionary");function jc(r,e,t){let n,i;typeof r=="string"?(i=e,n=t):(i=r.range.start,n=e),i||(i=B.create(0,0));let s=vd(r),a=zc(n),c=_m({lines:s,position:i,options:a});return bm({index:0,tokens:c,position:i})}o(jc,"parseJSDoc");function Vc(r,e){let t=zc(e),n=vd(r);if(n.length===0)return!1;let i=n[0],s=n[n.length-1],a=t.start,c=t.end;return!!a?.exec(i)&&!!c?.exec(s)}o(Vc,"isJSDoc");function vd(r){let e="";return typeof r=="string"?e=r:e=r.text,e.split(fa)}o(vd,"getLines");var Rd=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Cm=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function _m(r){var e,t,n;let i=[],s=r.position.line,a=r.position.character;for(let c=0;c<r.lines.length;c++){let l=c===0,u=c===r.lines.length-1,f=r.lines[c],d=0;if(l&&r.options.start){let h=(e=r.options.start)===null||e===void 0?void 0:e.exec(f);h&&(d=h.index+h[0].length)}else{let h=(t=r.options.line)===null||t===void 0?void 0:t.exec(f);h&&(d=h.index+h[0].length)}if(u){let h=(n=r.options.end)===null||n===void 0?void 0:n.exec(f);h&&(f=f.substring(0,h.index))}if(f=f.substring(0,Pm(f)),Wc(f,d)>=f.length){if(i.length>0){let h=B.create(s,a);i.push({type:"break",content:"",range:U.create(h,h)})}}else{Rd.lastIndex=d;let h=Rd.exec(f);if(h){let g=h[0],x=h[1],k=B.create(s,a+d),E=B.create(s,a+d+g.length);i.push({type:"tag",content:x,range:U.create(k,E)}),d+=g.length,d=Wc(f,d)}if(d<f.length){let g=f.substring(d),x=Array.from(g.matchAll(Cm));i.push(...wm(x,g,s,a+d))}}s++,a=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}o(_m,"tokenize");function wm(r,e,t,n){let i=[];if(r.length===0){let s=B.create(t,n),a=B.create(t,n+e.length);i.push({type:"text",content:e,range:U.create(s,a)})}else{let s=0;for(let c of r){let l=c.index,u=e.substring(s,l);u.length>0&&i.push({type:"text",content:e.substring(s,l),range:U.create(B.create(t,s+n),B.create(t,l+n))});let f=u.length+1,d=c[1];if(i.push({type:"inline-tag",content:d,range:U.create(B.create(t,s+f+n),B.create(t,s+f+d.length+n))}),f+=d.length,c.length===4){f+=c[2].length;let p=c[3];i.push({type:"text",content:p,range:U.create(B.create(t,s+f+n),B.create(t,s+f+p.length+n))})}else i.push({type:"text",content:"",range:U.create(B.create(t,s+f+n),B.create(t,s+f+n))});s=l+c[0].length}let a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:U.create(B.create(t,s+n),B.create(t,s+n+a.length))})}return i}o(wm,"buildInlineTokens");var Lm=/\S/,Om=/\s*$/;function Wc(r,e){let t=r.substring(e).match(Lm);return t?e+t.index:r.length}o(Wc,"skipWhitespace");function Pm(r){let e=r.match(Om);if(e&&typeof e.index=="number")return e.index}o(Pm,"lastCharacter");function bm(r){var e,t,n,i;let s=B.create(r.position.line,r.position.character);if(r.tokens.length===0)return new Vs([],U.create(s,s));let a=[];for(;r.index<r.tokens.length;){let u=$m(r,a[a.length-1]);u&&a.push(u)}let c=(t=(e=a[0])===null||e===void 0?void 0:e.range.start)!==null&&t!==void 0?t:s,l=(i=(n=a[a.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:s;return new Vs(a,U.create(c,l))}o(bm,"parseJSDocComment");function $m(r,e){let t=r.tokens[r.index];if(t.type==="tag")return Id(r,!1);if(t.type==="text"||t.type==="inline-tag")return kd(r);Mm(t,e),r.index++}o($m,"parseJSDocElement");function Mm(r,e){if(e){let t=new zs("",r.range);"inlines"in e?e.inlines.push(t):e.content.inlines.push(t)}}o(Mm,"appendEmptyLine");function kd(r){let e=r.tokens[r.index],t=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(Dm(r)),n=e,e=r.tokens[r.index];return new yi(i,U.create(t.range.start,n.range.end))}o(kd,"parseJSDocText");function Dm(r){return r.tokens[r.index].type==="inline-tag"?Id(r,!0):Nd(r)}o(Dm,"parseJSDocInline");function Id(r,e){let t=r.tokens[r.index++],n=t.content.substring(1),i=r.tokens[r.index];if(i?.type==="text")if(e){let s=Nd(r);return new gi(n,new yi([s],s.range),e,U.create(t.range.start,s.range.end))}else{let s=kd(r);return new gi(n,s,e,U.create(t.range.start,s.range.end))}else{let s=t.range;return new gi(n,new yi([],s),e,s)}}o(Id,"parseJSDocTag");function Nd(r){let e=r.tokens[r.index++];return new zs(e.content,e.range)}o(Nd,"parseJSDocLine");function zc(r){if(!r)return zc({start:"/**",end:"*/",line:"*"});let{start:e,end:t,line:n}=r;return{start:Bc(e,!0),end:Bc(t,!1),line:Bc(n,!0)}}o(zc,"normalizeOptions");function Bc(r,e){if(typeof r=="string"||typeof r=="object"){let t=typeof r=="string"?rr(r):r.source;return e?new RegExp(`^\\s*${t}`):new RegExp(`\\s*${t}\\s*$`)}else return r}o(Bc,"normalizeOption");var Vs=class{static{o(this,"JSDocCommentImpl")}constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find(t=>t.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(let t of this.elements)if(e.length===0)e=t.toString();else{let n=t.toString();e+=Ad(e)+n}return e.trim()}toMarkdown(e){let t="";for(let n of this.elements)if(t.length===0)t=n.toMarkdown(e);else{let i=n.toMarkdown(e);t+=Ad(t)+i}return t.trim()}},gi=class{static{o(this,"JSDocTagImpl")}constructor(e,t,n,i){this.name=e,this.content=t,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}
${t}`),this.inline?`{${e}}`:e}toMarkdown(e){var t,n;return(n=(t=e?.renderTag)===null||t===void 0?void 0:t.call(e,this))!==null&&n!==void 0?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){let t=this.content.toMarkdown(e);if(this.inline){let s=Fm(this.name,t,e??{});if(typeof s=="string")return s}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 ${t}`:this.content.inlines.length>1&&(i=`${i}
${t}`),this.inline?`{${i}}`:i}};function Fm(r,e,t){var n,i;if(r==="linkplain"||r==="linkcode"||r==="link"){let s=e.indexOf(" "),a=e;if(s>0){let l=Wc(e,s);a=e.substring(l),e=e.substring(0,s)}return(r==="linkcode"||r==="link"&&t.link==="code")&&(a=`\`${a}\``),(i=(n=t.renderLink)===null||n===void 0?void 0:n.call(t,e,a))!==null&&i!==void 0?i:Um(e,a)}}o(Fm,"renderInlineTag");function Um(r,e){try{return We.parse(r,!0),`[${e}](${r})`}catch{return r}}o(Um,"renderLinkDefault");var yi=class{static{o(this,"JSDocTextImpl")}constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;t<this.inlines.length;t++){let n=this.inlines[t],i=this.inlines[t+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
`)}return e}toMarkdown(e){let t="";for(let n=0;n<this.inlines.length;n++){let i=this.inlines[n],s=this.inlines[n+1];t+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(t+=`
`)}return t}},zs=class{static{o(this,"JSDocLineImpl")}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}};function Ad(r){return r.endsWith(`
`)?`
`:`

`}o(Ad,"fillNewlines");var xi=class{static{o(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let t=this.commentProvider.getComment(e);if(t&&Vc(t))return jc(t).toMarkdown({renderLink:o((i,s)=>this.documentationLinkRenderer(e,i,s),"renderLink"),renderTag:o(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,t,n){var i;let s=(i=this.findNameInPrecomputedScopes(e,t))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,t);if(s&&s.nameSegment){let a=s.nameSegment.range.start.line+1,c=s.nameSegment.range.start.character+1,l=s.documentUri.with({fragment:`L${a},${c}`});return`[${n}](${l.toString()})`}else return}documentationTagRenderer(e,t){}findNameInPrecomputedScopes(e,t){let i=ge(e).precomputedScopes;if(!i)return;let s=e;do{let c=i.get(s).find(l=>l.name===t);if(c)return c;s=s.$container}while(s)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(i=>i.name===t)}};var Ti=class{static{o(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var t;return Fc(e)?e.$comment:(t=ro(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||t===void 0?void 0:t.text}};var le={};G(le,nl(Oc(),1));var Ei=class{static{o(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e){return Promise.resolve(this.syncParser.parse(e))}},Kc=class{static{o(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){let e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){let t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){let n=await this.acquireParserWorker(t),i=new Ue,s,a=t.onCancellationRequested(()=>{s=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(c=>{let l=this.hydrator.hydrate(c);i.resolve(l)}).catch(c=>{i.reject(c)}).finally(()=>{a.dispose(),clearTimeout(s)}),i.promise}terminateWorker(e){e.terminate();let t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(let n of this.workerPool)if(n.ready)return n.lock(),n;let t=new Ue;return e.onCancellationRequested(()=>{let n=this.queue.indexOf(t);n>=0&&this.queue.splice(n,1),t.reject(ut)}),this.queue.push(t),t.promise}},Hc=class{static{o(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,n,i){this.onReadyEmitter=new le.Emitter,this.deferred=new Ue,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,t(s=>{let a=s;this.deferred.resolve(a),this.unlock()}),n(s=>{this.deferred.reject(s),this.unlock()})}terminate(){this.deferred.reject(ut),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Ue,this.sendMessage(e),this.deferred.promise}};var Ri=class{static{o(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new w.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let t=new w.CancellationTokenSource;return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,n){let i=new Ue,s={action:t,deferred:i,cancellationToken:n??w.CancellationToken.None};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:t,deferred:n,cancellationToken:i})=>{try{let s=await Promise.resolve().then(()=>t(i));n.resolve(s)}catch(s){Gt(s)?n.resolve(void 0):n.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var Ai=class{static{o(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new gr,this.tokenTypeIdMap=new gr,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors.map(t=>Object.assign({},t)),parserErrors:e.parserErrors.map(t=>Object.assign({},t)),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}createDehyrationContext(e){let t=new Map,n=new Map;for(let i of Qe(e))t.set(i,{});if(e.$cstNode)for(let i of qt(e.$cstNode))n.set(i,{});return{astNodes:t,cstNodes:n}}dehydrateAstNode(e,t){let n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(let[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){let a=[];n[i]=a;for(let c of s)oe(c)?a.push(this.dehydrateAstNode(c,t)):Ae(c)?a.push(this.dehydrateReference(c,t)):a.push(c)}else oe(s)?n[i]=this.dehydrateAstNode(s,t):Ae(s)?n[i]=this.dehydrateReference(s,t):s!==void 0&&(n[i]=s);return n}dehydrateReference(e,t){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=t.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,t){let n=t.cstNodes.get(e);return cn(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=t.astNodes.get(e.astNode),ze(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,t)):bt(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){let t=e.value,n=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,n),{lexerErrors:e.lexerErrors,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,n)}}createHydrationContext(e){let t=new Map,n=new Map;for(let s of Qe(e))t.set(s,{});let i;if(e.$cstNode)for(let s of qt(e.$cstNode)){let a;"fullText"in s?(a=new Xr(s.fullText),i=a):"content"in s?a=new dr:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(n.set(s,a),a.root=i)}return{astNodes:t,cstNodes:n}}hydrateAstNode(e,t){let n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=t.cstNodes.get(e.$cstNode));for(let[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){let a=[];n[i]=a;for(let c of s)oe(c)?a.push(this.setParent(this.hydrateAstNode(c,t),n)):Ae(c)?a.push(this.hydrateReference(c,n,i,t)):a.push(c)}else oe(s)?n[i]=this.setParent(this.hydrateAstNode(s,t),n):Ae(s)?n[i]=this.hydrateReference(s,n,i,t):s!==void 0&&(n[i]=s);return n}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,n,i){return this.linker.buildReference(t,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,n=0){let i=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=t.astNodes.get(e.astNode),ze(i))for(let s of e.content){let a=this.hydrateCstNode(s,t,n++);i.content.push(a)}return i}hydrateCstLeafNode(e){let t=this.getTokenType(e.tokenType),n=e.offset,i=e.length,s=e.startLine,a=e.startColumn,c=e.endLine,l=e.endColumn,u=e.hidden;return new fr(n,i,{start:{line:s,character:a},end:{line:c,character:l}},t,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap();let t=this.grammarElementIdMap.getKey(e);if(t)return t;throw new Error("Invalid grammar element id: "+e)}createGrammarElementIdMap(){let e=0;for(let t of Qe(this.grammar))dn(t)&&this.grammarElementIdMap.set(t,e++)}};function qc(r){return{documentation:{CommentProvider:o(e=>new Ti(e),"CommentProvider"),DocumentationProvider:o(e=>new xi(e),"DocumentationProvider")},parser:{AsyncParser:o(e=>new Ei(e),"AsyncParser"),GrammarConfig:o(e=>Sa(e),"GrammarConfig"),LangiumParser:o(e=>Nc(e),"LangiumParser"),CompletionParser:o(e=>Ic(e),"CompletionParser"),ValueConverter:o(()=>new mr,"ValueConverter"),TokenBuilder:o(()=>new pr,"TokenBuilder"),Lexer:o(e=>new mi(e),"Lexer"),ParserErrorMessageProvider:o(()=>new Yr,"ParserErrorMessageProvider")},workspace:{AstNodeLocator:o(()=>new ui,"AstNodeLocator"),AstNodeDescriptionProvider:o(e=>new ci(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:o(e=>new li(e),"ReferenceDescriptionProvider")},references:{Linker:o(e=>new Jn(e),"Linker"),NameProvider:o(()=>new Qn,"NameProvider"),ScopeProvider:o(e=>new ni(e),"ScopeProvider"),ScopeComputation:o(e=>new ei(e),"ScopeComputation"),References:o(e=>new Zn(e),"References")},serializer:{Hydrator:o(e=>new Ai(e),"Hydrator"),JsonSerializer:o(e=>new ii(e),"JsonSerializer")},validation:{DocumentValidator:o(e=>new ai(e),"DocumentValidator"),ValidationRegistry:o(e=>new oi(e),"ValidationRegistry")},shared:o(()=>r.shared,"shared")}}o(qc,"createDefaultCoreModule");function Xc(r){return{ServiceRegistry:o(()=>new si,"ServiceRegistry"),workspace:{LangiumDocuments:o(e=>new Yn(e),"LangiumDocuments"),LangiumDocumentFactory:o(e=>new Xn(e),"LangiumDocumentFactory"),DocumentBuilder:o(e=>new di(e),"DocumentBuilder"),IndexManager:o(e=>new hi(e),"IndexManager"),WorkspaceManager:o(e=>new pi(e),"WorkspaceManager"),FileSystemProvider:o(e=>r.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:o(()=>new Ri,"WorkspaceLock"),ConfigurationProvider:o(e=>new fi(e),"ConfigurationProvider")}}}o(Xc,"createDefaultSharedCoreModule");var Yc;(function(r){r.merge=(e,t)=>Ks(Ks({},e),t)})(Yc||(Yc={}));function Hs(r,e,t,n,i,s,a,c,l){let u=[r,e,t,n,i,s,a,c,l].reduce(Ks,{});return wd(u)}o(Hs,"inject");var Jc=Symbol("isProxy");function _d(r){if(r&&r[Jc])for(let e of Object.values(r))_d(e);return r}o(_d,"eagerLoad");function wd(r,e){let t=new Proxy({},{deleteProperty:o(()=>!1,"deleteProperty"),get:o((n,i)=>Cd(n,i,r,e||t),"get"),getOwnPropertyDescriptor:o((n,i)=>(Cd(n,i,r,e||t),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:o((n,i)=>i in r,"has"),ownKeys:o(()=>[...Reflect.ownKeys(r),Jc],"ownKeys")});return t[Jc]=!0,t}o(wd,"_inject");var Sd=Symbol();function Cd(r,e,t,n){if(e in r){if(r[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:r[e]});if(r[e]===Sd)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');return r[e]}else if(e in t){let i=t[e];r[e]=Sd;try{r[e]=typeof i=="function"?i(n):wd(i,n)}catch(s){throw r[e]=s instanceof Error?s:void 0,s}return r[e]}else return}o(Cd,"_resolve");function Ks(r,e){if(e){for(let[t,n]of Object.entries(e))if(n!==void 0){let i=r[t];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?r[t]=Ks(i,n):r[t]=n}}return r}o(Ks,"_merge");var W={};jt(W,{AstUtils:()=>Fi,BiMap:()=>gr,Cancellation:()=>w,ContextCache:()=>yr,CstUtils:()=>Si,DONE_RESULT:()=>$e,Deferred:()=>Ue,Disposable:()=>xr,DisposableCache:()=>rn,DocumentCache:()=>Bs,EMPTY_STREAM:()=>ln,ErrorWithLocation:()=>Yt,GrammarUtils:()=>Vi,MultiMap:()=>ft,OperationCancelled:()=>ut,Reduction:()=>Ar,RegExpUtils:()=>Wi,SimpleCache:()=>ri,StreamImpl:()=>Ke,TreeStreamImpl:()=>st,URI:()=>We,UriUtils:()=>Ge,WorkspaceCache:()=>nn,assertUnreachable:()=>$t,delayNextTick:()=>Mc,interruptAndCheck:()=>xe,isOperationCancelled:()=>Gt,loadGrammarFromJson:()=>Tr,setInterruptionPeriod:()=>dd,startCancelableOperation:()=>fd,stream:()=>V});G(W,le);var qs=class{static{o(this,"EmptyFileSystemProvider")}readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}},Qc={fileSystemProvider:o(()=>new qs,"fileSystemProvider")};var Gm={Grammar:o(()=>{},"Grammar"),LanguageMetaData:o(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Bm={AstReflection:o(()=>new kr,"AstReflection")};function Wm(){let r=Hs(Xc(Qc),Bm),e=Hs(qc({shared:r}),Gm);return r.ServiceRegistry.register(e),e}o(Wm,"createMinimalGrammarServices");function Tr(r){var e;let t=Wm(),n=t.serializer.JsonSerializer.deserialize(r);return t.shared.workspace.LangiumDocumentFactory.fromModel(n,We.parse(`memory://${(e=n.name)!==null&&e!==void 0?e:"grammar"}.langium`)),n}o(Tr,"loadGrammarFromJson");G(pe,W);var jm=Object.defineProperty,H=o((r,e)=>jm(r,"name",{value:e,configurable:!0}),"__name"),Vm="Statement",$d="Branch";function zm(r){return dt.isInstance(r,$d)}o(zm,"isBranch");H(zm,"isBranch");var Km="Checkout",Hm="CherryPicking",Md="Commit";function qm(r){return dt.isInstance(r,Md)}o(qm,"isCommit");H(qm,"isCommit");var Xm="Common";function Ym(r){return dt.isInstance(r,Xm)}o(Ym,"isCommon");H(Ym,"isCommon");var Dd="GitGraph";function Jm(r){return dt.isInstance(r,Dd)}o(Jm,"isGitGraph");H(Jm,"isGitGraph");var Qm="Info";function Zm(r){return dt.isInstance(r,Qm)}o(Zm,"isInfo");H(Zm,"isInfo");var Fd="Merge";function eg(r){return dt.isInstance(r,Fd)}o(eg,"isMerge");H(eg,"isMerge");var tg="Packet";function rg(r){return dt.isInstance(r,tg)}o(rg,"isPacket");H(rg,"isPacket");var ng="PacketBlock";function ig(r){return dt.isInstance(r,ng)}o(ig,"isPacketBlock");H(ig,"isPacketBlock");var sg="Pie";function og(r){return dt.isInstance(r,sg)}o(og,"isPie");H(og,"isPie");var ag="PieSection";function cg(r){return dt.isInstance(r,ag)}o(cg,"isPieSection");H(cg,"isPieSection");var lg="Direction",Ud=class extends Kt{static{o(this,"MermaidAstReflection")}static{H(this,"MermaidAstReflection")}getAllTypes(){return["Branch","Checkout","CherryPicking","Commit","Common","Direction","GitGraph","Info","Merge","Packet","PacketBlock","Pie","PieSection","Statement"]}computeIsSubtype(r,e){switch(r){case $d:case Km:case Hm:case Md:case Fd:return this.isSubtype(Vm,e);case lg:return this.isSubtype(Dd,e);default:return!1}}getReferenceType(r){let e=`${r.container.$type}:${r.property}`;switch(e){default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(r){switch(r){case"Branch":return{name:"Branch",properties:[{name:"name"},{name:"order"}]};case"Checkout":return{name:"Checkout",properties:[{name:"branch"}]};case"CherryPicking":return{name:"CherryPicking",properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case"Commit":return{name:"Commit",properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Common":return{name:"Common",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"GitGraph":return{name:"GitGraph",properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case"Info":return{name:"Info",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Merge":return{name:"Merge",properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Packet":return{name:"Packet",properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case"PacketBlock":return{name:"PacketBlock",properties:[{name:"end"},{name:"label"},{name:"start"}]};case"Pie":return{name:"Pie",properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case"PieSection":return{name:"PieSection",properties:[{name:"label"},{name:"value"}]};case"Direction":return{name:"Direction",properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:r,properties:[]}}}},dt=new Ud,Ld,ug=H(()=>Ld??(Ld=Tr('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","name":"Info","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"InfoGrammar"),Od,fg=H(()=>Od??(Od=Tr(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","name":"Packet","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}`)),"PacketGrammar"),Pd,dg=H(()=>Pd??(Pd=Tr('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","name":"Pie","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"PieGrammar"),bd,hg=H(()=>bd??(bd=Tr(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","name":"GitGraph","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)),"GitGraphGrammar"),pg={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},mg={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},gg={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},yg={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},YS={AstReflection:H(()=>new Ud,"AstReflection")},JS={Grammar:H(()=>ug(),"Grammar"),LanguageMetaData:H(()=>pg,"LanguageMetaData"),parser:{}},QS={Grammar:H(()=>fg(),"Grammar"),LanguageMetaData:H(()=>mg,"LanguageMetaData"),parser:{}},ZS={Grammar:H(()=>dg(),"Grammar"),LanguageMetaData:H(()=>gg,"LanguageMetaData"),parser:{}},eC={Grammar:H(()=>hg(),"Grammar"),LanguageMetaData:H(()=>yg,"LanguageMetaData"),parser:{}},xg=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Tg=/accTitle[\t ]*:([^\n\r]*)/,Eg=/title([\t ][^\n\r]*|)/,Rg={ACC_DESCR:xg,ACC_TITLE:Tg,TITLE:Eg},Ag=class extends mr{static{o(this,"AbstractMermaidValueConverter")}static{H(this,"AbstractMermaidValueConverter")}runConverter(r,e,t){let n=this.runCommonConverter(r,e,t);return n===void 0&&(n=this.runCustomConverter(r,e,t)),n===void 0?super.runConverter(r,e,t):n}runCommonConverter(r,e,t){let n=Rg[r.name];if(n===void 0)return;let i=n.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
`)}}},rC=class extends Ag{static{o(this,"CommonValueConverter")}static{H(this,"CommonValueConverter")}runCustomConverter(r,e,t){}},vg=class extends pr{static{o(this,"AbstractMermaidTokenBuilder")}static{H(this,"AbstractMermaidTokenBuilder")}constructor(r){super(),this.keywords=new Set(r)}buildKeywordTokens(r,e,t){let n=super.buildKeywordTokens(r,e,t);return n.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}},iC=class extends vg{static{o(this,"CommonTokenBuilder")}static{H(this,"CommonTokenBuilder")}};export{qc as a,Xc as b,Hs as c,Qc as d,pe as e,H as f,YS as g,JS as h,QS as i,ZS as j,eC as k,Ag as l,rC as m,vg as n};