You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
venv/PyCharm 2025.2.1.1/plugins/python/jupyter-web/2928.js

1 line
318 KiB

"use strict";var Ga=Object.defineProperty,Ba=(Ae,V,g)=>V in Ae?Ga(Ae,V,{enumerable:!0,configurable:!0,writable:!0,value:g}):Ae[V]=g,Un=(Ae,V,g)=>(Ba(Ae,"symbol"!=typeof V?V+"":V,g),g);(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[2928],{59762:(Ae,V,g)=>{V.AU=V.Ts=void 0;const L=g(51194),B=g(96021),k=g(4617);var O,A;(A=O=V.Ts||(V.Ts={})).None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:k.Event.None}),A.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:k.Event.None}),A.is=function T(I){const h=I;return h&&(h===A.None||h===A.Cancelled||B.boolean(h.isCancellationRequested)&&!!h.onCancellationRequested)};const M=Object.freeze(function(A,T){const I=L.default().timer.setTimeout(A.bind(T),0);return{dispose(){L.default().timer.clearTimeout(I)}}});class W{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?M:(this._emitter||(this._emitter=new k.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}V.AU=class F{get token(){return this._token||(this._token=new W),this._token}cancel(){this._token?this._token.cancel():this._token=O.Cancelled}dispose(){this._token?this._token instanceof W&&this._token.dispose():this._token=O.None}}},4617:(Ae,V,g)=>{Object.defineProperty(V,"__esModule",{value:!0}),V.Emitter=V.Event=void 0;const y=g(51194);!function(O){const M={dispose(){}};O.None=function(){return M}}(V.Event||(V.Event={}));class B{add(M,W=null,F){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(M),this._contexts.push(W),Array.isArray(F)&&F.push({dispose:()=>this.remove(M,W)})}remove(M,W=null){if(!this._callbacks)return;let F=!1;for(let A=0,T=this._callbacks.length;A<T;A++)if(this._callbacks[A]===M){if(this._contexts[A]===W)return this._callbacks.splice(A,1),void this._contexts.splice(A,1);F=!0}if(F)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...M){if(!this._callbacks)return[];const W=[],F=this._callbacks.slice(0),A=this._contexts.slice(0);for(let T=0,I=F.length;T<I;T++)try{W.push(F[T].apply(A[T],M))}catch(h){y.default().console.error(h)}return W}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class k{constructor(M){this._options=M}get event(){return this._event||(this._event=(M,W,F)=>{this._callbacks||(this._callbacks=new B),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(M,W);const A={dispose:()=>{!this._callbacks||(this._callbacks.remove(M,W),A.dispose=k._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(F)&&F.push(A),A}),this._event}fire(M){this._callbacks&&this._callbacks.invoke.call(this._callbacks,M)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}V.Emitter=k,k._noop=function(){}},96021:(Ae,V)=>{function y(W){return"string"==typeof W||W instanceof String}function O(W){return Array.isArray(W)}Object.defineProperty(V,"__esModule",{value:!0}),V.stringArray=V.array=V.func=V.error=V.number=V.string=V.boolean=void 0,V.boolean=function g(W){return!0===W||!1===W},V.string=y,V.number=function L(W){return"number"==typeof W||W instanceof Number},V.error=function B(W){return W instanceof Error},V.func=function k(W){return"function"==typeof W},V.array=O,V.stringArray=function M(W){return O(W)&&W.every(F=>y(F))}},51194:(Ae,V)=>{let g;function y(){if(void 0===g)throw new Error("No runtime abstraction layer installed");return g}Object.defineProperty(V,"__esModule",{value:!0}),(y||(y={})).install=function B(k){if(void 0===k)throw new Error("No runtime abstraction layer provided");g=k},V.default=y},77614:(Ae,V,g)=>{var F;g.d(V,{n:()=>M,z:()=>W});var y=g(85497),L=g(66066),B=g(60036),k=g(58497),O=(F=class extends y.T7{constructor(){super(["gitGraph"])}},__name(F,"GitGraphTokenBuilder"),F),M={parser:{TokenBuilder:(0,y.eW)(()=>new O,"TokenBuilder"),ValueConverter:(0,y.eW)(()=>new y.nr,"ValueConverter")}};function W(A=L.u){const T=(0,B.f3)((0,k.T)(A),y.GS),I=(0,B.f3)((0,k.Q)({shared:T}),y.vn,M);return T.ServiceRegistry.register(I),{shared:T,GitGraph:I}}(0,y.eW)(W,"createGitGraphServices")},30091:(Ae,V,g)=>{var F;g.d(V,{T:()=>W,x:()=>M});var y=g(85497),L=g(66066),B=g(60036),k=g(58497),O=(F=class extends y.T7{constructor(){super(["radar-beta"])}},__name(F,"RadarTokenBuilder"),F),M={parser:{TokenBuilder:(0,y.eW)(()=>new O,"TokenBuilder"),ValueConverter:(0,y.eW)(()=>new y.nr,"ValueConverter")}};function W(A=L.u){const T=(0,B.f3)((0,k.T)(A),y.GS),I=(0,B.f3)((0,k.Q)({shared:T}),y.gB,M);return T.ServiceRegistry.register(I),{shared:T,Radar:I}}(0,y.eW)(W,"createRadarServices")},85497:(Ae,V,g)=>{var vt,zt,ht,Yt,Et;g.d(V,{T7:()=>Tt,kb:()=>kt,Qr:()=>Gn,nr:()=>ct,vn:()=>Kt,F_:()=>Bt,GS:()=>Fn,bb:()=>nt,WH:()=>Wt,gB:()=>Bn,eW:()=>E});var y=g(21932),L=g(58497),B=g(60036),k=g(48893),O=g(66066),M=g(74312);const W={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},F={AstReflection:()=>new k.SV};function T(be){var we;const ge=function A(){const be=(0,B.f3)((0,L.T)(O.u),F),we=(0,B.f3)((0,L.Q)({shared:be}),W);return be.ServiceRegistry.register(we),we}(),ze=ge.serializer.JsonSerializer.deserialize(be);return ge.shared.workspace.LangiumDocumentFactory.fromModel(ze,M.o.parse(`memory://${null!==(we=ze.name)&&void 0!==we?we:"grammar"}.langium`)),ze}var I=g(7043),h=g(60197),v=Object.defineProperty,E=(be,we)=>v(be,"name",{value:we,configurable:!0}),S="Statement",m="Architecture";E(function N(be){return ve.isInstance(be,m)},"isArchitecture");var P="Axis",D="Branch";E(function b(be){return ve.isInstance(be,D)},"isBranch");var X="Checkout",ae="CherryPicking",ue="Commit";E(function K(be){return ve.isInstance(be,ue)},"isCommit");var te="Common";E(function de(be){return ve.isInstance(be,te)},"isCommon");var ye="Curve",Se="Edge",Re="Entry",Be="GitGraph";E(function ee(be){return ve.isInstance(be,Be)},"isGitGraph");var H="Group",oe="Info";E(function le(be){return ve.isInstance(be,oe)},"isInfo");var _e="Junction",Te="Merge";E(function pe(be){return ve.isInstance(be,Te)},"isMerge");var Xe="Option",xe="Packet";E(function De(be){return ve.isInstance(be,xe)},"isPacket");var tt="PacketBlock";E(function lt(be){return ve.isInstance(be,tt)},"isPacketBlock");var Ze="Pie";E(function Je(be){return ve.isInstance(be,Ze)},"isPie");var C="PieSection";E(function Z(be){return ve.isInstance(be,C)},"isPieSection");var Pe,qt,pn,In,at,en,z="Radar",fe="Service",ce="Direction",Ie=(vt=class extends y.$v{getAllTypes(){return[m,P,D,X,ae,ue,te,ye,ce,Se,Re,Be,H,oe,_e,Te,Xe,xe,tt,Ze,C,z,fe,S]}computeIsSubtype(we,ge){switch(we){case D:case X:case ae:case ue:case Te:return this.isSubtype(S,ge);case ce:return this.isSubtype(Be,ge);default:return!1}}getReferenceType(we){const ge=`${we.container.$type}:${we.property}`;if("Entry:axis"===ge)return P;throw new Error(`${ge} is not a valid reference id.`)}getTypeMetaData(we){switch(we){case m:return{name:m,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case P:return{name:P,properties:[{name:"label"},{name:"name"}]};case D:return{name:D,properties:[{name:"name"},{name:"order"}]};case X:return{name:X,properties:[{name:"branch"}]};case ae:return{name:ae,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case ue:return{name:ue,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case te:return{name:te,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case ye:return{name:ye,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case Se:return{name:Se,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case Re:return{name:Re,properties:[{name:"axis"},{name:"value"}]};case Be:return{name:Be,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case H:return{name:H,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case oe:return{name:oe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case _e:return{name:_e,properties:[{name:"id"},{name:"in"}]};case Te:return{name:Te,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case Xe:return{name:Xe,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case xe:return{name:xe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case tt:return{name:tt,properties:[{name:"end"},{name:"label"},{name:"start"}]};case Ze:return{name:Ze,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case C:return{name:C,properties:[{name:"label"},{name:"value"}]};case z:return{name:z,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case fe:return{name:fe,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case ce:return{name:ce,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:we,properties:[]}}}},E(vt,"MermaidAstReflection"),vt),ve=new Ie,Ot=E(()=>Pe??(Pe=T('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","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","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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"),yt=E(()=>qt??(qt=T('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","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","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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"),Ut=E(()=>pn??(pn=T('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","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","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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"),Lt=E(()=>In??(In=T('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"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":[]}')),"ArchitectureGrammar"),Ft=E(()=>at??(at=T('{"$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","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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","entry":true,"name":"GitGraph","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"),Gt=E(()=>en??(en=T('{"$type":"Grammar","isDeclared":true,"name":"Radar","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":[]},{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@12"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@12"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9\\\\-_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}')),"RadarGrammar"),Cn={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},We={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xn={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Pt={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},kn={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ct={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Fn={AstReflection:E(()=>new Ie,"AstReflection")},Bt={Grammar:E(()=>Ot(),"Grammar"),LanguageMetaData:E(()=>Cn,"LanguageMetaData"),parser:{}},nt={Grammar:E(()=>yt(),"Grammar"),LanguageMetaData:E(()=>We,"LanguageMetaData"),parser:{}},Wt={Grammar:E(()=>Ut(),"Grammar"),LanguageMetaData:E(()=>xn,"LanguageMetaData"),parser:{}},Gn={Grammar:E(()=>Lt(),"Grammar"),LanguageMetaData:E(()=>Pt,"LanguageMetaData"),parser:{}},Kt={Grammar:E(()=>Ft(),"Grammar"),LanguageMetaData:E(()=>kn,"LanguageMetaData"),parser:{}},Bn={Grammar:E(()=>Gt(),"Grammar"),LanguageMetaData:E(()=>Ct,"LanguageMetaData"),parser:{}},Ht={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},kt=(zt=class extends I.t{runConverter(we,ge,ze){let st=this.runCommonConverter(we,ge,ze);return void 0===st&&(st=this.runCustomConverter(we,ge,ze)),void 0===st?super.runConverter(we,ge,ze):st}runCommonConverter(we,ge,ze){const st=Ht[we.name];if(void 0===st)return;const rt=st.exec(ge);if(null!==rt){if(void 0!==rt[1])return rt[1].trim().replace(/[\t ]{2,}/gm," ");if(void 0!==rt[2])return rt[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n")}}},E(zt,"AbstractMermaidValueConverter"),zt),ct=(E(ht=class extends kt{runCustomConverter(we,ge,ze){}},"CommonValueConverter"),ht),Tt=(Yt=class extends h.P{constructor(we){super(),this.keywords=new Set(we)}buildKeywordTokens(we,ge,ze){const st=super.buildKeywordTokens(we,ge,ze);return st.forEach(rt=>{this.keywords.has(rt.name)&&void 0!==rt.PATTERN&&(rt.PATTERN=new RegExp(rt.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),st}},E(Yt,"AbstractMermaidTokenBuilder"),Yt);E(Et=class extends(null){},"CommonTokenBuilder")},15563:(Ae,V,g)=>{var A,T;g.d(V,{i:()=>F,s:()=>W});var y=g(85497),L=g(66066),B=g(60036),k=g(58497),O=(A=class extends y.T7{constructor(){super(["architecture"])}},__name(A,"ArchitectureTokenBuilder"),A),M=(T=class extends y.kb{runCustomConverter(h,v,E){return"ARCH_ICON"===h.name?v.replace(/[()]/g,"").trim():"ARCH_TEXT_ICON"===h.name?v.replace(/["()]/g,""):"ARCH_TITLE"===h.name?v.replace(/[[\]]/g,"").trim():void 0}},__name(T,"ArchitectureValueConverter"),T),W={parser:{TokenBuilder:(0,y.eW)(()=>new O,"TokenBuilder"),ValueConverter:(0,y.eW)(()=>new M,"ValueConverter")}};function F(I=L.u){const h=(0,B.f3)((0,k.T)(I),y.GS),v=(0,B.f3)((0,k.Q)({shared:h}),y.Qr,W);return h.ServiceRegistry.register(v),{shared:h,Architecture:v}}(0,y.eW)(F,"createArchitectureServices")},23863:(Ae,V,g)=>{var F;g.d(V,{H:()=>M,M:()=>W});var y=g(85497),L=g(66066),B=g(60036),k=g(58497),O=(F=class extends y.T7{constructor(){super(["info","showInfo"])}},__name(F,"InfoTokenBuilder"),F),M={parser:{TokenBuilder:(0,y.eW)(()=>new O,"TokenBuilder"),ValueConverter:(0,y.eW)(()=>new y.nr,"ValueConverter")}};function W(A=L.u){const T=(0,B.f3)((0,k.T)(A),y.GS),I=(0,B.f3)((0,k.Q)({shared:T}),y.F_,M);return T.ServiceRegistry.register(I),{shared:T,Info:I}}(0,y.eW)(W,"createInfoServices")},42872:(Ae,V,g)=>{var A,T;g.d(V,{F:()=>W,l:()=>F});var y=g(85497),L=g(66066),B=g(60036),k=g(58497),O=(A=class extends y.T7{constructor(){super(["pie","showData"])}},__name(A,"PieTokenBuilder"),A),M=(T=class extends y.kb{runCustomConverter(h,v,E){if("PIE_SECTION_LABEL"===h.name)return v.replace(/"/g,"").trim()}},__name(T,"PieValueConverter"),T),W={parser:{TokenBuilder:(0,y.eW)(()=>new O,"TokenBuilder"),ValueConverter:(0,y.eW)(()=>new M,"ValueConverter")}};function F(I=L.u){const h=(0,B.f3)((0,k.T)(I),y.GS),v=(0,B.f3)((0,k.Q)({shared:h}),y.WH,W);return h.ServiceRegistry.register(v),{shared:h,Pie:v}}(0,y.eW)(F,"createPieServices")},32527:(Ae,V,g)=>{var F;g.d(V,{$:()=>M,g:()=>W});var y=g(85497),L=g(66066),B=g(60036),k=g(58497),O=(F=class extends y.T7{constructor(){super(["packet-beta"])}},__name(F,"PacketTokenBuilder"),F),M={parser:{TokenBuilder:(0,y.eW)(()=>new O,"TokenBuilder"),ValueConverter:(0,y.eW)(()=>new y.nr,"ValueConverter")}};function W(A=L.u){const T=(0,B.f3)((0,k.T)(A),y.GS),I=(0,B.f3)((0,k.Q)({shared:T}),y.bb,M);return T.ServiceRegistry.register(I),{shared:T,Packet:I}}(0,y.eW)(W,"createPacketServices")},32928:(Ae,V,g)=>{var E;g.d(V,{Qc:()=>I});var y=g(53420),F=(g(77614),g(23863),g(32527),g(42872),g(15563),g(30091),g(85497)),A={},T={info:(0,F.eW)((0,y.Z)(function*(){const{createInfoServices:S}=yield g.e(4743).then(g.bind(g,74743)),m=S().Info.parser.LangiumParser;A.info=m}),"info"),packet:(0,F.eW)((0,y.Z)(function*(){const{createPacketServices:S}=yield g.e(5033).then(g.bind(g,15033)),m=S().Packet.parser.LangiumParser;A.packet=m}),"packet"),pie:(0,F.eW)((0,y.Z)(function*(){const{createPieServices:S}=yield g.e(6454).then(g.bind(g,56454)),m=S().Pie.parser.LangiumParser;A.pie=m}),"pie"),architecture:(0,F.eW)((0,y.Z)(function*(){const{createArchitectureServices:S}=yield g.e(5802).then(g.bind(g,45802)),m=S().Architecture.parser.LangiumParser;A.architecture=m}),"architecture"),gitGraph:(0,F.eW)((0,y.Z)(function*(){const{createGitGraphServices:S}=yield g.e(8901).then(g.bind(g,18901)),m=S().GitGraph.parser.LangiumParser;A.gitGraph=m}),"gitGraph"),radar:(0,F.eW)((0,y.Z)(function*(){const{createRadarServices:S}=yield g.e(9776).then(g.bind(g,59776)),m=S().Radar.parser.LangiumParser;A.radar=m}),"radar")};function I(S,m){return h.apply(this,arguments)}function h(){return(h=(0,y.Z)(function*(S,m){const N=T[S];if(!N)throw new Error(`Unknown diagram type: ${S}`);A[S]||(yield N());const D=A[S].parse(m);if(D.lexerErrors.length>0||D.parserErrors.length>0)throw new v(D);return D.value})).apply(this,arguments)}(0,F.eW)(I,"parse");var v=(E=class extends Error{constructor(m){super(`Parsing failed: ${m.lexerErrors.map(D=>D.message).join("\n")} ${m.parserErrors.map(D=>D.message).join("\n")}`),this.result=m}},__name(E,"MermaidParseError"),E)},74312:(Ae,V,g)=>{var y;g.d(V,{c:()=>B,o:()=>L}),(()=>{var k={470:F=>{function A(h){if("string"!=typeof h)throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function T(h,v){for(var E,S="",m=0,N=-1,P=0,D=0;D<=h.length;++D){if(D<h.length)E=h.charCodeAt(D);else{if(47===E)break;E=47}if(47===E){if(N!==D-1&&1!==P)if(N!==D-1&&2===P){if(S.length<2||2!==m||46!==S.charCodeAt(S.length-1)||46!==S.charCodeAt(S.length-2))if(S.length>2){var b=S.lastIndexOf("/");if(b!==S.length-1){-1===b?(S="",m=0):m=(S=S.slice(0,b)).length-1-S.lastIndexOf("/"),N=D,P=0;continue}}else if(2===S.length||1===S.length){S="",m=0,N=D,P=0;continue}v&&(S.length>0?S+="/..":S="..",m=2)}else S.length>0?S+="/"+h.slice(N+1,D):S=h.slice(N+1,D),m=D-N-1;N=D,P=0}else 46===E&&-1!==P?++P:P=-1}return S}var I={resolve:function(){for(var h,v="",E=!1,S=arguments.length-1;S>=-1&&!E;S--){var m;S>=0?m=arguments[S]:(void 0===h&&(h=process.cwd()),m=h),A(m),0!==m.length&&(v=m+"/"+v,E=47===m.charCodeAt(0))}return v=T(v,!E),E?v.length>0?"/"+v:"/":v.length>0?v:"."},normalize:function(h){if(A(h),0===h.length)return".";var v=47===h.charCodeAt(0),E=47===h.charCodeAt(h.length-1);return 0!==(h=T(h,!v)).length||v||(h="."),h.length>0&&E&&(h+="/"),v?"/"+h:h},isAbsolute:function(h){return A(h),h.length>0&&47===h.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var h,v=0;v<arguments.length;++v){var E=arguments[v];A(E),E.length>0&&(void 0===h?h=E:h+="/"+E)}return void 0===h?".":I.normalize(h)},relative:function(h,v){if(A(h),A(v),h===v||(h=I.resolve(h))===(v=I.resolve(v)))return"";for(var E=1;E<h.length&&47===h.charCodeAt(E);++E);for(var S=h.length,m=S-E,N=1;N<v.length&&47===v.charCodeAt(N);++N);for(var P=v.length-N,D=m<P?m:P,b=-1,X=0;X<=D;++X){if(X===D){if(P>D){if(47===v.charCodeAt(N+X))return v.slice(N+X+1);if(0===X)return v.slice(N+X)}else m>D&&(47===h.charCodeAt(E+X)?b=X:0===X&&(b=0));break}var ae=h.charCodeAt(E+X);if(ae!==v.charCodeAt(N+X))break;47===ae&&(b=X)}var ue="";for(X=E+b+1;X<=S;++X)X!==S&&47!==h.charCodeAt(X)||(0===ue.length?ue+="..":ue+="/..");return ue.length>0?ue+v.slice(N+b):(N+=b,47===v.charCodeAt(N)&&++N,v.slice(N))},_makeLong:function(h){return h},dirname:function(h){if(A(h),0===h.length)return".";for(var v=h.charCodeAt(0),E=47===v,S=-1,m=!0,N=h.length-1;N>=1;--N)if(47===(v=h.charCodeAt(N))){if(!m){S=N;break}}else m=!1;return-1===S?E?"/":".":E&&1===S?"//":h.slice(0,S)},basename:function(h,v){if(void 0!==v&&"string"!=typeof v)throw new TypeError('"ext" argument must be a string');A(h);var E,S=0,m=-1,N=!0;if(void 0!==v&&v.length>0&&v.length<=h.length){if(v.length===h.length&&v===h)return"";var P=v.length-1,D=-1;for(E=h.length-1;E>=0;--E){var b=h.charCodeAt(E);if(47===b){if(!N){S=E+1;break}}else-1===D&&(N=!1,D=E+1),P>=0&&(b===v.charCodeAt(P)?-1==--P&&(m=E):(P=-1,m=D))}return S===m?m=D:-1===m&&(m=h.length),h.slice(S,m)}for(E=h.length-1;E>=0;--E)if(47===h.charCodeAt(E)){if(!N){S=E+1;break}}else-1===m&&(N=!1,m=E+1);return-1===m?"":h.slice(S,m)},extname:function(h){A(h);for(var v=-1,E=0,S=-1,m=!0,N=0,P=h.length-1;P>=0;--P){var D=h.charCodeAt(P);if(47!==D)-1===S&&(m=!1,S=P+1),46===D?-1===v?v=P:1!==N&&(N=1):-1!==v&&(N=-1);else if(!m){E=P+1;break}}return-1===v||-1===S||0===N||1===N&&v===S-1&&v===E+1?"":h.slice(v,S)},format:function(h){if(null===h||"object"!=typeof h)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof h);return S=(E=h).dir||E.root,m=E.base||(E.name||"")+(E.ext||""),S?S===E.root?S+m:S+"/"+m:m;var E,S,m},parse:function(h){A(h);var v={root:"",dir:"",base:"",ext:"",name:""};if(0===h.length)return v;var E,S=h.charCodeAt(0),m=47===S;m?(v.root="/",E=1):E=0;for(var N=-1,P=0,D=-1,b=!0,X=h.length-1,ae=0;X>=E;--X)if(47!==(S=h.charCodeAt(X)))-1===D&&(b=!1,D=X+1),46===S?-1===N?N=X:1!==ae&&(ae=1):-1!==N&&(ae=-1);else if(!b){P=X+1;break}return-1===N||-1===D||0===ae||1===ae&&N===D-1&&N===P+1?-1!==D&&(v.base=v.name=0===P&&m?h.slice(1,D):h.slice(P,D)):(0===P&&m?(v.name=h.slice(1,N),v.base=h.slice(1,D)):(v.name=h.slice(P,N),v.base=h.slice(P,D)),v.ext=h.slice(N,D)),P>0?v.dir=h.slice(0,P-1):m&&(v.dir="/"),v},sep:"/",delimiter:":",win32:null,posix:null};I.posix=I,F.exports=I}},O={};function M(F){var A=O[F];if(void 0!==A)return A.exports;var T=O[F]={exports:{}};return k[F](T,T.exports,M),T.exports}M.d=(F,A)=>{for(var T in A)M.o(A,T)&&!M.o(F,T)&&Object.defineProperty(F,T,{enumerable:!0,get:A[T]})},M.o=(F,A)=>Object.prototype.hasOwnProperty.call(F,A),M.r=F=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var W={};(()=>{let F;M.r(W),M.d(W,{URI:()=>m,Utils:()=>Be}),"object"==typeof process?F="win32"===process.platform:"object"==typeof navigator&&(F=navigator.userAgent.indexOf("Windows")>=0);const A=/^\w[\w\d+.-]*$/,T=/^\//,I=/^\/\//;function h(ee,H){if(!ee.scheme&&H)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ee.authority}", path: "${ee.path}", query: "${ee.query}", fragment: "${ee.fragment}"}`);if(ee.scheme&&!A.test(ee.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(ee.path)if(ee.authority){if(!T.test(ee.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(I.test(ee.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}const v="",E="/",S=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{constructor(H,oe,le,_e,Te,pe=!1){var Xe,xe;Un(this,"scheme"),Un(this,"authority"),Un(this,"path"),Un(this,"query"),Un(this,"fragment"),"object"==typeof H?(this.scheme=H.scheme||v,this.authority=H.authority||v,this.path=H.path||v,this.query=H.query||v,this.fragment=H.fragment||v):(this.scheme=(xe=pe,(Xe=H)||xe?Xe:"file"),this.authority=oe||v,this.path=function(Xe,xe){switch(Xe){case"https":case"http":case"file":xe?xe[0]!==E&&(xe=E+xe):xe=E}return xe}(this.scheme,le||v),this.query=_e||v,this.fragment=Te||v,h(this,pe))}static isUri(H){return H instanceof m||!!H&&"string"==typeof H.authority&&"string"==typeof H.fragment&&"string"==typeof H.path&&"string"==typeof H.query&&"string"==typeof H.scheme&&"string"==typeof H.fsPath&&"function"==typeof H.with&&"function"==typeof H.toString}get fsPath(){return ae(this,!1)}with(H){if(!H)return this;let{scheme:oe,authority:le,path:_e,query:Te,fragment:pe}=H;return void 0===oe?oe=this.scheme:null===oe&&(oe=v),void 0===le?le=this.authority:null===le&&(le=v),void 0===_e?_e=this.path:null===_e&&(_e=v),void 0===Te?Te=this.query:null===Te&&(Te=v),void 0===pe?pe=this.fragment:null===pe&&(pe=v),oe===this.scheme&&le===this.authority&&_e===this.path&&Te===this.query&&pe===this.fragment?this:new P(oe,le,_e,Te,pe)}static parse(H,oe=!1){const le=S.exec(H);return le?new P(le[2]||v,de(le[4]||v),de(le[5]||v),de(le[7]||v),de(le[9]||v),oe):new P(v,v,v,v,v)}static file(H){let oe=v;if(F&&(H=H.replace(/\\/g,E)),H[0]===E&&H[1]===E){const le=H.indexOf(E,2);-1===le?(oe=H.substring(2),H=E):(oe=H.substring(2,le),H=H.substring(le)||E)}return new P("file",oe,H,v,v)}static from(H){const oe=new P(H.scheme,H.authority,H.path,H.query,H.fragment);return h(oe,!0),oe}toString(H=!1){return ue(this,H)}toJSON(){return this}static revive(H){if(H){if(H instanceof m)return H;{const oe=new P(H);return oe._formatted=H.external,oe._fsPath=H._sep===N?H.fsPath:null,oe}}return H}}const N=F?1:void 0;class P extends m{constructor(){super(...arguments),Un(this,"_formatted",null),Un(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=ae(this,!1)),this._fsPath}toString(H=!1){return H?ue(this,!0):(this._formatted||(this._formatted=ue(this,!1)),this._formatted)}toJSON(){const H={$mid:1};return this._fsPath&&(H.fsPath=this._fsPath,H._sep=N),this._formatted&&(H.external=this._formatted),this.path&&(H.path=this.path),this.scheme&&(H.scheme=this.scheme),this.authority&&(H.authority=this.authority),this.query&&(H.query=this.query),this.fragment&&(H.fragment=this.fragment),H}}const D={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 b(ee,H,oe){let le,_e=-1;for(let Te=0;Te<ee.length;Te++){const pe=ee.charCodeAt(Te);if(pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||45===pe||46===pe||95===pe||126===pe||H&&47===pe||oe&&91===pe||oe&&93===pe||oe&&58===pe)-1!==_e&&(le+=encodeURIComponent(ee.substring(_e,Te)),_e=-1),void 0!==le&&(le+=ee.charAt(Te));else{void 0===le&&(le=ee.substr(0,Te));const Xe=D[pe];void 0!==Xe?(-1!==_e&&(le+=encodeURIComponent(ee.substring(_e,Te)),_e=-1),le+=Xe):-1===_e&&(_e=Te)}}return-1!==_e&&(le+=encodeURIComponent(ee.substring(_e))),void 0!==le?le:ee}function X(ee){let H;for(let oe=0;oe<ee.length;oe++){const le=ee.charCodeAt(oe);35===le||63===le?(void 0===H&&(H=ee.substr(0,oe)),H+=D[le]):void 0!==H&&(H+=ee[oe])}return void 0!==H?H:ee}function ae(ee,H){let oe;return oe=ee.authority&&ee.path.length>1&&"file"===ee.scheme?`//${ee.authority}${ee.path}`:47===ee.path.charCodeAt(0)&&(ee.path.charCodeAt(1)>=65&&ee.path.charCodeAt(1)<=90||ee.path.charCodeAt(1)>=97&&ee.path.charCodeAt(1)<=122)&&58===ee.path.charCodeAt(2)?H?ee.path.substr(1):ee.path[1].toLowerCase()+ee.path.substr(2):ee.path,F&&(oe=oe.replace(/\//g,"\\")),oe}function ue(ee,H){const oe=H?X:b;let le="",{scheme:_e,authority:Te,path:pe,query:Xe,fragment:xe}=ee;if(_e&&(le+=_e,le+=":"),(Te||"file"===_e)&&(le+=E,le+=E),Te){let De=Te.indexOf("@");if(-1!==De){const tt=Te.substr(0,De);Te=Te.substr(De+1),De=tt.lastIndexOf(":"),-1===De?le+=oe(tt,!1,!1):(le+=oe(tt.substr(0,De),!1,!1),le+=":",le+=oe(tt.substr(De+1),!1,!0)),le+="@"}Te=Te.toLowerCase(),De=Te.lastIndexOf(":"),-1===De?le+=oe(Te,!1,!0):(le+=oe(Te.substr(0,De),!1,!0),le+=Te.substr(De))}if(pe){if(pe.length>=3&&47===pe.charCodeAt(0)&&58===pe.charCodeAt(2)){const De=pe.charCodeAt(1);De>=65&&De<=90&&(pe=`/${String.fromCharCode(De+32)}:${pe.substr(3)}`)}else if(pe.length>=2&&58===pe.charCodeAt(1)){const De=pe.charCodeAt(0);De>=65&&De<=90&&(pe=`${String.fromCharCode(De+32)}:${pe.substr(2)}`)}le+=oe(pe,!0,!1)}return Xe&&(le+="?",le+=oe(Xe,!1,!1)),xe&&(le+="#",le+=H?xe:b(xe,!1,!1)),le}function K(ee){try{return decodeURIComponent(ee)}catch{return ee.length>3?ee.substr(0,3)+K(ee.substr(3)):ee}}const te=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function de(ee){return ee.match(te)?ee.replace(te,H=>K(H)):ee}var ye=M(470);const Se=ye.posix||ye;var Be,ee;(ee=Be||(Be={})).joinPath=function(H,...oe){return H.with({path:Se.join(H.path,...oe)})},ee.resolvePath=function(H,...oe){let le=H.path,_e=!1;"/"!==le[0]&&(le="/"+le,_e=!0);let Te=Se.resolve(le,...oe);return _e&&"/"===Te[0]&&!H.authority&&(Te=Te.substring(1)),H.with({path:Te})},ee.dirname=function(H){if(0===H.path.length||"/"===H.path)return H;let oe=Se.dirname(H.path);return 1===oe.length&&46===oe.charCodeAt(0)&&(oe=""),H.with({path:oe})},ee.basename=function(H){return Se.basename(H.path)},ee.extname=function(H){return Se.extname(H.path)}})(),y=W})();const{URI:L,Utils:B}=y},17790:(Ae,V,g)=>{function y(S){return S.charCodeAt(0)}function L(S,m){Array.isArray(S)?S.forEach(function(N){m.push(N)}):m.push(S)}function B(S,m){if(!0===S[m])throw"duplicate flag "+m;S[m];S[m]=!0}function k(S){if(void 0===S)throw Error("Internal Error - Should never get here!");return!0}function O(){throw Error("Internal Error - Should never get here!")}function M(S){return"Character"===S.type}g.d(V,{e:()=>E,O:()=>v});const W=[];for(let S=y("0");S<=y("9");S++)W.push(S);const F=[y("_")].concat(W);for(let S=y("a");S<=y("z");S++)F.push(S);for(let S=y("A");S<=y("Z");S++)F.push(S);const A=[y(" "),y("\f"),y("\n"),y("\r"),y("\t"),y("\v"),y("\t"),y("\xa0"),y("\u1680"),y("\u2000"),y("\u2001"),y("\u2002"),y("\u2003"),y("\u2004"),y("\u2005"),y("\u2006"),y("\u2007"),y("\u2008"),y("\u2009"),y("\u200a"),y("\u2028"),y("\u2029"),y("\u202f"),y("\u205f"),y("\u3000"),y("\ufeff")],T=/[0-9a-fA-F]/,I=/[0-9]/,h=/[1-9]/;class v{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(m){this.idx=m.idx,this.input=m.input,this.groupIdx=m.groupIdx}pattern(m){this.idx=0,this.input=m,this.groupIdx=0,this.consumeChar("/");const N=this.disjunction();this.consumeChar("/");const P={type:"Flags",loc:{begin:this.idx,end:m.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":B(P,"global");break;case"i":B(P,"ignoreCase");break;case"m":B(P,"multiLine");break;case"u":B(P,"unicode");break;case"y":B(P,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:P,value:N,loc:this.loc(0)}}disjunction(){const m=[],N=this.idx;for(m.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),m.push(this.alternative());return{type:"Disjunction",value:m,loc:this.loc(N)}}alternative(){const m=[],N=this.idx;for(;this.isTerm();)m.push(this.term());return{type:"Alternative",value:m,loc:this.loc(N)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const m=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(m)};case"$":return{type:"EndAnchor",loc:this.loc(m)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(m)};case"B":return{type:"NonWordBoundary",loc:this.loc(m)}}throw Error("Invalid Assertion Escape");case"(":let N;switch(this.consumeChar("?"),this.popChar()){case"=":N="Lookahead";break;case"!":N="NegativeLookahead"}k(N);const P=this.disjunction();return this.consumeChar(")"),{type:N,value:P,loc:this.loc(m)}}return O()}quantifier(m=!1){let N;const P=this.idx;switch(this.popChar()){case"*":N={atLeast:0,atMost:1/0};break;case"+":N={atLeast:1,atMost:1/0};break;case"?":N={atLeast:0,atMost:1};break;case"{":const D=this.integerIncludingZero();switch(this.popChar()){case"}":N={atLeast:D,atMost:D};break;case",":let b;this.isDigit()?(b=this.integerIncludingZero(),N={atLeast:D,atMost:b}):N={atLeast:D,atMost:1/0},this.consumeChar("}")}if(!0===m&&void 0===N)return;k(N)}if((!0!==m||void 0!==N)&&k(N))return"?"===this.peekChar(0)?(this.consumeChar("?"),N.greedy=!1):N.greedy=!0,N.type="Quantifier",N.loc=this.loc(P),N}atom(){let m;const N=this.idx;switch(this.peekChar()){case".":m=this.dotAll();break;case"\\":m=this.atomEscape();break;case"[":m=this.characterClass();break;case"(":m=this.group()}return void 0===m&&this.isPatternCharacter()&&(m=this.patternCharacter()),k(m)?(m.loc=this.loc(N),this.isQuantifier()&&(m.quantifier=this.quantifier()),m):O()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[y("\n"),y("\r"),y("\u2028"),y("\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 m,N=!1;switch(this.popChar()){case"d":m=W;break;case"D":m=W,N=!0;break;case"s":m=A;break;case"S":m=A,N=!0;break;case"w":m=F;break;case"W":m=F,N=!0}return k(m)?{type:"Set",value:m,complement:N}:O()}controlEscapeAtom(){let m;switch(this.popChar()){case"f":m=y("\f");break;case"n":m=y("\n");break;case"r":m=y("\r");break;case"t":m=y("\t");break;case"v":m=y("\v")}return k(m)?{type:"Character",value:m}:O()}controlLetterEscapeAtom(){this.consumeChar("c");const m=this.popChar();if(!1===/[a-zA-Z]/.test(m))throw Error("Invalid ");return{type:"Character",value:m.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:y("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:y(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:y(this.popChar())}}}characterClass(){const m=[];let N=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),N=!0);this.isClassAtom();){const P=this.classAtom();P.type;if(M(P)&&this.isRangeDash()){this.consumeChar("-");const b=this.classAtom();b.type;if(M(b)){if(b.value<P.value)throw Error("Range out of order in character class");m.push({from:P.value,to:b.value})}else L(P.value,m),m.push(y("-")),L(b.value,m)}else L(P.value,m)}return this.consumeChar("]"),{type:"Set",complement:N,value:m}}classAtom(){switch(this.peekChar()){case"]":case"\n":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:y("\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 m=!0;if("?"===(this.consumeChar("("),this.peekChar(0)))this.consumeChar("?"),this.consumeChar(":"),m=!1;else this.groupIdx++;const N=this.disjunction();this.consumeChar(")");const P={type:"Group",capturing:m,value:N};return m&&(P.idx=this.groupIdx),P}positiveInteger(){let m=this.popChar();if(!1===h.test(m))throw Error("Expecting a positive integer");for(;I.test(this.peekChar(0));)m+=this.popChar();return parseInt(m,10)}integerIncludingZero(){let m=this.popChar();if(!1===I.test(m))throw Error("Expecting an integer");for(;I.test(this.peekChar(0));)m+=this.popChar();return parseInt(m,10)}patternCharacter(){const m=this.popChar();switch(m){case"\n":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:y(m)}}}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 I.test(this.peekChar(0))}isClassAtom(m=0){switch(this.peekChar(m)){case"]":case"\n":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(){const m=this.saveState();try{return void 0!==this.quantifier(!0)}catch{return!1}finally{this.restoreState(m)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(m){let N="";for(let D=0;D<m;D++){const b=this.popChar();if(!1===T.test(b))throw Error("Expecting a HexDecimal digits");N+=b}return{type:"Character",value:parseInt(N,16)}}peekChar(m=0){return this.input[this.idx+m]}popChar(){const m=this.peekChar(0);return this.consumeChar(void 0),m}consumeChar(m){if(void 0!==m&&this.input[this.idx]!==m)throw Error("Expected: '"+m+"' 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(m){return{begin:m,end:this.idx}}}class E{visitChildren(m){for(const N in m){const P=m[N];m.hasOwnProperty(N)&&(void 0!==P.type?this.visit(P):Array.isArray(P)&&P.forEach(D=>{this.visit(D)},this))}}visit(m){switch(m.type){case"Pattern":this.visitPattern(m);break;case"Flags":this.visitFlags(m);break;case"Disjunction":this.visitDisjunction(m);break;case"Alternative":this.visitAlternative(m);break;case"StartAnchor":this.visitStartAnchor(m);break;case"EndAnchor":this.visitEndAnchor(m);break;case"WordBoundary":this.visitWordBoundary(m);break;case"NonWordBoundary":this.visitNonWordBoundary(m);break;case"Lookahead":this.visitLookahead(m);break;case"NegativeLookahead":this.visitNegativeLookahead(m);break;case"Character":this.visitCharacter(m);break;case"Set":this.visitSet(m);break;case"Group":this.visitGroup(m);break;case"GroupBackReference":this.visitGroupBackReference(m);break;case"Quantifier":this.visitQuantifier(m)}this.visitChildren(m)}visitPattern(m){}visitFlags(m){}visitDisjunction(m){}visitAlternative(m){}visitStartAnchor(m){}visitEndAnchor(m){}visitWordBoundary(m){}visitNonWordBoundary(m){}visitLookahead(m){}visitNegativeLookahead(m){}visitCharacter(m){}visitSet(m){}visitGroup(m){}visitGroupBackReference(m){}visitQuantifier(m){}}},9196:(Ae,V,g)=>{g.d(V,{ue:()=>ve,_o:()=>ba,sd:()=>dn,nu:()=>Da,dV:()=>Ai,hW:()=>Rt,Sj:()=>Ze,Wx:()=>Z,hI:()=>ce,ej:()=>z,fK:()=>fe,pT:()=>Ie,oI:()=>Pe,ZW:()=>cn,Hs:()=>Ke,oC:()=>ri,l$:()=>pt,ol:()=>ke});var y=g(4509),L=g(88118),B=g(80256),k=g(99211),O=g(26279),M=g(38884);function W(o){function t(){}t.prototype=o;const a=new t;function u(){return typeof a.bar}return u(),u(),o}const A=function F(o,t,a){var u=-1,d=o.length;t<0&&(t=-t>d?0:d+t),(a=a>d?d:a)<0&&(a+=d),d=t>a?0:a-t>>>0,t>>>=0;for(var p=Array(d);++u<d;)p[u]=o[u+t];return p};var T=g(72001);const h=function I(o,t,a){var u=null==o?0:o.length;return u?(t=a||void 0===t?1:(0,T.Z)(t),A(o,t<0?0:t,u)):[]};var v=g(3311),E=g(61551),S=g(14839),m=g(24540),N=g(84929),P=g(98939),D=g(41270),X=Object.prototype.hasOwnProperty,ae=(0,m.Z)(function(o,t){if((0,P.Z)(t)||(0,N.Z)(t))(0,S.Z)(t,(0,D.Z)(t),o);else for(var a in t)X.call(t,a)&&(0,E.Z)(o,a,t[a])});const ue=ae;var K=g(98647),te=g(65960),de=g(41064),ye=g(75822);const Re=function Se(o,t){if(null==o)return{};var a=(0,K.Z)((0,ye.Z)(o),function(u){return[u]});return t=(0,te.Z)(t),(0,de.Z)(o,a,function(u,d){return t(u,d[0])})};var Be=g(45004),ee=g(13343);const le=function oe(o){return(0,ee.Z)(o)&&"[object RegExp]"==(0,Be.Z)(o)};var _e=g(33774),Te=g(1680),pe=Te.Z&&Te.Z.isRegExp;const xe=pe?(0,_e.Z)(pe):le;function De(o){return function tt(o){return(0,v.Z)(o.LABEL)&&""!==o.LABEL}(o)?o.LABEL:o.name}class lt{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),(0,y.Z)(this.definition,a=>{a.accept(t)})}}class Ze extends lt{constructor(t){super([]),this.idx=1,ue(this,Re(t,a=>void 0!==a))}set definition(t){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(t){t.visit(this)}}class Je extends lt{constructor(t){super(t.definition),this.orgText="",ue(this,Re(t,a=>void 0!==a))}}class C extends lt{constructor(t){super(t.definition),this.ignoreAmbiguities=!1,ue(this,Re(t,a=>void 0!==a))}}class Z extends lt{constructor(t){super(t.definition),this.idx=1,ue(this,Re(t,a=>void 0!==a))}}class z extends lt{constructor(t){super(t.definition),this.idx=1,ue(this,Re(t,a=>void 0!==a))}}class fe extends lt{constructor(t){super(t.definition),this.idx=1,ue(this,Re(t,a=>void 0!==a))}}class ce extends lt{constructor(t){super(t.definition),this.idx=1,ue(this,Re(t,a=>void 0!==a))}}class Ie extends lt{constructor(t){super(t.definition),this.idx=1,ue(this,Re(t,a=>void 0!==a))}}class ve extends lt{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,ue(this,Re(t,a=>void 0!==a))}}class Pe{constructor(t){this.idx=1,ue(this,Re(t,a=>void 0!==a))}accept(t){t.visit(this)}}function qt(o){function t(a){return(0,k.Z)(a,qt)}if(o instanceof Ze){const a={type:"NonTerminal",name:o.nonTerminalName,idx:o.idx};return(0,v.Z)(o.label)&&(a.label=o.label),a}if(o instanceof C)return{type:"Alternative",definition:t(o.definition)};if(o instanceof Z)return{type:"Option",idx:o.idx,definition:t(o.definition)};if(o instanceof z)return{type:"RepetitionMandatory",idx:o.idx,definition:t(o.definition)};if(o instanceof fe)return{type:"RepetitionMandatoryWithSeparator",idx:o.idx,separator:qt(new Pe({terminalType:o.separator})),definition:t(o.definition)};if(o instanceof Ie)return{type:"RepetitionWithSeparator",idx:o.idx,separator:qt(new Pe({terminalType:o.separator})),definition:t(o.definition)};if(o instanceof ce)return{type:"Repetition",idx:o.idx,definition:t(o.definition)};if(o instanceof ve)return{type:"Alternation",idx:o.idx,definition:t(o.definition)};if(o instanceof Pe){const a={type:"Terminal",name:o.terminalType.name,label:De(o.terminalType),idx:o.idx};(0,v.Z)(o.label)&&(a.terminalLabel=o.label);const u=o.terminalType.PATTERN;return o.terminalType.PATTERN&&(a.pattern=xe(u)?u.source:u),a}if(o instanceof Je)return{type:"Rule",name:o.name,orgText:o.orgText,definition:t(o.definition)};throw Error("non exhaustive match")}class yt{walk(t,a=[]){(0,y.Z)(t.definition,(u,d)=>{const p=h(t.definition,d+1);if(u instanceof Ze)this.walkProdRef(u,p,a);else if(u instanceof Pe)this.walkTerminal(u,p,a);else if(u instanceof C)this.walkFlat(u,p,a);else if(u instanceof Z)this.walkOption(u,p,a);else if(u instanceof z)this.walkAtLeastOne(u,p,a);else if(u instanceof fe)this.walkAtLeastOneSep(u,p,a);else if(u instanceof Ie)this.walkManySep(u,p,a);else if(u instanceof ce)this.walkMany(u,p,a);else{if(!(u instanceof ve))throw Error("non exhaustive match");this.walkOr(u,p,a)}})}walkTerminal(t,a,u){}walkProdRef(t,a,u){}walkFlat(t,a,u){const d=a.concat(u);this.walk(t,d)}walkOption(t,a,u){const d=a.concat(u);this.walk(t,d)}walkAtLeastOne(t,a,u){const d=[new Z({definition:t.definition})].concat(a,u);this.walk(t,d)}walkAtLeastOneSep(t,a,u){const d=pn(t,a,u);this.walk(t,d)}walkMany(t,a,u){const d=[new Z({definition:t.definition})].concat(a,u);this.walk(t,d)}walkManySep(t,a,u){const d=pn(t,a,u);this.walk(t,d)}walkOr(t,a,u){const d=a.concat(u);(0,y.Z)(t.definition,p=>{const R=new C({definition:[p]});this.walk(R,d)})}}function pn(o,t,a){return[new Z({definition:[new Pe({terminalType:o.separator})].concat(o.definition)})].concat(t,a)}var Ut=g(8888);const Lt=function In(o){return o&&o.length?(0,Ut.Z)(o):[]};var at=g(28744),Ft=g(46842),en=g(36527);const Cn=function Gt(o,t){var a;return(0,en.Z)(o,function(u,d,p){return!(a=t(u,d,p))}),!!a};var We=g(43390),xn=g(15980);const kn=function Pt(o,t,a){var u=(0,We.Z)(o)?Ft.Z:Cn;return a&&(0,xn.Z)(o,t,a)&&(t=void 0),u(o,(0,te.Z)(t,3))};var Ct=g(11873),Fn=Math.max;const nt=function Bt(o,t,a,u){o=(0,N.Z)(o)?o:(0,L.Z)(o),a=a&&!u?(0,T.Z)(a):0;var d=o.length;return a<0&&(a=Fn(d+a,0)),(0,v.Z)(o)?a<=d&&o.indexOf(t,a)>-1:!!d&&(0,Ct.Z)(o,t,a)>-1};const Gn=function Wt(o,t){for(var a=-1,u=null==o?0:o.length;++a<u;)if(!t(o[a],a,o))return!1;return!0};const Bn=function Kt(o,t){var a=!0;return(0,en.Z)(o,function(u,d,p){return a=!!t(u,d,p)}),a};const ut=function jt(o,t,a){var u=(0,We.Z)(o)?Gn:Bn;return a&&(0,xn.Z)(o,t,a)&&(t=void 0),u(o,(0,te.Z)(t,3))};function Ht(o,t=[]){return o instanceof Z||o instanceof ce||o instanceof Ie||(o instanceof ve?kn(o.definition,u=>Ht(u,t)):!(o instanceof Ze&&nt(t,o))&&(o instanceof lt&&(o instanceof Ze&&t.push(o),ut(o.definition,u=>Ht(u,t)))))}function ct(o){if(o instanceof Ze)return"SUBRULE";if(o instanceof Z)return"OPTION";if(o instanceof ve)return"OR";if(o instanceof z)return"AT_LEAST_ONE";if(o instanceof fe)return"AT_LEAST_ONE_SEP";if(o instanceof Ie)return"MANY_SEP";if(o instanceof ce)return"MANY";if(o instanceof Pe)return"CONSUME";throw Error("non exhaustive match")}function Tt(o){if(o instanceof Ze)return Tt(o.referencedRule);if(o instanceof Pe)return function zt(o){return[o.terminalType]}(o);if(function Vt(o){return o instanceof C||o instanceof Z||o instanceof ce||o instanceof z||o instanceof fe||o instanceof Ie||o instanceof Pe||o instanceof Je}(o))return function mn(o){let t=[];const a=o.definition;let p,u=0,d=a.length>u,R=!0;for(;d&&R;)p=a[u],R=Ht(p),t=t.concat(Tt(p)),u+=1,d=a.length>u;return Lt(t)}(o);if(function kt(o){return o instanceof ve}(o))return function vt(o){const t=(0,k.Z)(o.definition,a=>Tt(a));return Lt((0,at.Z)(t))}(o);throw Error("non exhaustive match")}const ht="_~IN~_";class Yt extends yt{constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,a,u){}walkProdRef(t,a,u){const d=function be(o,t){return o.name+t+ht}(t.referencedRule,t.idx)+this.topProd.name,p=a.concat(u),x=Tt(new C({definition:p}));this.follows[d]=x}}var ge=g(94518),ze=g(17790),st=g(38424),rt=g(12233),Sn=g(48705);const j=function ne(o){if("function"!=typeof o)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!o.call(this);case 1:return!o.call(this,t[0]);case 2:return!o.call(this,t[0],t[1]);case 3:return!o.call(this,t[0],t[1],t[2])}return!o.apply(this,t)}};const Qe=function wt(o,t){return((0,We.Z)(o)?rt.Z:Sn.Z)(o,j((0,te.Z)(t,3)))};var tn=g(20801),us=Math.max;const Sr=function cs(o,t,a){var u=null==o?0:o.length;if(!u)return-1;var d=null==a?0:(0,T.Z)(a);return d<0&&(d=us(u+d,0)),(0,Ct.Z)(o,t,d)};var dt=g(43408),At=g(76038),ds=g(46019),fs=g(13920),rr=g(50460),Nn=g(82090);const ot=function $n(o,t,a,u){var d=-1,p=fs.Z,R=!0,x=o.length,$=[],U=t.length;if(!x)return $;a&&(t=(0,K.Z)(t,(0,_e.Z)(a))),u?(p=rr.Z,R=!1):t.length>=200&&(p=Nn.Z,R=!1,t=new ds.Z(t));e:for(;++d<x;){var Q=o[d],q=null==a?Q:a(Q);if(Q=u||0!==Q?Q:0,R&&q==q){for(var me=U;me--;)if(t[me]===q)continue e;$.push(Q)}else p(t,q,u)||$.push(Q)}return $};var nn=g(31066),sr=g(55663),On=g(20995),Wn=(0,sr.Z)(function(o,t){return(0,On.Z)(o)?ot(o,(0,nn.Z)(t,1,On.Z,!0)):[]});const rn=Wn;const sn=function Nr(o){for(var t=-1,a=null==o?0:o.length,u=0,d=[];++t<a;){var p=o[t];p&&(d[u++]=p)}return d};const Mt=function hs(o){return o&&o.length?o[0]:void 0};var gn=g(171);function ir(o){console&&console.error&&console.error(`Error: ${o}`)}function Kn(o){console&&console.warn&&console.warn(`Warning: ${o}`)}let jn={};const $r=new ze.O;function an(o){const t=o.toString();if(jn.hasOwnProperty(t))return jn[t];{const a=$r.pattern(t);return jn[t]=a,a}}const Or="Complement Sets are not supported for first char optimization",Vn='Unable to use "first char" lexer optimizations:\n';function ms(o,t=!1){try{const a=an(o);return ar(a.value,{},a.flags.ignoreCase)}catch(a){if(a.message===Or)t&&Kn(`${Vn}\tUnable to optimize: < ${o.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let u="";t&&(u="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),ir(`${Vn}\n\tFailed parsing: < ${o.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+u)}}return[]}function ar(o,t,a){switch(o.type){case"Disjunction":for(let d=0;d<o.value.length;d++)ar(o.value[d],t,a);break;case"Alternative":const u=o.value;for(let d=0;d<u.length;d++){const p=u[d];switch(p.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const R=p;switch(R.type){case"Character":Hn(R.value,t,a);break;case"Set":if(!0===R.complement)throw Error(Or);(0,y.Z)(R.value,$=>{if("number"==typeof $)Hn($,t,a);else{const U=$;if(!0===a)for(let Q=U.from;Q<=U.to;Q++)Hn(Q,t,a);else{for(let Q=U.from;Q<=U.to&&Q<Xn;Q++)Hn(Q,t,a);if(U.to>=Xn){const Q=U.from>=Xn?U.from:Xn,q=U.to,me=ln(Q),Ee=ln(q);for(let Ne=me;Ne<=Ee;Ne++)t[Ne]=Ne}}}});break;case"Group":ar(R.value,t,a);break;default:throw Error("Non Exhaustive Match")}const x=void 0!==R.quantifier&&0===R.quantifier.atLeast;if("Group"===R.type&&!1===Ln(R)||"Group"!==R.type&&!1===x)break}break;default:throw Error("non exhaustive match!")}return(0,L.Z)(t)}function Hn(o,t,a){const u=ln(o);t[u]=u,!0===a&&function gs(o,t){const a=String.fromCharCode(o),u=a.toUpperCase();if(u!==a){const d=ln(u.charCodeAt(0));t[d]=d}else{const d=a.toLowerCase();if(d!==a){const p=ln(d.charCodeAt(0));t[p]=p}}}(o,t)}function Lr(o,t){return(0,gn.Z)(o.value,a=>{if("number"==typeof a)return nt(t,a);{const u=a;return void 0!==(0,gn.Z)(t,d=>u.from<=d&&d<=u.to)}})}function Ln(o){const t=o.quantifier;return!(!t||0!==t.atLeast)||!!o.value&&((0,We.Z)(o.value)?ut(o.value,Ln):Ln(o.value))}class ys extends ze.e{constructor(t){super(),this.targetCharCodes=t,this.found=!1}visitChildren(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}super.visitChildren(t)}}visitCharacter(t){nt(this.targetCharCodes,t.value)&&(this.found=!0)}visitSet(t){t.complement?void 0===Lr(t,this.targetCharCodes)&&(this.found=!0):void 0!==Lr(t,this.targetCharCodes)&&(this.found=!0)}}function or(o,t){if(t instanceof RegExp){const a=an(t),u=new ys(o);return u.visit(a),u.found}return void 0!==(0,gn.Z)(t,a=>nt(o,a.charCodeAt(0)))}const on="PATTERN",Pn="defaultMode",zn="modes";let Yn="boolean"==typeof new RegExp("(?:)").sticky;function Ts(o,t){const a=(t=(0,st.Z)(t,{useSticky:Yn,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(he,se)=>se()})).tracer;let u;a("initCharCodeToOptimizedIndexMap",()=>{!function Fs(){if((0,B.Z)(w)){w=new Array(65536);for(let o=0;o<65536;o++)w[o]=o>255?255+~~(o/255):o}}()}),a("Reject Lexer.NA",()=>{u=Qe(o,he=>he[on]===Rt.NA)});let p,R,x,$,U,Q,q,me,Ee,Ne,$e,d=!1;a("Transform Patterns",()=>{d=!1,p=(0,k.Z)(u,he=>{const se=he[on];if(xe(se)){const Oe=se.source;return 1!==Oe.length||"^"===Oe||"$"===Oe||"."===Oe||se.ignoreCase?2!==Oe.length||"\\"!==Oe[0]||nt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],Oe[1])?t.useSticky?cr(se):ur(se):Oe[1]:Oe}if((0,tn.Z)(se))return d=!0,{exec:se};if("object"==typeof se)return d=!0,se;if("string"==typeof se){if(1===se.length)return se;{const Oe=se.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),Le=new RegExp(Oe);return t.useSticky?cr(Le):ur(Le)}}throw Error("non exhaustive match")})}),a("misc mapping",()=>{R=(0,k.Z)(u,he=>he.tokenTypeIdx),x=(0,k.Z)(u,he=>{const se=he.GROUP;if(se!==Rt.SKIPPED){if((0,v.Z)(se))return se;if((0,ge.Z)(se))return!1;throw Error("non exhaustive match")}}),$=(0,k.Z)(u,he=>{const se=he.LONGER_ALT;if(se)return(0,We.Z)(se)?(0,k.Z)(se,Le=>Sr(u,Le)):[Sr(u,se)]}),U=(0,k.Z)(u,he=>he.PUSH_MODE),Q=(0,k.Z)(u,he=>(0,O.Z)(he,"POP_MODE"))}),a("Line Terminator Handling",()=>{const he=Oi(t.lineTerminatorCharacters);q=(0,k.Z)(u,se=>!1),"onlyOffset"!==t.positionTracking&&(q=(0,k.Z)(u,se=>(0,O.Z)(se,"LINE_BREAKS")?!!se.LINE_BREAKS:!1===wr(se,he)&&or(he,se.PATTERN)))}),a("Misc Mapping #2",()=>{me=(0,k.Z)(u,Pr),Ee=(0,k.Z)(p,Ds),Ne=(0,dt.Z)(u,(he,se)=>{const Oe=se.GROUP;return(0,v.Z)(Oe)&&Oe!==Rt.SKIPPED&&(he[Oe]=[]),he},{}),$e=(0,k.Z)(p,(he,se)=>({pattern:p[se],longerAlt:$[se],canLineTerminator:q[se],isCustom:me[se],short:Ee[se],group:x[se],push:U[se],pop:Q[se],tokenTypeIdx:R[se],tokenType:u[se]}))});let Fe=!0,Ce=[];return t.safeMode||a("First Char Optimization",()=>{Ce=(0,dt.Z)(u,(he,se,Oe)=>{if("string"==typeof se.PATTERN){const Nt=ln(se.PATTERN.charCodeAt(0));dr(he,Nt,$e[Oe])}else if((0,We.Z)(se.START_CHARS_HINT)){let Le;(0,y.Z)(se.START_CHARS_HINT,Nt=>{const hn=ln("string"==typeof Nt?Nt.charCodeAt(0):Nt);Le!==hn&&(Le=hn,dr(he,hn,$e[Oe]))})}else if(xe(se.PATTERN))if(se.PATTERN.unicode)Fe=!1,t.ensureOptimizations&&ir(`${Vn}\tUnable to analyze < ${se.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const Le=ms(se.PATTERN,t.ensureOptimizations);(0,B.Z)(Le)&&(Fe=!1),(0,y.Z)(Le,Nt=>{dr(he,Nt,$e[Oe])})}else t.ensureOptimizations&&ir(`${Vn}\tTokenType: <${se.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),Fe=!1;return he},[])}),{emptyGroups:Ne,patternIdxToConfig:$e,charCodeToPatternIdxToConfig:Ce,hasCustom:d,canBeOptimized:Fe}}function vs(o,t){let a=[];const u=function lr(o){const t=(0,At.Z)(o,d=>!(0,O.Z)(d,on)),a=(0,k.Z)(t,d=>({message:"Token Type: ->"+d.name+"<- missing static 'PATTERN' property",type:Ye.MISSING_PATTERN,tokenTypes:[d]})),u=rn(o,t);return{errors:a,valid:u}}(o);a=a.concat(u.errors);const d=function As(o){const t=(0,At.Z)(o,d=>{const p=d[on];return!(xe(p)||(0,tn.Z)(p)||(0,O.Z)(p,"exec")||(0,v.Z)(p))}),a=(0,k.Z)(t,d=>({message:"Token Type: ->"+d.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ye.INVALID_PATTERN,tokenTypes:[d]})),u=rn(o,t);return{errors:a,valid:u}}(u.valid),p=d.valid;return a=a.concat(d.errors),a=a.concat(function Es(o){let t=[];const a=(0,At.Z)(o,u=>xe(u[on]));return t=t.concat(function _s(o){class t extends ze.e{constructor(){super(...arguments),this.found=!1}visitEndAnchor(p){this.found=!0}}const a=(0,At.Z)(o,d=>{const p=d.PATTERN;try{const R=an(p),x=new t;return x.visit(R),x.found}catch{return Rs.test(p.source)}});return(0,k.Z)(a,d=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+d.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Ye.EOI_ANCHOR_FOUND,tokenTypes:[d]}))}(a)),t=t.concat(function xs(o){class t extends ze.e{constructor(){super(...arguments),this.found=!1}visitStartAnchor(p){this.found=!0}}const a=(0,At.Z)(o,d=>{const p=d.PATTERN;try{const R=an(p),x=new t;return x.visit(R),x.found}catch{return Cs.test(p.source)}});return(0,k.Z)(a,d=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+d.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Ye.SOI_ANCHOR_FOUND,tokenTypes:[d]}))}(a)),t=t.concat(function ks(o){const t=(0,At.Z)(o,u=>{const d=u[on];return d instanceof RegExp&&(d.multiline||d.global)});return(0,k.Z)(t,u=>({message:"Token Type: ->"+u.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ye.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[u]}))}(a)),t=t.concat(function Ss(o){const t=[];let a=(0,k.Z)(o,p=>(0,dt.Z)(o,(R,x)=>(p.PATTERN.source===x.PATTERN.source&&!nt(t,x)&&x.PATTERN!==Rt.NA&&(t.push(x),R.push(x)),R),[]));a=sn(a);const u=(0,At.Z)(a,p=>p.length>1);return(0,k.Z)(u,p=>{const R=(0,k.Z)(p,$=>$.name);return{message:`The same RegExp pattern ->${Mt(p).PATTERN}<-has been used in all of the following Token Types: ${R.join(", ")} <-`,type:Ye.DUPLICATE_PATTERNS_FOUND,tokenTypes:p}})}(a)),t=t.concat(function Is(o){const t=(0,At.Z)(o,u=>u.PATTERN.test(""));return(0,k.Z)(t,u=>({message:"Token Type: ->"+u.name+"<- static 'PATTERN' must not match an empty string",type:Ye.EMPTY_MATCH_PATTERN,tokenTypes:[u]}))}(a)),t}(p)),a=a.concat(function Ns(o){const t=(0,At.Z)(o,u=>{if(!(0,O.Z)(u,"GROUP"))return!1;const d=u.GROUP;return d!==Rt.SKIPPED&&d!==Rt.NA&&!(0,v.Z)(d)});return(0,k.Z)(t,u=>({message:"Token Type: ->"+u.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ye.INVALID_GROUP_TYPE_FOUND,tokenTypes:[u]}))}(p)),a=a.concat(function $s(o,t){const a=(0,At.Z)(o,d=>void 0!==d.PUSH_MODE&&!nt(t,d.PUSH_MODE));return(0,k.Z)(a,d=>({message:`Token Type: ->${d.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${d.PUSH_MODE}<-which does not exist`,type:Ye.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[d]}))}(p,t)),a=a.concat(function Os(o){const t=[],a=(0,dt.Z)(o,(u,d,p)=>{const R=d.PATTERN;return R===Rt.NA||((0,v.Z)(R)?u.push({str:R,idx:p,tokenType:d}):xe(R)&&function Ps(o){const t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return void 0===(0,gn.Z)(t,a=>-1!==o.source.indexOf(a))}(R)&&u.push({str:R.source,idx:p,tokenType:d})),u},[]);return(0,y.Z)(o,(u,d)=>{(0,y.Z)(a,({str:p,idx:R,tokenType:x})=>{if(d<R&&function Ls(o,t){if(xe(t)){const a=t.exec(o);return null!==a&&0===a.index}if((0,tn.Z)(t))return t(o,0,[],{});if((0,O.Z)(t,"exec"))return t.exec(o,0,[],{});if("string"==typeof t)return t===o;throw Error("non exhaustive match")}(p,u.PATTERN)){const $=`Token: ->${x.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${u.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:$,type:Ye.UNREACHABLE_PATTERN,tokenTypes:[u,x]})}})}),t}(p)),a}const Rs=/[^\\][$]/;const Cs=/[^\\[][\^]|^\^/;function ur(o){const t=o.ignoreCase?"i":"";return new RegExp(`^(?:${o.source})`,t)}function cr(o){const t=o.ignoreCase?"iy":"y";return new RegExp(`${o.source}`,t)}function Pr(o){const t=o.PATTERN;if(xe(t))return!1;if((0,tn.Z)(t))return!0;if((0,O.Z)(t,"exec"))return!0;if((0,v.Z)(t))return!1;throw Error("non exhaustive match")}function Ds(o){return!(!(0,v.Z)(o)||1!==o.length)&&o.charCodeAt(0)}const Zs={test:function(o){const t=o.length;for(let a=this.lastIndex;a<t;a++){const u=o.charCodeAt(a);if(10===u)return this.lastIndex=a+1,!0;if(13===u)return 10===o.charCodeAt(a+1)?this.lastIndex=a+2:this.lastIndex=a+1,!0}return!1},lastIndex:0};function wr(o,t){if((0,O.Z)(o,"LINE_BREAKS"))return!1;if(xe(o.PATTERN)){try{or(t,o.PATTERN)}catch(a){return{issue:Ye.IDENTIFY_TERMINATOR,errMsg:a.message}}return!1}if((0,v.Z)(o.PATTERN))return!1;if(Pr(o))return{issue:Ye.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function Us(o,t){if(t.issue===Ye.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${o.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Ye.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${o.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Oi(o){return(0,k.Z)(o,a=>(0,v.Z)(a)?a.charCodeAt(0):a)}function dr(o,t,a){void 0===o[t]?o[t]=[a]:o[t].push(a)}const Xn=256;let w=[];function ln(o){return o<Xn?o:w[o]}var fr=g(15278),qe=g(24587),un=g(13668);function Mr(o){const t=(new Date).getTime(),a=o();return{time:(new Date).getTime()-t,value:a}}function yn(o,t){const a=o.tokenTypeIdx;return a===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[a]}function wn(o,t){return o.tokenTypeIdx===t.tokenTypeIdx}let br=1;const Dr={};function Mn(o){const t=function Li(o){let t=(0,M.Z)(o),a=o,u=!0;for(;u;){a=sn((0,at.Z)((0,k.Z)(a,p=>p.CATEGORIES)));const d=rn(a,t);t=t.concat(d),(0,B.Z)(d)?u=!1:a=d}return t}(o);(function Pi(o){(0,y.Z)(o,t=>{Ws(t)||(Dr[br]=t,t.tokenTypeIdx=br++),Tn(t)&&!(0,We.Z)(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),Tn(t)||(t.CATEGORIES=[]),function it(o){return(0,O.Z)(o,"categoryMatches")}(t)||(t.categoryMatches=[]),function Ks(o){return(0,O.Z)(o,"categoryMatchesMap")}(t)||(t.categoryMatchesMap={})})})(t),function wi(o){(0,y.Z)(o,t=>{Bs([],t)})}(t),function Gs(o){(0,y.Z)(o,t=>{t.categoryMatches=[],(0,y.Z)(t.categoryMatchesMap,(a,u)=>{t.categoryMatches.push(Dr[u].tokenTypeIdx)})})}(t),(0,y.Z)(t,a=>{a.isParent=a.categoryMatches.length>0})}function Bs(o,t){(0,y.Z)(o,a=>{t.categoryMatchesMap[a.tokenTypeIdx]=!0}),(0,y.Z)(t.CATEGORIES,a=>{const u=o.concat(t);nt(u,a)||Bs(u,a)})}function Ws(o){return(0,O.Z)(o,"tokenTypeIdx")}function Tn(o){return(0,O.Z)(o,"CATEGORIES")}function Mi(o){return(0,O.Z)(o,"tokenTypeIdx")}const cn={buildUnableToPopLexerModeMessage:o=>`Unable to pop Lexer Mode after encountering Token ->${o.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(o,t,a,u,d)=>`unexpected character: ->${o.charAt(t)}<- at offset: ${t}, skipped ${a} characters.`};var Ye,o;(o=Ye||(Ye={}))[o.MISSING_PATTERN=0]="MISSING_PATTERN",o[o.INVALID_PATTERN=1]="INVALID_PATTERN",o[o.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",o[o.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",o[o.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",o[o.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",o[o.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",o[o.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",o[o.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",o[o.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",o[o.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",o[o.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",o[o.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",o[o.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",o[o.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",o[o.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",o[o.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",o[o.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";const Jn={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:cn,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Jn);class Rt{constructor(t,a=Jn){if(this.lexerDefinition=t,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=(d,p)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const R=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${R}--\x3e <${d}>`);const{time:x,value:$}=Mr(p),U=x>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&U(`${R}<-- <${d}> time: ${x}ms`),this.traceInitIndent--,$}return p()},"boolean"==typeof a)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=ue({},Jn,a);const u=this.config.traceInitPerf;!0===u?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof u&&(this.traceInitMaxIdent=u,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let d,p=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Jn.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Zs;else if(this.config.lineTerminatorCharacters===Jn.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(a.safeMode&&a.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),(0,We.Z)(t)?d={modes:{defaultMode:(0,M.Z)(t)},defaultMode:Pn}:(p=!1,d=(0,M.Z)(t))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function ws(o,t,a){const u=[];return(0,O.Z)(o,Pn)||u.push({message:"A MultiMode Lexer cannot be initialized without a <"+Pn+"> property in its definition\n",type:Ye.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,O.Z)(o,zn)||u.push({message:"A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",type:Ye.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,O.Z)(o,zn)&&(0,O.Z)(o,Pn)&&!(0,O.Z)(o.modes,o.defaultMode)&&u.push({message:`A MultiMode Lexer cannot be initialized with a ${Pn}: <${o.defaultMode}>which does not exist\n`,type:Ye.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,O.Z)(o,zn)&&(0,y.Z)(o.modes,(d,p)=>{(0,y.Z)(d,(R,x)=>{if((0,ge.Z)(R))u.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${p}> at index: <${x}>\n`,type:Ye.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if((0,O.Z)(R,"LONGER_ALT")){const $=(0,We.Z)(R.LONGER_ALT)?R.LONGER_ALT:[R.LONGER_ALT];(0,y.Z)($,U=>{!(0,ge.Z)(U)&&!nt(d,U)&&u.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${U.name}> on token <${R.name}> outside of mode <${p}>\n`,type:Ye.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),u}(d,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function Ms(o,t,a){const u=[];let d=!1;const p=sn((0,at.Z)((0,L.Z)(o.modes))),R=Qe(p,$=>$[on]===Rt.NA),x=Oi(a);return t&&(0,y.Z)(R,$=>{const U=wr($,x);if(!1!==U){const q={message:Us($,U),type:U.issue,tokenType:$};u.push(q)}else(0,O.Z)($,"LINE_BREAKS")?!0===$.LINE_BREAKS&&(d=!0):or(x,$.PATTERN)&&(d=!0)}),t&&!d&&u.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Ye.NO_LINE_BREAKS_FLAGS}),u}(d,this.trackStartLines,this.config.lineTerminatorCharacters))})),d.modes=d.modes?d.modes:{},(0,y.Z)(d.modes,(x,$)=>{d.modes[$]=Qe(x,U=>(0,ge.Z)(U))});const R=(0,D.Z)(d.modes);if((0,y.Z)(d.modes,(x,$)=>{this.TRACE_INIT(`Mode: <${$}> processing`,()=>{if(this.modes.push($),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(vs(x,R))}),(0,B.Z)(this.lexerDefinitionErrors)){let U;Mn(x),this.TRACE_INIT("analyzeTokenTypes",()=>{U=Ts(x,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:a.positionTracking,ensureOptimizations:a.ensureOptimizations,safeMode:a.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[$]=U.patternIdxToConfig,this.charCodeToPatternIdxToConfig[$]=U.charCodeToPatternIdxToConfig,this.emptyGroups=ue({},this.emptyGroups,U.emptyGroups),this.hasCustom=U.hasCustom||this.hasCustom,this.canModeBeOptimized[$]=U.canBeOptimized}})}),this.defaultMode=d.defaultMode,!(0,B.Z)(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const $=(0,k.Z)(this.lexerDefinitionErrors,U=>U.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+$)}(0,y.Z)(this.lexerDefinitionWarning,x=>{Kn(x.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Yn?(this.chopInput=fr.Z,this.match=this.matchWithTest):(this.updateLastIndex=qe.Z,this.match=this.matchWithExec),p&&(this.handleModes=qe.Z),!1===this.trackStartLines&&(this.computeNewColumn=fr.Z),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=qe.Z),/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))throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const x=(0,dt.Z)(this.canModeBeOptimized,($,U,Q)=>(!1===U&&$.push(Q),$),[]);if(a.ensureOptimizations&&!(0,B.Z)(x))throw Error(`Lexer Modes: < ${x.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{!function ps(){jn={}}()}),this.TRACE_INIT("toFastProperties",()=>{W(this)})})}tokenize(t,a=this.defaultMode){if(!(0,B.Z)(this.lexerDefinitionErrors)){const d=(0,k.Z)(this.lexerDefinitionErrors,p=>p.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+d)}return this.tokenizeInternal(t,a)}tokenizeInternal(t,a){let u,d,p,R,x,$,U,Q,q,me,Ee,Ne,$e,Ce,he;const se=t,Oe=se.length;let Le=0,Nt=0;const da=this.hasCustom?0:Math.floor(t.length/10),hn=new Array(da),fa=[];let is=this.trackStartLines?1:void 0,bn=this.trackStartLines?1:void 0;const as=function bs(o){const t={},a=(0,D.Z)(o);return(0,y.Z)(a,u=>{const d=o[u];if(!(0,We.Z)(d))throw Error("non exhaustive match");t[u]=[]}),t}(this.emptyGroups),Ua=this.trackStartLines,ha=this.config.lineTerminatorsPattern;let ki=0,Dn=[],os=[];const Si=[],Ca=[];let ls;function xa(){return Dn}function ka(gt){const Zt=ln(gt),kr=os[Zt];return void 0===kr?Ca:kr}Object.freeze(Ca);const Fa=gt=>{if(1===Si.length&&void 0===gt.tokenType.PUSH_MODE){const Zt=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(gt);fa.push({offset:gt.startOffset,line:gt.startLine,column:gt.startColumn,length:gt.image.length,message:Zt})}else{Si.pop();const Zt=(0,un.Z)(Si);Dn=this.patternIdxToConfig[Zt],os=this.charCodeToPatternIdxToConfig[Zt],ki=Dn.length;const kr=this.canModeBeOptimized[Zt]&&!1===this.config.safeMode;ls=os&&kr?ka:xa}};function Sa(gt){Si.push(gt),os=this.charCodeToPatternIdxToConfig[gt],Dn=this.patternIdxToConfig[gt],ki=Dn.length,ki=Dn.length;const Zt=this.canModeBeOptimized[gt]&&!1===this.config.safeMode;ls=os&&Zt?ka:xa}let Qt;Sa.call(this,a);const Na=this.config.recoveryEnabled;for(;Le<Oe;){$=null;const gt=se.charCodeAt(Le),Zt=ls(gt),kr=Zt.length;for(u=0;u<kr;u++){Qt=Zt[u];const $t=Qt.pattern;U=null;const Rn=Qt.short;if(!1!==Rn?gt===Rn&&($=$t):!0===Qt.isCustom?(he=$t.exec(se,Le,hn,as),null!==he?($=he[0],void 0!==he.payload&&(U=he.payload)):$=null):(this.updateLastIndex($t,Le),$=this.match($t,t,Le)),null!==$){if(x=Qt.longerAlt,void 0!==x){const Zn=x.length;for(p=0;p<Zn;p++){const _n=Dn[x[p]],nr=_n.pattern;if(Q=null,!0===_n.isCustom?(he=nr.exec(se,Le,hn,as),null!==he?(R=he[0],void 0!==he.payload&&(Q=he.payload)):R=null):(this.updateLastIndex(nr,Le),R=this.match(nr,t,Le)),R&&R.length>$.length){$=R,U=Q,Qt=_n;break}}}break}}if(null!==$){if(q=$.length,me=Qt.group,void 0!==me&&(Ee=Qt.tokenTypeIdx,Ne=this.createTokenInstance($,Le,Ee,Qt.tokenType,is,bn,q),this.handlePayload(Ne,U),!1===me?Nt=this.addToken(hn,Nt,Ne):as[me].push(Ne)),t=this.chopInput(t,q),Le+=q,bn=this.computeNewColumn(bn,q),!0===Ua&&!0===Qt.canLineTerminator){let Rn,Zn,$t=0;ha.lastIndex=0;do{Rn=ha.test($),!0===Rn&&(Zn=ha.lastIndex-1,$t++)}while(!0===Rn);0!==$t&&(is+=$t,bn=q-Zn,this.updateTokenEndLineColumnLocation(Ne,me,Zn,$t,is,bn,q))}this.handleModes(Qt,Fa,Sa,Ne)}else{const $t=Le,Rn=is,Zn=bn;let _n=!1===Na;for(;!1===_n&&Le<Oe;)for(t=this.chopInput(t,1),Le++,d=0;d<ki;d++){const nr=Dn[d],pa=nr.pattern,$a=nr.short;if(!1!==$a?se.charCodeAt(Le)===$a&&(_n=!0):!0===nr.isCustom?_n=null!==pa.exec(se,Le,hn,as):(this.updateLastIndex(pa,Le),_n=null!==pa.exec(t)),!0===_n)break}if($e=Le-$t,bn=this.computeNewColumn(bn,$e),Ce=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(se,$t,$e,Rn,Zn),fa.push({offset:$t,line:Rn,column:Zn,length:$e,message:Ce}),!1===Na)break}}return this.hasCustom||(hn.length=Nt),{tokens:hn,groups:as,errors:fa}}handleModes(t,a,u,d){if(!0===t.pop){const p=t.push;a(d),void 0!==p&&u.call(this,p)}else void 0!==t.push&&u.call(this,t.push)}chopInput(t,a){return t.substring(a)}updateLastIndex(t,a){t.lastIndex=a}updateTokenEndLineColumnLocation(t,a,u,d,p,R,x){let $,U;void 0!==a&&($=u===x-1,U=$?-1:0,1===d&&!0===$||(t.endLine=p+U,t.endColumn=R-1-U))}computeNewColumn(t,a){return t+a}createOffsetOnlyToken(t,a,u,d){return{image:t,startOffset:a,tokenTypeIdx:u,tokenType:d}}createStartOnlyToken(t,a,u,d,p,R){return{image:t,startOffset:a,startLine:p,startColumn:R,tokenTypeIdx:u,tokenType:d}}createFullToken(t,a,u,d,p,R,x){return{image:t,startOffset:a,endOffset:a+x-1,startLine:p,endLine:p,startColumn:R,endColumn:R+x-1,tokenTypeIdx:u,tokenType:d}}addTokenUsingPush(t,a,u){return t.push(u),a}addTokenUsingMemberAccess(t,a,u){return t[a]=u,++a}handlePayloadNoCustom(t,a){}handlePayloadWithCustom(t,a){null!==a&&(t.payload=a)}matchWithTest(t,a,u){return!0===t.test(a)?a.substring(u,t.lastIndex):null}matchWithExec(t,a){const u=t.exec(a);return null!==u?u[0]:null}}function pt(o){return js(o)?o.LABEL:o.name}function js(o){return(0,v.Z)(o.LABEL)&&""!==o.LABEL}Rt.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.",Rt.NA=/NOT_APPLICABLE/;const Qn="categories",Zr="label",Vs="group",Ur="push_mode",Fr="pop_mode",Hs="longer_alt",hr="line_breaks",zs="start_chars_hint";function Ys(o){return function Di(o){const t=o.pattern,a={};if(a.name=o.name,(0,ge.Z)(t)||(a.PATTERN=t),(0,O.Z)(o,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return(0,O.Z)(o,Qn)&&(a.CATEGORIES=o[Qn]),Mn([a]),(0,O.Z)(o,Zr)&&(a.LABEL=o[Zr]),(0,O.Z)(o,Vs)&&(a.GROUP=o[Vs]),(0,O.Z)(o,Fr)&&(a.POP_MODE=o[Fr]),(0,O.Z)(o,Ur)&&(a.PUSH_MODE=o[Ur]),(0,O.Z)(o,Hs)&&(a.LONGER_ALT=o[Hs]),(0,O.Z)(o,hr)&&(a.LINE_BREAKS=o[hr]),(0,O.Z)(o,zs)&&(a.START_CHARS_HINT=o[zs]),a}(o)}const dn=Ys({name:"EOF",pattern:Rt.NA});function Gr(o,t,a,u,d,p,R,x){return{image:t,startOffset:a,endOffset:u,startLine:d,endLine:p,startColumn:R,endColumn:x,tokenTypeIdx:o.tokenTypeIdx,tokenType:o}}function ke(o,t){return yn(o,t)}Mn([dn]);const Ke={buildMismatchTokenMessage:({expected:o,actual:t,previous:a,ruleName:u})=>`Expecting ${js(o)?`--\x3e ${pt(o)} <--`:`token of type --\x3e ${o.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:o,ruleName:t})=>"Redundant input, expecting EOF but found: "+o.image,buildNoViableAltMessage({expectedPathsPerAlt:o,actual:t,previous:a,customUserDescription:u,ruleName:d}){const p="Expecting: ",x="\nbut found: '"+Mt(t).image+"'";if(u)return p+u+x;{const $=(0,dt.Z)(o,(me,Ee)=>me.concat(Ee),[]),U=(0,k.Z)($,me=>`[${(0,k.Z)(me,Ee=>pt(Ee)).join(", ")}]`);return p+`one of these possible Token sequences:\n${(0,k.Z)(U,(me,Ee)=>` ${Ee+1}. ${me}`).join("\n")}`+x}},buildEarlyExitMessage({expectedIterationPaths:o,actual:t,customUserDescription:a,ruleName:u}){const d="Expecting: ",R="\nbut found: '"+Mt(t).image+"'";if(a)return d+a+R;return d+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${(0,k.Z)(o,U=>`[${(0,k.Z)(U,Q=>pt(Q)).join(",")}]`).join(" ,")}>`+R}};Object.freeze(Ke);const Ge={buildRuleNotFoundError:(o,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+o.name+"<-"},vn={buildDuplicateFoundError(o,t){const u=o.name,d=Mt(t),p=d.idx,R=ct(d),x=function a(Q){return Q instanceof Pe?Q.terminalType.name:Q instanceof Ze?Q.nonTerminalName:""}(d);let U=`->${R}${p>0?p:""}<- ${x?`with argument: ->${x}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${u}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return U=U.replace(/[ \t]+/g," "),U=U.replace(/\s\s+/g,"\n"),U},buildNamespaceConflictError:o=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${o.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(o){const t=(0,k.Z)(o.prefixPath,d=>pt(d)).join(", "),a=0===o.alternation.idx?"":o.alternation.idx;return`Ambiguous alternatives: <${o.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${a}> inside <${o.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(o){const t=(0,k.Z)(o.prefixPath,d=>pt(d)).join(", "),a=0===o.alternation.idx?"":o.alternation.idx;let u=`Ambiguous Alternatives Detected: <${o.ambiguityIndices.join(" ,")}> in <OR${a}> inside <${o.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return u+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",u},buildEmptyRepetitionError(o){let t=ct(o.repetition);return 0!==o.repetition.idx&&(t+=o.repetition.idx),`The repetition <${t}> within Rule <${o.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:o=>"deprecated",buildEmptyAlternationError:o=>`Ambiguous empty alternative: <${o.emptyChoiceIdx+1}> in <OR${o.alternation.idx}> inside <${o.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:o=>`An Alternation cannot have more than 256 alternatives:\n<OR${o.alternation.idx}> inside <${o.topLevelRule.name}> Rule.\n has ${o.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(o){const t=o.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --\x3e ${(0,k.Z)(o.leftRecursionPath,p=>p.name).concat([t]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:o=>"deprecated",buildDuplicateRuleNameError(o){let t;return t=o.topLevelRule instanceof Je?o.topLevelRule.name:o.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${o.grammarName}<-`}};class Jt{visit(t){const a=t;switch(a.constructor){case Ze:return this.visitNonTerminal(a);case C:return this.visitAlternative(a);case Z:return this.visitOption(a);case z:return this.visitRepetitionMandatory(a);case fe:return this.visitRepetitionMandatoryWithSeparator(a);case Ie:return this.visitRepetitionWithSeparator(a);case ce:return this.visitRepetition(a);case ve:return this.visitAlternation(a);case Pe:return this.visitTerminal(a);case Je:return this.visitRule(a);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}}class Zi extends Jt{constructor(t,a){super(),this.nameToTopRule=t,this.errMsgProvider=a,this.errors=[]}resolveRefs(){(0,y.Z)((0,L.Z)(this.nameToTopRule),t=>{this.currTopLevel=t,t.accept(this)})}visitNonTerminal(t){const a=this.nameToTopRule[t.nonTerminalName];if(a)t.referencedRule=a;else{const u=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:u,type:It.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}}var St=g(53026),pr=g(40355);const _t=function mr(o,t,a,u){for(var d=-1,p=null==o?0:o.length;++d<p;){var R=o[d];t(u,R,a(R),o)}return u};const Wr=function Br(o,t,a,u){return(0,en.Z)(o,function(d,p,R){t(u,d,a(d),R)}),u};const Kr=function qn(o,t){return function(a,u){var d=(0,We.Z)(a)?_t:Wr,p=t?t():{};return d(a,o,(0,te.Z)(u,2),p)}};var Js=Object.prototype.hasOwnProperty,Qs=Kr(function(o,t,a){Js.call(o,a)?o[a].push(t):(0,pr.Z)(o,a,[t])});const qs=Qs;const ft=function Ui(o,t,a){var u=null==o?0:o.length;return u?(t=a||void 0===t?1:(0,T.Z)(t),A(o,0,(t=u-t)<0?0:t)):[]};class Ve extends yt{constructor(t,a){super(),this.topProd=t,this.path=a,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=(0,M.Z)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,M.Z)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,a=[]){this.found||super.walk(t,a)}walkProdRef(t,a,u){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){const d=a.concat(u);this.updateExpectedNext(),this.walk(t.referencedRule,d)}}updateExpectedNext(){(0,B.Z)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Fi extends Ve{constructor(t,a){super(t,a),this.path=a,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,a,u){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){const d=a.concat(u),p=new C({definition:d});this.possibleTokTypes=Tt(p),this.found=!0}}}class gr extends yt{constructor(t,a){super(),this.topRule=t,this.occurrence=a,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class Vr extends gr{walkMany(t,a,u){if(t.idx===this.occurrence){const d=Mt(a.concat(u));this.result.isEndOfRule=void 0===d,d instanceof Pe&&(this.result.token=d.terminalType,this.result.occurrence=d.idx)}else super.walkMany(t,a,u)}}class ei extends gr{walkManySep(t,a,u){if(t.idx===this.occurrence){const d=Mt(a.concat(u));this.result.isEndOfRule=void 0===d,d instanceof Pe&&(this.result.token=d.terminalType,this.result.occurrence=d.idx)}else super.walkManySep(t,a,u)}}class Gi extends gr{walkAtLeastOne(t,a,u){if(t.idx===this.occurrence){const d=Mt(a.concat(u));this.result.isEndOfRule=void 0===d,d instanceof Pe&&(this.result.token=d.terminalType,this.result.occurrence=d.idx)}else super.walkAtLeastOne(t,a,u)}}class ti extends gr{walkAtLeastOneSep(t,a,u){if(t.idx===this.occurrence){const d=Mt(a.concat(u));this.result.isEndOfRule=void 0===d,d instanceof Pe&&(this.result.token=d.terminalType,this.result.occurrence=d.idx)}else super.walkAtLeastOneSep(t,a,u)}}function bt(o,t,a=[]){a=(0,M.Z)(a);let u=[],d=0;function R(x){const $=bt(function p(x){return x.concat(h(o,d+1))}(x),t,a);return u.concat($)}for(;a.length<t&&d<o.length;){const x=o[d];if(x instanceof C)return R(x.definition);if(x instanceof Ze)return R(x.definition);if(x instanceof Z)u=R(x.definition);else{if(x instanceof z){return R(x.definition.concat([new ce({definition:x.definition})]))}if(x instanceof fe){return R([new C({definition:x.definition}),new ce({definition:[new Pe({terminalType:x.separator})].concat(x.definition)})])}if(x instanceof Ie){const $=x.definition.concat([new ce({definition:[new Pe({terminalType:x.separator})].concat(x.definition)})]);u=R($)}else if(x instanceof ce){const $=x.definition.concat([new ce({definition:x.definition})]);u=R($)}else{if(x instanceof ve)return(0,y.Z)(x.definition,$=>{!1===(0,B.Z)($.definition)&&(u=R($.definition))}),u;if(!(x instanceof Pe))throw Error("non exhaustive match");a.push(x.terminalType)}}d++}return u.push({partialPath:a,suffixDef:h(o,d)}),u}function ni(o,t,a,u){const d="EXIT_NONE_TERMINAL",p=[d],R="EXIT_ALTERNATIVE";let x=!1;const $=t.length,U=$-u-1,Q=[],q=[];for(q.push({idx:-1,def:o,ruleStack:[],occurrenceStack:[]});!(0,B.Z)(q);){const me=q.pop();if(me===R){x&&(0,un.Z)(q).idx<=U&&q.pop();continue}const Ee=me.def,Ne=me.idx,$e=me.ruleStack,Fe=me.occurrenceStack;if((0,B.Z)(Ee))continue;const Ce=Ee[0];if(Ce===d){const he={idx:Ne,def:h(Ee),ruleStack:ft($e),occurrenceStack:ft(Fe)};q.push(he)}else if(Ce instanceof Pe)if(Ne<$-1){const he=Ne+1;if(a(t[he],Ce.terminalType)){const Oe={idx:he,def:h(Ee),ruleStack:$e,occurrenceStack:Fe};q.push(Oe)}}else{if(Ne!==$-1)throw Error("non exhaustive match");Q.push({nextTokenType:Ce.terminalType,nextTokenOccurrence:Ce.idx,ruleStack:$e,occurrenceStack:Fe}),x=!0}else if(Ce instanceof Ze){const he=(0,M.Z)($e);he.push(Ce.nonTerminalName);const se=(0,M.Z)(Fe);se.push(Ce.idx);const Oe={idx:Ne,def:Ce.definition.concat(p,h(Ee)),ruleStack:he,occurrenceStack:se};q.push(Oe)}else if(Ce instanceof Z){const he={idx:Ne,def:h(Ee),ruleStack:$e,occurrenceStack:Fe};q.push(he),q.push(R);const se={idx:Ne,def:Ce.definition.concat(h(Ee)),ruleStack:$e,occurrenceStack:Fe};q.push(se)}else if(Ce instanceof z){const he=new ce({definition:Ce.definition,idx:Ce.idx}),Oe={idx:Ne,def:Ce.definition.concat([he],h(Ee)),ruleStack:$e,occurrenceStack:Fe};q.push(Oe)}else if(Ce instanceof fe){const he=new Pe({terminalType:Ce.separator}),se=new ce({definition:[he].concat(Ce.definition),idx:Ce.idx}),Le={idx:Ne,def:Ce.definition.concat([se],h(Ee)),ruleStack:$e,occurrenceStack:Fe};q.push(Le)}else if(Ce instanceof Ie){const he={idx:Ne,def:h(Ee),ruleStack:$e,occurrenceStack:Fe};q.push(he),q.push(R);const se=new Pe({terminalType:Ce.separator}),Oe=new ce({definition:[se].concat(Ce.definition),idx:Ce.idx}),Nt={idx:Ne,def:Ce.definition.concat([Oe],h(Ee)),ruleStack:$e,occurrenceStack:Fe};q.push(Nt)}else if(Ce instanceof ce){const he={idx:Ne,def:h(Ee),ruleStack:$e,occurrenceStack:Fe};q.push(he),q.push(R);const se=new ce({definition:Ce.definition,idx:Ce.idx}),Le={idx:Ne,def:Ce.definition.concat([se],h(Ee)),ruleStack:$e,occurrenceStack:Fe};q.push(Le)}else if(Ce instanceof ve)for(let he=Ce.definition.length-1;he>=0;he--){const Oe={idx:Ne,def:Ce.definition[he].definition.concat(h(Ee)),ruleStack:$e,occurrenceStack:Fe};q.push(Oe),q.push(R)}else if(Ce instanceof C)q.push({idx:Ne,def:Ce.definition.concat(h(Ee)),ruleStack:$e,occurrenceStack:Fe});else{if(!(Ce instanceof Je))throw Error("non exhaustive match");q.push(yr(Ce,Ne,$e,Fe))}}return Q}function yr(o,t,a,u){const d=(0,M.Z)(a);d.push(o.name);const p=(0,M.Z)(u);return p.push(1),{idx:t,def:o.definition,ruleStack:d,occurrenceStack:p}}var He;function Hr(o){if(o instanceof Z||"Option"===o)return He.OPTION;if(o instanceof ce||"Repetition"===o)return He.REPETITION;if(o instanceof z||"RepetitionMandatory"===o)return He.REPETITION_MANDATORY;if(o instanceof fe||"RepetitionMandatoryWithSeparator"===o)return He.REPETITION_MANDATORY_WITH_SEPARATOR;if(o instanceof Ie||"RepetitionWithSeparator"===o)return He.REPETITION_WITH_SEPARATOR;if(o instanceof ve||"Alternation"===o)return He.ALTERNATION;throw Error("non exhaustive match")}function ri(o){const{occurrence:t,rule:a,prodType:u,maxLookahead:d}=o,p=Hr(u);return p===He.ALTERNATION?Tr(t,a,d):vr(t,a,p,d)}function si(o,t,a,u){const d=o.length,p=ut(o,R=>ut(R,x=>1===x.length));if(t)return function(R){const x=(0,k.Z)(R,$=>$.GATE);for(let $=0;$<d;$++){const U=o[$],Q=U.length,q=x[$];if(void 0===q||!1!==q.call(this))e:for(let me=0;me<Q;me++){const Ee=U[me],Ne=Ee.length;for(let $e=0;$e<Ne;$e++){const Fe=this.LA($e+1);if(!1===a(Fe,Ee[$e]))continue e}return $}}};if(p&&!u){const R=(0,k.Z)(o,$=>(0,at.Z)($)),x=(0,dt.Z)(R,($,U,Q)=>((0,y.Z)(U,q=>{(0,O.Z)($,q.tokenTypeIdx)||($[q.tokenTypeIdx]=Q),(0,y.Z)(q.categoryMatches,me=>{(0,O.Z)($,me)||($[me]=Q)})}),$),{});return function(){const $=this.LA(1);return x[$.tokenTypeIdx]}}return function(){for(let R=0;R<d;R++){const x=o[R],$=x.length;e:for(let U=0;U<$;U++){const Q=x[U],q=Q.length;for(let me=0;me<q;me++){const Ee=this.LA(me+1);if(!1===a(Ee,Q[me]))continue e}return R}}}}function Wi(o,t,a){const u=ut(o,p=>1===p.length),d=o.length;if(u&&!a){const p=(0,at.Z)(o);if(1===p.length&&(0,B.Z)(p[0].categoryMatches)){const x=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===x}}{const R=(0,dt.Z)(p,(x,$,U)=>(x[$.tokenTypeIdx]=!0,(0,y.Z)($.categoryMatches,Q=>{x[Q]=!0}),x),[]);return function(){const x=this.LA(1);return!0===R[x.tokenTypeIdx]}}}return function(){e:for(let p=0;p<d;p++){const R=o[p],x=R.length;for(let $=0;$<x;$++){const U=this.LA($+1);if(!1===t(U,R[$]))continue e}return!0}return!1}}!function(o){o[o.OPTION=0]="OPTION",o[o.REPETITION=1]="REPETITION",o[o.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",o[o.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",o[o.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",o[o.ALTERNATION=5]="ALTERNATION"}(He||(He={}));class Ki extends yt{constructor(t,a,u){super(),this.topProd=t,this.targetOccurrence=a,this.targetProdType=u}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(t,a,u,d){return t.idx===this.targetOccurrence&&this.targetProdType===a&&(this.restDef=u.concat(d),!0)}walkOption(t,a,u){this.checkIsTarget(t,He.OPTION,a,u)||super.walkOption(t,a,u)}walkAtLeastOne(t,a,u){this.checkIsTarget(t,He.REPETITION_MANDATORY,a,u)||super.walkOption(t,a,u)}walkAtLeastOneSep(t,a,u){this.checkIsTarget(t,He.REPETITION_MANDATORY_WITH_SEPARATOR,a,u)||super.walkOption(t,a,u)}walkMany(t,a,u){this.checkIsTarget(t,He.REPETITION,a,u)||super.walkOption(t,a,u)}walkManySep(t,a,u){this.checkIsTarget(t,He.REPETITION_WITH_SEPARATOR,a,u)||super.walkOption(t,a,u)}}class ji extends Jt{constructor(t,a,u){super(),this.targetOccurrence=t,this.targetProdType=a,this.targetRef=u,this.result=[]}checkIsTarget(t,a){t.idx===this.targetOccurrence&&this.targetProdType===a&&(void 0===this.targetRef||t===this.targetRef)&&(this.result=t.definition)}visitOption(t){this.checkIsTarget(t,He.OPTION)}visitRepetition(t){this.checkIsTarget(t,He.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,He.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,He.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,He.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,He.ALTERNATION)}}function ii(o){const t=new Array(o);for(let a=0;a<o;a++)t[a]=[];return t}function zr(o){let t=[""];for(let a=0;a<o.length;a++){const u=o[a],d=[];for(let p=0;p<t.length;p++){const R=t[p];d.push(R+"_"+u.tokenTypeIdx);for(let x=0;x<u.categoryMatches.length;x++){const $="_"+u.categoryMatches[x];d.push(R+$)}}t=d}return t}function Vi(o,t,a){for(let u=0;u<o.length;u++){if(u===a)continue;const d=o[u];for(let p=0;p<t.length;p++){if(!0===d[t[p]])return!1}}return!0}function Yr(o,t){const a=(0,k.Z)(o,R=>bt([R],1)),u=ii(a.length),d=(0,k.Z)(a,R=>{const x={};return(0,y.Z)(R,$=>{const U=zr($.partialPath);(0,y.Z)(U,Q=>{x[Q]=!0})}),x});let p=a;for(let R=1;R<=t;R++){const x=p;p=ii(x.length);for(let $=0;$<x.length;$++){const U=x[$];for(let Q=0;Q<U.length;Q++){const q=U[Q].partialPath,me=U[Q].suffixDef,Ee=zr(q);if(Vi(d,Ee,$)||(0,B.Z)(me)||q.length===t){const $e=u[$];if(!1===En($e,q)){$e.push(q);for(let Fe=0;Fe<Ee.length;Fe++){const Ce=Ee[Fe];d[$][Ce]=!0}}}else{const $e=bt(me,R+1,q);p[$]=p[$].concat($e),(0,y.Z)($e,Fe=>{const Ce=zr(Fe.partialPath);(0,y.Z)(Ce,he=>{d[$][he]=!0})})}}}}return u}function Tr(o,t,a,u){const d=new ji(o,He.ALTERNATION,u);return t.accept(d),Yr(d.result,a)}function vr(o,t,a,u){const d=new ji(o,a);t.accept(d);const p=d.result,x=new Ki(t,o,a).startWalking();return Yr([new C({definition:p}),new C({definition:x})],u)}function En(o,t){e:for(let a=0;a<o.length;a++){const u=o[a];if(u.length===t.length){for(let d=0;d<u.length;d++){const p=t[d],R=u[d];if(!1==(p===R||void 0!==R.categoryMatchesMap[p.tokenTypeIdx]))continue e}return!0}}return!1}function ai(o){return ut(o,t=>ut(t,a=>ut(a,u=>(0,B.Z)(u.categoryMatches))))}function zi(o,t,a,u){const d=(0,St.Z)(o,$=>function Xr(o,t){const a=new Xi;o.accept(a);const u=a.allProductions,d=qs(u,Yi),p=Re(d,x=>x.length>1);return(0,k.Z)((0,L.Z)(p),x=>{const $=Mt(x),U=t.buildDuplicateFoundError(o,x),Q=ct($),q={message:U,type:It.DUPLICATE_PRODUCTIONS,ruleName:o.name,dslName:Q,occurrence:$.idx},me=xt($);return me&&(q.parameter=me),q})}($,a)),p=function li(o,t,a){const u=[],d=(0,k.Z)(t,p=>p.name);return(0,y.Z)(o,p=>{const R=p.name;if(nt(d,R)){const x=a.buildNamespaceConflictError(p);u.push({message:x,type:It.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:R})}}),u}(o,t,a),R=(0,St.Z)(o,$=>function na(o,t){const a=new An;o.accept(a);const u=a.alternations;return(0,St.Z)(u,p=>p.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:o,alternation:p}),type:It.TOO_MANY_ALTS,ruleName:o.name,occurrence:p.idx}]:[])}($,a)),x=(0,St.Z)(o,$=>function Ji(o,t,a,u){const d=[];if((0,dt.Z)(t,(R,x)=>x.name===o.name?R+1:R,0)>1){const R=u.buildDuplicateRuleNameError({topLevelRule:o,grammarName:a});d.push({message:R,type:It.DUPLICATE_RULE_NAME,ruleName:o.name})}return d}($,o,u,a));return d.concat(p,R,x)}function Yi(o){return`${ct(o)}_#_${o.idx}_#_${xt(o)}`}function xt(o){return o instanceof Pe?o.terminalType.name:o instanceof Ze?o.nonTerminalName:""}class Xi extends Jt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(t){this.allProductions.push(t)}visitOption(t){this.allProductions.push(t)}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}visitAlternation(t){this.allProductions.push(t)}visitTerminal(t){this.allProductions.push(t)}}function oi(o,t,a,u=[]){const d=[],p=Ar(t.definition);if((0,B.Z)(p))return[];{const R=o.name;nt(p,o)&&d.push({message:a.buildLeftRecursionError({topLevelRule:o,leftRecursionPath:u}),type:It.LEFT_RECURSION,ruleName:R});const $=rn(p,u.concat([o])),U=(0,St.Z)($,Q=>{const q=(0,M.Z)(u);return q.push(Q),oi(o,Q,a,q)});return d.concat(U)}}function Ar(o){let t=[];if((0,B.Z)(o))return t;const a=Mt(o);if(a instanceof Ze)t.push(a.referencedRule);else if(a instanceof C||a instanceof Z||a instanceof z||a instanceof fe||a instanceof Ie||a instanceof ce)t=t.concat(Ar(a.definition));else if(a instanceof ve)t=(0,at.Z)((0,k.Z)(a.definition,p=>Ar(p.definition)));else if(!(a instanceof Pe))throw Error("non exhaustive match");const u=Ht(a),d=o.length>1;if(u&&d){const p=h(o);return t.concat(Ar(p))}return t}class An extends Jt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}}function ea(o,t,a){const u=new An;o.accept(u);let d=u.alternations;return d=Qe(d,R=>!0===R.ignoreAmbiguities),(0,St.Z)(d,R=>{const x=R.idx,$=R.maxLookahead||t,U=Tr(x,o,$,R),Q=function sa(o,t,a,u){const d=[],p=(0,dt.Z)(o,(x,$,U)=>(!0===t.definition[U].ignoreAmbiguities||(0,y.Z)($,Q=>{const q=[U];(0,y.Z)(o,(me,Ee)=>{U!==Ee&&En(me,Q)&&!0!==t.definition[Ee].ignoreAmbiguities&&q.push(Ee)}),q.length>1&&!En(d,Q)&&(d.push(Q),x.push({alts:q,path:Q}))}),x),[]);return(0,k.Z)(p,x=>{const $=(0,k.Z)(x.alts,Q=>Q+1);return{message:u.buildAlternationAmbiguityError({topLevelRule:a,alternation:t,ambiguityIndices:$,prefixPath:x.path}),type:It.AMBIGUOUS_ALTS,ruleName:a.name,occurrence:t.idx,alternatives:x.alts}})}(U,R,o,a),q=function ia(o,t,a,u){const d=(0,dt.Z)(o,(R,x,$)=>{const U=(0,k.Z)(x,Q=>({idx:$,path:Q}));return R.concat(U)},[]);return sn((0,St.Z)(d,R=>{if(!0===t.definition[R.idx].ignoreAmbiguities)return[];const $=R.idx,U=R.path,Q=(0,At.Z)(d,me=>!0!==t.definition[me.idx].ignoreAmbiguities&&me.idx<$&&function Er(o,t){return o.length<t.length&&ut(o,(a,u)=>{const d=t[u];return a===d||d.categoryMatchesMap[a.tokenTypeIdx]})}(me.path,U));return(0,k.Z)(Q,me=>{const Ee=[me.idx+1,$+1],Ne=0===t.idx?"":t.idx;return{message:u.buildAlternationPrefixAmbiguityError({topLevelRule:a,alternation:t,ambiguityIndices:Ee,prefixPath:me.path}),type:It.AMBIGUOUS_PREFIX_ALTS,ruleName:a.name,occurrence:Ne,alternatives:Ee}})}))}(U,R,o,a);return Q.concat(q)})}class ta extends Jt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}}function ui(o){const t=(0,st.Z)(o,{errMsgProvider:Ge}),a={};return(0,y.Z)(o.rules,u=>{a[u.name]=u}),function Xs(o,t){const a=new Zi(o,t);return a.resolveRefs(),a.errors}(a,t.errMsgProvider)}const ci="MismatchedTokenException",Jr="NoViableAltException",Qr="EarlyExitException",di="NotAllInputParsedException",fi=[ci,Jr,Qr,di];function Rr(o){return nt(fi,o.name)}Object.freeze(fi);class _r extends Error{constructor(t,a){super(t),this.token=a,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class hi extends _r{constructor(t,a,u){super(t,a),this.previousToken=u,this.name=ci}}class qr extends _r{constructor(t,a,u){super(t,a),this.previousToken=u,this.name=Jr}}class oa extends _r{constructor(t,a){super(t,a),this.name=di}}class la extends _r{constructor(t,a,u){super(t,a),this.previousToken=u,this.name=Qr}}const es={},pi="InRuleRecoveryException";class mi extends Error{constructor(t){super(t),this.name=pi}}function gi(o,t,a,u,d,p,R){const x=this.getKeyForAutomaticLookahead(u,d);let $=this.firstAfterRepMap[x];if(void 0===$){const me=this.getCurrRuleFullName();$=new p(this.getGAstProductions()[me],d).startWalking(),this.firstAfterRepMap[x]=$}let U=$.token,Q=$.occurrence;const q=$.isEndOfRule;1===this.RULE_STACK.length&&q&&void 0===U&&(U=dn,Q=1),void 0!==U&&void 0!==Q&&this.shouldInRepetitionRecoveryBeTried(U,Q,R)&&this.tryInRepetitionRecovery(o,t,a,U)}function ns(o,t,a){return a|t|o}class Ai{constructor(t){var a;this.maxLookahead=null!==(a=null==t?void 0:t.maxLookahead)&&void 0!==a?a:fn.maxLookahead}validate(t){const a=this.validateNoLeftRecursion(t.rules);if((0,B.Z)(a)){const u=this.validateEmptyOrAlternatives(t.rules),d=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),p=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...a,...u,...d,...p]}return a}validateNoLeftRecursion(t){return(0,St.Z)(t,a=>oi(a,a,vn))}validateEmptyOrAlternatives(t){return(0,St.Z)(t,a=>function qi(o,t){const a=new An;o.accept(a);const u=a.alternations;return(0,St.Z)(u,p=>{const R=ft(p.definition);return(0,St.Z)(R,(x,$)=>{const U=ni([x],[],yn,1);return(0,B.Z)(U)?[{message:t.buildEmptyAlternationError({topLevelRule:o,alternation:p,emptyChoiceIdx:$}),type:It.NONE_LAST_EMPTY_ALT,ruleName:o.name,occurrence:p.idx,alternative:$+1}]:[]})})}(a,vn))}validateAmbiguousAlternationAlternatives(t,a){return(0,St.Z)(t,u=>ea(u,a,vn))}validateSomeNonEmptyLookaheadPath(t,a){return function ra(o,t,a){const u=[];return(0,y.Z)(o,d=>{const p=new ta;d.accept(p);const R=p.allProductions;(0,y.Z)(R,x=>{const $=Hr(x),U=x.maxLookahead||t,me=vr(x.idx,d,$,U)[0];if((0,B.Z)((0,at.Z)(me))){const Ee=a.buildEmptyRepetitionError({topLevelRule:d,repetition:x});u.push({message:Ee,type:It.NO_NON_EMPTY_LOOKAHEAD,ruleName:d.name})}})}),u}(t,a,vn)}buildLookaheadForAlternation(t){return function Bi(o,t,a,u,d,p){const R=Tr(o,t,a);return p(R,u,ai(R)?wn:yn,d)}(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,si)}buildLookaheadForOptional(t){return function ga(o,t,a,u,d,p){const R=vr(o,t,d,a),x=ai(R)?wn:yn;return p(R[0],x,u)}(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,Hr(t.prodType),Wi)}}const xr=new class va extends Jt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(t){this.dslMethods.option.push(t)}visitRepetitionWithSeparator(t){this.dslMethods.repetitionWithSeparator.push(t)}visitRepetitionMandatory(t){this.dslMethods.repetitionMandatory.push(t)}visitRepetitionMandatoryWithSeparator(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)}visitRepetition(t){this.dslMethods.repetition.push(t)}visitAlternation(t){this.dslMethods.alternation.push(t)}};function Ri(o,t){!0===isNaN(o.startOffset)?(o.startOffset=t.startOffset,o.endOffset=t.endOffset):o.endOffset<t.endOffset&&(o.endOffset=t.endOffset)}function _i(o,t){!0===isNaN(o.startOffset)?(o.startOffset=t.startOffset,o.startColumn=t.startColumn,o.startLine=t.startLine,o.endOffset=t.endOffset,o.endColumn=t.endColumn,o.endLine=t.endLine):o.endOffset<t.endOffset&&(o.endOffset=t.endOffset,o.endColumn=t.endColumn,o.endLine=t.endLine)}function r(o,t){Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,writable:!1,value:t})}function s(o,t){const a=(0,D.Z)(o),u=a.length;for(let d=0;d<u;d++){const R=o[a[d]],x=R.length;for(let $=0;$<x;$++){const U=R[$];void 0===U.tokenTypeIdx&&this[U.name](U.children,t)}}}function l(o,t){const a=function(){};r(a,o+"BaseSemantics");const u={visit:function(d,p){if((0,We.Z)(d)&&(d=d[0]),!(0,ge.Z)(d))return this[d.name](d.children,p)},validateVisitor:function(){const d=function _(o,t){return function G(o,t){const a=(0,At.Z)(t,d=>!1===(0,tn.Z)(o[d])),u=(0,k.Z)(a,d=>({msg:`Missing visitor method: <${d}> on ${o.constructor.name} CST Visitor.`,type:f.MISSING_METHOD,methodName:d}));return sn(u)}(o,t)}(this,t);if(!(0,B.Z)(d)){const p=(0,k.Z)(d,R=>R.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${p.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return a.prototype=u,a.prototype.constructor=a,a._RULE_NAMES=t,a}var f;!function(o){o[o.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",o[o.MISSING_METHOD=1]="MISSING_METHOD"}(f||(f={}));var J=g(82293);const mt={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(mt);const Aa=Math.pow(2,8)-1,Ra=Ys({name:"RECORDING_PHASE_TOKEN",pattern:Rt.NA});Mn([Ra]);const _a=Gr(Ra,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(_a);const Oa={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function rs(o,t,a,u=!1){Ii(a);const d=(0,un.Z)(this.recordingProdStack),p=(0,tn.Z)(t)?t:t.DEF,R=new o({definition:[],idx:a});return u&&(R.separator=t.SEP),(0,O.Z)(t,"MAX_LOOKAHEAD")&&(R.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(R),p.call(this),d.definition.push(R),this.recordingProdStack.pop(),mt}function Pa(o,t){Ii(t);const a=(0,un.Z)(this.recordingProdStack),u=!1===(0,We.Z)(o),d=!1===u?o:o.DEF,p=new ve({definition:[],idx:t,ignoreAmbiguities:u&&!0===o.IGNORE_AMBIGUITIES});(0,O.Z)(o,"MAX_LOOKAHEAD")&&(p.maxLookahead=o.MAX_LOOKAHEAD);const R=kn(d,x=>(0,tn.Z)(x.GATE));return p.hasPredicates=R,a.definition.push(p),(0,y.Z)(d,x=>{const $=new C({definition:[]});p.definition.push($),(0,O.Z)(x,"IGNORE_AMBIGUITIES")?$.ignoreAmbiguities=x.IGNORE_AMBIGUITIES:(0,O.Z)(x,"GATE")&&($.ignoreAmbiguities=!0),this.recordingProdStack.push($),x.ALT.call(this),this.recordingProdStack.pop()}),mt}function Ia(o){return 0===o?"":`${o}`}function Ii(o){if(o<0||o>Aa){const t=new Error(`Invalid DSL Method idx value: <${o}>\n\tIdx value must be a none negative value smaller than ${Aa+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const Ci=Gr(dn,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Ci);const fn=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ke,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),xi=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var It;function ba(o){return function(){return o}}!function(o){o[o.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",o[o.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",o[o.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",o[o.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",o[o.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",o[o.LEFT_RECURSION=5]="LEFT_RECURSION",o[o.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",o[o.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",o[o.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",o[o.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",o[o.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",o[o.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",o[o.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",o[o.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(It||(It={}));class ss{static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;const a=this.className;this.TRACE_INIT("toFastProps",()=>{W(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),(0,y.Z)(this.definedRulesNames,d=>{const R=this[d].originalGrammarAction;let x;this.TRACE_INIT(`${d} Rule`,()=>{x=this.topLevelRuleRecord(d,R)}),this.gastProductionsCache[d]=x})}finally{this.disableRecording()}});let u=[];if(this.TRACE_INIT("Grammar Resolving",()=>{u=ui({rules:(0,L.Z)(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(u)}),this.TRACE_INIT("Grammar Validations",()=>{if((0,B.Z)(u)&&!1===this.skipValidations){const d=function aa(o){return zi((o=(0,st.Z)(o,{errMsgProvider:vn})).rules,o.tokenTypes,o.errMsgProvider,o.grammarName)}({rules:(0,L.Z)(this.gastProductionsCache),tokenTypes:(0,L.Z)(this.tokensMap),errMsgProvider:vn,grammarName:a}),p=function Hi(o){const t=o.lookaheadStrategy.validate({rules:o.rules,tokenTypes:o.tokenTypes,grammarName:o.grammarName});return(0,k.Z)(t,a=>Object.assign({type:It.CUSTOM_LOOKAHEAD_VALIDATION},a))}({lookaheadStrategy:this.lookaheadStrategy,rules:(0,L.Z)(this.gastProductionsCache),tokenTypes:(0,L.Z)(this.tokensMap),grammarName:a});this.definitionErrors=this.definitionErrors.concat(d,p)}}),(0,B.Z)(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const d=function Et(o){const t={};return(0,y.Z)(o,a=>{const u=new Yt(a).startWalking();ue(t,u)}),t}((0,L.Z)(this.gastProductionsCache));this.resyncFollows=d}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var d,p;null===(p=(d=this.lookaheadStrategy).initialize)||void 0===p||p.call(d,{rules:(0,L.Z)(this.gastProductionsCache)}),this.preComputeLookaheadFunctions((0,L.Z)(this.gastProductionsCache))})),!ss.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,B.Z)(this.definitionErrors))throw t=(0,k.Z)(this.definitionErrors,d=>d.message),new Error(`Parser Definition Errors detected:\n ${t.join("\n-------------------------------\n")}`)})}constructor(t,a){this.definitionErrors=[],this.selfAnalysisDone=!1;const u=this;if(u.initErrorHandler(a),u.initLexerAdapter(),u.initLooksAhead(a),u.initRecognizerEngine(t,a),u.initRecoverable(a),u.initTreeBuilder(a),u.initContentAssist(),u.initGastRecorder(a),u.initPerformanceTracer(a),(0,O.Z)(a,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=(0,O.Z)(a,"skipValidations")?a.skipValidations:fn.skipValidations}}ss.DEFER_DEFINITION_ERRORS_HANDLING=!1,function Ma(o,t){t.forEach(a=>{const u=a.prototype;Object.getOwnPropertyNames(u).forEach(d=>{if("constructor"===d)return;const p=Object.getOwnPropertyDescriptor(u,d);p&&(p.get||p.set)?Object.defineProperty(o.prototype,d,p):o.prototype[d]=a.prototype[d]})})}(ss,[class ua{initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,O.Z)(t,"recoveryEnabled")?t.recoveryEnabled:fn.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=gi)}getTokenToInsert(t){const a=Gr(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return a.isInsertedInRecovery=!0,a}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,a,u,d){const p=this.findReSyncTokenType(),R=this.exportLexerState(),x=[];let $=!1;const U=this.LA(1);let Q=this.LA(1);const q=()=>{const me=this.LA(0),Ee=this.errorMessageProvider.buildMismatchTokenMessage({expected:d,actual:U,previous:me,ruleName:this.getCurrRuleFullName()}),Ne=new hi(Ee,U,this.LA(0));Ne.resyncedTokens=ft(x),this.SAVE_ERROR(Ne)};for(;!$;){if(this.tokenMatcher(Q,d))return void q();if(u.call(this))return q(),void t.apply(this,a);this.tokenMatcher(Q,p)?$=!0:(Q=this.SKIP_TOKEN(),this.addToResyncTokens(Q,x))}this.importLexerState(R)}shouldInRepetitionRecoveryBeTried(t,a,u){return!(!1===u||this.tokenMatcher(this.LA(1),t)||this.isBackTracking()||this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,a)))}getFollowsForInRuleRecovery(t,a){const u=this.getCurrentGrammarPath(t,a);return this.getNextPossibleTokenTypes(u)}tryInRuleRecovery(t,a){if(this.canRecoverWithSingleTokenInsertion(t,a))return this.getTokenToInsert(t);if(this.canRecoverWithSingleTokenDeletion(t)){const u=this.SKIP_TOKEN();return this.consumeToken(),u}throw new mi("sad sad panda")}canPerformInRuleRecovery(t,a){return this.canRecoverWithSingleTokenInsertion(t,a)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,a){if(!this.canTokenTypeBeInsertedInRecovery(t)||(0,B.Z)(a))return!1;const u=this.LA(1);return void 0!==(0,gn.Z)(a,p=>this.tokenMatcher(u,p))}canRecoverWithSingleTokenDeletion(t){return!!this.canTokenTypeBeDeletedInRecovery(t)&&this.tokenMatcher(this.LA(2),t)}isInCurrentRuleReSyncSet(t){const a=this.getCurrFollowKey(),u=this.getFollowSetFromFollowKey(a);return nt(u,t)}findReSyncTokenType(){const t=this.flattenFollowSet();let a=this.LA(1),u=2;for(;;){const d=(0,gn.Z)(t,p=>ke(a,p));if(void 0!==d)return d;a=this.LA(u),u++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return es;const t=this.getLastExplicitRuleShortName(),a=this.getLastExplicitRuleOccurrenceIndex(),u=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:a,inRule:this.shortRuleNameToFullName(u)}}buildFullFollowKeyStack(){const t=this.RULE_STACK,a=this.RULE_OCCURRENCE_STACK;return(0,k.Z)(t,(u,d)=>0===d?es:{ruleName:this.shortRuleNameToFullName(u),idxInCallingRule:a[d],inRule:this.shortRuleNameToFullName(t[d-1])})}flattenFollowSet(){const t=(0,k.Z)(this.buildFullFollowKeyStack(),a=>this.getFollowSetFromFollowKey(a));return(0,at.Z)(t)}getFollowSetFromFollowKey(t){if(t===es)return[dn];const a=t.ruleName+t.idxInCallingRule+ht+t.inRule;return this.resyncFollows[a]}addToResyncTokens(t,a){return this.tokenMatcher(t,dn)||a.push(t),a}reSyncTo(t){const a=[];let u=this.LA(1);for(;!1===this.tokenMatcher(u,t);)u=this.SKIP_TOKEN(),this.addToResyncTokens(u,a);return ft(a)}attemptInRepetitionRecovery(t,a,u,d,p,R,x){}getCurrentGrammarPath(t,a){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,M.Z)(this.RULE_OCCURRENCE_STACK),lastTok:t,lastTokOccurrence:a}}getHumanReadableRuleStack(){return(0,k.Z)(this.RULE_STACK,t=>this.shortRuleNameToFullName(t))}},class Ta{initLooksAhead(t){this.dynamicTokensEnabled=(0,O.Z)(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:fn.dynamicTokensEnabled,this.maxLookahead=(0,O.Z)(t,"maxLookahead")?t.maxLookahead:fn.maxLookahead,this.lookaheadStrategy=(0,O.Z)(t,"lookaheadStrategy")?t.lookaheadStrategy:new Ai({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(t){(0,y.Z)(t,a=>{this.TRACE_INIT(`${a.name} Rule Lookahead`,()=>{const{alternation:u,repetition:d,option:p,repetitionMandatory:R,repetitionMandatoryWithSeparator:x,repetitionWithSeparator:$}=function ca(o){xr.reset(),o.accept(xr);const t=xr.dslMethods;return xr.reset(),t}(a);(0,y.Z)(u,U=>{const Q=0===U.idx?"":U.idx;this.TRACE_INIT(`${ct(U)}${Q}`,()=>{const q=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:U.idx,rule:a,maxLookahead:U.maxLookahead||this.maxLookahead,hasPredicates:U.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),me=ns(this.fullRuleNameToShort[a.name],256,U.idx);this.setLaFuncCache(me,q)})}),(0,y.Z)(d,U=>{this.computeLookaheadFunc(a,U.idx,768,"Repetition",U.maxLookahead,ct(U))}),(0,y.Z)(p,U=>{this.computeLookaheadFunc(a,U.idx,512,"Option",U.maxLookahead,ct(U))}),(0,y.Z)(R,U=>{this.computeLookaheadFunc(a,U.idx,1024,"RepetitionMandatory",U.maxLookahead,ct(U))}),(0,y.Z)(x,U=>{this.computeLookaheadFunc(a,U.idx,1536,"RepetitionMandatoryWithSeparator",U.maxLookahead,ct(U))}),(0,y.Z)($,U=>{this.computeLookaheadFunc(a,U.idx,1280,"RepetitionWithSeparator",U.maxLookahead,ct(U))})})})}computeLookaheadFunc(t,a,u,d,p,R){this.TRACE_INIT(`${R}${0===a?"":a}`,()=>{const x=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:a,rule:t,maxLookahead:p||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:d}),$=ns(this.fullRuleNameToShort[t.name],u,a);this.setLaFuncCache($,x)})}getKeyForAutomaticLookahead(t,a){return ns(this.getLastExplicitRuleShortName(),t,a)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,a){this.lookAheadFuncsCache.set(t,a)}},class Y{initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=(0,O.Z)(t,"nodeLocationTracking")?t.nodeLocationTracking:fn.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_i,this.setNodeLocationFromNode=_i,this.cstPostRule=qe.Z,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=qe.Z,this.setNodeLocationFromNode=qe.Z,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ri,this.setNodeLocationFromNode=Ri,this.cstPostRule=qe.Z,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=qe.Z,this.setNodeLocationFromNode=qe.Z,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid <nodeLocationTracking> config option: "${t.nodeLocationTracking}"`);this.setNodeLocationFromToken=qe.Z,this.setNodeLocationFromNode=qe.Z,this.cstPostRule=qe.Z,this.setInitialNodeLocation=qe.Z}else this.cstInvocationStateUpdate=qe.Z,this.cstFinallyStateUpdate=qe.Z,this.cstPostTerminal=qe.Z,this.cstPostNonTerminal=qe.Z,this.cstPostRule=qe.Z}setInitialNodeLocationOnlyOffsetRecovery(t){t.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(t){const a=this.LA(1);t.location={startOffset:a.startOffset,startLine:a.startLine,startColumn:a.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(t){const a={name:t,children:Object.create(null)};this.setInitialNodeLocation(a),this.CST_STACK.push(a)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){const a=this.LA(0),u=t.location;u.startOffset<=a.startOffset?(u.endOffset=a.endOffset,u.endLine=a.endLine,u.endColumn=a.endColumn):(u.startOffset=NaN,u.startLine=NaN,u.startColumn=NaN)}cstPostRuleOnlyOffset(t){const a=this.LA(0),u=t.location;u.startOffset<=a.startOffset?u.endOffset=a.endOffset:u.startOffset=NaN}cstPostTerminal(t,a){const u=this.CST_STACK[this.CST_STACK.length-1];(function i(o,t,a){void 0===o.children[a]?o.children[a]=[t]:o.children[a].push(t)})(u,a,t),this.setNodeLocationFromToken(u.location,a)}cstPostNonTerminal(t,a){const u=this.CST_STACK[this.CST_STACK.length-1];(function e(o,t,a){void 0===o.children[t]?o.children[t]=[a]:o.children[t].push(a)})(u,a,t),this.setNodeLocationFromNode(u.location,t.location)}getBaseCstVisitorConstructor(){if((0,ge.Z)(this.baseCstVisitorConstructor)){const t=l(this.className,(0,D.Z)(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if((0,ge.Z)(this.baseCstVisitorWithDefaultsConstructor)){const t=function c(o,t,a){const u=function(){};r(u,o+"BaseSemanticsWithDefaults");const d=Object.create(a.prototype);return(0,y.Z)(t,p=>{d[p]=s}),u.prototype=d,u.prototype.constructor=u,u}(this.className,(0,D.Z)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const t=this.RULE_STACK;return t[t.length-1]}getPreviousExplicitRuleShortName(){const t=this.RULE_STACK;return t[t.length-2]}getLastExplicitRuleOccurrenceIndex(){const t=this.RULE_OCCURRENCE_STACK;return t[t.length-1]}},class ie{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(t){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Ci}LA(t){const a=this.currIdx+t;return a<0||this.tokVectorLength<=a?Ci:this.tokVector[a]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(t){this.currIdx=t}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},class Ue{initRecognizerEngine(t,a){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=wn,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,O.Z)(a,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,We.Z)(t)){if((0,B.Z)(t))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof t[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if((0,We.Z)(t))this.tokensMap=(0,dt.Z)(t,(p,R)=>(p[R.name]=R,p),{});else if((0,O.Z)(t,"modes")&&ut((0,at.Z)((0,L.Z)(t.modes)),Mi)){const p=(0,at.Z)((0,L.Z)(t.modes)),R=Lt(p);this.tokensMap=(0,dt.Z)(R,(x,$)=>(x[$.name]=$,x),{})}else{if(!(0,J.Z)(t))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,M.Z)(t)}this.tokensMap.EOF=dn;const u=(0,O.Z)(t,"modes")?(0,at.Z)((0,L.Z)(t.modes)):(0,L.Z)(t),d=ut(u,p=>(0,B.Z)(p.categoryMatches));this.tokenMatcher=d?wn:yn,Mn((0,L.Z)(this.tokensMap))}defineRule(t,a,u){if(this.selfAnalysisDone)throw Error(`Grammar rule <${t}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const d=(0,O.Z)(u,"resyncEnabled")?u.resyncEnabled:xi.resyncEnabled,p=(0,O.Z)(u,"recoveryValueFunc")?u.recoveryValueFunc:xi.recoveryValueFunc,R=this.ruleShortNameIdx<<12;let x;return this.ruleShortNameIdx++,this.shortRuleNameToFull[R]=t,this.fullRuleNameToShort[t]=R,x=!0===this.outputCst?function(...Q){try{this.ruleInvocationStateUpdate(R,t,this.subruleIdx),a.apply(this,Q);const q=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(q),q}catch(q){return this.invokeRuleCatch(q,d,p)}finally{this.ruleFinallyStateUpdate()}}:function(...Q){try{return this.ruleInvocationStateUpdate(R,t,this.subruleIdx),a.apply(this,Q)}catch(q){return this.invokeRuleCatch(q,d,p)}finally{this.ruleFinallyStateUpdate()}},Object.assign(x,{ruleName:t,originalGrammarAction:a})}invokeRuleCatch(t,a,u){const d=1===this.RULE_STACK.length,p=a&&!this.isBackTracking()&&this.recoveryEnabled;if(Rr(t)){const R=t;if(p){const x=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(x)){if(R.resyncedTokens=this.reSyncTo(x),this.outputCst){const $=this.CST_STACK[this.CST_STACK.length-1];return $.recoveredNode=!0,$}return u(t)}if(this.outputCst){const $=this.CST_STACK[this.CST_STACK.length-1];$.recoveredNode=!0,R.partialCstResult=$}throw R}if(d)return this.moveToTerminatedState(),u(t);throw R}throw t}optionInternal(t,a){const u=this.getKeyForAutomaticLookahead(512,a);return this.optionInternalLogic(t,a,u)}optionInternalLogic(t,a,u){let p,d=this.getLaFuncFromCache(u);if("function"!=typeof t){p=t.DEF;const R=t.GATE;if(void 0!==R){const x=d;d=()=>R.call(this)&&x.call(this)}}else p=t;if(!0===d.call(this))return p.call(this)}atLeastOneInternal(t,a){const u=this.getKeyForAutomaticLookahead(1024,t);return this.atLeastOneInternalLogic(t,a,u)}atLeastOneInternalLogic(t,a,u){let p,d=this.getLaFuncFromCache(u);if("function"!=typeof a){p=a.DEF;const R=a.GATE;if(void 0!==R){const x=d;d=()=>R.call(this)&&x.call(this)}}else p=a;if(!0!==d.call(this))throw this.raiseEarlyExitException(t,He.REPETITION_MANDATORY,a.ERR_MSG);{let R=this.doSingleRepetition(p);for(;!0===d.call(this)&&!0===R;)R=this.doSingleRepetition(p)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,a],d,1024,t,Gi)}atLeastOneSepFirstInternal(t,a){const u=this.getKeyForAutomaticLookahead(1536,t);this.atLeastOneSepFirstInternalLogic(t,a,u)}atLeastOneSepFirstInternalLogic(t,a,u){const d=a.DEF,p=a.SEP;if(!0!==this.getLaFuncFromCache(u).call(this))throw this.raiseEarlyExitException(t,He.REPETITION_MANDATORY_WITH_SEPARATOR,a.ERR_MSG);{d.call(this);const x=()=>this.tokenMatcher(this.LA(1),p);for(;!0===this.tokenMatcher(this.LA(1),p);)this.CONSUME(p),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,p,x,d,ti],x,1536,t,ti)}}manyInternal(t,a){const u=this.getKeyForAutomaticLookahead(768,t);return this.manyInternalLogic(t,a,u)}manyInternalLogic(t,a,u){let p,d=this.getLaFuncFromCache(u);if("function"!=typeof a){p=a.DEF;const x=a.GATE;if(void 0!==x){const $=d;d=()=>x.call(this)&&$.call(this)}}else p=a;let R=!0;for(;!0===d.call(this)&&!0===R;)R=this.doSingleRepetition(p);this.attemptInRepetitionRecovery(this.manyInternal,[t,a],d,768,t,Vr,R)}manySepFirstInternal(t,a){const u=this.getKeyForAutomaticLookahead(1280,t);this.manySepFirstInternalLogic(t,a,u)}manySepFirstInternalLogic(t,a,u){const d=a.DEF,p=a.SEP;if(!0===this.getLaFuncFromCache(u).call(this)){d.call(this);const x=()=>this.tokenMatcher(this.LA(1),p);for(;!0===this.tokenMatcher(this.LA(1),p);)this.CONSUME(p),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,p,x,d,ei],x,1280,t,ei)}}repetitionSepSecondInternal(t,a,u,d,p){for(;u();)this.CONSUME(a),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,a,u,d,p],u,1536,t,p)}doSingleRepetition(t){const a=this.getLexerPosition();return t.call(this),this.getLexerPosition()>a}orInternal(t,a){const u=this.getKeyForAutomaticLookahead(256,a),d=(0,We.Z)(t)?t:t.DEF,R=this.getLaFuncFromCache(u).call(this,d);if(void 0!==R)return d[R].ALT.call(this);this.raiseNoAltException(a,t.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const t=this.LA(1),a=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new oa(a,t))}}subruleInternal(t,a,u){let d;try{const p=void 0!==u?u.ARGS:void 0;return this.subruleIdx=a,d=t.apply(this,p),this.cstPostNonTerminal(d,void 0!==u&&void 0!==u.LABEL?u.LABEL:t.ruleName),d}catch(p){throw this.subruleInternalError(p,u,t.ruleName)}}subruleInternalError(t,a,u){throw Rr(t)&&void 0!==t.partialCstResult&&(this.cstPostNonTerminal(t.partialCstResult,void 0!==a&&void 0!==a.LABEL?a.LABEL:u),delete t.partialCstResult),t}consumeInternal(t,a,u){let d;try{const p=this.LA(1);!0===this.tokenMatcher(p,t)?(this.consumeToken(),d=p):this.consumeInternalError(t,p,u)}catch(p){d=this.consumeInternalRecovery(t,a,p)}return this.cstPostTerminal(void 0!==u&&void 0!==u.LABEL?u.LABEL:t.name,d),d}consumeInternalError(t,a,u){let d;const p=this.LA(0);throw d=void 0!==u&&u.ERR_MSG?u.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:a,previous:p,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new hi(d,a,p))}consumeInternalRecovery(t,a,u){if(!this.recoveryEnabled||"MismatchedTokenException"!==u.name||this.isBackTracking())throw u;{const d=this.getFollowsForInRuleRecovery(t,a);try{return this.tryInRuleRecovery(t,d)}catch(p){throw p.name===pi?u:p}}}saveRecogState(){const t=this.errors,a=(0,M.Z)(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:a,CST_STACK:this.CST_STACK}}reloadRecogState(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK}ruleInvocationStateUpdate(t,a,u){this.RULE_OCCURRENCE_STACK.push(u),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(a)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[t]}shortRuleNameToFullName(t){return this.shortRuleNameToFull[t]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),dn)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class re{ACTION(t){return t.call(this)}consume(t,a,u){return this.consumeInternal(a,t,u)}subrule(t,a,u){return this.subruleInternal(a,t,u)}option(t,a){return this.optionInternal(a,t)}or(t,a){return this.orInternal(a,t)}many(t,a){return this.manyInternal(t,a)}atLeastOne(t,a){return this.atLeastOneInternal(t,a)}CONSUME(t,a){return this.consumeInternal(t,0,a)}CONSUME1(t,a){return this.consumeInternal(t,1,a)}CONSUME2(t,a){return this.consumeInternal(t,2,a)}CONSUME3(t,a){return this.consumeInternal(t,3,a)}CONSUME4(t,a){return this.consumeInternal(t,4,a)}CONSUME5(t,a){return this.consumeInternal(t,5,a)}CONSUME6(t,a){return this.consumeInternal(t,6,a)}CONSUME7(t,a){return this.consumeInternal(t,7,a)}CONSUME8(t,a){return this.consumeInternal(t,8,a)}CONSUME9(t,a){return this.consumeInternal(t,9,a)}SUBRULE(t,a){return this.subruleInternal(t,0,a)}SUBRULE1(t,a){return this.subruleInternal(t,1,a)}SUBRULE2(t,a){return this.subruleInternal(t,2,a)}SUBRULE3(t,a){return this.subruleInternal(t,3,a)}SUBRULE4(t,a){return this.subruleInternal(t,4,a)}SUBRULE5(t,a){return this.subruleInternal(t,5,a)}SUBRULE6(t,a){return this.subruleInternal(t,6,a)}SUBRULE7(t,a){return this.subruleInternal(t,7,a)}SUBRULE8(t,a){return this.subruleInternal(t,8,a)}SUBRULE9(t,a){return this.subruleInternal(t,9,a)}OPTION(t){return this.optionInternal(t,0)}OPTION1(t){return this.optionInternal(t,1)}OPTION2(t){return this.optionInternal(t,2)}OPTION3(t){return this.optionInternal(t,3)}OPTION4(t){return this.optionInternal(t,4)}OPTION5(t){return this.optionInternal(t,5)}OPTION6(t){return this.optionInternal(t,6)}OPTION7(t){return this.optionInternal(t,7)}OPTION8(t){return this.optionInternal(t,8)}OPTION9(t){return this.optionInternal(t,9)}OR(t){return this.orInternal(t,0)}OR1(t){return this.orInternal(t,1)}OR2(t){return this.orInternal(t,2)}OR3(t){return this.orInternal(t,3)}OR4(t){return this.orInternal(t,4)}OR5(t){return this.orInternal(t,5)}OR6(t){return this.orInternal(t,6)}OR7(t){return this.orInternal(t,7)}OR8(t){return this.orInternal(t,8)}OR9(t){return this.orInternal(t,9)}MANY(t){this.manyInternal(0,t)}MANY1(t){this.manyInternal(1,t)}MANY2(t){this.manyInternal(2,t)}MANY3(t){this.manyInternal(3,t)}MANY4(t){this.manyInternal(4,t)}MANY5(t){this.manyInternal(5,t)}MANY6(t){this.manyInternal(6,t)}MANY7(t){this.manyInternal(7,t)}MANY8(t){this.manyInternal(8,t)}MANY9(t){this.manyInternal(9,t)}MANY_SEP(t){this.manySepFirstInternal(0,t)}MANY_SEP1(t){this.manySepFirstInternal(1,t)}MANY_SEP2(t){this.manySepFirstInternal(2,t)}MANY_SEP3(t){this.manySepFirstInternal(3,t)}MANY_SEP4(t){this.manySepFirstInternal(4,t)}MANY_SEP5(t){this.manySepFirstInternal(5,t)}MANY_SEP6(t){this.manySepFirstInternal(6,t)}MANY_SEP7(t){this.manySepFirstInternal(7,t)}MANY_SEP8(t){this.manySepFirstInternal(8,t)}MANY_SEP9(t){this.manySepFirstInternal(9,t)}AT_LEAST_ONE(t){this.atLeastOneInternal(0,t)}AT_LEAST_ONE1(t){return this.atLeastOneInternal(1,t)}AT_LEAST_ONE2(t){this.atLeastOneInternal(2,t)}AT_LEAST_ONE3(t){this.atLeastOneInternal(3,t)}AT_LEAST_ONE4(t){this.atLeastOneInternal(4,t)}AT_LEAST_ONE5(t){this.atLeastOneInternal(5,t)}AT_LEAST_ONE6(t){this.atLeastOneInternal(6,t)}AT_LEAST_ONE7(t){this.atLeastOneInternal(7,t)}AT_LEAST_ONE8(t){this.atLeastOneInternal(8,t)}AT_LEAST_ONE9(t){this.atLeastOneInternal(9,t)}AT_LEAST_ONE_SEP(t){this.atLeastOneSepFirstInternal(0,t)}AT_LEAST_ONE_SEP1(t){this.atLeastOneSepFirstInternal(1,t)}AT_LEAST_ONE_SEP2(t){this.atLeastOneSepFirstInternal(2,t)}AT_LEAST_ONE_SEP3(t){this.atLeastOneSepFirstInternal(3,t)}AT_LEAST_ONE_SEP4(t){this.atLeastOneSepFirstInternal(4,t)}AT_LEAST_ONE_SEP5(t){this.atLeastOneSepFirstInternal(5,t)}AT_LEAST_ONE_SEP6(t){this.atLeastOneSepFirstInternal(6,t)}AT_LEAST_ONE_SEP7(t){this.atLeastOneSepFirstInternal(7,t)}AT_LEAST_ONE_SEP8(t){this.atLeastOneSepFirstInternal(8,t)}AT_LEAST_ONE_SEP9(t){this.atLeastOneSepFirstInternal(9,t)}RULE(t,a,u=xi){if(nt(this.definedRulesNames,t)){const R={message:vn.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:It.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(R)}this.definedRulesNames.push(t);const d=this.defineRule(t,a,u);return this[t]=d,d}OVERRIDE_RULE(t,a,u=xi){const d=function Qi(o,t,a){const u=[];let d;return nt(t,o)||(d=`Invalid rule override, rule: ->${o}<- cannot be overridden in the grammar: ->${a}<-as it is not defined in any of the super grammars `,u.push({message:d,type:It.INVALID_RULE_OVERRIDE,ruleName:o})),u}(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(d);const p=this.defineRule(t,a,u);return this[t]=p,p}BACKTRACK(t,a){return function(){this.isBackTrackingStack.push(1);const u=this.saveRecogState();try{return t.apply(this,a),!0}catch(d){if(Rr(d))return!1;throw d}finally{this.reloadRecogState(u),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return function Ot(o){return(0,k.Z)(o,qt)}((0,L.Z)(this.gastProductionsCache))}},class je{initErrorHandler(t){this._errors=[],this.errorMessageProvider=(0,O.Z)(t,"errorMessageProvider")?t.errorMessageProvider:fn.errorMessageProvider}SAVE_ERROR(t){if(Rr(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,M.Z)(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return(0,M.Z)(this._errors)}set errors(t){this._errors=t}raiseEarlyExitException(t,a,u){const d=this.getCurrRuleFullName(),x=vr(t,this.getGAstProductions()[d],a,this.maxLookahead)[0],$=[];for(let Q=1;Q<=this.maxLookahead;Q++)$.push(this.LA(Q));const U=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:x,actual:$,previous:this.LA(0),customUserDescription:u,ruleName:d});throw this.SAVE_ERROR(new la(U,this.LA(1),this.LA(0)))}raiseNoAltException(t,a){const u=this.getCurrRuleFullName(),p=Tr(t,this.getGAstProductions()[u],this.maxLookahead),R=[];for(let U=1;U<=this.maxLookahead;U++)R.push(this.LA(U));const x=this.LA(0),$=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:p,actual:R,previous:x,customUserDescription:a,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new qr($,this.LA(1),x))}},class et{initContentAssist(){}computeContentAssist(t,a){const u=this.gastProductionsCache[t];if((0,ge.Z)(u))throw Error(`Rule ->${t}<- does not exist in this grammar.`);return ni([u],a,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(t){const a=Mt(t.ruleStack),d=this.getGAstProductions()[a];return new Fi(d,t).startWalking()}},class La{initGastRecorder(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let t=0;t<10;t++){const a=t>0?t:"";this[`CONSUME${a}`]=function(u,d){return this.consumeInternalRecord(u,t,d)},this[`SUBRULE${a}`]=function(u,d){return this.subruleInternalRecord(u,t,d)},this[`OPTION${a}`]=function(u){return this.optionInternalRecord(u,t)},this[`OR${a}`]=function(u){return this.orInternalRecord(u,t)},this[`MANY${a}`]=function(u){this.manyInternalRecord(t,u)},this[`MANY_SEP${a}`]=function(u){this.manySepFirstInternalRecord(t,u)},this[`AT_LEAST_ONE${a}`]=function(u){this.atLeastOneInternalRecord(t,u)},this[`AT_LEAST_ONE_SEP${a}`]=function(u){this.atLeastOneSepFirstInternalRecord(t,u)}}this.consume=function(t,a,u){return this.consumeInternalRecord(a,t,u)},this.subrule=function(t,a,u){return this.subruleInternalRecord(a,t,u)},this.option=function(t,a){return this.optionInternalRecord(a,t)},this.or=function(t,a){return this.orInternalRecord(a,t)},this.many=function(t,a){this.manyInternalRecord(t,a)},this.atLeastOne=function(t,a){this.atLeastOneInternalRecord(t,a)},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",()=>{const t=this;for(let a=0;a<10;a++){const u=a>0?a:"";delete t[`CONSUME${u}`],delete t[`SUBRULE${u}`],delete t[`OPTION${u}`],delete t[`OR${u}`],delete t[`MANY${u}`],delete t[`MANY_SEP${u}`],delete t[`AT_LEAST_ONE${u}`],delete t[`AT_LEAST_ONE_SEP${u}`]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA})}ACTION_RECORD(t){}BACKTRACK_RECORD(t,a){return()=>!0}LA_RECORD(t){return Ci}topLevelRuleRecord(t,a){try{const u=new Je({definition:[],name:t});return u.name=t,this.recordingProdStack.push(u),a.call(this),this.recordingProdStack.pop(),u}catch(u){if(!0!==u.KNOWN_RECORDER_ERROR)try{u.message=u.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch{throw u}throw u}}optionInternalRecord(t,a){return rs.call(this,Z,t,a)}atLeastOneInternalRecord(t,a){rs.call(this,z,a,t)}atLeastOneSepFirstInternalRecord(t,a){rs.call(this,fe,a,t,true)}manyInternalRecord(t,a){rs.call(this,ce,a,t)}manySepFirstInternalRecord(t,a){rs.call(this,Ie,a,t,true)}orInternalRecord(t,a){return Pa.call(this,t,a)}subruleInternalRecord(t,a,u){if(Ii(a),!t||!1===(0,O.Z)(t,"ruleName")){const x=new Error(`<SUBRULE${Ia(a)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw x.KNOWN_RECORDER_ERROR=!0,x}const d=(0,un.Z)(this.recordingProdStack),p=t.ruleName,R=new Ze({idx:a,nonTerminalName:p,label:null==u?void 0:u.LABEL,referencedRule:void 0});return d.definition.push(R),this.outputCst?Oa:mt}consumeInternalRecord(t,a,u){if(Ii(a),!Ws(t)){const R=new Error(`<CONSUME${Ia(a)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw R.KNOWN_RECORDER_ERROR=!0,R}const d=(0,un.Z)(this.recordingProdStack),p=new Pe({idx:a,terminalType:t,label:null==u?void 0:u.LABEL});return d.definition.push(p),_a}},class wa{initPerformanceTracer(t){if((0,O.Z)(t,"traceInitPerf")){const a=t.traceInitPerf,u="number"==typeof a;this.traceInitMaxIdent=u?a:1/0,this.traceInitPerf=u?a>0:a}else this.traceInitMaxIdent=0,this.traceInitPerf=fn.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(t,a){if(!0===this.traceInitPerf){this.traceInitIndent++;const u=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${u}--\x3e <${t}>`);const{time:d,value:p}=Mr(a),R=d>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&R(`${u}<-- <${t}> time: ${d}ms`),this.traceInitIndent--,p}return a()}}]);class Da extends ss{constructor(t,a=fn){const u=(0,M.Z)(a);u.outputCst=!1,super(t,u)}}},58497:(Ae,V,g)=>{g.d(V,{Q:()=>Ri,T:()=>_i});var y=g(6152),L=g(47712),B=g(7657),k=g(48893);var M=g(9196),W=g(99211),F=g(76038);function A(i,e,n){return`${i.name}_${e}_${n}`}class ae{constructor(e){this.target=e}isEpsilon(){return!1}}class ue extends ae{constructor(e,n){super(e),this.tokenType=n}}class K extends ae{constructor(e){super(e)}isEpsilon(){return!0}}class te extends ae{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function de(i){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};!function ye(i,e){const n=e.length;for(let r=0;r<n;r++){const s=e[r],l=z(i,s,void 0,{type:2}),c=z(i,s,void 0,{type:7});l.stop=c,i.ruleToStartState.set(s,l),i.ruleToStopState.set(s,c)}}(e,i);const n=i.length;for(let r=0;r<n;r++){const s=i[r],l=_e(e,s,s);void 0!==l&&C(e,s,l)}return e}function Se(i,e,n){return n instanceof M.oI?Ze(i,e,n.terminalType,n):n instanceof M.Sj?function Je(i,e,n){const r=n.referencedRule,s=i.ruleToStartState.get(r),l=z(i,e,n,{type:1}),c=z(i,e,n,{type:1}),f=new te(s,r,c);return fe(l,f),{left:l,right:c}}(i,e,n):n instanceof M.ue?function oe(i,e,n){const r=z(i,e,n,{type:1});xe(i,r);const s=(0,W.Z)(n.definition,c=>Se(i,e,c));return De(i,e,r,n,...s)}(i,e,n):n instanceof M.Wx?function le(i,e,n){const r=z(i,e,n,{type:1});xe(i,r);const s=De(i,e,r,n,_e(i,e,n));return function Xe(i,e,n,r){const s=r.left,l=r.right;return Z(s,l),i.decisionMap[A(e,"Option",n.idx)]=s,r}(i,e,n,s)}(i,e,n):n instanceof M.hI?function Re(i,e,n){const r=z(i,e,n,{type:5});xe(i,r);const s=De(i,e,r,n,_e(i,e,n));return pe(i,e,n,s)}(i,e,n):n instanceof M.pT?function Be(i,e,n){const r=z(i,e,n,{type:5});xe(i,r);const s=De(i,e,r,n,_e(i,e,n)),l=Ze(i,e,n.separator,n);return pe(i,e,n,s,l)}(i,e,n):n instanceof M.ej?function ee(i,e,n){const r=z(i,e,n,{type:4});xe(i,r);const s=De(i,e,r,n,_e(i,e,n));return Te(i,e,n,s)}(i,e,n):n instanceof M.fK?function H(i,e,n){const r=z(i,e,n,{type:4});xe(i,r);const s=De(i,e,r,n,_e(i,e,n)),l=Ze(i,e,n.separator,n);return Te(i,e,n,s,l)}(i,e,n):_e(i,e,n)}function _e(i,e,n){const r=(0,F.Z)((0,W.Z)(n.definition,s=>Se(i,e,s)),s=>void 0!==s);return 1===r.length?r[0]:0===r.length?void 0:function lt(i,e){const n=e.length;for(let l=0;l<n-1;l++){const c=e[l];let f;1===c.left.transitions.length&&(f=c.left.transitions[0]);const _=f instanceof te,G=f,Y=e[l+1].left;1===c.left.type&&1===c.right.type&&void 0!==f&&(_&&G.followState===c.right||f.target===c.right)?(_?G.followState=Y:f.target=Y,ce(i,c.right)):Z(c.right,Y)}const r=e[0],s=e[n-1];return{left:r.left,right:s.right}}(i,r)}function Te(i,e,n,r,s){const l=r.left,c=r.right,f=z(i,e,n,{type:11});xe(i,f);const _=z(i,e,n,{type:12});return l.loopback=f,_.loopback=f,i.decisionMap[A(e,s?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=f,Z(c,f),void 0===s?(Z(f,l),Z(f,_)):(Z(f,_),Z(f,s.left),Z(s.right,l)),{left:l,right:_}}function pe(i,e,n,r,s){const l=r.left,c=r.right,f=z(i,e,n,{type:10});xe(i,f);const _=z(i,e,n,{type:12}),G=z(i,e,n,{type:9});return f.loopback=G,_.loopback=G,Z(f,l),Z(f,_),Z(c,G),void 0!==s?(Z(G,_),Z(G,s.left),Z(s.right,l)):Z(G,f),i.decisionMap[A(e,s?"RepetitionWithSeparator":"Repetition",n.idx)]=f,{left:f,right:_}}function xe(i,e){return i.decisionStates.push(e),e.decision=i.decisionStates.length-1,e.decision}function De(i,e,n,r,...s){const l=z(i,e,r,{type:8,start:n});n.end=l;for(const f of s)void 0!==f?(Z(n,f.left),Z(f.right,l)):Z(n,l);const c={left:n,right:l};return i.decisionMap[A(e,function tt(i){if(i instanceof M.ue)return"Alternation";if(i instanceof M.Wx)return"Option";if(i instanceof M.hI)return"Repetition";if(i instanceof M.pT)return"RepetitionWithSeparator";if(i instanceof M.ej)return"RepetitionMandatory";if(i instanceof M.fK)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}(r),r.idx)]=n,c}function Ze(i,e,n,r){const s=z(i,e,r,{type:1}),l=z(i,e,r,{type:1});return fe(s,new ue(l,n)),{left:s,right:l}}function C(i,e,n){const r=i.ruleToStartState.get(e);Z(r,n.left);const s=i.ruleToStopState.get(e);return Z(n.right,s),{left:r,right:s}}function Z(i,e){fe(i,new K(e))}function z(i,e,n,r){const s=Object.assign({atn:i,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:i.states.length},r);return i.states.push(s),s}function fe(i,e){0===i.transitions.length&&(i.epsilonOnlyTransitions=e.isEpsilon()),i.transitions.push(e)}function ce(i,e){i.states.splice(i.states.indexOf(e),1)}const Ie={};class ve{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=Pe(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return(0,W.Z)(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function Pe(i,e=!0){return`${e?`a${i.alt}`:""}s${i.state.stateNumber}:${i.stack.map(n=>n.stateNumber.toString()).join("_")}`}var Ot=g(48007),qt=g(53026),yt=g(65960),pn=g(8888);const In=function Ut(i,e){return i&&i.length?(0,pn.Z)(i,(0,yt.Z)(e,2)):[]};var Lt=g(28744),at=g(4509),Ft=g(80256),en=g(43408);function Gt(i,e){const n={};return r=>{const s=r.toString();let l=n[s];return void 0!==l||(l={atnStartState:i,decision:e,states:{}},n[s]=l),l}}class Cn{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=!0===this.predicates[r]?"1":"0";return e}}const We=new Cn;class xn extends M.dV{constructor(e){var n;super(),this.logging=null!==(n=null==e?void 0:e.logging)&&void 0!==n?n:r=>console.log(r)}initialize(e){this.atn=de(e.rules),this.dfas=function kn(i){const e=i.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=Gt(i.decisionStates[r],r);return n}(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:s,dynamicTokensEnabled:l}=e,c=this.dfas,f=this.logging,_=A(r,"Alternation",n),Y=this.atn.decisionMap[_].decision,ie=(0,W.Z)((0,M.oC)({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),re=>(0,W.Z)(re,J=>J[0]));if(Pt(ie,!1)&&!l){const re=(0,en.Z)(ie,(J,Ue,je)=>((0,at.Z)(Ue,et=>{et&&(J[et.tokenTypeIdx]=je,(0,at.Z)(et.categoryMatches,mt=>{J[mt]=je}))}),J),{});return s?function(J){var Ue;const je=this.LA(1),et=re[je.tokenTypeIdx];if(void 0!==J&&void 0!==et){const mt=null===(Ue=J[et])||void 0===Ue?void 0:Ue.GATE;if(void 0!==mt&&!1===mt.call(this))return}return et}:function(){const J=this.LA(1);return re[J.tokenTypeIdx]}}return s?function(re){const J=new Cn,Ue=void 0===re?0:re.length;for(let et=0;et<Ue;et++){const mt=null==re?void 0:re[et].GATE;J.set(et,void 0===mt||mt.call(this))}const je=Ct.call(this,c,Y,J,f);return"number"==typeof je?je:void 0}:function(){const re=Ct.call(this,c,Y,We,f);return"number"==typeof re?re:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:s,dynamicTokensEnabled:l}=e,c=this.dfas,f=this.logging,_=A(r,s,n),Y=this.atn.decisionMap[_].decision,ie=(0,W.Z)((0,M.oC)({maxLookahead:1,occurrence:n,prodType:s,rule:r}),re=>(0,W.Z)(re,J=>J[0]));if(Pt(ie)&&ie[0][0]&&!l){const re=ie[0],J=(0,Lt.Z)(re);if(1===J.length&&(0,Ft.Z)(J[0].categoryMatches)){const je=J[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===je}}{const Ue=(0,en.Z)(J,(je,et)=>(void 0!==et&&(je[et.tokenTypeIdx]=!0,(0,at.Z)(et.categoryMatches,mt=>{je[mt]=!0})),je),{});return function(){const je=this.LA(1);return!0===Ue[je.tokenTypeIdx]}}}return function(){const re=Ct.call(this,c,Y,We,f);return"object"!=typeof re&&0===re}}}function Pt(i,e=!0){const n=new Set;for(const r of i){const s=new Set;for(const l of r){if(void 0===l){if(e)break;return!1}const c=[l.tokenTypeIdx].concat(l.categoryMatches);for(const f of c)if(n.has(f)){if(!s.has(f))return!1}else n.add(f),s.add(f)}}return!0}function Ct(i,e,n,r){const s=i[e](n);let l=s.start;if(void 0===l){const f=function Tt(i){const e=new ve,n=i.transitions.length;for(let r=0;r<n;r++){mn({state:i.transitions[r].target,alt:r,stack:[]},e)}return e}(s.atnStartState);l=ct(s,Ht(f)),s.start=l}return Fn.apply(this,[s,l,n,r])}function Fn(i,e,n,r){let s=e,l=1;const c=[];let f=this.LA(l++);for(;;){let _=Bn(s,f);if(void 0===_&&(_=Bt.apply(this,[i,s,f,l,n,r])),_===Ie)return Kt(c,s,f);if(!0===_.isAcceptState)return _.prediction;s=_,c.push(f),f=this.LA(l++)}}function Bt(i,e,n,r,s,l){const c=function jt(i,e,n){const r=new ve,s=[];for(const c of i.elements){if(!1===n.is(c.alt))continue;if(7===c.state.type){s.push(c);continue}const f=c.state.transitions.length;for(let _=0;_<f;_++){const Y=ut(c.state.transitions[_],e);void 0!==Y&&r.add({state:Y,alt:c.alt,stack:c.stack})}}let l;if(0===s.length&&1===r.size&&(l=r),void 0===l){l=new ve;for(const c of r.elements)mn(c,l)}if(s.length>0&&!function zt(i){for(const e of i.elements)if(7===e.state.type)return!0;return!1}(l))for(const c of s)l.add(c);return l}(e.configs,n,s);if(0===c.size)return kt(i,e,n,Ie),Ie;let f=Ht(c);const _=function Vt(i,e){let n;for(const r of i.elements)if(!0===e.is(r.alt))if(void 0===n)n=r.alt;else if(n!==r.alt)return;return n}(c,s);if(void 0!==_)f.isAcceptState=!0,f.prediction=_,f.configs.uniqueAlt=_;else if(function Yt(i){if(function ht(i){for(const e of i.elements)if(7!==e.state.type)return!1;return!0}(i))return!0;const e=function Et(i){const e=new Map;for(const n of i){const r=Pe(n,!1);let s=e.get(r);void 0===s&&(s={},e.set(r,s)),s[n.alt]=!0}return e}(i.elements);return function be(i){for(const e of Array.from(i.values()))if(Object.keys(e).length>1)return!0;return!1}(e)&&!function we(i){for(const e of Array.from(i.values()))if(1===Object.keys(e).length)return!0;return!1}(e)}(c)){const G=(0,Ot.Z)(c.alts);f.isAcceptState=!0,f.prediction=G,f.configs.uniqueAlt=G,nt.apply(this,[i,r,c.alts,l])}return f=kt(i,e,n,f),f}function nt(i,e,n,r){const s=[];for(let G=1;G<=e;G++)s.push(this.LA(G).tokenType);const l=i.atnStartState,_=function Wt(i){const e=(0,W.Z)(i.prefixPath,s=>(0,M.l$)(s)).join(", "),n=0===i.production.idx?"":i.production.idx;let r=`Ambiguous Alternatives Detected: <${i.ambiguityIndices.join(", ")}> in <${function Gn(i){if(i instanceof M.Sj)return"SUBRULE";if(i instanceof M.Wx)return"OPTION";if(i instanceof M.ue)return"OR";if(i instanceof M.ej)return"AT_LEAST_ONE";if(i instanceof M.fK)return"AT_LEAST_ONE_SEP";if(i instanceof M.pT)return"MANY_SEP";if(i instanceof M.hI)return"MANY";if(i instanceof M.oI)return"CONSUME";throw Error("non exhaustive match")}(i.production)}${n}> inside <${i.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r}({topLevelRule:l.rule,ambiguityIndices:n,production:l.production,prefixPath:s});r(_)}function Kt(i,e,n){const r=(0,qt.Z)(e.configs.elements,l=>l.state.transitions);return{actualToken:n,possibleTokenTypes:In(r.filter(l=>l instanceof ue).map(l=>l.tokenType),l=>l.tokenTypeIdx),tokenPath:i}}function Bn(i,e){return i.edges[e.tokenTypeIdx]}function ut(i,e){if(i instanceof ue&&(0,M.ol)(e,i.tokenType))return i.target}function Ht(i){return{configs:i,edges:{},isAcceptState:!1,prediction:-1}}function kt(i,e,n,r){return r=ct(i,r),e.edges[n.tokenTypeIdx]=r,r}function ct(i,e){if(e===Ie)return e;const n=e.configs.key,r=i.states[n];return void 0!==r?r:(e.configs.finalize(),i.states[n]=e,e)}function mn(i,e){const n=i.state;if(7===n.type){if(i.stack.length>0){const s=[...i.stack];mn({state:s.pop(),alt:i.alt,stack:s},e)}else e.add(i);return}n.epsilonOnlyTransitions||e.add(i);const r=n.transitions.length;for(let s=0;s<r;s++){const c=vt(i,n.transitions[s]);void 0!==c&&mn(c,e)}}function vt(i,e){if(e instanceof K)return{state:e.target,alt:i.alt,stack:i.stack};if(e instanceof te){const n=[...i.stack,e.followState];return{state:e.target,alt:i.alt,stack:n}}}var ze,st,rt,Sn,Me,ne,j,wt,Qe,tn,us,cs,Sr,dt,At,ds,fs,rr,Nn,Xt,$n,ot,nn,sr,On,Wn,rn,Nr,gn,ir,Kn,jn,$r,an,ps,Or,Vn,ms,ar,Hn,gs,Lr,Ln,ys,or,on,Pn,zn,Yn,Ni,$i,Ts,vs,Es,lr,As,Rs,_s,Is,Cs,xs,ks,Ss,Ns,$s,Os,Ls,Ps,ur,cr,ws,Ms,bs,Pr,Ds,Zs,wr,Us,ge=g(65406);(ze||(ze={})).is=function e(n){return"string"==typeof n},function(i){i.is=function e(n){return"string"==typeof n}}(st||(st={})),function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647,i.is=function e(n){return"number"==typeof n&&i.MIN_VALUE<=n&&n<=i.MAX_VALUE}}(rt||(rt={})),function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647,i.is=function e(n){return"number"==typeof n&&i.MIN_VALUE<=n&&n<=i.MAX_VALUE}}(Sn||(Sn={})),function(i){i.create=function e(r,s){return r===Number.MAX_VALUE&&(r=Sn.MAX_VALUE),s===Number.MAX_VALUE&&(s=Sn.MAX_VALUE),{line:r,character:s}},i.is=function n(r){let s=r;return w.objectLiteral(s)&&w.uinteger(s.line)&&w.uinteger(s.character)}}(Me||(Me={})),function(i){i.create=function e(r,s,l,c){if(w.uinteger(r)&&w.uinteger(s)&&w.uinteger(l)&&w.uinteger(c))return{start:Me.create(r,s),end:Me.create(l,c)};if(Me.is(r)&&Me.is(s))return{start:r,end:s};throw new Error(`Range#create called with invalid arguments[${r}, ${s}, ${l}, ${c}]`)},i.is=function n(r){let s=r;return w.objectLiteral(s)&&Me.is(s.start)&&Me.is(s.end)}}(ne||(ne={})),function(i){i.create=function e(r,s){return{uri:r,range:s}},i.is=function n(r){let s=r;return w.objectLiteral(s)&&ne.is(s.range)&&(w.string(s.uri)||w.undefined(s.uri))}}(j||(j={})),function(i){i.create=function e(r,s,l,c){return{targetUri:r,targetRange:s,targetSelectionRange:l,originSelectionRange:c}},i.is=function n(r){let s=r;return w.objectLiteral(s)&&ne.is(s.targetRange)&&w.string(s.targetUri)&&ne.is(s.targetSelectionRange)&&(ne.is(s.originSelectionRange)||w.undefined(s.originSelectionRange))}}(wt||(wt={})),function(i){i.create=function e(r,s,l,c){return{red:r,green:s,blue:l,alpha:c}},i.is=function n(r){const s=r;return w.objectLiteral(s)&&w.numberRange(s.red,0,1)&&w.numberRange(s.green,0,1)&&w.numberRange(s.blue,0,1)&&w.numberRange(s.alpha,0,1)}}(Qe||(Qe={})),function(i){i.create=function e(r,s){return{range:r,color:s}},i.is=function n(r){const s=r;return w.objectLiteral(s)&&ne.is(s.range)&&Qe.is(s.color)}}(tn||(tn={})),function(i){i.create=function e(r,s,l){return{label:r,textEdit:s,additionalTextEdits:l}},i.is=function n(r){const s=r;return w.objectLiteral(s)&&w.string(s.label)&&(w.undefined(s.textEdit)||Xt.is(s))&&(w.undefined(s.additionalTextEdits)||w.typedArray(s.additionalTextEdits,Xt.is))}}(us||(us={})),function(i){i.Comment="comment",i.Imports="imports",i.Region="region"}(cs||(cs={})),function(i){i.create=function e(r,s,l,c,f,_){const G={startLine:r,endLine:s};return w.defined(l)&&(G.startCharacter=l),w.defined(c)&&(G.endCharacter=c),w.defined(f)&&(G.kind=f),w.defined(_)&&(G.collapsedText=_),G},i.is=function n(r){const s=r;return w.objectLiteral(s)&&w.uinteger(s.startLine)&&w.uinteger(s.startLine)&&(w.undefined(s.startCharacter)||w.uinteger(s.startCharacter))&&(w.undefined(s.endCharacter)||w.uinteger(s.endCharacter))&&(w.undefined(s.kind)||w.string(s.kind))}}(Sr||(Sr={})),function(i){i.create=function e(r,s){return{location:r,message:s}},i.is=function n(r){let s=r;return w.defined(s)&&j.is(s.location)&&w.string(s.message)}}(dt||(dt={})),function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4}(At||(At={})),function(i){i.Unnecessary=1,i.Deprecated=2}(ds||(ds={})),function(i){i.is=function e(n){const r=n;return w.objectLiteral(r)&&w.string(r.href)}}(fs||(fs={})),function(i){i.create=function e(r,s,l,c,f,_){let G={range:r,message:s};return w.defined(l)&&(G.severity=l),w.defined(c)&&(G.code=c),w.defined(f)&&(G.source=f),w.defined(_)&&(G.relatedInformation=_),G},i.is=function n(r){var s;let l=r;return w.defined(l)&&ne.is(l.range)&&w.string(l.message)&&(w.number(l.severity)||w.undefined(l.severity))&&(w.integer(l.code)||w.string(l.code)||w.undefined(l.code))&&(w.undefined(l.codeDescription)||w.string(null===(s=l.codeDescription)||void 0===s?void 0:s.href))&&(w.string(l.source)||w.undefined(l.source))&&(w.undefined(l.relatedInformation)||w.typedArray(l.relatedInformation,dt.is))}}(rr||(rr={})),function(i){i.create=function e(r,s,...l){let c={title:r,command:s};return w.defined(l)&&l.length>0&&(c.arguments=l),c},i.is=function n(r){let s=r;return w.defined(s)&&w.string(s.title)&&w.string(s.command)}}(Nn||(Nn={})),function(i){i.replace=function e(l,c){return{range:l,newText:c}},i.insert=function n(l,c){return{range:{start:l,end:l},newText:c}},i.del=function r(l){return{range:l,newText:""}},i.is=function s(l){const c=l;return w.objectLiteral(c)&&w.string(c.newText)&&ne.is(c.range)}}(Xt||(Xt={})),function(i){i.create=function e(r,s,l){const c={label:r};return void 0!==s&&(c.needsConfirmation=s),void 0!==l&&(c.description=l),c},i.is=function n(r){const s=r;return w.objectLiteral(s)&&w.string(s.label)&&(w.boolean(s.needsConfirmation)||void 0===s.needsConfirmation)&&(w.string(s.description)||void 0===s.description)}}($n||($n={})),function(i){i.is=function e(n){const r=n;return w.string(r)}}(ot||(ot={})),function(i){i.replace=function e(l,c,f){return{range:l,newText:c,annotationId:f}},i.insert=function n(l,c,f){return{range:{start:l,end:l},newText:c,annotationId:f}},i.del=function r(l,c){return{range:l,newText:"",annotationId:c}},i.is=function s(l){const c=l;return Xt.is(c)&&($n.is(c.annotationId)||ot.is(c.annotationId))}}(nn||(nn={})),function(i){i.create=function e(r,s){return{textDocument:r,edits:s}},i.is=function n(r){let s=r;return w.defined(s)&&Kn.is(s.textDocument)&&Array.isArray(s.edits)}}(sr||(sr={})),function(i){i.create=function e(r,s,l){let c={kind:"create",uri:r};return void 0!==s&&(void 0!==s.overwrite||void 0!==s.ignoreIfExists)&&(c.options=s),void 0!==l&&(c.annotationId=l),c},i.is=function n(r){let s=r;return s&&"create"===s.kind&&w.string(s.uri)&&(void 0===s.options||(void 0===s.options.overwrite||w.boolean(s.options.overwrite))&&(void 0===s.options.ignoreIfExists||w.boolean(s.options.ignoreIfExists)))&&(void 0===s.annotationId||ot.is(s.annotationId))}}(On||(On={})),function(i){i.create=function e(r,s,l,c){let f={kind:"rename",oldUri:r,newUri:s};return void 0!==l&&(void 0!==l.overwrite||void 0!==l.ignoreIfExists)&&(f.options=l),void 0!==c&&(f.annotationId=c),f},i.is=function n(r){let s=r;return s&&"rename"===s.kind&&w.string(s.oldUri)&&w.string(s.newUri)&&(void 0===s.options||(void 0===s.options.overwrite||w.boolean(s.options.overwrite))&&(void 0===s.options.ignoreIfExists||w.boolean(s.options.ignoreIfExists)))&&(void 0===s.annotationId||ot.is(s.annotationId))}}(Wn||(Wn={})),function(i){i.create=function e(r,s,l){let c={kind:"delete",uri:r};return void 0!==s&&(void 0!==s.recursive||void 0!==s.ignoreIfNotExists)&&(c.options=s),void 0!==l&&(c.annotationId=l),c},i.is=function n(r){let s=r;return s&&"delete"===s.kind&&w.string(s.uri)&&(void 0===s.options||(void 0===s.options.recursive||w.boolean(s.options.recursive))&&(void 0===s.options.ignoreIfNotExists||w.boolean(s.options.ignoreIfNotExists)))&&(void 0===s.annotationId||ot.is(s.annotationId))}}(rn||(rn={})),function(i){i.is=function e(n){let r=n;return r&&(void 0!==r.changes||void 0!==r.documentChanges)&&(void 0===r.documentChanges||r.documentChanges.every(s=>w.string(s.kind)?On.is(s)||Wn.is(s)||rn.is(s):sr.is(s)))}}(Nr||(Nr={}));!function(i){i.create=function e(r){return{uri:r}},i.is=function n(r){let s=r;return w.defined(s)&&w.string(s.uri)}}(gn||(gn={})),function(i){i.create=function e(r,s){return{uri:r,version:s}},i.is=function n(r){let s=r;return w.defined(s)&&w.string(s.uri)&&w.integer(s.version)}}(ir||(ir={})),function(i){i.create=function e(r,s){return{uri:r,version:s}},i.is=function n(r){let s=r;return w.defined(s)&&w.string(s.uri)&&(null===s.version||w.integer(s.version))}}(Kn||(Kn={})),function(i){i.create=function e(r,s,l,c){return{uri:r,languageId:s,version:l,text:c}},i.is=function n(r){let s=r;return w.defined(s)&&w.string(s.uri)&&w.string(s.languageId)&&w.integer(s.version)&&w.string(s.text)}}(jn||(jn={})),function(i){i.PlainText="plaintext",i.Markdown="markdown",i.is=function e(n){const r=n;return r===i.PlainText||r===i.Markdown}}($r||($r={})),function(i){i.is=function e(n){const r=n;return w.objectLiteral(n)&&$r.is(r.kind)&&w.string(r.value)}}(an||(an={})),function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25}(ps||(ps={})),function(i){i.PlainText=1,i.Snippet=2}(Or||(Or={})),function(i){i.Deprecated=1}(Vn||(Vn={})),function(i){i.create=function e(r,s,l){return{newText:r,insert:s,replace:l}},i.is=function n(r){const s=r;return s&&w.string(s.newText)&&ne.is(s.insert)&&ne.is(s.replace)}}(ms||(ms={})),function(i){i.asIs=1,i.adjustIndentation=2}(ar||(ar={})),function(i){i.is=function e(n){const r=n;return r&&(w.string(r.detail)||void 0===r.detail)&&(w.string(r.description)||void 0===r.description)}}(Hn||(Hn={})),function(i){i.create=function e(n){return{label:n}}}(gs||(gs={})),function(i){i.create=function e(n,r){return{items:n||[],isIncomplete:!!r}}}(Lr||(Lr={})),function(i){i.fromPlainText=function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},i.is=function n(r){const s=r;return w.string(s)||w.objectLiteral(s)&&w.string(s.language)&&w.string(s.value)}}(Ln||(Ln={})),function(i){i.is=function e(n){let r=n;return!!r&&w.objectLiteral(r)&&(an.is(r.contents)||Ln.is(r.contents)||w.typedArray(r.contents,Ln.is))&&(void 0===n.range||ne.is(n.range))}}(ys||(ys={})),function(i){i.create=function e(n,r){return r?{label:n,documentation:r}:{label:n}}}(or||(or={})),function(i){i.create=function e(n,r,...s){let l={label:n};return w.defined(r)&&(l.documentation=r),w.defined(s)?l.parameters=s:l.parameters=[],l}}(on||(on={})),function(i){i.Text=1,i.Read=2,i.Write=3}(Pn||(Pn={})),function(i){i.create=function e(n,r){let s={range:n};return w.number(r)&&(s.kind=r),s}}(zn||(zn={})),function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26}(Yn||(Yn={})),function(i){i.Deprecated=1}(Ni||(Ni={})),function(i){i.create=function e(n,r,s,l,c){let f={name:n,kind:r,location:{uri:l,range:s}};return c&&(f.containerName=c),f}}($i||($i={})),function(i){i.create=function e(n,r,s,l){return void 0!==l?{name:n,kind:r,location:{uri:s,range:l}}:{name:n,kind:r,location:{uri:s}}}}(Ts||(Ts={})),function(i){i.create=function e(r,s,l,c,f,_){let G={name:r,detail:s,kind:l,range:c,selectionRange:f};return void 0!==_&&(G.children=_),G},i.is=function n(r){let s=r;return s&&w.string(s.name)&&w.number(s.kind)&&ne.is(s.range)&&ne.is(s.selectionRange)&&(void 0===s.detail||w.string(s.detail))&&(void 0===s.deprecated||w.boolean(s.deprecated))&&(void 0===s.children||Array.isArray(s.children))&&(void 0===s.tags||Array.isArray(s.tags))}}(vs||(vs={})),function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"}(Es||(Es={})),function(i){i.Invoked=1,i.Automatic=2}(lr||(lr={})),function(i){i.create=function e(r,s,l){let c={diagnostics:r};return null!=s&&(c.only=s),null!=l&&(c.triggerKind=l),c},i.is=function n(r){let s=r;return w.defined(s)&&w.typedArray(s.diagnostics,rr.is)&&(void 0===s.only||w.typedArray(s.only,w.string))&&(void 0===s.triggerKind||s.triggerKind===lr.Invoked||s.triggerKind===lr.Automatic)}}(As||(As={})),function(i){i.create=function e(r,s,l){let c={title:r},f=!0;return"string"==typeof s?(f=!1,c.kind=s):Nn.is(s)?c.command=s:c.edit=s,f&&void 0!==l&&(c.kind=l),c},i.is=function n(r){let s=r;return s&&w.string(s.title)&&(void 0===s.diagnostics||w.typedArray(s.diagnostics,rr.is))&&(void 0===s.kind||w.string(s.kind))&&(void 0!==s.edit||void 0!==s.command)&&(void 0===s.command||Nn.is(s.command))&&(void 0===s.isPreferred||w.boolean(s.isPreferred))&&(void 0===s.edit||Nr.is(s.edit))}}(Rs||(Rs={})),function(i){i.create=function e(r,s){let l={range:r};return w.defined(s)&&(l.data=s),l},i.is=function n(r){let s=r;return w.defined(s)&&ne.is(s.range)&&(w.undefined(s.command)||Nn.is(s.command))}}(_s||(_s={})),function(i){i.create=function e(r,s){return{tabSize:r,insertSpaces:s}},i.is=function n(r){let s=r;return w.defined(s)&&w.uinteger(s.tabSize)&&w.boolean(s.insertSpaces)}}(Is||(Is={})),function(i){i.create=function e(r,s,l){return{range:r,target:s,data:l}},i.is=function n(r){let s=r;return w.defined(s)&&ne.is(s.range)&&(w.undefined(s.target)||w.string(s.target))}}(Cs||(Cs={})),function(i){i.create=function e(r,s){return{range:r,parent:s}},i.is=function n(r){let s=r;return w.objectLiteral(s)&&ne.is(s.range)&&(void 0===s.parent||i.is(s.parent))}}(xs||(xs={})),function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"}(ks||(ks={})),function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"}(Ss||(Ss={})),function(i){i.is=function e(n){const r=n;return w.objectLiteral(r)&&(void 0===r.resultId||"string"==typeof r.resultId)&&Array.isArray(r.data)&&(0===r.data.length||"number"==typeof r.data[0])}}(Ns||(Ns={})),function(i){i.create=function e(r,s){return{range:r,text:s}},i.is=function n(r){const s=r;return null!=s&&ne.is(s.range)&&w.string(s.text)}}($s||($s={})),function(i){i.create=function e(r,s,l){return{range:r,variableName:s,caseSensitiveLookup:l}},i.is=function n(r){const s=r;return null!=s&&ne.is(s.range)&&w.boolean(s.caseSensitiveLookup)&&(w.string(s.variableName)||void 0===s.variableName)}}(Os||(Os={})),function(i){i.create=function e(r,s){return{range:r,expression:s}},i.is=function n(r){const s=r;return null!=s&&ne.is(s.range)&&(w.string(s.expression)||void 0===s.expression)}}(Ls||(Ls={})),function(i){i.create=function e(r,s){return{frameId:r,stoppedLocation:s}},i.is=function n(r){const s=r;return w.defined(s)&&ne.is(r.stoppedLocation)}}(Ps||(Ps={})),function(i){i.Type=1,i.Parameter=2,i.is=function e(n){return 1===n||2===n}}(ur||(ur={})),function(i){i.create=function e(r){return{value:r}},i.is=function n(r){const s=r;return w.objectLiteral(s)&&(void 0===s.tooltip||w.string(s.tooltip)||an.is(s.tooltip))&&(void 0===s.location||j.is(s.location))&&(void 0===s.command||Nn.is(s.command))}}(cr||(cr={})),function(i){i.create=function e(r,s,l){const c={position:r,label:s};return void 0!==l&&(c.kind=l),c},i.is=function n(r){const s=r;return w.objectLiteral(s)&&Me.is(s.position)&&(w.string(s.label)||w.typedArray(s.label,cr.is))&&(void 0===s.kind||ur.is(s.kind))&&void 0===s.textEdits||w.typedArray(s.textEdits,Xt.is)&&(void 0===s.tooltip||w.string(s.tooltip)||an.is(s.tooltip))&&(void 0===s.paddingLeft||w.boolean(s.paddingLeft))&&(void 0===s.paddingRight||w.boolean(s.paddingRight))}}(ws||(ws={})),function(i){i.createSnippet=function e(n){return{kind:"snippet",value:n}}}(Ms||(Ms={})),function(i){i.create=function e(n,r,s,l){return{insertText:n,filterText:r,range:s,command:l}}}(bs||(bs={})),function(i){i.create=function e(n){return{items:n}}}(Pr||(Pr={})),function(i){i.Invoked=0,i.Automatic=1}(Ds||(Ds={})),function(i){i.create=function e(n,r){return{range:n,text:r}}}(Zs||(Zs={})),function(i){i.create=function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}}(wr||(wr={})),function(i){i.is=function e(n){const r=n;return w.objectLiteral(r)&&st.is(r.uri)&&w.string(r.name)}}(Us||(Us={}));var dr,w;!function(i){function s(l,c){if(l.length<=1)return l;const f=l.length/2|0,_=l.slice(0,f),G=l.slice(f);s(_,c),s(G,c);let Y=0,ie=0,re=0;for(;Y<_.length&&ie<G.length;)c(_[Y],G[ie])<=0?l[re++]=_[Y++]:l[re++]=G[ie++];for(;Y<_.length;)l[re++]=_[Y++];for(;ie<G.length;)l[re++]=G[ie++];return l}i.create=function e(l,c,f,_){return new Xn(l,c,f,_)},i.is=function n(l){let c=l;return!!(w.defined(c)&&w.string(c.uri)&&(w.undefined(c.languageId)||w.string(c.languageId))&&w.uinteger(c.lineCount)&&w.func(c.getText)&&w.func(c.positionAt)&&w.func(c.offsetAt))},i.applyEdits=function r(l,c){let f=l.getText(),_=s(c,(Y,ie)=>{let re=Y.range.start.line-ie.range.start.line;return 0===re?Y.range.start.character-ie.range.start.character:re}),G=f.length;for(let Y=_.length-1;Y>=0;Y--){let ie=_[Y],re=l.offsetAt(ie.range.start),J=l.offsetAt(ie.range.end);if(!(J<=G))throw new Error("Overlapping edit");f=f.substring(0,re)+ie.newText+f.substring(J,f.length),G=re}return f}}(dr||(dr={}));class Xn{constructor(e,n,r,s){this._uri=e,this._languageId=n,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(void 0===this._lineOffsets){let e=[],n=this._content,r=!0;for(let s=0;s<n.length;s++){r&&(e.push(s),r=!1);let l=n.charAt(s);r="\r"===l||"\n"===l,"\r"===l&&s+1<n.length&&"\n"===n.charAt(s+1)&&s++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,s=n.length;if(0===s)return Me.create(0,e);for(;r<s;){let c=Math.floor((r+s)/2);n[c]>e?s=c:r=c+1}let l=r-1;return Me.create(l,e-n[l])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],s=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,s),r)}get lineCount(){return this.getLineOffsets().length}}!function(i){const e=Object.prototype.toString;i.defined=function n(J){return typeof J<"u"},i.undefined=function r(J){return typeof J>"u"},i.boolean=function s(J){return!0===J||!1===J},i.string=function l(J){return"[object String]"===e.call(J)},i.number=function c(J){return"[object Number]"===e.call(J)},i.numberRange=function f(J,Ue,je){return"[object Number]"===e.call(J)&&Ue<=J&&J<=je},i.integer=function _(J){return"[object Number]"===e.call(J)&&-2147483648<=J&&J<=2147483647},i.uinteger=function G(J){return"[object Number]"===e.call(J)&&0<=J&&J<=2147483647},i.func=function Y(J){return"[object Function]"===e.call(J)},i.objectLiteral=function ie(J){return null!==J&&"object"==typeof J},i.typedArray=function re(J,Ue){return Array.isArray(J)&&J.every(Ue)}}(w||(w={}));class ln{constructor(){this.nodeStack=[]}get current(){var e;return null!==(e=this.nodeStack[this.nodeStack.length-1])&&void 0!==e?e:this.rootNode}buildRootNode(e){return this.rootNode=new Mr(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new qe;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new fr(e.startOffset,e.image.length,(0,y.sp)(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const l of e){const c=new fr(l.startOffset,l.image.length,(0,y.sp)(l),l.tokenType,!0);c.root=this.rootNode,n.push(c)}let r=this.current,s=!1;if(r.content.length>0)r.content.push(...n);else{for(;r.container;){const l=r.container.content.indexOf(r);if(l>0){r.container.content.splice(l,0,...n),s=!0;break}r=r.container}s||this.rootNode.content.unshift(...n)}}construct(e){const n=this.current;"string"==typeof e.$type&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();0===(null==r?void 0:r.content.length)&&this.removeNode(r)}}class Fs{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,n;const r="string"==typeof(null===(e=this._astNode)||void 0===e?void 0:e.$type)?this._astNode:null===(n=this.container)||void 0===n?void 0:n.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class fr extends Fs{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,n,r,s,l=!1){super(),this._hidden=l,this._offset=e,this._tokenType=s,this._length=n,this._range=r}}class qe extends Fs{constructor(){super(...arguments),this.content=new un(this)}get children(){return this.content}get offset(){var e,n;return null!==(n=null===(e=this.firstNonHiddenNode)||void 0===e?void 0:e.offset)&&void 0!==n?n:0}get length(){return this.end-this.offset}get end(){var e,n;return null!==(n=null===(e=this.lastNonHiddenNode)||void 0===e?void 0:e.end)&&void 0!==n?n:0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(void 0===this._rangeCache){const{range:r}=e,{range:s}=n;this._rangeCache={start:r.start,end:s.end.line<r.start.line?r.start:s.end}}return this._rangeCache}return{start:Me.create(0,0),end:Me.create(0,0)}}get firstNonHiddenNode(){for(const 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--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class un extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,un.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class Mr extends qe{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const yn=Symbol("Datatype");function wn(i){return i.$type===yn}const Dr=i=>i.endsWith("\u200b")?i:i+"\u200b";class Mn{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r="production"===e.LanguageMetaData.mode;this.wrapper=new Ws(n,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Li extends Mn{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new ln,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e),s=this.wrapper.DEFINE_RULE(Dr(e.name),this.startImplementation(r,n).bind(this));return this.allRules.set(e.name,s),e.entry&&(this.mainRule=s),s}computeRuleType(e){if(!e.fragment){if((0,L.UP)(e))return yn;return(0,L.$G)(e)??e.name}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const s=n.rule?this.allRules.get(n.rule):this.mainRule;if(!s)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const l=s.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:l,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{const s=!this.isRecording()&&void 0!==e;if(s){const c={$type:e};this.stack.push(c),e===yn&&(c.value="")}let l;try{l=n(r)}catch{l=void 0}return void 0===l&&s&&(l=this.construct()),l}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;for(let s=0;s<n.length;s++)if(n[s].startOffset>r)return n.splice(0,s);return n.splice(0,n.length)}consume(e,n,r){const s=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(s)){const l=this.extractHiddenTokens(s);this.nodeBuilder.addHiddenNodes(l);const c=this.nodeBuilder.buildLeafNode(s,r),{assignment:f,isCrossRef:_}=this.getAssignment(r),G=this.current;if(f){const Y=(0,k.p1)(r)?s.image:this.converter.convert(s.image,c);this.assign(f.operator,f.feature,Y,c,_)}else if(wn(G)){let Y=s.image;(0,k.p1)(r)||(Y=this.converter.convert(Y,c).toString()),G.value+=Y}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&"number"==typeof e.endOffset&&!isNaN(e.endOffset)}subrule(e,n,r,s,l){let c;!this.isRecording()&&!r&&(c=this.nodeBuilder.buildCompositeNode(s));const f=this.wrapper.wrapSubrule(e,n,l);!this.isRecording()&&c&&c.length>0&&this.performSubruleAssignment(f,s,c)}performSubruleAssignment(e,n,r){const{assignment:s,isCrossRef:l}=this.getAssignment(n);if(s)this.assign(s.operator,s.feature,e,r,l);else if(!s){const c=this.current;if(wn(c))c.value+=e.toString();else if("object"==typeof e&&e){const _=this.assignWithoutOverride(e,c);this.stack.pop(),this.stack.push(_)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const l={$type:e};this.stack.push(l),this.assign(n.operator,n.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return(0,ge.b2)(e),this.nodeBuilder.construct(e),this.stack.pop(),wn(e)?this.converter.convert(e.value,e.$cstNode):((0,ge.a1)(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=(0,ge.V_)(e,k.B7);this.assignmentMap.set(e,{assignment:n,isCrossRef:!!n&&(0,k.Ki)(n.terminal)})}return this.assignmentMap.get(e)}assign(e,n,r,s,l){const c=this.current;let f;switch(f=l&&"string"==typeof r?this.linker.buildReference(c,n,s,r):r,e){case"=":c[n]=f;break;case"?=":c[n]=!0;break;case"+=":Array.isArray(c[n])||(c[n]=[]),c[n].push(f)}}assignWithoutOverride(e,n){for(const[s,l]of Object.entries(n)){const c=e[s];void 0===c?e[s]=l:Array.isArray(c)&&Array.isArray(l)&&(l.push(...c),e[s]=l)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class Gs extends class Pi{buildMismatchTokenMessage(e){return M.Hs.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return M.Hs.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return M.Hs.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return M.Hs.buildEarlyExitMessage(e)}}{buildMismatchTokenMessage({expected:e,actual:n}){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 \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class wi extends Mn{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.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,n){const r=this.wrapper.DEFINE_RULE(Dr(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,s,l){this.before(s),this.wrapper.wrapSubrule(e,n,l),this.after(s)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const Bs={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Gs};class Ws extends M.nu{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},Bs),{lookaheadStrategy:r?new M.dV({maxLookahead:n.maxLookahead}):new xn({logging:n.skipValidations?()=>{}:void 0})}),n))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n){return this.RULE(e,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}var Tn=g(4408),it=g(5364);function Ks(i,e,n){return function Mi(i,e){const n=(0,L.VD)(e,!1),r=(0,it.Vw)(e.rules).filter(k.F9).filter(s=>n.has(s));for(const s of r){const l=Object.assign(Object.assign({},i),{consume:1,optional:1,subrule:1,many:1,or:1});i.parser.rule(s,cn(l,s.definition))}}({parser:e,tokens:n,ruleNames:new Map},i),e}function cn(i,e,n=!1){let r;if((0,k.p1)(e))r=function Vs(i,e){const n=i.consume++,r=i.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>i.parser.consume(n,r,e)}(i,e);else if((0,k.LG)(e))r=function Ye(i,e){const n=(0,L.z$)(e);return()=>i.parser.action(n,e)}(i,e);else if((0,k.B7)(e))r=cn(i,e.terminal);else if((0,k.Ki)(e))r=Zr(i,e);else if((0,k.t3)(e))r=function Jn(i,e){const n=e.rule.ref;if((0,k.F9)(n)){const r=i.subrule++,s=n.fragment,l=e.arguments.length>0?function Rt(i,e){const n=e.map(r=>pt(r.value));return r=>{const s={};for(let l=0;l<n.length;l++){const c=i.parameters[l],f=n[l];s[c.name]=f(r)}return s}}(n,e.arguments):()=>({});return c=>i.parser.subrule(r,Fr(i,n),s,e,l(c))}if((0,k.MS)(n)){const r=i.consume++,s=hr(i,n.name);return()=>i.parser.consume(r,s,e)}if(!n)throw new Tn.h(e.$cstNode,`Undefined rule: ${e.rule.$refText}`);(0,Tn.U)(n)}(i,e);else if((0,k.MZ)(e))r=function ma(i,e){if(1===e.elements.length)return cn(i,e.elements[0]);{const n=[];for(const s of e.elements){const l={ALT:cn(i,s,!0)},c=Qn(s);c&&(l.GATE=pt(c)),n.push(l)}const r=i.or++;return s=>i.parser.alternatives(r,n.map(l=>{const c={ALT:()=>l.ALT(s)},f=l.GATE;return f&&(c.GATE=()=>f(s)),c}))}}(i,e);else if((0,k.W1)(e))r=function js(i,e){if(1===e.elements.length)return cn(i,e.elements[0]);const n=[];for(const f of e.elements){const _={ALT:cn(i,f,!0)},G=Qn(f);G&&(_.GATE=pt(G)),n.push(_)}const r=i.or++,s=(f,_)=>`uGroup_${f}_${_.getRuleStack().join("-")}`,l=f=>i.parser.alternatives(r,n.map((_,G)=>{const Y={ALT:()=>!0},ie=i.parser;Y.ALT=()=>{if(_.ALT(f),!ie.isRecording()){const J=s(r,ie);ie.unorderedGroups.get(J)||ie.unorderedGroups.set(J,[]);const Ue=ie.unorderedGroups.get(J);typeof(null==Ue?void 0:Ue[G])>"u"&&(Ue[G]=!0)}};const re=_.GATE;return Y.GATE=re?()=>re(f):()=>{const J=ie.unorderedGroups.get(s(r,ie));return!(null==J?void 0:J[G])},Y})),c=Ur(i,Qn(e),l,"*");return f=>{c(f),i.parser.isRecording()||i.parser.unorderedGroups.delete(s(r,i.parser))}}(i,e);else if((0,k.ty)(e))r=function bi(i,e){const n=e.elements.map(r=>cn(i,r));return r=>n.forEach(s=>s(r))}(i,e);else{if(!(0,k.rT)(e))throw new Tn.h(e.$cstNode,`Unexpected element type: ${e.$type}`);{const s=i.consume++;r=()=>i.parser.consume(s,M.sd,e)}}return Ur(i,n?void 0:Qn(e),r,e.cardinality)}function pt(i){if((0,k.F8)(i)){const e=pt(i.left),n=pt(i.right);return r=>e(r)||n(r)}if((0,k.TB)(i)){const e=pt(i.left),n=pt(i.right);return r=>e(r)&&n(r)}if((0,k.Ii)(i)){const e=pt(i.value);return n=>!e(n)}if((0,k.yW)(i)){const e=i.parameter.ref.name;return n=>void 0!==n&&!0===n[e]}if((0,k.L)(i)){const e=Boolean(i.true);return()=>e}(0,Tn.U)(i)}function Qn(i){if((0,k.ty)(i))return i.guardCondition}function Zr(i,e,n=e.terminal){if(n){if((0,k.t3)(n)&&(0,k.F9)(n.rule.ref)){const r=n.rule.ref,s=i.subrule++;return l=>i.parser.subrule(s,Fr(i,r),!1,e,l)}if((0,k.t3)(n)&&(0,k.MS)(n.rule.ref)){const r=i.consume++,s=hr(i,n.rule.ref.name);return()=>i.parser.consume(r,s,e)}if((0,k.p1)(n)){const r=i.consume++,s=hr(i,n.value);return()=>i.parser.consume(r,s,e)}throw new Error("Could not build cross reference parser")}{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=(0,L.ib)(e.type.ref),s=null==r?void 0:r.terminal;if(!s)throw new Error("Could not find name assignment for type: "+(0,L.z$)(e.type.ref));return Zr(i,e,s)}}function Ur(i,e,n,r){const s=e&&pt(e);if(!r){if(s){const l=i.or++;return c=>i.parser.alternatives(l,[{ALT:()=>n(c),GATE:()=>s(c)},{ALT:(0,M._o)(),GATE:()=>!s(c)}])}return n}if("*"===r){const l=i.many++;return c=>i.parser.many(l,{DEF:()=>n(c),GATE:s?()=>s(c):void 0})}if("+"===r){const l=i.many++;if(s){const c=i.or++;return f=>i.parser.alternatives(c,[{ALT:()=>i.parser.atLeastOne(l,{DEF:()=>n(f)}),GATE:()=>s(f)},{ALT:(0,M._o)(),GATE:()=>!s(f)}])}return c=>i.parser.atLeastOne(l,{DEF:()=>n(c)})}if("?"===r){const l=i.optional++;return c=>i.parser.optional(l,{DEF:()=>n(c),GATE:s?()=>s(c):void 0})}(0,Tn.U)(r)}function Fr(i,e){const n=function Hs(i,e){if((0,k.F9)(e))return e.name;if(i.ruleNames.has(e))return i.ruleNames.get(e);{let n=e,r=n.$container,s=e.$type;for(;!(0,k.F9)(r);)((0,k.ty)(r)||(0,k.MZ)(r)||(0,k.W1)(r))&&(s=r.elements.indexOf(n).toString()+":"+s),n=r,r=r.$container;return s=r.name+":"+s,i.ruleNames.set(e,s),s}}(i,e),r=i.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function hr(i,e){const n=i.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function Ys(i){const e=function Di(i){const e=i.Grammar,n=i.parser.Lexer,r=new Li(i);return Ks(e,r,n.definition)}(i);return e.finalize(),e}var dn=g(60197),Gr=g(7043),ke=g(53420),Ke=g(59762),Ge=g(21932);function vn(){return new Promise(i=>{typeof setImmediate>"u"?setTimeout(i,0):setImmediate(i)})}let Jt=0,Xs=10;const pr=Symbol("OperationCancelled");function mr(i){return i===pr}function _t(i){return Br.apply(this,arguments)}function Br(){return Br=(0,ke.Z)(function*(i){if(i===Ke.Ts.None)return;const e=performance.now();if(e-Jt>=Xs&&(Jt=e,yield vn(),Jt=performance.now()),i.isCancellationRequested)throw pr}),Br.apply(this,arguments)}class Wr{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class qn{constructor(e,n,r,s){this._uri=e,this._languageId=n,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(const r of e)if(qn.isIncremental(r)){const s=qs(r.range),l=this.offsetAt(s.start),c=this.offsetAt(s.end);this._content=this._content.substring(0,l)+r.text+this._content.substring(c,this._content.length);const f=Math.max(s.start.line,0),_=Math.max(s.end.line,0);let G=this._lineOffsets;const Y=Js(r.text,!1,l);if(_-f===Y.length)for(let re=0,J=Y.length;re<J;re++)G[re+f+1]=Y[re];else Y.length<1e4?G.splice(f+1,_-f,...Y):this._lineOffsets=G=G.slice(0,f+1).concat(Y,G.slice(_+1));const ie=r.text.length-(c-l);if(0!==ie)for(let re=f+1+Y.length,J=G.length;re<J;re++)G[re]=G[re]+ie}else{if(!qn.isFull(r))throw new Error("Unknown change event received");this._content=r.text,this._lineOffsets=void 0}this._version=n}getLineOffsets(){return void 0===this._lineOffsets&&(this._lineOffsets=Js(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const n=this.getLineOffsets();let r=0,s=n.length;if(0===s)return{line:0,character:e};for(;r<s;){const c=Math.floor((r+s)/2);n[c]>e?s=c:r=c+1}const l=r-1;return{line:l,character:(e=this.ensureBeforeEOL(e,n[l]))-n[l]}}offsetAt(e){const n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;const r=n[e.line];if(e.character<=0)return r;const s=e.line+1<n.length?n[e.line+1]:this._content.length,l=Math.min(r+e.character,s);return this.ensureBeforeEOL(l,r)}ensureBeforeEOL(e,n){for(;e>n&&Qs(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const n=e;return null!=n&&"string"==typeof n.text&&void 0!==n.range&&(void 0===n.rangeLength||"number"==typeof n.rangeLength)}static isFull(e){const n=e;return null!=n&&"string"==typeof n.text&&void 0===n.range&&void 0===n.rangeLength}}var Kr;function jr(i,e){if(i.length<=1)return i;const n=i.length/2|0,r=i.slice(0,n),s=i.slice(n);jr(r,e),jr(s,e);let l=0,c=0,f=0;for(;l<r.length&&c<s.length;)e(r[l],s[c])<=0?i[f++]=r[l++]:i[f++]=s[c++];for(;l<r.length;)i[f++]=r[l++];for(;c<s.length;)i[f++]=s[c++];return i}function Js(i,e,n=0){const r=e?[n]:[];for(let s=0;s<i.length;s++){const l=i.charCodeAt(s);Qs(l)&&(13===l&&s+1<i.length&&10===i.charCodeAt(s+1)&&s++,r.push(n+s+1))}return r}function Qs(i){return 13===i||10===i}function qs(i){const e=i.start,n=i.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:i}function Ui(i){const e=qs(i.range);return e!==i.range?{newText:i.newText,range:e}:i}!function(i){i.create=function e(s,l,c,f){return new qn(s,l,c,f)},i.update=function n(s,l,c){if(s instanceof qn)return s.update(l,c),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")},i.applyEdits=function r(s,l){const c=s.getText(),f=jr(l.map(Ui),(Y,ie)=>{const re=Y.range.start.line-ie.range.start.line;return 0===re?Y.range.start.character-ie.range.start.character:re});let _=0;const G=[];for(const Y of f){const ie=s.offsetAt(Y.range.start);if(ie<_)throw new Error("Overlapping edit");ie>_&&G.push(c.substring(_,ie)),Y.newText.length&&G.push(Y.newText),_=s.offsetAt(Y.range.end)}return G.push(c.substr(_)),G.join("")}}(Kr||(Kr={}));var Ve,ft=g(74312);!function(i){i[i.Changed=0]="Changed",i[i.Parsed=1]="Parsed",i[i.IndexedContent=2]="IndexedContent",i[i.ComputedScopes=3]="ComputedScopes",i[i.Linked=4]="Linked",i[i.IndexedReferences=5]="IndexedReferences",i[i.Validated=6]="Validated"}(Ve||(Ve={}));class Fi{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}fromUri(e,n=Ke.Ts.None){var r=this;return(0,ke.Z)(function*(){const s=yield r.fileSystemProvider.readFile(e);return r.createAsync(e,s,n)})()}fromTextDocument(e,n,r){return n=n??ft.o.parse(e.uri),Ke.Ts.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return Ke.Ts.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if("string"==typeof n){const s=this.parse(e,n,r);return this.createLangiumDocument(s,e,void 0,n)}if("$model"in n){const s={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(s,e)}{const s=this.parse(e,n.getText(),r);return this.createLangiumDocument(s,e,n)}}createAsync(e,n,r){var s=this;return(0,ke.Z)(function*(){if("string"==typeof n){const l=yield s.parseAsync(e,n,r);return s.createLangiumDocument(l,e,void 0,n)}{const l=yield s.parseAsync(e,n.getText(),r);return s.createLangiumDocument(l,e,n)}})()}createLangiumDocument(e,n,r,s){let l;if(r)l={parseResult:e,uri:n,state:Ve.Parsed,references:[],textDocument:r};else{const c=this.createTextDocumentGetter(n,s);l={parseResult:e,uri:n,state:Ve.Parsed,references:[],get textDocument(){return c()}}}return e.value.$document=l,l}update(e,n){var r=this;return(0,ke.Z)(function*(){var s,l;const c=null===(s=e.parseResult.value.$cstNode)||void 0===s?void 0:s.root.fullText,f=null===(l=r.textDocuments)||void 0===l?void 0:l.get(e.uri.toString()),_=f?f.getText():yield r.fileSystemProvider.readFile(e.uri);if(f)Object.defineProperty(e,"textDocument",{value:f});else{const G=r.createTextDocumentGetter(e.uri,_);Object.defineProperty(e,"textDocument",{get:G})}return c!==_&&(e.parseResult=yield r.parseAsync(e.uri,_,n),e.parseResult.value.$document=e),e.state=Ve.Parsed,e})()}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let s;return()=>s??(s=Kr.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class gr{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return(0,it.Vw)(this.documentMap.values())}addDocument(e){const n=e.uri.toString();if(this.documentMap.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentMap.set(n,e)}getDocument(e){const n=e.toString();return this.documentMap.get(n)}getOrCreateDocument(e,n){var r=this;return(0,ke.Z)(function*(){let s=r.getDocument(e);return s||(s=yield r.langiumDocumentFactory.fromUri(e,n),r.addDocument(s),s)})()}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(s=>(this.addDocument(s),s));{const s=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(s),s}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=Ve.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(r.state=Ve.Changed,this.documentMap.delete(n)),r}}const Vr=Symbol("ref_resolving");class ei{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}link(e,n=Ke.Ts.None){var r=this;return(0,ke.Z)(function*(){for(const s of(0,ge.Zc)(e.parseResult.value))yield _t(n),(0,ge.fy)(s).forEach(l=>r.doLink(l,e))})()}doLink(e,n){var r;const s=e.reference;if(void 0===s._ref){s._ref=Vr;try{const l=this.getCandidate(e);if((0,Ge.et)(l))s._ref=l;else if(s._nodeDescription=l,this.langiumDocuments().hasDocument(l.documentUri)){const c=this.loadAstNode(l);s._ref=c??this.createLinkingError(e,l)}else s._ref=void 0}catch(l){console.error(`An error occurred while resolving reference to '${s.$refText}':`,l);const c=null!==(r=l.message)&&void 0!==r?r:String(l);s._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${s.$refText}': ${c}`})}n.references.push(s)}}unlink(e){for(const n of e.references)delete n._ref,delete n._nodeDescription;e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}buildReference(e,n,r,s){const l=this,c={$refNode:r,$refText:s,get ref(){var f;if((0,Ge.xA)(this._ref))return this._ref;if((0,Ge.SI)(this._nodeDescription)){const _=l.loadAstNode(this._nodeDescription);this._ref=_??l.createLinkingError({reference:c,container:e,property:n},this._nodeDescription)}else if(void 0===this._ref){this._ref=Vr;const _=(0,ge.E$)(e).$document,G=l.getLinkedNode({reference:c,container:e,property:n});if(G.error&&_&&_.state<Ve.ComputedScopes)return this._ref=void 0;this._ref=null!==(f=G.node)&&void 0!==f?f:G.error,this._nodeDescription=G.descr,null==_||_.references.push(this)}else if(this._ref===Vr)throw new Error(`Cyclic reference resolution detected: ${l.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${s}')`);return(0,Ge.xA)(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return(0,Ge.et)(this._ref)?this._ref:void 0}};return c}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if((0,Ge.et)(r))return{error:r};const s=this.loadAstNode(r);return s?{node:s,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const s=null!==(n=r.message)&&void 0!==n?n:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${s}`})}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);return n?this.astNodeLocator.getAstNode(n.parseResult.value,e.path):void 0}createLinkingError(e,n){const r=(0,ge.E$)(e.container).$document;r&&r.state<Ve.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const s=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${s} named '${e.reference.$refText}'.`,targetDescription:n})}}class ti{getName(e){if(function Gi(i){return"string"==typeof i.name}(e))return e.name}getNameNode(e){return(0,L.vb)(e.$cstNode,"name")}}var bt;!function(i){i.basename=ft.c.basename,i.dirname=ft.c.dirname,i.extname=ft.c.extname,i.joinPath=ft.c.joinPath,i.resolvePath=ft.c.resolvePath,i.equals=function e(s,l){return(null==s?void 0:s.toString())===(null==l?void 0:l.toString())},i.relative=function n(s,l){const c="string"==typeof s?s:s.path,f="string"==typeof l?l:l.path,_=c.split("/").filter(J=>J.length>0),G=f.split("/").filter(J=>J.length>0);let Y=0;for(;Y<_.length&&_[Y]===G[Y];Y++);return"../".repeat(_.length-Y)+G.slice(Y).join("/")},i.normalize=function r(s){return ft.o.parse(s.toString()).toString()}}(bt||(bt={}));class ni{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=(0,L.h7)(e),r=e.astNode;if(n&&r){const s=r[n.feature];if((0,Ge.Yk)(s))return s.ref;if(Array.isArray(s))for(const l of s)if((0,Ge.Yk)(l)&&l.$refNode&&l.$refNode.offset<=e.offset&&l.$refNode.end>=e.end)return l.ref}if(r){const s=this.nameProvider.getNameNode(r);if(s&&(s===e||(0,y.OB)(e,s)))return r}}}findDeclarationNode(e){const n=this.findDeclaration(e);if(null==n?void 0:n.$cstNode){return this.nameProvider.getNameNode(n)??n.$cstNode}}findReferences(e,n){const r=[];if(n.includeDeclaration){const l=this.getReferenceToSelf(e);l&&r.push(l)}let s=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(s=s.filter(l=>bt.equals(l.sourceUri,n.documentUri))),r.push(...s),(0,it.Vw)(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=(0,ge.Me)(e),s=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:s,targetUri:r.uri,targetPath:s,segment:(0,y.yn)(n),local:!0}}}}class yr{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return it.IH.sum((0,it.Vw)(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(void 0===n)return this.map.delete(e);{const r=this.map.get(e);if(r){const s=r.indexOf(n);if(s>=0)return 1===r.length?this.map.delete(e):r.splice(s,1),!0}return!1}}get(e){var n;return null!==(n=this.map.get(e))&&void 0!==n?n:[]}has(e,n){if(void 0===n)return this.map.has(e);{const r=this.map.get(e);return!!r&&r.indexOf(n)>=0}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(s=>e(s,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return(0,it.Vw)(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return(0,it.Vw)(this.map.keys())}values(){return(0,it.Vw)(this.map.values()).flat()}entriesGroupedByKey(){return(0,it.Vw)(this.map.entries())}}class He{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return void 0!==n&&(this.map.delete(e),this.inverse.delete(n),!0)}}class Hr{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}computeExports(e,n=Ke.Ts.None){var r=this;return(0,ke.Z)(function*(){return r.computeExportsForNode(e.parseResult.value,e,void 0,n)})()}computeExportsForNode(e,n,r=ge.sx,s=Ke.Ts.None){var l=this;return(0,ke.Z)(function*(){const c=[];l.exportNode(e,c,n);for(const f of r(e))yield _t(s),l.exportNode(f,c,n);return c})()}exportNode(e,n,r){const s=this.nameProvider.getName(e);s&&n.push(this.descriptions.createDescription(e,s,r))}computeLocalScopes(e,n=Ke.Ts.None){var r=this;return(0,ke.Z)(function*(){const s=e.parseResult.value,l=new yr;for(const c of(0,ge.VY)(s))yield _t(n),r.processNode(c,e,l);return l})()}processNode(e,n,r){const s=e.$container;if(s){const l=this.nameProvider.getName(e);l&&r.add(s,this.descriptions.createDescription(e,l,n))}}}class ri{constructor(e,n,r){var s;this.elements=e,this.outerScope=n,this.caseInsensitive=null!==(s=null==r?void 0:r.caseInsensitive)&&void 0!==s&&s}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);return n||(this.outerScope?this.outerScope.getElement(e):void 0)}}class Bi{constructor(e,n,r){var s;this.elements=new Map,this.caseInsensitive=null!==(s=null==r?void 0:r.caseInsensitive)&&void 0!==s&&s;for(const l of e){const c=this.caseInsensitive?l.name.toLowerCase():l.name;this.elements.set(c,l)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);return r||(this.outerScope?this.outerScope.getElement(e):void 0)}getAllElements(){let e=(0,it.Vw)(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class si{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")}}class Wi extends si{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Ki extends si{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const s=this.cacheForContext(e);if(s.has(n))return s.get(n);if(r){const l=r();return s.set(n,l),l}}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class ii extends Wi{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,s)=>{s.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class zr{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 ii(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),s=(0,ge.Me)(e.container).precomputedScopes;if(s){let c=e.container;do{const f=s.get(c);f.length>0&&n.push((0,it.Vw)(f).filter(_=>this.reflection.isSubtype(_.type,r))),c=c.$container}while(c)}let l=this.getGlobalScope(r,e);for(let c=n.length-1;c>=0;c--)l=this.createScope(n[c],l);return l}createScope(e,n,r){return new ri((0,it.Vw)(e),n,r)}createScopeForNodes(e,n,r){const s=(0,it.Vw)(e).map(l=>{const c=this.nameProvider.getName(l);if(c)return this.descriptions.createDescription(l,c)}).nonNullable();return new ri(s,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new Bi(this.indexManager.allElements(e)))}}function Yr(i){return"object"==typeof i&&!!i&&("$ref"in i||"$error"in i)}class Tr{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,n){const r=n??{},s=null==n?void 0:n.replacer,l=(f,_)=>this.replacer(f,_,r),c=s?(f,_)=>s(f,_,l):l;try{return this.currentDocument=(0,ge.Me)(e),JSON.stringify(e,c,null==n?void 0:n.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},s=JSON.parse(e);return this.linkNode(s,s,r),s}replacer(e,n,{refText:r,sourceText:s,textRegions:l,comments:c,uriConverter:f}){var _,G,Y,ie;if(!this.ignoreProperties.has(e)){if((0,Ge.Yk)(n)){const re=n.ref,J=r?n.$refText:void 0;if(re){const Ue=(0,ge.Me)(re);let je="";this.currentDocument&&this.currentDocument!==Ue&&(je=f?f(Ue.uri,n):Ue.uri.toString());return{$ref:`${je}#${this.astNodeLocator.getAstNodePath(re)}`,$refText:J}}return{$error:null!==(G=null===(_=n.error)||void 0===_?void 0:_.message)&&void 0!==G?G:"Could not resolve reference",$refText:J}}if((0,Ge.xA)(n)){let re;if(l&&(re=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&(null==re?void 0:re.$textRegion)&&(re.$textRegion.documentURI=null===(Y=this.currentDocument)||void 0===Y?void 0:Y.uri.toString())),s&&!e&&(re??(re=Object.assign({},n)),re.$sourceText=null===(ie=n.$cstNode)||void 0===ie?void 0:ie.text),c){re??(re=Object.assign({},n));const J=this.commentProvider.getComment(n);J&&(re.$comment=J.replace(/\r/g,""))}return re??n}return n}}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const s=(e.$textRegion=n(e.$cstNode)).assignments={};return Object.keys(e).filter(l=>!l.startsWith("$")).forEach(l=>{const c=(0,L.EL)(e.$cstNode,l).map(n);0!==c.length&&(s[l]=c)}),e}}linkNode(e,n,r,s,l,c){for(const[_,G]of Object.entries(e))if(Array.isArray(G))for(let Y=0;Y<G.length;Y++){const ie=G[Y];Yr(ie)?G[Y]=this.reviveReference(e,_,n,ie,r):(0,Ge.xA)(ie)&&this.linkNode(ie,n,r,e,_,Y)}else Yr(G)?e[_]=this.reviveReference(e,_,n,G,r):(0,Ge.xA)(G)&&this.linkNode(G,n,r,e,_);const f=e;f.$container=s,f.$containerProperty=l,f.$containerIndex=c}reviveReference(e,n,r,s,l){let c=s.$refText,f=s.$error;if(s.$ref){const _=this.getRefNode(r,s.$ref,l.uriConverter);if((0,Ge.xA)(_))return c||(c=this.nameProvider.getName(_)),{$refText:c??"",ref:_};f=_}if(f){const _={$refText:c??""};return _.error={container:e,property:n,message:f,reference:_},_}}getRefNode(e,n,r){try{const s=n.indexOf("#");if(0===s){return this.astNodeLocator.getAstNode(e,n.substring(1))||"Could not resolve path: "+n}if(s<0){const _=r?r(n):ft.o.parse(n),G=this.langiumDocuments.getDocument(_);return G?G.parseResult.value:"Could not find document for URI: "+n}const l=r?r(n.substring(0,s)):ft.o.parse(n.substring(0,s)),c=this.langiumDocuments.getDocument(l);if(!c)return"Could not find document for URI: "+n;if(s===n.length-1)return c.parseResult.value;return this.astNodeLocator.getAstNode(c.parseResult.value,n.substring(s+1))||"Could not resolve URI: "+n}catch(s){return String(s)}}}class vr{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=null==e?void 0:e.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(n.languageId,e),1===this.languageIdMap.size?this.singleton=e:this.singleton=void 0}getServices(e){var n,r;if(void 0!==this.singleton)return this.singleton;if(0===this.languageIdMap.size)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const s=null===(r=null===(n=this.textDocuments)||void 0===n?void 0:n.get(e))||void 0===r?void 0:r.languageId;if(void 0!==s){const f=this.languageIdMap.get(s);if(f)return f}const l=bt.extname(e),c=this.fileExtensionMap.get(l);if(!c)throw s?new Error(`The service registry contains no services for the extension '${l}' for language '${s}'.`):new Error(`The service registry contains no services for the extension '${l}'.`);return c}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function En(i){return{code:i}}var Er,xt;!function(i){i.all=["fast","slow","built-in"]}(Er||(Er={}));class ai{constructor(e){this.entries=new yr,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if("built-in"===r)throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[s,l]of Object.entries(e)){const c=l;if(Array.isArray(c))for(const f of c){const _={check:this.wrapValidationException(f,n),category:r};this.addEntry(s,_)}else if("function"==typeof c){const f={check:this.wrapValidationException(c,n),category:r};this.addEntry(s,f)}else(0,Tn.U)(c)}}wrapValidationException(e,n){var r=this;return function(){var s=(0,ke.Z)(function*(l,c,f){yield r.handleException(()=>e.call(n,l,c,f),"An error occurred during validation",c,l)});return function(l,c,f){return s.apply(this,arguments)}}()}handleException(e,n,r,s){return(0,ke.Z)(function*(){try{yield e()}catch(l){if(mr(l))throw l;console.error(`${n}:`,l),l instanceof Error&&l.stack&&console.error(l.stack);const c=l instanceof Error?l.message:String(l);r("error",`${n}: ${c}`,{node:s})}})()}addEntry(e,n){if("AstNode"!==e)for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n);else this.entries.add("AstNode",n)}getChecks(e,n){let r=(0,it.Vw)(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(s=>n.includes(s.category))),r.map(s=>s.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){var s=this;return function(){var l=(0,ke.Z)(function*(c,f,_,G){yield s.handleException(()=>e.call(r,c,f,_,G),n,f,c)});return function(c,f,_,G){return l.apply(this,arguments)}}()}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class Hi{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}validateDocument(e,n={},r=Ke.Ts.None){var s=this;return(0,ke.Z)(function*(){const l=e.parseResult,c=[];if(yield _t(r),(!n.categories||n.categories.includes("built-in"))&&(s.processLexingErrors(l,c,n),n.stopAfterLexingErrors&&c.some(f=>{var _;return(null===(_=f.data)||void 0===_?void 0:_.code)===xt.LexingError})||(s.processParsingErrors(l,c,n),n.stopAfterParsingErrors&&c.some(f=>{var _;return(null===(_=f.data)||void 0===_?void 0:_.code)===xt.ParsingError}))||(s.processLinkingErrors(e,c,n),n.stopAfterLinkingErrors&&c.some(f=>{var _;return(null===(_=f.data)||void 0===_?void 0:_.code)===xt.LinkingError}))))return c;try{c.push(...yield s.validateAst(l.value,n,r))}catch(f){if(mr(f))throw f;console.error("An error occurred during validation:",f)}return yield _t(r),c})()}processLexingErrors(e,n,r){var s,l,c;const f=[...e.lexerErrors,...null!==(l=null===(s=e.lexerReport)||void 0===s?void 0:s.diagnostics)&&void 0!==l?l:[]];for(const _ of f){const G=null!==(c=_.severity)&&void 0!==c?c:"error",Y={severity:Xr(G),range:{start:{line:_.line-1,character:_.column-1},end:{line:_.line-1,character:_.column+_.length-1}},message:_.message,data:Yi(G),source:this.getSource()};n.push(Y)}}processParsingErrors(e,n,r){for(const s of e.parserErrors){let l;if(isNaN(s.token.startOffset)){if("previousToken"in s){const c=s.previousToken;if(isNaN(c.startOffset)){const f={line:0,character:0};l={start:f,end:f}}else{const f={line:c.endLine-1,character:c.endColumn};l={start:f,end:f}}}}else l=(0,y.sp)(s.token);if(l){const c={severity:Xr("error"),range:l,message:s.message,data:En(xt.ParsingError),source:this.getSource()};n.push(c)}}}processLinkingErrors(e,n,r){for(const s of e.references){const l=s.error;if(l){const c={node:l.container,property:l.property,index:l.index,data:{code:xt.LinkingError,containerType:l.container.$type,property:l.property,refText:l.reference.$refText}};n.push(this.toDiagnostic("error",l.message,c))}}}validateAst(e,n,r=Ke.Ts.None){var s=this;return(0,ke.Z)(function*(){const l=[],c=(f,_,G)=>{l.push(s.toDiagnostic(f,_,G))};return yield s.validateAstBefore(e,n,c,r),yield s.validateAstNodes(e,n,c,r),yield s.validateAstAfter(e,n,c,r),l})()}validateAstBefore(e,n,r,s=Ke.Ts.None){var l=this;return(0,ke.Z)(function*(){var c;const f=l.validationRegistry.checksBefore;for(const _ of f)yield _t(s),yield _(e,r,null!==(c=n.categories)&&void 0!==c?c:[],s)})()}validateAstNodes(e,n,r,s=Ke.Ts.None){var l=this;return(0,ke.Z)(function*(){yield Promise.all((0,ge.Zc)(e).map(function(){var c=(0,ke.Z)(function*(f){yield _t(s);const _=l.validationRegistry.getChecks(f.$type,n.categories);for(const G of _)yield G(f,r,s)});return function(f){return c.apply(this,arguments)}}()))})()}validateAstAfter(e,n,r,s=Ke.Ts.None){var l=this;return(0,ke.Z)(function*(){var c;const f=l.validationRegistry.checksAfter;for(const _ of f)yield _t(s),yield _(e,r,null!==(c=n.categories)&&void 0!==c?c:[],s)})()}toDiagnostic(e,n,r){return{message:n,range:zi(r),severity:Xr(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function zi(i){if(i.range)return i.range;let e;return"string"==typeof i.property?e=(0,L.vb)(i.node.$cstNode,i.property,i.index):"string"==typeof i.keyword&&(e=(0,L.lA)(i.node.$cstNode,i.keyword,i.index)),e??(e=i.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Xr(i){switch(i){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+i)}}function Yi(i){switch(i){case"error":return En(xt.LexingError);case"warning":return En(xt.LexingWarning);case"info":return En(xt.LexingInfo);case"hint":return En(xt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+i)}}!function(i){i.LexingError="lexing-error",i.LexingWarning="lexing-warning",i.LexingInfo="lexing-info",i.LexingHint="lexing-hint",i.ParsingError="parsing-error",i.LinkingError="linking-error"}(xt||(xt={}));class Xi{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const s=r??(0,ge.Me)(e);n??(n=this.nameProvider.getName(e));const l=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${l} has no name.`);let c;const f=()=>{var _;return c??(c=(0,y.yn)(null!==(_=this.nameProvider.getNameNode(e))&&void 0!==_?_:e.$cstNode))};return{node:e,name:n,get nameSegment(){return f()},selectionSegment:(0,y.yn)(e.$cstNode),type:e.$type,documentUri:s.uri,path:l}}}class Ji{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}createDescriptions(e,n=Ke.Ts.None){var r=this;return(0,ke.Z)(function*(){const s=[],l=e.parseResult.value;for(const c of(0,ge.Zc)(l))yield _t(n),(0,ge.fy)(c).filter(f=>!(0,Ge.et)(f)).forEach(f=>{const _=r.createDescription(f);_&&s.push(_)});return s})()}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const s=(0,ge.Me)(e.container).uri;return{sourceUri:s,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:(0,y.yn)(r),local:bt.equals(n.documentUri,s)}}}class Qi{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return void 0!==n?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((s,l)=>{if(!s||0===l.length)return s;const c=l.indexOf(this.indexSeparator);if(c>0){const f=l.substring(0,c),_=parseInt(l.substring(c+1)),G=s[f];return null==G?void 0:G[_]}return s[l]},e)}}var An,oi=g(4617);class Ar{constructor(e){this._ready=new Wr,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new oi.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n,r;this.workspaceConfig=null!==(r=null===(n=e.capabilities.workspace)||void 0===n?void 0:n.configuration)&&void 0!==r&&r}initialized(e){var n=this;return(0,ke.Z)(function*(){if(n.workspaceConfig){if(e.register){const r=n.serviceRegistry.all;e.register({section:r.map(s=>n.toSectionName(s.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=n.serviceRegistry.all.map(l=>({section:n.toSectionName(l.LanguageMetaData.languageId)})),s=yield e.fetchConfiguration(r);r.forEach((l,c)=>{n.updateSectionConfiguration(l.section,s[c])})}}n._ready.resolve()})()}updateConfiguration(e){!e.settings||Object.keys(e.settings).forEach(n=>{const r=e.settings[n];this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}getConfiguration(e,n){var r=this;return(0,ke.Z)(function*(){yield r.ready;const s=r.toSectionName(e);if(r.settings[s])return r.settings[s][n]})()}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}!function(i){i.create=function e(n){return{dispose:(r=(0,ke.Z)(function*(){return yield n()}),function(){return r.apply(this,arguments)})};var r}}(An||(An={}));class qi{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new yr,this.documentPhaseListeners=new yr,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Ve.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}build(e,n={},r=Ke.Ts.None){var s=this;return(0,ke.Z)(function*(){var l,c;for(const f of e){const _=f.uri.toString();if(f.state===Ve.Validated){if("boolean"==typeof n.validation&&n.validation)f.state=Ve.IndexedReferences,f.diagnostics=void 0,s.buildState.delete(_);else if("object"==typeof n.validation){const G=s.buildState.get(_),Y=null===(l=null==G?void 0:G.result)||void 0===l?void 0:l.validationChecks;if(Y){const re=(null!==(c=n.validation.categories)&&void 0!==c?c:Er.all).filter(J=>!Y.includes(J));re.length>0&&(s.buildState.set(_,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:re})},result:G.result}),f.state=Ve.IndexedReferences)}}}else s.buildState.delete(_)}s.currentState=Ve.Changed,yield s.emitUpdate(e.map(f=>f.uri),[]),yield s.buildDocuments(e,n,r)})()}update(e,n,r=Ke.Ts.None){var s=this;return(0,ke.Z)(function*(){s.currentState=Ve.Changed;for(const f of n)s.langiumDocuments.deleteDocument(f),s.buildState.delete(f.toString()),s.indexManager.remove(f);for(const f of e){if(!s.langiumDocuments.invalidateDocument(f)){const G=s.langiumDocumentFactory.fromModel({$type:"INVALID"},f);G.state=Ve.Changed,s.langiumDocuments.addDocument(G)}s.buildState.delete(f.toString())}const l=(0,it.Vw)(e).concat(n).map(f=>f.toString()).toSet();s.langiumDocuments.all.filter(f=>!l.has(f.uri.toString())&&s.shouldRelink(f,l)).forEach(f=>{s.serviceRegistry.getServices(f.uri).references.Linker.unlink(f),f.state=Math.min(f.state,Ve.ComputedScopes),f.diagnostics=void 0}),yield s.emitUpdate(e,n),yield _t(r);const c=s.sortDocuments(s.langiumDocuments.all.filter(f=>{var _;return f.state<Ve.Linked||!(null===(_=s.buildState.get(f.uri.toString()))||void 0===_?void 0:_.completed)}).toArray());yield s.buildDocuments(c,s.updateBuildOptions,r)})()}emitUpdate(e,n){var r=this;return(0,ke.Z)(function*(){yield Promise.all(r.updateListeners.map(s=>s(e,n)))})()}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return Boolean(null===(n=this.textDocuments)||void 0===n?void 0:n.get(e.uri))}shouldRelink(e,n){return!!e.references.some(r=>void 0!==r.error)||this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),An.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}buildDocuments(e,n,r){var s=this;return(0,ke.Z)(function*(){s.prepareBuild(e,n),yield s.runCancelable(e,Ve.Parsed,r,c=>s.langiumDocumentFactory.update(c,r)),yield s.runCancelable(e,Ve.IndexedContent,r,c=>s.indexManager.updateContent(c,r)),yield s.runCancelable(e,Ve.ComputedScopes,r,function(){var c=(0,ke.Z)(function*(f){const _=s.serviceRegistry.getServices(f.uri).references.ScopeComputation;f.precomputedScopes=yield _.computeLocalScopes(f,r)});return function(f){return c.apply(this,arguments)}}()),yield s.runCancelable(e,Ve.Linked,r,c=>s.serviceRegistry.getServices(c.uri).references.Linker.link(c,r)),yield s.runCancelable(e,Ve.IndexedReferences,r,c=>s.indexManager.updateReferences(c,r));const l=e.filter(c=>s.shouldValidate(c));yield s.runCancelable(l,Ve.Validated,r,c=>s.validate(c,r));for(const c of e){const f=s.buildState.get(c.uri.toString());f&&(f.completed=!0)}})()}prepareBuild(e,n){for(const r of e){const s=r.uri.toString(),l=this.buildState.get(s);(!l||l.completed)&&this.buildState.set(s,{completed:!1,options:n,result:null==l?void 0:l.result})}}runCancelable(e,n,r,s){var l=this;return(0,ke.Z)(function*(){const c=e.filter(_=>_.state<n);for(const _ of c)yield _t(r),yield s(_),_.state=n,yield l.notifyDocumentPhase(_,n,r);const f=e.filter(_=>_.state===n);yield l.notifyBuildPhase(f,n,r),l.currentState=n})()}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),An.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),An.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let s;if(n&&"path"in n?s=n:r=n,r??(r=Ke.Ts.None),s){const l=this.langiumDocuments.getDocument(s);if(l&&l.state>e)return Promise.resolve(s)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(pr):new Promise((l,c)=>{const f=this.onBuildPhase(e,()=>{if(f.dispose(),_.dispose(),s){const G=this.langiumDocuments.getDocument(s);l(null==G?void 0:G.uri)}else l(void 0)}),_=r.onCancellationRequested(()=>{f.dispose(),_.dispose(),c(pr)})})}notifyDocumentPhase(e,n,r){var s=this;return(0,ke.Z)(function*(){const c=s.documentPhaseListeners.get(n).slice();for(const f of c)try{yield f(e,r)}catch(_){if(!mr(_))throw _}})()}notifyBuildPhase(e,n,r){var s=this;return(0,ke.Z)(function*(){if(0===e.length)return;const c=s.buildPhaseListeners.get(n).slice();for(const f of c)yield _t(r),yield f(e,r)})()}shouldValidate(e){return Boolean(this.getBuildOptions(e).validation)}validate(e,n){var r=this;return(0,ke.Z)(function*(){var s,l;const c=r.serviceRegistry.getServices(e.uri).validation.DocumentValidator,f=r.getBuildOptions(e).validation,_="object"==typeof f?f:void 0,G=yield c.validateDocument(e,_,n);e.diagnostics?e.diagnostics.push(...G):e.diagnostics=G;const Y=r.buildState.get(e.uri.toString());if(Y){null!==(s=Y.result)&&void 0!==s||(Y.result={});const ie=null!==(l=null==_?void 0:_.categories)&&void 0!==l?l:Er.all;Y.result.validationChecks?Y.result.validationChecks.push(...ie):Y.result.validationChecks=[...ie]}})()}getBuildOptions(e){var n,r;return null!==(r=null===(n=this.buildState.get(e.uri.toString()))||void 0===n?void 0:n.options)&&void 0!==r?r:{}}}class ea{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Ki,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=(0,ge.Me)(e).uri,s=[];return this.referenceIndex.forEach(l=>{l.forEach(c=>{bt.equals(c.targetUri,r)&&c.targetPath===n&&s.push(c)})}),(0,it.Vw)(s)}allElements(e,n){let r=(0,it.Vw)(this.symbolIndex.keys());return n&&(r=r.filter(s=>!n||n.has(s))),r.map(s=>this.getFileDescriptions(s,e)).flat()}getFileDescriptions(e,n){var r;return n?this.symbolByTypeIndex.get(e,n,()=>{var l;return(null!==(l=this.symbolIndex.get(e))&&void 0!==l?l:[]).filter(f=>this.astReflection.isSubtype(f.type,n))}):null!==(r=this.symbolIndex.get(e))&&void 0!==r?r:[]}remove(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n),this.referenceIndex.delete(n)}updateContent(e,n=Ke.Ts.None){var r=this;return(0,ke.Z)(function*(){const l=yield r.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,n),c=e.uri.toString();r.symbolIndex.set(c,l),r.symbolByTypeIndex.clear(c)})()}updateReferences(e,n=Ke.Ts.None){var r=this;return(0,ke.Z)(function*(){const l=yield r.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);r.referenceIndex.set(e.uri.toString(),l)})()}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return!!r&&r.some(s=>!s.local&&n.has(s.targetUri.toString()))}}class ta{constructor(e){this.initialBuildOptions={},this._ready=new Wr,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}get workspaceFolders(){return this.folders}initialize(e){var n;this.folders=null!==(n=e.workspaceFolders)&&void 0!==n?n:void 0}initialized(e){return this.mutex.write(n=>{var r;return this.initializeWorkspace(null!==(r=this.folders)&&void 0!==r?r:[],n)})}initializeWorkspace(e,n=Ke.Ts.None){var r=this;return(0,ke.Z)(function*(){const s=yield r.performStartup(e);yield _t(n),yield r.documentBuilder.build(s,r.initialBuildOptions,n)})()}performStartup(e){var n=this;return(0,ke.Z)(function*(){const r=n.serviceRegistry.all.flatMap(c=>c.LanguageMetaData.fileExtensions),s=[],l=c=>{s.push(c),n.langiumDocuments.hasDocument(c.uri)||n.langiumDocuments.addDocument(c)};return yield n.loadAdditionalDocuments(e,l),yield Promise.all(e.map(c=>[c,n.getRootFolder(c)]).map(function(){var c=(0,ke.Z)(function*(f){return n.traverseFolder(...f,r,l)});return function(f){return c.apply(this,arguments)}}())),n._ready.resolve(),s})()}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return ft.o.parse(e.uri)}traverseFolder(e,n,r,s){var l=this;return(0,ke.Z)(function*(){const c=yield l.fileSystemProvider.readDirectory(n);yield Promise.all(c.map(function(){var f=(0,ke.Z)(function*(_){if(l.includeEntry(e,_,r))if(_.isDirectory)yield l.traverseFolder(e,_.uri,r,s);else if(_.isFile){const G=yield l.langiumDocuments.getOrCreateDocument(_.uri);s(G)}});return function(_){return f.apply(this,arguments)}}()))})()}includeEntry(e,n,r){const s=bt.basename(n.uri);if(s.startsWith("."))return!1;if(n.isDirectory)return"node_modules"!==s&&"out"!==s;if(n.isFile){const l=bt.extname(n.uri);return r.includes(l)}return!1}}class na{buildUnexpectedCharactersMessage(e,n,r,s,l){return M.ZW.buildUnexpectedCharactersMessage(e,n,r,s,l)}buildUnableToPopLexerModeMessage(e){return M.ZW.buildUnableToPopLexerModeMessage(e)}}const ra={mode:"full"};class sa{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=ui(n)?Object.values(n):n,s="production"===e.LanguageMetaData.mode;this.chevrotainLexer=new M.hW(r,{positionTracking:"full",skipValidations:s,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=ra){var r,s,l;const c=this.chevrotainLexer.tokenize(e);return{tokens:c.tokens,errors:c.errors,hidden:null!==(r=c.groups.hidden)&&void 0!==r?r:[],report:null===(l=(s=this.tokenBuilder).flushLexingReport)||void 0===l?void 0:l.call(s,e)}}toTokenTypeDictionary(e){if(ui(e))return e;const n=li(e)?Object.values(e.modes).flat():e,r={};return n.forEach(s=>r[s.name]=s),r}}function li(i){return i&&"modes"in i&&"defaultMode"in i}function ui(i){return!function ia(i){return Array.isArray(i)&&(0===i.length||"name"in i[0])}(i)&&!li(i)}function aa(i,e,n){let r,s;"string"==typeof i?(s=e,r=n):(s=i.range.start,r=e),s||(s=Me.create(0,0));const f=function fi(i){var e,n,r;const s=[];let l=i.position.line,c=i.position.character;for(let f=0;f<i.lines.length;f++){const _=0===f,G=f===i.lines.length-1;let Y=i.lines[f],ie=0;if(_&&i.options.start){const J=null===(e=i.options.start)||void 0===e?void 0:e.exec(Y);J&&(ie=J.index+J[0].length)}else{const J=null===(n=i.options.line)||void 0===n?void 0:n.exec(Y);J&&(ie=J.index+J[0].length)}if(G){const J=null===(r=i.options.end)||void 0===r?void 0:r.exec(Y);J&&(Y=Y.substring(0,J.index))}if(Y=Y.substring(0,oa(Y)),qr(Y,ie)>=Y.length){if(s.length>0){const J=Me.create(l,c);s.push({type:"break",content:"",range:ne.create(J,J)})}}else{Qr.lastIndex=ie;const J=Qr.exec(Y);if(J){const Ue=J[0],je=J[1],et=Me.create(l,c+ie),mt=Me.create(l,c+ie+Ue.length);s.push({type:"tag",content:je,range:ne.create(et,mt)}),ie+=Ue.length,ie=qr(Y,ie)}if(ie<Y.length){const Ue=Y.substring(ie),je=Array.from(Ue.matchAll(di));s.push(...Rr(je,Ue,l,c+ie))}}l++,c=0}return s.length>0&&"break"===s[s.length-1].type?s.slice(0,-1):s}({lines:Jr(i),position:s,options:Dt(r)});return function la(i){var e,n,r,s;const l=Me.create(i.position.line,i.position.character);if(0===i.tokens.length)return new vi([],ne.create(l,l));const c=[];for(;i.index<i.tokens.length;){const G=es(i,c[c.length-1]);G&&c.push(G)}const f=null!==(n=null===(e=c[0])||void 0===e?void 0:e.range.start)&&void 0!==n?n:l,_=null!==(s=null===(r=c[c.length-1])||void 0===r?void 0:r.range.end)&&void 0!==s?s:l;return new vi(c,ne.create(f,_))}({index:0,tokens:f,position:s})}function Jr(i){let e="";return e="string"==typeof i?i:i.text,e.split(B.K0)}const Qr=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,di=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Rr(i,e,n,r){const s=[];if(0===i.length){const l=Me.create(n,r),c=Me.create(n,r+e.length);s.push({type:"text",content:e,range:ne.create(l,c)})}else{let l=0;for(const f of i){const _=f.index,G=e.substring(l,_);G.length>0&&s.push({type:"text",content:e.substring(l,_),range:ne.create(Me.create(n,l+r),Me.create(n,_+r))});let Y=G.length+1;const ie=f[1];if(s.push({type:"inline-tag",content:ie,range:ne.create(Me.create(n,l+Y+r),Me.create(n,l+Y+ie.length+r))}),Y+=ie.length,4===f.length){Y+=f[2].length;const re=f[3];s.push({type:"text",content:re,range:ne.create(Me.create(n,l+Y+r),Me.create(n,l+Y+re.length+r))})}else s.push({type:"text",content:"",range:ne.create(Me.create(n,l+Y+r),Me.create(n,l+Y+r))});l=_+f[0].length}const c=e.substring(l);c.length>0&&s.push({type:"text",content:c,range:ne.create(Me.create(n,l+r),Me.create(n,l+r+c.length))})}return s}const _r=/\S/,hi=/\s*$/;function qr(i,e){const n=i.substring(e).match(_r);return n?e+n.index:i.length}function oa(i){const e=i.match(hi);if(e&&"number"==typeof e.index)return e.index}function es(i,e){const n=i.tokens[i.index];return"tag"===n.type?gi(i,!1):"text"===n.type||"inline-tag"===n.type?mi(i):(function pi(i,e){if(e){const n=new Cr("",i.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}(n,e),void i.index++)}function mi(i){let e=i.tokens[i.index];const n=e;let r=e;const s=[];for(;e&&"break"!==e.type&&"tag"!==e.type;)s.push(ua(i)),r=e,e=i.tokens[i.index];return new er(s,ne.create(n.range.start,r.range.end))}function ua(i){return"inline-tag"===i.tokens[i.index].type?gi(i,!0):yi(i)}function gi(i,e){const n=i.tokens[i.index++],r=n.content.substring(1),s=i.tokens[i.index];if("text"===(null==s?void 0:s.type)){if(e){const l=yi(i);return new Ir(r,new er([l],l.range),e,ne.create(n.range.start,l.range.end))}{const l=mi(i);return new Ir(r,l,e,ne.create(n.range.start,l.range.end))}}{const l=n.range;return new Ir(r,new er([],l),e,l)}}function yi(i){const e=i.tokens[i.index++];return new Cr(e.content,e.range)}function Dt(i){if(!i)return Dt({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=i;return{start:Ti(e,!0),end:Ti(n,!1),line:Ti(r,!0)}}function Ti(i,e){if("string"==typeof i||"object"==typeof i){const n="string"==typeof i?(0,B.hr)(i):i.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}return i}class vi{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(0===e.length)e=n.toString();else{const r=n.toString();e+=tr(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(0===n.length)n=r.toMarkdown(e);else{const s=r.toMarkdown(e);n+=tr(n)+s}return n.trim()}}class Ir{constructor(e,n,r,s){this.name=e,this.content=n,this.inline=r,this.range=s}toString(){let e=`@${this.name}`;const n=this.content.toString();return 1===this.content.inlines.length?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}\n${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n,r;return null!==(r=null===(n=null==e?void 0:e.renderTag)||void 0===n?void 0:n.call(e,this))&&void 0!==r?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const l=function Ei(i,e,n){var r,s;if("linkplain"===i||"linkcode"===i||"link"===i){const l=e.indexOf(" ");let c=e;if(l>0){const _=qr(e,l);c=e.substring(_),e=e.substring(0,l)}return("linkcode"===i||"link"===i&&"code"===n.link)&&(c=`\`${c}\``),null!==(s=null===(r=n.renderLink)||void 0===r?void 0:r.call(n,e,c))&&void 0!==s?s:function ts(i,e){try{return ft.o.parse(i,!0),`[${e}](${i})`}catch{return i}}(e,c)}}(this.name,n,e??{});if("string"==typeof l)return l}let r="";"italic"===(null==e?void 0:e.tag)||void 0===(null==e?void 0:e.tag)?r="*":"bold"===(null==e?void 0:e.tag)?r="**":"bold-italic"===(null==e?void 0:e.tag)&&(r="***");let s=`${r}@${this.name}${r}`;return 1===this.content.inlines.length?s=`${s} \u2014 ${n}`:this.content.inlines.length>1&&(s=`${s}\n${n}`),this.inline?`{${s}}`:s}}class er{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],s=this.inlines[n+1];e+=r.toString(),s&&s.range.start.line>r.range.start.line&&(e+="\n")}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const s=this.inlines[r],l=this.inlines[r+1];n+=s.toMarkdown(e),l&&l.range.start.line>s.range.start.line&&(n+="\n")}return n}}class Cr{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function tr(i){return i.endsWith("\n")?"\n":"\n\n"}class ns{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&function ci(i,e){const n=Dt(e),r=Jr(i);if(0===r.length)return!1;const s=r[0],l=r[r.length-1],c=n.start,f=n.end;return Boolean(null==c?void 0:c.exec(s))&&Boolean(null==f?void 0:f.exec(l))}(n))return aa(n).toMarkdown({renderLink:(s,l)=>this.documentationLinkRenderer(e,s,l),renderTag:s=>this.documentationTagRenderer(e,s)})}documentationLinkRenderer(e,n,r){var s;const l=null!==(s=this.findNameInPrecomputedScopes(e,n))&&void 0!==s?s:this.findNameInGlobalScope(e,n);if(l&&l.nameSegment){const c=l.nameSegment.range.start.line+1,f=l.nameSegment.range.start.character+1;return`[${r}](${l.documentUri.with({fragment:`L${c},${f}`}).toString()})`}}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const s=(0,ge.Me)(e).precomputedScopes;if(!s)return;let l=e;do{const f=s.get(l).find(_=>_.name===n);if(f)return f;l=l.$container}while(l)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(s=>s.name===n)}}class ya{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return function Vi(i){return"string"==typeof i.$comment}(e)?e.$comment:null===(n=(0,y.LK)(e.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===n?void 0:n.text}}class Ai{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class xr{constructor(){this.previousTokenSource=new Ke.AU,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=function Zi(){return Jt=performance.now(),new Ke.AU}();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=Ke.Ts.None){const s=new Wr,l={action:n,deferred:s,cancellationToken:r};return e.push(l),this.performNextOperation(),s.promise}performNextOperation(){var e=this;return(0,ke.Z)(function*(){if(!e.done)return;const n=[];if(e.writeQueue.length>0)n.push(e.writeQueue.shift());else{if(!(e.readQueue.length>0))return;n.push(...e.readQueue.splice(0,e.readQueue.length))}e.done=!1,yield Promise.all(n.map(function(){var r=(0,ke.Z)(function*({action:s,deferred:l,cancellationToken:c}){try{const f=yield Promise.resolve().then(()=>s(c));l.resolve(f)}catch(f){mr(f)?l.resolve(void 0):l.reject(f)}});return function(s){return r.apply(this,arguments)}}())),e.done=!0,e.performNextOperation()})()}cancelWrite(){this.previousTokenSource.cancel()}}class ca{constructor(e){this.grammarElementIdMap=new He,this.tokenTypeIdMap=new He,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const s of(0,ge.Zc)(e))n.set(s,{});if(e.$cstNode)for(const s of(0,y._t)(e.$cstNode))r.set(s,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,void 0!==e.$cstNode&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[s,l]of Object.entries(e))if(!s.startsWith("$"))if(Array.isArray(l)){const c=[];r[s]=c;for(const f of l)(0,Ge.xA)(f)?c.push(this.dehydrateAstNode(f,n)):(0,Ge.Yk)(f)?c.push(this.dehydrateReference(f,n)):c.push(f)}else(0,Ge.xA)(l)?r[s]=this.dehydrateAstNode(l,n):(0,Ge.Yk)(l)?r[s]=this.dehydrateReference(l,n):void 0!==l&&(r[s]=l);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return(0,Ge.U8)(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),(0,Ge.al)(e)?r.content=e.content.map(s=>this.dehydrateCstNode(s,n)):(0,Ge.dm)(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const l of(0,ge.Zc)(e))n.set(l,{});let s;if(e.$cstNode)for(const l of(0,y._t)(e.$cstNode)){let c;"fullText"in l?(c=new Mr(l.fullText),s=c):"content"in l?c=new qe:"tokenType"in l&&(c=this.hydrateCstLeafNode(l)),c&&(r.set(l,c),c.root=s)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[s,l]of Object.entries(e))if(!s.startsWith("$"))if(Array.isArray(l)){const c=[];r[s]=c;for(const f of l)(0,Ge.xA)(f)?c.push(this.setParent(this.hydrateAstNode(f,n),r)):(0,Ge.Yk)(f)?c.push(this.hydrateReference(f,r,s,n)):c.push(f)}else(0,Ge.xA)(l)?r[s]=this.setParent(this.hydrateAstNode(l,n),r):(0,Ge.Yk)(l)?r[s]=this.hydrateReference(l,r,s,n):void 0!==l&&(r[s]=l);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,s){return this.linker.buildReference(n,r,s.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const s=n.cstNodes.get(e);if("number"==typeof e.grammarSource&&(s.grammarSource=this.getGrammarElement(e.grammarSource)),s.astNode=n.astNodes.get(e.astNode),(0,Ge.al)(s))for(const l of e.content){const c=this.hydrateCstNode(l,n,r++);s.content.push(c)}return s}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,s=e.length,l=e.startLine,c=e.startColumn,f=e.endLine,_=e.endColumn,G=e.hidden;return new fr(r,s,{start:{line:l,character:c},end:{line:f,character:_}},n,G)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const n of(0,ge.Zc)(this.grammar))(0,k.zJ)(n)&&this.grammarElementIdMap.set(n,e++)}}function Ri(i){return{documentation:{CommentProvider:e=>new ya(e),DocumentationProvider:e=>new ns(e)},parser:{AsyncParser:e=>new Ai(e),GrammarConfig:e=>function O(i){const e=[],n=i.Grammar;for(const r of n.rules)(0,k.MS)(r)&&(0,L.md)(r)&&(0,B.Rn)((0,L.s1)(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:y.uz}}(e),LangiumParser:e=>Ys(e),CompletionParser:e=>function zs(i){const e=i.Grammar,n=i.parser.Lexer,r=new wi(i);return Ks(e,r,n.definition),r.finalize(),r}(e),ValueConverter:()=>new Gr.t,TokenBuilder:()=>new dn.P,Lexer:e=>new sa(e),ParserErrorMessageProvider:()=>new Gs,LexerErrorMessageProvider:()=>new na},workspace:{AstNodeLocator:()=>new Qi,AstNodeDescriptionProvider:e=>new Xi(e),ReferenceDescriptionProvider:e=>new Ji(e)},references:{Linker:e=>new ei(e),NameProvider:()=>new ti,ScopeProvider:e=>new zr(e),ScopeComputation:e=>new Hr(e),References:e=>new ni(e)},serializer:{Hydrator:e=>new ca(e),JsonSerializer:e=>new Tr(e)},validation:{DocumentValidator:e=>new Hi(e),ValidationRegistry:e=>new ai(e)},shared:()=>i.shared}}function _i(i){return{ServiceRegistry:e=>new vr(e),workspace:{LangiumDocuments:e=>new gr(e),LangiumDocumentFactory:e=>new Fi(e),DocumentBuilder:e=>new qi(e),IndexManager:e=>new ea(e),WorkspaceManager:e=>new ta(e),FileSystemProvider:e=>i.fileSystemProvider(e),WorkspaceLock:()=>new xr,ConfigurationProvider:e=>new Ar(e)}}}},60036:(Ae,V,g)=>{var y;function L(A,T,I,h,v,E,S,m,N){return O([A,T,I,h,v,E,S,m,N].reduce(F,{}))}g.d(V,{f3:()=>L}),(y||(y={})).merge=(T,I)=>F(F({},T),I);const B=Symbol("isProxy");function O(A,T){const I=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(h,v)=>v===B||W(h,v,A,T||I),getOwnPropertyDescriptor:(h,v)=>(W(h,v,A,T||I),Object.getOwnPropertyDescriptor(h,v)),has:(h,v)=>v in A,ownKeys:()=>[...Object.getOwnPropertyNames(A)]});return I}const M=Symbol();function W(A,T,I,h){if(T in A){if(A[T]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:A[T]});if(A[T]===M)throw new Error('Cycle detected. Please make "'+String(T)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return A[T]}if(T in I){const v=I[T];A[T]=M;try{A[T]="function"==typeof v?v(h):O(v,h)}catch(E){throw A[T]=E instanceof Error?E:void 0,E}return A[T]}}function F(A,T){if(T)for(const[I,h]of Object.entries(T))if(void 0!==h){const v=A[I];A[I]=null!==v&&null!==h&&"object"==typeof v&&"object"==typeof h?F(v,h):h}return A}},48893:(Ae,V,g)=>{g.d(V,{B7:()=>kn,Bf:()=>Fn,Bi:()=>Ht,F8:()=>de,F9:()=>Z,Ii:()=>Xe,Iy:()=>Pe,Ki:()=>nt,L:()=>ae,LG:()=>Cn,MS:()=>pn,MZ:()=>xn,Mp:()=>Ie,OG:()=>st,P9:()=>In,QV:()=>le,SV:()=>Me,S_:()=>H,Sg:()=>ct,TB:()=>K,V7:()=>zt,W1:()=>ge,X9:()=>Yt,gf:()=>be,p1:()=>ut,qm:()=>Sn,rT:()=>Gn,t3:()=>mn,ty:()=>Bn,yW:()=>Je,zJ:()=>m});var y=g(21932);const B="AbstractRule";const O="AbstractType";const W="Condition";const I="TypeDefinition";const v="ValueLiteral";const S="AbstractElement";function m(j){return ne.isInstance(j,S)}const N="ArrayLiteral";const D="ArrayType";const X="BooleanLiteral";function ae(j){return ne.isInstance(j,X)}const ue="Conjunction";function K(j){return ne.isInstance(j,ue)}const te="Disjunction";function de(j){return ne.isInstance(j,te)}const ye="Grammar";const Re="GrammarImport";const ee="InferredType";function H(j){return ne.isInstance(j,ee)}const oe="Interface";function le(j){return ne.isInstance(j,oe)}const _e="NamedArgument";const pe="Negation";function Xe(j){return ne.isInstance(j,pe)}const xe="NumberLiteral";const tt="Parameter";const Ze="ParameterReference";function Je(j){return ne.isInstance(j,Ze)}const C="ParserRule";function Z(j){return ne.isInstance(j,C)}const z="ReferenceType";const ce="ReturnType";function Ie(j){return ne.isInstance(j,ce)}const ve="SimpleType";function Pe(j){return ne.isInstance(j,ve)}const Ot="StringLiteral";const yt="TerminalRule";function pn(j){return ne.isInstance(j,yt)}const Ut="Type";function In(j){return ne.isInstance(j,Ut)}const Lt="TypeAttribute";const Ft="UnionType";const Gt="Action";function Cn(j){return ne.isInstance(j,Gt)}const We="Alternatives";function xn(j){return ne.isInstance(j,We)}const Pt="Assignment";function kn(j){return ne.isInstance(j,Pt)}const Ct="CharacterRange";function Fn(j){return ne.isInstance(j,Ct)}const Bt="CrossReference";function nt(j){return ne.isInstance(j,Bt)}const Wt="EndOfFile";function Gn(j){return ne.isInstance(j,Wt)}const Kt="Group";function Bn(j){return ne.isInstance(j,Kt)}const jt="Keyword";function ut(j){return ne.isInstance(j,jt)}const Vt="NegatedToken";function Ht(j){return ne.isInstance(j,Vt)}const kt="RegexToken";function ct(j){return ne.isInstance(j,kt)}const Tt="RuleCall";function mn(j){return ne.isInstance(j,Tt)}const vt="TerminalAlternatives";function zt(j){return ne.isInstance(j,vt)}const ht="TerminalGroup";function Yt(j){return ne.isInstance(j,ht)}const Et="TerminalRuleCall";function be(j){return ne.isInstance(j,Et)}const we="UnorderedGroup";function ge(j){return ne.isInstance(j,we)}const ze="UntilToken";function st(j){return ne.isInstance(j,ze)}const rt="Wildcard";function Sn(j){return ne.isInstance(j,rt)}class Me extends y.$v{getAllTypes(){return[S,B,O,Gt,We,N,D,Pt,X,Ct,W,ue,Bt,te,Wt,ye,Re,Kt,ee,oe,jt,_e,Vt,pe,xe,tt,Ze,C,z,kt,ce,Tt,ve,Ot,vt,ht,yt,Et,Ut,Lt,I,Ft,we,ze,v,rt]}computeIsSubtype(wt,Qe){switch(wt){case Gt:case We:case Pt:case Ct:case Bt:case Wt:case Kt:case jt:case Vt:case kt:case Tt:case vt:case ht:case Et:case we:case ze:case rt:return this.isSubtype(S,Qe);case N:case xe:case Ot:return this.isSubtype(v,Qe);case D:case z:case ve:case Ft:return this.isSubtype(I,Qe);case X:return this.isSubtype(W,Qe)||this.isSubtype(v,Qe);case ue:case te:case pe:case Ze:return this.isSubtype(W,Qe);case ee:case oe:case Ut:return this.isSubtype(O,Qe);case C:return this.isSubtype(B,Qe)||this.isSubtype(O,Qe);case yt:return this.isSubtype(B,Qe);default:return!1}}getReferenceType(wt){const Qe=`${wt.container.$type}:${wt.property}`;switch(Qe){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return O;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return B;case"Grammar:usedGrammars":return ye;case"NamedArgument:parameter":case"ParameterReference:parameter":return tt;case"TerminalRuleCall:rule":return yt;default:throw new Error(`${Qe} is not a valid reference id.`)}}getTypeMetaData(wt){switch(wt){case S:return{name:S,properties:[{name:"cardinality"},{name:"lookahead"}]};case N:return{name:N,properties:[{name:"elements",defaultValue:[]}]};case D:return{name:D,properties:[{name:"elementType"}]};case X:return{name:X,properties:[{name:"true",defaultValue:!1}]};case ue:return{name:ue,properties:[{name:"left"},{name:"right"}]};case te:return{name:te,properties:[{name:"left"},{name:"right"}]};case ye:return{name:ye,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 Re:return{name:Re,properties:[{name:"path"}]};case ee:return{name:ee,properties:[{name:"name"}]};case oe:return{name:oe,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case _e:return{name:_e,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case pe:return{name:pe,properties:[{name:"value"}]};case xe:return{name:xe,properties:[{name:"value"}]};case tt:return{name:tt,properties:[{name:"name"}]};case Ze:return{name:Ze,properties:[{name:"parameter"}]};case C:return{name:C,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 z:return{name:z,properties:[{name:"referenceType"}]};case ce:return{name:ce,properties:[{name:"name"}]};case ve:return{name:ve,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Ot:return{name:Ot,properties:[{name:"value"}]};case yt:return{name:yt,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Ut:return{name:Ut,properties:[{name:"name"},{name:"type"}]};case Lt:return{name:Lt,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Ft:return{name:Ft,properties:[{name:"types",defaultValue:[]}]};case Gt:return{name:Gt,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case We:return{name:We,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Pt:return{name:Pt,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Ct:return{name:Ct,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Bt:return{name:Bt,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Wt:return{name:Wt,properties:[{name:"cardinality"},{name:"lookahead"}]};case Kt:return{name:Kt,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case jt:return{name:jt,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Vt:return{name:Vt,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case kt:return{name:kt,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case Tt:return{name:Tt,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case vt:return{name:vt,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case ht:return{name:ht,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Et:return{name:Et,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case we:return{name:we,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case ze:return{name:ze,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case rt:return{name:rt,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:wt,properties:[]}}}}const ne=new Me},60197:(Ae,V,g)=>{g.d(V,{P:()=>W});var y=g(9196),L=g(48893),B=g(65406),k=g(47712),O=g(7657),M=g(5364);class W{constructor(){this.diagnostics=[]}buildTokens(A,T){const I=(0,M.Vw)((0,k.VD)(A,!1)),h=this.buildTerminalTokens(I),v=this.buildKeywordTokens(I,h,T);return h.forEach(E=>{const S=E.PATTERN;"object"==typeof S&&S&&"test"in S&&(0,O.cb)(S)?v.unshift(E):v.push(E)}),v}flushLexingReport(A){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const A=[...this.diagnostics];return this.diagnostics=[],A}buildTerminalTokens(A){return A.filter(L.MS).filter(T=>!T.fragment).map(T=>this.buildTerminalToken(T)).toArray()}buildTerminalToken(A){const T=(0,k.s1)(A),I=this.requiresCustomPattern(T)?this.regexPatternFunction(T):T,h={name:A.name,PATTERN:I};return"function"==typeof I&&(h.LINE_BREAKS=!0),A.hidden&&(h.GROUP=(0,O.cb)(T)?y.hW.SKIPPED:"hidden"),h}requiresCustomPattern(A){return!(!A.flags.includes("u")&&!A.flags.includes("s"))||!(!A.source.includes("?<=")&&!A.source.includes("?<!"))}regexPatternFunction(A){const T=new RegExp(A,A.flags+"y");return(I,h)=>(T.lastIndex=h,T.exec(I))}buildKeywordTokens(A,T,I){return A.filter(L.F9).flatMap(h=>(0,B.VY)(h).filter(L.p1)).distinct(h=>h.value).toArray().sort((h,v)=>v.value.length-h.value.length).map(h=>this.buildKeywordToken(h,T,Boolean(null==I?void 0:I.caseInsensitive)))}buildKeywordToken(A,T,I){const h=this.buildKeywordPattern(A,I),v={name:A.value,PATTERN:h,LONGER_ALT:this.findLongerAlt(A,T)};return"function"==typeof h&&(v.LINE_BREAKS=!0),v}buildKeywordPattern(A,T){return T?new RegExp((0,O.cp)(A.value)):A.value}findLongerAlt(A,T){return T.reduce((I,h)=>{const v=null==h?void 0:h.PATTERN;return(null==v?void 0:v.source)&&(0,O.XC)("^"+v.source+"$",A.value)&&I.push(h),I},[])}}},7043:(Ae,V,g)=>{g.d(V,{t:()=>B});var k,y=g(48893),L=g(47712);class B{convert(M,W){let F=W.grammarSource;if((0,y.Ki)(F)&&(F=(0,L.eN)(F)),(0,y.t3)(F)){const A=F.rule.ref;if(!A)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(A,M,W)}return M}runConverter(M,W,F){var A;switch(M.name.toUpperCase()){case"INT":return k.convertInt(W);case"STRING":return k.convertString(W);case"ID":return k.convertID(W)}switch(null===(A=(0,L.mJ)(M))||void 0===A?void 0:A.toLowerCase()){case"number":return k.convertNumber(W);case"boolean":return k.convertBoolean(W);case"bigint":return k.convertBigint(W);case"date":return k.convertDate(W);default:return W}}}!function(O){function W(E){switch(E){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"0":return"\0";default:return E}}O.convertString=function M(E){let S="";for(let m=1;m<E.length-1;m++){const N=E.charAt(m);if("\\"===N){S+=W(E.charAt(++m))}else S+=N}return S},O.convertID=function F(E){return"^"===E.charAt(0)?E.substring(1):E},O.convertInt=function A(E){return parseInt(E)},O.convertBigint=function T(E){return BigInt(E)},O.convertDate=function I(E){return new Date(E)},O.convertNumber=function h(E){return Number(E)},O.convertBoolean=function v(E){return"true"===E.toLowerCase()}}(k||(k={}))},21932:(Ae,V,g)=>{function y(A){return"object"==typeof A&&null!==A&&"string"==typeof A.$type}function L(A){return"object"==typeof A&&null!==A&&"string"==typeof A.$refText}function B(A){return"object"==typeof A&&null!==A&&"string"==typeof A.name&&"string"==typeof A.type&&"string"==typeof A.path}function k(A){return"object"==typeof A&&null!==A&&y(A.container)&&L(A.reference)&&"string"==typeof A.message}g.d(V,{$v:()=>O,SI:()=>B,U8:()=>F,Yk:()=>L,al:()=>M,dm:()=>W,et:()=>k,xA:()=>y});class O{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(T,I){return y(T)&&this.isSubtype(T.$type,I)}isSubtype(T,I){if(T===I)return!0;let h=this.subtypes[T];h||(h=this.subtypes[T]={});const v=h[I];if(void 0!==v)return v;{const E=this.computeIsSubtype(T,I);return h[I]=E,E}}getAllSubTypes(T){const I=this.allSubtypes[T];if(I)return I;{const h=this.getAllTypes(),v=[];for(const E of h)this.isSubtype(E,T)&&v.push(E);return this.allSubtypes[T]=v,v}}}function M(A){return"object"==typeof A&&null!==A&&Array.isArray(A.content)}function W(A){return"object"==typeof A&&null!==A&&"object"==typeof A.tokenType}function F(A){return M(A)&&"string"==typeof A.fullText}},65406:(Ae,V,g)=>{g.d(V,{E$:()=>F,Me:()=>W,VY:()=>T,V_:()=>O,Zc:()=>I,a1:()=>S,b2:()=>k,fy:()=>v,sx:()=>A});var y=g(21932),L=g(5364),B=g(6152);function k(P){for(const[D,b]of Object.entries(P))D.startsWith("$")||(Array.isArray(b)?b.forEach((X,ae)=>{(0,y.xA)(X)&&(X.$container=P,X.$containerProperty=D,X.$containerIndex=ae)}):(0,y.xA)(b)&&(b.$container=P,b.$containerProperty=D))}function O(P,D){let b=P;for(;b;){if(D(b))return b;b=b.$container}}function W(P){const b=F(P).$document;if(!b)throw new Error("AST node has no document.");return b}function F(P){for(;P.$container;)P=P.$container;return P}function A(P,D){if(!P)throw new Error("Node must be an AstNode.");const b=null==D?void 0:D.range;return new L.i(()=>({keys:Object.keys(P),keyIndex:0,arrayIndex:0}),X=>{for(;X.keyIndex<X.keys.length;){const ae=X.keys[X.keyIndex];if(!ae.startsWith("$")){const ue=P[ae];if((0,y.xA)(ue)){if(X.keyIndex++,h(ue,b))return{done:!1,value:ue}}else if(Array.isArray(ue)){for(;X.arrayIndex<ue.length;){const te=ue[X.arrayIndex++];if((0,y.xA)(te)&&h(te,b))return{done:!1,value:te}}X.arrayIndex=0}}X.keyIndex++}return L.Ry})}function T(P,D){if(!P)throw new Error("Root node must be an AstNode.");return new L.i8(P,b=>A(b,D))}function I(P,D){if(!P)throw new Error("Root node must be an AstNode.");return(null==D?void 0:D.range)&&!h(P,D.range)?new L.i8(P,()=>[]):new L.i8(P,b=>A(b,D),{includeRoot:!0})}function h(P,D){var b;if(!D)return!0;const X=null===(b=P.$cstNode)||void 0===b?void 0:b.range;return!!X&&(0,B.Z2)(X,D)}function v(P){return new L.i(()=>({keys:Object.keys(P),keyIndex:0,arrayIndex:0}),D=>{for(;D.keyIndex<D.keys.length;){const b=D.keys[D.keyIndex];if(!b.startsWith("$")){const X=P[b];if((0,y.Yk)(X))return D.keyIndex++,{done:!1,value:{reference:X,container:P,property:b}};if(Array.isArray(X)){for(;D.arrayIndex<X.length;){const ae=D.arrayIndex++,ue=X[ae];if((0,y.Yk)(ue))return{done:!1,value:{reference:ue,container:P,property:b,index:ae}}}D.arrayIndex=0}}D.keyIndex++}return L.Ry})}function S(P,D){const b=P.getTypeMetaData(D.$type),X=D;for(const ae of b.properties)void 0!==ae.defaultValue&&void 0===X[ae.name]&&(X[ae.name]=m(ae.defaultValue))}function m(P){return Array.isArray(P)?[...P.map(m)]:P}},6152:(Ae,V,g)=>{g.d(V,{LK:()=>v,OB:()=>O,Z2:()=>T,_t:()=>B,sp:()=>M,uz:()=>I,yn:()=>W});var F,K,y=g(21932),L=g(5364);function B(K){return new L.i8(K,te=>(0,y.al)(te)?te.content:[],{includeRoot:!0})}function O(K,te){for(;K.container;)if((K=K.container)===te)return!0;return!1}function M(K){return{start:{character:K.startColumn-1,line:K.startLine-1},end:{character:K.endColumn,line:K.endLine-1}}}function W(K){if(!K)return;const{offset:te,end:de,range:ye}=K;return{range:ye,offset:te,end:de,length:de-te}}function T(K,te){return function A(K,te){if(K.end.line<te.start.line||K.end.line===te.start.line&&K.end.character<=te.start.character)return F.Before;if(K.start.line>te.end.line||K.start.line===te.end.line&&K.start.character>=te.end.character)return F.After;const de=K.start.line>te.start.line||K.start.line===te.start.line&&K.start.character>=te.start.character,ye=K.end.line<te.end.line||K.end.line===te.end.line&&K.end.character<=te.end.character;return de&&ye?F.Inside:de?F.OverlapBack:ye?F.OverlapFront:F.Outside}(K,te)>F.After}(K=F||(F={}))[K.Before=0]="Before",K[K.After=1]="After",K[K.OverlapFront=2]="OverlapFront",K[K.OverlapBack=3]="OverlapBack",K[K.Inside=4]="Inside",K[K.Outside=5]="Outside";const I=/^[\w\p{L}]$/u;function v(K,te){if(K){const de=function P(K,te=!0){for(;K.container;){const de=K.container;let ye=de.content.indexOf(K);for(;ye>0;){ye--;const Se=de.content[ye];if(te||!Se.hidden)return Se}K=de}}(K,!0);if(de&&E(de,te))return de;if((0,y.U8)(K)){const ye=K.content.findIndex(Se=>!Se.hidden);for(let Se=ye-1;Se>=0;Se--){const Re=K.content[Se];if(E(Re,te))return Re}}}}function E(K,te){return(0,y.dm)(K)&&te.includes(K.tokenType.name)}},4408:(Ae,V,g)=>{g.d(V,{U:()=>L,h:()=>y});class y extends Error{constructor(k,O){super(k?`${O} at ${k.range.start.line}:${k.range.start.character}`:O)}}function L(B){throw new Error("Error! The input value was not handled.")}},47712:(Ae,V,g)=>{g.d(V,{$G:()=>Be,EL:()=>v,UP:()=>de,VD:()=>A,eN:()=>I,h7:()=>D,ib:()=>b,lA:()=>N,mJ:()=>le,md:()=>h,s1:()=>_e,vb:()=>E,z$:()=>ee});var y=g(4408),L=g(48893),B=g(21932),k=g(65406),O=g(6152),M=g(7657);function A(C,Z){const z=new Set,fe=function W(C){return C.rules.find(Z=>L.F9(Z)&&Z.entry)}(C);if(!fe)return new Set(C.rules);const ce=[fe].concat(function F(C){return C.rules.filter(Z=>L.MS(Z)&&Z.hidden)}(C));for(const ve of ce)T(ve,z,Z);const Ie=new Set;for(const ve of C.rules)(z.has(ve.name)||L.MS(ve)&&ve.hidden)&&Ie.add(ve);return Ie}function T(C,Z,z){Z.add(C.name),(0,k.VY)(C).forEach(fe=>{if(L.t3(fe)||z&&L.gf(fe)){const ce=fe.rule.ref;ce&&!Z.has(ce.name)&&T(ce,Z,z)}})}function I(C){if(C.terminal)return C.terminal;if(C.type.ref){const Z=b(C.type.ref);return null==Z?void 0:Z.terminal}}function h(C){return C.hidden&&!(0,M.cb)(_e(C))}function v(C,Z){return C&&Z?S(C,Z,C.astNode,!0):[]}function E(C,Z,z){if(!C||!Z)return;const fe=S(C,Z,C.astNode,!0);return 0!==fe.length?fe[z=void 0!==z?Math.max(0,Math.min(z,fe.length-1)):0]:void 0}function S(C,Z,z,fe){if(!fe){const ce=(0,k.V_)(C.grammarSource,L.B7);if(ce&&ce.feature===Z)return[C]}return(0,B.al)(C)&&C.astNode===z?C.content.flatMap(ce=>S(ce,Z,z,!1)):[]}function N(C,Z,z){if(!C)return;const fe=P(C,Z,null==C?void 0:C.astNode);return 0!==fe.length?fe[z=void 0!==z?Math.max(0,Math.min(z,fe.length-1)):0]:void 0}function P(C,Z,z){if(C.astNode!==z)return[];if(L.p1(C.grammarSource)&&C.grammarSource.value===Z)return[C];const fe=(0,O._t)(C).iterator();let ce;const Ie=[];do{if(ce=fe.next(),!ce.done){const ve=ce.value;ve.astNode===z?L.p1(ve.grammarSource)&&ve.grammarSource.value===Z&&Ie.push(ve):fe.prune()}}while(!ce.done);return Ie}function D(C){var Z;const z=C.astNode;for(;z===(null===(Z=C.container)||void 0===Z?void 0:Z.astNode);){const fe=(0,k.V_)(C.grammarSource,L.B7);if(fe)return fe;C=C.container}}function b(C){let Z=C;return L.S_(Z)&&(L.LG(Z.$container)?Z=Z.$container.$container:L.F9(Z.$container)?Z=Z.$container:(0,y.U)(Z.$container)),X(C,Z,new Map)}function X(C,Z,z){var fe;function ce(Ie,ve){let Pe;return(0,k.V_)(Ie,L.B7)||(Pe=X(ve,ve,z)),z.set(C,Pe),Pe}if(z.has(C))return z.get(C);z.set(C,void 0);for(const Ie of(0,k.VY)(Z)){if(L.B7(Ie)&&"name"===Ie.feature.toLowerCase())return z.set(C,Ie),Ie;if(L.t3(Ie)&&L.F9(Ie.rule.ref))return ce(Ie,Ie.rule.ref);if(L.Iy(Ie)&&(null===(fe=Ie.typeRef)||void 0===fe?void 0:fe.ref))return ce(Ie,Ie.typeRef.ref)}}function de(C){return ye(C,new Set)}function ye(C,Z){if(Z.has(C))return!0;Z.add(C);for(const z of(0,k.VY)(C))if(L.t3(z)){if(!z.rule.ref||L.F9(z.rule.ref)&&!ye(z.rule.ref,Z))return!1}else{if(L.B7(z))return!1;if(L.LG(z))return!1}return Boolean(C.definition)}function Be(C){if(C.inferredType)return C.inferredType.name;if(C.dataType)return C.dataType;if(C.returnType){const Z=C.returnType.ref;if(Z){if(L.F9(Z))return Z.name;if(L.QV(Z)||L.P9(Z))return Z.name}}}function ee(C){var Z;if(L.F9(C))return de(C)?C.name:null!==(Z=Be(C))&&void 0!==Z?Z:C.name;if(L.QV(C)||L.P9(C)||L.Mp(C))return C.name;if(L.LG(C)){const z=function H(C){var Z;if(C.inferredType)return C.inferredType.name;if(null===(Z=C.type)||void 0===Z?void 0:Z.ref)return ee(C.type.ref)}(C);if(z)return z}else if(L.S_(C))return C.name;throw new Error("Cannot get name of Unknown Type")}function le(C){var Z,z,fe;return L.MS(C)?null!==(z=null===(Z=C.type)||void 0===Z?void 0:Z.name)&&void 0!==z?z:"string":null!==(fe=Be(C))&&void 0!==fe?fe:C.name}function _e(C){const Z={s:!1,i:!1,u:!1},z=pe(C.definition,Z),fe=Object.entries(Z).filter(([,ce])=>ce).map(([ce])=>ce).join("");return new RegExp(z,fe)}const Te=/[\s\S]/.source;function pe(C,Z){if(L.V7(C))return function Xe(C){return Je(C.elements.map(Z=>pe(Z)).join("|"),{cardinality:C.cardinality,lookahead:C.lookahead})}(C);if(L.X9(C))return function xe(C){return Je(C.elements.map(Z=>pe(Z)).join(""),{cardinality:C.cardinality,lookahead:C.lookahead})}(C);if(L.Bf(C))return function lt(C){return C.right?Je(`[${Ze(C.left)}-${Ze(C.right)}]`,{cardinality:C.cardinality,lookahead:C.lookahead,wrap:!1}):Je(Ze(C.left),{cardinality:C.cardinality,lookahead:C.lookahead,wrap:!1})}(C);if(L.gf(C)){const z=C.rule.ref;if(!z)throw new Error("Missing rule reference.");return Je(pe(z.definition),{cardinality:C.cardinality,lookahead:C.lookahead})}if(L.Bi(C))return function tt(C){return Je(`(?!${pe(C.terminal)})${Te}*?`,{cardinality:C.cardinality,lookahead:C.lookahead})}(C);if(L.OG(C))return function De(C){return Je(`${Te}*?${pe(C.terminal)}`,{cardinality:C.cardinality,lookahead:C.lookahead})}(C);if(L.Sg(C)){const z=C.regex.lastIndexOf("/"),fe=C.regex.substring(1,z),ce=C.regex.substring(z+1);return Z&&(Z.i=ce.includes("i"),Z.s=ce.includes("s"),Z.u=ce.includes("u")),Je(fe,{cardinality:C.cardinality,lookahead:C.lookahead,wrap:!1})}if(L.qm(C))return Je(Te,{cardinality:C.cardinality,lookahead:C.lookahead});throw new Error(`Invalid terminal element: ${null==C?void 0:C.$type}`)}function Ze(C){return(0,M.hr)(C.value)}function Je(C,Z){var z;return(!1!==Z.wrap||Z.lookahead)&&(C=`(${null!==(z=Z.lookahead)&&void 0!==z?z:""}${C})`),Z.cardinality?`${C}${Z.cardinality}`:C}},7657:(Ae,V,g)=>{g.d(V,{K0:()=>L,Rn:()=>W,XC:()=>h,cb:()=>A,cp:()=>I,hr:()=>T});var y=g(17790);const L=/\r?\n/gm,B=new y.O;class k extends y.e{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(S){this.multiline=!1,this.regex=S,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(S){S.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(S){const m=String.fromCharCode(S.value);if(!this.multiline&&"\n"===m&&(this.multiline=!0),S.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const N=T(m);this.endRegexpStack.push(N),this.isStarting&&(this.startRegexp+=N)}}visitSet(S){if(!this.multiline){const m=this.regex.substring(S.loc.begin,S.loc.end),N=new RegExp(m);this.multiline=Boolean("\n".match(N))}if(S.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const m=this.regex.substring(S.loc.begin,S.loc.end);this.endRegexpStack.push(m),this.isStarting&&(this.startRegexp+=m)}}visitChildren(S){"Group"===S.type&&S.quantifier||super.visitChildren(S)}}const O=new k;function W(E){try{return"string"==typeof E&&(E=new RegExp(E)),E=E.toString(),O.reset(E),O.visit(B.pattern(E)),O.multiline}catch{return!1}}const F="\f\n\r\t\v \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff".split("");function A(E){const S="string"==typeof E?new RegExp(E):E;return F.some(m=>S.test(m))}function T(E){return E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(E){return Array.prototype.map.call(E,S=>/\w/.test(S)?`[${S.toLowerCase()}${S.toUpperCase()}]`:T(S)).join("")}function h(E,S){const m=function v(E){"string"==typeof E&&(E=new RegExp(E));const S=E,m=E.source;let N=0;function P(){let b,D="";function X(ue){D+=m.substr(N,ue),N+=ue}function ae(ue){D+="(?:"+m.substr(N,ue)+"|$)",N+=ue}for(;N<m.length;)switch(m[N]){case"\\":switch(m[N+1]){case"c":ae(3);break;case"x":ae(4);break;case"u":S.unicode?"{"===m[N+2]?ae(m.indexOf("}",N)-N+1):ae(6):ae(2);break;case"p":case"P":S.unicode?ae(m.indexOf("}",N)-N+1):ae(2);break;case"k":ae(m.indexOf(">",N)-N+1);break;default:ae(2)}break;case"[":b=/\[(?:\\.|.)*?\]/g,b.lastIndex=N,b=b.exec(m)||[],ae(b[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":X(1);break;case"{":b=/\{\d+,?\d*\}/g,b.lastIndex=N,b=b.exec(m),b?X(b[0].length):ae(1);break;case"(":if("?"===m[N+1])switch(m[N+2]){case":":D+="(?:",N+=3,D+=P()+"|$)";break;case"=":D+="(?=",N+=3,D+=P()+")";break;case"!":b=N,N+=3,P(),D+=m.substr(b,N-b);break;case"<":switch(m[N+3]){case"=":case"!":b=N,N+=4,P(),D+=m.substr(b,N-b);break;default:X(m.indexOf(">",N)-N+1),D+=P()+"|$)"}}else X(1),D+=P()+"|$)";break;case")":return++N,D;default:ae(1)}return D}return new RegExp(P(),E.flags)}(E),N=S.match(m);return!!N&&N[0].length>0}},5364:(Ae,V,g)=>{g.d(V,{Cl:()=>k,IH:()=>F,Ry:()=>O,Vw:()=>M,i:()=>y,i8:()=>W});class y{constructor(T,I){this.startFn=T,this.nextFn=I}iterator(){const T={state:this.startFn(),next:()=>this.nextFn(T.state),[Symbol.iterator]:()=>T};return T}[Symbol.iterator](){return this.iterator()}isEmpty(){const T=this.iterator();return Boolean(T.next().done)}count(){const T=this.iterator();let I=0,h=T.next();for(;!h.done;)I++,h=T.next();return I}toArray(){const T=[],I=this.iterator();let h;do{h=I.next(),void 0!==h.value&&T.push(h.value)}while(!h.done);return T}toSet(){return new Set(this)}toMap(T,I){const h=this.map(v=>[T?T(v):v,I?I(v):v]);return new Map(h)}toString(){return this.join()}concat(T){return new y(()=>({first:this.startFn(),firstDone:!1,iterator:T[Symbol.iterator]()}),I=>{let h;if(!I.firstDone){do{if(h=this.nextFn(I.first),!h.done)return h}while(!h.done);I.firstDone=!0}do{if(h=I.iterator.next(),!h.done)return h}while(!h.done);return O})}join(T=","){const I=this.iterator();let v,h="",E=!1;do{v=I.next(),v.done||(E&&(h+=T),h+="string"==typeof(A=v.value)?A:typeof A>"u"?"undefined":"function"==typeof A.toString?A.toString():Object.prototype.toString.call(A)),E=!0}while(!v.done);var A;return h}indexOf(T,I=0){const h=this.iterator();let v=0,E=h.next();for(;!E.done;){if(v>=I&&E.value===T)return v;E=h.next(),v++}return-1}every(T){const I=this.iterator();let h=I.next();for(;!h.done;){if(!T(h.value))return!1;h=I.next()}return!0}some(T){const I=this.iterator();let h=I.next();for(;!h.done;){if(T(h.value))return!0;h=I.next()}return!1}forEach(T){const I=this.iterator();let h=0,v=I.next();for(;!v.done;)T(v.value,h),v=I.next(),h++}map(T){return new y(this.startFn,I=>{const{done:h,value:v}=this.nextFn(I);return h?O:{done:!1,value:T(v)}})}filter(T){return new y(this.startFn,I=>{let h;do{if(h=this.nextFn(I),!h.done&&T(h.value))return h}while(!h.done);return O})}nonNullable(){return this.filter(T=>null!=T)}reduce(T,I){const h=this.iterator();let v=I,E=h.next();for(;!E.done;)v=void 0===v?E.value:T(v,E.value),E=h.next();return v}reduceRight(T,I){return this.recursiveReduce(this.iterator(),T,I)}recursiveReduce(T,I,h){const v=T.next();if(v.done)return h;const E=this.recursiveReduce(T,I,h);return void 0===E?v.value:I(E,v.value)}find(T){const I=this.iterator();let h=I.next();for(;!h.done;){if(T(h.value))return h.value;h=I.next()}}findIndex(T){const I=this.iterator();let h=0,v=I.next();for(;!v.done;){if(T(v.value))return h;v=I.next(),h++}return-1}includes(T){const I=this.iterator();let h=I.next();for(;!h.done;){if(h.value===T)return!0;h=I.next()}return!1}flatMap(T){return new y(()=>({this:this.startFn()}),I=>{do{if(I.iterator){const E=I.iterator.next();if(!E.done)return E;I.iterator=void 0}const{done:h,value:v}=this.nextFn(I.this);if(!h){const E=T(v);if(!B(E))return{done:!1,value:E};I.iterator=E[Symbol.iterator]()}}while(I.iterator);return O})}flat(T){if(void 0===T&&(T=1),T<=0)return this;const I=T>1?this.flat(T-1):this;return new y(()=>({this:I.startFn()}),h=>{do{if(h.iterator){const S=h.iterator.next();if(!S.done)return S;h.iterator=void 0}const{done:v,value:E}=I.nextFn(h.this);if(!v){if(!B(E))return{done:!1,value:E};h.iterator=E[Symbol.iterator]()}}while(h.iterator);return O})}head(){const I=this.iterator().next();if(!I.done)return I.value}tail(T=1){return new y(()=>{const I=this.startFn();for(let h=0;h<T;h++)if(this.nextFn(I).done)return I;return I},this.nextFn)}limit(T){return new y(()=>({size:0,state:this.startFn()}),I=>(I.size++,I.size>T?O:this.nextFn(I.state)))}distinct(T){return new y(()=>({set:new Set,internalState:this.startFn()}),I=>{let h;do{if(h=this.nextFn(I.internalState),!h.done){const v=T?T(h.value):h.value;if(!I.set.has(v))return I.set.add(v),h}}while(!h.done);return O})}exclude(T,I){const h=new Set;for(const v of T){const E=I?I(v):v;h.add(E)}return this.filter(v=>{const E=I?I(v):v;return!h.has(E)})}}function B(A){return!!A&&"function"==typeof A[Symbol.iterator]}const k=new y(()=>{},()=>O),O=Object.freeze({done:!0,value:void 0});function M(...A){if(1===A.length){const T=A[0];if(T instanceof y)return T;if(B(T))return new y(()=>T[Symbol.iterator](),I=>I.next());if("number"==typeof T.length)return new y(()=>({index:0}),I=>I.index<T.length?{done:!1,value:T[I.index++]}:O)}return A.length>1?new y(()=>({collIndex:0,arrIndex:0}),T=>{do{if(T.iterator){const I=T.iterator.next();if(!I.done)return I;T.iterator=void 0}if(T.array){if(T.arrIndex<T.array.length)return{done:!1,value:T.array[T.arrIndex++]};T.array=void 0,T.arrIndex=0}if(T.collIndex<A.length){const I=A[T.collIndex++];B(I)?T.iterator=I[Symbol.iterator]():I&&"number"==typeof I.length&&(T.array=I)}}while(T.iterator||T.array||T.collIndex<A.length);return O}):k}class W extends y{constructor(T,I,h){super(()=>({iterators:(null==h?void 0:h.includeRoot)?[[T][Symbol.iterator]()]:[I(T)[Symbol.iterator]()],pruned:!1}),v=>{for(v.pruned&&(v.iterators.pop(),v.pruned=!1);v.iterators.length>0;){const S=v.iterators[v.iterators.length-1].next();if(!S.done)return v.iterators.push(I(S.value)[Symbol.iterator]()),S;v.iterators.pop()}return O})}iterator(){const T={state:this.startFn(),next:()=>this.nextFn(T.state),prune:()=>{T.state.pruned=!0},[Symbol.iterator]:()=>T};return T}}var F,A;(A=F||(F={})).sum=function T(E){return E.reduce((S,m)=>S+m,0)},A.product=function I(E){return E.reduce((S,m)=>S*m,0)},A.min=function h(E){return E.reduce((S,m)=>Math.min(S,m))},A.max=function v(E){return E.reduce((S,m)=>Math.max(S,m))}},66066:(Ae,V,g)=>{g.d(V,{u:()=>B});var y=g(53420);class L{readFile(){throw new Error("No file system is available.")}readDirectory(){return(0,y.Z)(function*(){return[]})()}}const B={fileSystemProvider:()=>new L}},87885:(Ae,V,g)=>{g.d(V,{Z:()=>B});var y=g(95546);const B=function L(k,O,M){for(var W=-1,F=k.length;++W<F;){var A=k[W],T=O(A);if(null!=T&&(void 0===I?T==T&&!(0,y.Z)(T):M(T,I)))var I=T,h=A}return h}},99711:(Ae,V,g)=>{g.d(V,{Z:()=>L});const L=function y(B,k){return B<k}},36464:(Ae,V,g)=>{g.d(V,{Z:()=>k});var y=g(36527),L=g(84929);const k=function B(O,M){var W=-1,F=(0,L.Z)(O)?Array(O.length):[];return(0,y.Z)(O,function(A,T,I){F[++W]=M(A,T,I)}),F}},41064:(Ae,V,g)=>{g.d(V,{Z:()=>T});var y=g(28078),L=g(61551),B=g(16888),k=g(57538),O=g(82293),M=g(25883);const F=function W(I,h,v,E){if(!(0,O.Z)(I))return I;for(var S=-1,m=(h=(0,B.Z)(h,I)).length,N=m-1,P=I;null!=P&&++S<m;){var D=(0,M.Z)(h[S]),b=v;if("__proto__"===D||"constructor"===D||"prototype"===D)return I;if(S!=N){var X=P[D];void 0===(b=E?E(X,D,P):void 0)&&(b=(0,O.Z)(X)?X:(0,k.Z)(h[S+1])?[]:{})}(0,L.Z)(P,D,b),P=P[D]}return I};const T=function A(I,h,v){for(var E=-1,S=h.length,m={};++E<S;){var N=h[E],P=(0,y.Z)(I,N);v(P,N)&&F(m,(0,B.Z)(N,I),P)}return m}},38884:(Ae,V,g)=>{g.d(V,{Z:()=>k});var y=g(69052);const k=function B(O){return(0,y.Z)(O,4)}},38424:(Ae,V,g)=>{g.d(V,{Z:()=>F});var y=g(55663),L=g(66267),B=g(15980),k=g(32888),O=Object.prototype,M=O.hasOwnProperty;const F=(0,y.Z)(function(A,T){A=Object(A);var I=-1,h=T.length,v=h>2?T[2]:void 0;for(v&&(0,B.Z)(T[0],T[1],v)&&(h=1);++I<h;)for(var E=T[I],S=(0,k.Z)(E),m=-1,N=S.length;++m<N;){var P=S[m],D=A[P];(void 0===D||(0,L.Z)(D,O[P])&&!M.call(A,P))&&(A[P]=E[P])}return A})},171:(Ae,V,g)=>{g.d(V,{Z:()=>h});var y=g(65960),L=g(84929),B=g(41270);const O=function k(v){return function(E,S,m){var N=Object(E);if(!(0,L.Z)(E)){var P=(0,y.Z)(S,3);E=(0,B.Z)(E),S=function(b){return P(N[b],b,N)}}var D=v(E,S,m);return D>-1?N[P?E[D]:D]:void 0}};var M=g(87278),W=g(72001),F=Math.max;const h=O(function A(v,E,S){var m=null==v?0:v.length;if(!m)return-1;var N=null==S?0:(0,W.Z)(S);return N<0&&(N=F(m+N,0)),(0,M.Z)(v,(0,y.Z)(E,3),N)})},53026:(Ae,V,g)=>{g.d(V,{Z:()=>k});var y=g(31066),L=g(99211);const k=function B(O,M){return(0,y.Z)((0,L.Z)(O,M),1)}},28744:(Ae,V,g)=>{g.d(V,{Z:()=>B});var y=g(31066);const B=function L(k){return(null==k?0:k.length)?(0,y.Z)(k,1):[]}},26279:(Ae,V,g)=>{g.d(V,{Z:()=>W});var L=Object.prototype.hasOwnProperty;const k=function B(F,A){return null!=F&&L.call(F,A)};var O=g(28443);const W=function M(F,A){return null!=F&&(0,O.Z)(F,A,k)}},3311:(Ae,V,g)=>{g.d(V,{Z:()=>M});var y=g(45004),L=g(43390),B=g(13343);const M=function O(W){return"string"==typeof W||!(0,L.Z)(W)&&(0,B.Z)(W)&&"[object String]"==(0,y.Z)(W)}},13668:(Ae,V,g)=>{g.d(V,{Z:()=>L});const L=function y(B){var k=null==B?0:B.length;return k?B[k-1]:void 0}},99211:(Ae,V,g)=>{g.d(V,{Z:()=>M});var y=g(98647),L=g(65960),B=g(36464),k=g(43390);const M=function O(W,F){return((0,k.Z)(W)?y.Z:B.Z)(W,(0,L.Z)(F,3))}},48007:(Ae,V,g)=>{g.d(V,{Z:()=>O});var y=g(87885),L=g(99711),B=g(15278);const O=function k(M){return M&&M.length?(0,y.Z)(M,B.Z,L.Z):void 0}},39924:(Ae,V,g)=>{g.d(V,{Z:()=>D});var y=/\s/;const B=function L(b){for(var X=b.length;X--&&y.test(b.charAt(X)););return X};var k=/^\s+/;const M=function O(b){return b&&b.slice(0,B(b)+1).replace(k,"")};var W=g(82293),F=g(95546),T=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,h=/^0o[0-7]+$/i,v=parseInt;const S=function E(b){if("number"==typeof b)return b;if((0,F.Z)(b))return NaN;if((0,W.Z)(b)){var X="function"==typeof b.valueOf?b.valueOf():b;b=(0,W.Z)(X)?X+"":X}if("string"!=typeof b)return 0===b?b:+b;b=M(b);var ae=I.test(b);return ae||h.test(b)?v(b.slice(2),ae?2:8):T.test(b)?NaN:+b};var m=1/0;const D=function P(b){return b?(b=S(b))===m||b===-m?17976931348623157e292*(b<0?-1:1):b==b?b:0:0===b?b:0}},72001:(Ae,V,g)=>{g.d(V,{Z:()=>B});var y=g(39924);const B=function L(k){var O=(0,y.Z)(k),M=O%1;return O==O?M?O-M:O:0}}}]);