termbeam 1.18.0 → 1.19.0

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 (85) hide show
  1. package/package.json +4 -1
  2. package/public/assets/{_basePickBy-CVn0rIeA.js → _basePickBy-CPjv_JEU.js} +1 -1
  3. package/public/assets/{_baseUniq-D-ViDZI1.js → _baseUniq-BtieUu_k.js} +1 -1
  4. package/public/assets/{arc-BWX7iih_.js → arc-Op_Jfgj1.js} +1 -1
  5. package/public/assets/architectureDiagram-Q4EWVU46-BPBC-sFg.js +36 -0
  6. package/public/assets/{blockDiagram-WCTKOSBZ-RZQh_7bp.js → blockDiagram-DXYQGD6D-bhrY5jZb.js} +6 -6
  7. package/public/assets/c4Diagram-AHTNJAMY-Bbj59C07.js +10 -0
  8. package/public/assets/channel-BqlgTU2z.js +1 -0
  9. package/public/assets/{chunk-4BX2VUAB-Cz0Sexay.js → chunk-4BX2VUAB-NTfL5dnQ.js} +1 -1
  10. package/public/assets/chunk-4TB4RGXK-DI71V5fB.js +206 -0
  11. package/public/assets/{chunk-55IACEB6-DhjD4VKO.js → chunk-55IACEB6-DErzjt0v.js} +1 -1
  12. package/public/assets/{chunk-KX2RTZJC-BU-NTTwY.js → chunk-EDXVE4YY-D_8mpmH-.js} +1 -1
  13. package/public/assets/{chunk-FMBD7UC4-H_1l13Rz.js → chunk-FMBD7UC4-DxKx7vX-.js} +1 -1
  14. package/public/assets/chunk-OYMX7WX6-DWu1iUFO.js +231 -0
  15. package/public/assets/{chunk-QZHKN3VN-CrSItx1v.js → chunk-QZHKN3VN-Cnf_5dAG.js} +1 -1
  16. package/public/assets/{chunk-JSJVCQXG-D_GdzPQn.js → chunk-YZCP3GAM-mW6tkOzW.js} +1 -1
  17. package/public/assets/classDiagram-6PBFFD2Q-BUz6cVs_.js +1 -0
  18. package/public/assets/classDiagram-v2-HSJHXN6E-BUz6cVs_.js +1 -0
  19. package/public/assets/clone-RMCUsgPf.js +1 -0
  20. package/public/assets/{cose-bilkent-S5V4N54A-BNYNzK1p.js → cose-bilkent-S5V4N54A-913I4PUt.js} +1 -1
  21. package/public/assets/{dagre-KLK3FWXG-CvP5MaIU.js → dagre-KV5264BT-BDwVAKyX.js} +2 -2
  22. package/public/assets/diagram-5BDNPKRD-OcJJ0e9j.js +10 -0
  23. package/public/assets/diagram-G4DWMVQ6-Dm20tH1B.js +24 -0
  24. package/public/assets/diagram-MMDJMWI5-D-cm46Bv.js +43 -0
  25. package/public/assets/{diagram-P4PSJMXO-D7EqFseu.js → diagram-TYMM5635-CbPn6K5D.js} +1 -1
  26. package/public/assets/erDiagram-SMLLAGMA-4AUfKRLi.js +85 -0
  27. package/public/assets/flowDiagram-DWJPFMVM-BJ4qWDVH.js +162 -0
  28. package/public/assets/{ganttDiagram-A5KZAMGK-C55hiPqb.js → ganttDiagram-T4ZO3ILL-_q7m5Uo2.js} +4 -4
  29. package/public/assets/gitGraphDiagram-UUTBAWPF-Ctcn_coL.js +106 -0
  30. package/public/assets/{graph-mq5DkKwp.js → graph-mh6uBCte.js} +1 -1
  31. package/public/assets/index-2RolNYEW.css +32 -0
  32. package/public/assets/index-CuJ2Kdhb.js +447 -0
  33. package/public/assets/{infoDiagram-LFFYTUFH-Cisyfr_w.js → infoDiagram-42DDH7IO-Cbl2ZkB4.js} +1 -1
  34. package/public/assets/{ishikawaDiagram-PHBUUO56-BjaKmPoV.js → ishikawaDiagram-UXIWVN3A-Buq4uztC.js} +2 -2
  35. package/public/assets/journeyDiagram-VCZTEJTY-CLs6SdFG.js +139 -0
  36. package/public/assets/{kanban-definition-K7BYSVSG-D9TVNfL2.js → kanban-definition-6JOO6SKY-CflX5gNH.js} +8 -8
  37. package/public/assets/{layout-DIfi_3Cg.js → layout-e9E0SnY2.js} +1 -1
  38. package/public/assets/{linear-CNFortHj.js → linear-Bue4Zf_D.js} +1 -1
  39. package/public/assets/mindmap-definition-QFDTVHPH-B8iZj3K3.js +96 -0
  40. package/public/assets/pieDiagram-DEJITSTG-B5dciSBP.js +30 -0
  41. package/public/assets/{quadrantDiagram-337W2JSQ-Dcj0avLR.js → quadrantDiagram-34T5L4WZ-CZaQCVxe.js} +1 -1
  42. package/public/assets/requirementDiagram-MS252O5E-2wYKQi_y.js +84 -0
  43. package/public/assets/{sankeyDiagram-WA2Y5GQK-CpT1bDmZ.js → sankeyDiagram-XADWPNL6-CX5Cdm9d.js} +1 -1
  44. package/public/assets/sequenceDiagram-FGHM5R23-BUWxC38t.js +157 -0
  45. package/public/assets/stateDiagram-FHFEXIEX-85EGIrQk.js +1 -0
  46. package/public/assets/stateDiagram-v2-QKLJ7IA2-OKhwT9tv.js +1 -0
  47. package/public/assets/timeline-definition-GMOUNBTQ-C3BtHzdG.js +120 -0
  48. package/public/assets/{vennDiagram-LZ73GAT5-Ci8AKqD1.js → vennDiagram-DHZGUBPP-Chw5is4z.js} +5 -5
  49. package/public/assets/wardley-RL74JXVD-FEtUMcEE.js +162 -0
  50. package/public/assets/wardleyDiagram-NUSXRM2D-C_sFSy0G.js +20 -0
  51. package/public/assets/xychartDiagram-5P7HB3ND-C9Qs21NZ.js +7 -0
  52. package/public/index.html +2 -2
  53. package/public/sw.js +2 -2
  54. package/src/server/index.js +5 -49
  55. package/src/server/routes.js +59 -72
  56. package/src/server/sessions.js +20 -0
  57. package/src/tunnel/index.js +4 -6
  58. package/src/utils/agent-sessions.js +210 -0
  59. package/src/utils/agents.js +116 -0
  60. package/src/utils/update-check.js +19 -0
  61. package/public/assets/architectureDiagram-2XIMDMQ5-Dr3bqfT2.js +0 -36
  62. package/public/assets/c4Diagram-IC4MRINW-BM1jg1mo.js +0 -10
  63. package/public/assets/channel-N7LACYfb.js +0 -1
  64. package/public/assets/chunk-NQ4KR5QH-_X3IQmYu.js +0 -220
  65. package/public/assets/chunk-WL4C6EOR-XtpH4KKr.js +0 -189
  66. package/public/assets/classDiagram-VBA2DB6C-Ct_F3N6M.js +0 -1
  67. package/public/assets/classDiagram-v2-RAHNMMFH-Ct_F3N6M.js +0 -1
  68. package/public/assets/clone-DfaqXUXL.js +0 -1
  69. package/public/assets/diagram-E7M64L7V-C1ypW2kT.js +0 -24
  70. package/public/assets/diagram-IFDJBPK2-CH5mcu6V.js +0 -43
  71. package/public/assets/erDiagram-INFDFZHY-Dc_91GQC.js +0 -70
  72. package/public/assets/flowDiagram-PKNHOUZH-wUw5Mjvb.js +0 -162
  73. package/public/assets/gitGraphDiagram-K3NZZRJ6-D3HBxR11.js +0 -65
  74. package/public/assets/index-BxVq7AYs.js +0 -394
  75. package/public/assets/index-Cpm34cTy.css +0 -32
  76. package/public/assets/journeyDiagram-4ABVD52K-BNP3C6Ph.js +0 -139
  77. package/public/assets/mindmap-definition-YRQLILUH-CfNe7W8X.js +0 -68
  78. package/public/assets/pieDiagram-SKSYHLDU-C3T1FeFD.js +0 -30
  79. package/public/assets/requirementDiagram-Z7DCOOCP-D4yTZU0p.js +0 -73
  80. package/public/assets/sequenceDiagram-2WXFIKYE-CPsVjHHb.js +0 -145
  81. package/public/assets/stateDiagram-RAJIS63D-CbB0QqSa.js +0 -1
  82. package/public/assets/stateDiagram-v2-FVOUBMTO-CQnYvVz1.js +0 -1
  83. package/public/assets/timeline-definition-YZTLITO2-Bi12ioU0.js +0 -61
  84. package/public/assets/treemap-KZPCXAKY-Ct-pligZ.js +0 -162
  85. package/public/assets/xychartDiagram-JWTSCODW-BsOGuDAL.js +0 -7
