- Refactor D3D12 backend and RenderGraph module - Update graphics RHI and core rendering components - Add Random.hlsl shader include - Regenerate API documentation and update user guides
161 lines
450 KiB
JavaScript
161 lines
450 KiB
JavaScript
import{A as Pe,B as hu,C as er,D as vt,G as nm,I as Mt,L as Fe,M as _n,O as Fo,R as Ks,S as im,a as Be,b as Pr,c as lt,d as We,e as Ae,g as Or,i as Vs,j as In,k as mr,l as Ve,m as rn,n as L,o as Et,p as at,q as Lr,r as ut,s as I,t as ft,w as rm,x as F,y as dt,z as $e}from"./chunk-R5JLOOQ4.min.js";import{d as Z}from"./chunk-PTL4EUOE.min.js";import{M as pu,d as tm,e as hr,z as Je}from"./chunk-E5F23VE2.min.js";import{a as rE,b as Y,c as tn,d as se,e as fu,f as du}from"./chunk-VBFLGJ4I.min.js";var il={};tn(il,{AnnotatedTextEdit:()=>Yr,ChangeAnnotation:()=>ni,ChangeAnnotationIdentifier:()=>ot,CodeAction:()=>Rd,CodeActionContext:()=>Td,CodeActionKind:()=>yd,CodeActionTriggerKind:()=>qa,CodeDescription:()=>Hf,CodeLens:()=>xd,Color:()=>Jc,ColorInformation:()=>zf,ColorPresentation:()=>jf,Command:()=>ii,CompletionItem:()=>sd,CompletionItemKind:()=>Zf,CompletionItemLabelDetails:()=>id,CompletionItemTag:()=>td,CompletionList:()=>ad,CreateFile:()=>is,DeleteFile:()=>as,Diagnostic:()=>Ma,DiagnosticRelatedInformation:()=>Qc,DiagnosticSeverity:()=>Vf,DiagnosticTag:()=>Kf,DocumentHighlight:()=>fd,DocumentHighlightKind:()=>ud,DocumentLink:()=>vd,DocumentSymbol:()=>gd,DocumentUri:()=>Gf,EOL:()=>wA,FoldingRange:()=>Wf,FoldingRangeKind:()=>Bf,FormattingOptions:()=>Ed,Hover:()=>od,InlayHint:()=>_d,InlayHintKind:()=>rl,InlayHintLabelPart:()=>nl,InlineCompletionContext:()=>Md,InlineCompletionItem:()=>Pd,InlineCompletionList:()=>Od,InlineCompletionTriggerKind:()=>Ld,InlineValueContext:()=>Id,InlineValueEvaluatableExpression:()=>wd,InlineValueText:()=>Cd,InlineValueVariableLookup:()=>Nd,InsertReplaceEdit:()=>rd,InsertTextFormat:()=>ed,InsertTextMode:()=>nd,Location:()=>Da,LocationLink:()=>qf,MarkedString:()=>Ua,MarkupContent:()=>os,MarkupKind:()=>tl,OptionalVersionedTextDocumentIdentifier:()=>Ga,ParameterInformation:()=>cd,Position:()=>oe,Range:()=>ne,RenameFile:()=>ss,SelectedCompletionInfo:()=>Dd,SelectionRange:()=>Ad,SemanticTokenModifiers:()=>Sd,SemanticTokenTypes:()=>$d,SemanticTokens:()=>kd,SignatureInformation:()=>ld,StringValue:()=>bd,SymbolInformation:()=>hd,SymbolKind:()=>dd,SymbolTag:()=>pd,TextDocument:()=>Gd,TextDocumentEdit:()=>Fa,TextDocumentIdentifier:()=>Xf,TextDocumentItem:()=>Qf,TextEdit:()=>vr,URI:()=>Xc,VersionedTextDocumentIdentifier:()=>Jf,WorkspaceChange:()=>Yf,WorkspaceEdit:()=>Zc,WorkspaceFolder:()=>Fd,WorkspaceSymbol:()=>md,integer:()=>Uf,uinteger:()=>La});var Gf,Xc,Uf,La,oe,ne,Da,qf,Jc,zf,jf,Bf,Wf,Qc,Vf,Kf,Hf,Ma,ii,vr,ni,ot,Yr,Fa,is,ss,as,Zc,ns,el,Yf,Xf,Jf,Ga,Qf,tl,os,Zf,ed,td,rd,nd,id,sd,ad,Ua,od,cd,ld,ud,fd,dd,pd,hd,md,gd,yd,qa,Td,Rd,xd,Ed,vd,Ad,$d,Sd,kd,Cd,Nd,wd,Id,rl,nl,_d,bd,Pd,Od,Ld,Dd,Md,Fd,wA,Gd,Ud,m,cs=rE(()=>{"use strict";(function(t){function e(r){return typeof r=="string"}t.is=e})(Gf||(Gf={}));(function(t){function e(r){return typeof r=="string"}t.is=e})(Xc||(Xc={}));(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Uf||(Uf={}));(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(La||(La={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=La.MAX_VALUE),i===Number.MAX_VALUE&&(i=La.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&m.uinteger(i.line)&&m.uinteger(i.character)}t.is=r})(oe||(oe={}));(function(t){function e(n,i,s,a){if(m.uinteger(n)&&m.uinteger(i)&&m.uinteger(s)&&m.uinteger(a))return{start:oe.create(n,i),end:oe.create(s,a)};if(oe.is(n)&&oe.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${s}, ${a}]`)}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&oe.is(i.start)&&oe.is(i.end)}t.is=r})(ne||(ne={}));(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&ne.is(i.range)&&(m.string(i.uri)||m.undefined(i.uri))}t.is=r})(Da||(Da={}));(function(t){function e(n,i,s,a){return{targetUri:n,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&ne.is(i.targetRange)&&m.string(i.targetUri)&&ne.is(i.targetSelectionRange)&&(ne.is(i.originSelectionRange)||m.undefined(i.originSelectionRange))}t.is=r})(qf||(qf={}));(function(t){function e(n,i,s,a){return{red:n,green:i,blue:s,alpha:a}}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&m.numberRange(i.red,0,1)&&m.numberRange(i.green,0,1)&&m.numberRange(i.blue,0,1)&&m.numberRange(i.alpha,0,1)}t.is=r})(Jc||(Jc={}));(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&ne.is(i.range)&&Jc.is(i.color)}t.is=r})(zf||(zf={}));(function(t){function e(n,i,s){return{label:n,textEdit:i,additionalTextEdits:s}}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&m.string(i.label)&&(m.undefined(i.textEdit)||vr.is(i))&&(m.undefined(i.additionalTextEdits)||m.typedArray(i.additionalTextEdits,vr.is))}t.is=r})(jf||(jf={}));(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Bf||(Bf={}));(function(t){function e(n,i,s,a,o,c){let l={startLine:n,endLine:i};return m.defined(s)&&(l.startCharacter=s),m.defined(a)&&(l.endCharacter=a),m.defined(o)&&(l.kind=o),m.defined(c)&&(l.collapsedText=c),l}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&m.uinteger(i.startLine)&&m.uinteger(i.startLine)&&(m.undefined(i.startCharacter)||m.uinteger(i.startCharacter))&&(m.undefined(i.endCharacter)||m.uinteger(i.endCharacter))&&(m.undefined(i.kind)||m.string(i.kind))}t.is=r})(Wf||(Wf={}));(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return m.defined(i)&&Da.is(i.location)&&m.string(i.message)}t.is=r})(Qc||(Qc={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Vf||(Vf={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(Kf||(Kf={}));(function(t){function e(r){let n=r;return m.objectLiteral(n)&&m.string(n.href)}t.is=e})(Hf||(Hf={}));(function(t){function e(n,i,s,a,o,c){let l={range:n,message:i};return m.defined(s)&&(l.severity=s),m.defined(a)&&(l.code=a),m.defined(o)&&(l.source=o),m.defined(c)&&(l.relatedInformation=c),l}t.create=e;function r(n){var i;let s=n;return m.defined(s)&&ne.is(s.range)&&m.string(s.message)&&(m.number(s.severity)||m.undefined(s.severity))&&(m.integer(s.code)||m.string(s.code)||m.undefined(s.code))&&(m.undefined(s.codeDescription)||m.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(m.string(s.source)||m.undefined(s.source))&&(m.undefined(s.relatedInformation)||m.typedArray(s.relatedInformation,Qc.is))}t.is=r})(Ma||(Ma={}));(function(t){function e(n,i,...s){let a={title:n,command:i};return m.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function r(n){let i=n;return m.defined(i)&&m.string(i.title)&&m.string(i.command)}t.is=r})(ii||(ii={}));(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function r(s,a){return{range:{start:s,end:s},newText:a}}t.insert=r;function n(s){return{range:s,newText:""}}t.del=n;function i(s){let a=s;return m.objectLiteral(a)&&m.string(a.newText)&&ne.is(a.range)}t.is=i})(vr||(vr={}));(function(t){function e(n,i,s){let a={label:n};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&m.string(i.label)&&(m.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(m.string(i.description)||i.description===void 0)}t.is=r})(ni||(ni={}));(function(t){function e(r){let n=r;return m.string(n)}t.is=e})(ot||(ot={}));(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function r(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=r;function n(s,a){return{range:s,newText:"",annotationId:a}}t.del=n;function i(s){let a=s;return vr.is(a)&&(ni.is(a.annotationId)||ot.is(a.annotationId))}t.is=i})(Yr||(Yr={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return m.defined(i)&&Ga.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Fa||(Fa={}));(function(t){function e(n,i,s){let a={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&m.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||m.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||m.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ot.is(i.annotationId))}t.is=r})(is||(is={}));(function(t){function e(n,i,s,a){let o={kind:"rename",oldUri:n,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&m.string(i.oldUri)&&m.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||m.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||m.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ot.is(i.annotationId))}t.is=r})(ss||(ss={}));(function(t){function e(n,i,s){let a={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&m.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||m.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||m.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||ot.is(i.annotationId))}t.is=r})(as||(as={}));(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>m.string(i.kind)?is.is(i)||ss.is(i)||as.is(i):Fa.is(i)))}t.is=e})(Zc||(Zc={}));ns=class{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,s;if(n===void 0?i=vr.insert(e,r):ot.is(n)?(s=n,i=Yr.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(n),i=Yr.insert(e,r,s)),this.edits.push(i),s!==void 0)return s}replace(e,r,n){let i,s;if(n===void 0?i=vr.replace(e,r):ot.is(n)?(s=n,i=Yr.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(n),i=Yr.replace(e,r,s)),this.edits.push(i),s!==void 0)return s}delete(e,r){let n,i;if(r===void 0?n=vr.del(e):ot.is(r)?(i=r,n=Yr.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=Yr.del(e,i)),this.edits.push(n),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},el=class{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,r){let n;if(ot.is(e)?n=e:(n=this.nextId(),r=e),this._annotations[n]!==void 0)throw new Error(`Id ${n} is already in use.`);if(r===void 0)throw new Error(`No annotation provided for id ${n}`);return this._annotations[n]=r,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},Yf=class{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new el(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Fa.is(r)){let n=new ns(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{let n=new ns(e.changes[r]);this._textEditChanges[r]=n})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Ga.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r={uri:e.uri,version:e.version},n=this._textEditChanges[r.uri];if(!n){let i=[],s={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(s),n=new ns(i,this._changeAnnotations),this._textEditChanges[r.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let r=this._textEditChanges[e];if(!r){let n=[];this._workspaceEdit.changes[e]=n,r=new ns(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new el,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;ni.is(r)||ot.is(r)?i=r:n=r;let s,a;if(i===void 0?s=is.create(e,n):(a=ot.is(i)?i:this._changeAnnotations.manage(i),s=is.create(e,n,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}renameFile(e,r,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;ni.is(n)||ot.is(n)?s=n:i=n;let a,o;if(s===void 0?a=ss.create(e,r,i):(o=ot.is(s)?s:this._changeAnnotations.manage(s),a=ss.create(e,r,i,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;ni.is(r)||ot.is(r)?i=r:n=r;let s,a;if(i===void 0?s=as.create(e,n):(a=ot.is(i)?i:this._changeAnnotations.manage(i),s=as.create(e,n,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}};(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return m.defined(i)&&m.string(i.uri)}t.is=r})(Xf||(Xf={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return m.defined(i)&&m.string(i.uri)&&m.integer(i.version)}t.is=r})(Jf||(Jf={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return m.defined(i)&&m.string(i.uri)&&(i.version===null||m.integer(i.version))}t.is=r})(Ga||(Ga={}));(function(t){function e(n,i,s,a){return{uri:n,languageId:i,version:s,text:a}}t.create=e;function r(n){let i=n;return m.defined(i)&&m.string(i.uri)&&m.string(i.languageId)&&m.integer(i.version)&&m.string(i.text)}t.is=r})(Qf||(Qf={}));(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(tl||(tl={}));(function(t){function e(r){let n=r;return m.objectLiteral(r)&&tl.is(n.kind)&&m.string(n.value)}t.is=e})(os||(os={}));(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Zf||(Zf={}));(function(t){t.PlainText=1,t.Snippet=2})(ed||(ed={}));(function(t){t.Deprecated=1})(td||(td={}));(function(t){function e(n,i,s){return{newText:n,insert:i,replace:s}}t.create=e;function r(n){let i=n;return i&&m.string(i.newText)&&ne.is(i.insert)&&ne.is(i.replace)}t.is=r})(rd||(rd={}));(function(t){t.asIs=1,t.adjustIndentation=2})(nd||(nd={}));(function(t){function e(r){let n=r;return n&&(m.string(n.detail)||n.detail===void 0)&&(m.string(n.description)||n.description===void 0)}t.is=e})(id||(id={}));(function(t){function e(r){return{label:r}}t.create=e})(sd||(sd={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(ad||(ad={}));(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return m.string(i)||m.objectLiteral(i)&&m.string(i.language)&&m.string(i.value)}t.is=r})(Ua||(Ua={}));(function(t){function e(r){let n=r;return!!n&&m.objectLiteral(n)&&(os.is(n.contents)||Ua.is(n.contents)||m.typedArray(n.contents,Ua.is))&&(r.range===void 0||ne.is(r.range))}t.is=e})(od||(od={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(cd||(cd={}));(function(t){function e(r,n,...i){let s={label:r};return m.defined(n)&&(s.documentation=n),m.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(ld||(ld={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(ud||(ud={}));(function(t){function e(r,n){let i={range:r};return m.number(n)&&(i.kind=n),i}t.create=e})(fd||(fd={}));(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(dd||(dd={}));(function(t){t.Deprecated=1})(pd||(pd={}));(function(t){function e(r,n,i,s,a){let o={name:r,kind:n,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(hd||(hd={}));(function(t){function e(r,n,i,s){return s!==void 0?{name:r,kind:n,location:{uri:i,range:s}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(md||(md={}));(function(t){function e(n,i,s,a,o,c){let l={name:n,detail:i,kind:s,range:a,selectionRange:o};return c!==void 0&&(l.children=c),l}t.create=e;function r(n){let i=n;return i&&m.string(i.name)&&m.number(i.kind)&&ne.is(i.range)&&ne.is(i.selectionRange)&&(i.detail===void 0||m.string(i.detail))&&(i.deprecated===void 0||m.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(gd||(gd={}));(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(yd||(yd={}));(function(t){t.Invoked=1,t.Automatic=2})(qa||(qa={}));(function(t){function e(n,i,s){let a={diagnostics:n};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function r(n){let i=n;return m.defined(i)&&m.typedArray(i.diagnostics,Ma.is)&&(i.only===void 0||m.typedArray(i.only,m.string))&&(i.triggerKind===void 0||i.triggerKind===qa.Invoked||i.triggerKind===qa.Automatic)}t.is=r})(Td||(Td={}));(function(t){function e(n,i,s){let a={title:n},o=!0;return typeof i=="string"?(o=!1,a.kind=i):ii.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function r(n){let i=n;return i&&m.string(i.title)&&(i.diagnostics===void 0||m.typedArray(i.diagnostics,Ma.is))&&(i.kind===void 0||m.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||ii.is(i.command))&&(i.isPreferred===void 0||m.boolean(i.isPreferred))&&(i.edit===void 0||Zc.is(i.edit))}t.is=r})(Rd||(Rd={}));(function(t){function e(n,i){let s={range:n};return m.defined(i)&&(s.data=i),s}t.create=e;function r(n){let i=n;return m.defined(i)&&ne.is(i.range)&&(m.undefined(i.command)||ii.is(i.command))}t.is=r})(xd||(xd={}));(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return m.defined(i)&&m.uinteger(i.tabSize)&&m.boolean(i.insertSpaces)}t.is=r})(Ed||(Ed={}));(function(t){function e(n,i,s){return{range:n,target:i,data:s}}t.create=e;function r(n){let i=n;return m.defined(i)&&ne.is(i.range)&&(m.undefined(i.target)||m.string(i.target))}t.is=r})(vd||(vd={}));(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&ne.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Ad||(Ad={}));(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})($d||($d={}));(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Sd||(Sd={}));(function(t){function e(r){let n=r;return m.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(kd||(kd={}));(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&ne.is(i.range)&&m.string(i.text)}t.is=r})(Cd||(Cd={}));(function(t){function e(n,i,s){return{range:n,variableName:i,caseSensitiveLookup:s}}t.create=e;function r(n){let i=n;return i!=null&&ne.is(i.range)&&m.boolean(i.caseSensitiveLookup)&&(m.string(i.variableName)||i.variableName===void 0)}t.is=r})(Nd||(Nd={}));(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&ne.is(i.range)&&(m.string(i.expression)||i.expression===void 0)}t.is=r})(wd||(wd={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return m.defined(i)&&ne.is(n.stoppedLocation)}t.is=r})(Id||(Id={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(rl||(rl={}));(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&(i.tooltip===void 0||m.string(i.tooltip)||os.is(i.tooltip))&&(i.location===void 0||Da.is(i.location))&&(i.command===void 0||ii.is(i.command))}t.is=r})(nl||(nl={}));(function(t){function e(n,i,s){let a={position:n,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function r(n){let i=n;return m.objectLiteral(i)&&oe.is(i.position)&&(m.string(i.label)||m.typedArray(i.label,nl.is))&&(i.kind===void 0||rl.is(i.kind))&&i.textEdits===void 0||m.typedArray(i.textEdits,vr.is)&&(i.tooltip===void 0||m.string(i.tooltip)||os.is(i.tooltip))&&(i.paddingLeft===void 0||m.boolean(i.paddingLeft))&&(i.paddingRight===void 0||m.boolean(i.paddingRight))}t.is=r})(_d||(_d={}));(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(bd||(bd={}));(function(t){function e(r,n,i,s){return{insertText:r,filterText:n,range:i,command:s}}t.create=e})(Pd||(Pd={}));(function(t){function e(r){return{items:r}}t.create=e})(Od||(Od={}));(function(t){t.Invoked=0,t.Automatic=1})(Ld||(Ld={}));(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Dd||(Dd={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Md||(Md={}));(function(t){function e(r){let n=r;return m.objectLiteral(n)&&Xc.is(n.uri)&&m.string(n.name)}t.is=e})(Fd||(Fd={}));wA=[`
|
|
`,`\r
|
|
`,"\r"];(function(t){function e(s,a,o,c){return new Ud(s,a,o,c)}t.create=e;function r(s){let a=s;return!!(m.defined(a)&&m.string(a.uri)&&(m.undefined(a.languageId)||m.string(a.languageId))&&m.uinteger(a.lineCount)&&m.func(a.getText)&&m.func(a.positionAt)&&m.func(a.offsetAt))}t.is=r;function n(s,a){let o=s.getText(),c=i(a,(f,p)=>{let h=f.range.start.line-p.range.start.line;return h===0?f.range.start.character-p.range.start.character:h}),l=o.length;for(let f=c.length-1;f>=0;f--){let p=c[f],h=s.offsetAt(p.range.start),g=s.offsetAt(p.range.end);if(g<=l)o=o.substring(0,h)+p.newText+o.substring(g,o.length);else throw new Error("Overlapping edit");l=h}return o}t.applyEdits=n;function i(s,a){if(s.length<=1)return s;let o=s.length/2|0,c=s.slice(0,o),l=s.slice(o);i(c,a),i(l,a);let f=0,p=0,h=0;for(;f<c.length&&p<l.length;)a(c[f],l[p])<=0?s[h++]=c[f++]:s[h++]=l[p++];for(;f<c.length;)s[h++]=c[f++];for(;p<l.length;)s[h++]=l[p++];return s}})(Gd||(Gd={}));Ud=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let s=r.charAt(i);n=s==="\r"||s===`
|
|
`,s==="\r"&&i+1<r.length&&r.charAt(i+1)===`
|
|
`&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return oe.create(0,e);for(;n<i;){let a=Math.floor((n+i)/2);r[a]>e?i=a:n=a+1}let s=n-1;return oe.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}};(function(t){let e=Object.prototype.toString;function r(g){return typeof g<"u"}t.defined=r;function n(g){return typeof g>"u"}t.undefined=n;function i(g){return g===!0||g===!1}t.boolean=i;function s(g){return e.call(g)==="[object String]"}t.string=s;function a(g){return e.call(g)==="[object Number]"}t.number=a;function o(g,k,N){return e.call(g)==="[object Number]"&&k<=g&&g<=N}t.numberRange=o;function c(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}t.integer=c;function l(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}t.uinteger=l;function f(g){return e.call(g)==="[object Function]"}t.func=f;function p(g){return g!==null&&typeof g=="object"}t.objectLiteral=p;function h(g,k){return Array.isArray(g)&&g.every(k)}t.typedArray=h})(m||(m={}))});var xn=Y(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});var Hd;function Yd(){if(Hd===void 0)throw new Error("No runtime abstraction layer installed");return Hd}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Hd=r}t.install=e})(Yd||(Yd={}));Xd.default=Yd});var fs=Y(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function qA(t){return t===!0||t===!1}mt.boolean=qA;function Yg(t){return typeof t=="string"||t instanceof String}mt.string=Yg;function zA(t){return typeof t=="number"||t instanceof Number}mt.number=zA;function jA(t){return t instanceof Error}mt.error=jA;function BA(t){return typeof t=="function"}mt.func=BA;function Xg(t){return Array.isArray(t)}mt.array=Xg;function WA(t){return Xg(t)&&t.every(e=>Yg(e))}mt.stringArray=WA});var li=Y(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.Emitter=ds.Event=void 0;var VA=xn(),Jg;(function(t){let e={dispose(){}};t.None=function(){return e}})(Jg||(ds.Event=Jg={}));var Jd=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,a=n.length;s<a;s++)try{r.push(n[s].apply(i[s],e))}catch(o){(0,VA.default)().console.error(o)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ll=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Jd),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ds.Emitter=ll;ll._noop=function(){}});var Ha=Y(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.CancellationTokenSource=ps.CancellationToken=void 0;var KA=xn(),HA=fs(),Qd=li(),ul;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Qd.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Qd.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||HA.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(ul||(ps.CancellationToken=ul={}));var YA=Object.freeze(function(t,e){let r=(0,KA.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),fl=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?YA:(this._emitter||(this._emitter=new Qd.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Zd=class{get token(){return this._token||(this._token=new fl),this._token}cancel(){this._token?this._token.cancel():this._token=ul.Cancelled}dispose(){this._token?this._token instanceof fl&&this._token.dispose():this._token=ul.None}};ps.CancellationTokenSource=Zd});var Np=Y(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.Message=z.NotificationType9=z.NotificationType8=z.NotificationType7=z.NotificationType6=z.NotificationType5=z.NotificationType4=z.NotificationType3=z.NotificationType2=z.NotificationType1=z.NotificationType0=z.NotificationType=z.RequestType9=z.RequestType8=z.RequestType7=z.RequestType6=z.RequestType5=z.RequestType4=z.RequestType3=z.RequestType2=z.RequestType1=z.RequestType=z.RequestType0=z.AbstractMessageSignature=z.ParameterStructures=z.ResponseError=z.ErrorCodes=void 0;var hi=fs(),ip;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(ip||(z.ErrorCodes=ip={}));var sp=class t extends Error{constructor(e,r,n){super(r),this.code=hi.number(e)?e:ip.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};z.ResponseError=sp;var Pt=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};z.ParameterStructures=Pt;Pt.auto=new Pt("auto");Pt.byPosition=new Pt("byPosition");Pt.byName=new Pt("byName");var ke=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Pt.auto}};z.AbstractMessageSignature=ke;var ap=class extends ke{constructor(e){super(e,0)}};z.RequestType0=ap;var op=class extends ke{constructor(e,r=Pt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};z.RequestType=op;var cp=class extends ke{constructor(e,r=Pt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};z.RequestType1=cp;var lp=class extends ke{constructor(e){super(e,2)}};z.RequestType2=lp;var up=class extends ke{constructor(e){super(e,3)}};z.RequestType3=up;var fp=class extends ke{constructor(e){super(e,4)}};z.RequestType4=fp;var dp=class extends ke{constructor(e){super(e,5)}};z.RequestType5=dp;var pp=class extends ke{constructor(e){super(e,6)}};z.RequestType6=pp;var hp=class extends ke{constructor(e){super(e,7)}};z.RequestType7=hp;var mp=class extends ke{constructor(e){super(e,8)}};z.RequestType8=mp;var gp=class extends ke{constructor(e){super(e,9)}};z.RequestType9=gp;var yp=class extends ke{constructor(e,r=Pt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};z.NotificationType=yp;var Tp=class extends ke{constructor(e){super(e,0)}};z.NotificationType0=Tp;var Rp=class extends ke{constructor(e,r=Pt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};z.NotificationType1=Rp;var xp=class extends ke{constructor(e){super(e,2)}};z.NotificationType2=xp;var Ep=class extends ke{constructor(e){super(e,3)}};z.NotificationType3=Ep;var vp=class extends ke{constructor(e){super(e,4)}};z.NotificationType4=vp;var Ap=class extends ke{constructor(e){super(e,5)}};z.NotificationType5=Ap;var $p=class extends ke{constructor(e){super(e,6)}};z.NotificationType6=$p;var Sp=class extends ke{constructor(e){super(e,7)}};z.NotificationType7=Sp;var kp=class extends ke{constructor(e){super(e,8)}};z.NotificationType8=kp;var Cp=class extends ke{constructor(e){super(e,9)}};z.NotificationType9=Cp;var ly;(function(t){function e(i){let s=i;return s&&hi.string(s.method)&&(hi.string(s.id)||hi.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&hi.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(hi.string(s.id)||hi.number(s.id)||s.id===null)}t.isResponse=n})(ly||(z.Message=ly={}))});var Ip=Y(En=>{"use strict";var uy;Object.defineProperty(En,"__esModule",{value:!0});En.LRUCache=En.LinkedMap=En.Touch=void 0;var yt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(yt||(En.Touch=yt={}));var Tl=class{constructor(){this[uy]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=yt.None){let n=this._map.get(e);if(n)return r!==yt.None&&this.touch(n,r),n.value}set(e,r,n=yt.None){let i=this._map.get(e);if(i)i.value=r,n!==yt.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case yt.None:this.addItemLast(i);break;case yt.First:this.addItemFirst(i);break;case yt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(uy=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==yt.First&&r!==yt.Last)){if(r===yt.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===yt.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};En.LinkedMap=Tl;var wp=class extends Tl{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=yt.AsNew){return super.get(e,r)}peek(e){return super.get(e,yt.None)}set(e,r){return super.set(e,r,yt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};En.LRUCache=wp});var dy=Y(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.Disposable=void 0;var fy;(function(t){function e(r){return{dispose:r}}t.create=e})(fy||(Rl.Disposable=fy={}))});var py=Y(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.SharedArrayReceiverStrategy=xs.SharedArraySenderStrategy=void 0;var QA=Ha(),po;(function(t){t.Continue=0,t.Cancelled=1})(po||(po={}));var _p=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=po.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,po.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};xs.SharedArraySenderStrategy=_p;var bp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===po.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Pp=class{constructor(e){this.token=new bp(e)}cancel(){}dispose(){}},Op=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new QA.CancellationTokenSource:new Pp(r)}};xs.SharedArrayReceiverStrategy=Op});var Dp=Y(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.Semaphore=void 0;var ZA=xn(),Lp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,ZA.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};xl.Semaphore=Lp});var my=Y(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ReadableStreamMessageReader=vn.AbstractMessageReader=vn.MessageReader=void 0;var Fp=xn(),Es=fs(),Mp=li(),e$=Dp(),hy;(function(t){function e(r){let n=r;return n&&Es.func(n.listen)&&Es.func(n.dispose)&&Es.func(n.onError)&&Es.func(n.onClose)&&Es.func(n.onPartialMessage)}t.is=e})(hy||(vn.MessageReader=hy={}));var El=class{constructor(){this.errorEmitter=new Mp.Emitter,this.closeEmitter=new Mp.Emitter,this.partialMessageEmitter=new Mp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Es.string(e.message)?e.message:"unknown"}`)}};vn.AbstractMessageReader=El;var Gp;(function(t){function e(r){let n,i,s,a=new Map,o,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,a.set(s.name,s)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)a.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(o=r.contentTypeDecoder,c.set(o.name,o)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return o===void 0&&(o=(0,Fp.default)().applicationJson.decoder,c.set(o.name,o)),{charset:n,contentDecoder:s,contentDecoders:a,contentTypeDecoder:o,contentTypeDecoders:c}}t.fromOptions=e})(Gp||(Gp={}));var Up=class extends El{constructor(e,r){super(),this.readable=e,this.options=Gp.fromOptions(r),this.buffer=(0,Fp.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new e$.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Fp.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};vn.ReadableStreamMessageReader=Up});var xy=Y(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.WriteableStreamMessageWriter=An.AbstractMessageWriter=An.MessageWriter=void 0;var gy=xn(),ho=fs(),t$=Dp(),yy=li(),r$="Content-Length: ",Ty=`\r
|
|
`,Ry;(function(t){function e(r){let n=r;return n&&ho.func(n.dispose)&&ho.func(n.onClose)&&ho.func(n.onError)&&ho.func(n.write)}t.is=e})(Ry||(An.MessageWriter=Ry={}));var vl=class{constructor(){this.errorEmitter=new yy.Emitter,this.closeEmitter=new yy.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ho.string(e.message)?e.message:"unknown"}`)}};An.AbstractMessageWriter=vl;var qp;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,gy.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,gy.default)().applicationJson.encoder}}t.fromOptions=e})(qp||(qp={}));var zp=class extends vl{constructor(e,r){super(),this.writable=e,this.options=qp.fromOptions(r),this.errorCount=0,this.writeSemaphore=new t$.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(r$,n.byteLength.toString(),Ty),i.push(Ty),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};An.WriteableStreamMessageWriter=zp});var Ey=Y(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.AbstractMessageBuffer=void 0;var n$=13,i$=10,s$=`\r
|
|
`,jp=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(i=0;i<l.length;){switch(l[i]){case n$:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case i$:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=l.byteLength,n++}if(r!==4)return;let a=this._read(s+i),o=new Map,c=this.toString(a,"ascii").split(s$);if(c.length<2)return o;for(let l=0;l<c.length-2;l++){let f=c[l],p=f.indexOf(":");if(p===-1)throw new Error(`Message header must separate key and value using ':'
|
|
${f}`);let h=f.substr(0,p),g=f.substr(p+1).trim();o.set(e?h.toLowerCase():h,g)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],a=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,a}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let a=s.slice(0,e);r.set(a,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};Al.AbstractMessageBuffer=jp});var ky=Y(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.createMessageConnection=X.ConnectionOptions=X.MessageStrategy=X.CancellationStrategy=X.CancellationSenderStrategy=X.CancellationReceiverStrategy=X.RequestCancellationReceiverStrategy=X.IdCancellationReceiverStrategy=X.ConnectionStrategy=X.ConnectionError=X.ConnectionErrors=X.LogTraceNotification=X.SetTraceNotification=X.TraceFormat=X.TraceValues=X.Trace=X.NullLogger=X.ProgressType=X.ProgressToken=void 0;var vy=xn(),De=fs(),V=Np(),Ay=Ip(),mo=li(),Bp=Ha(),To;(function(t){t.type=new V.NotificationType("$/cancelRequest")})(To||(To={}));var Wp;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Wp||(X.ProgressToken=Wp={}));var go;(function(t){t.type=new V.NotificationType("$/progress")})(go||(go={}));var Vp=class{constructor(){}};X.ProgressType=Vp;var Kp;(function(t){function e(r){return De.func(r)}t.is=e})(Kp||(Kp={}));X.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ue;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ue||(X.Trace=ue={}));var $y;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})($y||(X.TraceValues=$y={}));(function(t){function e(n){if(!De.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ue||(X.Trace=ue={}));var jt;(function(t){t.Text="text",t.JSON="json"})(jt||(X.TraceFormat=jt={}));(function(t){function e(r){return De.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(jt||(X.TraceFormat=jt={}));var Hp;(function(t){t.type=new V.NotificationType("$/setTrace")})(Hp||(X.SetTraceNotification=Hp={}));var $l;(function(t){t.type=new V.NotificationType("$/logTrace")})($l||(X.LogTraceNotification=$l={}));var yo;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(yo||(X.ConnectionErrors=yo={}));var vs=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};X.ConnectionError=vs;var Yp;(function(t){function e(r){let n=r;return n&&De.func(n.cancelUndispatched)}t.is=e})(Yp||(X.ConnectionStrategy=Yp={}));var Sl;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&De.func(n.createCancellationTokenSource)&&(n.dispose===void 0||De.func(n.dispose))}t.is=e})(Sl||(X.IdCancellationReceiverStrategy=Sl={}));var Xp;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&De.func(n.createCancellationTokenSource)&&(n.dispose===void 0||De.func(n.dispose))}t.is=e})(Xp||(X.RequestCancellationReceiverStrategy=Xp={}));var kl;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Bp.CancellationTokenSource}});function e(r){return Sl.is(r)||Xp.is(r)}t.is=e})(kl||(X.CancellationReceiverStrategy=kl={}));var Cl;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(To.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&De.func(n.sendCancellation)&&De.func(n.cleanup)}t.is=e})(Cl||(X.CancellationSenderStrategy=Cl={}));var Nl;(function(t){t.Message=Object.freeze({receiver:kl.Message,sender:Cl.Message});function e(r){let n=r;return n&&kl.is(n.receiver)&&Cl.is(n.sender)}t.is=e})(Nl||(X.CancellationStrategy=Nl={}));var wl;(function(t){function e(r){let n=r;return n&&De.func(n.handleMessage)}t.is=e})(wl||(X.MessageStrategy=wl={}));var Sy;(function(t){function e(r){let n=r;return n&&(Nl.is(n.cancellationStrategy)||Yp.is(n.connectionStrategy)||wl.is(n.messageStrategy))}t.is=e})(Sy||(X.ConnectionOptions=Sy={}));var cr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(cr||(cr={}));function a$(t,e,r,n){let i=r!==void 0?r:X.NullLogger,s=0,a=0,o=0,c="2.0",l,f=new Map,p,h=new Map,g=new Map,k,N=new Ay.LinkedMap,q=new Map,D=new Set,b=new Map,v=ue.Off,K=jt.Text,G,he=cr.New,fr=new mo.Emitter,Ye=new mo.Emitter,Jt=new mo.Emitter,Wt=new mo.Emitter,$=new mo.Emitter,y=n&&n.cancellationStrategy?n.cancellationStrategy:Nl.Message;function O(d){if(d===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+d.toString()}function P(d){return d===null?"res-unknown-"+(++o).toString():"res-"+d.toString()}function T(){return"not-"+(++a).toString()}function x(d,E){V.Message.isRequest(E)?d.set(O(E.id),E):V.Message.isResponse(E)?d.set(P(E.id),E):d.set(T(),E)}function A(d){}function _(){return he===cr.Listening}function M(){return he===cr.Closed}function C(){return he===cr.Disposed}function H(){(he===cr.New||he===cr.Listening)&&(he=cr.Closed,Ye.fire(void 0))}function J(d){fr.fire([d,void 0,void 0])}function je(d){fr.fire(d)}t.onClose(H),t.onError(J),e.onClose(H),e.onError(je);function le(){k||N.size===0||(k=(0,vy.default)().timer.setImmediate(()=>{k=void 0,dr()}))}function _e(d){V.Message.isRequest(d)?wt(d):V.Message.isNotification(d)?Rt(d):V.Message.isResponse(d)?Zr(d):Qt(d)}function dr(){if(N.size===0)return;let d=N.shift();try{let E=n?.messageStrategy;wl.is(E)?E.handleMessage(d,_e):_e(d)}finally{le()}}let tt=d=>{try{if(V.Message.isNotification(d)&&d.method===To.type.method){let E=d.params.id,w=O(E),U=N.get(w);if(V.Message.isRequest(U)){let me=n?.connectionStrategy,Me=me&&me.cancelUndispatched?me.cancelUndispatched(U,A):void 0;if(Me&&(Me.error!==void 0||Me.result!==void 0)){N.delete(w),b.delete(E),Me.id=U.id,en(Me,d.method,Date.now()),e.write(Me).catch(()=>i.error("Sending response for canceled message failed."));return}}let ve=b.get(E);if(ve!==void 0){ve.cancel(),lu(d);return}else D.add(E)}x(N,d)}finally{le()}};function wt(d){if(C())return;function E(ae,be,pe){let Xe={jsonrpc:c,id:d.id};ae instanceof V.ResponseError?Xe.error=ae.toJson():Xe.result=ae===void 0?null:ae,en(Xe,be,pe),e.write(Xe).catch(()=>i.error("Sending response failed."))}function w(ae,be,pe){let Xe={jsonrpc:c,id:d.id,error:ae.toJson()};en(Xe,be,pe),e.write(Xe).catch(()=>i.error("Sending response failed."))}function U(ae,be,pe){ae===void 0&&(ae=null);let Xe={jsonrpc:c,id:d.id,result:ae};en(Xe,be,pe),e.write(Xe).catch(()=>i.error("Sending response failed."))}Mo(d);let ve=f.get(d.method),me,Me;ve&&(me=ve.type,Me=ve.handler);let qe=Date.now();if(Me||l){let ae=d.id??String(Date.now()),be=Sl.is(y.receiver)?y.receiver.createCancellationTokenSource(ae):y.receiver.createCancellationTokenSource(d);d.id!==null&&D.has(d.id)&&be.cancel(),d.id!==null&&b.set(ae,be);try{let pe;if(Me)if(d.params===void 0){if(me!==void 0&&me.numberOfParams!==0){w(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${d.method} defines ${me.numberOfParams} params but received none.`),d.method,qe);return}pe=Me(be.token)}else if(Array.isArray(d.params)){if(me!==void 0&&me.parameterStructures===V.ParameterStructures.byName){w(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by name but received parameters by position`),d.method,qe);return}pe=Me(...d.params,be.token)}else{if(me!==void 0&&me.parameterStructures===V.ParameterStructures.byPosition){w(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by position but received parameters by name`),d.method,qe);return}pe=Me(d.params,be.token)}else l&&(pe=l(d.method,d.params,be.token));let Xe=pe;pe?Xe.then?Xe.then(xt=>{b.delete(ae),E(xt,d.method,qe)},xt=>{b.delete(ae),xt instanceof V.ResponseError?w(xt,d.method,qe):xt&&De.string(xt.message)?w(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${xt.message}`),d.method,qe):w(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,qe)}):(b.delete(ae),E(pe,d.method,qe)):(b.delete(ae),U(pe,d.method,qe))}catch(pe){b.delete(ae),pe instanceof V.ResponseError?E(pe,d.method,qe):pe&&De.string(pe.message)?w(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${pe.message}`),d.method,qe):w(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,qe)}}else w(new V.ResponseError(V.ErrorCodes.MethodNotFound,`Unhandled method ${d.method}`),d.method,qe)}function Zr(d){if(!C())if(d.id===null)d.error?i.error(`Received response message without id: Error is:
|
|
${JSON.stringify(d.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let E=d.id,w=q.get(E);if(Qx(d,w),w!==void 0){q.delete(E);try{if(d.error){let U=d.error;w.reject(new V.ResponseError(U.code,U.message,U.data))}else if(d.result!==void 0)w.resolve(d.result);else throw new Error("Should never happen.")}catch(U){U.message?i.error(`Response handler '${w.method}' failed with message: ${U.message}`):i.error(`Response handler '${w.method}' failed unexpectedly.`)}}}}function Rt(d){if(C())return;let E,w;if(d.method===To.type.method){let U=d.params.id;D.delete(U),lu(d);return}else{let U=h.get(d.method);U&&(w=U.handler,E=U.type)}if(w||p)try{if(lu(d),w)if(d.params===void 0)E!==void 0&&E.numberOfParams!==0&&E.parameterStructures!==V.ParameterStructures.byName&&i.error(`Notification ${d.method} defines ${E.numberOfParams} params but received none.`),w();else if(Array.isArray(d.params)){let U=d.params;d.method===go.type.method&&U.length===2&&Wp.is(U[0])?w({token:U[0],value:U[1]}):(E!==void 0&&(E.parameterStructures===V.ParameterStructures.byName&&i.error(`Notification ${d.method} defines parameters by name but received parameters by position`),E.numberOfParams!==d.params.length&&i.error(`Notification ${d.method} defines ${E.numberOfParams} params but received ${U.length} arguments`)),w(...U))}else E!==void 0&&E.parameterStructures===V.ParameterStructures.byPosition&&i.error(`Notification ${d.method} defines parameters by position but received parameters by name`),w(d.params);else p&&p(d.method,d.params)}catch(U){U.message?i.error(`Notification handler '${d.method}' failed with message: ${U.message}`):i.error(`Notification handler '${d.method}' failed unexpectedly.`)}else Jt.fire(d)}function Qt(d){if(!d){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
|
${JSON.stringify(d,null,4)}`);let E=d;if(De.string(E.id)||De.number(E.id)){let w=E.id,U=q.get(w);U&&U.reject(new Error("The received response has neither a result nor an error property."))}}function st(d){if(d!=null)switch(v){case ue.Verbose:return JSON.stringify(d,null,4);case ue.Compact:return JSON.stringify(d);default:return}}function Zt(d){if(!(v===ue.Off||!G))if(K===jt.Text){let E;(v===ue.Verbose||v===ue.Compact)&&d.params&&(E=`Params: ${st(d.params)}
|
|
|
|
`),G.log(`Sending request '${d.method} - (${d.id})'.`,E)}else vi("send-request",d)}function br(d){if(!(v===ue.Off||!G))if(K===jt.Text){let E;(v===ue.Verbose||v===ue.Compact)&&(d.params?E=`Params: ${st(d.params)}
|
|
|
|
`:E=`No parameters provided.
|
|
|
|
`),G.log(`Sending notification '${d.method}'.`,E)}else vi("send-notification",d)}function en(d,E,w){if(!(v===ue.Off||!G))if(K===jt.Text){let U;(v===ue.Verbose||v===ue.Compact)&&(d.error&&d.error.data?U=`Error data: ${st(d.error.data)}
|
|
|
|
`:d.result?U=`Result: ${st(d.result)}
|
|
|
|
`:d.error===void 0&&(U=`No result returned.
|
|
|
|
`)),G.log(`Sending response '${E} - (${d.id})'. Processing request took ${Date.now()-w}ms`,U)}else vi("send-response",d)}function Mo(d){if(!(v===ue.Off||!G))if(K===jt.Text){let E;(v===ue.Verbose||v===ue.Compact)&&d.params&&(E=`Params: ${st(d.params)}
|
|
|
|
`),G.log(`Received request '${d.method} - (${d.id})'.`,E)}else vi("receive-request",d)}function lu(d){if(!(v===ue.Off||!G||d.method===$l.type.method))if(K===jt.Text){let E;(v===ue.Verbose||v===ue.Compact)&&(d.params?E=`Params: ${st(d.params)}
|
|
|
|
`:E=`No parameters provided.
|
|
|
|
`),G.log(`Received notification '${d.method}'.`,E)}else vi("receive-notification",d)}function Qx(d,E){if(!(v===ue.Off||!G))if(K===jt.Text){let w;if((v===ue.Verbose||v===ue.Compact)&&(d.error&&d.error.data?w=`Error data: ${st(d.error.data)}
|
|
|
|
`:d.result?w=`Result: ${st(d.result)}
|
|
|
|
`:d.error===void 0&&(w=`No result returned.
|
|
|
|
`)),E){let U=d.error?` Request failed: ${d.error.message} (${d.error.code}).`:"";G.log(`Received response '${E.method} - (${d.id})' in ${Date.now()-E.timerStart}ms.${U}`,w)}else G.log(`Received response ${d.id} without active response promise.`,w)}else vi("receive-response",d)}function vi(d,E){if(!G||v===ue.Off)return;let w={isLSPMessage:!0,type:d,message:E,timestamp:Date.now()};G.log(w)}function Bs(){if(M())throw new vs(yo.Closed,"Connection is closed.");if(C())throw new vs(yo.Disposed,"Connection is disposed.")}function Zx(){if(_())throw new vs(yo.AlreadyListening,"Connection is already listening")}function eE(){if(!_())throw new Error("Call listen() first.")}function Ws(d){return d===void 0?null:d}function Qh(d){if(d!==null)return d}function Zh(d){return d!=null&&!Array.isArray(d)&&typeof d=="object"}function uu(d,E){switch(d){case V.ParameterStructures.auto:return Zh(E)?Qh(E):[Ws(E)];case V.ParameterStructures.byName:if(!Zh(E))throw new Error("Received parameters by name but param is not an object literal.");return Qh(E);case V.ParameterStructures.byPosition:return[Ws(E)];default:throw new Error(`Unknown parameter structure ${d.toString()}`)}}function em(d,E){let w,U=d.numberOfParams;switch(U){case 0:w=void 0;break;case 1:w=uu(d.parameterStructures,E[0]);break;default:w=[];for(let ve=0;ve<E.length&&ve<U;ve++)w.push(Ws(E[ve]));if(E.length<U)for(let ve=E.length;ve<U;ve++)w.push(null);break}return w}let Ai={sendNotification:(d,...E)=>{Bs();let w,U;if(De.string(d)){w=d;let me=E[0],Me=0,qe=V.ParameterStructures.auto;V.ParameterStructures.is(me)&&(Me=1,qe=me);let ae=E.length,be=ae-Me;switch(be){case 0:U=void 0;break;case 1:U=uu(qe,E[Me]);break;default:if(qe===V.ParameterStructures.byName)throw new Error(`Received ${be} parameters for 'by Name' notification parameter structure.`);U=E.slice(Me,ae).map(pe=>Ws(pe));break}}else{let me=E;w=d.method,U=em(d,me)}let ve={jsonrpc:c,method:w,params:U};return br(ve),e.write(ve).catch(me=>{throw i.error("Sending notification failed."),me})},onNotification:(d,E)=>{Bs();let w;return De.func(d)?p=d:E&&(De.string(d)?(w=d,h.set(d,{type:void 0,handler:E})):(w=d.method,h.set(d.method,{type:d,handler:E}))),{dispose:()=>{w!==void 0?h.delete(w):p=void 0}}},onProgress:(d,E,w)=>{if(g.has(E))throw new Error(`Progress handler for token ${E} already registered`);return g.set(E,w),{dispose:()=>{g.delete(E)}}},sendProgress:(d,E,w)=>Ai.sendNotification(go.type,{token:E,value:w}),onUnhandledProgress:Wt.event,sendRequest:(d,...E)=>{Bs(),eE();let w,U,ve;if(De.string(d)){w=d;let ae=E[0],be=E[E.length-1],pe=0,Xe=V.ParameterStructures.auto;V.ParameterStructures.is(ae)&&(pe=1,Xe=ae);let xt=E.length;Bp.CancellationToken.is(be)&&(xt=xt-1,ve=be);let pr=xt-pe;switch(pr){case 0:U=void 0;break;case 1:U=uu(Xe,E[pe]);break;default:if(Xe===V.ParameterStructures.byName)throw new Error(`Received ${pr} parameters for 'by Name' request parameter structure.`);U=E.slice(pe,xt).map(tE=>Ws(tE));break}}else{let ae=E;w=d.method,U=em(d,ae);let be=d.numberOfParams;ve=Bp.CancellationToken.is(ae[be])?ae[be]:void 0}let me=s++,Me;ve&&(Me=ve.onCancellationRequested(()=>{let ae=y.sender.sendCancellation(Ai,me);return ae===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${me}`),Promise.resolve()):ae.catch(()=>{i.log(`Sending cancellation messages for id ${me} failed`)})}));let qe={jsonrpc:c,id:me,method:w,params:U};return Zt(qe),typeof y.sender.enableCancellation=="function"&&y.sender.enableCancellation(qe),new Promise(async(ae,be)=>{let pe=pr=>{ae(pr),y.sender.cleanup(me),Me?.dispose()},Xe=pr=>{be(pr),y.sender.cleanup(me),Me?.dispose()},xt={method:w,timerStart:Date.now(),resolve:pe,reject:Xe};try{await e.write(qe),q.set(me,xt)}catch(pr){throw i.error("Sending request failed."),xt.reject(new V.ResponseError(V.ErrorCodes.MessageWriteError,pr.message?pr.message:"Unknown reason")),pr}})},onRequest:(d,E)=>{Bs();let w=null;return Kp.is(d)?(w=void 0,l=d):De.string(d)?(w=null,E!==void 0&&(w=d,f.set(d,{handler:E,type:void 0}))):E!==void 0&&(w=d.method,f.set(d.method,{type:d,handler:E})),{dispose:()=>{w!==null&&(w!==void 0?f.delete(w):l=void 0)}}},hasPendingResponse:()=>q.size>0,trace:async(d,E,w)=>{let U=!1,ve=jt.Text;w!==void 0&&(De.boolean(w)?U=w:(U=w.sendNotification||!1,ve=w.traceFormat||jt.Text)),v=d,K=ve,v===ue.Off?G=void 0:G=E,U&&!M()&&!C()&&await Ai.sendNotification(Hp.type,{value:ue.toString(d)})},onError:fr.event,onClose:Ye.event,onUnhandledNotification:Jt.event,onDispose:$.event,end:()=>{e.end()},dispose:()=>{if(C())return;he=cr.Disposed,$.fire(void 0);let d=new V.ResponseError(V.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let E of q.values())E.reject(d);q=new Map,b=new Map,D=new Set,N=new Ay.LinkedMap,De.func(e.dispose)&&e.dispose(),De.func(t.dispose)&&t.dispose()},listen:()=>{Bs(),Zx(),he=cr.Listening,t.listen(tt)},inspect:()=>{(0,vy.default)().console.log("inspect")}};return Ai.onNotification($l.type,d=>{if(v===ue.Off||!G)return;let E=v===ue.Verbose||v===ue.Compact;G.log(d.message,E?d.verbose:void 0)}),Ai.onNotification(go.type,d=>{let E=g.get(d.token);E?E(d.value):Wt.fire(d)}),Ai}X.createMessageConnection=a$});var Il=Y(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.ProgressType=R.ProgressToken=R.createMessageConnection=R.NullLogger=R.ConnectionOptions=R.ConnectionStrategy=R.AbstractMessageBuffer=R.WriteableStreamMessageWriter=R.AbstractMessageWriter=R.MessageWriter=R.ReadableStreamMessageReader=R.AbstractMessageReader=R.MessageReader=R.SharedArrayReceiverStrategy=R.SharedArraySenderStrategy=R.CancellationToken=R.CancellationTokenSource=R.Emitter=R.Event=R.Disposable=R.LRUCache=R.Touch=R.LinkedMap=R.ParameterStructures=R.NotificationType9=R.NotificationType8=R.NotificationType7=R.NotificationType6=R.NotificationType5=R.NotificationType4=R.NotificationType3=R.NotificationType2=R.NotificationType1=R.NotificationType0=R.NotificationType=R.ErrorCodes=R.ResponseError=R.RequestType9=R.RequestType8=R.RequestType7=R.RequestType6=R.RequestType5=R.RequestType4=R.RequestType3=R.RequestType2=R.RequestType1=R.RequestType0=R.RequestType=R.Message=R.RAL=void 0;R.MessageStrategy=R.CancellationStrategy=R.CancellationSenderStrategy=R.CancellationReceiverStrategy=R.ConnectionError=R.ConnectionErrors=R.LogTraceNotification=R.SetTraceNotification=R.TraceFormat=R.TraceValues=R.Trace=void 0;var Ee=Np();Object.defineProperty(R,"Message",{enumerable:!0,get:function(){return Ee.Message}});Object.defineProperty(R,"RequestType",{enumerable:!0,get:function(){return Ee.RequestType}});Object.defineProperty(R,"RequestType0",{enumerable:!0,get:function(){return Ee.RequestType0}});Object.defineProperty(R,"RequestType1",{enumerable:!0,get:function(){return Ee.RequestType1}});Object.defineProperty(R,"RequestType2",{enumerable:!0,get:function(){return Ee.RequestType2}});Object.defineProperty(R,"RequestType3",{enumerable:!0,get:function(){return Ee.RequestType3}});Object.defineProperty(R,"RequestType4",{enumerable:!0,get:function(){return Ee.RequestType4}});Object.defineProperty(R,"RequestType5",{enumerable:!0,get:function(){return Ee.RequestType5}});Object.defineProperty(R,"RequestType6",{enumerable:!0,get:function(){return Ee.RequestType6}});Object.defineProperty(R,"RequestType7",{enumerable:!0,get:function(){return Ee.RequestType7}});Object.defineProperty(R,"RequestType8",{enumerable:!0,get:function(){return Ee.RequestType8}});Object.defineProperty(R,"RequestType9",{enumerable:!0,get:function(){return Ee.RequestType9}});Object.defineProperty(R,"ResponseError",{enumerable:!0,get:function(){return Ee.ResponseError}});Object.defineProperty(R,"ErrorCodes",{enumerable:!0,get:function(){return Ee.ErrorCodes}});Object.defineProperty(R,"NotificationType",{enumerable:!0,get:function(){return Ee.NotificationType}});Object.defineProperty(R,"NotificationType0",{enumerable:!0,get:function(){return Ee.NotificationType0}});Object.defineProperty(R,"NotificationType1",{enumerable:!0,get:function(){return Ee.NotificationType1}});Object.defineProperty(R,"NotificationType2",{enumerable:!0,get:function(){return Ee.NotificationType2}});Object.defineProperty(R,"NotificationType3",{enumerable:!0,get:function(){return Ee.NotificationType3}});Object.defineProperty(R,"NotificationType4",{enumerable:!0,get:function(){return Ee.NotificationType4}});Object.defineProperty(R,"NotificationType5",{enumerable:!0,get:function(){return Ee.NotificationType5}});Object.defineProperty(R,"NotificationType6",{enumerable:!0,get:function(){return Ee.NotificationType6}});Object.defineProperty(R,"NotificationType7",{enumerable:!0,get:function(){return Ee.NotificationType7}});Object.defineProperty(R,"NotificationType8",{enumerable:!0,get:function(){return Ee.NotificationType8}});Object.defineProperty(R,"NotificationType9",{enumerable:!0,get:function(){return Ee.NotificationType9}});Object.defineProperty(R,"ParameterStructures",{enumerable:!0,get:function(){return Ee.ParameterStructures}});var Jp=Ip();Object.defineProperty(R,"LinkedMap",{enumerable:!0,get:function(){return Jp.LinkedMap}});Object.defineProperty(R,"LRUCache",{enumerable:!0,get:function(){return Jp.LRUCache}});Object.defineProperty(R,"Touch",{enumerable:!0,get:function(){return Jp.Touch}});var o$=dy();Object.defineProperty(R,"Disposable",{enumerable:!0,get:function(){return o$.Disposable}});var Cy=li();Object.defineProperty(R,"Event",{enumerable:!0,get:function(){return Cy.Event}});Object.defineProperty(R,"Emitter",{enumerable:!0,get:function(){return Cy.Emitter}});var Ny=Ha();Object.defineProperty(R,"CancellationTokenSource",{enumerable:!0,get:function(){return Ny.CancellationTokenSource}});Object.defineProperty(R,"CancellationToken",{enumerable:!0,get:function(){return Ny.CancellationToken}});var wy=py();Object.defineProperty(R,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return wy.SharedArraySenderStrategy}});Object.defineProperty(R,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return wy.SharedArrayReceiverStrategy}});var Qp=my();Object.defineProperty(R,"MessageReader",{enumerable:!0,get:function(){return Qp.MessageReader}});Object.defineProperty(R,"AbstractMessageReader",{enumerable:!0,get:function(){return Qp.AbstractMessageReader}});Object.defineProperty(R,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Qp.ReadableStreamMessageReader}});var Zp=xy();Object.defineProperty(R,"MessageWriter",{enumerable:!0,get:function(){return Zp.MessageWriter}});Object.defineProperty(R,"AbstractMessageWriter",{enumerable:!0,get:function(){return Zp.AbstractMessageWriter}});Object.defineProperty(R,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Zp.WriteableStreamMessageWriter}});var c$=Ey();Object.defineProperty(R,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c$.AbstractMessageBuffer}});var ct=ky();Object.defineProperty(R,"ConnectionStrategy",{enumerable:!0,get:function(){return ct.ConnectionStrategy}});Object.defineProperty(R,"ConnectionOptions",{enumerable:!0,get:function(){return ct.ConnectionOptions}});Object.defineProperty(R,"NullLogger",{enumerable:!0,get:function(){return ct.NullLogger}});Object.defineProperty(R,"createMessageConnection",{enumerable:!0,get:function(){return ct.createMessageConnection}});Object.defineProperty(R,"ProgressToken",{enumerable:!0,get:function(){return ct.ProgressToken}});Object.defineProperty(R,"ProgressType",{enumerable:!0,get:function(){return ct.ProgressType}});Object.defineProperty(R,"Trace",{enumerable:!0,get:function(){return ct.Trace}});Object.defineProperty(R,"TraceValues",{enumerable:!0,get:function(){return ct.TraceValues}});Object.defineProperty(R,"TraceFormat",{enumerable:!0,get:function(){return ct.TraceFormat}});Object.defineProperty(R,"SetTraceNotification",{enumerable:!0,get:function(){return ct.SetTraceNotification}});Object.defineProperty(R,"LogTraceNotification",{enumerable:!0,get:function(){return ct.LogTraceNotification}});Object.defineProperty(R,"ConnectionErrors",{enumerable:!0,get:function(){return ct.ConnectionErrors}});Object.defineProperty(R,"ConnectionError",{enumerable:!0,get:function(){return ct.ConnectionError}});Object.defineProperty(R,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return ct.CancellationReceiverStrategy}});Object.defineProperty(R,"CancellationSenderStrategy",{enumerable:!0,get:function(){return ct.CancellationSenderStrategy}});Object.defineProperty(R,"CancellationStrategy",{enumerable:!0,get:function(){return ct.CancellationStrategy}});Object.defineProperty(R,"MessageStrategy",{enumerable:!0,get:function(){return ct.MessageStrategy}});var l$=xn();R.RAL=l$.default});var _y=Y(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});var kr=Il(),_l=class t extends kr.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}};_l.emptyBuffer=new Uint8Array(0);var eh=class{constructor(e){this.socket=e,this._onData=new kr.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,kr.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),kr.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),kr.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),kr.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}},th=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),kr.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),kr.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),kr.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},u$=new TextEncoder,Iy=Object.freeze({messageBuffer:Object.freeze({create:t=>new _l(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(u$.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new eh(t),asWritableStream:t=>new th(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function rh(){return Iy}(function(t){function e(){kr.RAL.install(Iy)}t.install=e})(rh||(rh={}));nh.default=rh});var mi=Y(Bt=>{"use strict";var f$=Bt&&Bt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d$=Bt&&Bt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f$(e,t,r)};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.createMessageConnection=Bt.BrowserMessageWriter=Bt.BrowserMessageReader=void 0;var p$=_y();p$.default.install();var As=Il();d$(Il(),Bt);var ih=class extends As.AbstractMessageReader{constructor(e){super(),this._onData=new As.Emitter,this._messageListener=r=>{this._onData.fire(r.data)},e.addEventListener("error",r=>this.fireError(r)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}};Bt.BrowserMessageReader=ih;var sh=class extends As.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Bt.BrowserMessageWriter=sh;function h$(t,e,r,n){return r===void 0&&(r=As.NullLogger),As.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,As.createMessageConnection)(t,e,r,n)}Bt.createMessageConnection=h$});var ah=Y((Fb,by)=>{"use strict";by.exports=mi()});var Ie=Y(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.ProtocolNotificationType=Ot.ProtocolNotificationType0=Ot.ProtocolRequestType=Ot.ProtocolRequestType0=Ot.RegistrationType=Ot.MessageDirection=void 0;var $s=mi(),Py;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Py||(Ot.MessageDirection=Py={}));var oh=class{constructor(e){this.method=e}};Ot.RegistrationType=oh;var ch=class extends $s.RequestType0{constructor(e){super(e)}};Ot.ProtocolRequestType0=ch;var lh=class extends $s.RequestType{constructor(e){super(e,$s.ParameterStructures.byName)}};Ot.ProtocolRequestType=lh;var uh=class extends $s.NotificationType0{constructor(e){super(e)}};Ot.ProtocolNotificationType0=uh;var fh=class extends $s.NotificationType{constructor(e){super(e,$s.ParameterStructures.byName)}};Ot.ProtocolNotificationType=fh});var bl=Y(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.objectLiteral=He.typedArray=He.stringArray=He.array=He.func=He.error=He.number=He.string=He.boolean=void 0;function m$(t){return t===!0||t===!1}He.boolean=m$;function Oy(t){return typeof t=="string"||t instanceof String}He.string=Oy;function g$(t){return typeof t=="number"||t instanceof Number}He.number=g$;function y$(t){return t instanceof Error}He.error=y$;function T$(t){return typeof t=="function"}He.func=T$;function Ly(t){return Array.isArray(t)}He.array=Ly;function R$(t){return Ly(t)&&t.every(e=>Oy(e))}He.stringArray=R$;function x$(t,e){return Array.isArray(t)&&t.every(e)}He.typedArray=x$;function E$(t){return t!==null&&typeof t=="object"}He.objectLiteral=E$});var Fy=Y(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.ImplementationRequest=void 0;var Dy=Ie(),My;(function(t){t.method="textDocument/implementation",t.messageDirection=Dy.MessageDirection.clientToServer,t.type=new Dy.ProtocolRequestType(t.method)})(My||(Pl.ImplementationRequest=My={}))});var qy=Y(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.TypeDefinitionRequest=void 0;var Gy=Ie(),Uy;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Gy.MessageDirection.clientToServer,t.type=new Gy.ProtocolRequestType(t.method)})(Uy||(Ol.TypeDefinitionRequest=Uy={}))});var By=Y(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.DidChangeWorkspaceFoldersNotification=Ss.WorkspaceFoldersRequest=void 0;var Ll=Ie(),zy;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Ll.MessageDirection.serverToClient,t.type=new Ll.ProtocolRequestType0(t.method)})(zy||(Ss.WorkspaceFoldersRequest=zy={}));var jy;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Ll.MessageDirection.clientToServer,t.type=new Ll.ProtocolNotificationType(t.method)})(jy||(Ss.DidChangeWorkspaceFoldersNotification=jy={}))});var Ky=Y(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.ConfigurationRequest=void 0;var Wy=Ie(),Vy;(function(t){t.method="workspace/configuration",t.messageDirection=Wy.MessageDirection.serverToClient,t.type=new Wy.ProtocolRequestType(t.method)})(Vy||(Dl.ConfigurationRequest=Vy={}))});var Xy=Y(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.ColorPresentationRequest=ks.DocumentColorRequest=void 0;var Ml=Ie(),Hy;(function(t){t.method="textDocument/documentColor",t.messageDirection=Ml.MessageDirection.clientToServer,t.type=new Ml.ProtocolRequestType(t.method)})(Hy||(ks.DocumentColorRequest=Hy={}));var Yy;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Ml.MessageDirection.clientToServer,t.type=new Ml.ProtocolRequestType(t.method)})(Yy||(ks.ColorPresentationRequest=Yy={}))});var Zy=Y(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.FoldingRangeRefreshRequest=Cs.FoldingRangeRequest=void 0;var Fl=Ie(),Jy;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Fl.MessageDirection.clientToServer,t.type=new Fl.ProtocolRequestType(t.method)})(Jy||(Cs.FoldingRangeRequest=Jy={}));var Qy;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Fl.MessageDirection.serverToClient,t.type=new Fl.ProtocolRequestType0(t.method)})(Qy||(Cs.FoldingRangeRefreshRequest=Qy={}))});var rT=Y(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.DeclarationRequest=void 0;var eT=Ie(),tT;(function(t){t.method="textDocument/declaration",t.messageDirection=eT.MessageDirection.clientToServer,t.type=new eT.ProtocolRequestType(t.method)})(tT||(Gl.DeclarationRequest=tT={}))});var sT=Y(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.SelectionRangeRequest=void 0;var nT=Ie(),iT;(function(t){t.method="textDocument/selectionRange",t.messageDirection=nT.MessageDirection.clientToServer,t.type=new nT.ProtocolRequestType(t.method)})(iT||(Ul.SelectionRangeRequest=iT={}))});var lT=Y($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.WorkDoneProgressCancelNotification=$n.WorkDoneProgressCreateRequest=$n.WorkDoneProgress=void 0;var v$=mi(),ql=Ie(),aT;(function(t){t.type=new v$.ProgressType;function e(r){return r===t.type}t.is=e})(aT||($n.WorkDoneProgress=aT={}));var oT;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=ql.MessageDirection.serverToClient,t.type=new ql.ProtocolRequestType(t.method)})(oT||($n.WorkDoneProgressCreateRequest=oT={}));var cT;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=ql.MessageDirection.clientToServer,t.type=new ql.ProtocolNotificationType(t.method)})(cT||($n.WorkDoneProgressCancelNotification=cT={}))});var pT=Y(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.CallHierarchyOutgoingCallsRequest=Sn.CallHierarchyIncomingCallsRequest=Sn.CallHierarchyPrepareRequest=void 0;var Ns=Ie(),uT;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Ns.MessageDirection.clientToServer,t.type=new Ns.ProtocolRequestType(t.method)})(uT||(Sn.CallHierarchyPrepareRequest=uT={}));var fT;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Ns.MessageDirection.clientToServer,t.type=new Ns.ProtocolRequestType(t.method)})(fT||(Sn.CallHierarchyIncomingCallsRequest=fT={}));var dT;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Ns.MessageDirection.clientToServer,t.type=new Ns.ProtocolRequestType(t.method)})(dT||(Sn.CallHierarchyOutgoingCallsRequest=dT={}))});var RT=Y(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.SemanticTokensRefreshRequest=Lt.SemanticTokensRangeRequest=Lt.SemanticTokensDeltaRequest=Lt.SemanticTokensRequest=Lt.SemanticTokensRegistrationType=Lt.TokenFormat=void 0;var Jr=Ie(),hT;(function(t){t.Relative="relative"})(hT||(Lt.TokenFormat=hT={}));var Ro;(function(t){t.method="textDocument/semanticTokens",t.type=new Jr.RegistrationType(t.method)})(Ro||(Lt.SemanticTokensRegistrationType=Ro={}));var mT;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method),t.registrationMethod=Ro.method})(mT||(Lt.SemanticTokensRequest=mT={}));var gT;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method),t.registrationMethod=Ro.method})(gT||(Lt.SemanticTokensDeltaRequest=gT={}));var yT;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method),t.registrationMethod=Ro.method})(yT||(Lt.SemanticTokensRangeRequest=yT={}));var TT;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Jr.MessageDirection.serverToClient,t.type=new Jr.ProtocolRequestType0(t.method)})(TT||(Lt.SemanticTokensRefreshRequest=TT={}))});var vT=Y(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.ShowDocumentRequest=void 0;var xT=Ie(),ET;(function(t){t.method="window/showDocument",t.messageDirection=xT.MessageDirection.serverToClient,t.type=new xT.ProtocolRequestType(t.method)})(ET||(zl.ShowDocumentRequest=ET={}))});var ST=Y(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.LinkedEditingRangeRequest=void 0;var AT=Ie(),$T;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=AT.MessageDirection.clientToServer,t.type=new AT.ProtocolRequestType(t.method)})($T||(jl.LinkedEditingRangeRequest=$T={}))});var PT=Y(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.WillDeleteFilesRequest=Tt.DidDeleteFilesNotification=Tt.DidRenameFilesNotification=Tt.WillRenameFilesRequest=Tt.DidCreateFilesNotification=Tt.WillCreateFilesRequest=Tt.FileOperationPatternKind=void 0;var Yt=Ie(),kT;(function(t){t.file="file",t.folder="folder"})(kT||(Tt.FileOperationPatternKind=kT={}));var CT;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Yt.MessageDirection.clientToServer,t.type=new Yt.ProtocolRequestType(t.method)})(CT||(Tt.WillCreateFilesRequest=CT={}));var NT;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Yt.MessageDirection.clientToServer,t.type=new Yt.ProtocolNotificationType(t.method)})(NT||(Tt.DidCreateFilesNotification=NT={}));var wT;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Yt.MessageDirection.clientToServer,t.type=new Yt.ProtocolRequestType(t.method)})(wT||(Tt.WillRenameFilesRequest=wT={}));var IT;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Yt.MessageDirection.clientToServer,t.type=new Yt.ProtocolNotificationType(t.method)})(IT||(Tt.DidRenameFilesNotification=IT={}));var _T;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Yt.MessageDirection.clientToServer,t.type=new Yt.ProtocolNotificationType(t.method)})(_T||(Tt.DidDeleteFilesNotification=_T={}));var bT;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Yt.MessageDirection.clientToServer,t.type=new Yt.ProtocolRequestType(t.method)})(bT||(Tt.WillDeleteFilesRequest=bT={}))});var FT=Y(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.MonikerRequest=kn.MonikerKind=kn.UniquenessLevel=void 0;var OT=Ie(),LT;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(LT||(kn.UniquenessLevel=LT={}));var DT;(function(t){t.$import="import",t.$export="export",t.local="local"})(DT||(kn.MonikerKind=DT={}));var MT;(function(t){t.method="textDocument/moniker",t.messageDirection=OT.MessageDirection.clientToServer,t.type=new OT.ProtocolRequestType(t.method)})(MT||(kn.MonikerRequest=MT={}))});var zT=Y(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.TypeHierarchySubtypesRequest=Cn.TypeHierarchySupertypesRequest=Cn.TypeHierarchyPrepareRequest=void 0;var ws=Ie(),GT;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=ws.MessageDirection.clientToServer,t.type=new ws.ProtocolRequestType(t.method)})(GT||(Cn.TypeHierarchyPrepareRequest=GT={}));var UT;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=ws.MessageDirection.clientToServer,t.type=new ws.ProtocolRequestType(t.method)})(UT||(Cn.TypeHierarchySupertypesRequest=UT={}));var qT;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=ws.MessageDirection.clientToServer,t.type=new ws.ProtocolRequestType(t.method)})(qT||(Cn.TypeHierarchySubtypesRequest=qT={}))});var WT=Y(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.InlineValueRefreshRequest=Is.InlineValueRequest=void 0;var Bl=Ie(),jT;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Bl.MessageDirection.clientToServer,t.type=new Bl.ProtocolRequestType(t.method)})(jT||(Is.InlineValueRequest=jT={}));var BT;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Bl.MessageDirection.serverToClient,t.type=new Bl.ProtocolRequestType0(t.method)})(BT||(Is.InlineValueRefreshRequest=BT={}))});var YT=Y(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.InlayHintRefreshRequest=Nn.InlayHintResolveRequest=Nn.InlayHintRequest=void 0;var _s=Ie(),VT;(function(t){t.method="textDocument/inlayHint",t.messageDirection=_s.MessageDirection.clientToServer,t.type=new _s.ProtocolRequestType(t.method)})(VT||(Nn.InlayHintRequest=VT={}));var KT;(function(t){t.method="inlayHint/resolve",t.messageDirection=_s.MessageDirection.clientToServer,t.type=new _s.ProtocolRequestType(t.method)})(KT||(Nn.InlayHintResolveRequest=KT={}));var HT;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=_s.MessageDirection.serverToClient,t.type=new _s.ProtocolRequestType0(t.method)})(HT||(Nn.InlayHintRefreshRequest=HT={}))});var rR=Y(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DiagnosticRefreshRequest=Xt.WorkspaceDiagnosticRequest=Xt.DocumentDiagnosticRequest=Xt.DocumentDiagnosticReportKind=Xt.DiagnosticServerCancellationData=void 0;var tR=mi(),A$=bl(),bs=Ie(),XT;(function(t){function e(r){let n=r;return n&&A$.boolean(n.retriggerRequest)}t.is=e})(XT||(Xt.DiagnosticServerCancellationData=XT={}));var JT;(function(t){t.Full="full",t.Unchanged="unchanged"})(JT||(Xt.DocumentDiagnosticReportKind=JT={}));var QT;(function(t){t.method="textDocument/diagnostic",t.messageDirection=bs.MessageDirection.clientToServer,t.type=new bs.ProtocolRequestType(t.method),t.partialResult=new tR.ProgressType})(QT||(Xt.DocumentDiagnosticRequest=QT={}));var ZT;(function(t){t.method="workspace/diagnostic",t.messageDirection=bs.MessageDirection.clientToServer,t.type=new bs.ProtocolRequestType(t.method),t.partialResult=new tR.ProgressType})(ZT||(Xt.WorkspaceDiagnosticRequest=ZT={}));var eR;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=bs.MessageDirection.serverToClient,t.type=new bs.ProtocolRequestType0(t.method)})(eR||(Xt.DiagnosticRefreshRequest=eR={}))});var lR=Y(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.DidCloseNotebookDocumentNotification=Ue.DidSaveNotebookDocumentNotification=Ue.DidChangeNotebookDocumentNotification=Ue.NotebookCellArrayChange=Ue.DidOpenNotebookDocumentNotification=Ue.NotebookDocumentSyncRegistrationType=Ue.NotebookDocument=Ue.NotebookCell=Ue.ExecutionSummary=Ue.NotebookCellKind=void 0;var xo=(cs(),du(il)),lr=bl(),Cr=Ie(),dh;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(dh||(Ue.NotebookCellKind=dh={}));var ph;(function(t){function e(i,s){let a={executionOrder:i};return(s===!0||s===!1)&&(a.success=s),a}t.create=e;function r(i){let s=i;return lr.objectLiteral(s)&&xo.uinteger.is(s.executionOrder)&&(s.success===void 0||lr.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(ph||(Ue.ExecutionSummary=ph={}));var Wl;(function(t){function e(s,a){return{kind:s,document:a}}t.create=e;function r(s){let a=s;return lr.objectLiteral(a)&&dh.is(a.kind)&&xo.DocumentUri.is(a.document)&&(a.metadata===void 0||lr.objectLiteral(a.metadata))}t.is=r;function n(s,a){let o=new Set;return s.document!==a.document&&o.add("document"),s.kind!==a.kind&&o.add("kind"),s.executionSummary!==a.executionSummary&&o.add("executionSummary"),(s.metadata!==void 0||a.metadata!==void 0)&&!i(s.metadata,a.metadata)&&o.add("metadata"),(s.executionSummary!==void 0||a.executionSummary!==void 0)&&!ph.equals(s.executionSummary,a.executionSummary)&&o.add("executionSummary"),o}t.diff=n;function i(s,a){if(s===a)return!0;if(s==null||a===null||a===void 0||typeof s!=typeof a||typeof s!="object")return!1;let o=Array.isArray(s),c=Array.isArray(a);if(o!==c)return!1;if(o&&c){if(s.length!==a.length)return!1;for(let l=0;l<s.length;l++)if(!i(s[l],a[l]))return!1}if(lr.objectLiteral(s)&&lr.objectLiteral(a)){let l=Object.keys(s),f=Object.keys(a);if(l.length!==f.length||(l.sort(),f.sort(),!i(l,f)))return!1;for(let p=0;p<l.length;p++){let h=l[p];if(!i(s[h],a[h]))return!1}}return!0}})(Wl||(Ue.NotebookCell=Wl={}));var nR;(function(t){function e(n,i,s,a){return{uri:n,notebookType:i,version:s,cells:a}}t.create=e;function r(n){let i=n;return lr.objectLiteral(i)&&lr.string(i.uri)&&xo.integer.is(i.version)&&lr.typedArray(i.cells,Wl.is)}t.is=r})(nR||(Ue.NotebookDocument=nR={}));var Ps;(function(t){t.method="notebookDocument/sync",t.messageDirection=Cr.MessageDirection.clientToServer,t.type=new Cr.RegistrationType(t.method)})(Ps||(Ue.NotebookDocumentSyncRegistrationType=Ps={}));var iR;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Cr.MessageDirection.clientToServer,t.type=new Cr.ProtocolNotificationType(t.method),t.registrationMethod=Ps.method})(iR||(Ue.DidOpenNotebookDocumentNotification=iR={}));var sR;(function(t){function e(n){let i=n;return lr.objectLiteral(i)&&xo.uinteger.is(i.start)&&xo.uinteger.is(i.deleteCount)&&(i.cells===void 0||lr.typedArray(i.cells,Wl.is))}t.is=e;function r(n,i,s){let a={start:n,deleteCount:i};return s!==void 0&&(a.cells=s),a}t.create=r})(sR||(Ue.NotebookCellArrayChange=sR={}));var aR;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Cr.MessageDirection.clientToServer,t.type=new Cr.ProtocolNotificationType(t.method),t.registrationMethod=Ps.method})(aR||(Ue.DidChangeNotebookDocumentNotification=aR={}));var oR;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Cr.MessageDirection.clientToServer,t.type=new Cr.ProtocolNotificationType(t.method),t.registrationMethod=Ps.method})(oR||(Ue.DidSaveNotebookDocumentNotification=oR={}));var cR;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Cr.MessageDirection.clientToServer,t.type=new Cr.ProtocolNotificationType(t.method),t.registrationMethod=Ps.method})(cR||(Ue.DidCloseNotebookDocumentNotification=cR={}))});var dR=Y(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.InlineCompletionRequest=void 0;var uR=Ie(),fR;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=uR.MessageDirection.clientToServer,t.type=new uR.ProtocolRequestType(t.method)})(fR||(Vl.InlineCompletionRequest=fR={}))});var Sx=Y(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});u.WorkspaceSymbolRequest=u.CodeActionResolveRequest=u.CodeActionRequest=u.DocumentSymbolRequest=u.DocumentHighlightRequest=u.ReferencesRequest=u.DefinitionRequest=u.SignatureHelpRequest=u.SignatureHelpTriggerKind=u.HoverRequest=u.CompletionResolveRequest=u.CompletionRequest=u.CompletionTriggerKind=u.PublishDiagnosticsNotification=u.WatchKind=u.RelativePattern=u.FileChangeType=u.DidChangeWatchedFilesNotification=u.WillSaveTextDocumentWaitUntilRequest=u.WillSaveTextDocumentNotification=u.TextDocumentSaveReason=u.DidSaveTextDocumentNotification=u.DidCloseTextDocumentNotification=u.DidChangeTextDocumentNotification=u.TextDocumentContentChangeEvent=u.DidOpenTextDocumentNotification=u.TextDocumentSyncKind=u.TelemetryEventNotification=u.LogMessageNotification=u.ShowMessageRequest=u.ShowMessageNotification=u.MessageType=u.DidChangeConfigurationNotification=u.ExitNotification=u.ShutdownRequest=u.InitializedNotification=u.InitializeErrorCodes=u.InitializeRequest=u.WorkDoneProgressOptions=u.TextDocumentRegistrationOptions=u.StaticRegistrationOptions=u.PositionEncodingKind=u.FailureHandlingKind=u.ResourceOperationKind=u.UnregistrationRequest=u.RegistrationRequest=u.DocumentSelector=u.NotebookCellTextDocumentFilter=u.NotebookDocumentFilter=u.TextDocumentFilter=void 0;u.MonikerRequest=u.MonikerKind=u.UniquenessLevel=u.WillDeleteFilesRequest=u.DidDeleteFilesNotification=u.WillRenameFilesRequest=u.DidRenameFilesNotification=u.WillCreateFilesRequest=u.DidCreateFilesNotification=u.FileOperationPatternKind=u.LinkedEditingRangeRequest=u.ShowDocumentRequest=u.SemanticTokensRegistrationType=u.SemanticTokensRefreshRequest=u.SemanticTokensRangeRequest=u.SemanticTokensDeltaRequest=u.SemanticTokensRequest=u.TokenFormat=u.CallHierarchyPrepareRequest=u.CallHierarchyOutgoingCallsRequest=u.CallHierarchyIncomingCallsRequest=u.WorkDoneProgressCancelNotification=u.WorkDoneProgressCreateRequest=u.WorkDoneProgress=u.SelectionRangeRequest=u.DeclarationRequest=u.FoldingRangeRefreshRequest=u.FoldingRangeRequest=u.ColorPresentationRequest=u.DocumentColorRequest=u.ConfigurationRequest=u.DidChangeWorkspaceFoldersNotification=u.WorkspaceFoldersRequest=u.TypeDefinitionRequest=u.ImplementationRequest=u.ApplyWorkspaceEditRequest=u.ExecuteCommandRequest=u.PrepareRenameRequest=u.RenameRequest=u.PrepareSupportDefaultBehavior=u.DocumentOnTypeFormattingRequest=u.DocumentRangesFormattingRequest=u.DocumentRangeFormattingRequest=u.DocumentFormattingRequest=u.DocumentLinkResolveRequest=u.DocumentLinkRequest=u.CodeLensRefreshRequest=u.CodeLensResolveRequest=u.CodeLensRequest=u.WorkspaceSymbolResolveRequest=void 0;u.InlineCompletionRequest=u.DidCloseNotebookDocumentNotification=u.DidSaveNotebookDocumentNotification=u.DidChangeNotebookDocumentNotification=u.NotebookCellArrayChange=u.DidOpenNotebookDocumentNotification=u.NotebookDocumentSyncRegistrationType=u.NotebookDocument=u.NotebookCell=u.ExecutionSummary=u.NotebookCellKind=u.DiagnosticRefreshRequest=u.WorkspaceDiagnosticRequest=u.DocumentDiagnosticRequest=u.DocumentDiagnosticReportKind=u.DiagnosticServerCancellationData=u.InlayHintRefreshRequest=u.InlayHintResolveRequest=u.InlayHintRequest=u.InlineValueRefreshRequest=u.InlineValueRequest=u.TypeHierarchySupertypesRequest=u.TypeHierarchySubtypesRequest=u.TypeHierarchyPrepareRequest=void 0;var S=Ie(),pR=(cs(),du(il)),it=bl(),$$=Fy();Object.defineProperty(u,"ImplementationRequest",{enumerable:!0,get:function(){return $$.ImplementationRequest}});var S$=qy();Object.defineProperty(u,"TypeDefinitionRequest",{enumerable:!0,get:function(){return S$.TypeDefinitionRequest}});var Ex=By();Object.defineProperty(u,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Ex.WorkspaceFoldersRequest}});Object.defineProperty(u,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Ex.DidChangeWorkspaceFoldersNotification}});var k$=Ky();Object.defineProperty(u,"ConfigurationRequest",{enumerable:!0,get:function(){return k$.ConfigurationRequest}});var vx=Xy();Object.defineProperty(u,"DocumentColorRequest",{enumerable:!0,get:function(){return vx.DocumentColorRequest}});Object.defineProperty(u,"ColorPresentationRequest",{enumerable:!0,get:function(){return vx.ColorPresentationRequest}});var Ax=Zy();Object.defineProperty(u,"FoldingRangeRequest",{enumerable:!0,get:function(){return Ax.FoldingRangeRequest}});Object.defineProperty(u,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Ax.FoldingRangeRefreshRequest}});var C$=rT();Object.defineProperty(u,"DeclarationRequest",{enumerable:!0,get:function(){return C$.DeclarationRequest}});var N$=sT();Object.defineProperty(u,"SelectionRangeRequest",{enumerable:!0,get:function(){return N$.SelectionRangeRequest}});var Th=lT();Object.defineProperty(u,"WorkDoneProgress",{enumerable:!0,get:function(){return Th.WorkDoneProgress}});Object.defineProperty(u,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Th.WorkDoneProgressCreateRequest}});Object.defineProperty(u,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Th.WorkDoneProgressCancelNotification}});var Rh=pT();Object.defineProperty(u,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Rh.CallHierarchyIncomingCallsRequest}});Object.defineProperty(u,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Rh.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(u,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Rh.CallHierarchyPrepareRequest}});var Os=RT();Object.defineProperty(u,"TokenFormat",{enumerable:!0,get:function(){return Os.TokenFormat}});Object.defineProperty(u,"SemanticTokensRequest",{enumerable:!0,get:function(){return Os.SemanticTokensRequest}});Object.defineProperty(u,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Os.SemanticTokensDeltaRequest}});Object.defineProperty(u,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Os.SemanticTokensRangeRequest}});Object.defineProperty(u,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Os.SemanticTokensRefreshRequest}});Object.defineProperty(u,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Os.SemanticTokensRegistrationType}});var w$=vT();Object.defineProperty(u,"ShowDocumentRequest",{enumerable:!0,get:function(){return w$.ShowDocumentRequest}});var I$=ST();Object.defineProperty(u,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return I$.LinkedEditingRangeRequest}});var gi=PT();Object.defineProperty(u,"FileOperationPatternKind",{enumerable:!0,get:function(){return gi.FileOperationPatternKind}});Object.defineProperty(u,"DidCreateFilesNotification",{enumerable:!0,get:function(){return gi.DidCreateFilesNotification}});Object.defineProperty(u,"WillCreateFilesRequest",{enumerable:!0,get:function(){return gi.WillCreateFilesRequest}});Object.defineProperty(u,"DidRenameFilesNotification",{enumerable:!0,get:function(){return gi.DidRenameFilesNotification}});Object.defineProperty(u,"WillRenameFilesRequest",{enumerable:!0,get:function(){return gi.WillRenameFilesRequest}});Object.defineProperty(u,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return gi.DidDeleteFilesNotification}});Object.defineProperty(u,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return gi.WillDeleteFilesRequest}});var xh=FT();Object.defineProperty(u,"UniquenessLevel",{enumerable:!0,get:function(){return xh.UniquenessLevel}});Object.defineProperty(u,"MonikerKind",{enumerable:!0,get:function(){return xh.MonikerKind}});Object.defineProperty(u,"MonikerRequest",{enumerable:!0,get:function(){return xh.MonikerRequest}});var Eh=zT();Object.defineProperty(u,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Eh.TypeHierarchyPrepareRequest}});Object.defineProperty(u,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Eh.TypeHierarchySubtypesRequest}});Object.defineProperty(u,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Eh.TypeHierarchySupertypesRequest}});var $x=WT();Object.defineProperty(u,"InlineValueRequest",{enumerable:!0,get:function(){return $x.InlineValueRequest}});Object.defineProperty(u,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return $x.InlineValueRefreshRequest}});var vh=YT();Object.defineProperty(u,"InlayHintRequest",{enumerable:!0,get:function(){return vh.InlayHintRequest}});Object.defineProperty(u,"InlayHintResolveRequest",{enumerable:!0,get:function(){return vh.InlayHintResolveRequest}});Object.defineProperty(u,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return vh.InlayHintRefreshRequest}});var Eo=rR();Object.defineProperty(u,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Eo.DiagnosticServerCancellationData}});Object.defineProperty(u,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Eo.DocumentDiagnosticReportKind}});Object.defineProperty(u,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Eo.DocumentDiagnosticRequest}});Object.defineProperty(u,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Eo.WorkspaceDiagnosticRequest}});Object.defineProperty(u,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Eo.DiagnosticRefreshRequest}});var Nr=lR();Object.defineProperty(u,"NotebookCellKind",{enumerable:!0,get:function(){return Nr.NotebookCellKind}});Object.defineProperty(u,"ExecutionSummary",{enumerable:!0,get:function(){return Nr.ExecutionSummary}});Object.defineProperty(u,"NotebookCell",{enumerable:!0,get:function(){return Nr.NotebookCell}});Object.defineProperty(u,"NotebookDocument",{enumerable:!0,get:function(){return Nr.NotebookDocument}});Object.defineProperty(u,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Nr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(u,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Nr.DidOpenNotebookDocumentNotification}});Object.defineProperty(u,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Nr.NotebookCellArrayChange}});Object.defineProperty(u,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Nr.DidChangeNotebookDocumentNotification}});Object.defineProperty(u,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Nr.DidSaveNotebookDocumentNotification}});Object.defineProperty(u,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Nr.DidCloseNotebookDocumentNotification}});var _$=dR();Object.defineProperty(u,"InlineCompletionRequest",{enumerable:!0,get:function(){return _$.InlineCompletionRequest}});var hh;(function(t){function e(r){let n=r;return it.string(n)||it.string(n.language)||it.string(n.scheme)||it.string(n.pattern)}t.is=e})(hh||(u.TextDocumentFilter=hh={}));var mh;(function(t){function e(r){let n=r;return it.objectLiteral(n)&&(it.string(n.notebookType)||it.string(n.scheme)||it.string(n.pattern))}t.is=e})(mh||(u.NotebookDocumentFilter=mh={}));var gh;(function(t){function e(r){let n=r;return it.objectLiteral(n)&&(it.string(n.notebook)||mh.is(n.notebook))&&(n.language===void 0||it.string(n.language))}t.is=e})(gh||(u.NotebookCellTextDocumentFilter=gh={}));var yh;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!it.string(n)&&!hh.is(n)&&!gh.is(n))return!1;return!0}t.is=e})(yh||(u.DocumentSelector=yh={}));var hR;(function(t){t.method="client/registerCapability",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolRequestType(t.method)})(hR||(u.RegistrationRequest=hR={}));var mR;(function(t){t.method="client/unregisterCapability",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolRequestType(t.method)})(mR||(u.UnregistrationRequest=mR={}));var gR;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(gR||(u.ResourceOperationKind=gR={}));var yR;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(yR||(u.FailureHandlingKind=yR={}));var TR;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(TR||(u.PositionEncodingKind=TR={}));var RR;(function(t){function e(r){let n=r;return n&&it.string(n.id)&&n.id.length>0}t.hasId=e})(RR||(u.StaticRegistrationOptions=RR={}));var xR;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||yh.is(n.documentSelector))}t.is=e})(xR||(u.TextDocumentRegistrationOptions=xR={}));var ER;(function(t){function e(n){let i=n;return it.objectLiteral(i)&&(i.workDoneProgress===void 0||it.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&it.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(ER||(u.WorkDoneProgressOptions=ER={}));var vR;(function(t){t.method="initialize",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(vR||(u.InitializeRequest=vR={}));var AR;(function(t){t.unknownProtocolVersion=1})(AR||(u.InitializeErrorCodes=AR={}));var $R;(function(t){t.method="initialized",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType(t.method)})($R||(u.InitializedNotification=$R={}));var SR;(function(t){t.method="shutdown",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType0(t.method)})(SR||(u.ShutdownRequest=SR={}));var kR;(function(t){t.method="exit",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType0(t.method)})(kR||(u.ExitNotification=kR={}));var CR;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType(t.method)})(CR||(u.DidChangeConfigurationNotification=CR={}));var NR;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(NR||(u.MessageType=NR={}));var wR;(function(t){t.method="window/showMessage",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolNotificationType(t.method)})(wR||(u.ShowMessageNotification=wR={}));var IR;(function(t){t.method="window/showMessageRequest",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolRequestType(t.method)})(IR||(u.ShowMessageRequest=IR={}));var _R;(function(t){t.method="window/logMessage",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolNotificationType(t.method)})(_R||(u.LogMessageNotification=_R={}));var bR;(function(t){t.method="telemetry/event",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolNotificationType(t.method)})(bR||(u.TelemetryEventNotification=bR={}));var PR;(function(t){t.None=0,t.Full=1,t.Incremental=2})(PR||(u.TextDocumentSyncKind=PR={}));var OR;(function(t){t.method="textDocument/didOpen",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType(t.method)})(OR||(u.DidOpenTextDocumentNotification=OR={}));var LR;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(LR||(u.TextDocumentContentChangeEvent=LR={}));var DR;(function(t){t.method="textDocument/didChange",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType(t.method)})(DR||(u.DidChangeTextDocumentNotification=DR={}));var MR;(function(t){t.method="textDocument/didClose",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType(t.method)})(MR||(u.DidCloseTextDocumentNotification=MR={}));var FR;(function(t){t.method="textDocument/didSave",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType(t.method)})(FR||(u.DidSaveTextDocumentNotification=FR={}));var GR;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(GR||(u.TextDocumentSaveReason=GR={}));var UR;(function(t){t.method="textDocument/willSave",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType(t.method)})(UR||(u.WillSaveTextDocumentNotification=UR={}));var qR;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(qR||(u.WillSaveTextDocumentWaitUntilRequest=qR={}));var zR;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolNotificationType(t.method)})(zR||(u.DidChangeWatchedFilesNotification=zR={}));var jR;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(jR||(u.FileChangeType=jR={}));var BR;(function(t){function e(r){let n=r;return it.objectLiteral(n)&&(pR.URI.is(n.baseUri)||pR.WorkspaceFolder.is(n.baseUri))&&it.string(n.pattern)}t.is=e})(BR||(u.RelativePattern=BR={}));var WR;(function(t){t.Create=1,t.Change=2,t.Delete=4})(WR||(u.WatchKind=WR={}));var VR;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolNotificationType(t.method)})(VR||(u.PublishDiagnosticsNotification=VR={}));var KR;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(KR||(u.CompletionTriggerKind=KR={}));var HR;(function(t){t.method="textDocument/completion",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(HR||(u.CompletionRequest=HR={}));var YR;(function(t){t.method="completionItem/resolve",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(YR||(u.CompletionResolveRequest=YR={}));var XR;(function(t){t.method="textDocument/hover",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(XR||(u.HoverRequest=XR={}));var JR;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(JR||(u.SignatureHelpTriggerKind=JR={}));var QR;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(QR||(u.SignatureHelpRequest=QR={}));var ZR;(function(t){t.method="textDocument/definition",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(ZR||(u.DefinitionRequest=ZR={}));var ex;(function(t){t.method="textDocument/references",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(ex||(u.ReferencesRequest=ex={}));var tx;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(tx||(u.DocumentHighlightRequest=tx={}));var rx;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(rx||(u.DocumentSymbolRequest=rx={}));var nx;(function(t){t.method="textDocument/codeAction",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(nx||(u.CodeActionRequest=nx={}));var ix;(function(t){t.method="codeAction/resolve",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(ix||(u.CodeActionResolveRequest=ix={}));var sx;(function(t){t.method="workspace/symbol",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(sx||(u.WorkspaceSymbolRequest=sx={}));var ax;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(ax||(u.WorkspaceSymbolResolveRequest=ax={}));var ox;(function(t){t.method="textDocument/codeLens",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(ox||(u.CodeLensRequest=ox={}));var cx;(function(t){t.method="codeLens/resolve",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(cx||(u.CodeLensResolveRequest=cx={}));var lx;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolRequestType0(t.method)})(lx||(u.CodeLensRefreshRequest=lx={}));var ux;(function(t){t.method="textDocument/documentLink",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(ux||(u.DocumentLinkRequest=ux={}));var fx;(function(t){t.method="documentLink/resolve",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(fx||(u.DocumentLinkResolveRequest=fx={}));var dx;(function(t){t.method="textDocument/formatting",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(dx||(u.DocumentFormattingRequest=dx={}));var px;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(px||(u.DocumentRangeFormattingRequest=px={}));var hx;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(hx||(u.DocumentRangesFormattingRequest=hx={}));var mx;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(mx||(u.DocumentOnTypeFormattingRequest=mx={}));var gx;(function(t){t.Identifier=1})(gx||(u.PrepareSupportDefaultBehavior=gx={}));var yx;(function(t){t.method="textDocument/rename",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(yx||(u.RenameRequest=yx={}));var Tx;(function(t){t.method="textDocument/prepareRename",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(Tx||(u.PrepareRenameRequest=Tx={}));var Rx;(function(t){t.method="workspace/executeCommand",t.messageDirection=S.MessageDirection.clientToServer,t.type=new S.ProtocolRequestType(t.method)})(Rx||(u.ExecuteCommandRequest=Rx={}));var xx;(function(t){t.method="workspace/applyEdit",t.messageDirection=S.MessageDirection.serverToClient,t.type=new S.ProtocolRequestType("workspace/applyEdit")})(xx||(u.ApplyWorkspaceEditRequest=xx={}))});var Cx=Y(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.createProtocolConnection=void 0;var kx=mi();function b$(t,e,r,n){return kx.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,kx.createMessageConnection)(t,e,r,n)}Kl.createProtocolConnection=b$});var wx=Y(Dt=>{"use strict";var P$=Dt&&Dt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hl=Dt&&Dt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P$(e,t,r)};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.LSPErrorCodes=Dt.createProtocolConnection=void 0;Hl(mi(),Dt);Hl((cs(),du(il)),Dt);Hl(Ie(),Dt);Hl(Sx(),Dt);var O$=Cx();Object.defineProperty(Dt,"createProtocolConnection",{enumerable:!0,get:function(){return O$.createProtocolConnection}});var Nx;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(Nx||(Dt.LSPErrorCodes=Nx={}))});var _x=Y(wr=>{"use strict";var L$=wr&&wr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ix=wr&&wr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&L$(e,t,r)};Object.defineProperty(wr,"__esModule",{value:!0});wr.createProtocolConnection=void 0;var D$=ah();Ix(ah(),wr);Ix(wx(),wr);function M$(t,e,r,n){return(0,D$.createMessageConnection)(t,e,r,n)}wr.createProtocolConnection=M$});var Ge={};tn(Ge,{AbstractAstReflection:()=>bn,AbstractCstNode:()=>ja,AbstractLangiumParser:()=>Ba,AbstractParserErrorMessageProvider:()=>al,AbstractThreadedAsyncParser:()=>Ih,AstUtils:()=>qo,BiMap:()=>fi,Cancellation:()=>B,CompositeCstNodeImpl:()=>ai,ContextCache:()=>di,CstNodeBuilder:()=>za,CstUtils:()=>oc,DEFAULT_TOKENIZE_OPTIONS:()=>Yl,DONE_RESULT:()=>pt,DatatypeSymbol:()=>sl,DefaultAstNodeDescriptionProvider:()=>co,DefaultAstNodeLocator:()=>uo,DefaultAsyncParser:()=>Io,DefaultCommentProvider:()=>wo,DefaultConfigurationProvider:()=>fo,DefaultDocumentBuilder:()=>vo,DefaultDocumentValidator:()=>oo,DefaultHydrator:()=>bo,DefaultIndexManager:()=>Ao,DefaultJsonSerializer:()=>io,DefaultLangiumDocumentFactory:()=>Ya,DefaultLangiumDocuments:()=>Xa,DefaultLangiumProfiler:()=>Fh,DefaultLexer:()=>yi,DefaultLexerErrorMessageProvider:()=>So,DefaultLinker:()=>Ja,DefaultNameProvider:()=>Qa,DefaultReferenceDescriptionProvider:()=>lo,DefaultReferences:()=>Za,DefaultScopeComputation:()=>eo,DefaultScopeProvider:()=>no,DefaultServiceRegistry:()=>so,DefaultTokenBuilder:()=>Xr,DefaultValueConverter:()=>ci,DefaultWorkspaceLock:()=>_o,DefaultWorkspaceManager:()=>$o,Deferred:()=>Nt,Disposable:()=>wn,DisposableCache:()=>Ts,DocumentCache:()=>ml,DocumentState:()=>Q,DocumentValidator:()=>Ht,EMPTY_SCOPE:()=>JA,EMPTY_STREAM:()=>sn,EmptyFileSystem:()=>Mh,EmptyFileSystemProvider:()=>tu,ErrorWithLocation:()=>Kn,GrammarAST:()=>aa,GrammarUtils:()=>pc,IndentationAwareLexer:()=>Dh,IndentationAwareTokenBuilder:()=>eu,JSDocDocumentationProvider:()=>No,LangiumCompletionParser:()=>Va,LangiumParser:()=>Wa,LangiumParserErrorMessageProvider:()=>us,LeafCstNodeImpl:()=>si,LexingMode:()=>Ti,MapScope:()=>rp,Module:()=>Oh,MultiMap:()=>gt,MultiMapScope:()=>to,OperationCancelled:()=>Kt,ParserWorker:()=>_h,ProfilingTask:()=>ru,Reduction:()=>$i,RefResolving:()=>ui,RegExpUtils:()=>uc,RootCstNodeImpl:()=>ls,SimpleCache:()=>ro,StreamImpl:()=>Gt,StreamScope:()=>ys,TextDocument:()=>hs,TreeStreamImpl:()=>gr,URI:()=>et,UriTrie:()=>gs,UriUtils:()=>ze,VALIDATE_EACH_NODE:()=>ay,ValidationCategory:()=>gl,ValidationRegistry:()=>ao,ValueConverter:()=>$r,WorkspaceCache:()=>Rs,assertCondition:()=>fm,assertUnreachable:()=>Rr,createCompletionParser:()=>Vd,createDefaultCoreModule:()=>bh,createDefaultSharedCoreModule:()=>Ph,createGrammarConfig:()=>af,createLangiumParser:()=>Kd,createParser:()=>Ka,delayNextTick:()=>ep,diagnosticData:()=>pi,eagerLoad:()=>qx,getDiagnosticRange:()=>oy,indentationBuilderDefaultOptions:()=>Lh,inject:()=>Zl,interruptAndCheck:()=>Le,isAstNode:()=>Oe,isAstNodeDescription:()=>mu,isAstNodeWithComment:()=>np,isCompositeCstNode:()=>tr,isIMultiModeLexerDefinition:()=>$h,isJSDoc:()=>Nh,isLeafCstNode:()=>nn,isLinkingError:()=>Pn,isMultiReference:()=>Ft,isNamed:()=>iy,isOperationCancelled:()=>Sr,isReference:()=>Qe,isRootCstNode:()=>Hs,isTokenTypeArray:()=>Xl,isTokenTypeDictionary:()=>Ah,loadGrammarFromJson:()=>Ir,parseJSDoc:()=>Ch,prepareLangiumParser:()=>Hg,setInterruptionPeriod:()=>Zg,startCancelableOperation:()=>pl,stream:()=>ee,toDiagnosticData:()=>cy,toDiagnosticSeverity:()=>yl});var oc={};tn(oc,{DefaultNameRegexp:()=>ac,RangeComparison:()=>Tr,compareRange:()=>om,findCommentNode:()=>Uu,findDeclarationNodeAtOffset:()=>SE,findLeafNodeAtOffset:()=>qu,findLeafNodeBeforeOffset:()=>cm,flattenCst:()=>$E,getDatatypeNode:()=>AE,getInteriorNodes:()=>NE,getNextNode:()=>kE,getPreviousNode:()=>um,getStartlineNode:()=>CE,inRange:()=>Ru,isChildNode:()=>Gu,isCommentNode:()=>Fu,streamCst:()=>Wn,toDocumentSegment:()=>Vn,tokenToRange:()=>Li});function Oe(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Qe(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function Ft(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function mu(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Pn(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}var bn=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){let r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);let n=r.properties[e.property]?.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){let r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Oe(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let s=this.types[e],a=s?s.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=a,a}}getAllSubTypes(e){let r=this.allSubtypes[e];if(r)return r;{let n=this.getAllTypes(),i=[];for(let s of n)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}};function tr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function nn(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Hs(t){return tr(t)&&typeof t.fullText=="string"}var Gt=class t{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new t(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return pt})}join(e=","){let r=this.iterator(),n="",i,s=!1;do i=r.next(),i.done||(s&&(n+=e),n+=iE(i.value)),s=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,s=n.next();for(;!s.done;){if(i>=r&&s.value===e)return i;s=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?pt:{done:!1,value:e(i)}})}filter(e){return new t(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return pt})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,s=n.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let s=this.recursiveReduce(e,r,n);return s===void 0?i.value:r(s,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}let{done:n,value:i}=this.nextFn(r.this);if(!n){let s=e(i);if(Go(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return pt})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new t(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let a=n.iterator.next();if(a.done)n.iterator=void 0;else return a}let{done:i,value:s}=r.nextFn(n.this);if(!i)if(Go(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return pt})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new t(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new t(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?pt:this.nextFn(r.state)))}distinct(e){return new t(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){let i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return pt})}exclude(e,r){let n=new Set;for(let i of e){let s=r?r(i):i;n.add(s)}return this.filter(i=>{let s=r?r(i):i;return!n.has(s)})}};function iE(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Go(t){return!!t&&typeof t[Symbol.iterator]=="function"}var sn=new Gt(()=>{},()=>pt),pt=Object.freeze({done:!0,value:void 0});function ee(...t){if(t.length===1){let e=t[0];if(e instanceof Gt)return e;if(Go(e))return new Gt(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Gt(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:pt)}return t.length>1?new Gt(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){let r=t[e.collIndex++];Go(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return pt}):sn}var gr=class extends Gt{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(r(a.value)[Symbol.iterator]()),a}return pt})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},$i;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function r(s){return s.reduce((a,o)=>a*o,0)}t.product=r;function n(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=n;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})($i||($i={}));var qo={};tn(qo,{assignMandatoryProperties:()=>Tu,copyAstNode:()=>yu,findRootNode:()=>ki,getContainerOfType:()=>Dr,getDocument:()=>ht,getReferenceNodes:()=>Uo,hasContainerOfType:()=>sE,linkContentToContainer:()=>Si,streamAllContents:()=>rr,streamAst:()=>At,streamContents:()=>Ys,streamReferences:()=>an});function Si(t,e={}){for(let[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,s)=>{Oe(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=s,e.deep&&Si(i,e))}):Oe(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Si(n,e)))}function Dr(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function sE(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function ht(t){let r=ki(t).$document;if(!r)throw new Error("AST node has no document.");return r}function ki(t){for(;t.$container;)t=t.$container;return t}function Uo(t){return Qe(t)?t.ref?[t.ref]:[]:Ft(t)?t.items.map(e=>e.ref):[]}function Ys(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new Gt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){let i=n.keys[n.keyIndex];if(!i.startsWith("$")){let s=t[i];if(Oe(s)){if(n.keyIndex++,gu(s,r))return{done:!1,value:s}}else if(Array.isArray(s)){for(;n.arrayIndex<s.length;){let a=n.arrayIndex++,o=s[a];if(Oe(o)&&gu(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return pt})}function rr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new gr(t,r=>Ys(r,e))}function At(t,e){if(t){if(e?.range&&!gu(t,e.range))return new gr(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new gr(t,r=>Ys(r,e),{includeRoot:!0})}function gu(t,e){if(!e)return!0;let r=t.$cstNode?.range;return r?Ru(r,e):!1}function an(t){return new Gt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(Qe(n)||Ft(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,s=n[i];if(Qe(s)||Ft(n))return{done:!1,value:{reference:s,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return pt})}function Tu(t,e){let r=t.getTypeMetaData(e.$type),n=e;for(let i of Object.values(r.properties))i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=sm(i.defaultValue))}function sm(t){return Array.isArray(t)?[...t.map(sm)]:t}function yu(t,e,r){let n={$type:t.$type};r&&(r.set(t,n),r.set(n,t));for(let[i,s]of Object.entries(t))if(!i.startsWith("$"))if(Oe(s))n[i]=yu(s,e,r);else if(Qe(s))n[i]=e(n,i,s.$refNode,s.$refText,s);else if(Array.isArray(s)){let a=[];for(let o of s)Oe(o)?a.push(yu(o,e,r)):Qe(o)?a.push(e(n,i,o.$refNode,o.$refText,o)):a.push(o);n[i]=a}else n[i]=s;return Si(n,{deep:!0}),n}var aa={};tn(aa,{AbstractElement:()=>It,AbstractParserRule:()=>Xs,AbstractRule:()=>Ci,AbstractType:()=>Ut,Action:()=>on,Alternatives:()=>Js,ArrayLiteral:()=>zo,ArrayType:()=>jo,Assignment:()=>cn,BooleanLiteral:()=>Bo,CharacterRange:()=>ln,Condition:()=>un,Conjunction:()=>Qs,CrossReference:()=>fn,Disjunction:()=>Zs,EndOfFile:()=>Wo,Grammar:()=>Mr,GrammarImport:()=>Vo,Group:()=>On,InferredType:()=>Ko,InfixRule:()=>yr,InfixRuleOperatorList:()=>ea,InfixRuleOperators:()=>Ho,Interface:()=>Ni,Keyword:()=>wi,LangiumGrammarAstReflection:()=>Oi,LangiumGrammarTerminals:()=>aE,NamedArgument:()=>Ii,NegatedToken:()=>Ln,Negation:()=>Yo,NumberLiteral:()=>Xo,Parameter:()=>_i,ParameterReference:()=>Jo,ParserRule:()=>nr,ReferenceType:()=>ta,RegexToken:()=>Dn,ReturnType:()=>Qo,RuleCall:()=>Mn,SimpleType:()=>bi,StringLiteral:()=>Zo,TerminalAlternatives:()=>Fn,TerminalElement:()=>_t,TerminalGroup:()=>Gn,TerminalRule:()=>Fr,TerminalRuleCall:()=>Un,Type:()=>ra,TypeAttribute:()=>qn,TypeDefinition:()=>zn,UnionType:()=>ec,UnorderedGroup:()=>na,UntilToken:()=>jn,ValueLiteral:()=>Bn,Wildcard:()=>Pi,isAbstractElement:()=>ia,isAbstractParserRule:()=>Gr,isAbstractRule:()=>oE,isAbstractType:()=>cE,isAction:()=>Ur,isAlternatives:()=>tc,isArrayLiteral:()=>lE,isArrayType:()=>xu,isAssignment:()=>ir,isBooleanLiteral:()=>Eu,isCharacterRange:()=>vu,isCondition:()=>uE,isConjunction:()=>Au,isCrossReference:()=>sr,isDisjunction:()=>$u,isEndOfFile:()=>Su,isGrammar:()=>fE,isGrammarImport:()=>dE,isGroup:()=>dn,isInferredType:()=>sa,isInfixRule:()=>pn,isInfixRuleOperatorList:()=>pE,isInfixRuleOperators:()=>hE,isInterface:()=>ku,isKeyword:()=>Vt,isNamedArgument:()=>mE,isNegatedToken:()=>Cu,isNegation:()=>Nu,isNumberLiteral:()=>gE,isParameter:()=>yE,isParameterReference:()=>wu,isParserRule:()=>rt,isReferenceType:()=>Iu,isRegexToken:()=>_u,isReturnType:()=>bu,isRuleCall:()=>ar,isSimpleType:()=>rc,isStringLiteral:()=>TE,isTerminalAlternatives:()=>Pu,isTerminalElement:()=>RE,isTerminalGroup:()=>Ou,isTerminalRule:()=>$t,isTerminalRuleCall:()=>nc,isType:()=>ic,isTypeAttribute:()=>xE,isTypeDefinition:()=>EE,isUnionType:()=>Lu,isUnorderedGroup:()=>sc,isUntilToken:()=>Du,isValueLiteral:()=>vE,isWildcard:()=>Mu,reflection:()=>j});var aE={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},It={$type:"AbstractElement",cardinality:"cardinality"};function ia(t){return j.isInstance(t,It.$type)}var Xs={$type:"AbstractParserRule"};function Gr(t){return j.isInstance(t,Xs.$type)}var Ci={$type:"AbstractRule"};function oE(t){return j.isInstance(t,Ci.$type)}var Ut={$type:"AbstractType"};function cE(t){return j.isInstance(t,Ut.$type)}var on={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ur(t){return j.isInstance(t,on.$type)}var Js={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function tc(t){return j.isInstance(t,Js.$type)}var zo={$type:"ArrayLiteral",elements:"elements"};function lE(t){return j.isInstance(t,zo.$type)}var jo={$type:"ArrayType",elementType:"elementType"};function xu(t){return j.isInstance(t,jo.$type)}var cn={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function ir(t){return j.isInstance(t,cn.$type)}var Bo={$type:"BooleanLiteral",true:"true"};function Eu(t){return j.isInstance(t,Bo.$type)}var ln={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function vu(t){return j.isInstance(t,ln.$type)}var un={$type:"Condition"};function uE(t){return j.isInstance(t,un.$type)}var Qs={$type:"Conjunction",left:"left",right:"right"};function Au(t){return j.isInstance(t,Qs.$type)}var fn={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function sr(t){return j.isInstance(t,fn.$type)}var Zs={$type:"Disjunction",left:"left",right:"right"};function $u(t){return j.isInstance(t,Zs.$type)}var Wo={$type:"EndOfFile",cardinality:"cardinality"};function Su(t){return j.isInstance(t,Wo.$type)}var Mr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function fE(t){return j.isInstance(t,Mr.$type)}var Vo={$type:"GrammarImport",path:"path"};function dE(t){return j.isInstance(t,Vo.$type)}var On={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function dn(t){return j.isInstance(t,On.$type)}var Ko={$type:"InferredType",name:"name"};function sa(t){return j.isInstance(t,Ko.$type)}var yr={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function pn(t){return j.isInstance(t,yr.$type)}var ea={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function pE(t){return j.isInstance(t,ea.$type)}var Ho={$type:"InfixRuleOperators",precedences:"precedences"};function hE(t){return j.isInstance(t,Ho.$type)}var Ni={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function ku(t){return j.isInstance(t,Ni.$type)}var wi={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Vt(t){return j.isInstance(t,wi.$type)}var Ii={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function mE(t){return j.isInstance(t,Ii.$type)}var Ln={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Cu(t){return j.isInstance(t,Ln.$type)}var Yo={$type:"Negation",value:"value"};function Nu(t){return j.isInstance(t,Yo.$type)}var Xo={$type:"NumberLiteral",value:"value"};function gE(t){return j.isInstance(t,Xo.$type)}var _i={$type:"Parameter",name:"name"};function yE(t){return j.isInstance(t,_i.$type)}var Jo={$type:"ParameterReference",parameter:"parameter"};function wu(t){return j.isInstance(t,Jo.$type)}var nr={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function rt(t){return j.isInstance(t,nr.$type)}var ta={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Iu(t){return j.isInstance(t,ta.$type)}var Dn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function _u(t){return j.isInstance(t,Dn.$type)}var Qo={$type:"ReturnType",name:"name"};function bu(t){return j.isInstance(t,Qo.$type)}var Mn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function ar(t){return j.isInstance(t,Mn.$type)}var bi={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function rc(t){return j.isInstance(t,bi.$type)}var Zo={$type:"StringLiteral",value:"value"};function TE(t){return j.isInstance(t,Zo.$type)}var Fn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Pu(t){return j.isInstance(t,Fn.$type)}var _t={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function RE(t){return j.isInstance(t,_t.$type)}var Gn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Ou(t){return j.isInstance(t,Gn.$type)}var Fr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function $t(t){return j.isInstance(t,Fr.$type)}var Un={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function nc(t){return j.isInstance(t,Un.$type)}var ra={$type:"Type",name:"name",type:"type"};function ic(t){return j.isInstance(t,ra.$type)}var qn={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function xE(t){return j.isInstance(t,qn.$type)}var zn={$type:"TypeDefinition"};function EE(t){return j.isInstance(t,zn.$type)}var ec={$type:"UnionType",types:"types"};function Lu(t){return j.isInstance(t,ec.$type)}var na={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function sc(t){return j.isInstance(t,na.$type)}var jn={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Du(t){return j.isInstance(t,jn.$type)}var Bn={$type:"ValueLiteral"};function vE(t){return j.isInstance(t,Bn.$type)}var Pi={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Mu(t){return j.isInstance(t,Pi.$type)}var Oi=class extends bn{constructor(){super(...arguments),this.types={AbstractElement:{name:It.$type,properties:{cardinality:{name:It.cardinality}},superTypes:[]},AbstractParserRule:{name:Xs.$type,properties:{},superTypes:[Ci.$type,Ut.$type]},AbstractRule:{name:Ci.$type,properties:{},superTypes:[]},AbstractType:{name:Ut.$type,properties:{},superTypes:[]},Action:{name:on.$type,properties:{cardinality:{name:on.cardinality},feature:{name:on.feature},inferredType:{name:on.inferredType},operator:{name:on.operator},type:{name:on.type,referenceType:Ut.$type}},superTypes:[It.$type]},Alternatives:{name:Js.$type,properties:{cardinality:{name:Js.cardinality},elements:{name:Js.elements,defaultValue:[]}},superTypes:[It.$type]},ArrayLiteral:{name:zo.$type,properties:{elements:{name:zo.elements,defaultValue:[]}},superTypes:[Bn.$type]},ArrayType:{name:jo.$type,properties:{elementType:{name:jo.elementType}},superTypes:[zn.$type]},Assignment:{name:cn.$type,properties:{cardinality:{name:cn.cardinality},feature:{name:cn.feature},operator:{name:cn.operator},predicate:{name:cn.predicate},terminal:{name:cn.terminal}},superTypes:[It.$type]},BooleanLiteral:{name:Bo.$type,properties:{true:{name:Bo.true,defaultValue:!1}},superTypes:[un.$type,Bn.$type]},CharacterRange:{name:ln.$type,properties:{cardinality:{name:ln.cardinality},left:{name:ln.left},lookahead:{name:ln.lookahead},parenthesized:{name:ln.parenthesized,defaultValue:!1},right:{name:ln.right}},superTypes:[_t.$type]},Condition:{name:un.$type,properties:{},superTypes:[]},Conjunction:{name:Qs.$type,properties:{left:{name:Qs.left},right:{name:Qs.right}},superTypes:[un.$type]},CrossReference:{name:fn.$type,properties:{cardinality:{name:fn.cardinality},deprecatedSyntax:{name:fn.deprecatedSyntax,defaultValue:!1},isMulti:{name:fn.isMulti,defaultValue:!1},terminal:{name:fn.terminal},type:{name:fn.type,referenceType:Ut.$type}},superTypes:[It.$type]},Disjunction:{name:Zs.$type,properties:{left:{name:Zs.left},right:{name:Zs.right}},superTypes:[un.$type]},EndOfFile:{name:Wo.$type,properties:{cardinality:{name:Wo.cardinality}},superTypes:[It.$type]},Grammar:{name:Mr.$type,properties:{imports:{name:Mr.imports,defaultValue:[]},interfaces:{name:Mr.interfaces,defaultValue:[]},isDeclared:{name:Mr.isDeclared,defaultValue:!1},name:{name:Mr.name},rules:{name:Mr.rules,defaultValue:[]},types:{name:Mr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Vo.$type,properties:{path:{name:Vo.path}},superTypes:[]},Group:{name:On.$type,properties:{cardinality:{name:On.cardinality},elements:{name:On.elements,defaultValue:[]},guardCondition:{name:On.guardCondition},predicate:{name:On.predicate}},superTypes:[It.$type]},InferredType:{name:Ko.$type,properties:{name:{name:Ko.name}},superTypes:[Ut.$type]},InfixRule:{name:yr.$type,properties:{call:{name:yr.call},dataType:{name:yr.dataType},inferredType:{name:yr.inferredType},name:{name:yr.name},operators:{name:yr.operators},parameters:{name:yr.parameters,defaultValue:[]},returnType:{name:yr.returnType,referenceType:Ut.$type}},superTypes:[Xs.$type]},InfixRuleOperatorList:{name:ea.$type,properties:{associativity:{name:ea.associativity},operators:{name:ea.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Ho.$type,properties:{precedences:{name:Ho.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Ni.$type,properties:{attributes:{name:Ni.attributes,defaultValue:[]},name:{name:Ni.name},superTypes:{name:Ni.superTypes,defaultValue:[],referenceType:Ut.$type}},superTypes:[Ut.$type]},Keyword:{name:wi.$type,properties:{cardinality:{name:wi.cardinality},predicate:{name:wi.predicate},value:{name:wi.value}},superTypes:[It.$type]},NamedArgument:{name:Ii.$type,properties:{calledByName:{name:Ii.calledByName,defaultValue:!1},parameter:{name:Ii.parameter,referenceType:_i.$type},value:{name:Ii.value}},superTypes:[]},NegatedToken:{name:Ln.$type,properties:{cardinality:{name:Ln.cardinality},lookahead:{name:Ln.lookahead},parenthesized:{name:Ln.parenthesized,defaultValue:!1},terminal:{name:Ln.terminal}},superTypes:[_t.$type]},Negation:{name:Yo.$type,properties:{value:{name:Yo.value}},superTypes:[un.$type]},NumberLiteral:{name:Xo.$type,properties:{value:{name:Xo.value}},superTypes:[Bn.$type]},Parameter:{name:_i.$type,properties:{name:{name:_i.name}},superTypes:[]},ParameterReference:{name:Jo.$type,properties:{parameter:{name:Jo.parameter,referenceType:_i.$type}},superTypes:[un.$type]},ParserRule:{name:nr.$type,properties:{dataType:{name:nr.dataType},definition:{name:nr.definition},entry:{name:nr.entry,defaultValue:!1},fragment:{name:nr.fragment,defaultValue:!1},inferredType:{name:nr.inferredType},name:{name:nr.name},parameters:{name:nr.parameters,defaultValue:[]},returnType:{name:nr.returnType,referenceType:Ut.$type}},superTypes:[Xs.$type]},ReferenceType:{name:ta.$type,properties:{isMulti:{name:ta.isMulti,defaultValue:!1},referenceType:{name:ta.referenceType}},superTypes:[zn.$type]},RegexToken:{name:Dn.$type,properties:{cardinality:{name:Dn.cardinality},lookahead:{name:Dn.lookahead},parenthesized:{name:Dn.parenthesized,defaultValue:!1},regex:{name:Dn.regex}},superTypes:[_t.$type]},ReturnType:{name:Qo.$type,properties:{name:{name:Qo.name}},superTypes:[]},RuleCall:{name:Mn.$type,properties:{arguments:{name:Mn.arguments,defaultValue:[]},cardinality:{name:Mn.cardinality},predicate:{name:Mn.predicate},rule:{name:Mn.rule,referenceType:Ci.$type}},superTypes:[It.$type]},SimpleType:{name:bi.$type,properties:{primitiveType:{name:bi.primitiveType},stringType:{name:bi.stringType},typeRef:{name:bi.typeRef,referenceType:Ut.$type}},superTypes:[zn.$type]},StringLiteral:{name:Zo.$type,properties:{value:{name:Zo.value}},superTypes:[Bn.$type]},TerminalAlternatives:{name:Fn.$type,properties:{cardinality:{name:Fn.cardinality},elements:{name:Fn.elements,defaultValue:[]},lookahead:{name:Fn.lookahead},parenthesized:{name:Fn.parenthesized,defaultValue:!1}},superTypes:[_t.$type]},TerminalElement:{name:_t.$type,properties:{cardinality:{name:_t.cardinality},lookahead:{name:_t.lookahead},parenthesized:{name:_t.parenthesized,defaultValue:!1}},superTypes:[It.$type]},TerminalGroup:{name:Gn.$type,properties:{cardinality:{name:Gn.cardinality},elements:{name:Gn.elements,defaultValue:[]},lookahead:{name:Gn.lookahead},parenthesized:{name:Gn.parenthesized,defaultValue:!1}},superTypes:[_t.$type]},TerminalRule:{name:Fr.$type,properties:{definition:{name:Fr.definition},fragment:{name:Fr.fragment,defaultValue:!1},hidden:{name:Fr.hidden,defaultValue:!1},name:{name:Fr.name},type:{name:Fr.type}},superTypes:[Ci.$type]},TerminalRuleCall:{name:Un.$type,properties:{cardinality:{name:Un.cardinality},lookahead:{name:Un.lookahead},parenthesized:{name:Un.parenthesized,defaultValue:!1},rule:{name:Un.rule,referenceType:Fr.$type}},superTypes:[_t.$type]},Type:{name:ra.$type,properties:{name:{name:ra.name},type:{name:ra.type}},superTypes:[Ut.$type]},TypeAttribute:{name:qn.$type,properties:{defaultValue:{name:qn.defaultValue},isOptional:{name:qn.isOptional,defaultValue:!1},name:{name:qn.name},type:{name:qn.type}},superTypes:[]},TypeDefinition:{name:zn.$type,properties:{},superTypes:[]},UnionType:{name:ec.$type,properties:{types:{name:ec.types,defaultValue:[]}},superTypes:[zn.$type]},UnorderedGroup:{name:na.$type,properties:{cardinality:{name:na.cardinality},elements:{name:na.elements,defaultValue:[]}},superTypes:[It.$type]},UntilToken:{name:jn.$type,properties:{cardinality:{name:jn.cardinality},lookahead:{name:jn.lookahead},parenthesized:{name:jn.parenthesized,defaultValue:!1},terminal:{name:jn.terminal}},superTypes:[_t.$type]},ValueLiteral:{name:Bn.$type,properties:{},superTypes:[]},Wildcard:{name:Pi.$type,properties:{cardinality:{name:Pi.cardinality},lookahead:{name:Pi.lookahead},parenthesized:{name:Pi.parenthesized,defaultValue:!1}},superTypes:[_t.$type]}}}},j=new Oi;function AE(t){let e=t,r=!1;for(;e;){let n=Dr(e.grammarSource,rt);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}function Wn(t){return new gr(t,e=>tr(e)?e.content:[],{includeRoot:!0})}function $E(t){return Wn(t).filter(nn)}function Gu(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Li(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Vn(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var Tr;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Tr||(Tr={}));function om(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Tr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Tr.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?Tr.Inside:r?Tr.OverlapBack:n?Tr.OverlapFront:Tr.Outside}function Ru(t,e){return om(t,e)>Tr.After}var ac=/^[\w\p{L}]$/u;function SE(t,e,r=ac){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return qu(t,e)}}function Uu(t,e){if(t){let r=um(t,!0);if(r&&Fu(r,e))return r;if(Hs(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let s=t.content[i];if(Fu(s,e))return s}}}}function Fu(t,e){return nn(t)&&e.includes(t.tokenType.name)}function qu(t,e){if(nn(t))return t;if(tr(t)){let r=lm(t,e,!1);if(r)return qu(r,e)}}function cm(t,e){if(nn(t))return t;if(tr(t)){let r=lm(t,e,!0);if(r)return cm(r,e)}}function lm(t,e,r){let n=0,i=t.content.length-1,s;for(;n<=i;){let a=Math.floor((n+i)/2),o=t.content[a];if(o.offset<=e&&o.end>e)return o;o.end<=e?(s=r?o:void 0,n=a+1):i=a-1}return s}function um(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t);for(;n>0;){n--;let i=r.content[n];if(e||!i.hidden)return i}t=r}}function kE(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;n<i;){n++;let s=r.content[n];if(e||!s.hidden)return s}t=r}}function CE(t){if(t.range.start.character===0)return t;let e=t.range.start.line,r=t,n;for(;t.container;){let i=t.container,s=n??i.content.indexOf(t);if(s===0?(t=i,n=void 0):(n=s-1,t=i.content[n]),t.range.start.line!==e)break;r=t}return r}function NE(t,e){let r=wE(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function wE(t,e){let r=am(t),n=am(e),i;for(let s=0;s<r.length&&s<n.length;s++){let a=r[s],o=n[s];if(a.parent===o.parent)i={parent:a.parent,a:a.index,b:o.index};else break}return i}function am(t){let e=[];for(;t.container;){let r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}var pc={};tn(pc,{findAssignment:()=>rf,findNameAssignment:()=>fc,findNodeForKeyword:()=>ef,findNodeForProperty:()=>da,findNodesForKeyword:()=>OE,findNodesForKeywordInternal:()=>tf,findNodesForProperty:()=>Qu,getActionAtElement:()=>Rm,getActionType:()=>Em,getAllReachableRules:()=>fa,getAllRulesUsedForCrossReferences:()=>PE,getCrossReferenceTerminal:()=>Xu,getEntryRule:()=>mm,getExplicitRuleType:()=>dc,getHiddenRules:()=>gm,getRuleType:()=>nf,getRuleTypeName:()=>GE,getTypeName:()=>mn,isArrayCardinality:()=>DE,isArrayOperator:()=>ME,isCommentTerminal:()=>Ju,isDataType:()=>FE,isDataTypeRule:()=>pa,isOptionalCardinality:()=>LE,terminalRegex:()=>Mi});var Kn=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function Rr(t,e="Error: Got unexpected value."){throw new Error(e)}function fm(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}var uc={};tn(uc,{NEWLINE_REGEXP:()=>Wu,escapeRegExp:()=>hn,getTerminalParts:()=>bE,isMultilineComment:()=>Vu,isWhitespace:()=>ua,partialMatches:()=>Ku,partialRegExp:()=>hm,whitespaceCharacters:()=>pm});function W(t){return t.charCodeAt(0)}function cc(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Di(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Hn(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function oa(){throw Error("Internal Error - Should never get here!")}function zu(t){return t.type==="Character"}var ca=[];for(let t=W("0");t<=W("9");t++)ca.push(t);var la=[W("_")].concat(ca);for(let t=W("a");t<=W("z");t++)la.push(t);for(let t=W("A");t<=W("Z");t++)la.push(t);var ju=[W(" "),W("\f"),W(`
|
|
`),W("\r"),W(" "),W("\v"),W(" "),W("\xA0"),W("\u1680"),W("\u2000"),W("\u2001"),W("\u2002"),W("\u2003"),W("\u2004"),W("\u2005"),W("\u2006"),W("\u2007"),W("\u2008"),W("\u2009"),W("\u200A"),W("\u2028"),W("\u2029"),W("\u202F"),W("\u205F"),W("\u3000"),W("\uFEFF")];var IE=/[0-9a-fA-F]/,lc=/[0-9]/,_E=/[1-9]/,Yn=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Di(n,"global");break;case"i":Di(n,"ignoreCase");break;case"m":Di(n,"multiLine");break;case"u":Di(n,"unicode");break;case"y":Di(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}Hn(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return oa()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),r={atLeast:i,atMost:s}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Hn(r);break}if(!(e===!0&&r===void 0)&&Hn(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Hn(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):oa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[W(`
|
|
`),W("\r"),W("\u2028"),W("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=ca;break;case"D":e=ca,r=!0;break;case"s":e=ju;break;case"S":e=ju,r=!0;break;case"w":e=la;break;case"W":e=la,r=!0;break}return Hn(e)?{type:"Set",value:e,complement:r}:oa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=W("\f");break;case"n":e=W(`
|
|
`);break;case"r":e=W("\r");break;case"t":e=W(" ");break;case"v":e=W("\v");break}return Hn(e)?{type:"Character",value:e}:oa()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:W("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:W(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:W(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(zu(n)&&this.isRangeDash()){this.consumeChar("-");let s=this.classAtom(),a=s.type==="Character";if(zu(s)){if(s.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:s.value})}else cc(n.value,e),e.push(W("-")),cc(s.value,e)}else cc(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:W("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(_E.test(e)===!1)throw Error("Expecting a positive integer");for(;lc.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(lc.test(e)===!1)throw Error("Expecting an integer");for(;lc.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
|
|
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:W(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return lc.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let s=this.popChar();if(IE.test(s)===!1)throw Error("Expecting a HexDecimal digits");r+=s}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var xr=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var Wu=/\r?\n/gm,dm=new Yn,Bu=class extends xr{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===`
|
|
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=hn(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
|
|
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},Xn=new Bu;function bE(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;let e=dm.pattern(t),r=[];for(let n of e.value.value)Xn.reset(t),Xn.visit(n),r.push({start:Xn.startRegexp,end:Xn.endRegex});return r}catch{return[]}}function Vu(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Xn.reset(t),Xn.visit(dm.pattern(t)),Xn.multiline}catch{return!1}}var pm=`\f
|
|
\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function ua(t){let e=typeof t=="string"?new RegExp(t):t;return pm.some(r=>e.test(r))}function hn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ku(t,e){let r=hm(t),n=e.match(r);return!!n&&n[0].length>0}function hm(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let s="",a;function o(l){s+=r.substr(n,l),n+=l}function c(l){s+="(?:"+r.substr(n,l)+"|$)",n+=l}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?r[n+2]==="{"?c(r.indexOf("}",n)-n+1):c(6):c(2);break;case"p":case"P":e.unicode?c(r.indexOf("}",n)-n+1):c(2);break;case"k":c(r.indexOf(">",n)-n+1);break;default:c(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=n,a=a.exec(r)||[],c(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=n,a=a.exec(r),a?o(a[0].length):c(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=i()+"|$)";break;case"=":s+="(?=",n+=3,s+=i()+")";break;case"!":a=n,n+=3,i(),s+=r.substr(a,n-a);break;case"<":switch(r[n+3]){case"=":case"!":a=n,n+=4,i(),s+=r.substr(a,n-a);break;default:o(r.indexOf(">",n)-n+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++n,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function mm(t){return t.rules.find(e=>rt(e)&&e.entry)}function gm(t){return t.rules.filter(e=>$t(e)&&e.hidden)}function fa(t,e){let r=new Set,n=mm(t);if(!n)return new Set(t.rules);let i=[n].concat(gm(t));for(let a of i)ym(a,r,e);let s=new Set;for(let a of t.rules)(r.has(a.name)||$t(a)&&a.hidden)&&s.add(a);return s}function ym(t,e,r){e.add(t.name),rr(t).forEach(n=>{if(ar(n)||r&&nc(n)){let i=n.rule.ref;i&&!e.has(i.name)&&ym(i,e,r)}})}function PE(t){let e=new Set;return rr(t).forEach(r=>{sr(r)&&(rt(r.type.ref)&&e.add(r.type.ref),sa(r.type.ref)&&rt(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}function Xu(t){if(t.terminal)return t.terminal;if(t.type.ref)return fc(t.type.ref)?.terminal}function Ju(t){return t.hidden&&!ua(Mi(t))}function Qu(t,e){return!t||!e?[]:Zu(t,e,t.astNode,!0)}function da(t,e,r){if(!t||!e)return;let n=Zu(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Zu(t,e,r,n){if(!n){let i=Dr(t.grammarSource,ir);if(i&&i.feature===e)return[t]}return tr(t)&&t.astNode===r?t.content.flatMap(i=>Zu(i,e,r,!1)):[]}function OE(t,e){return t?tf(t,e,t?.astNode):[]}function ef(t,e,r){if(!t)return;let n=tf(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function tf(t,e,r){if(t.astNode!==r)return[];if(Vt(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=Wn(t).iterator(),i,s=[];do if(i=n.next(),!i.done){let a=i.value;a.astNode===r?Vt(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):n.prune()}while(!i.done);return s}function rf(t){let e=t.astNode;for(;e===t.container?.astNode;){let r=Dr(t.grammarSource,ir);if(r)return r;t=t.container}}function fc(t){let e=t;return sa(e)&&(Ur(e.$container)?e=e.$container.$container:Gr(e.$container)?e=e.$container:Rr(e.$container)),Tm(t,e,new Map)}function Tm(t,e,r){function n(i,s){let a;return Dr(i,ir)||(a=Tm(s,s,r)),r.set(t,a),a}if(r.has(t))return r.get(t);r.set(t,void 0);for(let i of rr(e)){if(ir(i)&&i.feature.toLowerCase()==="name")return r.set(t,i),i;if(ar(i)&&rt(i.rule.ref))return n(i,i.rule.ref);if(rc(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}function Rm(t){let e=t.$container;if(dn(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let s=r[i];if(Ur(s))return s;{let a=rr(r[i]).find(Ur);if(a)return a}}}if(ia(e))return Rm(e)}function LE(t,e){return t==="?"||t==="*"||dn(e)&&!!e.guardCondition}function DE(t){return t==="*"||t==="+"}function ME(t){return t==="+="}function pa(t){return xm(t,new Set)}function xm(t,e){if(e.has(t))return!0;e.add(t);for(let r of rr(t))if(ar(r)){if(!r.rule.ref||rt(r.rule.ref)&&!xm(r.rule.ref,e)||pn(r.rule.ref))return!1}else{if(ir(r))return!1;if(Ur(r))return!1}return!!t.definition}function FE(t){return Yu(t.type,new Set)}function Yu(t,e){if(e.has(t))return!0;if(e.add(t),xu(t))return!1;if(Iu(t))return!1;if(Lu(t))return t.types.every(r=>Yu(r,e));if(rc(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){let r=t.typeRef.ref;return ic(r)?Yu(r.type,e):!1}else return!1}else return!1}function dc(t){if(!$t(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e)return e.name}}}function mn(t){if(Gr(t))return rt(t)&&pa(t)?t.name:dc(t)??t.name;if(ku(t)||ic(t)||bu(t))return t.name;if(Ur(t)){let e=Em(t);if(e)return e}else if(sa(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Em(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return mn(t.type.ref)}function GE(t){return $t(t)?t.type?.name??"string":rt(t)&&pa(t)?t.name:dc(t)??t.name}function nf(t){return $t(t)?t.type?.name??"string":dc(t)??t.name}function Mi(t){let e={s:!1,i:!1,u:!1},r=Fi(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}var sf=/[\s\S]/.source;function Fi(t,e){if(Pu(t))return UE(t);if(Ou(t))return qE(t);if(vu(t))return BE(t);if(nc(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return qr(Fi(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Cu(t))return jE(t);if(Du(t))return zE(t);if(_u(t)){let r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),qr(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(Mu(t))return qr(sf,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function UE(t){return qr(t.elements.map(e=>Fi(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function qE(t){return qr(t.elements.map(e=>Fi(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function zE(t){return qr(`${sf}*?${Fi(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function jE(t){return qr(`(?!${Fi(t.terminal)})${sf}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function BE(t){return t.right?qr(`[${Hu(t.left)}-${Hu(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):qr(Hu(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Hu(t){return hn(t.value)}function qr(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function af(t){let e=[],r=t.Grammar;for(let n of r.rules)$t(n)&&Ju(n)&&Vu(Mi(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:ac}}function Gi(t){console&&console.error&&console.error(`Error: ${t}`)}function ha(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function ma(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function ga(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function WE(t){return VE(t)?t.LABEL:t.name}function VE(t){return dt(t.LABEL)&&t.LABEL!==""}var qt=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),L(this.definition,r=>{r.accept(e)})}},fe=class extends qt{constructor(e){super([]),this.idx=1,lt(this,Mt(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},St=class extends qt{constructor(e){super(e.definition),this.orgText="",lt(this,Mt(e,r=>r!==void 0))}},Te=class extends qt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,lt(this,Mt(e,r=>r!==void 0))}},de=class extends qt{constructor(e){super(e.definition),this.idx=1,lt(this,Mt(e,r=>r!==void 0))}},Re=class extends qt{constructor(e){super(e.definition),this.idx=1,lt(this,Mt(e,r=>r!==void 0))}},xe=class extends qt{constructor(e){super(e.definition),this.idx=1,lt(this,Mt(e,r=>r!==void 0))}},ie=class extends qt{constructor(e){super(e.definition),this.idx=1,lt(this,Mt(e,r=>r!==void 0))}},ge=class extends qt{constructor(e){super(e.definition),this.idx=1,lt(this,Mt(e,r=>r!==void 0))}},ye=class extends qt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,lt(this,Mt(e,r=>r!==void 0))}},te=class{constructor(e){this.idx=1,lt(this,Mt(e,r=>r!==void 0))}accept(e){e.visit(this)}};function hc(t){return I(t,Ui)}function Ui(t){function e(r){return I(r,Ui)}if(t instanceof fe){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return dt(t.label)&&(r.label=t.label),r}else{if(t instanceof Te)return{type:"Alternative",definition:e(t.definition)};if(t instanceof de)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Re)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof xe)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Ui(new te({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ge)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Ui(new te({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ie)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ye)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof te){let r={type:"Terminal",name:t.terminalType.name,label:WE(t.terminalType),idx:t.idx};dt(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=er(n)?n.source:n),r}else{if(t instanceof St)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var kt=class{visit(e){let r=e;switch(r.constructor){case fe:return this.visitNonTerminal(r);case Te:return this.visitAlternative(r);case de:return this.visitOption(r);case Re:return this.visitRepetitionMandatory(r);case xe:return this.visitRepetitionMandatoryWithSeparator(r);case ge:return this.visitRepetitionWithSeparator(r);case ie:return this.visitRepetition(r);case ye:return this.visitAlternation(r);case te:return this.visitTerminal(r);case St:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function of(t){return t instanceof Te||t instanceof de||t instanceof ie||t instanceof Re||t instanceof xe||t instanceof ge||t instanceof te||t instanceof St}function Jn(t,e=[]){return t instanceof de||t instanceof ie||t instanceof ge?!0:t instanceof ye?Fo(t.definition,n=>Jn(n,e)):t instanceof fe&&Pe(e,t)?!1:t instanceof qt?(t instanceof fe&&e.push(t),Et(t.definition,n=>Jn(n,e))):!1}function cf(t){return t instanceof ye}function bt(t){if(t instanceof fe)return"SUBRULE";if(t instanceof de)return"OPTION";if(t instanceof ye)return"OR";if(t instanceof Re)return"AT_LEAST_ONE";if(t instanceof xe)return"AT_LEAST_ONE_SEP";if(t instanceof ge)return"MANY_SEP";if(t instanceof ie)return"MANY";if(t instanceof te)return"CONSUME";throw Error("non exhaustive match")}var zr=class{walk(e,r=[]){L(e.definition,(n,i)=>{let s=Ve(e.definition,i+1);if(n instanceof fe)this.walkProdRef(n,s,r);else if(n instanceof te)this.walkTerminal(n,s,r);else if(n instanceof Te)this.walkFlat(n,s,r);else if(n instanceof de)this.walkOption(n,s,r);else if(n instanceof Re)this.walkAtLeastOne(n,s,r);else if(n instanceof xe)this.walkAtLeastOneSep(n,s,r);else if(n instanceof ge)this.walkManySep(n,s,r);else if(n instanceof ie)this.walkMany(n,s,r);else if(n instanceof ye)this.walkOr(n,s,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new de({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=vm(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new de({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=vm(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);L(e.definition,s=>{let a=new Te({definition:[s]});this.walk(a,i)})}};function vm(t,e,r){return[new de({definition:[new te({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Qn(t){if(t instanceof fe)return Qn(t.referencedRule);if(t instanceof te)return YE(t);if(of(t))return KE(t);if(cf(t))return HE(t);throw Error("non exhaustive match")}function KE(t){let e=[],r=t.definition,n=0,i=r.length>n,s,a=!0;for(;i&&a;)s=r[n],a=Jn(s),e=e.concat(Qn(s)),n=n+1,i=r.length>n;return Ks(e)}function HE(t){let e=I(t.definition,r=>Qn(r));return Ks(We(e))}function YE(t){return[t.terminalType]}var mc="_~IN~_";var lf=class extends zr{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=XE(e.referencedRule,e.idx)+this.topProd.name,s=r.concat(n),a=new Te({definition:s}),o=Qn(a);this.follows[i]=o}};function Am(t){let e={};return L(t,r=>{let n=new lf(r).startWalking();lt(e,n)}),e}function XE(t,e){return t.name+e+mc}var gc={},JE=new Yn;function qi(t){let e=t.toString();if(gc.hasOwnProperty(e))return gc[e];{let r=JE.pattern(e);return gc[e]=r,r}}function $m(){gc={}}var km="Complement Sets are not supported for first char optimization",ya=`Unable to use "first char" lexer optimizations:
|
|
`;function Cm(t,e=!1){try{let r=qi(t);return uf(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===km)e&&ha(`${ya} Unable to optimize: < ${t.toString()} >
|
|
Complement Sets cannot be automatically optimized.
|
|
This will disable the lexer's first char optimizations.
|
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
|
|
This will disable the lexer's first char optimizations.
|
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Gi(`${ya}
|
|
Failed parsing: < ${t.toString()} >
|
|
Using the @chevrotain/regexp-to-ast library
|
|
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function uf(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)uf(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let s=n[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let a=s;switch(a.type){case"Character":yc(a.value,e,r);break;case"Set":if(a.complement===!0)throw Error(km);L(a.value,c=>{if(typeof c=="number")yc(c,e,r);else{let l=c;if(r===!0)for(let f=l.from;f<=l.to;f++)yc(f,e,r);else{for(let f=l.from;f<=l.to&&f<zi;f++)yc(f,e,r);if(l.to>=zi){let f=l.from>=zi?l.from:zi,p=l.to,h=Er(f),g=Er(p);for(let k=h;k<=g;k++)e[k]=k}}}});break;case"Group":uf(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}let o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&ff(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return $e(e)}function yc(t,e,r){let n=Er(t);e[n]=n,r===!0&&QE(t,e)}function QE(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Er(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let s=Er(i.charCodeAt(0));e[s]=s}}}function Sm(t,e){return Lr(t.value,r=>{if(typeof r=="number")return Pe(e,r);{let n=r;return Lr(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function ff(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Je(t.value)?Et(t.value,ff):ff(t.value):!1}var df=class extends xr{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){Pe(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Sm(e,this.targetCharCodes)===void 0&&(this.found=!0):Sm(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Tc(t,e){if(e instanceof RegExp){let r=qi(e),n=new df(t);return n.visit(r),n.found}else return Lr(e,r=>Pe(t,r.charCodeAt(0)))!==void 0}var Zn="PATTERN",ji="defaultMode",Rc="modes",hf=typeof new RegExp("(?:)").sticky=="boolean";function Im(t,e){e=Vs(e,{useSticky:hf,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
`],tracer:(b,v)=>v()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{yv()});let n;r("Reject Lexer.NA",()=>{n=_n(t,b=>b[Zn]===Ne.NA)});let i=!1,s;r("Transform Patterns",()=>{i=!1,s=I(n,b=>{let v=b[Zn];if(er(v)){let K=v.source;return K.length===1&&K!=="^"&&K!=="$"&&K!=="."&&!v.ignoreCase?K:K.length===2&&K[0]==="\\"&&!Pe(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],K[1])?K[1]:e.useSticky?wm(v):Nm(v)}else{if(hr(v))return i=!0,{exec:v};if(typeof v=="object")return i=!0,v;if(typeof v=="string"){if(v.length===1)return v;{let K=v.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),G=new RegExp(K);return e.useSticky?wm(G):Nm(G)}}else throw Error("non exhaustive match")}})});let a,o,c,l,f;r("misc mapping",()=>{a=I(n,b=>b.tokenTypeIdx),o=I(n,b=>{let v=b.GROUP;if(v!==Ne.SKIPPED){if(dt(v))return v;if(vt(v))return!1;throw Error("non exhaustive match")}}),c=I(n,b=>{let v=b.LONGER_ALT;if(v)return Je(v)?I(v,G=>hu(n,G)):[hu(n,v)]}),l=I(n,b=>b.PUSH_MODE),f=I(n,b=>F(b,"POP_MODE"))});let p;r("Line Terminator Handling",()=>{let b=Fm(e.lineTerminatorCharacters);p=I(n,v=>!1),e.positionTracking!=="onlyOffset"&&(p=I(n,v=>F(v,"LINE_BREAKS")?!!v.LINE_BREAKS:Mm(v,b)===!1&&Tc(b,v.PATTERN)))});let h,g,k,N;r("Misc Mapping #2",()=>{h=I(n,Lm),g=I(s,mv),k=Fe(n,(b,v)=>{let K=v.GROUP;return dt(K)&&K!==Ne.SKIPPED&&(b[K]=[]),b},{}),N=I(s,(b,v)=>({pattern:s[v],longerAlt:c[v],canLineTerminator:p[v],isCustom:h[v],short:g[v],group:o[v],push:l[v],pop:f[v],tokenTypeIdx:a[v],tokenType:n[v]}))});let q=!0,D=[];return e.safeMode||r("First Char Optimization",()=>{D=Fe(n,(b,v,K)=>{if(typeof v.PATTERN=="string"){let G=v.PATTERN.charCodeAt(0),he=Er(G);pf(b,he,N[K])}else if(Je(v.START_CHARS_HINT)){let G;L(v.START_CHARS_HINT,he=>{let fr=typeof he=="string"?he.charCodeAt(0):he,Ye=Er(fr);G!==Ye&&(G=Ye,pf(b,Ye,N[K]))})}else if(er(v.PATTERN))if(v.PATTERN.unicode)q=!1,e.ensureOptimizations&&Gi(`${ya} Unable to analyze < ${v.PATTERN.toString()} > pattern.
|
|
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
This will disable the lexer's first char optimizations.
|
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let G=Cm(v.PATTERN,e.ensureOptimizations);Z(G)&&(q=!1),L(G,he=>{pf(b,he,N[K])})}else e.ensureOptimizations&&Gi(`${ya} TokenType: <${v.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
This will disable the lexer's first char optimizations.
|
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),q=!1;return b},[])}),{emptyGroups:k,patternIdxToConfig:N,charCodeToPatternIdxToConfig:D,hasCustom:i,canBeOptimized:q}}function _m(t,e){let r=[],n=ev(t);r=r.concat(n.errors);let i=tv(n.valid),s=i.valid;return r=r.concat(i.errors),r=r.concat(ZE(s)),r=r.concat(lv(s)),r=r.concat(uv(s,e)),r=r.concat(fv(s)),r}function ZE(t){let e=[],r=at(t,n=>er(n[Zn]));return e=e.concat(nv(r)),e=e.concat(av(r)),e=e.concat(ov(r)),e=e.concat(cv(r)),e=e.concat(iv(r)),e}function ev(t){let e=at(t,i=>!F(i,Zn)),r=I(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ce.MISSING_PATTERN,tokenTypes:[i]})),n=In(t,e);return{errors:r,valid:n}}function tv(t){let e=at(t,i=>{let s=i[Zn];return!er(s)&&!hr(s)&&!F(s,"exec")&&!dt(s)}),r=I(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ce.INVALID_PATTERN,tokenTypes:[i]})),n=In(t,e);return{errors:r,valid:n}}var rv=/[^\\][$]/;function nv(t){class e extends xr{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}let r=at(t,i=>{let s=i.PATTERN;try{let a=qi(s),o=new e;return o.visit(a),o.found}catch{return rv.test(s.source)}});return I(r,i=>({message:`Unexpected RegExp Anchor Error:
|
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ce.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function iv(t){let e=at(t,n=>n.PATTERN.test(""));return I(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ce.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var sv=/[^\\[][\^]|^\^/;function av(t){class e extends xr{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}let r=at(t,i=>{let s=i.PATTERN;try{let a=qi(s),o=new e;return o.visit(a),o.found}catch{return sv.test(s.source)}});return I(r,i=>({message:`Unexpected RegExp Anchor Error:
|
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ce.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function ov(t){let e=at(t,n=>{let i=n[Zn];return i instanceof RegExp&&(i.multiline||i.global)});return I(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ce.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function cv(t){let e=[],r=I(t,s=>Fe(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!Pe(e,o)&&o.PATTERN!==Ne.NA&&(e.push(o),a.push(o)),a),[]));r=Or(r);let n=at(r,s=>s.length>1);return I(n,s=>{let a=I(s,c=>c.name);return{message:`The same RegExp pattern ->${ut(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Ce.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function lv(t){let e=at(t,n=>{if(!F(n,"GROUP"))return!1;let i=n.GROUP;return i!==Ne.SKIPPED&&i!==Ne.NA&&!dt(i)});return I(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ce.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function uv(t,e){let r=at(t,i=>i.PUSH_MODE!==void 0&&!Pe(e,i.PUSH_MODE));return I(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Ce.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function fv(t){let e=[],r=Fe(t,(n,i,s)=>{let a=i.PATTERN;return a===Ne.NA||(dt(a)?n.push({str:a,idx:s,tokenType:i}):er(a)&&pv(a)&&n.push({str:a.source,idx:s,tokenType:i})),n},[]);return L(t,(n,i)=>{L(r,({str:s,idx:a,tokenType:o})=>{if(i<a&&dv(s,n.PATTERN)){let c=`Token: ->${o.name}<- can never be matched.
|
|
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
|
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Ce.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}function dv(t,e){if(er(e)){if(hv(e))return!1;let r=e.exec(t);return r!==null&&r.index===0}else{if(hr(e))return e(t,0,[],{});if(F(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function pv(t){return Lr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function hv(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function Nm(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function wm(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function bm(t,e,r){let n=[];return F(t,ji)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+ji+`> property in its definition
|
|
`,type:Ce.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),F(t,Rc)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Rc+`> property in its definition
|
|
`,type:Ce.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),F(t,Rc)&&F(t,ji)&&!F(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${ji}: <${t.defaultMode}>which does not exist
|
|
`,type:Ce.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),F(t,Rc)&&L(t.modes,(i,s)=>{L(i,(a,o)=>{if(vt(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}>
|
|
`,type:Ce.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(F(a,"LONGER_ALT")){let c=Je(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];L(c,l=>{!vt(l)&&!Pe(i,l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${a.name}> outside of mode <${s}>
|
|
`,type:Ce.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function Pm(t,e,r){let n=[],i=!1,s=Or(We($e(t.modes))),a=_n(s,c=>c[Zn]===Ne.NA),o=Fm(r);return e&&L(a,c=>{let l=Mm(c,o);if(l!==!1){let p={message:gv(c,l),type:l.issue,tokenType:c};n.push(p)}else F(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Tc(o,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
This Lexer has been defined to track line and column information,
|
|
But none of the Token Types can be identified as matching a line terminator.
|
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
for details.`,type:Ce.NO_LINE_BREAKS_FLAGS}),n}function Om(t){let e={},r=Pr(t);return L(r,n=>{let i=t[n];if(Je(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Lm(t){let e=t.PATTERN;if(er(e))return!1;if(hr(e))return!0;if(F(e,"exec"))return!0;if(dt(e))return!1;throw Error("non exhaustive match")}function mv(t){return dt(t)&&t.length===1?t.charCodeAt(0):!1}var Dm={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function Mm(t,e){if(F(t,"LINE_BREAKS"))return!1;if(er(t.PATTERN)){try{Tc(e,t.PATTERN)}catch(r){return{issue:Ce.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(dt(t.PATTERN))return!1;if(Lm(t))return{issue:Ce.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function gv(t,e){if(e.issue===Ce.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
The problem is in the <${t.name}> Token Type
|
|
Root cause: ${e.errMsg}.
|
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Ce.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
The problem is in the <${t.name}> Token Type
|
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Fm(t){return I(t,r=>dt(r)?r.charCodeAt(0):r)}function pf(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var zi=256,xc=[];function Er(t){return t<zi?t:xc[t]}function yv(){if(Z(xc)){xc=new Array(65536);for(let t=0;t<65536;t++)xc[t]=t>255?255+~~(t/255):t}}function jr(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Bi(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var Gm=1,qm={};function Br(t){let e=Tv(t);Rv(e),Ev(e),xv(e),L(e,r=>{r.isParent=r.categoryMatches.length>0})}function Tv(t){let e=Ae(t),r=t,n=!0;for(;n;){r=Or(We(I(r,s=>s.CATEGORIES)));let i=In(r,e);e=e.concat(i),Z(i)?n=!1:r=i}return e}function Rv(t){L(t,e=>{mf(e)||(qm[Gm]=e,e.tokenTypeIdx=Gm++),Um(e)&&!Je(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Um(e)||(e.CATEGORIES=[]),vv(e)||(e.categoryMatches=[]),Av(e)||(e.categoryMatchesMap={})})}function xv(t){L(t,e=>{e.categoryMatches=[],L(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(qm[n].tokenTypeIdx)})})}function Ev(t){L(t,e=>{zm([],e)})}function zm(t,e){L(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),L(e.CATEGORIES,r=>{let n=t.concat(e);Pe(n,r)||zm(n,r)})}function mf(t){return F(t,"tokenTypeIdx")}function Um(t){return F(t,"CATEGORIES")}function vv(t){return F(t,"categoryMatches")}function Av(t){return F(t,"categoryMatchesMap")}function jm(t){return F(t,"tokenTypeIdx")}var Wi={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var Ce;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Ce||(Ce={}));var Ta={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Wi,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ta);var Ne=class{constructor(e,r=Ta){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);let{time:o,value:c}=ma(s),l=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${a}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,c}else return s()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
a boolean 2nd argument is no longer supported`);this.config=lt({},Ta,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ta.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Dm;else if(this.config.lineTerminatorCharacters===Ta.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Je(e)?i={modes:{defaultMode:Ae(e)},defaultMode:ji}:(s=!1,i=Ae(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(bm(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Pm(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},L(i.modes,(o,c)=>{i.modes[c]=_n(o,l=>vt(l))});let a=Pr(i.modes);if(L(i.modes,(o,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(_m(o,a))}),Z(this.lexerDefinitionErrors)){Br(o);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=Im(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=l.charCodeToPatternIdxToConfig,this.emptyGroups=lt({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Z(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let c=I(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
|
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|
`+c)}L(this.lexerDefinitionWarning,o=>{ha(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(hf?(this.chopInput=pu,this.match=this.matchWithTest):(this.updateLastIndex=Be,this.match=this.matchWithExec),s&&(this.handleModes=Be),this.trackStartLines===!1&&(this.computeNewColumn=pu),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Be),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let o=Fe(this.canModeBeOptimized,(c,l,f)=>(l===!1&&c.push(f),c),[]);if(r.ensureOptimizations&&!Z(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{$m()}),this.TRACE_INIT("toFastProperties",()=>{ga(this)})})}tokenize(e,r=this.defaultMode){if(!Z(this.lexerDefinitionErrors)){let i=I(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,s,a,o,c,l,f,p,h,g,k,N,q,D,b,v=e,K=v.length,G=0,he=0,fr=this.hasCustom?0:Math.floor(e.length/10),Ye=new Array(fr),Jt=[],Wt=this.trackStartLines?1:void 0,$=this.trackStartLines?1:void 0,y=Om(this.emptyGroups),O=this.trackStartLines,P=this.config.lineTerminatorsPattern,T=0,x=[],A=[],_=[],M=[];Object.freeze(M);let C;function H(){return x}function J(tt){let wt=Er(tt),Zr=A[wt];return Zr===void 0?M:Zr}let je=tt=>{if(_.length===1&&tt.tokenType.PUSH_MODE===void 0){let wt=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(tt);Jt.push({offset:tt.startOffset,line:tt.startLine,column:tt.startColumn,length:tt.image.length,message:wt})}else{_.pop();let wt=mr(_);x=this.patternIdxToConfig[wt],A=this.charCodeToPatternIdxToConfig[wt],T=x.length;let Zr=this.canModeBeOptimized[wt]&&this.config.safeMode===!1;A&&Zr?C=J:C=H}};function le(tt){_.push(tt),A=this.charCodeToPatternIdxToConfig[tt],x=this.patternIdxToConfig[tt],T=x.length,T=x.length;let wt=this.canModeBeOptimized[tt]&&this.config.safeMode===!1;A&&wt?C=J:C=H}le.call(this,r);let _e,dr=this.config.recoveryEnabled;for(;G<K;){c=null;let tt=v.charCodeAt(G),wt=C(tt),Zr=wt.length;for(n=0;n<Zr;n++){_e=wt[n];let Rt=_e.pattern;l=null;let Qt=_e.short;if(Qt!==!1?tt===Qt&&(c=Rt):_e.isCustom===!0?(b=Rt.exec(v,G,Ye,y),b!==null?(c=b[0],b.payload!==void 0&&(l=b.payload)):c=null):(this.updateLastIndex(Rt,G),c=this.match(Rt,e,G)),c!==null){if(o=_e.longerAlt,o!==void 0){let st=o.length;for(s=0;s<st;s++){let Zt=x[o[s]],br=Zt.pattern;if(f=null,Zt.isCustom===!0?(b=br.exec(v,G,Ye,y),b!==null?(a=b[0],b.payload!==void 0&&(f=b.payload)):a=null):(this.updateLastIndex(br,G),a=this.match(br,e,G)),a&&a.length>c.length){c=a,l=f,_e=Zt;break}}}break}}if(c!==null){if(p=c.length,h=_e.group,h!==void 0&&(g=_e.tokenTypeIdx,k=this.createTokenInstance(c,G,g,_e.tokenType,Wt,$,p),this.handlePayload(k,l),h===!1?he=this.addToken(Ye,he,k):y[h].push(k)),e=this.chopInput(e,p),G=G+p,$=this.computeNewColumn($,p),O===!0&&_e.canLineTerminator===!0){let Rt=0,Qt,st;P.lastIndex=0;do Qt=P.test(c),Qt===!0&&(st=P.lastIndex-1,Rt++);while(Qt===!0);Rt!==0&&(Wt=Wt+Rt,$=p-st,this.updateTokenEndLineColumnLocation(k,h,st,Rt,Wt,$,p))}this.handleModes(_e,je,le,k)}else{let Rt=G,Qt=Wt,st=$,Zt=dr===!1;for(;Zt===!1&&G<K;)for(e=this.chopInput(e,1),G++,i=0;i<T;i++){let br=x[i],en=br.pattern,Mo=br.short;if(Mo!==!1?v.charCodeAt(G)===Mo&&(Zt=!0):br.isCustom===!0?Zt=en.exec(v,G,Ye,y)!==null:(this.updateLastIndex(en,G),Zt=en.exec(e)!==null),Zt===!0)break}if(N=G-Rt,$=this.computeNewColumn($,N),D=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(v,Rt,N,Qt,st,mr(_)),Jt.push({offset:Rt,line:Qt,column:st,length:N,message:D}),dr===!1)break}}return this.hasCustom||(Ye.length=he),{tokens:Ye,groups:y,errors:Jt}}handleModes(e,r,n,i){if(e.pop===!0){let s=e.push;r(i),s!==void 0&&n.call(this,s)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,s,a,o){let c,l;r!==void 0&&(c=n===o-1,l=c?-1:0,i===1&&c===!0||(e.endLine=s+l,e.endColumn=a-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,s,a){return{image:e,startOffset:r,startLine:s,startColumn:a,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,s,a,o){return{image:e,startOffset:r,endOffset:r+o-1,startLine:s,endLine:s,startColumn:a,endColumn:a+o-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Ne.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Ne.NA=/NOT_APPLICABLE/;function Wr(t){return gf(t)?t.LABEL:t.name}function gf(t){return dt(t.LABEL)&&t.LABEL!==""}var $v="parent",Bm="categories",Wm="label",Vm="group",Km="push_mode",Hm="pop_mode",Ym="longer_alt",Xm="line_breaks",Jm="start_chars_hint";function gn(t){return Sv(t)}function Sv(t){let e=t.pattern,r={};if(r.name=t.name,vt(e)||(r.PATTERN=e),F(t,$v))throw`The parent property is no longer supported.
|
|
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return F(t,Bm)&&(r.CATEGORIES=t[Bm]),Br([r]),F(t,Wm)&&(r.LABEL=t[Wm]),F(t,Vm)&&(r.GROUP=t[Vm]),F(t,Hm)&&(r.POP_MODE=t[Hm]),F(t,Km)&&(r.PUSH_MODE=t[Km]),F(t,Ym)&&(r.LONGER_ALT=t[Ym]),F(t,Xm)&&(r.LINE_BREAKS=t[Xm]),F(t,Jm)&&(r.START_CHARS_HINT=t[Jm]),r}var zt=gn({name:"EOF",pattern:Ne.NA});Br([zt]);function Vr(t,e,r,n,i,s,a,o){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Ra(t,e){return jr(t,e)}var Kr={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${gf(t)?`--> ${Wr(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let s="Expecting: ",o=`
|
|
but found: '`+ut(e).image+"'";if(n)return s+n+o;{let c=Fe(t,(h,g)=>h.concat(g),[]),l=I(c,h=>`[${I(h,g=>Wr(g)).join(", ")}]`),p=`one of these possible Token sequences:
|
|
${I(l,(h,g)=>` ${g+1}. ${h}`).join(`
|
|
`)}`;return s+p+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",a=`
|
|
but found: '`+ut(e).image+"'";if(r)return i+r+a;{let c=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
<${I(t,l=>`[${I(l,f=>Wr(f)).join(",")}]`).join(" ,")}>`;return i+c+a}}};Object.freeze(Kr);var Qm={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
inside top level rule: ->`+t.name+"<-"}},or={buildDuplicateFoundError(t,e){function r(f){return f instanceof te?f.terminalType.name:f instanceof fe?f.nonTerminalName:""}let n=t.name,i=ut(e),s=i.idx,a=bt(i),o=r(i),c=s>0,l=`->${a}${c?s:""}<- ${o?`with argument: ->${o}<-`:""}
|
|
appears more than once (${e.length} times) in the top level rule: ->${n}<-.
|
|
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
`;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
|
|
`),l},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=I(t.prefixPath,i=>Wr(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
in <OR${r}> inside <${t.topLevelRule.name}> Rule,
|
|
<${e}> may appears as a prefix path in all these alternatives.
|
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
For Further details.`},buildAlternationAmbiguityError(t){let e=I(t.prefixPath,i=>Wr(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
|
|
<${e}> may appears as a prefix path in all these alternatives.
|
|
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
For Further details.`,n},buildEmptyRepetitionError(t){let e=bt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=I(t.leftRecursionPath,s=>s.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
without consuming any Tokens. The grammar path that causes this is:
|
|
${n}
|
|
To fix this refactor your grammar to remove the left recursion.
|
|
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof St?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Zm(t,e){let r=new yf(t,e);return r.resolveRefs(),r.errors}var yf=class extends kt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){L($e(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Ze.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var Tf=class extends zr{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Ae(this.path.ruleStack).reverse(),this.occurrenceStack=Ae(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Z(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},Ec=class extends Tf{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),s=new Te({definition:i});this.possibleTokTypes=Qn(s),this.found=!0}}},Vi=class extends zr{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},vc=class extends Vi{walkMany(e,r,n){if(e.idx===this.occurrence){let i=ut(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof te&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},xa=class extends Vi{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=ut(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof te&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Ac=class extends Vi{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=ut(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof te&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Ea=class extends Vi{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=ut(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof te&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function $c(t,e,r=[]){r=Ae(r);let n=[],i=0;function s(o){return o.concat(Ve(t,i+1))}function a(o){let c=$c(s(o),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let o=t[i];if(o instanceof Te)return a(o.definition);if(o instanceof fe)return a(o.definition);if(o instanceof de)n=a(o.definition);else if(o instanceof Re){let c=o.definition.concat([new ie({definition:o.definition})]);return a(c)}else if(o instanceof xe){let c=[new Te({definition:o.definition}),new ie({definition:[new te({terminalType:o.separator})].concat(o.definition)})];return a(c)}else if(o instanceof ge){let c=o.definition.concat([new ie({definition:[new te({terminalType:o.separator})].concat(o.definition)})]);n=a(c)}else if(o instanceof ie){let c=o.definition.concat([new ie({definition:o.definition})]);n=a(c)}else{if(o instanceof ye)return L(o.definition,c=>{Z(c.definition)===!1&&(n=a(c.definition))}),n;if(o instanceof te)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Ve(t,i)}),n}function Sc(t,e,r,n){let i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE",o=!1,c=e.length,l=c-n-1,f=[],p=[];for(p.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Z(p);){let h=p.pop();if(h===a){o&&mr(p).idx<=l&&p.pop();continue}let g=h.def,k=h.idx,N=h.ruleStack,q=h.occurrenceStack;if(Z(g))continue;let D=g[0];if(D===i){let b={idx:k,def:Ve(g),ruleStack:rn(N),occurrenceStack:rn(q)};p.push(b)}else if(D instanceof te)if(k<c-1){let b=k+1,v=e[b];if(r(v,D.terminalType)){let K={idx:b,def:Ve(g),ruleStack:N,occurrenceStack:q};p.push(K)}}else if(k===c-1)f.push({nextTokenType:D.terminalType,nextTokenOccurrence:D.idx,ruleStack:N,occurrenceStack:q}),o=!0;else throw Error("non exhaustive match");else if(D instanceof fe){let b=Ae(N);b.push(D.nonTerminalName);let v=Ae(q);v.push(D.idx);let K={idx:k,def:D.definition.concat(s,Ve(g)),ruleStack:b,occurrenceStack:v};p.push(K)}else if(D instanceof de){let b={idx:k,def:Ve(g),ruleStack:N,occurrenceStack:q};p.push(b),p.push(a);let v={idx:k,def:D.definition.concat(Ve(g)),ruleStack:N,occurrenceStack:q};p.push(v)}else if(D instanceof Re){let b=new ie({definition:D.definition,idx:D.idx}),v=D.definition.concat([b],Ve(g)),K={idx:k,def:v,ruleStack:N,occurrenceStack:q};p.push(K)}else if(D instanceof xe){let b=new te({terminalType:D.separator}),v=new ie({definition:[b].concat(D.definition),idx:D.idx}),K=D.definition.concat([v],Ve(g)),G={idx:k,def:K,ruleStack:N,occurrenceStack:q};p.push(G)}else if(D instanceof ge){let b={idx:k,def:Ve(g),ruleStack:N,occurrenceStack:q};p.push(b),p.push(a);let v=new te({terminalType:D.separator}),K=new ie({definition:[v].concat(D.definition),idx:D.idx}),G=D.definition.concat([K],Ve(g)),he={idx:k,def:G,ruleStack:N,occurrenceStack:q};p.push(he)}else if(D instanceof ie){let b={idx:k,def:Ve(g),ruleStack:N,occurrenceStack:q};p.push(b),p.push(a);let v=new ie({definition:D.definition,idx:D.idx}),K=D.definition.concat([v],Ve(g)),G={idx:k,def:K,ruleStack:N,occurrenceStack:q};p.push(G)}else if(D instanceof ye)for(let b=D.definition.length-1;b>=0;b--){let v=D.definition[b],K={idx:k,def:v.definition.concat(Ve(g)),ruleStack:N,occurrenceStack:q};p.push(K),p.push(a)}else if(D instanceof Te)p.push({idx:k,def:D.definition.concat(Ve(g)),ruleStack:N,occurrenceStack:q});else if(D instanceof St)p.push(kv(D,k,N,q));else throw Error("non exhaustive match")}return f}function kv(t,e,r,n){let i=Ae(r);i.push(t.name);let s=Ae(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var we;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(we||(we={}));function va(t){if(t instanceof de||t==="Option")return we.OPTION;if(t instanceof ie||t==="Repetition")return we.REPETITION;if(t instanceof Re||t==="RepetitionMandatory")return we.REPETITION_MANDATORY;if(t instanceof xe||t==="RepetitionMandatoryWithSeparator")return we.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ge||t==="RepetitionWithSeparator")return we.REPETITION_WITH_SEPARATOR;if(t instanceof ye||t==="Alternation")return we.ALTERNATION;throw Error("non exhaustive match")}function Cc(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=va(n);return s===we.ALTERNATION?Ki(e,r,i):Hi(e,r,s,i)}function tg(t,e,r,n,i,s){let a=Ki(t,e,r),o=og(a)?Bi:jr;return s(a,n,o,i)}function rg(t,e,r,n,i,s){let a=Hi(t,e,i,r),o=og(a)?Bi:jr;return s(a[0],o,n)}function ng(t,e,r,n){let i=t.length,s=Et(t,a=>Et(a,o=>o.length===1));if(e)return function(a){let o=I(a,c=>c.GATE);for(let c=0;c<i;c++){let l=t[c],f=l.length,p=o[c];if(!(p!==void 0&&p.call(this)===!1))e:for(let h=0;h<f;h++){let g=l[h],k=g.length;for(let N=0;N<k;N++){let q=this.LA(N+1);if(r(q,g[N])===!1)continue e}return c}}};if(s&&!n){let a=I(t,c=>We(c)),o=Fe(a,(c,l,f)=>(L(l,p=>{F(c,p.tokenTypeIdx)||(c[p.tokenTypeIdx]=f),L(p.categoryMatches,h=>{F(c,h)||(c[h]=f)})}),c),{});return function(){let c=this.LA(1);return o[c.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){let o=t[a],c=o.length;e:for(let l=0;l<c;l++){let f=o[l],p=f.length;for(let h=0;h<p;h++){let g=this.LA(h+1);if(r(g,f[h])===!1)continue e}return a}}}}function ig(t,e,r){let n=Et(t,s=>s.length===1),i=t.length;if(n&&!r){let s=We(t);if(s.length===1&&Z(s[0].categoryMatches)){let o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{let a=Fe(s,(o,c,l)=>(o[c.tokenTypeIdx]=!0,L(c.categoryMatches,f=>{o[f]=!0}),o),[]);return function(){let o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){let a=t[s],o=a.length;for(let c=0;c<o;c++){let l=this.LA(c+1);if(e(l,a[c])===!1)continue e}return!0}return!1}}var xf=class extends zr{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,we.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,we.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,we.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,we.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,we.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},kc=class extends kt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,we.OPTION)}visitRepetition(e){this.checkIsTarget(e,we.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,we.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,we.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,we.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,we.ALTERNATION)}};function eg(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Rf(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let s=0;s<e.length;s++){let a=e[s];i.push(a+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){let c="_"+n.categoryMatches[o];i.push(a+c)}}e=i}return e}function Cv(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let s=0;s<e.length;s++){let a=e[s];if(i[a]===!0)return!1}}return!0}function sg(t,e){let r=I(t,a=>$c([a],1)),n=eg(r.length),i=I(r,a=>{let o={};return L(a,c=>{let l=Rf(c.partialPath);L(l,f=>{o[f]=!0})}),o}),s=r;for(let a=1;a<=e;a++){let o=s;s=eg(o.length);for(let c=0;c<o.length;c++){let l=o[c];for(let f=0;f<l.length;f++){let p=l[f].partialPath,h=l[f].suffixDef,g=Rf(p);if(Cv(i,g,c)||Z(h)||p.length===e){let N=n[c];if(Nc(N,p)===!1){N.push(p);for(let q=0;q<g.length;q++){let D=g[q];i[c][D]=!0}}}else{let N=$c(h,a+1,p);s[c]=s[c].concat(N),L(N,q=>{let D=Rf(q.partialPath);L(D,b=>{i[c][b]=!0})})}}}}return n}function Ki(t,e,r,n){let i=new kc(t,we.ALTERNATION,n);return e.accept(i),sg(i.result,r)}function Hi(t,e,r,n){let i=new kc(t,r);e.accept(i);let s=i.result,o=new xf(e,t,r).startWalking(),c=new Te({definition:s}),l=new Te({definition:o});return sg([c,l],n)}function Nc(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let s=e[i],a=n[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function ag(t,e){return t.length<e.length&&Et(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function og(t){return Et(t,e=>Et(e,r=>Et(r,n=>Z(n.categoryMatches))))}function cg(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return I(e,r=>Object.assign({type:Ze.CUSTOM_LOOKAHEAD_VALIDATION},r))}function lg(t,e,r,n){let i=ft(t,c=>Nv(c,r)),s=Ov(t,e,r),a=ft(t,c=>_v(c,r)),o=ft(t,c=>Iv(c,t,n,r));return i.concat(s,a,o)}function Nv(t,e){let r=new Ef;t.accept(r);let n=r.allProductions,i=rm(n,wv),s=Mt(i,o=>o.length>1);return I($e(s),o=>{let c=ut(o),l=e.buildDuplicateFoundError(t,o),f=bt(c),p={message:l,type:Ze.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:f,occurrence:c.idx},h=ug(c);return h&&(p.parameter=h),p})}function wv(t){return`${bt(t)}_#_${t.idx}_#_${ug(t)}`}function ug(t){return t instanceof te?t.terminalType.name:t instanceof fe?t.nonTerminalName:""}var Ef=class extends kt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function Iv(t,e,r,n){let i=[];if(Fe(e,(a,o)=>o.name===t.name?a+1:a,0)>1){let a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:Ze.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function fg(t,e,r){let n=[],i;return Pe(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Ze.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Af(t,e,r,n=[]){let i=[],s=wc(e.definition);if(Z(s))return[];{let a=t.name;Pe(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Ze.LEFT_RECURSION,ruleName:a});let c=In(s,n.concat([t])),l=ft(c,f=>{let p=Ae(n);return p.push(f),Af(t,f,r,p)});return i.concat(l)}}function wc(t){let e=[];if(Z(t))return e;let r=ut(t);if(r instanceof fe)e.push(r.referencedRule);else if(r instanceof Te||r instanceof de||r instanceof Re||r instanceof xe||r instanceof ge||r instanceof ie)e=e.concat(wc(r.definition));else if(r instanceof ye)e=We(I(r.definition,s=>wc(s.definition)));else if(!(r instanceof te))throw Error("non exhaustive match");let n=Jn(r),i=t.length>1;if(n&&i){let s=Ve(t);return e.concat(wc(s))}else return e}var Aa=class extends kt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function dg(t,e){let r=new Aa;t.accept(r);let n=r.alternations;return ft(n,s=>{let a=rn(s.definition);return ft(a,(o,c)=>{let l=Sc([o],[],jr,1);return Z(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:Ze.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function pg(t,e,r){let n=new Aa;t.accept(n);let i=n.alternations;return i=_n(i,a=>a.ignoreAmbiguities===!0),ft(i,a=>{let o=a.idx,c=a.maxLookahead||e,l=Ki(o,t,c,a),f=bv(l,a,t,r),p=Pv(l,a,t,r);return f.concat(p)})}var vf=class extends kt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function _v(t,e){let r=new Aa;t.accept(r);let n=r.alternations;return ft(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Ze.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function hg(t,e,r){let n=[];return L(t,i=>{let s=new vf;i.accept(s);let a=s.allProductions;L(a,o=>{let c=va(o),l=o.maxLookahead||e,f=o.idx,h=Hi(f,i,c,l)[0];if(Z(We(h))){let g=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:g,type:Ze.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function bv(t,e,r,n){let i=[],s=Fe(t,(o,c,l)=>(e.definition[l].ignoreAmbiguities===!0||L(c,f=>{let p=[l];L(t,(h,g)=>{l!==g&&Nc(h,f)&&e.definition[g].ignoreAmbiguities!==!0&&p.push(g)}),p.length>1&&!Nc(i,f)&&(i.push(f),o.push({alts:p,path:f}))}),o),[]);return I(s,o=>{let c=I(o.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:o.path}),type:Ze.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function Pv(t,e,r,n){let i=Fe(t,(a,o,c)=>{let l=I(o,f=>({idx:c,path:f}));return a.concat(l)},[]);return Or(ft(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];let c=a.idx,l=a.path,f=at(i,h=>e.definition[h.idx].ignoreAmbiguities!==!0&&h.idx<c&&ag(h.path,l));return I(f,h=>{let g=[h.idx+1,c+1],k=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:g,prefixPath:h.path}),type:Ze.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:k,alternatives:g}})}))}function Ov(t,e,r){let n=[],i=I(e,s=>s.name);return L(t,s=>{let a=s.name;if(Pe(i,a)){let o=r.buildNamespaceConflictError(s);n.push({message:o,type:Ze.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}function mg(t){let e=Vs(t,{errMsgProvider:Qm}),r={};return L(t.rules,n=>{r[n.name]=n}),Zm(r,e.errMsgProvider)}function gg(t){return t=Vs(t,{errMsgProvider:or}),lg(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var yg="MismatchedTokenException",Tg="NoViableAltException",Rg="EarlyExitException",xg="NotAllInputParsedException",Eg=[yg,Tg,Rg,xg];Object.freeze(Eg);function yn(t){return Pe(Eg,t.name)}var Yi=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},ei=class extends Yi{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=yg}},$a=class extends Yi{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Tg}},Sa=class extends Yi{constructor(e,r){super(e,r),this.name=xg}},ka=class extends Yi{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Rg}};var $f={},kf="InRuleRecoveryException",Sf=class extends Error{constructor(e){super(e),this.name=kf}},Ic=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=F(e,"recoveryEnabled")?e.recoveryEnabled:Ct.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lv)}getTokenToInsert(e){let r=Vr(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[],c=!1,l=this.LA(1),f=this.LA(1),p=()=>{let h=this.LA(0),g=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:h,ruleName:this.getCurrRuleFullName()}),k=new ei(g,l,this.LA(0));k.resyncedTokens=rn(o),this.SAVE_ERROR(k)};for(;!c;)if(this.tokenMatcher(f,i)){p();return}else if(n.call(this)){p(),e.apply(this,r);return}else this.tokenMatcher(f,s)?c=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Sf("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Z(r))return!1;let n=this.LA(1);return Lr(r,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Pe(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Lr(e,s=>Ra(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return $f;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return I(e,(n,i)=>i===0?$f:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=I(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return We(e)}getFollowSetFromFollowKey(e){if(e===$f)return[zt];let r=e.ruleName+e.idxInCallingRule+mc+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,zt)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return rn(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Ae(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return I(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function Lv(t,e,r,n,i,s,a){let o=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[o];if(c===void 0){let h=this.getCurrRuleFullName(),g=this.getGAstProductions()[h];c=new s(g,i).startWalking(),this.firstAfterRepMap[o]=c}let l=c.token,f=c.occurrence,p=c.isEndOfRule;this.RULE_STACK.length===1&&p&&l===void 0&&(l=zt,f=1),!(l===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,f,a)&&this.tryInRepetitionRecovery(t,e,r,l)}function _c(t,e,r){return r|e|t}var Hr=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:Ct.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Z(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...s]}return r}validateNoLeftRecursion(e){return ft(e,r=>Af(r,r,or))}validateEmptyOrAlternatives(e){return ft(e,r=>dg(r,or))}validateAmbiguousAlternationAlternatives(e,r){return ft(e,n=>pg(n,r,or))}validateSomeNonEmptyLookaheadPath(e,r){return hg(e,r,or)}buildLookaheadForAlternation(e){return tg(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,ng)}buildLookaheadForOptional(e){return rg(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,va(e.prodType),ig)}};var Pc=class{initLooksAhead(e){this.dynamicTokensEnabled=F(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Ct.dynamicTokensEnabled,this.maxLookahead=F(e,"maxLookahead")?e.maxLookahead:Ct.maxLookahead,this.lookaheadStrategy=F(e,"lookaheadStrategy")?e.lookaheadStrategy:new Hr({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){L(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:c}=Dv(r);L(n,l=>{let f=l.idx===0?"":l.idx;this.TRACE_INIT(`${bt(l)}${f}`,()=>{let p=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),h=_c(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(h,p)})}),L(i,l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,bt(l))}),L(s,l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,bt(l))}),L(a,l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,bt(l))}),L(o,l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,bt(l))}),L(c,l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,bt(l))})})})}computeLookaheadFunc(e,r,n,i,s,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{let o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=_c(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,o)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return _c(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Cf=class extends kt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},bc=new Cf;function Dv(t){bc.reset(),t.accept(bc);let e=bc.dslMethods;return bc.reset(),e}function If(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function _f(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function vg(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function Ag(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var Mv="name";function bf(t,e){Object.defineProperty(t,Mv,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Fv(t,e){let r=Pr(t),n=r.length;for(let i=0;i<n;i++){let s=r[i],a=t[s],o=a.length;for(let c=0;c<o;c++){let l=a[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function $g(t,e){let r=function(){};bf(r,t+"BaseSemantics");let n={visit:function(i,s){if(Je(i)&&(i=i[0]),!vt(i))return this[i.name](i.children,s)},validateVisitor:function(){let i=Gv(this,e);if(!Z(i)){let s=I(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
${s.join(`
|
|
|
|
`).replace(/\n/g,`
|
|
`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function Sg(t,e,r){let n=function(){};bf(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return L(e,s=>{i[s]=Fv}),n.prototype=i,n.prototype.constructor=n,n}var Pf;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Pf||(Pf={}));function Gv(t,e){return Uv(t,e)}function Uv(t,e){let r=at(e,i=>hr(t[i])===!1),n=I(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Pf.MISSING_METHOD,methodName:i}));return Or(n)}var Mc=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=F(e,"nodeLocationTracking")?e.nodeLocationTracking:Ct.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Be,this.cstFinallyStateUpdate=Be,this.cstPostTerminal=Be,this.cstPostNonTerminal=Be,this.cstPostRule=Be;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_f,this.setNodeLocationFromNode=_f,this.cstPostRule=Be,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Be,this.setNodeLocationFromNode=Be,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=If,this.setNodeLocationFromNode=If,this.cstPostRule=Be,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Be,this.setNodeLocationFromNode=Be,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Be,this.setNodeLocationFromNode=Be,this.cstPostRule=Be,this.setInitialNodeLocation=Be;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];vg(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];Ag(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(vt(this.baseCstVisitorConstructor)){let e=$g(this.className,Pr(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(vt(this.baseCstVisitorWithDefaultsConstructor)){let e=Sg(this.className,Pr(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var Fc=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Xi}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Xi:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var Gc=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Ji){if(Pe(this.definedRulesNames,e)){let a={message:or.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ze.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Ji){let i=fg(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let s=this.defineRule(e,r,n);return this[e]=s,s}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(yn(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return hc($e(this.gastProductionsCache))}};var Uc=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Bi,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},F(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
For Further details.`);if(Je(e)){if(Z(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
Note that the first argument for the parser constructor
|
|
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
For Further details.`)}if(Je(e))this.tokensMap=Fe(e,(s,a)=>(s[a.name]=a,s),{});else if(F(e,"modes")&&Et(We($e(e.modes)),jm)){let s=We($e(e.modes)),a=Ks(s);this.tokensMap=Fe(a,(o,c)=>(o[c.name]=c,o),{})}else if(tm(e))this.tokensMap=Ae(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=zt;let n=F(e,"modes")?We($e(e.modes)):$e(e),i=Et(n,s=>Z(s.categoryMatches));this.tokenMatcher=i?Bi:jr,Br($e(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=F(n,"resyncEnabled")?n.resyncEnabled:Ji.resyncEnabled,s=F(n,"recoveryValueFunc")?n.recoveryValueFunc:Ji.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return this.outputCst===!0?o=function(...f){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),r.apply(this,f);let p=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(p),p}catch(p){return this.invokeRuleCatch(p,i,s)}finally{this.ruleFinallyStateUpdate()}}:o=function(...f){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),r.apply(this,f)}catch(p){return this.invokeRuleCatch(p,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,s=r&&!this.isBackTracking()&&this.recoveryEnabled;if(yn(e)){let a=e;if(s){let o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(e);else{if(this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,a.partialCstResult=c}throw a}}else{if(i)return this.moveToTerminatedState(),n(e);throw a}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof e!="function"){s=e.DEF;let a=e.GATE;if(a!==void 0){let o=i;i=()=>a.call(this)&&o.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;let a=r.GATE;if(a!==void 0){let o=i;i=()=>a.call(this)&&o.call(this)}}else s=r;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,we.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Ac)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Ea],o,1536,e,Ea)}else throw this.raiseEarlyExitException(e,we.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;let o=r.GATE;if(o!==void 0){let c=i;i=()=>o.call(this)&&c.call(this)}}else s=r;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,vc,a)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,xa],o,1280,e,xa)}}repetitionSepSecondInternal(e,r,n,i,s){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,s],n,1536,e,s)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=Je(e)?e:e.DEF,a=this.getLaFuncFromCache(n).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Sa(r,e))}}subruleInternal(e,r,n){let i;try{let s=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,s),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,n,e.ruleName)}}subruleInternalError(e,r,n){throw yn(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,n)}catch(s){i=this.consumeInternalRecovery(e,r,s)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,s=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ei(i,r,s))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===kf?n:s}}else throw n}saveRecogState(){let e=this.errors,r=Ae(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),zt)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var qc=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=F(e,"errorMessageProvider")?e.errorMessageProvider:Ct.errorMessageProvider}SAVE_ERROR(e){if(yn(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ae(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ae(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=Hi(e,s,r,this.maxLookahead)[0],c=[];for(let f=1;f<=this.maxLookahead;f++)c.push(this.LA(f));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new ka(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=Ki(e,i,this.maxLookahead),a=[];for(let l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));let o=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new $a(c,this.LA(1),o))}};var zc=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(vt(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Sc([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=ut(e.ruleStack),i=this.getGAstProductions()[r];return new Ec(i,e).startWalking()}};var Wc={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Wc);var kg=!0,Cg=Math.pow(2,8)-1,wg=gn({name:"RECORDING_PHASE_TOKEN",pattern:Ne.NA});Br([wg]);var Ig=Vr(wg,`This IToken indicates the Parser is in Recording Phase
|
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Ig);var zv={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},jc=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Xi}topLevelRuleRecord(e,r){try{let n=new St({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
|
|
This error was thrown during the "grammar recording phase" For more info see:
|
|
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Na.call(this,de,e,r)}atLeastOneInternalRecord(e,r){Na.call(this,Re,r,e)}atLeastOneSepFirstInternalRecord(e,r){Na.call(this,xe,r,e,kg)}manyInternalRecord(e,r){Na.call(this,ie,r,e)}manySepFirstInternalRecord(e,r){Na.call(this,ge,r,e,kg)}orInternalRecord(e,r){return jv.call(this,e,r)}subruleInternalRecord(e,r,n){if(Bc(r),!e||F(e,"ruleName")===!1){let o=new Error(`<SUBRULE${Ng(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}let i=mr(this.recordingProdStack),s=e.ruleName,a=new fe({idx:r,nonTerminalName:s,label:n?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?zv:Wc}consumeInternalRecord(e,r,n){if(Bc(r),!mf(e)){let a=new Error(`<CONSUME${Ng(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=mr(this.recordingProdStack),s=new te({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(s),Ig}};function Na(t,e,r,n=!1){Bc(r);let i=mr(this.recordingProdStack),s=hr(e)?e:e.DEF,a=new t({definition:[],idx:r});return n&&(a.separator=e.SEP),F(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),Wc}function jv(t,e){Bc(e);let r=mr(this.recordingProdStack),n=Je(t)===!1,i=n===!1?t:t.DEF,s=new ye({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});F(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);let a=Fo(i,o=>hr(o.GATE));return s.hasPredicates=a,r.definition.push(s),L(i,o=>{let c=new Te({definition:[]});s.definition.push(c),F(o,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:F(o,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),o.ALT.call(this),this.recordingProdStack.pop()}),Wc}function Ng(t){return t===0?"":`${t}`}function Bc(t){if(t<0||t>Cg){let e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
Idx value must be a none negative value smaller than ${Cg+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var Vc=class{initPerformanceTracer(e){if(F(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Ct.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:s}=ma(r),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return r()}};function _g(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let s=Object.getOwnPropertyDescriptor(n,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=r.prototype[i]})})}var Xi=Vr(zt,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Xi);var Ct=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Kr,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ji=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),Ze;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Ze||(Ze={}));function Kc(t=void 0){return function(){return t}}var wa=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{ga(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),L(this.definedRulesNames,i=>{let a=this[i].originalGrammarAction,o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=mg({rules:$e(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Z(n)&&this.skipValidations===!1){let i=gg({rules:$e(this.gastProductionsCache),tokenTypes:$e(this.tokensMap),errMsgProvider:or,grammarName:r}),s=cg({lookaheadStrategy:this.lookaheadStrategy,rules:$e(this.gastProductionsCache),tokenTypes:$e(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,s)}}),Z(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=Am($e(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:$e(this.gastProductionsCache)}),this.preComputeLookaheadFunctions($e(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Z(this.definitionErrors))throw e=I(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
${e.join(`
|
|
-------------------------------
|
|
`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),F(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
For further details.`);this.skipValidations=F(r,"skipValidations")?r.skipValidations:Ct.skipValidations}};wa.DEFER_DEFINITION_ERRORS_HANDLING=!1;_g(wa,[Ic,Pc,Mc,Fc,Uc,Gc,qc,zc,jc,Vc]);var Ia=class extends wa{constructor(e,r=Ct){let n=Ae(r);n.outputCst=!1,super(e,n)}};function ti(t,e,r){return`${t.name}_${e}_${r}`}var Tn=1,Wv=2,bg=4,Pg=5;var es=7,Vv=8,Kv=9,Hv=10,Yv=11,Og=12,_a=class{constructor(e){this.target=e}isEpsilon(){return!1}},Qi=class extends _a{constructor(e,r){super(e),this.tokenType=r}},ba=class extends _a{constructor(e){super(e)}isEpsilon(){return!0}},Zi=class extends _a{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function Lg(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Xv(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],s=ri(e,i,i);s!==void 0&&oA(e,i,s)}return e}function Xv(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],s=nt(t,i,void 0,{type:Wv}),a=nt(t,i,void 0,{type:es});s.stop=a,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,a)}}function Dg(t,e,r){return r instanceof te?Lf(t,e,r.terminalType,r):r instanceof fe?aA(t,e,r):r instanceof ye?tA(t,e,r):r instanceof de?rA(t,e,r):r instanceof ie?Jv(t,e,r):r instanceof ge?Qv(t,e,r):r instanceof Re?Zv(t,e,r):r instanceof xe?eA(t,e,r):ri(t,e,r)}function Jv(t,e,r){let n=nt(t,e,r,{type:Pg});Rn(t,n);let i=ts(t,e,n,r,ri(t,e,r));return Fg(t,e,r,i)}function Qv(t,e,r){let n=nt(t,e,r,{type:Pg});Rn(t,n);let i=ts(t,e,n,r,ri(t,e,r)),s=Lf(t,e,r.separator,r);return Fg(t,e,r,i,s)}function Zv(t,e,r){let n=nt(t,e,r,{type:bg});Rn(t,n);let i=ts(t,e,n,r,ri(t,e,r));return Mg(t,e,r,i)}function eA(t,e,r){let n=nt(t,e,r,{type:bg});Rn(t,n);let i=ts(t,e,n,r,ri(t,e,r)),s=Lf(t,e,r.separator,r);return Mg(t,e,r,i,s)}function tA(t,e,r){let n=nt(t,e,r,{type:Tn});Rn(t,n);let i=I(r.definition,a=>Dg(t,e,a));return ts(t,e,n,r,...i)}function rA(t,e,r){let n=nt(t,e,r,{type:Tn});Rn(t,n);let i=ts(t,e,n,r,ri(t,e,r));return nA(t,e,r,i)}function ri(t,e,r){let n=at(I(r.definition,i=>Dg(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:sA(t,n)}function Mg(t,e,r,n,i){let s=n.left,a=n.right,o=nt(t,e,r,{type:Yv});Rn(t,o);let c=nt(t,e,r,{type:Og});return s.loopback=o,c.loopback=o,t.decisionMap[ti(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Ke(a,o),i===void 0?(Ke(o,s),Ke(o,c)):(Ke(o,c),Ke(o,i.left),Ke(i.right,s)),{left:s,right:c}}function Fg(t,e,r,n,i){let s=n.left,a=n.right,o=nt(t,e,r,{type:Hv});Rn(t,o);let c=nt(t,e,r,{type:Og}),l=nt(t,e,r,{type:Kv});return o.loopback=l,c.loopback=l,Ke(o,s),Ke(o,c),Ke(a,l),i!==void 0?(Ke(l,c),Ke(l,i.left),Ke(i.right,s)):Ke(l,o),t.decisionMap[ti(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:c}}function nA(t,e,r,n){let i=n.left,s=n.right;return Ke(i,s),t.decisionMap[ti(e,"Option",r.idx)]=i,n}function Rn(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function ts(t,e,r,n,...i){let s=nt(t,e,n,{type:Vv,start:r});r.end=s;for(let o of i)o!==void 0?(Ke(r,o.left),Ke(o.right,s)):Ke(r,s);let a={left:r,right:s};return t.decisionMap[ti(e,iA(n),n.idx)]=r,a}function iA(t){if(t instanceof ye)return"Alternation";if(t instanceof de)return"Option";if(t instanceof ie)return"Repetition";if(t instanceof ge)return"RepetitionWithSeparator";if(t instanceof Re)return"RepetitionMandatory";if(t instanceof xe)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function sA(t,e){let r=e.length;for(let s=0;s<r-1;s++){let a=e[s],o;a.left.transitions.length===1&&(o=a.left.transitions[0]);let c=o instanceof Zi,l=o,f=e[s+1].left;a.left.type===Tn&&a.right.type===Tn&&o!==void 0&&(c&&l.followState===a.right||o.target===a.right)?(c?l.followState=f:o.target=f,cA(t,a.right)):Ke(a.right,f)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Lf(t,e,r,n){let i=nt(t,e,n,{type:Tn}),s=nt(t,e,n,{type:Tn});return Df(i,new Qi(s,r)),{left:i,right:s}}function aA(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),s=nt(t,e,r,{type:Tn}),a=nt(t,e,r,{type:Tn}),o=new Zi(i,n,a);return Df(s,o),{left:s,right:a}}function oA(t,e,r){let n=t.ruleToStartState.get(e);Ke(n,r.left);let i=t.ruleToStopState.get(e);return Ke(r.right,i),{left:n,right:i}}function Ke(t,e){let r=new ba(e);Df(t,r)}function nt(t,e,r,n){let i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function Df(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function cA(t,e){t.states.splice(t.states.indexOf(e),1)}var Pa={},rs=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=Mf(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return I(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function Mf(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function lA(t,e){let r={};return n=>{let i=n.toString(),s=r[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},r[i]=s),s}}var Hc=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="",r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}},Gg=new Hc,Oa=class extends Hr{constructor(e){var r;super(),this.logging=(r=e?.logging)!==null&&r!==void 0?r:(n=>console.log(n))}initialize(e){this.atn=Lg(e.rules),this.dfas=uA(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=ti(n,"Alternation",r),f=this.atn.decisionMap[c].decision,p=I(Cc({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),h=>I(h,g=>g[0]));if(Ug(p,!1)&&!s){let h=Fe(p,(g,k,N)=>(L(k,q=>{q&&(g[q.tokenTypeIdx]=N,L(q.categoryMatches,D=>{g[D]=N}))}),g),{});return i?function(g){var k;let N=this.LA(1),q=h[N.tokenTypeIdx];if(g!==void 0&&q!==void 0){let D=(k=g[q])===null||k===void 0?void 0:k.GATE;if(D!==void 0&&D.call(this)===!1)return}return q}:function(){let g=this.LA(1);return h[g.tokenTypeIdx]}}else return i?function(h){let g=new Hc,k=h===void 0?0:h.length;for(let q=0;q<k;q++){let D=h?.[q].GATE;g.set(q,D===void 0||D.call(this))}let N=Ff.call(this,a,f,g,o);return typeof N=="number"?N:void 0}:function(){let h=Ff.call(this,a,f,Gg,o);return typeof h=="number"?h:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=ti(n,i,r),f=this.atn.decisionMap[c].decision,p=I(Cc({maxLookahead:1,occurrence:r,prodType:i,rule:n}),h=>I(h,g=>g[0]));if(Ug(p)&&p[0][0]&&!s){let h=p[0],g=We(h);if(g.length===1&&Z(g[0].categoryMatches)){let N=g[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===N}}else{let k=Fe(g,(N,q)=>(q!==void 0&&(N[q.tokenTypeIdx]=!0,L(q.categoryMatches,D=>{N[D]=!0})),N),{});return function(){let N=this.LA(1);return k[N.tokenTypeIdx]===!0}}}return function(){let h=Ff.call(this,a,f,Gg,o);return typeof h=="object"?!1:h===0}}};function Ug(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let s of n){if(s===void 0){if(e)break;return!1}let a=[s.tokenTypeIdx].concat(s.categoryMatches);for(let o of a)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}function uA(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=lA(t.decisionStates[n],n);return r}function Ff(t,e,r,n){let i=t[e](r),s=i.start;if(s===void 0){let o=EA(i.atnStartState);s=jg(i,zg(o)),i.start=s}return fA.apply(this,[i,s,r,n])}function fA(t,e,r,n){let i=e,s=1,a=[],o=this.LA(s++);for(;;){let c=yA(i,o);if(c===void 0&&(c=dA.apply(this,[t,i,o,s,r,n])),c===Pa)return gA(a,i,o);if(c.isAcceptState===!0)return c.prediction;i=c,a.push(o),o=this.LA(s++)}}function dA(t,e,r,n,i,s){let a=TA(e.configs,r,i);if(a.size===0)return qg(t,e,r,Pa),Pa;let o=zg(a),c=xA(a,i);if(c!==void 0)o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c;else if(SA(a)){let l=nm(a.alts);o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l,pA.apply(this,[t,n,a.alts,s])}return o=qg(t,e,r,o),o}function pA(t,e,r,n){let i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);let s=t.atnStartState,a=s.rule,o=s.production,c=hA({topLevelRule:a,ambiguityIndices:r,production:o,prefixPath:i});n(c)}function hA(t){let e=I(t.prefixPath,i=>Wr(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${mA(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
|
|
<${e}> may appears as a prefix path in all these alternatives.
|
|
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
For Further details.`,n}function mA(t){if(t instanceof fe)return"SUBRULE";if(t instanceof de)return"OPTION";if(t instanceof ye)return"OR";if(t instanceof Re)return"AT_LEAST_ONE";if(t instanceof xe)return"AT_LEAST_ONE_SEP";if(t instanceof ge)return"MANY_SEP";if(t instanceof ie)return"MANY";if(t instanceof te)return"CONSUME";throw Error("non exhaustive match")}function gA(t,e,r){let n=ft(e.configs.elements,s=>s.state.transitions),i=im(n.filter(s=>s instanceof Qi).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function yA(t,e){return t.edges[e.tokenTypeIdx]}function TA(t,e,r){let n=new rs,i=[];for(let a of t.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===es){i.push(a);continue}let o=a.state.transitions.length;for(let c=0;c<o;c++){let l=a.state.transitions[c],f=RA(l,e);f!==void 0&&n.add({state:f,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&n.size===1&&(s=n),s===void 0){s=new rs;for(let a of n.elements)Yc(a,s)}if(i.length>0&&!AA(s))for(let a of i)s.add(a);return s}function RA(t,e){if(t instanceof Qi&&Ra(e,t.tokenType))return t.target}function xA(t,e){let r;for(let n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function zg(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function qg(t,e,r,n){return n=jg(t,n),e.edges[r.tokenTypeIdx]=n,n}function jg(t,e){if(e===Pa)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function EA(t){let e=new rs,r=t.transitions.length;for(let n=0;n<r;n++){let s={state:t.transitions[n].target,alt:n,stack:[]};Yc(s,e)}return e}function Yc(t,e){let r=t.state;if(r.type===es){if(t.stack.length>0){let i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};Yc(a,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i<n;i++){let s=r.transitions[i],a=vA(t,s);a!==void 0&&Yc(a,e)}}function vA(t,e){if(e instanceof ba)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Zi){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function AA(t){for(let e of t.elements)if(e.state.type===es)return!0;return!1}function $A(t){for(let e of t.elements)if(e.state.type!==es)return!1;return!0}function SA(t){if($A(t))return!0;let e=kA(t.elements);return CA(e)&&!NA(e)}function kA(t){let e=new Map;for(let r of t){let n=Mf(r,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function CA(t){for(let e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function NA(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}cs();var za=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new ls(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new ai;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new si(e.startOffset,e.image.length,Li(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let r=e.container;if(r){let n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){let r=[];for(let s of e){let a=new si(s.startOffset,s.image.length,Li(s),s.tokenType,!0);a.root=this.rootNode,r.push(a)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){let s=n.container.content.indexOf(n);if(s>0){n.container.content.splice(s,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){let r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},ja=class{get hidden(){return!1}get astNode(){let e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},si=class extends ja{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},ai=class extends ja{constructor(){super(...arguments),this.content=new qd(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){let e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:oe.create(0,0),end:oe.create(0,0)}}get firstNonHiddenNode(){for(let e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){let r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},qd=class t extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.container=this.parent}},ls=class extends ai{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var sl=Symbol("Datatype");function zd(t){return t.$type===sl}var Bg="\u200B",Wg=t=>t.endsWith(Bg)?t:t+Bg,Ba=class{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;let r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new jd(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new ol(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}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()}},Wa=class extends Ba{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new za,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){let n=this.computeRuleType(e),i;pn(e)&&(i=e.name,this.registerPrecedenceMap(e));let s=this.wrapper.DEFINE_RULE(Wg(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,s),rt(e)&&e.entry&&(this.mainRule=s),s}registerPrecedenceMap(e){let r=e.name,n=new Map;for(let i=0;i<e.operators.precedences.length;i++){let s=e.operators.precedences[i];for(let a of s.operators)n.set(a.value,{precedence:i,rightAssoc:s.associativity==="right"})}this.operatorPrecedence.set(r,n)}computeRuleType(e){return pn(e)?mn(e):e.fragment?void 0:pa(e)?sl:mn(e)}parse(e,r={}){this.nodeBuilder.buildRootNode(e);let n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;let i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");let s=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,Si(s,{deep:!0}),{value:s,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let r=this.wrapper.rule(e);if(this.stack.length>0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{let s=!this.isRecording()&&e!==void 0;if(s){let a={$type:e};this.stack.push(a),e===sl?a.value="":r!==void 0&&(a.$infixName=r)}return n(i),s?this.construct():void 0}}extractHiddenTokens(e){let r=this.lexerResult.hidden;if(!r.length)return[];let n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){let s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);let a=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:c}=this.getAssignment(n),l=this.current;if(o){let f=Vt(n)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,f,a,c)}else if(zd(l)){let f=i.image;Vt(n)||(f=this.converter.convert(f,a).toString()),l.value+=f}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,s){let a;!this.isRecording()&&!n&&(a=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,s)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,i,a))}}performSubruleAssignment(e,r,n){let{assignment:i,crossRef:s}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,s);else if(!i){let a=this.current;if(zd(a))a.value+=e.toString();else if(typeof e=="object"&&e){let c=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(c)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);let s={$type:e};this.stack.push(s),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;let e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):zd(e)?this.converter.convert(e.value,e.$cstNode):(Tu(this.astReflection,e),e)}constructInfix(e,r){let n=e.parts;if(!Array.isArray(n)||n.length===0)return;let i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let s=0,a=-1;for(let N=0;N<i.length;N++){let q=i[N],D=r.get(q)??{precedence:1/0,rightAssoc:!1};D.precedence>a?(a=D.precedence,s=N):D.precedence===a&&(D.rightAssoc||(s=N))}let o=i.slice(0,s),c=i.slice(s+1),l=n.slice(0,s+1),f=n.slice(s+1),p={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:o},h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:f,operators:c},g=this.constructInfix(p,r),k=this.constructInfix(h,r);return{$type:e.$type,$cstNode:e.$cstNode,left:g,operator:i[s],right:k}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=Dr(e,ir);this.assignmentMap.set(e,{assignment:r,crossRef:r&&sr(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,s){let a=this.current,o;switch(s==="single"&&typeof n=="string"?o=this.linker.buildReference(a,r,i,n):s==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(a,r,i,n):o=n,e){case"=":{a[r]=o;break}case"?=":{a[r]=!0;break}case"+=":Array.isArray(a[r])||(a[r]=[]),a[r].push(o)}}assignWithoutOverride(e,r){for(let[i,s]of Object.entries(r)){let a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}let n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},al=class{buildMismatchTokenMessage(e){return Kr.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Kr.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Kr.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Kr.buildEarlyExitMessage(e)}},us=class extends al{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},Va=class extends Ba{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(Wg(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,s){this.before(i),this.wrapper.wrapSubrule(e,r,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},IA={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new us},ol=class extends Ia{constructor(e,r){let n=r&&"maxLookahead"in r;super(e,{...IA,lookaheadStrategy:n?new Hr({maxLookahead:r.maxLookahead}):new Oa({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},jd=class extends ol{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}};function Ka(t,e,r){return _A({parser:e,tokens:r,ruleNames:new Map},t),e}function _A(t,e){let r=fa(e,!1),n=ee(e.rules).filter(rt).filter(s=>r.has(s));for(let s of n){let a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(s,oi(a,s.definition))}let i=ee(e.rules).filter(pn).filter(s=>r.has(s));for(let s of i)t.parser.rule(s,bA(t,s))}function bA(t,e){let r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if($t(r))throw new Error("Cannot use terminal rule in infix expression");let n=e.operators.precedences.flatMap(g=>g.operators),i={$type:"Group",elements:[]},s={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(s,a);let c={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},l={...s,$container:a};a.elements.push(c,l);let p=n.map(g=>t.tokens[g.value]).map((g,k)=>({ALT:()=>t.parser.consume(k,g,c)})),h;return g=>{h??(h=Wd(t,r)),t.parser.subrule(0,h,!1,s,g),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,p),t.parser.subrule(1,h,!1,l,g)}})}}function oi(t,e,r=!1){let n;if(Vt(e))n=GA(t,e);else if(Ur(e))n=PA(t,e);else if(ir(e))n=oi(t,e.terminal);else if(sr(e))n=Vg(t,e);else if(ar(e))n=OA(t,e);else if(tc(e))n=DA(t,e);else if(sc(e))n=MA(t,e);else if(dn(e))n=FA(t,e);else if(Su(e)){let i=t.consume++;n=()=>t.parser.consume(i,zt,e)}else throw new Kn(e.$cstNode,`Unexpected element type: ${e.$type}`);return Kg(t,r?void 0:cl(e),n,e.cardinality)}function PA(t,e){let r=mn(e);return()=>t.parser.action(r,e)}function OA(t,e){let r=e.rule.ref;if(Gr(r)){let n=t.subrule++,i=rt(r)&&r.fragment,s=e.arguments.length>0?LA(r,e.arguments):()=>({}),a;return o=>{a??(a=Wd(t,r)),t.parser.subrule(n,a,i,e,s(o))}}else if($t(r)){let n=t.consume++,i=Bd(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Rr(r);else throw new Kn(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function LA(t,e){if(e.some(n=>n.calledByName)){let n=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:Ar(i.value)}));return i=>{let s={};for(let{parameterName:a,predicate:o}of n)a&&(s[a]=o(i));return s}}else{let n=e.map(i=>Ar(i.value));return i=>{let s={};for(let a=0;a<n.length;a++)if(a<t.parameters.length){let o=t.parameters[a].name,c=n[a];s[o]=c(i)}return s}}}function Ar(t){if($u(t)){let e=Ar(t.left),r=Ar(t.right);return n=>e(n)||r(n)}else if(Au(t)){let e=Ar(t.left),r=Ar(t.right);return n=>e(n)&&r(n)}else if(Nu(t)){let e=Ar(t.value);return r=>!e(r)}else if(wu(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Eu(t)){let e=!!t.true;return()=>e}Rr(t)}function DA(t,e){if(e.elements.length===1)return oi(t,e.elements[0]);{let r=[];for(let i of e.elements){let s={ALT:oi(t,i,!0)},a=cl(i);a&&(s.GATE=Ar(a)),r.push(s)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(s=>{let a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function MA(t,e){if(e.elements.length===1)return oi(t,e.elements[0]);let r=[];for(let o of e.elements){let c={ALT:oi(t,o,!0)},l=cl(o);l&&(c.GATE=Ar(l)),r.push(c)}let n=t.or++,i=(o,c)=>{let l=c.getRuleStack().join("-");return`uGroup_${o}_${l}`},s=o=>t.parser.alternatives(n,r.map((c,l)=>{let f={ALT:()=>!0},p=t.parser;f.ALT=()=>{if(c.ALT(o),!p.isRecording()){let g=i(n,p);p.unorderedGroups.get(g)||p.unorderedGroups.set(g,[]);let k=p.unorderedGroups.get(g);typeof k?.[l]>"u"&&(k[l]=!0)}};let h=c.GATE;return h?f.GATE=()=>h(o):f.GATE=()=>!p.unorderedGroups.get(i(n,p))?.[l],f})),a=Kg(t,cl(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function FA(t,e){let r=e.elements.map(n=>oi(t,n));return n=>r.forEach(i=>i(n))}function cl(t){if(dn(t))return t.guardCondition}function Vg(t,e,r=e.terminal){if(r)if(ar(r)&&rt(r.rule.ref)){let n=r.rule.ref,i=t.subrule++,s;return a=>{s??(s=Wd(t,n)),t.parser.subrule(i,s,!1,e,a)}}else if(ar(r)&&$t(r.rule.ref)){let n=t.consume++,i=Bd(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Vt(r)){let n=t.consume++,i=Bd(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let i=fc(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+mn(e.type.ref));return Vg(t,e,i)}}function GA(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function Kg(t,e,r,n){let i=e&&Ar(e);if(!n)if(i){let s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>r(a),GATE:()=>i(a)},{ALT:Kc(),GATE:()=>!i(a)}])}else return r;if(n==="*"){let s=t.many++;return a=>t.parser.many(s,{DEF:()=>r(a),GATE:i?()=>i(a):void 0})}else if(n==="+"){let s=t.many++;if(i){let a=t.or++;return o=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>r(o)}),GATE:()=>i(o)},{ALT:Kc(),GATE:()=>!i(o)}])}else return a=>t.parser.atLeastOne(s,{DEF:()=>r(a)})}else if(n==="?"){let s=t.optional++;return a=>t.parser.optional(s,{DEF:()=>r(a),GATE:i?()=>i(a):void 0})}else Rr(n)}function Wd(t,e){let r=UA(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function UA(t,e){if(Gr(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!rt(n);)(dn(n)||tc(n)||sc(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function Bd(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function Vd(t){let e=t.Grammar,r=t.parser.Lexer,n=new Va(t);return Ka(e,n,r.definition),n.finalize(),n}function Kd(t){let e=Hg(t);return e.finalize(),e}function Hg(t){let e=t.Grammar,r=t.parser.Lexer,n=new Wa(t);return Ka(e,n,r.definition)}var Xr=class{constructor(){this.diagnostics=[]}buildTokens(e,r){let n=ee(fa(e,!1)),i=this.buildTerminalTokens(n),s=this.buildKeywordTokens(n,i,r);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter($t).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=Mi(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=ua(r)?Ne.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){let r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Gr).flatMap(i=>rr(i).filter(Vt)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){let i=this.buildKeywordPattern(e,n),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,r){return r?new RegExp(hn(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let s=i?.PATTERN;return s?.source&&Ku("^"+s.source+"$",e.value)&&n.push(i),n},[])}};var ci=class{convert(e,r){let n=r.grammarSource;if(sr(n)&&(n=Xu(n)),ar(n)){let i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){switch(e.name.toUpperCase()){case"INT":return $r.convertInt(r);case"STRING":return $r.convertString(r);case"ID":return $r.convertID(r)}switch(nf(e)?.toLowerCase()){case"number":return $r.convertNumber(r);case"boolean":return $r.convertBoolean(r);case"bigint":return $r.convertBigint(r);case"date":return $r.convertDate(r);default:return r}}},$r;(function(t){function e(l){let f="";for(let p=1;p<l.length-1;p++){let h=l.charAt(p);if(h==="\\"){let g=l.charAt(++p);f+=r(g)}else f+=h}return f}t.convertString=e;function r(l){switch(l){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return l}}function n(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=n;function i(l){return parseInt(l)}t.convertInt=i;function s(l){return BigInt(l)}t.convertBigint=s;function a(l){return new Date(l)}t.convertDate=a;function o(l){return Number(l)}t.convertNumber=o;function c(l){return l.toLowerCase()==="true"}t.convertBoolean=c})($r||($r={}));var B={};se(B,fu(Ha(),1));function ep(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}var dl=0,Qg=10;function pl(){return dl=performance.now(),new B.CancellationTokenSource}function Zg(t){Qg=t}var Kt=Symbol("OperationCancelled");function Sr(t){return t===Kt}async function Le(t){if(t===B.CancellationToken.None)return;let e=performance.now();if(e-dl>=Qg&&(dl=e,await ep(),dl=performance.now()),t.isCancellationRequested)throw Kt}var Nt=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};var hl=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=ry(n.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(a,this._content.length);let o=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,f=ey(n.text,!1,s);if(c-o===f.length)for(let h=0,g=f.length;h<g;h++)l[h+o+1]=f[h];else f.length<1e4?l.splice(o+1,c-o,...f):this._lineOffsets=l=l.slice(0,o+1).concat(f,l.slice(c+1));let p=n.text.length-(a-s);if(p!==0)for(let h=o+1+f.length,g=l.length;h<g;h++)l[h]=l[h]+p}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=ey(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let a=Math.floor((n+i)/2);r[a]>e?i=a:n=a+1}let s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let i=e.line+1<r.length?r[e.line+1]:this._content.length,s=Math.min(n+e.character,i);return this.ensureBeforeEOL(s,n)}ensureBeforeEOL(e,r){for(;e>r&&ty(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},hs;(function(t){function e(i,s,a,o){return new hl(i,s,a,o)}t.create=e;function r(i,s,a){if(i instanceof hl)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,s){let a=i.getText(),o=tp(s.map(XA),(f,p)=>{let h=f.range.start.line-p.range.start.line;return h===0?f.range.start.character-p.range.start.character:h}),c=0,l=[];for(let f of o){let p=i.offsetAt(f.range.start);if(p<c)throw new Error("Overlapping edit");p>c&&l.push(a.substring(c,p)),f.newText.length&&l.push(f.newText),c=i.offsetAt(f.range.end)}return l.push(a.substr(c)),l.join("")}t.applyEdits=n})(hs||(hs={}));function tp(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);tp(n,e),tp(i,e);let s=0,a=0,o=0;for(;s<n.length&&a<i.length;)e(n[s],i[a])<=0?t[o++]=n[s++]:t[o++]=i[a++];for(;s<n.length;)t[o++]=n[s++];for(;a<i.length;)t[o++]=i[a++];return t}function ey(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);ty(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function ty(t){return t===13||t===10}function ry(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function XA(t){let e=ry(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var ny;(()=>{"use strict";var t={975:$=>{function y(T){if(typeof T!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(T))}function O(T,x){for(var A,_="",M=0,C=-1,H=0,J=0;J<=T.length;++J){if(J<T.length)A=T.charCodeAt(J);else{if(A===47)break;A=47}if(A===47){if(!(C===J-1||H===1))if(C!==J-1&&H===2){if(_.length<2||M!==2||_.charCodeAt(_.length-1)!==46||_.charCodeAt(_.length-2)!==46){if(_.length>2){var je=_.lastIndexOf("/");if(je!==_.length-1){je===-1?(_="",M=0):M=(_=_.slice(0,je)).length-1-_.lastIndexOf("/"),C=J,H=0;continue}}else if(_.length===2||_.length===1){_="",M=0,C=J,H=0;continue}}x&&(_.length>0?_+="/..":_="..",M=2)}else _.length>0?_+="/"+T.slice(C+1,J):_=T.slice(C+1,J),M=J-C-1;C=J,H=0}else A===46&&H!==-1?++H:H=-1}return _}var P={resolve:function(){for(var T,x="",A=!1,_=arguments.length-1;_>=-1&&!A;_--){var M;_>=0?M=arguments[_]:(T===void 0&&(T=process.cwd()),M=T),y(M),M.length!==0&&(x=M+"/"+x,A=M.charCodeAt(0)===47)}return x=O(x,!A),A?x.length>0?"/"+x:"/":x.length>0?x:"."},normalize:function(T){if(y(T),T.length===0)return".";var x=T.charCodeAt(0)===47,A=T.charCodeAt(T.length-1)===47;return(T=O(T,!x)).length!==0||x||(T="."),T.length>0&&A&&(T+="/"),x?"/"+T:T},isAbsolute:function(T){return y(T),T.length>0&&T.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var T,x=0;x<arguments.length;++x){var A=arguments[x];y(A),A.length>0&&(T===void 0?T=A:T+="/"+A)}return T===void 0?".":P.normalize(T)},relative:function(T,x){if(y(T),y(x),T===x||(T=P.resolve(T))===(x=P.resolve(x)))return"";for(var A=1;A<T.length&&T.charCodeAt(A)===47;++A);for(var _=T.length,M=_-A,C=1;C<x.length&&x.charCodeAt(C)===47;++C);for(var H=x.length-C,J=M<H?M:H,je=-1,le=0;le<=J;++le){if(le===J){if(H>J){if(x.charCodeAt(C+le)===47)return x.slice(C+le+1);if(le===0)return x.slice(C+le)}else M>J&&(T.charCodeAt(A+le)===47?je=le:le===0&&(je=0));break}var _e=T.charCodeAt(A+le);if(_e!==x.charCodeAt(C+le))break;_e===47&&(je=le)}var dr="";for(le=A+je+1;le<=_;++le)le!==_&&T.charCodeAt(le)!==47||(dr.length===0?dr+="..":dr+="/..");return dr.length>0?dr+x.slice(C+je):(C+=je,x.charCodeAt(C)===47&&++C,x.slice(C))},_makeLong:function(T){return T},dirname:function(T){if(y(T),T.length===0)return".";for(var x=T.charCodeAt(0),A=x===47,_=-1,M=!0,C=T.length-1;C>=1;--C)if((x=T.charCodeAt(C))===47){if(!M){_=C;break}}else M=!1;return _===-1?A?"/":".":A&&_===1?"//":T.slice(0,_)},basename:function(T,x){if(x!==void 0&&typeof x!="string")throw new TypeError('"ext" argument must be a string');y(T);var A,_=0,M=-1,C=!0;if(x!==void 0&&x.length>0&&x.length<=T.length){if(x.length===T.length&&x===T)return"";var H=x.length-1,J=-1;for(A=T.length-1;A>=0;--A){var je=T.charCodeAt(A);if(je===47){if(!C){_=A+1;break}}else J===-1&&(C=!1,J=A+1),H>=0&&(je===x.charCodeAt(H)?--H==-1&&(M=A):(H=-1,M=J))}return _===M?M=J:M===-1&&(M=T.length),T.slice(_,M)}for(A=T.length-1;A>=0;--A)if(T.charCodeAt(A)===47){if(!C){_=A+1;break}}else M===-1&&(C=!1,M=A+1);return M===-1?"":T.slice(_,M)},extname:function(T){y(T);for(var x=-1,A=0,_=-1,M=!0,C=0,H=T.length-1;H>=0;--H){var J=T.charCodeAt(H);if(J!==47)_===-1&&(M=!1,_=H+1),J===46?x===-1?x=H:C!==1&&(C=1):x!==-1&&(C=-1);else if(!M){A=H+1;break}}return x===-1||_===-1||C===0||C===1&&x===_-1&&x===A+1?"":T.slice(x,_)},format:function(T){if(T===null||typeof T!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof T);return(function(x,A){var _=A.dir||A.root,M=A.base||(A.name||"")+(A.ext||"");return _?_===A.root?_+M:_+"/"+M:M})(0,T)},parse:function(T){y(T);var x={root:"",dir:"",base:"",ext:"",name:""};if(T.length===0)return x;var A,_=T.charCodeAt(0),M=_===47;M?(x.root="/",A=1):A=0;for(var C=-1,H=0,J=-1,je=!0,le=T.length-1,_e=0;le>=A;--le)if((_=T.charCodeAt(le))!==47)J===-1&&(je=!1,J=le+1),_===46?C===-1?C=le:_e!==1&&(_e=1):C!==-1&&(_e=-1);else if(!je){H=le+1;break}return C===-1||J===-1||_e===0||_e===1&&C===J-1&&C===H+1?J!==-1&&(x.base=x.name=H===0&&M?T.slice(1,J):T.slice(H,J)):(H===0&&M?(x.name=T.slice(1,C),x.base=T.slice(1,J)):(x.name=T.slice(H,C),x.base=T.slice(H,J)),x.ext=T.slice(C,J)),H>0?x.dir=T.slice(0,H-1):M&&(x.dir="/"),x},sep:"/",delimiter:":",win32:null,posix:null};P.posix=P,$.exports=P}},e={};function r($){var y=e[$];if(y!==void 0)return y.exports;var O=e[$]={exports:{}};return t[$](O,O.exports,r),O.exports}r.d=($,y)=>{for(var O in y)r.o(y,O)&&!r.o($,O)&&Object.defineProperty($,O,{enumerable:!0,get:y[O]})},r.o=($,y)=>Object.prototype.hasOwnProperty.call($,y),r.r=$=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),Object.defineProperty($,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>h,Utils:()=>Wt}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function c($,y){if(!$.scheme&&y)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${$.authority}", path: "${$.path}", query: "${$.query}", fragment: "${$.fragment}"}`);if($.scheme&&!s.test($.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if($.path){if($.authority){if(!a.test($.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(o.test($.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let l="",f="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{static isUri(y){return y instanceof h||!!y&&typeof y.authority=="string"&&typeof y.fragment=="string"&&typeof y.path=="string"&&typeof y.query=="string"&&typeof y.scheme=="string"&&typeof y.fsPath=="string"&&typeof y.with=="function"&&typeof y.toString=="function"}scheme;authority;path;query;fragment;constructor(y,O,P,T,x,A=!1){typeof y=="object"?(this.scheme=y.scheme||l,this.authority=y.authority||l,this.path=y.path||l,this.query=y.query||l,this.fragment=y.fragment||l):(this.scheme=(function(_,M){return _||M?_:"file"})(y,A),this.authority=O||l,this.path=(function(_,M){switch(_){case"https":case"http":case"file":M?M[0]!==f&&(M=f+M):M=f}return M})(this.scheme,P||l),this.query=T||l,this.fragment=x||l,c(this,A))}get fsPath(){return b(this,!1)}with(y){if(!y)return this;let{scheme:O,authority:P,path:T,query:x,fragment:A}=y;return O===void 0?O=this.scheme:O===null&&(O=l),P===void 0?P=this.authority:P===null&&(P=l),T===void 0?T=this.path:T===null&&(T=l),x===void 0?x=this.query:x===null&&(x=l),A===void 0?A=this.fragment:A===null&&(A=l),O===this.scheme&&P===this.authority&&T===this.path&&x===this.query&&A===this.fragment?this:new k(O,P,T,x,A)}static parse(y,O=!1){let P=p.exec(y);return P?new k(P[2]||l,he(P[4]||l),he(P[5]||l),he(P[7]||l),he(P[9]||l),O):new k(l,l,l,l,l)}static file(y){let O=l;if(i&&(y=y.replace(/\\/g,f)),y[0]===f&&y[1]===f){let P=y.indexOf(f,2);P===-1?(O=y.substring(2),y=f):(O=y.substring(2,P),y=y.substring(P)||f)}return new k("file",O,y,l,l)}static from(y){let O=new k(y.scheme,y.authority,y.path,y.query,y.fragment);return c(O,!0),O}toString(y=!1){return v(this,y)}toJSON(){return this}static revive(y){if(y){if(y instanceof h)return y;{let O=new k(y);return O._formatted=y.external,O._fsPath=y._sep===g?y.fsPath:null,O}}return y}}let g=i?1:void 0;class k extends h{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath}toString(y=!1){return y?v(this,!0):(this._formatted||(this._formatted=v(this,!1)),this._formatted)}toJSON(){let y={$mid:1};return this._fsPath&&(y.fsPath=this._fsPath,y._sep=g),this._formatted&&(y.external=this._formatted),this.path&&(y.path=this.path),this.scheme&&(y.scheme=this.scheme),this.authority&&(y.authority=this.authority),this.query&&(y.query=this.query),this.fragment&&(y.fragment=this.fragment),y}}let N={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function q($,y,O){let P,T=-1;for(let x=0;x<$.length;x++){let A=$.charCodeAt(x);if(A>=97&&A<=122||A>=65&&A<=90||A>=48&&A<=57||A===45||A===46||A===95||A===126||y&&A===47||O&&A===91||O&&A===93||O&&A===58)T!==-1&&(P+=encodeURIComponent($.substring(T,x)),T=-1),P!==void 0&&(P+=$.charAt(x));else{P===void 0&&(P=$.substr(0,x));let _=N[A];_!==void 0?(T!==-1&&(P+=encodeURIComponent($.substring(T,x)),T=-1),P+=_):T===-1&&(T=x)}}return T!==-1&&(P+=encodeURIComponent($.substring(T))),P!==void 0?P:$}function D($){let y;for(let O=0;O<$.length;O++){let P=$.charCodeAt(O);P===35||P===63?(y===void 0&&(y=$.substr(0,O)),y+=N[P]):y!==void 0&&(y+=$[O])}return y!==void 0?y:$}function b($,y){let O;return O=$.authority&&$.path.length>1&&$.scheme==="file"?`//${$.authority}${$.path}`:$.path.charCodeAt(0)===47&&($.path.charCodeAt(1)>=65&&$.path.charCodeAt(1)<=90||$.path.charCodeAt(1)>=97&&$.path.charCodeAt(1)<=122)&&$.path.charCodeAt(2)===58?y?$.path.substr(1):$.path[1].toLowerCase()+$.path.substr(2):$.path,i&&(O=O.replace(/\//g,"\\")),O}function v($,y){let O=y?D:q,P="",{scheme:T,authority:x,path:A,query:_,fragment:M}=$;if(T&&(P+=T,P+=":"),(x||T==="file")&&(P+=f,P+=f),x){let C=x.indexOf("@");if(C!==-1){let H=x.substr(0,C);x=x.substr(C+1),C=H.lastIndexOf(":"),C===-1?P+=O(H,!1,!1):(P+=O(H.substr(0,C),!1,!1),P+=":",P+=O(H.substr(C+1),!1,!0)),P+="@"}x=x.toLowerCase(),C=x.lastIndexOf(":"),C===-1?P+=O(x,!1,!0):(P+=O(x.substr(0,C),!1,!0),P+=x.substr(C))}if(A){if(A.length>=3&&A.charCodeAt(0)===47&&A.charCodeAt(2)===58){let C=A.charCodeAt(1);C>=65&&C<=90&&(A=`/${String.fromCharCode(C+32)}:${A.substr(3)}`)}else if(A.length>=2&&A.charCodeAt(1)===58){let C=A.charCodeAt(0);C>=65&&C<=90&&(A=`${String.fromCharCode(C+32)}:${A.substr(2)}`)}P+=O(A,!0,!1)}return _&&(P+="?",P+=O(_,!1,!1)),M&&(P+="#",P+=y?M:q(M,!1,!1)),P}function K($){try{return decodeURIComponent($)}catch{return $.length>3?$.substr(0,3)+K($.substr(3)):$}}let G=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function he($){return $.match(G)?$.replace(G,(y=>K(y))):$}var fr=r(975);let Ye=fr.posix||fr,Jt="/";var Wt;(function($){$.joinPath=function(y,...O){return y.with({path:Ye.join(y.path,...O)})},$.resolvePath=function(y,...O){let P=y.path,T=!1;P[0]!==Jt&&(P=Jt+P,T=!0);let x=Ye.resolve(P,...O);return T&&x[0]===Jt&&!y.authority&&(x=x.substring(1)),y.with({path:x})},$.dirname=function(y){if(y.path.length===0||y.path===Jt)return y;let O=Ye.dirname(y.path);return O.length===1&&O.charCodeAt(0)===46&&(O=""),y.with({path:O})},$.basename=function(y){return Ye.basename(y.path)},$.extname=function(y){return Ye.extname(y.path)}})(Wt||(Wt={})),ny=n})();var{URI:et,Utils:ms}=ny;var ze;(function(t){t.basename=ms.basename,t.dirname=ms.dirname,t.extname=ms.extname,t.joinPath=ms.joinPath,t.resolvePath=ms.resolvePath;let e=typeof process=="object"&&process?.platform==="win32";function r(a,o){return a?.toString()===o?.toString()}t.equals=r;function n(a,o){let c=typeof a=="string"?et.parse(a).path:a.path,l=typeof o=="string"?et.parse(o).path:o.path,f=c.split("/").filter(N=>N.length>0),p=l.split("/").filter(N=>N.length>0);if(e){let N=/^[A-Z]:$/;if(f[0]&&N.test(f[0])&&(f[0]=f[0].toLowerCase()),p[0]&&N.test(p[0])&&(p[0]=p[0].toLowerCase()),f[0]!==p[0])return l.substring(1)}let h=0;for(;h<f.length&&f[h]===p[h];h++);let g="../".repeat(f.length-h),k=p.slice(h).join("/");return g+k}t.relative=n;function i(a){return et.parse(a.toString()).toString()}t.normalize=i;function s(a,o){let c=typeof a=="string"?a:a.path,l=typeof o=="string"?o:o.path;return l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l===c?!0:l.length<c.length||l.charAt(c.length)!=="/"?!1:l.startsWith(c)}t.contains=s})(ze||(ze={}));var gs=class{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return ze.normalize(e)}clear(){this.root.children.clear()}insert(e,r){let n=this.getNode(this.normalizeUri(e),!0);n.element=r}delete(e){let r=this.getNode(this.normalizeUri(e),!1);r?.parent&&r.parent.children.delete(r.name)}has(e){return this.getNode(this.normalizeUri(e),!1)?.element!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){return this.getNode(this.normalizeUri(e),!1)?.element}findNode(e){let r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:ze.joinPath(et.parse(r),n.name).toString(),element:n.element}}findChildren(e){let r=this.normalizeUri(e),n=this.getNode(r,!1);return n?Array.from(n.children.values()).map(i=>({name:i.name,uri:ze.joinPath(et.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let r=this.getNode(ze.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){let n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(let s of n){let a=i.children.get(s);if(!a)if(r)a={name:s,children:new Map,parent:i},i.children.set(s,a);else return;i=a}return i}collectValues(e){let r=[];e.element&&r.push(e.element);for(let n of e.children.values())r.push(...this.collectValues(n));return r}};var Q;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Q||(Q={}));var Ya=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=B.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??et.parse(e.uri),B.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return B.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){let i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){let i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{let i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){let i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{let i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let s;if(n)s={parseResult:e,uri:r,state:Q.Parsed,references:[],textDocument:n};else{let a=this.createTextDocumentGetter(r,i);s={parseResult:e,uri:r,state:Q.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,r){let n=e.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(e.uri.toString()),s=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{let a=this.createTextDocumentGetter(e.uri,s);Object.defineProperty(e,"textDocument",{get:a})}return n!==s&&(e.parseResult=await this.parseAsync(e.uri,s,r),e.parseResult.value.$document=e),e.state=Q.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){let n=this.serviceRegistry,i;return()=>i??(i=hs.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},Xa=class{constructor(e){this.documentTrie=new gs,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ee(this.documentTrie.all())}addDocument(e){let r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){let r=e.toString();return this.documentTrie.find(r)}getDocuments(e){let r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Q.Changed),n}deleteDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Q.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){let r=e.toString(),n=this.documentTrie.findAll(r);for(let i of n)i.state=Q.Changed;return this.documentTrie.delete(r),n}};var ui=Symbol("RefResolving"),Ja=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=B.CancellationToken.None){if(this.profiler?.isActive("linking")){let n=this.profiler.createTask("linking",this.languageId);n.start();try{for(let i of At(e.parseResult.value))await Le(r),an(i).forEach(s=>{let a=`${i.$type}:${s.property}`;n.startSubTask(a);try{this.doLink(s,e)}finally{n.stopSubTask(a)}})}finally{n.stop()}}else for(let n of At(e.parseResult.value))await Le(r),an(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=ui;try{let i=this.getCandidate(e);if(Pn(i))n._ref=i;else{n._nodeDescription=i;let s=this.loadAstNode(i);n._ref=s??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);let s=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${s}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=ui;try{let i=this.getCandidates(e),s=[];if(Pn(i))n._linkingError=i;else for(let a of i){let o=this.loadAstNode(a);o&&s.push({ref:o,$nodeDescription:a})}n._items=s}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(let r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){let n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){let s=this,a={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Oe(this._ref))return this._ref;if(mu(this._nodeDescription)){let o=s.loadAstNode(this._nodeDescription);this._ref=o??s.createLinkingError({reference:a,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=ui;let o=ki(e).$document,c=s.getLinkedNode({reference:a,container:e,property:r});if(c.error&&o&&o.state<Q.ComputedScopes)return this._ref=void 0;this._ref=c.node??c.error,this._nodeDescription=c.descr,o?.references.push(this)}else this._ref===ui&&s.throwCyclicReferenceError(e,r,i);return Oe(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Pn(this._ref)?this._ref:void 0}};return a}buildMultiReference(e,r,n,i){let s=this,a={$refNode:n,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=ui;let o=ki(e).$document,c=s.getCandidates({reference:a,container:e,property:r}),l=[];if(Pn(c))this._linkingError=c;else for(let f of c){let p=s.loadAstNode(f);p&&l.push({ref:p,$nodeDescription:f})}this._items=l,o?.references.push(this)}else this._items===ui&&s.throwCyclicReferenceError(e,r,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=s.createLinkingError({reference:a,container:e,property:r})}};return a}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{let r=this.getCandidate(e);if(Pn(r))return{error:r};let n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);let n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){let n=ki(e.container).$document;n&&n.state<Q.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}};function iy(t){return typeof t.name=="string"}var Qa=class{getName(e){if(iy(e))return e.name}getNameNode(e){return da(e.$cstNode,"name")}};var Za=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=At(e.Grammar).some(r=>sr(r)&&r.isMulti)}findDeclarations(e){if(e){let r=rf(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(Qe(i)||Ft(i))return Uo(i);if(Array.isArray(i)){for(let s of i)if((Qe(s)||Ft(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return Uo(s)}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||Gu(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(let i of an(n))if(Ft(i.reference)&&i.reference.items.some(s=>s.ref===e))return i.reference.items.map(s=>s.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;let r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){let r=this.findDeclarations(e),n=[];for(let i of r){let s=this.nameProvider.getNameNode(i)??i.$cstNode;s&&n.push(s)}return n}findReferences(e,r){let n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(s=>ze.equals(s.sourceUri,r.documentUri))),n.push(...i),ee(n)}getSelfReferences(e){let r=this.getSelfNodes(e),n=[];for(let i of r){let s=this.nameProvider.getNameNode(i);if(s){let a=ht(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:Vn(s),local:!0})}}return n}};var gt=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return $i.sum(ee(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){let r=this.map.get(e);return r?ee(r):sn}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ee(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ee(this.map.keys())}values(){return ee(this.map.values()).flat()}entriesGroupedByKey(){return ee(this.map.entries())}},fi=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}};var eo=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=B.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=Ys,i=B.CancellationToken.None){let s=[];this.addExportedSymbol(e,s,r);for(let a of n(e))await Le(i),this.addExportedSymbol(a,s,r);return s}addExportedSymbol(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=B.CancellationToken.None){let n=e.parseResult.value,i=new gt;for(let s of rr(n))await Le(r),this.addLocalSymbol(s,e,i);return i}addLocalSymbol(e,r,n){let i=e.$container;if(i){let s=this.nameProvider.getName(e);s&&n.add(i,this.descriptions.createDescription(e,s,r))}}};var ys=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},rp=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(s,i)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?ee(i).concat(this.outerScope.getElements(e)):ee(i)}getAllElements(){let e=ee(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},to=class{constructor(e,r,n){this.elements=new gt,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(s,i)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?ee(n).concat(this.outerScope.getElements(e)):ee(n)}getAllElements(){let e=ee(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},JA={getElement(){},getElements(){return sn},getAllElements(){return sn}};var Ts=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},ro=class extends Ts{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){let n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},di=class extends Ts{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let s=n();return i.set(r,s),s}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},ml=class extends di{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(let s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{let s=n.concat(i);for(let a of s)this.clear(a)}))}},Rs=class extends ro{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var no=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Rs(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=ht(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&r.push(i.getStream(a).filter(o=>this.reflection.isSubtype(o.type,n))),a=a.$container;while(a)}let s=this.getGlobalScope(n,e);for(let a=r.length-1;a>=0;a--)s=this.createScope(r[a],s);return s}createScope(e,r,n){return new ys(ee(e),r,n)}createScopeForNodes(e,r,n){let i=ee(e).map(s=>{let a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new ys(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new to(this.indexManager.allElements(e)))}};function np(t){return typeof t.$comment=="string"}function sy(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}var io=class{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,r){let n=r??{},i=r?.replacer,s=(o,c)=>this.replacer(o,c,n),a=i?(o,c)=>i(o,c,s):s;try{return this.currentDocument=ht(e),JSON.stringify(e,a,r?.space)}finally{this.currentDocument=void 0}}deserialize(e,r){let n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:s,comments:a,uriConverter:o}){if(!this.ignoreProperties.has(e))if(Qe(r)){let c=r.ref,l=n?r.$refText:void 0;if(c){let f=ht(c),p="";this.currentDocument&&this.currentDocument!==f&&(o?p=o(f.uri,c):p=f.uri.toString());let h=this.astNodeLocator.getAstNodePath(c);return{$ref:`${p}#${h}`,$refText:l}}else return{$error:r.error?.message??"Could not resolve reference",$refText:l}}else if(Ft(r)){let c=n?r.$refText:void 0,l=[];for(let f of r.items){let p=f.ref,h=ht(f.ref),g="";this.currentDocument&&this.currentDocument!==h&&(o?g=o(h.uri,p):g=h.uri.toString());let k=this.astNodeLocator.getAstNodePath(p);l.push(`${g}#${k}`)}return{$refs:l,$refText:c}}else if(Oe(r)){let c;if(s&&(c=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&c?.$textRegion&&(c.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!e&&(c??(c={...r}),c.$sourceText=r.$cstNode?.text),a){c??(c={...r});let l=this.commentProvider.getComment(r);l&&(c.$comment=l.replace(/\r/g,""))}return c??r}else return r}addAstNodeRegionWithAssignmentsTo(e){let r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{let a=Qu(e.$cstNode,s).map(r);a.length!==0&&(i[s]=a)}),e}}linkNode(e,r,n,i,s,a){for(let[c,l]of Object.entries(e))if(Array.isArray(l))for(let f=0;f<l.length;f++){let p=l[f];sy(p)?l[f]=this.reviveReference(e,c,r,p,n):Oe(p)&&this.linkNode(p,r,n,e,c,f)}else sy(l)?e[c]=this.reviveReference(e,c,r,l,n):Oe(l)&&this.linkNode(l,r,n,e,c);let o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,r,n,i,s){let a=i.$refText,o=i.$error,c;if(i.$ref){let l=this.getRefNode(n,i.$ref,s.uriConverter);if(Oe(l))return a||(a=this.nameProvider.getName(l)),{$refText:a??"",ref:l};o=l}else if(i.$refs){let l=[];for(let f of i.$refs){let p=this.getRefNode(n,f,s.uriConverter);Oe(p)&&l.push({ref:p})}if(l.length===0)c={$refText:a??"",items:l},o??(o="Could not resolve multi-reference");else return{$refText:a??"",items:l}}if(o)return c??(c={$refText:a??"",ref:void 0}),c.error={info:{container:e,property:r,reference:c},message:o},c}getRefNode(e,r,n){try{let i=r.indexOf("#");if(i===0){let c=this.astNodeLocator.getAstNode(e,r.substring(1));return c||"Could not resolve path: "+r}if(i<0){let c=n?n(r):et.parse(r),l=this.langiumDocuments.getDocument(c);return l?l.parseResult.value:"Could not find document for URI: "+r}let s=n?n(r.substring(0,i)):et.parse(r.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+r;if(i===r.length-1)return a.parseResult.value;let o=this.astNodeLocator.getAstNode(a.parseResult.value,r.substring(i+1));return o||"Could not resolve URI: "+r}catch(i){return String(i)}}};var so=class{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){let r=e.LanguageMetaData;for(let n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);if(r.fileNames)for(let n of r.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(r.languageId,e)}getServices(e){if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let r=this.textDocuments?.get(e)?.languageId;if(r!==void 0){let a=this.languageIdMap.get(r);if(a)return a}let n=ze.extname(e),i=ze.basename(e),s=this.fileNameMap.get(i)??this.fileExtensionMap.get(n);if(!s)throw r?new Error(`The service registry contains no services for the extension '${n}' for language '${r}'.`):new Error(`The service registry contains no services for the extension '${n}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}};function pi(t){return{code:t}}var gl;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(gl||(gl={}));var ao=class{constructor(e){this.entries=new gt,this.knownCategories=new Set(gl.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(n);for(let[i,s]of Object.entries(e)){let a=s;if(Array.isArray(a))for(let o of a){let c={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,c)}else if(typeof a=="function"){let o={check:this.wrapValidationException(a,r),category:n};this.addEntry(i,o)}else Rr(a)}}wrapValidationException(e,r){return async(n,i,s)=>{await this.handleException(()=>e.call(r,n,i,s),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(s){if(Sr(s))throw s;console.error(`${r}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);let a=s instanceof Error?s.message:String(s);n("error",`${r}: ${a}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=ee(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,s,a,o)=>{await this.handleException(()=>e.call(n,i,s,a,o),r,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}};var ay=Object.freeze({validateNode:!0,validateChildren:!0}),oo=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=B.CancellationToken.None){let i=e.parseResult,s=[];if(await Le(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,s,r),r.stopAfterLexingErrors&&s.some(a=>a.data?.code===Ht.LexingError)||(this.processParsingErrors(i,s,r),r.stopAfterParsingErrors&&s.some(a=>a.data?.code===Ht.ParsingError))||(this.processLinkingErrors(e,s,r),r.stopAfterLinkingErrors&&s.some(a=>a.data?.code===Ht.LinkingError))))return s;try{s.push(...await this.validateAst(i.value,r,n))}catch(a){if(Sr(a))throw a;console.error("An error occurred during validation:",a)}return await Le(n),s}processLexingErrors(e,r,n){let i=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(let s of i){let a=s.severity??"error",o={severity:yl(a),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:cy(a),source:this.getSource()};r.push(o)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){let a=i.previousToken;if(isNaN(a.startOffset)){let o={line:0,character:0};s={start:o,end:o}}else{let o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=Li(i.token);if(s){let a={severity:yl("error"),range:s,message:i.message,data:pi(Ht.ParsingError),source:this.getSource()};r.push(a)}}}processLinkingErrors(e,r,n){for(let i of e.references){let s=i.error;if(s){let a={node:s.info.container,range:i.$refNode?.range,property:s.info.property,index:s.info.index,data:{code:Ht.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,r,n=B.CancellationToken.None){let i=[],s=(a,o,c)=>{i.push(this.toDiagnostic(a,o,c))};return await this.validateAstBefore(e,r,s,n),await this.validateAstNodes(e,r,s,n),await this.validateAstAfter(e,r,s,n),i}async validateAstBefore(e,r,n,i=B.CancellationToken.None){let s=this.validationRegistry.checksBefore;for(let a of s)await Le(i),await a(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=B.CancellationToken.None){if(this.profiler?.isActive("validating")){let s=this.profiler.createTask("validating",this.languageId);s.start();try{let a=At(e).iterator();for(let o of a){s.startSubTask(o.$type);let c=this.validateSingleNodeOptions(o,r);if(c.validateNode)try{let l=this.validationRegistry.getChecks(o.$type,r.categories);for(let f of l)await f(o,n,i)}finally{s.stopSubTask(o.$type)}c.validateChildren||a.prune()}}finally{s.stop()}}else{let s=At(e).iterator();for(let a of s){await Le(i);let o=this.validateSingleNodeOptions(a,r);if(o.validateNode){let c=this.validationRegistry.getChecks(a.$type,r.categories);for(let l of c)await l(a,n,i)}o.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return ay}async validateAstAfter(e,r,n,i=B.CancellationToken.None){let s=this.validationRegistry.checksAfter;for(let a of s)await Le(i),await a(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:oy(n),severity:yl(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function oy(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=da(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=ef(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function yl(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function cy(t){switch(t){case"error":return pi(Ht.LexingError);case"warning":return pi(Ht.LexingWarning);case"info":return pi(Ht.LexingInfo);case"hint":return pi(Ht.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Ht;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Ht||(Ht={}));var co=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){let i=n??ht(e);r??(r=this.nameProvider.getName(e));let s=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${s} has no name.`);let a,o=()=>a??(a=Vn(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return o()},selectionSegment:Vn(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}},lo=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=B.CancellationToken.None){let n=[],i=e.parseResult.value;for(let s of At(i))await Le(r),an(s).forEach(a=>{a.reference.error||n.push(...this.createInfoDescriptions(a))});return n}createInfoDescriptions(e){let r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Qe(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Ft(r)&&(n=r.items.map(c=>c.$nodeDescription).filter(c=>c!==void 0));let i=ht(e.container).uri,s=this.nodeLocator.getAstNodePath(e.container),a=[],o=Vn(r.$refNode);for(let c of n)a.push({sourceUri:i,sourcePath:s,targetUri:c.documentUri,targetPath:c.path,segment:o,local:ze.equals(c.documentUri,i)});return a}};var uo=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;let a=s.indexOf(this.indexSeparator);if(a>0){let o=s.substring(0,a),c=parseInt(s.substring(a+1));return i[o]?.[c]}return i[s]},e)}};var Se={};se(Se,fu(li(),1));var fo=class{constructor(e){this._ready=new Nt,this.onConfigurationSectionUpdateEmitter=new Se.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){let r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,s)=>{this.updateSectionConfiguration(i.section,n[s])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};var Ls=fu(_x(),1);var wn;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(wn||(wn={}));var vo=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new gt,this.documentPhaseListeners=new gt,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Q.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=B.CancellationToken.None){for(let i of e){let s=i.uri.toString();if(i.state===Q.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(i,Q.IndexedReferences);else if(typeof r.validation=="object"){let a=this.findMissingValidationCategories(i,r);a.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:a}},result:this.buildState.get(s)?.result}),i.state=Q.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=Q.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=B.CancellationToken.None){this.currentState=Q.Changed;let i=[];for(let c of r){let l=this.langiumDocuments.deleteDocuments(c);for(let f of l)i.push(f.uri),this.cleanUpDeleted(f)}let s=(await Promise.all(e.map(c=>this.findChangedUris(c)))).flat();for(let c of s){let l=this.langiumDocuments.getDocument(c);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},c),l.state=Q.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,Q.Changed)}let a=ee(s).concat(i).map(c=>c.toString()).toSet();this.langiumDocuments.all.filter(c=>!a.has(c.uri.toString())&&this.shouldRelink(c,a)).forEach(c=>this.resetToState(c,Q.ComputedScopes)),await this.emitUpdate(s,i),await Le(n);let o=this.sortDocuments(this.langiumDocuments.all.filter(c=>c.state<Q.Validated||!this.buildState.get(c.uri.toString())?.completed||this.resultsAreIncomplete(c,this.updateBuildOptions)).toArray());await this.buildDocuments(o,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=1}findMissingValidationCategories(e,r){let n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),s=n?.result?.validationChecks?new Set(n?.result?.validationChecks):n?.completed?i:new Set,a=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return ee(a).filter(o=>!s.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{let n=await this.fileSystemProvider.stat(e);if(n.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(n))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){return!!this.textDocuments?.get(e.uri)}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),wn.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Q.Changed:case Q.Parsed:this.indexManager.removeContent(e.uri);case Q.IndexedContent:e.localSymbols=void 0;case Q.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Q.Linked:this.indexManager.removeReferences(e.uri);case Q.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Q.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Q.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Q.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,Q.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,Q.ComputedScopes,n,async a=>{let o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,n)});let i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,Q.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(i,Q.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));let s=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(s,Q.Validated,n,async a=>{await this.validate(a,n),this.markAsCompleted(a)})}markAsCompleted(e){let r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(let n of e){let i=n.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:r,result:s?.result})}}async runCancelable(e,r,n,i){for(let a of e)a.state<r&&(await Le(n),await i(a),a.state=r,await this.notifyDocumentPhase(a,r,n));let s=e.filter(a=>a.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),wn.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),wn.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=B.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){let i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Kt);if(this.currentState>=e&&e>i.state)return Promise.reject(new Ls.ResponseError(Ls.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Q[i.state]}, requiring ${Q[e]}, but workspace state is already ${Q[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Ls.ResponseError(Ls.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((s,a)=>{let o=this.onDocumentPhase(e,l=>{ze.equals(l.uri,r)&&(o.dispose(),c.dispose(),s(l.uri))}),c=n.onCancellationRequested(()=>{o.dispose(),c.dispose(),a(Kt)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Kt):new Promise((n,i)=>{let s=this.onBuildPhase(e,()=>{s.dispose(),a.dispose(),n()}),a=r.onCancellationRequested(()=>{s.dispose(),a.dispose(),i(Kt)})})}async notifyDocumentPhase(e,r,n){let s=this.documentPhaseListeners.get(r).slice();for(let a of s)try{await Le(n),await a(e,n)}catch(o){if(!Sr(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;let s=this.buildPhaseListeners.get(r).slice();for(let a of s)await Le(n),await a(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){let n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),s=typeof i.validation=="object"?{...i.validation}:{};s.categories=this.findMissingValidationCategories(e,i);let a=await n.validateDocument(e,s,r);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;let o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=ee(o.result.validationChecks).concat(s.categories).distinct().toArray():o.result.validationChecks=[...s.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}};var Ao=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new di,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=ht(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{ze.equals(a.targetUri,n)&&a.targetPath===r&&i.push(a)})}),ee(i)}allElements(e,r){let n=ee(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(s=>this.astReflection.isSubtype(s.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){let r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){let r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=B.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,r=B.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}};var $o=class{constructor(e){this.initialBuildOptions={},this._ready=new Nt,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){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=B.CancellationToken.None){let n=await this.performStartup(e);await Le(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){let r=[],n=a=>{r.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};await this.loadAdditionalDocuments(e,n);let i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));let s=ee(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(s,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{let i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return et.parse(e.uri)}async traverseFolder(e,r){try{let n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){let r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){let r=ze.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}};var So=class{buildUnexpectedCharactersMessage(e,r,n,i,s){return Wi.buildUnexpectedCharactersMessage(e,r,n,i,s)}buildUnableToPopLexerModeMessage(e){return Wi.buildUnableToPopLexerModeMessage(e)}},Yl={mode:"full"},yi=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;let r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);let n=Ah(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Ne(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Yl){let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(Ah(e))return e;let r=$h(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function Xl(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function $h(t){return t&&"modes"in t&&"defaultMode"in t}function Ah(t){return!Xl(t)&&!$h(t)}cs();function Ch(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=oe.create(0,0));let s=Ox(t),a=wh(n),o=G$({lines:s,position:i,options:a});return B$({index:0,tokens:o,position:i})}function Nh(t,e){let r=wh(e),n=Ox(t);if(n.length===0)return!1;let i=n[0],s=n[n.length-1],a=r.start,o=r.end;return!!a?.exec(i)&&!!o?.exec(s)}function Ox(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Wu)}var bx=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,F$=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function G$(t){let e=[],r=t.position.line,n=t.position.character;for(let i=0;i<t.lines.length;i++){let s=i===0,a=i===t.lines.length-1,o=t.lines[i],c=0;if(s&&t.options.start){let f=t.options.start?.exec(o);f&&(c=f.index+f[0].length)}else{let f=t.options.line?.exec(o);f&&(c=f.index+f[0].length)}if(a){let f=t.options.end?.exec(o);f&&(o=o.substring(0,f.index))}if(o=o.substring(0,j$(o)),kh(o,c)>=o.length){if(e.length>0){let f=oe.create(r,n);e.push({type:"break",content:"",range:ne.create(f,f)})}}else{bx.lastIndex=c;let f=bx.exec(o);if(f){let p=f[0],h=f[1],g=oe.create(r,n+c),k=oe.create(r,n+c+p.length);e.push({type:"tag",content:h,range:ne.create(g,k)}),c+=p.length,c=kh(o,c)}if(c<o.length){let p=o.substring(c),h=Array.from(p.matchAll(F$));e.push(...U$(h,p,r,n+c))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function U$(t,e,r,n){let i=[];if(t.length===0){let s=oe.create(r,n),a=oe.create(r,n+e.length);i.push({type:"text",content:e,range:ne.create(s,a)})}else{let s=0;for(let o of t){let c=o.index,l=e.substring(s,c);l.length>0&&i.push({type:"text",content:e.substring(s,c),range:ne.create(oe.create(r,s+n),oe.create(r,c+n))});let f=l.length+1,p=o[1];if(i.push({type:"inline-tag",content:p,range:ne.create(oe.create(r,s+f+n),oe.create(r,s+f+p.length+n))}),f+=p.length,o.length===4){f+=o[2].length;let h=o[3];i.push({type:"text",content:h,range:ne.create(oe.create(r,s+f+n),oe.create(r,s+f+h.length+n))})}else i.push({type:"text",content:"",range:ne.create(oe.create(r,s+f+n),oe.create(r,s+f+n))});s=c+o[0].length}let a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:ne.create(oe.create(r,s+n),oe.create(r,s+n+a.length))})}return i}var q$=/\S/,z$=/\s*$/;function kh(t,e){let r=t.substring(e).match(q$);return r?e+r.index:t.length}function j$(t){let e=t.match(z$);if(e&&typeof e.index=="number")return e.index}function B$(t){let e=oe.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Jl([],ne.create(e,e));let r=[];for(;t.index<t.tokens.length;){let s=W$(t,r[r.length-1]);s&&r.push(s)}let n=r[0]?.range.start??e,i=r[r.length-1]?.range.end??e;return new Jl(r,ne.create(n,i))}function W$(t,e){let r=t.tokens[t.index];if(r.type==="tag")return Dx(t,!1);if(r.type==="text"||r.type==="inline-tag")return Lx(t);V$(r,e),t.index++}function V$(t,e){if(e){let r=new Ql("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function Lx(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(K$(t)),n=e,e=t.tokens[t.index];return new Co(i,ne.create(r.range.start,n.range.end))}function K$(t){return t.tokens[t.index].type==="inline-tag"?Dx(t,!0):Mx(t)}function Dx(t,e){let r=t.tokens[t.index++],n=r.content.substring(1);if(t.tokens[t.index]?.type==="text")if(e){let s=Mx(t);return new ko(n,new Co([s],s.range),e,ne.create(r.range.start,s.range.end))}else{let s=Lx(t);return new ko(n,s,e,ne.create(r.range.start,s.range.end))}else{let s=r.range;return new ko(n,new Co([],s),e,s)}}function Mx(t){let e=t.tokens[t.index++];return new Ql(e.content,e.range)}function wh(t){if(!t)return wh({start:"/**",end:"*/",line:"*"});let{start:e,end:r,line:n}=t;return{start:Sh(e,!0),end:Sh(r,!1),line:Sh(n,!0)}}function Sh(t,e){if(typeof t=="string"||typeof t=="object"){let r=typeof t=="string"?hn(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}var Jl=class{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(let r of this.elements)if(e.length===0)e=r.toString();else{let n=r.toString();e+=Px(e)+n}return e.trim()}toMarkdown(e){let r="";for(let n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{let i=n.toMarkdown(e);r+=Px(r)+i}return r.trim()}},ko=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
|
|
${r}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){let r=this.content.toMarkdown(e);if(this.inline){let s=H$(this.name,r,e??{});if(typeof s=="string")return s}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \u2014 ${r}`:this.content.inlines.length>1&&(i=`${i}
|
|
${r}`),this.inline?`{${i}}`:i}};function H$(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){let n=e.indexOf(" "),i=e;if(n>0){let a=kh(e,n);i=e.substring(a),e=e.substring(0,n)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(i=`\`${i}\``),r.renderLink?.(e,i)??Y$(e,i)}}function Y$(t,e){try{return et.parse(t,!0),`[${e}](${t})`}catch{return t}}var Co=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){let n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
|
|
`)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){let i=this.inlines[n],s=this.inlines[n+1];r+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(r+=`
|
|
`)}return r}},Ql=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function Px(t){return t.endsWith(`
|
|
`)?`
|
|
`:`
|
|
|
|
`}var No=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&Nh(r))return Ch(r).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){let i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){let s=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${s},${a}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){let i=ht(e).localSymbols;if(!i)return;let s=e;do{let o=i.getStream(s).find(c=>c.name===r);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}};var wo=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return np(e)?e.$comment:Uu(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var Io=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},Ih=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){let e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){let r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){let n=await this.acquireParserWorker(r),i=new Nt,s,a=r.onCancellationRequested(()=>{s=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{let c=this.hydrator.hydrate(o);i.resolve(c)}).catch(o=>{i.reject(o)}).finally(()=>{a.dispose(),clearTimeout(s)}),i.promise}terminateWorker(e){e.terminate();let r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(let n of this.workerPool)if(n.ready)return n.lock(),n;let r=new Nt;return e.onCancellationRequested(()=>{let n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Kt)}),this.queue.push(r),r.promise}},_h=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new Se.Emitter,this.deferred=new Nt,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(s=>{let a=s;this.deferred.resolve(a),this.unlock()}),n(s=>{this.deferred.reject(s),this.unlock()})}terminate(){this.deferred.reject(Kt),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Nt,this.sendMessage(e),this.deferred.promise}};var _o=class{constructor(){this.previousTokenSource=new B.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let r=pl();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=B.CancellationToken.None){let i=new Nt,s={action:r,deferred:i,cancellationToken:n};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{let s=await Promise.resolve().then(()=>r(i));n.resolve(s)}catch(s){Sr(s)?n.resolve(void 0):n.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var bo=class{constructor(e){this.grammarElementIdMap=new fi,this.tokenTypeIdMap=new fi,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(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){let r=new Map,n=new Map;for(let i of At(e))r.set(i,{});if(e.$cstNode)for(let i of Wn(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(let[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){let a=[];n[i]=a;for(let o of s)Oe(o)?a.push(this.dehydrateAstNode(o,r)):Qe(o)?a.push(this.dehydrateReference(o,r)):a.push(o)}else Oe(s)?n[i]=this.dehydrateAstNode(s,r):Qe(s)?n[i]=this.dehydrateReference(s,r):s!==void 0&&(n[i]=s);return n}dehydrateReference(e,r){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){let n=r.cstNodes.get(e);return Hs(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),tr(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):nn(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){let r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){let r=new Map,n=new Map;for(let s of At(e))r.set(s,{});let i;if(e.$cstNode)for(let s of Wn(e.$cstNode)){let a;"fullText"in s?(a=new ls(s.fullText),i=a):"content"in s?a=new ai:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(n.set(s,a),a.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(let[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){let a=[];n[i]=a;for(let o of s)Oe(o)?a.push(this.setParent(this.hydrateAstNode(o,r),n)):Qe(o)?a.push(this.hydrateReference(o,n,i,r)):a.push(o)}else Oe(s)?n[i]=this.setParent(this.hydrateAstNode(s,r),n):Qe(s)?n[i]=this.hydrateReference(s,n,i,r):s!==void 0&&(n[i]=s);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){let i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),tr(i))for(let s of e.content){let a=this.hydrateCstNode(s,r,n++);i.content.push(a)}return i}hydrateCstLeafNode(e){let r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,c=e.endColumn,l=e.hidden;return new si(n,i,{start:{line:s,character:a},end:{line:o,character:c}},r,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(let r of At(this.grammar))ia(r)&&this.grammarElementIdMap.set(r,e++)}};function bh(t){return{documentation:{CommentProvider:e=>new wo(e),DocumentationProvider:e=>new No(e)},parser:{AsyncParser:e=>new Io(e),GrammarConfig:e=>af(e),LangiumParser:e=>Kd(e),CompletionParser:e=>Vd(e),ValueConverter:()=>new ci,TokenBuilder:()=>new Xr,Lexer:e=>new yi(e),ParserErrorMessageProvider:()=>new us,LexerErrorMessageProvider:()=>new So},workspace:{AstNodeLocator:()=>new uo,AstNodeDescriptionProvider:e=>new co(e),ReferenceDescriptionProvider:e=>new lo(e)},references:{Linker:e=>new Ja(e),NameProvider:()=>new Qa,ScopeProvider:e=>new no(e),ScopeComputation:e=>new eo(e),References:e=>new Za(e)},serializer:{Hydrator:e=>new bo(e),JsonSerializer:e=>new io(e)},validation:{DocumentValidator:e=>new oo(e),ValidationRegistry:e=>new ao(e)},shared:()=>t.shared}}function Ph(t){return{ServiceRegistry:e=>new so(e),workspace:{LangiumDocuments:e=>new Xa(e),LangiumDocumentFactory:e=>new Ya(e),DocumentBuilder:e=>new vo(e),IndexManager:e=>new Ao(e),WorkspaceManager:e=>new $o(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new _o,ConfigurationProvider:e=>new fo(e)},profilers:{}}}var Oh;(function(t){t.merge=(e,r)=>Po(Po({},e),r)})(Oh||(Oh={}));function Zl(t,e,r,n,i,s,a,o,c){let l=[t,e,r,n,i,s,a,o,c].reduce(Po,{});return zx(l)}var Ux=Symbol("isProxy");function qx(t){if(t&&t[Ux])for(let e of Object.values(t))qx(e);return t}function zx(t,e){let r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===Ux?!0:Gx(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(Gx(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}var Fx=Symbol();function Gx(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===Fx)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=Fx;try{t[e]=typeof i=="function"?i(n):zx(i,n)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function Po(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){let i=t[r];typeof i=="object"&&i!==null?t[r]=Po(i,n):t[r]=Po({},n)}else t[r]=n}return t}var Lh={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Ti;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(Ti||(Ti={}));var eu=class extends Xr{constructor(e=Lh){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...Lh,...e},this.indentTokenType=gn({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=gn({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){let n=super.buildTokens(e,r);if(!Xl(n))throw new Error("Invalid tokens built by default builder");let{indentTokenName:i,dedentTokenName:s,whitespaceTokenName:a,ignoreIndentationDelimiters:o}=this.options,c,l,f,p=[];for(let h of n){for(let[g,k]of o)h.name===g?h.PUSH_MODE=Ti.IGNORE_INDENTATION:h.name===k&&(h.POP_MODE=!0);h.name===s?c=h:h.name===i?l=h:h.name===a?f=h:p.push(h)}if(!c||!l||!f)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[Ti.REGULAR]:[c,l,...p,f],[Ti.IGNORE_INDENTATION]:[...p,f]},defaultMode:Ti.REGULAR}:[c,l,f,...p]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r
|
|
`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;let s=this.whitespaceRegExp.exec(e);return{currIndentLevel:s?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:s}}createIndentationTokenInstance(e,r,n,i){let s=this.getLineNumber(r,i);return Vr(e,n,i,i+n.length,s,s,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:s,prevIndentLevel:a,match:o}=this.matchWhitespace(e,r,n,i);return s<=a?null:(this.indentationStack.push(s),o)}dedentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:s,prevIndentLevel:a,match:o}=this.matchWhitespace(e,r,n,i);if(s>=a)return null;let c=this.indentationStack.lastIndexOf(s);if(c===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${s} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:o?.[0]?.length??0,line:this.getLineNumber(e,r),column:1}),null;let l=this.indentationStack.length-c-1,f=e.substring(0,r).match(/[\r\n]+$/)?.[0].length??1;for(let p=0;p<l;p++){let h=this.createIndentationTokenInstance(this.dedentTokenType,e,"",r-(f-1));n.push(h),this.indentationStack.pop()}return null}buildTerminalToken(e){let r=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:s}=this.options;return r.name===n?this.indentTokenType:r.name===i?this.dedentTokenType:r.name===s?gn({name:s,pattern:this.whitespaceRegExp,group:Ne.SKIPPED}):r}flushRemainingDedents(e){let r=[];for(;this.indentationStack.length>1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},Dh=class extends yi{constructor(e){if(super(e),e.parser.TokenBuilder instanceof eu)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Yl){let n=super.tokenize(e),i=n.report;r?.mode==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];let{indentTokenType:s,dedentTokenType:a}=this.indentationTokenBuilder,o=s.tokenTypeIdx,c=a.tokenTypeIdx,l=[],f=n.tokens.length-1;for(let p=0;p<f;p++){let h=n.tokens[p],g=n.tokens[p+1];if(h.tokenTypeIdx===o&&g.tokenTypeIdx===c){p++;continue}l.push(h)}return f>=0&&l.push(n.tokens[f]),n.tokens=l,n}};var ce={};tn(ce,{AstUtils:()=>qo,BiMap:()=>fi,Cancellation:()=>B,ContextCache:()=>di,CstUtils:()=>oc,DONE_RESULT:()=>pt,Deferred:()=>Nt,Disposable:()=>wn,DisposableCache:()=>Ts,DocumentCache:()=>ml,EMPTY_STREAM:()=>sn,ErrorWithLocation:()=>Kn,GrammarUtils:()=>pc,MultiMap:()=>gt,OperationCancelled:()=>Kt,Reduction:()=>$i,RegExpUtils:()=>uc,SimpleCache:()=>ro,StreamImpl:()=>Gt,TreeStreamImpl:()=>gr,URI:()=>et,UriTrie:()=>gs,UriUtils:()=>ze,WorkspaceCache:()=>Rs,assertCondition:()=>fm,assertUnreachable:()=>Rr,delayNextTick:()=>ep,interruptAndCheck:()=>Le,isOperationCancelled:()=>Sr,loadGrammarFromJson:()=>Ir,setInterruptionPeriod:()=>Zg,startCancelableOperation:()=>pl,stream:()=>ee});se(ce,Se);var tu=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},Mh={fileSystemProvider:()=>new tu};var X$={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},J$={AstReflection:()=>new Oi};function Q$(){let t=Zl(Ph(Mh),J$),e=Zl(bh({shared:t}),X$);return t.ServiceRegistry.register(e),e}function Ir(t){let e=Q$(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,et.parse(`memory:/${r.name??"grammar"}.langium`)),r}se(Ge,ce);var Fh=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new gt}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new ru(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);let n=[];for(let a of r.entries.keys()){let o=r.entries.get(a),c=o.reduce((l,f)=>l+f);n.push({name:`${r.identifier}.${a}`,count:o.length,duration:c})}let i=r.duration-n.map(a=>a.duration).reduce((a,o)=>a+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((a,o)=>o.duration-a.duration);function s(a){return Math.round(100*a)/100}return console.table(n.map(a=>({Element:a.name,Count:a.count,"Self %":s(100*a.duration/r.duration),"Time (ms)":s(a.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},ru=class{constructor(e,r){this.stack=[],this.entries=new gt,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);let e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){let r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);let n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);let i=n-r.content;this.entries.add(e,i)}};var Z$=Object.defineProperty,re=(t,e)=>Z$(t,"name",{value:e,configurable:!0}),Wh;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[[\w ]+\]/}})(Wh||(Wh={}));var Vh;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(Vh||(Vh={}));var Kh;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Kh||(Kh={}));var Hh;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Hh||(Hh={}));var Yh;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Yh||(Yh={}));var Xh;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Xh||(Xh={}));var Jh;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(Jh||(Jh={}));var pL={...Wh.Terminals,...Vh.Terminals,...Kh.Terminals,...Hh.Terminals,...Yh.Terminals,...Xh.Terminals,...Jh.Terminals},Qr={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function eS(t){return ur.isInstance(t,Qr.$type)}re(eS,"isArchitecture");var nu={$type:"Axis",label:"label",name:"name"},ou={$type:"Branch",name:"name",order:"order"};function tS(t){return ur.isInstance(t,ou.$type)}re(tS,"isBranch");var jx={$type:"Checkout",branch:"branch"},iu={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},Gh={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Gs={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function rS(t){return ur.isInstance(t,Gs.$type)}re(rS,"isCommit");var su={$type:"Curve",entries:"entries",label:"label",name:"name"},Ds={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},_r={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Uh={$type:"Entry",axis:"axis",value:"value"},xi={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function nS(t){return ur.isInstance(t,xi.$type)}re(nS,"isGitGraph");var Oo={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Do={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function iS(t){return ur.isInstance(t,Do.$type)}re(iS,"isInfo");var Lo={$type:"Item",classSelector:"classSelector",name:"name"},qh={$type:"Junction",id:"id",in:"in"},au={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Us={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function sS(t){return ur.isInstance(t,Us.$type)}re(sS,"isMerge");var zh={$type:"Option",name:"name",value:"value"},qs={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function aS(t){return ur.isInstance(t,qs.$type)}re(aS,"isPacket");var zs={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function oS(t){return ur.isInstance(t,zs.$type)}re(oS,"isPacketBlock");var Ei={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function cS(t){return ur.isInstance(t,Ei.$type)}re(cS,"isPie");var cu={$type:"PieSection",label:"label",value:"value"};function lS(t){return ur.isInstance(t,cu.$type)}re(lS,"isPieSection");var Ri={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},jh={$type:"Section",classSelector:"classSelector",name:"name"},Ms={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},Fs={$type:"Statement"},js={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function uS(t){return ur.isInstance(t,js.$type)}re(uS,"isTreemap");var Bh={$type:"TreemapRow",indent:"indent",item:"item"},Jx=class extends bn{constructor(){super(...arguments),this.types={Architecture:{name:Qr.$type,properties:{accDescr:{name:Qr.accDescr},accTitle:{name:Qr.accTitle},edges:{name:Qr.edges,defaultValue:[]},groups:{name:Qr.groups,defaultValue:[]},junctions:{name:Qr.junctions,defaultValue:[]},services:{name:Qr.services,defaultValue:[]},title:{name:Qr.title}},superTypes:[]},Axis:{name:nu.$type,properties:{label:{name:nu.label},name:{name:nu.name}},superTypes:[]},Branch:{name:ou.$type,properties:{name:{name:ou.name},order:{name:ou.order}},superTypes:[Fs.$type]},Checkout:{name:jx.$type,properties:{branch:{name:jx.branch}},superTypes:[Fs.$type]},CherryPicking:{name:iu.$type,properties:{id:{name:iu.id},parent:{name:iu.parent},tags:{name:iu.tags,defaultValue:[]}},superTypes:[Fs.$type]},ClassDefStatement:{name:Gh.$type,properties:{className:{name:Gh.className},styleText:{name:Gh.styleText}},superTypes:[]},Commit:{name:Gs.$type,properties:{id:{name:Gs.id},message:{name:Gs.message},tags:{name:Gs.tags,defaultValue:[]},type:{name:Gs.type}},superTypes:[Fs.$type]},Curve:{name:su.$type,properties:{entries:{name:su.entries,defaultValue:[]},label:{name:su.label},name:{name:su.name}},superTypes:[]},Direction:{name:Ds.$type,properties:{accDescr:{name:Ds.accDescr},accTitle:{name:Ds.accTitle},dir:{name:Ds.dir},statements:{name:Ds.statements,defaultValue:[]},title:{name:Ds.title}},superTypes:[xi.$type]},Edge:{name:_r.$type,properties:{lhsDir:{name:_r.lhsDir},lhsGroup:{name:_r.lhsGroup,defaultValue:!1},lhsId:{name:_r.lhsId},lhsInto:{name:_r.lhsInto,defaultValue:!1},rhsDir:{name:_r.rhsDir},rhsGroup:{name:_r.rhsGroup,defaultValue:!1},rhsId:{name:_r.rhsId},rhsInto:{name:_r.rhsInto,defaultValue:!1},title:{name:_r.title}},superTypes:[]},Entry:{name:Uh.$type,properties:{axis:{name:Uh.axis,referenceType:nu.$type},value:{name:Uh.value}},superTypes:[]},GitGraph:{name:xi.$type,properties:{accDescr:{name:xi.accDescr},accTitle:{name:xi.accTitle},statements:{name:xi.statements,defaultValue:[]},title:{name:xi.title}},superTypes:[]},Group:{name:Oo.$type,properties:{icon:{name:Oo.icon},id:{name:Oo.id},in:{name:Oo.in},title:{name:Oo.title}},superTypes:[]},Info:{name:Do.$type,properties:{accDescr:{name:Do.accDescr},accTitle:{name:Do.accTitle},title:{name:Do.title}},superTypes:[]},Item:{name:Lo.$type,properties:{classSelector:{name:Lo.classSelector},name:{name:Lo.name}},superTypes:[]},Junction:{name:qh.$type,properties:{id:{name:qh.id},in:{name:qh.in}},superTypes:[]},Leaf:{name:au.$type,properties:{classSelector:{name:au.classSelector},name:{name:au.name},value:{name:au.value}},superTypes:[Lo.$type]},Merge:{name:Us.$type,properties:{branch:{name:Us.branch},id:{name:Us.id},tags:{name:Us.tags,defaultValue:[]},type:{name:Us.type}},superTypes:[Fs.$type]},Option:{name:zh.$type,properties:{name:{name:zh.name},value:{name:zh.value,defaultValue:!1}},superTypes:[]},Packet:{name:qs.$type,properties:{accDescr:{name:qs.accDescr},accTitle:{name:qs.accTitle},blocks:{name:qs.blocks,defaultValue:[]},title:{name:qs.title}},superTypes:[]},PacketBlock:{name:zs.$type,properties:{bits:{name:zs.bits},end:{name:zs.end},label:{name:zs.label},start:{name:zs.start}},superTypes:[]},Pie:{name:Ei.$type,properties:{accDescr:{name:Ei.accDescr},accTitle:{name:Ei.accTitle},sections:{name:Ei.sections,defaultValue:[]},showData:{name:Ei.showData,defaultValue:!1},title:{name:Ei.title}},superTypes:[]},PieSection:{name:cu.$type,properties:{label:{name:cu.label},value:{name:cu.value}},superTypes:[]},Radar:{name:Ri.$type,properties:{accDescr:{name:Ri.accDescr},accTitle:{name:Ri.accTitle},axes:{name:Ri.axes,defaultValue:[]},curves:{name:Ri.curves,defaultValue:[]},options:{name:Ri.options,defaultValue:[]},title:{name:Ri.title}},superTypes:[]},Section:{name:jh.$type,properties:{classSelector:{name:jh.classSelector},name:{name:jh.name}},superTypes:[Lo.$type]},Service:{name:Ms.$type,properties:{icon:{name:Ms.icon},iconText:{name:Ms.iconText},id:{name:Ms.id},in:{name:Ms.in},title:{name:Ms.title}},superTypes:[]},Statement:{name:Fs.$type,properties:{},superTypes:[]},Treemap:{name:js.$type,properties:{accDescr:{name:js.accDescr},accTitle:{name:js.accTitle},title:{name:js.title},TreemapRows:{name:js.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Bh.$type,properties:{indent:{name:Bh.indent},item:{name:Bh.item}},superTypes:[]}}}static{re(this,"MermaidAstReflection")}},ur=new Jx,Bx,fS=re(()=>Bx??(Bx=Ir(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$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":[]}}]},"entry":false,"parameters":[]},{"$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":[]}}]},"entry":false,"parameters":[]},{"$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":":"}]},"entry":false,"parameters":[]},{"$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@11"},"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@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),Wx,dS=re(()=>Wx??(Wx=Ir(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"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@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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"}]}},"entry":false,"fragment":false,"parameters":[]},{"$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@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),Vx,pS=re(()=>Vx??(Vx=Ir(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$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@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Kx,hS=re(()=>Kx??(Kx=Ir(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),Hx,mS=re(()=>Hx??(Hx=Ir(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),Yx,gS=re(()=>Yx??(Yx=Ir(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$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@11"},"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@17"},"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@17"},"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@17"},"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@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),Xx,yS=re(()=>Xx??(Xx=Ir(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),TS={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},RS={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xS={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ES={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vS={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},AS={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$S={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mL={AstReflection:re(()=>new Jx,"AstReflection")},gL={Grammar:re(()=>fS(),"Grammar"),LanguageMetaData:re(()=>TS,"LanguageMetaData"),parser:{}},yL={Grammar:re(()=>dS(),"Grammar"),LanguageMetaData:re(()=>RS,"LanguageMetaData"),parser:{}},TL={Grammar:re(()=>pS(),"Grammar"),LanguageMetaData:re(()=>xS,"LanguageMetaData"),parser:{}},RL={Grammar:re(()=>hS(),"Grammar"),LanguageMetaData:re(()=>ES,"LanguageMetaData"),parser:{}},xL={Grammar:re(()=>mS(),"Grammar"),LanguageMetaData:re(()=>vS,"LanguageMetaData"),parser:{}},EL={Grammar:re(()=>gS(),"Grammar"),LanguageMetaData:re(()=>AS,"LanguageMetaData"),parser:{}},vL={Grammar:re(()=>yS(),"Grammar"),LanguageMetaData:re(()=>$S,"LanguageMetaData"),parser:{}},SS=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,kS=/accTitle[\t ]*:([^\n\r]*)/,CS=/title([\t ][^\n\r]*|)/,NS={ACC_DESCR:SS,ACC_TITLE:kS,TITLE:CS},wS=class extends ci{static{re(this,"AbstractMermaidValueConverter")}runConverter(t,e,r){let n=this.runCommonConverter(t,e,r);return n===void 0&&(n=this.runCustomConverter(t,e,r)),n===void 0?super.runConverter(t,e,r):n}runCommonConverter(t,e,r){let n=NS[t.name];if(n===void 0)return;let i=n.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
|
|
`)}}},$L=class extends wS{static{re(this,"CommonValueConverter")}runCustomConverter(t,e,r){}},IS=class extends Xr{static{re(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,r){let n=super.buildKeywordTokens(t,e,r);return n.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}},kL=class extends IS{static{re(this,"CommonTokenBuilder")}};export{bh as a,Ph as b,Zl as c,Mh as d,Ge as e,re as f,mL as g,gL as h,yL as i,TL as j,RL as k,xL as l,EL as m,vL as n,wS as o,$L as p,IS as q};
|
|
//# sourceMappingURL=chunk-E24YF7OQ.min.js.map
|