var Zb=Object.create;var ta=Object.defineProperty;var Qb=Object.getOwnPropertyDescriptor;var e$=Object.getOwnPropertyNames;var t$=Object.getPrototypeOf,r$=Object.prototype.hasOwnProperty;var s=(t,e)=>ta(t,"name",{value:e,configurable:!0});var n$=(t,e)=>()=>(t&&(e=t(t=0)),e);var J=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Nn=(t,e)=>{for(var r in e)ta(t,r,{get:e[r],enumerable:!0})},Xl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of e$(e))!r$.call(t,i)&&i!==r&&ta(t,i,{get:()=>e[i],enumerable:!(n=Qb(e,i))||n.enumerable});return t},oe=(t,e,r)=>(Xl(t,e,"default"),r&&Xl(r,e,"default")),ep=(t,e,r)=>(r=t!=null?Zb(t$(t)):{},Xl(e||!t||!t.__esModule?ta(r,"default",{value:t,enumerable:!0}):r,t)),tp=t=>Xl(ta({},"__esModule",{value:!0}),t);var Kc={};Nn(Kc,{AnnotatedTextEdit:()=>En,ChangeAnnotation:()=>qi,ChangeAnnotationIdentifier:()=>Rt,CodeAction:()=>pm,CodeActionContext:()=>fm,CodeActionKind:()=>cm,CodeActionTriggerKind:()=>Qa,CodeDescription:()=>jd,CodeLens:()=>dm,Color:()=>Gc,ColorInformation:()=>Ld,ColorPresentation:()=>Dd,Command:()=>Bi,CompletionItem:()=>Zd,CompletionItemKind:()=>Kd,CompletionItemLabelDetails:()=>Jd,CompletionItemTag:()=>Hd,CompletionList:()=>Qd,CreateFile:()=>po,DeleteFile:()=>ho,Diagnostic:()=>Ya,DiagnosticRelatedInformation:()=>Uc,DiagnosticSeverity:()=>Gd,DiagnosticTag:()=>Ud,DocumentHighlight:()=>im,DocumentHighlightKind:()=>nm,DocumentLink:()=>hm,DocumentSymbol:()=>um,DocumentUri:()=>_d,EOL:()=>mD,FoldingRange:()=>Fd,FoldingRangeKind:()=>Md,FormattingOptions:()=>mm,Hover:()=>em,InlayHint:()=>Sm,InlayHintKind:()=>zc,InlayHintLabelPart:()=>Wc,InlineCompletionContext:()=>km,InlineCompletionItem:()=>$m,InlineCompletionList:()=>Cm,InlineCompletionTriggerKind:()=>Nm,InlineValueContext:()=>Am,InlineValueEvaluatableExpression:()=>Em,InlineValueText:()=>Rm,InlineValueVariableLookup:()=>vm,InsertReplaceEdit:()=>Yd,InsertTextFormat:()=>Vd,InsertTextMode:()=>Xd,Location:()=>Ha,LocationLink:()=>Od,MarkedString:()=>Za,MarkupContent:()=>go,MarkupKind:()=>Bc,OptionalVersionedTextDocumentIdentifier:()=>Ja,ParameterInformation:()=>tm,Position:()=>le,Range:()=>ie,RenameFile:()=>mo,SelectedCompletionInfo:()=>wm,SelectionRange:()=>gm,SemanticTokenModifiers:()=>xm,SemanticTokenTypes:()=>ym,SemanticTokens:()=>Tm,SignatureInformation:()=>rm,StringValue:()=>bm,SymbolInformation:()=>am,SymbolKind:()=>sm,SymbolTag:()=>om,TextDocument:()=>_m,TextDocumentEdit:()=>Xa,TextDocumentIdentifier:()=>Bd,TextDocumentItem:()=>Wd,TextEdit:()=>Vr,URI:()=>Fc,VersionedTextDocumentIdentifier:()=>zd,WorkspaceChange:()=>qd,WorkspaceEdit:()=>jc,WorkspaceFolder:()=>Im,WorkspaceSymbol:()=>lm,integer:()=>Pd,uinteger:()=>Va});var _d,Fc,Pd,Va,le,ie,Ha,Od,Gc,Ld,Dd,Md,Fd,Uc,Gd,Ud,jd,Ya,Bi,Vr,qi,Rt,En,Xa,po,mo,ho,jc,fo,qc,qd,Bd,zd,Ja,Wd,Bc,go,Kd,Vd,Hd,Yd,Xd,Jd,Zd,Qd,Za,em,tm,rm,nm,im,sm,om,am,lm,um,cm,Qa,fm,pm,dm,mm,hm,gm,ym,xm,Tm,Rm,vm,Em,Am,zc,Wc,Sm,bm,$m,Cm,Nm,wm,km,Im,mD,_m,Pm,y,yo=n$(()=>{"use strict";(function(t){function e(r){return typeof r=="string"}s(e,"is"),t.is=e})(_d||(_d={}));(function(t){function e(r){return typeof r=="string"}s(e,"is"),t.is=e})(Fc||(Fc={}));(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}s(e,"is"),t.is=e})(Pd||(Pd={}));(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}s(e,"is"),t.is=e})(Va||(Va={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Va.MAX_VALUE),i===Number.MAX_VALUE&&(i=Va.MAX_VALUE),{line:n,character:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&y.uinteger(i.line)&&y.uinteger(i.character)}s(r,"is"),t.is=r})(le||(le={}));(function(t){function e(n,i,o,a){if(y.uinteger(n)&&y.uinteger(i)&&y.uinteger(o)&&y.uinteger(a))return{start:le.create(n,i),end:le.create(o,a)};if(le.is(n)&&le.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${o}, ${a}]`)}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&le.is(i.start)&&le.is(i.end)}s(r,"is"),t.is=r})(ie||(ie={}));(function(t){function e(n,i){return{uri:n,range:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&ie.is(i.range)&&(y.string(i.uri)||y.undefined(i.uri))}s(r,"is"),t.is=r})(Ha||(Ha={}));(function(t){function e(n,i,o,a){return{targetUri:n,targetRange:i,targetSelectionRange:o,originSelectionRange:a}}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&ie.is(i.targetRange)&&y.string(i.targetUri)&&ie.is(i.targetSelectionRange)&&(ie.is(i.originSelectionRange)||y.undefined(i.originSelectionRange))}s(r,"is"),t.is=r})(Od||(Od={}));(function(t){function e(n,i,o,a){return{red:n,green:i,blue:o,alpha:a}}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&y.numberRange(i.red,0,1)&&y.numberRange(i.green,0,1)&&y.numberRange(i.blue,0,1)&&y.numberRange(i.alpha,0,1)}s(r,"is"),t.is=r})(Gc||(Gc={}));(function(t){function e(n,i){return{range:n,color:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&ie.is(i.range)&&Gc.is(i.color)}s(r,"is"),t.is=r})(Ld||(Ld={}));(function(t){function e(n,i,o){return{label:n,textEdit:i,additionalTextEdits:o}}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&y.string(i.label)&&(y.undefined(i.textEdit)||Vr.is(i))&&(y.undefined(i.additionalTextEdits)||y.typedArray(i.additionalTextEdits,Vr.is))}s(r,"is"),t.is=r})(Dd||(Dd={}));(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Md||(Md={}));(function(t){function e(n,i,o,a,l,u){let c={startLine:n,endLine:i};return y.defined(o)&&(c.startCharacter=o),y.defined(a)&&(c.endCharacter=a),y.defined(l)&&(c.kind=l),y.defined(u)&&(c.collapsedText=u),c}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&y.uinteger(i.startLine)&&y.uinteger(i.startLine)&&(y.undefined(i.startCharacter)||y.uinteger(i.startCharacter))&&(y.undefined(i.endCharacter)||y.uinteger(i.endCharacter))&&(y.undefined(i.kind)||y.string(i.kind))}s(r,"is"),t.is=r})(Fd||(Fd={}));(function(t){function e(n,i){return{location:n,message:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&Ha.is(i.location)&&y.string(i.message)}s(r,"is"),t.is=r})(Uc||(Uc={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Gd||(Gd={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(Ud||(Ud={}));(function(t){function e(r){let n=r;return y.objectLiteral(n)&&y.string(n.href)}s(e,"is"),t.is=e})(jd||(jd={}));(function(t){function e(n,i,o,a,l,u){let c={range:n,message:i};return y.defined(o)&&(c.severity=o),y.defined(a)&&(c.code=a),y.defined(l)&&(c.source=l),y.defined(u)&&(c.relatedInformation=u),c}s(e,"create"),t.create=e;function r(n){var i;let o=n;return y.defined(o)&&ie.is(o.range)&&y.string(o.message)&&(y.number(o.severity)||y.undefined(o.severity))&&(y.integer(o.code)||y.string(o.code)||y.undefined(o.code))&&(y.undefined(o.codeDescription)||y.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(y.string(o.source)||y.undefined(o.source))&&(y.undefined(o.relatedInformation)||y.typedArray(o.relatedInformation,Uc.is))}s(r,"is"),t.is=r})(Ya||(Ya={}));(function(t){function e(n,i,...o){let a={title:n,command:i};return y.defined(o)&&o.length>0&&(a.arguments=o),a}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&y.string(i.title)&&y.string(i.command)}s(r,"is"),t.is=r})(Bi||(Bi={}));(function(t){function e(o,a){return{range:o,newText:a}}s(e,"replace"),t.replace=e;function r(o,a){return{range:{start:o,end:o},newText:a}}s(r,"insert"),t.insert=r;function n(o){return{range:o,newText:""}}s(n,"del"),t.del=n;function i(o){let a=o;return y.objectLiteral(a)&&y.string(a.newText)&&ie.is(a.range)}s(i,"is"),t.is=i})(Vr||(Vr={}));(function(t){function e(n,i,o){let a={label:n};return i!==void 0&&(a.needsConfirmation=i),o!==void 0&&(a.description=o),a}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&y.string(i.label)&&(y.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(y.string(i.description)||i.description===void 0)}s(r,"is"),t.is=r})(qi||(qi={}));(function(t){function e(r){let n=r;return y.string(n)}s(e,"is"),t.is=e})(Rt||(Rt={}));(function(t){function e(o,a,l){return{range:o,newText:a,annotationId:l}}s(e,"replace"),t.replace=e;function r(o,a,l){return{range:{start:o,end:o},newText:a,annotationId:l}}s(r,"insert"),t.insert=r;function n(o,a){return{range:o,newText:"",annotationId:a}}s(n,"del"),t.del=n;function i(o){let a=o;return Vr.is(a)&&(qi.is(a.annotationId)||Rt.is(a.annotationId))}s(i,"is"),t.is=i})(En||(En={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&Ja.is(i.textDocument)&&Array.isArray(i.edits)}s(r,"is"),t.is=r})(Xa||(Xa={}));(function(t){function e(n,i,o){let a={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),o!==void 0&&(a.annotationId=o),a}s(e,"create"),t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&y.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||y.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||y.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Rt.is(i.annotationId))}s(r,"is"),t.is=r})(po||(po={}));(function(t){function e(n,i,o,a){let l={kind:"rename",oldUri:n,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(l.options=o),a!==void 0&&(l.annotationId=a),l}s(e,"create"),t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&y.string(i.oldUri)&&y.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||y.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||y.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Rt.is(i.annotationId))}s(r,"is"),t.is=r})(mo||(mo={}));(function(t){function e(n,i,o){let a={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),o!==void 0&&(a.annotationId=o),a}s(e,"create"),t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&y.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||y.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||y.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Rt.is(i.annotationId))}s(r,"is"),t.is=r})(ho||(ho={}));(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=>y.string(i.kind)?po.is(i)||mo.is(i)||ho.is(i):Xa.is(i)))}s(e,"is"),t.is=e})(jc||(jc={}));fo=class{static{s(this,"TextEditChangeImpl")}constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,o;if(n===void 0?i=Vr.insert(e,r):Rt.is(n)?(o=n,i=En.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=En.insert(e,r,o)),this.edits.push(i),o!==void 0)return o}replace(e,r,n){let i,o;if(n===void 0?i=Vr.replace(e,r):Rt.is(n)?(o=n,i=En.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=En.replace(e,r,o)),this.edits.push(i),o!==void 0)return o}delete(e,r){let n,i;if(r===void 0?n=Vr.del(e):Rt.is(r)?(i=r,n=En.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=En.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.")}},qc=class{static{s(this,"ChangeAnnotations")}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(Rt.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()}},qd=class{static{s(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new qc(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Xa.is(r)){let n=new fo(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{let n=new fo(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(Ja.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r={uri:e.uri,version:e.version},n=this._textEditChanges[r.uri];if(!n){let i=[],o={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(o),n=new fo(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 fo(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new qc,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;qi.is(r)||Rt.is(r)?i=r:n=r;let o,a;if(i===void 0?o=po.create(e,n):(a=Rt.is(i)?i:this._changeAnnotations.manage(i),o=po.create(e,n,a)),this._workspaceEdit.documentChanges.push(o),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 o;qi.is(n)||Rt.is(n)?o=n:i=n;let a,l;if(o===void 0?a=mo.create(e,r,i):(l=Rt.is(o)?o:this._changeAnnotations.manage(o),a=mo.create(e,r,i,l)),this._workspaceEdit.documentChanges.push(a),l!==void 0)return l}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;qi.is(r)||Rt.is(r)?i=r:n=r;let o,a;if(i===void 0?o=ho.create(e,n):(a=Rt.is(i)?i:this._changeAnnotations.manage(i),o=ho.create(e,n,a)),this._workspaceEdit.documentChanges.push(o),a!==void 0)return a}};(function(t){function e(n){return{uri:n}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&y.string(i.uri)}s(r,"is"),t.is=r})(Bd||(Bd={}));(function(t){function e(n,i){return{uri:n,version:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&y.string(i.uri)&&y.integer(i.version)}s(r,"is"),t.is=r})(zd||(zd={}));(function(t){function e(n,i){return{uri:n,version:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&y.string(i.uri)&&(i.version===null||y.integer(i.version))}s(r,"is"),t.is=r})(Ja||(Ja={}));(function(t){function e(n,i,o,a){return{uri:n,languageId:i,version:o,text:a}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&y.string(i.uri)&&y.string(i.languageId)&&y.integer(i.version)&&y.string(i.text)}s(r,"is"),t.is=r})(Wd||(Wd={}));(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}s(e,"is"),t.is=e})(Bc||(Bc={}));(function(t){function e(r){let n=r;return y.objectLiteral(r)&&Bc.is(n.kind)&&y.string(n.value)}s(e,"is"),t.is=e})(go||(go={}));(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})(Kd||(Kd={}));(function(t){t.PlainText=1,t.Snippet=2})(Vd||(Vd={}));(function(t){t.Deprecated=1})(Hd||(Hd={}));(function(t){function e(n,i,o){return{newText:n,insert:i,replace:o}}s(e,"create"),t.create=e;function r(n){let i=n;return i&&y.string(i.newText)&&ie.is(i.insert)&&ie.is(i.replace)}s(r,"is"),t.is=r})(Yd||(Yd={}));(function(t){t.asIs=1,t.adjustIndentation=2})(Xd||(Xd={}));(function(t){function e(r){let n=r;return n&&(y.string(n.detail)||n.detail===void 0)&&(y.string(n.description)||n.description===void 0)}s(e,"is"),t.is=e})(Jd||(Jd={}));(function(t){function e(r){return{label:r}}s(e,"create"),t.create=e})(Zd||(Zd={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}s(e,"create"),t.create=e})(Qd||(Qd={}));(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s(e,"fromPlainText"),t.fromPlainText=e;function r(n){let i=n;return y.string(i)||y.objectLiteral(i)&&y.string(i.language)&&y.string(i.value)}s(r,"is"),t.is=r})(Za||(Za={}));(function(t){function e(r){let n=r;return!!n&&y.objectLiteral(n)&&(go.is(n.contents)||Za.is(n.contents)||y.typedArray(n.contents,Za.is))&&(r.range===void 0||ie.is(r.range))}s(e,"is"),t.is=e})(em||(em={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}s(e,"create"),t.create=e})(tm||(tm={}));(function(t){function e(r,n,...i){let o={label:r};return y.defined(n)&&(o.documentation=n),y.defined(i)?o.parameters=i:o.parameters=[],o}s(e,"create"),t.create=e})(rm||(rm={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(nm||(nm={}));(function(t){function e(r,n){let i={range:r};return y.number(n)&&(i.kind=n),i}s(e,"create"),t.create=e})(im||(im={}));(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})(sm||(sm={}));(function(t){t.Deprecated=1})(om||(om={}));(function(t){function e(r,n,i,o,a){let l={name:r,kind:n,location:{uri:o,range:i}};return a&&(l.containerName=a),l}s(e,"create"),t.create=e})(am||(am={}));(function(t){function e(r,n,i,o){return o!==void 0?{name:r,kind:n,location:{uri:i,range:o}}:{name:r,kind:n,location:{uri:i}}}s(e,"create"),t.create=e})(lm||(lm={}));(function(t){function e(n,i,o,a,l,u){let c={name:n,detail:i,kind:o,range:a,selectionRange:l};return u!==void 0&&(c.children=u),c}s(e,"create"),t.create=e;function r(n){let i=n;return i&&y.string(i.name)&&y.number(i.kind)&&ie.is(i.range)&&ie.is(i.selectionRange)&&(i.detail===void 0||y.string(i.detail))&&(i.deprecated===void 0||y.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}s(r,"is"),t.is=r})(um||(um={}));(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"})(cm||(cm={}));(function(t){t.Invoked=1,t.Automatic=2})(Qa||(Qa={}));(function(t){function e(n,i,o){let a={diagnostics:n};return i!=null&&(a.only=i),o!=null&&(a.triggerKind=o),a}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&y.typedArray(i.diagnostics,Ya.is)&&(i.only===void 0||y.typedArray(i.only,y.string))&&(i.triggerKind===void 0||i.triggerKind===Qa.Invoked||i.triggerKind===Qa.Automatic)}s(r,"is"),t.is=r})(fm||(fm={}));(function(t){function e(n,i,o){let a={title:n},l=!0;return typeof i=="string"?(l=!1,a.kind=i):Bi.is(i)?a.command=i:a.edit=i,l&&o!==void 0&&(a.kind=o),a}s(e,"create"),t.create=e;function r(n){let i=n;return i&&y.string(i.title)&&(i.diagnostics===void 0||y.typedArray(i.diagnostics,Ya.is))&&(i.kind===void 0||y.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Bi.is(i.command))&&(i.isPreferred===void 0||y.boolean(i.isPreferred))&&(i.edit===void 0||jc.is(i.edit))}s(r,"is"),t.is=r})(pm||(pm={}));(function(t){function e(n,i){let o={range:n};return y.defined(i)&&(o.data=i),o}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&ie.is(i.range)&&(y.undefined(i.command)||Bi.is(i.command))}s(r,"is"),t.is=r})(dm||(dm={}));(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&y.uinteger(i.tabSize)&&y.boolean(i.insertSpaces)}s(r,"is"),t.is=r})(mm||(mm={}));(function(t){function e(n,i,o){return{range:n,target:i,data:o}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&ie.is(i.range)&&(y.undefined(i.target)||y.string(i.target))}s(r,"is"),t.is=r})(hm||(hm={}));(function(t){function e(n,i){return{range:n,parent:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&ie.is(i.range)&&(i.parent===void 0||t.is(i.parent))}s(r,"is"),t.is=r})(gm||(gm={}));(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"})(ym||(ym={}));(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"})(xm||(xm={}));(function(t){function e(r){let n=r;return y.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}s(e,"is"),t.is=e})(Tm||(Tm={}));(function(t){function e(n,i){return{range:n,text:i}}s(e,"create"),t.create=e;function r(n){let i=n;return i!=null&&ie.is(i.range)&&y.string(i.text)}s(r,"is"),t.is=r})(Rm||(Rm={}));(function(t){function e(n,i,o){return{range:n,variableName:i,caseSensitiveLookup:o}}s(e,"create"),t.create=e;function r(n){let i=n;return i!=null&&ie.is(i.range)&&y.boolean(i.caseSensitiveLookup)&&(y.string(i.variableName)||i.variableName===void 0)}s(r,"is"),t.is=r})(vm||(vm={}));(function(t){function e(n,i){return{range:n,expression:i}}s(e,"create"),t.create=e;function r(n){let i=n;return i!=null&&ie.is(i.range)&&(y.string(i.expression)||i.expression===void 0)}s(r,"is"),t.is=r})(Em||(Em={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}s(e,"create"),t.create=e;function r(n){let i=n;return y.defined(i)&&ie.is(n.stoppedLocation)}s(r,"is"),t.is=r})(Am||(Am={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}s(e,"is"),t.is=e})(zc||(zc={}));(function(t){function e(n){return{value:n}}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&(i.tooltip===void 0||y.string(i.tooltip)||go.is(i.tooltip))&&(i.location===void 0||Ha.is(i.location))&&(i.command===void 0||Bi.is(i.command))}s(r,"is"),t.is=r})(Wc||(Wc={}));(function(t){function e(n,i,o){let a={position:n,label:i};return o!==void 0&&(a.kind=o),a}s(e,"create"),t.create=e;function r(n){let i=n;return y.objectLiteral(i)&&le.is(i.position)&&(y.string(i.label)||y.typedArray(i.label,Wc.is))&&(i.kind===void 0||zc.is(i.kind))&&i.textEdits===void 0||y.typedArray(i.textEdits,Vr.is)&&(i.tooltip===void 0||y.string(i.tooltip)||go.is(i.tooltip))&&(i.paddingLeft===void 0||y.boolean(i.paddingLeft))&&(i.paddingRight===void 0||y.boolean(i.paddingRight))}s(r,"is"),t.is=r})(Sm||(Sm={}));(function(t){function e(r){return{kind:"snippet",value:r}}s(e,"createSnippet"),t.createSnippet=e})(bm||(bm={}));(function(t){function e(r,n,i,o){return{insertText:r,filterText:n,range:i,command:o}}s(e,"create"),t.create=e})($m||($m={}));(function(t){function e(r){return{items:r}}s(e,"create"),t.create=e})(Cm||(Cm={}));(function(t){t.Invoked=0,t.Automatic=1})(Nm||(Nm={}));(function(t){function e(r,n){return{range:r,text:n}}s(e,"create"),t.create=e})(wm||(wm={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}s(e,"create"),t.create=e})(km||(km={}));(function(t){function e(r){let n=r;return y.objectLiteral(n)&&Fc.is(n.uri)&&y.string(n.name)}s(e,"is"),t.is=e})(Im||(Im={}));mD=[` `,`\r `,"\r"];(function(t){function e(o,a,l,u){return new Pm(o,a,l,u)}s(e,"create"),t.create=e;function r(o){let a=o;return!!(y.defined(a)&&y.string(a.uri)&&(y.undefined(a.languageId)||y.string(a.languageId))&&y.uinteger(a.lineCount)&&y.func(a.getText)&&y.func(a.positionAt)&&y.func(a.offsetAt))}s(r,"is"),t.is=r;function n(o,a){let l=o.getText(),u=i(a,(f,d)=>{let h=f.range.start.line-d.range.start.line;return h===0?f.range.start.character-d.range.start.character:h}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],h=o.offsetAt(d.range.start),g=o.offsetAt(d.range.end);if(g<=c)l=l.substring(0,h)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=h}return l}s(n,"applyEdits"),t.applyEdits=n;function i(o,a){if(o.length<=1)return o;let l=o.length/2|0,u=o.slice(0,l),c=o.slice(l);i(u,a),i(c,a);let f=0,d=0,h=0;for(;f0&&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 le.create(0,e);for(;ne?i=a:n=a+1}let o=n-1;return le.create(o,e-r[o])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1"u"}s(n,"undefined"),t.undefined=n;function i(g){return g===!0||g===!1}s(i,"boolean"),t.boolean=i;function o(g){return e.call(g)==="[object String]"}s(o,"string"),t.string=o;function a(g){return e.call(g)==="[object Number]"}s(a,"number"),t.number=a;function l(g,b,$){return e.call(g)==="[object Number]"&&b<=g&&g<=$}s(l,"numberRange"),t.numberRange=l;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}s(u,"integer"),t.integer=u;function c(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}s(c,"uinteger"),t.uinteger=c;function f(g){return e.call(g)==="[object Function]"}s(f,"func"),t.func=f;function d(g){return g!==null&&typeof g=="object"}s(d,"objectLiteral"),t.objectLiteral=d;function h(g,b){return Array.isArray(g)&&g.every(b)}s(h,"typedArray"),t.typedArray=h})(y||(y={}))});var si=J(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var jm;function qm(){if(jm===void 0)throw new Error("No runtime abstraction layer installed");return jm}s(qm,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");jm=r}s(e,"install"),t.install=e})(qm||(qm={}));Bm.default=qm});var Ro=J($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.stringArray=$t.array=$t.func=$t.error=$t.number=$t.string=$t.boolean=void 0;function $D(t){return t===!0||t===!1}s($D,"boolean");$t.boolean=$D;function Cv(t){return typeof t=="string"||t instanceof String}s(Cv,"string");$t.string=Cv;function CD(t){return typeof t=="number"||t instanceof Number}s(CD,"number");$t.number=CD;function ND(t){return t instanceof Error}s(ND,"error");$t.error=ND;function wD(t){return typeof t=="function"}s(wD,"func");$t.func=wD;function Nv(t){return Array.isArray(t)}s(Nv,"array");$t.array=Nv;function kD(t){return Nv(t)&&t.every(e=>Cv(e))}s(kD,"stringArray");$t.stringArray=kD});var Hi=J(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.Emitter=vo.Event=void 0;var ID=si(),wv;(function(t){let e={dispose(){}};t.None=function(){return e}})(wv||(vo.Event=wv={}));var zm=class{static{s(this,"CallbackList")}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:s(()=>this.remove(e,r),"dispose")})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i{this._callbacks||(this._callbacks=new zm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:s(()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};vo.Emitter=Jc;Jc._noop=function(){}});var ol=J(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.CancellationTokenSource=Eo.CancellationToken=void 0;var _D=si(),PD=Ro(),Wm=Hi(),Zc;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Wm.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Wm.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||PD.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}s(e,"is"),t.is=e})(Zc||(Eo.CancellationToken=Zc={}));var OD=Object.freeze(function(t,e){let r=(0,_D.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Qc=class{static{s(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?OD:(this._emitter||(this._emitter=new Wm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Km=class{static{s(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new Qc),this._token}cancel(){this._token?this._token.cancel():this._token=Zc.Cancelled}dispose(){this._token?this._token instanceof Qc&&this._token.dispose():this._token=Zc.None}};Eo.CancellationTokenSource=Km});var vh=J(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 Qi=Ro(),Jm;(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})(Jm||(z.ErrorCodes=Jm={}));var Zm=class t extends Error{static{s(this,"ResponseError")}constructor(e,r,n){super(r),this.code=Qi.number(e)?e:Jm.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=Zm;var Ht=class t{static{s(this,"ParameterStructures")}constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};z.ParameterStructures=Ht;Ht.auto=new Ht("auto");Ht.byPosition=new Ht("byPosition");Ht.byName=new Ht("byName");var ke=class{static{s(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Ht.auto}};z.AbstractMessageSignature=ke;var Qm=class extends ke{static{s(this,"RequestType0")}constructor(e){super(e,0)}};z.RequestType0=Qm;var eh=class extends ke{static{s(this,"RequestType")}constructor(e,r=Ht.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};z.RequestType=eh;var th=class extends ke{static{s(this,"RequestType1")}constructor(e,r=Ht.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};z.RequestType1=th;var rh=class extends ke{static{s(this,"RequestType2")}constructor(e){super(e,2)}};z.RequestType2=rh;var nh=class extends ke{static{s(this,"RequestType3")}constructor(e){super(e,3)}};z.RequestType3=nh;var ih=class extends ke{static{s(this,"RequestType4")}constructor(e){super(e,4)}};z.RequestType4=ih;var sh=class extends ke{static{s(this,"RequestType5")}constructor(e){super(e,5)}};z.RequestType5=sh;var oh=class extends ke{static{s(this,"RequestType6")}constructor(e){super(e,6)}};z.RequestType6=oh;var ah=class extends ke{static{s(this,"RequestType7")}constructor(e){super(e,7)}};z.RequestType7=ah;var lh=class extends ke{static{s(this,"RequestType8")}constructor(e){super(e,8)}};z.RequestType8=lh;var uh=class extends ke{static{s(this,"RequestType9")}constructor(e){super(e,9)}};z.RequestType9=uh;var ch=class extends ke{static{s(this,"NotificationType")}constructor(e,r=Ht.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};z.NotificationType=ch;var fh=class extends ke{static{s(this,"NotificationType0")}constructor(e){super(e,0)}};z.NotificationType0=fh;var ph=class extends ke{static{s(this,"NotificationType1")}constructor(e,r=Ht.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};z.NotificationType1=ph;var dh=class extends ke{static{s(this,"NotificationType2")}constructor(e){super(e,2)}};z.NotificationType2=dh;var mh=class extends ke{static{s(this,"NotificationType3")}constructor(e){super(e,3)}};z.NotificationType3=mh;var hh=class extends ke{static{s(this,"NotificationType4")}constructor(e){super(e,4)}};z.NotificationType4=hh;var gh=class extends ke{static{s(this,"NotificationType5")}constructor(e){super(e,5)}};z.NotificationType5=gh;var yh=class extends ke{static{s(this,"NotificationType6")}constructor(e){super(e,6)}};z.NotificationType6=yh;var xh=class extends ke{static{s(this,"NotificationType7")}constructor(e){super(e,7)}};z.NotificationType7=xh;var Th=class extends ke{static{s(this,"NotificationType8")}constructor(e){super(e,8)}};z.NotificationType8=Th;var Rh=class extends ke{static{s(this,"NotificationType9")}constructor(e){super(e,9)}};z.NotificationType9=Rh;var jv;(function(t){function e(i){let o=i;return o&&Qi.string(o.method)&&(Qi.string(o.id)||Qi.number(o.id))}s(e,"isRequest"),t.isRequest=e;function r(i){let o=i;return o&&Qi.string(o.method)&&i.id===void 0}s(r,"isNotification"),t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Qi.string(o.id)||Qi.number(o.id)||o.id===null)}s(n,"isResponse"),t.isResponse=n})(jv||(z.Message=jv={}))});var Ah=J(oi=>{"use strict";var qv;Object.defineProperty(oi,"__esModule",{value:!0});oi.LRUCache=oi.LinkedMap=oi.Touch=void 0;var Nt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Nt||(oi.Touch=Nt={}));var af=class{static{s(this,"LinkedMap")}constructor(){this[qv]="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=Nt.None){let n=this._map.get(e);if(n)return r!==Nt.None&&this.touch(n,r),n.value}set(e,r,n=Nt.None){let i=this._map.get(e);if(i)i.value=r,n!==Nt.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Nt.None:this.addItemLast(i);break;case Nt.First:this.addItemFirst(i);break;case Nt.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:s(()=>{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}},"next")};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:s(()=>{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}},"next")};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:s(()=>{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}},"next")};return n}[(qv=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!==Nt.First&&r!==Nt.Last)){if(r===Nt.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===Nt.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)}};oi.LinkedMap=af;var Eh=class extends af{static{s(this,"LRUCache")}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=Nt.AsNew){return super.get(e,r)}peek(e){return super.get(e,Nt.None)}set(e,r){return super.set(e,r,Nt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};oi.LRUCache=Eh});var zv=J(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.Disposable=void 0;var Bv;(function(t){function e(r){return{dispose:r}}s(e,"create"),t.create=e})(Bv||(lf.Disposable=Bv={}))});var Wv=J(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.SharedArrayReceiverStrategy=wo.SharedArraySenderStrategy=void 0;var MD=ol(),Sl;(function(t){t.Continue=0,t.Cancelled=1})(Sl||(Sl={}));var Sh=class{static{s(this,"SharedArraySenderStrategy")}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]=Sl.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,Sl.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};wo.SharedArraySenderStrategy=Sh;var bh=class{static{s(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Sl.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},$h=class{static{s(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new bh(e)}cancel(){}dispose(){}},Ch=class{static{s(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new MD.CancellationTokenSource:new $h(r)}};wo.SharedArrayReceiverStrategy=Ch});var wh=J(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.Semaphore=void 0;var FD=si(),Nh=class{static{s(this,"Semaphore")}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,FD.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};uf.Semaphore=Nh});var Vv=J(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.ReadableStreamMessageReader=ai.AbstractMessageReader=ai.MessageReader=void 0;var Ih=si(),ko=Ro(),kh=Hi(),GD=wh(),Kv;(function(t){function e(r){let n=r;return n&&ko.func(n.listen)&&ko.func(n.dispose)&&ko.func(n.onError)&&ko.func(n.onClose)&&ko.func(n.onPartialMessage)}s(e,"is"),t.is=e})(Kv||(ai.MessageReader=Kv={}));var cf=class{static{s(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new kh.Emitter,this.closeEmitter=new kh.Emitter,this.partialMessageEmitter=new kh.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: ${ko.string(e.message)?e.message:"unknown"}`)}};ai.AbstractMessageReader=cf;var _h;(function(t){function e(r){let n,i,o,a=new Map,l,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,a.set(o.name,o)),r.contentDecoders!==void 0)for(let c of r.contentDecoders)a.set(c.name,c);if(r.contentTypeDecoder!==void 0&&(l=r.contentTypeDecoder,u.set(l.name,l)),r.contentTypeDecoders!==void 0)for(let c of r.contentTypeDecoders)u.set(c.name,c)}return l===void 0&&(l=(0,Ih.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:o,contentDecoders:a,contentTypeDecoder:l,contentTypeDecoders:u}}s(e,"fromOptions"),t.fromOptions=e})(_h||(_h={}));var Ph=class extends cf{static{s(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=_h.fromOptions(r),this.buffer=(0,Ih.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new GD.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 o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Ih.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))}};ai.ReadableStreamMessageReader=Ph});var Zv=J(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.WriteableStreamMessageWriter=li.AbstractMessageWriter=li.MessageWriter=void 0;var Hv=si(),bl=Ro(),UD=wh(),Yv=Hi(),jD="Content-Length: ",Xv=`\r `,Jv;(function(t){function e(r){let n=r;return n&&bl.func(n.dispose)&&bl.func(n.onClose)&&bl.func(n.onError)&&bl.func(n.write)}s(e,"is"),t.is=e})(Jv||(li.MessageWriter=Jv={}));var ff=class{static{s(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new Yv.Emitter,this.closeEmitter=new Yv.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: ${bl.string(e.message)?e.message:"unknown"}`)}};li.AbstractMessageWriter=ff;var Oh;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,Hv.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,Hv.default)().applicationJson.encoder}}s(e,"fromOptions"),t.fromOptions=e})(Oh||(Oh={}));var Lh=class extends ff{static{s(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=Oh.fromOptions(r),this.errorCount=0,this.writeSemaphore=new UD.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(jD,n.byteLength.toString(),Xv),i.push(Xv),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()}};li.WriteableStreamMessageWriter=Lh});var Qv=J(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.AbstractMessageBuffer=void 0;var qD=13,BD=10,zD=`\r `,Dh=class{static{s(this,"AbstractMessageBuffer")}constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,o=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],a=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,a}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let a=o.slice(0,e);r.set(a,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};pf.AbstractMessageBuffer=Dh});var iE=J(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.createMessageConnection=Z.ConnectionOptions=Z.MessageStrategy=Z.CancellationStrategy=Z.CancellationSenderStrategy=Z.CancellationReceiverStrategy=Z.RequestCancellationReceiverStrategy=Z.IdCancellationReceiverStrategy=Z.ConnectionStrategy=Z.ConnectionError=Z.ConnectionErrors=Z.LogTraceNotification=Z.SetTraceNotification=Z.TraceFormat=Z.TraceValues=Z.Trace=Z.NullLogger=Z.ProgressType=Z.ProgressToken=void 0;var eE=si(),Be=Ro(),Y=vh(),tE=Ah(),$l=Hi(),Mh=ol(),wl;(function(t){t.type=new Y.NotificationType("$/cancelRequest")})(wl||(wl={}));var Fh;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}s(e,"is"),t.is=e})(Fh||(Z.ProgressToken=Fh={}));var Cl;(function(t){t.type=new Y.NotificationType("$/progress")})(Cl||(Cl={}));var Gh=class{static{s(this,"ProgressType")}constructor(){}};Z.ProgressType=Gh;var Uh;(function(t){function e(r){return Be.func(r)}s(e,"is"),t.is=e})(Uh||(Uh={}));Z.NullLogger=Object.freeze({error:s(()=>{},"error"),warn:s(()=>{},"warn"),info:s(()=>{},"info"),log:s(()=>{},"log")});var fe;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(fe||(Z.Trace=fe={}));var rE;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(rE||(Z.TraceValues=rE={}));(function(t){function e(n){if(!Be.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}}s(e,"fromString"),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"}}s(r,"toString"),t.toString=r})(fe||(Z.Trace=fe={}));var nr;(function(t){t.Text="text",t.JSON="json"})(nr||(Z.TraceFormat=nr={}));(function(t){function e(r){return Be.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}s(e,"fromString"),t.fromString=e})(nr||(Z.TraceFormat=nr={}));var jh;(function(t){t.type=new Y.NotificationType("$/setTrace")})(jh||(Z.SetTraceNotification=jh={}));var df;(function(t){t.type=new Y.NotificationType("$/logTrace")})(df||(Z.LogTraceNotification=df={}));var Nl;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Nl||(Z.ConnectionErrors=Nl={}));var Io=class t extends Error{static{s(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Z.ConnectionError=Io;var qh;(function(t){function e(r){let n=r;return n&&Be.func(n.cancelUndispatched)}s(e,"is"),t.is=e})(qh||(Z.ConnectionStrategy=qh={}));var mf;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Be.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Be.func(n.dispose))}s(e,"is"),t.is=e})(mf||(Z.IdCancellationReceiverStrategy=mf={}));var Bh;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Be.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Be.func(n.dispose))}s(e,"is"),t.is=e})(Bh||(Z.RequestCancellationReceiverStrategy=Bh={}));var hf;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Mh.CancellationTokenSource}});function e(r){return mf.is(r)||Bh.is(r)}s(e,"is"),t.is=e})(hf||(Z.CancellationReceiverStrategy=hf={}));var gf;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(wl.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Be.func(n.sendCancellation)&&Be.func(n.cleanup)}s(e,"is"),t.is=e})(gf||(Z.CancellationSenderStrategy=gf={}));var yf;(function(t){t.Message=Object.freeze({receiver:hf.Message,sender:gf.Message});function e(r){let n=r;return n&&hf.is(n.receiver)&&gf.is(n.sender)}s(e,"is"),t.is=e})(yf||(Z.CancellationStrategy=yf={}));var xf;(function(t){function e(r){let n=r;return n&&Be.func(n.handleMessage)}s(e,"is"),t.is=e})(xf||(Z.MessageStrategy=xf={}));var nE;(function(t){function e(r){let n=r;return n&&(yf.is(n.cancellationStrategy)||qh.is(n.connectionStrategy)||xf.is(n.messageStrategy))}s(e,"is"),t.is=e})(nE||(Z.ConnectionOptions=nE={}));var br;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(br||(br={}));function WD(t,e,r,n){let i=r!==void 0?r:Z.NullLogger,o=0,a=0,l=0,u="2.0",c,f=new Map,d,h=new Map,g=new Map,b,$=new tE.LinkedMap,O=new Map,w=new Set,k=new Map,E=fe.Off,W=nr.Text,G,ge=br.New,Nr=new $l.Emitter,it=new $l.Emitter,dr=new $l.Emitter,sr=new $l.Emitter,C=new $l.Emitter,x=n&&n.cancellationStrategy?n.cancellationStrategy:yf.Message;function M(m){if(m===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+m.toString()}s(M,"createRequestQueueKey");function D(m){return m===null?"res-unknown-"+(++l).toString():"res-"+m.toString()}s(D,"createResponseQueueKey");function T(){return"not-"+(++a).toString()}s(T,"createNotificationQueueKey");function v(m,A){Y.Message.isRequest(A)?m.set(M(A.id),A):Y.Message.isResponse(A)?m.set(D(A.id),A):m.set(T(),A)}s(v,"addMessageToQueue");function S(m){}s(S,"cancelUndispatched");function L(){return ge===br.Listening}s(L,"isListening");function j(){return ge===br.Closed}s(j,"isClosed");function I(){return ge===br.Disposed}s(I,"isDisposed");function X(){(ge===br.New||ge===br.Listening)&&(ge=br.Closed,it.fire(void 0))}s(X,"closeHandler");function Q(m){Nr.fire([m,void 0,void 0])}s(Q,"readErrorHandler");function Qe(m){Nr.fire(m)}s(Qe,"writeErrorHandler"),t.onClose(X),t.onError(Q),e.onClose(X),e.onError(Qe);function ce(){b||$.size===0||(b=(0,eE.default)().timer.setImmediate(()=>{b=void 0,wr()}))}s(ce,"triggerMessageQueue");function De(m){Y.Message.isRequest(m)?Ut(m):Y.Message.isNotification(m)?kt(m):Y.Message.isResponse(m)?$n(m):mr(m)}s(De,"handleMessage");function wr(){if($.size===0)return;let m=$.shift();try{let A=n?.messageStrategy;xf.is(A)?A.handleMessage(m,De):De(m)}finally{ce()}}s(wr,"processMessageQueue");let ct=s(m=>{try{if(Y.Message.isNotification(m)&&m.method===wl.type.method){let A=m.params.id,P=M(A),B=$.get(P);if(Y.Message.isRequest(B)){let ye=n?.connectionStrategy,ze=ye&&ye.cancelUndispatched?ye.cancelUndispatched(B,S):void 0;if(ze&&(ze.error!==void 0||ze.result!==void 0)){$.delete(P),k.delete(A),ze.id=B.id,Cn(ze,m.method,Date.now()),e.write(ze).catch(()=>i.error("Sending response for canceled message failed."));return}}let Ce=k.get(A);if(Ce!==void 0){Ce.cancel(),Zf(m);return}else w.add(A)}v($,m)}finally{ce()}},"callback");function Ut(m){if(I())return;function A(ae,Me,me){let st={jsonrpc:u,id:m.id};ae instanceof Y.ResponseError?st.error=ae.toJson():st.result=ae===void 0?null:ae,Cn(st,Me,me),e.write(st).catch(()=>i.error("Sending response failed."))}s(A,"reply");function P(ae,Me,me){let st={jsonrpc:u,id:m.id,error:ae.toJson()};Cn(st,Me,me),e.write(st).catch(()=>i.error("Sending response failed."))}s(P,"replyError");function B(ae,Me,me){ae===void 0&&(ae=null);let st={jsonrpc:u,id:m.id,result:ae};Cn(st,Me,me),e.write(st).catch(()=>i.error("Sending response failed."))}s(B,"replySuccess"),Yl(m);let Ce=f.get(m.method),ye,ze;Ce&&(ye=Ce.type,ze=Ce.handler);let He=Date.now();if(ze||c){let ae=m.id??String(Date.now()),Me=mf.is(x.receiver)?x.receiver.createCancellationTokenSource(ae):x.receiver.createCancellationTokenSource(m);m.id!==null&&w.has(m.id)&&Me.cancel(),m.id!==null&&k.set(ae,Me);try{let me;if(ze)if(m.params===void 0){if(ye!==void 0&&ye.numberOfParams!==0){P(new Y.ResponseError(Y.ErrorCodes.InvalidParams,`Request ${m.method} defines ${ye.numberOfParams} params but received none.`),m.method,He);return}me=ze(Me.token)}else if(Array.isArray(m.params)){if(ye!==void 0&&ye.parameterStructures===Y.ParameterStructures.byName){P(new Y.ResponseError(Y.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by name but received parameters by position`),m.method,He);return}me=ze(...m.params,Me.token)}else{if(ye!==void 0&&ye.parameterStructures===Y.ParameterStructures.byPosition){P(new Y.ResponseError(Y.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by position but received parameters by name`),m.method,He);return}me=ze(m.params,Me.token)}else c&&(me=c(m.method,m.params,Me.token));let st=me;me?st.then?st.then(It=>{k.delete(ae),A(It,m.method,He)},It=>{k.delete(ae),It instanceof Y.ResponseError?P(It,m.method,He):It&&Be.string(It.message)?P(new Y.ResponseError(Y.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${It.message}`),m.method,He):P(new Y.ResponseError(Y.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,He)}):(k.delete(ae),A(me,m.method,He)):(k.delete(ae),B(me,m.method,He))}catch(me){k.delete(ae),me instanceof Y.ResponseError?A(me,m.method,He):me&&Be.string(me.message)?P(new Y.ResponseError(Y.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${me.message}`),m.method,He):P(new Y.ResponseError(Y.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,He)}}else P(new Y.ResponseError(Y.ErrorCodes.MethodNotFound,`Unhandled method ${m.method}`),m.method,He)}s(Ut,"handleRequest");function $n(m){if(!I())if(m.id===null)m.error?i.error(`Received response message without id: Error is: ${JSON.stringify(m.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let A=m.id,P=O.get(A);if(Hb(m,P),P!==void 0){O.delete(A);try{if(m.error){let B=m.error;P.reject(new Y.ResponseError(B.code,B.message,B.data))}else if(m.result!==void 0)P.resolve(m.result);else throw new Error("Should never happen.")}catch(B){B.message?i.error(`Response handler '${P.method}' failed with message: ${B.message}`):i.error(`Response handler '${P.method}' failed unexpectedly.`)}}}}s($n,"handleResponse");function kt(m){if(I())return;let A,P;if(m.method===wl.type.method){let B=m.params.id;w.delete(B),Zf(m);return}else{let B=h.get(m.method);B&&(P=B.handler,A=B.type)}if(P||d)try{if(Zf(m),P)if(m.params===void 0)A!==void 0&&A.numberOfParams!==0&&A.parameterStructures!==Y.ParameterStructures.byName&&i.error(`Notification ${m.method} defines ${A.numberOfParams} params but received none.`),P();else if(Array.isArray(m.params)){let B=m.params;m.method===Cl.type.method&&B.length===2&&Fh.is(B[0])?P({token:B[0],value:B[1]}):(A!==void 0&&(A.parameterStructures===Y.ParameterStructures.byName&&i.error(`Notification ${m.method} defines parameters by name but received parameters by position`),A.numberOfParams!==m.params.length&&i.error(`Notification ${m.method} defines ${A.numberOfParams} params but received ${B.length} arguments`)),P(...B))}else A!==void 0&&A.parameterStructures===Y.ParameterStructures.byPosition&&i.error(`Notification ${m.method} defines parameters by position but received parameters by name`),P(m.params);else d&&d(m.method,m.params)}catch(B){B.message?i.error(`Notification handler '${m.method}' failed with message: ${B.message}`):i.error(`Notification handler '${m.method}' failed unexpectedly.`)}else dr.fire(m)}s(kt,"handleNotification");function mr(m){if(!m){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(m,null,4)}`);let A=m;if(Be.string(A.id)||Be.number(A.id)){let P=A.id,B=O.get(P);B&&B.reject(new Error("The received response has neither a result nor an error property."))}}s(mr,"handleInvalidMessage");function yt(m){if(m!=null)switch(E){case fe.Verbose:return JSON.stringify(m,null,4);case fe.Compact:return JSON.stringify(m);default:return}}s(yt,"stringifyTrace");function hr(m){if(!(E===fe.Off||!G))if(W===nr.Text){let A;(E===fe.Verbose||E===fe.Compact)&&m.params&&(A=`Params: ${yt(m.params)} `),G.log(`Sending request '${m.method} - (${m.id})'.`,A)}else as("send-request",m)}s(hr,"traceSendingRequest");function nn(m){if(!(E===fe.Off||!G))if(W===nr.Text){let A;(E===fe.Verbose||E===fe.Compact)&&(m.params?A=`Params: ${yt(m.params)} `:A=`No parameters provided. `),G.log(`Sending notification '${m.method}'.`,A)}else as("send-notification",m)}s(nn,"traceSendingNotification");function Cn(m,A,P){if(!(E===fe.Off||!G))if(W===nr.Text){let B;(E===fe.Verbose||E===fe.Compact)&&(m.error&&m.error.data?B=`Error data: ${yt(m.error.data)} `:m.result?B=`Result: ${yt(m.result)} `:m.error===void 0&&(B=`No result returned. `)),G.log(`Sending response '${A} - (${m.id})'. Processing request took ${Date.now()-P}ms`,B)}else as("send-response",m)}s(Cn,"traceSendingResponse");function Yl(m){if(!(E===fe.Off||!G))if(W===nr.Text){let A;(E===fe.Verbose||E===fe.Compact)&&m.params&&(A=`Params: ${yt(m.params)} `),G.log(`Received request '${m.method} - (${m.id})'.`,A)}else as("receive-request",m)}s(Yl,"traceReceivedRequest");function Zf(m){if(!(E===fe.Off||!G||m.method===df.type.method))if(W===nr.Text){let A;(E===fe.Verbose||E===fe.Compact)&&(m.params?A=`Params: ${yt(m.params)} `:A=`No parameters provided. `),G.log(`Received notification '${m.method}'.`,A)}else as("receive-notification",m)}s(Zf,"traceReceivedNotification");function Hb(m,A){if(!(E===fe.Off||!G))if(W===nr.Text){let P;if((E===fe.Verbose||E===fe.Compact)&&(m.error&&m.error.data?P=`Error data: ${yt(m.error.data)} `:m.result?P=`Result: ${yt(m.result)} `:m.error===void 0&&(P=`No result returned. `)),A){let B=m.error?` Request failed: ${m.error.message} (${m.error.code}).`:"";G.log(`Received response '${A.method} - (${m.id})' in ${Date.now()-A.timerStart}ms.${B}`,P)}else G.log(`Received response ${m.id} without active response promise.`,P)}else as("receive-response",m)}s(Hb,"traceReceivedResponse");function as(m,A){if(!G||E===fe.Off)return;let P={isLSPMessage:!0,type:m,message:A,timestamp:Date.now()};G.log(P)}s(as,"logLSPMessage");function Qo(){if(j())throw new Io(Nl.Closed,"Connection is closed.");if(I())throw new Io(Nl.Disposed,"Connection is disposed.")}s(Qo,"throwIfClosedOrDisposed");function Yb(){if(L())throw new Io(Nl.AlreadyListening,"Connection is already listening")}s(Yb,"throwIfListening");function Xb(){if(!L())throw new Error("Call listen() first.")}s(Xb,"throwIfNotListening");function ea(m){return m===void 0?null:m}s(ea,"undefinedToNull");function Ug(m){if(m!==null)return m}s(Ug,"nullToUndefined");function jg(m){return m!=null&&!Array.isArray(m)&&typeof m=="object"}s(jg,"isNamedParam");function Qf(m,A){switch(m){case Y.ParameterStructures.auto:return jg(A)?Ug(A):[ea(A)];case Y.ParameterStructures.byName:if(!jg(A))throw new Error("Received parameters by name but param is not an object literal.");return Ug(A);case Y.ParameterStructures.byPosition:return[ea(A)];default:throw new Error(`Unknown parameter structure ${m.toString()}`)}}s(Qf,"computeSingleParam");function qg(m,A){let P,B=m.numberOfParams;switch(B){case 0:P=void 0;break;case 1:P=Qf(m.parameterStructures,A[0]);break;default:P=[];for(let Ce=0;Ce{Qo();let P,B;if(Be.string(m)){P=m;let ye=A[0],ze=0,He=Y.ParameterStructures.auto;Y.ParameterStructures.is(ye)&&(ze=1,He=ye);let ae=A.length,Me=ae-ze;switch(Me){case 0:B=void 0;break;case 1:B=Qf(He,A[ze]);break;default:if(He===Y.ParameterStructures.byName)throw new Error(`Received ${Me} parameters for 'by Name' notification parameter structure.`);B=A.slice(ze,ae).map(me=>ea(me));break}}else{let ye=A;P=m.method,B=qg(m,ye)}let Ce={jsonrpc:u,method:P,params:B};return nn(Ce),e.write(Ce).catch(ye=>{throw i.error("Sending notification failed."),ye})},"sendNotification"),onNotification:s((m,A)=>{Qo();let P;return Be.func(m)?d=m:A&&(Be.string(m)?(P=m,h.set(m,{type:void 0,handler:A})):(P=m.method,h.set(m.method,{type:m,handler:A}))),{dispose:s(()=>{P!==void 0?h.delete(P):d=void 0},"dispose")}},"onNotification"),onProgress:s((m,A,P)=>{if(g.has(A))throw new Error(`Progress handler for token ${A} already registered`);return g.set(A,P),{dispose:s(()=>{g.delete(A)},"dispose")}},"onProgress"),sendProgress:s((m,A,P)=>ls.sendNotification(Cl.type,{token:A,value:P}),"sendProgress"),onUnhandledProgress:sr.event,sendRequest:s((m,...A)=>{Qo(),Xb();let P,B,Ce;if(Be.string(m)){P=m;let ae=A[0],Me=A[A.length-1],me=0,st=Y.ParameterStructures.auto;Y.ParameterStructures.is(ae)&&(me=1,st=ae);let It=A.length;Mh.CancellationToken.is(Me)&&(It=It-1,Ce=Me);let kr=It-me;switch(kr){case 0:B=void 0;break;case 1:B=Qf(st,A[me]);break;default:if(st===Y.ParameterStructures.byName)throw new Error(`Received ${kr} parameters for 'by Name' request parameter structure.`);B=A.slice(me,It).map(Jb=>ea(Jb));break}}else{let ae=A;P=m.method,B=qg(m,ae);let Me=m.numberOfParams;Ce=Mh.CancellationToken.is(ae[Me])?ae[Me]:void 0}let ye=o++,ze;Ce&&(ze=Ce.onCancellationRequested(()=>{let ae=x.sender.sendCancellation(ls,ye);return ae===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${ye}`),Promise.resolve()):ae.catch(()=>{i.log(`Sending cancellation messages for id ${ye} failed`)})}));let He={jsonrpc:u,id:ye,method:P,params:B};return hr(He),typeof x.sender.enableCancellation=="function"&&x.sender.enableCancellation(He),new Promise(async(ae,Me)=>{let me=s(kr=>{ae(kr),x.sender.cleanup(ye),ze?.dispose()},"resolveWithCleanup"),st=s(kr=>{Me(kr),x.sender.cleanup(ye),ze?.dispose()},"rejectWithCleanup"),It={method:P,timerStart:Date.now(),resolve:me,reject:st};try{await e.write(He),O.set(ye,It)}catch(kr){throw i.error("Sending request failed."),It.reject(new Y.ResponseError(Y.ErrorCodes.MessageWriteError,kr.message?kr.message:"Unknown reason")),kr}})},"sendRequest"),onRequest:s((m,A)=>{Qo();let P=null;return Uh.is(m)?(P=void 0,c=m):Be.string(m)?(P=null,A!==void 0&&(P=m,f.set(m,{handler:A,type:void 0}))):A!==void 0&&(P=m.method,f.set(m.method,{type:m,handler:A})),{dispose:s(()=>{P!==null&&(P!==void 0?f.delete(P):c=void 0)},"dispose")}},"onRequest"),hasPendingResponse:s(()=>O.size>0,"hasPendingResponse"),trace:s(async(m,A,P)=>{let B=!1,Ce=nr.Text;P!==void 0&&(Be.boolean(P)?B=P:(B=P.sendNotification||!1,Ce=P.traceFormat||nr.Text)),E=m,W=Ce,E===fe.Off?G=void 0:G=A,B&&!j()&&!I()&&await ls.sendNotification(jh.type,{value:fe.toString(m)})},"trace"),onError:Nr.event,onClose:it.event,onUnhandledNotification:dr.event,onDispose:C.event,end:s(()=>{e.end()},"end"),dispose:s(()=>{if(I())return;ge=br.Disposed,C.fire(void 0);let m=new Y.ResponseError(Y.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let A of O.values())A.reject(m);O=new Map,k=new Map,w=new Set,$=new tE.LinkedMap,Be.func(e.dispose)&&e.dispose(),Be.func(t.dispose)&&t.dispose()},"dispose"),listen:s(()=>{Qo(),Yb(),ge=br.Listening,t.listen(ct)},"listen"),inspect:s(()=>{(0,eE.default)().console.log("inspect")},"inspect")};return ls.onNotification(df.type,m=>{if(E===fe.Off||!G)return;let A=E===fe.Verbose||E===fe.Compact;G.log(m.message,A?m.verbose:void 0)}),ls.onNotification(Cl.type,m=>{let A=g.get(m.token);A?A(m.value):sr.fire(m)}),ls}s(WD,"createMessageConnection");Z.createMessageConnection=WD});var Tf=J(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 $e=vh();Object.defineProperty(R,"Message",{enumerable:!0,get:s(function(){return $e.Message},"get")});Object.defineProperty(R,"RequestType",{enumerable:!0,get:s(function(){return $e.RequestType},"get")});Object.defineProperty(R,"RequestType0",{enumerable:!0,get:s(function(){return $e.RequestType0},"get")});Object.defineProperty(R,"RequestType1",{enumerable:!0,get:s(function(){return $e.RequestType1},"get")});Object.defineProperty(R,"RequestType2",{enumerable:!0,get:s(function(){return $e.RequestType2},"get")});Object.defineProperty(R,"RequestType3",{enumerable:!0,get:s(function(){return $e.RequestType3},"get")});Object.defineProperty(R,"RequestType4",{enumerable:!0,get:s(function(){return $e.RequestType4},"get")});Object.defineProperty(R,"RequestType5",{enumerable:!0,get:s(function(){return $e.RequestType5},"get")});Object.defineProperty(R,"RequestType6",{enumerable:!0,get:s(function(){return $e.RequestType6},"get")});Object.defineProperty(R,"RequestType7",{enumerable:!0,get:s(function(){return $e.RequestType7},"get")});Object.defineProperty(R,"RequestType8",{enumerable:!0,get:s(function(){return $e.RequestType8},"get")});Object.defineProperty(R,"RequestType9",{enumerable:!0,get:s(function(){return $e.RequestType9},"get")});Object.defineProperty(R,"ResponseError",{enumerable:!0,get:s(function(){return $e.ResponseError},"get")});Object.defineProperty(R,"ErrorCodes",{enumerable:!0,get:s(function(){return $e.ErrorCodes},"get")});Object.defineProperty(R,"NotificationType",{enumerable:!0,get:s(function(){return $e.NotificationType},"get")});Object.defineProperty(R,"NotificationType0",{enumerable:!0,get:s(function(){return $e.NotificationType0},"get")});Object.defineProperty(R,"NotificationType1",{enumerable:!0,get:s(function(){return $e.NotificationType1},"get")});Object.defineProperty(R,"NotificationType2",{enumerable:!0,get:s(function(){return $e.NotificationType2},"get")});Object.defineProperty(R,"NotificationType3",{enumerable:!0,get:s(function(){return $e.NotificationType3},"get")});Object.defineProperty(R,"NotificationType4",{enumerable:!0,get:s(function(){return $e.NotificationType4},"get")});Object.defineProperty(R,"NotificationType5",{enumerable:!0,get:s(function(){return $e.NotificationType5},"get")});Object.defineProperty(R,"NotificationType6",{enumerable:!0,get:s(function(){return $e.NotificationType6},"get")});Object.defineProperty(R,"NotificationType7",{enumerable:!0,get:s(function(){return $e.NotificationType7},"get")});Object.defineProperty(R,"NotificationType8",{enumerable:!0,get:s(function(){return $e.NotificationType8},"get")});Object.defineProperty(R,"NotificationType9",{enumerable:!0,get:s(function(){return $e.NotificationType9},"get")});Object.defineProperty(R,"ParameterStructures",{enumerable:!0,get:s(function(){return $e.ParameterStructures},"get")});var zh=Ah();Object.defineProperty(R,"LinkedMap",{enumerable:!0,get:s(function(){return zh.LinkedMap},"get")});Object.defineProperty(R,"LRUCache",{enumerable:!0,get:s(function(){return zh.LRUCache},"get")});Object.defineProperty(R,"Touch",{enumerable:!0,get:s(function(){return zh.Touch},"get")});var KD=zv();Object.defineProperty(R,"Disposable",{enumerable:!0,get:s(function(){return KD.Disposable},"get")});var sE=Hi();Object.defineProperty(R,"Event",{enumerable:!0,get:s(function(){return sE.Event},"get")});Object.defineProperty(R,"Emitter",{enumerable:!0,get:s(function(){return sE.Emitter},"get")});var oE=ol();Object.defineProperty(R,"CancellationTokenSource",{enumerable:!0,get:s(function(){return oE.CancellationTokenSource},"get")});Object.defineProperty(R,"CancellationToken",{enumerable:!0,get:s(function(){return oE.CancellationToken},"get")});var aE=Wv();Object.defineProperty(R,"SharedArraySenderStrategy",{enumerable:!0,get:s(function(){return aE.SharedArraySenderStrategy},"get")});Object.defineProperty(R,"SharedArrayReceiverStrategy",{enumerable:!0,get:s(function(){return aE.SharedArrayReceiverStrategy},"get")});var Wh=Vv();Object.defineProperty(R,"MessageReader",{enumerable:!0,get:s(function(){return Wh.MessageReader},"get")});Object.defineProperty(R,"AbstractMessageReader",{enumerable:!0,get:s(function(){return Wh.AbstractMessageReader},"get")});Object.defineProperty(R,"ReadableStreamMessageReader",{enumerable:!0,get:s(function(){return Wh.ReadableStreamMessageReader},"get")});var Kh=Zv();Object.defineProperty(R,"MessageWriter",{enumerable:!0,get:s(function(){return Kh.MessageWriter},"get")});Object.defineProperty(R,"AbstractMessageWriter",{enumerable:!0,get:s(function(){return Kh.AbstractMessageWriter},"get")});Object.defineProperty(R,"WriteableStreamMessageWriter",{enumerable:!0,get:s(function(){return Kh.WriteableStreamMessageWriter},"get")});var VD=Qv();Object.defineProperty(R,"AbstractMessageBuffer",{enumerable:!0,get:s(function(){return VD.AbstractMessageBuffer},"get")});var vt=iE();Object.defineProperty(R,"ConnectionStrategy",{enumerable:!0,get:s(function(){return vt.ConnectionStrategy},"get")});Object.defineProperty(R,"ConnectionOptions",{enumerable:!0,get:s(function(){return vt.ConnectionOptions},"get")});Object.defineProperty(R,"NullLogger",{enumerable:!0,get:s(function(){return vt.NullLogger},"get")});Object.defineProperty(R,"createMessageConnection",{enumerable:!0,get:s(function(){return vt.createMessageConnection},"get")});Object.defineProperty(R,"ProgressToken",{enumerable:!0,get:s(function(){return vt.ProgressToken},"get")});Object.defineProperty(R,"ProgressType",{enumerable:!0,get:s(function(){return vt.ProgressType},"get")});Object.defineProperty(R,"Trace",{enumerable:!0,get:s(function(){return vt.Trace},"get")});Object.defineProperty(R,"TraceValues",{enumerable:!0,get:s(function(){return vt.TraceValues},"get")});Object.defineProperty(R,"TraceFormat",{enumerable:!0,get:s(function(){return vt.TraceFormat},"get")});Object.defineProperty(R,"SetTraceNotification",{enumerable:!0,get:s(function(){return vt.SetTraceNotification},"get")});Object.defineProperty(R,"LogTraceNotification",{enumerable:!0,get:s(function(){return vt.LogTraceNotification},"get")});Object.defineProperty(R,"ConnectionErrors",{enumerable:!0,get:s(function(){return vt.ConnectionErrors},"get")});Object.defineProperty(R,"ConnectionError",{enumerable:!0,get:s(function(){return vt.ConnectionError},"get")});Object.defineProperty(R,"CancellationReceiverStrategy",{enumerable:!0,get:s(function(){return vt.CancellationReceiverStrategy},"get")});Object.defineProperty(R,"CancellationSenderStrategy",{enumerable:!0,get:s(function(){return vt.CancellationSenderStrategy},"get")});Object.defineProperty(R,"CancellationStrategy",{enumerable:!0,get:s(function(){return vt.CancellationStrategy},"get")});Object.defineProperty(R,"MessageStrategy",{enumerable:!0,get:s(function(){return vt.MessageStrategy},"get")});var HD=si();R.RAL=HD.default});var uE=J(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});var Jr=Tf(),Rf=class t extends Jr.AbstractMessageBuffer{static{s(this,"MessageBuffer")}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)}};Rf.emptyBuffer=new Uint8Array(0);var Vh=class{static{s(this,"ReadableStreamWrapper")}constructor(e){this.socket=e,this._onData=new Jr.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Jr.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Jr.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Jr.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Jr.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}},Hh=class{static{s(this,"WritableStreamWrapper")}constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Jr.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Jr.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Jr.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()}},YD=new TextEncoder,lE=Object.freeze({messageBuffer:Object.freeze({create:s(t=>new Rf(t),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:s((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(YD.encode(JSON.stringify(t,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:s((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)))},"decode")})}),stream:Object.freeze({asReadableStream:s(t=>new Vh(t),"asReadableStream"),asWritableStream:s(t=>new Hh(t),"asWritableStream")}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:s(()=>clearTimeout(n),"dispose")}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:s(()=>clearTimeout(r),"dispose")}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:s(()=>clearInterval(n),"dispose")}}})});function Yh(){return lE}s(Yh,"RIL");(function(t){function e(){Jr.RAL.install(lE)}s(e,"install"),t.install=e})(Yh||(Yh={}));Xh.default=Yh});var es=J(ir=>{"use strict";var XD=ir&&ir.__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:s(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JD=ir&&ir.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XD(e,t,r)};Object.defineProperty(ir,"__esModule",{value:!0});ir.createMessageConnection=ir.BrowserMessageWriter=ir.BrowserMessageReader=void 0;var ZD=uE();ZD.default.install();var _o=Tf();JD(Tf(),ir);var Jh=class extends _o.AbstractMessageReader{static{s(this,"BrowserMessageReader")}constructor(e){super(),this._onData=new _o.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)}};ir.BrowserMessageReader=Jh;var Zh=class extends _o.AbstractMessageWriter{static{s(this,"BrowserMessageWriter")}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(){}};ir.BrowserMessageWriter=Zh;function QD(t,e,r,n){return r===void 0&&(r=_o.NullLogger),_o.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,_o.createMessageConnection)(t,e,r,n)}s(QD,"createMessageConnection");ir.createMessageConnection=QD});var Qh=J((PQ,cE)=>{"use strict";cE.exports=es()});var Le=J(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.ProtocolNotificationType=Yt.ProtocolNotificationType0=Yt.ProtocolRequestType=Yt.ProtocolRequestType0=Yt.RegistrationType=Yt.MessageDirection=void 0;var Po=es(),fE;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(fE||(Yt.MessageDirection=fE={}));var eg=class{static{s(this,"RegistrationType")}constructor(e){this.method=e}};Yt.RegistrationType=eg;var tg=class extends Po.RequestType0{static{s(this,"ProtocolRequestType0")}constructor(e){super(e)}};Yt.ProtocolRequestType0=tg;var rg=class extends Po.RequestType{static{s(this,"ProtocolRequestType")}constructor(e){super(e,Po.ParameterStructures.byName)}};Yt.ProtocolRequestType=rg;var ng=class extends Po.NotificationType0{static{s(this,"ProtocolNotificationType0")}constructor(e){super(e)}};Yt.ProtocolNotificationType0=ng;var ig=class extends Po.NotificationType{static{s(this,"ProtocolNotificationType")}constructor(e){super(e,Po.ParameterStructures.byName)}};Yt.ProtocolNotificationType=ig});var vf=J(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.objectLiteral=nt.typedArray=nt.stringArray=nt.array=nt.func=nt.error=nt.number=nt.string=nt.boolean=void 0;function eM(t){return t===!0||t===!1}s(eM,"boolean");nt.boolean=eM;function pE(t){return typeof t=="string"||t instanceof String}s(pE,"string");nt.string=pE;function tM(t){return typeof t=="number"||t instanceof Number}s(tM,"number");nt.number=tM;function rM(t){return t instanceof Error}s(rM,"error");nt.error=rM;function nM(t){return typeof t=="function"}s(nM,"func");nt.func=nM;function dE(t){return Array.isArray(t)}s(dE,"array");nt.array=dE;function iM(t){return dE(t)&&t.every(e=>pE(e))}s(iM,"stringArray");nt.stringArray=iM;function sM(t,e){return Array.isArray(t)&&t.every(e)}s(sM,"typedArray");nt.typedArray=sM;function oM(t){return t!==null&&typeof t=="object"}s(oM,"objectLiteral");nt.objectLiteral=oM});var gE=J(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.ImplementationRequest=void 0;var mE=Le(),hE;(function(t){t.method="textDocument/implementation",t.messageDirection=mE.MessageDirection.clientToServer,t.type=new mE.ProtocolRequestType(t.method)})(hE||(Ef.ImplementationRequest=hE={}))});var TE=J(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.TypeDefinitionRequest=void 0;var yE=Le(),xE;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=yE.MessageDirection.clientToServer,t.type=new yE.ProtocolRequestType(t.method)})(xE||(Af.TypeDefinitionRequest=xE={}))});var EE=J(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.DidChangeWorkspaceFoldersNotification=Oo.WorkspaceFoldersRequest=void 0;var Sf=Le(),RE;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Sf.MessageDirection.serverToClient,t.type=new Sf.ProtocolRequestType0(t.method)})(RE||(Oo.WorkspaceFoldersRequest=RE={}));var vE;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Sf.MessageDirection.clientToServer,t.type=new Sf.ProtocolNotificationType(t.method)})(vE||(Oo.DidChangeWorkspaceFoldersNotification=vE={}))});var bE=J(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.ConfigurationRequest=void 0;var AE=Le(),SE;(function(t){t.method="workspace/configuration",t.messageDirection=AE.MessageDirection.serverToClient,t.type=new AE.ProtocolRequestType(t.method)})(SE||(bf.ConfigurationRequest=SE={}))});var NE=J(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.ColorPresentationRequest=Lo.DocumentColorRequest=void 0;var $f=Le(),$E;(function(t){t.method="textDocument/documentColor",t.messageDirection=$f.MessageDirection.clientToServer,t.type=new $f.ProtocolRequestType(t.method)})($E||(Lo.DocumentColorRequest=$E={}));var CE;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=$f.MessageDirection.clientToServer,t.type=new $f.ProtocolRequestType(t.method)})(CE||(Lo.ColorPresentationRequest=CE={}))});var IE=J(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.FoldingRangeRefreshRequest=Do.FoldingRangeRequest=void 0;var Cf=Le(),wE;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Cf.MessageDirection.clientToServer,t.type=new Cf.ProtocolRequestType(t.method)})(wE||(Do.FoldingRangeRequest=wE={}));var kE;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Cf.MessageDirection.serverToClient,t.type=new Cf.ProtocolRequestType0(t.method)})(kE||(Do.FoldingRangeRefreshRequest=kE={}))});var OE=J(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.DeclarationRequest=void 0;var _E=Le(),PE;(function(t){t.method="textDocument/declaration",t.messageDirection=_E.MessageDirection.clientToServer,t.type=new _E.ProtocolRequestType(t.method)})(PE||(Nf.DeclarationRequest=PE={}))});var ME=J(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.SelectionRangeRequest=void 0;var LE=Le(),DE;(function(t){t.method="textDocument/selectionRange",t.messageDirection=LE.MessageDirection.clientToServer,t.type=new LE.ProtocolRequestType(t.method)})(DE||(wf.SelectionRangeRequest=DE={}))});var jE=J(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.WorkDoneProgressCancelNotification=ui.WorkDoneProgressCreateRequest=ui.WorkDoneProgress=void 0;var aM=es(),kf=Le(),FE;(function(t){t.type=new aM.ProgressType;function e(r){return r===t.type}s(e,"is"),t.is=e})(FE||(ui.WorkDoneProgress=FE={}));var GE;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=kf.MessageDirection.serverToClient,t.type=new kf.ProtocolRequestType(t.method)})(GE||(ui.WorkDoneProgressCreateRequest=GE={}));var UE;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=kf.MessageDirection.clientToServer,t.type=new kf.ProtocolNotificationType(t.method)})(UE||(ui.WorkDoneProgressCancelNotification=UE={}))});var WE=J(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.CallHierarchyOutgoingCallsRequest=ci.CallHierarchyIncomingCallsRequest=ci.CallHierarchyPrepareRequest=void 0;var Mo=Le(),qE;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(qE||(ci.CallHierarchyPrepareRequest=qE={}));var BE;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(BE||(ci.CallHierarchyIncomingCallsRequest=BE={}));var zE;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(zE||(ci.CallHierarchyOutgoingCallsRequest=zE={}))});var JE=J(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.SemanticTokensRefreshRequest=Xt.SemanticTokensRangeRequest=Xt.SemanticTokensDeltaRequest=Xt.SemanticTokensRequest=Xt.SemanticTokensRegistrationType=Xt.TokenFormat=void 0;var Sn=Le(),KE;(function(t){t.Relative="relative"})(KE||(Xt.TokenFormat=KE={}));var kl;(function(t){t.method="textDocument/semanticTokens",t.type=new Sn.RegistrationType(t.method)})(kl||(Xt.SemanticTokensRegistrationType=kl={}));var VE;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Sn.MessageDirection.clientToServer,t.type=new Sn.ProtocolRequestType(t.method),t.registrationMethod=kl.method})(VE||(Xt.SemanticTokensRequest=VE={}));var HE;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Sn.MessageDirection.clientToServer,t.type=new Sn.ProtocolRequestType(t.method),t.registrationMethod=kl.method})(HE||(Xt.SemanticTokensDeltaRequest=HE={}));var YE;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Sn.MessageDirection.clientToServer,t.type=new Sn.ProtocolRequestType(t.method),t.registrationMethod=kl.method})(YE||(Xt.SemanticTokensRangeRequest=YE={}));var XE;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Sn.MessageDirection.serverToClient,t.type=new Sn.ProtocolRequestType0(t.method)})(XE||(Xt.SemanticTokensRefreshRequest=XE={}))});var eA=J(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.ShowDocumentRequest=void 0;var ZE=Le(),QE;(function(t){t.method="window/showDocument",t.messageDirection=ZE.MessageDirection.serverToClient,t.type=new ZE.ProtocolRequestType(t.method)})(QE||(If.ShowDocumentRequest=QE={}))});var nA=J(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.LinkedEditingRangeRequest=void 0;var tA=Le(),rA;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=tA.MessageDirection.clientToServer,t.type=new tA.ProtocolRequestType(t.method)})(rA||(_f.LinkedEditingRangeRequest=rA={}))});var fA=J(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.WillDeleteFilesRequest=wt.DidDeleteFilesNotification=wt.DidRenameFilesNotification=wt.WillRenameFilesRequest=wt.DidCreateFilesNotification=wt.WillCreateFilesRequest=wt.FileOperationPatternKind=void 0;var fr=Le(),iA;(function(t){t.file="file",t.folder="folder"})(iA||(wt.FileOperationPatternKind=iA={}));var sA;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=fr.MessageDirection.clientToServer,t.type=new fr.ProtocolRequestType(t.method)})(sA||(wt.WillCreateFilesRequest=sA={}));var oA;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=fr.MessageDirection.clientToServer,t.type=new fr.ProtocolNotificationType(t.method)})(oA||(wt.DidCreateFilesNotification=oA={}));var aA;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=fr.MessageDirection.clientToServer,t.type=new fr.ProtocolRequestType(t.method)})(aA||(wt.WillRenameFilesRequest=aA={}));var lA;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=fr.MessageDirection.clientToServer,t.type=new fr.ProtocolNotificationType(t.method)})(lA||(wt.DidRenameFilesNotification=lA={}));var uA;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=fr.MessageDirection.clientToServer,t.type=new fr.ProtocolNotificationType(t.method)})(uA||(wt.DidDeleteFilesNotification=uA={}));var cA;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=fr.MessageDirection.clientToServer,t.type=new fr.ProtocolRequestType(t.method)})(cA||(wt.WillDeleteFilesRequest=cA={}))});var gA=J(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.MonikerRequest=fi.MonikerKind=fi.UniquenessLevel=void 0;var pA=Le(),dA;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(dA||(fi.UniquenessLevel=dA={}));var mA;(function(t){t.$import="import",t.$export="export",t.local="local"})(mA||(fi.MonikerKind=mA={}));var hA;(function(t){t.method="textDocument/moniker",t.messageDirection=pA.MessageDirection.clientToServer,t.type=new pA.ProtocolRequestType(t.method)})(hA||(fi.MonikerRequest=hA={}))});var RA=J(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.TypeHierarchySubtypesRequest=pi.TypeHierarchySupertypesRequest=pi.TypeHierarchyPrepareRequest=void 0;var Fo=Le(),yA;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Fo.MessageDirection.clientToServer,t.type=new Fo.ProtocolRequestType(t.method)})(yA||(pi.TypeHierarchyPrepareRequest=yA={}));var xA;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Fo.MessageDirection.clientToServer,t.type=new Fo.ProtocolRequestType(t.method)})(xA||(pi.TypeHierarchySupertypesRequest=xA={}));var TA;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Fo.MessageDirection.clientToServer,t.type=new Fo.ProtocolRequestType(t.method)})(TA||(pi.TypeHierarchySubtypesRequest=TA={}))});var AA=J(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.InlineValueRefreshRequest=Go.InlineValueRequest=void 0;var Pf=Le(),vA;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Pf.MessageDirection.clientToServer,t.type=new Pf.ProtocolRequestType(t.method)})(vA||(Go.InlineValueRequest=vA={}));var EA;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Pf.MessageDirection.serverToClient,t.type=new Pf.ProtocolRequestType0(t.method)})(EA||(Go.InlineValueRefreshRequest=EA={}))});var CA=J(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.InlayHintRefreshRequest=di.InlayHintResolveRequest=di.InlayHintRequest=void 0;var Uo=Le(),SA;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Uo.MessageDirection.clientToServer,t.type=new Uo.ProtocolRequestType(t.method)})(SA||(di.InlayHintRequest=SA={}));var bA;(function(t){t.method="inlayHint/resolve",t.messageDirection=Uo.MessageDirection.clientToServer,t.type=new Uo.ProtocolRequestType(t.method)})(bA||(di.InlayHintResolveRequest=bA={}));var $A;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Uo.MessageDirection.serverToClient,t.type=new Uo.ProtocolRequestType0(t.method)})($A||(di.InlayHintRefreshRequest=$A={}))});var OA=J(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.DiagnosticRefreshRequest=pr.WorkspaceDiagnosticRequest=pr.DocumentDiagnosticRequest=pr.DocumentDiagnosticReportKind=pr.DiagnosticServerCancellationData=void 0;var PA=es(),lM=vf(),jo=Le(),NA;(function(t){function e(r){let n=r;return n&&lM.boolean(n.retriggerRequest)}s(e,"is"),t.is=e})(NA||(pr.DiagnosticServerCancellationData=NA={}));var wA;(function(t){t.Full="full",t.Unchanged="unchanged"})(wA||(pr.DocumentDiagnosticReportKind=wA={}));var kA;(function(t){t.method="textDocument/diagnostic",t.messageDirection=jo.MessageDirection.clientToServer,t.type=new jo.ProtocolRequestType(t.method),t.partialResult=new PA.ProgressType})(kA||(pr.DocumentDiagnosticRequest=kA={}));var IA;(function(t){t.method="workspace/diagnostic",t.messageDirection=jo.MessageDirection.clientToServer,t.type=new jo.ProtocolRequestType(t.method),t.partialResult=new PA.ProgressType})(IA||(pr.WorkspaceDiagnosticRequest=IA={}));var _A;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=jo.MessageDirection.serverToClient,t.type=new jo.ProtocolRequestType0(t.method)})(_A||(pr.DiagnosticRefreshRequest=_A={}))});var jA=J(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.DidCloseNotebookDocumentNotification=Ve.DidSaveNotebookDocumentNotification=Ve.DidChangeNotebookDocumentNotification=Ve.NotebookCellArrayChange=Ve.DidOpenNotebookDocumentNotification=Ve.NotebookDocumentSyncRegistrationType=Ve.NotebookDocument=Ve.NotebookCell=Ve.ExecutionSummary=Ve.NotebookCellKind=void 0;var Il=(yo(),tp(Kc)),$r=vf(),Zr=Le(),sg;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}s(e,"is"),t.is=e})(sg||(Ve.NotebookCellKind=sg={}));var og;(function(t){function e(i,o){let a={executionOrder:i};return(o===!0||o===!1)&&(a.success=o),a}s(e,"create"),t.create=e;function r(i){let o=i;return $r.objectLiteral(o)&&Il.uinteger.is(o.executionOrder)&&(o.success===void 0||$r.boolean(o.success))}s(r,"is"),t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}s(n,"equals"),t.equals=n})(og||(Ve.ExecutionSummary=og={}));var Of;(function(t){function e(o,a){return{kind:o,document:a}}s(e,"create"),t.create=e;function r(o){let a=o;return $r.objectLiteral(a)&&sg.is(a.kind)&&Il.DocumentUri.is(a.document)&&(a.metadata===void 0||$r.objectLiteral(a.metadata))}s(r,"is"),t.is=r;function n(o,a){let l=new Set;return o.document!==a.document&&l.add("document"),o.kind!==a.kind&&l.add("kind"),o.executionSummary!==a.executionSummary&&l.add("executionSummary"),(o.metadata!==void 0||a.metadata!==void 0)&&!i(o.metadata,a.metadata)&&l.add("metadata"),(o.executionSummary!==void 0||a.executionSummary!==void 0)&&!og.equals(o.executionSummary,a.executionSummary)&&l.add("executionSummary"),l}s(n,"diff"),t.diff=n;function i(o,a){if(o===a)return!0;if(o==null||a===null||a===void 0||typeof o!=typeof a||typeof o!="object")return!1;let l=Array.isArray(o),u=Array.isArray(a);if(l!==u)return!1;if(l&&u){if(o.length!==a.length)return!1;for(let c=0;c{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.InlineCompletionRequest=void 0;var qA=Le(),BA;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=qA.MessageDirection.clientToServer,t.type=new qA.ProtocolRequestType(t.method)})(BA||(Lf.InlineCompletionRequest=BA={}))});var nb=J(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.WorkspaceSymbolRequest=p.CodeActionResolveRequest=p.CodeActionRequest=p.DocumentSymbolRequest=p.DocumentHighlightRequest=p.ReferencesRequest=p.DefinitionRequest=p.SignatureHelpRequest=p.SignatureHelpTriggerKind=p.HoverRequest=p.CompletionResolveRequest=p.CompletionRequest=p.CompletionTriggerKind=p.PublishDiagnosticsNotification=p.WatchKind=p.RelativePattern=p.FileChangeType=p.DidChangeWatchedFilesNotification=p.WillSaveTextDocumentWaitUntilRequest=p.WillSaveTextDocumentNotification=p.TextDocumentSaveReason=p.DidSaveTextDocumentNotification=p.DidCloseTextDocumentNotification=p.DidChangeTextDocumentNotification=p.TextDocumentContentChangeEvent=p.DidOpenTextDocumentNotification=p.TextDocumentSyncKind=p.TelemetryEventNotification=p.LogMessageNotification=p.ShowMessageRequest=p.ShowMessageNotification=p.MessageType=p.DidChangeConfigurationNotification=p.ExitNotification=p.ShutdownRequest=p.InitializedNotification=p.InitializeErrorCodes=p.InitializeRequest=p.WorkDoneProgressOptions=p.TextDocumentRegistrationOptions=p.StaticRegistrationOptions=p.PositionEncodingKind=p.FailureHandlingKind=p.ResourceOperationKind=p.UnregistrationRequest=p.RegistrationRequest=p.DocumentSelector=p.NotebookCellTextDocumentFilter=p.NotebookDocumentFilter=p.TextDocumentFilter=void 0;p.MonikerRequest=p.MonikerKind=p.UniquenessLevel=p.WillDeleteFilesRequest=p.DidDeleteFilesNotification=p.WillRenameFilesRequest=p.DidRenameFilesNotification=p.WillCreateFilesRequest=p.DidCreateFilesNotification=p.FileOperationPatternKind=p.LinkedEditingRangeRequest=p.ShowDocumentRequest=p.SemanticTokensRegistrationType=p.SemanticTokensRefreshRequest=p.SemanticTokensRangeRequest=p.SemanticTokensDeltaRequest=p.SemanticTokensRequest=p.TokenFormat=p.CallHierarchyPrepareRequest=p.CallHierarchyOutgoingCallsRequest=p.CallHierarchyIncomingCallsRequest=p.WorkDoneProgressCancelNotification=p.WorkDoneProgressCreateRequest=p.WorkDoneProgress=p.SelectionRangeRequest=p.DeclarationRequest=p.FoldingRangeRefreshRequest=p.FoldingRangeRequest=p.ColorPresentationRequest=p.DocumentColorRequest=p.ConfigurationRequest=p.DidChangeWorkspaceFoldersNotification=p.WorkspaceFoldersRequest=p.TypeDefinitionRequest=p.ImplementationRequest=p.ApplyWorkspaceEditRequest=p.ExecuteCommandRequest=p.PrepareRenameRequest=p.RenameRequest=p.PrepareSupportDefaultBehavior=p.DocumentOnTypeFormattingRequest=p.DocumentRangesFormattingRequest=p.DocumentRangeFormattingRequest=p.DocumentFormattingRequest=p.DocumentLinkResolveRequest=p.DocumentLinkRequest=p.CodeLensRefreshRequest=p.CodeLensResolveRequest=p.CodeLensRequest=p.WorkspaceSymbolResolveRequest=void 0;p.InlineCompletionRequest=p.DidCloseNotebookDocumentNotification=p.DidSaveNotebookDocumentNotification=p.DidChangeNotebookDocumentNotification=p.NotebookCellArrayChange=p.DidOpenNotebookDocumentNotification=p.NotebookDocumentSyncRegistrationType=p.NotebookDocument=p.NotebookCell=p.ExecutionSummary=p.NotebookCellKind=p.DiagnosticRefreshRequest=p.WorkspaceDiagnosticRequest=p.DocumentDiagnosticRequest=p.DocumentDiagnosticReportKind=p.DiagnosticServerCancellationData=p.InlayHintRefreshRequest=p.InlayHintResolveRequest=p.InlayHintRequest=p.InlineValueRefreshRequest=p.InlineValueRequest=p.TypeHierarchySupertypesRequest=p.TypeHierarchySubtypesRequest=p.TypeHierarchyPrepareRequest=void 0;var N=Le(),WA=(yo(),tp(Kc)),gt=vf(),uM=gE();Object.defineProperty(p,"ImplementationRequest",{enumerable:!0,get:s(function(){return uM.ImplementationRequest},"get")});var cM=TE();Object.defineProperty(p,"TypeDefinitionRequest",{enumerable:!0,get:s(function(){return cM.TypeDefinitionRequest},"get")});var QS=EE();Object.defineProperty(p,"WorkspaceFoldersRequest",{enumerable:!0,get:s(function(){return QS.WorkspaceFoldersRequest},"get")});Object.defineProperty(p,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:s(function(){return QS.DidChangeWorkspaceFoldersNotification},"get")});var fM=bE();Object.defineProperty(p,"ConfigurationRequest",{enumerable:!0,get:s(function(){return fM.ConfigurationRequest},"get")});var eb=NE();Object.defineProperty(p,"DocumentColorRequest",{enumerable:!0,get:s(function(){return eb.DocumentColorRequest},"get")});Object.defineProperty(p,"ColorPresentationRequest",{enumerable:!0,get:s(function(){return eb.ColorPresentationRequest},"get")});var tb=IE();Object.defineProperty(p,"FoldingRangeRequest",{enumerable:!0,get:s(function(){return tb.FoldingRangeRequest},"get")});Object.defineProperty(p,"FoldingRangeRefreshRequest",{enumerable:!0,get:s(function(){return tb.FoldingRangeRefreshRequest},"get")});var pM=OE();Object.defineProperty(p,"DeclarationRequest",{enumerable:!0,get:s(function(){return pM.DeclarationRequest},"get")});var dM=ME();Object.defineProperty(p,"SelectionRangeRequest",{enumerable:!0,get:s(function(){return dM.SelectionRangeRequest},"get")});var fg=jE();Object.defineProperty(p,"WorkDoneProgress",{enumerable:!0,get:s(function(){return fg.WorkDoneProgress},"get")});Object.defineProperty(p,"WorkDoneProgressCreateRequest",{enumerable:!0,get:s(function(){return fg.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(p,"WorkDoneProgressCancelNotification",{enumerable:!0,get:s(function(){return fg.WorkDoneProgressCancelNotification},"get")});var pg=WE();Object.defineProperty(p,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:s(function(){return pg.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(p,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:s(function(){return pg.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(p,"CallHierarchyPrepareRequest",{enumerable:!0,get:s(function(){return pg.CallHierarchyPrepareRequest},"get")});var Bo=JE();Object.defineProperty(p,"TokenFormat",{enumerable:!0,get:s(function(){return Bo.TokenFormat},"get")});Object.defineProperty(p,"SemanticTokensRequest",{enumerable:!0,get:s(function(){return Bo.SemanticTokensRequest},"get")});Object.defineProperty(p,"SemanticTokensDeltaRequest",{enumerable:!0,get:s(function(){return Bo.SemanticTokensDeltaRequest},"get")});Object.defineProperty(p,"SemanticTokensRangeRequest",{enumerable:!0,get:s(function(){return Bo.SemanticTokensRangeRequest},"get")});Object.defineProperty(p,"SemanticTokensRefreshRequest",{enumerable:!0,get:s(function(){return Bo.SemanticTokensRefreshRequest},"get")});Object.defineProperty(p,"SemanticTokensRegistrationType",{enumerable:!0,get:s(function(){return Bo.SemanticTokensRegistrationType},"get")});var mM=eA();Object.defineProperty(p,"ShowDocumentRequest",{enumerable:!0,get:s(function(){return mM.ShowDocumentRequest},"get")});var hM=nA();Object.defineProperty(p,"LinkedEditingRangeRequest",{enumerable:!0,get:s(function(){return hM.LinkedEditingRangeRequest},"get")});var ts=fA();Object.defineProperty(p,"FileOperationPatternKind",{enumerable:!0,get:s(function(){return ts.FileOperationPatternKind},"get")});Object.defineProperty(p,"DidCreateFilesNotification",{enumerable:!0,get:s(function(){return ts.DidCreateFilesNotification},"get")});Object.defineProperty(p,"WillCreateFilesRequest",{enumerable:!0,get:s(function(){return ts.WillCreateFilesRequest},"get")});Object.defineProperty(p,"DidRenameFilesNotification",{enumerable:!0,get:s(function(){return ts.DidRenameFilesNotification},"get")});Object.defineProperty(p,"WillRenameFilesRequest",{enumerable:!0,get:s(function(){return ts.WillRenameFilesRequest},"get")});Object.defineProperty(p,"DidDeleteFilesNotification",{enumerable:!0,get:s(function(){return ts.DidDeleteFilesNotification},"get")});Object.defineProperty(p,"WillDeleteFilesRequest",{enumerable:!0,get:s(function(){return ts.WillDeleteFilesRequest},"get")});var dg=gA();Object.defineProperty(p,"UniquenessLevel",{enumerable:!0,get:s(function(){return dg.UniquenessLevel},"get")});Object.defineProperty(p,"MonikerKind",{enumerable:!0,get:s(function(){return dg.MonikerKind},"get")});Object.defineProperty(p,"MonikerRequest",{enumerable:!0,get:s(function(){return dg.MonikerRequest},"get")});var mg=RA();Object.defineProperty(p,"TypeHierarchyPrepareRequest",{enumerable:!0,get:s(function(){return mg.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(p,"TypeHierarchySubtypesRequest",{enumerable:!0,get:s(function(){return mg.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(p,"TypeHierarchySupertypesRequest",{enumerable:!0,get:s(function(){return mg.TypeHierarchySupertypesRequest},"get")});var rb=AA();Object.defineProperty(p,"InlineValueRequest",{enumerable:!0,get:s(function(){return rb.InlineValueRequest},"get")});Object.defineProperty(p,"InlineValueRefreshRequest",{enumerable:!0,get:s(function(){return rb.InlineValueRefreshRequest},"get")});var hg=CA();Object.defineProperty(p,"InlayHintRequest",{enumerable:!0,get:s(function(){return hg.InlayHintRequest},"get")});Object.defineProperty(p,"InlayHintResolveRequest",{enumerable:!0,get:s(function(){return hg.InlayHintResolveRequest},"get")});Object.defineProperty(p,"InlayHintRefreshRequest",{enumerable:!0,get:s(function(){return hg.InlayHintRefreshRequest},"get")});var _l=OA();Object.defineProperty(p,"DiagnosticServerCancellationData",{enumerable:!0,get:s(function(){return _l.DiagnosticServerCancellationData},"get")});Object.defineProperty(p,"DocumentDiagnosticReportKind",{enumerable:!0,get:s(function(){return _l.DocumentDiagnosticReportKind},"get")});Object.defineProperty(p,"DocumentDiagnosticRequest",{enumerable:!0,get:s(function(){return _l.DocumentDiagnosticRequest},"get")});Object.defineProperty(p,"WorkspaceDiagnosticRequest",{enumerable:!0,get:s(function(){return _l.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(p,"DiagnosticRefreshRequest",{enumerable:!0,get:s(function(){return _l.DiagnosticRefreshRequest},"get")});var Qr=jA();Object.defineProperty(p,"NotebookCellKind",{enumerable:!0,get:s(function(){return Qr.NotebookCellKind},"get")});Object.defineProperty(p,"ExecutionSummary",{enumerable:!0,get:s(function(){return Qr.ExecutionSummary},"get")});Object.defineProperty(p,"NotebookCell",{enumerable:!0,get:s(function(){return Qr.NotebookCell},"get")});Object.defineProperty(p,"NotebookDocument",{enumerable:!0,get:s(function(){return Qr.NotebookDocument},"get")});Object.defineProperty(p,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:s(function(){return Qr.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(p,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:s(function(){return Qr.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(p,"NotebookCellArrayChange",{enumerable:!0,get:s(function(){return Qr.NotebookCellArrayChange},"get")});Object.defineProperty(p,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:s(function(){return Qr.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(p,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:s(function(){return Qr.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(p,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:s(function(){return Qr.DidCloseNotebookDocumentNotification},"get")});var gM=zA();Object.defineProperty(p,"InlineCompletionRequest",{enumerable:!0,get:s(function(){return gM.InlineCompletionRequest},"get")});var ag;(function(t){function e(r){let n=r;return gt.string(n)||gt.string(n.language)||gt.string(n.scheme)||gt.string(n.pattern)}s(e,"is"),t.is=e})(ag||(p.TextDocumentFilter=ag={}));var lg;(function(t){function e(r){let n=r;return gt.objectLiteral(n)&&(gt.string(n.notebookType)||gt.string(n.scheme)||gt.string(n.pattern))}s(e,"is"),t.is=e})(lg||(p.NotebookDocumentFilter=lg={}));var ug;(function(t){function e(r){let n=r;return gt.objectLiteral(n)&&(gt.string(n.notebook)||lg.is(n.notebook))&&(n.language===void 0||gt.string(n.language))}s(e,"is"),t.is=e})(ug||(p.NotebookCellTextDocumentFilter=ug={}));var cg;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!gt.string(n)&&!ag.is(n)&&!ug.is(n))return!1;return!0}s(e,"is"),t.is=e})(cg||(p.DocumentSelector=cg={}));var KA;(function(t){t.method="client/registerCapability",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolRequestType(t.method)})(KA||(p.RegistrationRequest=KA={}));var VA;(function(t){t.method="client/unregisterCapability",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolRequestType(t.method)})(VA||(p.UnregistrationRequest=VA={}));var HA;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(HA||(p.ResourceOperationKind=HA={}));var YA;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(YA||(p.FailureHandlingKind=YA={}));var XA;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(XA||(p.PositionEncodingKind=XA={}));var JA;(function(t){function e(r){let n=r;return n&>.string(n.id)&&n.id.length>0}s(e,"hasId"),t.hasId=e})(JA||(p.StaticRegistrationOptions=JA={}));var ZA;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||cg.is(n.documentSelector))}s(e,"is"),t.is=e})(ZA||(p.TextDocumentRegistrationOptions=ZA={}));var QA;(function(t){function e(n){let i=n;return gt.objectLiteral(i)&&(i.workDoneProgress===void 0||gt.boolean(i.workDoneProgress))}s(e,"is"),t.is=e;function r(n){let i=n;return i&>.boolean(i.workDoneProgress)}s(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(QA||(p.WorkDoneProgressOptions=QA={}));var eS;(function(t){t.method="initialize",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(eS||(p.InitializeRequest=eS={}));var tS;(function(t){t.unknownProtocolVersion=1})(tS||(p.InitializeErrorCodes=tS={}));var rS;(function(t){t.method="initialized",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType(t.method)})(rS||(p.InitializedNotification=rS={}));var nS;(function(t){t.method="shutdown",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType0(t.method)})(nS||(p.ShutdownRequest=nS={}));var iS;(function(t){t.method="exit",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType0(t.method)})(iS||(p.ExitNotification=iS={}));var sS;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType(t.method)})(sS||(p.DidChangeConfigurationNotification=sS={}));var oS;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(oS||(p.MessageType=oS={}));var aS;(function(t){t.method="window/showMessage",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolNotificationType(t.method)})(aS||(p.ShowMessageNotification=aS={}));var lS;(function(t){t.method="window/showMessageRequest",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolRequestType(t.method)})(lS||(p.ShowMessageRequest=lS={}));var uS;(function(t){t.method="window/logMessage",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolNotificationType(t.method)})(uS||(p.LogMessageNotification=uS={}));var cS;(function(t){t.method="telemetry/event",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolNotificationType(t.method)})(cS||(p.TelemetryEventNotification=cS={}));var fS;(function(t){t.None=0,t.Full=1,t.Incremental=2})(fS||(p.TextDocumentSyncKind=fS={}));var pS;(function(t){t.method="textDocument/didOpen",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType(t.method)})(pS||(p.DidOpenTextDocumentNotification=pS={}));var dS;(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")}s(e,"isIncremental"),t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}s(r,"isFull"),t.isFull=r})(dS||(p.TextDocumentContentChangeEvent=dS={}));var mS;(function(t){t.method="textDocument/didChange",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType(t.method)})(mS||(p.DidChangeTextDocumentNotification=mS={}));var hS;(function(t){t.method="textDocument/didClose",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType(t.method)})(hS||(p.DidCloseTextDocumentNotification=hS={}));var gS;(function(t){t.method="textDocument/didSave",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType(t.method)})(gS||(p.DidSaveTextDocumentNotification=gS={}));var yS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(yS||(p.TextDocumentSaveReason=yS={}));var xS;(function(t){t.method="textDocument/willSave",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType(t.method)})(xS||(p.WillSaveTextDocumentNotification=xS={}));var TS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(TS||(p.WillSaveTextDocumentWaitUntilRequest=TS={}));var RS;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolNotificationType(t.method)})(RS||(p.DidChangeWatchedFilesNotification=RS={}));var vS;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(vS||(p.FileChangeType=vS={}));var ES;(function(t){function e(r){let n=r;return gt.objectLiteral(n)&&(WA.URI.is(n.baseUri)||WA.WorkspaceFolder.is(n.baseUri))&>.string(n.pattern)}s(e,"is"),t.is=e})(ES||(p.RelativePattern=ES={}));var AS;(function(t){t.Create=1,t.Change=2,t.Delete=4})(AS||(p.WatchKind=AS={}));var SS;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolNotificationType(t.method)})(SS||(p.PublishDiagnosticsNotification=SS={}));var bS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(bS||(p.CompletionTriggerKind=bS={}));var $S;(function(t){t.method="textDocument/completion",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})($S||(p.CompletionRequest=$S={}));var CS;(function(t){t.method="completionItem/resolve",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(CS||(p.CompletionResolveRequest=CS={}));var NS;(function(t){t.method="textDocument/hover",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(NS||(p.HoverRequest=NS={}));var wS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(wS||(p.SignatureHelpTriggerKind=wS={}));var kS;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(kS||(p.SignatureHelpRequest=kS={}));var IS;(function(t){t.method="textDocument/definition",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(IS||(p.DefinitionRequest=IS={}));var _S;(function(t){t.method="textDocument/references",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(_S||(p.ReferencesRequest=_S={}));var PS;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(PS||(p.DocumentHighlightRequest=PS={}));var OS;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(OS||(p.DocumentSymbolRequest=OS={}));var LS;(function(t){t.method="textDocument/codeAction",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(LS||(p.CodeActionRequest=LS={}));var DS;(function(t){t.method="codeAction/resolve",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(DS||(p.CodeActionResolveRequest=DS={}));var MS;(function(t){t.method="workspace/symbol",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(MS||(p.WorkspaceSymbolRequest=MS={}));var FS;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(FS||(p.WorkspaceSymbolResolveRequest=FS={}));var GS;(function(t){t.method="textDocument/codeLens",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(GS||(p.CodeLensRequest=GS={}));var US;(function(t){t.method="codeLens/resolve",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(US||(p.CodeLensResolveRequest=US={}));var jS;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolRequestType0(t.method)})(jS||(p.CodeLensRefreshRequest=jS={}));var qS;(function(t){t.method="textDocument/documentLink",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(qS||(p.DocumentLinkRequest=qS={}));var BS;(function(t){t.method="documentLink/resolve",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(BS||(p.DocumentLinkResolveRequest=BS={}));var zS;(function(t){t.method="textDocument/formatting",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(zS||(p.DocumentFormattingRequest=zS={}));var WS;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(WS||(p.DocumentRangeFormattingRequest=WS={}));var KS;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(KS||(p.DocumentRangesFormattingRequest=KS={}));var VS;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(VS||(p.DocumentOnTypeFormattingRequest=VS={}));var HS;(function(t){t.Identifier=1})(HS||(p.PrepareSupportDefaultBehavior=HS={}));var YS;(function(t){t.method="textDocument/rename",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(YS||(p.RenameRequest=YS={}));var XS;(function(t){t.method="textDocument/prepareRename",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(XS||(p.PrepareRenameRequest=XS={}));var JS;(function(t){t.method="workspace/executeCommand",t.messageDirection=N.MessageDirection.clientToServer,t.type=new N.ProtocolRequestType(t.method)})(JS||(p.ExecuteCommandRequest=JS={}));var ZS;(function(t){t.method="workspace/applyEdit",t.messageDirection=N.MessageDirection.serverToClient,t.type=new N.ProtocolRequestType("workspace/applyEdit")})(ZS||(p.ApplyWorkspaceEditRequest=ZS={}))});var sb=J(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.createProtocolConnection=void 0;var ib=es();function yM(t,e,r,n){return ib.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,ib.createMessageConnection)(t,e,r,n)}s(yM,"createProtocolConnection");Df.createProtocolConnection=yM});var ab=J(Jt=>{"use strict";var xM=Jt&&Jt.__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:s(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Mf=Jt&&Jt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xM(e,t,r)};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.LSPErrorCodes=Jt.createProtocolConnection=void 0;Mf(es(),Jt);Mf((yo(),tp(Kc)),Jt);Mf(Le(),Jt);Mf(nb(),Jt);var TM=sb();Object.defineProperty(Jt,"createProtocolConnection",{enumerable:!0,get:s(function(){return TM.createProtocolConnection},"get")});var ob;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(ob||(Jt.LSPErrorCodes=ob={}))});var ub=J(en=>{"use strict";var RM=en&&en.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lb=en&&en.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RM(e,t,r)};Object.defineProperty(en,"__esModule",{value:!0});en.createProtocolConnection=void 0;var vM=Qh();lb(Qh(),en);lb(ab(),en);function EM(t,e,r,n){return(0,vM.createMessageConnection)(t,e,r,n)}s(EM,"createProtocolConnection");en.createProtocolConnection=EM});var Ke={};Nn(Ke,{AbstractAstReflection:()=>hi,AbstractCstNode:()=>tl,AbstractLangiumParser:()=>rl,AbstractParserErrorMessageProvider:()=>Hc,AbstractThreadedAsyncParser:()=>Ag,AstUtils:()=>Ql,BiMap:()=>Xi,Cancellation:()=>V,CompositeCstNodeImpl:()=>Wi,ContextCache:()=>Ji,CstNodeBuilder:()=>el,CstUtils:()=>Tu,DEFAULT_TOKENIZE_OPTIONS:()=>Ff,DONE_RESULT:()=>Et,DatatypeSymbol:()=>Vc,DefaultAstNodeDescriptionProvider:()=>Rl,DefaultAstNodeLocator:()=>El,DefaultAsyncParser:()=>jl,DefaultCommentProvider:()=>Ul,DefaultConfigurationProvider:()=>Al,DefaultDocumentBuilder:()=>Pl,DefaultDocumentValidator:()=>Tl,DefaultHydrator:()=>Bl,DefaultIndexManager:()=>Ol,DefaultJsonSerializer:()=>gl,DefaultLangiumDocumentFactory:()=>al,DefaultLangiumDocuments:()=>ll,DefaultLangiumProfiler:()=>Ig,DefaultLexer:()=>rs,DefaultLexerErrorMessageProvider:()=>Dl,DefaultLinker:()=>ul,DefaultNameProvider:()=>cl,DefaultReferenceDescriptionProvider:()=>vl,DefaultReferences:()=>fl,DefaultScopeComputation:()=>pl,DefaultScopeProvider:()=>hl,DefaultServiceRegistry:()=>yl,DefaultTokenBuilder:()=>An,DefaultValueConverter:()=>Vi,DefaultWorkspaceLock:()=>ql,DefaultWorkspaceManager:()=>Ll,Deferred:()=>Gt,Disposable:()=>mi,DisposableCache:()=>Co,DocumentCache:()=>nf,DocumentState:()=>te,DocumentValidator:()=>cr,EMPTY_SCOPE:()=>DD,EMPTY_STREAM:()=>kn,EmptyFileSystem:()=>kg,EmptyFileSystemProvider:()=>zf,ErrorWithLocation:()=>ki,GrammarAST:()=>ma,GrammarUtils:()=>bu,IndentationAwareLexer:()=>wg,IndentationAwareTokenBuilder:()=>Bf,JSDocDocumentationProvider:()=>Gl,LangiumCompletionParser:()=>il,LangiumParser:()=>nl,LangiumParserErrorMessageProvider:()=>To,LeafCstNodeImpl:()=>zi,LexingMode:()=>ns,MapScope:()=>Ym,Module:()=>Cg,MultiMap:()=>Ct,MultiMapScope:()=>dl,OperationCancelled:()=>ur,ParserWorker:()=>Sg,ProfilingTask:()=>Wf,Reduction:()=>us,RefResolving:()=>Yi,RegExpUtils:()=>Eu,RootCstNodeImpl:()=>xo,SimpleCache:()=>ml,StreamImpl:()=>Qt,StreamScope:()=>$o,TextDocument:()=>Ao,TreeStreamImpl:()=>Ir,URI:()=>ut,UriTrie:()=>bo,UriUtils:()=>Ze,VALIDATE_EACH_NODE:()=>Fv,ValidationCategory:()=>sf,ValidationRegistry:()=>xl,ValueConverter:()=>Yr,WorkspaceCache:()=>No,assertCondition:()=>Yg,assertUnreachable:()=>Or,createCompletionParser:()=>Gm,createDefaultCoreModule:()=>bg,createDefaultSharedCoreModule:()=>$g,createGrammarConfig:()=>Kp,createLangiumParser:()=>Um,createParser:()=>sl,delayNextTick:()=>Vm,diagnosticData:()=>Zi,eagerLoad:()=>Tb,getDiagnosticRange:()=>Gv,indentationBuilderDefaultOptions:()=>Ng,inject:()=>qf,interruptAndCheck:()=>qe,isAstNode:()=>Fe,isAstNodeDescription:()=>rp,isAstNodeWithComment:()=>Xm,isCompositeCstNode:()=>gr,isIMultiModeLexerDefinition:()=>yg,isJSDoc:()=>vg,isLeafCstNode:()=>wn,isLinkingError:()=>gi,isMultiReference:()=>Zt,isNamed:()=>Dv,isOperationCancelled:()=>Xr,isReference:()=>ot,isRootCstNode:()=>ra,isTokenTypeArray:()=>Gf,isTokenTypeDictionary:()=>gg,loadGrammarFromJson:()=>tn,parseJSDoc:()=>Rg,prepareLangiumParser:()=>$v,setInterruptionPeriod:()=>Iv,startCancelableOperation:()=>tf,stream:()=>re,toDiagnosticData:()=>Uv,toDiagnosticSeverity:()=>of});var Tu={};Nn(Tu,{DefaultNameRegexp:()=>xu,RangeComparison:()=>Pr,compareRange:()=>Wg,findCommentNode:()=>Cp,findDeclarationNodeAtOffset:()=>$$,findLeafNodeAtOffset:()=>Np,findLeafNodeBeforeOffset:()=>Kg,flattenCst:()=>b$,getDatatypeNode:()=>S$,getInteriorNodes:()=>w$,getNextNode:()=>C$,getPreviousNode:()=>Hg,getStartlineNode:()=>N$,inRange:()=>op,isChildNode:()=>$p,isCommentNode:()=>bp,streamCst:()=>Ni,toDocumentSegment:()=>wi,tokenToRange:()=>Rs});function Fe(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}s(Fe,"isAstNode");function ot(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}s(ot,"isReference");function Zt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}s(Zt,"isMultiReference");function rp(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}s(rp,"isAstNodeDescription");function gi(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}s(gi,"isLinkingError");var hi=class{static{s(this,"AbstractAstReflection")}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 Fe(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let o=this.types[e],a=o?o.superTypes.some(l=>this.isSubtype(l,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 o of n)this.isSubtype(o,e)&&i.push(o);return this.allSubtypes[e]=i,i}}};function gr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}s(gr,"isCompositeCstNode");function wn(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}s(wn,"isLeafCstNode");function ra(t){return gr(t)&&typeof t.fullText=="string"}s(ra,"isRootCstNode");var Qt=class t{static{s(this,"StreamImpl")}constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:s(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),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 Et})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=s$(i.value)),o=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,o=n.next();for(;!o.done;){if(i>=r&&o.value===e)return i;o=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?Et:{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 Et})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,o=n.next();for(;!o.done;)i===void 0?i=o.value:i=e(i,o.value),o=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let o=this.recursiveReduce(e,r,n);return o===void 0?i.value:r(o,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}let{done:n,value:i}=this.nextFn(r.this);if(!n){let o=e(i);if(Jl(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return Et})}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:o}=r.nextFn(n.this);if(!i)if(Jl(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return Et})}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({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Et: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 Et})}exclude(e,r){let n=new Set;for(let i of e){let o=r?r(i):i;n.add(o)}return this.filter(i=>{let o=r?r(i):i;return!n.has(o)})}};function s$(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}s(s$,"toString");function Jl(t){return!!t&&typeof t[Symbol.iterator]=="function"}s(Jl,"isIterable");var kn=new Qt(()=>{},()=>Et),Et=Object.freeze({done:!0,value:void 0});function re(...t){if(t.length===1){let e=t[0];if(e instanceof Qt)return e;if(Jl(e))return new Qt(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Qt(()=>({index:0}),r=>r.index1?new Qt(()=>({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({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 Et})}iterator(){let e={state:this.startFn(),next:s(()=>this.nextFn(e.state),"next"),prune:s(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},us;(function(t){function e(o){return o.reduce((a,l)=>a+l,0)}s(e,"sum"),t.sum=e;function r(o){return o.reduce((a,l)=>a*l,0)}s(r,"product"),t.product=r;function n(o){return o.reduce((a,l)=>Math.min(a,l))}s(n,"min"),t.min=n;function i(o){return o.reduce((a,l)=>Math.max(a,l))}s(i,"max"),t.max=i})(us||(us={}));var Ql={};Nn(Ql,{assignMandatoryProperties:()=>sp,copyAstNode:()=>ip,findRootNode:()=>fs,getContainerOfType:()=>sn,getDocument:()=>At,getReferenceNodes:()=>Zl,hasContainerOfType:()=>o$,linkContentToContainer:()=>cs,streamAllContents:()=>yr,streamAst:()=>_t,streamContents:()=>na,streamReferences:()=>In});function cs(t,e={}){for(let[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,o)=>{Fe(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=o,e.deep&&cs(i,e))}):Fe(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&cs(n,e)))}s(cs,"linkContentToContainer");function sn(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}s(sn,"getContainerOfType");function o$(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}s(o$,"hasContainerOfType");function At(t){let r=fs(t).$document;if(!r)throw new Error("AST node has no document.");return r}s(At,"getDocument");function fs(t){for(;t.$container;)t=t.$container;return t}s(fs,"findRootNode");function Zl(t){return ot(t)?t.ref?[t.ref]:[]:Zt(t)?t.items.map(e=>e.ref):[]}s(Zl,"getReferenceNodes");function na(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new Qt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexna(r,e))}s(yr,"streamAllContents");function _t(t,e){if(t){if(e?.range&&!np(t,e.range))return new Ir(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Ir(t,r=>na(r,e),{includeRoot:!0})}s(_t,"streamAst");function np(t,e){if(!e)return!0;let r=t.$cstNode?.range;return r?op(r,e):!1}s(np,"isAstNodeInRange");function In(t){return new Qt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexjt,AbstractParserRule:()=>ia,AbstractRule:()=>ps,AbstractType:()=>er,Action:()=>_n,Alternatives:()=>sa,ArrayLiteral:()=>eu,ArrayType:()=>tu,Assignment:()=>Pn,BooleanLiteral:()=>ru,CharacterRange:()=>On,Condition:()=>Ln,Conjunction:()=>oa,CrossReference:()=>Dn,Disjunction:()=>aa,EndOfFile:()=>nu,Grammar:()=>on,GrammarImport:()=>iu,Group:()=>yi,InferredType:()=>su,InfixRule:()=>_r,InfixRuleOperatorList:()=>la,InfixRuleOperators:()=>ou,Interface:()=>ds,Keyword:()=>ms,LangiumGrammarAstReflection:()=>Ts,LangiumGrammarTerminals:()=>a$,NamedArgument:()=>hs,NegatedToken:()=>xi,Negation:()=>au,NumberLiteral:()=>lu,Parameter:()=>gs,ParameterReference:()=>uu,ParserRule:()=>xr,ReferenceType:()=>ua,RegexToken:()=>Ti,ReturnType:()=>cu,RuleCall:()=>Ri,SimpleType:()=>ys,StringLiteral:()=>fu,TerminalAlternatives:()=>vi,TerminalElement:()=>qt,TerminalGroup:()=>Ei,TerminalRule:()=>an,TerminalRuleCall:()=>Ai,Type:()=>ca,TypeAttribute:()=>Si,TypeDefinition:()=>bi,UnionType:()=>pu,UnorderedGroup:()=>fa,UntilToken:()=>$i,ValueLiteral:()=>Ci,Wildcard:()=>xs,isAbstractElement:()=>pa,isAbstractParserRule:()=>ln,isAbstractRule:()=>l$,isAbstractType:()=>u$,isAction:()=>un,isAlternatives:()=>du,isArrayLiteral:()=>c$,isArrayType:()=>ap,isAssignment:()=>Tr,isBooleanLiteral:()=>lp,isCharacterRange:()=>up,isCondition:()=>f$,isConjunction:()=>cp,isCrossReference:()=>Rr,isDisjunction:()=>fp,isEndOfFile:()=>pp,isGrammar:()=>p$,isGrammarImport:()=>d$,isGroup:()=>Mn,isInferredType:()=>da,isInfixRule:()=>Fn,isInfixRuleOperatorList:()=>m$,isInfixRuleOperators:()=>h$,isInterface:()=>dp,isKeyword:()=>or,isNamedArgument:()=>g$,isNegatedToken:()=>mp,isNegation:()=>hp,isNumberLiteral:()=>y$,isParameter:()=>x$,isParameterReference:()=>gp,isParserRule:()=>ft,isReferenceType:()=>yp,isRegexToken:()=>xp,isReturnType:()=>Tp,isRuleCall:()=>vr,isSimpleType:()=>mu,isStringLiteral:()=>T$,isTerminalAlternatives:()=>Rp,isTerminalElement:()=>R$,isTerminalGroup:()=>vp,isTerminalRule:()=>Pt,isTerminalRuleCall:()=>hu,isType:()=>gu,isTypeAttribute:()=>v$,isTypeDefinition:()=>E$,isUnionType:()=>Ep,isUnorderedGroup:()=>yu,isUntilToken:()=>Ap,isValueLiteral:()=>A$,isWildcard:()=>Sp,reflection:()=>K});var a$={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]*/},jt={$type:"AbstractElement",cardinality:"cardinality"};function pa(t){return K.isInstance(t,jt.$type)}s(pa,"isAbstractElement");var ia={$type:"AbstractParserRule"};function ln(t){return K.isInstance(t,ia.$type)}s(ln,"isAbstractParserRule");var ps={$type:"AbstractRule"};function l$(t){return K.isInstance(t,ps.$type)}s(l$,"isAbstractRule");var er={$type:"AbstractType"};function u$(t){return K.isInstance(t,er.$type)}s(u$,"isAbstractType");var _n={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function un(t){return K.isInstance(t,_n.$type)}s(un,"isAction");var sa={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function du(t){return K.isInstance(t,sa.$type)}s(du,"isAlternatives");var eu={$type:"ArrayLiteral",elements:"elements"};function c$(t){return K.isInstance(t,eu.$type)}s(c$,"isArrayLiteral");var tu={$type:"ArrayType",elementType:"elementType"};function ap(t){return K.isInstance(t,tu.$type)}s(ap,"isArrayType");var Pn={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Tr(t){return K.isInstance(t,Pn.$type)}s(Tr,"isAssignment");var ru={$type:"BooleanLiteral",true:"true"};function lp(t){return K.isInstance(t,ru.$type)}s(lp,"isBooleanLiteral");var On={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function up(t){return K.isInstance(t,On.$type)}s(up,"isCharacterRange");var Ln={$type:"Condition"};function f$(t){return K.isInstance(t,Ln.$type)}s(f$,"isCondition");var oa={$type:"Conjunction",left:"left",right:"right"};function cp(t){return K.isInstance(t,oa.$type)}s(cp,"isConjunction");var Dn={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Rr(t){return K.isInstance(t,Dn.$type)}s(Rr,"isCrossReference");var aa={$type:"Disjunction",left:"left",right:"right"};function fp(t){return K.isInstance(t,aa.$type)}s(fp,"isDisjunction");var nu={$type:"EndOfFile",cardinality:"cardinality"};function pp(t){return K.isInstance(t,nu.$type)}s(pp,"isEndOfFile");var on={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function p$(t){return K.isInstance(t,on.$type)}s(p$,"isGrammar");var iu={$type:"GrammarImport",path:"path"};function d$(t){return K.isInstance(t,iu.$type)}s(d$,"isGrammarImport");var yi={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Mn(t){return K.isInstance(t,yi.$type)}s(Mn,"isGroup");var su={$type:"InferredType",name:"name"};function da(t){return K.isInstance(t,su.$type)}s(da,"isInferredType");var _r={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Fn(t){return K.isInstance(t,_r.$type)}s(Fn,"isInfixRule");var la={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function m$(t){return K.isInstance(t,la.$type)}s(m$,"isInfixRuleOperatorList");var ou={$type:"InfixRuleOperators",precedences:"precedences"};function h$(t){return K.isInstance(t,ou.$type)}s(h$,"isInfixRuleOperators");var ds={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function dp(t){return K.isInstance(t,ds.$type)}s(dp,"isInterface");var ms={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function or(t){return K.isInstance(t,ms.$type)}s(or,"isKeyword");var hs={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function g$(t){return K.isInstance(t,hs.$type)}s(g$,"isNamedArgument");var xi={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function mp(t){return K.isInstance(t,xi.$type)}s(mp,"isNegatedToken");var au={$type:"Negation",value:"value"};function hp(t){return K.isInstance(t,au.$type)}s(hp,"isNegation");var lu={$type:"NumberLiteral",value:"value"};function y$(t){return K.isInstance(t,lu.$type)}s(y$,"isNumberLiteral");var gs={$type:"Parameter",name:"name"};function x$(t){return K.isInstance(t,gs.$type)}s(x$,"isParameter");var uu={$type:"ParameterReference",parameter:"parameter"};function gp(t){return K.isInstance(t,uu.$type)}s(gp,"isParameterReference");var xr={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function ft(t){return K.isInstance(t,xr.$type)}s(ft,"isParserRule");var ua={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function yp(t){return K.isInstance(t,ua.$type)}s(yp,"isReferenceType");var Ti={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function xp(t){return K.isInstance(t,Ti.$type)}s(xp,"isRegexToken");var cu={$type:"ReturnType",name:"name"};function Tp(t){return K.isInstance(t,cu.$type)}s(Tp,"isReturnType");var Ri={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function vr(t){return K.isInstance(t,Ri.$type)}s(vr,"isRuleCall");var ys={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function mu(t){return K.isInstance(t,ys.$type)}s(mu,"isSimpleType");var fu={$type:"StringLiteral",value:"value"};function T$(t){return K.isInstance(t,fu.$type)}s(T$,"isStringLiteral");var vi={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Rp(t){return K.isInstance(t,vi.$type)}s(Rp,"isTerminalAlternatives");var qt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function R$(t){return K.isInstance(t,qt.$type)}s(R$,"isTerminalElement");var Ei={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function vp(t){return K.isInstance(t,Ei.$type)}s(vp,"isTerminalGroup");var an={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Pt(t){return K.isInstance(t,an.$type)}s(Pt,"isTerminalRule");var Ai={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function hu(t){return K.isInstance(t,Ai.$type)}s(hu,"isTerminalRuleCall");var ca={$type:"Type",name:"name",type:"type"};function gu(t){return K.isInstance(t,ca.$type)}s(gu,"isType");var Si={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function v$(t){return K.isInstance(t,Si.$type)}s(v$,"isTypeAttribute");var bi={$type:"TypeDefinition"};function E$(t){return K.isInstance(t,bi.$type)}s(E$,"isTypeDefinition");var pu={$type:"UnionType",types:"types"};function Ep(t){return K.isInstance(t,pu.$type)}s(Ep,"isUnionType");var fa={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function yu(t){return K.isInstance(t,fa.$type)}s(yu,"isUnorderedGroup");var $i={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Ap(t){return K.isInstance(t,$i.$type)}s(Ap,"isUntilToken");var Ci={$type:"ValueLiteral"};function A$(t){return K.isInstance(t,Ci.$type)}s(A$,"isValueLiteral");var xs={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Sp(t){return K.isInstance(t,xs.$type)}s(Sp,"isWildcard");var Ts=class extends hi{static{s(this,"LangiumGrammarAstReflection")}constructor(){super(...arguments),this.types={AbstractElement:{name:jt.$type,properties:{cardinality:{name:jt.cardinality}},superTypes:[]},AbstractParserRule:{name:ia.$type,properties:{},superTypes:[ps.$type,er.$type]},AbstractRule:{name:ps.$type,properties:{},superTypes:[]},AbstractType:{name:er.$type,properties:{},superTypes:[]},Action:{name:_n.$type,properties:{cardinality:{name:_n.cardinality},feature:{name:_n.feature},inferredType:{name:_n.inferredType},operator:{name:_n.operator},type:{name:_n.type,referenceType:er.$type}},superTypes:[jt.$type]},Alternatives:{name:sa.$type,properties:{cardinality:{name:sa.cardinality},elements:{name:sa.elements,defaultValue:[]}},superTypes:[jt.$type]},ArrayLiteral:{name:eu.$type,properties:{elements:{name:eu.elements,defaultValue:[]}},superTypes:[Ci.$type]},ArrayType:{name:tu.$type,properties:{elementType:{name:tu.elementType}},superTypes:[bi.$type]},Assignment:{name:Pn.$type,properties:{cardinality:{name:Pn.cardinality},feature:{name:Pn.feature},operator:{name:Pn.operator},predicate:{name:Pn.predicate},terminal:{name:Pn.terminal}},superTypes:[jt.$type]},BooleanLiteral:{name:ru.$type,properties:{true:{name:ru.true,defaultValue:!1}},superTypes:[Ln.$type,Ci.$type]},CharacterRange:{name:On.$type,properties:{cardinality:{name:On.cardinality},left:{name:On.left},lookahead:{name:On.lookahead},parenthesized:{name:On.parenthesized,defaultValue:!1},right:{name:On.right}},superTypes:[qt.$type]},Condition:{name:Ln.$type,properties:{},superTypes:[]},Conjunction:{name:oa.$type,properties:{left:{name:oa.left},right:{name:oa.right}},superTypes:[Ln.$type]},CrossReference:{name:Dn.$type,properties:{cardinality:{name:Dn.cardinality},deprecatedSyntax:{name:Dn.deprecatedSyntax,defaultValue:!1},isMulti:{name:Dn.isMulti,defaultValue:!1},terminal:{name:Dn.terminal},type:{name:Dn.type,referenceType:er.$type}},superTypes:[jt.$type]},Disjunction:{name:aa.$type,properties:{left:{name:aa.left},right:{name:aa.right}},superTypes:[Ln.$type]},EndOfFile:{name:nu.$type,properties:{cardinality:{name:nu.cardinality}},superTypes:[jt.$type]},Grammar:{name:on.$type,properties:{imports:{name:on.imports,defaultValue:[]},interfaces:{name:on.interfaces,defaultValue:[]},isDeclared:{name:on.isDeclared,defaultValue:!1},name:{name:on.name},rules:{name:on.rules,defaultValue:[]},types:{name:on.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:iu.$type,properties:{path:{name:iu.path}},superTypes:[]},Group:{name:yi.$type,properties:{cardinality:{name:yi.cardinality},elements:{name:yi.elements,defaultValue:[]},guardCondition:{name:yi.guardCondition},predicate:{name:yi.predicate}},superTypes:[jt.$type]},InferredType:{name:su.$type,properties:{name:{name:su.name}},superTypes:[er.$type]},InfixRule:{name:_r.$type,properties:{call:{name:_r.call},dataType:{name:_r.dataType},inferredType:{name:_r.inferredType},name:{name:_r.name},operators:{name:_r.operators},parameters:{name:_r.parameters,defaultValue:[]},returnType:{name:_r.returnType,referenceType:er.$type}},superTypes:[ia.$type]},InfixRuleOperatorList:{name:la.$type,properties:{associativity:{name:la.associativity},operators:{name:la.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:ou.$type,properties:{precedences:{name:ou.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:ds.$type,properties:{attributes:{name:ds.attributes,defaultValue:[]},name:{name:ds.name},superTypes:{name:ds.superTypes,defaultValue:[],referenceType:er.$type}},superTypes:[er.$type]},Keyword:{name:ms.$type,properties:{cardinality:{name:ms.cardinality},predicate:{name:ms.predicate},value:{name:ms.value}},superTypes:[jt.$type]},NamedArgument:{name:hs.$type,properties:{calledByName:{name:hs.calledByName,defaultValue:!1},parameter:{name:hs.parameter,referenceType:gs.$type},value:{name:hs.value}},superTypes:[]},NegatedToken:{name:xi.$type,properties:{cardinality:{name:xi.cardinality},lookahead:{name:xi.lookahead},parenthesized:{name:xi.parenthesized,defaultValue:!1},terminal:{name:xi.terminal}},superTypes:[qt.$type]},Negation:{name:au.$type,properties:{value:{name:au.value}},superTypes:[Ln.$type]},NumberLiteral:{name:lu.$type,properties:{value:{name:lu.value}},superTypes:[Ci.$type]},Parameter:{name:gs.$type,properties:{name:{name:gs.name}},superTypes:[]},ParameterReference:{name:uu.$type,properties:{parameter:{name:uu.parameter,referenceType:gs.$type}},superTypes:[Ln.$type]},ParserRule:{name:xr.$type,properties:{dataType:{name:xr.dataType},definition:{name:xr.definition},entry:{name:xr.entry,defaultValue:!1},fragment:{name:xr.fragment,defaultValue:!1},inferredType:{name:xr.inferredType},name:{name:xr.name},parameters:{name:xr.parameters,defaultValue:[]},returnType:{name:xr.returnType,referenceType:er.$type}},superTypes:[ia.$type]},ReferenceType:{name:ua.$type,properties:{isMulti:{name:ua.isMulti,defaultValue:!1},referenceType:{name:ua.referenceType}},superTypes:[bi.$type]},RegexToken:{name:Ti.$type,properties:{cardinality:{name:Ti.cardinality},lookahead:{name:Ti.lookahead},parenthesized:{name:Ti.parenthesized,defaultValue:!1},regex:{name:Ti.regex}},superTypes:[qt.$type]},ReturnType:{name:cu.$type,properties:{name:{name:cu.name}},superTypes:[]},RuleCall:{name:Ri.$type,properties:{arguments:{name:Ri.arguments,defaultValue:[]},cardinality:{name:Ri.cardinality},predicate:{name:Ri.predicate},rule:{name:Ri.rule,referenceType:ps.$type}},superTypes:[jt.$type]},SimpleType:{name:ys.$type,properties:{primitiveType:{name:ys.primitiveType},stringType:{name:ys.stringType},typeRef:{name:ys.typeRef,referenceType:er.$type}},superTypes:[bi.$type]},StringLiteral:{name:fu.$type,properties:{value:{name:fu.value}},superTypes:[Ci.$type]},TerminalAlternatives:{name:vi.$type,properties:{cardinality:{name:vi.cardinality},elements:{name:vi.elements,defaultValue:[]},lookahead:{name:vi.lookahead},parenthesized:{name:vi.parenthesized,defaultValue:!1}},superTypes:[qt.$type]},TerminalElement:{name:qt.$type,properties:{cardinality:{name:qt.cardinality},lookahead:{name:qt.lookahead},parenthesized:{name:qt.parenthesized,defaultValue:!1}},superTypes:[jt.$type]},TerminalGroup:{name:Ei.$type,properties:{cardinality:{name:Ei.cardinality},elements:{name:Ei.elements,defaultValue:[]},lookahead:{name:Ei.lookahead},parenthesized:{name:Ei.parenthesized,defaultValue:!1}},superTypes:[qt.$type]},TerminalRule:{name:an.$type,properties:{definition:{name:an.definition},fragment:{name:an.fragment,defaultValue:!1},hidden:{name:an.hidden,defaultValue:!1},name:{name:an.name},type:{name:an.type}},superTypes:[ps.$type]},TerminalRuleCall:{name:Ai.$type,properties:{cardinality:{name:Ai.cardinality},lookahead:{name:Ai.lookahead},parenthesized:{name:Ai.parenthesized,defaultValue:!1},rule:{name:Ai.rule,referenceType:an.$type}},superTypes:[qt.$type]},Type:{name:ca.$type,properties:{name:{name:ca.name},type:{name:ca.type}},superTypes:[er.$type]},TypeAttribute:{name:Si.$type,properties:{defaultValue:{name:Si.defaultValue},isOptional:{name:Si.isOptional,defaultValue:!1},name:{name:Si.name},type:{name:Si.type}},superTypes:[]},TypeDefinition:{name:bi.$type,properties:{},superTypes:[]},UnionType:{name:pu.$type,properties:{types:{name:pu.types,defaultValue:[]}},superTypes:[bi.$type]},UnorderedGroup:{name:fa.$type,properties:{cardinality:{name:fa.cardinality},elements:{name:fa.elements,defaultValue:[]}},superTypes:[jt.$type]},UntilToken:{name:$i.$type,properties:{cardinality:{name:$i.cardinality},lookahead:{name:$i.lookahead},parenthesized:{name:$i.parenthesized,defaultValue:!1},terminal:{name:$i.terminal}},superTypes:[qt.$type]},ValueLiteral:{name:Ci.$type,properties:{},superTypes:[]},Wildcard:{name:xs.$type,properties:{cardinality:{name:xs.cardinality},lookahead:{name:xs.lookahead},parenthesized:{name:xs.parenthesized,defaultValue:!1}},superTypes:[qt.$type]}}}},K=new Ts;function S$(t){let e=t,r=!1;for(;e;){let n=sn(e.grammarSource,ft);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}s(S$,"getDatatypeNode");function Ni(t){return new Ir(t,e=>gr(e)?e.content:[],{includeRoot:!0})}s(Ni,"streamCst");function b$(t){return Ni(t).filter(wn)}s(b$,"flattenCst");function $p(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}s($p,"isChildNode");function Rs(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}s(Rs,"tokenToRange");function wi(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}s(wi,"toDocumentSegment");var Pr;(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"})(Pr||(Pr={}));function Wg(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Pr.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linePr.After}s(op,"inRange");var xu=/^[\w\p{L}]$/u;function $$(t,e,r=xu){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return Np(t,e)}}s($$,"findDeclarationNodeAtOffset");function Cp(t,e){if(t){let r=Hg(t,!0);if(r&&bp(r,e))return r;if(ra(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(bp(o,e))return o}}}}s(Cp,"findCommentNode");function bp(t,e){return wn(t)&&e.includes(t.tokenType.name)}s(bp,"isCommentNode");function Np(t,e){if(wn(t))return t;if(gr(t)){let r=Vg(t,e,!1);if(r)return Np(r,e)}}s(Np,"findLeafNodeAtOffset");function Kg(t,e){if(wn(t))return t;if(gr(t)){let r=Vg(t,e,!0);if(r)return Kg(r,e)}}s(Kg,"findLeafNodeBeforeOffset");function Vg(t,e,r){let n=0,i=t.content.length-1,o;for(;n<=i;){let a=Math.floor((n+i)/2),l=t.content[a];if(l.offset<=e&&l.end>e)return l;l.end<=e?(o=r?l:void 0,n=a+1):i=a-1}return o}s(Vg,"binarySearch");function Hg(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}}s(Hg,"getPreviousNode");function C$(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;nBp,findNameAssignment:()=>Au,findNodeForKeyword:()=>jp,findNodeForProperty:()=>Ra,findNodesForKeyword:()=>L$,findNodesForKeywordInternal:()=>qp,findNodesForProperty:()=>Gp,getActionAtElement:()=>ny,getActionType:()=>sy,getAllReachableRules:()=>Ta,getAllRulesUsedForCrossReferences:()=>O$,getCrossReferenceTerminal:()=>Mp,getEntryRule:()=>Qg,getExplicitRuleType:()=>Su,getHiddenRules:()=>ey,getRuleType:()=>zp,getRuleTypeName:()=>U$,getTypeName:()=>Un,isArrayCardinality:()=>M$,isArrayOperator:()=>F$,isCommentTerminal:()=>Fp,isDataType:()=>G$,isDataTypeRule:()=>va,isOptionalCardinality:()=>D$,terminalRegex:()=>Es});var ki=class extends Error{static{s(this,"ErrorWithLocation")}constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function Or(t,e="Error: Got unexpected value."){throw new Error(e)}s(Or,"assertUnreachable");function Yg(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}s(Yg,"assertCondition");var Eu={};Nn(Eu,{NEWLINE_REGEXP:()=>_p,escapeRegExp:()=>Gn,getTerminalParts:()=>P$,isMultilineComment:()=>Pp,isWhitespace:()=>xa,partialMatches:()=>Op,partialRegExp:()=>Zg,whitespaceCharacters:()=>Jg});function H(t){return t.charCodeAt(0)}s(H,"cc");function Ru(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}s(Ru,"insertToSet");function vs(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}s(vs,"addFlag");function Ii(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}s(Ii,"ASSERT_EXISTS");function ha(){throw Error("Internal Error - Should never get here!")}s(ha,"ASSERT_NEVER_REACH_HERE");function wp(t){return t.type==="Character"}s(wp,"isCharacter");var ga=[];for(let t=H("0");t<=H("9");t++)ga.push(t);var ya=[H("_")].concat(ga);for(let t=H("a");t<=H("z");t++)ya.push(t);for(let t=H("A");t<=H("Z");t++)ya.push(t);var kp=[H(" "),H("\f"),H(` `),H("\r"),H(" "),H("\v"),H(" "),H("\xA0"),H("\u1680"),H("\u2000"),H("\u2001"),H("\u2002"),H("\u2003"),H("\u2004"),H("\u2005"),H("\u2006"),H("\u2007"),H("\u2008"),H("\u2009"),H("\u200A"),H("\u2028"),H("\u2029"),H("\u202F"),H("\u205F"),H("\u3000"),H("\uFEFF")];var I$=/[0-9a-fA-F]/,vu=/[0-9]/,_$=/[1-9]/,_i=class{static{s(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let 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":vs(n,"global");break;case"i":vs(n,"ignoreCase");break;case"m":vs(n,"multiLine");break;case"u":vs(n,"unicode");break;case"y":vs(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}}Ii(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return ha()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Ii(r);break}if(!(e===!0&&r===void 0)&&Ii(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()),Ii(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):ha()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[H(` `),H("\r"),H("\u2028"),H("\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=ga;break;case"D":e=ga,r=!0;break;case"s":e=kp;break;case"S":e=kp,r=!0;break;case"w":e=ya;break;case"W":e=ya,r=!0;break}return Ii(e)?{type:"Set",value:e,complement:r}:ha()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=H("\f");break;case"n":e=H(` `);break;case"r":e=H("\r");break;case"t":e=H(" ");break;case"v":e=H("\v");break}return Ii(e)?{type:"Character",value:e}:ha()}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:H("\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:H(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:H(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(wp(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),a=o.type==="Character";if(wp(o)){if(o.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var Lr=class{static{s(this,"BaseRegExpVisitor")}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 _p=/\r?\n/gm,Xg=new _i,Ip=class extends Lr{static{s(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===` `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=Gn(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)}},Pi=new Ip;function P$(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;let e=Xg.pattern(t),r=[];for(let n of e.value.value)Pi.reset(t),Pi.visit(n),r.push({start:Pi.startRegexp,end:Pi.endRegex});return r}catch{return[]}}s(P$,"getTerminalParts");function Pp(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Pi.reset(t),Pi.visit(Xg.pattern(t)),Pi.multiline}catch{return!1}}s(Pp,"isMultilineComment");var Jg=`\f \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function xa(t){let e=typeof t=="string"?new RegExp(t):t;return Jg.some(r=>e.test(r))}s(xa,"isWhitespace");function Gn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(Gn,"escapeRegExp");function Op(t,e){let r=Zg(t),n=e.match(r);return!!n&&n[0].length>0}s(Op,"partialMatches");function Zg(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let o="",a;function l(c){o+=r.substr(n,c),n+=c}s(l,"appendRaw");function u(c){o+="(?:"+r.substr(n,c)+"|$)",n+=c}for(s(u,"appendOptional");n",n)-n+1);break;default:u(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=n,a=a.exec(r)||[],u(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":l(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=n,a=a.exec(r),a?l(a[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":o+="(?:",n+=3,o+=i()+"|$)";break;case"=":o+="(?=",n+=3,o+=i()+")";break;case"!":a=n,n+=3,i(),o+=r.substr(a,n-a);break;case"<":switch(r[n+3]){case"=":case"!":a=n,n+=4,i(),o+=r.substr(a,n-a);break;default:l(r.indexOf(">",n)-n+1),o+=i()+"|$)";break}break}else l(1),o+=i()+"|$)";break;case")":return++n,o;default:u(1);break}return o}return s(i,"process"),new RegExp(i(),t.flags)}s(Zg,"partialRegExp");function Qg(t){return t.rules.find(e=>ft(e)&&e.entry)}s(Qg,"getEntryRule");function ey(t){return t.rules.filter(e=>Pt(e)&&e.hidden)}s(ey,"getHiddenRules");function Ta(t,e){let r=new Set,n=Qg(t);if(!n)return new Set(t.rules);let i=[n].concat(ey(t));for(let a of i)ty(a,r,e);let o=new Set;for(let a of t.rules)(r.has(a.name)||Pt(a)&&a.hidden)&&o.add(a);return o}s(Ta,"getAllReachableRules");function ty(t,e,r){e.add(t.name),yr(t).forEach(n=>{if(vr(n)||r&&hu(n)){let i=n.rule.ref;i&&!e.has(i.name)&&ty(i,e,r)}})}s(ty,"ruleDfs");function O$(t){let e=new Set;return yr(t).forEach(r=>{Rr(r)&&(ft(r.type.ref)&&e.add(r.type.ref),da(r.type.ref)&&ft(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}s(O$,"getAllRulesUsedForCrossReferences");function Mp(t){if(t.terminal)return t.terminal;if(t.type.ref)return Au(t.type.ref)?.terminal}s(Mp,"getCrossReferenceTerminal");function Fp(t){return t.hidden&&!xa(Es(t))}s(Fp,"isCommentTerminal");function Gp(t,e){return!t||!e?[]:Up(t,e,t.astNode,!0)}s(Gp,"findNodesForProperty");function Ra(t,e,r){if(!t||!e)return;let n=Up(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]}s(Ra,"findNodeForProperty");function Up(t,e,r,n){if(!n){let i=sn(t.grammarSource,Tr);if(i&&i.feature===e)return[t]}return gr(t)&&t.astNode===r?t.content.flatMap(i=>Up(i,e,r,!1)):[]}s(Up,"findNodesForPropertyInternal");function L$(t,e){return t?qp(t,e,t?.astNode):[]}s(L$,"findNodesForKeyword");function jp(t,e,r){if(!t)return;let n=qp(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]}s(jp,"findNodeForKeyword");function qp(t,e,r){if(t.astNode!==r)return[];if(or(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=Ni(t).iterator(),i,o=[];do if(i=n.next(),!i.done){let a=i.value;a.astNode===r?or(a.grammarSource)&&a.grammarSource.value===e&&o.push(a):n.prune()}while(!i.done);return o}s(qp,"findNodesForKeywordInternal");function Bp(t){let e=t.astNode;for(;e===t.container?.astNode;){let r=sn(t.grammarSource,Tr);if(r)return r;t=t.container}}s(Bp,"findAssignment");function Au(t){let e=t;return da(e)&&(un(e.$container)?e=e.$container.$container:ln(e.$container)?e=e.$container:Or(e.$container)),ry(t,e,new Map)}s(Au,"findNameAssignment");function ry(t,e,r){function n(i,o){let a;return sn(i,Tr)||(a=ry(o,o,r)),r.set(t,a),a}if(s(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(let i of yr(e)){if(Tr(i)&&i.feature.toLowerCase()==="name")return r.set(t,i),i;if(vr(i)&&ft(i.rule.ref))return n(i,i.rule.ref);if(mu(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}s(ry,"findNameAssignmentInternal");function ny(t){let e=t.$container;if(Mn(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(un(o))return o;{let a=yr(r[i]).find(un);if(a)return a}}}if(pa(e))return ny(e)}s(ny,"getActionAtElement");function D$(t,e){return t==="?"||t==="*"||Mn(e)&&!!e.guardCondition}s(D$,"isOptionalCardinality");function M$(t){return t==="*"||t==="+"}s(M$,"isArrayCardinality");function F$(t){return t==="+="}s(F$,"isArrayOperator");function va(t){return iy(t,new Set)}s(va,"isDataTypeRule");function iy(t,e){if(e.has(t))return!0;e.add(t);for(let r of yr(t))if(vr(r)){if(!r.rule.ref||ft(r.rule.ref)&&!iy(r.rule.ref,e)||Fn(r.rule.ref))return!1}else{if(Tr(r))return!1;if(un(r))return!1}return!!t.definition}s(iy,"isDataTypeRuleInternal");function G$(t){return Dp(t.type,new Set)}s(G$,"isDataType");function Dp(t,e){if(e.has(t))return!0;if(e.add(t),ap(t))return!1;if(yp(t))return!1;if(Ep(t))return t.types.every(r=>Dp(r,e));if(mu(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 gu(r)?Dp(r.type,e):!1}else return!1}else return!1}s(Dp,"isDataTypeInternal");function Su(t){if(!Pt(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}}}s(Su,"getExplicitRuleType");function Un(t){if(ln(t))return ft(t)&&va(t)?t.name:Su(t)??t.name;if(dp(t)||gu(t)||Tp(t))return t.name;if(un(t)){let e=sy(t);if(e)return e}else if(da(t))return t.name;throw new Error("Cannot get name of Unknown Type")}s(Un,"getTypeName");function sy(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return Un(t.type.ref)}s(sy,"getActionType");function U$(t){return Pt(t)?t.type?.name??"string":ft(t)&&va(t)?t.name:Su(t)??t.name}s(U$,"getRuleTypeName");function zp(t){return Pt(t)?t.type?.name??"string":Su(t)??t.name}s(zp,"getRuleType");function Es(t){let e={s:!1,i:!1,u:!1},r=As(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}s(Es,"terminalRegex");var Wp=/[\s\S]/.source;function As(t,e){if(Rp(t))return j$(t);if(vp(t))return q$(t);if(up(t))return W$(t);if(hu(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return cn(As(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(mp(t))return z$(t);if(Ap(t))return B$(t);if(xp(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")),cn(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(Sp(t))return cn(Wp,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}s(As,"abstractElementToRegex");function j$(t){return cn(t.elements.map(e=>As(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}s(j$,"terminalAlternativesToRegex");function q$(t){return cn(t.elements.map(e=>As(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}s(q$,"terminalGroupToRegex");function B$(t){return cn(`${Wp}*?${As(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}s(B$,"untilTokenToRegex");function z$(t){return cn(`(?!${As(t.terminal)})${Wp}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}s(z$,"negateTokenToRegex");function W$(t){return t.right?cn(`[${Lp(t.left)}-${Lp(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):cn(Lp(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}s(W$,"characterRangeToRegex");function Lp(t){return Gn(t.value)}s(Lp,"keywordToRegex");function cn(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}s(cn,"withCardinality");function Kp(t){let e=[],r=t.Grammar;for(let n of r.rules)Pt(n)&&Fp(n)&&Pp(Es(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:xu}}s(Kp,"createGrammarConfig");var K$=typeof global=="object"&&global&&global.Object===Object&&global,$u=K$;var V$=typeof self=="object"&&self&&self.Object===Object&&self,H$=$u||V$||Function("return this")(),et=H$;var Y$=et.Symbol,pt=Y$;var oy=Object.prototype,X$=oy.hasOwnProperty,J$=oy.toString,Ea=pt?pt.toStringTag:void 0;function Z$(t){var e=X$.call(t,Ea),r=t[Ea];try{t[Ea]=void 0;var n=!0}catch{}var i=J$.call(t);return n&&(e?t[Ea]=r:delete t[Ea]),i}s(Z$,"getRawTag");var ay=Z$;var Q$=Object.prototype,eC=Q$.toString;function tC(t){return eC.call(t)}s(tC,"objectToString");var ly=tC;var rC="[object Null]",nC="[object Undefined]",uy=pt?pt.toStringTag:void 0;function iC(t){return t==null?t===void 0?nC:rC:uy&&uy in Object(t)?ay(t):ly(t)}s(iC,"baseGetTag");var Ot=iC;function sC(t){return t!=null&&typeof t=="object"}s(sC,"isObjectLike");var Ye=sC;var oC="[object Symbol]";function aC(t){return typeof t=="symbol"||Ye(t)&&Ot(t)==oC}s(aC,"isSymbol");var Dr=aC;function lC(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=XC)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}s(QC,"shortOut");var Ny=QC;function eN(t){return function(){return t}}s(eN,"constant");var wy=eN;var tN=(function(){try{var t=zt(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Ss=tN;var rN=Ss?function(t,e){return Ss(t,"toString",{configurable:!0,enumerable:!1,value:wy(e),writable:!0})}:Bt,ky=rN;var nN=Ny(ky),Iy=nN;function iN(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}s(uN,"arrayIncludes");var Iu=uN;var cN=9007199254740991,fN=/^(?:0|[1-9]\d*)$/;function pN(t,e){var r=typeof t;return e=e??cN,!!e&&(r=="number"||r!="symbol"&&fN.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=vN}s(EN,"isLength");var Ns=EN;function AN(t){return t!=null&&Ns(t.length)&&!Lt(t)}s(AN,"isArrayLike");var tt=AN;function SN(t,e,r){if(!Ge(r))return!1;var n=typeof e;return(n=="number"?tt(r)&&jn(e,r.length):n=="string"&&e in r)?Gr(r[e],t):!1}s(SN,"isIterateeCall");var Bn=SN;function bN(t){return Cs(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&Bn(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++n-1}s(Jw,"listCacheHas");var nx=Jw;function Zw(t,e){var r=this.__data__,n=Kn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}s(Zw,"listCacheSet");var ix=Zw;function _s(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(l)?e>1?xx(l,e-1,r,n,i):Ls(i,l):n||(i[i.length]=l)}return i}s(xx,"baseFlatten");var Ds=xx;function vk(t){var e=t==null?0:t.length;return e?Ds(t,1):[]}s(vk,"flatten");var Xe=vk;var Ek=Pu(Object.getPrototypeOf,Object),Lu=Ek;function Ak(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++nl))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var d=-1,h=!0,g=r&R_?new qs:void 0;for(o.set(t,e),o.set(e,t);++d2?e[2]:void 0;for(i&&Bn(e[0],e[1],i)&&(n=1);++r=RP&&(o=Bs,a=!1,e=new qs(e));e:for(;++i-1?i[o?e[a]:a]:void 0}}s(PP,"createFind");var MT=PP;var OP=Math.max;function LP(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Fr(r);return i<0&&(i=OP(n+i,0)),ku(t,We(e,3),i)}s(LP,"findIndex");var FT=LP;var DP=MT(FT),Wr=DP;function MP(t){return t&&t.length?t[0]:void 0}s(MP,"head");var mt=MP;function FP(t,e){var r=-1,n=tt(t)?Array(t.length):[];return Wt(t,function(i,o,a){n[++r]=e(i,o,a)}),n}s(FP,"baseMap");var GT=FP;function GP(t,e){var r=q(t)?Mr:GT;return r(t,We(e,3))}s(GP,"map");var _=GP;function UP(t,e){return Ds(_(t,e),1)}s(UP,"flatMap");var Tt=UP;var jP=Object.prototype,qP=jP.hasOwnProperty,BP=IT(function(t,e,r){qP.call(t,r)?t[r].push(e):$s(t,r,[e])}),Qp=BP;var zP=Object.prototype,WP=zP.hasOwnProperty;function KP(t,e){return t!=null&&WP.call(t,e)}s(KP,"baseHas");var UT=KP;function VP(t,e){return t!=null&&Ju(t,e,UT)}s(VP,"has");var U=VP;var HP="[object String]";function YP(t){return typeof t=="string"||!q(t)&&Ye(t)&&Ot(t)==HP}s(YP,"isString");var at=YP;function XP(t,e){return Mr(e,function(r){return t[r]})}s(XP,"baseValues");var jT=XP;function JP(t){return t==null?[]:jT(t,Re(t))}s(JP,"values");var he=JP;var ZP=Math.max;function QP(t,e,r,n){t=tt(t)?t:he(t),r=r&&!n?Fr(r):0;var i=t.length;return r<0&&(r=ZP(i+r,0)),at(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&bs(t,e,r)>-1}s(QP,"includes");var Ie=QP;var eO=Math.max;function tO(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Fr(r);return i<0&&(i=eO(n+i,0)),bs(t,e,i)}s(tO,"indexOf");var ec=tO;var rO="[object Map]",nO="[object Set]",iO=Object.prototype,sO=iO.hasOwnProperty;function oO(t){if(t==null)return!0;if(tt(t)&&(q(t)||typeof t=="string"||typeof t.splice=="function"||pn(t)||ws(t)||zn(t)))return!t.length;var e=Er(t);if(e==rO||e==nO)return!t.size;if(jr(t))return!Ou(t).length;for(var r in t)if(sO.call(t,r))return!1;return!0}s(oO,"isEmpty");var ee=oO;var aO="[object RegExp]";function lO(t){return Ye(t)&&Ot(t)==aO}s(lO,"baseIsRegExp");var qT=lO;var BT=ar&&ar.isRegExp,uO=BT?qr(BT):qT,lr=uO;function cO(t){return t===void 0}s(cO,"isUndefined");var bt=cO;function fO(t,e){return t=$O){var c=e?null:ZT(t);if(c)return zs(c);a=!1,i=Bs,u=new qs}else u=e?[]:l;e:for(;++n{r.accept(e)})}},pe=class extends tr{static{s(this,"NonTerminal")}constructor(e){super([]),this.idx=1,xt(this,Kt(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Dt=class extends tr{static{s(this,"Rule")}constructor(e){super(e.definition),this.orgText="",xt(this,Kt(e,r=>r!==void 0))}},Ae=class extends tr{static{s(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,xt(this,Kt(e,r=>r!==void 0))}},de=class extends tr{static{s(this,"Option")}constructor(e){super(e.definition),this.idx=1,xt(this,Kt(e,r=>r!==void 0))}},Se=class extends tr{static{s(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,xt(this,Kt(e,r=>r!==void 0))}},be=class extends tr{static{s(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,xt(this,Kt(e,r=>r!==void 0))}},se=class extends tr{static{s(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,xt(this,Kt(e,r=>r!==void 0))}},xe=class extends tr{static{s(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,xt(this,Kt(e,r=>r!==void 0))}},Te=class extends tr{static{s(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,xt(this,Kt(e,r=>r!==void 0))}},ne=class{static{s(this,"Terminal")}constructor(e){this.idx=1,xt(this,Kt(e,r=>r!==void 0))}accept(e){e.visit(this)}};function rc(t){return _(t,Hs)}s(rc,"serializeGrammar");function Hs(t){function e(r){return _(r,Hs)}if(s(e,"convertDefinition"),t instanceof pe){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return at(t.label)&&(r.label=t.label),r}else{if(t instanceof Ae)return{type:"Alternative",definition:e(t.definition)};if(t instanceof de)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Se)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof be)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Hs(new ne({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof xe)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Hs(new ne({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof se)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Te)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ne){let r={type:"Terminal",name:t.terminalType.name,label:kO(t.terminalType),idx:t.idx};at(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=lr(n)?n.source:n),r}else{if(t instanceof Dt)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}s(Hs,"serializeProduction");var Mt=class{static{s(this,"GAstVisitor")}visit(e){let r=e;switch(r.constructor){case pe:return this.visitNonTerminal(r);case Ae:return this.visitAlternative(r);case de:return this.visitOption(r);case Se:return this.visitRepetitionMandatory(r);case be:return this.visitRepetitionMandatoryWithSeparator(r);case xe:return this.visitRepetitionWithSeparator(r);case se:return this.visitRepetition(r);case Te:return this.visitAlternation(r);case ne:return this.visitTerminal(r);case Dt: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 ed(t){return t instanceof Ae||t instanceof de||t instanceof se||t instanceof Se||t instanceof be||t instanceof xe||t instanceof ne||t instanceof Dt}s(ed,"isSequenceProd");function Di(t,e=[]){return t instanceof de||t instanceof se||t instanceof xe?!0:t instanceof Te?ba(t.definition,n=>Di(n,e)):t instanceof pe&&Ie(e,t)?!1:t instanceof tr?(t instanceof pe&&e.push(t),St(t.definition,n=>Di(n,e))):!1}s(Di,"isOptionalProd");function td(t){return t instanceof Te}s(td,"isBranchingProd");function Vt(t){if(t instanceof pe)return"SUBRULE";if(t instanceof de)return"OPTION";if(t instanceof Te)return"OR";if(t instanceof Se)return"AT_LEAST_ONE";if(t instanceof be)return"AT_LEAST_ONE_SEP";if(t instanceof xe)return"MANY_SEP";if(t instanceof se)return"MANY";if(t instanceof ne)return"CONSUME";throw Error("non exhaustive match")}s(Vt,"getProductionDslName");var hn=class{static{s(this,"RestWalker")}walk(e,r=[]){F(e.definition,(n,i)=>{let o=Je(e.definition,i+1);if(n instanceof pe)this.walkProdRef(n,o,r);else if(n instanceof ne)this.walkTerminal(n,o,r);else if(n instanceof Ae)this.walkFlat(n,o,r);else if(n instanceof de)this.walkOption(n,o,r);else if(n instanceof Se)this.walkAtLeastOne(n,o,r);else if(n instanceof be)this.walkAtLeastOneSep(n,o,r);else if(n instanceof xe)this.walkManySep(n,o,r);else if(n instanceof se)this.walkMany(n,o,r);else if(n instanceof Te)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new de({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=eR(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=eR(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);F(e.definition,o=>{let a=new Ae({definition:[o]});this.walk(a,i)})}};function eR(t,e,r){return[new de({definition:[new ne({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}s(eR,"restForRepetitionWithSeparator");function Mi(t){if(t instanceof pe)return Mi(t.referencedRule);if(t instanceof ne)return OO(t);if(ed(t))return _O(t);if(td(t))return PO(t);throw Error("non exhaustive match")}s(Mi,"first");function _O(t){let e=[],r=t.definition,n=0,i=r.length>n,o,a=!0;for(;i&&a;)o=r[n],a=Di(o),e=e.concat(Mi(o)),n=n+1,i=r.length>n;return Ks(e)}s(_O,"firstForSequence");function PO(t){let e=_(t.definition,r=>Mi(r));return Ks(Xe(e))}s(PO,"firstForBranching");function OO(t){return[t.terminalType]}s(OO,"firstForTerminal");var nc="_~IN~_";var rd=class extends hn{static{s(this,"ResyncFollowsWalker")}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=LO(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),a=new Ae({definition:o}),l=Mi(a);this.follows[i]=l}};function tR(t){let e={};return F(t,r=>{let n=new rd(r).startWalking();xt(e,n)}),e}s(tR,"computeAllProdsFollows");function LO(t,e){return t.name+e+nc}s(LO,"buildBetweenProdsFollowPrefix");var ic={},DO=new _i;function Ys(t){let e=t.toString();if(ic.hasOwnProperty(e))return ic[e];{let r=DO.pattern(e);return ic[e]=r,r}}s(Ys,"getRegExpAst");function rR(){ic={}}s(rR,"clearRegExpParserCache");var iR="Complement Sets are not supported for first char optimization",wa=`Unable to use "first char" lexer optimizations: `;function sR(t,e=!1){try{let r=Ys(t);return nd(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===iR)e&&$a(`${wa} 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.`),Vs(`${wa} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}s(sR,"getOptimizedStartCodesIndices");function nd(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof u=="number")sc(u,e,r);else{let c=u;if(r===!0)for(let f=c.from;f<=c.to;f++)sc(f,e,r);else{for(let f=c.from;f<=c.to&&f=Xs){let f=c.from>=Xs?c.from:Xs,d=c.to,h=Kr(f),g=Kr(d);for(let b=h;b<=g;b++)e[b]=b}}}});break;case"Group":nd(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}let l=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&id(a)===!1||a.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return he(e)}s(nd,"firstCharOptimizedIndices");function sc(t,e,r){let n=Kr(t);e[n]=n,r===!0&&MO(t,e)}s(sc,"addOptimizedIdxToResult");function MO(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Kr(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=Kr(i.charCodeAt(0));e[o]=o}}}s(MO,"handleIgnoreCase");function nR(t,e){return Wr(t.value,r=>{if(typeof r=="number")return Ie(e,r);{let n=r;return Wr(e,i=>n.from<=i&&i<=n.to)!==void 0}})}s(nR,"findCode");function id(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?q(t.value)?St(t.value,id):id(t.value):!1}s(id,"isWholeOptional");var sd=class extends Lr{static{s(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){Ie(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?nR(e,this.targetCharCodes)===void 0&&(this.found=!0):nR(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function oc(t,e){if(e instanceof RegExp){let r=Ys(e),n=new sd(t);return n.visit(r),n.found}else return Wr(e,r=>Ie(t,r.charCodeAt(0)))!==void 0}s(oc,"canMatchCharCode");var Fi="PATTERN",Js="defaultMode",ac="modes",ad=typeof new RegExp("(?:)").sticky=="boolean";function lR(t,e){e=Ws(e,{useSticky:ad,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` `],tracer:s((k,E)=>E(),"tracer")});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{rL()});let n;r("Reject Lexer.NA",()=>{n=ei(t,k=>k[Fi]===Pe.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=_(n,k=>{let E=k[Fi];if(lr(E)){let W=E.source;return W.length===1&&W!=="^"&&W!=="$"&&W!=="."&&!E.ignoreCase?W:W.length===2&&W[0]==="\\"&&!Ie(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],W[1])?W[1]:e.useSticky?aR(E):oR(E)}else{if(Lt(E))return i=!0,{exec:E};if(typeof E=="object")return i=!0,E;if(typeof E=="string"){if(E.length===1)return E;{let W=E.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),G=new RegExp(W);return e.useSticky?aR(G):oR(G)}}else throw Error("non exhaustive match")}})});let a,l,u,c,f;r("misc mapping",()=>{a=_(n,k=>k.tokenTypeIdx),l=_(n,k=>{let E=k.GROUP;if(E!==Pe.SKIPPED){if(at(E))return E;if(bt(E))return!1;throw Error("non exhaustive match")}}),u=_(n,k=>{let E=k.LONGER_ALT;if(E)return q(E)?_(E,G=>ec(n,G)):[ec(n,E)]}),c=_(n,k=>k.PUSH_MODE),f=_(n,k=>U(k,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{let k=gR(e.lineTerminatorCharacters);d=_(n,E=>!1),e.positionTracking!=="onlyOffset"&&(d=_(n,E=>U(E,"LINE_BREAKS")?!!E.LINE_BREAKS:hR(E,k)===!1&&oc(k,E.PATTERN)))});let h,g,b,$;r("Misc Mapping #2",()=>{h=_(n,dR),g=_(o,eL),b=je(n,(k,E)=>{let W=E.GROUP;return at(W)&&W!==Pe.SKIPPED&&(k[W]=[]),k},{}),$=_(o,(k,E)=>({pattern:o[E],longerAlt:u[E],canLineTerminator:d[E],isCustom:h[E],short:g[E],group:l[E],push:c[E],pop:f[E],tokenTypeIdx:a[E],tokenType:n[E]}))});let O=!0,w=[];return e.safeMode||r("First Char Optimization",()=>{w=je(n,(k,E,W)=>{if(typeof E.PATTERN=="string"){let G=E.PATTERN.charCodeAt(0),ge=Kr(G);od(k,ge,$[W])}else if(q(E.START_CHARS_HINT)){let G;F(E.START_CHARS_HINT,ge=>{let Nr=typeof ge=="string"?ge.charCodeAt(0):ge,it=Kr(Nr);G!==it&&(G=it,od(k,it,$[W]))})}else if(lr(E.PATTERN))if(E.PATTERN.unicode)O=!1,e.ensureOptimizations&&Vs(`${wa} Unable to analyze < ${E.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=sR(E.PATTERN,e.ensureOptimizations);ee(G)&&(O=!1),F(G,ge=>{od(k,ge,$[W])})}else e.ensureOptimizations&&Vs(`${wa} TokenType: <${E.name}> is using a custom token pattern without providing parameter. This will disable the lexer's first char optimizations. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),O=!1;return k},[])}),{emptyGroups:b,patternIdxToConfig:$,charCodeToPatternIdxToConfig:w,hasCustom:i,canBeOptimized:O}}s(lR,"analyzeTokenTypes");function uR(t,e){let r=[],n=GO(t);r=r.concat(n.errors);let i=UO(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(FO(o)),r=r.concat(HO(o)),r=r.concat(YO(o,e)),r=r.concat(XO(o)),r}s(uR,"validatePatterns");function FO(t){let e=[],r=dt(t,n=>lr(n[Fi]));return e=e.concat(qO(r)),e=e.concat(WO(r)),e=e.concat(KO(r)),e=e.concat(VO(r)),e=e.concat(BO(r)),e}s(FO,"validateRegExpPattern");function GO(t){let e=dt(t,i=>!U(i,Fi)),r=_(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:_e.MISSING_PATTERN,tokenTypes:[i]})),n=Qn(t,e);return{errors:r,valid:n}}s(GO,"findMissingPatterns");function UO(t){let e=dt(t,i=>{let o=i[Fi];return!lr(o)&&!Lt(o)&&!U(o,"exec")&&!at(o)}),r=_(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:_e.INVALID_PATTERN,tokenTypes:[i]})),n=Qn(t,e);return{errors:r,valid:n}}s(UO,"findInvalidPatterns");var jO=/[^\\][$]/;function qO(t){class e extends Lr{static{s(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=dt(t,i=>{let o=i.PATTERN;try{let a=Ys(o),l=new e;return l.visit(a),l.found}catch{return jO.test(o.source)}});return _(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:_e.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}s(qO,"findEndOfInputAnchor");function BO(t){let e=dt(t,n=>n.PATTERN.test(""));return _(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:_e.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}s(BO,"findEmptyMatchRegExps");var zO=/[^\\[][\^]|^\^/;function WO(t){class e extends Lr{static{s(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=dt(t,i=>{let o=i.PATTERN;try{let a=Ys(o),l=new e;return l.visit(a),l.found}catch{return zO.test(o.source)}});return _(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:_e.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}s(WO,"findStartOfInputAnchor");function KO(t){let e=dt(t,n=>{let i=n[Fi];return i instanceof RegExp&&(i.multiline||i.global)});return _(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:_e.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}s(KO,"findUnsupportedFlags");function VO(t){let e=[],r=_(t,o=>je(t,(a,l)=>(o.PATTERN.source===l.PATTERN.source&&!Ie(e,l)&&l.PATTERN!==Pe.NA&&(e.push(l),a.push(l)),a),[]));r=zr(r);let n=dt(r,o=>o.length>1);return _(n,o=>{let a=_(o,u=>u.name);return{message:`The same RegExp pattern ->${mt(o).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:_e.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}s(VO,"findDuplicatePatterns");function HO(t){let e=dt(t,n=>{if(!U(n,"GROUP"))return!1;let i=n.GROUP;return i!==Pe.SKIPPED&&i!==Pe.NA&&!at(i)});return _(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:_e.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}s(HO,"findInvalidGroupType");function YO(t,e){let r=dt(t,i=>i.PUSH_MODE!==void 0&&!Ie(e,i.PUSH_MODE));return _(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:_e.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}s(YO,"findModesThatDoNotExist");function XO(t){let e=[],r=je(t,(n,i,o)=>{let a=i.PATTERN;return a===Pe.NA||(at(a)?n.push({str:a,idx:o,tokenType:i}):lr(a)&&ZO(a)&&n.push({str:a.source,idx:o,tokenType:i})),n},[]);return F(t,(n,i)=>{F(r,({str:o,idx:a,tokenType:l})=>{if(i${l.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:u,type:_e.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),e}s(XO,"findUnreachablePatterns");function JO(t,e){if(lr(e)){if(QO(e))return!1;let r=e.exec(t);return r!==null&&r.index===0}else{if(Lt(e))return e(t,0,[],{});if(U(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}s(JO,"tryToMatchStrToPattern");function ZO(t){return Wr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}s(ZO,"noMetaChar");function QO(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition `,type:_e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),U(t,ac)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+ac+`> property in its definition `,type:_e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),U(t,ac)&&U(t,Js)&&!U(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Js}: <${t.defaultMode}>which does not exist `,type:_e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),U(t,ac)&&F(t.modes,(i,o)=>{F(i,(a,l)=>{if(bt(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${l}> `,type:_e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(U(a,"LONGER_ALT")){let u=q(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];F(u,c=>{!bt(c)&&!Ie(i,c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${a.name}> outside of mode <${o}> `,type:_e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}s(cR,"performRuntimeChecks");function fR(t,e,r){let n=[],i=!1,o=zr(Xe(he(t.modes))),a=ei(o,u=>u[Fi]===Pe.NA),l=gR(r);return e&&F(a,u=>{let c=hR(u,l);if(c!==!1){let d={message:tL(u,c),type:c.issue,tokenType:u};n.push(d)}else U(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):oc(l,u.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:_e.NO_LINE_BREAKS_FLAGS}),n}s(fR,"performWarningRuntimeChecks");function pR(t){let e={},r=Re(t);return F(r,n=>{let i=t[n];if(q(i))e[n]=[];else throw Error("non exhaustive match")}),e}s(pR,"cloneEmptyGroups");function dR(t){let e=t.PATTERN;if(lr(e))return!1;if(Lt(e))return!0;if(U(e,"exec"))return!0;if(at(e))return!1;throw Error("non exhaustive match")}s(dR,"isCustomPattern");function eL(t){return at(t)&&t.length===1?t.charCodeAt(0):!1}s(eL,"isShortPattern");var mR={test:s(function(t){let e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===_e.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the 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")}s(tL,"buildLineBreakIssueMessage");function gR(t){return _(t,r=>at(r)?r.charCodeAt(0):r)}s(gR,"getCharCodes");function od(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}s(od,"addToMapOfArrays");var Xs=256,lc=[];function Kr(t){return t255?255+~~(t/255):t}}s(rL,"initCharCodeToOptimizedIndexMap");function gn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}s(gn,"tokenStructuredMatcher");function Zs(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}s(Zs,"tokenStructuredMatcherNoCategories");var yR=1,TR={};function yn(t){let e=nL(t);iL(e),oL(e),sL(e),F(e,r=>{r.isParent=r.categoryMatches.length>0})}s(yn,"augmentTokenTypes");function nL(t){let e=Ee(t),r=t,n=!0;for(;n;){r=zr(Xe(_(r,o=>o.CATEGORIES)));let i=Qn(r,e);e=e.concat(i),ee(i)?n=!1:r=i}return e}s(nL,"expandCategories");function iL(t){F(t,e=>{ld(e)||(TR[yR]=e,e.tokenTypeIdx=yR++),xR(e)&&!q(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),xR(e)||(e.CATEGORIES=[]),aL(e)||(e.categoryMatches=[]),lL(e)||(e.categoryMatchesMap={})})}s(iL,"assignTokenDefaultProps");function sL(t){F(t,e=>{e.categoryMatches=[],F(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(TR[n].tokenTypeIdx)})})}s(sL,"assignCategoriesTokensProp");function oL(t){F(t,e=>{RR([],e)})}s(oL,"assignCategoriesMapProp");function RR(t,e){F(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),F(e.CATEGORIES,r=>{let n=t.concat(e);Ie(n,r)||RR(n,r)})}s(RR,"singleAssignCategoriesToksMap");function ld(t){return U(t,"tokenTypeIdx")}s(ld,"hasShortKeyProperty");function xR(t){return U(t,"CATEGORIES")}s(xR,"hasCategoriesProperty");function aL(t){return U(t,"categoryMatches")}s(aL,"hasExtendingTokensTypesProperty");function lL(t){return U(t,"categoryMatchesMap")}s(lL,"hasExtendingTokensTypesMapProperty");function vR(t){return U(t,"tokenTypeIdx")}s(vR,"isTokenType");var Qs={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,o){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var _e;(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"})(_e||(_e={}));var ka={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Qs,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ka);var Pe=class{static{s(this,"Lexer")}constructor(e,r=ka){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);let{time:l,value:u}=Ca(o),c=l>10?console.warn:console.log;return this.traceInitIndent time: ${l}ms`),this.traceInitIndent--,u}else return o()},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=xt({},ka,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===ka.lineTerminatorsPattern)this.config.lineTerminatorsPattern=mR;else if(this.config.lineTerminatorCharacters===ka.lineTerminatorCharacters)throw Error(`Error: Missing 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),q(e)?i={modes:{defaultMode:Ee(e)},defaultMode:Js}:(o=!1,i=Ee(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(cR(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(fR(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},F(i.modes,(l,u)=>{i.modes[u]=ei(l,c=>bt(c))});let a=Re(i.modes);if(F(i.modes,(l,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(uR(l,a))}),ee(this.lexerDefinitionErrors)){yn(l);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=lR(l,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=c.charCodeToPatternIdxToConfig,this.emptyGroups=xt({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,!ee(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let u=_(this.lexerDefinitionErrors,c=>c.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: `+u)}F(this.lexerDefinitionWarning,l=>{$a(l.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(ad?(this.chopInput=Bt,this.match=this.matchWithTest):(this.updateLastIndex=Ue,this.match=this.matchWithExec),o&&(this.handleModes=Ue),this.trackStartLines===!1&&(this.computeNewColumn=Bt),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ue),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid 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 l=je(this.canModeBeOptimized,(u,c,f)=>(c===!1&&u.push(f),u),[]);if(r.ensureOptimizations&&!ee(l))throw Error(`Lexer Modes: < ${l.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",()=>{rR()}),this.TRACE_INIT("toFastProperties",()=>{Na(this)})})}tokenize(e,r=this.defaultMode){if(!ee(this.lexerDefinitionErrors)){let i=_(this.lexerDefinitionErrors,o=>o.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,o,a,l,u,c,f,d,h,g,b,$,O,w,k,E=e,W=E.length,G=0,ge=0,Nr=this.hasCustom?0:Math.floor(e.length/10),it=new Array(Nr),dr=[],sr=this.trackStartLines?1:void 0,C=this.trackStartLines?1:void 0,x=pR(this.emptyGroups),M=this.trackStartLines,D=this.config.lineTerminatorsPattern,T=0,v=[],S=[],L=[],j=[];Object.freeze(j);let I;function X(){return v}s(X,"getPossiblePatternsSlow");function Q(ct){let Ut=Kr(ct),$n=S[Ut];return $n===void 0?j:$n}s(Q,"getPossiblePatternsOptimized");let Qe=s(ct=>{if(L.length===1&&ct.tokenType.PUSH_MODE===void 0){let Ut=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ct);dr.push({offset:ct.startOffset,line:ct.startLine,column:ct.startColumn,length:ct.image.length,message:Ut})}else{L.pop();let Ut=Ar(L);v=this.patternIdxToConfig[Ut],S=this.charCodeToPatternIdxToConfig[Ut],T=v.length;let $n=this.canModeBeOptimized[Ut]&&this.config.safeMode===!1;S&&$n?I=Q:I=X}},"pop_mode");function ce(ct){L.push(ct),S=this.charCodeToPatternIdxToConfig[ct],v=this.patternIdxToConfig[ct],T=v.length,T=v.length;let Ut=this.canModeBeOptimized[ct]&&this.config.safeMode===!1;S&&Ut?I=Q:I=X}s(ce,"push_mode"),ce.call(this,r);let De,wr=this.config.recoveryEnabled;for(;Gu.length){u=a,c=f,De=hr;break}}}break}}if(u!==null){if(d=u.length,h=De.group,h!==void 0&&(g=De.tokenTypeIdx,b=this.createTokenInstance(u,G,g,De.tokenType,sr,C,d),this.handlePayload(b,c),h===!1?ge=this.addToken(it,ge,b):x[h].push(b)),e=this.chopInput(e,d),G=G+d,C=this.computeNewColumn(C,d),M===!0&&De.canLineTerminator===!0){let kt=0,mr,yt;D.lastIndex=0;do mr=D.test(u),mr===!0&&(yt=D.lastIndex-1,kt++);while(mr===!0);kt!==0&&(sr=sr+kt,C=d-yt,this.updateTokenEndLineColumnLocation(b,h,yt,kt,sr,C,d))}this.handleModes(De,Qe,ce,b)}else{let kt=G,mr=sr,yt=C,hr=wr===!1;for(;hr===!1&&G ${xn(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",l=` but found: '`+mt(e).image+"'";if(n)return o+n+l;{let u=je(t,(h,g)=>h.concat(g),[]),c=_(u,h=>`[${_(h,g=>xn(g)).join(", ")}]`),d=`one of these possible Token sequences: ${_(c,(h,g)=>` ${g+1}. ${h}`).join(` `)}`;return o+d+l}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",a=` but found: '`+mt(e).image+"'";if(r)return i+r+a;{let u=`expecting at least one iteration which starts with one of these possible Token sequences:: <${_(t,c=>`[${_(c,f=>xn(f)).join(",")}]`).join(" ,")}>`;return i+u+a}}};Object.freeze(Rn);var kR={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},Sr={buildDuplicateFoundError(t,e){function r(f){return f instanceof ne?f.terminalType.name:f instanceof pe?f.nonTerminalName:""}s(r,"getExtraProductionArgument");let n=t.name,i=mt(e),o=i.idx,a=Vt(i),l=r(i),u=o>0,c=`->${a}${u?o:""}<- ${l?`with argument: ->${l}<-`:""} 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 c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` `),c},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=_(t.prefixPath,i=>xn(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix in 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=_(t.prefixPath,i=>xn(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in 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=Vt(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 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: inside <${t.topLevelRule.name}> Rule. has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=_(t.leftRecursionPath,o=>o.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 Dt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function IR(t,e){let r=new cd(t,e);return r.resolveRefs(),r.errors}s(IR,"resolveGrammar");var cd=class extends Mt{static{s(this,"GastRefResolverVisitor")}constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){F(he(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:lt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var fd=class extends hn{static{s(this,"AbstractNextPossibleTokensWalker")}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=Ee(this.path.ruleStack).reverse(),this.occurrenceStack=Ee(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){ee(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},uc=class extends fd{static{s(this,"NextAfterTokenWalker")}constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new Ae({definition:i});this.possibleTokTypes=Mi(o),this.found=!0}}},eo=class extends hn{static{s(this,"AbstractNextTerminalAfterProductionWalker")}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}},cc=class extends eo{static{s(this,"NextTerminalAfterManyWalker")}walkMany(e,r,n){if(e.idx===this.occurrence){let i=mt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ne&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},_a=class extends eo{static{s(this,"NextTerminalAfterManySepWalker")}walkManySep(e,r,n){if(e.idx===this.occurrence){let i=mt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ne&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},fc=class extends eo{static{s(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=mt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ne&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Pa=class extends eo{static{s(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=mt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ne&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function pc(t,e,r=[]){r=Ee(r);let n=[],i=0;function o(l){return l.concat(Je(t,i+1))}s(o,"remainingPathWith");function a(l){let u=pc(o(l),e,r);return n.concat(u)}for(s(a,"getAlternativesForProd");r.length{ee(u.definition)===!1&&(n=a(u.definition))}),n;if(l instanceof ne)r.push(l.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Je(t,i)}),n}s(pc,"possiblePathsFrom");function dc(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],a="EXIT_ALTERNATIVE",l=!1,u=e.length,c=u-n-1,f=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!ee(d);){let h=d.pop();if(h===a){l&&Ar(d).idx<=c&&d.pop();continue}let g=h.def,b=h.idx,$=h.ruleStack,O=h.occurrenceStack;if(ee(g))continue;let w=g[0];if(w===i){let k={idx:b,def:Je(g),ruleStack:mn($),occurrenceStack:mn(O)};d.push(k)}else if(w instanceof ne)if(b=0;k--){let E=w.definition[k],W={idx:b,def:E.definition.concat(Je(g)),ruleStack:$,occurrenceStack:O};d.push(W),d.push(a)}else if(w instanceof Ae)d.push({idx:b,def:w.definition.concat(Je(g)),ruleStack:$,occurrenceStack:O});else if(w instanceof Dt)d.push(fL(w,b,$,O));else throw Error("non exhaustive match")}return f}s(dc,"nextPossibleTokensAfter");function fL(t,e,r,n){let i=Ee(r);i.push(t.name);let o=Ee(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}s(fL,"expandTopLevelRule");var Oe;(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"})(Oe||(Oe={}));function Oa(t){if(t instanceof de||t==="Option")return Oe.OPTION;if(t instanceof se||t==="Repetition")return Oe.REPETITION;if(t instanceof Se||t==="RepetitionMandatory")return Oe.REPETITION_MANDATORY;if(t instanceof be||t==="RepetitionMandatoryWithSeparator")return Oe.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof xe||t==="RepetitionWithSeparator")return Oe.REPETITION_WITH_SEPARATOR;if(t instanceof Te||t==="Alternation")return Oe.ALTERNATION;throw Error("non exhaustive match")}s(Oa,"getProdType");function hc(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,o=Oa(n);return o===Oe.ALTERNATION?to(e,r,i):ro(e,r,o,i)}s(hc,"getLookaheadPaths");function PR(t,e,r,n,i,o){let a=to(t,e,r),l=GR(a)?Zs:gn;return o(a,n,l,i)}s(PR,"buildLookaheadFuncForOr");function OR(t,e,r,n,i,o){let a=ro(t,e,i,r),l=GR(a)?Zs:gn;return o(a[0],l,n)}s(OR,"buildLookaheadFuncForOptionalProd");function LR(t,e,r,n){let i=t.length,o=St(t,a=>St(a,l=>l.length===1));if(e)return function(a){let l=_(a,u=>u.GATE);for(let u=0;uXe(u)),l=je(a,(u,c,f)=>(F(c,d=>{U(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=f),F(d.categoryMatches,h=>{U(u,h)||(u[h]=f)})}),u),{});return function(){let u=this.LA(1);return l[u.tokenTypeIdx]}}else return function(){for(let a=0;ao.length===1),i=t.length;if(n&&!r){let o=Xe(t);if(o.length===1&&ee(o[0].categoryMatches)){let l=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{let a=je(o,(l,u,c)=>(l[u.tokenTypeIdx]=!0,F(u.categoryMatches,f=>{l[f]=!0}),l),[]);return function(){let l=this.LA(1);return a[l.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;opc([a],1)),n=_R(r.length),i=_(r,a=>{let l={};return F(a,u=>{let c=pd(u.partialPath);F(c,f=>{l[f]=!0})}),l}),o=r;for(let a=1;a<=e;a++){let l=o;o=_R(l.length);for(let u=0;u{let w=pd(O.partialPath);F(w,k=>{i[u][k]=!0})})}}}}return n}s(MR,"lookAheadSequenceFromAlternatives");function to(t,e,r,n){let i=new mc(t,Oe.ALTERNATION,n);return e.accept(i),MR(i.result,r)}s(to,"getLookaheadPathsForOr");function ro(t,e,r,n){let i=new mc(t,r);e.accept(i);let o=i.result,l=new dd(e,t,r).startWalking(),u=new Ae({definition:o}),c=new Ae({definition:l});return MR([u,c],n)}s(ro,"getLookaheadPathsForOptionalProd");function gc(t,e){e:for(let r=0;r{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}s(FR,"isStrictPrefixOfPath");function GR(t){return St(t,e=>St(e,r=>St(r,n=>ee(n.categoryMatches))))}s(GR,"areTokenCategoriesNotUsed");function UR(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return _(e,r=>Object.assign({type:lt.CUSTOM_LOOKAHEAD_VALIDATION},r))}s(UR,"validateLookahead");function jR(t,e,r,n){let i=Tt(t,u=>dL(u,r)),o=TL(t,e,r),a=Tt(t,u=>gL(u,r)),l=Tt(t,u=>hL(u,t,n,r));return i.concat(o,a,l)}s(jR,"validateGrammar");function dL(t,e){let r=new md;t.accept(r);let n=r.allProductions,i=Qp(n,mL),o=Kt(i,l=>l.length>1);return _(he(o),l=>{let u=mt(l),c=e.buildDuplicateFoundError(t,l),f=Vt(u),d={message:c,type:lt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:f,occurrence:u.idx},h=qR(u);return h&&(d.parameter=h),d})}s(dL,"validateDuplicateProductions");function mL(t){return`${Vt(t)}_#_${t.idx}_#_${qR(t)}`}s(mL,"identifyProductionForDuplicates");function qR(t){return t instanceof ne?t.terminalType.name:t instanceof pe?t.nonTerminalName:""}s(qR,"getExtraProductionArgument");var md=class extends Mt{static{s(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function hL(t,e,r,n){let i=[];if(je(e,(a,l)=>l.name===t.name?a+1:a,0)>1){let a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:lt.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}s(hL,"validateRuleDoesNotAlreadyExist");function BR(t,e,r){let n=[],i;return Ie(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:lt.INVALID_RULE_OVERRIDE,ruleName:t})),n}s(BR,"validateRuleIsOverridden");function gd(t,e,r,n=[]){let i=[],o=yc(e.definition);if(ee(o))return[];{let a=t.name;Ie(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:lt.LEFT_RECURSION,ruleName:a});let u=Qn(o,n.concat([t])),c=Tt(u,f=>{let d=Ee(n);return d.push(f),gd(t,f,r,d)});return i.concat(c)}}s(gd,"validateNoLeftRecursion");function yc(t){let e=[];if(ee(t))return e;let r=mt(t);if(r instanceof pe)e.push(r.referencedRule);else if(r instanceof Ae||r instanceof de||r instanceof Se||r instanceof be||r instanceof xe||r instanceof se)e=e.concat(yc(r.definition));else if(r instanceof Te)e=Xe(_(r.definition,o=>yc(o.definition)));else if(!(r instanceof ne))throw Error("non exhaustive match");let n=Di(r),i=t.length>1;if(n&&i){let o=Je(t);return e.concat(yc(o))}else return e}s(yc,"getFirstNoneTerminal");var La=class extends Mt{static{s(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function zR(t,e){let r=new La;t.accept(r);let n=r.alternations;return Tt(n,o=>{let a=mn(o.definition);return Tt(a,(l,u)=>{let c=dc([l],[],gn,1);return ee(c)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:u}),type:lt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:u+1}]:[]})})}s(zR,"validateEmptyOrAlternative");function WR(t,e,r){let n=new La;t.accept(n);let i=n.alternations;return i=ei(i,a=>a.ignoreAmbiguities===!0),Tt(i,a=>{let l=a.idx,u=a.maxLookahead||e,c=to(l,t,u,a),f=yL(c,a,t,r),d=xL(c,a,t,r);return f.concat(d)})}s(WR,"validateAmbiguousAlternationAlternatives");var hd=class extends Mt{static{s(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function gL(t,e){let r=new La;t.accept(r);let n=r.alternations;return Tt(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:lt.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}s(gL,"validateTooManyAlts");function KR(t,e,r){let n=[];return F(t,i=>{let o=new hd;i.accept(o);let a=o.allProductions;F(a,l=>{let u=Oa(l),c=l.maxLookahead||e,f=l.idx,h=ro(f,i,u,c)[0];if(ee(Xe(h))){let g=r.buildEmptyRepetitionError({topLevelRule:i,repetition:l});n.push({message:g,type:lt.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}s(KR,"validateSomeNonEmptyLookaheadPath");function yL(t,e,r,n){let i=[],o=je(t,(l,u,c)=>(e.definition[c].ignoreAmbiguities===!0||F(u,f=>{let d=[c];F(t,(h,g)=>{c!==g&&gc(h,f)&&e.definition[g].ignoreAmbiguities!==!0&&d.push(g)}),d.length>1&&!gc(i,f)&&(i.push(f),l.push({alts:d,path:f}))}),l),[]);return _(o,l=>{let u=_(l.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:l.path}),type:lt.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:l.alts}})}s(yL,"checkAlternativesAmbiguities");function xL(t,e,r,n){let i=je(t,(a,l,u)=>{let c=_(l,f=>({idx:u,path:f}));return a.concat(c)},[]);return zr(Tt(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];let u=a.idx,c=a.path,f=dt(i,h=>e.definition[h.idx].ignoreAmbiguities!==!0&&h.idx{let g=[h.idx+1,u+1],b=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:g,prefixPath:h.path}),type:lt.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:b,alternatives:g}})}))}s(xL,"checkPrefixAlternativesAmbiguities");function TL(t,e,r){let n=[],i=_(e,o=>o.name);return F(t,o=>{let a=o.name;if(Ie(i,a)){let l=r.buildNamespaceConflictError(o);n.push({message:l,type:lt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}s(TL,"checkTerminalAndNoneTerminalsNameSpace");function VR(t){let e=Ws(t,{errMsgProvider:kR}),r={};return F(t.rules,n=>{r[n.name]=n}),IR(r,e.errMsgProvider)}s(VR,"resolveGrammar");function HR(t){return t=Ws(t,{errMsgProvider:Sr}),jR(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}s(HR,"validateGrammar");var YR="MismatchedTokenException",XR="NoViableAltException",JR="EarlyExitException",ZR="NotAllInputParsedException",QR=[YR,XR,JR,ZR];Object.freeze(QR);function ri(t){return Ie(QR,t.name)}s(ri,"isRecognitionException");var no=class extends Error{static{s(this,"RecognitionException")}constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Gi=class extends no{static{s(this,"MismatchedTokenException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=YR}},Da=class extends no{static{s(this,"NoViableAltException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=XR}},Ma=class extends no{static{s(this,"NotAllInputParsedException")}constructor(e,r){super(e,r),this.name=ZR}},Fa=class extends no{static{s(this,"EarlyExitException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=JR}};var yd={},Td="InRuleRecoveryException",xd=class extends Error{static{s(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=Td}},xc=class{static{s(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=U(e,"recoveryEnabled")?e.recoveryEnabled:Ft.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=RL)}getTokenToInsert(e){let r=Tn(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],u=!1,c=this.LA(1),f=this.LA(1),d=s(()=>{let h=this.LA(0),g=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:h,ruleName:this.getCurrRuleFullName()}),b=new Gi(g,c,this.LA(0));b.resyncedTokens=mn(l),this.SAVE_ERROR(b)},"generateErrorMessage");for(;!u;)if(this.tokenMatcher(f,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(f,o)?u=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,l));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 xd("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||ee(r))return!1;let n=this.LA(1);return Wr(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Ie(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Wr(e,o=>Ia(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return yd;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 _(e,(n,i)=>i===0?yd:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=_(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Xe(e)}getFollowSetFromFollowKey(e){if(e===yd)return[rr];let r=e.ruleName+e.idxInCallingRule+nc+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,rr)||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 mn(r)}attemptInRepetitionRecovery(e,r,n,i,o,a,l){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Ee(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return _(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function RL(t,e,r,n,i,o,a){let l=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[l];if(u===void 0){let h=this.getCurrRuleFullName(),g=this.getGAstProductions()[h];u=new o(g,i).startWalking(),this.firstAfterRepMap[l]=u}let c=u.token,f=u.occurrence,d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=rr,f=1),!(c===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,f,a)&&this.tryInRepetitionRecovery(t,e,r,c)}s(RL,"attemptInRepetitionRecovery");function Tc(t,e,r){return r|e|t}s(Tc,"getKeyForAutomaticLookahead");var vn=class{static{s(this,"LLkLookaheadStrategy")}constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:Ft.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(ee(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return Tt(e,r=>gd(r,r,Sr))}validateEmptyOrAlternatives(e){return Tt(e,r=>zR(r,Sr))}validateAmbiguousAlternationAlternatives(e,r){return Tt(e,n=>WR(n,r,Sr))}validateSomeNonEmptyLookaheadPath(e,r){return KR(e,r,Sr)}buildLookaheadForAlternation(e){return PR(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,LR)}buildLookaheadForOptional(e){return OR(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Oa(e.prodType),DR)}};var vc=class{static{s(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=U(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Ft.dynamicTokensEnabled,this.maxLookahead=U(e,"maxLookahead")?e.maxLookahead:Ft.maxLookahead,this.lookaheadStrategy=U(e,"lookaheadStrategy")?e.lookaheadStrategy:new vn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){F(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:a,repetitionMandatoryWithSeparator:l,repetitionWithSeparator:u}=vL(r);F(n,c=>{let f=c.idx===0?"":c.idx;this.TRACE_INIT(`${Vt(c)}${f}`,()=>{let d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:r,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),h=Tc(this.fullRuleNameToShort[r.name],256,c.idx);this.setLaFuncCache(h,d)})}),F(i,c=>{this.computeLookaheadFunc(r,c.idx,768,"Repetition",c.maxLookahead,Vt(c))}),F(o,c=>{this.computeLookaheadFunc(r,c.idx,512,"Option",c.maxLookahead,Vt(c))}),F(a,c=>{this.computeLookaheadFunc(r,c.idx,1024,"RepetitionMandatory",c.maxLookahead,Vt(c))}),F(l,c=>{this.computeLookaheadFunc(r,c.idx,1536,"RepetitionMandatoryWithSeparator",c.maxLookahead,Vt(c))}),F(u,c=>{this.computeLookaheadFunc(r,c.idx,1280,"RepetitionWithSeparator",c.maxLookahead,Vt(c))})})})}computeLookaheadFunc(e,r,n,i,o,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{let l=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=Tc(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,l)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return Tc(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Rd=class extends Mt{static{s(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},Rc=new Rd;function vL(t){Rc.reset(),t.accept(Rc);let e=Rc.dslMethods;return Rc.reset(),e}s(vL,"collectMethods");function Ad(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseta.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: ${o.join(` `).replace(/\n/g,` `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}s(rv,"createBaseSemanticVisitorConstructor");function nv(t,e,r){let n=s(function(){},"derivedConstructor");bd(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return F(e,o=>{i[o]=AL}),n.prototype=i,n.prototype.constructor=n,n}s(nv,"createBaseVisitorConstructorWithDefaults");var $d;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})($d||($d={}));function SL(t,e){return bL(t,e)}s(SL,"validateVisitor");function bL(t,e){let r=dt(e,i=>Lt(t[i])===!1),n=_(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:$d.MISSING_METHOD,methodName:i}));return zr(n)}s(bL,"validateMissingCstMethods");var bc=class{static{s(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=U(e,"nodeLocationTracking")?e.nodeLocationTracking:Ft.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ue,this.cstFinallyStateUpdate=Ue,this.cstPostTerminal=Ue,this.cstPostNonTerminal=Ue,this.cstPostRule=Ue;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Sd,this.setNodeLocationFromNode=Sd,this.cstPostRule=Ue,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ue,this.setNodeLocationFromNode=Ue,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ad,this.setNodeLocationFromNode=Ad,this.cstPostRule=Ue,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Ue,this.setNodeLocationFromNode=Ue,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ue,this.setNodeLocationFromNode=Ue,this.cstPostRule=Ue,this.setInitialNodeLocation=Ue;else throw Error(`Invalid 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];ev(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];tv(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(bt(this.baseCstVisitorConstructor)){let e=rv(this.className,Re(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(bt(this.baseCstVisitorWithDefaultsConstructor)){let e=nv(this.className,Re(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 $c=class{static{s(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing 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)):io}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?io: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 Cc=class{static{s(this,"RecognizerApi")}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=so){if(Ie(this.definedRulesNames,e)){let a={message:Sr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:lt.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=so){let i=BR(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(ri(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return rc(he(this.gastProductionsCache))}};var Nc=class{static{s(this,"RecognizerEngine")}initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Zs,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},U(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 For Further details.`);if(q(e)){if(ee(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(q(e))this.tokensMap=je(e,(o,a)=>(o[a.name]=a,o),{});else if(U(e,"modes")&&St(Xe(he(e.modes)),vR)){let o=Xe(he(e.modes)),a=Ks(o);this.tokensMap=je(a,(l,u)=>(l[u.name]=u,l),{})}else if(Ge(e))this.tokensMap=Ee(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=rr;let n=U(e,"modes")?Xe(he(e.modes)):he(e),i=St(n,o=>ee(o.categoryMatches));this.tokenMatcher=i?Zs:gn,yn(he(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=U(n,"resyncEnabled")?n.resyncEnabled:so.resyncEnabled,o=U(n,"recoveryValueFunc")?n.recoveryValueFunc:so.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let l;return this.outputCst===!0?l=s(function(...f){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),r.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):l=s(function(...f){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),r.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(l,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(ri(e)){let a=e;if(o){let l=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(l))if(a.resyncedTokens=this.reSyncTo(l),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,a.partialCstResult=u}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),o;if(typeof e!="function"){o=e.DEF;let a=e.GATE;if(a!==void 0){let l=i;i=s(()=>a.call(this)&&l.call(this),"lookAheadFunc")}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let l=i;i=s(()=>a.call(this)&&l.call(this),"lookAheadFunc")}}else o=r;if(i.call(this)===!0){let a=this.doSingleRepetition(o);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,Oe.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,fc)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=s(()=>this.tokenMatcher(this.LA(1),o),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,l,i,Pa],l,1536,e,Pa)}else throw this.raiseEarlyExitException(e,Oe.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let l=r.GATE;if(l!==void 0){let u=i;i=s(()=>l.call(this)&&u.call(this),"lookaheadFunction")}}else o=r;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,cc,a)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=s(()=>this.tokenMatcher(this.LA(1),o),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,l,i,_a],l,1280,e,_a)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=q(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 Ma(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw ri(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Gi(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===Td?n:o}}else throw n}saveRecogState(){let e=this.errors,r=Ee(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),rr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var wc=class{static{s(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=U(e,"errorMessageProvider")?e.errorMessageProvider:Ft.errorMessageProvider}SAVE_ERROR(e){if(ri(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ee(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ee(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],l=ro(e,o,r,this.maxLookahead)[0],u=[];for(let f=1;f<=this.maxLookahead;f++)u.push(this.LA(f));let c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:l,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Fa(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=to(e,i,this.maxLookahead),a=[];for(let c=1;c<=this.maxLookahead;c++)a.push(this.LA(c));let l=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:a,previous:l,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Da(u,this.LA(1),l))}};var kc=class{static{s(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(bt(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return dc([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=mt(e.ruleStack),i=this.getGAstProductions()[r];return new uc(i,e).startWalking()}};var Pc={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Pc);var iv=!0,sv=Math.pow(2,8)-1,av=ti({name:"RECORDING_PHASE_TOKEN",pattern:Pe.NA});yn([av]);var lv=Tn(av,`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(lv);var CL={name:`This CSTNode indicates the Parser is in Recording Phase See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Ic=class{static{s(this,"GastRecorder")}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let 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 io}topLevelRuleRecord(e,r){try{let n=new Dt({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 Ua.call(this,de,e,r)}atLeastOneInternalRecord(e,r){Ua.call(this,Se,r,e)}atLeastOneSepFirstInternalRecord(e,r){Ua.call(this,be,r,e,iv)}manyInternalRecord(e,r){Ua.call(this,se,r,e)}manySepFirstInternalRecord(e,r){Ua.call(this,xe,r,e,iv)}orInternalRecord(e,r){return NL.call(this,e,r)}subruleInternalRecord(e,r,n){if(_c(r),!e||U(e,"ruleName")===!1){let l=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> inside top level rule: <${this.recordingProdStack[0].name}>`);throw l.KNOWN_RECORDER_ERROR=!0,l}let i=Ar(this.recordingProdStack),o=e.ruleName,a=new pe({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?CL:Pc}consumeInternalRecord(e,r,n){if(_c(r),!ld(e)){let a=new Error(` 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=Ar(this.recordingProdStack),o=new ne({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),lv}};function Ua(t,e,r,n=!1){_c(r);let i=Ar(this.recordingProdStack),o=Lt(e)?e:e.DEF,a=new t({definition:[],idx:r});return n&&(a.separator=e.SEP),U(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),o.call(this),i.definition.push(a),this.recordingProdStack.pop(),Pc}s(Ua,"recordProd");function NL(t,e){_c(e);let r=Ar(this.recordingProdStack),n=q(t)===!1,i=n===!1?t:t.DEF,o=new Te({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});U(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let a=ba(i,l=>Lt(l.GATE));return o.hasPredicates=a,r.definition.push(o),F(i,l=>{let u=new Ae({definition:[]});o.definition.push(u),U(l,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:U(l,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),l.ALT.call(this),this.recordingProdStack.pop()}),Pc}s(NL,"recordOrProd");function ov(t){return t===0?"":`${t}`}s(ov,"getIdxSuffix");function _c(t){if(t<0||t>sv){let e=new Error(`Invalid DSL Method idx value: <${t}> Idx value must be a none negative value smaller than ${sv+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}s(_c,"assertMethodIdxIsValid");var Oc=class{static{s(this,"PerformanceTracer")}initPerformanceTracer(e){if(U(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=Ft.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);let{time:i,value:o}=Ca(r),a=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function uv(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}s(uv,"applyMixins");var io=Tn(rr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(io);var Ft=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Rn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),so=Object.freeze({recoveryValueFunc:s(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),lt;(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"})(lt||(lt={}));function Lc(t=void 0){return function(){return t}}s(Lc,"EMPTY_ALT");var ja=class t{static{s(this,"Parser")}static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),F(this.definedRulesNames,i=>{let a=this[i].originalGrammarAction,l;this.TRACE_INIT(`${i} Rule`,()=>{l=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=l})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=VR({rules:he(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(ee(n)&&this.skipValidations===!1){let i=HR({rules:he(this.gastProductionsCache),tokenTypes:he(this.tokensMap),errMsgProvider:Sr,grammarName:r}),o=UR({lookaheadStrategy:this.lookaheadStrategy,rules:he(this.gastProductionsCache),tokenTypes:he(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),ee(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=tR(he(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:he(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(he(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!ee(this.definitionErrors))throw e=_(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),U(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES For further details.`);this.skipValidations=U(r,"skipValidations")?r.skipValidations:Ft.skipValidations}};ja.DEFER_DEFINITION_ERRORS_HANDLING=!1;uv(ja,[xc,vc,bc,$c,Nc,Cc,wc,kc,Ic,Oc]);var qa=class extends ja{static{s(this,"EmbeddedActionsParser")}constructor(e,r=Ft){let n=Ee(r);n.outputCst=!1,super(e,n)}};function Ui(t,e,r){return`${t.name}_${e}_${r}`}s(Ui,"buildATNKey");var ni=1,kL=2,cv=4,fv=5;var lo=7,IL=8,_L=9,PL=10,OL=11,pv=12,Ba=class{static{s(this,"AbstractTransition")}constructor(e){this.target=e}isEpsilon(){return!1}},oo=class extends Ba{static{s(this,"AtomTransition")}constructor(e,r){super(e),this.tokenType=r}},za=class extends Ba{static{s(this,"EpsilonTransition")}constructor(e){super(e)}isEpsilon(){return!0}},ao=class extends Ba{static{s(this,"RuleTransition")}constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function dv(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};LL(e,t);let r=t.length;for(let n=0;nmv(t,e,a));return uo(t,e,n,r,...i)}s(UL,"alternation");function jL(t,e,r){let n=ht(t,e,r,{type:ni});ii(t,n);let i=uo(t,e,n,r,ji(t,e,r));return qL(t,e,r,i)}s(jL,"option");function ji(t,e,r){let n=dt(_(r.definition,i=>mv(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:zL(t,n)}s(ji,"block");function hv(t,e,r,n,i){let o=n.left,a=n.right,l=ht(t,e,r,{type:OL});ii(t,l);let u=ht(t,e,r,{type:pv});return o.loopback=l,u.loopback=l,t.decisionMap[Ui(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=l,rt(a,l),i===void 0?(rt(l,o),rt(l,u)):(rt(l,u),rt(l,i.left),rt(i.right,o)),{left:o,right:u}}s(hv,"plus");function gv(t,e,r,n,i){let o=n.left,a=n.right,l=ht(t,e,r,{type:PL});ii(t,l);let u=ht(t,e,r,{type:pv}),c=ht(t,e,r,{type:_L});return l.loopback=c,u.loopback=c,rt(l,o),rt(l,u),rt(a,c),i!==void 0?(rt(c,u),rt(c,i.left),rt(i.right,o)):rt(c,l),t.decisionMap[Ui(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=l,{left:l,right:u}}s(gv,"star");function qL(t,e,r,n){let i=n.left,o=n.right;return rt(i,o),t.decisionMap[Ui(e,"Option",r.idx)]=i,n}s(qL,"optional");function ii(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}s(ii,"defineDecisionState");function uo(t,e,r,n,...i){let o=ht(t,e,n,{type:IL,start:r});r.end=o;for(let l of i)l!==void 0?(rt(r,l.left),rt(l.right,o)):rt(r,o);let a={left:r,right:o};return t.decisionMap[Ui(e,BL(n),n.idx)]=r,a}s(uo,"makeAlts");function BL(t){if(t instanceof Te)return"Alternation";if(t instanceof de)return"Option";if(t instanceof se)return"Repetition";if(t instanceof xe)return"RepetitionWithSeparator";if(t instanceof Se)return"RepetitionMandatory";if(t instanceof be)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}s(BL,"getProdType");function zL(t,e){let r=e.length;for(let o=0;oe.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function kd(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}s(kd,"getATNConfigKey");function HL(t,e){let r={};return n=>{let i=n.toString(),o=r[i];return o!==void 0||(o={atnStartState:t,decision:e,states:{}},r[i]=o),o}}s(HL,"createDFACache");var Dc=class{static{s(this,"PredicateSet")}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;nconsole.log(n))}initialize(e){this.atn=dv(e.rules),this.dfas=YL(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:o}=e,a=this.dfas,l=this.logging,u=Ui(n,"Alternation",r),f=this.atn.decisionMap[u].decision,d=_(hc({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),h=>_(h,g=>g[0]));if(xv(d,!1)&&!o){let h=je(d,(g,b,$)=>(F(b,O=>{O&&(g[O.tokenTypeIdx]=$,F(O.categoryMatches,w=>{g[w]=$}))}),g),{});return i?function(g){var b;let $=this.LA(1),O=h[$.tokenTypeIdx];if(g!==void 0&&O!==void 0){let w=(b=g[O])===null||b===void 0?void 0:b.GATE;if(w!==void 0&&w.call(this)===!1)return}return O}:function(){let g=this.LA(1);return h[g.tokenTypeIdx]}}else return i?function(h){let g=new Dc,b=h===void 0?0:h.length;for(let O=0;O_(h,g=>g[0]));if(xv(d)&&d[0][0]&&!o){let h=d[0],g=Xe(h);if(g.length===1&&ee(g[0].categoryMatches)){let $=g[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===$}}else{let b=je(g,($,O)=>(O!==void 0&&($[O.tokenTypeIdx]=!0,F(O.categoryMatches,w=>{$[w]=!0})),$),{});return function(){let $=this.LA(1);return b[$.tokenTypeIdx]===!0}}}return function(){let h=Id.call(this,a,f,yv,l);return typeof h=="object"?!1:h===0}}};function xv(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let o of n){if(o===void 0){if(e)break;return!1}let a=[o.tokenTypeIdx].concat(o.categoryMatches);for(let l of a)if(r.has(l)){if(!i.has(l))return!1}else r.add(l),i.add(l)}}return!0}s(xv,"isLL1Sequence");function YL(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;nxn(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${eD(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}s(QL,"buildAmbiguityError");function eD(t){if(t instanceof pe)return"SUBRULE";if(t instanceof de)return"OPTION";if(t instanceof Te)return"OR";if(t instanceof Se)return"AT_LEAST_ONE";if(t instanceof be)return"AT_LEAST_ONE_SEP";if(t instanceof xe)return"MANY_SEP";if(t instanceof se)return"MANY";if(t instanceof ne)return"CONSUME";throw Error("non exhaustive match")}s(eD,"getProductionDslName");function tD(t,e,r){let n=Tt(e.configs.elements,o=>o.state.transitions),i=QT(n.filter(o=>o instanceof oo).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}s(tD,"buildAdaptivePredictError");function rD(t,e){return t.edges[e.tokenTypeIdx]}s(rD,"getExistingTargetState");function nD(t,e,r){let n=new co,i=[];for(let a of t.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===lo){i.push(a);continue}let l=a.state.transitions.length;for(let u=0;u0&&!lD(o))for(let a of i)o.add(a);return o}s(nD,"computeReachSet");function iD(t,e){if(t instanceof oo&&Ia(e,t.tokenType))return t.target}s(iD,"getReachableTarget");function sD(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}s(sD,"getUniqueAlt");function Rv(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}s(Rv,"newDFAState");function Tv(t,e,r,n){return n=vv(t,n),e.edges[r.tokenTypeIdx]=n,n}s(Tv,"addDFAEdge");function vv(t,e){if(e===Wa)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}s(vv,"addDFAState");function oD(t){let e=new co,r=t.transitions.length;for(let n=0;n0){let i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};Mc(a,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i1)return!0;return!1}s(pD,"hasConflictingAltSet");function dD(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}s(dD,"hasStateAssociatedWithOneAlt");yo();var el=class{static{s(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new xo(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new Wi;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new zi(e.startOffset,e.image.length,Rs(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 o of e){let a=new zi(o.startOffset,o.image.length,Rs(o),o.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 o=n.container.content.indexOf(n);if(o>0){n.container.content.splice(o,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.$infix&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},tl=class{static{s(this,"AbstractCstNode")}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)}},zi=class extends tl{static{s(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,o=!1){super(),this._hidden=o,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},Wi=class extends tl{static{s(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new Om(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=0;e--){let r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},Om=class t extends Array{static{s(this,"CstNodeContainer")}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}},xo=class extends Wi{static{s(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var Vc=Symbol("Datatype");function Lm(t){return t.$type===Vc}s(Lm,"isDataTypeNode");var Ev="\u200B",Av=s(t=>t.endsWith(Ev)?t:t+Ev,"withRuleSuffix"),rl=class{static{s(this,"AbstractLangiumParser")}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 Dm(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Yc(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()}},nl=class extends rl{static{s(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new el,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;Fn(e)&&(i=e.name,this.registerPrecedenceMap(e));let o=this.wrapper.DEFINE_RULE(Av(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,o),ft(e)&&e.entry&&(this.mainRule=o),o}registerPrecedenceMap(e){let r=e.name,n=new Map;for(let i=0;i0&&(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 o=!this.isRecording()&&e!==void 0;if(o){let a={$type:e};this.stack.push(a),e===Vc?a.value="":r!==void 0&&(a.$infixName=r)}return n(i),o?this.construct():void 0}}extractHiddenTokens(e){let r=this.lexerResult.hidden;if(!r.length)return[];let n=e.startOffset;for(let i=0;in)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 o=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(o);let a=this.nodeBuilder.buildLeafNode(i,n),{assignment:l,crossRef:u}=this.getAssignment(n),c=this.current;if(l){let f=or(n)?i.image:this.converter.convert(i.image,a);this.assign(l.operator,l.feature,f,a,u)}else if(Lm(c)){let f=i.image;or(n)||(f=this.converter.convert(f,a).toString()),c.value+=f}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,o){let a;!this.isRecording()&&!n&&(a=this.nodeBuilder.buildCompositeNode(i));let l;try{l=this.wrapper.wrapSubrule(e,r,o)}finally{this.isRecording()||(l===void 0&&!n&&(l=this.construct()),l!==void 0&&a&&a.length>0&&this.performSubruleAssignment(l,i,a))}}performSubruleAssignment(e,r,n){let{assignment:i,crossRef:o}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,o);else if(!i){let a=this.current;if(Lm(a))a.value+=e.toString();else if(typeof e=="object"&&e){let u=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(u)}}}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 o={$type:e};this.stack.push(o),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)):Lm(e)?this.converter.convert(e.value,e.$cstNode):(sp(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 o=0,a=-1;for(let $=0;$a?(a=w.precedence,o=$):w.precedence===a&&(w.rightAssoc||(o=$))}let l=i.slice(0,o),u=i.slice(o+1),c=n.slice(0,o+1),f=n.slice(o+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:l},h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:f,operators:u},g=this.constructInfix(d,r),b=this.constructInfix(h,r);return{$type:e.$type,$cstNode:e.$cstNode,left:g,operator:i[o],right:b}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=sn(e,Tr);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Rr(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,o){let a=this.current,l;switch(o==="single"&&typeof n=="string"?l=this.linker.buildReference(a,r,i,n):o==="multi"&&typeof n=="string"?l=this.linker.buildMultiReference(a,r,i,n):l=n,e){case"=":{a[r]=l;break}case"?=":{a[r]=!0;break}case"+=":Array.isArray(a[r])||(a[r]=[]),a[r].push(l)}}assignWithoutOverride(e,r){for(let[i,o]of Object.entries(r)){let a=e[i];a===void 0?e[i]=o:Array.isArray(a)&&Array.isArray(o)&&(o.push(...a),e[i]=o)}let n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},Hc=class{static{s(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return Rn.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Rn.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Rn.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Rn.buildEarlyExitMessage(e)}},To=class extends Hc{static{s(this,"LangiumParserErrorMessageProvider")}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}\`.`}},il=class extends rl{static{s(this,"LangiumCompletionParser")}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(Av(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,o){this.before(i),this.wrapper.wrapSubrule(e,r,o),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}},hD={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new To},Yc=class extends qa{static{s(this,"ChevrotainWrapper")}constructor(e,r){let n=r&&"maxLookahead"in r;super(e,{...hD,lookaheadStrategy:n?new vn({maxLookahead:r.maxLookahead}):new Ka({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,{})}},Dm=class extends Yc{static{s(this,"ProfilerWrapper")}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 sl(t,e,r){return gD({parser:e,tokens:r,ruleNames:new Map},t),e}s(sl,"createParser");function gD(t,e){let r=Ta(e,!1),n=re(e.rules).filter(ft).filter(o=>r.has(o));for(let o of n){let a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(o,Ki(a,o.definition))}let i=re(e.rules).filter(Fn).filter(o=>r.has(o));for(let o of i)t.parser.rule(o,yD(t,o))}s(gD,"buildRules");function yD(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(Pt(r))throw new Error("Cannot use terminal rule in infix expression");let n=e.operators.precedences.flatMap(g=>g.operators),i={$type:"Group",elements:[]},o={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(o,a);let u={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},c={...o,$container:a};a.elements.push(u,c);let d=n.map(g=>t.tokens[g.value]).map((g,b)=>({ALT:s(()=>t.parser.consume(b,g,u),"ALT")})),h;return g=>{h??(h=Fm(t,r)),t.parser.subrule(0,h,!1,o,g),t.parser.many(0,{DEF:s(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,h,!1,c,g)},"DEF")})}}s(yD,"buildInfixRule");function Ki(t,e,r=!1){let n;if(or(e))n=SD(t,e);else if(un(e))n=xD(t,e);else if(Tr(e))n=Ki(t,e.terminal);else if(Rr(e))n=Sv(t,e);else if(vr(e))n=TD(t,e);else if(du(e))n=vD(t,e);else if(yu(e))n=ED(t,e);else if(Mn(e))n=AD(t,e);else if(pp(e)){let i=t.consume++;n=s(()=>t.parser.consume(i,rr,e),"method")}else throw new ki(e.$cstNode,`Unexpected element type: ${e.$type}`);return bv(t,r?void 0:Xc(e),n,e.cardinality)}s(Ki,"buildElement");function xD(t,e){let r=Un(e);return()=>t.parser.action(r,e)}s(xD,"buildAction");function TD(t,e){let r=e.rule.ref;if(ln(r)){let n=t.subrule++,i=ft(r)&&r.fragment,o=e.arguments.length>0?RD(r,e.arguments):()=>({}),a;return l=>{a??(a=Fm(t,r)),t.parser.subrule(n,a,i,e,o(l))}}else if(Pt(r)){let n=t.consume++,i=Mm(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Or(r);else throw new ki(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}s(TD,"buildRuleCall");function RD(t,e){if(e.some(n=>n.calledByName)){let n=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:Hr(i.value)}));return i=>{let o={};for(let{parameterName:a,predicate:l}of n)a&&(o[a]=l(i));return o}}else{let n=e.map(i=>Hr(i.value));return i=>{let o={};for(let a=0;ae(n)||r(n)}else if(cp(t)){let e=Hr(t.left),r=Hr(t.right);return n=>e(n)&&r(n)}else if(hp(t)){let e=Hr(t.value);return r=>!e(r)}else if(gp(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(lp(t)){let e=!!t.true;return()=>e}Or(t)}s(Hr,"buildPredicate");function vD(t,e){if(e.elements.length===1)return Ki(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:Ki(t,i,!0)},a=Xc(i);a&&(o.GATE=Hr(a)),r.push(o)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(o=>{let a={ALT:s(()=>o.ALT(i),"ALT")},l=o.GATE;return l&&(a.GATE=()=>l(i)),a}))}}s(vD,"buildAlternatives");function ED(t,e){if(e.elements.length===1)return Ki(t,e.elements[0]);let r=[];for(let l of e.elements){let u={ALT:Ki(t,l,!0)},c=Xc(l);c&&(u.GATE=Hr(c)),r.push(u)}let n=t.or++,i=s((l,u)=>{let c=u.getRuleStack().join("-");return`uGroup_${l}_${c}`},"idFunc"),o=s(l=>t.parser.alternatives(n,r.map((u,c)=>{let f={ALT:s(()=>!0,"ALT")},d=t.parser;f.ALT=()=>{if(u.ALT(l),!d.isRecording()){let g=i(n,d);d.unorderedGroups.get(g)||d.unorderedGroups.set(g,[]);let b=d.unorderedGroups.get(g);typeof b?.[c]>"u"&&(b[c]=!0)}};let h=u.GATE;return h?f.GATE=()=>h(l):f.GATE=()=>!d.unorderedGroups.get(i(n,d))?.[c],f})),"alternatives"),a=bv(t,Xc(e),o,"*");return l=>{a(l),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}s(ED,"buildUnorderedGroup");function AD(t,e){let r=e.elements.map(n=>Ki(t,n));return n=>r.forEach(i=>i(n))}s(AD,"buildGroup");function Xc(t){if(Mn(t))return t.guardCondition}s(Xc,"getGuardCondition");function Sv(t,e,r=e.terminal){if(r)if(vr(r)&&ft(r.rule.ref)){let n=r.rule.ref,i=t.subrule++,o;return a=>{o??(o=Fm(t,n)),t.parser.subrule(i,o,!1,e,a)}}else if(vr(r)&&Pt(r.rule.ref)){let n=t.consume++,i=Mm(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(or(r)){let n=t.consume++,i=Mm(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=Au(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Un(e.type.ref));return Sv(t,e,i)}}s(Sv,"buildCrossReference");function SD(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)}s(SD,"buildKeyword");function bv(t,e,r,n){let i=e&&Hr(e);if(!n)if(i){let o=t.or++;return a=>t.parser.alternatives(o,[{ALT:s(()=>r(a),"ALT"),GATE:s(()=>i(a),"GATE")},{ALT:Lc(),GATE:s(()=>!i(a),"GATE")}])}else return r;if(n==="*"){let o=t.many++;return a=>t.parser.many(o,{DEF:s(()=>r(a),"DEF"),GATE:i?()=>i(a):void 0})}else if(n==="+"){let o=t.many++;if(i){let a=t.or++;return l=>t.parser.alternatives(a,[{ALT:s(()=>t.parser.atLeastOne(o,{DEF:s(()=>r(l),"DEF")}),"ALT"),GATE:s(()=>i(l),"GATE")},{ALT:Lc(),GATE:s(()=>!i(l),"GATE")}])}else return a=>t.parser.atLeastOne(o,{DEF:s(()=>r(a),"DEF")})}else if(n==="?"){let o=t.optional++;return a=>t.parser.optional(o,{DEF:s(()=>r(a),"DEF"),GATE:i?()=>i(a):void 0})}else Or(n)}s(bv,"wrap");function Fm(t,e){let r=bD(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}s(Fm,"getRule");function bD(t,e){if(ln(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!ft(n);)(Mn(n)||du(n)||yu(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}s(bD,"getRuleName");function Mm(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}s(Mm,"getToken");function Gm(t){let e=t.Grammar,r=t.parser.Lexer,n=new il(t);return sl(e,n,r.definition),n.finalize(),n}s(Gm,"createCompletionParser");function Um(t){let e=$v(t);return e.finalize(),e}s(Um,"createLangiumParser");function $v(t){let e=t.Grammar,r=t.parser.Lexer,n=new nl(t);return sl(e,n,r.definition)}s($v,"prepareLangiumParser");var An=class{static{s(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(e,r){let n=re(Ta(e,!1)),i=this.buildTerminalTokens(n),o=this.buildKeywordTokens(n,i,r);return o.push(...i),o}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Pt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=Es(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=xa(r)?Pe.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(ln).flatMap(i=>yr(i).filter(or)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){let i=this.buildKeywordPattern(e,n),o={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(o.LINE_BREAKS=!0),o}buildKeywordPattern(e,r){return r?new RegExp(Gn(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&Op("^"+o.source+"$",e.value)&&n.push(i),n},[])}};var Vi=class{static{s(this,"DefaultValueConverter")}convert(e,r){let n=r.grammarSource;if(Rr(n)&&(n=Mp(n)),vr(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 Yr.convertInt(r);case"STRING":return Yr.convertString(r);case"ID":return Yr.convertID(r)}switch(zp(e)?.toLowerCase()){case"number":return Yr.convertNumber(r);case"boolean":return Yr.convertBoolean(r);case"bigint":return Yr.convertBigint(r);case"date":return Yr.convertDate(r);default:return r}}},Yr;(function(t){function e(c){let f="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}s(Vm,"delayNextTick");var ef=0,kv=10;function tf(){return ef=performance.now(),new V.CancellationTokenSource}s(tf,"startCancelableOperation");function Iv(t){kv=t}s(Iv,"setInterruptionPeriod");var ur=Symbol("OperationCancelled");function Xr(t){return t===ur}s(Xr,"isOperationCancelled");async function qe(t){if(t===V.CancellationToken.None)return;let e=performance.now();if(e-ef>=kv&&(ef=e,await Vm(),ef=performance.now()),t.isCancellationRequested)throw ur}s(qe,"interruptAndCheck");var Gt=class{static{s(this,"Deferred")}constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};var rf=class t{static{s(this,"FullTextDocument")}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=Ov(n.range),o=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,o)+n.text+this._content.substring(a,this._content.length);let l=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,f=_v(n.text,!1,o);if(u-l===f.length)for(let h=0,g=f.length;he?i=a:n=a+1}let o=n-1;return e=this.ensureBeforeEOL(e,r[o]),{line:o,character:e-r[o]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let i=e.line+1r&&Pv(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}},Ao;(function(t){function e(i,o,a,l){return new rf(i,o,a,l)}s(e,"create"),t.create=e;function r(i,o,a){if(i instanceof rf)return i.update(o,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}s(r,"update"),t.update=r;function n(i,o){let a=i.getText(),l=Hm(o.map(LD),(f,d)=>{let h=f.range.start.line-d.range.start.line;return h===0?f.range.start.character-d.range.start.character:h}),u=0,c=[];for(let f of l){let d=i.offsetAt(f.range.start);if(du&&c.push(a.substring(u,d)),f.newText.length&&c.push(f.newText),u=i.offsetAt(f.range.end)}return c.push(a.substr(u)),c.join("")}s(n,"applyEdits"),t.applyEdits=n})(Ao||(Ao={}));function Hm(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Hm(n,e),Hm(i,e);let o=0,a=0,l=0;for(;or.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}s(Ov,"getWellformedRange");function LD(t){let e=Ov(t.range);return e!==t.range?{newText:t.newText,range:e}:t}s(LD,"getWellformedEdit");var Lv;(()=>{"use strict";var t={975:C=>{function x(T){if(typeof T!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(T))}s(x,"e");function M(T,v){for(var S,L="",j=0,I=-1,X=0,Q=0;Q<=T.length;++Q){if(Q2){var Qe=L.lastIndexOf("/");if(Qe!==L.length-1){Qe===-1?(L="",j=0):j=(L=L.slice(0,Qe)).length-1-L.lastIndexOf("/"),I=Q,X=0;continue}}else if(L.length===2||L.length===1){L="",j=0,I=Q,X=0;continue}}v&&(L.length>0?L+="/..":L="..",j=2)}else L.length>0?L+="/"+T.slice(I+1,Q):L=T.slice(I+1,Q),j=Q-I-1;I=Q,X=0}else S===46&&X!==-1?++X:X=-1}return L}s(M,"r");var D={resolve:s(function(){for(var T,v="",S=!1,L=arguments.length-1;L>=-1&&!S;L--){var j;L>=0?j=arguments[L]:(T===void 0&&(T=process.cwd()),j=T),x(j),j.length!==0&&(v=j+"/"+v,S=j.charCodeAt(0)===47)}return v=M(v,!S),S?v.length>0?"/"+v:"/":v.length>0?v:"."},"resolve"),normalize:s(function(T){if(x(T),T.length===0)return".";var v=T.charCodeAt(0)===47,S=T.charCodeAt(T.length-1)===47;return(T=M(T,!v)).length!==0||v||(T="."),T.length>0&&S&&(T+="/"),v?"/"+T:T},"normalize"),isAbsolute:s(function(T){return x(T),T.length>0&&T.charCodeAt(0)===47},"isAbsolute"),join:s(function(){if(arguments.length===0)return".";for(var T,v=0;v0&&(T===void 0?T=S:T+="/"+S)}return T===void 0?".":D.normalize(T)},"join"),relative:s(function(T,v){if(x(T),x(v),T===v||(T=D.resolve(T))===(v=D.resolve(v)))return"";for(var S=1;SQ){if(v.charCodeAt(I+ce)===47)return v.slice(I+ce+1);if(ce===0)return v.slice(I+ce)}else j>Q&&(T.charCodeAt(S+ce)===47?Qe=ce:ce===0&&(Qe=0));break}var De=T.charCodeAt(S+ce);if(De!==v.charCodeAt(I+ce))break;De===47&&(Qe=ce)}var wr="";for(ce=S+Qe+1;ce<=L;++ce)ce!==L&&T.charCodeAt(ce)!==47||(wr.length===0?wr+="..":wr+="/..");return wr.length>0?wr+v.slice(I+Qe):(I+=Qe,v.charCodeAt(I)===47&&++I,v.slice(I))},"relative"),_makeLong:s(function(T){return T},"_makeLong"),dirname:s(function(T){if(x(T),T.length===0)return".";for(var v=T.charCodeAt(0),S=v===47,L=-1,j=!0,I=T.length-1;I>=1;--I)if((v=T.charCodeAt(I))===47){if(!j){L=I;break}}else j=!1;return L===-1?S?"/":".":S&&L===1?"//":T.slice(0,L)},"dirname"),basename:s(function(T,v){if(v!==void 0&&typeof v!="string")throw new TypeError('"ext" argument must be a string');x(T);var S,L=0,j=-1,I=!0;if(v!==void 0&&v.length>0&&v.length<=T.length){if(v.length===T.length&&v===T)return"";var X=v.length-1,Q=-1;for(S=T.length-1;S>=0;--S){var Qe=T.charCodeAt(S);if(Qe===47){if(!I){L=S+1;break}}else Q===-1&&(I=!1,Q=S+1),X>=0&&(Qe===v.charCodeAt(X)?--X==-1&&(j=S):(X=-1,j=Q))}return L===j?j=Q:j===-1&&(j=T.length),T.slice(L,j)}for(S=T.length-1;S>=0;--S)if(T.charCodeAt(S)===47){if(!I){L=S+1;break}}else j===-1&&(I=!1,j=S+1);return j===-1?"":T.slice(L,j)},"basename"),extname:s(function(T){x(T);for(var v=-1,S=0,L=-1,j=!0,I=0,X=T.length-1;X>=0;--X){var Q=T.charCodeAt(X);if(Q!==47)L===-1&&(j=!1,L=X+1),Q===46?v===-1?v=X:I!==1&&(I=1):v!==-1&&(I=-1);else if(!j){S=X+1;break}}return v===-1||L===-1||I===0||I===1&&v===L-1&&v===S+1?"":T.slice(v,L)},"extname"),format:s(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(v,S){var L=S.dir||S.root,j=S.base||(S.name||"")+(S.ext||"");return L?L===S.root?L+j:L+"/"+j:j})(0,T)},"format"),parse:s(function(T){x(T);var v={root:"",dir:"",base:"",ext:"",name:""};if(T.length===0)return v;var S,L=T.charCodeAt(0),j=L===47;j?(v.root="/",S=1):S=0;for(var I=-1,X=0,Q=-1,Qe=!0,ce=T.length-1,De=0;ce>=S;--ce)if((L=T.charCodeAt(ce))!==47)Q===-1&&(Qe=!1,Q=ce+1),L===46?I===-1?I=ce:De!==1&&(De=1):I!==-1&&(De=-1);else if(!Qe){X=ce+1;break}return I===-1||Q===-1||De===0||De===1&&I===Q-1&&I===X+1?Q!==-1&&(v.base=v.name=X===0&&j?T.slice(1,Q):T.slice(X,Q)):(X===0&&j?(v.name=T.slice(1,I),v.base=T.slice(1,Q)):(v.name=T.slice(X,I),v.base=T.slice(X,Q)),v.ext=T.slice(I,Q)),X>0?v.dir=T.slice(0,X-1):j&&(v.dir="/"),v},"parse"),sep:"/",delimiter:":",win32:null,posix:null};D.posix=D,C.exports=D}},e={};function r(C){var x=e[C];if(x!==void 0)return x.exports;var M=e[C]={exports:{}};return t[C](M,M.exports,r),M.exports}s(r,"r"),r.d=(C,x)=>{for(var M in x)r.o(x,M)&&!r.o(C,M)&&Object.defineProperty(C,M,{enumerable:!0,get:x[M]})},r.o=(C,x)=>Object.prototype.hasOwnProperty.call(C,x),r.r=C=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:s(()=>h,"URI"),Utils:s(()=>sr,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let o=/^\w[\w\d+.-]*$/,a=/^\//,l=/^\/\//;function u(C,x){if(!C.scheme&&x)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${C.authority}", path: "${C.path}", query: "${C.query}", fragment: "${C.fragment}"}`);if(C.scheme&&!o.test(C.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(C.path){if(C.authority){if(!a.test(C.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(C.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}s(u,"a");let c="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{static{s(this,"l")}static isUri(x){return x instanceof h||!!x&&typeof x.authority=="string"&&typeof x.fragment=="string"&&typeof x.path=="string"&&typeof x.query=="string"&&typeof x.scheme=="string"&&typeof x.fsPath=="string"&&typeof x.with=="function"&&typeof x.toString=="function"}scheme;authority;path;query;fragment;constructor(x,M,D,T,v,S=!1){typeof x=="object"?(this.scheme=x.scheme||c,this.authority=x.authority||c,this.path=x.path||c,this.query=x.query||c,this.fragment=x.fragment||c):(this.scheme=(function(L,j){return L||j?L:"file"})(x,S),this.authority=M||c,this.path=(function(L,j){switch(L){case"https":case"http":case"file":j?j[0]!==f&&(j=f+j):j=f}return j})(this.scheme,D||c),this.query=T||c,this.fragment=v||c,u(this,S))}get fsPath(){return k(this,!1)}with(x){if(!x)return this;let{scheme:M,authority:D,path:T,query:v,fragment:S}=x;return M===void 0?M=this.scheme:M===null&&(M=c),D===void 0?D=this.authority:D===null&&(D=c),T===void 0?T=this.path:T===null&&(T=c),v===void 0?v=this.query:v===null&&(v=c),S===void 0?S=this.fragment:S===null&&(S=c),M===this.scheme&&D===this.authority&&T===this.path&&v===this.query&&S===this.fragment?this:new b(M,D,T,v,S)}static parse(x,M=!1){let D=d.exec(x);return D?new b(D[2]||c,ge(D[4]||c),ge(D[5]||c),ge(D[7]||c),ge(D[9]||c),M):new b(c,c,c,c,c)}static file(x){let M=c;if(i&&(x=x.replace(/\\/g,f)),x[0]===f&&x[1]===f){let D=x.indexOf(f,2);D===-1?(M=x.substring(2),x=f):(M=x.substring(2,D),x=x.substring(D)||f)}return new b("file",M,x,c,c)}static from(x){let M=new b(x.scheme,x.authority,x.path,x.query,x.fragment);return u(M,!0),M}toString(x=!1){return E(this,x)}toJSON(){return this}static revive(x){if(x){if(x instanceof h)return x;{let M=new b(x);return M._formatted=x.external,M._fsPath=x._sep===g?x.fsPath:null,M}}return x}}let g=i?1:void 0;class b extends h{static{s(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=k(this,!1)),this._fsPath}toString(x=!1){return x?E(this,!0):(this._formatted||(this._formatted=E(this,!1)),this._formatted)}toJSON(){let x={$mid:1};return this._fsPath&&(x.fsPath=this._fsPath,x._sep=g),this._formatted&&(x.external=this._formatted),this.path&&(x.path=this.path),this.scheme&&(x.scheme=this.scheme),this.authority&&(x.authority=this.authority),this.query&&(x.query=this.query),this.fragment&&(x.fragment=this.fragment),x}}let $={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function O(C,x,M){let D,T=-1;for(let v=0;v=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===46||S===95||S===126||x&&S===47||M&&S===91||M&&S===93||M&&S===58)T!==-1&&(D+=encodeURIComponent(C.substring(T,v)),T=-1),D!==void 0&&(D+=C.charAt(v));else{D===void 0&&(D=C.substr(0,v));let L=$[S];L!==void 0?(T!==-1&&(D+=encodeURIComponent(C.substring(T,v)),T=-1),D+=L):T===-1&&(T=v)}}return T!==-1&&(D+=encodeURIComponent(C.substring(T))),D!==void 0?D:C}s(O,"m");function w(C){let x;for(let M=0;M1&&C.scheme==="file"?`//${C.authority}${C.path}`:C.path.charCodeAt(0)===47&&(C.path.charCodeAt(1)>=65&&C.path.charCodeAt(1)<=90||C.path.charCodeAt(1)>=97&&C.path.charCodeAt(1)<=122)&&C.path.charCodeAt(2)===58?x?C.path.substr(1):C.path[1].toLowerCase()+C.path.substr(2):C.path,i&&(M=M.replace(/\//g,"\\")),M}s(k,"v");function E(C,x){let M=x?w:O,D="",{scheme:T,authority:v,path:S,query:L,fragment:j}=C;if(T&&(D+=T,D+=":"),(v||T==="file")&&(D+=f,D+=f),v){let I=v.indexOf("@");if(I!==-1){let X=v.substr(0,I);v=v.substr(I+1),I=X.lastIndexOf(":"),I===-1?D+=M(X,!1,!1):(D+=M(X.substr(0,I),!1,!1),D+=":",D+=M(X.substr(I+1),!1,!0)),D+="@"}v=v.toLowerCase(),I=v.lastIndexOf(":"),I===-1?D+=M(v,!1,!0):(D+=M(v.substr(0,I),!1,!0),D+=v.substr(I))}if(S){if(S.length>=3&&S.charCodeAt(0)===47&&S.charCodeAt(2)===58){let I=S.charCodeAt(1);I>=65&&I<=90&&(S=`/${String.fromCharCode(I+32)}:${S.substr(3)}`)}else if(S.length>=2&&S.charCodeAt(1)===58){let I=S.charCodeAt(0);I>=65&&I<=90&&(S=`${String.fromCharCode(I+32)}:${S.substr(2)}`)}D+=M(S,!0,!1)}return L&&(D+="?",D+=M(L,!1,!1)),j&&(D+="#",D+=x?j:O(j,!1,!1)),D}s(E,"b");function W(C){try{return decodeURIComponent(C)}catch{return C.length>3?C.substr(0,3)+W(C.substr(3)):C}}s(W,"C");let G=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ge(C){return C.match(G)?C.replace(G,(x=>W(x))):C}s(ge,"w");var Nr=r(975);let it=Nr.posix||Nr,dr="/";var sr;(function(C){C.joinPath=function(x,...M){return x.with({path:it.join(x.path,...M)})},C.resolvePath=function(x,...M){let D=x.path,T=!1;D[0]!==dr&&(D=dr+D,T=!0);let v=it.resolve(D,...M);return T&&v[0]===dr&&!x.authority&&(v=v.substring(1)),x.with({path:v})},C.dirname=function(x){if(x.path.length===0||x.path===dr)return x;let M=it.dirname(x.path);return M.length===1&&M.charCodeAt(0)===46&&(M=""),x.with({path:M})},C.basename=function(x){return it.basename(x.path)},C.extname=function(x){return it.extname(x.path)}})(sr||(sr={})),Lv=n})();var{URI:ut,Utils:So}=Lv;var Ze;(function(t){t.basename=So.basename,t.dirname=So.dirname,t.extname=So.extname,t.joinPath=So.joinPath,t.resolvePath=So.resolvePath;let e=typeof process=="object"&&process?.platform==="win32";function r(a,l){return a?.toString()===l?.toString()}s(r,"equals"),t.equals=r;function n(a,l){let u=typeof a=="string"?ut.parse(a).path:a.path,c=typeof l=="string"?ut.parse(l).path:l.path,f=u.split("/").filter($=>$.length>0),d=c.split("/").filter($=>$.length>0);if(e){let $=/^[A-Z]:$/;if(f[0]&&$.test(f[0])&&(f[0]=f[0].toLowerCase()),d[0]&&$.test(d[0])&&(d[0]=d[0].toLowerCase()),f[0]!==d[0])return c.substring(1)}let h=0;for(;h({name:i.name,uri:Ze.joinPath(ut.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 o of n){let a=i.children.get(o);if(!a)if(r)a={name:o,children:new Map,parent:i},i.children.set(o,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 te;(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"})(te||(te={}));var al=class{static{s(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=V.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??ut.parse(e.uri),V.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return V.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 o;if(n)o={parseResult:e,uri:r,state:te.Parsed,references:[],textDocument:n};else{let a=this.createTextDocumentGetter(r,i);o={parseResult:e,uri:r,state:te.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=o,o}async update(e,r){let n=e.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(e.uri.toString()),o=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{let a=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:a})}return n!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=te.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=Ao.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},ll=class{static{s(this,"DefaultLangiumDocuments")}constructor(e){this.documentTrie=new bo,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return re(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,te.Changed),n}deleteDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=te.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){let r=e.toString(),n=this.documentTrie.findAll(r);for(let i of n)i.state=te.Changed;return this.documentTrie.delete(r),n}};var Yi=Symbol("RefResolving"),ul=class{static{s(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=V.CancellationToken.None){if(this.profiler?.isActive("linking")){let n=this.profiler.createTask("linking",this.languageId);n.start();try{for(let i of _t(e.parseResult.value))await qe(r),In(i).forEach(o=>{let a=`${i.$type}:${o.property}`;n.startSubTask(a);try{this.doLink(o,e)}finally{n.stopSubTask(a)}})}finally{n.stop()}}else for(let n of _t(e.parseResult.value))await qe(r),In(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Yi;try{let i=this.getCandidate(e);if(gi(i))n._ref=i;else{n._nodeDescription=i;let o=this.loadAstNode(i);n._ref=o??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);let o=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${o}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Yi;try{let i=this.getCandidates(e),o=[];if(gi(i))n._linkingError=i;else for(let a of i){let l=this.loadAstNode(a);l&&o.push({ref:l,$nodeDescription:a})}n._items=o}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 o=this,a={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Fe(this._ref))return this._ref;if(rp(this._nodeDescription)){let l=o.loadAstNode(this._nodeDescription);this._ref=l??o.createLinkingError({reference:a,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Yi;let l=fs(e).$document,u=o.getLinkedNode({reference:a,container:e,property:r});if(u.error&&l&&l.state0))return this._linkingError=o.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(gi(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=fs(e.container).$document;n&&n.stateRr(r)&&r.isMulti)}findDeclarations(e){if(e){let r=Bp(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(ot(i)||Zt(i))return Zl(i);if(Array.isArray(i)){for(let o of i)if((ot(o)||Zt(o))&&o.$refNode&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return Zl(o)}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||$p(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 In(n))if(Zt(i.reference)&&i.reference.items.some(o=>o.ref===e))return i.reference.items.map(o=>o.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 o=this.nameProvider.getNameNode(i)??i.$cstNode;o&&n.push(o)}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(o=>Ze.equals(o.sourceUri,r.documentUri))),n.push(...i),re(n)}getSelfReferences(e){let r=this.getSelfNodes(e),n=[];for(let i of r){let o=this.nameProvider.getNameNode(i);if(o){let a=At(i),l=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:a.uri,sourcePath:l,targetUri:a.uri,targetPath:l,segment:wi(o),local:!0})}}return n}};var Ct=class{static{s(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return us.sum(re(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?re(r):kn}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 re(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return re(this.map.keys())}values(){return re(this.map.values()).flat()}entriesGroupedByKey(){return re(this.map.entries())}},Xi=class{static{s(this,"BiMap")}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 pl=class{static{s(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=V.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=na,i=V.CancellationToken.None){let o=[];this.addExportedSymbol(e,o,r);for(let a of n(e))await qe(i),this.addExportedSymbol(a,o,r);return o}addExportedSymbol(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=V.CancellationToken.None){let n=e.parseResult.value,i=new Ct;for(let o of yr(n))await qe(r),this.addLocalSymbol(o,e,i);return i}addLocalSymbol(e,r,n){let i=e.$container;if(i){let o=this.nameProvider.getName(e);o&&n.add(i,this.descriptions.createDescription(e,o,r))}}};var $o=class{static{s(this,"StreamScope")}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}},Ym=class{static{s(this,"MapScope")}constructor(e,r,n){this.elements=new Map,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(o,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?re(i).concat(this.outerScope.getElements(e)):re(i)}getAllElements(){let e=re(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},dl=class{static{s(this,"MultiMapScope")}constructor(e,r,n){this.elements=new Ct,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(o,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?re(n).concat(this.outerScope.getElements(e)):re(n)}getAllElements(){let e=re(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},DD={getElement(){},getElements(){return kn},getAllElements(){return kn}};var Co=class{static{s(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},ml=class extends Co{static{s(this,"SimpleCache")}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()}},Ji=class extends Co{static{s(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let o=n();return i.set(r,o),o}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},nf=class extends Ji{static{s(this,"DocumentCache")}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 o of i)this.clear(o)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{let o=n.concat(i);for(let a of o)this.clear(a)}))}},No=class extends ml{static{s(this,"WorkspaceCache")}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 hl=class{static{s(this,"DefaultScopeProvider")}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new No(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=At(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&r.push(i.getStream(a).filter(l=>this.reflection.isSubtype(l.type,n))),a=a.$container;while(a)}let o=this.getGlobalScope(n,e);for(let a=r.length-1;a>=0;a--)o=this.createScope(r[a],o);return o}createScope(e,r,n){return new $o(re(e),r,n)}createScopeForNodes(e,r,n){let i=re(e).map(o=>{let a=this.nameProvider.getName(o);if(a)return this.descriptions.createDescription(o,a)}).nonNullable();return new $o(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new dl(this.indexManager.allElements(e)))}};function Xm(t){return typeof t.$comment=="string"}s(Xm,"isAstNodeWithComment");function Mv(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}s(Mv,"isIntermediateReference");var gl=class{static{s(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){let n=r??{},i=r?.replacer,o=s((l,u)=>this.replacer(l,u,n),"defaultReplacer"),a=i?(l,u)=>i(l,u,o):o;try{return this.currentDocument=At(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:o,comments:a,uriConverter:l}){if(!this.ignoreProperties.has(e))if(ot(r)){let u=r.ref,c=n?r.$refText:void 0;if(u){let f=At(u),d="";this.currentDocument&&this.currentDocument!==f&&(l?d=l(f.uri,u):d=f.uri.toString());let h=this.astNodeLocator.getAstNodePath(u);return{$ref:`${d}#${h}`,$refText:c}}else return{$error:r.error?.message??"Could not resolve reference",$refText:c}}else if(Zt(r)){let u=n?r.$refText:void 0,c=[];for(let f of r.items){let d=f.ref,h=At(f.ref),g="";this.currentDocument&&this.currentDocument!==h&&(l?g=l(h.uri,d):g=h.uri.toString());let b=this.astNodeLocator.getAstNodePath(d);c.push(`${g}#${b}`)}return{$refs:c,$refText:u}}else if(Fe(r)){let u;if(o&&(u=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&u?.$textRegion&&(u.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!e&&(u??(u={...r}),u.$sourceText=r.$cstNode?.text),a){u??(u={...r});let c=this.commentProvider.getComment(r);c&&(u.$comment=c.replace(/\r/g,""))}return u??r}else return r}addAstNodeRegionWithAssignmentsTo(e){let r=s(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(o=>!o.startsWith("$")).forEach(o=>{let a=Gp(e.$cstNode,o).map(r);a.length!==0&&(i[o]=a)}),e}}linkNode(e,r,n,i,o,a){for(let[u,c]of Object.entries(e))if(Array.isArray(c))for(let f=0;f{await this.handleException(()=>e.call(r,n,i,o),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(o){if(Xr(o))throw o;console.error(`${r}:`,o),o instanceof Error&&o.stack&&console.error(o.stack);let a=o instanceof Error?o.message:String(o);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=re(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,o,a,l)=>{await this.handleException(()=>e.call(n,i,o,a,l),r,o,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}};var Fv=Object.freeze({validateNode:!0,validateChildren:!0}),Tl=class{static{s(this,"DefaultDocumentValidator")}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=V.CancellationToken.None){let i=e.parseResult,o=[];if(await qe(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,o,r),r.stopAfterLexingErrors&&o.some(a=>a.data?.code===cr.LexingError)||(this.processParsingErrors(i,o,r),r.stopAfterParsingErrors&&o.some(a=>a.data?.code===cr.ParsingError))||(this.processLinkingErrors(e,o,r),r.stopAfterLinkingErrors&&o.some(a=>a.data?.code===cr.LinkingError))))return o;try{o.push(...await this.validateAst(i.value,r,n))}catch(a){if(Xr(a))throw a;console.error("An error occurred during validation:",a)}return await qe(n),o}processLexingErrors(e,r,n){let i=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(let o of i){let a=o.severity??"error",l={severity:of(a),range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,data:Uv(a),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let o;if(isNaN(i.token.startOffset)){if("previousToken"in i){let a=i.previousToken;if(isNaN(a.startOffset)){let l={line:0,character:0};o={start:l,end:l}}else{let l={line:a.endLine-1,character:a.endColumn};o={start:l,end:l}}}}else o=Rs(i.token);if(o){let a={severity:of("error"),range:o,message:i.message,data:Zi(cr.ParsingError),source:this.getSource()};r.push(a)}}}processLinkingErrors(e,r,n){for(let i of e.references){let o=i.error;if(o){let a={node:o.info.container,range:i.$refNode?.range,property:o.info.property,index:o.info.index,data:{code:cr.LinkingError,containerType:o.info.container.$type,property:o.info.property,refText:o.info.reference.$refText}};r.push(this.toDiagnostic("error",o.message,a))}}}async validateAst(e,r,n=V.CancellationToken.None){let i=[],o=s((a,l,u)=>{i.push(this.toDiagnostic(a,l,u))},"acceptor");return await this.validateAstBefore(e,r,o,n),await this.validateAstNodes(e,r,o,n),await this.validateAstAfter(e,r,o,n),i}async validateAstBefore(e,r,n,i=V.CancellationToken.None){let o=this.validationRegistry.checksBefore;for(let a of o)await qe(i),await a(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=V.CancellationToken.None){if(this.profiler?.isActive("validating")){let o=this.profiler.createTask("validating",this.languageId);o.start();try{let a=_t(e).iterator();for(let l of a){o.startSubTask(l.$type);let u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{let c=this.validationRegistry.getChecks(l.$type,r.categories);for(let f of c)await f(l,n,i)}finally{o.stopSubTask(l.$type)}u.validateChildren||a.prune()}}finally{o.stop()}}else{let o=_t(e).iterator();for(let a of o){await qe(i);let l=this.validateSingleNodeOptions(a,r);if(l.validateNode){let u=this.validationRegistry.getChecks(a.$type,r.categories);for(let c of u)await c(a,n,i)}l.validateChildren||o.prune()}}}validateSingleNodeOptions(e,r){return Fv}async validateAstAfter(e,r,n,i=V.CancellationToken.None){let o=this.validationRegistry.checksAfter;for(let a of o)await qe(i),await a(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Gv(n),severity:of(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 Gv(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Ra(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=jp(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}}}s(Gv,"getDiagnosticRange");function of(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)}}s(of,"toDiagnosticSeverity");function Uv(t){switch(t){case"error":return Zi(cr.LexingError);case"warning":return Zi(cr.LexingWarning);case"info":return Zi(cr.LexingInfo);case"hint":return Zi(cr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}s(Uv,"toDiagnosticData");var cr;(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"})(cr||(cr={}));var Rl=class{static{s(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){let i=n??At(e);r??(r=this.nameProvider.getName(e));let o=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${o} has no name.`);let a,l=s(()=>a??(a=wi(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return l()},selectionSegment:wi(e.$cstNode),type:e.$type,documentUri:i.uri,path:o}}},vl=class{static{s(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=V.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of _t(i))await qe(r),In(o).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=[];ot(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Zt(r)&&(n=r.items.map(u=>u.$nodeDescription).filter(u=>u!==void 0));let i=At(e.container).uri,o=this.nodeLocator.getAstNodePath(e.container),a=[],l=wi(r.$refNode);for(let u of n)a.push({sourceUri:i,sourcePath:o,targetUri:u.documentUri,targetPath:u.path,segment:l,local:Ze.equals(u.documentUri,i)});return a}};var El=class{static{s(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let a=o.indexOf(this.indexSeparator);if(a>0){let l=o.substring(0,a),u=parseInt(o.substring(a+1));return i[l]?.[u]}return i[o]},e)}};var we={};oe(we,ep(Hi(),1));var Al=class{static{s(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new Gt,this.onConfigurationSectionUpdateEmitter=new we.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,o)=>{this.updateSectionConfiguration(i.section,n[o])})}}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 zo=ep(ub(),1);var mi;(function(t){function e(r){return{dispose:s(async()=>await r(),"dispose")}}s(e,"create"),t.create=e})(mi||(mi={}));var Pl=class{static{s(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ct,this.documentPhaseListeners=new Ct,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=te.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=V.CancellationToken.None){for(let i of e){let o=i.uri.toString();if(i.state===te.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(i,te.IndexedReferences);else if(typeof r.validation=="object"){let a=this.findMissingValidationCategories(i,r);a.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:{categories:a}},result:this.buildState.get(o)?.result}),i.state=te.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=te.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=V.CancellationToken.None){this.currentState=te.Changed;let i=[];for(let u of r){let c=this.langiumDocuments.deleteDocuments(u);for(let f of c)i.push(f.uri),this.cleanUpDeleted(f)}let o=(await Promise.all(e.map(u=>this.findChangedUris(u)))).flat();for(let u of o){let c=this.langiumDocuments.getDocument(u);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},u),c.state=te.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,te.Changed)}let a=re(o).concat(i).map(u=>u.toString()).toSet();this.langiumDocuments.all.filter(u=>!a.has(u.uri.toString())&&this.shouldRelink(u,a)).forEach(u=>this.resetToState(u,te.ComputedScopes)),await this.emitUpdate(o,i),await qe(n);let l=this.sortDocuments(this.langiumDocuments.all.filter(u=>u.state=1}findMissingValidationCategories(e,r){let n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),o=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 re(a).filter(l=>!o.has(l)).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=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),mi.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case te.Changed:case te.Parsed:this.indexManager.removeContent(e.uri);case te.IndexedContent:e.localSymbols=void 0;case te.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case te.Linked:this.indexManager.removeReferences(e.uri);case te.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case te.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=te.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,te.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,te.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,te.ComputedScopes,n,async a=>{let l=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await l.collectLocalSymbols(a,n)});let i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,te.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(i,te.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));let o=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(o,te.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(),o=this.buildState.get(i);(!o||o.completed)&&this.buildState.set(i,{completed:!1,options:r,result:o?.result})}}async runCancelable(e,r,n,i){for(let a of e)a.statea.state===r);await this.notifyBuildPhase(o,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),mi.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),mi.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=V.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(ur);if(this.currentState>=e&&e>i.state)return Promise.reject(new zo.ResponseError(zo.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${te[i.state]}, requiring ${te[e]}, but workspace state is already ${te[this.currentState]}. Returning undefined.`))}else return Promise.reject(new zo.ResponseError(zo.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((o,a)=>{let l=this.onDocumentPhase(e,c=>{Ze.equals(c.uri,r)&&(l.dispose(),u.dispose(),o(c.uri))}),u=n.onCancellationRequested(()=>{l.dispose(),u.dispose(),a(ur)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(ur):new Promise((n,i)=>{let o=this.onBuildPhase(e,()=>{o.dispose(),a.dispose(),n()}),a=r.onCancellationRequested(()=>{o.dispose(),a.dispose(),i(ur)})})}async notifyDocumentPhase(e,r,n){let o=this.documentPhaseListeners.get(r).slice();for(let a of o)try{await qe(n),await a(e,n)}catch(l){if(!Xr(l))throw l}}async notifyBuildPhase(e,r,n){if(e.length===0)return;let o=this.buildPhaseListeners.get(r).slice();for(let a of o)await qe(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),o=typeof i.validation=="object"?{...i.validation}:{};o.categories=this.findMissingValidationCategories(e,i);let a=await n.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;let l=this.buildState.get(e.uri.toString());l&&(l.result??(l.result={}),l.result.validationChecks?l.result.validationChecks=re(l.result.validationChecks).concat(o.categories).distinct().toArray():l.result.validationChecks=[...o.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}};var Ol=class{static{s(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Ji,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=At(e).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(a=>{Ze.equals(a.targetUri,n)&&a.targetPath===r&&i.push(a)})}),re(i)}allElements(e,r){let n=re(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(o=>this.astReflection.isSubtype(o.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=V.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),o=e.uri.toString();this.symbolIndex.set(o,i),this.symbolByTypeIndex.clear(o)}async updateReferences(e,r=V.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 Ll=class{static{s(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new Gt,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=V.CancellationToken.None){let n=await this.performStartup(e);await qe(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){let r=[],n=s(a=>{r.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)},"collector");await this.loadAdditionalDocuments(e,n);let i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));let o=re(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(o,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 ut.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 Dl=class{static{s(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(e,r,n,i,o){return Qs.buildUnexpectedCharactersMessage(e,r,n,i,o)}buildUnableToPopLexerModeMessage(e){return Qs.buildUnableToPopLexerModeMessage(e)}},Ff={mode:"full"},rs=class{static{s(this,"DefaultLexer")}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=gg(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Pe(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Ff){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(gg(e))return e;let r=yg(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function Gf(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}s(Gf,"isTokenTypeArray");function yg(t){return t&&"modes"in t&&"defaultMode"in t}s(yg,"isIMultiModeLexerDefinition");function gg(t){return!Gf(t)&&!yg(t)}s(gg,"isTokenTypeDictionary");yo();function Rg(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=le.create(0,0));let o=pb(t),a=Eg(n),l=SM({lines:o,position:i,options:a});return wM({index:0,tokens:l,position:i})}s(Rg,"parseJSDoc");function vg(t,e){let r=Eg(e),n=pb(t);if(n.length===0)return!1;let i=n[0],o=n[n.length-1],a=r.start,l=r.end;return!!a?.exec(i)&&!!l?.exec(o)}s(vg,"isJSDoc");function pb(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(_p)}s(pb,"getLines");var cb=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,AM=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function SM(t){let e=[],r=t.position.line,n=t.position.character;for(let i=0;i=l.length){if(e.length>0){let f=le.create(r,n);e.push({type:"break",content:"",range:ie.create(f,f)})}}else{cb.lastIndex=u;let f=cb.exec(l);if(f){let d=f[0],h=f[1],g=le.create(r,n+u),b=le.create(r,n+u+d.length);e.push({type:"tag",content:h,range:ie.create(g,b)}),u+=d.length,u=Tg(l,u)}if(u0&&e[e.length-1].type==="break"?e.slice(0,-1):e}s(SM,"tokenize");function bM(t,e,r,n){let i=[];if(t.length===0){let o=le.create(r,n),a=le.create(r,n+e.length);i.push({type:"text",content:e,range:ie.create(o,a)})}else{let o=0;for(let l of t){let u=l.index,c=e.substring(o,u);c.length>0&&i.push({type:"text",content:e.substring(o,u),range:ie.create(le.create(r,o+n),le.create(r,u+n))});let f=c.length+1,d=l[1];if(i.push({type:"inline-tag",content:d,range:ie.create(le.create(r,o+f+n),le.create(r,o+f+d.length+n))}),f+=d.length,l.length===4){f+=l[2].length;let h=l[3];i.push({type:"text",content:h,range:ie.create(le.create(r,o+f+n),le.create(r,o+f+h.length+n))})}else i.push({type:"text",content:"",range:ie.create(le.create(r,o+f+n),le.create(r,o+f+n))});o=u+l[0].length}let a=e.substring(o);a.length>0&&i.push({type:"text",content:a,range:ie.create(le.create(r,o+n),le.create(r,o+n+a.length))})}return i}s(bM,"buildInlineTokens");var $M=/\S/,CM=/\s*$/;function Tg(t,e){let r=t.substring(e).match($M);return r?e+r.index:t.length}s(Tg,"skipWhitespace");function NM(t){let e=t.match(CM);if(e&&typeof e.index=="number")return e.index}s(NM,"lastCharacter");function wM(t){let e=le.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Uf([],ie.create(e,e));let r=[];for(;t.indexr.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+=fb(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+=fb(r)+i}return r.trim()}},Ml=class{static{s(this,"JSDocTagImpl")}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 o=PM(this.name,r,e??{});if(typeof o=="string")return o}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \u2014 ${r}`:this.content.inlines.length>1&&(i=`${i} ${r}`),this.inline?`{${i}}`:i}};function PM(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){let n=e.indexOf(" "),i=e;if(n>0){let a=Tg(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)??OM(e,i)}}s(PM,"renderInlineTag");function OM(t,e){try{return ut.parse(t,!0),`[${e}](${t})`}catch{return t}}s(OM,"renderLinkDefault");var Fl=class{static{s(this,"JSDocTextImpl")}constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` `)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` `)}return r}},jf=class{static{s(this,"JSDocLineImpl")}constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function fb(t){return t.endsWith(` `)?` `:` `}s(fb,"fillNewlines");var Gl=class{static{s(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&vg(r))return Rg(r).toMarkdown({renderLink:s((i,o)=>this.documentationLinkRenderer(e,i,o),"renderLink"),renderTag:s(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){let i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){let o=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,l=i.documentUri.with({fragment:`L${o},${a}`});return`[${n}](${l.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){let i=At(e).localSymbols;if(!i)return;let o=e;do{let l=i.getStream(o).find(u=>u.name===r);if(l)return l;o=o.$container}while(o)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}};var Ul=class{static{s(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Xm(e)?e.$comment:Cp(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var jl=class{static{s(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},Ag=class{static{s(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{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 Gt,o,a=r.onCancellationRequested(()=>{o=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(l=>{let u=this.hydrator.hydrate(l);i.resolve(u)}).catch(l=>{i.reject(l)}).finally(()=>{a.dispose(),clearTimeout(o)}),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 Gt;return e.onCancellationRequested(()=>{let n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(ur)}),this.queue.push(r),r.promise}},Sg=class{static{s(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new we.Emitter,this.deferred=new Gt,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(o=>{let a=o;this.deferred.resolve(a),this.unlock()}),n(o=>{this.deferred.reject(o),this.unlock()})}terminate(){this.deferred.reject(ur),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 Gt,this.sendMessage(e),this.deferred.promise}};var ql=class{static{s(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new V.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let r=tf();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=V.CancellationToken.None){let i=new Gt,o={action:r,deferred:i,cancellationToken:n};return e.push(o),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 o=await Promise.resolve().then(()=>r(i));n.resolve(o)}catch(o){Xr(o)?n.resolve(void 0):n.reject(o)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var Bl=class{static{s(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new Xi,this.tokenTypeIdMap=new Xi,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 _t(e))r.set(i,{});if(e.$cstNode)for(let i of Ni(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,o]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(o)){let a=[];n[i]=a;for(let l of o)Fe(l)?a.push(this.dehydrateAstNode(l,r)):ot(l)?a.push(this.dehydrateReference(l,r)):a.push(l)}else Fe(o)?n[i]=this.dehydrateAstNode(o,r):ot(o)?n[i]=this.dehydrateReference(o,r):o!==void 0&&(n[i]=o);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 ra(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),gr(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):wn(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 o of _t(e))r.set(o,{});let i;if(e.$cstNode)for(let o of Ni(e.$cstNode)){let a;"fullText"in o?(a=new xo(o.fullText),i=a):"content"in o?a=new Wi:"tokenType"in o&&(a=this.hydrateCstLeafNode(o)),a&&(n.set(o,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,o]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(o)){let a=[];n[i]=a;for(let l of o)Fe(l)?a.push(this.setParent(this.hydrateAstNode(l,r),n)):ot(l)?a.push(this.hydrateReference(l,n,i,r)):a.push(l)}else Fe(o)?n[i]=this.setParent(this.hydrateAstNode(o,r),n):ot(o)?n[i]=this.hydrateReference(o,n,i,r):o!==void 0&&(n[i]=o);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),gr(i))for(let o of e.content){let a=this.hydrateCstNode(o,r,n++);i.content.push(a)}return i}hydrateCstLeafNode(e){let r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,o=e.startLine,a=e.startColumn,l=e.endLine,u=e.endColumn,c=e.hidden;return new zi(n,i,{start:{line:o,character:a},end:{line:l,character:u}},r,c)}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 _t(this.grammar))pa(r)&&this.grammarElementIdMap.set(r,e++)}};function bg(t){return{documentation:{CommentProvider:s(e=>new Ul(e),"CommentProvider"),DocumentationProvider:s(e=>new Gl(e),"DocumentationProvider")},parser:{AsyncParser:s(e=>new jl(e),"AsyncParser"),GrammarConfig:s(e=>Kp(e),"GrammarConfig"),LangiumParser:s(e=>Um(e),"LangiumParser"),CompletionParser:s(e=>Gm(e),"CompletionParser"),ValueConverter:s(()=>new Vi,"ValueConverter"),TokenBuilder:s(()=>new An,"TokenBuilder"),Lexer:s(e=>new rs(e),"Lexer"),ParserErrorMessageProvider:s(()=>new To,"ParserErrorMessageProvider"),LexerErrorMessageProvider:s(()=>new Dl,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:s(()=>new El,"AstNodeLocator"),AstNodeDescriptionProvider:s(e=>new Rl(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:s(e=>new vl(e),"ReferenceDescriptionProvider")},references:{Linker:s(e=>new ul(e),"Linker"),NameProvider:s(()=>new cl,"NameProvider"),ScopeProvider:s(e=>new hl(e),"ScopeProvider"),ScopeComputation:s(e=>new pl(e),"ScopeComputation"),References:s(e=>new fl(e),"References")},serializer:{Hydrator:s(e=>new Bl(e),"Hydrator"),JsonSerializer:s(e=>new gl(e),"JsonSerializer")},validation:{DocumentValidator:s(e=>new Tl(e),"DocumentValidator"),ValidationRegistry:s(e=>new xl(e),"ValidationRegistry")},shared:s(()=>t.shared,"shared")}}s(bg,"createDefaultCoreModule");function $g(t){return{ServiceRegistry:s(e=>new yl(e),"ServiceRegistry"),workspace:{LangiumDocuments:s(e=>new ll(e),"LangiumDocuments"),LangiumDocumentFactory:s(e=>new al(e),"LangiumDocumentFactory"),DocumentBuilder:s(e=>new Pl(e),"DocumentBuilder"),IndexManager:s(e=>new Ol(e),"IndexManager"),WorkspaceManager:s(e=>new Ll(e),"WorkspaceManager"),FileSystemProvider:s(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:s(()=>new ql,"WorkspaceLock"),ConfigurationProvider:s(e=>new Al(e),"ConfigurationProvider")},profilers:{}}}s($g,"createDefaultSharedCoreModule");var Cg;(function(t){t.merge=(e,r)=>zl(zl({},e),r)})(Cg||(Cg={}));function qf(t,e,r,n,i,o,a,l,u){let c=[t,e,r,n,i,o,a,l,u].reduce(zl,{});return Rb(c)}s(qf,"inject");var xb=Symbol("isProxy");function Tb(t){if(t&&t[xb])for(let e of Object.values(t))Tb(e);return t}s(Tb,"eagerLoad");function Rb(t,e){let r=new Proxy({},{deleteProperty:s(()=>!1,"deleteProperty"),set:s(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:s((n,i)=>i===xb?!0:yb(n,i,t,e||r),"get"),getOwnPropertyDescriptor:s((n,i)=>(yb(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:s((n,i)=>i in t,"has"),ownKeys:s(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}s(Rb,"_inject");var gb=Symbol();function yb(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]===gb)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]=gb;try{t[e]=typeof i=="function"?i(n):Rb(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}s(yb,"_resolve");function zl(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]=zl(i,n):t[r]=zl({},n)}else t[r]=n}return t}s(zl,"_merge");var Ng={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},ns;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(ns||(ns={}));var Bf=class extends An{static{s(this,"IndentationAwareTokenBuilder")}constructor(e=Ng){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...Ng,...e},this.indentTokenType=ti({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=ti({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){let n=super.buildTokens(e,r);if(!Gf(n))throw new Error("Invalid tokens built by default builder");let{indentTokenName:i,dedentTokenName:o,whitespaceTokenName:a,ignoreIndentationDelimiters:l}=this.options,u,c,f,d=[];for(let h of n){for(let[g,b]of l)h.name===g?h.PUSH_MODE=ns.IGNORE_INDENTATION:h.name===b&&(h.POP_MODE=!0);h.name===o?u=h:h.name===i?c=h:h.name===a?f=h:d.push(h)}if(!u||!c||!f)throw new Error("Some indentation/whitespace tokens not found!");return l.length>0?{modes:{[ns.REGULAR]:[u,c,...d,f],[ns.IGNORE_INDENTATION]:[...d,f]},defaultMode:ns.REGULAR}:[u,c,f,...d]}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 o=this.whitespaceRegExp.exec(e);return{currIndentLevel:o?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:o}}createIndentationTokenInstance(e,r,n,i){let o=this.getLineNumber(r,i);return Tn(e,n,i,i+n.length,o,o,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:o,prevIndentLevel:a,match:l}=this.matchWhitespace(e,r,n,i);return o<=a?null:(this.indentationStack.push(o),l)}dedentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:o,prevIndentLevel:a,match:l}=this.matchWhitespace(e,r,n,i);if(o>=a)return null;let u=this.indentationStack.lastIndexOf(o);if(u===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${o} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:l?.[0]?.length??0,line:this.getLineNumber(e,r),column:1}),null;let c=this.indentationStack.length-u-1,f=e.substring(0,r).match(/[\r\n]+$/)?.[0].length??1;for(let d=0;d1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},wg=class extends rs{static{s(this,"IndentationAwareLexer")}constructor(e){if(super(e),e.parser.TokenBuilder instanceof Bf)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Ff){let n=super.tokenize(e),i=n.report;r?.mode==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];let{indentTokenType:o,dedentTokenType:a}=this.indentationTokenBuilder,l=o.tokenTypeIdx,u=a.tokenTypeIdx,c=[],f=n.tokens.length-1;for(let d=0;d=0&&c.push(n.tokens[f]),n.tokens=c,n}};var ue={};Nn(ue,{AstUtils:()=>Ql,BiMap:()=>Xi,Cancellation:()=>V,ContextCache:()=>Ji,CstUtils:()=>Tu,DONE_RESULT:()=>Et,Deferred:()=>Gt,Disposable:()=>mi,DisposableCache:()=>Co,DocumentCache:()=>nf,EMPTY_STREAM:()=>kn,ErrorWithLocation:()=>ki,GrammarUtils:()=>bu,MultiMap:()=>Ct,OperationCancelled:()=>ur,Reduction:()=>us,RegExpUtils:()=>Eu,SimpleCache:()=>ml,StreamImpl:()=>Qt,TreeStreamImpl:()=>Ir,URI:()=>ut,UriTrie:()=>bo,UriUtils:()=>Ze,WorkspaceCache:()=>No,assertCondition:()=>Yg,assertUnreachable:()=>Or,delayNextTick:()=>Vm,interruptAndCheck:()=>qe,isOperationCancelled:()=>Xr,loadGrammarFromJson:()=>tn,setInterruptionPeriod:()=>Iv,startCancelableOperation:()=>tf,stream:()=>re});oe(ue,we);var zf=class{static{s(this,"EmptyFileSystemProvider")}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[]}},kg={fileSystemProvider:s(()=>new zf,"fileSystemProvider")};var LM={Grammar:s(()=>{},"Grammar"),LanguageMetaData:s(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},DM={AstReflection:s(()=>new Ts,"AstReflection")};function MM(){let t=qf($g(kg),DM),e=qf(bg({shared:t}),LM);return t.ServiceRegistry.register(e),e}s(MM,"createMinimalGrammarServices");function tn(t){let e=MM(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,ut.parse(`memory:/${r.name??"grammar"}.langium`)),r}s(tn,"loadGrammarFromJson");oe(Ke,ue);var Ig=class{static{s(this,"DefaultLangiumProfiler")}constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Ct}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 Wf(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 l=r.entries.get(a),u=l.reduce((c,f)=>c+f);n.push({name:`${r.identifier}.${a}`,count:l.length,duration:u})}let i=r.duration-n.map(a=>a.duration).reduce((a,l)=>a+l,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((a,l)=>l.duration-a.duration);function o(a){return Math.round(100*a)/100}return s(o,"Round"),console.table(n.map(a=>({Element:a.name,Count:a.count,"Self %":o(100*a.duration/r.duration),"Time (ms)":o(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])}},Wf=class{static{s(this,"ProfilingTask")}constructor(e,r){this.stack=[],this.entries=new Ct,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 Eb;(e=>e.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 ]+)\]/})(Eb||={});var Ab;(e=>e.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])?/})(Ab||={});var Sb;(e=>e.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]*/})(Sb||={});var bb;(e=>e.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]*/})(bb||={});var $b;(e=>e.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]*/})($b||={});var Cb;(e=>e.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]*/})(Cb||={});var Nb;(e=>e.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:/"[^"]*"|'[^']*'/})(Nb||={});var Ore={...Eb.Terminals,...Ab.Terminals,...Sb.Terminals,...bb.Terminals,...$b.Terminals,...Cb.Terminals,...Nb.Terminals},bn={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Lre(t){return Cr.isInstance(t,bn.$type)}s(Lre,"isArchitecture");var Kf={$type:"Axis",label:"label",name:"name"};var Xf={$type:"Branch",name:"name",order:"order"};function Dre(t){return Cr.isInstance(t,Xf.$type)}s(Dre,"isBranch");var vb={$type:"Checkout",branch:"branch"};var Vf={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"};var _g={$type:"ClassDefStatement",className:"className",styleText:"styleText"};var Ho={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function Mre(t){return Cr.isInstance(t,Ho.$type)}s(Mre,"isCommit");var Hf={$type:"Curve",entries:"entries",label:"label",name:"name"};var Wo={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"};var rn={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"};var Pg={$type:"Entry",axis:"axis",value:"value"};var ss={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Fre(t){return Cr.isInstance(t,ss.$type)}s(Fre,"isGitGraph");var Wl={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"};var Vl={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Gre(t){return Cr.isInstance(t,Vl.$type)}s(Gre,"isInfo");var Kl={$type:"Item",classSelector:"classSelector",name:"name"};var Og={$type:"Junction",id:"id",in:"in"};var Yf={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"};var Yo={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Ure(t){return Cr.isInstance(t,Yo.$type)}s(Ure,"isMerge");var Lg={$type:"Option",name:"name",value:"value"};var Xo={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function jre(t){return Cr.isInstance(t,Xo.$type)}s(jre,"isPacket");var Jo={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function qre(t){return Cr.isInstance(t,Jo.$type)}s(qre,"isPacketBlock");var os={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Bre(t){return Cr.isInstance(t,os.$type)}s(Bre,"isPie");var Jf={$type:"PieSection",label:"label",value:"value"};function zre(t){return Cr.isInstance(t,Jf.$type)}s(zre,"isPieSection");var is={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"};var Dg={$type:"Section",classSelector:"classSelector",name:"name"};var Ko={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"};var Vo={$type:"Statement"};var Zo={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function Wre(t){return Cr.isInstance(t,Zo.$type)}s(Wre,"isTreemap");var Mg={$type:"TreemapRow",indent:"indent",item:"item"};var Hl=class extends hi{constructor(){super(...arguments);this.types={Architecture:{name:bn.$type,properties:{accDescr:{name:bn.accDescr},accTitle:{name:bn.accTitle},edges:{name:bn.edges,defaultValue:[]},groups:{name:bn.groups,defaultValue:[]},junctions:{name:bn.junctions,defaultValue:[]},services:{name:bn.services,defaultValue:[]},title:{name:bn.title}},superTypes:[]},Axis:{name:Kf.$type,properties:{label:{name:Kf.label},name:{name:Kf.name}},superTypes:[]},Branch:{name:Xf.$type,properties:{name:{name:Xf.name},order:{name:Xf.order}},superTypes:[Vo.$type]},Checkout:{name:vb.$type,properties:{branch:{name:vb.branch}},superTypes:[Vo.$type]},CherryPicking:{name:Vf.$type,properties:{id:{name:Vf.id},parent:{name:Vf.parent},tags:{name:Vf.tags,defaultValue:[]}},superTypes:[Vo.$type]},ClassDefStatement:{name:_g.$type,properties:{className:{name:_g.className},styleText:{name:_g.styleText}},superTypes:[]},Commit:{name:Ho.$type,properties:{id:{name:Ho.id},message:{name:Ho.message},tags:{name:Ho.tags,defaultValue:[]},type:{name:Ho.type}},superTypes:[Vo.$type]},Curve:{name:Hf.$type,properties:{entries:{name:Hf.entries,defaultValue:[]},label:{name:Hf.label},name:{name:Hf.name}},superTypes:[]},Direction:{name:Wo.$type,properties:{accDescr:{name:Wo.accDescr},accTitle:{name:Wo.accTitle},dir:{name:Wo.dir},statements:{name:Wo.statements,defaultValue:[]},title:{name:Wo.title}},superTypes:[ss.$type]},Edge:{name:rn.$type,properties:{lhsDir:{name:rn.lhsDir},lhsGroup:{name:rn.lhsGroup,defaultValue:!1},lhsId:{name:rn.lhsId},lhsInto:{name:rn.lhsInto,defaultValue:!1},rhsDir:{name:rn.rhsDir},rhsGroup:{name:rn.rhsGroup,defaultValue:!1},rhsId:{name:rn.rhsId},rhsInto:{name:rn.rhsInto,defaultValue:!1},title:{name:rn.title}},superTypes:[]},Entry:{name:Pg.$type,properties:{axis:{name:Pg.axis,referenceType:Kf.$type},value:{name:Pg.value}},superTypes:[]},GitGraph:{name:ss.$type,properties:{accDescr:{name:ss.accDescr},accTitle:{name:ss.accTitle},statements:{name:ss.statements,defaultValue:[]},title:{name:ss.title}},superTypes:[]},Group:{name:Wl.$type,properties:{icon:{name:Wl.icon},id:{name:Wl.id},in:{name:Wl.in},title:{name:Wl.title}},superTypes:[]},Info:{name:Vl.$type,properties:{accDescr:{name:Vl.accDescr},accTitle:{name:Vl.accTitle},title:{name:Vl.title}},superTypes:[]},Item:{name:Kl.$type,properties:{classSelector:{name:Kl.classSelector},name:{name:Kl.name}},superTypes:[]},Junction:{name:Og.$type,properties:{id:{name:Og.id},in:{name:Og.in}},superTypes:[]},Leaf:{name:Yf.$type,properties:{classSelector:{name:Yf.classSelector},name:{name:Yf.name},value:{name:Yf.value}},superTypes:[Kl.$type]},Merge:{name:Yo.$type,properties:{branch:{name:Yo.branch},id:{name:Yo.id},tags:{name:Yo.tags,defaultValue:[]},type:{name:Yo.type}},superTypes:[Vo.$type]},Option:{name:Lg.$type,properties:{name:{name:Lg.name},value:{name:Lg.value,defaultValue:!1}},superTypes:[]},Packet:{name:Xo.$type,properties:{accDescr:{name:Xo.accDescr},accTitle:{name:Xo.accTitle},blocks:{name:Xo.blocks,defaultValue:[]},title:{name:Xo.title}},superTypes:[]},PacketBlock:{name:Jo.$type,properties:{bits:{name:Jo.bits},end:{name:Jo.end},label:{name:Jo.label},start:{name:Jo.start}},superTypes:[]},Pie:{name:os.$type,properties:{accDescr:{name:os.accDescr},accTitle:{name:os.accTitle},sections:{name:os.sections,defaultValue:[]},showData:{name:os.showData,defaultValue:!1},title:{name:os.title}},superTypes:[]},PieSection:{name:Jf.$type,properties:{label:{name:Jf.label},value:{name:Jf.value}},superTypes:[]},Radar:{name:is.$type,properties:{accDescr:{name:is.accDescr},accTitle:{name:is.accTitle},axes:{name:is.axes,defaultValue:[]},curves:{name:is.curves,defaultValue:[]},options:{name:is.options,defaultValue:[]},title:{name:is.title}},superTypes:[]},Section:{name:Dg.$type,properties:{classSelector:{name:Dg.classSelector},name:{name:Dg.name}},superTypes:[Kl.$type]},Service:{name:Ko.$type,properties:{icon:{name:Ko.icon},iconText:{name:Ko.iconText},id:{name:Ko.id},in:{name:Ko.in},title:{name:Ko.title}},superTypes:[]},Statement:{name:Vo.$type,properties:{},superTypes:[]},Treemap:{name:Zo.$type,properties:{accDescr:{name:Zo.accDescr},accTitle:{name:Zo.accTitle},title:{name:Zo.title},TreemapRows:{name:Zo.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Mg.$type,properties:{indent:{name:Mg.indent},item:{name:Mg.item}},superTypes:[]}}}static{s(this,"MermaidAstReflection")}},Cr=new Hl;var wb,Db=s(()=>wb??(wb=tn(`{"$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"),kb,Mb=s(()=>kb??(kb=tn(`{"$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"),Ib,Fb=s(()=>Ib??(Ib=tn(`{"$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"),_b,Gb=s(()=>_b??(_b=tn(`{"$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"),Pb,Ub=s(()=>Pb??(Pb=tn(`{"$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"),Ob,jb=s(()=>Ob??(Ob=tn(`{"$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"),Lb,qb=s(()=>Lb??(Lb=tn(`{"$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");var FM={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},GM={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},UM={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},jM={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},qM={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},BM={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zM={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Qre={AstReflection:s(()=>new Hl,"AstReflection")},ene={Grammar:s(()=>Db(),"Grammar"),LanguageMetaData:s(()=>FM,"LanguageMetaData"),parser:{}},tne={Grammar:s(()=>Mb(),"Grammar"),LanguageMetaData:s(()=>GM,"LanguageMetaData"),parser:{}},rne={Grammar:s(()=>Fb(),"Grammar"),LanguageMetaData:s(()=>UM,"LanguageMetaData"),parser:{}},nne={Grammar:s(()=>Gb(),"Grammar"),LanguageMetaData:s(()=>jM,"LanguageMetaData"),parser:{}},ine={Grammar:s(()=>Ub(),"Grammar"),LanguageMetaData:s(()=>qM,"LanguageMetaData"),parser:{}},sne={Grammar:s(()=>jb(),"Grammar"),LanguageMetaData:s(()=>BM,"LanguageMetaData"),parser:{}},one={Grammar:s(()=>qb(),"Grammar"),LanguageMetaData:s(()=>zM,"LanguageMetaData"),parser:{}};var Bb=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,zb=/accTitle[\t ]*:([^\n\r]*)/,Wb=/title([\t ][^\n\r]*|)/;var WM={ACC_DESCR:Bb,ACC_TITLE:zb,TITLE:Wb},Fg=class extends Vi{static{s(this,"AbstractMermaidValueConverter")}runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){let i=WM[e.name];if(i===void 0)return;let o=i.exec(r);if(o!==null){if(o[1]!==void 0)return o[1].trim().replace(/[\t ]{2,}/gm," ");if(o[2]!==void 0)return o[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` `)}}},Kb=class extends Fg{static{s(this,"CommonValueConverter")}runCustomConverter(e,r,n){}};var Gg=class extends An{static{s(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){let i=super.buildKeywordTokens(e,r,n);return i.forEach(o=>{this.keywords.has(o.name)&&o.PATTERN!==void 0&&(o.PATTERN=new RegExp(o.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},Vb=class extends Gg{static{s(this,"CommonTokenBuilder")}};export{s as a,bg as b,$g as c,qf as d,kg as e,Ke as f,bn as g,Lre as h,Xf as i,Dre as j,Ho as k,Mre as l,ss as m,Fre as n,Vl as o,Gre as p,Yo as q,Ure as r,Xo as s,jre as t,Jo as u,qre as v,os as w,Bre as x,Jf as y,zre as z,is as A,Vo as B,Zo as C,Wre as D,Qre as E,ene as F,tne as G,rne as H,nne as I,ine as J,sne as K,one as L,Fg as M,Kb as N,Gg as O,Vb as P}; /*! Bundled license information: lodash-es/lodash.js: (** * @license * Lodash (Custom Build) * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) */