@@ -0,0 +1,162 @@
1
+ var fp=Object.defineProperty;var dp=(t,e,r)=>e in t?fp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var gr=(t,e,r)=>dp(t,typeof e!="symbol"?e+"":e,r);import{bE as hp,bF as pp,aY as rd,bo as mp,b0 as gp,aZ as Be,at as yp,au as Ju,be as Tp,bh as nd,bi as id,bf as Rp,bt as Zu,aw as en,ax as se,a_ as vp,aU as Ep,bG as $p,bH as jt}from"./index-CuJ2Kdhb.js";import{k as Hn,j as Cu,g as ti,S as Ap,w as Cp,x as Sp,c as ad,v as Le,y as sd,l as kp,z as wp,A as Np,B as bp,C as _p,a as od,d as U,i as sr,r as Ze,f as pt,D as ze}from"./_baseUniq-BtieUu_k.js";import{j as Su,m as M,d as Ip,f as Tt,g as Yn,h as j,i as ku,l as Kr,e as Pp}from"./_basePickBy-CPjv_JEU.js";import{c as Ve}from"./clone-RMCUsgPf.js";var Lp=Object.prototype,Op=Lp.hasOwnProperty,ht=hp(function(t,e){if(pp(e)||rd(e)){mp(e,Hn(e),t);return}for(var r in e)Op.call(e,r)&&gp(t,r,e[r])});function ld(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 ha(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}function xp(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 Dp(t,e,r,n){return Cu(t,function(i,a,s){e(n,i,r(i),s)}),n}function Mp(t,e){return function(r,n){var i=Be(r)?xp:Dp,a=e?e():{};return i(r,t,ti(n),a)}}var Gp=200;function Fp(t,e,r,n){var i=-1,a=Cp,s=!0,o=t.length,l=[],u=e.length;if(!o)return l;e.length>=Gp&&(a=Sp,s=!1,e=new Ap(e));e:for(;++i<o;){var c=t[i],d=c;if(c=c!==0?c:0,s&&d===d){for(var g=u;g--;)if(e[g]===d)continue e;l.push(c)}else a(e,d,n)||l.push(c)}return l}var Vs=yp(function(t,e){return Ju(t)?Fp(t,ad(e,1,Ju,!0)):[]});function Ue(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:Su(e),ld(t,e<0?0:e,n)):[]}function ea(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:Su(e),e=n-e,ld(t,0,e<0?0:e)):[]}function zp(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 Up(t,e){var r=!0;return Cu(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function wt(t,e,r){var n=Be(t)?zp:Up;return n(t,ti(e))}function bt(t){return t&&t.length?t[0]:void 0}function dt(t,e){return ad(M(t,e))}var qp=Object.prototype,jp=qp.hasOwnProperty,Bp=Mp(function(t,e,r){jp.call(t,r)?t[r].push(e):Tp(t,r,[e])}),Wp="[object String]";function nt(t){return typeof t=="string"||!Be(t)&&nd(t)&&id(t)==Wp}var Vp=Math.max;function tt(t,e,r,n){t=rd(t)?t:Le(t),r=r?Su(r):0;var i=t.length;return r<0&&(r=Vp(i+r,0)),nt(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&sd(t,e,r)>-1}function Qu(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=0;return sd(t,e,i)}var Kp="[object RegExp]";function Hp(t){return nd(t)&&id(t)==Kp}var ec=Zu&&Zu.isRegExp,or=ec?Rp(ec):Hp,Yp="Expected a function";function Xp(t){if(typeof t!="function")throw new TypeError(Yp);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 _t(t,e){if(t==null)return{};var r=kp(wp(t),function(n){return[n]});return e=ti(e),Ip(t,r,function(n,i){return e(n,i[0])})}function Ks(t,e){var r=Be(t)?Np:bp;return r(t,Xp(ti(e)))}function Jp(t,e){var r;return Cu(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function ud(t,e,r){var n=Be(t)?_p:Jp;return n(t,ti(e))}function wu(t){return t&&t.length?od(t):[]}function Zp(t,e){return t&&t.length?od(t,ti(e)):[]}function Ke(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function kt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function Tr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function Qp(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function vi(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class cd{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 Ke(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 ta(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function fd(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function dd(t){return ta(t)&&typeof t.fullText=="string"}class qe{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 qe(()=>({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 ct})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=em(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 qe(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ct:{done:!1,value:e(i)}})}filter(e){return new qe(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ct})}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 qe(()=>({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(As(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ct})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new qe(()=>({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(As(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ct})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new qe(()=>{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 qe(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ct:this.nextFn(r.state)))}distinct(e){return new qe(()=>({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 ct})}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 em(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function As(t){return!!t&&typeof t[Symbol.iterator]=="function"}const hd=new qe(()=>{},()=>ct),ct=Object.freeze({done:!0,value:void 0});function ge(...t){if(t.length===1){const e=t[0];if(e instanceof qe)return e;if(As(e))return new qe(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new qe(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:ct)}return t.length>1?new qe(()=>({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++];As(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return ct}):hd}class Nu extends qe{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 ct})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Fo;(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})(Fo||(Fo={}));function zo(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Ke(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&zo(i,e))}):Ke(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&zo(n,e)))}function Hs(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function nr(t){const r=ls(t).$document;if(!r)throw new Error("AST node has no document.");return r}function ls(t){for(;t.$container;)t=t.$container;return t}function tc(t){return kt(t)?t.ref?[t.ref]:[]:Tr(t)?t.items.map(e=>e.ref):[]}function bu(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new qe(()=>({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(Ke(a)){if(n.keyIndex++,rc(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(Ke(o)&&rc(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return ct})}function pa(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Nu(t,r=>bu(r,e))}function ir(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Nu(t,r=>bu(r,e),{includeRoot:!0})}function rc(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?Am(r,e):!1}function Cs(t){return new qe(()=>({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(kt(n)||Tr(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(kt(a)||Tr(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return ct})}function tm(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]=pd(i.defaultValue))}function pd(t){return Array.isArray(t)?[...t.map(pd)]:t}const ut={$type:"AbstractElement",cardinality:"cardinality"};function rm(t){return ee.isInstance(t,ut.$type)}const us={$type:"AbstractParserRule"};function ma(t){return ee.isInstance(t,us.$type)}const Ua={$type:"AbstractRule"},At={$type:"AbstractType"},Fr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ys(t){return ee.isInstance(t,Fr.$type)}const cs={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function md(t){return ee.isInstance(t,cs.$type)}const nc={$type:"ArrayLiteral",elements:"elements"},ic={$type:"ArrayType",elementType:"elementType"},zr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Hr(t){return ee.isInstance(t,zr.$type)}const Uo={$type:"BooleanLiteral",true:"true"};function nm(t){return ee.isInstance(t,Uo.$type)}const Ur={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function im(t){return ee.isInstance(t,Ur.$type)}const sn={$type:"Condition"},fs={$type:"Conjunction",left:"left",right:"right"};function am(t){return ee.isInstance(t,fs.$type)}const qr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Xs(t){return ee.isInstance(t,qr.$type)}const ds={$type:"Disjunction",left:"left",right:"right"};function sm(t){return ee.isInstance(t,ds.$type)}const qo={$type:"EndOfFile",cardinality:"cardinality"};function om(t){return ee.isInstance(t,qo.$type)}const Sr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},ac={$type:"GrammarImport",path:"path"},dn={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function _u(t){return ee.isInstance(t,dn.$type)}const jo={$type:"InferredType",name:"name"};function gd(t){return ee.isInstance(t,jo.$type)}const Zt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Ss(t){return ee.isInstance(t,Zt.$type)}const uo={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},sc={$type:"InfixRuleOperators",precedences:"precedences"},Bi={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function lm(t){return ee.isInstance(t,Bi.$type)}const Wi={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Yr(t){return ee.isInstance(t,Wi.$type)}const qa={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},hn={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function um(t){return ee.isInstance(t,hn.$type)}const Bo={$type:"Negation",value:"value"};function cm(t){return ee.isInstance(t,Bo.$type)}const oc={$type:"NumberLiteral",value:"value"},ja={$type:"Parameter",name:"name"},Wo={$type:"ParameterReference",parameter:"parameter"};function fm(t){return ee.isInstance(t,Wo.$type)}const Lt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function ur(t){return ee.isInstance(t,Lt.$type)}const co={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},pn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function dm(t){return ee.isInstance(t,pn.$type)}const Vo={$type:"ReturnType",name:"name"};function hm(t){return ee.isInstance(t,Vo.$type)}const mn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Xr(t){return ee.isInstance(t,mn.$type)}const Vi={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function pm(t){return ee.isInstance(t,Vi.$type)}const lc={$type:"StringLiteral",value:"value"},gn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function mm(t){return ee.isInstance(t,gn.$type)}const yt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},yn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function gm(t){return ee.isInstance(t,yn.$type)}const yr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function cr(t){return ee.isInstance(t,yr.$type)}const Tn={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function ym(t){return ee.isInstance(t,Tn.$type)}const hs={$type:"Type",name:"name",type:"type"};function Tm(t){return ee.isInstance(t,hs.$type)}const Ei={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},$i={$type:"TypeDefinition"},uc={$type:"UnionType",types:"types"},ps={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function yd(t){return ee.isInstance(t,ps.$type)}const Rn={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Rm(t){return ee.isInstance(t,Rn.$type)}const Ai={$type:"ValueLiteral"},Ki={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function vm(t){return ee.isInstance(t,Ki.$type)}class Td extends cd{constructor(){super(...arguments),this.types={AbstractElement:{name:ut.$type,properties:{cardinality:{name:ut.cardinality}},superTypes:[]},AbstractParserRule:{name:us.$type,properties:{},superTypes:[Ua.$type,At.$type]},AbstractRule:{name:Ua.$type,properties:{},superTypes:[]},AbstractType:{name:At.$type,properties:{},superTypes:[]},Action:{name:Fr.$type,properties:{cardinality:{name:Fr.cardinality},feature:{name:Fr.feature},inferredType:{name:Fr.inferredType},operator:{name:Fr.operator},type:{name:Fr.type,referenceType:At.$type}},superTypes:[ut.$type]},Alternatives:{name:cs.$type,properties:{cardinality:{name:cs.cardinality},elements:{name:cs.elements,defaultValue:[]}},superTypes:[ut.$type]},ArrayLiteral:{name:nc.$type,properties:{elements:{name:nc.elements,defaultValue:[]}},superTypes:[Ai.$type]},ArrayType:{name:ic.$type,properties:{elementType:{name:ic.elementType}},superTypes:[$i.$type]},Assignment:{name:zr.$type,properties:{cardinality:{name:zr.cardinality},feature:{name:zr.feature},operator:{name:zr.operator},predicate:{name:zr.predicate},terminal:{name:zr.terminal}},superTypes:[ut.$type]},BooleanLiteral:{name:Uo.$type,properties:{true:{name:Uo.true,defaultValue:!1}},superTypes:[sn.$type,Ai.$type]},CharacterRange:{name:Ur.$type,properties:{cardinality:{name:Ur.cardinality},left:{name:Ur.left},lookahead:{name:Ur.lookahead},parenthesized:{name:Ur.parenthesized,defaultValue:!1},right:{name:Ur.right}},superTypes:[yt.$type]},Condition:{name:sn.$type,properties:{},superTypes:[]},Conjunction:{name:fs.$type,properties:{left:{name:fs.left},right:{name:fs.right}},superTypes:[sn.$type]},CrossReference:{name:qr.$type,properties:{cardinality:{name:qr.cardinality},deprecatedSyntax:{name:qr.deprecatedSyntax,defaultValue:!1},isMulti:{name:qr.isMulti,defaultValue:!1},terminal:{name:qr.terminal},type:{name:qr.type,referenceType:At.$type}},superTypes:[ut.$type]},Disjunction:{name:ds.$type,properties:{left:{name:ds.left},right:{name:ds.right}},superTypes:[sn.$type]},EndOfFile:{name:qo.$type,properties:{cardinality:{name:qo.cardinality}},superTypes:[ut.$type]},Grammar:{name:Sr.$type,properties:{imports:{name:Sr.imports,defaultValue:[]},interfaces:{name:Sr.interfaces,defaultValue:[]},isDeclared:{name:Sr.isDeclared,defaultValue:!1},name:{name:Sr.name},rules:{name:Sr.rules,defaultValue:[]},types:{name:Sr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:ac.$type,properties:{path:{name:ac.path}},superTypes:[]},Group:{name:dn.$type,properties:{cardinality:{name:dn.cardinality},elements:{name:dn.elements,defaultValue:[]},guardCondition:{name:dn.guardCondition},predicate:{name:dn.predicate}},superTypes:[ut.$type]},InferredType:{name:jo.$type,properties:{name:{name:jo.name}},superTypes:[At.$type]},InfixRule:{name:Zt.$type,properties:{call:{name:Zt.call},dataType:{name:Zt.dataType},inferredType:{name:Zt.inferredType},name:{name:Zt.name},operators:{name:Zt.operators},parameters:{name:Zt.parameters,defaultValue:[]},returnType:{name:Zt.returnType,referenceType:At.$type}},superTypes:[us.$type]},InfixRuleOperatorList:{name:uo.$type,properties:{associativity:{name:uo.associativity},operators:{name:uo.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:sc.$type,properties:{precedences:{name:sc.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Bi.$type,properties:{attributes:{name:Bi.attributes,defaultValue:[]},name:{name:Bi.name},superTypes:{name:Bi.superTypes,defaultValue:[],referenceType:At.$type}},superTypes:[At.$type]},Keyword:{name:Wi.$type,properties:{cardinality:{name:Wi.cardinality},predicate:{name:Wi.predicate},value:{name:Wi.value}},superTypes:[ut.$type]},NamedArgument:{name:qa.$type,properties:{calledByName:{name:qa.calledByName,defaultValue:!1},parameter:{name:qa.parameter,referenceType:ja.$type},value:{name:qa.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:Bo.$type,properties:{value:{name:Bo.value}},superTypes:[sn.$type]},NumberLiteral:{name:oc.$type,properties:{value:{name:oc.value}},superTypes:[Ai.$type]},Parameter:{name:ja.$type,properties:{name:{name:ja.name}},superTypes:[]},ParameterReference:{name:Wo.$type,properties:{parameter:{name:Wo.parameter,referenceType:ja.$type}},superTypes:[sn.$type]},ParserRule:{name:Lt.$type,properties:{dataType:{name:Lt.dataType},definition:{name:Lt.definition},entry:{name:Lt.entry,defaultValue:!1},fragment:{name:Lt.fragment,defaultValue:!1},inferredType:{name:Lt.inferredType},name:{name:Lt.name},parameters:{name:Lt.parameters,defaultValue:[]},returnType:{name:Lt.returnType,referenceType:At.$type}},superTypes:[us.$type]},ReferenceType:{name:co.$type,properties:{isMulti:{name:co.isMulti,defaultValue:!1},referenceType:{name:co.referenceType}},superTypes:[$i.$type]},RegexToken:{name:pn.$type,properties:{cardinality:{name:pn.cardinality},lookahead:{name:pn.lookahead},parenthesized:{name:pn.parenthesized,defaultValue:!1},regex:{name:pn.regex}},superTypes:[yt.$type]},ReturnType:{name:Vo.$type,properties:{name:{name:Vo.name}},superTypes:[]},RuleCall:{name:mn.$type,properties:{arguments:{name:mn.arguments,defaultValue:[]},cardinality:{name:mn.cardinality},predicate:{name:mn.predicate},rule:{name:mn.rule,referenceType:Ua.$type}},superTypes:[ut.$type]},SimpleType:{name:Vi.$type,properties:{primitiveType:{name:Vi.primitiveType},stringType:{name:Vi.stringType},typeRef:{name:Vi.typeRef,referenceType:At.$type}},superTypes:[$i.$type]},StringLiteral:{name:lc.$type,properties:{value:{name:lc.value}},superTypes:[Ai.$type]},TerminalAlternatives:{name:gn.$type,properties:{cardinality:{name:gn.cardinality},elements:{name:gn.elements,defaultValue:[]},lookahead:{name:gn.lookahead},parenthesized:{name:gn.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:[ut.$type]},TerminalGroup:{name:yn.$type,properties:{cardinality:{name:yn.cardinality},elements:{name:yn.elements,defaultValue:[]},lookahead:{name:yn.lookahead},parenthesized:{name:yn.parenthesized,defaultValue:!1}},superTypes:[yt.$type]},TerminalRule:{name:yr.$type,properties:{definition:{name:yr.definition},fragment:{name:yr.fragment,defaultValue:!1},hidden:{name:yr.hidden,defaultValue:!1},name:{name:yr.name},type:{name:yr.type}},superTypes:[Ua.$type]},TerminalRuleCall:{name:Tn.$type,properties:{cardinality:{name:Tn.cardinality},lookahead:{name:Tn.lookahead},parenthesized:{name:Tn.parenthesized,defaultValue:!1},rule:{name:Tn.rule,referenceType:yr.$type}},superTypes:[yt.$type]},Type:{name:hs.$type,properties:{name:{name:hs.name},type:{name:hs.type}},superTypes:[At.$type]},TypeAttribute:{name:Ei.$type,properties:{defaultValue:{name:Ei.defaultValue},isOptional:{name:Ei.isOptional,defaultValue:!1},name:{name:Ei.name},type:{name:Ei.type}},superTypes:[]},TypeDefinition:{name:$i.$type,properties:{},superTypes:[]},UnionType:{name:uc.$type,properties:{types:{name:uc.types,defaultValue:[]}},superTypes:[$i.$type]},UnorderedGroup:{name:ps.$type,properties:{cardinality:{name:ps.cardinality},elements:{name:ps.elements,defaultValue:[]}},superTypes:[ut.$type]},UntilToken:{name:Rn.$type,properties:{cardinality:{name:Rn.cardinality},lookahead:{name:Rn.lookahead},parenthesized:{name:Rn.parenthesized,defaultValue:!1},terminal:{name:Rn.terminal}},superTypes:[yt.$type]},ValueLiteral:{name:Ai.$type,properties:{},superTypes:[]},Wildcard:{name:Ki.$type,properties:{cardinality:{name:Ki.cardinality},lookahead:{name:Ki.lookahead},parenthesized:{name:Ki.parenthesized,defaultValue:!1}},superTypes:[yt.$type]}}}}const ee=new Td;function Ko(t){return new Nu(t,e=>ta(e)?e.content:[],{includeRoot:!0})}function Em(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Ho(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function ks(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var tr;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(tr||(tr={}));function $m(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return tr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return tr.After;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?tr.Inside:r?tr.OverlapBack:n?tr.OverlapFront:tr.Outside}function Am(t,e){return $m(t,e)>tr.After}const Cm=/^[\w\p{L}]$/u;function Sm(t,e){if(t){const r=km(t,!0);if(r&&cc(r,e))return r;if(dd(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(cc(a,e))return a}}}}function cc(t,e){return fd(t)&&e.includes(t.tokenType.name)}function km(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 Rd extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function ga(t,e="Error: Got unexpected value."){throw new Error(e)}function W(t){return t.charCodeAt(0)}function fo(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Ci(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function on(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function wm(){throw Error("Internal Error - Should never get here!")}function fc(t){return t.type==="Character"}const ws=[];for(let t=W("0");t<=W("9");t++)ws.push(t);const Ns=[W("_")].concat(ws);for(let t=W("a");t<=W("z");t++)Ns.push(t);for(let t=W("A");t<=W("Z");t++)Ns.push(t);const dc=[W(" "),W("\f"),W(`
2
+ `),W("\r"),W(" "),W("\v"),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W("\u2028"),W("\u2029"),W(" "),W(" "),W(" "),W("\uFEFF")],Nm=/[0-9a-fA-F]/,Ba=/[0-9]/,bm=/[1-9]/;class vd{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":Ci(n,"global");break;case"i":Ci(n,"ignoreCase");break;case"m":Ci(n,"multiLine");break;case"u":Ci(n,"unicode");break;case"y":Ci(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}}on(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return wm()}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;on(r);break}if(!(e===!0&&r===void 0)&&on(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()),on(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[W(`
3
+ `),W("\r"),W("\u2028"),W("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=ws;break;case"D":e=ws,r=!0;break;case"s":e=dc;break;case"S":e=dc,r=!0;break;case"w":e=Ns;break;case"W":e=Ns,r=!0;break}if(on(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=W("\f");break;case"n":e=W(`
4
+ `);break;case"r":e=W("\r");break;case"t":e=W(" ");break;case"v":e=W("\v");break}if(on(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:W("\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:W(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:W(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,fc(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,fc(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else fo(n.value,e),e.push(W("-")),fo(i.value,e)}else fo(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:W("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;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(bm.test(e)===!1)throw Error("Expecting a positive integer");for(;Ba.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Ba.test(e)===!1)throw Error("Expecting an integer");for(;Ba.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:W(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Ba.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(Nm.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 Js{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 _m=/\r?\n/gm,Im=new vd;class Pm extends Js{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=Zs(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 ho=new Pm;function Lm(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),ho.reset(t),ho.visit(Im.pattern(t)),ho.multiline}catch{return!1}}const Om=`\f
12
+ \r \v              \u2028\u2029   \uFEFF`.split("");function Ed(t){const e=typeof t=="string"?new RegExp(t):t;return Om.some(r=>e.test(r))}function Zs(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xm(t,e){const r=Dm(t),n=e.match(r);return!!n&&n[0].length>0}function Dm(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 Mm(t){return t.rules.find(e=>ur(e)&&e.entry)}function Gm(t){return t.rules.filter(e=>cr(e)&&e.hidden)}function $d(t,e){const r=new Set,n=Mm(t);if(!n)return new Set(t.rules);const i=[n].concat(Gm(t));for(const s of i)Ad(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||cr(s)&&s.hidden)&&a.add(s);return a}function Ad(t,e,r){e.add(t.name),pa(t).forEach(n=>{if(Xr(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&Ad(i,e,r)}})}function Fm(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Sd(t.type.ref);return e==null?void 0:e.terminal}}function zm(t){return t.hidden&&!Ed(Pu(t))}function Um(t,e){return!t||!e?[]:Iu(t,e,t.astNode,!0)}function Cd(t,e,r){if(!t||!e)return;const n=Iu(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 Iu(t,e,r,n){if(!n){const i=Hs(t.grammarSource,Hr);if(i&&i.feature===e)return[t]}return ta(t)&&t.astNode===r?t.content.flatMap(i=>Iu(i,e,r,!1)):[]}function qm(t,e,r){if(!t)return;const n=jm(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 jm(t,e,r){if(t.astNode!==r)return[];if(Yr(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Ko(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Yr(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function Bm(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=Hs(t.grammarSource,Hr);if(n)return n;t=t.container}}function Sd(t){let e=t;return gd(e)&&(Ys(e.$container)?e=e.$container.$container:ma(e.$container)?e=e.$container:ga(e.$container)),kd(t,e,new Map)}function kd(t,e,r){var i;function n(a,s){let o;return Hs(a,Hr)||(o=kd(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 pa(e)){if(Hr(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Xr(a)&&ur(a.rule.ref))return n(a,a.rule.ref);if(pm(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}function wd(t){return Nd(t,new Set)}function Nd(t,e){if(e.has(t))return!0;e.add(t);for(const r of pa(t))if(Xr(r)){if(!r.rule.ref||ur(r.rule.ref)&&!Nd(r.rule.ref,e)||Ss(r.rule.ref))return!1}else{if(Hr(r))return!1;if(Ys(r))return!1}return!!t.definition}function bd(t){if(!cr(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 ra(t){if(ma(t))return ur(t)&&wd(t)?t.name:bd(t)??t.name;if(lm(t)||Tm(t)||hm(t))return t.name;if(Ys(t)){const e=Wm(t);if(e)return e}else if(gd(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Wm(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return ra(t.type.ref)}function Vm(t){var e;return cr(t)?((e=t.type)==null?void 0:e.name)??"string":bd(t)??t.name}function Pu(t){const e={s:!1,i:!1,u:!1},r=ri(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const Lu=/[\s\S]/.source;function ri(t,e){var r;if(mm(t))return Km(t);if(gm(t))return Hm(t);if(im(t))return Jm(t);if(ym(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return ar(ri(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(um(t))return Xm(t);if(Rm(t))return Ym(t);if(dm(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")),ar(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(vm(t))return ar(Lu,{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 Km(t){return ar(t.elements.map(e=>ri(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Hm(t){return ar(t.elements.map(e=>ri(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Ym(t){return ar(`${Lu}*?${ri(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Xm(t){return ar(`(?!${ri(t.terminal)})${Lu}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Jm(t){return t.right?ar(`[${po(t.left)}-${po(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):ar(po(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function po(t){return Zs(t.value)}function ar(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function Zm(t){const e=[],r=t.Grammar;for(const n of r.rules)cr(n)&&zm(n)&&Lm(Pu(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Cm}}function Yo(t){console&&console.error&&console.error(`Error: ${t}`)}function _d(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Id(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Pd(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}function Qm(t){return eg(t)?t.LABEL:t.name}function eg(t){return nt(t.LABEL)&&t.LABEL!==""}class Mt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),U(this.definition,r=>{r.accept(e)})}}class Qe extends Mt{constructor(e){super([]),this.idx=1,ht(this,_t(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class ni extends Mt{constructor(e){super(e.definition),this.orgText="",ht(this,_t(e,r=>r!==void 0))}}class it extends Mt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,ht(this,_t(e,r=>r!==void 0))}}let We=class extends Mt{constructor(e){super(e.definition),this.idx=1,ht(this,_t(e,r=>r!==void 0))}};class mt extends Mt{constructor(e){super(e.definition),this.idx=1,ht(this,_t(e,r=>r!==void 0))}}class gt extends Mt{constructor(e){super(e.definition),this.idx=1,ht(this,_t(e,r=>r!==void 0))}}class $e extends Mt{constructor(e){super(e.definition),this.idx=1,ht(this,_t(e,r=>r!==void 0))}}class at extends Mt{constructor(e){super(e.definition),this.idx=1,ht(this,_t(e,r=>r!==void 0))}}class st extends Mt{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,_t(e,r=>r!==void 0))}}class ce{constructor(e){this.idx=1,ht(this,_t(e,r=>r!==void 0))}accept(e){e.visit(this)}}function tg(t){return M(t,ms)}function ms(t){function e(r){return M(r,ms)}if(t instanceof Qe){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return nt(t.label)&&(r.label=t.label),r}else{if(t instanceof it)return{type:"Alternative",definition:e(t.definition)};if(t instanceof We)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:ms(new ce({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof at)return{type:"RepetitionWithSeparator",idx:t.idx,separator:ms(new ce({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof $e)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof st)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ce){const r={type:"Terminal",name:t.terminalType.name,label:Qm(t.terminalType),idx:t.idx};nt(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=or(n)?n.source:n),r}else{if(t instanceof ni)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class ii{visit(e){const r=e;switch(r.constructor){case Qe:return this.visitNonTerminal(r);case it:return this.visitAlternative(r);case We:return this.visitOption(r);case mt:return this.visitRepetitionMandatory(r);case gt:return this.visitRepetitionMandatoryWithSeparator(r);case at:return this.visitRepetitionWithSeparator(r);case $e:return this.visitRepetition(r);case st:return this.visitAlternation(r);case ce:return this.visitTerminal(r);case ni: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 rg(t){return t instanceof it||t instanceof We||t instanceof $e||t instanceof mt||t instanceof gt||t instanceof at||t instanceof ce||t instanceof ni}function bs(t,e=[]){return t instanceof We||t instanceof $e||t instanceof at?!0:t instanceof st?ud(t.definition,n=>bs(n,e)):t instanceof Qe&&tt(e,t)?!1:t instanceof Mt?(t instanceof Qe&&e.push(t),wt(t.definition,n=>bs(n,e))):!1}function ng(t){return t instanceof st}function Ot(t){if(t instanceof Qe)return"SUBRULE";if(t instanceof We)return"OPTION";if(t instanceof st)return"OR";if(t instanceof mt)return"AT_LEAST_ONE";if(t instanceof gt)return"AT_LEAST_ONE_SEP";if(t instanceof at)return"MANY_SEP";if(t instanceof $e)return"MANY";if(t instanceof ce)return"CONSUME";throw Error("non exhaustive match")}class Qs{walk(e,r=[]){U(e.definition,(n,i)=>{const a=Ue(e.definition,i+1);if(n instanceof Qe)this.walkProdRef(n,a,r);else if(n instanceof ce)this.walkTerminal(n,a,r);else if(n instanceof it)this.walkFlat(n,a,r);else if(n instanceof We)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 at)this.walkManySep(n,a,r);else if(n instanceof $e)this.walkMany(n,a,r);else if(n instanceof st)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 We({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=hc(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new We({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=hc(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);U(e.definition,a=>{const s=new it({definition:[a]});this.walk(s,i)})}}function hc(t,e,r){return[new We({definition:[new ce({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function ya(t){if(t instanceof Qe)return ya(t.referencedRule);if(t instanceof ce)return sg(t);if(rg(t))return ig(t);if(ng(t))return ag(t);throw Error("non exhaustive match")}function ig(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=bs(a),e=e.concat(ya(a)),n=n+1,i=r.length>n;return wu(e)}function ag(t){const e=M(t.definition,r=>ya(r));return wu(Tt(e))}function sg(t){return[t.terminalType]}const Ld="_~IN~_";class og extends Qs{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=ug(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new it({definition:a}),o=ya(s);this.follows[i]=o}}function lg(t){const e={};return U(t,r=>{const n=new og(r).startWalking();ht(e,n)}),e}function ug(t,e){return t.name+e+Ld}let gs={};const cg=new vd;function eo(t){const e=t.toString();if(gs.hasOwnProperty(e))return gs[e];{const r=cg.pattern(e);return gs[e]=r,r}}function fg(){gs={}}const Od="Complement Sets are not supported for first char optimization",_s=`Unable to use "first char" lexer optimizations:
13
+ `;function dg(t,e=!1){try{const r=eo(t);return Xo(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Od)e&&_d(`${_s} 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.`),Yo(`${_s}
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 Xo(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Xo(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":Wa(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(Od);U(s.value,l=>{if(typeof l=="number")Wa(l,e,r);else{const u=l;if(r===!0)for(let c=u.from;c<=u.to;c++)Wa(c,e,r);else{for(let c=u.from;c<=u.to&&c<Yi;c++)Wa(c,e,r);if(u.to>=Yi){const c=u.from>=Yi?u.from:Yi,d=u.to,g=Rr(c),h=Rr(d);for(let E=g;E<=h;E++)e[E]=E}}}});break;case"Group":Xo(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"&&Jo(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Le(e)}function Wa(t,e,r){const n=Rr(t);e[n]=n,r===!0&&hg(t,e)}function hg(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Rr(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Rr(i.charCodeAt(0));e[a]=a}}}function pc(t,e){return Yn(t.value,r=>{if(typeof r=="number")return tt(e,r);{const n=r;return Yn(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function Jo(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Be(t.value)?wt(t.value,Jo):Jo(t.value):!1}class pg extends Js{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){tt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?pc(e,this.targetCharCodes)===void 0&&(this.found=!0):pc(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Ou(t,e){if(e instanceof RegExp){const r=eo(e),n=new pg(t);return n.visit(r),n.found}else return Yn(e,r=>tt(t,r.charCodeAt(0)))!==void 0}const Jr="PATTERN",Hi="defaultMode",Va="modes";function mg(t,e){e=ku(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
+ `],tracer:(k,S)=>S()});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Fg()});let n;r("Reject Lexer.NA",()=>{n=Ks(t,k=>k[Jr]===rt.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=M(n,k=>{const S=k[Jr];if(or(S)){const P=S.source;return P.length===1&&P!=="^"&&P!=="$"&&P!=="."&&!S.ignoreCase?P:P.length===2&&P[0]==="\\"&&!tt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],P[1])?P[1]:mc(S)}else{if(en(S))return i=!0,{exec:S};if(typeof S=="object")return i=!0,S;if(typeof S=="string"){if(S.length===1)return S;{const P=S.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),H=new RegExp(P);return mc(H)}}else throw Error("non exhaustive match")}})});let s,o,l,u,c;r("misc mapping",()=>{s=M(n,k=>k.tokenTypeIdx),o=M(n,k=>{const S=k.GROUP;if(S!==rt.SKIPPED){if(nt(S))return S;if(sr(S))return!1;throw Error("non exhaustive match")}}),l=M(n,k=>{const S=k.LONGER_ALT;if(S)return Be(S)?M(S,H=>Qu(n,H)):[Qu(n,S)]}),u=M(n,k=>k.PUSH_MODE),c=M(n,k=>j(k,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const k=Md(e.lineTerminatorCharacters);d=M(n,S=>!1),e.positionTracking!=="onlyOffset"&&(d=M(n,S=>j(S,"LINE_BREAKS")?!!S.LINE_BREAKS:Dd(S,k)===!1&&Ou(k,S.PATTERN)))});let g,h,E,N;r("Misc Mapping #2",()=>{g=M(n,xd),h=M(a,Dg),E=Ze(n,(k,S)=>{const P=S.GROUP;return nt(P)&&P!==rt.SKIPPED&&(k[P]=[]),k},{}),N=M(a,(k,S)=>({pattern:a[S],longerAlt:l[S],canLineTerminator:d[S],isCustom:g[S],short:h[S],group:o[S],push:u[S],pop:c[S],tokenTypeIdx:s[S],tokenType:n[S]}))});let I=!0,C=[];return e.safeMode||r("First Char Optimization",()=>{C=Ze(n,(k,S,P)=>{if(typeof S.PATTERN=="string"){const H=S.PATTERN.charCodeAt(0),K=Rr(H);mo(k,K,N[P])}else if(Be(S.START_CHARS_HINT)){let H;U(S.START_CHARS_HINT,K=>{const J=typeof K=="string"?K.charCodeAt(0):K,oe=Rr(J);H!==oe&&(H=oe,mo(k,oe,N[P]))})}else if(or(S.PATTERN))if(S.PATTERN.unicode)I=!1,e.ensureOptimizations&&Yo(`${_s} Unable to analyze < ${S.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 H=dg(S.PATTERN,e.ensureOptimizations);se(H)&&(I=!1),U(H,K=>{mo(k,K,N[P])})}else e.ensureOptimizations&&Yo(`${_s} TokenType: <${S.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`),I=!1;return k},[])}),{emptyGroups:E,patternIdxToConfig:N,charCodeToPatternIdxToConfig:C,hasCustom:i,canBeOptimized:I}}function gg(t,e){let r=[];const n=Tg(t);r=r.concat(n.errors);const i=Rg(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(yg(a)),r=r.concat(wg(a)),r=r.concat(Ng(a,e)),r=r.concat(bg(a)),r}function yg(t){let e=[];const r=pt(t,n=>or(n[Jr]));return e=e.concat(Eg(r)),e=e.concat(Cg(r)),e=e.concat(Sg(r)),e=e.concat(kg(r)),e=e.concat($g(r)),e}function Tg(t){const e=pt(t,i=>!j(i,Jr)),r=M(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ae.MISSING_PATTERN,tokenTypes:[i]})),n=Vs(t,e);return{errors:r,valid:n}}function Rg(t){const e=pt(t,i=>{const a=i[Jr];return!or(a)&&!en(a)&&!j(a,"exec")&&!nt(a)}),r=M(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:Ae.INVALID_PATTERN,tokenTypes:[i]})),n=Vs(t,e);return{errors:r,valid:n}}const vg=/[^\\][$]/;function Eg(t){class e extends Js{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}const r=pt(t,i=>{const a=i.PATTERN;try{const s=eo(a),o=new e;return o.visit(s),o.found}catch{return vg.test(a.source)}});return M(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:Ae.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function $g(t){const e=pt(t,n=>n.PATTERN.test(""));return M(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ae.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}const Ag=/[^\\[][\^]|^\^/;function Cg(t){class e extends Js{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}const r=pt(t,i=>{const a=i.PATTERN;try{const s=eo(a),o=new e;return o.visit(s),o.found}catch{return Ag.test(a.source)}});return M(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:Ae.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Sg(t){const e=pt(t,n=>{const i=n[Jr];return i instanceof RegExp&&(i.multiline||i.global)});return M(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ae.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function kg(t){const e=[];let r=M(t,a=>Ze(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!tt(e,o)&&o.PATTERN!==rt.NA&&(e.push(o),s.push(o)),s),[]));r=ha(r);const n=pt(r,a=>a.length>1);return M(n,a=>{const s=M(a,l=>l.name);return{message:`The same RegExp pattern ->${bt(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Ae.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function wg(t){const e=pt(t,n=>{if(!j(n,"GROUP"))return!1;const i=n.GROUP;return i!==rt.SKIPPED&&i!==rt.NA&&!nt(i)});return M(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ae.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function Ng(t,e){const r=pt(t,i=>i.PUSH_MODE!==void 0&&!tt(e,i.PUSH_MODE));return M(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:Ae.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function bg(t){const e=[],r=Ze(t,(n,i,a)=>{const s=i.PATTERN;return s===rt.NA||(nt(s)?n.push({str:s,idx:a,tokenType:i}):or(s)&&Ig(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return U(t,(n,i)=>{U(r,({str:a,idx:s,tokenType:o})=>{if(i<s&&_g(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:Ae.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}function _g(t,e){if(or(e)){if(Pg(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(en(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 Ig(t){return Yn([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function Pg(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function mc(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function Lg(t,e,r){const n=[];return j(t,Hi)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Hi+`> property in its definition
34
+ `,type:Ae.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),j(t,Va)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Va+`> property in its definition
35
+ `,type:Ae.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),j(t,Va)&&j(t,Hi)&&!j(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Hi}: <${t.defaultMode}>which does not exist
36
+ `,type:Ae.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),j(t,Va)&&U(t.modes,(i,a)=>{U(i,(s,o)=>{if(sr(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}>
37
+ `,type:Ae.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(j(s,"LONGER_ALT")){const l=Be(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];U(l,u=>{!sr(u)&&!tt(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:Ae.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function Og(t,e,r){const n=[];let i=!1;const a=ha(Tt(Le(t.modes))),s=Ks(a,l=>l[Jr]===rt.NA),o=Md(r);return e&&U(s,l=>{const u=Dd(l,o);if(u!==!1){const d={message:Gg(l,u),type:u.issue,tokenType:l};n.push(d)}else j(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Ou(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:Ae.NO_LINE_BREAKS_FLAGS}),n}function xg(t){const e={},r=Hn(t);return U(r,n=>{const i=t[n];if(Be(i))e[n]=[];else throw Error("non exhaustive match")}),e}function xd(t){const e=t.PATTERN;if(or(e))return!1;if(en(e))return!0;if(j(e,"exec"))return!0;if(nt(e))return!1;throw Error("non exhaustive match")}function Dg(t){return nt(t)&&t.length===1?t.charCodeAt(0):!1}const Mg={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 Dd(t,e){if(j(t,"LINE_BREAKS"))return!1;if(or(t.PATTERN)){try{Ou(e,t.PATTERN)}catch(r){return{issue:Ae.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(nt(t.PATTERN))return!1;if(xd(t))return{issue:Ae.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Gg(t,e){if(e.issue===Ae.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===Ae.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 Md(t){return M(t,r=>nt(r)?r.charCodeAt(0):r)}function mo(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const Yi=256;let ys=[];function Rr(t){return t<Yi?t:ys[t]}function Fg(){if(se(ys)){ys=new Array(65536);for(let t=0;t<65536;t++)ys[t]=t>255?255+~~(t/255):t}}function Ta(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Is(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let gc=1;const Gd={};function Ra(t){const e=zg(t);Ug(e),jg(e),qg(e),U(e,r=>{r.isParent=r.categoryMatches.length>0})}function zg(t){let e=Ve(t),r=t,n=!0;for(;n;){r=ha(Tt(M(r,a=>a.CATEGORIES)));const i=Vs(r,e);e=e.concat(i),se(i)?n=!1:r=i}return e}function Ug(t){U(t,e=>{zd(e)||(Gd[gc]=e,e.tokenTypeIdx=gc++),yc(e)&&!Be(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),yc(e)||(e.CATEGORIES=[]),Bg(e)||(e.categoryMatches=[]),Wg(e)||(e.categoryMatchesMap={})})}function qg(t){U(t,e=>{e.categoryMatches=[],U(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Gd[n].tokenTypeIdx)})})}function jg(t){U(t,e=>{Fd([],e)})}function Fd(t,e){U(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),U(e.CATEGORIES,r=>{const n=t.concat(e);tt(n,r)||Fd(n,r)})}function zd(t){return j(t,"tokenTypeIdx")}function yc(t){return j(t,"CATEGORIES")}function Bg(t){return j(t,"categoryMatches")}function Wg(t){return j(t,"categoryMatchesMap")}function Vg(t){return j(t,"tokenTypeIdx")}const Zo={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 Ae;(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"})(Ae||(Ae={}));const Xi={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Zo,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Xi);class rt{constructor(e,r=Xi){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}=Id(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=ht({},Xi,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===Xi.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Mg;else if(this.config.lineTerminatorCharacters===Xi.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),Be(e)?i={modes:{defaultMode:Ve(e)},defaultMode:Hi}:(a=!1,i=Ve(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Lg(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Og(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},U(i.modes,(o,l)=>{i.modes[l]=Ks(o,u=>sr(u))});const s=Hn(i.modes);if(U(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(gg(o,s))}),se(this.lexerDefinitionErrors)){Ra(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=mg(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=ht({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!se(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=M(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
51
+ `);throw new Error(`Errors detected in definition of Lexer:
52
+ `+l)}U(this.lexerDefinitionWarning,o=>{_d(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ze),this.trackStartLines===!1&&(this.computeNewColumn=vp),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ze),/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=Ze(this.canModeBeOptimized,(l,u,c)=>(u===!1&&l.push(c),l),[]);if(r.ensureOptimizations&&!se(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",()=>{fg()}),this.TRACE_INIT("toFastProperties",()=>{Pd(this)})})}tokenize(e,r=this.defaultMode){if(!se(this.lexerDefinitionErrors)){const i=M(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,d,g,h,E,N,I,C;const k=e,S=k.length;let P=0,H=0;const K=this.hasCustom?0:Math.floor(e.length/10),J=new Array(K),oe=[];let fe=this.trackStartLines?1:void 0,de=this.trackStartLines?1:void 0;const b=xg(this.emptyGroups),R=this.trackStartLines,m=this.config.lineTerminatorsPattern;let A=0,y=[],T=[];const $=[],O=[];Object.freeze(O);let D=!1;const x=B=>{if($.length===1&&B.tokenType.PUSH_MODE===void 0){const re=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(B);oe.push({offset:B.startOffset,line:B.startLine,column:B.startColumn,length:B.image.length,message:re})}else{$.pop();const re=Kr($);y=this.patternIdxToConfig[re],T=this.charCodeToPatternIdxToConfig[re],A=y.length;const xe=this.canModeBeOptimized[re]&&this.config.safeMode===!1;T&&xe?D=!0:D=!1}};function q(B){$.push(B),T=this.charCodeToPatternIdxToConfig[B],y=this.patternIdxToConfig[B],A=y.length,A=y.length;const re=this.canModeBeOptimized[B]&&this.config.safeMode===!1;T&&re?D=!0:D=!1}q.call(this,r);let F;const ie=this.config.recoveryEnabled;for(;P<S;){l=null,d=-1;const B=k.charCodeAt(P);let re;if(D){const ve=Rr(B),he=T[ve];re=he!==void 0?he:O}else re=y;const xe=re.length;for(n=0;n<xe;n++){F=re[n];const ve=F.pattern;u=null;const he=F.short;if(he!==!1?B===he&&(d=1,l=ve):F.isCustom===!0?(C=ve.exec(k,P,J,b),C!==null?(l=C[0],d=l.length,C.payload!==void 0&&(u=C.payload)):l=null):(ve.lastIndex=P,d=this.matchLength(ve,e,P)),d!==-1){if(o=F.longerAlt,o!==void 0){l=e.substring(P,P+d);const Ie=o.length;for(a=0;a<Ie;a++){const De=y[o[a]],Ne=De.pattern;if(c=null,De.isCustom===!0?(C=Ne.exec(k,P,J,b),C!==null?(s=C[0],C.payload!==void 0&&(c=C.payload)):s=null):(Ne.lastIndex=P,s=this.match(Ne,e,P)),s&&s.length>l.length){l=s,d=s.length,u=c,F=De;break}}}break}}if(d!==-1){if(g=F.group,g!==void 0&&(l=l!==null?l:e.substring(P,P+d),h=F.tokenTypeIdx,E=this.createTokenInstance(l,P,h,F.tokenType,fe,de,d),this.handlePayload(E,u),g===!1?H=this.addToken(J,H,E):b[g].push(E)),R===!0&&F.canLineTerminator===!0){let ve=0,he,Ie;m.lastIndex=0;do l=l!==null?l:e.substring(P,P+d),he=m.test(l),he===!0&&(Ie=m.lastIndex-1,ve++);while(he===!0);ve!==0?(fe=fe+ve,de=d-Ie,this.updateTokenEndLineColumnLocation(E,g,Ie,ve,fe,de,d)):de=this.computeNewColumn(de,d)}else de=this.computeNewColumn(de,d);P=P+d,this.handleModes(F,x,q,E)}else{const ve=P,he=fe,Ie=de;let De=ie===!1;for(;De===!1&&P<S;)for(P++,i=0;i<A;i++){const Ne=y[i],Q=Ne.pattern,ot=Ne.short;if(ot!==!1?k.charCodeAt(P)===ot&&(De=!0):Ne.isCustom===!0?De=Q.exec(k,P,J,b)!==null:(Q.lastIndex=P,De=Q.exec(e)!==null),De===!0)break}if(N=P-ve,de=this.computeNewColumn(de,N),I=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(k,ve,N,he,Ie,Kr($)),oe.push({offset:ve,line:he,column:Ie,length:N,message:I}),ie===!1)break}}return this.hasCustom||(J.length=H),{tokens:J,groups:b,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}}rt.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.";rt.NA=/NOT_APPLICABLE/;function wn(t){return Ud(t)?t.LABEL:t.name}function Ud(t){return nt(t.LABEL)&&t.LABEL!==""}const Kg="parent",Tc="categories",Rc="label",vc="group",Ec="push_mode",$c="pop_mode",Ac="longer_alt",Cc="line_breaks",Sc="start_chars_hint";function qd(t){return Hg(t)}function Hg(t){const e=t.pattern,r={};if(r.name=t.name,sr(e)||(r.PATTERN=e),j(t,Kg))throw`The parent property is no longer supported.
57
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return j(t,Tc)&&(r.CATEGORIES=t[Tc]),Ra([r]),j(t,Rc)&&(r.LABEL=t[Rc]),j(t,vc)&&(r.GROUP=t[vc]),j(t,$c)&&(r.POP_MODE=t[$c]),j(t,Ec)&&(r.PUSH_MODE=t[Ec]),j(t,Ac)&&(r.LONGER_ALT=t[Ac]),j(t,Cc)&&(r.LINE_BREAKS=t[Cc]),j(t,Sc)&&(r.START_CHARS_HINT=t[Sc]),r}const vr=qd({name:"EOF",pattern:rt.NA});Ra([vr]);function xu(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 jd(t,e){return Ta(t,e)}const Sn={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Ud(t)?`--> ${wn(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: '`+bt(e).image+"'";if(n)return a+n+o;{const l=Ze(t,(g,h)=>g.concat(h),[]),u=M(l,g=>`[${M(g,h=>wn(h)).join(", ")}]`),d=`one of these possible Token sequences:
59
+ ${M(u,(g,h)=>` ${h+1}. ${g}`).join(`
60
+ `)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=`
61
+ but found: '`+bt(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
+ <${M(t,u=>`[${M(u,c=>wn(c)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Sn);const Yg={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
+ inside top level rule: ->`+t.name+"<-"}},Wr={buildDuplicateFoundError(t,e){function r(c){return c instanceof ce?c.terminalType.name:c instanceof Qe?c.nonTerminalName:""}const n=t.name,i=bt(e),a=i.idx,s=Ot(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=M(t.prefixPath,i=>wn(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=M(t.prefixPath,a=>wn(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=Ot(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=M(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 ni?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Xg(t,e){const r=new Jg(t,e);return r.resolveRefs(),r.errors}class Jg extends ii{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){U(Le(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:et.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Zg extends Qs{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=Ve(this.path.ruleStack).reverse(),this.occurrenceStack=Ve(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(){se(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Qg extends Zg{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 it({definition:i});this.possibleTokTypes=ya(a),this.found=!0}}}class to extends Qs{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 ey extends to{walkMany(e,r,n){if(e.idx===this.occurrence){const i=bt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ce&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}}class kc extends to{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=bt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ce&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}}class ty extends to{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=bt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ce&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}}class wc extends to{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=bt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ce&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}}function Qo(t,e,r=[]){r=Ve(r);let n=[],i=0;function a(o){return o.concat(Ue(t,i+1))}function s(o){const l=Qo(a(o),e,r);return n.concat(l)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof it)return s(o.definition);if(o instanceof Qe)return s(o.definition);if(o instanceof We)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 it({definition:o.definition}),new $e({definition:[new ce({terminalType:o.separator})].concat(o.definition)})];return s(l)}else if(o instanceof at){const l=o.definition.concat([new $e({definition:[new ce({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 st)return U(o.definition,l=>{se(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof ce)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Ue(t,i)}),n}function Bd(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=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!se(d);){const g=d.pop();if(g===s){o&&Kr(d).idx<=u&&d.pop();continue}const h=g.def,E=g.idx,N=g.ruleStack,I=g.occurrenceStack;if(se(h))continue;const C=h[0];if(C===i){const k={idx:E,def:Ue(h),ruleStack:ea(N),occurrenceStack:ea(I)};d.push(k)}else if(C instanceof ce)if(E<l-1){const k=E+1,S=e[k];if(r(S,C.terminalType)){const P={idx:k,def:Ue(h),ruleStack:N,occurrenceStack:I};d.push(P)}}else if(E===l-1)c.push({nextTokenType:C.terminalType,nextTokenOccurrence:C.idx,ruleStack:N,occurrenceStack:I}),o=!0;else throw Error("non exhaustive match");else if(C instanceof Qe){const k=Ve(N);k.push(C.nonTerminalName);const S=Ve(I);S.push(C.idx);const P={idx:E,def:C.definition.concat(a,Ue(h)),ruleStack:k,occurrenceStack:S};d.push(P)}else if(C instanceof We){const k={idx:E,def:Ue(h),ruleStack:N,occurrenceStack:I};d.push(k),d.push(s);const S={idx:E,def:C.definition.concat(Ue(h)),ruleStack:N,occurrenceStack:I};d.push(S)}else if(C instanceof mt){const k=new $e({definition:C.definition,idx:C.idx}),S=C.definition.concat([k],Ue(h)),P={idx:E,def:S,ruleStack:N,occurrenceStack:I};d.push(P)}else if(C instanceof gt){const k=new ce({terminalType:C.separator}),S=new $e({definition:[k].concat(C.definition),idx:C.idx}),P=C.definition.concat([S],Ue(h)),H={idx:E,def:P,ruleStack:N,occurrenceStack:I};d.push(H)}else if(C instanceof at){const k={idx:E,def:Ue(h),ruleStack:N,occurrenceStack:I};d.push(k),d.push(s);const S=new ce({terminalType:C.separator}),P=new $e({definition:[S].concat(C.definition),idx:C.idx}),H=C.definition.concat([P],Ue(h)),K={idx:E,def:H,ruleStack:N,occurrenceStack:I};d.push(K)}else if(C instanceof $e){const k={idx:E,def:Ue(h),ruleStack:N,occurrenceStack:I};d.push(k),d.push(s);const S=new $e({definition:C.definition,idx:C.idx}),P=C.definition.concat([S],Ue(h)),H={idx:E,def:P,ruleStack:N,occurrenceStack:I};d.push(H)}else if(C instanceof st)for(let k=C.definition.length-1;k>=0;k--){const S=C.definition[k],P={idx:E,def:S.definition.concat(Ue(h)),ruleStack:N,occurrenceStack:I};d.push(P),d.push(s)}else if(C instanceof it)d.push({idx:E,def:C.definition.concat(Ue(h)),ruleStack:N,occurrenceStack:I});else if(C instanceof ni)d.push(ry(C,E,N,I));else throw Error("non exhaustive match")}return c}function ry(t,e,r,n){const i=Ve(r);i.push(t.name);const a=Ve(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var ye;(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"})(ye||(ye={}));function Du(t){if(t instanceof We||t==="Option")return ye.OPTION;if(t instanceof $e||t==="Repetition")return ye.REPETITION;if(t instanceof mt||t==="RepetitionMandatory")return ye.REPETITION_MANDATORY;if(t instanceof gt||t==="RepetitionMandatoryWithSeparator")return ye.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof at||t==="RepetitionWithSeparator")return ye.REPETITION_WITH_SEPARATOR;if(t instanceof st||t==="Alternation")return ye.ALTERNATION;throw Error("non exhaustive match")}function Nc(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Du(n);return a===ye.ALTERNATION?ro(e,r,i):no(e,r,a,i)}function ny(t,e,r,n,i,a){const s=ro(t,e,r),o=Kd(s)?Is:Ta;return a(s,n,o,i)}function iy(t,e,r,n,i,a){const s=no(t,e,i,r),o=Kd(s)?Is:Ta;return a(s[0],o,n)}function ay(t,e,r,n){const i=t.length,a=wt(t,s=>wt(s,o=>o.length===1));if(e)return function(s){const o=M(s,l=>l.GATE);for(let l=0;l<i;l++){const u=t[l],c=u.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let g=0;g<c;g++){const h=u[g],E=h.length;for(let N=0;N<E;N++){const I=this.LA(N+1);if(r(I,h[N])===!1)continue e}return l}}};if(a&&!n){const s=M(t,l=>Tt(l)),o=Ze(s,(l,u,c)=>(U(u,d=>{j(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=c),U(d.categoryMatches,g=>{j(l,g)||(l[g]=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],d=c.length;for(let g=0;g<d;g++){const h=this.LA(g+1);if(r(h,c[g])===!1)continue e}return s}}}}function sy(t,e,r){const n=wt(t,a=>a.length===1),i=t.length;if(n&&!r){const a=Tt(t);if(a.length===1&&se(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Ze(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,U(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 oy extends Qs{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,ye.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,ye.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,ye.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,ye.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,ye.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class Wd extends ii{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,ye.OPTION)}visitRepetition(e){this.checkIsTarget(e,ye.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,ye.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,ye.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,ye.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,ye.ALTERNATION)}}function bc(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function go(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 ly(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 Vd(t,e){const r=M(t,s=>Qo([s],1)),n=bc(r.length),i=M(r,s=>{const o={};return U(s,l=>{const u=go(l.partialPath);U(u,c=>{o[c]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=bc(o.length);for(let l=0;l<o.length;l++){const u=o[l];for(let c=0;c<u.length;c++){const d=u[c].partialPath,g=u[c].suffixDef,h=go(d);if(ly(i,h,l)||se(g)||d.length===e){const N=n[l];if(el(N,d)===!1){N.push(d);for(let I=0;I<h.length;I++){const C=h[I];i[l][C]=!0}}}else{const N=Qo(g,s+1,d);a[l]=a[l].concat(N),U(N,I=>{const C=go(I.partialPath);U(C,k=>{i[l][k]=!0})})}}}}return n}function ro(t,e,r,n){const i=new Wd(t,ye.ALTERNATION,n);return e.accept(i),Vd(i.result,r)}function no(t,e,r,n){const i=new Wd(t,r);e.accept(i);const a=i.result,o=new oy(e,t,r).startWalking(),l=new it({definition:a}),u=new it({definition:o});return Vd([l,u],n)}function el(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 uy(t,e){return t.length<e.length&&wt(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function Kd(t){return wt(t,e=>wt(e,r=>wt(r,n=>se(n.categoryMatches))))}function cy(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return M(e,r=>Object.assign({type:et.CUSTOM_LOOKAHEAD_VALIDATION},r))}function fy(t,e,r,n){const i=dt(t,l=>dy(l,r)),a=Cy(t,e,r),s=dt(t,l=>vy(l,r)),o=dt(t,l=>my(l,t,n,r));return i.concat(a,s,o)}function dy(t,e){const r=new py;t.accept(r);const n=r.allProductions,i=Bp(n,hy),a=_t(i,o=>o.length>1);return M(Le(a),o=>{const l=bt(o),u=e.buildDuplicateFoundError(t,o),c=Ot(l),d={message:u,type:et.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:l.idx},g=Hd(l);return g&&(d.parameter=g),d})}function hy(t){return`${Ot(t)}_#_${t.idx}_#_${Hd(t)}`}function Hd(t){return t instanceof ce?t.terminalType.name:t instanceof Qe?t.nonTerminalName:""}class py extends ii{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 my(t,e,r,n){const i=[];if(Ze(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:et.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function gy(t,e,r){const n=[];let i;return tt(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:et.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Yd(t,e,r,n=[]){const i=[],a=Ts(e.definition);if(se(a))return[];{const s=t.name;tt(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:et.LEFT_RECURSION,ruleName:s});const l=Vs(a,n.concat([t])),u=dt(l,c=>{const d=Ve(n);return d.push(c),Yd(t,c,r,d)});return i.concat(u)}}function Ts(t){let e=[];if(se(t))return e;const r=bt(t);if(r instanceof Qe)e.push(r.referencedRule);else if(r instanceof it||r instanceof We||r instanceof mt||r instanceof gt||r instanceof at||r instanceof $e)e=e.concat(Ts(r.definition));else if(r instanceof st)e=Tt(M(r.definition,a=>Ts(a.definition)));else if(!(r instanceof ce))throw Error("non exhaustive match");const n=bs(r),i=t.length>1;if(n&&i){const a=Ue(t);return e.concat(Ts(a))}else return e}class Mu extends ii{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function yy(t,e){const r=new Mu;t.accept(r);const n=r.alternations;return dt(n,a=>{const s=ea(a.definition);return dt(s,(o,l)=>{const u=Bd([o],[],Ta,1);return se(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:et.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}function Ty(t,e,r){const n=new Mu;t.accept(n);let i=n.alternations;return i=Ks(i,s=>s.ignoreAmbiguities===!0),dt(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=ro(o,t,l,s),c=$y(u,s,t,r),d=Ay(u,s,t,r);return c.concat(d)})}class Ry extends ii{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 vy(t,e){const r=new Mu;t.accept(r);const n=r.alternations;return dt(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:et.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function Ey(t,e,r){const n=[];return U(t,i=>{const a=new Ry;i.accept(a);const s=a.allProductions;U(s,o=>{const l=Du(o),u=o.maxLookahead||e,c=o.idx,g=no(c,i,l,u)[0];if(se(Tt(g))){const h=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:h,type:et.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function $y(t,e,r,n){const i=[],a=Ze(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||U(l,c=>{const d=[u];U(t,(g,h)=>{u!==h&&el(g,c)&&e.definition[h].ignoreAmbiguities!==!0&&d.push(h)}),d.length>1&&!el(i,c)&&(i.push(c),o.push({alts:d,path:c}))}),o),[]);return M(a,o=>{const l=M(o.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:et.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function Ay(t,e,r,n){const i=Ze(t,(s,o,l)=>{const u=M(o,c=>({idx:l,path:c}));return s.concat(u)},[]);return ha(dt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,c=pt(i,g=>e.definition[g.idx].ignoreAmbiguities!==!0&&g.idx<l&&uy(g.path,u));return M(c,g=>{const h=[g.idx+1,l+1],E=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:h,prefixPath:g.path}),type:et.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:E,alternatives:h}})}))}function Cy(t,e,r){const n=[],i=M(e,a=>a.name);return U(t,a=>{const s=a.name;if(tt(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:et.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function Sy(t){const e=ku(t,{errMsgProvider:Yg}),r={};return U(t.rules,n=>{r[n.name]=n}),Xg(r,e.errMsgProvider)}function ky(t){return t=ku(t,{errMsgProvider:Wr}),fy(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const Xd="MismatchedTokenException",Jd="NoViableAltException",Zd="EarlyExitException",Qd="NotAllInputParsedException",eh=[Xd,Jd,Zd,Qd];Object.freeze(eh);function Ps(t){return tt(eh,t.name)}class io 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 th extends io{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Xd}}class wy extends io{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Jd}}class Ny extends io{constructor(e,r){super(e,r),this.name=Qd}}class by extends io{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Zd}}const yo={},rh="InRuleRecoveryException";class _y extends Error{constructor(e){super(e),this.name=rh}}class Iy{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=j(e,"recoveryEnabled")?e.recoveryEnabled:lr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Py)}getTokenToInsert(e){const r=xu(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 d=()=>{const g=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:g,ruleName:this.getCurrRuleFullName()}),E=new th(h,u,this.LA(0));E.resyncedTokens=ea(o),this.SAVE_ERROR(E)};for(;!l;)if(this.tokenMatcher(c,i)){d();return}else if(n.call(this)){d(),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 _y("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||se(r))return!1;const n=this.LA(1);return Yn(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 tt(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=Yn(e,a=>jd(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return yo;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 M(e,(n,i)=>i===0?yo:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=M(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Tt(e)}getFollowSetFromFollowKey(e){if(e===yo)return[vr];const r=e.ruleName+e.idxInCallingRule+Ld+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,vr)||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 ea(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Ve(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return M(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function Py(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const g=this.getCurrRuleFullName(),h=this.getGAstProductions()[g];l=new a(h,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,c=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=vr,c=1),!(u===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,c,s)&&this.tryInRepetitionRecovery(t,e,r,u)}const Ly=4,$r=8,nh=1<<$r,ih=2<<$r,tl=3<<$r,rl=4<<$r,nl=5<<$r,Rs=6<<$r;function To(t,e,r){return r|e|t}class Gu{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:lr.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(se(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 dt(e,r=>Yd(r,r,Wr))}validateEmptyOrAlternatives(e){return dt(e,r=>yy(r,Wr))}validateAmbiguousAlternationAlternatives(e,r){return dt(e,n=>Ty(n,r,Wr))}validateSomeNonEmptyLookaheadPath(e,r){return Ey(e,r,Wr)}buildLookaheadForAlternation(e){return ny(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,ay)}buildLookaheadForOptional(e){return iy(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Du(e.prodType),sy)}}class Oy{initLooksAhead(e){this.dynamicTokensEnabled=j(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:lr.dynamicTokensEnabled,this.maxLookahead=j(e,"maxLookahead")?e.maxLookahead:lr.maxLookahead,this.lookaheadStrategy=j(e,"lookaheadStrategy")?e.lookaheadStrategy:new Gu({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){U(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Dy(r);U(n,u=>{const c=u.idx===0?"":u.idx;this.TRACE_INIT(`${Ot(u)}${c}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),g=To(this.fullRuleNameToShort[r.name],nh,u.idx);this.setLaFuncCache(g,d)})}),U(i,u=>{this.computeLookaheadFunc(r,u.idx,tl,"Repetition",u.maxLookahead,Ot(u))}),U(a,u=>{this.computeLookaheadFunc(r,u.idx,ih,"Option",u.maxLookahead,Ot(u))}),U(s,u=>{this.computeLookaheadFunc(r,u.idx,rl,"RepetitionMandatory",u.maxLookahead,Ot(u))}),U(o,u=>{this.computeLookaheadFunc(r,u.idx,Rs,"RepetitionMandatoryWithSeparator",u.maxLookahead,Ot(u))}),U(l,u=>{this.computeLookaheadFunc(r,u.idx,nl,"RepetitionWithSeparator",u.maxLookahead,Ot(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=To(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return To(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class xy extends ii{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 Ka=new xy;function Dy(t){Ka.reset(),t.accept(Ka);const e=Ka.dslMethods;return Ka.reset(),e}function _c(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Ic(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 My(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function Gy(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const Fy="name";function ah(t,e){Object.defineProperty(t,Fy,{enumerable:!1,configurable:!0,writable:!1,value:e})}function zy(t,e){const r=Hn(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 Uy(t,e){const r=function(){};ah(r,t+"BaseSemantics");const n={visit:function(i,a){if(Be(i)&&(i=i[0]),!sr(i))return this[i.name](i.children,a)},validateVisitor:function(){const i=jy(this,e);if(!se(i)){const a=M(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 qy(t,e,r){const n=function(){};ah(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return U(e,a=>{i[a]=zy}),n.prototype=i,n.prototype.constructor=n,n}var il;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(il||(il={}));function jy(t,e){return By(t,e)}function By(t,e){const r=pt(e,i=>en(t[i])===!1),n=M(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:il.MISSING_METHOD,methodName:i}));return ha(n)}class Wy{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=j(e,"nodeLocationTracking")?e.nodeLocationTracking:lr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ze,this.cstFinallyStateUpdate=ze,this.cstPostTerminal=ze,this.cstPostNonTerminal=ze,this.cstPostRule=ze;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ic,this.setNodeLocationFromNode=Ic,this.cstPostRule=ze,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ze,this.setNodeLocationFromNode=ze,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_c,this.setNodeLocationFromNode=_c,this.cstPostRule=ze,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ze,this.setNodeLocationFromNode=ze,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ze,this.setNodeLocationFromNode=ze,this.cstPostRule=ze,this.setInitialNodeLocation=ze;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];My(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Gy(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(sr(this.baseCstVisitorConstructor)){const e=Uy(this.className,Hn(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(sr(this.baseCstVisitorWithDefaultsConstructor)){const e=qy(this.className,Hn(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 Vy{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)):Os}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Os: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 Ky{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=xs){if(tt(this.definedRulesNames,e)){const s={message:Wr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:et.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=xs){const i=gy(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(Ps(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return tg(Le(this.gastProductionsCache))}}class Hy{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Is,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(Be(e)){if(se(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(Be(e))this.tokensMap=Ze(e,(a,s)=>(a[s.name]=s,a),{});else if(j(e,"modes")&&wt(Tt(Le(e.modes)),Vg)){const a=Tt(Le(e.modes)),s=wu(a);this.tokensMap=Ze(s,(o,l)=>(o[l.name]=l,o),{})}else if(Ep(e))this.tokensMap=Ve(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=vr;const n=j(e,"modes")?Tt(Le(e.modes)):Le(e),i=wt(n,a=>se(a.categoryMatches));this.tokenMatcher=i?Is:Ta,Ra(Le(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:xs.resyncEnabled,a=j(n,"recoveryValueFunc")?n.recoveryValueFunc:xs.recoveryValueFunc,s=this.ruleShortNameIdx<<Ly+$r;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 d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(d){return this.invokeRuleCatch(d,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(Ps(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(ih,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(rl,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,ye.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,rl,e,ty)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Rs,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,wc],o,Rs,e,wc)}else throw this.raiseEarlyExitException(e,ye.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(tl,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,tl,e,ey,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(nl,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,kc],o,nl,e,kc)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,Rs,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(nh,r),i=Be(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 Ny(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 Ps(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 th(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===rh?n:a}}else throw n}saveRecogState(){const e=this.errors,r=Ve(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),vr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class Yy{initErrorHandler(e){this._errors=[],this.errorMessageProvider=j(e,"errorMessageProvider")?e.errorMessageProvider:lr.errorMessageProvider}SAVE_ERROR(e){if(Ps(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ve(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ve(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=no(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 by(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=ro(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 wy(l,this.LA(1),o))}}class Xy{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(sr(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Bd([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=bt(e.ruleStack),i=this.getGAstProductions()[r];return new Qg(i,e).startWalking()}}const ao={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(ao);const Pc=!0,Lc=Math.pow(2,$r)-1,sh=qd({name:"RECORDING_PHASE_TOKEN",pattern:rt.NA});Ra([sh]);const oh=xu(sh,`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(oh);const Jy={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 Zy{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 Os}topLevelRuleRecord(e,r){try{const n=new ni({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 Si.call(this,We,e,r)}atLeastOneInternalRecord(e,r){Si.call(this,mt,r,e)}atLeastOneSepFirstInternalRecord(e,r){Si.call(this,gt,r,e,Pc)}manyInternalRecord(e,r){Si.call(this,$e,r,e)}manySepFirstInternalRecord(e,r){Si.call(this,at,r,e,Pc)}orInternalRecord(e,r){return Qy.call(this,e,r)}subruleInternalRecord(e,r,n){if(Ls(r),!e||j(e,"ruleName")===!1){const o=new Error(`<SUBRULE${Oc(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=Kr(this.recordingProdStack),a=e.ruleName,s=new Qe({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?Jy:ao}consumeInternalRecord(e,r,n){if(Ls(r),!zd(e)){const s=new Error(`<CONSUME${Oc(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=Kr(this.recordingProdStack),a=new ce({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),oh}}function Si(t,e,r,n=!1){Ls(r);const i=Kr(this.recordingProdStack),a=en(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(),ao}function Qy(t,e){Ls(e);const r=Kr(this.recordingProdStack),n=Be(t)===!1,i=n===!1?t:t.DEF,a=new st({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});j(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=ud(i,o=>en(o.GATE));return a.hasPredicates=s,r.definition.push(a),U(i,o=>{const l=new it({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()}),ao}function Oc(t){return t===0?"":`${t}`}function Ls(t){if(t<0||t>Lc){const e=new Error(`Invalid DSL Method idx value: <${t}>
107
+ Idx value must be a none negative value smaller than ${Lc+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class eT{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=lr.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}=Id(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 tT(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 Os=xu(vr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Os);const lr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Sn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),xs=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var et;(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"})(et||(et={}));function xc(t=void 0){return function(){return t}}class va{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",()=>{Pd(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),U(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=Sy({rules:Le(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(se(n)&&this.skipValidations===!1){const i=ky({rules:Le(this.gastProductionsCache),tokenTypes:Le(this.tokensMap),errMsgProvider:Wr,grammarName:r}),a=cy({lookaheadStrategy:this.lookaheadStrategy,rules:Le(this.gastProductionsCache),tokenTypes:Le(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),se(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=lg(Le(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:Le(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Le(this.gastProductionsCache))})),!va.DEFER_DEFINITION_ERRORS_HANDLING&&!se(this.definitionErrors))throw e=M(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:lr.skipValidations}}va.DEFER_DEFINITION_ERRORS_HANDLING=!1;tT(va,[Iy,Oy,Wy,Vy,Hy,Ky,Yy,Xy,Zy,eT]);class rT extends va{constructor(e,r=lr){const n=Ve(r);n.outputCst=!1,super(e,n)}}function Xn(t,e,r){return`${t.name}_${e}_${r}`}const Er=1,nT=2,lh=4,uh=5,Ea=7,iT=8,aT=9,sT=10,oT=11,ch=12;class Fu{constructor(e){this.target=e}isEpsilon(){return!1}}class zu extends Fu{constructor(e,r){super(e),this.tokenType=r}}class fh extends Fu{constructor(e){super(e)}isEpsilon(){return!0}}class Uu extends Fu{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function lT(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};uT(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=tn(e,i,i);a!==void 0&&vT(e,i,a)}return e}function uT(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=Oe(t,i,void 0,{type:nT}),s=Oe(t,i,void 0,{type:Ea});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function dh(t,e,r){return r instanceof ce?qu(t,e,r.terminalType,r):r instanceof Qe?RT(t,e,r):r instanceof st?pT(t,e,r):r instanceof We?mT(t,e,r):r instanceof $e?cT(t,e,r):r instanceof at?fT(t,e,r):r instanceof mt?dT(t,e,r):r instanceof gt?hT(t,e,r):tn(t,e,r)}function cT(t,e,r){const n=Oe(t,e,r,{type:uh});Ar(t,n);const i=ai(t,e,n,r,tn(t,e,r));return ph(t,e,r,i)}function fT(t,e,r){const n=Oe(t,e,r,{type:uh});Ar(t,n);const i=ai(t,e,n,r,tn(t,e,r)),a=qu(t,e,r.separator,r);return ph(t,e,r,i,a)}function dT(t,e,r){const n=Oe(t,e,r,{type:lh});Ar(t,n);const i=ai(t,e,n,r,tn(t,e,r));return hh(t,e,r,i)}function hT(t,e,r){const n=Oe(t,e,r,{type:lh});Ar(t,n);const i=ai(t,e,n,r,tn(t,e,r)),a=qu(t,e,r.separator,r);return hh(t,e,r,i,a)}function pT(t,e,r){const n=Oe(t,e,r,{type:Er});Ar(t,n);const i=M(r.definition,s=>dh(t,e,s));return ai(t,e,n,r,...i)}function mT(t,e,r){const n=Oe(t,e,r,{type:Er});Ar(t,n);const i=ai(t,e,n,r,tn(t,e,r));return gT(t,e,r,i)}function tn(t,e,r){const n=pt(M(r.definition,i=>dh(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:TT(t,n)}function hh(t,e,r,n,i){const a=n.left,s=n.right,o=Oe(t,e,r,{type:oT});Ar(t,o);const l=Oe(t,e,r,{type:ch});return a.loopback=o,l.loopback=o,t.decisionMap[Xn(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,be(s,o),i===void 0?(be(o,a),be(o,l)):(be(o,l),be(o,i.left),be(i.right,a)),{left:a,right:l}}function ph(t,e,r,n,i){const a=n.left,s=n.right,o=Oe(t,e,r,{type:sT});Ar(t,o);const l=Oe(t,e,r,{type:ch}),u=Oe(t,e,r,{type:aT});return o.loopback=u,l.loopback=u,be(o,a),be(o,l),be(s,u),i!==void 0?(be(u,l),be(u,i.left),be(i.right,a)):be(u,o),t.decisionMap[Xn(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function gT(t,e,r,n){const i=n.left,a=n.right;return be(i,a),t.decisionMap[Xn(e,"Option",r.idx)]=i,n}function Ar(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function ai(t,e,r,n,...i){const a=Oe(t,e,n,{type:iT,start:r});r.end=a;for(const o of i)o!==void 0?(be(r,o.left),be(o.right,a)):be(r,a);const s={left:r,right:a};return t.decisionMap[Xn(e,yT(n),n.idx)]=r,s}function yT(t){if(t instanceof st)return"Alternation";if(t instanceof We)return"Option";if(t instanceof $e)return"Repetition";if(t instanceof at)return"RepetitionWithSeparator";if(t instanceof mt)return"RepetitionMandatory";if(t instanceof gt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function TT(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 Uu,u=o,c=e[a+1].left;s.left.type===Er&&s.right.type===Er&&o!==void 0&&(l&&u.followState===s.right||o.target===s.right)?(l?u.followState=c:o.target=c,ET(t,s.right)):be(s.right,c)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function qu(t,e,r,n){const i=Oe(t,e,n,{type:Er}),a=Oe(t,e,n,{type:Er});return ju(i,new zu(a,r)),{left:i,right:a}}function RT(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=Oe(t,e,r,{type:Er}),s=Oe(t,e,r,{type:Er}),o=new Uu(i,n,s);return ju(a,o),{left:a,right:s}}function vT(t,e,r){const n=t.ruleToStartState.get(e);be(n,r.left);const i=t.ruleToStopState.get(e);return be(r.right,i),{left:n,right:i}}function be(t,e){const r=new fh(e);ju(t,r)}function Oe(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 ju(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function ET(t,e){t.states.splice(t.states.indexOf(e),1)}const Ds={};class al{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=mh(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return M(this.configs,e=>e.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}}function mh(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function $T(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 gh{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 Dc=new gh;class AT extends Gu{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=lT(e.rules),this.dfas=CT(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=Xn(n,"Alternation",r),c=this.atn.decisionMap[l].decision,d=M(Nc({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),g=>M(g,h=>h[0]));if(Mc(d,!1)&&!a){const g=Ze(d,(h,E,N)=>(U(E,I=>{I&&(h[I.tokenTypeIdx]=N,U(I.categoryMatches,C=>{h[C]=N}))}),h),{});return i?function(h){var E;const N=this.LA(1),I=g[N.tokenTypeIdx];if(h!==void 0&&I!==void 0){const C=(E=h[I])===null||E===void 0?void 0:E.GATE;if(C!==void 0&&C.call(this)===!1)return}return I}:function(){const h=this.LA(1);return g[h.tokenTypeIdx]}}else return i?function(g){const h=new gh,E=g===void 0?0:g.length;for(let I=0;I<E;I++){const C=g==null?void 0:g[I].GATE;h.set(I,C===void 0||C.call(this))}const N=Ro.call(this,s,c,h,o);return typeof N=="number"?N:void 0}:function(){const g=Ro.call(this,s,c,Dc,o);return typeof g=="number"?g:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Xn(n,i,r),c=this.atn.decisionMap[l].decision,d=M(Nc({maxLookahead:1,occurrence:r,prodType:i,rule:n}),g=>M(g,h=>h[0]));if(Mc(d)&&d[0][0]&&!a){const g=d[0],h=Tt(g);if(h.length===1&&se(h[0].categoryMatches)){const N=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===N}}else{const E=Ze(h,(N,I)=>(I!==void 0&&(N[I.tokenTypeIdx]=!0,U(I.categoryMatches,C=>{N[C]=!0})),N),{});return function(){const N=this.LA(1);return E[N.tokenTypeIdx]===!0}}}return function(){const g=Ro.call(this,s,c,Dc,o);return typeof g=="object"?!1:g===0}}}function Mc(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 CT(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=$T(t.decisionStates[n],n);return r}function Ro(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const o=xT(i.atnStartState);a=Th(i,yh(o)),i.start=a}return ST.apply(this,[i,a,r,n])}function ST(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA(a++);for(;;){let l=IT(i,o);if(l===void 0&&(l=kT.apply(this,[t,i,o,a,r,n])),l===Ds)return _T(s,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,s.push(o),o=this.LA(a++)}}function kT(t,e,r,n,i,a){const s=PT(e.configs,r,i);if(s.size===0)return Gc(t,e,r,Ds),Ds;let o=yh(s);const l=OT(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(FT(s)){const u=Pp(s.alts);o.isAcceptState=!0,o.prediction=u,o.configs.uniqueAlt=u,wT.apply(this,[t,n,s.alts,a])}return o=Gc(t,e,r,o),o}function wT(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=NT({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function NT(t){const e=M(t.prefixPath,i=>wn(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${bT(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 bT(t){if(t instanceof Qe)return"SUBRULE";if(t instanceof We)return"OPTION";if(t instanceof st)return"OR";if(t instanceof mt)return"AT_LEAST_ONE";if(t instanceof gt)return"AT_LEAST_ONE_SEP";if(t instanceof at)return"MANY_SEP";if(t instanceof $e)return"MANY";if(t instanceof ce)return"CONSUME";throw Error("non exhaustive match")}function _T(t,e,r){const n=dt(e.configs.elements,a=>a.state.transitions),i=Zp(n.filter(a=>a instanceof zu).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function IT(t,e){return t.edges[e.tokenTypeIdx]}function PT(t,e,r){const n=new al,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Ea){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const u=s.state.transitions[l],c=LT(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 al;for(const s of n.elements)Ms(s,a)}if(i.length>0&&!MT(a))for(const s of i)a.add(s);return a}function LT(t,e){if(t instanceof zu&&jd(e,t.tokenType))return t.target}function OT(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 yh(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Gc(t,e,r,n){return n=Th(t,n),e.edges[r.tokenTypeIdx]=n,n}function Th(t,e){if(e===Ds)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 xT(t){const e=new al,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};Ms(a,e)}return e}function Ms(t,e){const r=t.state;if(r.type===Ea){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Ms(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=DT(t,a);s!==void 0&&Ms(s,e)}}function DT(t,e){if(e instanceof fh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Uu){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function MT(t){for(const e of t.elements)if(e.state.type===Ea)return!0;return!1}function GT(t){for(const e of t.elements)if(e.state.type!==Ea)return!1;return!0}function FT(t){if(GT(t))return!0;const e=zT(t.elements);return UT(e)&&!qT(e)}function zT(t){const e=new Map;for(const r of t){const n=mh(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function UT(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function qT(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var sl;(function(t){function e(r){return typeof r=="string"}t.is=e})(sl||(sl={}));var Gs;(function(t){function e(r){return typeof r=="string"}t.is=e})(Gs||(Gs={}));var ol;(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})(ol||(ol={}));var na;(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})(na||(na={}));var te;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=na.MAX_VALUE),i===Number.MAX_VALUE&&(i=na.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&v.uinteger(i.line)&&v.uinteger(i.character)}t.is=r})(te||(te={}));var X;(function(t){function e(n,i,a,s){if(v.uinteger(n)&&v.uinteger(i)&&v.uinteger(a)&&v.uinteger(s))return{start:te.create(n,i),end:te.create(a,s)};if(te.is(n)&&te.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 v.objectLiteral(i)&&te.is(i.start)&&te.is(i.end)}t.is=r})(X||(X={}));var ia;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&X.is(i.range)&&(v.string(i.uri)||v.undefined(i.uri))}t.is=r})(ia||(ia={}));var ll;(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 v.objectLiteral(i)&&X.is(i.targetRange)&&v.string(i.targetUri)&&X.is(i.targetSelectionRange)&&(X.is(i.originSelectionRange)||v.undefined(i.originSelectionRange))}t.is=r})(ll||(ll={}));var Fs;(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 v.objectLiteral(i)&&v.numberRange(i.red,0,1)&&v.numberRange(i.green,0,1)&&v.numberRange(i.blue,0,1)&&v.numberRange(i.alpha,0,1)}t.is=r})(Fs||(Fs={}));var ul;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&X.is(i.range)&&Fs.is(i.color)}t.is=r})(ul||(ul={}));var cl;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.string(i.label)&&(v.undefined(i.textEdit)||Dt.is(i))&&(v.undefined(i.additionalTextEdits)||v.typedArray(i.additionalTextEdits,Dt.is))}t.is=r})(cl||(cl={}));var fl;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(fl||(fl={}));var dl;(function(t){function e(n,i,a,s,o,l){const u={startLine:n,endLine:i};return v.defined(a)&&(u.startCharacter=a),v.defined(s)&&(u.endCharacter=s),v.defined(o)&&(u.kind=o),v.defined(l)&&(u.collapsedText=l),u}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.uinteger(i.startLine)&&v.uinteger(i.startLine)&&(v.undefined(i.startCharacter)||v.uinteger(i.startCharacter))&&(v.undefined(i.endCharacter)||v.uinteger(i.endCharacter))&&(v.undefined(i.kind)||v.string(i.kind))}t.is=r})(dl||(dl={}));var zs;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&ia.is(i.location)&&v.string(i.message)}t.is=r})(zs||(zs={}));var hl;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(hl||(hl={}));var pl;(function(t){t.Unnecessary=1,t.Deprecated=2})(pl||(pl={}));var ml;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&v.string(n.href)}t.is=e})(ml||(ml={}));var aa;(function(t){function e(n,i,a,s,o,l){let u={range:n,message:i};return v.defined(a)&&(u.severity=a),v.defined(s)&&(u.code=s),v.defined(o)&&(u.source=o),v.defined(l)&&(u.relatedInformation=l),u}t.create=e;function r(n){var i;let a=n;return v.defined(a)&&X.is(a.range)&&v.string(a.message)&&(v.number(a.severity)||v.undefined(a.severity))&&(v.integer(a.code)||v.string(a.code)||v.undefined(a.code))&&(v.undefined(a.codeDescription)||v.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(v.string(a.source)||v.undefined(a.source))&&(v.undefined(a.relatedInformation)||v.typedArray(a.relatedInformation,zs.is))}t.is=r})(aa||(aa={}));var Zr;(function(t){function e(n,i,...a){let s={title:n,command:i};return v.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.title)&&v.string(i.command)}t.is=r})(Zr||(Zr={}));var Dt;(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 v.objectLiteral(s)&&v.string(s.newText)&&X.is(s.range)}t.is=i})(Dt||(Dt={}));var Vr;(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 v.objectLiteral(i)&&v.string(i.label)&&(v.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(v.string(i.description)||i.description===void 0)}t.is=r})(Vr||(Vr={}));var je;(function(t){function e(r){const n=r;return v.string(n)}t.is=e})(je||(je={}));var rr;(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 Dt.is(s)&&(Vr.is(s.annotationId)||je.is(s.annotationId))}t.is=i})(rr||(rr={}));var sa;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&oa.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(sa||(sa={}));var Jn;(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"&&v.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||je.is(i.annotationId))}t.is=r})(Jn||(Jn={}));var Zn;(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"&&v.string(i.oldUri)&&v.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||je.is(i.annotationId))}t.is=r})(Zn||(Zn={}));var Qn;(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"&&v.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||v.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||v.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||je.is(i.annotationId))}t.is=r})(Qn||(Qn={}));var Us;(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=>v.string(i.kind)?Jn.is(i)||Zn.is(i)||Qn.is(i):sa.is(i)))}t.is=e})(Us||(Us={}));class Ha{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,a;if(n===void 0?i=Dt.insert(e,r):je.is(n)?(a=n,i=rr.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=rr.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=Dt.replace(e,r):je.is(n)?(a=n,i=rr.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=rr.replace(e,r,a)),this.edits.push(i),a!==void 0)return a}delete(e,r){let n,i;if(r===void 0?n=Dt.del(e):je.is(r)?(i=r,n=rr.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=rr.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 Fc{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(je.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 jT{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Fc(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(sa.is(r)){const n=new Ha(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{const n=new Ha(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(oa.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 Ha(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 Ha(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Fc,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;Vr.is(r)||je.is(r)?i=r:n=r;let a,s;if(i===void 0?a=Jn.create(e,n):(s=je.is(i)?i:this._changeAnnotations.manage(i),a=Jn.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;Vr.is(n)||je.is(n)?a=n:i=n;let s,o;if(a===void 0?s=Zn.create(e,r,i):(o=je.is(a)?a:this._changeAnnotations.manage(a),s=Zn.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;Vr.is(r)||je.is(r)?i=r:n=r;let a,s;if(i===void 0?a=Qn.create(e,n):(s=je.is(i)?i:this._changeAnnotations.manage(i),a=Qn.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}}var gl;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)}t.is=r})(gl||(gl={}));var yl;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&v.integer(i.version)}t.is=r})(yl||(yl={}));var oa;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&(i.version===null||v.integer(i.version))}t.is=r})(oa||(oa={}));var Tl;(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 v.defined(i)&&v.string(i.uri)&&v.string(i.languageId)&&v.integer(i.version)&&v.string(i.text)}t.is=r})(Tl||(Tl={}));var qs;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(qs||(qs={}));var ei;(function(t){function e(r){const n=r;return v.objectLiteral(r)&&qs.is(n.kind)&&v.string(n.value)}t.is=e})(ei||(ei={}));var Rl;(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})(Rl||(Rl={}));var vl;(function(t){t.PlainText=1,t.Snippet=2})(vl||(vl={}));var El;(function(t){t.Deprecated=1})(El||(El={}));var $l;(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&&v.string(i.newText)&&X.is(i.insert)&&X.is(i.replace)}t.is=r})($l||($l={}));var Al;(function(t){t.asIs=1,t.adjustIndentation=2})(Al||(Al={}));var Cl;(function(t){function e(r){const n=r;return n&&(v.string(n.detail)||n.detail===void 0)&&(v.string(n.description)||n.description===void 0)}t.is=e})(Cl||(Cl={}));var Sl;(function(t){function e(r){return{label:r}}t.create=e})(Sl||(Sl={}));var kl;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(kl||(kl={}));var la;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return v.string(i)||v.objectLiteral(i)&&v.string(i.language)&&v.string(i.value)}t.is=r})(la||(la={}));var wl;(function(t){function e(r){let n=r;return!!n&&v.objectLiteral(n)&&(ei.is(n.contents)||la.is(n.contents)||v.typedArray(n.contents,la.is))&&(r.range===void 0||X.is(r.range))}t.is=e})(wl||(wl={}));var Nl;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Nl||(Nl={}));var bl;(function(t){function e(r,n,...i){let a={label:r};return v.defined(n)&&(a.documentation=n),v.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(bl||(bl={}));var _l;(function(t){t.Text=1,t.Read=2,t.Write=3})(_l||(_l={}));var Il;(function(t){function e(r,n){let i={range:r};return v.number(n)&&(i.kind=n),i}t.create=e})(Il||(Il={}));var Pl;(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})(Pl||(Pl={}));var Ll;(function(t){t.Deprecated=1})(Ll||(Ll={}));var Ol;(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})(Ol||(Ol={}));var xl;(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})(xl||(xl={}));var Dl;(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&&v.string(i.name)&&v.number(i.kind)&&X.is(i.range)&&X.is(i.selectionRange)&&(i.detail===void 0||v.string(i.detail))&&(i.deprecated===void 0||v.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Dl||(Dl={}));var Ml;(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"})(Ml||(Ml={}));var ua;(function(t){t.Invoked=1,t.Automatic=2})(ua||(ua={}));var Gl;(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 v.defined(i)&&v.typedArray(i.diagnostics,aa.is)&&(i.only===void 0||v.typedArray(i.only,v.string))&&(i.triggerKind===void 0||i.triggerKind===ua.Invoked||i.triggerKind===ua.Automatic)}t.is=r})(Gl||(Gl={}));var Fl;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):Zr.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&&v.string(i.title)&&(i.diagnostics===void 0||v.typedArray(i.diagnostics,aa.is))&&(i.kind===void 0||v.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Zr.is(i.command))&&(i.isPreferred===void 0||v.boolean(i.isPreferred))&&(i.edit===void 0||Us.is(i.edit))}t.is=r})(Fl||(Fl={}));var zl;(function(t){function e(n,i){let a={range:n};return v.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return v.defined(i)&&X.is(i.range)&&(v.undefined(i.command)||Zr.is(i.command))}t.is=r})(zl||(zl={}));var Ul;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.uinteger(i.tabSize)&&v.boolean(i.insertSpaces)}t.is=r})(Ul||(Ul={}));var ql;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return v.defined(i)&&X.is(i.range)&&(v.undefined(i.target)||v.string(i.target))}t.is=r})(ql||(ql={}));var jl;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&X.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(jl||(jl={}));var Bl;(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"})(Bl||(Bl={}));var Wl;(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"})(Wl||(Wl={}));var Vl;(function(t){function e(r){const n=r;return v.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})(Vl||(Vl={}));var Kl;(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)&&v.string(i.text)}t.is=r})(Kl||(Kl={}));var Hl;(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)&&v.boolean(i.caseSensitiveLookup)&&(v.string(i.variableName)||i.variableName===void 0)}t.is=r})(Hl||(Hl={}));var Yl;(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)&&(v.string(i.expression)||i.expression===void 0)}t.is=r})(Yl||(Yl={}));var Xl;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return v.defined(i)&&X.is(n.stoppedLocation)}t.is=r})(Xl||(Xl={}));var js;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(js||(js={}));var Bs;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&(i.tooltip===void 0||v.string(i.tooltip)||ei.is(i.tooltip))&&(i.location===void 0||ia.is(i.location))&&(i.command===void 0||Zr.is(i.command))}t.is=r})(Bs||(Bs={}));var Jl;(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 v.objectLiteral(i)&&te.is(i.position)&&(v.string(i.label)||v.typedArray(i.label,Bs.is))&&(i.kind===void 0||js.is(i.kind))&&i.textEdits===void 0||v.typedArray(i.textEdits,Dt.is)&&(i.tooltip===void 0||v.string(i.tooltip)||ei.is(i.tooltip))&&(i.paddingLeft===void 0||v.boolean(i.paddingLeft))&&(i.paddingRight===void 0||v.boolean(i.paddingRight))}t.is=r})(Jl||(Jl={}));var Zl;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Zl||(Zl={}));var Ql;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(Ql||(Ql={}));var eu;(function(t){function e(r){return{items:r}}t.create=e})(eu||(eu={}));var tu;(function(t){t.Invoked=0,t.Automatic=1})(tu||(tu={}));var ru;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(ru||(ru={}));var nu;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(nu||(nu={}));var iu;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&Gs.is(n.uri)&&v.string(n.name)}t.is=e})(iu||(iu={}));const BT=[`
117
+ `,`\r
118
+ `,"\r"];var au;(function(t){function e(a,s,o,l){return new WT(a,s,o,l)}t.create=e;function r(a){let s=a;return!!(v.defined(s)&&v.string(s.uri)&&(v.undefined(s.languageId)||v.string(s.languageId))&&v.uinteger(s.lineCount)&&v.func(s.getText)&&v.func(s.positionAt)&&v.func(s.offsetAt))}t.is=r;function n(a,s){let o=a.getText(),l=i(s,(c,d)=>{let g=c.range.start.line-d.range.start.line;return g===0?c.range.start.character-d.range.start.character:g}),u=o.length;for(let c=l.length-1;c>=0;c--){let d=l[c],g=a.offsetAt(d.range.start),h=a.offsetAt(d.range.end);if(h<=u)o=o.substring(0,g)+d.newText+o.substring(h,o.length);else throw new Error("Overlapping edit");u=g}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,d=0,g=0;for(;c<l.length&&d<u.length;)s(l[c],u[d])<=0?a[g++]=l[c++]:a[g++]=u[d++];for(;c<l.length;)a[g++]=l[c++];for(;d<u.length;)a[g++]=u[d++];return a}})(au||(au={}));let WT=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 te.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 te.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 v;(function(t){const e=Object.prototype.toString;function r(h){return typeof h<"u"}t.defined=r;function n(h){return typeof h>"u"}t.undefined=n;function i(h){return h===!0||h===!1}t.boolean=i;function a(h){return e.call(h)==="[object String]"}t.string=a;function s(h){return e.call(h)==="[object Number]"}t.number=s;function o(h,E,N){return e.call(h)==="[object Number]"&&E<=h&&h<=N}t.numberRange=o;function l(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=l;function u(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=u;function c(h){return e.call(h)==="[object Function]"}t.func=c;function d(h){return h!==null&&typeof h=="object"}t.objectLiteral=d;function g(h,E){return Array.isArray(h)&&h.every(E)}t.typedArray=g})(v||(v={}));const VT=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return rr},get ChangeAnnotation(){return Vr},get ChangeAnnotationIdentifier(){return je},get CodeAction(){return Fl},get CodeActionContext(){return Gl},get CodeActionKind(){return Ml},get CodeActionTriggerKind(){return ua},get CodeDescription(){return ml},get CodeLens(){return zl},get Color(){return Fs},get ColorInformation(){return ul},get ColorPresentation(){return cl},get Command(){return Zr},get CompletionItem(){return Sl},get CompletionItemKind(){return Rl},get CompletionItemLabelDetails(){return Cl},get CompletionItemTag(){return El},get CompletionList(){return kl},get CreateFile(){return Jn},get DeleteFile(){return Qn},get Diagnostic(){return aa},get DiagnosticRelatedInformation(){return zs},get DiagnosticSeverity(){return hl},get DiagnosticTag(){return pl},get DocumentHighlight(){return Il},get DocumentHighlightKind(){return _l},get DocumentLink(){return ql},get DocumentSymbol(){return Dl},get DocumentUri(){return sl},EOL:BT,get FoldingRange(){return dl},get FoldingRangeKind(){return fl},get FormattingOptions(){return Ul},get Hover(){return wl},get InlayHint(){return Jl},get InlayHintKind(){return js},get InlayHintLabelPart(){return Bs},get InlineCompletionContext(){return nu},get InlineCompletionItem(){return Ql},get InlineCompletionList(){return eu},get InlineCompletionTriggerKind(){return tu},get InlineValueContext(){return Xl},get InlineValueEvaluatableExpression(){return Yl},get InlineValueText(){return Kl},get InlineValueVariableLookup(){return Hl},get InsertReplaceEdit(){return $l},get InsertTextFormat(){return vl},get InsertTextMode(){return Al},get Location(){return ia},get LocationLink(){return ll},get MarkedString(){return la},get MarkupContent(){return ei},get MarkupKind(){return qs},get OptionalVersionedTextDocumentIdentifier(){return oa},get ParameterInformation(){return Nl},get Position(){return te},get Range(){return X},get RenameFile(){return Zn},get SelectedCompletionInfo(){return ru},get SelectionRange(){return jl},get SemanticTokenModifiers(){return Wl},get SemanticTokenTypes(){return Bl},get SemanticTokens(){return Vl},get SignatureInformation(){return bl},get StringValue(){return Zl},get SymbolInformation(){return Ol},get SymbolKind(){return Pl},get SymbolTag(){return Ll},get TextDocument(){return au},get TextDocumentEdit(){return sa},get TextDocumentIdentifier(){return gl},get TextDocumentItem(){return Tl},get TextEdit(){return Dt},get URI(){return Gs},get VersionedTextDocumentIdentifier(){return yl},WorkspaceChange:jT,get WorkspaceEdit(){return Us},get WorkspaceFolder(){return iu},get WorkspaceSymbol(){return xl},get integer(){return ol},get uinteger(){return na}},Symbol.toStringTag,{value:"Module"}));class KT{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new vh(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new Bu;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new su(e.startOffset,e.image.length,Ho(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 su(a.startOffset,a.image.length,Ho(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 Rh{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 su extends Rh{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 Bu extends Rh{constructor(){super(...arguments),this.content=new Wu(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:te.create(0,0),end:te.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 Wu extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Wu.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 vh extends Bu{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const ou=Symbol("Datatype");function vo(t){return t.$type===ou}const zc="​",Eh=t=>t.endsWith(zc)?t:t+zc;class $h{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 ZT(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Ch(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 HT extends $h{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new KT,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;Ss(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(Eh(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),ur(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 Ss(e)?ra(e):e.fragment?void 0:wd(e)?ou:ra(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,zo(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===ou?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=Yr(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,c,s,l)}else if(vo(u)){let c=i.image;Yr(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(vo(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)):vo(e)?this.converter.convert(e.value,e.$cstNode):(tm(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 N=0;N<i.length;N++){const I=i[N],C=r.get(I)??{precedence:1/0,rightAssoc:!1};C.precedence>s?(s=C.precedence,a=N):C.precedence===s&&(C.rightAssoc||(a=N))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),c=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},g={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:l},h=this.constructInfix(d,r),E=this.constructInfix(g,r);return{$type:e.$type,$cstNode:e.$cstNode,left:h,operator:i[a],right:E}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=Hs(e,Hr);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Xs(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 YT{buildMismatchTokenMessage(e){return Sn.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Sn.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Sn.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Sn.buildEarlyExitMessage(e)}}class Ah extends YT{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 XT extends $h{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(Eh(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 JT={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Ah};class Ch extends rT{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...JT,lookaheadStrategy:n?new Gu({maxLookahead:r.maxLookahead}):new AT({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 ZT extends Ch{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 Sh(t,e,r){return QT({parser:e,tokens:r,ruleNames:new Map},t),e}function QT(t,e){const r=$d(e,!1),n=ge(e.rules).filter(ur).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,Qr(s,a.definition))}const i=ge(e.rules).filter(Ss).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,eR(t,a))}function eR(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(cr(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(h=>h.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 d=n.map(h=>t.tokens[h.value]).map((h,E)=>({ALT:()=>t.parser.consume(E,h,l)}));let g;return h=>{g??(g=Vu(t,r)),t.parser.subrule(0,g,!1,a,h),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,d),t.parser.subrule(1,g,!1,u,h)}})}}function Qr(t,e,r=!1){let n;if(Yr(e))n=oR(t,e);else if(Ys(e))n=tR(t,e);else if(Hr(e))n=Qr(t,e.terminal);else if(Xs(e))n=kh(t,e);else if(Xr(e))n=rR(t,e);else if(md(e))n=iR(t,e);else if(yd(e))n=aR(t,e);else if(_u(e))n=sR(t,e);else if(om(e)){const i=t.consume++;n=()=>t.parser.consume(i,vr,e)}else throw new Rd(e.$cstNode,`Unexpected element type: ${e.$type}`);return wh(t,r?void 0:Ws(e),n,e.cardinality)}function tR(t,e){const r=ra(e);return()=>t.parser.action(r,e)}function rR(t,e){const r=e.rule.ref;if(ma(r)){const n=t.subrule++,i=ur(r)&&r.fragment,a=e.arguments.length>0?nR(r,e.arguments):()=>({});let s;return o=>{s??(s=Vu(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(cr(r)){const n=t.consume++,i=lu(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)ga();else throw new Rd(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function nR(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:xt(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=>xt(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 xt(t){if(sm(t)){const e=xt(t.left),r=xt(t.right);return n=>e(n)||r(n)}else if(am(t)){const e=xt(t.left),r=xt(t.right);return n=>e(n)&&r(n)}else if(cm(t)){const e=xt(t.value);return r=>!e(r)}else if(fm(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(nm(t)){const e=!!t.true;return()=>e}ga()}function iR(t,e){if(e.elements.length===1)return Qr(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Qr(t,i,!0)},s=Ws(i);s&&(a.GATE=xt(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 aR(t,e){if(e.elements.length===1)return Qr(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Qr(t,o,!0)},u=Ws(o);u&&(l.GATE=xt(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},d=t.parser;c.ALT=()=>{if(l.ALT(o),!d.isRecording()){const h=i(n,d);d.unorderedGroups.get(h)||d.unorderedGroups.set(h,[]);const E=d.unorderedGroups.get(h);typeof(E==null?void 0:E[u])>"u"&&(E[u]=!0)}};const g=l.GATE;return g?c.GATE=()=>g(o):c.GATE=()=>{const h=d.unorderedGroups.get(i(n,d));return!(h!=null&&h[u])},c})),s=wh(t,Ws(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function sR(t,e){const r=e.elements.map(n=>Qr(t,n));return n=>r.forEach(i=>i(n))}function Ws(t){if(_u(t))return t.guardCondition}function kh(t,e,r=e.terminal){if(r)if(Xr(r)&&ur(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=Vu(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Xr(r)&&cr(r.rule.ref)){const n=t.consume++,i=lu(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Yr(r)){const n=t.consume++,i=lu(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=Sd(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+ra(e.type.ref));return kh(t,e,i)}}function oR(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 wh(t,e,r,n){const i=e&&xt(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:xc(),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:xc(),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 ga()}function Vu(t,e){const r=lR(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function lR(t,e){if(ma(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!ur(n);)(_u(n)||md(n)||yd(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 lu(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function uR(t){const e=t.Grammar,r=t.parser.Lexer,n=new XT(t);return Sh(e,n,r.definition),n.finalize(),n}function cR(t){const e=fR(t);return e.finalize(),e}function fR(t){const e=t.Grammar,r=t.parser.Lexer,n=new HT(t);return Sh(e,n,r.definition)}class Nh{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=ge($d(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(cr).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Pu(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=Ed(r)?rt.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(ma).flatMap(i=>pa(i).filter(Yr)).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(Zs(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&&xm("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class bh{convert(e,r){let n=r.grammarSource;if(Xs(n)&&(n=Fm(n)),Xr(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 er.convertInt(r);case"STRING":return er.convertString(r);case"ID":return er.convertID(r)}switch((i=Vm(e))==null?void 0:i.toLowerCase()){case"number":return er.convertNumber(r);case"boolean":return er.convertBoolean(r);case"bigint":return er.convertBigint(r);case"date":return er.convertDate(r);default:return r}}}var er;(function(t){function e(u){let c="";for(let d=1;d<u.length-1;d++){const g=u.charAt(d);if(g==="\\"){const h=u.charAt(++d);c+=r(h)}else c+=g}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})(er||(er={}));var kr={},Ya={},Uc;function rn(){if(Uc)return Ya;Uc=1,Object.defineProperty(Ya,"__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={})),Ya.default=e,Ya}var Me={},qc;function $a(){if(qc)return Me;qc=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.stringArray=Me.array=Me.func=Me.error=Me.number=Me.string=Me.boolean=void 0;function t(o){return o===!0||o===!1}Me.boolean=t;function e(o){return typeof o=="string"||o instanceof String}Me.string=e;function r(o){return typeof o=="number"||o instanceof Number}Me.number=r;function n(o){return o instanceof Error}Me.error=n;function i(o){return typeof o=="function"}Me.func=i;function a(o){return Array.isArray(o)}Me.array=a;function s(o){return a(o)&&o.every(l=>e(l))}return Me.stringArray=s,Me}var wr={},jc;function si(){if(jc)return wr;jc=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.Emitter=wr.Event=void 0;const t=rn();var e;(function(i){const a={dispose(){}};i.None=function(){return a}})(e||(wr.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(d){(0,t.default)().console.error(d)}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 wr.Emitter=n,n._noop=function(){},wr}var Bc;function so(){if(Bc)return kr;Bc=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.CancellationTokenSource=kr.CancellationToken=void 0;const t=rn(),e=$a(),r=si();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||(kr.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 kr.CancellationTokenSource=s,kr}var Te=so();function dR(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let vs=0,hR=10;function pR(){return vs=performance.now(),new Te.CancellationTokenSource}const kn=Symbol("OperationCancelled");function oo(t){return t===kn}async function Je(t){if(t===Te.CancellationToken.None)return;const e=performance.now();if(e-vs>=hR&&(vs=e,await dR(),vs=performance.now()),t.isCancellationRequested)throw kn}class Ku{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class ca{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(ca.isIncremental(n)){const i=Ih(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=Wc(n.text,!1,a);if(l-o===c.length)for(let g=0,h=c.length;g<h;g++)u[g+o+1]=c[g];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 d=n.text.length-(s-a);if(d!==0)for(let g=o+1+c.length,h=u.length;g<h;g++)u[g]=u[g]+d}else if(ca.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=Wc(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&&_h(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 uu;(function(t){function e(i,a,s,o){return new ca(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof ca)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=cu(a.map(mR),(c,d)=>{const g=c.range.start.line-d.range.start.line;return g===0?c.range.start.character-d.range.start.character:g});let l=0;const u=[];for(const c of o){const d=i.offsetAt(c.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&u.push(s.substring(l,d)),c.newText.length&&u.push(c.newText),l=i.offsetAt(c.range.end)}return u.push(s.substr(l)),u.join("")}t.applyEdits=n})(uu||(uu={}));function cu(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);cu(n,e),cu(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 Wc(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);_h(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function _h(t){return t===13||t===10}function Ih(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 mR(t){const e=Ih(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Ph;(()=>{var t={975:b=>{function R(y){if(typeof y!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(y))}function m(y,T){for(var $,O="",D=0,x=-1,q=0,F=0;F<=y.length;++F){if(F<y.length)$=y.charCodeAt(F);else{if($===47)break;$=47}if($===47){if(!(x===F-1||q===1))if(x!==F-1&&q===2){if(O.length<2||D!==2||O.charCodeAt(O.length-1)!==46||O.charCodeAt(O.length-2)!==46){if(O.length>2){var ie=O.lastIndexOf("/");if(ie!==O.length-1){ie===-1?(O="",D=0):D=(O=O.slice(0,ie)).length-1-O.lastIndexOf("/"),x=F,q=0;continue}}else if(O.length===2||O.length===1){O="",D=0,x=F,q=0;continue}}T&&(O.length>0?O+="/..":O="..",D=2)}else O.length>0?O+="/"+y.slice(x+1,F):O=y.slice(x+1,F),D=F-x-1;x=F,q=0}else $===46&&q!==-1?++q:q=-1}return O}var A={resolve:function(){for(var y,T="",$=!1,O=arguments.length-1;O>=-1&&!$;O--){var D;O>=0?D=arguments[O]:(y===void 0&&(y=process.cwd()),D=y),R(D),D.length!==0&&(T=D+"/"+T,$=D.charCodeAt(0)===47)}return T=m(T,!$),$?T.length>0?"/"+T:"/":T.length>0?T:"."},normalize:function(y){if(R(y),y.length===0)return".";var T=y.charCodeAt(0)===47,$=y.charCodeAt(y.length-1)===47;return(y=m(y,!T)).length!==0||T||(y="."),y.length>0&&$&&(y+="/"),T?"/"+y:y},isAbsolute:function(y){return R(y),y.length>0&&y.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var y,T=0;T<arguments.length;++T){var $=arguments[T];R($),$.length>0&&(y===void 0?y=$:y+="/"+$)}return y===void 0?".":A.normalize(y)},relative:function(y,T){if(R(y),R(T),y===T||(y=A.resolve(y))===(T=A.resolve(T)))return"";for(var $=1;$<y.length&&y.charCodeAt($)===47;++$);for(var O=y.length,D=O-$,x=1;x<T.length&&T.charCodeAt(x)===47;++x);for(var q=T.length-x,F=D<q?D:q,ie=-1,B=0;B<=F;++B){if(B===F){if(q>F){if(T.charCodeAt(x+B)===47)return T.slice(x+B+1);if(B===0)return T.slice(x+B)}else D>F&&(y.charCodeAt($+B)===47?ie=B:B===0&&(ie=0));break}var re=y.charCodeAt($+B);if(re!==T.charCodeAt(x+B))break;re===47&&(ie=B)}var xe="";for(B=$+ie+1;B<=O;++B)B!==O&&y.charCodeAt(B)!==47||(xe.length===0?xe+="..":xe+="/..");return xe.length>0?xe+T.slice(x+ie):(x+=ie,T.charCodeAt(x)===47&&++x,T.slice(x))},_makeLong:function(y){return y},dirname:function(y){if(R(y),y.length===0)return".";for(var T=y.charCodeAt(0),$=T===47,O=-1,D=!0,x=y.length-1;x>=1;--x)if((T=y.charCodeAt(x))===47){if(!D){O=x;break}}else D=!1;return O===-1?$?"/":".":$&&O===1?"//":y.slice(0,O)},basename:function(y,T){if(T!==void 0&&typeof T!="string")throw new TypeError('"ext" argument must be a string');R(y);var $,O=0,D=-1,x=!0;if(T!==void 0&&T.length>0&&T.length<=y.length){if(T.length===y.length&&T===y)return"";var q=T.length-1,F=-1;for($=y.length-1;$>=0;--$){var ie=y.charCodeAt($);if(ie===47){if(!x){O=$+1;break}}else F===-1&&(x=!1,F=$+1),q>=0&&(ie===T.charCodeAt(q)?--q==-1&&(D=$):(q=-1,D=F))}return O===D?D=F:D===-1&&(D=y.length),y.slice(O,D)}for($=y.length-1;$>=0;--$)if(y.charCodeAt($)===47){if(!x){O=$+1;break}}else D===-1&&(x=!1,D=$+1);return D===-1?"":y.slice(O,D)},extname:function(y){R(y);for(var T=-1,$=0,O=-1,D=!0,x=0,q=y.length-1;q>=0;--q){var F=y.charCodeAt(q);if(F!==47)O===-1&&(D=!1,O=q+1),F===46?T===-1?T=q:x!==1&&(x=1):T!==-1&&(x=-1);else if(!D){$=q+1;break}}return T===-1||O===-1||x===0||x===1&&T===O-1&&T===$+1?"":y.slice(T,O)},format:function(y){if(y===null||typeof y!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof y);return(function(T,$){var O=$.dir||$.root,D=$.base||($.name||"")+($.ext||"");return O?O===$.root?O+D:O+"/"+D:D})(0,y)},parse:function(y){R(y);var T={root:"",dir:"",base:"",ext:"",name:""};if(y.length===0)return T;var $,O=y.charCodeAt(0),D=O===47;D?(T.root="/",$=1):$=0;for(var x=-1,q=0,F=-1,ie=!0,B=y.length-1,re=0;B>=$;--B)if((O=y.charCodeAt(B))!==47)F===-1&&(ie=!1,F=B+1),O===46?x===-1?x=B:re!==1&&(re=1):x!==-1&&(re=-1);else if(!ie){q=B+1;break}return x===-1||F===-1||re===0||re===1&&x===F-1&&x===q+1?F!==-1&&(T.base=T.name=q===0&&D?y.slice(1,F):y.slice(q,F)):(q===0&&D?(T.name=y.slice(1,x),T.base=y.slice(1,F)):(T.name=y.slice(q,x),T.base=y.slice(q,F)),T.ext=y.slice(x,F)),q>0?T.dir=y.slice(0,q-1):D&&(T.dir="/"),T},sep:"/",delimiter:":",win32:null,posix:null};A.posix=A,b.exports=A}},e={};function r(b){var R=e[b];if(R!==void 0)return R.exports;var m=e[b]={exports:{}};return t[b](m,m.exports,r),m.exports}r.d=(b,R)=>{for(var m in R)r.o(R,m)&&!r.o(b,m)&&Object.defineProperty(b,m,{enumerable:!0,get:R[m]})},r.o=(b,R)=>Object.prototype.hasOwnProperty.call(b,R),r.r=b=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>g,Utils:()=>de}),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(b,R){if(!b.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${b.authority}", path: "${b.path}", query: "${b.query}", fragment: "${b.fragment}"}`);if(b.scheme&&!a.test(b.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(b.path){if(b.authority){if(!s.test(b.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(b.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="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class g{constructor(R,m,A,y,T,$=!1){gr(this,"scheme");gr(this,"authority");gr(this,"path");gr(this,"query");gr(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||u,this.authority=R.authority||u,this.path=R.path||u,this.query=R.query||u,this.fragment=R.fragment||u):(this.scheme=(function(O,D){return O||D?O:"file"})(R,$),this.authority=m||u,this.path=(function(O,D){switch(O){case"https":case"http":case"file":D?D[0]!==c&&(D=c+D):D=c}return D})(this.scheme,A||u),this.query=y||u,this.fragment=T||u,l(this,$))}static isUri(R){return R instanceof g||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return k(this)}with(R){if(!R)return this;let{scheme:m,authority:A,path:y,query:T,fragment:$}=R;return m===void 0?m=this.scheme:m===null&&(m=u),A===void 0?A=this.authority:A===null&&(A=u),y===void 0?y=this.path:y===null&&(y=u),T===void 0?T=this.query:T===null&&(T=u),$===void 0?$=this.fragment:$===null&&($=u),m===this.scheme&&A===this.authority&&y===this.path&&T===this.query&&$===this.fragment?this:new E(m,A,y,T,$)}static parse(R,m=!1){const A=d.exec(R);return A?new E(A[2]||u,K(A[4]||u),K(A[5]||u),K(A[7]||u),K(A[9]||u),m):new E(u,u,u,u,u)}static file(R){let m=u;if(i&&(R=R.replace(/\\/g,c)),R[0]===c&&R[1]===c){const A=R.indexOf(c,2);A===-1?(m=R.substring(2),R=c):(m=R.substring(2,A),R=R.substring(A)||c)}return new E("file",m,R,u,u)}static from(R){const m=new E(R.scheme,R.authority,R.path,R.query,R.fragment);return l(m,!0),m}toString(R=!1){return S(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof g)return R;{const m=new E(R);return m._formatted=R.external,m._fsPath=R._sep===h?R.fsPath:null,m}}return R}}const h=i?1:void 0;class E extends g{constructor(){super(...arguments);gr(this,"_formatted",null);gr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=k(this)),this._fsPath}toString(m=!1){return m?S(this,!0):(this._formatted||(this._formatted=S(this,!1)),this._formatted)}toJSON(){const m={$mid:1};return this._fsPath&&(m.fsPath=this._fsPath,m._sep=h),this._formatted&&(m.external=this._formatted),this.path&&(m.path=this.path),this.scheme&&(m.scheme=this.scheme),this.authority&&(m.authority=this.authority),this.query&&(m.query=this.query),this.fragment&&(m.fragment=this.fragment),m}}const N={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function I(b,R,m){let A,y=-1;for(let T=0;T<b.length;T++){const $=b.charCodeAt(T);if($>=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===45||$===46||$===95||$===126||R&&$===47||m&&$===91||m&&$===93||m&&$===58)y!==-1&&(A+=encodeURIComponent(b.substring(y,T)),y=-1),A!==void 0&&(A+=b.charAt(T));else{A===void 0&&(A=b.substr(0,T));const O=N[$];O!==void 0?(y!==-1&&(A+=encodeURIComponent(b.substring(y,T)),y=-1),A+=O):y===-1&&(y=T)}}return y!==-1&&(A+=encodeURIComponent(b.substring(y))),A!==void 0?A:b}function C(b){let R;for(let m=0;m<b.length;m++){const A=b.charCodeAt(m);A===35||A===63?(R===void 0&&(R=b.substr(0,m)),R+=N[A]):R!==void 0&&(R+=b[m])}return R!==void 0?R:b}function k(b,R){let m;return m=b.authority&&b.path.length>1&&b.scheme==="file"?`//${b.authority}${b.path}`:b.path.charCodeAt(0)===47&&(b.path.charCodeAt(1)>=65&&b.path.charCodeAt(1)<=90||b.path.charCodeAt(1)>=97&&b.path.charCodeAt(1)<=122)&&b.path.charCodeAt(2)===58?b.path[1].toLowerCase()+b.path.substr(2):b.path,i&&(m=m.replace(/\//g,"\\")),m}function S(b,R){const m=R?C:I;let A="",{scheme:y,authority:T,path:$,query:O,fragment:D}=b;if(y&&(A+=y,A+=":"),(T||y==="file")&&(A+=c,A+=c),T){let x=T.indexOf("@");if(x!==-1){const q=T.substr(0,x);T=T.substr(x+1),x=q.lastIndexOf(":"),x===-1?A+=m(q,!1,!1):(A+=m(q.substr(0,x),!1,!1),A+=":",A+=m(q.substr(x+1),!1,!0)),A+="@"}T=T.toLowerCase(),x=T.lastIndexOf(":"),x===-1?A+=m(T,!1,!0):(A+=m(T.substr(0,x),!1,!0),A+=T.substr(x))}if($){if($.length>=3&&$.charCodeAt(0)===47&&$.charCodeAt(2)===58){const x=$.charCodeAt(1);x>=65&&x<=90&&($=`/${String.fromCharCode(x+32)}:${$.substr(3)}`)}else if($.length>=2&&$.charCodeAt(1)===58){const x=$.charCodeAt(0);x>=65&&x<=90&&($=`${String.fromCharCode(x+32)}:${$.substr(2)}`)}A+=m($,!0,!1)}return O&&(A+="?",A+=m(O,!1,!1)),D&&(A+="#",A+=R?D:I(D,!1,!1)),A}function P(b){try{return decodeURIComponent(b)}catch{return b.length>3?b.substr(0,3)+P(b.substr(3)):b}}const H=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function K(b){return b.match(H)?b.replace(H,(R=>P(R))):b}var J=r(975);const oe=J.posix||J,fe="/";var de;(function(b){b.joinPath=function(R,...m){return R.with({path:oe.join(R.path,...m)})},b.resolvePath=function(R,...m){let A=R.path,y=!1;A[0]!==fe&&(A=fe+A,y=!0);let T=oe.resolve(A,...m);return y&&T[0]===fe&&!R.authority&&(T=T.substring(1)),R.with({path:T})},b.dirname=function(R){if(R.path.length===0||R.path===fe)return R;let m=oe.dirname(R.path);return m.length===1&&m.charCodeAt(0)===46&&(m=""),R.with({path:m})},b.basename=function(R){return oe.basename(R.path)},b.extname=function(R){return oe.extname(R.path)}})(de||(de={})),Ph=n})();const{URI:Nt,Utils:ki}=Ph;var ft;(function(t){t.basename=ki.basename,t.dirname=ki.dirname,t.extname=ki.extname,t.joinPath=ki.joinPath,t.resolvePath=ki.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"?Nt.parse(s).path:s.path,u=typeof o=="string"?Nt.parse(o).path:o.path,c=l.split("/").filter(N=>N.length>0),d=u.split("/").filter(N=>N.length>0);if(e){const N=/^[A-Z]:$/;if(c[0]&&N.test(c[0])&&(c[0]=c[0].toLowerCase()),d[0]&&N.test(d[0])&&(d[0]=d[0].toLowerCase()),c[0]!==d[0])return u.substring(1)}let g=0;for(;g<c.length&&c[g]===d[g];g++);const h="../".repeat(c.length-g),E=d.slice(g).join("/");return h+E}t.relative=n;function i(s){return Nt.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})(ft||(ft={}));class gR{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return ft.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:ft.joinPath(Nt.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:ft.joinPath(Nt.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(ft.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 yR{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Te.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Nt.parse(e.uri),Te.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Te.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=uu.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class TR{constructor(e){this.documentTrie=new gR,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ge(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 ln=Symbol("RefResolving");class RR{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=Te.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 ir(e.parseResult.value))await Je(r),Cs(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 ir(e.parseResult.value))await Je(r),Cs(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=ln;try{const i=this.getCandidate(e);if(vi(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=ln;try{const i=this.getCandidates(e),a=[];if(vi(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(Ke(this._ref))return this._ref;if(Qp(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=ln;const o=ls(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===ln&&a.throwCyclicReferenceError(e,r,i);return Ke(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return vi(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=ln;const o=ls(e).$document,l=a.getCandidates({reference:s,container:e,property:r}),u=[];if(vi(l))this._linkingError=l;else for(const c of l){const d=a.loadAstNode(c);d&&u.push({ref:d,$nodeDescription:c})}this._items=u,o==null||o.references.push(this)}else this._items===ln&&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(vi(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=ls(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 vR(t){return typeof t.name=="string"}class ER{getName(e){if(vR(e))return e.name}getNameNode(e){return Cd(e.$cstNode,"name")}}class $R{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=ir(e.Grammar).some(r=>Xs(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Bm(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(kt(i)||Tr(i))return tc(i);if(Array.isArray(i)){for(const a of i)if((kt(a)||Tr(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return tc(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Em(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 Cs(n))if(Tr(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=>ft.equals(a.sourceUri,r.documentUri))),n.push(...i),ge(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=nr(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:ks(a),local:!0})}}return n}}class fa{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Fo.sum(ge(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?ge(r):hd}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 ge(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ge(this.map.keys())}values(){return ge(this.map.values()).flat()}entriesGroupedByKey(){return ge(this.map.entries())}}class Vc{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 AR{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Te.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=bu,i=Te.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Je(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=Te.CancellationToken.None){const n=e.parseResult.value,i=new fa;for(const a of pa(n))await Je(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 Kc{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 CR{constructor(e,r,n){this.elements=new fa,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?ge(n).concat(this.outerScope.getElements(e)):ge(n)}getAllElements(){let e=ge(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Lh{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 SR extends Lh{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 kR extends Lh{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 wR extends SR{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 NR{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 wR(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=nr(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 Kc(ge(e),r,n)}createScopeForNodes(e,r,n){const i=ge(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new Kc(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new CR(this.indexManager.allElements(e)))}}function bR(t){return typeof t.$comment=="string"}function Hc(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class _R{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=nr(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(kt(r)){const d=r.ref,g=n?r.$refText:void 0;if(d){const h=nr(d);let E="";this.currentDocument&&this.currentDocument!==h&&(o?E=o(h.uri,d):E=h.uri.toString());const N=this.astNodeLocator.getAstNodePath(d);return{$ref:`${E}#${N}`,$refText:g}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:g}}else if(Tr(r)){const d=n?r.$refText:void 0,g=[];for(const h of r.items){const E=h.ref,N=nr(h.ref);let I="";this.currentDocument&&this.currentDocument!==N&&(o?I=o(N.uri,E):I=N.uri.toString());const C=this.astNodeLocator.getAstNodePath(E);g.push(`${I}#${C}`)}return{$refs:g,$refText:d}}else if(Ke(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(c=r.$cstNode)==null?void 0:c.text),s){d??(d={...r});const g=this.commentProvider.getComment(r);g&&(d.$comment=g.replace(/\r/g,""))}return d??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=Um(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 d=u[c];Hc(d)?u[c]=this.reviveReference(e,l,r,d,n):Ke(d)&&this.linkNode(d,r,n,e,l,c)}else Hc(u)?e[l]=this.reviveReference(e,l,r,u,n):Ke(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(Ke(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 d=this.getRefNode(n,c,a.uriConverter);Ke(d)&&u.push({ref:d})}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):Nt.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)):Nt.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 IR{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=ft.extname(e),i=ft.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 Ji(t){return{code:t}}var fu;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(fu||(fu={}));class PR{constructor(e){this.entries=new fa,this.knownCategories=new Set(fu.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 ga()}}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(oo(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=ge(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 LR=Object.freeze({validateNode:!0,validateChildren:!0});class OR{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=Te.CancellationToken.None){const i=e.parseResult,a=[];if(await Je(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)===St.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===St.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===St.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(oo(s))throw s;console.error("An error occurred during validation:",s)}return await Je(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:Eo(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:DR(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=Ho(i.token);if(a){const s={severity:Eo("error"),range:a,message:i.message,data:Ji(St.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:St.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=Te.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=Te.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Je(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Te.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=ir(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 d of c)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=ir(e).iterator();for(const o of s){await Je(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 LR}async validateAstAfter(e,r,n,i=Te.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Je(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:xR(n),severity:Eo(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 xR(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Cd(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=qm(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 Eo(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 DR(t){switch(t){case"error":return Ji(St.LexingError);case"warning":return Ji(St.LexingWarning);case"info":return Ji(St.LexingInfo);case"hint":return Ji(St.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var St;(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"})(St||(St={}));class MR{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??nr(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=ks(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return o()},selectionSegment:ks(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class GR{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Te.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of ir(i))await Je(r),Cs(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=[];kt(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Tr(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=nr(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=ks(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:ft.equals(l.documentUri,i)});return s}}class FR{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 zR=si();class UR{constructor(e){this._ready=new Ku,this.onConfigurationSectionUpdateEmitter=new zR.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 Nr={},br={},Xa={},$o={},z={},Yc;function Oh(){if(Yc)return z;Yc=1,Object.defineProperty(z,"__esModule",{value:!0}),z.Message=z.NotificationType9=z.NotificationType8=z.NotificationType7=z.NotificationType6=z.NotificationType5=z.NotificationType4=z.NotificationType3=z.NotificationType2=z.NotificationType1=z.NotificationType0=z.NotificationType=z.RequestType9=z.RequestType8=z.RequestType7=z.RequestType6=z.RequestType5=z.RequestType4=z.RequestType3=z.RequestType2=z.RequestType1=z.RequestType=z.RequestType0=z.AbstractMessageSignature=z.ParameterStructures=z.ResponseError=z.ErrorCodes=void 0;const t=$a();var e;(function(R){R.ParseError=-32700,R.InvalidRequest=-32600,R.MethodNotFound=-32601,R.InvalidParams=-32602,R.InternalError=-32603,R.jsonrpcReservedErrorRangeStart=-32099,R.serverErrorStart=-32099,R.MessageWriteError=-32099,R.MessageReadError=-32098,R.PendingResponseRejected=-32097,R.ConnectionInactive=-32096,R.ServerNotInitialized=-32002,R.UnknownErrorCode=-32001,R.jsonrpcReservedErrorRangeEnd=-32e3,R.serverErrorEnd=-32e3})(e||(z.ErrorCodes=e={}));class r extends Error{constructor(m,A,y){super(A),this.code=t.number(m)?m:e.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,r.prototype)}toJson(){const m={code:this.code,message:this.message};return this.data!==void 0&&(m.data=this.data),m}}z.ResponseError=r;class n{constructor(m){this.kind=m}static is(m){return m===n.auto||m===n.byName||m===n.byPosition}toString(){return this.kind}}z.ParameterStructures=n,n.auto=new n("auto"),n.byPosition=new n("byPosition"),n.byName=new n("byName");class i{constructor(m,A){this.method=m,this.numberOfParams=A}get parameterStructures(){return n.auto}}z.AbstractMessageSignature=i;class a extends i{constructor(m){super(m,0)}}z.RequestType0=a;class s extends i{constructor(m,A=n.auto){super(m,1),this._parameterStructures=A}get parameterStructures(){return this._parameterStructures}}z.RequestType=s;class o extends i{constructor(m,A=n.auto){super(m,1),this._parameterStructures=A}get parameterStructures(){return this._parameterStructures}}z.RequestType1=o;class l extends i{constructor(m){super(m,2)}}z.RequestType2=l;class u extends i{constructor(m){super(m,3)}}z.RequestType3=u;class c extends i{constructor(m){super(m,4)}}z.RequestType4=c;class d extends i{constructor(m){super(m,5)}}z.RequestType5=d;class g extends i{constructor(m){super(m,6)}}z.RequestType6=g;class h extends i{constructor(m){super(m,7)}}z.RequestType7=h;class E extends i{constructor(m){super(m,8)}}z.RequestType8=E;class N extends i{constructor(m){super(m,9)}}z.RequestType9=N;class I extends i{constructor(m,A=n.auto){super(m,1),this._parameterStructures=A}get parameterStructures(){return this._parameterStructures}}z.NotificationType=I;class C extends i{constructor(m){super(m,0)}}z.NotificationType0=C;class k extends i{constructor(m,A=n.auto){super(m,1),this._parameterStructures=A}get parameterStructures(){return this._parameterStructures}}z.NotificationType1=k;class S extends i{constructor(m){super(m,2)}}z.NotificationType2=S;class P extends i{constructor(m){super(m,3)}}z.NotificationType3=P;class H extends i{constructor(m){super(m,4)}}z.NotificationType4=H;class K extends i{constructor(m){super(m,5)}}z.NotificationType5=K;class J extends i{constructor(m){super(m,6)}}z.NotificationType6=J;class oe extends i{constructor(m){super(m,7)}}z.NotificationType7=oe;class fe extends i{constructor(m){super(m,8)}}z.NotificationType8=fe;class de extends i{constructor(m){super(m,9)}}z.NotificationType9=de;var b;return(function(R){function m(T){const $=T;return $&&t.string($.method)&&(t.string($.id)||t.number($.id))}R.isRequest=m;function A(T){const $=T;return $&&t.string($.method)&&T.id===void 0}R.isNotification=A;function y(T){const $=T;return $&&($.result!==void 0||!!$.error)&&(t.string($.id)||t.number($.id)||$.id===null)}R.isResponse=y})(b||(z.Message=b={})),z}var Bt={},Xc;function xh(){if(Xc)return Bt;Xc=1;var t;Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.LRUCache=Bt.LinkedMap=Bt.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||(Bt.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)}}Bt.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 Bt.LRUCache=n,Bt}var wi={},Jc;function qR(){if(Jc)return wi;Jc=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.Disposable=void 0;var t;return(function(e){function r(n){return{dispose:n}}e.create=r})(t||(wi.Disposable=t={})),wi}var _r={},Zc;function jR(){if(Zc)return _r;Zc=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.SharedArrayReceiverStrategy=_r.SharedArraySenderStrategy=void 0;const t=so();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()}}_r.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 _r.SharedArrayReceiverStrategy=a,_r}var Wt={},Ni={},Qc;function Dh(){if(Qc)return Ni;Qc=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.Semaphore=void 0;const t=rn();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 Ni.Semaphore=e,Ni}var ef;function BR(){if(ef)return Wt;ef=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.ReadableStreamMessageReader=Wt.AbstractMessageReader=Wt.MessageReader=void 0;const t=rn(),e=$a(),r=si(),n=Dh();var i;(function(l){function u(c){let d=c;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}l.is=u})(i||(Wt.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"}`)}}Wt.AbstractMessageReader=a;var s;(function(l){function u(c){let d,g;const h=new Map;let E;const N=new Map;if(c===void 0||typeof c=="string")d=c??"utf-8";else{if(d=c.charset??"utf-8",c.contentDecoder!==void 0&&(g=c.contentDecoder,h.set(g.name,g)),c.contentDecoders!==void 0)for(const I of c.contentDecoders)h.set(I.name,I);if(c.contentTypeDecoder!==void 0&&(E=c.contentTypeDecoder,N.set(E.name,E)),c.contentTypeDecoders!==void 0)for(const I of c.contentTypeDecoders)N.set(I.name,I)}return E===void 0&&(E=(0,t.default)().applicationJson.decoder,N.set(E.name,E)),{charset:d,contentDecoder:g,contentDecoders:h,contentTypeDecoder:E,contentTypeDecoders:N}}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(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),c}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const g=d.get("content-length");if(!g){this.fireError(new Error(`Header must provide a Content-Length property.
122
+ ${JSON.stringify(Object.fromEntries(d))}`));return}const h=parseInt(g);if(isNaN(h)){this.fireError(new Error(`Content-Length value must be a number. Got ${g}`));return}this.nextMessageLength=h}const c=this.buffer.tryReadBody(this.nextMessageLength);if(c===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(c):c,g=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(g)}).catch(d=>{this.fireError(d)})}}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 Wt.ReadableStreamMessageReader=o,Wt}var Vt={},tf;function WR(){if(tf)return Vt;tf=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.WriteableStreamMessageWriter=Vt.AbstractMessageWriter=Vt.MessageWriter=void 0;const t=rn(),e=$a(),r=Dh(),n=si(),i="Content-Length: ",a=`\r
123
+ `;var s;(function(c){function d(g){let h=g;return h&&e.func(h.dispose)&&e.func(h.onClose)&&e.func(h.onError)&&e.func(h.write)}c.is=d})(s||(Vt.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(d,g,h){this.errorEmitter.fire([this.asError(d),g,h])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}Vt.AbstractMessageWriter=o;var l;(function(c){function d(g){return g===void 0||typeof g=="string"?{charset:g??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:g.charset??"utf-8",contentEncoder:g.contentEncoder,contentTypeEncoder:g.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}c.fromOptions=d})(l||(l={}));class u extends o{constructor(d,g){super(),this.writable=d,this.options=l.fromOptions(g),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(h=>this.fireError(h)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(h=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(h):h).then(h=>{const E=[];return E.push(i,h.byteLength.toString(),a),E.push(a),this.doWrite(d,E,h)},h=>{throw this.fireError(h),h}))}async doWrite(d,g,h){try{return await this.writable.write(g.join(""),"ascii"),this.writable.write(h)}catch(E){return this.handleError(E,d),Promise.reject(E)}}handleError(d,g){this.errorCount++,this.fireError(d,g,this.errorCount)}end(){this.writable.end()}}return Vt.WriteableStreamMessageWriter=u,Vt}var bi={},rf;function VR(){if(rf)return bi;rf=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.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 h=this._chunks[o];for(l=0;l<h.length;){switch(h[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+=h.byteLength,o++}if(s!==4)return;const c=this._read(u+l),d=new Map,g=this.toString(c,"ascii").split(r);if(g.length<2)return d;for(let h=0;h<g.length-2;h++){const E=g[h],N=E.indexOf(":");if(N===-1)throw new Error(`Message header must separate key and value using ':'
125
+ ${E}`);const I=E.substr(0,N),C=E.substr(N+1).trim();d.set(a?I.toLowerCase():I,C)}return d}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 bi.AbstractMessageBuffer=n,bi}var Ao={},nf;function KR(){return nf||(nf=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=rn(),r=$a(),n=Oh(),i=xh(),a=si(),s=so();var o;(function(m){m.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(m){function A(y){return typeof y=="string"||typeof y=="number"}m.is=A})(l||(t.ProgressToken=l={}));var u;(function(m){m.type=new n.NotificationType("$/progress")})(u||(u={}));class c{constructor(){}}t.ProgressType=c;var d;(function(m){function A(y){return r.func(y)}m.is=A})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var g;(function(m){m[m.Off=0]="Off",m[m.Messages=1]="Messages",m[m.Compact=2]="Compact",m[m.Verbose=3]="Verbose"})(g||(t.Trace=g={}));var h;(function(m){m.Off="off",m.Messages="messages",m.Compact="compact",m.Verbose="verbose"})(h||(t.TraceValues=h={})),(function(m){function A(T){if(!r.string(T))return m.Off;switch(T=T.toLowerCase(),T){case"off":return m.Off;case"messages":return m.Messages;case"compact":return m.Compact;case"verbose":return m.Verbose;default:return m.Off}}m.fromString=A;function y(T){switch(T){case m.Off:return"off";case m.Messages:return"messages";case m.Compact:return"compact";case m.Verbose:return"verbose";default:return"off"}}m.toString=y})(g||(t.Trace=g={}));var E;(function(m){m.Text="text",m.JSON="json"})(E||(t.TraceFormat=E={})),(function(m){function A(y){return r.string(y)?(y=y.toLowerCase(),y==="json"?m.JSON:m.Text):m.Text}m.fromString=A})(E||(t.TraceFormat=E={}));var N;(function(m){m.type=new n.NotificationType("$/setTrace")})(N||(t.SetTraceNotification=N={}));var I;(function(m){m.type=new n.NotificationType("$/logTrace")})(I||(t.LogTraceNotification=I={}));var C;(function(m){m[m.Closed=1]="Closed",m[m.Disposed=2]="Disposed",m[m.AlreadyListening=3]="AlreadyListening"})(C||(t.ConnectionErrors=C={}));class k extends Error{constructor(A,y){super(y),this.code=A,Object.setPrototypeOf(this,k.prototype)}}t.ConnectionError=k;var S;(function(m){function A(y){const T=y;return T&&r.func(T.cancelUndispatched)}m.is=A})(S||(t.ConnectionStrategy=S={}));var P;(function(m){function A(y){const T=y;return T&&(T.kind===void 0||T.kind==="id")&&r.func(T.createCancellationTokenSource)&&(T.dispose===void 0||r.func(T.dispose))}m.is=A})(P||(t.IdCancellationReceiverStrategy=P={}));var H;(function(m){function A(y){const T=y;return T&&T.kind==="request"&&r.func(T.createCancellationTokenSource)&&(T.dispose===void 0||r.func(T.dispose))}m.is=A})(H||(t.RequestCancellationReceiverStrategy=H={}));var K;(function(m){m.Message=Object.freeze({createCancellationTokenSource(y){return new s.CancellationTokenSource}});function A(y){return P.is(y)||H.is(y)}m.is=A})(K||(t.CancellationReceiverStrategy=K={}));var J;(function(m){m.Message=Object.freeze({sendCancellation(y,T){return y.sendNotification(o.type,{id:T})},cleanup(y){}});function A(y){const T=y;return T&&r.func(T.sendCancellation)&&r.func(T.cleanup)}m.is=A})(J||(t.CancellationSenderStrategy=J={}));var oe;(function(m){m.Message=Object.freeze({receiver:K.Message,sender:J.Message});function A(y){const T=y;return T&&K.is(T.receiver)&&J.is(T.sender)}m.is=A})(oe||(t.CancellationStrategy=oe={}));var fe;(function(m){function A(y){const T=y;return T&&r.func(T.handleMessage)}m.is=A})(fe||(t.MessageStrategy=fe={}));var de;(function(m){function A(y){const T=y;return T&&(oe.is(T.cancellationStrategy)||S.is(T.connectionStrategy)||fe.is(T.messageStrategy))}m.is=A})(de||(t.ConnectionOptions=de={}));var b;(function(m){m[m.New=1]="New",m[m.Listening=2]="Listening",m[m.Closed=3]="Closed",m[m.Disposed=4]="Disposed"})(b||(b={}));function R(m,A,y,T){const $=y!==void 0?y:t.NullLogger;let O=0,D=0,x=0;const q="2.0";let F;const ie=new Map;let B;const re=new Map,xe=new Map;let ve,he=new i.LinkedMap,Ie=new Map,De=new Set,Ne=new Map,Q=g.Off,ot=E.Text,Ee,vt=b.New;const nn=new a.Emitter,ui=new a.Emitter,ci=new a.Emitter,fi=new a.Emitter,di=new a.Emitter,Et=T&&T.cancellationStrategy?T.cancellationStrategy:oe.Message;function hi(p){if(p===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+p.toString()}function Aa(p){return p===null?"res-unknown-"+(++x).toString():"res-"+p.toString()}function Ca(){return"not-"+(++D).toString()}function Sa(p,w){n.Message.isRequest(w)?p.set(hi(w.id),w):n.Message.isResponse(w)?p.set(Aa(w.id),w):p.set(Ca(),w)}function ka(p){}function pi(){return vt===b.Listening}function mi(){return vt===b.Closed}function Ut(){return vt===b.Disposed}function gi(){(vt===b.New||vt===b.Listening)&&(vt=b.Closed,ui.fire(void 0))}function wa(p){nn.fire([p,void 0,void 0])}function Na(p){nn.fire(p)}m.onClose(gi),m.onError(wa),A.onClose(gi),A.onError(Na);function yi(){ve||he.size===0||(ve=(0,e.default)().timer.setImmediate(()=>{ve=void 0,ba()}))}function Ti(p){n.Message.isRequest(p)?Ia(p):n.Message.isNotification(p)?La(p):n.Message.isResponse(p)?Pa(p):Oa(p)}function ba(){if(he.size===0)return;const p=he.shift();try{const w=T==null?void 0:T.messageStrategy;fe.is(w)?w.handleMessage(p,Ti):Ti(p)}finally{yi()}}const _a=p=>{try{if(n.Message.isNotification(p)&&p.method===o.type.method){const w=p.params.id,L=hi(w),G=he.get(L);if(n.Message.isRequest(G)){const ae=T==null?void 0:T.connectionStrategy,le=ae&&ae.cancelUndispatched?ae.cancelUndispatched(G,ka):void 0;if(le&&(le.error!==void 0||le.result!==void 0)){he.delete(L),Ne.delete(w),le.id=G.id,Cr(le,p.method,Date.now()),A.write(le).catch(()=>$.error("Sending response for canceled message failed."));return}}const ue=Ne.get(w);if(ue!==void 0){ue.cancel(),an(p);return}else De.add(w)}Sa(he,p)}finally{yi()}};function Ia(p){if(Ut())return;function w(Z,pe,ne){const Pe={jsonrpc:q,id:p.id};Z instanceof n.ResponseError?Pe.error=Z.toJson():Pe.result=Z===void 0?null:Z,Cr(Pe,pe,ne),A.write(Pe).catch(()=>$.error("Sending response failed."))}function L(Z,pe,ne){const Pe={jsonrpc:q,id:p.id,error:Z.toJson()};Cr(Pe,pe,ne),A.write(Pe).catch(()=>$.error("Sending response failed."))}function G(Z,pe,ne){Z===void 0&&(Z=null);const Pe={jsonrpc:q,id:p.id,result:Z};Cr(Pe,pe,ne),A.write(Pe).catch(()=>$.error("Sending response failed."))}Ma(p);const ue=ie.get(p.method);let ae,le;ue&&(ae=ue.type,le=ue.handler);const ke=Date.now();if(le||F){const Z=p.id??String(Date.now()),pe=P.is(Et.receiver)?Et.receiver.createCancellationTokenSource(Z):Et.receiver.createCancellationTokenSource(p);p.id!==null&&De.has(p.id)&&pe.cancel(),p.id!==null&&Ne.set(Z,pe);try{let ne;if(le)if(p.params===void 0){if(ae!==void 0&&ae.numberOfParams!==0){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${p.method} defines ${ae.numberOfParams} params but received none.`),p.method,ke);return}ne=le(pe.token)}else if(Array.isArray(p.params)){if(ae!==void 0&&ae.parameterStructures===n.ParameterStructures.byName){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${p.method} defines parameters by name but received parameters by position`),p.method,ke);return}ne=le(...p.params,pe.token)}else{if(ae!==void 0&&ae.parameterStructures===n.ParameterStructures.byPosition){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${p.method} defines parameters by position but received parameters by name`),p.method,ke);return}ne=le(p.params,pe.token)}else F&&(ne=F(p.method,p.params,pe.token));const Pe=ne;ne?Pe.then?Pe.then(He=>{Ne.delete(Z),w(He,p.method,ke)},He=>{Ne.delete(Z),He instanceof n.ResponseError?L(He,p.method,ke):He&&r.string(He.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${p.method} failed with message: ${He.message}`),p.method,ke):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${p.method} failed unexpectedly without providing any details.`),p.method,ke)}):(Ne.delete(Z),w(ne,p.method,ke)):(Ne.delete(Z),G(ne,p.method,ke))}catch(ne){Ne.delete(Z),ne instanceof n.ResponseError?w(ne,p.method,ke):ne&&r.string(ne.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${p.method} failed with message: ${ne.message}`),p.method,ke):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${p.method} failed unexpectedly without providing any details.`),p.method,ke)}}else L(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${p.method}`),p.method,ke)}function Pa(p){if(!Ut())if(p.id===null)p.error?$.error(`Received response message without id: Error is:
126
+ ${JSON.stringify(p.error,void 0,4)}`):$.error("Received response message without id. No further error information provided.");else{const w=p.id,L=Ie.get(w);if(Ga(p,L),L!==void 0){Ie.delete(w);try{if(p.error){const G=p.error;L.reject(new n.ResponseError(G.code,G.message,G.data))}else if(p.result!==void 0)L.resolve(p.result);else throw new Error("Should never happen.")}catch(G){G.message?$.error(`Response handler '${L.method}' failed with message: ${G.message}`):$.error(`Response handler '${L.method}' failed unexpectedly.`)}}}}function La(p){if(Ut())return;let w,L;if(p.method===o.type.method){const G=p.params.id;De.delete(G),an(p);return}else{const G=re.get(p.method);G&&(L=G.handler,w=G.type)}if(L||B)try{if(an(p),L)if(p.params===void 0)w!==void 0&&w.numberOfParams!==0&&w.parameterStructures!==n.ParameterStructures.byName&&$.error(`Notification ${p.method} defines ${w.numberOfParams} params but received none.`),L();else if(Array.isArray(p.params)){const G=p.params;p.method===u.type.method&&G.length===2&&l.is(G[0])?L({token:G[0],value:G[1]}):(w!==void 0&&(w.parameterStructures===n.ParameterStructures.byName&&$.error(`Notification ${p.method} defines parameters by name but received parameters by position`),w.numberOfParams!==p.params.length&&$.error(`Notification ${p.method} defines ${w.numberOfParams} params but received ${G.length} arguments`)),L(...G))}else w!==void 0&&w.parameterStructures===n.ParameterStructures.byPosition&&$.error(`Notification ${p.method} defines parameters by position but received parameters by name`),L(p.params);else B&&B(p.method,p.params)}catch(G){G.message?$.error(`Notification handler '${p.method}' failed with message: ${G.message}`):$.error(`Notification handler '${p.method}' failed unexpectedly.`)}else ci.fire(p)}function Oa(p){if(!p){$.error("Received empty message.");return}$.error(`Received message which is neither a response nor a notification message:
127
+ ${JSON.stringify(p,null,4)}`);const w=p;if(r.string(w.id)||r.number(w.id)){const L=w.id,G=Ie.get(L);G&&G.reject(new Error("The received response has neither a result nor an error property."))}}function $t(p){if(p!=null)switch(Q){case g.Verbose:return JSON.stringify(p,null,4);case g.Compact:return JSON.stringify(p);default:return}}function xa(p){if(!(Q===g.Off||!Ee))if(ot===E.Text){let w;(Q===g.Verbose||Q===g.Compact)&&p.params&&(w=`Params: ${$t(p.params)}
128
+
129
+ `),Ee.log(`Sending request '${p.method} - (${p.id})'.`,w)}else qt("send-request",p)}function Da(p){if(!(Q===g.Off||!Ee))if(ot===E.Text){let w;(Q===g.Verbose||Q===g.Compact)&&(p.params?w=`Params: ${$t(p.params)}
130
+
131
+ `:w=`No parameters provided.
132
+
133
+ `),Ee.log(`Sending notification '${p.method}'.`,w)}else qt("send-notification",p)}function Cr(p,w,L){if(!(Q===g.Off||!Ee))if(ot===E.Text){let G;(Q===g.Verbose||Q===g.Compact)&&(p.error&&p.error.data?G=`Error data: ${$t(p.error.data)}
134
+
135
+ `:p.result?G=`Result: ${$t(p.result)}
136
+
137
+ `:p.error===void 0&&(G=`No result returned.
138
+
139
+ `)),Ee.log(`Sending response '${w} - (${p.id})'. Processing request took ${Date.now()-L}ms`,G)}else qt("send-response",p)}function Ma(p){if(!(Q===g.Off||!Ee))if(ot===E.Text){let w;(Q===g.Verbose||Q===g.Compact)&&p.params&&(w=`Params: ${$t(p.params)}
140
+
141
+ `),Ee.log(`Received request '${p.method} - (${p.id})'.`,w)}else qt("receive-request",p)}function an(p){if(!(Q===g.Off||!Ee||p.method===I.type.method))if(ot===E.Text){let w;(Q===g.Verbose||Q===g.Compact)&&(p.params?w=`Params: ${$t(p.params)}
142
+
143
+ `:w=`No parameters provided.
144
+
145
+ `),Ee.log(`Received notification '${p.method}'.`,w)}else qt("receive-notification",p)}function Ga(p,w){if(!(Q===g.Off||!Ee))if(ot===E.Text){let L;if((Q===g.Verbose||Q===g.Compact)&&(p.error&&p.error.data?L=`Error data: ${$t(p.error.data)}
146
+
147
+ `:p.result?L=`Result: ${$t(p.result)}
148
+
149
+ `:p.error===void 0&&(L=`No result returned.
150
+
151
+ `)),w){const G=p.error?` Request failed: ${p.error.message} (${p.error.code}).`:"";Ee.log(`Received response '${w.method} - (${p.id})' in ${Date.now()-w.timerStart}ms.${G}`,L)}else Ee.log(`Received response ${p.id} without active response promise.`,L)}else qt("receive-response",p)}function qt(p,w){if(!Ee||Q===g.Off)return;const L={isLSPMessage:!0,type:p,message:w,timestamp:Date.now()};Ee.log(L)}function pr(){if(mi())throw new k(C.Closed,"Connection is closed.");if(Ut())throw new k(C.Disposed,"Connection is disposed.")}function Fa(){if(pi())throw new k(C.AlreadyListening,"Connection is already listening")}function za(){if(!pi())throw new Error("Call listen() first.")}function mr(p){return p===void 0?null:p}function Ri(p){if(p!==null)return p}function f(p){return p!=null&&!Array.isArray(p)&&typeof p=="object"}function Ce(p,w){switch(p){case n.ParameterStructures.auto:return f(w)?Ri(w):[mr(w)];case n.ParameterStructures.byName:if(!f(w))throw new Error("Received parameters by name but param is not an object literal.");return Ri(w);case n.ParameterStructures.byPosition:return[mr(w)];default:throw new Error(`Unknown parameter structure ${p.toString()}`)}}function Se(p,w){let L;const G=p.numberOfParams;switch(G){case 0:L=void 0;break;case 1:L=Ce(p.parameterStructures,w[0]);break;default:L=[];for(let ue=0;ue<w.length&&ue<G;ue++)L.push(mr(w[ue]));if(w.length<G)for(let ue=w.length;ue<G;ue++)L.push(null);break}return L}const V={sendNotification:(p,...w)=>{pr();let L,G;if(r.string(p)){L=p;const ae=w[0];let le=0,ke=n.ParameterStructures.auto;n.ParameterStructures.is(ae)&&(le=1,ke=ae);let Z=w.length;const pe=Z-le;switch(pe){case 0:G=void 0;break;case 1:G=Ce(ke,w[le]);break;default:if(ke===n.ParameterStructures.byName)throw new Error(`Received ${pe} parameters for 'by Name' notification parameter structure.`);G=w.slice(le,Z).map(ne=>mr(ne));break}}else{const ae=w;L=p.method,G=Se(p,ae)}const ue={jsonrpc:q,method:L,params:G};return Da(ue),A.write(ue).catch(ae=>{throw $.error("Sending notification failed."),ae})},onNotification:(p,w)=>{pr();let L;return r.func(p)?B=p:w&&(r.string(p)?(L=p,re.set(p,{type:void 0,handler:w})):(L=p.method,re.set(p.method,{type:p,handler:w}))),{dispose:()=>{L!==void 0?re.delete(L):B=void 0}}},onProgress:(p,w,L)=>{if(xe.has(w))throw new Error(`Progress handler for token ${w} already registered`);return xe.set(w,L),{dispose:()=>{xe.delete(w)}}},sendProgress:(p,w,L)=>V.sendNotification(u.type,{token:w,value:L}),onUnhandledProgress:fi.event,sendRequest:(p,...w)=>{pr(),za();let L,G,ue;if(r.string(p)){L=p;const Z=w[0],pe=w[w.length-1];let ne=0,Pe=n.ParameterStructures.auto;n.ParameterStructures.is(Z)&&(ne=1,Pe=Z);let He=w.length;s.CancellationToken.is(pe)&&(He=He-1,ue=pe);const It=He-ne;switch(It){case 0:G=void 0;break;case 1:G=Ce(Pe,w[ne]);break;default:if(Pe===n.ParameterStructures.byName)throw new Error(`Received ${It} parameters for 'by Name' request parameter structure.`);G=w.slice(ne,He).map(cp=>mr(cp));break}}else{const Z=w;L=p.method,G=Se(p,Z);const pe=p.numberOfParams;ue=s.CancellationToken.is(Z[pe])?Z[pe]:void 0}const ae=O++;let le;ue&&(le=ue.onCancellationRequested(()=>{const Z=Et.sender.sendCancellation(V,ae);return Z===void 0?($.log(`Received no promise from cancellation strategy when cancelling id ${ae}`),Promise.resolve()):Z.catch(()=>{$.log(`Sending cancellation messages for id ${ae} failed`)})}));const ke={jsonrpc:q,id:ae,method:L,params:G};return xa(ke),typeof Et.sender.enableCancellation=="function"&&Et.sender.enableCancellation(ke),new Promise(async(Z,pe)=>{const ne=It=>{Z(It),Et.sender.cleanup(ae),le==null||le.dispose()},Pe=It=>{pe(It),Et.sender.cleanup(ae),le==null||le.dispose()},He={method:L,timerStart:Date.now(),resolve:ne,reject:Pe};try{await A.write(ke),Ie.set(ae,He)}catch(It){throw $.error("Sending request failed."),He.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,It.message?It.message:"Unknown reason")),It}})},onRequest:(p,w)=>{pr();let L=null;return d.is(p)?(L=void 0,F=p):r.string(p)?(L=null,w!==void 0&&(L=p,ie.set(p,{handler:w,type:void 0}))):w!==void 0&&(L=p.method,ie.set(p.method,{type:p,handler:w})),{dispose:()=>{L!==null&&(L!==void 0?ie.delete(L):F=void 0)}}},hasPendingResponse:()=>Ie.size>0,trace:async(p,w,L)=>{let G=!1,ue=E.Text;L!==void 0&&(r.boolean(L)?G=L:(G=L.sendNotification||!1,ue=L.traceFormat||E.Text)),Q=p,ot=ue,Q===g.Off?Ee=void 0:Ee=w,G&&!mi()&&!Ut()&&await V.sendNotification(N.type,{value:g.toString(p)})},onError:nn.event,onClose:ui.event,onUnhandledNotification:ci.event,onDispose:di.event,end:()=>{A.end()},dispose:()=>{if(Ut())return;vt=b.Disposed,di.fire(void 0);const p=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const w of Ie.values())w.reject(p);Ie=new Map,Ne=new Map,De=new Set,he=new i.LinkedMap,r.func(A.dispose)&&A.dispose(),r.func(m.dispose)&&m.dispose()},listen:()=>{pr(),Fa(),vt=b.Listening,m.listen(_a)},inspect:()=>{(0,e.default)().console.log("inspect")}};return V.onNotification(I.type,p=>{if(Q===g.Off||!Ee)return;const w=Q===g.Verbose||Q===g.Compact;Ee.log(p.message,w?p.verbose:void 0)}),V.onNotification(u.type,p=>{const w=xe.get(p.token);w?w(p.value):fi.fire(p)}),V}t.createMessageConnection=R})(Ao)),Ao}var af;function du(){return af||(af=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=Oh();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=xh();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=qR();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return n.Disposable}});const i=si();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const a=so();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const s=jR();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const o=BR();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=WR();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=VR();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const c=KR();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 d=rn();t.RAL=d.default})($o)),$o}var sf;function HR(){if(sf)return Xa;sf=1,Object.defineProperty(Xa,"__esModule",{value:!0});const t=du();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(d=>{this._onData.fire(new Uint8Array(d))},()=>{(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={})),Xa.default=s,Xa}var of;function oi(){return of||(of=1,(function(t){var e=br&&br.__createBinding||(Object.create?(function(l,u,c,d){d===void 0&&(d=c);var g=Object.getOwnPropertyDescriptor(u,c);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[c]}}),Object.defineProperty(l,d,g)}):(function(l,u,c,d){d===void 0&&(d=c),l[d]=u[c]})),r=br&&br.__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,HR().default.install();const i=du();r(du(),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,d){return c===void 0&&(c=i.NullLogger),i.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,i.createMessageConnection)(l,u,c,d)}t.createMessageConnection=o})(br)),br}var Co,lf;function uf(){return lf||(lf=1,Co=oi()),Co}var Ir={};const Hu=$p(VT);var Ye={},cf;function Re(){if(cf)return Ye;cf=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.ProtocolNotificationType=Ye.ProtocolNotificationType0=Ye.ProtocolRequestType=Ye.ProtocolRequestType0=Ye.RegistrationType=Ye.MessageDirection=void 0;const t=oi();var e;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(e||(Ye.MessageDirection=e={}));class r{constructor(l){this.method=l}}Ye.RegistrationType=r;class n extends t.RequestType0{constructor(l){super(l)}}Ye.ProtocolRequestType0=n;class i extends t.RequestType{constructor(l){super(l,t.ParameterStructures.byName)}}Ye.ProtocolRequestType=i;class a extends t.NotificationType0{constructor(l){super(l)}}Ye.ProtocolNotificationType0=a;class s extends t.NotificationType{constructor(l){super(l,t.ParameterStructures.byName)}}return Ye.ProtocolNotificationType=s,Ye}var So={},we={},ff;function Yu(){if(ff)return we;ff=1,Object.defineProperty(we,"__esModule",{value:!0}),we.objectLiteral=we.typedArray=we.stringArray=we.array=we.func=we.error=we.number=we.string=we.boolean=void 0;function t(u){return u===!0||u===!1}we.boolean=t;function e(u){return typeof u=="string"||u instanceof String}we.string=e;function r(u){return typeof u=="number"||u instanceof Number}we.number=r;function n(u){return u instanceof Error}we.error=n;function i(u){return typeof u=="function"}we.func=i;function a(u){return Array.isArray(u)}we.array=a;function s(u){return a(u)&&u.every(c=>e(c))}we.stringArray=s;function o(u,c){return Array.isArray(u)&&u.every(c)}we.typedArray=o;function l(u){return u!==null&&typeof u=="object"}return we.objectLiteral=l,we}var _i={},df;function YR(){if(df)return _i;df=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.ImplementationRequest=void 0;const t=Re();var e;return(function(r){r.method="textDocument/implementation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(_i.ImplementationRequest=e={})),_i}var Ii={},hf;function XR(){if(hf)return Ii;hf=1,Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.TypeDefinitionRequest=void 0;const t=Re();var e;return(function(r){r.method="textDocument/typeDefinition",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ii.TypeDefinitionRequest=e={})),Ii}var Pr={},pf;function JR(){if(pf)return Pr;pf=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.DidChangeWorkspaceFoldersNotification=Pr.WorkspaceFoldersRequest=void 0;const t=Re();var e;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(e||(Pr.WorkspaceFoldersRequest=e={}));var r;return(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolNotificationType(n.method)})(r||(Pr.DidChangeWorkspaceFoldersNotification=r={})),Pr}var Pi={},mf;function ZR(){if(mf)return Pi;mf=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.ConfigurationRequest=void 0;const t=Re();var e;return(function(r){r.method="workspace/configuration",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType(r.method)})(e||(Pi.ConfigurationRequest=e={})),Pi}var Lr={},gf;function QR(){if(gf)return Lr;gf=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.ColorPresentationRequest=Lr.DocumentColorRequest=void 0;const t=Re();var e;(function(n){n.method="textDocument/documentColor",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(Lr.DocumentColorRequest=e={}));var r;return(function(n){n.method="textDocument/colorPresentation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(Lr.ColorPresentationRequest=r={})),Lr}var Or={},yf;function ev(){if(yf)return Or;yf=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.FoldingRangeRefreshRequest=Or.FoldingRangeRequest=void 0;const t=Re();var e;(function(n){n.method="textDocument/foldingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(Or.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||(Or.FoldingRangeRefreshRequest=r={})),Or}var Li={},Tf;function tv(){if(Tf)return Li;Tf=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.DeclarationRequest=void 0;const t=Re();var e;return(function(r){r.method="textDocument/declaration",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Li.DeclarationRequest=e={})),Li}var Oi={},Rf;function rv(){if(Rf)return Oi;Rf=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.SelectionRangeRequest=void 0;const t=Re();var e;return(function(r){r.method="textDocument/selectionRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Oi.SelectionRangeRequest=e={})),Oi}var Kt={},vf;function nv(){if(vf)return Kt;vf=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.WorkDoneProgressCancelNotification=Kt.WorkDoneProgressCreateRequest=Kt.WorkDoneProgress=void 0;const t=oi(),e=Re();var r;(function(a){a.type=new t.ProgressType;function s(o){return o===a.type}a.is=s})(r||(Kt.WorkDoneProgress=r={}));var n;(function(a){a.method="window/workDoneProgress/create",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType(a.method)})(n||(Kt.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||(Kt.WorkDoneProgressCancelNotification=i={})),Kt}var Ht={},Ef;function iv(){if(Ef)return Ht;Ef=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.CallHierarchyOutgoingCallsRequest=Ht.CallHierarchyIncomingCallsRequest=Ht.CallHierarchyPrepareRequest=void 0;const t=Re();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Ht.CallHierarchyPrepareRequest=e={}));var r;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(Ht.CallHierarchyIncomingCallsRequest=r={}));var n;return(function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Ht.CallHierarchyOutgoingCallsRequest=n={})),Ht}var Xe={},$f;function av(){if($f)return Xe;$f=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.SemanticTokensRefreshRequest=Xe.SemanticTokensRangeRequest=Xe.SemanticTokensDeltaRequest=Xe.SemanticTokensRequest=Xe.SemanticTokensRegistrationType=Xe.TokenFormat=void 0;const t=Re();var e;(function(o){o.Relative="relative"})(e||(Xe.TokenFormat=e={}));var r;(function(o){o.method="textDocument/semanticTokens",o.type=new t.RegistrationType(o.method)})(r||(Xe.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||(Xe.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||(Xe.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||(Xe.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||(Xe.SemanticTokensRefreshRequest=s={})),Xe}var xi={},Af;function sv(){if(Af)return xi;Af=1,Object.defineProperty(xi,"__esModule",{value:!0}),xi.ShowDocumentRequest=void 0;const t=Re();var e;return(function(r){r.method="window/showDocument",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType(r.method)})(e||(xi.ShowDocumentRequest=e={})),xi}var Di={},Cf;function ov(){if(Cf)return Di;Cf=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.LinkedEditingRangeRequest=void 0;const t=Re();var e;return(function(r){r.method="textDocument/linkedEditingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Di.LinkedEditingRangeRequest=e={})),Di}var Ge={},Sf;function lv(){if(Sf)return Ge;Sf=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.WillDeleteFilesRequest=Ge.DidDeleteFilesNotification=Ge.DidRenameFilesNotification=Ge.WillRenameFilesRequest=Ge.DidCreateFilesNotification=Ge.WillCreateFilesRequest=Ge.FileOperationPatternKind=void 0;const t=Re();var e;(function(l){l.file="file",l.folder="folder"})(e||(Ge.FileOperationPatternKind=e={}));var r;(function(l){l.method="workspace/willCreateFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(r||(Ge.WillCreateFilesRequest=r={}));var n;(function(l){l.method="workspace/didCreateFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(n||(Ge.DidCreateFilesNotification=n={}));var i;(function(l){l.method="workspace/willRenameFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(Ge.WillRenameFilesRequest=i={}));var a;(function(l){l.method="workspace/didRenameFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(a||(Ge.DidRenameFilesNotification=a={}));var s;(function(l){l.method="workspace/didDeleteFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(s||(Ge.DidDeleteFilesNotification=s={}));var o;return(function(l){l.method="workspace/willDeleteFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(Ge.WillDeleteFilesRequest=o={})),Ge}var Yt={},kf;function uv(){if(kf)return Yt;kf=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.MonikerRequest=Yt.MonikerKind=Yt.UniquenessLevel=void 0;const t=Re();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(Yt.UniquenessLevel=e={}));var r;(function(i){i.$import="import",i.$export="export",i.local="local"})(r||(Yt.MonikerKind=r={}));var n;return(function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Yt.MonikerRequest=n={})),Yt}var Xt={},wf;function cv(){if(wf)return Xt;wf=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.TypeHierarchySubtypesRequest=Xt.TypeHierarchySupertypesRequest=Xt.TypeHierarchyPrepareRequest=void 0;const t=Re();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Xt.TypeHierarchyPrepareRequest=e={}));var r;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(Xt.TypeHierarchySupertypesRequest=r={}));var n;return(function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Xt.TypeHierarchySubtypesRequest=n={})),Xt}var xr={},Nf;function fv(){if(Nf)return xr;Nf=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.InlineValueRefreshRequest=xr.InlineValueRequest=void 0;const t=Re();var e;(function(n){n.method="textDocument/inlineValue",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(xr.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||(xr.InlineValueRefreshRequest=r={})),xr}var Jt={},bf;function dv(){if(bf)return Jt;bf=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.InlayHintRefreshRequest=Jt.InlayHintResolveRequest=Jt.InlayHintRequest=void 0;const t=Re();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Jt.InlayHintRequest=e={}));var r;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(Jt.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||(Jt.InlayHintRefreshRequest=n={})),Jt}var lt={},_f;function hv(){if(_f)return lt;_f=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.DiagnosticRefreshRequest=lt.WorkspaceDiagnosticRequest=lt.DocumentDiagnosticRequest=lt.DocumentDiagnosticReportKind=lt.DiagnosticServerCancellationData=void 0;const t=oi(),e=Yu(),r=Re();var n;(function(l){function u(c){const d=c;return d&&e.boolean(d.retriggerRequest)}l.is=u})(n||(lt.DiagnosticServerCancellationData=n={}));var i;(function(l){l.Full="full",l.Unchanged="unchanged"})(i||(lt.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||(lt.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||(lt.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||(lt.DiagnosticRefreshRequest=o={})),lt}var me={},If;function pv(){if(If)return me;If=1,Object.defineProperty(me,"__esModule",{value:!0}),me.DidCloseNotebookDocumentNotification=me.DidSaveNotebookDocumentNotification=me.DidChangeNotebookDocumentNotification=me.NotebookCellArrayChange=me.DidOpenNotebookDocumentNotification=me.NotebookDocumentSyncRegistrationType=me.NotebookDocument=me.NotebookCell=me.ExecutionSummary=me.NotebookCellKind=void 0;const t=Hu,e=Yu(),r=Re();var n;(function(h){h.Markup=1,h.Code=2;function E(N){return N===1||N===2}h.is=E})(n||(me.NotebookCellKind=n={}));var i;(function(h){function E(C,k){const S={executionOrder:C};return(k===!0||k===!1)&&(S.success=k),S}h.create=E;function N(C){const k=C;return e.objectLiteral(k)&&t.uinteger.is(k.executionOrder)&&(k.success===void 0||e.boolean(k.success))}h.is=N;function I(C,k){return C===k?!0:C==null||k===null||k===void 0?!1:C.executionOrder===k.executionOrder&&C.success===k.success}h.equals=I})(i||(me.ExecutionSummary=i={}));var a;(function(h){function E(k,S){return{kind:k,document:S}}h.create=E;function N(k){const S=k;return e.objectLiteral(S)&&n.is(S.kind)&&t.DocumentUri.is(S.document)&&(S.metadata===void 0||e.objectLiteral(S.metadata))}h.is=N;function I(k,S){const P=new Set;return k.document!==S.document&&P.add("document"),k.kind!==S.kind&&P.add("kind"),k.executionSummary!==S.executionSummary&&P.add("executionSummary"),(k.metadata!==void 0||S.metadata!==void 0)&&!C(k.metadata,S.metadata)&&P.add("metadata"),(k.executionSummary!==void 0||S.executionSummary!==void 0)&&!i.equals(k.executionSummary,S.executionSummary)&&P.add("executionSummary"),P}h.diff=I;function C(k,S){if(k===S)return!0;if(k==null||S===null||S===void 0||typeof k!=typeof S||typeof k!="object")return!1;const P=Array.isArray(k),H=Array.isArray(S);if(P!==H)return!1;if(P&&H){if(k.length!==S.length)return!1;for(let K=0;K<k.length;K++)if(!C(k[K],S[K]))return!1}if(e.objectLiteral(k)&&e.objectLiteral(S)){const K=Object.keys(k),J=Object.keys(S);if(K.length!==J.length||(K.sort(),J.sort(),!C(K,J)))return!1;for(let oe=0;oe<K.length;oe++){const fe=K[oe];if(!C(k[fe],S[fe]))return!1}}return!0}})(a||(me.NotebookCell=a={}));var s;(function(h){function E(I,C,k,S){return{uri:I,notebookType:C,version:k,cells:S}}h.create=E;function N(I){const C=I;return e.objectLiteral(C)&&e.string(C.uri)&&t.integer.is(C.version)&&e.typedArray(C.cells,a.is)}h.is=N})(s||(me.NotebookDocument=s={}));var o;(function(h){h.method="notebookDocument/sync",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.RegistrationType(h.method)})(o||(me.NotebookDocumentSyncRegistrationType=o={}));var l;(function(h){h.method="notebookDocument/didOpen",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(l||(me.DidOpenNotebookDocumentNotification=l={}));var u;(function(h){function E(I){const C=I;return e.objectLiteral(C)&&t.uinteger.is(C.start)&&t.uinteger.is(C.deleteCount)&&(C.cells===void 0||e.typedArray(C.cells,a.is))}h.is=E;function N(I,C,k){const S={start:I,deleteCount:C};return k!==void 0&&(S.cells=k),S}h.create=N})(u||(me.NotebookCellArrayChange=u={}));var c;(function(h){h.method="notebookDocument/didChange",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(c||(me.DidChangeNotebookDocumentNotification=c={}));var d;(function(h){h.method="notebookDocument/didSave",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(d||(me.DidSaveNotebookDocumentNotification=d={}));var g;return(function(h){h.method="notebookDocument/didClose",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(g||(me.DidCloseNotebookDocumentNotification=g={})),me}var Mi={},Pf;function mv(){if(Pf)return Mi;Pf=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.InlineCompletionRequest=void 0;const t=Re();var e;return(function(r){r.method="textDocument/inlineCompletion",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Mi.InlineCompletionRequest=e={})),Mi}var Lf;function gv(){return Lf||(Lf=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=Re(),r=Hu,n=Yu(),i=YR();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const a=XR();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const s=JR();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const o=ZR();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const l=QR();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const u=ev();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const c=tv();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return c.DeclarationRequest}});const d=rv();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const g=nv();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return g.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return g.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return g.WorkDoneProgressCancelNotification}});const h=iv();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return h.CallHierarchyPrepareRequest}});const E=av();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return E.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return E.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return E.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return E.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return E.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return E.SemanticTokensRegistrationType}});const N=sv();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return N.ShowDocumentRequest}});const I=ov();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return I.LinkedEditingRangeRequest}});const C=lv();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 k=uv();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return k.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return k.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return k.MonikerRequest}});const S=cv();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return S.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return S.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return S.TypeHierarchySupertypesRequest}});const P=fv();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return P.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return P.InlineValueRefreshRequest}});const H=dv();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return H.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return H.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return H.InlayHintRefreshRequest}});const K=hv();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return K.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return K.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return K.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return K.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return K.DiagnosticRefreshRequest}});const J=pv();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=mv();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return oe.InlineCompletionRequest}});var fe;(function(f){function Ce(Se){const V=Se;return n.string(V)||n.string(V.language)||n.string(V.scheme)||n.string(V.pattern)}f.is=Ce})(fe||(t.TextDocumentFilter=fe={}));var de;(function(f){function Ce(Se){const V=Se;return n.objectLiteral(V)&&(n.string(V.notebookType)||n.string(V.scheme)||n.string(V.pattern))}f.is=Ce})(de||(t.NotebookDocumentFilter=de={}));var b;(function(f){function Ce(Se){const V=Se;return n.objectLiteral(V)&&(n.string(V.notebook)||de.is(V.notebook))&&(V.language===void 0||n.string(V.language))}f.is=Ce})(b||(t.NotebookCellTextDocumentFilter=b={}));var R;(function(f){function Ce(Se){if(!Array.isArray(Se))return!1;for(let V of Se)if(!n.string(V)&&!fe.is(V)&&!b.is(V))return!1;return!0}f.is=Ce})(R||(t.DocumentSelector=R={}));var m;(function(f){f.method="client/registerCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(m||(t.RegistrationRequest=m={}));var A;(function(f){f.method="client/unregisterCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(A||(t.UnregistrationRequest=A={}));var y;(function(f){f.Create="create",f.Rename="rename",f.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var T;(function(f){f.Abort="abort",f.Transactional="transactional",f.TextOnlyTransactional="textOnlyTransactional",f.Undo="undo"})(T||(t.FailureHandlingKind=T={}));var $;(function(f){f.UTF8="utf-8",f.UTF16="utf-16",f.UTF32="utf-32"})($||(t.PositionEncodingKind=$={}));var O;(function(f){function Ce(Se){const V=Se;return V&&n.string(V.id)&&V.id.length>0}f.hasId=Ce})(O||(t.StaticRegistrationOptions=O={}));var D;(function(f){function Ce(Se){const V=Se;return V&&(V.documentSelector===null||R.is(V.documentSelector))}f.is=Ce})(D||(t.TextDocumentRegistrationOptions=D={}));var x;(function(f){function Ce(V){const p=V;return n.objectLiteral(p)&&(p.workDoneProgress===void 0||n.boolean(p.workDoneProgress))}f.is=Ce;function Se(V){const p=V;return p&&n.boolean(p.workDoneProgress)}f.hasWorkDoneProgress=Se})(x||(t.WorkDoneProgressOptions=x={}));var q;(function(f){f.method="initialize",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(q||(t.InitializeRequest=q={}));var F;(function(f){f.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var ie;(function(f){f.method="initialized",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(ie||(t.InitializedNotification=ie={}));var B;(function(f){f.method="shutdown",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType0(f.method)})(B||(t.ShutdownRequest=B={}));var re;(function(f){f.method="exit",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType0(f.method)})(re||(t.ExitNotification=re={}));var xe;(function(f){f.method="workspace/didChangeConfiguration",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(xe||(t.DidChangeConfigurationNotification=xe={}));var ve;(function(f){f.Error=1,f.Warning=2,f.Info=3,f.Log=4,f.Debug=5})(ve||(t.MessageType=ve={}));var he;(function(f){f.method="window/showMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(he||(t.ShowMessageNotification=he={}));var Ie;(function(f){f.method="window/showMessageRequest",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(Ie||(t.ShowMessageRequest=Ie={}));var De;(function(f){f.method="window/logMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(De||(t.LogMessageNotification=De={}));var Ne;(function(f){f.method="telemetry/event",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Ne||(t.TelemetryEventNotification=Ne={}));var Q;(function(f){f.None=0,f.Full=1,f.Incremental=2})(Q||(t.TextDocumentSyncKind=Q={}));var ot;(function(f){f.method="textDocument/didOpen",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(ot||(t.DidOpenTextDocumentNotification=ot={}));var Ee;(function(f){function Ce(V){let p=V;return p!=null&&typeof p.text=="string"&&p.range!==void 0&&(p.rangeLength===void 0||typeof p.rangeLength=="number")}f.isIncremental=Ce;function Se(V){let p=V;return p!=null&&typeof p.text=="string"&&p.range===void 0&&p.rangeLength===void 0}f.isFull=Se})(Ee||(t.TextDocumentContentChangeEvent=Ee={}));var vt;(function(f){f.method="textDocument/didChange",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(vt||(t.DidChangeTextDocumentNotification=vt={}));var nn;(function(f){f.method="textDocument/didClose",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(nn||(t.DidCloseTextDocumentNotification=nn={}));var ui;(function(f){f.method="textDocument/didSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(ui||(t.DidSaveTextDocumentNotification=ui={}));var ci;(function(f){f.Manual=1,f.AfterDelay=2,f.FocusOut=3})(ci||(t.TextDocumentSaveReason=ci={}));var fi;(function(f){f.method="textDocument/willSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(fi||(t.WillSaveTextDocumentNotification=fi={}));var di;(function(f){f.method="textDocument/willSaveWaitUntil",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(di||(t.WillSaveTextDocumentWaitUntilRequest=di={}));var Et;(function(f){f.method="workspace/didChangeWatchedFiles",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Et||(t.DidChangeWatchedFilesNotification=Et={}));var hi;(function(f){f.Created=1,f.Changed=2,f.Deleted=3})(hi||(t.FileChangeType=hi={}));var Aa;(function(f){function Ce(Se){const V=Se;return n.objectLiteral(V)&&(r.URI.is(V.baseUri)||r.WorkspaceFolder.is(V.baseUri))&&n.string(V.pattern)}f.is=Ce})(Aa||(t.RelativePattern=Aa={}));var Ca;(function(f){f.Create=1,f.Change=2,f.Delete=4})(Ca||(t.WatchKind=Ca={}));var Sa;(function(f){f.method="textDocument/publishDiagnostics",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Sa||(t.PublishDiagnosticsNotification=Sa={}));var ka;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.TriggerForIncompleteCompletions=3})(ka||(t.CompletionTriggerKind=ka={}));var pi;(function(f){f.method="textDocument/completion",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(pi||(t.CompletionRequest=pi={}));var mi;(function(f){f.method="completionItem/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(mi||(t.CompletionResolveRequest=mi={}));var Ut;(function(f){f.method="textDocument/hover",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Ut||(t.HoverRequest=Ut={}));var gi;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.ContentChange=3})(gi||(t.SignatureHelpTriggerKind=gi={}));var wa;(function(f){f.method="textDocument/signatureHelp",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(wa||(t.SignatureHelpRequest=wa={}));var Na;(function(f){f.method="textDocument/definition",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Na||(t.DefinitionRequest=Na={}));var yi;(function(f){f.method="textDocument/references",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(yi||(t.ReferencesRequest=yi={}));var Ti;(function(f){f.method="textDocument/documentHighlight",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Ti||(t.DocumentHighlightRequest=Ti={}));var ba;(function(f){f.method="textDocument/documentSymbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ba||(t.DocumentSymbolRequest=ba={}));var _a;(function(f){f.method="textDocument/codeAction",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(_a||(t.CodeActionRequest=_a={}));var Ia;(function(f){f.method="codeAction/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Ia||(t.CodeActionResolveRequest=Ia={}));var Pa;(function(f){f.method="workspace/symbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Pa||(t.WorkspaceSymbolRequest=Pa={}));var La;(function(f){f.method="workspaceSymbol/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(La||(t.WorkspaceSymbolResolveRequest=La={}));var Oa;(function(f){f.method="textDocument/codeLens",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Oa||(t.CodeLensRequest=Oa={}));var $t;(function(f){f.method="codeLens/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})($t||(t.CodeLensResolveRequest=$t={}));var xa;(function(f){f.method="workspace/codeLens/refresh",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType0(f.method)})(xa||(t.CodeLensRefreshRequest=xa={}));var Da;(function(f){f.method="textDocument/documentLink",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Da||(t.DocumentLinkRequest=Da={}));var Cr;(function(f){f.method="documentLink/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Cr||(t.DocumentLinkResolveRequest=Cr={}));var Ma;(function(f){f.method="textDocument/formatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Ma||(t.DocumentFormattingRequest=Ma={}));var an;(function(f){f.method="textDocument/rangeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(an||(t.DocumentRangeFormattingRequest=an={}));var Ga;(function(f){f.method="textDocument/rangesFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Ga||(t.DocumentRangesFormattingRequest=Ga={}));var qt;(function(f){f.method="textDocument/onTypeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(qt||(t.DocumentOnTypeFormattingRequest=qt={}));var pr;(function(f){f.Identifier=1})(pr||(t.PrepareSupportDefaultBehavior=pr={}));var Fa;(function(f){f.method="textDocument/rename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Fa||(t.RenameRequest=Fa={}));var za;(function(f){f.method="textDocument/prepareRename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(za||(t.PrepareRenameRequest=za={}));var mr;(function(f){f.method="workspace/executeCommand",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(mr||(t.ExecuteCommandRequest=mr={}));var Ri;(function(f){f.method="workspace/applyEdit",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType("workspace/applyEdit")})(Ri||(t.ApplyWorkspaceEditRequest=Ri={}))})(So)),So}var Gi={},Of;function yv(){if(Of)return Gi;Of=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.createProtocolConnection=void 0;const t=oi();function e(r,n,i,a){return t.ConnectionStrategy.is(a)&&(a={connectionStrategy:a}),(0,t.createMessageConnection)(r,n,i,a)}return Gi.createProtocolConnection=e,Gi}var xf;function Tv(){return xf||(xf=1,(function(t){var e=Ir&&Ir.__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=Ir&&Ir.__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(oi(),t),r(Hu,t),r(Re(),t),r(gv(),t);var n=yv();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={}))})(Ir)),Ir}var Df;function Rv(){return Df||(Df=1,(function(t){var e=Nr&&Nr.__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=Nr&&Nr.__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=uf();r(uf(),t),r(Tv(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}t.createProtocolConnection=i})(Nr)),Nr}var Ja=Rv(),Qi;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(Qi||(Qi={}));class vv{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new fa,this.documentPhaseListeners=new fa,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=Te.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=Te.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=ge(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 Je(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 ge(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),Qi.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 Je(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),Qi.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Qi.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Te.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(kn);if(this.currentState>=e&&e>i.state)return Promise.reject(new Ja.ResponseError(Ja.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 Ja.ResponseError(Ja.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{ft.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(kn)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(kn):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(kn)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Je(n),await s(e,n)}catch(o){if(!oo(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 Je(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=ge(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 Ev{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new kR,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=nr(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{ft.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ge(i)}allElements(e,r){let n=ge(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=Te.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=Te.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 $v{constructor(e){this.initialBuildOptions={},this._ready=new Ku,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=Te.CancellationToken.None){const n=await this.performStartup(e);await Je(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=ge(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 Nt.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=ft.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class Av{buildUnexpectedCharactersMessage(e,r,n,i,a){return Zo.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return Zo.buildUnableToPopLexerModeMessage(e)}}const Cv={mode:"full"};class Sv{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=Mf(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new rt(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Cv){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(Mf(e))return e;const r=Mh(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function kv(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function Mh(t){return t&&"modes"in t&&"defaultMode"in t}function Mf(t){return!kv(t)&&!Mh(t)}function wv(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=te.create(0,0));const a=Gh(t),s=Xu(n),o=_v({lines:a,position:i,options:s});return xv({index:0,tokens:o,position:i})}function Nv(t,e){const r=Xu(e),n=Gh(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 Gh(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(_m)}const Gf=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,bv=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function _v(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],d=0;if(l&&t.options.start){const h=(i=t.options.start)==null?void 0:i.exec(c);h&&(d=h.index+h[0].length)}else{const h=(a=t.options.line)==null?void 0:a.exec(c);h&&(d=h.index+h[0].length)}if(u){const h=(s=t.options.end)==null?void 0:s.exec(c);h&&(c=c.substring(0,h.index))}if(c=c.substring(0,Ov(c)),hu(c,d)>=c.length){if(e.length>0){const h=te.create(r,n);e.push({type:"break",content:"",range:X.create(h,h)})}}else{Gf.lastIndex=d;const h=Gf.exec(c);if(h){const E=h[0],N=h[1],I=te.create(r,n+d),C=te.create(r,n+d+E.length);e.push({type:"tag",content:N,range:X.create(I,C)}),d+=E.length,d=hu(c,d)}if(d<c.length){const E=c.substring(d),N=Array.from(E.matchAll(bv));e.push(...Iv(N,E,r,n+d))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function Iv(t,e,r,n){const i=[];if(t.length===0){const a=te.create(r,n),s=te.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(te.create(r,a+n),te.create(r,l+n))});let c=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:X.create(te.create(r,a+c+n),te.create(r,a+c+d.length+n))}),c+=d.length,o.length===4){c+=o[2].length;const g=o[3];i.push({type:"text",content:g,range:X.create(te.create(r,a+c+n),te.create(r,a+c+g.length+n))})}else i.push({type:"text",content:"",range:X.create(te.create(r,a+c+n),te.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(te.create(r,a+n),te.create(r,a+n+s.length))})}return i}const Pv=/\S/,Lv=/\s*$/;function hu(t,e){const r=t.substring(e).match(Pv);return r?e+r.index:t.length}function Ov(t){const e=t.match(Lv);if(e&&typeof e.index=="number")return e.index}function xv(t){var a,s;const e=te.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Ff([],X.create(e,e));const r=[];for(;t.index<t.tokens.length;){const o=Dv(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 Ff(r,X.create(n,i))}function Dv(t,e){const r=t.tokens[t.index];if(r.type==="tag")return zh(t,!1);if(r.type==="text"||r.type==="inline-tag")return Fh(t);Mv(r,e),t.index++}function Mv(t,e){if(e){const r=new qh("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function Fh(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(Gv(t)),n=e,e=t.tokens[t.index];return new pu(i,X.create(r.range.start,n.range.end))}function Gv(t){return t.tokens[t.index].type==="inline-tag"?zh(t,!0):Uh(t)}function zh(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=Uh(t);return new wo(n,new pu([a],a.range),e,X.create(r.range.start,a.range.end))}else{const a=Fh(t);return new wo(n,a,e,X.create(r.range.start,a.range.end))}else{const a=r.range;return new wo(n,new pu([],a),e,a)}}function Uh(t){const e=t.tokens[t.index++];return new qh(e.content,e.range)}function Xu(t){if(!t)return Xu({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:ko(e,!0),end:ko(r,!1),line:ko(n,!0)}}function ko(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?Zs(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class Ff{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+=zf(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+=zf(r)+i}return r.trim()}}class wo{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=Fv(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 Fv(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=hu(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))??zv(e,a)}}function zv(t,e){try{return Nt.parse(t,!0),`[${e}](${t})`}catch{return t}}class pu{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 qh{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}}function zf(t){return t.endsWith(`
156
+ `)?`
157
+ `:`
158
+
159
+ `}class Uv{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Nv(r))return wv(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=nr(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 qv{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return bR(e)?e.$comment:(r=Sm(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}}class jv{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class Bv{constructor(){this.previousTokenSource=new Te.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=pR();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Te.CancellationToken.None){const i=new Ku,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){oo(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class Wv{constructor(e){this.grammarElementIdMap=new Vc,this.tokenTypeIdMap=new Vc,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 ir(e))r.set(i,{});if(e.$cstNode)for(const i of Ko(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)Ke(o)?s.push(this.dehydrateAstNode(o,r)):kt(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Ke(a)?n[i]=this.dehydrateAstNode(a,r):kt(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 dd(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),ta(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):fd(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 ir(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Ko(e.$cstNode)){let s;"fullText"in a?(s=new vh(a.fullText),i=s):"content"in a?s=new Bu:"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)Ke(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):kt(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Ke(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):kt(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),ta(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 su(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 ir(this.grammar))rm(r)&&this.grammarElementIdMap.set(r,e++)}}function Gt(t){return{documentation:{CommentProvider:e=>new qv(e),DocumentationProvider:e=>new Uv(e)},parser:{AsyncParser:e=>new jv(e),GrammarConfig:e=>Zm(e),LangiumParser:e=>cR(e),CompletionParser:e=>uR(e),ValueConverter:()=>new bh,TokenBuilder:()=>new Nh,Lexer:e=>new Sv(e),ParserErrorMessageProvider:()=>new Ah,LexerErrorMessageProvider:()=>new Av},workspace:{AstNodeLocator:()=>new FR,AstNodeDescriptionProvider:e=>new MR(e),ReferenceDescriptionProvider:e=>new GR(e)},references:{Linker:e=>new RR(e),NameProvider:()=>new ER,ScopeProvider:e=>new NR(e),ScopeComputation:e=>new AR(e),References:e=>new $R(e)},serializer:{Hydrator:e=>new Wv(e),JsonSerializer:e=>new _R(e)},validation:{DocumentValidator:e=>new OR(e),ValidationRegistry:e=>new PR(e)},shared:()=>t.shared}}function Ft(t){return{ServiceRegistry:e=>new IR(e),workspace:{LangiumDocuments:e=>new TR(e),LangiumDocumentFactory:e=>new yR(e),DocumentBuilder:e=>new vv(e),IndexManager:e=>new Ev(e),WorkspaceManager:e=>new $v(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new Bv,ConfigurationProvider:e=>new UR(e)},profilers:{}}}var Uf;(function(t){t.merge=(e,r)=>da(da({},e),r)})(Uf||(Uf={}));function _e(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(da,{});return jh(u)}const Vv=Symbol("isProxy");function jh(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===Vv?!0:jf(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(jf(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const qf=Symbol();function jf(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]===qf)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]=qf;try{t[e]=typeof i=="function"?i(n):jh(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function da(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]=da(i,n):t[r]=da({},n)}else t[r]=n}return t}class Kv{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 zt={fileSystemProvider:()=>new Kv},Hv={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},Yv={AstReflection:()=>new Td};function Xv(){const t=_e(Ft(zt),Yv),e=_e(Gt({shared:t}),Hv);return t.ServiceRegistry.register(e),e}function fr(t){const e=Xv(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Nt.parse(`memory:/${r.name??"grammar"}.langium`)),r}var Jv=Object.defineProperty,_=(t,e)=>Jv(t,"name",{value:e,configurable:!0}),mu;(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 ]+)\]/}})(mu||(mu={}));var gu;(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])?/}})(gu||(gu={}));var yu;(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]*/}})(yu||(yu={}));var Tu;(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]*/}})(Tu||(Tu={}));var Ru;(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]*/}})(Ru||(Ru={}));var vu;(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]*/}})(vu||(vu={}));var Eu;(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:/"[^"]*"|'[^']*'/}})(Eu||(Eu={}));var $u;(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:/"[^"]*"|'[^']*'/}})($u||($u={}));var Au;(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]*/}})(Au||(Au={}));({...mu.Terminals,...gu.Terminals,...yu.Terminals,...Tu.Terminals,...Ru.Terminals,...vu.Terminals,...$u.Terminals,...Eu.Terminals,...Au.Terminals});var Za={$type:"Accelerator",name:"name",x:"x",y:"y"},Qa={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},Fi={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},No={$type:"Annotations",x:"x",y:"y"},Qt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Zv(t){return Rt.isInstance(t,Qt.$type)}_(Zv,"isArchitecture");var es={$type:"Axis",label:"label",name:"name"},Es={$type:"Branch",name:"name",order:"order"};function Qv(t){return Rt.isInstance(t,Es.$type)}_(Qv,"isBranch");var Bf={$type:"Checkout",branch:"branch"},ts={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},bo={$type:"ClassDefStatement",className:"className",styleText:"styleText"},vn={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function eE(t){return Rt.isInstance(t,vn.$type)}_(eE,"isCommit");var Dr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},rs={$type:"Curve",entries:"entries",label:"label",name:"name"},ns={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Wf={$type:"Decorator",strategy:"strategy"},un={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Pt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},_o={$type:"Entry",axis:"axis",value:"value"},Vf={$type:"Evolution",stages:"stages"},is={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},Io={$type:"Evolve",component:"component",target:"target"},jr={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function tE(t){return Rt.isInstance(t,jr.$type)}_(tE,"isGitGraph");var zi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Zi={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function rE(t){return Rt.isInstance(t,Zi.$type)}_(rE,"isInfo");var Ui={$type:"Item",classSelector:"classSelector",name:"name"},Po={$type:"Junction",id:"id",in:"in"},qi={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},as={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Mr={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},En={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function nE(t){return Rt.isInstance(t,En.$type)}_(nE,"isMerge");var ss={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},Lo={$type:"Option",name:"name",value:"value"},$n={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function iE(t){return Rt.isInstance(t,$n.$type)}_(iE,"isPacket");var An={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function aE(t){return Rt.isInstance(t,An.$type)}_(aE,"isPacketBlock");var Br={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function sE(t){return Rt.isInstance(t,Br.$type)}_(sE,"isPie");var $s={$type:"PieSection",label:"label",value:"value"};function oE(t){return Rt.isInstance(t,$s.$type)}_(oE,"isPieSection");var Oo={$type:"Pipeline",components:"components",parent:"parent"},os={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Gr={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},xo={$type:"Section",classSelector:"classSelector",name:"name"},cn={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},Do={$type:"Size",height:"height",width:"width"},fn={$type:"Statement"},Cn={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function lE(t){return Rt.isInstance(t,Cn.$type)}_(lE,"isTreemap");var Mo={$type:"TreemapRow",indent:"indent",item:"item"},Go={$type:"TreeNode",indent:"indent",name:"name"},ji={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Fe={$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 uE(t){return Rt.isInstance(t,Fe.$type)}_(uE,"isWardley");var Nn,Bh=(Nn=class extends cd{constructor(){super(...arguments),this.types={Accelerator:{name:Za.$type,properties:{name:{name:Za.name},x:{name:Za.x},y:{name:Za.y}},superTypes:[]},Anchor:{name:Qa.$type,properties:{evolution:{name:Qa.evolution},name:{name:Qa.name},visibility:{name:Qa.visibility}},superTypes:[]},Annotation:{name:Fi.$type,properties:{number:{name:Fi.number},text:{name:Fi.text},x:{name:Fi.x},y:{name:Fi.y}},superTypes:[]},Annotations:{name:No.$type,properties:{x:{name:No.x},y:{name:No.y}},superTypes:[]},Architecture:{name:Qt.$type,properties:{accDescr:{name:Qt.accDescr},accTitle:{name:Qt.accTitle},edges:{name:Qt.edges,defaultValue:[]},groups:{name:Qt.groups,defaultValue:[]},junctions:{name:Qt.junctions,defaultValue:[]},services:{name:Qt.services,defaultValue:[]},title:{name:Qt.title}},superTypes:[]},Axis:{name:es.$type,properties:{label:{name:es.label},name:{name:es.name}},superTypes:[]},Branch:{name:Es.$type,properties:{name:{name:Es.name},order:{name:Es.order}},superTypes:[fn.$type]},Checkout:{name:Bf.$type,properties:{branch:{name:Bf.branch}},superTypes:[fn.$type]},CherryPicking:{name:ts.$type,properties:{id:{name:ts.id},parent:{name:ts.parent},tags:{name:ts.tags,defaultValue:[]}},superTypes:[fn.$type]},ClassDefStatement:{name:bo.$type,properties:{className:{name:bo.className},styleText:{name:bo.styleText}},superTypes:[]},Commit:{name:vn.$type,properties:{id:{name:vn.id},message:{name:vn.message},tags:{name:vn.tags,defaultValue:[]},type:{name:vn.type}},superTypes:[fn.$type]},Component:{name:Dr.$type,properties:{decorator:{name:Dr.decorator},evolution:{name:Dr.evolution},inertia:{name:Dr.inertia,defaultValue:!1},label:{name:Dr.label},name:{name:Dr.name},visibility:{name:Dr.visibility}},superTypes:[]},Curve:{name:rs.$type,properties:{entries:{name:rs.entries,defaultValue:[]},label:{name:rs.label},name:{name:rs.name}},superTypes:[]},Deaccelerator:{name:ns.$type,properties:{name:{name:ns.name},x:{name:ns.x},y:{name:ns.y}},superTypes:[]},Decorator:{name:Wf.$type,properties:{strategy:{name:Wf.strategy}},superTypes:[]},Direction:{name:un.$type,properties:{accDescr:{name:un.accDescr},accTitle:{name:un.accTitle},dir:{name:un.dir},statements:{name:un.statements,defaultValue:[]},title:{name:un.title}},superTypes:[jr.$type]},Edge:{name:Pt.$type,properties:{lhsDir:{name:Pt.lhsDir},lhsGroup:{name:Pt.lhsGroup,defaultValue:!1},lhsId:{name:Pt.lhsId},lhsInto:{name:Pt.lhsInto,defaultValue:!1},rhsDir:{name:Pt.rhsDir},rhsGroup:{name:Pt.rhsGroup,defaultValue:!1},rhsId:{name:Pt.rhsId},rhsInto:{name:Pt.rhsInto,defaultValue:!1},title:{name:Pt.title}},superTypes:[]},Entry:{name:_o.$type,properties:{axis:{name:_o.axis,referenceType:es.$type},value:{name:_o.value}},superTypes:[]},Evolution:{name:Vf.$type,properties:{stages:{name:Vf.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:is.$type,properties:{boundary:{name:is.boundary},name:{name:is.name},secondName:{name:is.secondName}},superTypes:[]},Evolve:{name:Io.$type,properties:{component:{name:Io.component},target:{name:Io.target}},superTypes:[]},GitGraph:{name:jr.$type,properties:{accDescr:{name:jr.accDescr},accTitle:{name:jr.accTitle},statements:{name:jr.statements,defaultValue:[]},title:{name:jr.title}},superTypes:[]},Group:{name:zi.$type,properties:{icon:{name:zi.icon},id:{name:zi.id},in:{name:zi.in},title:{name:zi.title}},superTypes:[]},Info:{name:Zi.$type,properties:{accDescr:{name:Zi.accDescr},accTitle:{name:Zi.accTitle},title:{name:Zi.title}},superTypes:[]},Item:{name:Ui.$type,properties:{classSelector:{name:Ui.classSelector},name:{name:Ui.name}},superTypes:[]},Junction:{name:Po.$type,properties:{id:{name:Po.id},in:{name:Po.in}},superTypes:[]},Label:{name:qi.$type,properties:{negX:{name:qi.negX,defaultValue:!1},negY:{name:qi.negY,defaultValue:!1},offsetX:{name:qi.offsetX},offsetY:{name:qi.offsetY}},superTypes:[]},Leaf:{name:as.$type,properties:{classSelector:{name:as.classSelector},name:{name:as.name},value:{name:as.value}},superTypes:[Ui.$type]},Link:{name:Mr.$type,properties:{arrow:{name:Mr.arrow},from:{name:Mr.from},fromPort:{name:Mr.fromPort},linkLabel:{name:Mr.linkLabel},to:{name:Mr.to},toPort:{name:Mr.toPort}},superTypes:[]},Merge:{name:En.$type,properties:{branch:{name:En.branch},id:{name:En.id},tags:{name:En.tags,defaultValue:[]},type:{name:En.type}},superTypes:[fn.$type]},Note:{name:ss.$type,properties:{evolution:{name:ss.evolution},text:{name:ss.text},visibility:{name:ss.visibility}},superTypes:[]},Option:{name:Lo.$type,properties:{name:{name:Lo.name},value:{name:Lo.value,defaultValue:!1}},superTypes:[]},Packet:{name:$n.$type,properties:{accDescr:{name:$n.accDescr},accTitle:{name:$n.accTitle},blocks:{name:$n.blocks,defaultValue:[]},title:{name:$n.title}},superTypes:[]},PacketBlock:{name:An.$type,properties:{bits:{name:An.bits},end:{name:An.end},label:{name:An.label},start:{name:An.start}},superTypes:[]},Pie:{name:Br.$type,properties:{accDescr:{name:Br.accDescr},accTitle:{name:Br.accTitle},sections:{name:Br.sections,defaultValue:[]},showData:{name:Br.showData,defaultValue:!1},title:{name:Br.title}},superTypes:[]},PieSection:{name:$s.$type,properties:{label:{name:$s.label},value:{name:$s.value}},superTypes:[]},Pipeline:{name:Oo.$type,properties:{components:{name:Oo.components,defaultValue:[]},parent:{name:Oo.parent}},superTypes:[]},PipelineComponent:{name:os.$type,properties:{evolution:{name:os.evolution},label:{name:os.label},name:{name:os.name}},superTypes:[]},Radar:{name:Gr.$type,properties:{accDescr:{name:Gr.accDescr},accTitle:{name:Gr.accTitle},axes:{name:Gr.axes,defaultValue:[]},curves:{name:Gr.curves,defaultValue:[]},options:{name:Gr.options,defaultValue:[]},title:{name:Gr.title}},superTypes:[]},Section:{name:xo.$type,properties:{classSelector:{name:xo.classSelector},name:{name:xo.name}},superTypes:[Ui.$type]},Service:{name:cn.$type,properties:{icon:{name:cn.icon},iconText:{name:cn.iconText},id:{name:cn.id},in:{name:cn.in},title:{name:cn.title}},superTypes:[]},Size:{name:Do.$type,properties:{height:{name:Do.height},width:{name:Do.width}},superTypes:[]},Statement:{name:fn.$type,properties:{},superTypes:[]},TreeNode:{name:Go.$type,properties:{indent:{name:Go.indent},name:{name:Go.name}},superTypes:[]},TreeView:{name:ji.$type,properties:{accDescr:{name:ji.accDescr},accTitle:{name:ji.accTitle},nodes:{name:ji.nodes,defaultValue:[]},title:{name:ji.title}},superTypes:[]},Treemap:{name:Cn.$type,properties:{accDescr:{name:Cn.accDescr},accTitle:{name:Cn.accTitle},title:{name:Cn.title},TreemapRows:{name:Cn.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Mo.$type,properties:{indent:{name:Mo.indent},item:{name:Mo.item}},superTypes:[]},Wardley:{name:Fe.$type,properties:{accDescr:{name:Fe.accDescr},accelerators:{name:Fe.accelerators,defaultValue:[]},accTitle:{name:Fe.accTitle},anchors:{name:Fe.anchors,defaultValue:[]},annotation:{name:Fe.annotation,defaultValue:[]},annotations:{name:Fe.annotations,defaultValue:[]},components:{name:Fe.components,defaultValue:[]},deaccelerators:{name:Fe.deaccelerators,defaultValue:[]},evolution:{name:Fe.evolution},evolves:{name:Fe.evolves,defaultValue:[]},links:{name:Fe.links,defaultValue:[]},notes:{name:Fe.notes,defaultValue:[]},pipelines:{name:Fe.pipelines,defaultValue:[]},size:{name:Fe.size},title:{name:Fe.title}},superTypes:[]}}}},_(Nn,"MermaidAstReflection"),Nn),Rt=new Bh,Kf,cE=_(()=>Kf??(Kf=fr(`{"$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"),Hf,fE=_(()=>Hf??(Hf=fr(`{"$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"),Yf,dE=_(()=>Yf??(Yf=fr(`{"$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"),Xf,hE=_(()=>Xf??(Xf=fr(`{"$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"),Jf,pE=_(()=>Jf??(Jf=fr(`{"$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"),Zf,mE=_(()=>Zf??(Zf=fr(`{"$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"),Qf,gE=_(()=>Qf??(Qf=fr(`{"$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"),ed,yE=_(()=>ed??(ed=fr(`{"$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"),td,TE=_(()=>td??(td=fr(`{"$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"),RE={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vE={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},EE={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$E={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},AE={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},CE={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},SE={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},kE={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wE={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dr={AstReflection:_(()=>new Bh,"AstReflection")},NE={Grammar:_(()=>cE(),"Grammar"),LanguageMetaData:_(()=>RE,"LanguageMetaData"),parser:{}},bE={Grammar:_(()=>fE(),"Grammar"),LanguageMetaData:_(()=>vE,"LanguageMetaData"),parser:{}},_E={Grammar:_(()=>dE(),"Grammar"),LanguageMetaData:_(()=>EE,"LanguageMetaData"),parser:{}},IE={Grammar:_(()=>hE(),"Grammar"),LanguageMetaData:_(()=>$E,"LanguageMetaData"),parser:{}},PE={Grammar:_(()=>pE(),"Grammar"),LanguageMetaData:_(()=>AE,"LanguageMetaData"),parser:{}},LE={Grammar:_(()=>mE(),"Grammar"),LanguageMetaData:_(()=>CE,"LanguageMetaData"),parser:{}},OE={Grammar:_(()=>gE(),"Grammar"),LanguageMetaData:_(()=>SE,"LanguageMetaData"),parser:{}},xE={Grammar:_(()=>yE(),"Grammar"),LanguageMetaData:_(()=>kE,"LanguageMetaData"),parser:{}},DE={Grammar:_(()=>TE(),"Grammar"),LanguageMetaData:_(()=>wE,"LanguageMetaData"),parser:{}},ME=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,GE=/accTitle[\t ]*:([^\n\r]*)/,FE=/title([\t ][^\n\r]*|)/,zE={ACC_DESCR:ME,ACC_TITLE:GE,TITLE:FE},bn,li=(bn=class extends bh{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=zE[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
+ `)}}},_(bn,"AbstractMermaidValueConverter"),bn),_n,lo=(_n=class extends li{runCustomConverter(e,r,n){}},_(_n,"CommonValueConverter"),_n),In,hr=(In=class extends Nh{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}},_(In,"AbstractMermaidTokenBuilder"),In),Pn;Pn=class extends hr{},_(Pn,"CommonTokenBuilder");var Ln,UE=(Ln=class extends hr{constructor(){super(["treemap"])}},_(Ln,"TreemapTokenBuilder"),Ln),qE=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,On,jE=(On=class extends li{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=qE.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},_(On,"TreemapValueConverter"),On);function Wh(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}_(Wh,"registerValidationChecks");var xn,BE=(xn=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"}))}},_(xn,"TreemapValidator"),xn),Vh={parser:{TokenBuilder:_(()=>new UE,"TokenBuilder"),ValueConverter:_(()=>new jE,"ValueConverter")},validation:{TreemapValidator:_(()=>new BE,"TreemapValidator")}};function Kh(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),OE,Vh);return e.ServiceRegistry.register(r),Wh(r),{shared:e,Treemap:r}}_(Kh,"createTreemapServices");var Dn,WE=(Dn=class extends li{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},_(Dn,"WardleyValueConverter"),Dn),Hh={parser:{ValueConverter:_(()=>new WE,"ValueConverter")}};function Yh(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),DE,Hh);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}_(Yh,"createWardleyServices");var Mn,VE=(Mn=class extends hr{constructor(){super(["gitGraph"])}},_(Mn,"GitGraphTokenBuilder"),Mn),Xh={parser:{TokenBuilder:_(()=>new VE,"TokenBuilder"),ValueConverter:_(()=>new lo,"ValueConverter")}};function Jh(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),bE,Xh);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}_(Jh,"createGitGraphServices");var Gn,KE=(Gn=class extends hr{constructor(){super(["info","showInfo"])}},_(Gn,"InfoTokenBuilder"),Gn),Zh={parser:{TokenBuilder:_(()=>new KE,"TokenBuilder"),ValueConverter:_(()=>new lo,"ValueConverter")}};function Qh(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),_E,Zh);return e.ServiceRegistry.register(r),{shared:e,Info:r}}_(Qh,"createInfoServices");var Fn,HE=(Fn=class extends hr{constructor(){super(["packet"])}},_(Fn,"PacketTokenBuilder"),Fn),ep={parser:{TokenBuilder:_(()=>new HE,"TokenBuilder"),ValueConverter:_(()=>new lo,"ValueConverter")}};function tp(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),IE,ep);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}_(tp,"createPacketServices");var zn,YE=(zn=class extends hr{constructor(){super(["pie","showData"])}},_(zn,"PieTokenBuilder"),zn),Un,XE=(Un=class extends li{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},_(Un,"PieValueConverter"),Un),rp={parser:{TokenBuilder:_(()=>new YE,"TokenBuilder"),ValueConverter:_(()=>new XE,"ValueConverter")}};function np(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),PE,rp);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}_(np,"createPieServices");var qn,JE=(qn=class extends li{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)}},_(qn,"TreeViewValueConverter"),qn),jn,ZE=(jn=class extends hr{constructor(){super(["treeView-beta"])}},_(jn,"TreeViewTokenBuilder"),jn),ip={parser:{TokenBuilder:_(()=>new ZE,"TokenBuilder"),ValueConverter:_(()=>new JE,"ValueConverter")}};function ap(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),xE,ip);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}_(ap,"createTreeViewServices");var Bn,QE=(Bn=class extends hr{constructor(){super(["architecture"])}},_(Bn,"ArchitectureTokenBuilder"),Bn),Wn,e$=(Wn=class extends li{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()}}},_(Wn,"ArchitectureValueConverter"),Wn),sp={parser:{TokenBuilder:_(()=>new QE,"TokenBuilder"),ValueConverter:_(()=>new e$,"ValueConverter")}};function op(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),NE,sp);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}_(op,"createArchitectureServices");var Vn,t$=(Vn=class extends hr{constructor(){super(["radar-beta"])}},_(Vn,"RadarTokenBuilder"),Vn),lp={parser:{TokenBuilder:_(()=>new t$,"TokenBuilder"),ValueConverter:_(()=>new lo,"ValueConverter")}};function up(t=zt){const e=_e(Ft(t),dr),r=_e(Gt({shared:e}),LE,lp);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}_(up,"createRadarServices");var Ct={},r$={info:_(async()=>{const{createInfoServices:t}=await jt(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>a$);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;Ct.info=e},"info"),packet:_(async()=>{const{createPacketServices:t}=await jt(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>s$);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;Ct.packet=e},"packet"),pie:_(async()=>{const{createPieServices:t}=await jt(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>o$);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;Ct.pie=e},"pie"),treeView:_(async()=>{const{createTreeViewServices:t}=await jt(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>l$);return{createTreeViewServices:r}},void 0),e=t().TreeView.parser.LangiumParser;Ct.treeView=e},"treeView"),architecture:_(async()=>{const{createArchitectureServices:t}=await jt(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>u$);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;Ct.architecture=e},"architecture"),gitGraph:_(async()=>{const{createGitGraphServices:t}=await jt(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>c$);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;Ct.gitGraph=e},"gitGraph"),radar:_(async()=>{const{createRadarServices:t}=await jt(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>f$);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;Ct.radar=e},"radar"),treemap:_(async()=>{const{createTreemapServices:t}=await jt(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>d$);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;Ct.treemap=e},"treemap"),wardley:_(async()=>{const{createWardleyServices:t}=await jt(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>h$);return{createWardleyServices:r}},void 0),e=t().Wardley.parser.LangiumParser;Ct.wardley=e},"wardley")};async function n$(t,e){const r=r$[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Ct[t]||await r();const i=Ct[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new i$(i);return i.value}_(n$,"parse");var Kn,i$=(Kn=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}},_(Kn,"MermaidParseError"),Kn);const a$=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:Zh,createInfoServices:Qh},Symbol.toStringTag,{value:"Module"})),s$=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:ep,createPacketServices:tp},Symbol.toStringTag,{value:"Module"})),o$=Object.freeze(Object.defineProperty({__proto__:null,PieModule:rp,createPieServices:np},Symbol.toStringTag,{value:"Module"})),l$=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:ip,createTreeViewServices:ap},Symbol.toStringTag,{value:"Module"})),u$=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:sp,createArchitectureServices:op},Symbol.toStringTag,{value:"Module"})),c$=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Xh,createGitGraphServices:Jh},Symbol.toStringTag,{value:"Module"})),f$=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:lp,createRadarServices:up},Symbol.toStringTag,{value:"Module"})),d$=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Vh,createTreemapServices:Kh},Symbol.toStringTag,{value:"Module"})),h$=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:Hh,createWardleyServices:Yh},Symbol.toStringTag,{value:"Module"}));export{n$ as p};