@jacexh/claude-web-console 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +102 -0
  2. package/bin/cli.js +64 -0
  3. package/claude-web-console.service +26 -0
  4. package/client/dist/assets/_baseUniq-Cnoz3HXL.js +1 -0
  5. package/client/dist/assets/arc-Z_2trbN8.js +1 -0
  6. package/client/dist/assets/architectureDiagram-Q4EWVU46-BkJc1Y5A.js +36 -0
  7. package/client/dist/assets/blockDiagram-DXYQGD6D-DajeZur_.js +132 -0
  8. package/client/dist/assets/c4Diagram-AHTNJAMY-DPrSiSIe.js +10 -0
  9. package/client/dist/assets/channel-xmJgF8AT.js +1 -0
  10. package/client/dist/assets/chunk-4BX2VUAB-Ap8VOuEx.js +1 -0
  11. package/client/dist/assets/chunk-4TB4RGXK-7WUmxI0T.js +206 -0
  12. package/client/dist/assets/chunk-55IACEB6-gyKf_szG.js +1 -0
  13. package/client/dist/assets/chunk-EDXVE4YY-Dqsdf8RE.js +1 -0
  14. package/client/dist/assets/chunk-FMBD7UC4-CFwejjYg.js +15 -0
  15. package/client/dist/assets/chunk-OYMX7WX6-DjhMJFGF.js +231 -0
  16. package/client/dist/assets/chunk-QZHKN3VN-BZl3lFpB.js +1 -0
  17. package/client/dist/assets/chunk-YZCP3GAM-Bgp9VGoJ.js +1 -0
  18. package/client/dist/assets/classDiagram-6PBFFD2Q-CUsL9OeO.js +1 -0
  19. package/client/dist/assets/classDiagram-v2-HSJHXN6E-CUsL9OeO.js +1 -0
  20. package/client/dist/assets/clone-YPoNuUWg.js +1 -0
  21. package/client/dist/assets/cose-bilkent-S5V4N54A-BhMgNxzB.js +1 -0
  22. package/client/dist/assets/cytoscape.esm-BQaXIfA_.js +331 -0
  23. package/client/dist/assets/dagre-KV5264BT-Im4xvruI.js +4 -0
  24. package/client/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  25. package/client/dist/assets/diagram-5BDNPKRD-C_LUH1t_.js +10 -0
  26. package/client/dist/assets/diagram-G4DWMVQ6-ovGPIIZa.js +24 -0
  27. package/client/dist/assets/diagram-MMDJMWI5-Cc_S6QYf.js +43 -0
  28. package/client/dist/assets/diagram-TYMM5635-DNtJ4zRJ.js +24 -0
  29. package/client/dist/assets/erDiagram-SMLLAGMA-mjVqYF51.js +85 -0
  30. package/client/dist/assets/flowDiagram-DWJPFMVM-gfeU3vbm.js +162 -0
  31. package/client/dist/assets/ganttDiagram-T4ZO3ILL-DHzKAwPu.js +292 -0
  32. package/client/dist/assets/gitGraphDiagram-UUTBAWPF-NmVr9v2T.js +106 -0
  33. package/client/dist/assets/graph-DWZBkQul.js +1 -0
  34. package/client/dist/assets/index-Bs3edPh7.js +329 -0
  35. package/client/dist/assets/index-BvGI0U64.css +1 -0
  36. package/client/dist/assets/infoDiagram-42DDH7IO-uZQs2FWg.js +2 -0
  37. package/client/dist/assets/init-Gi6I4Gst.js +1 -0
  38. package/client/dist/assets/ishikawaDiagram-UXIWVN3A-CVqWYfyh.js +70 -0
  39. package/client/dist/assets/journeyDiagram-VCZTEJTY-BM-S2Uek.js +139 -0
  40. package/client/dist/assets/kanban-definition-6JOO6SKY-DtfrMWsW.js +89 -0
  41. package/client/dist/assets/katex-DkKDou_j.js +257 -0
  42. package/client/dist/assets/layout-dcq7fgvs.js +1 -0
  43. package/client/dist/assets/linear-B-FGkSzh.js +1 -0
  44. package/client/dist/assets/mermaid.core-DDFJ1A5Z.js +309 -0
  45. package/client/dist/assets/min-DD4RQeGA.js +1 -0
  46. package/client/dist/assets/mindmap-definition-QFDTVHPH-B1E5NbCo.js +96 -0
  47. package/client/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  48. package/client/dist/assets/pieDiagram-DEJITSTG-Ciel1XRV.js +30 -0
  49. package/client/dist/assets/quadrantDiagram-34T5L4WZ-D1jxP0fH.js +7 -0
  50. package/client/dist/assets/requirementDiagram-MS252O5E-CTXKAocB.js +84 -0
  51. package/client/dist/assets/sankeyDiagram-XADWPNL6-Dj-i0BnN.js +10 -0
  52. package/client/dist/assets/sequenceDiagram-FGHM5R23-kCI4qbes.js +157 -0
  53. package/client/dist/assets/stateDiagram-FHFEXIEX-CiE-lplM.js +1 -0
  54. package/client/dist/assets/stateDiagram-v2-QKLJ7IA2-ZPI5JmoG.js +1 -0
  55. package/client/dist/assets/timeline-definition-GMOUNBTQ-MoAQpvF_.js +120 -0
  56. package/client/dist/assets/vennDiagram-DHZGUBPP-BqTjHn6B.js +34 -0
  57. package/client/dist/assets/wardley-RL74JXVD-C3OshQuH.js +162 -0
  58. package/client/dist/assets/wardleyDiagram-NUSXRM2D-Dl-s9oxJ.js +20 -0
  59. package/client/dist/assets/xychartDiagram-5P7HB3ND-BqyQEiVY.js +7 -0
  60. package/client/dist/index.html +16 -0
  61. package/package.json +57 -0
  62. package/server/src/index.ts +52 -0
  63. package/server/src/session-manager.ts +765 -0
  64. package/server/src/types.ts +295 -0
  65. package/server/src/ws-handler.ts +355 -0
@@ -0,0 +1,162 @@
1
+ var cT=Object.defineProperty;var fT=(t,e,r)=>e in t?cT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Mr=(t,e,r)=>fT(t,typeof e!="symbol"?e+"":e,r);import{a as dT,_ as rr}from"./index-Bs3edPh7.js";import{m as gr,f as pT,d as hT}from"./min-DD4RQeGA.js";import{b as mT,l as gT,c as yT,m as TT,r as ld,n as Dl}from"./_baseUniq-Cnoz3HXL.js";import{ba as RT}from"./mermaid.core-DDFJ1A5Z.js";function vT(t,e){return mT(gr(t,e))}function $T(t,e){return t&&t.length?gT(t,yT(e)):[]}function Xe(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Pt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function zr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function AT(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ta(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class dm{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Xe(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}}function Ga(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function pm(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function hm(t){return Ga(t)&&typeof t.fullText=="string"}class Ke{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let 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){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new Ke(()=>({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 dt})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=ET(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new Ke(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?dt:{done:!1,value:e(i)}})}filter(e){return new Ke(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return dt})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new Ke(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Co(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return dt})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Ke(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Co(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return dt})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Ke(()=>{const r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new Ke(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?dt:this.nextFn(r.state)))}distinct(e){return new Ke(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return dt})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}}function ET(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Co(t){return!!t&&typeof t[Symbol.iterator]=="function"}const mm=new Ke(()=>{},()=>dt),dt=Object.freeze({done:!0,value:void 0});function ve(...t){if(t.length===1){const e=t[0];if(e instanceof Ke)return e;if(Co(e))return new Ke(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Ke(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:dt)}return t.length>1?new Ke(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const r=t[e.collIndex++];Co(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return dt}):mm}class hf extends Ke{constructor(e,r,n){super(()=>({iterators:n!=null&&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;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return dt})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Tu;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}t.max=i})(Tu||(Tu={}));function Ru(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Xe(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&Ru(i,e))}):Xe(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Ru(n,e)))}function Qo(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function yr(t){const r=oo(t).$document;if(!r)throw new Error("AST node has no document.");return r}function oo(t){for(;t.$container;)t=t.$container;return t}function ud(t){return Pt(t)?t.ref?[t.ref]:[]:zr(t)?t.items.map(e=>e.ref):[]}function mf(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Ke(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(Xe(a)){if(n.keyIndex++,cd(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(Xe(o)&&cd(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return dt})}function ns(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new hf(t,r=>mf(r,e))}function Tr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new hf(t,r=>mf(r,e),{includeRoot:!0})}function cd(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?KT(r,e):!1}function So(t){return new Ke(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const r=e.keys[e.keyIndex];if(!r.startsWith("$")){const n=t[r];if(Pt(n)||zr(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){const i=e.arrayIndex++,a=n[i];if(Pt(a)||zr(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return dt})}function CT(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const i of Object.values(r.properties))i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=gm(i.defaultValue))}function gm(t){return Array.isArray(t)?[...t.map(gm)]:t}const ft={$type:"AbstractElement",cardinality:"cardinality"};function ST(t){return te.isInstance(t,ft.$type)}const lo={$type:"AbstractParserRule"};function is(t){return te.isInstance(t,lo.$type)}const Fs={$type:"AbstractRule"},bt={$type:"AbstractType"},hn={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function el(t){return te.isInstance(t,hn.$type)}const uo={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function ym(t){return te.isInstance(t,uo.$type)}const fd={$type:"ArrayLiteral",elements:"elements"},dd={$type:"ArrayType",elementType:"elementType"},mn={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function An(t){return te.isInstance(t,mn.$type)}const vu={$type:"BooleanLiteral",true:"true"};function _T(t){return te.isInstance(t,vu.$type)}const gn={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function wT(t){return te.isInstance(t,gn.$type)}const Un={$type:"Condition"},co={$type:"Conjunction",left:"left",right:"right"};function bT(t){return te.isInstance(t,co.$type)}const yn={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function tl(t){return te.isInstance(t,yn.$type)}const fo={$type:"Disjunction",left:"left",right:"right"};function NT(t){return te.isInstance(t,fo.$type)}const $u={$type:"EndOfFile",cardinality:"cardinality"};function IT(t){return te.isInstance(t,$u.$type)}const Qr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},pd={$type:"GrammarImport",path:"path"},Vn={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function gf(t){return te.isInstance(t,Vn.$type)}const Au={$type:"InferredType",name:"name"};function Tm(t){return te.isInstance(t,Au.$type)}const fr={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function _o(t){return te.isInstance(t,fr.$type)}const Ml={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},hd={$type:"InfixRuleOperators",precedences:"precedences"},wa={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function PT(t){return te.isInstance(t,wa.$type)}const ba={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function En(t){return te.isInstance(t,ba.$type)}const Gs={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},Hn={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function kT(t){return te.isInstance(t,Hn.$type)}const Eu={$type:"Negation",value:"value"};function OT(t){return te.isInstance(t,Eu.$type)}const md={$type:"NumberLiteral",value:"value"},zs={$type:"Parameter",name:"name"},Cu={$type:"ParameterReference",parameter:"parameter"};function LT(t){return te.isInstance(t,Cu.$type)}const Gt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Cr(t){return te.isInstance(t,Gt.$type)}const Fl={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},Yn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function xT(t){return te.isInstance(t,Yn.$type)}const Su={$type:"ReturnType",name:"name"};function DT(t){return te.isInstance(t,Su.$type)}const Xn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Cn(t){return te.isInstance(t,Xn.$type)}const Na={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function MT(t){return te.isInstance(t,Na.$type)}const gd={$type:"StringLiteral",value:"value"},Jn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function FT(t){return te.isInstance(t,Jn.$type)}const yt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},Zn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function GT(t){return te.isInstance(t,Zn.$type)}const Fr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Sr(t){return te.isInstance(t,Fr.$type)}const Qn={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function zT(t){return te.isInstance(t,Qn.$type)}const po={$type:"Type",name:"name",type:"type"};function UT(t){return te.isInstance(t,po.$type)}const ra={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},na={$type:"TypeDefinition"},yd={$type:"UnionType",types:"types"},ho={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Rm(t){return te.isInstance(t,ho.$type)}const ei={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function jT(t){return te.isInstance(t,ei.$type)}const ia={$type:"ValueLiteral"},Ia={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function qT(t){return te.isInstance(t,Ia.$type)}class vm extends dm{constructor(){super(...arguments),this.types={AbstractElement:{name:ft.$type,properties:{cardinality:{name:ft.cardinality}},superTypes:[]},AbstractParserRule:{name:lo.$type,properties:{},superTypes:[Fs.$type,bt.$type]},AbstractRule:{name:Fs.$type,properties:{},superTypes:[]},AbstractType:{name:bt.$type,properties:{},superTypes:[]},Action:{name:hn.$type,properties:{cardinality:{name:hn.cardinality},feature:{name:hn.feature},inferredType:{name:hn.inferredType},operator:{name:hn.operator},type:{name:hn.type,referenceType:bt.$type}},superTypes:[ft.$type]},Alternatives:{name:uo.$type,properties:{cardinality:{name:uo.cardinality},elements:{name:uo.elements,defaultValue:[]}},superTypes:[ft.$type]},ArrayLiteral:{name:fd.$type,properties:{elements:{name:fd.elements,defaultValue:[]}},superTypes:[ia.$type]},ArrayType:{name:dd.$type,properties:{elementType:{name:dd.elementType}},superTypes:[na.$type]},Assignment:{name:mn.$type,properties:{cardinality:{name:mn.cardinality},feature:{name:mn.feature},operator:{name:mn.operator},predicate:{name:mn.predicate},terminal:{name:mn.terminal}},superTypes:[ft.$type]},BooleanLiteral:{name:vu.$type,properties:{true:{name:vu.true,defaultValue:!1}},superTypes:[Un.$type,ia.$type]},CharacterRange:{name:gn.$type,properties:{cardinality:{name:gn.cardinality},left:{name:gn.left},lookahead:{name:gn.lookahead},parenthesized:{name:gn.parenthesized,defaultValue:!1},right:{name:gn.right}},superTypes:[yt.$type]},Condition:{name:Un.$type,properties:{},superTypes:[]},Conjunction:{name:co.$type,properties:{left:{name:co.left},right:{name:co.right}},superTypes:[Un.$type]},CrossReference:{name:yn.$type,properties:{cardinality:{name:yn.cardinality},deprecatedSyntax:{name:yn.deprecatedSyntax,defaultValue:!1},isMulti:{name:yn.isMulti,defaultValue:!1},terminal:{name:yn.terminal},type:{name:yn.type,referenceType:bt.$type}},superTypes:[ft.$type]},Disjunction:{name:fo.$type,properties:{left:{name:fo.left},right:{name:fo.right}},superTypes:[Un.$type]},EndOfFile:{name:$u.$type,properties:{cardinality:{name:$u.cardinality}},superTypes:[ft.$type]},Grammar:{name:Qr.$type,properties:{imports:{name:Qr.imports,defaultValue:[]},interfaces:{name:Qr.interfaces,defaultValue:[]},isDeclared:{name:Qr.isDeclared,defaultValue:!1},name:{name:Qr.name},rules:{name:Qr.rules,defaultValue:[]},types:{name:Qr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:pd.$type,properties:{path:{name:pd.path}},superTypes:[]},Group:{name:Vn.$type,properties:{cardinality:{name:Vn.cardinality},elements:{name:Vn.elements,defaultValue:[]},guardCondition:{name:Vn.guardCondition},predicate:{name:Vn.predicate}},superTypes:[ft.$type]},InferredType:{name:Au.$type,properties:{name:{name:Au.name}},superTypes:[bt.$type]},InfixRule:{name:fr.$type,properties:{call:{name:fr.call},dataType:{name:fr.dataType},inferredType:{name:fr.inferredType},name:{name:fr.name},operators:{name:fr.operators},parameters:{name:fr.parameters,defaultValue:[]},returnType:{name:fr.returnType,referenceType:bt.$type}},superTypes:[lo.$type]},InfixRuleOperatorList:{name:Ml.$type,properties:{associativity:{name:Ml.associativity},operators:{name:Ml.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:hd.$type,properties:{precedences:{name:hd.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:wa.$type,properties:{attributes:{name:wa.attributes,defaultValue:[]},name:{name:wa.name},superTypes:{name:wa.superTypes,defaultValue:[],referenceType:bt.$type}},superTypes:[bt.$type]},Keyword:{name:ba.$type,properties:{cardinality:{name:ba.cardinality},predicate:{name:ba.predicate},value:{name:ba.value}},superTypes:[ft.$type]},NamedArgument:{name:Gs.$type,properties:{calledByName:{name:Gs.calledByName,defaultValue:!1},parameter:{name:Gs.parameter,referenceType:zs.$type},value:{name:Gs.value}},superTypes:[]},NegatedToken:{name:Hn.$type,properties:{cardinality:{name:Hn.cardinality},lookahead:{name:Hn.lookahead},parenthesized:{name:Hn.parenthesized,defaultValue:!1},terminal:{name:Hn.terminal}},superTypes:[yt.$type]},Negation:{name:Eu.$type,properties:{value:{name:Eu.value}},superTypes:[Un.$type]},NumberLiteral:{name:md.$type,properties:{value:{name:md.value}},superTypes:[ia.$type]},Parameter:{name:zs.$type,properties:{name:{name:zs.name}},superTypes:[]},ParameterReference:{name:Cu.$type,properties:{parameter:{name:Cu.parameter,referenceType:zs.$type}},superTypes:[Un.$type]},ParserRule:{name:Gt.$type,properties:{dataType:{name:Gt.dataType},definition:{name:Gt.definition},entry:{name:Gt.entry,defaultValue:!1},fragment:{name:Gt.fragment,defaultValue:!1},inferredType:{name:Gt.inferredType},name:{name:Gt.name},parameters:{name:Gt.parameters,defaultValue:[]},returnType:{name:Gt.returnType,referenceType:bt.$type}},superTypes:[lo.$type]},ReferenceType:{name:Fl.$type,properties:{isMulti:{name:Fl.isMulti,defaultValue:!1},referenceType:{name:Fl.referenceType}},superTypes:[na.$type]},RegexToken:{name:Yn.$type,properties:{cardinality:{name:Yn.cardinality},lookahead:{name:Yn.lookahead},parenthesized:{name:Yn.parenthesized,defaultValue:!1},regex:{name:Yn.regex}},superTypes:[yt.$type]},ReturnType:{name:Su.$type,properties:{name:{name:Su.name}},superTypes:[]},RuleCall:{name:Xn.$type,properties:{arguments:{name:Xn.arguments,defaultValue:[]},cardinality:{name:Xn.cardinality},predicate:{name:Xn.predicate},rule:{name:Xn.rule,referenceType:Fs.$type}},superTypes:[ft.$type]},SimpleType:{name:Na.$type,properties:{primitiveType:{name:Na.primitiveType},stringType:{name:Na.stringType},typeRef:{name:Na.typeRef,referenceType:bt.$type}},superTypes:[na.$type]},StringLiteral:{name:gd.$type,properties:{value:{name:gd.value}},superTypes:[ia.$type]},TerminalAlternatives:{name:Jn.$type,properties:{cardinality:{name:Jn.cardinality},elements:{name:Jn.elements,defaultValue:[]},lookahead:{name:Jn.lookahead},parenthesized:{name:Jn.parenthesized,defaultValue:!1}},superTypes:[yt.$type]},TerminalElement:{name:yt.$type,properties:{cardinality:{name:yt.cardinality},lookahead:{name:yt.lookahead},parenthesized:{name:yt.parenthesized,defaultValue:!1}},superTypes:[ft.$type]},TerminalGroup:{name:Zn.$type,properties:{cardinality:{name:Zn.cardinality},elements:{name:Zn.elements,defaultValue:[]},lookahead:{name:Zn.lookahead},parenthesized:{name:Zn.parenthesized,defaultValue:!1}},superTypes:[yt.$type]},TerminalRule:{name:Fr.$type,properties:{definition:{name:Fr.definition},fragment:{name:Fr.fragment,defaultValue:!1},hidden:{name:Fr.hidden,defaultValue:!1},name:{name:Fr.name},type:{name:Fr.type}},superTypes:[Fs.$type]},TerminalRuleCall:{name:Qn.$type,properties:{cardinality:{name:Qn.cardinality},lookahead:{name:Qn.lookahead},parenthesized:{name:Qn.parenthesized,defaultValue:!1},rule:{name:Qn.rule,referenceType:Fr.$type}},superTypes:[yt.$type]},Type:{name:po.$type,properties:{name:{name:po.name},type:{name:po.type}},superTypes:[bt.$type]},TypeAttribute:{name:ra.$type,properties:{defaultValue:{name:ra.defaultValue},isOptional:{name:ra.isOptional,defaultValue:!1},name:{name:ra.name},type:{name:ra.type}},superTypes:[]},TypeDefinition:{name:na.$type,properties:{},superTypes:[]},UnionType:{name:yd.$type,properties:{types:{name:yd.types,defaultValue:[]}},superTypes:[na.$type]},UnorderedGroup:{name:ho.$type,properties:{cardinality:{name:ho.cardinality},elements:{name:ho.elements,defaultValue:[]}},superTypes:[ft.$type]},UntilToken:{name:ei.$type,properties:{cardinality:{name:ei.cardinality},lookahead:{name:ei.lookahead},parenthesized:{name:ei.parenthesized,defaultValue:!1},terminal:{name:ei.terminal}},superTypes:[yt.$type]},ValueLiteral:{name:ia.$type,properties:{},superTypes:[]},Wildcard:{name:Ia.$type,properties:{cardinality:{name:Ia.cardinality},lookahead:{name:Ia.lookahead},parenthesized:{name:Ia.parenthesized,defaultValue:!1}},superTypes:[yt.$type]}}}}const te=new vm;function _u(t){return new hf(t,e=>Ga(e)?e.content:[],{includeRoot:!0})}function BT(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function wu(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function wo(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var hr;(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"})(hr||(hr={}));function WT(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return hr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return hr.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?hr.Inside:r?hr.OverlapBack:n?hr.OverlapFront:hr.Outside}function KT(t,e){return WT(t,e)>hr.After}const VT=/^[\w\p{L}]$/u;function HT(t,e){if(t){const r=YT(t,!0);if(r&&Td(r,e))return r;if(hm(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(Td(a,e))return a}}}}function Td(t,e){return pm(t)&&e.includes(t.tokenType.name)}function YT(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}class $m extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function as(t,e="Error: Got unexpected value."){throw new Error(e)}function B(t){return t.charCodeAt(0)}function Gl(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function aa(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function jn(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function XT(){throw Error("Internal Error - Should never get here!")}function Rd(t){return t.type==="Character"}const bo=[];for(let t=B("0");t<=B("9");t++)bo.push(t);const No=[B("_")].concat(bo);for(let t=B("a");t<=B("z");t++)No.push(t);for(let t=B("A");t<=B("Z");t++)No.push(t);const vd=[B(" "),B("\f"),B(`
2
+ `),B("\r"),B(" "),B("\v"),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B("\u2028"),B("\u2029"),B(" "),B(" "),B(" "),B("\uFEFF")],JT=/[0-9a-fA-F]/,Us=/[0-9]/,ZT=/[1-9]/;class Am{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("/");const r=this.disjunction();this.consumeChar("/");const 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":aa(n,"global");break;case"i":aa(n,"ignoreCase");break;case"m":aa(n,"multiLine");break;case"u":aa(n,"unicode");break;case"y":aa(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(){const 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(){const 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(){const 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}}jn(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return XT()}quantifier(e=!1){let r;const 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"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;jn(r);break}if(!(e===!0&&r===void 0)&&jn(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;const 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}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),jn(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[B(`
3
+ `),B("\r"),B("\u2028"),B("\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=bo;break;case"D":e=bo,r=!0;break;case"s":e=vd;break;case"S":e=vd,r=!0;break;case"w":e=No;break;case"W":e=No,r=!0;break}if(jn(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=B("\f");break;case"n":e=B(`
4
+ `);break;case"r":e=B("\r");break;case"t":e=B(" ");break;case"v":e=B("\v");break}if(jn(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const 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:B("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:B(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:B(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,Rd(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,Rd(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else Gl(n.value,e),e.push(B("-")),Gl(i.value,e)}else Gl(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
6
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:B("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const r=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(ZT.test(e)===!1)throw Error("Expecting a positive integer");for(;Us.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Us.test(e)===!1)throw Error("Expecting an integer");for(;Us.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
7
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:B(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Us.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
8
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
9
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){const a=this.popChar();if(JT.test(a)===!1)throw Error("Expecting a HexDecimal digits");r+=a}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class rl{visitChildren(e){for(const r in e){const 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){}}const QT=/\r?\n/gm,eR=new Am;class tR extends rl{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){const r=String.fromCharCode(e.value);if(!this.multiline&&r===`
10
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=nl(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
11
+ `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const 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)}}const zl=new tR;function rR(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),zl.reset(t),zl.visit(eR.pattern(t)),zl.multiline}catch{return!1}}const nR=`\f
12
+ \r \v              \u2028\u2029   \uFEFF`.split("");function Em(t){const e=typeof t=="string"?new RegExp(t):t;return nR.some(r=>e.test(r))}function nl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function iR(t,e){const r=aR(t),n=e.match(r);return!!n&&n[0].length>0}function aR(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?r[n+2]==="{"?l(r.indexOf("}",n)-n+1):l(6):l(2);break;case"p":case"P":e.unicode?l(r.indexOf("}",n)-n+1):l(2);break;case"k":l(r.indexOf(">",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return new RegExp(i(),t.flags)}function sR(t){return t.rules.find(e=>Cr(e)&&e.entry)}function oR(t){return t.rules.filter(e=>Sr(e)&&e.hidden)}function Cm(t,e){const r=new Set,n=sR(t);if(!n)return new Set(t.rules);const i=[n].concat(oR(t));for(const s of i)Sm(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Sr(s)&&s.hidden)&&a.add(s);return a}function Sm(t,e,r){e.add(t.name),ns(t).forEach(n=>{if(Cn(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&Sm(i,e,r)}})}function lR(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=wm(t.type.ref);return e==null?void 0:e.terminal}}function uR(t){return t.hidden&&!Em(Tf(t))}function cR(t,e){return!t||!e?[]:yf(t,e,t.astNode,!0)}function _m(t,e,r){if(!t||!e)return;const n=yf(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function yf(t,e,r,n){if(!n){const i=Qo(t.grammarSource,An);if(i&&i.feature===e)return[t]}return Ga(t)&&t.astNode===r?t.content.flatMap(i=>yf(i,e,r,!1)):[]}function fR(t,e,r){if(!t)return;const n=dR(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function dR(t,e,r){if(t.astNode!==r)return[];if(En(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=_u(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?En(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function pR(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=Qo(t.grammarSource,An);if(n)return n;t=t.container}}function wm(t){let e=t;return Tm(e)&&(el(e.$container)?e=e.$container.$container:is(e.$container)?e=e.$container:as(e.$container)),bm(t,e,new Map)}function bm(t,e,r){var i;function n(a,s){let o;return Qo(a,An)||(o=bm(s,s,r)),r.set(t,o),o}if(r.has(t))return r.get(t);r.set(t,void 0);for(const a of ns(e)){if(An(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Cn(a)&&Cr(a.rule.ref))return n(a,a.rule.ref);if(MT(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}function Nm(t){return Im(t,new Set)}function Im(t,e){if(e.has(t))return!0;e.add(t);for(const r of ns(t))if(Cn(r)){if(!r.rule.ref||Cr(r.rule.ref)&&!Im(r.rule.ref,e)||_o(r.rule.ref))return!1}else{if(An(r))return!1;if(el(r))return!1}return!!t.definition}function Pm(t){if(!Sr(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}function za(t){if(is(t))return Cr(t)&&Nm(t)?t.name:Pm(t)??t.name;if(PT(t)||UT(t)||DT(t))return t.name;if(el(t)){const e=hR(t);if(e)return e}else if(Tm(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function hR(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return za(t.type.ref)}function mR(t){var e;return Sr(t)?((e=t.type)==null?void 0:e.name)??"string":Pm(t)??t.name}function Tf(t){const e={s:!1,i:!1,u:!1},r=Mi(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const Rf=/[\s\S]/.source;function Mi(t,e){var r;if(FT(t))return gR(t);if(GT(t))return yR(t);if(wT(t))return vR(t);if(zT(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Rr(Mi(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(kT(t))return RR(t);if(jT(t))return TR(t);if(xT(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Rr(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(qT(t))return Rr(Rf,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}function gR(t){return Rr(t.elements.map(e=>Mi(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function yR(t){return Rr(t.elements.map(e=>Mi(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function TR(t){return Rr(`${Rf}*?${Mi(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function RR(t){return Rr(`(?!${Mi(t.terminal)})${Rf}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function vR(t){return t.right?Rr(`[${Ul(t.left)}-${Ul(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Rr(Ul(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Ul(t){return nl(t.value)}function Rr(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function $R(t){const e=[],r=t.Grammar;for(const n of r.rules)Sr(n)&&uR(n)&&rR(Tf(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:VT}}var km=typeof global=="object"&&global&&global.Object===Object&&global,AR=typeof self=="object"&&self&&self.Object===Object&&self,Wt=km||AR||Function("return this")(),vt=Wt.Symbol,Om=Object.prototype,ER=Om.hasOwnProperty,CR=Om.toString,sa=vt?vt.toStringTag:void 0;function SR(t){var e=ER.call(t,sa),r=t[sa];try{t[sa]=void 0;var n=!0}catch{}var i=CR.call(t);return n&&(e?t[sa]=r:delete t[sa]),i}var _R=Object.prototype,wR=_R.toString;function bR(t){return wR.call(t)}var NR="[object Null]",IR="[object Undefined]",$d=vt?vt.toStringTag:void 0;function Hr(t){return t==null?t===void 0?IR:NR:$d&&$d in Object(t)?SR(t):bR(t)}function Lt(t){return t!=null&&typeof t=="object"}var PR="[object Symbol]";function il(t){return typeof t=="symbol"||Lt(t)&&Hr(t)==PR}function al(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Q=Array.isArray,Ad=vt?vt.prototype:void 0,Ed=Ad?Ad.toString:void 0;function Lm(t){if(typeof t=="string")return t;if(Q(t))return al(t,Lm)+"";if(il(t))return Ed?Ed.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var kR=/\s/;function OR(t){for(var e=t.length;e--&&kR.test(t.charAt(e)););return e}var LR=/^\s+/;function xR(t){return t&&t.slice(0,OR(t)+1).replace(LR,"")}function $t(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Cd=NaN,DR=/^[-+]0x[0-9a-f]+$/i,MR=/^0b[01]+$/i,FR=/^0o[0-7]+$/i,GR=parseInt;function zR(t){if(typeof t=="number")return t;if(il(t))return Cd;if($t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=$t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=xR(t);var r=MR.test(t);return r||FR.test(t)?GR(t.slice(2),r?2:8):DR.test(t)?Cd:+t}var Sd=1/0,UR=17976931348623157e292;function jR(t){if(!t)return t===0?t:0;if(t=zR(t),t===Sd||t===-Sd){var e=t<0?-1:1;return e*UR}return t===t?t:0}function sl(t){var e=jR(t),r=e%1;return e===e?r?e-r:e:0}function ss(t){return t}var qR="[object AsyncFunction]",BR="[object Function]",WR="[object GeneratorFunction]",KR="[object Proxy]";function _r(t){if(!$t(t))return!1;var e=Hr(t);return e==BR||e==WR||e==qR||e==KR}var jl=Wt["__core-js_shared__"],_d=(function(){var t=/[^.]+$/.exec(jl&&jl.keys&&jl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function VR(t){return!!_d&&_d in t}var HR=Function.prototype,YR=HR.toString;function Pn(t){if(t!=null){try{return YR.call(t)}catch{}try{return t+""}catch{}}return""}var XR=/[\\^$.*+?()[\]{}|]/g,JR=/^\[object .+?Constructor\]$/,ZR=Function.prototype,QR=Object.prototype,ev=ZR.toString,tv=QR.hasOwnProperty,rv=RegExp("^"+ev.call(tv).replace(XR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nv(t){if(!$t(t)||VR(t))return!1;var e=_r(t)?rv:JR;return e.test(Pn(t))}function iv(t,e){return t==null?void 0:t[e]}function kn(t,e){var r=iv(t,e);return nv(r)?r:void 0}var bu=kn(Wt,"WeakMap"),wd=Object.create,av=(function(){function t(){}return function(e){if(!$t(e))return{};if(wd)return wd(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function sv(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Fe(){}function ov(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var lv=800,uv=16,cv=Date.now;function fv(t){var e=0,r=0;return function(){var n=cv(),i=uv-(n-r);if(r=n,i>0){if(++e>=lv)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function dv(t){return function(){return t}}var Io=(function(){try{var t=kn(Object,"defineProperty");return t({},"",{}),t}catch{}})(),pv=Io?function(t,e){return Io(t,"toString",{configurable:!0,enumerable:!1,value:dv(e),writable:!0})}:ss,hv=fv(pv);function xm(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function Dm(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function mv(t){return t!==t}function gv(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function vf(t,e,r){return e===e?gv(t,e,r):Dm(t,mv,r)}function Mm(t,e){var r=t==null?0:t.length;return!!r&&vf(t,e,0)>-1}var yv=9007199254740991,Tv=/^(?:0|[1-9]\d*)$/;function ol(t,e){var r=typeof t;return e=e??yv,!!e&&(r=="number"||r!="symbol"&&Tv.test(t))&&t>-1&&t%1==0&&t<e}function $f(t,e,r){e=="__proto__"&&Io?Io(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function os(t,e){return t===e||t!==t&&e!==e}var Rv=Object.prototype,vv=Rv.hasOwnProperty;function ll(t,e,r){var n=t[e];(!(vv.call(t,e)&&os(n,r))||r===void 0&&!(e in t))&&$f(t,e,r)}function ls(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),i?$f(r,o,l):ll(r,o,l)}return r}var bd=Math.max;function $v(t,e,r){return e=bd(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=bd(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),sv(t,this,o)}}function Af(t,e){return hv($v(t,e,ss),t+"")}var Av=9007199254740991;function Ef(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Av}function Kt(t){return t!=null&&Ef(t.length)&&!_r(t)}function Fm(t,e,r){if(!$t(r))return!1;var n=typeof e;return(n=="number"?Kt(r)&&ol(e,r.length):n=="string"&&e in r)?os(r[e],t):!1}function Ev(t){return Af(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&Fm(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var Cv=Object.prototype;function us(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Cv;return t===r}function Sv(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var _v="[object Arguments]";function Nd(t){return Lt(t)&&Hr(t)==_v}var Gm=Object.prototype,wv=Gm.hasOwnProperty,bv=Gm.propertyIsEnumerable,ul=Nd((function(){return arguments})())?Nd:function(t){return Lt(t)&&wv.call(t,"callee")&&!bv.call(t,"callee")};function Nv(){return!1}var zm=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Id=zm&&typeof module=="object"&&module&&!module.nodeType&&module,Iv=Id&&Id.exports===zm,Pd=Iv?Wt.Buffer:void 0,Pv=Pd?Pd.isBuffer:void 0,Ua=Pv||Nv,kv="[object Arguments]",Ov="[object Array]",Lv="[object Boolean]",xv="[object Date]",Dv="[object Error]",Mv="[object Function]",Fv="[object Map]",Gv="[object Number]",zv="[object Object]",Uv="[object RegExp]",jv="[object Set]",qv="[object String]",Bv="[object WeakMap]",Wv="[object ArrayBuffer]",Kv="[object DataView]",Vv="[object Float32Array]",Hv="[object Float64Array]",Yv="[object Int8Array]",Xv="[object Int16Array]",Jv="[object Int32Array]",Zv="[object Uint8Array]",Qv="[object Uint8ClampedArray]",e$="[object Uint16Array]",t$="[object Uint32Array]",de={};de[Vv]=de[Hv]=de[Yv]=de[Xv]=de[Jv]=de[Zv]=de[Qv]=de[e$]=de[t$]=!0;de[kv]=de[Ov]=de[Wv]=de[Lv]=de[Kv]=de[xv]=de[Dv]=de[Mv]=de[Fv]=de[Gv]=de[zv]=de[Uv]=de[jv]=de[qv]=de[Bv]=!1;function r$(t){return Lt(t)&&Ef(t.length)&&!!de[Hr(t)]}function cl(t){return function(e){return t(e)}}var Um=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Da=Um&&typeof module=="object"&&module&&!module.nodeType&&module,n$=Da&&Da.exports===Um,ql=n$&&km.process,Ur=(function(){try{var t=Da&&Da.require&&Da.require("util").types;return t||ql&&ql.binding&&ql.binding("util")}catch{}})(),kd=Ur&&Ur.isTypedArray,Cf=kd?cl(kd):r$,i$=Object.prototype,a$=i$.hasOwnProperty;function jm(t,e){var r=Q(t),n=!r&&ul(t),i=!r&&!n&&Ua(t),a=!r&&!n&&!i&&Cf(t),s=r||n||i||a,o=s?Sv(t.length,String):[],l=o.length;for(var u in t)(e||a$.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ol(u,l)))&&o.push(u);return o}function qm(t,e){return function(r){return t(e(r))}}var s$=qm(Object.keys,Object),o$=Object.prototype,l$=o$.hasOwnProperty;function Bm(t){if(!us(t))return s$(t);var e=[];for(var r in Object(t))l$.call(t,r)&&r!="constructor"&&e.push(r);return e}function At(t){return Kt(t)?jm(t):Bm(t)}var u$=Object.prototype,c$=u$.hasOwnProperty,Nu=Ev(function(t,e){if(us(e)||Kt(e)){ls(e,At(e),t);return}for(var r in e)c$.call(e,r)&&ll(t,r,e[r])});function f$(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var d$=Object.prototype,p$=d$.hasOwnProperty;function h$(t){if(!$t(t))return f$(t);var e=us(t),r=[];for(var n in t)n=="constructor"&&(e||!p$.call(t,n))||r.push(n);return r}function Sf(t){return Kt(t)?jm(t,!0):h$(t)}var m$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g$=/^\w*$/;function _f(t,e){if(Q(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||il(t)?!0:g$.test(t)||!m$.test(t)||e!=null&&t in Object(e)}var ja=kn(Object,"create");function y$(){this.__data__=ja?ja(null):{},this.size=0}function T$(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var R$="__lodash_hash_undefined__",v$=Object.prototype,$$=v$.hasOwnProperty;function A$(t){var e=this.__data__;if(ja){var r=e[t];return r===R$?void 0:r}return $$.call(e,t)?e[t]:void 0}var E$=Object.prototype,C$=E$.hasOwnProperty;function S$(t){var e=this.__data__;return ja?e[t]!==void 0:C$.call(e,t)}var _$="__lodash_hash_undefined__";function w$(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ja&&e===void 0?_$:e,this}function Sn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Sn.prototype.clear=y$;Sn.prototype.delete=T$;Sn.prototype.get=A$;Sn.prototype.has=S$;Sn.prototype.set=w$;function b$(){this.__data__=[],this.size=0}function fl(t,e){for(var r=t.length;r--;)if(os(t[r][0],e))return r;return-1}var N$=Array.prototype,I$=N$.splice;function P$(t){var e=this.__data__,r=fl(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():I$.call(e,r,1),--this.size,!0}function k$(t){var e=this.__data__,r=fl(e,t);return r<0?void 0:e[r][1]}function O$(t){return fl(this.__data__,t)>-1}function L$(t,e){var r=this.__data__,n=fl(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function wr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}wr.prototype.clear=b$;wr.prototype.delete=P$;wr.prototype.get=k$;wr.prototype.has=O$;wr.prototype.set=L$;var qa=kn(Wt,"Map");function x$(){this.size=0,this.__data__={hash:new Sn,map:new(qa||wr),string:new Sn}}function D$(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function dl(t,e){var r=t.__data__;return D$(e)?r[typeof e=="string"?"string":"hash"]:r.map}function M$(t){var e=dl(this,t).delete(t);return this.size-=e?1:0,e}function F$(t){return dl(this,t).get(t)}function G$(t){return dl(this,t).has(t)}function z$(t,e){var r=dl(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function br(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}br.prototype.clear=x$;br.prototype.delete=M$;br.prototype.get=F$;br.prototype.has=G$;br.prototype.set=z$;var U$="Expected a function";function wf(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(U$);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(wf.Cache||br),r}wf.Cache=br;var j$=500;function q$(t){var e=wf(t,function(n){return r.size===j$&&r.clear(),n}),r=e.cache;return e}var B$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W$=/\\(\\)?/g,K$=q$(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(B$,function(r,n,i,a){e.push(i?a.replace(W$,"$1"):n||r)}),e});function V$(t){return t==null?"":Lm(t)}function pl(t,e){return Q(t)?t:_f(t,e)?[t]:K$(V$(t))}function cs(t){if(typeof t=="string"||il(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function bf(t,e){e=pl(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[cs(e[r++])];return r&&r==n?t:void 0}function H$(t,e,r){var n=t==null?void 0:bf(t,e);return n===void 0?r:n}function Nf(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Od=vt?vt.isConcatSpreadable:void 0;function Y$(t){return Q(t)||ul(t)||!!(Od&&t&&t[Od])}function If(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=Y$),i||(i=[]);++a<s;){var o=t[a];r(o)?Nf(i,o):n||(i[i.length]=o)}return i}function kt(t){var e=t==null?0:t.length;return e?If(t):[]}var Wm=qm(Object.getPrototypeOf,Object);function Km(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 a=Array(i);++n<i;)a[n]=t[n+e];return a}function X$(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}function J$(){this.__data__=new wr,this.size=0}function Z$(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Q$(t){return this.__data__.get(t)}function eA(t){return this.__data__.has(t)}var tA=200;function rA(t,e){var r=this.__data__;if(r instanceof wr){var n=r.__data__;if(!qa||n.length<tA-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new br(n)}return r.set(t,e),this.size=r.size,this}function jt(t){var e=this.__data__=new wr(t);this.size=e.size}jt.prototype.clear=J$;jt.prototype.delete=Z$;jt.prototype.get=Q$;jt.prototype.has=eA;jt.prototype.set=rA;function nA(t,e){return t&&ls(e,At(e),t)}function iA(t,e){return t&&ls(e,Sf(e),t)}var Vm=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ld=Vm&&typeof module=="object"&&module&&!module.nodeType&&module,aA=Ld&&Ld.exports===Vm,xd=aA?Wt.Buffer:void 0,Dd=xd?xd.allocUnsafe:void 0;function sA(t,e){var r=t.length,n=Dd?Dd(r):new t.constructor(r);return t.copy(n),n}function Pf(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function Hm(){return[]}var oA=Object.prototype,lA=oA.propertyIsEnumerable,Md=Object.getOwnPropertySymbols,kf=Md?function(t){return t==null?[]:(t=Object(t),Pf(Md(t),function(e){return lA.call(t,e)}))}:Hm;function uA(t,e){return ls(t,kf(t),e)}var cA=Object.getOwnPropertySymbols,Ym=cA?function(t){for(var e=[];t;)Nf(e,kf(t)),t=Wm(t);return e}:Hm;function fA(t,e){return ls(t,Ym(t),e)}function Xm(t,e,r){var n=e(t);return Q(t)?n:Nf(n,r(t))}function Iu(t){return Xm(t,At,kf)}function dA(t){return Xm(t,Sf,Ym)}var Pu=kn(Wt,"DataView"),ku=kn(Wt,"Promise"),li=kn(Wt,"Set"),Fd="[object Map]",pA="[object Object]",Gd="[object Promise]",zd="[object Set]",Ud="[object WeakMap]",jd="[object DataView]",hA=Pn(Pu),mA=Pn(qa),gA=Pn(ku),yA=Pn(li),TA=Pn(bu),Tt=Hr;(Pu&&Tt(new Pu(new ArrayBuffer(1)))!=jd||qa&&Tt(new qa)!=Fd||ku&&Tt(ku.resolve())!=Gd||li&&Tt(new li)!=zd||bu&&Tt(new bu)!=Ud)&&(Tt=function(t){var e=Hr(t),r=e==pA?t.constructor:void 0,n=r?Pn(r):"";if(n)switch(n){case hA:return jd;case mA:return Fd;case gA:return Gd;case yA:return zd;case TA:return Ud}return e});var RA=Object.prototype,vA=RA.hasOwnProperty;function $A(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&vA.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Po=Wt.Uint8Array;function AA(t){var e=new t.constructor(t.byteLength);return new Po(e).set(new Po(t)),e}function EA(t,e){var r=t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var CA=/\w*$/;function SA(t){var e=new t.constructor(t.source,CA.exec(t));return e.lastIndex=t.lastIndex,e}var qd=vt?vt.prototype:void 0,Bd=qd?qd.valueOf:void 0;function _A(t){return Bd?Object(Bd.call(t)):{}}function wA(t,e){var r=t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var bA="[object Boolean]",NA="[object Date]",IA="[object Map]",PA="[object Number]",kA="[object RegExp]",OA="[object Set]",LA="[object String]",xA="[object Symbol]",DA="[object ArrayBuffer]",MA="[object DataView]",FA="[object Float32Array]",GA="[object Float64Array]",zA="[object Int8Array]",UA="[object Int16Array]",jA="[object Int32Array]",qA="[object Uint8Array]",BA="[object Uint8ClampedArray]",WA="[object Uint16Array]",KA="[object Uint32Array]";function VA(t,e,r){var n=t.constructor;switch(e){case DA:return AA(t);case bA:case NA:return new n(+t);case MA:return EA(t);case FA:case GA:case zA:case UA:case jA:case qA:case BA:case WA:case KA:return wA(t);case IA:return new n;case PA:case LA:return new n(t);case kA:return SA(t);case OA:return new n;case xA:return _A(t)}}function HA(t){return typeof t.constructor=="function"&&!us(t)?av(Wm(t)):{}}var YA="[object Map]";function XA(t){return Lt(t)&&Tt(t)==YA}var Wd=Ur&&Ur.isMap,JA=Wd?cl(Wd):XA,ZA="[object Set]";function QA(t){return Lt(t)&&Tt(t)==ZA}var Kd=Ur&&Ur.isSet,eE=Kd?cl(Kd):QA,tE=2,Jm="[object Arguments]",rE="[object Array]",nE="[object Boolean]",iE="[object Date]",aE="[object Error]",Zm="[object Function]",sE="[object GeneratorFunction]",oE="[object Map]",lE="[object Number]",Qm="[object Object]",uE="[object RegExp]",cE="[object Set]",fE="[object String]",dE="[object Symbol]",pE="[object WeakMap]",hE="[object ArrayBuffer]",mE="[object DataView]",gE="[object Float32Array]",yE="[object Float64Array]",TE="[object Int8Array]",RE="[object Int16Array]",vE="[object Int32Array]",$E="[object Uint8Array]",AE="[object Uint8ClampedArray]",EE="[object Uint16Array]",CE="[object Uint32Array]",ue={};ue[Jm]=ue[rE]=ue[hE]=ue[mE]=ue[nE]=ue[iE]=ue[gE]=ue[yE]=ue[TE]=ue[RE]=ue[vE]=ue[oE]=ue[lE]=ue[Qm]=ue[uE]=ue[cE]=ue[fE]=ue[dE]=ue[$E]=ue[AE]=ue[EE]=ue[CE]=!0;ue[aE]=ue[Zm]=ue[pE]=!1;function mo(t,e,r,n,i,a){var s,o=e&tE;if(s!==void 0)return s;if(!$t(t))return t;var l=Q(t);if(l)return s=$A(t),ov(t,s);var u=Tt(t),c=u==Zm||u==sE;if(Ua(t))return sA(t);if(u==Qm||u==Jm||c&&!i)return s=c?{}:HA(t),o?fA(t,iA(s,t)):uA(t,nA(s,t));if(!ue[u])return i?t:{};s=VA(t,u),a||(a=new jt);var f=a.get(t);if(f)return f;a.set(t,s),eE(t)?t.forEach(function(y){s.add(mo(y,e,r,y,t,a))}):JA(t)&&t.forEach(function(y,A){s.set(A,mo(y,e,r,A,t,a))});var h=Iu,p=l?void 0:h(t);return xm(p||t,function(y,A){p&&(A=y,y=t[A]),ll(s,A,mo(y,e,r,A,t,a))}),s}var SE=4;function Ye(t){return mo(t,SE)}function fs(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var a=t[e];a&&(i[n++]=a)}return i}var _E="__lodash_hash_undefined__";function wE(t){return this.__data__.set(t,_E),this}function bE(t){return this.__data__.has(t)}function Ii(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new br;++e<r;)this.add(t[e])}Ii.prototype.add=Ii.prototype.push=wE;Ii.prototype.has=bE;function eg(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Of(t,e){return t.has(e)}var NE=1,IE=2;function tg(t,e,r,n,i,a){var s=r&NE,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))return!1;var u=a.get(t),c=a.get(e);if(u&&c)return u==e&&c==t;var f=-1,h=!0,p=r&IE?new Ii:void 0;for(a.set(t,e),a.set(e,t);++f<o;){var y=t[f],A=e[f];if(n)var N=s?n(A,y,f,e,t,a):n(y,A,f,t,e,a);if(N!==void 0){if(N)continue;h=!1;break}if(p){if(!eg(e,function(C,S){if(!Of(p,S)&&(y===C||i(y,C,r,n,a)))return p.push(S)})){h=!1;break}}else if(!(y===A||i(y,A,r,n,a))){h=!1;break}}return a.delete(t),a.delete(e),h}function PE(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function Lf(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var kE=1,OE=2,LE="[object Boolean]",xE="[object Date]",DE="[object Error]",ME="[object Map]",FE="[object Number]",GE="[object RegExp]",zE="[object Set]",UE="[object String]",jE="[object Symbol]",qE="[object ArrayBuffer]",BE="[object DataView]",Vd=vt?vt.prototype:void 0,Bl=Vd?Vd.valueOf:void 0;function WE(t,e,r,n,i,a,s){switch(r){case BE:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case qE:return!(t.byteLength!=e.byteLength||!a(new Po(t),new Po(e)));case LE:case xE:case FE:return os(+t,+e);case DE:return t.name==e.name&&t.message==e.message;case GE:case UE:return t==e+"";case ME:var o=PE;case zE:var l=n&kE;if(o||(o=Lf),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;n|=OE,s.set(t,e);var c=tg(o(t),o(e),n,i,a,s);return s.delete(t),c;case jE:if(Bl)return Bl.call(t)==Bl.call(e)}return!1}var KE=1,VE=Object.prototype,HE=VE.hasOwnProperty;function YE(t,e,r,n,i,a){var s=r&KE,o=Iu(t),l=o.length,u=Iu(e),c=u.length;if(l!=c&&!s)return!1;for(var f=l;f--;){var h=o[f];if(!(s?h in e:HE.call(e,h)))return!1}var p=a.get(t),y=a.get(e);if(p&&y)return p==e&&y==t;var A=!0;a.set(t,e),a.set(e,t);for(var N=s;++f<l;){h=o[f];var C=t[h],S=e[h];if(n)var _=s?n(S,C,h,e,t,a):n(C,S,h,t,e,a);if(!(_===void 0?C===S||i(C,S,r,n,a):_)){A=!1;break}N||(N=h=="constructor")}if(A&&!N){var k=t.constructor,K=e.constructor;k!=K&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof K=="function"&&K instanceof K)&&(A=!1)}return a.delete(t),a.delete(e),A}var XE=1,Hd="[object Arguments]",Yd="[object Array]",js="[object Object]",JE=Object.prototype,Xd=JE.hasOwnProperty;function ZE(t,e,r,n,i,a){var s=Q(t),o=Q(e),l=s?Yd:Tt(t),u=o?Yd:Tt(e);l=l==Hd?js:l,u=u==Hd?js:u;var c=l==js,f=u==js,h=l==u;if(h&&Ua(t)){if(!Ua(e))return!1;s=!0,c=!1}if(h&&!c)return a||(a=new jt),s||Cf(t)?tg(t,e,r,n,i,a):WE(t,e,l,r,n,i,a);if(!(r&XE)){var p=c&&Xd.call(t,"__wrapped__"),y=f&&Xd.call(e,"__wrapped__");if(p||y){var A=p?t.value():t,N=y?e.value():e;return a||(a=new jt),i(A,N,r,n,a)}}return h?(a||(a=new jt),YE(t,e,r,n,i,a)):!1}function xf(t,e,r,n,i){return t===e?!0:t==null||e==null||!Lt(t)&&!Lt(e)?t!==t&&e!==e:ZE(t,e,r,n,xf,i)}var QE=1,eC=2;function tC(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],l=t[o],u=s[1];if(s[2]){if(l===void 0&&!(o in t))return!1}else{var c=new jt,f;if(!(f===void 0?xf(u,l,QE|eC,n,c):f))return!1}}return!0}function rg(t){return t===t&&!$t(t)}function rC(t){for(var e=At(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,rg(i)]}return e}function ng(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function nC(t){var e=rC(t);return e.length==1&&e[0][2]?ng(e[0][0],e[0][1]):function(r){return r===t||tC(r,t,e)}}function iC(t,e){return t!=null&&e in Object(t)}function ig(t,e,r){e=pl(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=cs(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&Ef(i)&&ol(s,i)&&(Q(t)||ul(t)))}function aC(t,e){return t!=null&&ig(t,e,iC)}var sC=1,oC=2;function lC(t,e){return _f(t)&&rg(e)?ng(cs(t),e):function(r){var n=H$(r,t);return n===void 0&&n===e?aC(r,t):xf(e,n,sC|oC)}}function uC(t){return function(e){return e==null?void 0:e[t]}}function cC(t){return function(e){return bf(e,t)}}function fC(t){return _f(t)?uC(cs(t)):cC(t)}function Vt(t){return typeof t=="function"?t:t==null?ss:typeof t=="object"?Q(t)?lC(t[0],t[1]):nC(t):fC(t)}function dC(t,e,r,n){for(var i=-1,a=t==null?0:t.length;++i<a;){var s=t[i];e(n,s,r(s),t)}return n}function pC(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var l=s[++i];if(r(a[l],l,a)===!1)break}return e}}var hC=pC();function mC(t,e){return t&&hC(t,e,At)}function gC(t,e){return function(r,n){if(r==null)return r;if(!Kt(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var On=gC(mC);function yC(t,e,r,n){return On(t,function(i,a,s){e(n,i,r(i),s)}),n}function TC(t,e){return function(r,n){var i=Q(r)?dC:yC,a=e?e():{};return i(r,t,Vt(n),a)}}var ag=Object.prototype,RC=ag.hasOwnProperty,Df=Af(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&Fm(e[0],e[1],i)&&(n=1);++r<n;)for(var a=e[r],s=Sf(a),o=-1,l=s.length;++o<l;){var u=s[o],c=t[u];(c===void 0||os(c,ag[u])&&!RC.call(t,u))&&(t[u]=a[u])}return t});function Jd(t){return Lt(t)&&Kt(t)}var vC=200;function $C(t,e,r,n){var i=-1,a=Mm,s=!0,o=t.length,l=[],u=e.length;if(!o)return l;e.length>=vC&&(a=Of,s=!1,e=new Ii(e));e:for(;++i<o;){var c=t[i],f=c;if(c=c!==0?c:0,s&&f===f){for(var h=u;h--;)if(e[h]===f)continue e;l.push(c)}else a(e,f,n)||l.push(c)}return l}var hl=Af(function(t,e){return Jd(t)?$C(t,If(e,1,Jd,!0)):[]});function _n(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function We(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:sl(e),Km(t,e<0?0:e,n)):[]}function Ba(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:sl(e),e=n-e,Km(t,0,e<0?0:e)):[]}function AC(t){return typeof t=="function"?t:ss}function W(t,e){var r=Q(t)?xm:On;return r(t,AC(e))}function EC(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function CC(t,e){var r=!0;return On(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function qt(t,e,r){var n=Q(t)?EC:CC;return n(t,Vt(e))}function sg(t,e){var r=[];return On(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}function Et(t,e){var r=Q(t)?Pf:sg;return r(t,Vt(e))}function SC(t){return function(e,r,n){var i=Object(e);if(!Kt(e)){var a=Vt(r);e=At(e),r=function(o){return a(i[o],o,i)}}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}var _C=Math.max;function wC(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:sl(r);return i<0&&(i=_C(n+i,0)),Dm(t,Vt(e),i)}var Pi=SC(wC);function xt(t){return t&&t.length?t[0]:void 0}function bC(t,e){var r=-1,n=Kt(t)?Array(t.length):[];return On(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function z(t,e){var r=Q(t)?al:bC;return r(t,Vt(e))}function Rt(t,e){return If(z(t,e))}var NC=Object.prototype,IC=NC.hasOwnProperty,PC=TC(function(t,e,r){IC.call(t,r)?t[r].push(e):$f(t,r,[e])}),kC=Object.prototype,OC=kC.hasOwnProperty;function LC(t,e){return t!=null&&OC.call(t,e)}function j(t,e){return t!=null&&ig(t,e,LC)}var xC="[object String]";function Dt(t){return typeof t=="string"||!Q(t)&&Lt(t)&&Hr(t)==xC}function DC(t,e){return al(e,function(r){return t[r]})}function Me(t){return t==null?[]:DC(t,At(t))}var MC=Math.max;function st(t,e,r,n){t=Kt(t)?t:Me(t),r=r?sl(r):0;var i=t.length;return r<0&&(r=MC(i+r,0)),Dt(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&vf(t,e,r)>-1}function Zd(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=0;return vf(t,e,i)}var FC="[object Map]",GC="[object Set]",zC=Object.prototype,UC=zC.hasOwnProperty;function ce(t){if(t==null)return!0;if(Kt(t)&&(Q(t)||typeof t=="string"||typeof t.splice=="function"||Ua(t)||Cf(t)||ul(t)))return!t.length;var e=Tt(t);if(e==FC||e==GC)return!t.size;if(us(t))return!Bm(t).length;for(var r in t)if(UC.call(t,r))return!1;return!0}var jC="[object RegExp]";function qC(t){return Lt(t)&&Hr(t)==jC}var Qd=Ur&&Ur.isRegExp,jr=Qd?cl(Qd):qC;function $r(t){return t===void 0}var BC="Expected a function";function WC(t){if(typeof t!="function")throw new TypeError(BC);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function KC(t,e,r,n){if(!$t(t))return t;e=pl(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var l=cs(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=s){var c=o[l];u=void 0,u===void 0&&(u=$t(c)?c:ol(e[i+1])?[]:{})}ll(o,l,u),o=o[l]}return t}function VC(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=bf(t,s);r(o,s)&&KC(a,pl(s,t),o)}return a}function HC(t,e){if(t==null)return{};var r=al(dA(t),function(n){return[n]});return e=Vt(e),VC(t,r,function(n,i){return e(n,i[0])})}function YC(t,e,r,n,i){return i(t,function(a,s,o){r=n?(n=!1,a):e(r,a,s,o)}),r}function ht(t,e,r){var n=Q(t)?X$:YC,i=arguments.length<3;return n(t,Vt(e),r,i,On)}function ml(t,e){var r=Q(t)?Pf:sg;return r(t,WC(Vt(e)))}function XC(t,e){var r;return On(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function JC(t,e,r){var n=Q(t)?eg:XC;return n(t,Vt(e))}var ZC=1/0,QC=li&&1/Lf(new li([,-0]))[1]==ZC?function(t){return new li(t)}:Fe,eS=200;function tS(t,e,r){var n=-1,i=Mm,a=t.length,s=!0,o=[],l=o;if(a>=eS){var u=QC(t);if(u)return Lf(u);s=!1,i=Of,l=new Ii}else l=o;e:for(;++n<a;){var c=t[n],f=c;if(c=c!==0?c:0,s&&f===f){for(var h=l.length;h--;)if(l[h]===f)continue e;o.push(c)}else i(l,f,r)||(l!==o&&l.push(f),o.push(c))}return o}function Mf(t){return t&&t.length?tS(t):[]}function Ou(t){console&&console.error&&console.error(`Error: ${t}`)}function og(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function lg(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function ug(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}var cg=typeof global=="object"&&global&&global.Object===Object&&global,rS=typeof self=="object"&&self&&self.Object===Object&&self,Nr=cg||rS||Function("return this")(),qr=Nr.Symbol,fg=Object.prototype,nS=fg.hasOwnProperty,iS=fg.toString,oa=qr?qr.toStringTag:void 0;function aS(t){var e=nS.call(t,oa),r=t[oa];try{t[oa]=void 0;var n=!0}catch{}var i=iS.call(t);return n&&(e?t[oa]=r:delete t[oa]),i}var sS=Object.prototype,oS=sS.toString;function lS(t){return oS.call(t)}var uS="[object Null]",cS="[object Undefined]",ep=qr?qr.toStringTag:void 0;function Yr(t){return t==null?t===void 0?cS:uS:ep&&ep in Object(t)?aS(t):lS(t)}function Br(t){return t!=null&&typeof t=="object"}var fS="[object Symbol]";function gl(t){return typeof t=="symbol"||Br(t)&&Yr(t)==fS}function yl(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var it=Array.isArray,tp=qr?qr.prototype:void 0,rp=tp?tp.toString:void 0;function dg(t){if(typeof t=="string")return t;if(it(t))return yl(t,dg)+"";if(gl(t))return rp?rp.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var dS=/\s/;function pS(t){for(var e=t.length;e--&&dS.test(t.charAt(e)););return e}var hS=/^\s+/;function mS(t){return t&&t.slice(0,pS(t)+1).replace(hS,"")}function Ar(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var np=NaN,gS=/^[-+]0x[0-9a-f]+$/i,yS=/^0b[01]+$/i,TS=/^0o[0-7]+$/i,RS=parseInt;function vS(t){if(typeof t=="number")return t;if(gl(t))return np;if(Ar(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ar(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=mS(t);var r=yS.test(t);return r||TS.test(t)?RS(t.slice(2),r?2:8):gS.test(t)?np:+t}var ip=1/0,$S=17976931348623157e292;function AS(t){if(!t)return t===0?t:0;if(t=vS(t),t===ip||t===-ip){var e=t<0?-1:1;return e*$S}return t===t?t:0}function ES(t){var e=AS(t),r=e%1;return e===e?r?e-r:e:0}function Tl(t){return t}var CS="[object AsyncFunction]",SS="[object Function]",_S="[object GeneratorFunction]",wS="[object Proxy]";function pg(t){if(!Ar(t))return!1;var e=Yr(t);return e==SS||e==_S||e==CS||e==wS}var Wl=Nr["__core-js_shared__"],ap=(function(){var t=/[^.]+$/.exec(Wl&&Wl.keys&&Wl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function bS(t){return!!ap&&ap in t}var NS=Function.prototype,IS=NS.toString;function Ln(t){if(t!=null){try{return IS.call(t)}catch{}try{return t+""}catch{}}return""}var PS=/[\\^$.*+?()[\]{}|]/g,kS=/^\[object .+?Constructor\]$/,OS=Function.prototype,LS=Object.prototype,xS=OS.toString,DS=LS.hasOwnProperty,MS=RegExp("^"+xS.call(DS).replace(PS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function FS(t){if(!Ar(t)||bS(t))return!1;var e=pg(t)?MS:kS;return e.test(Ln(t))}function GS(t,e){return t==null?void 0:t[e]}function xn(t,e){var r=GS(t,e);return FS(r)?r:void 0}var Lu=xn(Nr,"WeakMap");function zS(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var US=800,jS=16,qS=Date.now;function BS(t){var e=0,r=0;return function(){var n=qS(),i=jS-(n-r);if(r=n,i>0){if(++e>=US)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function WS(t){return function(){return t}}var ko=(function(){try{var t=xn(Object,"defineProperty");return t({},"",{}),t}catch{}})(),KS=ko?function(t,e){return ko(t,"toString",{configurable:!0,enumerable:!1,value:WS(e),writable:!0})}:Tl,VS=BS(KS);function HS(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function YS(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function XS(t){return t!==t}function JS(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function ZS(t,e,r){return e===e?JS(t,e,r):YS(t,XS,r)}var QS=9007199254740991,e_=/^(?:0|[1-9]\d*)$/;function Rl(t,e){var r=typeof t;return e=e??QS,!!e&&(r=="number"||r!="symbol"&&e_.test(t))&&t>-1&&t%1==0&&t<e}function hg(t,e,r){e=="__proto__"&&ko?ko(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function vl(t,e){return t===e||t!==t&&e!==e}var t_=Object.prototype,r_=t_.hasOwnProperty;function Ff(t,e,r){var n=t[e];(!(r_.call(t,e)&&vl(n,r))||r===void 0&&!(e in t))&&hg(t,e,r)}function n_(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),i?hg(r,o,l):Ff(r,o,l)}return r}var sp=Math.max;function i_(t,e,r){return e=sp(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=sp(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),zS(t,this,o)}}function a_(t,e){return VS(i_(t,e,Tl),t+"")}var s_=9007199254740991;function Gf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=s_}function Dn(t){return t!=null&&Gf(t.length)&&!pg(t)}function o_(t,e,r){if(!Ar(r))return!1;var n=typeof e;return(n=="number"?Dn(r)&&Rl(e,r.length):n=="string"&&e in r)?vl(r[e],t):!1}function l_(t){return a_(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&o_(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var u_=Object.prototype;function zf(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||u_;return t===r}function c_(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var f_="[object Arguments]";function op(t){return Br(t)&&Yr(t)==f_}var mg=Object.prototype,d_=mg.hasOwnProperty,p_=mg.propertyIsEnumerable,gg=op((function(){return arguments})())?op:function(t){return Br(t)&&d_.call(t,"callee")&&!p_.call(t,"callee")};function h_(){return!1}var yg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lp=yg&&typeof module=="object"&&module&&!module.nodeType&&module,m_=lp&&lp.exports===yg,up=m_?Nr.Buffer:void 0,g_=up?up.isBuffer:void 0,xu=g_||h_,y_="[object Arguments]",T_="[object Array]",R_="[object Boolean]",v_="[object Date]",$_="[object Error]",A_="[object Function]",E_="[object Map]",C_="[object Number]",S_="[object Object]",__="[object RegExp]",w_="[object Set]",b_="[object String]",N_="[object WeakMap]",I_="[object ArrayBuffer]",P_="[object DataView]",k_="[object Float32Array]",O_="[object Float64Array]",L_="[object Int8Array]",x_="[object Int16Array]",D_="[object Int32Array]",M_="[object Uint8Array]",F_="[object Uint8ClampedArray]",G_="[object Uint16Array]",z_="[object Uint32Array]",pe={};pe[k_]=pe[O_]=pe[L_]=pe[x_]=pe[D_]=pe[M_]=pe[F_]=pe[G_]=pe[z_]=!0;pe[y_]=pe[T_]=pe[I_]=pe[R_]=pe[P_]=pe[v_]=pe[$_]=pe[A_]=pe[E_]=pe[C_]=pe[S_]=pe[__]=pe[w_]=pe[b_]=pe[N_]=!1;function U_(t){return Br(t)&&Gf(t.length)&&!!pe[Yr(t)]}function Tg(t){return function(e){return t(e)}}var Rg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ma=Rg&&typeof module=="object"&&module&&!module.nodeType&&module,j_=Ma&&Ma.exports===Rg,Kl=j_&&cg.process,Oo=(function(){try{var t=Ma&&Ma.require&&Ma.require("util").types;return t||Kl&&Kl.binding&&Kl.binding("util")}catch{}})(),cp=Oo&&Oo.isTypedArray,vg=cp?Tg(cp):U_,q_=Object.prototype,B_=q_.hasOwnProperty;function $g(t,e){var r=it(t),n=!r&&gg(t),i=!r&&!n&&xu(t),a=!r&&!n&&!i&&vg(t),s=r||n||i||a,o=s?c_(t.length,String):[],l=o.length;for(var u in t)(e||B_.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Rl(u,l)))&&o.push(u);return o}function Ag(t,e){return function(r){return t(e(r))}}var W_=Ag(Object.keys,Object),K_=Object.prototype,V_=K_.hasOwnProperty;function H_(t){if(!zf(t))return W_(t);var e=[];for(var r in Object(t))V_.call(t,r)&&r!="constructor"&&e.push(r);return e}function ds(t){return Dn(t)?$g(t):H_(t)}var Y_=Object.prototype,X_=Y_.hasOwnProperty,Ht=l_(function(t,e){if(zf(e)||Dn(e)){n_(e,ds(e),t);return}for(var r in e)X_.call(e,r)&&Ff(t,r,e[r])});function J_(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Z_=Object.prototype,Q_=Z_.hasOwnProperty;function ew(t){if(!Ar(t))return J_(t);var e=zf(t),r=[];for(var n in t)n=="constructor"&&(e||!Q_.call(t,n))||r.push(n);return r}function tw(t){return Dn(t)?$g(t,!0):ew(t)}var rw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nw=/^\w*$/;function Uf(t,e){if(it(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||gl(t)?!0:nw.test(t)||!rw.test(t)||e!=null&&t in Object(e)}var Wa=xn(Object,"create");function iw(){this.__data__=Wa?Wa(null):{},this.size=0}function aw(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var sw="__lodash_hash_undefined__",ow=Object.prototype,lw=ow.hasOwnProperty;function uw(t){var e=this.__data__;if(Wa){var r=e[t];return r===sw?void 0:r}return lw.call(e,t)?e[t]:void 0}var cw=Object.prototype,fw=cw.hasOwnProperty;function dw(t){var e=this.__data__;return Wa?e[t]!==void 0:fw.call(e,t)}var pw="__lodash_hash_undefined__";function hw(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Wa&&e===void 0?pw:e,this}function wn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}wn.prototype.clear=iw;wn.prototype.delete=aw;wn.prototype.get=uw;wn.prototype.has=dw;wn.prototype.set=hw;function mw(){this.__data__=[],this.size=0}function $l(t,e){for(var r=t.length;r--;)if(vl(t[r][0],e))return r;return-1}var gw=Array.prototype,yw=gw.splice;function Tw(t){var e=this.__data__,r=$l(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():yw.call(e,r,1),--this.size,!0}function Rw(t){var e=this.__data__,r=$l(e,t);return r<0?void 0:e[r][1]}function vw(t){return $l(this.__data__,t)>-1}function $w(t,e){var r=this.__data__,n=$l(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Ir(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ir.prototype.clear=mw;Ir.prototype.delete=Tw;Ir.prototype.get=Rw;Ir.prototype.has=vw;Ir.prototype.set=$w;var Ka=xn(Nr,"Map");function Aw(){this.size=0,this.__data__={hash:new wn,map:new(Ka||Ir),string:new wn}}function Ew(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Al(t,e){var r=t.__data__;return Ew(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Cw(t){var e=Al(this,t).delete(t);return this.size-=e?1:0,e}function Sw(t){return Al(this,t).get(t)}function _w(t){return Al(this,t).has(t)}function ww(t,e){var r=Al(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Pr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Pr.prototype.clear=Aw;Pr.prototype.delete=Cw;Pr.prototype.get=Sw;Pr.prototype.has=_w;Pr.prototype.set=ww;var bw="Expected a function";function jf(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(bw);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(jf.Cache||Pr),r}jf.Cache=Pr;var Nw=500;function Iw(t){var e=jf(t,function(n){return r.size===Nw&&r.clear(),n}),r=e.cache;return e}var Pw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kw=/\\(\\)?/g,Ow=Iw(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Pw,function(r,n,i,a){e.push(i?a.replace(kw,"$1"):n||r)}),e});function Lw(t){return t==null?"":dg(t)}function El(t,e){return it(t)?t:Uf(t,e)?[t]:Ow(Lw(t))}function ps(t){if(typeof t=="string"||gl(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function qf(t,e){e=El(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[ps(e[r++])];return r&&r==n?t:void 0}function xw(t,e,r){var n=t==null?void 0:qf(t,e);return n===void 0?r:n}function Eg(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Dw=Ag(Object.getPrototypeOf,Object);function Mw(){this.__data__=new Ir,this.size=0}function Fw(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Gw(t){return this.__data__.get(t)}function zw(t){return this.__data__.has(t)}var Uw=200;function jw(t,e){var r=this.__data__;if(r instanceof Ir){var n=r.__data__;if(!Ka||n.length<Uw-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Pr(n)}return r.set(t,e),this.size=r.size,this}function vr(t){var e=this.__data__=new Ir(t);this.size=e.size}vr.prototype.clear=Mw;vr.prototype.delete=Fw;vr.prototype.get=Gw;vr.prototype.has=zw;vr.prototype.set=jw;function qw(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function Cg(){return[]}var Bw=Object.prototype,Ww=Bw.propertyIsEnumerable,fp=Object.getOwnPropertySymbols,Sg=fp?function(t){return t==null?[]:(t=Object(t),qw(fp(t),function(e){return Ww.call(t,e)}))}:Cg,Kw=Object.getOwnPropertySymbols,Vw=Kw?function(t){for(var e=[];t;)Eg(e,Sg(t)),t=Dw(t);return e}:Cg;function _g(t,e,r){var n=e(t);return it(t)?n:Eg(n,r(t))}function dp(t){return _g(t,ds,Sg)}function Hw(t){return _g(t,tw,Vw)}var Du=xn(Nr,"DataView"),Mu=xn(Nr,"Promise"),Fu=xn(Nr,"Set"),pp="[object Map]",Yw="[object Object]",hp="[object Promise]",mp="[object Set]",gp="[object WeakMap]",yp="[object DataView]",Xw=Ln(Du),Jw=Ln(Ka),Zw=Ln(Mu),Qw=Ln(Fu),eb=Ln(Lu),Gr=Yr;(Du&&Gr(new Du(new ArrayBuffer(1)))!=yp||Ka&&Gr(new Ka)!=pp||Mu&&Gr(Mu.resolve())!=hp||Fu&&Gr(new Fu)!=mp||Lu&&Gr(new Lu)!=gp)&&(Gr=function(t){var e=Yr(t),r=e==Yw?t.constructor:void 0,n=r?Ln(r):"";if(n)switch(n){case Xw:return yp;case Jw:return pp;case Zw:return hp;case Qw:return mp;case eb:return gp}return e});var Tp=Nr.Uint8Array,tb="__lodash_hash_undefined__";function rb(t){return this.__data__.set(t,tb),this}function nb(t){return this.__data__.has(t)}function Lo(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Pr;++e<r;)this.add(t[e])}Lo.prototype.add=Lo.prototype.push=rb;Lo.prototype.has=nb;function wg(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function ib(t,e){return t.has(e)}var ab=1,sb=2;function bg(t,e,r,n,i,a){var s=r&ab,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))return!1;var u=a.get(t),c=a.get(e);if(u&&c)return u==e&&c==t;var f=-1,h=!0,p=r&sb?new Lo:void 0;for(a.set(t,e),a.set(e,t);++f<o;){var y=t[f],A=e[f];if(n)var N=s?n(A,y,f,e,t,a):n(y,A,f,t,e,a);if(N!==void 0){if(N)continue;h=!1;break}if(p){if(!wg(e,function(C,S){if(!ib(p,S)&&(y===C||i(y,C,r,n,a)))return p.push(S)})){h=!1;break}}else if(!(y===A||i(y,A,r,n,a))){h=!1;break}}return a.delete(t),a.delete(e),h}function ob(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function lb(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var ub=1,cb=2,fb="[object Boolean]",db="[object Date]",pb="[object Error]",hb="[object Map]",mb="[object Number]",gb="[object RegExp]",yb="[object Set]",Tb="[object String]",Rb="[object Symbol]",vb="[object ArrayBuffer]",$b="[object DataView]",Rp=qr?qr.prototype:void 0,Vl=Rp?Rp.valueOf:void 0;function Ab(t,e,r,n,i,a,s){switch(r){case $b:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case vb:return!(t.byteLength!=e.byteLength||!a(new Tp(t),new Tp(e)));case fb:case db:case mb:return vl(+t,+e);case pb:return t.name==e.name&&t.message==e.message;case gb:case Tb:return t==e+"";case hb:var o=ob;case yb:var l=n&ub;if(o||(o=lb),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;n|=cb,s.set(t,e);var c=bg(o(t),o(e),n,i,a,s);return s.delete(t),c;case Rb:if(Vl)return Vl.call(t)==Vl.call(e)}return!1}var Eb=1,Cb=Object.prototype,Sb=Cb.hasOwnProperty;function _b(t,e,r,n,i,a){var s=r&Eb,o=dp(t),l=o.length,u=dp(e),c=u.length;if(l!=c&&!s)return!1;for(var f=l;f--;){var h=o[f];if(!(s?h in e:Sb.call(e,h)))return!1}var p=a.get(t),y=a.get(e);if(p&&y)return p==e&&y==t;var A=!0;a.set(t,e),a.set(e,t);for(var N=s;++f<l;){h=o[f];var C=t[h],S=e[h];if(n)var _=s?n(S,C,h,e,t,a):n(C,S,h,t,e,a);if(!(_===void 0?C===S||i(C,S,r,n,a):_)){A=!1;break}N||(N=h=="constructor")}if(A&&!N){var k=t.constructor,K=e.constructor;k!=K&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof K=="function"&&K instanceof K)&&(A=!1)}return a.delete(t),a.delete(e),A}var wb=1,vp="[object Arguments]",$p="[object Array]",qs="[object Object]",bb=Object.prototype,Ap=bb.hasOwnProperty;function Nb(t,e,r,n,i,a){var s=it(t),o=it(e),l=s?$p:Gr(t),u=o?$p:Gr(e);l=l==vp?qs:l,u=u==vp?qs:u;var c=l==qs,f=u==qs,h=l==u;if(h&&xu(t)){if(!xu(e))return!1;s=!0,c=!1}if(h&&!c)return a||(a=new vr),s||vg(t)?bg(t,e,r,n,i,a):Ab(t,e,l,r,n,i,a);if(!(r&wb)){var p=c&&Ap.call(t,"__wrapped__"),y=f&&Ap.call(e,"__wrapped__");if(p||y){var A=p?t.value():t,N=y?e.value():e;return a||(a=new vr),i(A,N,r,n,a)}}return h?(a||(a=new vr),_b(t,e,r,n,i,a)):!1}function Bf(t,e,r,n,i){return t===e?!0:t==null||e==null||!Br(t)&&!Br(e)?t!==t&&e!==e:Nb(t,e,r,n,Bf,i)}var Ib=1,Pb=2;function kb(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],l=t[o],u=s[1];if(s[2]){if(l===void 0&&!(o in t))return!1}else{var c=new vr,f;if(!(f===void 0?Bf(u,l,Ib|Pb,n,c):f))return!1}}return!0}function Ng(t){return t===t&&!Ar(t)}function Ob(t){for(var e=ds(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Ng(i)]}return e}function Ig(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Lb(t){var e=Ob(t);return e.length==1&&e[0][2]?Ig(e[0][0],e[0][1]):function(r){return r===t||kb(r,t,e)}}function xb(t,e){return t!=null&&e in Object(t)}function Db(t,e,r){e=El(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=ps(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&Gf(i)&&Rl(s,i)&&(it(t)||gg(t)))}function Mb(t,e){return t!=null&&Db(t,e,xb)}var Fb=1,Gb=2;function zb(t,e){return Uf(t)&&Ng(e)?Ig(ps(t),e):function(r){var n=xw(r,t);return n===void 0&&n===e?Mb(r,t):Bf(e,n,Fb|Gb)}}function Ub(t){return function(e){return e==null?void 0:e[t]}}function jb(t){return function(e){return qf(e,t)}}function qb(t){return Uf(t)?Ub(ps(t)):jb(t)}function Cl(t){return typeof t=="function"?t:t==null?Tl:typeof t=="object"?it(t)?zb(t[0],t[1]):Lb(t):qb(t)}function Bb(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var l=s[++i];if(r(a[l],l,a)===!1)break}return e}}var Wb=Bb();function Kb(t,e){return t&&Wb(t,e,ds)}function Vb(t,e){return function(r,n){if(r==null)return r;if(!Dn(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var Sl=Vb(Kb);function Hb(t){return typeof t=="function"?t:Tl}function Yb(t,e){var r=it(t)?HS:Sl;return r(t,Hb(e))}function Xb(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function Jb(t,e){var r=!0;return Sl(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function Zb(t,e,r){var n=it(t)?Xb:Jb;return n(t,Cl(e))}function Qb(t,e){var r=-1,n=Dn(t)?Array(t.length):[];return Sl(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Pg(t,e){var r=it(t)?yl:Qb;return r(t,Cl(e))}var eN="[object String]";function xo(t){return typeof t=="string"||!it(t)&&Br(t)&&Yr(t)==eN}function tN(t,e){return yl(e,function(r){return t[r]})}function rN(t){return t==null?[]:tN(t,ds(t))}var nN=Math.max;function iN(t,e,r,n){t=Dn(t)?t:rN(t),r=r?ES(r):0;var i=t.length;return r<0&&(r=nN(i+r,0)),xo(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&ZS(t,e,r)>-1}var aN="[object RegExp]";function sN(t){return Br(t)&&Yr(t)==aN}var Ep=Oo&&Oo.isRegExp,oN=Ep?Tg(Ep):sN;function lN(t,e,r,n){if(!Ar(t))return t;e=El(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var l=ps(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=s){var c=o[l];u=void 0,u===void 0&&(u=Ar(c)?c:Rl(e[i+1])?[]:{})}Ff(o,l,u),o=o[l]}return t}function uN(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=qf(t,s);r(o,s)&&lN(a,El(s,t),o)}return a}function Yt(t,e){if(t==null)return{};var r=yl(Hw(t),function(n){return[n]});return e=Cl(e),uN(t,r,function(n,i){return e(n,i[0])})}function cN(t,e){var r;return Sl(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function fN(t,e,r){var n=it(t)?wg:cN;return n(t,Cl(e))}function dN(t){return pN(t)?t.LABEL:t.name}function pN(t){return xo(t.LABEL)&&t.LABEL!==""}class Xt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Yb(this.definition,r=>{r.accept(e)})}}class tt extends Xt{constructor(e){super([]),this.idx=1,Ht(this,Yt(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Fi extends Xt{constructor(e){super(e.definition),this.orgText="",Ht(this,Yt(e,r=>r!==void 0))}}class at extends Xt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Ht(this,Yt(e,r=>r!==void 0))}}let He=class extends Xt{constructor(e){super(e.definition),this.idx=1,Ht(this,Yt(e,r=>r!==void 0))}};class mt extends Xt{constructor(e){super(e.definition),this.idx=1,Ht(this,Yt(e,r=>r!==void 0))}}class gt extends Xt{constructor(e){super(e.definition),this.idx=1,Ht(this,Yt(e,r=>r!==void 0))}}class _e extends Xt{constructor(e){super(e.definition),this.idx=1,Ht(this,Yt(e,r=>r!==void 0))}}class ot extends Xt{constructor(e){super(e.definition),this.idx=1,Ht(this,Yt(e,r=>r!==void 0))}}class lt extends Xt{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,Ht(this,Yt(e,r=>r!==void 0))}}class he{constructor(e){this.idx=1,Ht(this,Yt(e,r=>r!==void 0))}accept(e){e.visit(this)}}function hN(t){return Pg(t,go)}function go(t){function e(r){return Pg(r,go)}if(t instanceof tt){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return xo(t.label)&&(r.label=t.label),r}else{if(t instanceof at)return{type:"Alternative",definition:e(t.definition)};if(t instanceof He)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof mt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof gt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:go(new he({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ot)return{type:"RepetitionWithSeparator",idx:t.idx,separator:go(new he({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _e)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof lt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof he){const r={type:"Terminal",name:t.terminalType.name,label:dN(t.terminalType),idx:t.idx};xo(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=oN(n)?n.source:n),r}else{if(t instanceof Fi)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Gi{visit(e){const r=e;switch(r.constructor){case tt:return this.visitNonTerminal(r);case at:return this.visitAlternative(r);case He:return this.visitOption(r);case mt:return this.visitRepetitionMandatory(r);case gt:return this.visitRepetitionMandatoryWithSeparator(r);case ot:return this.visitRepetitionWithSeparator(r);case _e:return this.visitRepetition(r);case lt:return this.visitAlternation(r);case he:return this.visitTerminal(r);case Fi: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 mN(t){return t instanceof at||t instanceof He||t instanceof _e||t instanceof mt||t instanceof gt||t instanceof ot||t instanceof he||t instanceof Fi}function Do(t,e=[]){return t instanceof He||t instanceof _e||t instanceof ot?!0:t instanceof lt?fN(t.definition,n=>Do(n,e)):t instanceof tt&&iN(e,t)?!1:t instanceof Xt?(t instanceof tt&&e.push(t),Zb(t.definition,n=>Do(n,e))):!1}function gN(t){return t instanceof lt}function zt(t){if(t instanceof tt)return"SUBRULE";if(t instanceof He)return"OPTION";if(t instanceof lt)return"OR";if(t instanceof mt)return"AT_LEAST_ONE";if(t instanceof gt)return"AT_LEAST_ONE_SEP";if(t instanceof ot)return"MANY_SEP";if(t instanceof _e)return"MANY";if(t instanceof he)return"CONSUME";throw Error("non exhaustive match")}class _l{walk(e,r=[]){W(e.definition,(n,i)=>{const a=We(e.definition,i+1);if(n instanceof tt)this.walkProdRef(n,a,r);else if(n instanceof he)this.walkTerminal(n,a,r);else if(n instanceof at)this.walkFlat(n,a,r);else if(n instanceof He)this.walkOption(n,a,r);else if(n instanceof mt)this.walkAtLeastOne(n,a,r);else if(n instanceof gt)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ot)this.walkManySep(n,a,r);else if(n instanceof _e)this.walkMany(n,a,r);else if(n instanceof lt)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new He({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=Cp(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new He({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=Cp(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);W(e.definition,a=>{const s=new at({definition:[a]});this.walk(s,i)})}}function Cp(t,e,r){return[new He({definition:[new he({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function hs(t){if(t instanceof tt)return hs(t.referencedRule);if(t instanceof he)return RN(t);if(mN(t))return yN(t);if(gN(t))return TN(t);throw Error("non exhaustive match")}function yN(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=Do(a),e=e.concat(hs(a)),n=n+1,i=r.length>n;return Mf(e)}function TN(t){const e=z(t.definition,r=>hs(r));return Mf(kt(e))}function RN(t){return[t.terminalType]}const kg="_~IN~_";class vN extends _l{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=AN(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new at({definition:a}),o=hs(s);this.follows[i]=o}}function $N(t){const e={};return W(t,r=>{const n=new vN(r).startWalking();Nu(e,n)}),e}function AN(t,e){return t.name+e+kg}let yo={};const EN=new Am;function wl(t){const e=t.toString();if(yo.hasOwnProperty(e))return yo[e];{const r=EN.pattern(e);return yo[e]=r,r}}function CN(){yo={}}const Og="Complement Sets are not supported for first char optimization",Mo=`Unable to use "first char" lexer optimizations:
13
+ `;function SN(t,e=!1){try{const r=wl(t);return Gu(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Og)e&&og(`${Mo} Unable to optimize: < ${t.toString()} >
14
+ Complement Sets cannot be automatically optimized.
15
+ This will disable the lexer's first char optimizations.
16
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
17
+ This will disable the lexer's first char optimizations.
18
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Ou(`${Mo}
19
+ Failed parsing: < ${t.toString()} >
20
+ Using the @chevrotain/regexp-to-ast library
21
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Gu(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Gu(t.value[i],e,r);break;case"Alternative":const n=t.value;for(let i=0;i<n.length;i++){const a=n[i];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=a;switch(s.type){case"Character":Bs(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(Og);W(s.value,l=>{if(typeof l=="number")Bs(l,e,r);else{const u=l;if(r===!0)for(let c=u.from;c<=u.to;c++)Bs(c,e,r);else{for(let c=u.from;c<=u.to&&c<ka;c++)Bs(c,e,r);if(u.to>=ka){const c=u.from>=ka?u.from:ka,f=u.to,h=Wr(c),p=Wr(f);for(let y=h;y<=p;y++)e[y]=y}}}});break;case"Group":Gu(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&zu(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Me(e)}function Bs(t,e,r){const n=Wr(t);e[n]=n,r===!0&&_N(t,e)}function _N(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Wr(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Wr(i.charCodeAt(0));e[a]=a}}}function Sp(t,e){return Pi(t.value,r=>{if(typeof r=="number")return st(e,r);{const n=r;return Pi(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function zu(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Q(t.value)?qt(t.value,zu):zu(t.value):!1}class wN extends rl{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){st(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Sp(e,this.targetCharCodes)===void 0&&(this.found=!0):Sp(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Wf(t,e){if(e instanceof RegExp){const r=wl(e),n=new wN(t);return n.visit(r),n.found}else return Pi(e,r=>st(t,r.charCodeAt(0)))!==void 0}const bn="PATTERN",Pa="defaultMode",Ws="modes";function bN(t,e){e=Df(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
+ `],tracer:(S,_)=>_()});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{ZN()});let n;r("Reject Lexer.NA",()=>{n=ml(t,S=>S[bn]===nt.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=z(n,S=>{const _=S[bn];if(jr(_)){const k=_.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!_.ignoreCase?k:k.length===2&&k[0]==="\\"&&!st(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:_p(_)}else{if(_r(_))return i=!0,{exec:_};if(typeof _=="object")return i=!0,_;if(typeof _=="string"){if(_.length===1)return _;{const k=_.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),K=new RegExp(k);return _p(K)}}else throw Error("non exhaustive match")}})});let s,o,l,u,c;r("misc mapping",()=>{s=z(n,S=>S.tokenTypeIdx),o=z(n,S=>{const _=S.GROUP;if(_!==nt.SKIPPED){if(Dt(_))return _;if($r(_))return!1;throw Error("non exhaustive match")}}),l=z(n,S=>{const _=S.LONGER_ALT;if(_)return Q(_)?z(_,K=>Zd(n,K)):[Zd(n,_)]}),u=z(n,S=>S.PUSH_MODE),c=z(n,S=>j(S,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{const S=Dg(e.lineTerminatorCharacters);f=z(n,_=>!1),e.positionTracking!=="onlyOffset"&&(f=z(n,_=>j(_,"LINE_BREAKS")?!!_.LINE_BREAKS:xg(_,S)===!1&&Wf(S,_.PATTERN)))});let h,p,y,A;r("Misc Mapping #2",()=>{h=z(n,Lg),p=z(a,YN),y=ht(n,(S,_)=>{const k=_.GROUP;return Dt(k)&&k!==nt.SKIPPED&&(S[k]=[]),S},{}),A=z(a,(S,_)=>({pattern:a[_],longerAlt:l[_],canLineTerminator:f[_],isCustom:h[_],short:p[_],group:o[_],push:u[_],pop:c[_],tokenTypeIdx:s[_],tokenType:n[_]}))});let N=!0,C=[];return e.safeMode||r("First Char Optimization",()=>{C=ht(n,(S,_,k)=>{if(typeof _.PATTERN=="string"){const K=_.PATTERN.charCodeAt(0),H=Wr(K);Hl(S,H,A[k])}else if(Q(_.START_CHARS_HINT)){let K;W(_.START_CHARS_HINT,H=>{const J=typeof H=="string"?H.charCodeAt(0):H,oe=Wr(J);K!==oe&&(K=oe,Hl(S,oe,A[k]))})}else if(jr(_.PATTERN))if(_.PATTERN.unicode)N=!1,e.ensureOptimizations&&Ou(`${Mo} Unable to analyze < ${_.PATTERN.toString()} > pattern.
23
+ The regexp unicode flag is not currently supported by the regexp-to-ast library.
24
+ This will disable the lexer's first char optimizations.
25
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const K=SN(_.PATTERN,e.ensureOptimizations);ce(K)&&(N=!1),W(K,H=>{Hl(S,H,A[k])})}else e.ensureOptimizations&&Ou(`${Mo} TokenType: <${_.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
26
+ This will disable the lexer's first char optimizations.
27
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),N=!1;return S},[])}),{emptyGroups:y,patternIdxToConfig:A,charCodeToPatternIdxToConfig:C,hasCustom:i,canBeOptimized:N}}function NN(t,e){let r=[];const n=PN(t);r=r.concat(n.errors);const i=kN(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(IN(a)),r=r.concat(zN(a)),r=r.concat(UN(a,e)),r=r.concat(jN(a)),r}function IN(t){let e=[];const r=Et(t,n=>jr(n[bn]));return e=e.concat(LN(r)),e=e.concat(MN(r)),e=e.concat(FN(r)),e=e.concat(GN(r)),e=e.concat(xN(r)),e}function PN(t){const e=Et(t,i=>!j(i,bn)),r=z(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:we.MISSING_PATTERN,tokenTypes:[i]})),n=hl(t,e);return{errors:r,valid:n}}function kN(t){const e=Et(t,i=>{const a=i[bn];return!jr(a)&&!_r(a)&&!j(a,"exec")&&!Dt(a)}),r=z(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:we.INVALID_PATTERN,tokenTypes:[i]})),n=hl(t,e);return{errors:r,valid:n}}const ON=/[^\\][$]/;function LN(t){class e extends rl{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}const r=Et(t,i=>{const a=i.PATTERN;try{const s=wl(a),o=new e;return o.visit(s),o.found}catch{return ON.test(a.source)}});return z(r,i=>({message:`Unexpected RegExp Anchor Error:
28
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
29
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:we.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function xN(t){const e=Et(t,n=>n.PATTERN.test(""));return z(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:we.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}const DN=/[^\\[][\^]|^\^/;function MN(t){class e extends rl{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}const r=Et(t,i=>{const a=i.PATTERN;try{const s=wl(a),o=new e;return o.visit(s),o.found}catch{return DN.test(a.source)}});return z(r,i=>({message:`Unexpected RegExp Anchor Error:
30
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
31
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:we.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function FN(t){const e=Et(t,n=>{const i=n[bn];return i instanceof RegExp&&(i.multiline||i.global)});return z(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:we.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function GN(t){const e=[];let r=z(t,a=>ht(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!st(e,o)&&o.PATTERN!==nt.NA&&(e.push(o),s.push(o)),s),[]));r=fs(r);const n=Et(r,a=>a.length>1);return z(n,a=>{const s=z(a,l=>l.name);return{message:`The same RegExp pattern ->${xt(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:we.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function zN(t){const e=Et(t,n=>{if(!j(n,"GROUP"))return!1;const i=n.GROUP;return i!==nt.SKIPPED&&i!==nt.NA&&!Dt(i)});return z(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:we.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function UN(t,e){const r=Et(t,i=>i.PUSH_MODE!==void 0&&!st(e,i.PUSH_MODE));return z(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:we.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function jN(t){const e=[],r=ht(t,(n,i,a)=>{const s=i.PATTERN;return s===nt.NA||(Dt(s)?n.push({str:s,idx:a,tokenType:i}):jr(s)&&BN(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return W(t,(n,i)=>{W(r,({str:a,idx:s,tokenType:o})=>{if(i<s&&qN(a,n.PATTERN)){const l=`Token: ->${o.name}<- can never be matched.
32
+ Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
33
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:we.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}function qN(t,e){if(jr(e)){if(WN(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(_r(e))return e(t,0,[],{});if(j(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function BN(t){return Pi([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function WN(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function _p(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function KN(t,e,r){const n=[];return j(t,Pa)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Pa+`> property in its definition
34
+ `,type:we.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),j(t,Ws)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ws+`> property in its definition
35
+ `,type:we.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),j(t,Ws)&&j(t,Pa)&&!j(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Pa}: <${t.defaultMode}>which does not exist
36
+ `,type:we.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),j(t,Ws)&&W(t.modes,(i,a)=>{W(i,(s,o)=>{if($r(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}>
37
+ `,type:we.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(j(s,"LONGER_ALT")){const l=Q(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];W(l,u=>{!$r(u)&&!st(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}>
38
+ `,type:we.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function VN(t,e,r){const n=[];let i=!1;const a=fs(kt(Me(t.modes))),s=ml(a,l=>l[bn]===nt.NA),o=Dg(r);return e&&W(s,l=>{const u=xg(l,o);if(u!==!1){const f={message:JN(l,u),type:u.issue,tokenType:l};n.push(f)}else j(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Wf(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
39
+ This Lexer has been defined to track line and column information,
40
+ But none of the Token Types can be identified as matching a line terminator.
41
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
42
+ for details.`,type:we.NO_LINE_BREAKS_FLAGS}),n}function HN(t){const e={},r=At(t);return W(r,n=>{const i=t[n];if(Q(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Lg(t){const e=t.PATTERN;if(jr(e))return!1;if(_r(e))return!0;if(j(e,"exec"))return!0;if(Dt(e))return!1;throw Error("non exhaustive match")}function YN(t){return Dt(t)&&t.length===1?t.charCodeAt(0):!1}const XN={test:function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function xg(t,e){if(j(t,"LINE_BREAKS"))return!1;if(jr(t.PATTERN)){try{Wf(e,t.PATTERN)}catch(r){return{issue:we.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(Dt(t.PATTERN))return!1;if(Lg(t))return{issue:we.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function JN(t,e){if(e.issue===we.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
43
+ The problem is in the <${t.name}> Token Type
44
+ Root cause: ${e.errMsg}.
45
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===we.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
46
+ The problem is in the <${t.name}> Token Type
47
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Dg(t){return z(t,r=>Dt(r)?r.charCodeAt(0):r)}function Hl(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const ka=256;let To=[];function Wr(t){return t<ka?t:To[t]}function ZN(){if(ce(To)){To=new Array(65536);for(let t=0;t<65536;t++)To[t]=t>255?255+~~(t/255):t}}function ms(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Fo(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let wp=1;const Mg={};function gs(t){const e=QN(t);eI(e),rI(e),tI(e),W(e,r=>{r.isParent=r.categoryMatches.length>0})}function QN(t){let e=Ye(t),r=t,n=!0;for(;n;){r=fs(kt(z(r,a=>a.CATEGORIES)));const i=hl(r,e);e=e.concat(i),ce(i)?n=!1:r=i}return e}function eI(t){W(t,e=>{Gg(e)||(Mg[wp]=e,e.tokenTypeIdx=wp++),bp(e)&&!Q(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),bp(e)||(e.CATEGORIES=[]),nI(e)||(e.categoryMatches=[]),iI(e)||(e.categoryMatchesMap={})})}function tI(t){W(t,e=>{e.categoryMatches=[],W(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Mg[n].tokenTypeIdx)})})}function rI(t){W(t,e=>{Fg([],e)})}function Fg(t,e){W(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),W(e.CATEGORIES,r=>{const n=t.concat(e);st(n,r)||Fg(n,r)})}function Gg(t){return j(t,"tokenTypeIdx")}function bp(t){return j(t,"CATEGORIES")}function nI(t){return j(t,"categoryMatches")}function iI(t){return j(t,"categoryMatchesMap")}function aI(t){return j(t,"tokenTypeIdx")}const Uu={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var we;(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"})(we||(we={}));const Oa={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Uu,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Oa);class nt{constructor(e,r=Oa){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,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);const{time:o,value:l}=lg(a),u=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${s}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
49
+ a boolean 2nd argument is no longer supported`);this.config=Nu({},Oa,r);const 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,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Oa.lineTerminatorsPattern)this.config.lineTerminatorsPattern=XN;else if(this.config.lineTerminatorCharacters===Oa.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
50
+ 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:Ye(e)},defaultMode:Pa}:(a=!1,i=Ye(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(KN(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(VN(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},W(i.modes,(o,l)=>{i.modes[l]=ml(o,u=>$r(u))});const s=At(i.modes);if(W(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(NN(o,s))}),ce(this.lexerDefinitionErrors)){gs(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=bN(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Nu({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!ce(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=z(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
51
+ `);throw new Error(`Errors detected in definition of Lexer:
52
+ `+l)}W(this.lexerDefinitionWarning,o=>{og(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Fe),this.trackStartLines===!1&&(this.computeNewColumn=ss),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Fe),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=ht(this.canModeBeOptimized,(l,u,c)=>(u===!1&&l.push(c),l),[]);if(r.ensureOptimizations&&!ce(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
53
+ Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
54
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{CN()}),this.TRACE_INIT("toFastProperties",()=>{ug(this)})})}tokenize(e,r=this.defaultMode){if(!ce(this.lexerDefinitionErrors)){const i=z(this.lexerDefinitionErrors,a=>a.message).join(`-----------------------
55
+ `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
56
+ `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,c,f,h,p,y,A,N,C;const S=e,_=S.length;let k=0,K=0;const H=this.hasCustom?0:Math.floor(e.length/10),J=new Array(H),oe=[];let me=this.trackStartLines?1:void 0,ge=this.trackStartLines?1:void 0;const I=HN(this.emptyGroups),v=this.trackStartLines,g=this.config.lineTerminatorsPattern;let w=0,T=[],R=[];const E=[],L=[];Object.freeze(L);let D=!1;const x=q=>{if(E.length===1&&q.tokenType.PUSH_MODE===void 0){const ne=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(q);oe.push({offset:q.startOffset,line:q.startLine,column:q.startColumn,length:q.image.length,message:ne})}else{E.pop();const ne=_n(E);T=this.patternIdxToConfig[ne],R=this.charCodeToPatternIdxToConfig[ne],w=T.length;const ze=this.canModeBeOptimized[ne]&&this.config.safeMode===!1;R&&ze?D=!0:D=!1}};function U(q){E.push(q),R=this.charCodeToPatternIdxToConfig[q],T=this.patternIdxToConfig[q],w=T.length,w=T.length;const ne=this.canModeBeOptimized[q]&&this.config.safeMode===!1;R&&ne?D=!0:D=!1}U.call(this,r);let F;const ae=this.config.recoveryEnabled;for(;k<_;){l=null,f=-1;const q=S.charCodeAt(k);let ne;if(D){const Ce=Wr(q),ye=R[Ce];ne=ye!==void 0?ye:L}else ne=T;const ze=ne.length;for(n=0;n<ze;n++){F=ne[n];const Ce=F.pattern;u=null;const ye=F.short;if(ye!==!1?q===ye&&(f=1,l=Ce):F.isCustom===!0?(C=Ce.exec(S,k,J,I),C!==null?(l=C[0],f=l.length,C.payload!==void 0&&(u=C.payload)):l=null):(Ce.lastIndex=k,f=this.matchLength(Ce,e,k)),f!==-1){if(o=F.longerAlt,o!==void 0){l=e.substring(k,k+f);const xe=o.length;for(a=0;a<xe;a++){const Ue=T[o[a]],ke=Ue.pattern;if(c=null,Ue.isCustom===!0?(C=ke.exec(S,k,J,I),C!==null?(s=C[0],C.payload!==void 0&&(c=C.payload)):s=null):(ke.lastIndex=k,s=this.match(ke,e,k)),s&&s.length>l.length){l=s,f=s.length,u=c,F=Ue;break}}}break}}if(f!==-1){if(h=F.group,h!==void 0&&(l=l!==null?l:e.substring(k,k+f),p=F.tokenTypeIdx,y=this.createTokenInstance(l,k,p,F.tokenType,me,ge,f),this.handlePayload(y,u),h===!1?K=this.addToken(J,K,y):I[h].push(y)),v===!0&&F.canLineTerminator===!0){let Ce=0,ye,xe;g.lastIndex=0;do l=l!==null?l:e.substring(k,k+f),ye=g.test(l),ye===!0&&(xe=g.lastIndex-1,Ce++);while(ye===!0);Ce!==0?(me=me+Ce,ge=f-xe,this.updateTokenEndLineColumnLocation(y,h,xe,Ce,me,ge,f)):ge=this.computeNewColumn(ge,f)}else ge=this.computeNewColumn(ge,f);k=k+f,this.handleModes(F,x,U,y)}else{const Ce=k,ye=me,xe=ge;let Ue=ae===!1;for(;Ue===!1&&k<_;)for(k++,i=0;i<w;i++){const ke=T[i],ee=ke.pattern,ut=ke.short;if(ut!==!1?S.charCodeAt(k)===ut&&(Ue=!0):ke.isCustom===!0?Ue=ee.exec(S,k,J,I)!==null:(ee.lastIndex=k,Ue=ee.exec(e)!==null),Ue===!0)break}if(A=k-Ce,ge=this.computeNewColumn(ge,A),N=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(S,Ce,A,ye,xe,_n(E)),oe.push({offset:Ce,line:ye,column:xe,length:A,message:N}),ae===!1)break}}return this.hasCustom||(J.length=K),{tokens:J,groups:I,errors:oe}}handleModes(e,r,n,i){if(e.pop===!0){const a=e.push;r(i),a!==void 0&&n.call(this,a)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,i,a,s,o){let l,u;r!==void 0&&(l=n===o-1,u=l?-1:0,i===1&&l===!0||(e.endLine=a+u,e.endColumn=s-1+-u))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,a,s){return{image:e,startOffset:r,startLine:a,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:r+o-1,startLine:a,endLine:a,startColumn:s,endColumn:s+o-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}match(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchLength(e,r,n){return e.test(r)===!0?e.lastIndex-n:-1}}nt.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";nt.NA=/NOT_APPLICABLE/;function ui(t){return zg(t)?t.LABEL:t.name}function zg(t){return Dt(t.LABEL)&&t.LABEL!==""}const sI="parent",Np="categories",Ip="label",Pp="group",kp="push_mode",Op="pop_mode",Lp="longer_alt",xp="line_breaks",Dp="start_chars_hint";function Ug(t){return oI(t)}function oI(t){const e=t.pattern,r={};if(r.name=t.name,$r(e)||(r.PATTERN=e),j(t,sI))throw`The parent property is no longer supported.
57
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return j(t,Np)&&(r.CATEGORIES=t[Np]),gs([r]),j(t,Ip)&&(r.LABEL=t[Ip]),j(t,Pp)&&(r.GROUP=t[Pp]),j(t,Op)&&(r.POP_MODE=t[Op]),j(t,kp)&&(r.PUSH_MODE=t[kp]),j(t,Lp)&&(r.LONGER_ALT=t[Lp]),j(t,xp)&&(r.LINE_BREAKS=t[xp]),j(t,Dp)&&(r.START_CHARS_HINT=t[Dp]),r}const Kr=Ug({name:"EOF",pattern:nt.NA});gs([Kr]);function Kf(t,e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function jg(t,e){return ms(t,e)}const si={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${zg(t)?`--> ${ui(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}){const a="Expecting: ",o=`
58
+ but found: '`+xt(e).image+"'";if(n)return a+n+o;{const l=ht(t,(h,p)=>h.concat(p),[]),u=z(l,h=>`[${z(h,p=>ui(p)).join(", ")}]`),f=`one of these possible Token sequences:
59
+ ${z(u,(h,p)=>` ${p+1}. ${h}`).join(`
60
+ `)}`;return a+f+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=`
61
+ but found: '`+xt(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::
62
+ <${z(t,u=>`[${z(u,c=>ui(c)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(si);const lI={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
+ inside top level rule: ->`+t.name+"<-"}},vn={buildDuplicateFoundError(t,e){function r(c){return c instanceof he?c.terminalType.name:c instanceof tt?c.nonTerminalName:""}const n=t.name,i=xt(e),a=i.idx,s=zt(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""}
64
+ appears more than once (${e.length} times) in the top level rule: ->${n}<-.
65
+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
66
+ `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
67
+ `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
68
+ The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
69
+ To resolve this make sure each Terminal and Non-Terminal names are unique
70
+ This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
71
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=z(t.prefixPath,i=>ui(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
72
+ in <OR${r}> inside <${t.topLevelRule.name}> Rule,
73
+ <${e}> may appears as a prefix path in all these alternatives.
74
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
75
+ For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,
76
+ `;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable.
77
+ Only the last alternative may be empty.
78
+ `;else{const i=z(t.prefixPath,a=>ui(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives.
79
+ `}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
80
+ For Further details.`,n},buildEmptyRepetitionError(t){let e=zt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
81
+ This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
82
+ Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
83
+ <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
84
+ has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=z(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
85
+ rule: <${e}> can be invoked from itself (directly or indirectly)
86
+ without consuming any Tokens. The grammar path that causes this is:
87
+ ${n}
88
+ To fix this refactor your grammar to remove the left recursion.
89
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Fi?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function uI(t,e){const r=new cI(t,e);return r.resolveRefs(),r.errors}class cI extends Gi{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){W(Me(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:rt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class fI extends _l{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=Ye(this.path.ruleStack).reverse(),this.occurrenceStack=Ye(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){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){ce(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class dI extends fI{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){const i=r.concat(n),a=new at({definition:i});this.possibleTokTypes=hs(a),this.found=!0}}}class bl extends _l{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}}class pI extends bl{walkMany(e,r,n){if(e.idx===this.occurrence){const i=xt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof he&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}}class Mp extends bl{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=xt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof he&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}}class hI extends bl{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=xt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof he&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}}class Fp extends bl{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=xt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof he&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}}function ju(t,e,r=[]){r=Ye(r);let n=[],i=0;function a(o){return o.concat(We(t,i+1))}function s(o){const l=ju(a(o),e,r);return n.concat(l)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof at)return s(o.definition);if(o instanceof tt)return s(o.definition);if(o instanceof He)n=s(o.definition);else if(o instanceof mt){const l=o.definition.concat([new _e({definition:o.definition})]);return s(l)}else if(o instanceof gt){const l=[new at({definition:o.definition}),new _e({definition:[new he({terminalType:o.separator})].concat(o.definition)})];return s(l)}else if(o instanceof ot){const l=o.definition.concat([new _e({definition:[new he({terminalType:o.separator})].concat(o.definition)})]);n=s(l)}else if(o instanceof _e){const l=o.definition.concat([new _e({definition:o.definition})]);n=s(l)}else{if(o instanceof lt)return W(o.definition,l=>{ce(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof he)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:We(t,i)}),n}function qg(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!ce(f);){const h=f.pop();if(h===s){o&&_n(f).idx<=u&&f.pop();continue}const p=h.def,y=h.idx,A=h.ruleStack,N=h.occurrenceStack;if(ce(p))continue;const C=p[0];if(C===i){const S={idx:y,def:We(p),ruleStack:Ba(A),occurrenceStack:Ba(N)};f.push(S)}else if(C instanceof he)if(y<l-1){const S=y+1,_=e[S];if(r(_,C.terminalType)){const k={idx:S,def:We(p),ruleStack:A,occurrenceStack:N};f.push(k)}}else if(y===l-1)c.push({nextTokenType:C.terminalType,nextTokenOccurrence:C.idx,ruleStack:A,occurrenceStack:N}),o=!0;else throw Error("non exhaustive match");else if(C instanceof tt){const S=Ye(A);S.push(C.nonTerminalName);const _=Ye(N);_.push(C.idx);const k={idx:y,def:C.definition.concat(a,We(p)),ruleStack:S,occurrenceStack:_};f.push(k)}else if(C instanceof He){const S={idx:y,def:We(p),ruleStack:A,occurrenceStack:N};f.push(S),f.push(s);const _={idx:y,def:C.definition.concat(We(p)),ruleStack:A,occurrenceStack:N};f.push(_)}else if(C instanceof mt){const S=new _e({definition:C.definition,idx:C.idx}),_=C.definition.concat([S],We(p)),k={idx:y,def:_,ruleStack:A,occurrenceStack:N};f.push(k)}else if(C instanceof gt){const S=new he({terminalType:C.separator}),_=new _e({definition:[S].concat(C.definition),idx:C.idx}),k=C.definition.concat([_],We(p)),K={idx:y,def:k,ruleStack:A,occurrenceStack:N};f.push(K)}else if(C instanceof ot){const S={idx:y,def:We(p),ruleStack:A,occurrenceStack:N};f.push(S),f.push(s);const _=new he({terminalType:C.separator}),k=new _e({definition:[_].concat(C.definition),idx:C.idx}),K=C.definition.concat([k],We(p)),H={idx:y,def:K,ruleStack:A,occurrenceStack:N};f.push(H)}else if(C instanceof _e){const S={idx:y,def:We(p),ruleStack:A,occurrenceStack:N};f.push(S),f.push(s);const _=new _e({definition:C.definition,idx:C.idx}),k=C.definition.concat([_],We(p)),K={idx:y,def:k,ruleStack:A,occurrenceStack:N};f.push(K)}else if(C instanceof lt)for(let S=C.definition.length-1;S>=0;S--){const _=C.definition[S],k={idx:y,def:_.definition.concat(We(p)),ruleStack:A,occurrenceStack:N};f.push(k),f.push(s)}else if(C instanceof at)f.push({idx:y,def:C.definition.concat(We(p)),ruleStack:A,occurrenceStack:N});else if(C instanceof Fi)f.push(mI(C,y,A,N));else throw Error("non exhaustive match")}return c}function mI(t,e,r,n){const i=Ye(r);i.push(t.name);const a=Ye(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var $e;(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"})($e||($e={}));function Vf(t){if(t instanceof He||t==="Option")return $e.OPTION;if(t instanceof _e||t==="Repetition")return $e.REPETITION;if(t instanceof mt||t==="RepetitionMandatory")return $e.REPETITION_MANDATORY;if(t instanceof gt||t==="RepetitionMandatoryWithSeparator")return $e.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ot||t==="RepetitionWithSeparator")return $e.REPETITION_WITH_SEPARATOR;if(t instanceof lt||t==="Alternation")return $e.ALTERNATION;throw Error("non exhaustive match")}function Gp(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Vf(n);return a===$e.ALTERNATION?Nl(e,r,i):Il(e,r,a,i)}function gI(t,e,r,n,i,a){const s=Nl(t,e,r),o=Kg(s)?Fo:ms;return a(s,n,o,i)}function yI(t,e,r,n,i,a){const s=Il(t,e,i,r),o=Kg(s)?Fo:ms;return a(s[0],o,n)}function TI(t,e,r,n){const i=t.length,a=qt(t,s=>qt(s,o=>o.length===1));if(e)return function(s){const o=z(s,l=>l.GATE);for(let l=0;l<i;l++){const u=t[l],c=u.length,f=o[l];if(!(f!==void 0&&f.call(this)===!1))e:for(let h=0;h<c;h++){const p=u[h],y=p.length;for(let A=0;A<y;A++){const N=this.LA(A+1);if(r(N,p[A])===!1)continue e}return l}}};if(a&&!n){const s=z(t,l=>kt(l)),o=ht(s,(l,u,c)=>(W(u,f=>{j(l,f.tokenTypeIdx)||(l[f.tokenTypeIdx]=c),W(f.categoryMatches,h=>{j(l,h)||(l[h]=c)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){const o=t[s],l=o.length;e:for(let u=0;u<l;u++){const c=o[u],f=c.length;for(let h=0;h<f;h++){const p=this.LA(h+1);if(r(p,c[h])===!1)continue e}return s}}}}function RI(t,e,r){const n=qt(t,a=>a.length===1),i=t.length;if(n&&!r){const a=kt(t);if(a.length===1&&ce(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=ht(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,W(l.categoryMatches,c=>{o[c]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){const s=t[a],o=s.length;for(let l=0;l<o;l++){const u=this.LA(l+1);if(e(u,s[l])===!1)continue e}return!0}return!1}}class vI extends _l{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,$e.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,$e.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,$e.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,$e.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,$e.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class Bg extends Gi{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,$e.OPTION)}visitRepetition(e){this.checkIsTarget(e,$e.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,$e.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,$e.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,$e.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,$e.ALTERNATION)}}function zp(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Yl(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let a=0;a<e.length;a++){const s=e[a];i.push(s+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const l="_"+n.categoryMatches[o];i.push(s+l)}}e=i}return e}function $I(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let a=0;a<e.length;a++){const s=e[a];if(i[s]===!0)return!1}}return!0}function Wg(t,e){const r=z(t,s=>ju([s],1)),n=zp(r.length),i=z(r,s=>{const o={};return W(s,l=>{const u=Yl(l.partialPath);W(u,c=>{o[c]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=zp(o.length);for(let l=0;l<o.length;l++){const u=o[l];for(let c=0;c<u.length;c++){const f=u[c].partialPath,h=u[c].suffixDef,p=Yl(f);if($I(i,p,l)||ce(h)||f.length===e){const A=n[l];if(qu(A,f)===!1){A.push(f);for(let N=0;N<p.length;N++){const C=p[N];i[l][C]=!0}}}else{const A=ju(h,s+1,f);a[l]=a[l].concat(A),W(A,N=>{const C=Yl(N.partialPath);W(C,S=>{i[l][S]=!0})})}}}}return n}function Nl(t,e,r,n){const i=new Bg(t,$e.ALTERNATION,n);return e.accept(i),Wg(i.result,r)}function Il(t,e,r,n){const i=new Bg(t,r);e.accept(i);const a=i.result,o=new vI(e,t,r).startWalking(),l=new at({definition:a}),u=new at({definition:o});return Wg([l,u],n)}function qu(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const a=e[i],s=n[i];if((a===s||s.categoryMatchesMap[a.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function AI(t,e){return t.length<e.length&&qt(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function Kg(t){return qt(t,e=>qt(e,r=>qt(r,n=>ce(n.categoryMatches))))}function EI(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return z(e,r=>Object.assign({type:rt.CUSTOM_LOOKAHEAD_VALIDATION},r))}function CI(t,e,r,n){const i=Rt(t,l=>SI(l,r)),a=MI(t,e,r),s=Rt(t,l=>OI(l,r)),o=Rt(t,l=>bI(l,t,n,r));return i.concat(a,s,o)}function SI(t,e){const r=new wI;t.accept(r);const n=r.allProductions,i=PC(n,_I),a=HC(i,o=>o.length>1);return z(Me(a),o=>{const l=xt(o),u=e.buildDuplicateFoundError(t,o),c=zt(l),f={message:u,type:rt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:l.idx},h=Vg(l);return h&&(f.parameter=h),f})}function _I(t){return`${zt(t)}_#_${t.idx}_#_${Vg(t)}`}function Vg(t){return t instanceof he?t.terminalType.name:t instanceof tt?t.nonTerminalName:""}class wI extends Gi{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 bI(t,e,r,n){const i=[];if(ht(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:rt.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function NI(t,e,r){const n=[];let i;return st(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:rt.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Hg(t,e,r,n=[]){const i=[],a=Ro(e.definition);if(ce(a))return[];{const s=t.name;st(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:rt.LEFT_RECURSION,ruleName:s});const l=hl(a,n.concat([t])),u=Rt(l,c=>{const f=Ye(n);return f.push(c),Hg(t,c,r,f)});return i.concat(u)}}function Ro(t){let e=[];if(ce(t))return e;const r=xt(t);if(r instanceof tt)e.push(r.referencedRule);else if(r instanceof at||r instanceof He||r instanceof mt||r instanceof gt||r instanceof ot||r instanceof _e)e=e.concat(Ro(r.definition));else if(r instanceof lt)e=kt(z(r.definition,a=>Ro(a.definition)));else if(!(r instanceof he))throw Error("non exhaustive match");const n=Do(r),i=t.length>1;if(n&&i){const a=We(t);return e.concat(Ro(a))}else return e}class Hf extends Gi{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function II(t,e){const r=new Hf;t.accept(r);const n=r.alternations;return Rt(n,a=>{const s=Ba(a.definition);return Rt(s,(o,l)=>{const u=qg([o],[],ms,1);return ce(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:rt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}function PI(t,e,r){const n=new Hf;t.accept(n);let i=n.alternations;return i=ml(i,s=>s.ignoreAmbiguities===!0),Rt(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=Nl(o,t,l,s),c=xI(u,s,t,r),f=DI(u,s,t,r);return c.concat(f)})}class kI extends Gi{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 OI(t,e){const r=new Hf;t.accept(r);const n=r.alternations;return Rt(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:rt.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function LI(t,e,r){const n=[];return W(t,i=>{const a=new kI;i.accept(a);const s=a.allProductions;W(s,o=>{const l=Vf(o),u=o.maxLookahead||e,c=o.idx,h=Il(c,i,l,u)[0];if(ce(kt(h))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:rt.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function xI(t,e,r,n){const i=[],a=ht(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||W(l,c=>{const f=[u];W(t,(h,p)=>{u!==p&&qu(h,c)&&e.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!qu(i,c)&&(i.push(c),o.push({alts:f,path:c}))}),o),[]);return z(a,o=>{const l=z(o.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:rt.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function DI(t,e,r,n){const i=ht(t,(s,o,l)=>{const u=z(o,c=>({idx:l,path:c}));return s.concat(u)},[]);return fs(Rt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,c=Et(i,h=>e.definition[h.idx].ignoreAmbiguities!==!0&&h.idx<l&&AI(h.path,u));return z(c,h=>{const p=[h.idx+1,l+1],y=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:h.path}),type:rt.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:y,alternatives:p}})}))}function MI(t,e,r){const n=[],i=z(e,a=>a.name);return W(t,a=>{const s=a.name;if(st(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:rt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function FI(t){const e=Df(t,{errMsgProvider:lI}),r={};return W(t.rules,n=>{r[n.name]=n}),uI(r,e.errMsgProvider)}function GI(t){return t=Df(t,{errMsgProvider:vn}),CI(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const Yg="MismatchedTokenException",Xg="NoViableAltException",Jg="EarlyExitException",Zg="NotAllInputParsedException",Qg=[Yg,Xg,Jg,Zg];Object.freeze(Qg);function Go(t){return st(Qg,t.name)}class Pl extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ey extends Pl{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Yg}}class zI extends Pl{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Xg}}class UI extends Pl{constructor(e,r){super(e,r),this.name=Zg}}class jI extends Pl{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Jg}}const Xl={},ty="InRuleRecoveryException";class qI extends Error{constructor(e){super(e),this.name=ty}}class BI{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=j(e,"recoveryEnabled")?e.recoveryEnabled:Er.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=WI)}getTokenToInsert(e){const r=Kf(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){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let c=this.LA(1);const f=()=>{const h=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:h,ruleName:this.getCurrRuleFullName()}),y=new ey(p,u,this.LA(0));y.resyncedTokens=Ba(o),this.SAVE_ERROR(y)};for(;!l;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,a)?l=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const 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)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new qI("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||ce(r))return!1;const n=this.LA(1);return Pi(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return st(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=Pi(e,a=>jg(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Xl;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return z(e,(n,i)=>i===0?Xl:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=z(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return kt(e)}getFollowSetFromFollowKey(e){if(e===Xl)return[Kr];const r=e.ruleName+e.idxInCallingRule+kg+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Kr)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return Ba(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Ye(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return z(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function WI(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const h=this.getCurrRuleFullName(),p=this.getGAstProductions()[h];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,c=l.occurrence;const f=l.isEndOfRule;this.RULE_STACK.length===1&&f&&u===void 0&&(u=Kr,c=1),!(u===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,c,s)&&this.tryInRepetitionRecovery(t,e,r,u)}const KI=4,Xr=8,ry=1<<Xr,ny=2<<Xr,Bu=3<<Xr,Wu=4<<Xr,Ku=5<<Xr,vo=6<<Xr;function Jl(t,e,r){return r|e|t}class Yf{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:Er.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(ce(r)){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return Rt(e,r=>Hg(r,r,vn))}validateEmptyOrAlternatives(e){return Rt(e,r=>II(r,vn))}validateAmbiguousAlternationAlternatives(e,r){return Rt(e,n=>PI(n,r,vn))}validateSomeNonEmptyLookaheadPath(e,r){return LI(e,r,vn)}buildLookaheadForAlternation(e){return gI(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,TI)}buildLookaheadForOptional(e){return yI(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Vf(e.prodType),RI)}}class VI{initLooksAhead(e){this.dynamicTokensEnabled=j(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Er.dynamicTokensEnabled,this.maxLookahead=j(e,"maxLookahead")?e.maxLookahead:Er.maxLookahead,this.lookaheadStrategy=j(e,"lookaheadStrategy")?e.lookaheadStrategy:new Yf({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){W(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=YI(r);W(n,u=>{const c=u.idx===0?"":u.idx;this.TRACE_INIT(`${zt(u)}${c}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),h=Jl(this.fullRuleNameToShort[r.name],ry,u.idx);this.setLaFuncCache(h,f)})}),W(i,u=>{this.computeLookaheadFunc(r,u.idx,Bu,"Repetition",u.maxLookahead,zt(u))}),W(a,u=>{this.computeLookaheadFunc(r,u.idx,ny,"Option",u.maxLookahead,zt(u))}),W(s,u=>{this.computeLookaheadFunc(r,u.idx,Wu,"RepetitionMandatory",u.maxLookahead,zt(u))}),W(o,u=>{this.computeLookaheadFunc(r,u.idx,vo,"RepetitionMandatoryWithSeparator",u.maxLookahead,zt(u))}),W(l,u=>{this.computeLookaheadFunc(r,u.idx,Ku,"RepetitionWithSeparator",u.maxLookahead,zt(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=Jl(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return Jl(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class HI extends Gi{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)}}const Ks=new HI;function YI(t){Ks.reset(),t.accept(Ks);const e=Ks.dslMethods;return Ks.reset(),e}function Up(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function jp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function XI(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function JI(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const ZI="name";function iy(t,e){Object.defineProperty(t,ZI,{enumerable:!1,configurable:!0,writable:!1,value:e})}function QI(t,e){const r=At(t),n=r.length;for(let i=0;i<n;i++){const a=r[i],s=t[a],o=s.length;for(let l=0;l<o;l++){const u=s[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function eP(t,e){const r=function(){};iy(r,t+"BaseSemantics");const n={visit:function(i,a){if(Q(i)&&(i=i[0]),!$r(i))return this[i.name](i.children,a)},validateVisitor:function(){const i=rP(this,e);if(!ce(i)){const a=z(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
90
+ ${a.join(`
91
+
92
+ `).replace(/\n/g,`
93
+ `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function tP(t,e,r){const n=function(){};iy(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return W(e,a=>{i[a]=QI}),n.prototype=i,n.prototype.constructor=n,n}var Vu;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Vu||(Vu={}));function rP(t,e){return nP(t,e)}function nP(t,e){const r=Et(e,i=>_r(t[i])===!1),n=z(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Vu.MISSING_METHOD,methodName:i}));return fs(n)}class iP{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=j(e,"nodeLocationTracking")?e.nodeLocationTracking:Er.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Fe,this.cstFinallyStateUpdate=Fe,this.cstPostTerminal=Fe,this.cstPostNonTerminal=Fe,this.cstPostRule=Fe;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=jp,this.setNodeLocationFromNode=jp,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Up,this.setNodeLocationFromNode=Up,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=Fe,this.setInitialNodeLocation=Fe;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const 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){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];XI(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];JI(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if($r(this.baseCstVisitorConstructor)){const e=eP(this.className,At(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if($r(this.baseCstVisitorWithDefaultsConstructor)){const e=tP(this.className,At(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class aP{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Uo}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Uo: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()}}class sP{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=jo){if(st(this.definedRulesNames,e)){const s={message:vn.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:rt.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=jo){const i=NI(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(Go(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return hN(Me(this.gastProductionsCache))}}class oP{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Fo,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},j(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
94
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
95
+ For Further details.`);if(Q(e)){if(ce(e))throw Error(`A Token Vocabulary cannot be empty.
96
+ Note that the first argument for the parser constructor
97
+ 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.
98
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
99
+ For Further details.`)}if(Q(e))this.tokensMap=ht(e,(a,s)=>(a[s.name]=s,a),{});else if(j(e,"modes")&&qt(kt(Me(e.modes)),aI)){const a=kt(Me(e.modes)),s=Mf(a);this.tokensMap=ht(s,(o,l)=>(o[l.name]=l,o),{})}else if($t(e))this.tokensMap=Ye(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Kr;const n=j(e,"modes")?kt(Me(e.modes)):Me(e),i=qt(n,a=>ce(a.categoryMatches));this.tokenMatcher=i?Fo:ms,gs(Me(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'
100
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=j(n,"resyncEnabled")?n.resyncEnabled:jo.resyncEnabled,a=j(n,"recoveryValueFunc")?n.recoveryValueFunc:jo.recoveryValueFunc,s=this.ruleShortNameIdx<<KI+Xr;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=function(...c){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c);const f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(f){return this.invokeRuleCatch(f,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){const i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(Go(e)){const s=e;if(a){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(s.resyncedTokens=this.reSyncTo(o),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return n(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,s.partialCstResult=l}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){const n=this.getKeyForAutomaticLookahead(ny,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof e!="function"){a=e.DEF;const s=e.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(Wu,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,$e.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,Wu,e,hI)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(vo,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),a);for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,Fp],o,vo,e,Fp)}else throw this.raiseEarlyExitException(e,$e.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(Bu,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=()=>o.call(this)&&l.call(this)}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,Bu,e,pI,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Ku,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),a);for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,Mp],o,Ku,e,Mp)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,vo,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(ry,r),i=Q(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new UI(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw Go(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{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ey(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===ty?n:a}}else throw n}saveRecogState(){const e=this.errors,r=Ye(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(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Kr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class lP{initErrorHandler(e){this._errors=[],this.errorMessageProvider=j(e,"errorMessageProvider")?e.errorMessageProvider:Er.errorMessageProvider}SAVE_ERROR(e){if(Go(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ye(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ye(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=Il(e,a,r,this.maxLookahead)[0],l=[];for(let c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new jI(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Nl(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new zI(l,this.LA(1),o))}}class uP{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if($r(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return qg([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=xt(e.ruleStack),i=this.getGAstProductions()[r];return new dI(i,e).startWalking()}}const kl={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(kl);const qp=!0,Bp=Math.pow(2,Xr)-1,ay=Ug({name:"RECORDING_PHASE_TOKEN",pattern:nt.NA});gs([ay]);const sy=Kf(ay,`This IToken indicates the Parser is in Recording Phase
101
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(sy);const cP={name:`This CSTNode indicates the Parser is in Recording Phase
102
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class fP{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++){const 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",()=>{const e=this;for(let r=0;r<10;r++){const 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 Uo}topLevelRuleRecord(e,r){try{const n=new Fi({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+`
103
+ This error was thrown during the "grammar recording phase" For more info see:
104
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return la.call(this,He,e,r)}atLeastOneInternalRecord(e,r){la.call(this,mt,r,e)}atLeastOneSepFirstInternalRecord(e,r){la.call(this,gt,r,e,qp)}manyInternalRecord(e,r){la.call(this,_e,r,e)}manySepFirstInternalRecord(e,r){la.call(this,ot,r,e,qp)}orInternalRecord(e,r){return dP.call(this,e,r)}subruleInternalRecord(e,r,n){if(zo(r),!e||j(e,"ruleName")===!1){const o=new Error(`<SUBRULE${Wp(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
105
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=_n(this.recordingProdStack),a=e.ruleName,s=new tt({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?cP:kl}consumeInternalRecord(e,r,n){if(zo(r),!Gg(e)){const s=new Error(`<CONSUME${Wp(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
106
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=_n(this.recordingProdStack),a=new he({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),sy}}function la(t,e,r,n=!1){zo(r);const i=_n(this.recordingProdStack),a=_r(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),j(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),kl}function dP(t,e){zo(e);const r=_n(this.recordingProdStack),n=Q(t)===!1,i=n===!1?t:t.DEF,a=new lt({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});j(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=JC(i,o=>_r(o.GATE));return a.hasPredicates=s,r.definition.push(a),W(i,o=>{const l=new at({definition:[]});a.definition.push(l),j(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:j(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),kl}function Wp(t){return t===0?"":`${t}`}function zo(t){if(t<0||t>Bp){const e=new Error(`Invalid DSL Method idx value: <${t}>
107
+ Idx value must be a none negative value smaller than ${Bp+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class pP{initPerformanceTracer(e){if(j(e,"traceInitPerf")){const 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=Er.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);const{time:i,value:a}=lg(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,a}else return r()}}function hP(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}const Uo=Kf(Kr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Uo);const Er=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:si,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),jo=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rt;(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"})(rt||(rt={}));function Kp(t=void 0){return function(){return t}}class ys{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;const r=this.className;this.TRACE_INIT("toFastProps",()=>{ug(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),W(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=FI({rules:Me(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(ce(n)&&this.skipValidations===!1){const i=GI({rules:Me(this.gastProductionsCache),tokenTypes:Me(this.tokensMap),errMsgProvider:vn,grammarName:r}),a=EI({lookaheadStrategy:this.lookaheadStrategy,rules:Me(this.gastProductionsCache),tokenTypes:Me(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),ce(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=$N(Me(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Me(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Me(this.gastProductionsCache))})),!ys.DEFER_DEFINITION_ERRORS_HANDLING&&!ce(this.definitionErrors))throw e=z(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
108
+ ${e.join(`
109
+ -------------------------------
110
+ `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const 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),j(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
111
+ Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
112
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
113
+ For further details.`);this.skipValidations=j(r,"skipValidations")?r.skipValidations:Er.skipValidations}}ys.DEFER_DEFINITION_ERRORS_HANDLING=!1;hP(ys,[BI,VI,iP,aP,oP,sP,lP,uP,fP,pP]);class mP extends ys{constructor(e,r=Er){const n=Ye(r);n.outputCst=!1,super(e,n)}}function ki(t,e,r){return`${t.name}_${e}_${r}`}const Vr=1,gP=2,oy=4,ly=5,Ts=7,yP=8,TP=9,RP=10,vP=11,uy=12;class Xf{constructor(e){this.target=e}isEpsilon(){return!1}}class Jf extends Xf{constructor(e,r){super(e),this.tokenType=r}}class cy extends Xf{constructor(e){super(e)}isEpsilon(){return!0}}class Zf extends Xf{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function $P(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};AP(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=Mn(e,i,i);a!==void 0&&OP(e,i,a)}return e}function AP(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=Ge(t,i,void 0,{type:gP}),s=Ge(t,i,void 0,{type:Ts});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function fy(t,e,r){return r instanceof he?Qf(t,e,r.terminalType,r):r instanceof tt?kP(t,e,r):r instanceof lt?wP(t,e,r):r instanceof He?bP(t,e,r):r instanceof _e?EP(t,e,r):r instanceof ot?CP(t,e,r):r instanceof mt?SP(t,e,r):r instanceof gt?_P(t,e,r):Mn(t,e,r)}function EP(t,e,r){const n=Ge(t,e,r,{type:ly});Jr(t,n);const i=zi(t,e,n,r,Mn(t,e,r));return py(t,e,r,i)}function CP(t,e,r){const n=Ge(t,e,r,{type:ly});Jr(t,n);const i=zi(t,e,n,r,Mn(t,e,r)),a=Qf(t,e,r.separator,r);return py(t,e,r,i,a)}function SP(t,e,r){const n=Ge(t,e,r,{type:oy});Jr(t,n);const i=zi(t,e,n,r,Mn(t,e,r));return dy(t,e,r,i)}function _P(t,e,r){const n=Ge(t,e,r,{type:oy});Jr(t,n);const i=zi(t,e,n,r,Mn(t,e,r)),a=Qf(t,e,r.separator,r);return dy(t,e,r,i,a)}function wP(t,e,r){const n=Ge(t,e,r,{type:Vr});Jr(t,n);const i=gr(r.definition,s=>fy(t,e,s));return zi(t,e,n,r,...i)}function bP(t,e,r){const n=Ge(t,e,r,{type:Vr});Jr(t,n);const i=zi(t,e,n,r,Mn(t,e,r));return NP(t,e,r,i)}function Mn(t,e,r){const n=TT(gr(r.definition,i=>fy(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:PP(t,n)}function dy(t,e,r,n,i){const a=n.left,s=n.right,o=Ge(t,e,r,{type:vP});Jr(t,o);const l=Ge(t,e,r,{type:uy});return a.loopback=o,l.loopback=o,t.decisionMap[ki(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Oe(s,o),i===void 0?(Oe(o,a),Oe(o,l)):(Oe(o,l),Oe(o,i.left),Oe(i.right,a)),{left:a,right:l}}function py(t,e,r,n,i){const a=n.left,s=n.right,o=Ge(t,e,r,{type:RP});Jr(t,o);const l=Ge(t,e,r,{type:uy}),u=Ge(t,e,r,{type:TP});return o.loopback=u,l.loopback=u,Oe(o,a),Oe(o,l),Oe(s,u),i!==void 0?(Oe(u,l),Oe(u,i.left),Oe(i.right,a)):Oe(u,o),t.decisionMap[ki(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function NP(t,e,r,n){const i=n.left,a=n.right;return Oe(i,a),t.decisionMap[ki(e,"Option",r.idx)]=i,n}function Jr(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function zi(t,e,r,n,...i){const a=Ge(t,e,n,{type:yP,start:r});r.end=a;for(const o of i)o!==void 0?(Oe(r,o.left),Oe(o.right,a)):Oe(r,a);const s={left:r,right:a};return t.decisionMap[ki(e,IP(n),n.idx)]=r,s}function IP(t){if(t instanceof lt)return"Alternation";if(t instanceof He)return"Option";if(t instanceof _e)return"Repetition";if(t instanceof ot)return"RepetitionWithSeparator";if(t instanceof mt)return"RepetitionMandatory";if(t instanceof gt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function PP(t,e){const r=e.length;for(let a=0;a<r-1;a++){const s=e[a];let o;s.left.transitions.length===1&&(o=s.left.transitions[0]);const l=o instanceof Zf,u=o,c=e[a+1].left;s.left.type===Vr&&s.right.type===Vr&&o!==void 0&&(l&&u.followState===s.right||o.target===s.right)?(l?u.followState=c:o.target=c,LP(t,s.right)):Oe(s.right,c)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Qf(t,e,r,n){const i=Ge(t,e,n,{type:Vr}),a=Ge(t,e,n,{type:Vr});return ed(i,new Jf(a,r)),{left:i,right:a}}function kP(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=Ge(t,e,r,{type:Vr}),s=Ge(t,e,r,{type:Vr}),o=new Zf(i,n,s);return ed(a,o),{left:a,right:s}}function OP(t,e,r){const n=t.ruleToStartState.get(e);Oe(n,r.left);const i=t.ruleToStopState.get(e);return Oe(r.right,i),{left:n,right:i}}function Oe(t,e){const r=new cy(e);ed(t,r)}function Ge(t,e,r,n){const i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function ed(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function LP(t,e){t.states.splice(t.states.indexOf(e),1)}const qo={};class Hu{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=hy(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return gr(this.configs,e=>e.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}}function hy(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function xP(t,e){const r={};return n=>{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}class my{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}}const Vp=new my;class DP extends Yf{constructor(e){var r;super(),this.logging=(r=e==null?void 0:e.logging)!==null&&r!==void 0?r:(n=>console.log(n))}initialize(e){this.atn=$P(e.rules),this.dfas=MP(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=ki(n,"Alternation",r),c=this.atn.decisionMap[l].decision,f=gr(Gp({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),h=>gr(h,p=>p[0]));if(Hp(f,!1)&&!a){const h=ld(f,(p,y,A)=>(Dl(y,N=>{N&&(p[N.tokenTypeIdx]=A,Dl(N.categoryMatches,C=>{p[C]=A}))}),p),{});return i?function(p){var y;const A=this.LA(1),N=h[A.tokenTypeIdx];if(p!==void 0&&N!==void 0){const C=(y=p[N])===null||y===void 0?void 0:y.GATE;if(C!==void 0&&C.call(this)===!1)return}return N}:function(){const p=this.LA(1);return h[p.tokenTypeIdx]}}else return i?function(h){const p=new my,y=h===void 0?0:h.length;for(let N=0;N<y;N++){const C=h==null?void 0:h[N].GATE;p.set(N,C===void 0||C.call(this))}const A=Zl.call(this,s,c,p,o);return typeof A=="number"?A:void 0}:function(){const h=Zl.call(this,s,c,Vp,o);return typeof h=="number"?h:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=ki(n,i,r),c=this.atn.decisionMap[l].decision,f=gr(Gp({maxLookahead:1,occurrence:r,prodType:i,rule:n}),h=>gr(h,p=>p[0]));if(Hp(f)&&f[0][0]&&!a){const h=f[0],p=pT(h);if(p.length===1&&RT(p[0].categoryMatches)){const A=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===A}}else{const y=ld(p,(A,N)=>(N!==void 0&&(A[N.tokenTypeIdx]=!0,Dl(N.categoryMatches,C=>{A[C]=!0})),A),{});return function(){const A=this.LA(1);return y[A.tokenTypeIdx]===!0}}}return function(){const h=Zl.call(this,s,c,Vp,o);return typeof h=="object"?!1:h===0}}}function Hp(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}function MP(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=xP(t.decisionStates[n],n);return r}function Zl(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const o=HP(i.atnStartState);a=yy(i,gy(o)),i.start=a}return FP.apply(this,[i,a,r,n])}function FP(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA(a++);for(;;){let l=BP(i,o);if(l===void 0&&(l=GP.apply(this,[t,i,o,a,r,n])),l===qo)return qP(s,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,s.push(o),o=this.LA(a++)}}function GP(t,e,r,n,i,a){const s=WP(e.configs,r,i);if(s.size===0)return Yp(t,e,r,qo),qo;let o=gy(s);const l=VP(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(ZP(s)){const u=hT(s.alts);o.isAcceptState=!0,o.prediction=u,o.configs.uniqueAlt=u,zP.apply(this,[t,n,s.alts,a])}return o=Yp(t,e,r,o),o}function zP(t,e,r,n){const i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);const a=t.atnStartState,s=a.rule,o=a.production,l=UP({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function UP(t){const e=gr(t.prefixPath,i=>ui(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${jP(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
114
+ <${e}> may appears as a prefix path in all these alternatives.
115
+ `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
116
+ For Further details.`,n}function jP(t){if(t instanceof tt)return"SUBRULE";if(t instanceof He)return"OPTION";if(t instanceof lt)return"OR";if(t instanceof mt)return"AT_LEAST_ONE";if(t instanceof gt)return"AT_LEAST_ONE_SEP";if(t instanceof ot)return"MANY_SEP";if(t instanceof _e)return"MANY";if(t instanceof he)return"CONSUME";throw Error("non exhaustive match")}function qP(t,e,r){const n=vT(e.configs.elements,a=>a.state.transitions),i=$T(n.filter(a=>a instanceof Jf).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function BP(t,e){return t.edges[e.tokenTypeIdx]}function WP(t,e,r){const n=new Hu,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Ts){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const u=s.state.transitions[l],c=KP(u,e);c!==void 0&&n.add({state:c,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new Hu;for(const s of n.elements)Bo(s,a)}if(i.length>0&&!XP(a))for(const s of i)a.add(s);return a}function KP(t,e){if(t instanceof Jf&&jg(e,t.tokenType))return t.target}function VP(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function gy(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Yp(t,e,r,n){return n=yy(t,n),e.edges[r.tokenTypeIdx]=n,n}function yy(t,e){if(e===qo)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function HP(t){const e=new Hu,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};Bo(a,e)}return e}function Bo(t,e){const r=t.state;if(r.type===Ts){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Bo(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const a=r.transitions[i],s=YP(t,a);s!==void 0&&Bo(s,e)}}function YP(t,e){if(e instanceof cy)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Zf){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function XP(t){for(const e of t.elements)if(e.state.type===Ts)return!0;return!1}function JP(t){for(const e of t.elements)if(e.state.type!==Ts)return!1;return!0}function ZP(t){if(JP(t))return!0;const e=QP(t.elements);return ek(e)&&!tk(e)}function QP(t){const e=new Map;for(const r of t){const n=hy(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function ek(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function tk(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var Yu;(function(t){function e(r){return typeof r=="string"}t.is=e})(Yu||(Yu={}));var Wo;(function(t){function e(r){return typeof r=="string"}t.is=e})(Wo||(Wo={}));var Xu;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Xu||(Xu={}));var Va;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Va||(Va={}));var re;(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}}t.create=e;function r(n){let i=n;return $.objectLiteral(i)&&$.uinteger(i.line)&&$.uinteger(i.character)}t.is=r})(re||(re={}));var X;(function(t){function e(n,i,a,s){if($.uinteger(n)&&$.uinteger(i)&&$.uinteger(a)&&$.uinteger(s))return{start:re.create(n,i),end:re.create(a,s)};if(re.is(n)&&re.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${s}]`)}t.create=e;function r(n){let i=n;return $.objectLiteral(i)&&re.is(i.start)&&re.is(i.end)}t.is=r})(X||(X={}));var Ha;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return $.objectLiteral(i)&&X.is(i.range)&&($.string(i.uri)||$.undefined(i.uri))}t.is=r})(Ha||(Ha={}));var Ju;(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}t.create=e;function r(n){let i=n;return $.objectLiteral(i)&&X.is(i.targetRange)&&$.string(i.targetUri)&&X.is(i.targetSelectionRange)&&(X.is(i.originSelectionRange)||$.undefined(i.originSelectionRange))}t.is=r})(Ju||(Ju={}));var Ko;(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}t.create=e;function r(n){const i=n;return $.objectLiteral(i)&&$.numberRange(i.red,0,1)&&$.numberRange(i.green,0,1)&&$.numberRange(i.blue,0,1)&&$.numberRange(i.alpha,0,1)}t.is=r})(Ko||(Ko={}));var Zu;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return $.objectLiteral(i)&&X.is(i.range)&&Ko.is(i.color)}t.is=r})(Zu||(Zu={}));var Qu;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return $.objectLiteral(i)&&$.string(i.label)&&($.undefined(i.textEdit)||Bt.is(i))&&($.undefined(i.additionalTextEdits)||$.typedArray(i.additionalTextEdits,Bt.is))}t.is=r})(Qu||(Qu={}));var ec;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(ec||(ec={}));var tc;(function(t){function e(n,i,a,s,o,l){const u={startLine:n,endLine:i};return $.defined(a)&&(u.startCharacter=a),$.defined(s)&&(u.endCharacter=s),$.defined(o)&&(u.kind=o),$.defined(l)&&(u.collapsedText=l),u}t.create=e;function r(n){const i=n;return $.objectLiteral(i)&&$.uinteger(i.startLine)&&$.uinteger(i.startLine)&&($.undefined(i.startCharacter)||$.uinteger(i.startCharacter))&&($.undefined(i.endCharacter)||$.uinteger(i.endCharacter))&&($.undefined(i.kind)||$.string(i.kind))}t.is=r})(tc||(tc={}));var Vo;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return $.defined(i)&&Ha.is(i.location)&&$.string(i.message)}t.is=r})(Vo||(Vo={}));var rc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(rc||(rc={}));var nc;(function(t){t.Unnecessary=1,t.Deprecated=2})(nc||(nc={}));var ic;(function(t){function e(r){const n=r;return $.objectLiteral(n)&&$.string(n.href)}t.is=e})(ic||(ic={}));var Ya;(function(t){function e(n,i,a,s,o,l){let u={range:n,message:i};return $.defined(a)&&(u.severity=a),$.defined(s)&&(u.code=s),$.defined(o)&&(u.source=o),$.defined(l)&&(u.relatedInformation=l),u}t.create=e;function r(n){var i;let a=n;return $.defined(a)&&X.is(a.range)&&$.string(a.message)&&($.number(a.severity)||$.undefined(a.severity))&&($.integer(a.code)||$.string(a.code)||$.undefined(a.code))&&($.undefined(a.codeDescription)||$.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&($.string(a.source)||$.undefined(a.source))&&($.undefined(a.relatedInformation)||$.typedArray(a.relatedInformation,Vo.is))}t.is=r})(Ya||(Ya={}));var Nn;(function(t){function e(n,i,...a){let s={title:n,command:i};return $.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return $.defined(i)&&$.string(i.title)&&$.string(i.command)}t.is=r})(Nn||(Nn={}));var Bt;(function(t){function e(a,s){return{range:a,newText:s}}t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}t.insert=r;function n(a){return{range:a,newText:""}}t.del=n;function i(a){const s=a;return $.objectLiteral(s)&&$.string(s.newText)&&X.is(s.range)}t.is=i})(Bt||(Bt={}));var $n;(function(t){function e(n,i,a){const s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}t.create=e;function r(n){const i=n;return $.objectLiteral(i)&&$.string(i.label)&&($.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&($.string(i.description)||i.description===void 0)}t.is=r})($n||($n={}));var Ve;(function(t){function e(r){const n=r;return $.string(n)}t.is=e})(Ve||(Ve={}));var mr;(function(t){function e(a,s,o){return{range:a,newText:s,annotationId:o}}t.replace=e;function r(a,s,o){return{range:{start:a,end:a},newText:s,annotationId:o}}t.insert=r;function n(a,s){return{range:a,newText:"",annotationId:s}}t.del=n;function i(a){const s=a;return Bt.is(s)&&($n.is(s.annotationId)||Ve.is(s.annotationId))}t.is=i})(mr||(mr={}));var Xa;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return $.defined(i)&&Ja.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Xa||(Xa={}));var Oi;(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&$.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||$.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||$.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ve.is(i.annotationId))}t.is=r})(Oi||(Oi={}));var Li;(function(t){function e(n,i,a,s){let o={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&$.string(i.oldUri)&&$.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||$.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||$.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ve.is(i.annotationId))}t.is=r})(Li||(Li={}));var xi;(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&$.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||$.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||$.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Ve.is(i.annotationId))}t.is=r})(xi||(xi={}));var 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=>$.string(i.kind)?Oi.is(i)||Li.is(i)||xi.is(i):Xa.is(i)))}t.is=e})(Ho||(Ho={}));class Vs{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,a;if(n===void 0?i=Bt.insert(e,r):Ve.is(n)?(a=n,i=mr.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=mr.insert(e,r,a)),this.edits.push(i),a!==void 0)return a}replace(e,r,n){let i,a;if(n===void 0?i=Bt.replace(e,r):Ve.is(n)?(a=n,i=mr.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=mr.replace(e,r,a)),this.edits.push(i),a!==void 0)return a}delete(e,r){let n,i;if(r===void 0?n=Bt.del(e):Ve.is(r)?(i=r,n=mr.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=mr.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.")}}class Xp{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(Ve.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()}}class rk{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Xp(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Xa.is(r)){const n=new Vs(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{const n=new Vs(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.");const r={uri:e.uri,version:e.version};let n=this._textEditChanges[r.uri];if(!n){const i=[],a={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(a),n=new Vs(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 Vs(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Xp,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;$n.is(r)||Ve.is(r)?i=r:n=r;let a,s;if(i===void 0?a=Oi.create(e,n):(s=Ve.is(i)?i:this._changeAnnotations.manage(i),a=Oi.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,r,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;$n.is(n)||Ve.is(n)?a=n:i=n;let s,o;if(a===void 0?s=Li.create(e,r,i):(o=Ve.is(a)?a:this._changeAnnotations.manage(a),s=Li.create(e,r,i,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;$n.is(r)||Ve.is(r)?i=r:n=r;let a,s;if(i===void 0?a=xi.create(e,n):(s=Ve.is(i)?i:this._changeAnnotations.manage(i),a=xi.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}}var ac;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return $.defined(i)&&$.string(i.uri)}t.is=r})(ac||(ac={}));var sc;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return $.defined(i)&&$.string(i.uri)&&$.integer(i.version)}t.is=r})(sc||(sc={}));var Ja;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return $.defined(i)&&$.string(i.uri)&&(i.version===null||$.integer(i.version))}t.is=r})(Ja||(Ja={}));var oc;(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,text:s}}t.create=e;function r(n){let i=n;return $.defined(i)&&$.string(i.uri)&&$.string(i.languageId)&&$.integer(i.version)&&$.string(i.text)}t.is=r})(oc||(oc={}));var Yo;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(Yo||(Yo={}));var Di;(function(t){function e(r){const n=r;return $.objectLiteral(r)&&Yo.is(n.kind)&&$.string(n.value)}t.is=e})(Di||(Di={}));var lc;(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})(lc||(lc={}));var uc;(function(t){t.PlainText=1,t.Snippet=2})(uc||(uc={}));var cc;(function(t){t.Deprecated=1})(cc||(cc={}));var fc;(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}t.create=e;function r(n){const i=n;return i&&$.string(i.newText)&&X.is(i.insert)&&X.is(i.replace)}t.is=r})(fc||(fc={}));var dc;(function(t){t.asIs=1,t.adjustIndentation=2})(dc||(dc={}));var pc;(function(t){function e(r){const n=r;return n&&($.string(n.detail)||n.detail===void 0)&&($.string(n.description)||n.description===void 0)}t.is=e})(pc||(pc={}));var hc;(function(t){function e(r){return{label:r}}t.create=e})(hc||(hc={}));var mc;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(mc||(mc={}));var Za;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return $.string(i)||$.objectLiteral(i)&&$.string(i.language)&&$.string(i.value)}t.is=r})(Za||(Za={}));var gc;(function(t){function e(r){let n=r;return!!n&&$.objectLiteral(n)&&(Di.is(n.contents)||Za.is(n.contents)||$.typedArray(n.contents,Za.is))&&(r.range===void 0||X.is(r.range))}t.is=e})(gc||(gc={}));var yc;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(yc||(yc={}));var Tc;(function(t){function e(r,n,...i){let a={label:r};return $.defined(n)&&(a.documentation=n),$.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(Tc||(Tc={}));var Rc;(function(t){t.Text=1,t.Read=2,t.Write=3})(Rc||(Rc={}));var vc;(function(t){function e(r,n){let i={range:r};return $.number(n)&&(i.kind=n),i}t.create=e})(vc||(vc={}));var $c;(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})($c||($c={}));var Ac;(function(t){t.Deprecated=1})(Ac||(Ac={}));var Ec;(function(t){function e(r,n,i,a,s){let o={name:r,kind:n,location:{uri:a,range:i}};return s&&(o.containerName=s),o}t.create=e})(Ec||(Ec={}));var Cc;(function(t){function e(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(Cc||(Cc={}));var Sc;(function(t){function e(n,i,a,s,o,l){let u={name:n,detail:i,kind:a,range:s,selectionRange:o};return l!==void 0&&(u.children=l),u}t.create=e;function r(n){let i=n;return i&&$.string(i.name)&&$.number(i.kind)&&X.is(i.range)&&X.is(i.selectionRange)&&(i.detail===void 0||$.string(i.detail))&&(i.deprecated===void 0||$.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Sc||(Sc={}));var _c;(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"})(_c||(_c={}));var Qa;(function(t){t.Invoked=1,t.Automatic=2})(Qa||(Qa={}));var wc;(function(t){function e(n,i,a){let s={diagnostics:n};return i!=null&&(s.only=i),a!=null&&(s.triggerKind=a),s}t.create=e;function r(n){let i=n;return $.defined(i)&&$.typedArray(i.diagnostics,Ya.is)&&(i.only===void 0||$.typedArray(i.only,$.string))&&(i.triggerKind===void 0||i.triggerKind===Qa.Invoked||i.triggerKind===Qa.Automatic)}t.is=r})(wc||(wc={}));var bc;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):Nn.is(i)?s.command=i:s.edit=i,o&&a!==void 0&&(s.kind=a),s}t.create=e;function r(n){let i=n;return i&&$.string(i.title)&&(i.diagnostics===void 0||$.typedArray(i.diagnostics,Ya.is))&&(i.kind===void 0||$.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Nn.is(i.command))&&(i.isPreferred===void 0||$.boolean(i.isPreferred))&&(i.edit===void 0||Ho.is(i.edit))}t.is=r})(bc||(bc={}));var Nc;(function(t){function e(n,i){let a={range:n};return $.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return $.defined(i)&&X.is(i.range)&&($.undefined(i.command)||Nn.is(i.command))}t.is=r})(Nc||(Nc={}));var Ic;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return $.defined(i)&&$.uinteger(i.tabSize)&&$.boolean(i.insertSpaces)}t.is=r})(Ic||(Ic={}));var Pc;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return $.defined(i)&&X.is(i.range)&&($.undefined(i.target)||$.string(i.target))}t.is=r})(Pc||(Pc={}));var kc;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return $.objectLiteral(i)&&X.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(kc||(kc={}));var Oc;(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"})(Oc||(Oc={}));var Lc;(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"})(Lc||(Lc={}));var xc;(function(t){function e(r){const n=r;return $.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(xc||(xc={}));var Dc;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&X.is(i.range)&&$.string(i.text)}t.is=r})(Dc||(Dc={}));var Mc;(function(t){function e(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}t.create=e;function r(n){const i=n;return i!=null&&X.is(i.range)&&$.boolean(i.caseSensitiveLookup)&&($.string(i.variableName)||i.variableName===void 0)}t.is=r})(Mc||(Mc={}));var Fc;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&X.is(i.range)&&($.string(i.expression)||i.expression===void 0)}t.is=r})(Fc||(Fc={}));var Gc;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return $.defined(i)&&X.is(n.stoppedLocation)}t.is=r})(Gc||(Gc={}));var Xo;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Xo||(Xo={}));var Jo;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return $.objectLiteral(i)&&(i.tooltip===void 0||$.string(i.tooltip)||Di.is(i.tooltip))&&(i.location===void 0||Ha.is(i.location))&&(i.command===void 0||Nn.is(i.command))}t.is=r})(Jo||(Jo={}));var zc;(function(t){function e(n,i,a){const s={position:n,label:i};return a!==void 0&&(s.kind=a),s}t.create=e;function r(n){const i=n;return $.objectLiteral(i)&&re.is(i.position)&&($.string(i.label)||$.typedArray(i.label,Jo.is))&&(i.kind===void 0||Xo.is(i.kind))&&i.textEdits===void 0||$.typedArray(i.textEdits,Bt.is)&&(i.tooltip===void 0||$.string(i.tooltip)||Di.is(i.tooltip))&&(i.paddingLeft===void 0||$.boolean(i.paddingLeft))&&(i.paddingRight===void 0||$.boolean(i.paddingRight))}t.is=r})(zc||(zc={}));var Uc;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Uc||(Uc={}));var jc;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(jc||(jc={}));var qc;(function(t){function e(r){return{items:r}}t.create=e})(qc||(qc={}));var Bc;(function(t){t.Invoked=0,t.Automatic=1})(Bc||(Bc={}));var Wc;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Wc||(Wc={}));var Kc;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Kc||(Kc={}));var Vc;(function(t){function e(r){const n=r;return $.objectLiteral(n)&&Wo.is(n.uri)&&$.string(n.name)}t.is=e})(Vc||(Vc={}));const nk=[`
117
+ `,`\r
118
+ `,"\r"];var Hc;(function(t){function e(a,s,o,l){return new ik(a,s,o,l)}t.create=e;function r(a){let s=a;return!!($.defined(s)&&$.string(s.uri)&&($.undefined(s.languageId)||$.string(s.languageId))&&$.uinteger(s.lineCount)&&$.func(s.getText)&&$.func(s.positionAt)&&$.func(s.offsetAt))}t.is=r;function n(a,s){let o=a.getText(),l=i(s,(c,f)=>{let h=c.range.start.line-f.range.start.line;return h===0?c.range.start.character-f.range.start.character:h}),u=o.length;for(let c=l.length-1;c>=0;c--){let f=l[c],h=a.offsetAt(f.range.start),p=a.offsetAt(f.range.end);if(p<=u)o=o.substring(0,h)+f.newText+o.substring(p,o.length);else throw new Error("Overlapping edit");u=h}return o}t.applyEdits=n;function i(a,s){if(a.length<=1)return a;const o=a.length/2|0,l=a.slice(0,o),u=a.slice(o);i(l,s),i(u,s);let c=0,f=0,h=0;for(;c<l.length&&f<u.length;)s(l[c],u[f])<=0?a[h++]=l[c++]:a[h++]=u[f++];for(;c<l.length;)a[h++]=l[c++];for(;f<u.length;)a[h++]=u[f++];return a}})(Hc||(Hc={}));let ik=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let a=r.charAt(i);n=a==="\r"||a===`
119
+ `,a==="\r"&&i+1<r.length&&r.charAt(i+1)===`
120
+ `&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return re.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let a=n-1;return re.create(a,e-r[a])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}};var $;(function(t){const e=Object.prototype.toString;function r(p){return typeof p<"u"}t.defined=r;function n(p){return typeof p>"u"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function a(p){return e.call(p)==="[object String]"}t.string=a;function s(p){return e.call(p)==="[object Number]"}t.number=s;function o(p,y,A){return e.call(p)==="[object Number]"&&y<=p&&p<=A}t.numberRange=o;function l(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=l;function u(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=u;function c(p){return e.call(p)==="[object Function]"}t.func=c;function f(p){return p!==null&&typeof p=="object"}t.objectLiteral=f;function h(p,y){return Array.isArray(p)&&p.every(y)}t.typedArray=h})($||($={}));const ak=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return mr},get ChangeAnnotation(){return $n},get ChangeAnnotationIdentifier(){return Ve},get CodeAction(){return bc},get CodeActionContext(){return wc},get CodeActionKind(){return _c},get CodeActionTriggerKind(){return Qa},get CodeDescription(){return ic},get CodeLens(){return Nc},get Color(){return Ko},get ColorInformation(){return Zu},get ColorPresentation(){return Qu},get Command(){return Nn},get CompletionItem(){return hc},get CompletionItemKind(){return lc},get CompletionItemLabelDetails(){return pc},get CompletionItemTag(){return cc},get CompletionList(){return mc},get CreateFile(){return Oi},get DeleteFile(){return xi},get Diagnostic(){return Ya},get DiagnosticRelatedInformation(){return Vo},get DiagnosticSeverity(){return rc},get DiagnosticTag(){return nc},get DocumentHighlight(){return vc},get DocumentHighlightKind(){return Rc},get DocumentLink(){return Pc},get DocumentSymbol(){return Sc},get DocumentUri(){return Yu},EOL:nk,get FoldingRange(){return tc},get FoldingRangeKind(){return ec},get FormattingOptions(){return Ic},get Hover(){return gc},get InlayHint(){return zc},get InlayHintKind(){return Xo},get InlayHintLabelPart(){return Jo},get InlineCompletionContext(){return Kc},get InlineCompletionItem(){return jc},get InlineCompletionList(){return qc},get InlineCompletionTriggerKind(){return Bc},get InlineValueContext(){return Gc},get InlineValueEvaluatableExpression(){return Fc},get InlineValueText(){return Dc},get InlineValueVariableLookup(){return Mc},get InsertReplaceEdit(){return fc},get InsertTextFormat(){return uc},get InsertTextMode(){return dc},get Location(){return Ha},get LocationLink(){return Ju},get MarkedString(){return Za},get MarkupContent(){return Di},get MarkupKind(){return Yo},get OptionalVersionedTextDocumentIdentifier(){return Ja},get ParameterInformation(){return yc},get Position(){return re},get Range(){return X},get RenameFile(){return Li},get SelectedCompletionInfo(){return Wc},get SelectionRange(){return kc},get SemanticTokenModifiers(){return Lc},get SemanticTokenTypes(){return Oc},get SemanticTokens(){return xc},get SignatureInformation(){return Tc},get StringValue(){return Uc},get SymbolInformation(){return Ec},get SymbolKind(){return $c},get SymbolTag(){return Ac},get TextDocument(){return Hc},get TextDocumentEdit(){return Xa},get TextDocumentIdentifier(){return ac},get TextDocumentItem(){return oc},get TextEdit(){return Bt},get URI(){return Wo},get VersionedTextDocumentIdentifier(){return sc},WorkspaceChange:rk,get WorkspaceEdit(){return Ho},get WorkspaceFolder(){return Vc},get WorkspaceSymbol(){return Cc},get integer(){return Xu},get uinteger(){return Va}},Symbol.toStringTag,{value:"Module"}));class sk{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Ry(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new td;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Yc(e.startOffset,e.image.length,wu(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new Yc(a.startOffset,a.image.length,wu(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}}class Ty{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.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)}}class Yc extends Ty{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,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}}class td extends Ty{constructor(){super(...arguments),this.content=new rd(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:re.create(0,0),end:re.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}}class rd extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,rd.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(const r of e)r.container=this.parent}}class Ry extends td{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const Xc=Symbol("Datatype");function Ql(t){return t.$type===Xc}const Jp="​",vy=t=>t.endsWith(Jp)?t:t+Jp;class $y{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new fk(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Ey(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()}}class ok extends $y{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new sk,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){const n=this.computeRuleType(e);let i;_o(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(vy(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Cr(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i<e.operators.precedences.length;i++){const a=e.operators.precedences[i];for(const s of a.operators)n.set(s.value,{precedence:i,rightAssoc:a.associativity==="right"})}this.operatorPrecedence.set(r,n)}computeRuleType(e){return _o(e)?za(e):e.fragment?void 0:Nm(e)?Xc:za(e)}parse(e,r={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");const a=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,Ru(a,{deep:!0}),{value:a,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let r=this.wrapper.rule(e);if(this.stack.length>0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===Xc?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const c=En(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,c,s,l)}else if(Ql(u)){let c=i.image;En(n)||(c=this.converter.convert(c,s).toString()),u.value+=c}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(Ql(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}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);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Ql(e)?this.converter.convert(e.value,e.$cstNode):(CT(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let A=0;A<i.length;A++){const N=i[A],C=r.get(N)??{precedence:1/0,rightAssoc:!1};C.precedence>s?(s=C.precedence,a=A):C.precedence===s&&(C.rightAssoc||(a=A))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),c=n.slice(a+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:l},p=this.constructInfix(f,r),y=this.constructInfix(h,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:y}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=Qo(e,An);this.assignmentMap.set(e,{assignment:r,crossRef:r&&tl(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class lk{buildMismatchTokenMessage(e){return si.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return si.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return si.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return si.buildEarlyExitMessage(e)}}class Ay extends lk{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}\`.`}}class uk extends $y{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const 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){const n=this.wrapper.DEFINE_RULE(vy(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=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}}const ck={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Ay};class Ey extends mP{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...ck,lookaheadStrategy:n?new Yf({maxLookahead:r.maxLookahead}):new DP({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,{})}}class fk extends Ey{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 Cy(t,e,r){return dk({parser:e,tokens:r,ruleNames:new Map},t),e}function dk(t,e){const r=Cm(e,!1),n=ve(e.rules).filter(Cr).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,In(s,a.definition))}const i=ve(e.rules).filter(_o).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,pk(t,a))}function pk(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Sr(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const f=n.map(p=>t.tokens[p.value]).map((p,y)=>({ALT:()=>t.parser.consume(y,p,l)}));let h;return p=>{h??(h=nd(t,r)),t.parser.subrule(0,h,!1,a,p),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,f),t.parser.subrule(1,h,!1,u,p)}})}}function In(t,e,r=!1){let n;if(En(e))n=vk(t,e);else if(el(e))n=hk(t,e);else if(An(e))n=In(t,e.terminal);else if(tl(e))n=Sy(t,e);else if(Cn(e))n=mk(t,e);else if(ym(e))n=yk(t,e);else if(Rm(e))n=Tk(t,e);else if(gf(e))n=Rk(t,e);else if(IT(e)){const i=t.consume++;n=()=>t.parser.consume(i,Kr,e)}else throw new $m(e.$cstNode,`Unexpected element type: ${e.$type}`);return _y(t,r?void 0:Zo(e),n,e.cardinality)}function hk(t,e){const r=za(e);return()=>t.parser.action(r,e)}function mk(t,e){const r=e.rule.ref;if(is(r)){const n=t.subrule++,i=Cr(r)&&r.fragment,a=e.arguments.length>0?gk(r,e.arguments):()=>({});let s;return o=>{s??(s=nd(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Sr(r)){const n=t.consume++,i=Jc(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)as();else throw new $m(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function gk(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Ut(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Ut(i.value));return i=>{const a={};for(let s=0;s<n.length;s++)if(s<t.parameters.length){const o=t.parameters[s].name,l=n[s];a[o]=l(i)}return a}}}function Ut(t){if(NT(t)){const e=Ut(t.left),r=Ut(t.right);return n=>e(n)||r(n)}else if(bT(t)){const e=Ut(t.left),r=Ut(t.right);return n=>e(n)&&r(n)}else if(OT(t)){const e=Ut(t.value);return r=>!e(r)}else if(LT(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(_T(t)){const e=!!t.true;return()=>e}as()}function yk(t,e){if(e.elements.length===1)return In(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:In(t,i,!0)},s=Zo(i);s&&(a.GATE=Ut(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:()=>a.ALT(i)},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}function Tk(t,e){if(e.elements.length===1)return In(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:In(t,o,!0)},u=Zo(o);u&&(l.GATE=Ut(u)),r.push(l)}const n=t.or++,i=(o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},a=o=>t.parser.alternatives(n,r.map((l,u)=>{const c={ALT:()=>!0},f=t.parser;c.ALT=()=>{if(l.ALT(o),!f.isRecording()){const p=i(n,f);f.unorderedGroups.get(p)||f.unorderedGroups.set(p,[]);const y=f.unorderedGroups.get(p);typeof(y==null?void 0:y[u])>"u"&&(y[u]=!0)}};const h=l.GATE;return h?c.GATE=()=>h(o):c.GATE=()=>{const p=f.unorderedGroups.get(i(n,f));return!(p!=null&&p[u])},c})),s=_y(t,Zo(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function Rk(t,e){const r=e.elements.map(n=>In(t,n));return n=>r.forEach(i=>i(n))}function Zo(t){if(gf(t))return t.guardCondition}function Sy(t,e,r=e.terminal){if(r)if(Cn(r)&&Cr(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=nd(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Cn(r)&&Sr(r.rule.ref)){const n=t.consume++,i=Jc(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(En(r)){const n=t.consume++,i=Jc(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);const n=wm(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+za(e.type.ref));return Sy(t,e,i)}}function vk(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function _y(t,e,r,n){const i=e&&Ut(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:Kp(),GATE:()=>!i(s)}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(a,{DEF:()=>r(o)}),GATE:()=>i(o)},{ALT:Kp(),GATE:()=>!i(o)}])}else return s=>t.parser.atLeastOne(a,{DEF:()=>r(s)})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else as()}function nd(t,e){const r=$k(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function $k(t,e){if(is(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Cr(n);)(gf(n)||ym(n)||Rm(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function Jc(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function Ak(t){const e=t.Grammar,r=t.parser.Lexer,n=new uk(t);return Cy(e,n,r.definition),n.finalize(),n}function Ek(t){const e=Ck(t);return e.finalize(),e}function Ck(t){const e=t.Grammar,r=t.parser.Lexer,n=new ok(t);return Cy(e,n,r.definition)}class wy{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=ve(Cm(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Sr).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Tf(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=Em(r)?nt.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(is).flatMap(i=>ns(i).filter(En)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(nl(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&iR("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class by{convert(e,r){let n=r.grammarSource;if(tl(n)&&(n=lR(n)),Cn(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return pr.convertInt(r);case"STRING":return pr.convertString(r);case"ID":return pr.convertID(r)}switch((i=mR(e))==null?void 0:i.toLowerCase()){case"number":return pr.convertNumber(r);case"boolean":return pr.convertBoolean(r);case"bigint":return pr.convertBigint(r);case"date":return pr.convertDate(r);default:return r}}}var pr;(function(t){function e(u){let c="";for(let f=1;f<u.length-1;f++){const h=u.charAt(f);if(h==="\\"){const p=u.charAt(++f);c+=r(p)}else c+=h}return c}t.convertString=e;function r(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
121
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function n(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=n;function i(u){return parseInt(u)}t.convertInt=i;function a(u){return BigInt(u)}t.convertBigint=a;function s(u){return new Date(u)}t.convertDate=s;function o(u){return Number(u)}t.convertNumber=o;function l(u){return u.toLowerCase()==="true"}t.convertBoolean=l})(pr||(pr={}));var en={},Hs={},Zp;function Fn(){if(Zp)return Hs;Zp=1,Object.defineProperty(Hs,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return(function(r){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}r.install=n})(e||(e={})),Hs.default=e,Hs}var je={},Qp;function Rs(){if(Qp)return je;Qp=1,Object.defineProperty(je,"__esModule",{value:!0}),je.stringArray=je.array=je.func=je.error=je.number=je.string=je.boolean=void 0;function t(o){return o===!0||o===!1}je.boolean=t;function e(o){return typeof o=="string"||o instanceof String}je.string=e;function r(o){return typeof o=="number"||o instanceof Number}je.number=r;function n(o){return o instanceof Error}je.error=n;function i(o){return typeof o=="function"}je.func=i;function a(o){return Array.isArray(o)}je.array=a;function s(o){return a(o)&&o.every(l=>e(l))}return je.stringArray=s,je}var tn={},eh;function Ui(){if(eh)return tn;eh=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.Emitter=tn.Event=void 0;const t=Fn();var e;(function(i){const a={dispose(){}};i.None=function(){return a}})(e||(tn.Event=e={}));class r{add(a,s=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(a),this._contexts.push(s),Array.isArray(o)&&o.push({dispose:()=>this.remove(a,s)})}remove(a,s=null){if(!this._callbacks)return;let o=!1;for(let l=0,u=this._callbacks.length;l<u;l++)if(this._callbacks[l]===a)if(this._contexts[l]===s){this._callbacks.splice(l,1),this._contexts.splice(l,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...a){if(!this._callbacks)return[];const s=[],o=this._callbacks.slice(0),l=this._contexts.slice(0);for(let u=0,c=o.length;u<c;u++)try{s.push(o[u].apply(l[u],a))}catch(f){(0,t.default)().console.error(f)}return s}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class n{constructor(a){this._options=a}get event(){return this._event||(this._event=(a,s,o)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(a,s);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(a,s),l.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(l),l}),this._event}fire(a){this._callbacks&&this._callbacks.invoke.call(this._callbacks,a)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return tn.Emitter=n,n._noop=function(){},tn}var th;function Ol(){if(th)return en;th=1,Object.defineProperty(en,"__esModule",{value:!0}),en.CancellationTokenSource=en.CancellationToken=void 0;const t=Fn(),e=Rs(),r=Ui();var n;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function l(u){const c=u;return c&&(c===o.None||c===o.Cancelled||e.boolean(c.isCancellationRequested)&&!!c.onCancellationRequested)}o.is=l})(n||(en.CancellationToken=n={}));const i=Object.freeze(function(o,l){const u=(0,t.default)().timer.setTimeout(o.bind(l),0);return{dispose(){u.dispose()}}});class a{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?i:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class s{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=n.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=n.None}}return en.CancellationTokenSource=s,en}var Ae=Ol();function Sk(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let $o=0,_k=10;function wk(){return $o=performance.now(),new Ae.CancellationTokenSource}const oi=Symbol("OperationCancelled");function Ll(t){return t===oi}async function et(t){if(t===Ae.CancellationToken.None)return;const e=performance.now();if(e-$o>=_k&&($o=e,await Sk(),$o=performance.now()),t.isCancellationRequested)throw oi}class id{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class es{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){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(es.isIncremental(n)){const i=Iy(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const c=rh(n.text,!1,a);if(l-o===c.length)for(let h=0,p=c.length;h<p;h++)u[h+o+1]=c[h];else c.length<1e4?u.splice(o+1,l-o,...c):this._lineOffsets=u=u.slice(0,o+1).concat(c,u.slice(l+1));const f=n.text.length-(s-a);if(f!==0)for(let h=o+1+c.length,p=u.length;h<p;h++)u[h]=u[h]+f}else if(es.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=rh(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&Ny(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}}var Zc;(function(t){function e(i,a,s,o){return new es(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof es)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,a){const s=i.getText(),o=Qc(a.map(bk),(c,f)=>{const h=c.range.start.line-f.range.start.line;return h===0?c.range.start.character-f.range.start.character:h});let l=0;const u=[];for(const c of o){const f=i.offsetAt(c.range.start);if(f<l)throw new Error("Overlapping edit");f>l&&u.push(s.substring(l,f)),c.newText.length&&u.push(c.newText),l=i.offsetAt(c.range.end)}return u.push(s.substr(l)),u.join("")}t.applyEdits=n})(Zc||(Zc={}));function Qc(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Qc(n,e),Qc(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function rh(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);Ny(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function Ny(t){return t===13||t===10}function Iy(t){const e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function bk(t){const e=Iy(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Py;(()=>{var t={975:I=>{function v(T){if(typeof T!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(T))}function g(T,R){for(var E,L="",D=0,x=-1,U=0,F=0;F<=T.length;++F){if(F<T.length)E=T.charCodeAt(F);else{if(E===47)break;E=47}if(E===47){if(!(x===F-1||U===1))if(x!==F-1&&U===2){if(L.length<2||D!==2||L.charCodeAt(L.length-1)!==46||L.charCodeAt(L.length-2)!==46){if(L.length>2){var ae=L.lastIndexOf("/");if(ae!==L.length-1){ae===-1?(L="",D=0):D=(L=L.slice(0,ae)).length-1-L.lastIndexOf("/"),x=F,U=0;continue}}else if(L.length===2||L.length===1){L="",D=0,x=F,U=0;continue}}R&&(L.length>0?L+="/..":L="..",D=2)}else L.length>0?L+="/"+T.slice(x+1,F):L=T.slice(x+1,F),D=F-x-1;x=F,U=0}else E===46&&U!==-1?++U:U=-1}return L}var w={resolve:function(){for(var T,R="",E=!1,L=arguments.length-1;L>=-1&&!E;L--){var D;L>=0?D=arguments[L]:(T===void 0&&(T=process.cwd()),D=T),v(D),D.length!==0&&(R=D+"/"+R,E=D.charCodeAt(0)===47)}return R=g(R,!E),E?R.length>0?"/"+R:"/":R.length>0?R:"."},normalize:function(T){if(v(T),T.length===0)return".";var R=T.charCodeAt(0)===47,E=T.charCodeAt(T.length-1)===47;return(T=g(T,!R)).length!==0||R||(T="."),T.length>0&&E&&(T+="/"),R?"/"+T:T},isAbsolute:function(T){return v(T),T.length>0&&T.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var T,R=0;R<arguments.length;++R){var E=arguments[R];v(E),E.length>0&&(T===void 0?T=E:T+="/"+E)}return T===void 0?".":w.normalize(T)},relative:function(T,R){if(v(T),v(R),T===R||(T=w.resolve(T))===(R=w.resolve(R)))return"";for(var E=1;E<T.length&&T.charCodeAt(E)===47;++E);for(var L=T.length,D=L-E,x=1;x<R.length&&R.charCodeAt(x)===47;++x);for(var U=R.length-x,F=D<U?D:U,ae=-1,q=0;q<=F;++q){if(q===F){if(U>F){if(R.charCodeAt(x+q)===47)return R.slice(x+q+1);if(q===0)return R.slice(x+q)}else D>F&&(T.charCodeAt(E+q)===47?ae=q:q===0&&(ae=0));break}var ne=T.charCodeAt(E+q);if(ne!==R.charCodeAt(x+q))break;ne===47&&(ae=q)}var ze="";for(q=E+ae+1;q<=L;++q)q!==L&&T.charCodeAt(q)!==47||(ze.length===0?ze+="..":ze+="/..");return ze.length>0?ze+R.slice(x+ae):(x+=ae,R.charCodeAt(x)===47&&++x,R.slice(x))},_makeLong:function(T){return T},dirname:function(T){if(v(T),T.length===0)return".";for(var R=T.charCodeAt(0),E=R===47,L=-1,D=!0,x=T.length-1;x>=1;--x)if((R=T.charCodeAt(x))===47){if(!D){L=x;break}}else D=!1;return L===-1?E?"/":".":E&&L===1?"//":T.slice(0,L)},basename:function(T,R){if(R!==void 0&&typeof R!="string")throw new TypeError('"ext" argument must be a string');v(T);var E,L=0,D=-1,x=!0;if(R!==void 0&&R.length>0&&R.length<=T.length){if(R.length===T.length&&R===T)return"";var U=R.length-1,F=-1;for(E=T.length-1;E>=0;--E){var ae=T.charCodeAt(E);if(ae===47){if(!x){L=E+1;break}}else F===-1&&(x=!1,F=E+1),U>=0&&(ae===R.charCodeAt(U)?--U==-1&&(D=E):(U=-1,D=F))}return L===D?D=F:D===-1&&(D=T.length),T.slice(L,D)}for(E=T.length-1;E>=0;--E)if(T.charCodeAt(E)===47){if(!x){L=E+1;break}}else D===-1&&(x=!1,D=E+1);return D===-1?"":T.slice(L,D)},extname:function(T){v(T);for(var R=-1,E=0,L=-1,D=!0,x=0,U=T.length-1;U>=0;--U){var F=T.charCodeAt(U);if(F!==47)L===-1&&(D=!1,L=U+1),F===46?R===-1?R=U:x!==1&&(x=1):R!==-1&&(x=-1);else if(!D){E=U+1;break}}return R===-1||L===-1||x===0||x===1&&R===L-1&&R===E+1?"":T.slice(R,L)},format:function(T){if(T===null||typeof T!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof T);return(function(R,E){var L=E.dir||E.root,D=E.base||(E.name||"")+(E.ext||"");return L?L===E.root?L+D:L+"/"+D:D})(0,T)},parse:function(T){v(T);var R={root:"",dir:"",base:"",ext:"",name:""};if(T.length===0)return R;var E,L=T.charCodeAt(0),D=L===47;D?(R.root="/",E=1):E=0;for(var x=-1,U=0,F=-1,ae=!0,q=T.length-1,ne=0;q>=E;--q)if((L=T.charCodeAt(q))!==47)F===-1&&(ae=!1,F=q+1),L===46?x===-1?x=q:ne!==1&&(ne=1):x!==-1&&(ne=-1);else if(!ae){U=q+1;break}return x===-1||F===-1||ne===0||ne===1&&x===F-1&&x===U+1?F!==-1&&(R.base=R.name=U===0&&D?T.slice(1,F):T.slice(U,F)):(U===0&&D?(R.name=T.slice(1,x),R.base=T.slice(1,F)):(R.name=T.slice(U,x),R.base=T.slice(U,F)),R.ext=T.slice(x,F)),U>0?R.dir=T.slice(0,U-1):D&&(R.dir="/"),R},sep:"/",delimiter:":",win32:null,posix:null};w.posix=w,I.exports=w}},e={};function r(I){var v=e[I];if(v!==void 0)return v.exports;var g=e[I]={exports:{}};return t[I](g,g.exports,r),g.exports}r.d=(I,v)=>{for(var g in v)r.o(v,g)&&!r.o(I,g)&&Object.defineProperty(I,g,{enumerable:!0,get:v[g]})},r.o=(I,v)=>Object.prototype.hasOwnProperty.call(I,v),r.r=I=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>h,Utils:()=>ge}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(I,v){if(!I.scheme&&v)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${I.authority}", path: "${I.path}", query: "${I.query}", fragment: "${I.fragment}"}`);if(I.scheme&&!a.test(I.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(I.path){if(I.authority){if(!s.test(I.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(I.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",c="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{constructor(v,g,w,T,R,E=!1){Mr(this,"scheme");Mr(this,"authority");Mr(this,"path");Mr(this,"query");Mr(this,"fragment");typeof v=="object"?(this.scheme=v.scheme||u,this.authority=v.authority||u,this.path=v.path||u,this.query=v.query||u,this.fragment=v.fragment||u):(this.scheme=(function(L,D){return L||D?L:"file"})(v,E),this.authority=g||u,this.path=(function(L,D){switch(L){case"https":case"http":case"file":D?D[0]!==c&&(D=c+D):D=c}return D})(this.scheme,w||u),this.query=T||u,this.fragment=R||u,l(this,E))}static isUri(v){return v instanceof h||!!v&&typeof v.authority=="string"&&typeof v.fragment=="string"&&typeof v.path=="string"&&typeof v.query=="string"&&typeof v.scheme=="string"&&typeof v.fsPath=="string"&&typeof v.with=="function"&&typeof v.toString=="function"}get fsPath(){return S(this)}with(v){if(!v)return this;let{scheme:g,authority:w,path:T,query:R,fragment:E}=v;return g===void 0?g=this.scheme:g===null&&(g=u),w===void 0?w=this.authority:w===null&&(w=u),T===void 0?T=this.path:T===null&&(T=u),R===void 0?R=this.query:R===null&&(R=u),E===void 0?E=this.fragment:E===null&&(E=u),g===this.scheme&&w===this.authority&&T===this.path&&R===this.query&&E===this.fragment?this:new y(g,w,T,R,E)}static parse(v,g=!1){const w=f.exec(v);return w?new y(w[2]||u,H(w[4]||u),H(w[5]||u),H(w[7]||u),H(w[9]||u),g):new y(u,u,u,u,u)}static file(v){let g=u;if(i&&(v=v.replace(/\\/g,c)),v[0]===c&&v[1]===c){const w=v.indexOf(c,2);w===-1?(g=v.substring(2),v=c):(g=v.substring(2,w),v=v.substring(w)||c)}return new y("file",g,v,u,u)}static from(v){const g=new y(v.scheme,v.authority,v.path,v.query,v.fragment);return l(g,!0),g}toString(v=!1){return _(this,v)}toJSON(){return this}static revive(v){if(v){if(v instanceof h)return v;{const g=new y(v);return g._formatted=v.external,g._fsPath=v._sep===p?v.fsPath:null,g}}return v}}const p=i?1:void 0;class y extends h{constructor(){super(...arguments);Mr(this,"_formatted",null);Mr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=S(this)),this._fsPath}toString(g=!1){return g?_(this,!0):(this._formatted||(this._formatted=_(this,!1)),this._formatted)}toJSON(){const g={$mid:1};return this._fsPath&&(g.fsPath=this._fsPath,g._sep=p),this._formatted&&(g.external=this._formatted),this.path&&(g.path=this.path),this.scheme&&(g.scheme=this.scheme),this.authority&&(g.authority=this.authority),this.query&&(g.query=this.query),this.fragment&&(g.fragment=this.fragment),g}}const A={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 N(I,v,g){let w,T=-1;for(let R=0;R<I.length;R++){const E=I.charCodeAt(R);if(E>=97&&E<=122||E>=65&&E<=90||E>=48&&E<=57||E===45||E===46||E===95||E===126||v&&E===47||g&&E===91||g&&E===93||g&&E===58)T!==-1&&(w+=encodeURIComponent(I.substring(T,R)),T=-1),w!==void 0&&(w+=I.charAt(R));else{w===void 0&&(w=I.substr(0,R));const L=A[E];L!==void 0?(T!==-1&&(w+=encodeURIComponent(I.substring(T,R)),T=-1),w+=L):T===-1&&(T=R)}}return T!==-1&&(w+=encodeURIComponent(I.substring(T))),w!==void 0?w:I}function C(I){let v;for(let g=0;g<I.length;g++){const w=I.charCodeAt(g);w===35||w===63?(v===void 0&&(v=I.substr(0,g)),v+=A[w]):v!==void 0&&(v+=I[g])}return v!==void 0?v:I}function S(I,v){let g;return g=I.authority&&I.path.length>1&&I.scheme==="file"?`//${I.authority}${I.path}`:I.path.charCodeAt(0)===47&&(I.path.charCodeAt(1)>=65&&I.path.charCodeAt(1)<=90||I.path.charCodeAt(1)>=97&&I.path.charCodeAt(1)<=122)&&I.path.charCodeAt(2)===58?I.path[1].toLowerCase()+I.path.substr(2):I.path,i&&(g=g.replace(/\//g,"\\")),g}function _(I,v){const g=v?C:N;let w="",{scheme:T,authority:R,path:E,query:L,fragment:D}=I;if(T&&(w+=T,w+=":"),(R||T==="file")&&(w+=c,w+=c),R){let x=R.indexOf("@");if(x!==-1){const U=R.substr(0,x);R=R.substr(x+1),x=U.lastIndexOf(":"),x===-1?w+=g(U,!1,!1):(w+=g(U.substr(0,x),!1,!1),w+=":",w+=g(U.substr(x+1),!1,!0)),w+="@"}R=R.toLowerCase(),x=R.lastIndexOf(":"),x===-1?w+=g(R,!1,!0):(w+=g(R.substr(0,x),!1,!0),w+=R.substr(x))}if(E){if(E.length>=3&&E.charCodeAt(0)===47&&E.charCodeAt(2)===58){const x=E.charCodeAt(1);x>=65&&x<=90&&(E=`/${String.fromCharCode(x+32)}:${E.substr(3)}`)}else if(E.length>=2&&E.charCodeAt(1)===58){const x=E.charCodeAt(0);x>=65&&x<=90&&(E=`${String.fromCharCode(x+32)}:${E.substr(2)}`)}w+=g(E,!0,!1)}return L&&(w+="?",w+=g(L,!1,!1)),D&&(w+="#",w+=v?D:N(D,!1,!1)),w}function k(I){try{return decodeURIComponent(I)}catch{return I.length>3?I.substr(0,3)+k(I.substr(3)):I}}const K=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function H(I){return I.match(K)?I.replace(K,(v=>k(v))):I}var J=r(975);const oe=J.posix||J,me="/";var ge;(function(I){I.joinPath=function(v,...g){return v.with({path:oe.join(v.path,...g)})},I.resolvePath=function(v,...g){let w=v.path,T=!1;w[0]!==me&&(w=me+w,T=!0);let R=oe.resolve(w,...g);return T&&R[0]===me&&!v.authority&&(R=R.substring(1)),v.with({path:R})},I.dirname=function(v){if(v.path.length===0||v.path===me)return v;let g=oe.dirname(v.path);return g.length===1&&g.charCodeAt(0)===46&&(g=""),v.with({path:g})},I.basename=function(v){return oe.basename(v.path)},I.extname=function(v){return oe.extname(v.path)}})(ge||(ge={})),Py=n})();const{URI:Ot,Utils:ua}=Py;var pt;(function(t){t.basename=ua.basename,t.dirname=ua.dirname,t.extname=ua.extname,t.joinPath=ua.joinPath,t.resolvePath=ua.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}t.equals=r;function n(s,o){const l=typeof s=="string"?Ot.parse(s).path:s.path,u=typeof o=="string"?Ot.parse(o).path:o.path,c=l.split("/").filter(A=>A.length>0),f=u.split("/").filter(A=>A.length>0);if(e){const A=/^[A-Z]:$/;if(c[0]&&A.test(c[0])&&(c[0]=c[0].toLowerCase()),f[0]&&A.test(f[0])&&(f[0]=f[0].toLowerCase()),c[0]!==f[0])return u.substring(1)}let h=0;for(;h<c.length&&c[h]===f[h];h++);const p="../".repeat(c.length-h),y=f.slice(h).join("/");return p+y}t.relative=n;function i(s){return Ot.parse(s.toString()).toString()}t.normalize=i;function a(s,o){let l=typeof s=="string"?s:s.path,u=typeof o=="string"?o:o.path;return u.charAt(u.length-1)==="/"&&(u=u.slice(0,-1)),l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),u===l?!0:u.length<l.length||u.charAt(l.length)!=="/"?!1:u.startsWith(l)}t.contains=a})(pt||(pt={}));class Nk{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return pt.normalize(e)}clear(){this.root.children.clear()}insert(e,r){const n=this.getNode(this.normalizeUri(e),!0);n.element=r}delete(e){const r=this.getNode(this.normalizeUri(e),!1);r!=null&&r.parent&&r.parent.children.delete(r.name)}has(e){var r;return((r=this.getNode(this.normalizeUri(e),!1))==null?void 0:r.element)!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){var r;return(r=this.getNode(this.normalizeUri(e),!1))==null?void 0:r.element}findNode(e){const r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:pt.joinPath(Ot.parse(r),n.name).toString(),element:n.element}}findChildren(e){const r=this.normalizeUri(e),n=this.getNode(r,!1);return n?Array.from(n.children.values()).map(i=>({name:i.name,uri:pt.joinPath(Ot.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(pt.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}}var Y;(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"})(Y||(Y={}));class Ik{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Ae.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Ot.parse(e.uri),Ae.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Ae.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"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:Y.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Y.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=Y.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){const n=this.serviceRegistry;let i;return()=>i??(i=Zc.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class Pk{constructor(e){this.documentTrie=new Nk,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ve(this.documentTrie.all())}addDocument(e){const 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){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const 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));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Y.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Y.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Y.Changed;return this.documentTrie.delete(r),n}}const qn=Symbol("RefResolving");class kk{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=Ae.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Tr(e.parseResult.value))await et(r),So(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Tr(e.parseResult.value))await et(r),So(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=qn;try{const i=this.getCandidate(e);if(ta(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=qn;try{const i=this.getCandidates(e),a=[];if(ta(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}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(const 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){const 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){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Xe(this._ref))return this._ref;if(AT(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=qn;const o=oo(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state<Y.ComputedScopes)return this._ref=void 0;this._ref=l.node??l.error,this._nodeDescription=l.descr,o==null||o.references.push(this)}else this._ref===qn&&a.throwCyclicReferenceError(e,r,i);return Xe(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return ta(this._ref)?this._ref:void 0}};return s}buildMultiReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=qn;const o=oo(e).$document,l=a.getCandidates({reference:s,container:e,property:r}),u=[];if(ta(l))this._linkingError=l;else for(const c of l){const f=a.loadAstNode(c);f&&u.push({ref:f,$nodeDescription:c})}this._items=u,o==null||o.references.push(this)}else this._items===qn&&a.throwCyclicReferenceError(e,r,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(ta(r))return{error:r};const 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);const 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;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=oo(e.container).$document;n&&n.state<Y.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}}function Ok(t){return typeof t.name=="string"}class Lk{getName(e){if(Ok(e))return e.name}getNameNode(e){return _m(e.$cstNode,"name")}}class xk{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=Tr(e.Grammar).some(r=>tl(r)&&r.isMulti)}findDeclarations(e){if(e){const r=pR(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Pt(i)||zr(i))return ud(i);if(Array.isArray(i)){for(const a of i)if((Pt(a)||zr(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return ud(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||BT(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of So(n))if(zr(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>pt.equals(a.sourceUri,r.documentUri))),n.push(...i),ve(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=yr(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:wo(a),local:!0})}}return n}}class ts{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Tu.sum(ve(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const 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){const r=this.map.get(e);return r?ve(r):mm}has(e,r){if(r===void 0)return this.map.has(e);{const 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 ve(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ve(this.map.keys())}values(){return ve(this.map.values()).flat()}entriesGroupedByKey(){return ve(this.map.entries())}}class nh{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[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){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}class Dk{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Ae.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=mf,i=Ae.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await et(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=Ae.CancellationToken.None){const n=e.parseResult.value,i=new ts;for(const a of ns(n))await et(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}class ih{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const 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){const 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}}class Mk{constructor(e,r,n){this.elements=new ts,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const 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){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?ve(n).concat(this.outerScope.getElements(e)):ve(n)}getAllElements(){let e=ve(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class ky{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Fk extends ky{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){const 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()}}class Gk extends ky{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();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}}class zk extends Fk{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()}))}}class Uk{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 zk(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=yr(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new ih(ve(e),r,n)}createScopeForNodes(e,r,n){const i=ve(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new ih(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Mk(this.indexManager.allElements(e)))}}function jk(t){return typeof t.$comment=="string"}function ah(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class qk{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){const n=r??{},i=r==null?void 0:r.replacer,a=(o,l)=>this.replacer(o,l,n),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=yr(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,c;if(!this.ignoreProperties.has(e))if(Pt(r)){const f=r.ref,h=n?r.$refText:void 0;if(f){const p=yr(f);let y="";this.currentDocument&&this.currentDocument!==p&&(o?y=o(p.uri,f):y=p.uri.toString());const A=this.astNodeLocator.getAstNodePath(f);return{$ref:`${y}#${A}`,$refText:h}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:h}}else if(zr(r)){const f=n?r.$refText:void 0,h=[];for(const p of r.items){const y=p.ref,A=yr(p.ref);let N="";this.currentDocument&&this.currentDocument!==A&&(o?N=o(A.uri,y):N=A.uri.toString());const C=this.astNodeLocator.getAstNodePath(y);h.push(`${N}#${C}`)}return{$refs:h,$refText:f}}else if(Xe(r)){let f;if(a&&(f=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(f!=null&&f.$textRegion)&&(f.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(f??(f={...r}),f.$sourceText=(c=r.$cstNode)==null?void 0:c.text),s){f??(f={...r});const h=this.commentProvider.getComment(r);h&&(f.$comment=h.replace(/\r/g,""))}return f??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=cR(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let c=0;c<u.length;c++){const f=u[c];ah(f)?u[c]=this.reviveReference(e,l,r,f,n):Xe(f)&&this.linkNode(f,r,n,e,l,c)}else ah(u)?e[l]=this.reviveReference(e,l,r,u,n):Xe(u)&&this.linkNode(u,r,n,e,l);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error,l;if(i.$ref){const u=this.getRefNode(n,i.$ref,a.uriConverter);if(Xe(u))return s||(s=this.nameProvider.getName(u)),{$refText:s??"",ref:u};o=u}else if(i.$refs){const u=[];for(const c of i.$refs){const f=this.getRefNode(n,c,a.uriConverter);Xe(f)&&u.push({ref:f})}if(u.length===0)l={$refText:s??"",items:u},o??(o="Could not resolve multi-reference");else return{$refText:s??"",items:u}}if(o)return l??(l={$refText:s??"",ref:void 0}),l.error={info:{container:e,property:r,reference:l},message:o},l}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,r.substring(1));return l||"Could not resolve path: "+r}if(i<0){const l=n?n(r):Ot.parse(r),u=this.langiumDocuments.getDocument(l);return u?u.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):Ot.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;const o=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return o||"Could not resolve URI: "+r}catch(i){return String(i)}}}class Bk{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const r=e.LanguageMetaData;for(const n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);if(r.fileNames)for(const n of r.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(r.languageId,e)}getServices(e){var s,o;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const r=(o=(s=this.textDocuments)==null?void 0:s.get(e))==null?void 0:o.languageId;if(r!==void 0){const l=this.languageIdMap.get(r);if(l)return l}const n=pt.extname(e),i=pt.basename(e),a=this.fileNameMap.get(i)??this.fileExtensionMap.get(n);if(!a)throw r?new Error(`The service registry contains no services for the extension '${n}' for language '${r}'.`):new Error(`The service registry contains no services for the extension '${n}'.`);return a}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function La(t){return{code:t}}var ef;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(ef||(ef={}));class Wk{constructor(e){this.entries=new ts,this.knownCategories=new Set(ef.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(n);for(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const l={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,l)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else as()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Ll(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=ve(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,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}}const Kk=Object.freeze({validateNode:!0,validateChildren:!0});class Vk{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=Ae.CancellationToken.None){const i=e.parseResult,a=[];if(await et(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===It.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===It.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===It.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Ll(s))throw s;console.error("An error occurred during validation:",s)}return await et(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:eu(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:Yk(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=wu(i.token);if(a){const s={severity:eu("error"),range:a,message:i.message,data:La(It.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:It.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=Ae.CancellationToken.None){const i=[],a=(s,o,l)=>{i.push(this.toDiagnostic(s,o,l))};return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=Ae.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await et(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Ae.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Tr(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const c=this.validationRegistry.getChecks(l.$type,r.categories);for(const f of c)await f(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Tr(e).iterator();for(const o of s){await et(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const c of u)await c(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return Kk}async validateAstAfter(e,r,n,i=Ae.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await et(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Hk(n),severity:eu(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 Hk(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=_m(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=fR(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function eu(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function Yk(t){switch(t){case"error":return La(It.LexingError);case"warning":return La(It.LexingWarning);case"info":return La(It.LexingInfo);case"hint":return La(It.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var It;(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"})(It||(It={}));class Xk{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??yr(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=()=>s??(s=wo(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return o()},selectionSegment:wo(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class Jk{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Ae.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Tr(i))await et(r),So(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Pt(r)&&r.$nodeDescription?n=[r.$nodeDescription]:zr(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=yr(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=wo(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:pt.equals(l.documentUri,i)});return s}}class Zk{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const 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,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}}var Qk=Ui();class eO{constructor(e){this._ready=new id,this.onConfigurationSectionUpdateEmitter=new Qk.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}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;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var rn={},nn={},Ys={},tu={},G={},sh;function Oy(){if(sh)return G;sh=1,Object.defineProperty(G,"__esModule",{value:!0}),G.Message=G.NotificationType9=G.NotificationType8=G.NotificationType7=G.NotificationType6=G.NotificationType5=G.NotificationType4=G.NotificationType3=G.NotificationType2=G.NotificationType1=G.NotificationType0=G.NotificationType=G.RequestType9=G.RequestType8=G.RequestType7=G.RequestType6=G.RequestType5=G.RequestType4=G.RequestType3=G.RequestType2=G.RequestType1=G.RequestType=G.RequestType0=G.AbstractMessageSignature=G.ParameterStructures=G.ResponseError=G.ErrorCodes=void 0;const t=Rs();var e;(function(v){v.ParseError=-32700,v.InvalidRequest=-32600,v.MethodNotFound=-32601,v.InvalidParams=-32602,v.InternalError=-32603,v.jsonrpcReservedErrorRangeStart=-32099,v.serverErrorStart=-32099,v.MessageWriteError=-32099,v.MessageReadError=-32098,v.PendingResponseRejected=-32097,v.ConnectionInactive=-32096,v.ServerNotInitialized=-32002,v.UnknownErrorCode=-32001,v.jsonrpcReservedErrorRangeEnd=-32e3,v.serverErrorEnd=-32e3})(e||(G.ErrorCodes=e={}));class r extends Error{constructor(g,w,T){super(w),this.code=t.number(g)?g:e.UnknownErrorCode,this.data=T,Object.setPrototypeOf(this,r.prototype)}toJson(){const g={code:this.code,message:this.message};return this.data!==void 0&&(g.data=this.data),g}}G.ResponseError=r;class n{constructor(g){this.kind=g}static is(g){return g===n.auto||g===n.byName||g===n.byPosition}toString(){return this.kind}}G.ParameterStructures=n,n.auto=new n("auto"),n.byPosition=new n("byPosition"),n.byName=new n("byName");class i{constructor(g,w){this.method=g,this.numberOfParams=w}get parameterStructures(){return n.auto}}G.AbstractMessageSignature=i;class a extends i{constructor(g){super(g,0)}}G.RequestType0=a;class s extends i{constructor(g,w=n.auto){super(g,1),this._parameterStructures=w}get parameterStructures(){return this._parameterStructures}}G.RequestType=s;class o extends i{constructor(g,w=n.auto){super(g,1),this._parameterStructures=w}get parameterStructures(){return this._parameterStructures}}G.RequestType1=o;class l extends i{constructor(g){super(g,2)}}G.RequestType2=l;class u extends i{constructor(g){super(g,3)}}G.RequestType3=u;class c extends i{constructor(g){super(g,4)}}G.RequestType4=c;class f extends i{constructor(g){super(g,5)}}G.RequestType5=f;class h extends i{constructor(g){super(g,6)}}G.RequestType6=h;class p extends i{constructor(g){super(g,7)}}G.RequestType7=p;class y extends i{constructor(g){super(g,8)}}G.RequestType8=y;class A extends i{constructor(g){super(g,9)}}G.RequestType9=A;class N extends i{constructor(g,w=n.auto){super(g,1),this._parameterStructures=w}get parameterStructures(){return this._parameterStructures}}G.NotificationType=N;class C extends i{constructor(g){super(g,0)}}G.NotificationType0=C;class S extends i{constructor(g,w=n.auto){super(g,1),this._parameterStructures=w}get parameterStructures(){return this._parameterStructures}}G.NotificationType1=S;class _ extends i{constructor(g){super(g,2)}}G.NotificationType2=_;class k extends i{constructor(g){super(g,3)}}G.NotificationType3=k;class K extends i{constructor(g){super(g,4)}}G.NotificationType4=K;class H extends i{constructor(g){super(g,5)}}G.NotificationType5=H;class J extends i{constructor(g){super(g,6)}}G.NotificationType6=J;class oe extends i{constructor(g){super(g,7)}}G.NotificationType7=oe;class me extends i{constructor(g){super(g,8)}}G.NotificationType8=me;class ge extends i{constructor(g){super(g,9)}}G.NotificationType9=ge;var I;return(function(v){function g(R){const E=R;return E&&t.string(E.method)&&(t.string(E.id)||t.number(E.id))}v.isRequest=g;function w(R){const E=R;return E&&t.string(E.method)&&R.id===void 0}v.isNotification=w;function T(R){const E=R;return E&&(E.result!==void 0||!!E.error)&&(t.string(E.id)||t.number(E.id)||E.id===null)}v.isResponse=T})(I||(G.Message=I={})),G}var nr={},oh;function Ly(){if(oh)return nr;oh=1;var t;Object.defineProperty(nr,"__esModule",{value:!0}),nr.LRUCache=nr.LinkedMap=nr.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(nr.Touch=e={}));class r{constructor(){this[t]="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(){var a;return(a=this._head)==null?void 0:a.value}get last(){var a;return(a=this._tail)==null?void 0:a.value}has(a){return this._map.has(a)}get(a,s=e.None){const o=this._map.get(a);if(o)return s!==e.None&&this.touch(o,s),o.value}set(a,s,o=e.None){let l=this._map.get(a);if(l)l.value=s,o!==e.None&&this.touch(l,o);else{switch(l={key:a,value:s,next:void 0,previous:void 0},o){case e.None:this.addItemLast(l);break;case e.First:this.addItemFirst(l);break;case e.Last:this.addItemLast(l);break;default:this.addItemLast(l);break}this._map.set(a,l),this._size++}return this}delete(a){return!!this.remove(a)}remove(a){const s=this._map.get(a);if(s)return this._map.delete(a),this.removeItem(s),this._size--,s.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const a=this._head;return this._map.delete(a.key),this.removeItem(a),this._size--,a.value}forEach(a,s){const o=this._state;let l=this._head;for(;l;){if(s?a.bind(s)(l.value,l.key,this):a(l.value,l.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");l=l.next}}keys(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:s.key,done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}values(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:s.value,done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}entries(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:[s.key,s.value],done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(a){if(a>=this.size)return;if(a===0){this.clear();return}let s=this._head,o=this.size;for(;s&&o>a;)this._map.delete(s.key),s=s.next,o--;this._head=s,this._size=o,s&&(s.previous=void 0),this._state++}addItemFirst(a){if(!this._head&&!this._tail)this._tail=a;else if(this._head)a.next=this._head,this._head.previous=a;else throw new Error("Invalid list");this._head=a,this._state++}addItemLast(a){if(!this._head&&!this._tail)this._head=a;else if(this._tail)a.previous=this._tail,this._tail.next=a;else throw new Error("Invalid list");this._tail=a,this._state++}removeItem(a){if(a===this._head&&a===this._tail)this._head=void 0,this._tail=void 0;else if(a===this._head){if(!a.next)throw new Error("Invalid list");a.next.previous=void 0,this._head=a.next}else if(a===this._tail){if(!a.previous)throw new Error("Invalid list");a.previous.next=void 0,this._tail=a.previous}else{const s=a.next,o=a.previous;if(!s||!o)throw new Error("Invalid list");s.previous=o,o.next=s}a.next=void 0,a.previous=void 0,this._state++}touch(a,s){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(s!==e.First&&s!==e.Last)){if(s===e.First){if(a===this._head)return;const o=a.next,l=a.previous;a===this._tail?(l.next=void 0,this._tail=l):(o.previous=l,l.next=o),a.previous=void 0,a.next=this._head,this._head.previous=a,this._head=a,this._state++}else if(s===e.Last){if(a===this._tail)return;const o=a.next,l=a.previous;a===this._head?(o.previous=void 0,this._head=o):(o.previous=l,l.next=o),a.next=void 0,a.previous=this._tail,this._tail.next=a,this._tail=a,this._state++}}}toJSON(){const a=[];return this.forEach((s,o)=>{a.push([o,s])}),a}fromJSON(a){this.clear();for(const[s,o]of a)this.set(s,o)}}nr.LinkedMap=r;class n extends r{constructor(a,s=1){super(),this._limit=a,this._ratio=Math.min(Math.max(0,s),1)}get limit(){return this._limit}set limit(a){this._limit=a,this.checkTrim()}get ratio(){return this._ratio}set ratio(a){this._ratio=Math.min(Math.max(0,a),1),this.checkTrim()}get(a,s=e.AsNew){return super.get(a,s)}peek(a){return super.get(a,e.None)}set(a,s){return super.set(a,s,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return nr.LRUCache=n,nr}var ca={},lh;function tO(){if(lh)return ca;lh=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.Disposable=void 0;var t;return(function(e){function r(n){return{dispose:n}}e.create=r})(t||(ca.Disposable=t={})),ca}var an={},uh;function rO(){if(uh)return an;uh=1,Object.defineProperty(an,"__esModule",{value:!0}),an.SharedArrayReceiverStrategy=an.SharedArraySenderStrategy=void 0;const t=Ol();var e;(function(s){s.Continue=0,s.Cancelled=1})(e||(e={}));class r{constructor(){this.buffers=new Map}enableCancellation(o){if(o.id===null)return;const l=new SharedArrayBuffer(4),u=new Int32Array(l,0,1);u[0]=e.Continue,this.buffers.set(o.id,l),o.$cancellationData=l}async sendCancellation(o,l){const u=this.buffers.get(l);if(u===void 0)return;const c=new Int32Array(u,0,1);Atomics.store(c,0,e.Cancelled)}cleanup(o){this.buffers.delete(o)}dispose(){this.buffers.clear()}}an.SharedArraySenderStrategy=r;class n{constructor(o){this.data=new Int32Array(o,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(o){this.token=new n(o)}cancel(){}dispose(){}}class a{constructor(){this.kind="request"}createCancellationTokenSource(o){const l=o.$cancellationData;return l===void 0?new t.CancellationTokenSource:new i(l)}}return an.SharedArrayReceiverStrategy=a,an}var ir={},fa={},ch;function xy(){if(ch)return fa;ch=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.Semaphore=void 0;const t=Fn();class e{constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((i,a)=>{this._waiting.push({thunk:n,resolve:i,reject:a}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=n.thunk();i instanceof Promise?i.then(a=>{this._active--,n.resolve(a),this.runNext()},a=>{this._active--,n.reject(a),this.runNext()}):(this._active--,n.resolve(i),this.runNext())}catch(i){this._active--,n.reject(i),this.runNext()}}}return fa.Semaphore=e,fa}var fh;function nO(){if(fh)return ir;fh=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.ReadableStreamMessageReader=ir.AbstractMessageReader=ir.MessageReader=void 0;const t=Fn(),e=Rs(),r=Ui(),n=xy();var i;(function(l){function u(c){let f=c;return f&&e.func(f.listen)&&e.func(f.dispose)&&e.func(f.onError)&&e.func(f.onClose)&&e.func(f.onPartialMessage)}l.is=u})(i||(ir.MessageReader=i={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${e.string(u.message)?u.message:"unknown"}`)}}ir.AbstractMessageReader=a;var s;(function(l){function u(c){let f,h;const p=new Map;let y;const A=new Map;if(c===void 0||typeof c=="string")f=c??"utf-8";else{if(f=c.charset??"utf-8",c.contentDecoder!==void 0&&(h=c.contentDecoder,p.set(h.name,h)),c.contentDecoders!==void 0)for(const N of c.contentDecoders)p.set(N.name,N);if(c.contentTypeDecoder!==void 0&&(y=c.contentTypeDecoder,A.set(y.name,y)),c.contentTypeDecoders!==void 0)for(const N of c.contentTypeDecoders)A.set(N.name,N)}return y===void 0&&(y=(0,t.default)().applicationJson.decoder,A.set(y.name,y)),{charset:f,contentDecoder:h,contentDecoders:p,contentTypeDecoder:y,contentTypeDecoders:A}}l.fromOptions=u})(s||(s={}));class o extends a{constructor(u,c){super(),this.readable=u,this.options=s.fromOptions(c),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new n.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;const c=this.readable.onData(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),c}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const h=f.get("content-length");if(!h){this.fireError(new Error(`Header must provide a Content-Length property.
122
+ ${JSON.stringify(Object.fromEntries(f))}`));return}const p=parseInt(h);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${h}`));return}this.nextMessageLength=p}const c=this.buffer.tryReadBody(this.nextMessageLength);if(c===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(c):c,h=await this.options.contentTypeDecoder.decode(f,this.options);this.callback(h)}).catch(f=>{this.fireError(f)})}}catch(c){this.fireError(c)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,c)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:c}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return ir.ReadableStreamMessageReader=o,ir}var ar={},dh;function iO(){if(dh)return ar;dh=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.WriteableStreamMessageWriter=ar.AbstractMessageWriter=ar.MessageWriter=void 0;const t=Fn(),e=Rs(),r=xy(),n=Ui(),i="Content-Length: ",a=`\r
123
+ `;var s;(function(c){function f(h){let p=h;return p&&e.func(p.dispose)&&e.func(p.onClose)&&e.func(p.onError)&&e.func(p.write)}c.is=f})(s||(ar.MessageWriter=s={}));class o{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,h,p){this.errorEmitter.fire([this.asError(f),h,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${e.string(f.message)?f.message:"unknown"}`)}}ar.AbstractMessageWriter=o;var l;(function(c){function f(h){return h===void 0||typeof h=="string"?{charset:h??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:h.charset??"utf-8",contentEncoder:h.contentEncoder,contentTypeEncoder:h.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}c.fromOptions=f})(l||(l={}));class u extends o{constructor(f,h){super(),this.writable=f,this.options=l.fromOptions(h),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,this.options).then(p=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(p):p).then(p=>{const y=[];return y.push(i,p.byteLength.toString(),a),y.push(a),this.doWrite(f,y,p)},p=>{throw this.fireError(p),p}))}async doWrite(f,h,p){try{return await this.writable.write(h.join(""),"ascii"),this.writable.write(p)}catch(y){return this.handleError(y,f),Promise.reject(y)}}handleError(f,h){this.errorCount++,this.fireError(f,h,this.errorCount)}end(){this.writable.end()}}return ar.WriteableStreamMessageWriter=u,ar}var da={},ph;function aO(){if(ph)return da;ph=1,Object.defineProperty(da,"__esModule",{value:!0}),da.AbstractMessageBuffer=void 0;const t=13,e=10,r=`\r
124
+ `;class n{constructor(a="utf-8"){this._encoding=a,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(a){const s=typeof a=="string"?this.fromString(a,this._encoding):a;this._chunks.push(s),this._totalLength+=s.byteLength}tryReadHeaders(a=!1){if(this._chunks.length===0)return;let s=0,o=0,l=0,u=0;e:for(;o<this._chunks.length;){const p=this._chunks[o];for(l=0;l<p.length;){switch(p[l]){case t:switch(s){case 0:s=1;break;case 2:s=3;break;default:s=0}break;case e:switch(s){case 1:s=2;break;case 3:s=4,l++;break e;default:s=0}break;default:s=0}l++}u+=p.byteLength,o++}if(s!==4)return;const c=this._read(u+l),f=new Map,h=this.toString(c,"ascii").split(r);if(h.length<2)return f;for(let p=0;p<h.length-2;p++){const y=h[p],A=y.indexOf(":");if(A===-1)throw new Error(`Message header must separate key and value using ':'
125
+ ${y}`);const N=y.substr(0,A),C=y.substr(A+1).trim();f.set(a?N.toLowerCase():N,C)}return f}tryReadBody(a){if(!(this._totalLength<a))return this._read(a)}get numberOfBytes(){return this._totalLength}_read(a){if(a===0)return this.emptyBuffer();if(a>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===a){const u=this._chunks[0];return this._chunks.shift(),this._totalLength-=a,this.asNative(u)}if(this._chunks[0].byteLength>a){const u=this._chunks[0],c=this.asNative(u,a);return this._chunks[0]=u.slice(a),this._totalLength-=a,c}const s=this.allocNative(a);let o=0,l=0;for(;a>0;){const u=this._chunks[l];if(u.byteLength>a){const c=u.slice(0,a);s.set(c,o),o+=a,this._chunks[l]=u.slice(a),this._totalLength-=a,a-=a}else s.set(u,o),o+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,a-=u.byteLength}return s}}return da.AbstractMessageBuffer=n,da}var ru={},hh;function sO(){return hh||(hh=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=Fn(),r=Rs(),n=Oy(),i=Ly(),a=Ui(),s=Ol();var o;(function(g){g.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(g){function w(T){return typeof T=="string"||typeof T=="number"}g.is=w})(l||(t.ProgressToken=l={}));var u;(function(g){g.type=new n.NotificationType("$/progress")})(u||(u={}));class c{constructor(){}}t.ProgressType=c;var f;(function(g){function w(T){return r.func(T)}g.is=w})(f||(f={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var h;(function(g){g[g.Off=0]="Off",g[g.Messages=1]="Messages",g[g.Compact=2]="Compact",g[g.Verbose=3]="Verbose"})(h||(t.Trace=h={}));var p;(function(g){g.Off="off",g.Messages="messages",g.Compact="compact",g.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(g){function w(R){if(!r.string(R))return g.Off;switch(R=R.toLowerCase(),R){case"off":return g.Off;case"messages":return g.Messages;case"compact":return g.Compact;case"verbose":return g.Verbose;default:return g.Off}}g.fromString=w;function T(R){switch(R){case g.Off:return"off";case g.Messages:return"messages";case g.Compact:return"compact";case g.Verbose:return"verbose";default:return"off"}}g.toString=T})(h||(t.Trace=h={}));var y;(function(g){g.Text="text",g.JSON="json"})(y||(t.TraceFormat=y={})),(function(g){function w(T){return r.string(T)?(T=T.toLowerCase(),T==="json"?g.JSON:g.Text):g.Text}g.fromString=w})(y||(t.TraceFormat=y={}));var A;(function(g){g.type=new n.NotificationType("$/setTrace")})(A||(t.SetTraceNotification=A={}));var N;(function(g){g.type=new n.NotificationType("$/logTrace")})(N||(t.LogTraceNotification=N={}));var C;(function(g){g[g.Closed=1]="Closed",g[g.Disposed=2]="Disposed",g[g.AlreadyListening=3]="AlreadyListening"})(C||(t.ConnectionErrors=C={}));class S extends Error{constructor(w,T){super(T),this.code=w,Object.setPrototypeOf(this,S.prototype)}}t.ConnectionError=S;var _;(function(g){function w(T){const R=T;return R&&r.func(R.cancelUndispatched)}g.is=w})(_||(t.ConnectionStrategy=_={}));var k;(function(g){function w(T){const R=T;return R&&(R.kind===void 0||R.kind==="id")&&r.func(R.createCancellationTokenSource)&&(R.dispose===void 0||r.func(R.dispose))}g.is=w})(k||(t.IdCancellationReceiverStrategy=k={}));var K;(function(g){function w(T){const R=T;return R&&R.kind==="request"&&r.func(R.createCancellationTokenSource)&&(R.dispose===void 0||r.func(R.dispose))}g.is=w})(K||(t.RequestCancellationReceiverStrategy=K={}));var H;(function(g){g.Message=Object.freeze({createCancellationTokenSource(T){return new s.CancellationTokenSource}});function w(T){return k.is(T)||K.is(T)}g.is=w})(H||(t.CancellationReceiverStrategy=H={}));var J;(function(g){g.Message=Object.freeze({sendCancellation(T,R){return T.sendNotification(o.type,{id:R})},cleanup(T){}});function w(T){const R=T;return R&&r.func(R.sendCancellation)&&r.func(R.cleanup)}g.is=w})(J||(t.CancellationSenderStrategy=J={}));var oe;(function(g){g.Message=Object.freeze({receiver:H.Message,sender:J.Message});function w(T){const R=T;return R&&H.is(R.receiver)&&J.is(R.sender)}g.is=w})(oe||(t.CancellationStrategy=oe={}));var me;(function(g){function w(T){const R=T;return R&&r.func(R.handleMessage)}g.is=w})(me||(t.MessageStrategy=me={}));var ge;(function(g){function w(T){const R=T;return R&&(oe.is(R.cancellationStrategy)||_.is(R.connectionStrategy)||me.is(R.messageStrategy))}g.is=w})(ge||(t.ConnectionOptions=ge={}));var I;(function(g){g[g.New=1]="New",g[g.Listening=2]="Listening",g[g.Closed=3]="Closed",g[g.Disposed=4]="Disposed"})(I||(I={}));function v(g,w,T,R){const E=T!==void 0?T:t.NullLogger;let L=0,D=0,x=0;const U="2.0";let F;const ae=new Map;let q;const ne=new Map,ze=new Map;let Ce,ye=new i.LinkedMap,xe=new Map,Ue=new Set,ke=new Map,ee=h.Off,ut=y.Text,Se,St=I.New;const Gn=new a.Emitter,Bi=new a.Emitter,Wi=new a.Emitter,Ki=new a.Emitter,Vi=new a.Emitter,_t=R&&R.cancellationStrategy?R.cancellationStrategy:oe.Message;function Hi(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()}function vs(m){return m===null?"res-unknown-"+(++x).toString():"res-"+m.toString()}function $s(){return"not-"+(++D).toString()}function As(m,b){n.Message.isRequest(b)?m.set(Hi(b.id),b):n.Message.isResponse(b)?m.set(vs(b.id),b):m.set($s(),b)}function Es(m){}function Yi(){return St===I.Listening}function Xi(){return St===I.Closed}function er(){return St===I.Disposed}function Ji(){(St===I.New||St===I.Listening)&&(St=I.Closed,Bi.fire(void 0))}function Cs(m){Gn.fire([m,void 0,void 0])}function Ss(m){Gn.fire(m)}g.onClose(Ji),g.onError(Cs),w.onClose(Ji),w.onError(Ss);function Zi(){Ce||ye.size===0||(Ce=(0,e.default)().timer.setImmediate(()=>{Ce=void 0,_s()}))}function Qi(m){n.Message.isRequest(m)?bs(m):n.Message.isNotification(m)?Is(m):n.Message.isResponse(m)?Ns(m):Ps(m)}function _s(){if(ye.size===0)return;const m=ye.shift();try{const b=R==null?void 0:R.messageStrategy;me.is(b)?b.handleMessage(m,Qi):Qi(m)}finally{Zi()}}const ws=m=>{try{if(n.Message.isNotification(m)&&m.method===o.type.method){const b=m.params.id,O=Hi(b),M=ye.get(O);if(n.Message.isRequest(M)){const se=R==null?void 0:R.connectionStrategy,le=se&&se.cancelUndispatched?se.cancelUndispatched(M,Es):void 0;if(le&&(le.error!==void 0||le.result!==void 0)){ye.delete(O),ke.delete(b),le.id=M.id,Zr(le,m.method,Date.now()),w.write(le).catch(()=>E.error("Sending response for canceled message failed."));return}}const fe=ke.get(b);if(fe!==void 0){fe.cancel(),zn(m);return}else Ue.add(b)}As(ye,m)}finally{Zi()}};function bs(m){if(er())return;function b(Z,Te,ie){const De={jsonrpc:U,id:m.id};Z instanceof n.ResponseError?De.error=Z.toJson():De.result=Z===void 0?null:Z,Zr(De,Te,ie),w.write(De).catch(()=>E.error("Sending response failed."))}function O(Z,Te,ie){const De={jsonrpc:U,id:m.id,error:Z.toJson()};Zr(De,Te,ie),w.write(De).catch(()=>E.error("Sending response failed."))}function M(Z,Te,ie){Z===void 0&&(Z=null);const De={jsonrpc:U,id:m.id,result:Z};Zr(De,Te,ie),w.write(De).catch(()=>E.error("Sending response failed."))}Ls(m);const fe=ae.get(m.method);let se,le;fe&&(se=fe.type,le=fe.handler);const Ie=Date.now();if(le||F){const Z=m.id??String(Date.now()),Te=k.is(_t.receiver)?_t.receiver.createCancellationTokenSource(Z):_t.receiver.createCancellationTokenSource(m);m.id!==null&&Ue.has(m.id)&&Te.cancel(),m.id!==null&&ke.set(Z,Te);try{let ie;if(le)if(m.params===void 0){if(se!==void 0&&se.numberOfParams!==0){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines ${se.numberOfParams} params but received none.`),m.method,Ie);return}ie=le(Te.token)}else if(Array.isArray(m.params)){if(se!==void 0&&se.parameterStructures===n.ParameterStructures.byName){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by name but received parameters by position`),m.method,Ie);return}ie=le(...m.params,Te.token)}else{if(se!==void 0&&se.parameterStructures===n.ParameterStructures.byPosition){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by position but received parameters by name`),m.method,Ie);return}ie=le(m.params,Te.token)}else F&&(ie=F(m.method,m.params,Te.token));const De=ie;ie?De.then?De.then(Je=>{ke.delete(Z),b(Je,m.method,Ie)},Je=>{ke.delete(Z),Je instanceof n.ResponseError?O(Je,m.method,Ie):Je&&r.string(Je.message)?O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${Je.message}`),m.method,Ie):O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,Ie)}):(ke.delete(Z),b(ie,m.method,Ie)):(ke.delete(Z),M(ie,m.method,Ie))}catch(ie){ke.delete(Z),ie instanceof n.ResponseError?b(ie,m.method,Ie):ie&&r.string(ie.message)?O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${ie.message}`),m.method,Ie):O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,Ie)}}else O(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${m.method}`),m.method,Ie)}function Ns(m){if(!er())if(m.id===null)m.error?E.error(`Received response message without id: Error is:
126
+ ${JSON.stringify(m.error,void 0,4)}`):E.error("Received response message without id. No further error information provided.");else{const b=m.id,O=xe.get(b);if(xs(m,O),O!==void 0){xe.delete(b);try{if(m.error){const M=m.error;O.reject(new n.ResponseError(M.code,M.message,M.data))}else if(m.result!==void 0)O.resolve(m.result);else throw new Error("Should never happen.")}catch(M){M.message?E.error(`Response handler '${O.method}' failed with message: ${M.message}`):E.error(`Response handler '${O.method}' failed unexpectedly.`)}}}}function Is(m){if(er())return;let b,O;if(m.method===o.type.method){const M=m.params.id;Ue.delete(M),zn(m);return}else{const M=ne.get(m.method);M&&(O=M.handler,b=M.type)}if(O||q)try{if(zn(m),O)if(m.params===void 0)b!==void 0&&b.numberOfParams!==0&&b.parameterStructures!==n.ParameterStructures.byName&&E.error(`Notification ${m.method} defines ${b.numberOfParams} params but received none.`),O();else if(Array.isArray(m.params)){const M=m.params;m.method===u.type.method&&M.length===2&&l.is(M[0])?O({token:M[0],value:M[1]}):(b!==void 0&&(b.parameterStructures===n.ParameterStructures.byName&&E.error(`Notification ${m.method} defines parameters by name but received parameters by position`),b.numberOfParams!==m.params.length&&E.error(`Notification ${m.method} defines ${b.numberOfParams} params but received ${M.length} arguments`)),O(...M))}else b!==void 0&&b.parameterStructures===n.ParameterStructures.byPosition&&E.error(`Notification ${m.method} defines parameters by position but received parameters by name`),O(m.params);else q&&q(m.method,m.params)}catch(M){M.message?E.error(`Notification handler '${m.method}' failed with message: ${M.message}`):E.error(`Notification handler '${m.method}' failed unexpectedly.`)}else Wi.fire(m)}function Ps(m){if(!m){E.error("Received empty message.");return}E.error(`Received message which is neither a response nor a notification message:
127
+ ${JSON.stringify(m,null,4)}`);const b=m;if(r.string(b.id)||r.number(b.id)){const O=b.id,M=xe.get(O);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}function wt(m){if(m!=null)switch(ee){case h.Verbose:return JSON.stringify(m,null,4);case h.Compact:return JSON.stringify(m);default:return}}function ks(m){if(!(ee===h.Off||!Se))if(ut===y.Text){let b;(ee===h.Verbose||ee===h.Compact)&&m.params&&(b=`Params: ${wt(m.params)}
128
+
129
+ `),Se.log(`Sending request '${m.method} - (${m.id})'.`,b)}else tr("send-request",m)}function Os(m){if(!(ee===h.Off||!Se))if(ut===y.Text){let b;(ee===h.Verbose||ee===h.Compact)&&(m.params?b=`Params: ${wt(m.params)}
130
+
131
+ `:b=`No parameters provided.
132
+
133
+ `),Se.log(`Sending notification '${m.method}'.`,b)}else tr("send-notification",m)}function Zr(m,b,O){if(!(ee===h.Off||!Se))if(ut===y.Text){let M;(ee===h.Verbose||ee===h.Compact)&&(m.error&&m.error.data?M=`Error data: ${wt(m.error.data)}
134
+
135
+ `:m.result?M=`Result: ${wt(m.result)}
136
+
137
+ `:m.error===void 0&&(M=`No result returned.
138
+
139
+ `)),Se.log(`Sending response '${b} - (${m.id})'. Processing request took ${Date.now()-O}ms`,M)}else tr("send-response",m)}function Ls(m){if(!(ee===h.Off||!Se))if(ut===y.Text){let b;(ee===h.Verbose||ee===h.Compact)&&m.params&&(b=`Params: ${wt(m.params)}
140
+
141
+ `),Se.log(`Received request '${m.method} - (${m.id})'.`,b)}else tr("receive-request",m)}function zn(m){if(!(ee===h.Off||!Se||m.method===N.type.method))if(ut===y.Text){let b;(ee===h.Verbose||ee===h.Compact)&&(m.params?b=`Params: ${wt(m.params)}
142
+
143
+ `:b=`No parameters provided.
144
+
145
+ `),Se.log(`Received notification '${m.method}'.`,b)}else tr("receive-notification",m)}function xs(m,b){if(!(ee===h.Off||!Se))if(ut===y.Text){let O;if((ee===h.Verbose||ee===h.Compact)&&(m.error&&m.error.data?O=`Error data: ${wt(m.error.data)}
146
+
147
+ `:m.result?O=`Result: ${wt(m.result)}
148
+
149
+ `:m.error===void 0&&(O=`No result returned.
150
+
151
+ `)),b){const M=m.error?` Request failed: ${m.error.message} (${m.error.code}).`:"";Se.log(`Received response '${b.method} - (${m.id})' in ${Date.now()-b.timerStart}ms.${M}`,O)}else Se.log(`Received response ${m.id} without active response promise.`,O)}else tr("receive-response",m)}function tr(m,b){if(!Se||ee===h.Off)return;const O={isLSPMessage:!0,type:m,message:b,timestamp:Date.now()};Se.log(O)}function xr(){if(Xi())throw new S(C.Closed,"Connection is closed.");if(er())throw new S(C.Disposed,"Connection is disposed.")}function Ds(){if(Yi())throw new S(C.AlreadyListening,"Connection is already listening")}function Ms(){if(!Yi())throw new Error("Call listen() first.")}function Dr(m){return m===void 0?null:m}function ea(m){if(m!==null)return m}function d(m){return m!=null&&!Array.isArray(m)&&typeof m=="object"}function be(m,b){switch(m){case n.ParameterStructures.auto:return d(b)?ea(b):[Dr(b)];case n.ParameterStructures.byName:if(!d(b))throw new Error("Received parameters by name but param is not an object literal.");return ea(b);case n.ParameterStructures.byPosition:return[Dr(b)];default:throw new Error(`Unknown parameter structure ${m.toString()}`)}}function Ne(m,b){let O;const M=m.numberOfParams;switch(M){case 0:O=void 0;break;case 1:O=be(m.parameterStructures,b[0]);break;default:O=[];for(let fe=0;fe<b.length&&fe<M;fe++)O.push(Dr(b[fe]));if(b.length<M)for(let fe=b.length;fe<M;fe++)O.push(null);break}return O}const V={sendNotification:(m,...b)=>{xr();let O,M;if(r.string(m)){O=m;const se=b[0];let le=0,Ie=n.ParameterStructures.auto;n.ParameterStructures.is(se)&&(le=1,Ie=se);let Z=b.length;const Te=Z-le;switch(Te){case 0:M=void 0;break;case 1:M=be(Ie,b[le]);break;default:if(Ie===n.ParameterStructures.byName)throw new Error(`Received ${Te} parameters for 'by Name' notification parameter structure.`);M=b.slice(le,Z).map(ie=>Dr(ie));break}}else{const se=b;O=m.method,M=Ne(m,se)}const fe={jsonrpc:U,method:O,params:M};return Os(fe),w.write(fe).catch(se=>{throw E.error("Sending notification failed."),se})},onNotification:(m,b)=>{xr();let O;return r.func(m)?q=m:b&&(r.string(m)?(O=m,ne.set(m,{type:void 0,handler:b})):(O=m.method,ne.set(m.method,{type:m,handler:b}))),{dispose:()=>{O!==void 0?ne.delete(O):q=void 0}}},onProgress:(m,b,O)=>{if(ze.has(b))throw new Error(`Progress handler for token ${b} already registered`);return ze.set(b,O),{dispose:()=>{ze.delete(b)}}},sendProgress:(m,b,O)=>V.sendNotification(u.type,{token:b,value:O}),onUnhandledProgress:Ki.event,sendRequest:(m,...b)=>{xr(),Ms();let O,M,fe;if(r.string(m)){O=m;const Z=b[0],Te=b[b.length-1];let ie=0,De=n.ParameterStructures.auto;n.ParameterStructures.is(Z)&&(ie=1,De=Z);let Je=b.length;s.CancellationToken.is(Te)&&(Je=Je-1,fe=Te);const Mt=Je-ie;switch(Mt){case 0:M=void 0;break;case 1:M=be(De,b[ie]);break;default:if(De===n.ParameterStructures.byName)throw new Error(`Received ${Mt} parameters for 'by Name' request parameter structure.`);M=b.slice(ie,Je).map(uT=>Dr(uT));break}}else{const Z=b;O=m.method,M=Ne(m,Z);const Te=m.numberOfParams;fe=s.CancellationToken.is(Z[Te])?Z[Te]:void 0}const se=L++;let le;fe&&(le=fe.onCancellationRequested(()=>{const Z=_t.sender.sendCancellation(V,se);return Z===void 0?(E.log(`Received no promise from cancellation strategy when cancelling id ${se}`),Promise.resolve()):Z.catch(()=>{E.log(`Sending cancellation messages for id ${se} failed`)})}));const Ie={jsonrpc:U,id:se,method:O,params:M};return ks(Ie),typeof _t.sender.enableCancellation=="function"&&_t.sender.enableCancellation(Ie),new Promise(async(Z,Te)=>{const ie=Mt=>{Z(Mt),_t.sender.cleanup(se),le==null||le.dispose()},De=Mt=>{Te(Mt),_t.sender.cleanup(se),le==null||le.dispose()},Je={method:O,timerStart:Date.now(),resolve:ie,reject:De};try{await w.write(Ie),xe.set(se,Je)}catch(Mt){throw E.error("Sending request failed."),Je.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Mt.message?Mt.message:"Unknown reason")),Mt}})},onRequest:(m,b)=>{xr();let O=null;return f.is(m)?(O=void 0,F=m):r.string(m)?(O=null,b!==void 0&&(O=m,ae.set(m,{handler:b,type:void 0}))):b!==void 0&&(O=m.method,ae.set(m.method,{type:m,handler:b})),{dispose:()=>{O!==null&&(O!==void 0?ae.delete(O):F=void 0)}}},hasPendingResponse:()=>xe.size>0,trace:async(m,b,O)=>{let M=!1,fe=y.Text;O!==void 0&&(r.boolean(O)?M=O:(M=O.sendNotification||!1,fe=O.traceFormat||y.Text)),ee=m,ut=fe,ee===h.Off?Se=void 0:Se=b,M&&!Xi()&&!er()&&await V.sendNotification(A.type,{value:h.toString(m)})},onError:Gn.event,onClose:Bi.event,onUnhandledNotification:Wi.event,onDispose:Vi.event,end:()=>{w.end()},dispose:()=>{if(er())return;St=I.Disposed,Vi.fire(void 0);const m=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const b of xe.values())b.reject(m);xe=new Map,ke=new Map,Ue=new Set,ye=new i.LinkedMap,r.func(w.dispose)&&w.dispose(),r.func(g.dispose)&&g.dispose()},listen:()=>{xr(),Ds(),St=I.Listening,g.listen(ws)},inspect:()=>{(0,e.default)().console.log("inspect")}};return V.onNotification(N.type,m=>{if(ee===h.Off||!Se)return;const b=ee===h.Verbose||ee===h.Compact;Se.log(m.message,b?m.verbose:void 0)}),V.onNotification(u.type,m=>{const b=ze.get(m.token);b?b(m.value):Ki.fire(m)}),V}t.createMessageConnection=v})(ru)),ru}var mh;function tf(){return mh||(mh=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=Oy();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const r=Ly();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return r.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return r.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return r.Touch}});const n=tO();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return n.Disposable}});const i=Ui();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const a=Ol();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const s=rO();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const o=nO();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return o.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return o.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return o.ReadableStreamMessageReader}});const l=iO();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return l.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return l.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return l.WriteableStreamMessageWriter}});const u=aO();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const c=sO();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return c.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return c.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return c.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return c.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return c.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return c.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return c.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return c.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return c.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return c.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return c.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return c.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return c.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return c.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return c.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return c.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return c.MessageStrategy}});const f=Fn();t.RAL=f.default})(tu)),tu}var gh;function oO(){if(gh)return Ys;gh=1,Object.defineProperty(Ys,"__esModule",{value:!0});const t=tf();class e extends t.AbstractMessageBuffer{constructor(l="utf-8"){super(l),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return e.emptyBuffer}fromString(l,u){return new TextEncoder().encode(l)}toString(l,u){return u==="ascii"?this.asciiDecoder.decode(l):new TextDecoder(u).decode(l)}asNative(l,u){return u===void 0?l:l.slice(0,u)}allocNative(l){return new Uint8Array(l)}}e.emptyBuffer=new Uint8Array(0);class r{constructor(l){this.socket=l,this._onData=new t.Emitter,this._messageListener=u=>{u.data.arrayBuffer().then(f=>{this._onData.fire(new Uint8Array(f))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(l){return this.socket.addEventListener("close",l),t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){return this.socket.addEventListener("error",l),t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){return this.socket.addEventListener("end",l),t.Disposable.create(()=>this.socket.removeEventListener("end",l))}onData(l){return this._onData.event(l)}}class n{constructor(l){this.socket=l}onClose(l){return this.socket.addEventListener("close",l),t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){return this.socket.addEventListener("error",l),t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){return this.socket.addEventListener("end",l),t.Disposable.create(()=>this.socket.removeEventListener("end",l))}write(l,u){if(typeof l=="string"){if(u!==void 0&&u!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u}`);this.socket.send(l)}else this.socket.send(l);return Promise.resolve()}end(){this.socket.close()}}const i=new TextEncoder,a=Object.freeze({messageBuffer:Object.freeze({create:o=>new e(o)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(o,l)=>{if(l.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${l.charset}`);return Promise.resolve(i.encode(JSON.stringify(o,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(o,l)=>{if(!(o instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(l.charset).decode(o)))}})}),stream:Object.freeze({asReadableStream:o=>new r(o),asWritableStream:o=>new n(o)}),console,timer:Object.freeze({setTimeout(o,l,...u){const c=setTimeout(o,l,...u);return{dispose:()=>clearTimeout(c)}},setImmediate(o,...l){const u=setTimeout(o,0,...l);return{dispose:()=>clearTimeout(u)}},setInterval(o,l,...u){const c=setInterval(o,l,...u);return{dispose:()=>clearInterval(c)}}})});function s(){return a}return(function(o){function l(){t.RAL.install(a)}o.install=l})(s||(s={})),Ys.default=s,Ys}var yh;function ji(){return yh||(yh=1,(function(t){var e=nn&&nn.__createBinding||(Object.create?(function(l,u,c,f){f===void 0&&(f=c);var h=Object.getOwnPropertyDescriptor(u,c);(!h||("get"in h?!u.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return u[c]}}),Object.defineProperty(l,f,h)}):(function(l,u,c,f){f===void 0&&(f=c),l[f]=u[c]})),r=nn&&nn.__exportStar||function(l,u){for(var c in l)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&e(u,l,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,oO().default.install();const i=tf();r(tf(),t);class a extends i.AbstractMessageReader{constructor(u){super(),this._onData=new i.Emitter,this._messageListener=c=>{this._onData.fire(c.data)},u.addEventListener("error",c=>this.fireError(c)),u.onmessage=this._messageListener}listen(u){return this._onData.event(u)}}t.BrowserMessageReader=a;class s extends i.AbstractMessageWriter{constructor(u){super(),this.port=u,this.errorCount=0,u.addEventListener("error",c=>this.fireError(c))}write(u){try{return this.port.postMessage(u),Promise.resolve()}catch(c){return this.handleError(c,u),Promise.reject(c)}}handleError(u,c){this.errorCount++,this.fireError(u,c,this.errorCount)}end(){}}t.BrowserMessageWriter=s;function o(l,u,c,f){return c===void 0&&(c=i.NullLogger),i.ConnectionStrategy.is(f)&&(f={connectionStrategy:f}),(0,i.createMessageConnection)(l,u,c,f)}t.createMessageConnection=o})(nn)),nn}var nu,Th;function Rh(){return Th||(Th=1,nu=ji()),nu}var sn={};const ad=dT(ak);var Ze={},vh;function Ee(){if(vh)return Ze;vh=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.ProtocolNotificationType=Ze.ProtocolNotificationType0=Ze.ProtocolRequestType=Ze.ProtocolRequestType0=Ze.RegistrationType=Ze.MessageDirection=void 0;const t=ji();var e;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(e||(Ze.MessageDirection=e={}));class r{constructor(l){this.method=l}}Ze.RegistrationType=r;class n extends t.RequestType0{constructor(l){super(l)}}Ze.ProtocolRequestType0=n;class i extends t.RequestType{constructor(l){super(l,t.ParameterStructures.byName)}}Ze.ProtocolRequestType=i;class a extends t.NotificationType0{constructor(l){super(l)}}Ze.ProtocolNotificationType0=a;class s extends t.NotificationType{constructor(l){super(l,t.ParameterStructures.byName)}}return Ze.ProtocolNotificationType=s,Ze}var iu={},Pe={},$h;function sd(){if($h)return Pe;$h=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.objectLiteral=Pe.typedArray=Pe.stringArray=Pe.array=Pe.func=Pe.error=Pe.number=Pe.string=Pe.boolean=void 0;function t(u){return u===!0||u===!1}Pe.boolean=t;function e(u){return typeof u=="string"||u instanceof String}Pe.string=e;function r(u){return typeof u=="number"||u instanceof Number}Pe.number=r;function n(u){return u instanceof Error}Pe.error=n;function i(u){return typeof u=="function"}Pe.func=i;function a(u){return Array.isArray(u)}Pe.array=a;function s(u){return a(u)&&u.every(c=>e(c))}Pe.stringArray=s;function o(u,c){return Array.isArray(u)&&u.every(c)}Pe.typedArray=o;function l(u){return u!==null&&typeof u=="object"}return Pe.objectLiteral=l,Pe}var pa={},Ah;function lO(){if(Ah)return pa;Ah=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.ImplementationRequest=void 0;const t=Ee();var e;return(function(r){r.method="textDocument/implementation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(pa.ImplementationRequest=e={})),pa}var ha={},Eh;function uO(){if(Eh)return ha;Eh=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.TypeDefinitionRequest=void 0;const t=Ee();var e;return(function(r){r.method="textDocument/typeDefinition",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(ha.TypeDefinitionRequest=e={})),ha}var on={},Ch;function cO(){if(Ch)return on;Ch=1,Object.defineProperty(on,"__esModule",{value:!0}),on.DidChangeWorkspaceFoldersNotification=on.WorkspaceFoldersRequest=void 0;const t=Ee();var e;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(e||(on.WorkspaceFoldersRequest=e={}));var r;return(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolNotificationType(n.method)})(r||(on.DidChangeWorkspaceFoldersNotification=r={})),on}var ma={},Sh;function fO(){if(Sh)return ma;Sh=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.ConfigurationRequest=void 0;const t=Ee();var e;return(function(r){r.method="workspace/configuration",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType(r.method)})(e||(ma.ConfigurationRequest=e={})),ma}var ln={},_h;function dO(){if(_h)return ln;_h=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.ColorPresentationRequest=ln.DocumentColorRequest=void 0;const t=Ee();var e;(function(n){n.method="textDocument/documentColor",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(ln.DocumentColorRequest=e={}));var r;return(function(n){n.method="textDocument/colorPresentation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(ln.ColorPresentationRequest=r={})),ln}var un={},wh;function pO(){if(wh)return un;wh=1,Object.defineProperty(un,"__esModule",{value:!0}),un.FoldingRangeRefreshRequest=un.FoldingRangeRequest=void 0;const t=Ee();var e;(function(n){n.method="textDocument/foldingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(un.FoldingRangeRequest=e={}));var r;return(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(r||(un.FoldingRangeRefreshRequest=r={})),un}var ga={},bh;function hO(){if(bh)return ga;bh=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.DeclarationRequest=void 0;const t=Ee();var e;return(function(r){r.method="textDocument/declaration",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(ga.DeclarationRequest=e={})),ga}var ya={},Nh;function mO(){if(Nh)return ya;Nh=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.SelectionRangeRequest=void 0;const t=Ee();var e;return(function(r){r.method="textDocument/selectionRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(ya.SelectionRangeRequest=e={})),ya}var sr={},Ih;function gO(){if(Ih)return sr;Ih=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.WorkDoneProgressCancelNotification=sr.WorkDoneProgressCreateRequest=sr.WorkDoneProgress=void 0;const t=ji(),e=Ee();var r;(function(a){a.type=new t.ProgressType;function s(o){return o===a.type}a.is=s})(r||(sr.WorkDoneProgress=r={}));var n;(function(a){a.method="window/workDoneProgress/create",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType(a.method)})(n||(sr.WorkDoneProgressCreateRequest=n={}));var i;return(function(a){a.method="window/workDoneProgress/cancel",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(i||(sr.WorkDoneProgressCancelNotification=i={})),sr}var or={},Ph;function yO(){if(Ph)return or;Ph=1,Object.defineProperty(or,"__esModule",{value:!0}),or.CallHierarchyOutgoingCallsRequest=or.CallHierarchyIncomingCallsRequest=or.CallHierarchyPrepareRequest=void 0;const t=Ee();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(or.CallHierarchyPrepareRequest=e={}));var r;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(or.CallHierarchyIncomingCallsRequest=r={}));var n;return(function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(or.CallHierarchyOutgoingCallsRequest=n={})),or}var Qe={},kh;function TO(){if(kh)return Qe;kh=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.SemanticTokensRefreshRequest=Qe.SemanticTokensRangeRequest=Qe.SemanticTokensDeltaRequest=Qe.SemanticTokensRequest=Qe.SemanticTokensRegistrationType=Qe.TokenFormat=void 0;const t=Ee();var e;(function(o){o.Relative="relative"})(e||(Qe.TokenFormat=e={}));var r;(function(o){o.method="textDocument/semanticTokens",o.type=new t.RegistrationType(o.method)})(r||(Qe.SemanticTokensRegistrationType=r={}));var n;(function(o){o.method="textDocument/semanticTokens/full",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(n||(Qe.SemanticTokensRequest=n={}));var i;(function(o){o.method="textDocument/semanticTokens/full/delta",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(i||(Qe.SemanticTokensDeltaRequest=i={}));var a;(function(o){o.method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(a||(Qe.SemanticTokensRangeRequest=a={}));var s;return(function(o){o.method="workspace/semanticTokens/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(s||(Qe.SemanticTokensRefreshRequest=s={})),Qe}var Ta={},Oh;function RO(){if(Oh)return Ta;Oh=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.ShowDocumentRequest=void 0;const t=Ee();var e;return(function(r){r.method="window/showDocument",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType(r.method)})(e||(Ta.ShowDocumentRequest=e={})),Ta}var Ra={},Lh;function vO(){if(Lh)return Ra;Lh=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.LinkedEditingRangeRequest=void 0;const t=Ee();var e;return(function(r){r.method="textDocument/linkedEditingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ra.LinkedEditingRangeRequest=e={})),Ra}var qe={},xh;function $O(){if(xh)return qe;xh=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.WillDeleteFilesRequest=qe.DidDeleteFilesNotification=qe.DidRenameFilesNotification=qe.WillRenameFilesRequest=qe.DidCreateFilesNotification=qe.WillCreateFilesRequest=qe.FileOperationPatternKind=void 0;const t=Ee();var e;(function(l){l.file="file",l.folder="folder"})(e||(qe.FileOperationPatternKind=e={}));var r;(function(l){l.method="workspace/willCreateFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(r||(qe.WillCreateFilesRequest=r={}));var n;(function(l){l.method="workspace/didCreateFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(n||(qe.DidCreateFilesNotification=n={}));var i;(function(l){l.method="workspace/willRenameFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(qe.WillRenameFilesRequest=i={}));var a;(function(l){l.method="workspace/didRenameFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(a||(qe.DidRenameFilesNotification=a={}));var s;(function(l){l.method="workspace/didDeleteFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(s||(qe.DidDeleteFilesNotification=s={}));var o;return(function(l){l.method="workspace/willDeleteFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(qe.WillDeleteFilesRequest=o={})),qe}var lr={},Dh;function AO(){if(Dh)return lr;Dh=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.MonikerRequest=lr.MonikerKind=lr.UniquenessLevel=void 0;const t=Ee();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(lr.UniquenessLevel=e={}));var r;(function(i){i.$import="import",i.$export="export",i.local="local"})(r||(lr.MonikerKind=r={}));var n;return(function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(lr.MonikerRequest=n={})),lr}var ur={},Mh;function EO(){if(Mh)return ur;Mh=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.TypeHierarchySubtypesRequest=ur.TypeHierarchySupertypesRequest=ur.TypeHierarchyPrepareRequest=void 0;const t=Ee();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(ur.TypeHierarchyPrepareRequest=e={}));var r;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(ur.TypeHierarchySupertypesRequest=r={}));var n;return(function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(ur.TypeHierarchySubtypesRequest=n={})),ur}var cn={},Fh;function CO(){if(Fh)return cn;Fh=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.InlineValueRefreshRequest=cn.InlineValueRequest=void 0;const t=Ee();var e;(function(n){n.method="textDocument/inlineValue",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(cn.InlineValueRequest=e={}));var r;return(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(r||(cn.InlineValueRefreshRequest=r={})),cn}var cr={},Gh;function SO(){if(Gh)return cr;Gh=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.InlayHintRefreshRequest=cr.InlayHintResolveRequest=cr.InlayHintRequest=void 0;const t=Ee();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(cr.InlayHintRequest=e={}));var r;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(cr.InlayHintResolveRequest=r={}));var n;return(function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)})(n||(cr.InlayHintRefreshRequest=n={})),cr}var ct={},zh;function _O(){if(zh)return ct;zh=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.DiagnosticRefreshRequest=ct.WorkspaceDiagnosticRequest=ct.DocumentDiagnosticRequest=ct.DocumentDiagnosticReportKind=ct.DiagnosticServerCancellationData=void 0;const t=ji(),e=sd(),r=Ee();var n;(function(l){function u(c){const f=c;return f&&e.boolean(f.retriggerRequest)}l.is=u})(n||(ct.DiagnosticServerCancellationData=n={}));var i;(function(l){l.Full="full",l.Unchanged="unchanged"})(i||(ct.DocumentDiagnosticReportKind=i={}));var a;(function(l){l.method="textDocument/diagnostic",l.messageDirection=r.MessageDirection.clientToServer,l.type=new r.ProtocolRequestType(l.method),l.partialResult=new t.ProgressType})(a||(ct.DocumentDiagnosticRequest=a={}));var s;(function(l){l.method="workspace/diagnostic",l.messageDirection=r.MessageDirection.clientToServer,l.type=new r.ProtocolRequestType(l.method),l.partialResult=new t.ProgressType})(s||(ct.WorkspaceDiagnosticRequest=s={}));var o;return(function(l){l.method="workspace/diagnostic/refresh",l.messageDirection=r.MessageDirection.serverToClient,l.type=new r.ProtocolRequestType0(l.method)})(o||(ct.DiagnosticRefreshRequest=o={})),ct}var Re={},Uh;function wO(){if(Uh)return Re;Uh=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.DidCloseNotebookDocumentNotification=Re.DidSaveNotebookDocumentNotification=Re.DidChangeNotebookDocumentNotification=Re.NotebookCellArrayChange=Re.DidOpenNotebookDocumentNotification=Re.NotebookDocumentSyncRegistrationType=Re.NotebookDocument=Re.NotebookCell=Re.ExecutionSummary=Re.NotebookCellKind=void 0;const t=ad,e=sd(),r=Ee();var n;(function(p){p.Markup=1,p.Code=2;function y(A){return A===1||A===2}p.is=y})(n||(Re.NotebookCellKind=n={}));var i;(function(p){function y(C,S){const _={executionOrder:C};return(S===!0||S===!1)&&(_.success=S),_}p.create=y;function A(C){const S=C;return e.objectLiteral(S)&&t.uinteger.is(S.executionOrder)&&(S.success===void 0||e.boolean(S.success))}p.is=A;function N(C,S){return C===S?!0:C==null||S===null||S===void 0?!1:C.executionOrder===S.executionOrder&&C.success===S.success}p.equals=N})(i||(Re.ExecutionSummary=i={}));var a;(function(p){function y(S,_){return{kind:S,document:_}}p.create=y;function A(S){const _=S;return e.objectLiteral(_)&&n.is(_.kind)&&t.DocumentUri.is(_.document)&&(_.metadata===void 0||e.objectLiteral(_.metadata))}p.is=A;function N(S,_){const k=new Set;return S.document!==_.document&&k.add("document"),S.kind!==_.kind&&k.add("kind"),S.executionSummary!==_.executionSummary&&k.add("executionSummary"),(S.metadata!==void 0||_.metadata!==void 0)&&!C(S.metadata,_.metadata)&&k.add("metadata"),(S.executionSummary!==void 0||_.executionSummary!==void 0)&&!i.equals(S.executionSummary,_.executionSummary)&&k.add("executionSummary"),k}p.diff=N;function C(S,_){if(S===_)return!0;if(S==null||_===null||_===void 0||typeof S!=typeof _||typeof S!="object")return!1;const k=Array.isArray(S),K=Array.isArray(_);if(k!==K)return!1;if(k&&K){if(S.length!==_.length)return!1;for(let H=0;H<S.length;H++)if(!C(S[H],_[H]))return!1}if(e.objectLiteral(S)&&e.objectLiteral(_)){const H=Object.keys(S),J=Object.keys(_);if(H.length!==J.length||(H.sort(),J.sort(),!C(H,J)))return!1;for(let oe=0;oe<H.length;oe++){const me=H[oe];if(!C(S[me],_[me]))return!1}}return!0}})(a||(Re.NotebookCell=a={}));var s;(function(p){function y(N,C,S,_){return{uri:N,notebookType:C,version:S,cells:_}}p.create=y;function A(N){const C=N;return e.objectLiteral(C)&&e.string(C.uri)&&t.integer.is(C.version)&&e.typedArray(C.cells,a.is)}p.is=A})(s||(Re.NotebookDocument=s={}));var o;(function(p){p.method="notebookDocument/sync",p.messageDirection=r.MessageDirection.clientToServer,p.type=new r.RegistrationType(p.method)})(o||(Re.NotebookDocumentSyncRegistrationType=o={}));var l;(function(p){p.method="notebookDocument/didOpen",p.messageDirection=r.MessageDirection.clientToServer,p.type=new r.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(l||(Re.DidOpenNotebookDocumentNotification=l={}));var u;(function(p){function y(N){const C=N;return e.objectLiteral(C)&&t.uinteger.is(C.start)&&t.uinteger.is(C.deleteCount)&&(C.cells===void 0||e.typedArray(C.cells,a.is))}p.is=y;function A(N,C,S){const _={start:N,deleteCount:C};return S!==void 0&&(_.cells=S),_}p.create=A})(u||(Re.NotebookCellArrayChange=u={}));var c;(function(p){p.method="notebookDocument/didChange",p.messageDirection=r.MessageDirection.clientToServer,p.type=new r.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(c||(Re.DidChangeNotebookDocumentNotification=c={}));var f;(function(p){p.method="notebookDocument/didSave",p.messageDirection=r.MessageDirection.clientToServer,p.type=new r.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(f||(Re.DidSaveNotebookDocumentNotification=f={}));var h;return(function(p){p.method="notebookDocument/didClose",p.messageDirection=r.MessageDirection.clientToServer,p.type=new r.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(h||(Re.DidCloseNotebookDocumentNotification=h={})),Re}var va={},jh;function bO(){if(jh)return va;jh=1,Object.defineProperty(va,"__esModule",{value:!0}),va.InlineCompletionRequest=void 0;const t=Ee();var e;return(function(r){r.method="textDocument/inlineCompletion",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(va.InlineCompletionRequest=e={})),va}var qh;function NO(){return qh||(qh=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=Ee(),r=ad,n=sd(),i=lO();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const a=uO();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const s=cO();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const o=fO();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const l=dO();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const u=pO();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const c=hO();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return c.DeclarationRequest}});const f=mO();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const h=gO();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return h.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return h.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return h.WorkDoneProgressCancelNotification}});const p=yO();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const y=TO();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return y.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return y.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return y.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return y.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return y.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return y.SemanticTokensRegistrationType}});const A=RO();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return A.ShowDocumentRequest}});const N=vO();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return N.LinkedEditingRangeRequest}});const C=$O();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return C.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return C.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return C.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return C.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return C.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return C.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return C.WillDeleteFilesRequest}});const S=AO();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return S.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return S.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return S.MonikerRequest}});const _=EO();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return _.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return _.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return _.TypeHierarchySupertypesRequest}});const k=CO();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return k.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return k.InlineValueRefreshRequest}});const K=SO();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return K.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return K.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return K.InlayHintRefreshRequest}});const H=_O();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return H.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return H.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return H.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return H.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return H.DiagnosticRefreshRequest}});const J=wO();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return J.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return J.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return J.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return J.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return J.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return J.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidCloseNotebookDocumentNotification}});const oe=bO();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return oe.InlineCompletionRequest}});var me;(function(d){function be(Ne){const V=Ne;return n.string(V)||n.string(V.language)||n.string(V.scheme)||n.string(V.pattern)}d.is=be})(me||(t.TextDocumentFilter=me={}));var ge;(function(d){function be(Ne){const V=Ne;return n.objectLiteral(V)&&(n.string(V.notebookType)||n.string(V.scheme)||n.string(V.pattern))}d.is=be})(ge||(t.NotebookDocumentFilter=ge={}));var I;(function(d){function be(Ne){const V=Ne;return n.objectLiteral(V)&&(n.string(V.notebook)||ge.is(V.notebook))&&(V.language===void 0||n.string(V.language))}d.is=be})(I||(t.NotebookCellTextDocumentFilter=I={}));var v;(function(d){function be(Ne){if(!Array.isArray(Ne))return!1;for(let V of Ne)if(!n.string(V)&&!me.is(V)&&!I.is(V))return!1;return!0}d.is=be})(v||(t.DocumentSelector=v={}));var g;(function(d){d.method="client/registerCapability",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(g||(t.RegistrationRequest=g={}));var w;(function(d){d.method="client/unregisterCapability",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(w||(t.UnregistrationRequest=w={}));var T;(function(d){d.Create="create",d.Rename="rename",d.Delete="delete"})(T||(t.ResourceOperationKind=T={}));var R;(function(d){d.Abort="abort",d.Transactional="transactional",d.TextOnlyTransactional="textOnlyTransactional",d.Undo="undo"})(R||(t.FailureHandlingKind=R={}));var E;(function(d){d.UTF8="utf-8",d.UTF16="utf-16",d.UTF32="utf-32"})(E||(t.PositionEncodingKind=E={}));var L;(function(d){function be(Ne){const V=Ne;return V&&n.string(V.id)&&V.id.length>0}d.hasId=be})(L||(t.StaticRegistrationOptions=L={}));var D;(function(d){function be(Ne){const V=Ne;return V&&(V.documentSelector===null||v.is(V.documentSelector))}d.is=be})(D||(t.TextDocumentRegistrationOptions=D={}));var x;(function(d){function be(V){const m=V;return n.objectLiteral(m)&&(m.workDoneProgress===void 0||n.boolean(m.workDoneProgress))}d.is=be;function Ne(V){const m=V;return m&&n.boolean(m.workDoneProgress)}d.hasWorkDoneProgress=Ne})(x||(t.WorkDoneProgressOptions=x={}));var U;(function(d){d.method="initialize",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(U||(t.InitializeRequest=U={}));var F;(function(d){d.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var ae;(function(d){d.method="initialized",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(ae||(t.InitializedNotification=ae={}));var q;(function(d){d.method="shutdown",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType0(d.method)})(q||(t.ShutdownRequest=q={}));var ne;(function(d){d.method="exit",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType0(d.method)})(ne||(t.ExitNotification=ne={}));var ze;(function(d){d.method="workspace/didChangeConfiguration",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(ze||(t.DidChangeConfigurationNotification=ze={}));var Ce;(function(d){d.Error=1,d.Warning=2,d.Info=3,d.Log=4,d.Debug=5})(Ce||(t.MessageType=Ce={}));var ye;(function(d){d.method="window/showMessage",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(ye||(t.ShowMessageNotification=ye={}));var xe;(function(d){d.method="window/showMessageRequest",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(xe||(t.ShowMessageRequest=xe={}));var Ue;(function(d){d.method="window/logMessage",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(Ue||(t.LogMessageNotification=Ue={}));var ke;(function(d){d.method="telemetry/event",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(ke||(t.TelemetryEventNotification=ke={}));var ee;(function(d){d.None=0,d.Full=1,d.Incremental=2})(ee||(t.TextDocumentSyncKind=ee={}));var ut;(function(d){d.method="textDocument/didOpen",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(ut||(t.DidOpenTextDocumentNotification=ut={}));var Se;(function(d){function be(V){let m=V;return m!=null&&typeof m.text=="string"&&m.range!==void 0&&(m.rangeLength===void 0||typeof m.rangeLength=="number")}d.isIncremental=be;function Ne(V){let m=V;return m!=null&&typeof m.text=="string"&&m.range===void 0&&m.rangeLength===void 0}d.isFull=Ne})(Se||(t.TextDocumentContentChangeEvent=Se={}));var St;(function(d){d.method="textDocument/didChange",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(St||(t.DidChangeTextDocumentNotification=St={}));var Gn;(function(d){d.method="textDocument/didClose",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Gn||(t.DidCloseTextDocumentNotification=Gn={}));var Bi;(function(d){d.method="textDocument/didSave",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Bi||(t.DidSaveTextDocumentNotification=Bi={}));var Wi;(function(d){d.Manual=1,d.AfterDelay=2,d.FocusOut=3})(Wi||(t.TextDocumentSaveReason=Wi={}));var Ki;(function(d){d.method="textDocument/willSave",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Ki||(t.WillSaveTextDocumentNotification=Ki={}));var Vi;(function(d){d.method="textDocument/willSaveWaitUntil",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Vi||(t.WillSaveTextDocumentWaitUntilRequest=Vi={}));var _t;(function(d){d.method="workspace/didChangeWatchedFiles",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(_t||(t.DidChangeWatchedFilesNotification=_t={}));var Hi;(function(d){d.Created=1,d.Changed=2,d.Deleted=3})(Hi||(t.FileChangeType=Hi={}));var vs;(function(d){function be(Ne){const V=Ne;return n.objectLiteral(V)&&(r.URI.is(V.baseUri)||r.WorkspaceFolder.is(V.baseUri))&&n.string(V.pattern)}d.is=be})(vs||(t.RelativePattern=vs={}));var $s;(function(d){d.Create=1,d.Change=2,d.Delete=4})($s||(t.WatchKind=$s={}));var As;(function(d){d.method="textDocument/publishDiagnostics",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(As||(t.PublishDiagnosticsNotification=As={}));var Es;(function(d){d.Invoked=1,d.TriggerCharacter=2,d.TriggerForIncompleteCompletions=3})(Es||(t.CompletionTriggerKind=Es={}));var Yi;(function(d){d.method="textDocument/completion",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Yi||(t.CompletionRequest=Yi={}));var Xi;(function(d){d.method="completionItem/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Xi||(t.CompletionResolveRequest=Xi={}));var er;(function(d){d.method="textDocument/hover",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(er||(t.HoverRequest=er={}));var Ji;(function(d){d.Invoked=1,d.TriggerCharacter=2,d.ContentChange=3})(Ji||(t.SignatureHelpTriggerKind=Ji={}));var Cs;(function(d){d.method="textDocument/signatureHelp",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Cs||(t.SignatureHelpRequest=Cs={}));var Ss;(function(d){d.method="textDocument/definition",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Ss||(t.DefinitionRequest=Ss={}));var Zi;(function(d){d.method="textDocument/references",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Zi||(t.ReferencesRequest=Zi={}));var Qi;(function(d){d.method="textDocument/documentHighlight",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Qi||(t.DocumentHighlightRequest=Qi={}));var _s;(function(d){d.method="textDocument/documentSymbol",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(_s||(t.DocumentSymbolRequest=_s={}));var ws;(function(d){d.method="textDocument/codeAction",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ws||(t.CodeActionRequest=ws={}));var bs;(function(d){d.method="codeAction/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(bs||(t.CodeActionResolveRequest=bs={}));var Ns;(function(d){d.method="workspace/symbol",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Ns||(t.WorkspaceSymbolRequest=Ns={}));var Is;(function(d){d.method="workspaceSymbol/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Is||(t.WorkspaceSymbolResolveRequest=Is={}));var Ps;(function(d){d.method="textDocument/codeLens",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Ps||(t.CodeLensRequest=Ps={}));var wt;(function(d){d.method="codeLens/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(wt||(t.CodeLensResolveRequest=wt={}));var ks;(function(d){d.method="workspace/codeLens/refresh",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType0(d.method)})(ks||(t.CodeLensRefreshRequest=ks={}));var Os;(function(d){d.method="textDocument/documentLink",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Os||(t.DocumentLinkRequest=Os={}));var Zr;(function(d){d.method="documentLink/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Zr||(t.DocumentLinkResolveRequest=Zr={}));var Ls;(function(d){d.method="textDocument/formatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Ls||(t.DocumentFormattingRequest=Ls={}));var zn;(function(d){d.method="textDocument/rangeFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(zn||(t.DocumentRangeFormattingRequest=zn={}));var xs;(function(d){d.method="textDocument/rangesFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(xs||(t.DocumentRangesFormattingRequest=xs={}));var tr;(function(d){d.method="textDocument/onTypeFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(tr||(t.DocumentOnTypeFormattingRequest=tr={}));var xr;(function(d){d.Identifier=1})(xr||(t.PrepareSupportDefaultBehavior=xr={}));var Ds;(function(d){d.method="textDocument/rename",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Ds||(t.RenameRequest=Ds={}));var Ms;(function(d){d.method="textDocument/prepareRename",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Ms||(t.PrepareRenameRequest=Ms={}));var Dr;(function(d){d.method="workspace/executeCommand",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Dr||(t.ExecuteCommandRequest=Dr={}));var ea;(function(d){d.method="workspace/applyEdit",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType("workspace/applyEdit")})(ea||(t.ApplyWorkspaceEditRequest=ea={}))})(iu)),iu}var $a={},Bh;function IO(){if(Bh)return $a;Bh=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.createProtocolConnection=void 0;const t=ji();function e(r,n,i,a){return t.ConnectionStrategy.is(a)&&(a={connectionStrategy:a}),(0,t.createMessageConnection)(r,n,i,a)}return $a.createProtocolConnection=e,$a}var Wh;function PO(){return Wh||(Wh=1,(function(t){var e=sn&&sn.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=sn&&sn.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(ji(),t),r(ad,t),r(Ee(),t),r(NO(),t);var n=IO();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return n.createProtocolConnection}});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))})(sn)),sn}var Kh;function kO(){return Kh||(Kh=1,(function(t){var e=rn&&rn.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=rn&&rn.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const n=Rh();r(Rh(),t),r(PO(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}t.createProtocolConnection=i})(rn)),rn}var Xs=kO(),Fa;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(Fa||(Fa={}));class OO{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new ts,this.documentPhaseListeners=new ts,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Y.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=Ae.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===Y.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,Y.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=Y.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=Y.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Ae.CancellationToken.None){this.currentState=Y.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const c of u)i.push(c.uri),this.cleanUpDeleted(c)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=Y.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Y.Changed)}const s=ve(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,Y.ComputedScopes)),await this.emitUpdate(a,i),await et(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state<Y.Validated||!((u=this.buildState.get(l.uri.toString()))!=null&&u.completed)||this.resultsAreIncomplete(l,this.updateBuildOptions)}).toArray());await this.buildDocuments(o,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return ve(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){var r;return!!((r=this.textDocuments)!=null&&r.get(e.uri))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Fa.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Y.Changed:case Y.Parsed:this.indexManager.removeContent(e.uri);case Y.IndexedContent:e.localSymbols=void 0;case Y.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Y.Linked:this.indexManager.removeReferences(e.uri);case Y.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Y.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Y.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Y.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Y.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Y.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,Y.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,Y.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,Y.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.state<r&&(await et(n),await i(s),s.state=r,await this.notifyDocumentPhase(s,r,n));const a=e.filter(s=>s.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Fa.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Fa.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Ae.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(oi);if(this.currentState>=e&&e>i.state)return Promise.reject(new Xs.ResponseError(Xs.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Y[i.state]}, requiring ${Y[e]}, but workspace state is already ${Y[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Xs.ResponseError(Xs.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{pt.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(oi)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(oi):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(oi)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await et(n),await s(e,n)}catch(o){if(!Ll(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await et(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=ve(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}}class LO{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Gk,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=yr(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{pt.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ve(i)}allElements(e,r){let n=ve(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(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=Ae.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=Ae.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}class xO{constructor(e){this.initialBuildOptions={},this._ready=new id,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=Ae.CancellationToken.None){const n=await this.performStartup(e);await et(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=ve(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Ot.parse(e.uri)}async traverseFolder(e,r){try{const 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){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=pt.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class DO{buildUnexpectedCharactersMessage(e,r,n,i,a){return Uu.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return Uu.buildUnableToPopLexerModeMessage(e)}}const MO={mode:"full"};class FO{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=Vh(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new nt(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=MO){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(Vh(e))return e;const r=Dy(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function GO(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function Dy(t){return t&&"modes"in t&&"defaultMode"in t}function Vh(t){return!GO(t)&&!Dy(t)}function zO(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=re.create(0,0));const a=My(t),s=od(n),o=qO({lines:a,position:i,options:s});return HO({index:0,tokens:o,position:i})}function UO(t,e){const r=od(e),n=My(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}function My(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(QT)}const Hh=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,jO=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function qO(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o<t.lines.length;o++){const l=o===0,u=o===t.lines.length-1;let c=t.lines[o],f=0;if(l&&t.options.start){const p=(i=t.options.start)==null?void 0:i.exec(c);p&&(f=p.index+p[0].length)}else{const p=(a=t.options.line)==null?void 0:a.exec(c);p&&(f=p.index+p[0].length)}if(u){const p=(s=t.options.end)==null?void 0:s.exec(c);p&&(c=c.substring(0,p.index))}if(c=c.substring(0,VO(c)),rf(c,f)>=c.length){if(e.length>0){const p=re.create(r,n);e.push({type:"break",content:"",range:X.create(p,p)})}}else{Hh.lastIndex=f;const p=Hh.exec(c);if(p){const y=p[0],A=p[1],N=re.create(r,n+f),C=re.create(r,n+f+y.length);e.push({type:"tag",content:A,range:X.create(N,C)}),f+=y.length,f=rf(c,f)}if(f<c.length){const y=c.substring(f),A=Array.from(y.matchAll(jO));e.push(...BO(A,y,r,n+f))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function BO(t,e,r,n){const i=[];if(t.length===0){const a=re.create(r,n),s=re.create(r,n+e.length);i.push({type:"text",content:e,range:X.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:X.create(re.create(r,a+n),re.create(r,l+n))});let c=u.length+1;const f=o[1];if(i.push({type:"inline-tag",content:f,range:X.create(re.create(r,a+c+n),re.create(r,a+c+f.length+n))}),c+=f.length,o.length===4){c+=o[2].length;const h=o[3];i.push({type:"text",content:h,range:X.create(re.create(r,a+c+n),re.create(r,a+c+h.length+n))})}else i.push({type:"text",content:"",range:X.create(re.create(r,a+c+n),re.create(r,a+c+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:X.create(re.create(r,a+n),re.create(r,a+n+s.length))})}return i}const WO=/\S/,KO=/\s*$/;function rf(t,e){const r=t.substring(e).match(WO);return r?e+r.index:t.length}function VO(t){const e=t.match(KO);if(e&&typeof e.index=="number")return e.index}function HO(t){var a,s;const e=re.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Yh([],X.create(e,e));const r=[];for(;t.index<t.tokens.length;){const o=YO(t,r[r.length-1]);o&&r.push(o)}const n=((a=r[0])==null?void 0:a.range.start)??e,i=((s=r[r.length-1])==null?void 0:s.range.end)??e;return new Yh(r,X.create(n,i))}function YO(t,e){const r=t.tokens[t.index];if(r.type==="tag")return Gy(t,!1);if(r.type==="text"||r.type==="inline-tag")return Fy(t);XO(r,e),t.index++}function XO(t,e){if(e){const r=new Uy("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function Fy(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(JO(t)),n=e,e=t.tokens[t.index];return new nf(i,X.create(r.range.start,n.range.end))}function JO(t){return t.tokens[t.index].type==="inline-tag"?Gy(t,!0):zy(t)}function Gy(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const a=zy(t);return new su(n,new nf([a],a.range),e,X.create(r.range.start,a.range.end))}else{const a=Fy(t);return new su(n,a,e,X.create(r.range.start,a.range.end))}else{const a=r.range;return new su(n,new nf([],a),e,a)}}function zy(t){const e=t.tokens[t.index++];return new Uy(e.content,e.range)}function od(t){if(!t)return od({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:au(e,!0),end:au(r,!1),line:au(n,!0)}}function au(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?nl(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class Yh{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=Xh(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=Xh(r)+i}return r.trim()}}class su{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
152
+ ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=ZO(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i}
153
+ ${r}`),this.inline?`{${i}}`:i}}function ZO(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=rf(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??QO(e,a)}}function QO(t,e){try{return Ot.parse(t,!0),`[${e}](${t})`}catch{return t}}class nf{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
154
+ `)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const i=this.inlines[n],a=this.inlines[n+1];r+=i.toMarkdown(e),a&&a.range.start.line>i.range.start.line&&(r+=`
155
+ `)}return r}}class Uy{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}}function Xh(t){return t.endsWith(`
156
+ `)?`
157
+ `:`
158
+
159
+ `}class eL{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&UO(r))return zO(r).toMarkdown({renderLink:(i,a)=>this.documentationLinkRenderer(e,i,a),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=yr(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}}class tL{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return jk(e)?e.$comment:(r=HT(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}}class rL{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class nL{constructor(){this.previousTokenSource=new Ae.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=wk();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Ae.CancellationToken.None){const i=new id,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const 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{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Ll(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class iL{constructor(e){this.grammarElementIdMap=new nh,this.tokenTypeIdMap=new nh,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){const r=new Map,n=new Map;for(const i of Tr(e))r.set(i,{});if(e.$cstNode)for(const i of _u(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const 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(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Xe(o)?s.push(this.dehydrateAstNode(o,r)):Pt(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Xe(a)?n[i]=this.dehydrateAstNode(a,r):Pt(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return hm(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Ga(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):pm(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){const 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){const r=new Map,n=new Map;for(const a of Tr(e))r.set(a,{});let i;if(e.$cstNode)for(const a of _u(e.$cstNode)){let s;"fullText"in a?(s=new Ry(a.fullText),i=s):"content"in a?s=new td:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const 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(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Xe(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):Pt(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Xe(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):Pt(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);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){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Ga(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new Yc(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}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(const r of Tr(this.grammar))ST(r)&&this.grammarElementIdMap.set(r,e++)}}function Jt(t){return{documentation:{CommentProvider:e=>new tL(e),DocumentationProvider:e=>new eL(e)},parser:{AsyncParser:e=>new rL(e),GrammarConfig:e=>$R(e),LangiumParser:e=>Ek(e),CompletionParser:e=>Ak(e),ValueConverter:()=>new by,TokenBuilder:()=>new wy,Lexer:e=>new FO(e),ParserErrorMessageProvider:()=>new Ay,LexerErrorMessageProvider:()=>new DO},workspace:{AstNodeLocator:()=>new Zk,AstNodeDescriptionProvider:e=>new Xk(e),ReferenceDescriptionProvider:e=>new Jk(e)},references:{Linker:e=>new kk(e),NameProvider:()=>new Lk,ScopeProvider:e=>new Uk(e),ScopeComputation:e=>new Dk(e),References:e=>new xk(e)},serializer:{Hydrator:e=>new iL(e),JsonSerializer:e=>new qk(e)},validation:{DocumentValidator:e=>new Vk(e),ValidationRegistry:e=>new Wk(e)},shared:()=>t.shared}}function Zt(t){return{ServiceRegistry:e=>new Bk(e),workspace:{LangiumDocuments:e=>new Pk(e),LangiumDocumentFactory:e=>new Ik(e),DocumentBuilder:e=>new OO(e),IndexManager:e=>new LO(e),WorkspaceManager:e=>new xO(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new nL,ConfigurationProvider:e=>new eO(e)},profilers:{}}}var Jh;(function(t){t.merge=(e,r)=>rs(rs({},e),r)})(Jh||(Jh={}));function Le(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(rs,{});return jy(u)}const aL=Symbol("isProxy");function jy(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===aL?!0:Qh(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(Qh(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const Zh=Symbol();function Qh(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]===Zh)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){const i=r[e];t[e]=Zh;try{t[e]=typeof i=="function"?i(n):jy(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function rs(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=rs(i,n):t[r]=rs({},n)}else t[r]=n}return t}class sL{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[]}}const Qt={fileSystemProvider:()=>new sL},oL={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},lL={AstReflection:()=>new vm};function uL(){const t=Le(Zt(Qt),lL),e=Le(Jt({shared:t}),oL);return t.ServiceRegistry.register(e),e}function kr(t){const e=uL(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Ot.parse(`memory:/${r.name??"grammar"}.langium`)),r}var cL=Object.defineProperty,P=(t,e)=>cL(t,"name",{value:e,configurable:!0}),af;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(af||(af={}));var sf;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(sf||(sf={}));var of;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(of||(of={}));var lf;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(lf||(lf={}));var uf;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(uf||(uf={}));var cf;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cf||(cf={}));var ff;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(ff||(ff={}));var df;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,STRING2:/"[^"]*"|'[^']*'/}})(df||(df={}));var pf;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+</,LINK_ARROW:/-->|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z][A-Za-z0-9_()&]*(?:[ \t]+[A-Za-z(][A-Za-z0-9_()&]*)*/,WS:/[ \t]+/,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:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,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]*/}})(pf||(pf={}));({...af.Terminals,...sf.Terminals,...of.Terminals,...lf.Terminals,...uf.Terminals,...cf.Terminals,...df.Terminals,...ff.Terminals,...pf.Terminals});var Js={$type:"Accelerator",name:"name",x:"x",y:"y"},Zs={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},Aa={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},ou={$type:"Annotations",x:"x",y:"y"},dr={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function fL(t){return Ct.isInstance(t,dr.$type)}P(fL,"isArchitecture");var Qs={$type:"Axis",label:"label",name:"name"},Ao={$type:"Branch",name:"name",order:"order"};function dL(t){return Ct.isInstance(t,Ao.$type)}P(dL,"isBranch");var em={$type:"Checkout",branch:"branch"},eo={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},lu={$type:"ClassDefStatement",className:"className",styleText:"styleText"},ti={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function pL(t){return Ct.isInstance(t,ti.$type)}P(pL,"isCommit");var fn={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},to={$type:"Curve",entries:"entries",label:"label",name:"name"},ro={$type:"Deaccelerator",name:"name",x:"x",y:"y"},tm={$type:"Decorator",strategy:"strategy"},Bn={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Ft={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},uu={$type:"Entry",axis:"axis",value:"value"},rm={$type:"Evolution",stages:"stages"},no={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},cu={$type:"Evolve",component:"component",target:"target"},Tn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function hL(t){return Ct.isInstance(t,Tn.$type)}P(hL,"isGitGraph");var Ea={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},xa={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function mL(t){return Ct.isInstance(t,xa.$type)}P(mL,"isInfo");var Ca={$type:"Item",classSelector:"classSelector",name:"name"},fu={$type:"Junction",id:"id",in:"in"},Sa={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},io={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},dn={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},ri={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function gL(t){return Ct.isInstance(t,ri.$type)}P(gL,"isMerge");var ao={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},du={$type:"Option",name:"name",value:"value"},ni={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function yL(t){return Ct.isInstance(t,ni.$type)}P(yL,"isPacket");var ii={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function TL(t){return Ct.isInstance(t,ii.$type)}P(TL,"isPacketBlock");var Rn={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function RL(t){return Ct.isInstance(t,Rn.$type)}P(RL,"isPie");var Eo={$type:"PieSection",label:"label",value:"value"};function vL(t){return Ct.isInstance(t,Eo.$type)}P(vL,"isPieSection");var pu={$type:"Pipeline",components:"components",parent:"parent"},so={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},pn={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},hu={$type:"Section",classSelector:"classSelector",name:"name"},Wn={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},mu={$type:"Size",height:"height",width:"width"},Kn={$type:"Statement"},ai={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function $L(t){return Ct.isInstance(t,ai.$type)}P($L,"isTreemap");var gu={$type:"TreemapRow",indent:"indent",item:"item"},yu={$type:"TreeNode",indent:"indent",name:"name"},_a={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Be={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function AL(t){return Ct.isInstance(t,Be.$type)}P(AL,"isWardley");var ci,qy=(ci=class extends dm{constructor(){super(...arguments),this.types={Accelerator:{name:Js.$type,properties:{name:{name:Js.name},x:{name:Js.x},y:{name:Js.y}},superTypes:[]},Anchor:{name:Zs.$type,properties:{evolution:{name:Zs.evolution},name:{name:Zs.name},visibility:{name:Zs.visibility}},superTypes:[]},Annotation:{name:Aa.$type,properties:{number:{name:Aa.number},text:{name:Aa.text},x:{name:Aa.x},y:{name:Aa.y}},superTypes:[]},Annotations:{name:ou.$type,properties:{x:{name:ou.x},y:{name:ou.y}},superTypes:[]},Architecture:{name:dr.$type,properties:{accDescr:{name:dr.accDescr},accTitle:{name:dr.accTitle},edges:{name:dr.edges,defaultValue:[]},groups:{name:dr.groups,defaultValue:[]},junctions:{name:dr.junctions,defaultValue:[]},services:{name:dr.services,defaultValue:[]},title:{name:dr.title}},superTypes:[]},Axis:{name:Qs.$type,properties:{label:{name:Qs.label},name:{name:Qs.name}},superTypes:[]},Branch:{name:Ao.$type,properties:{name:{name:Ao.name},order:{name:Ao.order}},superTypes:[Kn.$type]},Checkout:{name:em.$type,properties:{branch:{name:em.branch}},superTypes:[Kn.$type]},CherryPicking:{name:eo.$type,properties:{id:{name:eo.id},parent:{name:eo.parent},tags:{name:eo.tags,defaultValue:[]}},superTypes:[Kn.$type]},ClassDefStatement:{name:lu.$type,properties:{className:{name:lu.className},styleText:{name:lu.styleText}},superTypes:[]},Commit:{name:ti.$type,properties:{id:{name:ti.id},message:{name:ti.message},tags:{name:ti.tags,defaultValue:[]},type:{name:ti.type}},superTypes:[Kn.$type]},Component:{name:fn.$type,properties:{decorator:{name:fn.decorator},evolution:{name:fn.evolution},inertia:{name:fn.inertia,defaultValue:!1},label:{name:fn.label},name:{name:fn.name},visibility:{name:fn.visibility}},superTypes:[]},Curve:{name:to.$type,properties:{entries:{name:to.entries,defaultValue:[]},label:{name:to.label},name:{name:to.name}},superTypes:[]},Deaccelerator:{name:ro.$type,properties:{name:{name:ro.name},x:{name:ro.x},y:{name:ro.y}},superTypes:[]},Decorator:{name:tm.$type,properties:{strategy:{name:tm.strategy}},superTypes:[]},Direction:{name:Bn.$type,properties:{accDescr:{name:Bn.accDescr},accTitle:{name:Bn.accTitle},dir:{name:Bn.dir},statements:{name:Bn.statements,defaultValue:[]},title:{name:Bn.title}},superTypes:[Tn.$type]},Edge:{name:Ft.$type,properties:{lhsDir:{name:Ft.lhsDir},lhsGroup:{name:Ft.lhsGroup,defaultValue:!1},lhsId:{name:Ft.lhsId},lhsInto:{name:Ft.lhsInto,defaultValue:!1},rhsDir:{name:Ft.rhsDir},rhsGroup:{name:Ft.rhsGroup,defaultValue:!1},rhsId:{name:Ft.rhsId},rhsInto:{name:Ft.rhsInto,defaultValue:!1},title:{name:Ft.title}},superTypes:[]},Entry:{name:uu.$type,properties:{axis:{name:uu.axis,referenceType:Qs.$type},value:{name:uu.value}},superTypes:[]},Evolution:{name:rm.$type,properties:{stages:{name:rm.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:no.$type,properties:{boundary:{name:no.boundary},name:{name:no.name},secondName:{name:no.secondName}},superTypes:[]},Evolve:{name:cu.$type,properties:{component:{name:cu.component},target:{name:cu.target}},superTypes:[]},GitGraph:{name:Tn.$type,properties:{accDescr:{name:Tn.accDescr},accTitle:{name:Tn.accTitle},statements:{name:Tn.statements,defaultValue:[]},title:{name:Tn.title}},superTypes:[]},Group:{name:Ea.$type,properties:{icon:{name:Ea.icon},id:{name:Ea.id},in:{name:Ea.in},title:{name:Ea.title}},superTypes:[]},Info:{name:xa.$type,properties:{accDescr:{name:xa.accDescr},accTitle:{name:xa.accTitle},title:{name:xa.title}},superTypes:[]},Item:{name:Ca.$type,properties:{classSelector:{name:Ca.classSelector},name:{name:Ca.name}},superTypes:[]},Junction:{name:fu.$type,properties:{id:{name:fu.id},in:{name:fu.in}},superTypes:[]},Label:{name:Sa.$type,properties:{negX:{name:Sa.negX,defaultValue:!1},negY:{name:Sa.negY,defaultValue:!1},offsetX:{name:Sa.offsetX},offsetY:{name:Sa.offsetY}},superTypes:[]},Leaf:{name:io.$type,properties:{classSelector:{name:io.classSelector},name:{name:io.name},value:{name:io.value}},superTypes:[Ca.$type]},Link:{name:dn.$type,properties:{arrow:{name:dn.arrow},from:{name:dn.from},fromPort:{name:dn.fromPort},linkLabel:{name:dn.linkLabel},to:{name:dn.to},toPort:{name:dn.toPort}},superTypes:[]},Merge:{name:ri.$type,properties:{branch:{name:ri.branch},id:{name:ri.id},tags:{name:ri.tags,defaultValue:[]},type:{name:ri.type}},superTypes:[Kn.$type]},Note:{name:ao.$type,properties:{evolution:{name:ao.evolution},text:{name:ao.text},visibility:{name:ao.visibility}},superTypes:[]},Option:{name:du.$type,properties:{name:{name:du.name},value:{name:du.value,defaultValue:!1}},superTypes:[]},Packet:{name:ni.$type,properties:{accDescr:{name:ni.accDescr},accTitle:{name:ni.accTitle},blocks:{name:ni.blocks,defaultValue:[]},title:{name:ni.title}},superTypes:[]},PacketBlock:{name:ii.$type,properties:{bits:{name:ii.bits},end:{name:ii.end},label:{name:ii.label},start:{name:ii.start}},superTypes:[]},Pie:{name:Rn.$type,properties:{accDescr:{name:Rn.accDescr},accTitle:{name:Rn.accTitle},sections:{name:Rn.sections,defaultValue:[]},showData:{name:Rn.showData,defaultValue:!1},title:{name:Rn.title}},superTypes:[]},PieSection:{name:Eo.$type,properties:{label:{name:Eo.label},value:{name:Eo.value}},superTypes:[]},Pipeline:{name:pu.$type,properties:{components:{name:pu.components,defaultValue:[]},parent:{name:pu.parent}},superTypes:[]},PipelineComponent:{name:so.$type,properties:{evolution:{name:so.evolution},label:{name:so.label},name:{name:so.name}},superTypes:[]},Radar:{name:pn.$type,properties:{accDescr:{name:pn.accDescr},accTitle:{name:pn.accTitle},axes:{name:pn.axes,defaultValue:[]},curves:{name:pn.curves,defaultValue:[]},options:{name:pn.options,defaultValue:[]},title:{name:pn.title}},superTypes:[]},Section:{name:hu.$type,properties:{classSelector:{name:hu.classSelector},name:{name:hu.name}},superTypes:[Ca.$type]},Service:{name:Wn.$type,properties:{icon:{name:Wn.icon},iconText:{name:Wn.iconText},id:{name:Wn.id},in:{name:Wn.in},title:{name:Wn.title}},superTypes:[]},Size:{name:mu.$type,properties:{height:{name:mu.height},width:{name:mu.width}},superTypes:[]},Statement:{name:Kn.$type,properties:{},superTypes:[]},TreeNode:{name:yu.$type,properties:{indent:{name:yu.indent},name:{name:yu.name}},superTypes:[]},TreeView:{name:_a.$type,properties:{accDescr:{name:_a.accDescr},accTitle:{name:_a.accTitle},nodes:{name:_a.nodes,defaultValue:[]},title:{name:_a.title}},superTypes:[]},Treemap:{name:ai.$type,properties:{accDescr:{name:ai.accDescr},accTitle:{name:ai.accTitle},title:{name:ai.title},TreemapRows:{name:ai.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:gu.$type,properties:{indent:{name:gu.indent},item:{name:gu.item}},superTypes:[]},Wardley:{name:Be.$type,properties:{accDescr:{name:Be.accDescr},accelerators:{name:Be.accelerators,defaultValue:[]},accTitle:{name:Be.accTitle},anchors:{name:Be.anchors,defaultValue:[]},annotation:{name:Be.annotation,defaultValue:[]},annotations:{name:Be.annotations,defaultValue:[]},components:{name:Be.components,defaultValue:[]},deaccelerators:{name:Be.deaccelerators,defaultValue:[]},evolution:{name:Be.evolution},evolves:{name:Be.evolves,defaultValue:[]},links:{name:Be.links,defaultValue:[]},notes:{name:Be.notes,defaultValue:[]},pipelines:{name:Be.pipelines,defaultValue:[]},size:{name:Be.size},title:{name:Be.title}},superTypes:[]}}}},P(ci,"MermaidAstReflection"),ci),Ct=new qy,nm,EL=P(()=>nm??(nm=kr(`{"$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"),im,CL=P(()=>im??(im=kr(`{"$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"),am,SL=P(()=>am??(am=kr(`{"$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"),sm,_L=P(()=>sm??(sm=kr(`{"$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"),om,wL=P(()=>om??(om=kr(`{"$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"),lm,bL=P(()=>lm??(lm=kr(`{"$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"),um,NL=P(()=>um??(um=kr(`{"$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"),cm,IL=P(()=>cm??(cm=kr(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$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":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$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":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@9"}}},"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 * TreeView grammar for Langium\\n * Converted from treemap 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 * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),fm,PL=P(()=>fm??(fm=kr(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"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":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'</","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'>/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z][A-Za-z0-9_()&]*(?:[ \\\\t]+[A-Za-z(][A-Za-z0-9_()&]*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"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@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"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@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"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":[]}`)),"WardleyGrammarGrammar"),kL={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},OL={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},LL={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xL={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},DL={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ML={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},FL={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},GL={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zL={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Or={AstReflection:P(()=>new qy,"AstReflection")},UL={Grammar:P(()=>EL(),"Grammar"),LanguageMetaData:P(()=>kL,"LanguageMetaData"),parser:{}},jL={Grammar:P(()=>CL(),"Grammar"),LanguageMetaData:P(()=>OL,"LanguageMetaData"),parser:{}},qL={Grammar:P(()=>SL(),"Grammar"),LanguageMetaData:P(()=>LL,"LanguageMetaData"),parser:{}},BL={Grammar:P(()=>_L(),"Grammar"),LanguageMetaData:P(()=>xL,"LanguageMetaData"),parser:{}},WL={Grammar:P(()=>wL(),"Grammar"),LanguageMetaData:P(()=>DL,"LanguageMetaData"),parser:{}},KL={Grammar:P(()=>bL(),"Grammar"),LanguageMetaData:P(()=>ML,"LanguageMetaData"),parser:{}},VL={Grammar:P(()=>NL(),"Grammar"),LanguageMetaData:P(()=>FL,"LanguageMetaData"),parser:{}},HL={Grammar:P(()=>IL(),"Grammar"),LanguageMetaData:P(()=>GL,"LanguageMetaData"),parser:{}},YL={Grammar:P(()=>PL(),"Grammar"),LanguageMetaData:P(()=>zL,"LanguageMetaData"),parser:{}},XL=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,JL=/accTitle[\t ]*:([^\n\r]*)/,ZL=/title([\t ][^\n\r]*|)/,QL={ACC_DESCR:XL,ACC_TITLE:JL,TITLE:ZL},fi,qi=(fi=class extends by{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){const i=QL[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
160
+ `)}}},P(fi,"AbstractMermaidValueConverter"),fi),di,xl=(di=class extends qi{runCustomConverter(e,r,n){}},P(di,"CommonValueConverter"),di),pi,Lr=(pi=class extends wy{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},P(pi,"AbstractMermaidTokenBuilder"),pi),hi;hi=class extends Lr{},P(hi,"CommonTokenBuilder");var mi,ex=(mi=class extends Lr{constructor(){super(["treemap"])}},P(mi,"TreemapTokenBuilder"),mi),tx=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,gi,rx=(gi=class extends qi{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=tx.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},P(gi,"TreemapValueConverter"),gi);function By(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}P(By,"registerValidationChecks");var yi,nx=(yi=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},P(yi,"TreemapValidator"),yi),Wy={parser:{TokenBuilder:P(()=>new ex,"TokenBuilder"),ValueConverter:P(()=>new rx,"ValueConverter")},validation:{TreemapValidator:P(()=>new nx,"TreemapValidator")}};function Ky(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),VL,Wy);return e.ServiceRegistry.register(r),By(r),{shared:e,Treemap:r}}P(Ky,"createTreemapServices");var Ti,ix=(Ti=class extends qi{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},P(Ti,"WardleyValueConverter"),Ti),Vy={parser:{ValueConverter:P(()=>new ix,"ValueConverter")}};function Hy(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),YL,Vy);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}P(Hy,"createWardleyServices");var Ri,ax=(Ri=class extends Lr{constructor(){super(["gitGraph"])}},P(Ri,"GitGraphTokenBuilder"),Ri),Yy={parser:{TokenBuilder:P(()=>new ax,"TokenBuilder"),ValueConverter:P(()=>new xl,"ValueConverter")}};function Xy(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),jL,Yy);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}P(Xy,"createGitGraphServices");var vi,sx=(vi=class extends Lr{constructor(){super(["info","showInfo"])}},P(vi,"InfoTokenBuilder"),vi),Jy={parser:{TokenBuilder:P(()=>new sx,"TokenBuilder"),ValueConverter:P(()=>new xl,"ValueConverter")}};function Zy(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),qL,Jy);return e.ServiceRegistry.register(r),{shared:e,Info:r}}P(Zy,"createInfoServices");var $i,ox=($i=class extends Lr{constructor(){super(["packet"])}},P($i,"PacketTokenBuilder"),$i),Qy={parser:{TokenBuilder:P(()=>new ox,"TokenBuilder"),ValueConverter:P(()=>new xl,"ValueConverter")}};function eT(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),BL,Qy);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}P(eT,"createPacketServices");var Ai,lx=(Ai=class extends Lr{constructor(){super(["pie","showData"])}},P(Ai,"PieTokenBuilder"),Ai),Ei,ux=(Ei=class extends qi{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},P(Ei,"PieValueConverter"),Ei),tT={parser:{TokenBuilder:P(()=>new lx,"TokenBuilder"),ValueConverter:P(()=>new ux,"ValueConverter")}};function rT(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),WL,tT);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}P(rT,"createPieServices");var Ci,cx=(Ci=class extends qi{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="STRING2")return r.substring(1,r.length-1)}},P(Ci,"TreeViewValueConverter"),Ci),Si,fx=(Si=class extends Lr{constructor(){super(["treeView-beta"])}},P(Si,"TreeViewTokenBuilder"),Si),nT={parser:{TokenBuilder:P(()=>new fx,"TokenBuilder"),ValueConverter:P(()=>new cx,"ValueConverter")}};function iT(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),HL,nT);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}P(iT,"createTreeViewServices");var _i,dx=(_i=class extends Lr{constructor(){super(["architecture"])}},P(_i,"ArchitectureTokenBuilder"),_i),wi,px=(wi=class extends qi{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},P(wi,"ArchitectureValueConverter"),wi),aT={parser:{TokenBuilder:P(()=>new dx,"TokenBuilder"),ValueConverter:P(()=>new px,"ValueConverter")}};function sT(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),UL,aT);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}P(sT,"createArchitectureServices");var bi,hx=(bi=class extends Lr{constructor(){super(["radar-beta"])}},P(bi,"RadarTokenBuilder"),bi),oT={parser:{TokenBuilder:P(()=>new hx,"TokenBuilder"),ValueConverter:P(()=>new xl,"ValueConverter")}};function lT(t=Qt){const e=Le(Zt(t),Or),r=Le(Jt({shared:e}),KL,oT);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}P(lT,"createRadarServices");var Nt={},mx={info:P(async()=>{const{createInfoServices:t}=await rr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>Tx);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;Nt.info=e},"info"),packet:P(async()=>{const{createPacketServices:t}=await rr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>Rx);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;Nt.packet=e},"packet"),pie:P(async()=>{const{createPieServices:t}=await rr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>vx);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;Nt.pie=e},"pie"),treeView:P(async()=>{const{createTreeViewServices:t}=await rr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>$x);return{createTreeViewServices:r}},void 0),e=t().TreeView.parser.LangiumParser;Nt.treeView=e},"treeView"),architecture:P(async()=>{const{createArchitectureServices:t}=await rr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>Ax);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;Nt.architecture=e},"architecture"),gitGraph:P(async()=>{const{createGitGraphServices:t}=await rr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>Ex);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;Nt.gitGraph=e},"gitGraph"),radar:P(async()=>{const{createRadarServices:t}=await rr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>Cx);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;Nt.radar=e},"radar"),treemap:P(async()=>{const{createTreemapServices:t}=await rr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Sx);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;Nt.treemap=e},"treemap"),wardley:P(async()=>{const{createWardleyServices:t}=await rr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>_x);return{createWardleyServices:r}},void 0),e=t().Wardley.parser.LangiumParser;Nt.wardley=e},"wardley")};async function gx(t,e){const r=mx[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Nt[t]||await r();const i=Nt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new yx(i);return i.value}P(gx,"parse");var Ni,yx=(Ni=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(`
161
+ `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(`
162
+ `);super(`Parsing failed: ${r} ${n}`),this.result=e}},P(Ni,"MermaidParseError"),Ni);const Tx=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:Jy,createInfoServices:Zy},Symbol.toStringTag,{value:"Module"})),Rx=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Qy,createPacketServices:eT},Symbol.toStringTag,{value:"Module"})),vx=Object.freeze(Object.defineProperty({__proto__:null,PieModule:tT,createPieServices:rT},Symbol.toStringTag,{value:"Module"})),$x=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:nT,createTreeViewServices:iT},Symbol.toStringTag,{value:"Module"})),Ax=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:aT,createArchitectureServices:sT},Symbol.toStringTag,{value:"Module"})),Ex=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Yy,createGitGraphServices:Xy},Symbol.toStringTag,{value:"Module"})),Cx=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:oT,createRadarServices:lT},Symbol.toStringTag,{value:"Module"})),Sx=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Wy,createTreemapServices:Ky},Symbol.toStringTag,{value:"Module"})),_x=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:Vy,createWardleyServices:Hy},Symbol.toStringTag,{value:"Module"}));export{gx as p};