orbitchat 3.2.2 → 3.2.3

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 (56) hide show
  1. package/dist/assets/{ChartRenderer-Dd-iDllj.js → ChartRenderer-BRZDGKXb.js} +1 -1
  2. package/dist/assets/{MermaidRenderer-b4CLxUY2.js → MermaidRenderer-By9E8Mka.js} +5 -5
  3. package/dist/assets/{MusicRenderer-46pIMJgC.js → MusicRenderer-CUeKRk9_.js} +2 -2
  4. package/dist/assets/{SVGRenderer-DPXNm96K.js → SVGRenderer-XqSV-WtQ.js} +1 -1
  5. package/dist/assets/{_basePickBy-CRNU2oh3.js → _basePickBy-Hf4aXm85.js} +1 -1
  6. package/dist/assets/{_baseUniq-D4EnRRPg.js → _baseUniq-D1bNmnwz.js} +1 -1
  7. package/dist/assets/{architectureDiagram-VXUJARFQ-Bmsde5Ld.js → architectureDiagram-VXUJARFQ-BVxn4r6b.js} +1 -1
  8. package/dist/assets/{blockDiagram-VD42YOAC-DkNKZeTU.js → blockDiagram-VD42YOAC-BkjBdjdz.js} +1 -1
  9. package/dist/assets/{c4Diagram-YG6GDRKO-Bxm9TWfp.js → c4Diagram-YG6GDRKO-DN9C0J4c.js} +1 -1
  10. package/dist/assets/channel-YSaYGfvU.js +1 -0
  11. package/dist/assets/{chunk-4BX2VUAB-Cid1RCdG.js → chunk-4BX2VUAB-DQjaxTxC.js} +1 -1
  12. package/dist/assets/{chunk-55IACEB6-DaMm9Sm9.js → chunk-55IACEB6-BAPmvzOA.js} +1 -1
  13. package/dist/assets/{chunk-B4BG7PRW-NJo0ZYrW.js → chunk-B4BG7PRW-BKn58Q3T.js} +1 -1
  14. package/dist/assets/{chunk-DI55MBZ5-DnBh4BcT.js → chunk-DI55MBZ5-D4T4cEvk.js} +1 -1
  15. package/dist/assets/{chunk-FMBD7UC4-C7uryJc0.js → chunk-FMBD7UC4-BBSfVL96.js} +1 -1
  16. package/dist/assets/{chunk-QN33PNHL-B359CDxs.js → chunk-QN33PNHL-2G6RGO0y.js} +1 -1
  17. package/dist/assets/{chunk-QZHKN3VN-BWKYBRsr.js → chunk-QZHKN3VN-3HkuNyaC.js} +1 -1
  18. package/dist/assets/{chunk-TZMSLE5B-BnBaUsND.js → chunk-TZMSLE5B-CGP8AgQu.js} +1 -1
  19. package/dist/assets/classDiagram-2ON5EDUG-DwTYgLtI.js +1 -0
  20. package/dist/assets/classDiagram-v2-WZHVMYZB-DwTYgLtI.js +1 -0
  21. package/dist/assets/clone-Dnm1uDjE.js +1 -0
  22. package/dist/assets/{cose-bilkent-S5V4N54A-Cn-0Rw3G.js → cose-bilkent-S5V4N54A-CjviFb5r.js} +1 -1
  23. package/dist/assets/{dagre-6UL2VRFP-BCy9sHJ_.js → dagre-6UL2VRFP-jOmi_c5R.js} +1 -1
  24. package/dist/assets/{diagram-PSM6KHXK-B0RMr1QC.js → diagram-PSM6KHXK-Dbp2IHQD.js} +1 -1
  25. package/dist/assets/{diagram-QEK2KX5R-Czad37E-.js → diagram-QEK2KX5R-BZYMok2J.js} +1 -1
  26. package/dist/assets/{diagram-S2PKOQOG-BdCIoL2c.js → diagram-S2PKOQOG-BrYZPEzc.js} +1 -1
  27. package/dist/assets/{erDiagram-Q2GNP2WA-B2v4aP_x.js → erDiagram-Q2GNP2WA-IzmpSNLX.js} +1 -1
  28. package/dist/assets/{flowDiagram-NV44I4VS-DKCjGiV2.js → flowDiagram-NV44I4VS-ah9osuE0.js} +1 -1
  29. package/dist/assets/{ganttDiagram-JELNMOA3-BM1BKdEi.js → ganttDiagram-JELNMOA3-4WG42_hu.js} +1 -1
  30. package/dist/assets/{gitGraphDiagram-V2S2FVAM--qI83Qf3.js → gitGraphDiagram-V2S2FVAM-_RIhHlSv.js} +1 -1
  31. package/dist/assets/{graph-DGfbBQxw.js → graph-CFhrCHAV.js} +1 -1
  32. package/dist/assets/{index-wu56yLEv.js → index-CX9xMrSE.js} +3 -3
  33. package/dist/assets/{index-cUciQe5_.js → index-Cw8cvkPe.js} +1 -1
  34. package/dist/assets/{infoDiagram-HS3SLOUP-DR_pKdtU.js → infoDiagram-HS3SLOUP-BGPObwg6.js} +1 -1
  35. package/dist/assets/{journeyDiagram-XKPGCS4Q-BcQ7sw-c.js → journeyDiagram-XKPGCS4Q-sVlgPfoV.js} +1 -1
  36. package/dist/assets/{kanban-definition-3W4ZIXB7-BUiYb7qQ.js → kanban-definition-3W4ZIXB7-B6QL8dmg.js} +1 -1
  37. package/dist/assets/{layout-D7FT5Uin.js → layout-kIMg9Yn-.js} +1 -1
  38. package/dist/assets/{mindmap-definition-VGOIOE7T-HTGX5tJM.js → mindmap-definition-VGOIOE7T-DQcLpIVB.js} +1 -1
  39. package/dist/assets/{pieDiagram-ADFJNKIX-C_PvxCSB.js → pieDiagram-ADFJNKIX-DjIo_IMA.js} +1 -1
  40. package/dist/assets/{quadrantDiagram-AYHSOK5B-DDhOIPoW.js → quadrantDiagram-AYHSOK5B-PlJT0Z8S.js} +1 -1
  41. package/dist/assets/{requirementDiagram-UZGBJVZJ-ClMyTh5u.js → requirementDiagram-UZGBJVZJ-jomV-cLl.js} +1 -1
  42. package/dist/assets/{sankeyDiagram-TZEHDZUN-BMLYipN_.js → sankeyDiagram-TZEHDZUN-Iih_Xpcv.js} +1 -1
  43. package/dist/assets/{sequenceDiagram-WL72ISMW-COwoFwcs.js → sequenceDiagram-WL72ISMW-pXhWBhIr.js} +1 -1
  44. package/dist/assets/{stateDiagram-FKZM4ZOC-CGM_7Cjh.js → stateDiagram-FKZM4ZOC-D8rwumaR.js} +1 -1
  45. package/dist/assets/stateDiagram-v2-4FDKWEC3-Dhf-0JeR.js +1 -0
  46. package/dist/assets/{timeline-definition-IT6M3QCI-C0EQUFm0.js → timeline-definition-IT6M3QCI-BJxh2E6G.js} +1 -1
  47. package/dist/assets/treemap-GDKQZRPO-BDXLLe9-.js +160 -0
  48. package/dist/assets/{xychartDiagram-PRI3JC2R-DPhl7kC1.js → xychartDiagram-PRI3JC2R-CgiuaYJ-.js} +1 -1
  49. package/dist/index.html +1 -1
  50. package/package.json +1 -1
  51. package/dist/assets/channel-DeMez_Hj.js +0 -1
  52. package/dist/assets/classDiagram-2ON5EDUG-BzXv5fTq.js +0 -1
  53. package/dist/assets/classDiagram-v2-WZHVMYZB-BzXv5fTq.js +0 -1
  54. package/dist/assets/clone-BMsGBMed.js +0 -1
  55. package/dist/assets/stateDiagram-v2-4FDKWEC3-CKgQtgpH.js +0 -1
  56. package/dist/assets/treemap-GDKQZRPO-BXbe6QGJ.js +0 -160
@@ -1,160 +0,0 @@
1
- var tm=Object.defineProperty;var nm=(t,e,n)=>e in t?tm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var fn=(t,e,n)=>nm(t,typeof e!="symbol"?e+"":e,n);import{c as vt,b as rm,_ as Ln}from"./index-wu56yLEv.js";import{b6 as im,b7 as sm,ay as Gf,aS as am,aC as om,az as Be,ak as cm,al as su,aI as lm,aL as Uf,aM as jf,aJ as um,aX as au,an as Qn,ao as oe,aA as ou,au as dm}from"./MermaidRenderer-b4CLxUY2.js";import{k as Wr,j as Il,g as li,S as fm,w as hm,x as pm,c as zf,v as Oe,y as Bf,l as mm,z as gm,A as ym,B as Tm,C as Rm,a as qf,d as U,i as nn,r as Ze,f as mt,D as De}from"./_baseUniq-D4EnRRPg.js";import{j as $l,m as D,d as vm,f as Et,g as Vr,h as z,i as Pl,l as Wn,e as Em}from"./_basePickBy-CRNU2oh3.js";import{c as We}from"./clone-BMsGBMed.js";var Am=Object.prototype,Sm=Am.hasOwnProperty,pt=im(function(t,e){if(sm(e)||Gf(e)){am(e,Wr(e),t);return}for(var n in e)Sm.call(e,n)&&om(t,n,e[n])});function Wf(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function cs(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}function Cm(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(r,a,n(a),t)}return r}function km(t,e,n,r){return Il(t,function(i,s,a){e(r,i,n(i),a)}),r}function wm(t,e){return function(n,r){var i=Be(n)?Cm:km,s=e?e():{};return i(n,t,li(r),s)}}var Nm=200;function bm(t,e,n,r){var i=-1,s=hm,a=!0,o=t.length,c=[],l=e.length;if(!o)return c;e.length>=Nm&&(s=pm,a=!1,e=new fm(e));e:for(;++i<o;){var d=t[i],h=d;if(d=d!==0?d:0,a&&h===h){for(var p=l;p--;)if(e[p]===h)continue e;c.push(d)}else s(e,h,r)||c.push(d)}return c}var Ua=cm(function(t,e){return su(t)?bm(t,zf(e,1,su,!0)):[]});function Ue(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:$l(e),Wf(t,e<0?0:e,r)):[]}function Vi(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:$l(e),e=r-e,Wf(t,0,e<0?0:e)):[]}function _m(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Im(t,e){var n=!0;return Il(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function _t(t,e,n){var r=Be(t)?_m:Im;return r(t,li(e))}function $t(t){return t&&t.length?t[0]:void 0}function ht(t,e){return zf(D(t,e))}var $m=Object.prototype,Pm=$m.hasOwnProperty,Lm=wm(function(t,e,n){Pm.call(t,n)?t[n].push(e):lm(t,n,[e])}),Om="[object String]";function at(t){return typeof t=="string"||!Be(t)&&Uf(t)&&jf(t)==Om}var xm=Math.max;function nt(t,e,n,r){t=Gf(t)?t:Oe(t),n=n?$l(n):0;var i=t.length;return n<0&&(n=xm(i+n,0)),at(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Bf(t,e,n)>-1}function cu(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return Bf(t,e,i)}var Dm="[object RegExp]";function Mm(t){return Uf(t)&&jf(t)==Dm}var lu=au&&au.isRegExp,rn=lu?um(lu):Mm,Fm="Expected a function";function Gm(t){if(typeof t!="function")throw new TypeError(Fm);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 Pt(t,e){if(t==null)return{};var n=mm(gm(t),function(r){return[r]});return e=li(e),vm(t,n,function(r,i){return e(r,i[0])})}function ja(t,e){var n=Be(t)?ym:Tm;return n(t,Gm(li(e)))}function Um(t,e){var n;return Il(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function Vf(t,e,n){var r=Be(t)?Rm:Um;return r(t,li(e))}function Ll(t){return t&&t.length?qf(t):[]}function jm(t,e){return t&&t.length?qf(t,li(e)):[]}function He(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Nt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function pn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function zm(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ki(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class Kf{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const n=this.types[e.container.$type];if(!n)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=(i=n.properties[e.property])==null?void 0:i.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const n=this.types[e];return n||{name:e,properties:{},superTypes:[]}}isInstance(e,n){return He(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.types[e],a=s?s.superTypes.some(o=>this.isSubtype(o,n)):!1;return r[n]=a,a}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Ki(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Hf(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Yf(t){return Ki(t)&&typeof t.fullText=="string"}class je{constructor(e,n){this.startFn=e,this.nextFn=n}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 n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new je(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return dt})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=Bm(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new je(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?dt:{done:!1,value:e(i)}})}filter(e){return new je(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return dt})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new je(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(la(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return dt})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new je(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(la(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return dt})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new je(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new je(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?dt:this.nextFn(n.state)))}distinct(e){return new je(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return dt})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function Bm(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function la(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Xf=new je(()=>{},()=>dt),dt=Object.freeze({done:!0,value:void 0});function pe(...t){if(t.length===1){const e=t[0];if(e instanceof je)return e;if(la(e))return new je(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new je(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:dt)}return t.length>1?new je(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;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 n=t[e.collIndex++];la(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return dt}):Xf}class Ol extends je{constructor(e,n,r){super(()=>({iterators:r!=null&&r.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return dt})}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(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(Fo||(Fo={}));function Go(t,e={}){for(const[n,r]of Object.entries(t))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,s)=>{He(i)&&(i.$container=t,i.$containerProperty=n,i.$containerIndex=s,e.deep&&Go(i,e))}):He(r)&&(r.$container=t,r.$containerProperty=n,e.deep&&Go(r,e)))}function za(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function Qt(t){const n=Hs(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Hs(t){for(;t.$container;)t=t.$container;return t}function uu(t){return Nt(t)?t.ref?[t.ref]:[]:pn(t)?t.items.map(e=>e.ref):[]}function xl(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e==null?void 0:e.range;return new je(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(He(s)){if(r.keyIndex++,du(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(He(o)&&du(o,n))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return dt})}function ls(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Ol(t,n=>xl(n,e))}function Zt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Ol(t,n=>xl(n,e),{includeRoot:!0})}function du(t,e){var r;if(!e)return!0;const n=(r=t.$cstNode)==null?void 0:r.range;return n?fg(n,e):!1}function ua(t){return new je(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(Nt(r)||pn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Nt(s)||pn(r))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return dt})}function qm(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of Object.values(n.properties))i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=Jf(i.defaultValue))}function Jf(t){return Array.isArray(t)?[...t.map(Jf)]:t}const ut={$type:"AbstractElement",cardinality:"cardinality"};function Wm(t){return Z.isInstance(t,ut.$type)}const Ys={$type:"AbstractParserRule"};function us(t){return Z.isInstance(t,Ys.$type)}const Ds={$type:"AbstractRule"},kt={$type:"AbstractType"},Dn={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ba(t){return Z.isInstance(t,Dn.$type)}const Xs={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Qf(t){return Z.isInstance(t,Xs.$type)}const fu={$type:"ArrayLiteral",elements:"elements"},hu={$type:"ArrayType",elementType:"elementType"},Mn={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Vn(t){return Z.isInstance(t,Mn.$type)}const Uo={$type:"BooleanLiteral",true:"true"};function Vm(t){return Z.isInstance(t,Uo.$type)}const Fn={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Km(t){return Z.isInstance(t,Fn.$type)}const sr={$type:"Condition"},Js={$type:"Conjunction",left:"left",right:"right"};function Hm(t){return Z.isInstance(t,Js.$type)}const Gn={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function qa(t){return Z.isInstance(t,Gn.$type)}const Qs={$type:"Disjunction",left:"left",right:"right"};function Ym(t){return Z.isInstance(t,Qs.$type)}const jo={$type:"EndOfFile",cardinality:"cardinality"};function Xm(t){return Z.isInstance(t,jo.$type)}const On={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},pu={$type:"GrammarImport",path:"path"},dr={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Dl(t){return Z.isInstance(t,dr.$type)}const zo={$type:"InferredType",name:"name"};function Zf(t){return Z.isInstance(t,zo.$type)}const Vt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function da(t){return Z.isInstance(t,Vt.$type)}const yo={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},mu={$type:"InfixRuleOperators",precedences:"precedences"},Oi={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Jm(t){return Z.isInstance(t,Oi.$type)}const xi={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Kn(t){return Z.isInstance(t,xi.$type)}const Ms={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},fr={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Qm(t){return Z.isInstance(t,fr.$type)}const Bo={$type:"Negation",value:"value"};function Zm(t){return Z.isInstance(t,Bo.$type)}const gu={$type:"NumberLiteral",value:"value"},Fs={$type:"Parameter",name:"name"},qo={$type:"ParameterReference",parameter:"parameter"};function eg(t){return Z.isInstance(t,qo.$type)}const Dt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function on(t){return Z.isInstance(t,Dt.$type)}const To={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},hr={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function tg(t){return Z.isInstance(t,hr.$type)}const Wo={$type:"ReturnType",name:"name"};function ng(t){return Z.isInstance(t,Wo.$type)}const pr={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Hn(t){return Z.isInstance(t,pr.$type)}const Di={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function rg(t){return Z.isInstance(t,Di.$type)}const yu={$type:"StringLiteral",value:"value"},mr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function ig(t){return Z.isInstance(t,mr.$type)}const Tt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},gr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function sg(t){return Z.isInstance(t,gr.$type)}const hn={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function cn(t){return Z.isInstance(t,hn.$type)}const yr={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function ag(t){return Z.isInstance(t,yr.$type)}const Zs={$type:"Type",name:"name",type:"type"};function og(t){return Z.isInstance(t,Zs.$type)}const wi={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},Ni={$type:"TypeDefinition"},Tu={$type:"UnionType",types:"types"},ea={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function eh(t){return Z.isInstance(t,ea.$type)}const Tr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function cg(t){return Z.isInstance(t,Tr.$type)}const bi={$type:"ValueLiteral"},Mi={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function lg(t){return Z.isInstance(t,Mi.$type)}class th extends Kf{constructor(){super(...arguments),this.types={AbstractElement:{name:ut.$type,properties:{cardinality:{name:ut.cardinality}},superTypes:[]},AbstractParserRule:{name:Ys.$type,properties:{},superTypes:[Ds.$type,kt.$type]},AbstractRule:{name:Ds.$type,properties:{},superTypes:[]},AbstractType:{name:kt.$type,properties:{},superTypes:[]},Action:{name:Dn.$type,properties:{cardinality:{name:Dn.cardinality},feature:{name:Dn.feature},inferredType:{name:Dn.inferredType},operator:{name:Dn.operator},type:{name:Dn.type,referenceType:kt.$type}},superTypes:[ut.$type]},Alternatives:{name:Xs.$type,properties:{cardinality:{name:Xs.cardinality},elements:{name:Xs.elements,defaultValue:[]}},superTypes:[ut.$type]},ArrayLiteral:{name:fu.$type,properties:{elements:{name:fu.elements,defaultValue:[]}},superTypes:[bi.$type]},ArrayType:{name:hu.$type,properties:{elementType:{name:hu.elementType}},superTypes:[Ni.$type]},Assignment:{name:Mn.$type,properties:{cardinality:{name:Mn.cardinality},feature:{name:Mn.feature},operator:{name:Mn.operator},predicate:{name:Mn.predicate},terminal:{name:Mn.terminal}},superTypes:[ut.$type]},BooleanLiteral:{name:Uo.$type,properties:{true:{name:Uo.true,defaultValue:!1}},superTypes:[sr.$type,bi.$type]},CharacterRange:{name:Fn.$type,properties:{cardinality:{name:Fn.cardinality},left:{name:Fn.left},lookahead:{name:Fn.lookahead},parenthesized:{name:Fn.parenthesized,defaultValue:!1},right:{name:Fn.right}},superTypes:[Tt.$type]},Condition:{name:sr.$type,properties:{},superTypes:[]},Conjunction:{name:Js.$type,properties:{left:{name:Js.left},right:{name:Js.right}},superTypes:[sr.$type]},CrossReference:{name:Gn.$type,properties:{cardinality:{name:Gn.cardinality},deprecatedSyntax:{name:Gn.deprecatedSyntax,defaultValue:!1},isMulti:{name:Gn.isMulti,defaultValue:!1},terminal:{name:Gn.terminal},type:{name:Gn.type,referenceType:kt.$type}},superTypes:[ut.$type]},Disjunction:{name:Qs.$type,properties:{left:{name:Qs.left},right:{name:Qs.right}},superTypes:[sr.$type]},EndOfFile:{name:jo.$type,properties:{cardinality:{name:jo.cardinality}},superTypes:[ut.$type]},Grammar:{name:On.$type,properties:{imports:{name:On.imports,defaultValue:[]},interfaces:{name:On.interfaces,defaultValue:[]},isDeclared:{name:On.isDeclared,defaultValue:!1},name:{name:On.name},rules:{name:On.rules,defaultValue:[]},types:{name:On.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:pu.$type,properties:{path:{name:pu.path}},superTypes:[]},Group:{name:dr.$type,properties:{cardinality:{name:dr.cardinality},elements:{name:dr.elements,defaultValue:[]},guardCondition:{name:dr.guardCondition},predicate:{name:dr.predicate}},superTypes:[ut.$type]},InferredType:{name:zo.$type,properties:{name:{name:zo.name}},superTypes:[kt.$type]},InfixRule:{name:Vt.$type,properties:{call:{name:Vt.call},dataType:{name:Vt.dataType},inferredType:{name:Vt.inferredType},name:{name:Vt.name},operators:{name:Vt.operators},parameters:{name:Vt.parameters,defaultValue:[]},returnType:{name:Vt.returnType,referenceType:kt.$type}},superTypes:[Ys.$type]},InfixRuleOperatorList:{name:yo.$type,properties:{associativity:{name:yo.associativity},operators:{name:yo.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:mu.$type,properties:{precedences:{name:mu.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Oi.$type,properties:{attributes:{name:Oi.attributes,defaultValue:[]},name:{name:Oi.name},superTypes:{name:Oi.superTypes,defaultValue:[],referenceType:kt.$type}},superTypes:[kt.$type]},Keyword:{name:xi.$type,properties:{cardinality:{name:xi.cardinality},predicate:{name:xi.predicate},value:{name:xi.value}},superTypes:[ut.$type]},NamedArgument:{name:Ms.$type,properties:{calledByName:{name:Ms.calledByName,defaultValue:!1},parameter:{name:Ms.parameter,referenceType:Fs.$type},value:{name:Ms.value}},superTypes:[]},NegatedToken:{name:fr.$type,properties:{cardinality:{name:fr.cardinality},lookahead:{name:fr.lookahead},parenthesized:{name:fr.parenthesized,defaultValue:!1},terminal:{name:fr.terminal}},superTypes:[Tt.$type]},Negation:{name:Bo.$type,properties:{value:{name:Bo.value}},superTypes:[sr.$type]},NumberLiteral:{name:gu.$type,properties:{value:{name:gu.value}},superTypes:[bi.$type]},Parameter:{name:Fs.$type,properties:{name:{name:Fs.name}},superTypes:[]},ParameterReference:{name:qo.$type,properties:{parameter:{name:qo.parameter,referenceType:Fs.$type}},superTypes:[sr.$type]},ParserRule:{name:Dt.$type,properties:{dataType:{name:Dt.dataType},definition:{name:Dt.definition},entry:{name:Dt.entry,defaultValue:!1},fragment:{name:Dt.fragment,defaultValue:!1},inferredType:{name:Dt.inferredType},name:{name:Dt.name},parameters:{name:Dt.parameters,defaultValue:[]},returnType:{name:Dt.returnType,referenceType:kt.$type}},superTypes:[Ys.$type]},ReferenceType:{name:To.$type,properties:{isMulti:{name:To.isMulti,defaultValue:!1},referenceType:{name:To.referenceType}},superTypes:[Ni.$type]},RegexToken:{name:hr.$type,properties:{cardinality:{name:hr.cardinality},lookahead:{name:hr.lookahead},parenthesized:{name:hr.parenthesized,defaultValue:!1},regex:{name:hr.regex}},superTypes:[Tt.$type]},ReturnType:{name:Wo.$type,properties:{name:{name:Wo.name}},superTypes:[]},RuleCall:{name:pr.$type,properties:{arguments:{name:pr.arguments,defaultValue:[]},cardinality:{name:pr.cardinality},predicate:{name:pr.predicate},rule:{name:pr.rule,referenceType:Ds.$type}},superTypes:[ut.$type]},SimpleType:{name:Di.$type,properties:{primitiveType:{name:Di.primitiveType},stringType:{name:Di.stringType},typeRef:{name:Di.typeRef,referenceType:kt.$type}},superTypes:[Ni.$type]},StringLiteral:{name:yu.$type,properties:{value:{name:yu.value}},superTypes:[bi.$type]},TerminalAlternatives:{name:mr.$type,properties:{cardinality:{name:mr.cardinality},elements:{name:mr.elements,defaultValue:[]},lookahead:{name:mr.lookahead},parenthesized:{name:mr.parenthesized,defaultValue:!1}},superTypes:[Tt.$type]},TerminalElement:{name:Tt.$type,properties:{cardinality:{name:Tt.cardinality},lookahead:{name:Tt.lookahead},parenthesized:{name:Tt.parenthesized,defaultValue:!1}},superTypes:[ut.$type]},TerminalGroup:{name:gr.$type,properties:{cardinality:{name:gr.cardinality},elements:{name:gr.elements,defaultValue:[]},lookahead:{name:gr.lookahead},parenthesized:{name:gr.parenthesized,defaultValue:!1}},superTypes:[Tt.$type]},TerminalRule:{name:hn.$type,properties:{definition:{name:hn.definition},fragment:{name:hn.fragment,defaultValue:!1},hidden:{name:hn.hidden,defaultValue:!1},name:{name:hn.name},type:{name:hn.type}},superTypes:[Ds.$type]},TerminalRuleCall:{name:yr.$type,properties:{cardinality:{name:yr.cardinality},lookahead:{name:yr.lookahead},parenthesized:{name:yr.parenthesized,defaultValue:!1},rule:{name:yr.rule,referenceType:hn.$type}},superTypes:[Tt.$type]},Type:{name:Zs.$type,properties:{name:{name:Zs.name},type:{name:Zs.type}},superTypes:[kt.$type]},TypeAttribute:{name:wi.$type,properties:{defaultValue:{name:wi.defaultValue},isOptional:{name:wi.isOptional,defaultValue:!1},name:{name:wi.name},type:{name:wi.type}},superTypes:[]},TypeDefinition:{name:Ni.$type,properties:{},superTypes:[]},UnionType:{name:Tu.$type,properties:{types:{name:Tu.types,defaultValue:[]}},superTypes:[Ni.$type]},UnorderedGroup:{name:ea.$type,properties:{cardinality:{name:ea.cardinality},elements:{name:ea.elements,defaultValue:[]}},superTypes:[ut.$type]},UntilToken:{name:Tr.$type,properties:{cardinality:{name:Tr.cardinality},lookahead:{name:Tr.lookahead},parenthesized:{name:Tr.parenthesized,defaultValue:!1},terminal:{name:Tr.terminal}},superTypes:[Tt.$type]},ValueLiteral:{name:bi.$type,properties:{},superTypes:[]},Wildcard:{name:Mi.$type,properties:{cardinality:{name:Mi.cardinality},lookahead:{name:Mi.lookahead},parenthesized:{name:Mi.parenthesized,defaultValue:!1}},superTypes:[Tt.$type]}}}}const Z=new th;function Vo(t){return new Ol(t,e=>Ki(e)?e.content:[],{includeRoot:!0})}function ug(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Ko(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function fa(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var Xt;(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"})(Xt||(Xt={}));function dg(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Xt.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Xt.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?Xt.Inside:n?Xt.OverlapBack:r?Xt.OverlapFront:Xt.Outside}function fg(t,e){return dg(t,e)>Xt.After}const hg=/^[\w\p{L}]$/u;function pg(t,e){if(t){const n=mg(t,!0);if(n&&Ru(n,e))return n;if(Yf(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(Ru(s,e))return s}}}}function Ru(t,e){return Hf(t)&&e.includes(t.tokenType.name)}function mg(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}class nh extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function ds(t,e="Error: Got unexpected value."){throw new Error(e)}function B(t){return t.charCodeAt(0)}function Ro(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function _i(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function ar(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function gg(){throw Error("Internal Error - Should never get here!")}function vu(t){return t.type==="Character"}const ha=[];for(let t=B("0");t<=B("9");t++)ha.push(t);const pa=[B("_")].concat(ha);for(let t=B("a");t<=B("z");t++)pa.push(t);for(let t=B("A");t<=B("Z");t++)pa.push(t);const Eu=[B(" "),B("\f"),B(`
2
- `),B("\r"),B(" "),B("\v"),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B(" "),B("\u2028"),B("\u2029"),B(" "),B(" "),B(" "),B("\uFEFF")],yg=/[0-9a-fA-F]/,Gs=/[0-9]/,Tg=/[1-9]/;class rh{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 n=this.disjunction();this.consumeChar("/");const r={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":_i(r,"global");break;case"i":_i(r,"ignoreCase");break;case"m":_i(r,"multiLine");break;case"u":_i(r,"unicode");break;case"y":_i(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}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 n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":n="Lookbehind";break;case"!":n="NegativeLookbehind"}break}}ar(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return gg()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;ar(n);break}if(!(e===!0&&n===void 0)&&ar(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=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()),ar(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[B(`
3
- `),B("\r"),B("\u2028"),B("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=ha;break;case"D":e=ha,n=!0;break;case"s":e=Eu;break;case"S":e=Eu,n=!0;break;case"w":e=pa;break;case"W":e=pa,n=!0;break}if(ar(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=B("\f");break;case"n":e=B(`
4
- `);break;case"r":e=B("\r");break;case"t":e=B(" ");break;case"v":e=B("\v");break}if(ar(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:B("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:B(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
- `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:B(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,vu(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,vu(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else Ro(r.value,e),e.push(B("-")),Ro(i.value,e)}else Ro(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
6
- `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:B("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(Tg.test(e)===!1)throw Error("Expecting a positive integer");for(;Gs.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Gs.test(e)===!1)throw Error("Expecting an integer");for(;Gs.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
7
- `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:B(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Gs.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 n="";for(let i=0;i<e;i++){const s=this.popChar();if(yg.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,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 Wa{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.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 Rg=/\r?\n/gm,vg=new rh;class Eg extends Wa{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 n=String.fromCharCode(e.value);if(!this.multiline&&n===`
10
- `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Va(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
11
- `.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const vo=new Eg;function Ag(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),vo.reset(t),vo.visit(vg.pattern(t)),vo.multiline}catch{return!1}}const Sg=`\f
12
- \r \v              \u2028\u2029   \uFEFF`.split("");function ih(t){const e=typeof t=="string"?new RegExp(t):t;return Sg.some(n=>e.test(n))}function Va(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cg(t,e){const n=kg(t),r=e.match(n);return!!r&&r[0].length>0}function kg(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",a;function o(l){s+=n.substr(r,l),r+=l}function c(l){s+="(?:"+n.substr(r,l)+"|$)",r+=l}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?n[r+2]==="{"?c(n.indexOf("}",r)-r+1):c(6):c(2);break;case"p":case"P":e.unicode?c(n.indexOf("}",r)-r+1):c(2);break;case"k":c(n.indexOf(">",r)-r+1);break;default:c(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],c(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?o(a[0].length):c(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=n.substr(a,r-a);break;case"<":switch(n[r+3]){case"=":case"!":a=r,r+=4,i(),s+=n.substr(a,r-a);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function wg(t){return t.rules.find(e=>on(e)&&e.entry)}function Ng(t){return t.rules.filter(e=>cn(e)&&e.hidden)}function sh(t,e){const n=new Set,r=wg(t);if(!r)return new Set(t.rules);const i=[r].concat(Ng(t));for(const a of i)ah(a,n,e);const s=new Set;for(const a of t.rules)(n.has(a.name)||cn(a)&&a.hidden)&&s.add(a);return s}function ah(t,e,n){e.add(t.name),ls(t).forEach(r=>{if(Hn(r)||n){const i=r.rule.ref;i&&!e.has(i.name)&&ah(i,e,n)}})}function bg(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=ch(t.type.ref);return e==null?void 0:e.terminal}}function _g(t){return t.hidden&&!ih(Fl(t))}function Ig(t,e){return!t||!e?[]:Ml(t,e,t.astNode,!0)}function oh(t,e,n){if(!t||!e)return;const r=Ml(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Ml(t,e,n,r){if(!r){const i=za(t.grammarSource,Vn);if(i&&i.feature===e)return[t]}return Ki(t)&&t.astNode===n?t.content.flatMap(i=>Ml(i,e,n,!1)):[]}function $g(t,e,n){if(!t)return;const r=Pg(t,e,t==null?void 0:t.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Pg(t,e,n){if(t.astNode!==n)return[];if(Kn(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Vo(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===n?Kn(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function Lg(t){var n;const e=t.astNode;for(;e===((n=t.container)==null?void 0:n.astNode);){const r=za(t.grammarSource,Vn);if(r)return r;t=t.container}}function ch(t){let e=t;return Zf(e)&&(Ba(e.$container)?e=e.$container.$container:us(e.$container)?e=e.$container:ds(e.$container)),lh(t,e,new Map)}function lh(t,e,n){var i;function r(s,a){let o;return za(s,Vn)||(o=lh(a,a,n)),n.set(t,o),o}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of ls(e)){if(Vn(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Hn(s)&&on(s.rule.ref))return r(s,s.rule.ref);if(rg(s)&&((i=s.typeRef)!=null&&i.ref))return r(s,s.typeRef.ref)}}function uh(t){return dh(t,new Set)}function dh(t,e){if(e.has(t))return!0;e.add(t);for(const n of ls(t))if(Hn(n)){if(!n.rule.ref||on(n.rule.ref)&&!dh(n.rule.ref,e)||da(n.rule.ref))return!1}else{if(Vn(n))return!1;if(Ba(n))return!1}return!!t.definition}function fh(t){if(!cn(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 Hi(t){if(us(t))return on(t)&&uh(t)?t.name:fh(t)??t.name;if(Jm(t)||og(t)||ng(t))return t.name;if(Ba(t)){const e=Og(t);if(e)return e}else if(Zf(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Og(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Hi(t.type.ref)}function xg(t){var e;return cn(t)?((e=t.type)==null?void 0:e.name)??"string":fh(t)??t.name}function Fl(t){const e={s:!1,i:!1,u:!1},n=ui(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const Gl=/[\s\S]/.source;function ui(t,e){var n;if(ig(t))return Dg(t);if(sg(t))return Mg(t);if(Km(t))return Ug(t);if(ag(t)){const r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return en(ui(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Qm(t))return Gg(t);if(cg(t))return Fg(t);if(tg(t)){const r=t.regex.lastIndexOf("/"),i=t.regex.substring(1,r),s=t.regex.substring(r+1);return e&&(e.i=s.includes("i"),e.s=s.includes("s"),e.u=s.includes("u")),en(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(lg(t))return en(Gl,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(n=t==null?void 0:t.$cstNode)==null?void 0:n.text}`)}}}function Dg(t){return en(t.elements.map(e=>ui(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Mg(t){return en(t.elements.map(e=>ui(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Fg(t){return en(`${Gl}*?${ui(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Gg(t){return en(`(?!${ui(t.terminal)})${Gl}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Ug(t){return t.right?en(`[${Eo(t.left)}-${Eo(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):en(Eo(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Eo(t){return Va(t.value)}function en(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function jg(t){const e=[],n=t.Grammar;for(const r of n.rules)cn(r)&&_g(r)&&Ag(Fl(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:hg}}function Ho(t){console&&console.error&&console.error(`Error: ${t}`)}function hh(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function ph(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function mh(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function zg(t){return Bg(t)?t.LABEL:t.name}function Bg(t){return at(t.LABEL)&&t.LABEL!==""}class Bt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),U(this.definition,n=>{n.accept(e)})}}class et extends Bt{constructor(e){super([]),this.idx=1,pt(this,Pt(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class di extends Bt{constructor(e){super(e.definition),this.orgText="",pt(this,Pt(e,n=>n!==void 0))}}class ot extends Bt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,pt(this,Pt(e,n=>n!==void 0))}}let qe=class extends Bt{constructor(e){super(e.definition),this.idx=1,pt(this,Pt(e,n=>n!==void 0))}};class gt extends Bt{constructor(e){super(e.definition),this.idx=1,pt(this,Pt(e,n=>n!==void 0))}}class yt extends Bt{constructor(e){super(e.definition),this.idx=1,pt(this,Pt(e,n=>n!==void 0))}}class ve extends Bt{constructor(e){super(e.definition),this.idx=1,pt(this,Pt(e,n=>n!==void 0))}}class ct extends Bt{constructor(e){super(e.definition),this.idx=1,pt(this,Pt(e,n=>n!==void 0))}}class lt extends Bt{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,pt(this,Pt(e,n=>n!==void 0))}}class de{constructor(e){this.idx=1,pt(this,Pt(e,n=>n!==void 0))}accept(e){e.visit(this)}}function qg(t){return D(t,ta)}function ta(t){function e(n){return D(n,ta)}if(t instanceof et){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return at(t.label)&&(n.label=t.label),n}else{if(t instanceof ot)return{type:"Alternative",definition:e(t.definition)};if(t instanceof qe)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof gt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof yt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:ta(new de({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ct)return{type:"RepetitionWithSeparator",idx:t.idx,separator:ta(new de({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ve)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof lt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof de){const n={type:"Terminal",name:t.terminalType.name,label:zg(t.terminalType),idx:t.idx};at(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=rn(r)?r.source:r),n}else{if(t instanceof di)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class fi{visit(e){const n=e;switch(n.constructor){case et:return this.visitNonTerminal(n);case ot:return this.visitAlternative(n);case qe:return this.visitOption(n);case gt:return this.visitRepetitionMandatory(n);case yt:return this.visitRepetitionMandatoryWithSeparator(n);case ct:return this.visitRepetitionWithSeparator(n);case ve:return this.visitRepetition(n);case lt:return this.visitAlternation(n);case de:return this.visitTerminal(n);case di:return this.visitRule(n);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 Wg(t){return t instanceof ot||t instanceof qe||t instanceof ve||t instanceof gt||t instanceof yt||t instanceof ct||t instanceof de||t instanceof di}function ma(t,e=[]){return t instanceof qe||t instanceof ve||t instanceof ct?!0:t instanceof lt?Vf(t.definition,r=>ma(r,e)):t instanceof et&&nt(e,t)?!1:t instanceof Bt?(t instanceof et&&e.push(t),_t(t.definition,r=>ma(r,e))):!1}function Vg(t){return t instanceof lt}function Mt(t){if(t instanceof et)return"SUBRULE";if(t instanceof qe)return"OPTION";if(t instanceof lt)return"OR";if(t instanceof gt)return"AT_LEAST_ONE";if(t instanceof yt)return"AT_LEAST_ONE_SEP";if(t instanceof ct)return"MANY_SEP";if(t instanceof ve)return"MANY";if(t instanceof de)return"CONSUME";throw Error("non exhaustive match")}class Ka{walk(e,n=[]){U(e.definition,(r,i)=>{const s=Ue(e.definition,i+1);if(r instanceof et)this.walkProdRef(r,s,n);else if(r instanceof de)this.walkTerminal(r,s,n);else if(r instanceof ot)this.walkFlat(r,s,n);else if(r instanceof qe)this.walkOption(r,s,n);else if(r instanceof gt)this.walkAtLeastOne(r,s,n);else if(r instanceof yt)this.walkAtLeastOneSep(r,s,n);else if(r instanceof ct)this.walkManySep(r,s,n);else if(r instanceof ve)this.walkMany(r,s,n);else if(r instanceof lt)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new qe({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=Au(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new qe({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=Au(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);U(e.definition,s=>{const a=new ot({definition:[s]});this.walk(a,i)})}}function Au(t,e,n){return[new qe({definition:[new de({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function fs(t){if(t instanceof et)return fs(t.referencedRule);if(t instanceof de)return Yg(t);if(Wg(t))return Kg(t);if(Vg(t))return Hg(t);throw Error("non exhaustive match")}function Kg(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,a=!0;for(;i&&a;)s=n[r],a=ma(s),e=e.concat(fs(s)),r=r+1,i=n.length>r;return Ll(e)}function Hg(t){const e=D(t.definition,n=>fs(n));return Ll(Et(e))}function Yg(t){return[t.terminalType]}const gh="_~IN~_";class Xg extends Ka{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=Qg(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),a=new ot({definition:s}),o=fs(a);this.follows[i]=o}}function Jg(t){const e={};return U(t,n=>{const r=new Xg(n).startWalking();pt(e,r)}),e}function Qg(t,e){return t.name+e+gh}let na={};const Zg=new rh;function Ha(t){const e=t.toString();if(na.hasOwnProperty(e))return na[e];{const n=Zg.pattern(e);return na[e]=n,n}}function ey(){na={}}const yh="Complement Sets are not supported for first char optimization",ga=`Unable to use "first char" lexer optimizations:
13
- `;function ty(t,e=!1){try{const n=Ha(t);return Yo(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===yh)e&&hh(`${ga} 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 r="";e&&(r=`
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.`),Ho(`${ga}
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`+r)}}return[]}function Yo(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Yo(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=s;switch(a.type){case"Character":Us(a.value,e,n);break;case"Set":if(a.complement===!0)throw Error(yh);U(a.value,c=>{if(typeof c=="number")Us(c,e,n);else{const l=c;if(n===!0)for(let d=l.from;d<=l.to;d++)Us(d,e,n);else{for(let d=l.from;d<=l.to&&d<Gi;d++)Us(d,e,n);if(l.to>=Gi){const d=l.from>=Gi?l.from:Gi,h=l.to,p=An(d),g=An(h);for(let C=p;C<=g;C++)e[C]=C}}}});break;case"Group":Yo(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&Xo(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Oe(e)}function Us(t,e,n){const r=An(t);e[r]=r,n===!0&&ny(t,e)}function ny(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=An(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=An(i.charCodeAt(0));e[s]=s}}}function Su(t,e){return Vr(t.value,n=>{if(typeof n=="number")return nt(e,n);{const r=n;return Vr(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function Xo(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Be(t.value)?_t(t.value,Xo):Xo(t.value):!1}class ry extends Wa{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){nt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Su(e,this.targetCharCodes)===void 0&&(this.found=!0):Su(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Ul(t,e){if(e instanceof RegExp){const n=Ha(e),r=new ry(t);return r.visit(n),r.found}else return Vr(e,n=>nt(t,n.charCodeAt(0)))!==void 0}const Yn="PATTERN",Fi="defaultMode",js="modes";let Th=typeof new RegExp("(?:)").sticky=="boolean";function iy(t,e){e=Pl(e,{useSticky:Th,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
- `],tracer:(L,b)=>b()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{by()});let r;n("Reject Lexer.NA",()=>{r=ja(t,L=>L[Yn]===st.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=D(r,L=>{const b=L[Yn];if(rn(b)){const M=b.source;return M.length===1&&M!=="^"&&M!=="$"&&M!=="."&&!b.ignoreCase?M:M.length===2&&M[0]==="\\"&&!nt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],M[1])?M[1]:e.useSticky?ku(b):Cu(b)}else{if(Qn(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const M=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),J=new RegExp(M);return e.useSticky?ku(J):Cu(J)}}else throw Error("non exhaustive match")}})});let a,o,c,l,d;n("misc mapping",()=>{a=D(r,L=>L.tokenTypeIdx),o=D(r,L=>{const b=L.GROUP;if(b!==st.SKIPPED){if(at(b))return b;if(nn(b))return!1;throw Error("non exhaustive match")}}),c=D(r,L=>{const b=L.LONGER_ALT;if(b)return Be(b)?D(b,J=>cu(r,J)):[cu(r,b)]}),l=D(r,L=>L.PUSH_MODE),d=D(r,L=>z(L,"POP_MODE"))});let h;n("Line Terminator Handling",()=>{const L=Eh(e.lineTerminatorCharacters);h=D(r,b=>!1),e.positionTracking!=="onlyOffset"&&(h=D(r,b=>z(b,"LINE_BREAKS")?!!b.LINE_BREAKS:vh(b,L)===!1&&Ul(L,b.PATTERN)))});let p,g,C,N;n("Misc Mapping #2",()=>{p=D(r,Rh),g=D(s,ky),C=Ze(r,(L,b)=>{const M=b.GROUP;return at(M)&&M!==st.SKIPPED&&(L[M]=[]),L},{}),N=D(s,(L,b)=>({pattern:s[b],longerAlt:c[b],canLineTerminator:h[b],isCustom:p[b],short:g[b],group:o[b],push:l[b],pop:d[b],tokenTypeIdx:a[b],tokenType:r[b]}))});let x=!0,w=[];return e.safeMode||n("First Char Optimization",()=>{w=Ze(r,(L,b,M)=>{if(typeof b.PATTERN=="string"){const J=b.PATTERN.charCodeAt(0),re=An(J);Ao(L,re,N[M])}else if(Be(b.START_CHARS_HINT)){let J;U(b.START_CHARS_HINT,re=>{const ie=typeof re=="string"?re.charCodeAt(0):re,we=An(ie);J!==we&&(J=we,Ao(L,we,N[M]))})}else if(rn(b.PATTERN))if(b.PATTERN.unicode)x=!1,e.ensureOptimizations&&Ho(`${ga} Unable to analyze < ${b.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 J=ty(b.PATTERN,e.ensureOptimizations);oe(J)&&(x=!1),U(J,re=>{Ao(L,re,N[M])})}else e.ensureOptimizations&&Ho(`${ga} TokenType: <${b.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`),x=!1;return L},[])}),{emptyGroups:C,patternIdxToConfig:N,charCodeToPatternIdxToConfig:w,hasCustom:i,canBeOptimized:x}}function sy(t,e){let n=[];const r=oy(t);n=n.concat(r.errors);const i=cy(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(ay(s)),n=n.concat(gy(s)),n=n.concat(yy(s,e)),n=n.concat(Ty(s)),n}function ay(t){let e=[];const n=mt(t,r=>rn(r[Yn]));return e=e.concat(uy(n)),e=e.concat(hy(n)),e=e.concat(py(n)),e=e.concat(my(n)),e=e.concat(dy(n)),e}function oy(t){const e=mt(t,i=>!z(i,Yn)),n=D(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ee.MISSING_PATTERN,tokenTypes:[i]})),r=Ua(t,e);return{errors:n,valid:r}}function cy(t){const e=mt(t,i=>{const s=i[Yn];return!rn(s)&&!Qn(s)&&!z(s,"exec")&&!at(s)}),n=D(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:Ee.INVALID_PATTERN,tokenTypes:[i]})),r=Ua(t,e);return{errors:n,valid:r}}const ly=/[^\\][$]/;function uy(t){class e extends Wa{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=mt(t,i=>{const s=i.PATTERN;try{const a=Ha(s),o=new e;return o.visit(a),o.found}catch{return ly.test(s.source)}});return D(n,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:Ee.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function dy(t){const e=mt(t,r=>r.PATTERN.test(""));return D(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:Ee.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const fy=/[^\\[][\^]|^\^/;function hy(t){class e extends Wa{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=mt(t,i=>{const s=i.PATTERN;try{const a=Ha(s),o=new e;return o.visit(a),o.found}catch{return fy.test(s.source)}});return D(n,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:Ee.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function py(t){const e=mt(t,r=>{const i=r[Yn];return i instanceof RegExp&&(i.multiline||i.global)});return D(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ee.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function my(t){const e=[];let n=D(t,s=>Ze(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!nt(e,o)&&o.PATTERN!==st.NA&&(e.push(o),a.push(o)),a),[]));n=cs(n);const r=mt(n,s=>s.length>1);return D(r,s=>{const a=D(s,c=>c.name);return{message:`The same RegExp pattern ->${$t(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Ee.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function gy(t){const e=mt(t,r=>{if(!z(r,"GROUP"))return!1;const i=r.GROUP;return i!==st.SKIPPED&&i!==st.NA&&!at(i)});return D(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ee.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function yy(t,e){const n=mt(t,i=>i.PUSH_MODE!==void 0&&!nt(e,i.PUSH_MODE));return D(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Ee.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function Ty(t){const e=[],n=Ze(t,(r,i,s)=>{const a=i.PATTERN;return a===st.NA||(at(a)?r.push({str:a,idx:s,tokenType:i}):rn(a)&&vy(a)&&r.push({str:a.source,idx:s,tokenType:i})),r},[]);return U(t,(r,i)=>{U(n,({str:s,idx:a,tokenType:o})=>{if(i<a&&Ry(s,r.PATTERN)){const c=`Token: ->${o.name}<- can never be matched.
32
- Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
33
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Ee.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function Ry(t,e){if(rn(e)){if(Ey(e))return!1;const n=e.exec(t);return n!==null&&n.index===0}else{if(Qn(e))return e(t,0,[],{});if(z(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function vy(t){return Vr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function Ey(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function Cu(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function ku(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function Ay(t,e,n){const r=[];return z(t,Fi)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Fi+`> property in its definition
34
- `,type:Ee.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),z(t,js)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+js+`> property in its definition
35
- `,type:Ee.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),z(t,js)&&z(t,Fi)&&!z(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Fi}: <${t.defaultMode}>which does not exist
36
- `,type:Ee.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),z(t,js)&&U(t.modes,(i,s)=>{U(i,(a,o)=>{if(nn(a))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}>
37
- `,type:Ee.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(z(a,"LONGER_ALT")){const c=Be(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];U(c,l=>{!nn(l)&&!nt(i,l)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${a.name}> outside of mode <${s}>
38
- `,type:Ee.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function Sy(t,e,n){const r=[];let i=!1;const s=cs(Et(Oe(t.modes))),a=ja(s,c=>c[Yn]===st.NA),o=Eh(n);return e&&U(a,c=>{const l=vh(c,o);if(l!==!1){const h={message:Ny(c,l),type:l.issue,tokenType:c};r.push(h)}else z(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Ul(o,c.PATTERN)&&(i=!0)}),e&&!i&&r.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:Ee.NO_LINE_BREAKS_FLAGS}),r}function Cy(t){const e={},n=Wr(t);return U(n,r=>{const i=t[r];if(Be(i))e[r]=[];else throw Error("non exhaustive match")}),e}function Rh(t){const e=t.PATTERN;if(rn(e))return!1;if(Qn(e))return!0;if(z(e,"exec"))return!0;if(at(e))return!1;throw Error("non exhaustive match")}function ky(t){return at(t)&&t.length===1?t.charCodeAt(0):!1}const wy={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function vh(t,e){if(z(t,"LINE_BREAKS"))return!1;if(rn(t.PATTERN)){try{Ul(e,t.PATTERN)}catch(n){return{issue:Ee.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(at(t.PATTERN))return!1;if(Rh(t))return{issue:Ee.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Ny(t,e){if(e.issue===Ee.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===Ee.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 Eh(t){return D(t,n=>at(n)?n.charCodeAt(0):n)}function Ao(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Gi=256;let ra=[];function An(t){return t<Gi?t:ra[t]}function by(){if(oe(ra)){ra=new Array(65536);for(let t=0;t<65536;t++)ra[t]=t>255?255+~~(t/255):t}}function hs(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function ya(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let wu=1;const Ah={};function ps(t){const e=_y(t);Iy(e),Py(e),$y(e),U(e,n=>{n.isParent=n.categoryMatches.length>0})}function _y(t){let e=We(t),n=t,r=!0;for(;r;){n=cs(Et(D(n,s=>s.CATEGORIES)));const i=Ua(n,e);e=e.concat(i),oe(i)?r=!1:n=i}return e}function Iy(t){U(t,e=>{Ch(e)||(Ah[wu]=e,e.tokenTypeIdx=wu++),Nu(e)&&!Be(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Nu(e)||(e.CATEGORIES=[]),Ly(e)||(e.categoryMatches=[]),Oy(e)||(e.categoryMatchesMap={})})}function $y(t){U(t,e=>{e.categoryMatches=[],U(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(Ah[r].tokenTypeIdx)})})}function Py(t){U(t,e=>{Sh([],e)})}function Sh(t,e){U(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),U(e.CATEGORIES,n=>{const r=t.concat(e);nt(r,n)||Sh(r,n)})}function Ch(t){return z(t,"tokenTypeIdx")}function Nu(t){return z(t,"CATEGORIES")}function Ly(t){return z(t,"categoryMatches")}function Oy(t){return z(t,"categoryMatchesMap")}function xy(t){return z(t,"tokenTypeIdx")}const Jo={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var Ee;(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"})(Ee||(Ee={}));const Ui={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Jo,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ui);class st{constructor(e,n=Ui){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);const{time:o,value:c}=ph(s),l=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${a}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,c}else return s()},typeof n=="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=pt({},Ui,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ui.lineTerminatorsPattern)this.config.lineTerminatorsPattern=wy;else if(this.config.lineTerminatorCharacters===Ui.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(n.safeMode&&n.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:We(e)},defaultMode:Fi}:(s=!1,i=We(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Ay(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Sy(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},U(i.modes,(o,c)=>{i.modes[c]=ja(o,l=>nn(l))});const a=Wr(i.modes);if(U(i.modes,(o,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(sy(o,a))}),oe(this.lexerDefinitionErrors)){ps(o);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=iy(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=l.charCodeToPatternIdxToConfig,this.emptyGroups=pt({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!oe(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=D(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
51
- `);throw new Error(`Errors detected in definition of Lexer:
52
- `+c)}U(this.lexerDefinitionWarning,o=>{hh(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Th?(this.chopInput=ou,this.match=this.matchWithTest):(this.updateLastIndex=De,this.match=this.matchWithExec),s&&(this.handleModes=De),this.trackStartLines===!1&&(this.computeNewColumn=ou),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=De),/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,(c,l,d)=>(l===!1&&c.push(d),c),[]);if(n.ensureOptimizations&&!oe(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",()=>{ey()}),this.TRACE_INIT("toFastProperties",()=>{mh(this)})})}tokenize(e,n=this.defaultMode){if(!oe(this.lexerDefinitionErrors)){const i=D(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
55
- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
56
- `+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,a,o,c,l,d,h,p,g,C,N,x,w;const L=e,b=L.length;let M=0,J=0;const re=this.hasCustom?0:Math.floor(e.length/10),ie=new Array(re),we=[];let _e=this.trackStartLines?1:void 0,Ie=this.trackStartLines?1:void 0;const k=Cy(this.emptyGroups),E=this.trackStartLines,m=this.config.lineTerminatorsPattern;let S=0,y=[],T=[];const v=[],$=[];Object.freeze($);let O;function P(){return y}function j(te){const Pe=An(te),Fe=T[Pe];return Fe===void 0?$:Fe}const q=te=>{if(v.length===1&&te.tokenType.PUSH_MODE===void 0){const Pe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(te);we.push({offset:te.startOffset,line:te.startLine,column:te.startColumn,length:te.image.length,message:Pe})}else{v.pop();const Pe=Wn(v);y=this.patternIdxToConfig[Pe],T=this.charCodeToPatternIdxToConfig[Pe],S=y.length;const Fe=this.canModeBeOptimized[Pe]&&this.config.safeMode===!1;T&&Fe?O=j:O=P}};function se(te){v.push(te),T=this.charCodeToPatternIdxToConfig[te],y=this.patternIdxToConfig[te],S=y.length,S=y.length;const Pe=this.canModeBeOptimized[te]&&this.config.safeMode===!1;T&&Pe?O=j:O=P}se.call(this,n);let V;const $e=this.config.recoveryEnabled;for(;M<b;){c=null;const te=L.charCodeAt(M),Pe=O(te),Fe=Pe.length;for(r=0;r<Fe;r++){V=Pe[r];const fe=V.pattern;l=null;const Ge=V.short;if(Ge!==!1?te===Ge&&(c=fe):V.isCustom===!0?(w=fe.exec(L,M,ie,k),w!==null?(c=w[0],w.payload!==void 0&&(l=w.payload)):c=null):(this.updateLastIndex(fe,M),c=this.match(fe,e,M)),c!==null){if(o=V.longerAlt,o!==void 0){const Ae=o.length;for(s=0;s<Ae;s++){const K=y[o[s]],xe=K.pattern;if(d=null,K.isCustom===!0?(w=xe.exec(L,M,ie,k),w!==null?(a=w[0],w.payload!==void 0&&(d=w.payload)):a=null):(this.updateLastIndex(xe,M),a=this.match(xe,e,M)),a&&a.length>c.length){c=a,l=d,V=K;break}}}break}}if(c!==null){if(h=c.length,p=V.group,p!==void 0&&(g=V.tokenTypeIdx,C=this.createTokenInstance(c,M,g,V.tokenType,_e,Ie,h),this.handlePayload(C,l),p===!1?J=this.addToken(ie,J,C):k[p].push(C)),e=this.chopInput(e,h),M=M+h,Ie=this.computeNewColumn(Ie,h),E===!0&&V.canLineTerminator===!0){let fe=0,Ge,Ae;m.lastIndex=0;do Ge=m.test(c),Ge===!0&&(Ae=m.lastIndex-1,fe++);while(Ge===!0);fe!==0&&(_e=_e+fe,Ie=h-Ae,this.updateTokenEndLineColumnLocation(C,p,Ae,fe,_e,Ie,h))}this.handleModes(V,q,se,C)}else{const fe=M,Ge=_e,Ae=Ie;let K=$e===!1;for(;K===!1&&M<b;)for(e=this.chopInput(e,1),M++,i=0;i<S;i++){const xe=y[i],ce=xe.pattern,rt=xe.short;if(rt!==!1?L.charCodeAt(M)===rt&&(K=!0):xe.isCustom===!0?K=ce.exec(L,M,ie,k)!==null:(this.updateLastIndex(ce,M),K=ce.exec(e)!==null),K===!0)break}if(N=M-fe,Ie=this.computeNewColumn(Ie,N),x=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(L,fe,N,Ge,Ae,Wn(v)),we.push({offset:fe,line:Ge,column:Ae,length:N,message:x}),$e===!1)break}}return this.hasCustom||(ie.length=J),{tokens:ie,groups:k,errors:we}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,n){return e.substring(n)}updateLastIndex(e,n){e.lastIndex=n}updateTokenEndLineColumnLocation(e,n,r,i,s,a,o){let c,l;n!==void 0&&(c=r===o-1,l=c?-1:0,i===1&&c===!0||(e.endLine=s+l,e.endColumn=a-1+-l))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,a){return{image:e,startOffset:n,startLine:s,startColumn:a,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:n+o-1,startLine:s,endLine:s,startColumn:a,endColumn:a+o-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}matchWithTest(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchWithExec(e,n){const r=e.exec(n);return r!==null?r[0]:null}}st.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.";st.NA=/NOT_APPLICABLE/;function Nr(t){return kh(t)?t.LABEL:t.name}function kh(t){return at(t.LABEL)&&t.LABEL!==""}const Dy="parent",bu="categories",_u="label",Iu="group",$u="push_mode",Pu="pop_mode",Lu="longer_alt",Ou="line_breaks",xu="start_chars_hint";function wh(t){return My(t)}function My(t){const e=t.pattern,n={};if(n.name=t.name,nn(e)||(n.PATTERN=e),z(t,Dy))throw`The parent property is no longer supported.
57
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return z(t,bu)&&(n.CATEGORIES=t[bu]),ps([n]),z(t,_u)&&(n.LABEL=t[_u]),z(t,Iu)&&(n.GROUP=t[Iu]),z(t,Pu)&&(n.POP_MODE=t[Pu]),z(t,$u)&&(n.PUSH_MODE=t[$u]),z(t,Lu)&&(n.LONGER_ALT=t[Lu]),z(t,Ou)&&(n.LINE_BREAKS=t[Ou]),z(t,xu)&&(n.START_CHARS_HINT=t[xu]),n}const Sn=wh({name:"EOF",pattern:st.NA});ps([Sn]);function jl(t,e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Nh(t,e){return hs(t,e)}const kr={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${kh(t)?`--> ${Nr(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:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o=`
58
- but found: '`+$t(e).image+"'";if(r)return s+r+o;{const c=Ze(t,(p,g)=>p.concat(g),[]),l=D(c,p=>`[${D(p,g=>Nr(g)).join(", ")}]`),h=`one of these possible Token sequences:
59
- ${D(l,(p,g)=>` ${g+1}. ${p}`).join(`
60
- `)}`;return s+h+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a=`
61
- but found: '`+$t(e).image+"'";if(n)return i+n+a;{const c=`expecting at least one iteration which starts with one of these possible Token sequences::
62
- <${D(t,l=>`[${D(l,d=>Nr(d)).join(",")}]`).join(" ,")}>`;return i+c+a}}};Object.freeze(kr);const Fy={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
- inside top level rule: ->`+t.name+"<-"}},Bn={buildDuplicateFoundError(t,e){function n(d){return d instanceof de?d.terminalType.name:d instanceof et?d.nonTerminalName:""}const r=t.name,i=$t(e),s=i.idx,a=Mt(i),o=n(i),c=s>0;let l=`->${a}${c?s:""}<- ${o?`with argument: ->${o}<-`:""}
64
- appears more than once (${e.length} times) in the top level rule: ->${r}<-.
65
- For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
66
- `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
67
- `),l},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=D(t.prefixPath,i=>Nr(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
72
- in <OR${n}> 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=D(t.prefixPath,i=>Nr(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,
76
- <${e}> may appears as a prefix path in all these alternatives.
77
- `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
78
- For Further details.`,r},buildEmptyRepetitionError(t){let e=Mt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
79
- 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.
80
- Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
81
- <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
82
- has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=D(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
83
- rule: <${e}> can be invoked from itself (directly or indirectly)
84
- without consuming any Tokens. The grammar path that causes this is:
85
- ${r}
86
- To fix this refactor your grammar to remove the left recursion.
87
- see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof di?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Gy(t,e){const n=new Uy(t,e);return n.resolveRefs(),n.errors}class Uy extends fi{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){U(Oe(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:tt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class jy extends Ka{constructor(e,n){super(),this.topProd=e,this.path=n,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=We(this.path.ruleStack).reverse(),this.occurrenceStack=We(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){oe(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class zy extends jy{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new ot({definition:i});this.possibleTokTypes=fs(s),this.found=!0}}}class Ya extends Ka{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class By extends Ya{walkMany(e,n,r){if(e.idx===this.occurrence){const i=$t(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof de&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class Du extends Ya{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=$t(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof de&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class qy extends Ya{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=$t(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof de&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class Mu extends Ya{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=$t(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof de&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Qo(t,e,n=[]){n=We(n);let r=[],i=0;function s(o){return o.concat(Ue(t,i+1))}function a(o){const c=Qo(s(o),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const o=t[i];if(o instanceof ot)return a(o.definition);if(o instanceof et)return a(o.definition);if(o instanceof qe)r=a(o.definition);else if(o instanceof gt){const c=o.definition.concat([new ve({definition:o.definition})]);return a(c)}else if(o instanceof yt){const c=[new ot({definition:o.definition}),new ve({definition:[new de({terminalType:o.separator})].concat(o.definition)})];return a(c)}else if(o instanceof ct){const c=o.definition.concat([new ve({definition:[new de({terminalType:o.separator})].concat(o.definition)})]);r=a(c)}else if(o instanceof ve){const c=o.definition.concat([new ve({definition:o.definition})]);r=a(c)}else{if(o instanceof lt)return U(o.definition,c=>{oe(c.definition)===!1&&(r=a(c.definition))}),r;if(o instanceof de)n.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Ue(t,i)}),r}function bh(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const c=e.length,l=c-r-1,d=[],h=[];for(h.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!oe(h);){const p=h.pop();if(p===a){o&&Wn(h).idx<=l&&h.pop();continue}const g=p.def,C=p.idx,N=p.ruleStack,x=p.occurrenceStack;if(oe(g))continue;const w=g[0];if(w===i){const L={idx:C,def:Ue(g),ruleStack:Vi(N),occurrenceStack:Vi(x)};h.push(L)}else if(w instanceof de)if(C<c-1){const L=C+1,b=e[L];if(n(b,w.terminalType)){const M={idx:L,def:Ue(g),ruleStack:N,occurrenceStack:x};h.push(M)}}else if(C===c-1)d.push({nextTokenType:w.terminalType,nextTokenOccurrence:w.idx,ruleStack:N,occurrenceStack:x}),o=!0;else throw Error("non exhaustive match");else if(w instanceof et){const L=We(N);L.push(w.nonTerminalName);const b=We(x);b.push(w.idx);const M={idx:C,def:w.definition.concat(s,Ue(g)),ruleStack:L,occurrenceStack:b};h.push(M)}else if(w instanceof qe){const L={idx:C,def:Ue(g),ruleStack:N,occurrenceStack:x};h.push(L),h.push(a);const b={idx:C,def:w.definition.concat(Ue(g)),ruleStack:N,occurrenceStack:x};h.push(b)}else if(w instanceof gt){const L=new ve({definition:w.definition,idx:w.idx}),b=w.definition.concat([L],Ue(g)),M={idx:C,def:b,ruleStack:N,occurrenceStack:x};h.push(M)}else if(w instanceof yt){const L=new de({terminalType:w.separator}),b=new ve({definition:[L].concat(w.definition),idx:w.idx}),M=w.definition.concat([b],Ue(g)),J={idx:C,def:M,ruleStack:N,occurrenceStack:x};h.push(J)}else if(w instanceof ct){const L={idx:C,def:Ue(g),ruleStack:N,occurrenceStack:x};h.push(L),h.push(a);const b=new de({terminalType:w.separator}),M=new ve({definition:[b].concat(w.definition),idx:w.idx}),J=w.definition.concat([M],Ue(g)),re={idx:C,def:J,ruleStack:N,occurrenceStack:x};h.push(re)}else if(w instanceof ve){const L={idx:C,def:Ue(g),ruleStack:N,occurrenceStack:x};h.push(L),h.push(a);const b=new ve({definition:w.definition,idx:w.idx}),M=w.definition.concat([b],Ue(g)),J={idx:C,def:M,ruleStack:N,occurrenceStack:x};h.push(J)}else if(w instanceof lt)for(let L=w.definition.length-1;L>=0;L--){const b=w.definition[L],M={idx:C,def:b.definition.concat(Ue(g)),ruleStack:N,occurrenceStack:x};h.push(M),h.push(a)}else if(w instanceof ot)h.push({idx:C,def:w.definition.concat(Ue(g)),ruleStack:N,occurrenceStack:x});else if(w instanceof di)h.push(Wy(w,C,N,x));else throw Error("non exhaustive match")}return d}function Wy(t,e,n,r){const i=We(n);i.push(t.name);const s=We(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var me;(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"})(me||(me={}));function zl(t){if(t instanceof qe||t==="Option")return me.OPTION;if(t instanceof ve||t==="Repetition")return me.REPETITION;if(t instanceof gt||t==="RepetitionMandatory")return me.REPETITION_MANDATORY;if(t instanceof yt||t==="RepetitionMandatoryWithSeparator")return me.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ct||t==="RepetitionWithSeparator")return me.REPETITION_WITH_SEPARATOR;if(t instanceof lt||t==="Alternation")return me.ALTERNATION;throw Error("non exhaustive match")}function Fu(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=zl(r);return s===me.ALTERNATION?Xa(e,n,i):Ja(e,n,s,i)}function Vy(t,e,n,r,i,s){const a=Xa(t,e,n),o=$h(a)?ya:hs;return s(a,r,o,i)}function Ky(t,e,n,r,i,s){const a=Ja(t,e,i,n),o=$h(a)?ya:hs;return s(a[0],o,r)}function Hy(t,e,n,r){const i=t.length,s=_t(t,a=>_t(a,o=>o.length===1));if(e)return function(a){const o=D(a,c=>c.GATE);for(let c=0;c<i;c++){const l=t[c],d=l.length,h=o[c];if(!(h!==void 0&&h.call(this)===!1))e:for(let p=0;p<d;p++){const g=l[p],C=g.length;for(let N=0;N<C;N++){const x=this.LA(N+1);if(n(x,g[N])===!1)continue e}return c}}};if(s&&!r){const a=D(t,c=>Et(c)),o=Ze(a,(c,l,d)=>(U(l,h=>{z(c,h.tokenTypeIdx)||(c[h.tokenTypeIdx]=d),U(h.categoryMatches,p=>{z(c,p)||(c[p]=d)})}),c),{});return function(){const c=this.LA(1);return o[c.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=t[a],c=o.length;e:for(let l=0;l<c;l++){const d=o[l],h=d.length;for(let p=0;p<h;p++){const g=this.LA(p+1);if(n(g,d[p])===!1)continue e}return a}}}}function Yy(t,e,n){const r=_t(t,s=>s.length===1),i=t.length;if(r&&!n){const s=Et(t);if(s.length===1&&oe(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=Ze(s,(o,c,l)=>(o[c.tokenTypeIdx]=!0,U(c.categoryMatches,d=>{o[d]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const a=t[s],o=a.length;for(let c=0;c<o;c++){const l=this.LA(c+1);if(e(l,a[c])===!1)continue e}return!0}return!1}}class Xy extends Ka{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,me.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,me.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,me.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,me.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,me.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class _h extends fi{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,me.OPTION)}visitRepetition(e){this.checkIsTarget(e,me.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,me.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,me.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,me.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,me.ALTERNATION)}}function Gu(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function So(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const a=e[s];i.push(a+"_"+r.tokenTypeIdx);for(let o=0;o<r.categoryMatches.length;o++){const c="_"+r.categoryMatches[o];i.push(a+c)}}e=i}return e}function Jy(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}function Ih(t,e){const n=D(t,a=>Qo([a],1)),r=Gu(n.length),i=D(n,a=>{const o={};return U(a,c=>{const l=So(c.partialPath);U(l,d=>{o[d]=!0})}),o});let s=n;for(let a=1;a<=e;a++){const o=s;s=Gu(o.length);for(let c=0;c<o.length;c++){const l=o[c];for(let d=0;d<l.length;d++){const h=l[d].partialPath,p=l[d].suffixDef,g=So(h);if(Jy(i,g,c)||oe(p)||h.length===e){const N=r[c];if(Zo(N,h)===!1){N.push(h);for(let x=0;x<g.length;x++){const w=g[x];i[c][w]=!0}}}else{const N=Qo(p,a+1,h);s[c]=s[c].concat(N),U(N,x=>{const w=So(x.partialPath);U(w,L=>{i[c][L]=!0})})}}}}return r}function Xa(t,e,n,r){const i=new _h(t,me.ALTERNATION,r);return e.accept(i),Ih(i.result,n)}function Ja(t,e,n,r){const i=new _h(t,n);e.accept(i);const s=i.result,o=new Xy(e,t,n).startWalking(),c=new ot({definition:s}),l=new ot({definition:o});return Ih([c,l],r)}function Zo(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],a=r[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Qy(t,e){return t.length<e.length&&_t(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function $h(t){return _t(t,e=>_t(e,n=>_t(n,r=>oe(r.categoryMatches))))}function Zy(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return D(e,n=>Object.assign({type:tt.CUSTOM_LOOKAHEAD_VALIDATION},n))}function eT(t,e,n,r){const i=ht(t,c=>tT(c,n)),s=hT(t,e,n),a=ht(t,c=>lT(c,n)),o=ht(t,c=>iT(c,t,r,n));return i.concat(s,a,o)}function tT(t,e){const n=new rT;t.accept(n);const r=n.allProductions,i=Lm(r,nT),s=Pt(i,o=>o.length>1);return D(Oe(s),o=>{const c=$t(o),l=e.buildDuplicateFoundError(t,o),d=Mt(c),h={message:l,type:tt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:d,occurrence:c.idx},p=Ph(c);return p&&(h.parameter=p),h})}function nT(t){return`${Mt(t)}_#_${t.idx}_#_${Ph(t)}`}function Ph(t){return t instanceof de?t.terminalType.name:t instanceof et?t.nonTerminalName:""}class rT extends fi{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 iT(t,e,n,r){const i=[];if(Ze(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:a,type:tt.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function sT(t,e,n){const r=[];let i;return nt(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:tt.INVALID_RULE_OVERRIDE,ruleName:t})),r}function Lh(t,e,n,r=[]){const i=[],s=ia(e.definition);if(oe(s))return[];{const a=t.name;nt(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:tt.LEFT_RECURSION,ruleName:a});const c=Ua(s,r.concat([t])),l=ht(c,d=>{const h=We(r);return h.push(d),Lh(t,d,n,h)});return i.concat(l)}}function ia(t){let e=[];if(oe(t))return e;const n=$t(t);if(n instanceof et)e.push(n.referencedRule);else if(n instanceof ot||n instanceof qe||n instanceof gt||n instanceof yt||n instanceof ct||n instanceof ve)e=e.concat(ia(n.definition));else if(n instanceof lt)e=Et(D(n.definition,s=>ia(s.definition)));else if(!(n instanceof de))throw Error("non exhaustive match");const r=ma(n),i=t.length>1;if(r&&i){const s=Ue(t);return e.concat(ia(s))}else return e}class Bl extends fi{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function aT(t,e){const n=new Bl;t.accept(n);const r=n.alternations;return ht(r,s=>{const a=Vi(s.definition);return ht(a,(o,c)=>{const l=bh([o],[],hs,1);return oe(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:tt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function oT(t,e,n){const r=new Bl;t.accept(r);let i=r.alternations;return i=ja(i,a=>a.ignoreAmbiguities===!0),ht(i,a=>{const o=a.idx,c=a.maxLookahead||e,l=Xa(o,t,c,a),d=dT(l,a,t,n),h=fT(l,a,t,n);return d.concat(h)})}class cT extends fi{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 lT(t,e){const n=new Bl;t.accept(n);const r=n.alternations;return ht(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:tt.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function uT(t,e,n){const r=[];return U(t,i=>{const s=new cT;i.accept(s);const a=s.allProductions;U(a,o=>{const c=zl(o),l=o.maxLookahead||e,d=o.idx,p=Ja(d,i,c,l)[0];if(oe(Et(p))){const g=n.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:g,type:tt.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function dT(t,e,n,r){const i=[],s=Ze(t,(o,c,l)=>(e.definition[l].ignoreAmbiguities===!0||U(c,d=>{const h=[l];U(t,(p,g)=>{l!==g&&Zo(p,d)&&e.definition[g].ignoreAmbiguities!==!0&&h.push(g)}),h.length>1&&!Zo(i,d)&&(i.push(d),o.push({alts:h,path:d}))}),o),[]);return D(s,o=>{const c=D(o.alts,d=>d+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:o.path}),type:tt.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:o.alts}})}function fT(t,e,n,r){const i=Ze(t,(a,o,c)=>{const l=D(o,d=>({idx:c,path:d}));return a.concat(l)},[]);return cs(ht(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const c=a.idx,l=a.path,d=mt(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<c&&Qy(p.path,l));return D(d,p=>{const g=[p.idx+1,c+1],C=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:g,prefixPath:p.path}),type:tt.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:C,alternatives:g}})}))}function hT(t,e,n){const r=[],i=D(e,s=>s.name);return U(t,s=>{const a=s.name;if(nt(i,a)){const o=n.buildNamespaceConflictError(s);r.push({message:o,type:tt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function pT(t){const e=Pl(t,{errMsgProvider:Fy}),n={};return U(t.rules,r=>{n[r.name]=r}),Gy(n,e.errMsgProvider)}function mT(t){return t=Pl(t,{errMsgProvider:Bn}),eT(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const Oh="MismatchedTokenException",xh="NoViableAltException",Dh="EarlyExitException",Mh="NotAllInputParsedException",Fh=[Oh,xh,Dh,Mh];Object.freeze(Fh);function Ta(t){return nt(Fh,t.name)}class Qa extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Gh extends Qa{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=Oh}}class gT extends Qa{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=xh}}class yT extends Qa{constructor(e,n){super(e,n),this.name=Mh}}class TT extends Qa{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=Dh}}const Co={},Uh="InRuleRecoveryException";class RT extends Error{constructor(e){super(e),this.name=Uh}}class vT{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=z(e,"recoveryEnabled")?e.recoveryEnabled:sn.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=ET)}getTokenToInsert(e){const n=jl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let c=!1;const l=this.LA(1);let d=this.LA(1);const h=()=>{const p=this.LA(0),g=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),C=new Gh(g,l,this.LA(0));C.resyncedTokens=Vi(o),this.SAVE_ERROR(C)};for(;!c;)if(this.tokenMatcher(d,i)){h();return}else if(r.call(this)){h(),e.apply(this,n);return}else this.tokenMatcher(d,s)?c=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new RT("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||oe(n))return!1;const r=this.LA(1);return Vr(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return nt(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=Vr(e,s=>Nh(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Co;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return D(e,(r,i)=>i===0?Co:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=D(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return Et(e)}getFollowSetFromFollowKey(e){if(e===Co)return[Sn];const n=e.ruleName+e.idxInCallingRule+gh+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,Sn)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return Vi(n)}attemptInRepetitionRecovery(e,n,r,i,s,a,o){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=We(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return D(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function ET(t,e,n,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[o];if(c===void 0){const p=this.getCurrRuleFullName(),g=this.getGAstProductions()[p];c=new s(g,i).startWalking(),this.firstAfterRepMap[o]=c}let l=c.token,d=c.occurrence;const h=c.isEndOfRule;this.RULE_STACK.length===1&&h&&l===void 0&&(l=Sn,d=1),!(l===void 0||d===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,d,a)&&this.tryInRepetitionRecovery(t,e,n,l)}const AT=4,wn=8,jh=1<<wn,zh=2<<wn,ec=3<<wn,tc=4<<wn,nc=5<<wn,sa=6<<wn;function ko(t,e,n){return n|e|t}class ql{constructor(e){var n;this.maxLookahead=(n=e==null?void 0:e.maxLookahead)!==null&&n!==void 0?n:sn.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(oe(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return ht(e,n=>Lh(n,n,Bn))}validateEmptyOrAlternatives(e){return ht(e,n=>aT(n,Bn))}validateAmbiguousAlternationAlternatives(e,n){return ht(e,r=>oT(r,n,Bn))}validateSomeNonEmptyLookaheadPath(e,n){return uT(e,n,Bn)}buildLookaheadForAlternation(e){return Vy(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Hy)}buildLookaheadForOptional(e){return Ky(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,zl(e.prodType),Yy)}}class ST{initLooksAhead(e){this.dynamicTokensEnabled=z(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:sn.dynamicTokensEnabled,this.maxLookahead=z(e,"maxLookahead")?e.maxLookahead:sn.maxLookahead,this.lookaheadStrategy=z(e,"lookaheadStrategy")?e.lookaheadStrategy:new ql({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){U(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:c}=kT(n);U(r,l=>{const d=l.idx===0?"":l.idx;this.TRACE_INIT(`${Mt(l)}${d}`,()=>{const h=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:n,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=ko(this.fullRuleNameToShort[n.name],jh,l.idx);this.setLaFuncCache(p,h)})}),U(i,l=>{this.computeLookaheadFunc(n,l.idx,ec,"Repetition",l.maxLookahead,Mt(l))}),U(s,l=>{this.computeLookaheadFunc(n,l.idx,zh,"Option",l.maxLookahead,Mt(l))}),U(a,l=>{this.computeLookaheadFunc(n,l.idx,tc,"RepetitionMandatory",l.maxLookahead,Mt(l))}),U(o,l=>{this.computeLookaheadFunc(n,l.idx,sa,"RepetitionMandatoryWithSeparator",l.maxLookahead,Mt(l))}),U(c,l=>{this.computeLookaheadFunc(n,l.idx,nc,"RepetitionWithSeparator",l.maxLookahead,Mt(l))})})})}computeLookaheadFunc(e,n,r,i,s,a){this.TRACE_INIT(`${a}${n===0?"":n}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=ko(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,o)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return ko(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class CT extends fi{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 zs=new CT;function kT(t){zs.reset(),t.accept(zs);const e=zs.dslMethods;return zs.reset(),e}function Uu(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function ju(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 wT(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function NT(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const bT="name";function Bh(t,e){Object.defineProperty(t,bT,{enumerable:!1,configurable:!0,writable:!1,value:e})}function _T(t,e){const n=Wr(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],a=t[s],o=a.length;for(let c=0;c<o;c++){const l=a[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function IT(t,e){const n=function(){};Bh(n,t+"BaseSemantics");const r={visit:function(i,s){if(Be(i)&&(i=i[0]),!nn(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=PT(this,e);if(!oe(i)){const s=D(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
88
- ${s.join(`
89
-
90
- `).replace(/\n/g,`
91
- `)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function $T(t,e,n){const r=function(){};Bh(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return U(e,s=>{i[s]=_T}),r.prototype=i,r.prototype.constructor=r,r}var rc;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(rc||(rc={}));function PT(t,e){return LT(t,e)}function LT(t,e){const n=mt(e,i=>Qn(t[i])===!1),r=D(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:rc.MISSING_METHOD,methodName:i}));return cs(r)}class OT{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=z(e,"nodeLocationTracking")?e.nodeLocationTracking:sn.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=De,this.cstFinallyStateUpdate=De,this.cstPostTerminal=De,this.cstPostNonTerminal=De,this.cstPostRule=De;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ju,this.setNodeLocationFromNode=ju,this.cstPostRule=De,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=De,this.setNodeLocationFromNode=De,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=De,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=De,this.setNodeLocationFromNode=De,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=De,this.setNodeLocationFromNode=De,this.cstPostRule=De,this.setInitialNodeLocation=De;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 n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];wT(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];NT(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(nn(this.baseCstVisitorConstructor)){const e=IT(this.className,Wr(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(nn(this.baseCstVisitorWithDefaultsConstructor)){const e=$T(this.className,Wr(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 xT{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)):va}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?va:this.tokVector[n]}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 DT{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}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,n,r=Ea){if(nt(this.definedRulesNames,e)){const a={message:Bn.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:tt.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=Ea){const i=sT(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(Ta(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return qg(Oe(this.gastProductionsCache))}}class MT{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ya,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},z(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
92
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
93
- For Further details.`);if(Be(e)){if(oe(e))throw Error(`A Token Vocabulary cannot be empty.
94
- Note that the first argument for the parser constructor
95
- 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.
96
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
97
- For Further details.`)}if(Be(e))this.tokensMap=Ze(e,(s,a)=>(s[a.name]=a,s),{});else if(z(e,"modes")&&_t(Et(Oe(e.modes)),xy)){const s=Et(Oe(e.modes)),a=Ll(s);this.tokensMap=Ze(a,(o,c)=>(o[c.name]=c,o),{})}else if(dm(e))this.tokensMap=We(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=Sn;const r=z(e,"modes")?Et(Oe(e.modes)):Oe(e),i=_t(r,s=>oe(s.categoryMatches));this.tokenMatcher=i?ya:hs,ps(Oe(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
98
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=z(r,"resyncEnabled")?r.resyncEnabled:Ea.resyncEnabled,s=z(r,"recoveryValueFunc")?r.recoveryValueFunc:Ea.recoveryValueFunc,a=this.ruleShortNameIdx<<AT+wn;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return this.outputCst===!0?o=function(...d){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,d);const h=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(h),h}catch(h){return this.invokeRuleCatch(h,i,s)}finally{this.ruleFinallyStateUpdate()}}:o=function(...d){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,d)}catch(h){return this.invokeRuleCatch(h,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(Ta(e)){const a=e;if(s){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return r(e);else{if(this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,a.partialCstResult=c}throw a}}else{if(i)return this.moveToTerminatedState(),r(e);throw a}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(zh,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const a=e.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(tc,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=n;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,me.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,tc,e,qy)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(sa,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Mu],o,sa,e,Mu)}else throw this.raiseEarlyExitException(e,me.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(ec,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const c=i;i=()=>o.call(this)&&c.call(this)}}else s=n;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,ec,e,By,a)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(nc,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Du],o,nc,e,Du)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,sa,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(jh,n),i=Be(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(n,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),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new yT(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw Ta(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Gh(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===Uh?r:s}}else throw r}saveRecogState(){const e=this.errors,n=We(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}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),Sn)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class FT{initErrorHandler(e){this._errors=[],this.errorMessageProvider=z(e,"errorMessageProvider")?e.errorMessageProvider:sn.errorMessageProvider}SAVE_ERROR(e){if(Ta(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:We(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return We(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=Ja(e,s,n,this.maxLookahead)[0],c=[];for(let d=1;d<=this.maxLookahead;d++)c.push(this.LA(d));const l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new TT(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=Xa(e,i,this.maxLookahead),a=[];for(let l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));const o=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new gT(c,this.LA(1),o))}}class GT{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(nn(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return bh([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=$t(e.ruleStack),i=this.getGAstProductions()[n];return new zy(i,e).startWalking()}}const Za={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Za);const zu=!0,Bu=Math.pow(2,wn)-1,qh=wh({name:"RECORDING_PHASE_TOKEN",pattern:st.NA});ps([qh]);const Wh=jl(qh,`This IToken indicates the Parser is in Recording Phase
99
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Wh);const UT={name:`This CSTNode indicates the Parser is in Recording Phase
100
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class jT{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 n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},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 n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}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,n){return()=>!0}LA_RECORD(e){return va}topLevelRuleRecord(e,n){try{const r=new di({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
101
- This error was thrown during the "grammar recording phase" For more info see:
102
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return Ii.call(this,qe,e,n)}atLeastOneInternalRecord(e,n){Ii.call(this,gt,n,e)}atLeastOneSepFirstInternalRecord(e,n){Ii.call(this,yt,n,e,zu)}manyInternalRecord(e,n){Ii.call(this,ve,n,e)}manySepFirstInternalRecord(e,n){Ii.call(this,ct,n,e,zu)}orInternalRecord(e,n){return zT.call(this,e,n)}subruleInternalRecord(e,n,r){if(Ra(n),!e||z(e,"ruleName")===!1){const o=new Error(`<SUBRULE${qu(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
103
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Wn(this.recordingProdStack),s=e.ruleName,a=new et({idx:n,nonTerminalName:s,label:r==null?void 0:r.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?UT:Za}consumeInternalRecord(e,n,r){if(Ra(n),!Ch(e)){const a=new Error(`<CONSUME${qu(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
104
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=Wn(this.recordingProdStack),s=new de({idx:n,terminalType:e,label:r==null?void 0:r.LABEL});return i.definition.push(s),Wh}}function Ii(t,e,n,r=!1){Ra(n);const i=Wn(this.recordingProdStack),s=Qn(e)?e:e.DEF,a=new t({definition:[],idx:n});return r&&(a.separator=e.SEP),z(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),Za}function zT(t,e){Ra(e);const n=Wn(this.recordingProdStack),r=Be(t)===!1,i=r===!1?t:t.DEF,s=new lt({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});z(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=Vf(i,o=>Qn(o.GATE));return s.hasPredicates=a,n.definition.push(s),U(i,o=>{const c=new ot({definition:[]});s.definition.push(c),z(o,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:z(o,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),o.ALT.call(this),this.recordingProdStack.pop()}),Za}function qu(t){return t===0?"":`${t}`}function Ra(t){if(t<0||t>Bu){const e=new Error(`Invalid DSL Method idx value: <${t}>
105
- Idx value must be a none negative value smaller than ${Bu+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class BT{initPerformanceTracer(e){if(z(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=sn.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=ph(n),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function qT(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const va=jl(Sn,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(va);const sn=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:kr,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ea=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var tt;(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"})(tt||(tt={}));function Wu(t=void 0){return function(){return t}}class ms{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 n=this.className;this.TRACE_INIT("toFastProps",()=>{mh(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),U(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=pT({rules:Oe(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(oe(r)&&this.skipValidations===!1){const i=mT({rules:Oe(this.gastProductionsCache),tokenTypes:Oe(this.tokensMap),errMsgProvider:Bn,grammarName:n}),s=Zy({lookaheadStrategy:this.lookaheadStrategy,rules:Oe(this.gastProductionsCache),tokenTypes:Oe(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),oe(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Jg(Oe(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:Oe(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Oe(this.gastProductionsCache))})),!ms.DEFER_DEFINITION_ERRORS_HANDLING&&!oe(this.definitionErrors))throw e=D(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
106
- ${e.join(`
107
- -------------------------------
108
- `)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),z(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
109
- Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
110
- See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
111
- For further details.`);this.skipValidations=z(n,"skipValidations")?n.skipValidations:sn.skipValidations}}ms.DEFER_DEFINITION_ERRORS_HANDLING=!1;qT(ms,[vT,ST,OT,xT,MT,DT,FT,GT,jT,BT]);class WT extends ms{constructor(e,n=sn){const r=We(n);r.outputCst=!1,super(e,r)}}function Kr(t,e,n){return`${t.name}_${e}_${n}`}const Cn=1,VT=2,Vh=4,Kh=5,gs=7,KT=8,HT=9,YT=10,XT=11,Hh=12;class Wl{constructor(e){this.target=e}isEpsilon(){return!1}}class Vl extends Wl{constructor(e,n){super(e),this.tokenType=n}}class Yh extends Wl{constructor(e){super(e)}isEpsilon(){return!0}}class Kl extends Wl{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function JT(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};QT(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=Zn(e,i,i);s!==void 0&&lR(e,i,s)}return e}function QT(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Me(t,i,void 0,{type:VT}),a=Me(t,i,void 0,{type:gs});s.stop=a,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,a)}}function Xh(t,e,n){return n instanceof de?Hl(t,e,n.terminalType,n):n instanceof et?cR(t,e,n):n instanceof lt?rR(t,e,n):n instanceof qe?iR(t,e,n):n instanceof ve?ZT(t,e,n):n instanceof ct?eR(t,e,n):n instanceof gt?tR(t,e,n):n instanceof yt?nR(t,e,n):Zn(t,e,n)}function ZT(t,e,n){const r=Me(t,e,n,{type:Kh});Nn(t,r);const i=hi(t,e,r,n,Zn(t,e,n));return Qh(t,e,n,i)}function eR(t,e,n){const r=Me(t,e,n,{type:Kh});Nn(t,r);const i=hi(t,e,r,n,Zn(t,e,n)),s=Hl(t,e,n.separator,n);return Qh(t,e,n,i,s)}function tR(t,e,n){const r=Me(t,e,n,{type:Vh});Nn(t,r);const i=hi(t,e,r,n,Zn(t,e,n));return Jh(t,e,n,i)}function nR(t,e,n){const r=Me(t,e,n,{type:Vh});Nn(t,r);const i=hi(t,e,r,n,Zn(t,e,n)),s=Hl(t,e,n.separator,n);return Jh(t,e,n,i,s)}function rR(t,e,n){const r=Me(t,e,n,{type:Cn});Nn(t,r);const i=D(n.definition,a=>Xh(t,e,a));return hi(t,e,r,n,...i)}function iR(t,e,n){const r=Me(t,e,n,{type:Cn});Nn(t,r);const i=hi(t,e,r,n,Zn(t,e,n));return sR(t,e,n,i)}function Zn(t,e,n){const r=mt(D(n.definition,i=>Xh(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:oR(t,r)}function Jh(t,e,n,r,i){const s=r.left,a=r.right,o=Me(t,e,n,{type:XT});Nn(t,o);const c=Me(t,e,n,{type:Hh});return s.loopback=o,c.loopback=o,t.decisionMap[Kr(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,Ne(a,o),i===void 0?(Ne(o,s),Ne(o,c)):(Ne(o,c),Ne(o,i.left),Ne(i.right,s)),{left:s,right:c}}function Qh(t,e,n,r,i){const s=r.left,a=r.right,o=Me(t,e,n,{type:YT});Nn(t,o);const c=Me(t,e,n,{type:Hh}),l=Me(t,e,n,{type:HT});return o.loopback=l,c.loopback=l,Ne(o,s),Ne(o,c),Ne(a,l),i!==void 0?(Ne(l,c),Ne(l,i.left),Ne(i.right,s)):Ne(l,o),t.decisionMap[Kr(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:c}}function sR(t,e,n,r){const i=r.left,s=r.right;return Ne(i,s),t.decisionMap[Kr(e,"Option",n.idx)]=i,r}function Nn(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function hi(t,e,n,r,...i){const s=Me(t,e,r,{type:KT,start:n});n.end=s;for(const o of i)o!==void 0?(Ne(n,o.left),Ne(o.right,s)):Ne(n,s);const a={left:n,right:s};return t.decisionMap[Kr(e,aR(r),r.idx)]=n,a}function aR(t){if(t instanceof lt)return"Alternation";if(t instanceof qe)return"Option";if(t instanceof ve)return"Repetition";if(t instanceof ct)return"RepetitionWithSeparator";if(t instanceof gt)return"RepetitionMandatory";if(t instanceof yt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function oR(t,e){const n=e.length;for(let s=0;s<n-1;s++){const a=e[s];let o;a.left.transitions.length===1&&(o=a.left.transitions[0]);const c=o instanceof Kl,l=o,d=e[s+1].left;a.left.type===Cn&&a.right.type===Cn&&o!==void 0&&(c&&l.followState===a.right||o.target===a.right)?(c?l.followState=d:o.target=d,uR(t,a.right)):Ne(a.right,d)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Hl(t,e,n,r){const i=Me(t,e,r,{type:Cn}),s=Me(t,e,r,{type:Cn});return Yl(i,new Vl(s,n)),{left:i,right:s}}function cR(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Me(t,e,n,{type:Cn}),a=Me(t,e,n,{type:Cn}),o=new Kl(i,r,a);return Yl(s,o),{left:s,right:a}}function lR(t,e,n){const r=t.ruleToStartState.get(e);Ne(r,n.left);const i=t.ruleToStopState.get(e);return Ne(n.right,i),{left:r,right:i}}function Ne(t,e){const n=new Yh(e);Yl(t,n)}function Me(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function Yl(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function uR(t,e){t.states.splice(t.states.indexOf(e),1)}const Aa={};class ic{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=Zh(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return D(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function Zh(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function dR(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class ep{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const Vu=new ep;class fR extends ql{constructor(e){var n;super(),this.logging=(n=e==null?void 0:e.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=JT(e.rules),this.dfas=hR(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=Kr(r,"Alternation",n),d=this.atn.decisionMap[c].decision,h=D(Fu({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),p=>D(p,g=>g[0]));if(Ku(h,!1)&&!s){const p=Ze(h,(g,C,N)=>(U(C,x=>{x&&(g[x.tokenTypeIdx]=N,U(x.categoryMatches,w=>{g[w]=N}))}),g),{});return i?function(g){var C;const N=this.LA(1),x=p[N.tokenTypeIdx];if(g!==void 0&&x!==void 0){const w=(C=g[x])===null||C===void 0?void 0:C.GATE;if(w!==void 0&&w.call(this)===!1)return}return x}:function(){const g=this.LA(1);return p[g.tokenTypeIdx]}}else return i?function(p){const g=new ep,C=p===void 0?0:p.length;for(let x=0;x<C;x++){const w=p==null?void 0:p[x].GATE;g.set(x,w===void 0||w.call(this))}const N=wo.call(this,a,d,g,o);return typeof N=="number"?N:void 0}:function(){const p=wo.call(this,a,d,Vu,o);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=Kr(r,i,n),d=this.atn.decisionMap[c].decision,h=D(Fu({maxLookahead:1,occurrence:n,prodType:i,rule:r}),p=>D(p,g=>g[0]));if(Ku(h)&&h[0][0]&&!s){const p=h[0],g=Et(p);if(g.length===1&&oe(g[0].categoryMatches)){const N=g[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===N}}else{const C=Ze(g,(N,x)=>(x!==void 0&&(N[x.tokenTypeIdx]=!0,U(x.categoryMatches,w=>{N[w]=!0})),N),{});return function(){const N=this.LA(1);return C[N.tokenTypeIdx]===!0}}}return function(){const p=wo.call(this,a,d,Vu,o);return typeof p=="object"?!1:p===0}}}function Ku(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(n.has(o)){if(!i.has(o))return!1}else n.add(o),i.add(o)}}return!0}function hR(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=dR(t.decisionStates[r],r);return n}function wo(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const o=CR(i.atnStartState);s=np(i,tp(o)),i.start=s}return pR.apply(this,[i,s,n,r])}function pR(t,e,n,r){let i=e,s=1;const a=[];let o=this.LA(s++);for(;;){let c=vR(i,o);if(c===void 0&&(c=mR.apply(this,[t,i,o,s,n,r])),c===Aa)return RR(a,i,o);if(c.isAcceptState===!0)return c.prediction;i=c,a.push(o),o=this.LA(s++)}}function mR(t,e,n,r,i,s){const a=ER(e.configs,n,i);if(a.size===0)return Hu(t,e,n,Aa),Aa;let o=tp(a);const c=SR(a,i);if(c!==void 0)o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c;else if(bR(a)){const l=Em(a.alts);o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l,gR.apply(this,[t,r,a.alts,s])}return o=Hu(t,e,n,o),o}function gR(t,e,n,r){const i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);const s=t.atnStartState,a=s.rule,o=s.production,c=yR({topLevelRule:a,ambiguityIndices:n,production:o,prefixPath:i});r(c)}function yR(t){const e=D(t.prefixPath,i=>Nr(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${TR(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
112
- <${e}> may appears as a prefix path in all these alternatives.
113
- `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
114
- For Further details.`,r}function TR(t){if(t instanceof et)return"SUBRULE";if(t instanceof qe)return"OPTION";if(t instanceof lt)return"OR";if(t instanceof gt)return"AT_LEAST_ONE";if(t instanceof yt)return"AT_LEAST_ONE_SEP";if(t instanceof ct)return"MANY_SEP";if(t instanceof ve)return"MANY";if(t instanceof de)return"CONSUME";throw Error("non exhaustive match")}function RR(t,e,n){const r=ht(e.configs.elements,s=>s.state.transitions),i=jm(r.filter(s=>s instanceof Vl).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function vR(t,e){return t.edges[e.tokenTypeIdx]}function ER(t,e,n){const r=new ic,i=[];for(const a of t.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===gs){i.push(a);continue}const o=a.state.transitions.length;for(let c=0;c<o;c++){const l=a.state.transitions[c],d=AR(l,e);d!==void 0&&r.add({state:d,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new ic;for(const a of r.elements)Sa(a,s)}if(i.length>0&&!wR(s))for(const a of i)s.add(a);return s}function AR(t,e){if(t instanceof Vl&&Nh(e,t.tokenType))return t.target}function SR(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function tp(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Hu(t,e,n,r){return r=np(t,r),e.edges[n.tokenTypeIdx]=r,r}function np(t,e){if(e===Aa)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function CR(t){const e=new ic,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};Sa(s,e)}return e}function Sa(t,e){const n=t.state;if(n.type===gs){if(t.stack.length>0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};Sa(a,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],a=kR(t,s);a!==void 0&&Sa(a,e)}}function kR(t,e){if(e instanceof Yh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Kl){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function wR(t){for(const e of t.elements)if(e.state.type===gs)return!0;return!1}function NR(t){for(const e of t.elements)if(e.state.type!==gs)return!1;return!0}function bR(t){if(NR(t))return!0;const e=_R(t.elements);return IR(e)&&!$R(e)}function _R(t){const e=new Map;for(const n of t){const r=Zh(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function IR(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function $R(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var sc;(function(t){function e(n){return typeof n=="string"}t.is=e})(sc||(sc={}));var Ca;(function(t){function e(n){return typeof n=="string"}t.is=e})(Ca||(Ca={}));var ac;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(ac||(ac={}));var Yi;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Yi||(Yi={}));var ee;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Yi.MAX_VALUE),i===Number.MAX_VALUE&&(i=Yi.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return R.objectLiteral(i)&&R.uinteger(i.line)&&R.uinteger(i.character)}t.is=n})(ee||(ee={}));var X;(function(t){function e(r,i,s,a){if(R.uinteger(r)&&R.uinteger(i)&&R.uinteger(s)&&R.uinteger(a))return{start:ee.create(r,i),end:ee.create(s,a)};if(ee.is(r)&&ee.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}t.create=e;function n(r){let i=r;return R.objectLiteral(i)&&ee.is(i.start)&&ee.is(i.end)}t.is=n})(X||(X={}));var Xi;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return R.objectLiteral(i)&&X.is(i.range)&&(R.string(i.uri)||R.undefined(i.uri))}t.is=n})(Xi||(Xi={}));var oc;(function(t){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function n(r){let i=r;return R.objectLiteral(i)&&X.is(i.targetRange)&&R.string(i.targetUri)&&X.is(i.targetSelectionRange)&&(X.is(i.originSelectionRange)||R.undefined(i.originSelectionRange))}t.is=n})(oc||(oc={}));var ka;(function(t){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}t.create=e;function n(r){const i=r;return R.objectLiteral(i)&&R.numberRange(i.red,0,1)&&R.numberRange(i.green,0,1)&&R.numberRange(i.blue,0,1)&&R.numberRange(i.alpha,0,1)}t.is=n})(ka||(ka={}));var cc;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return R.objectLiteral(i)&&X.is(i.range)&&ka.is(i.color)}t.is=n})(cc||(cc={}));var lc;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return R.objectLiteral(i)&&R.string(i.label)&&(R.undefined(i.textEdit)||Ut.is(i))&&(R.undefined(i.additionalTextEdits)||R.typedArray(i.additionalTextEdits,Ut.is))}t.is=n})(lc||(lc={}));var uc;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(uc||(uc={}));var dc;(function(t){function e(r,i,s,a,o,c){const l={startLine:r,endLine:i};return R.defined(s)&&(l.startCharacter=s),R.defined(a)&&(l.endCharacter=a),R.defined(o)&&(l.kind=o),R.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){const i=r;return R.objectLiteral(i)&&R.uinteger(i.startLine)&&R.uinteger(i.startLine)&&(R.undefined(i.startCharacter)||R.uinteger(i.startCharacter))&&(R.undefined(i.endCharacter)||R.uinteger(i.endCharacter))&&(R.undefined(i.kind)||R.string(i.kind))}t.is=n})(dc||(dc={}));var wa;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return R.defined(i)&&Xi.is(i.location)&&R.string(i.message)}t.is=n})(wa||(wa={}));var fc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(fc||(fc={}));var hc;(function(t){t.Unnecessary=1,t.Deprecated=2})(hc||(hc={}));var pc;(function(t){function e(n){const r=n;return R.objectLiteral(r)&&R.string(r.href)}t.is=e})(pc||(pc={}));var Ji;(function(t){function e(r,i,s,a,o,c){let l={range:r,message:i};return R.defined(s)&&(l.severity=s),R.defined(a)&&(l.code=a),R.defined(o)&&(l.source=o),R.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var i;let s=r;return R.defined(s)&&X.is(s.range)&&R.string(s.message)&&(R.number(s.severity)||R.undefined(s.severity))&&(R.integer(s.code)||R.string(s.code)||R.undefined(s.code))&&(R.undefined(s.codeDescription)||R.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(R.string(s.source)||R.undefined(s.source))&&(R.undefined(s.relatedInformation)||R.typedArray(s.relatedInformation,wa.is))}t.is=n})(Ji||(Ji={}));var Xn;(function(t){function e(r,i,...s){let a={title:r,command:i};return R.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function n(r){let i=r;return R.defined(i)&&R.string(i.title)&&R.string(i.command)}t.is=n})(Xn||(Xn={}));var Ut;(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function n(s,a){return{range:{start:s,end:s},newText:a}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const a=s;return R.objectLiteral(a)&&R.string(a.newText)&&X.is(a.range)}t.is=i})(Ut||(Ut={}));var qn;(function(t){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function n(r){const i=r;return R.objectLiteral(i)&&R.string(i.label)&&(R.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(R.string(i.description)||i.description===void 0)}t.is=n})(qn||(qn={}));var ze;(function(t){function e(n){const r=n;return R.string(r)}t.is=e})(ze||(ze={}));var Jt;(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function n(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=n;function r(s,a){return{range:s,newText:"",annotationId:a}}t.del=r;function i(s){const a=s;return Ut.is(a)&&(qn.is(a.annotationId)||ze.is(a.annotationId))}t.is=i})(Jt||(Jt={}));var Qi;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return R.defined(i)&&Zi.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Qi||(Qi={}));var Hr;(function(t){function e(r,i,s){let a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&R.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||R.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||R.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ze.is(i.annotationId))}t.is=n})(Hr||(Hr={}));var Yr;(function(t){function e(r,i,s,a){let o={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&R.string(i.oldUri)&&R.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||R.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||R.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ze.is(i.annotationId))}t.is=n})(Yr||(Yr={}));var Xr;(function(t){function e(r,i,s){let a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&R.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||R.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||R.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||ze.is(i.annotationId))}t.is=n})(Xr||(Xr={}));var Na;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>R.string(i.kind)?Hr.is(i)||Yr.is(i)||Xr.is(i):Qi.is(i)))}t.is=e})(Na||(Na={}));class Bs{constructor(e,n){this.edits=e,this.changeAnnotations=n}insert(e,n,r){let i,s;if(r===void 0?i=Ut.insert(e,n):ze.is(r)?(s=r,i=Jt.insert(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Jt.insert(e,n,s)),this.edits.push(i),s!==void 0)return s}replace(e,n,r){let i,s;if(r===void 0?i=Ut.replace(e,n):ze.is(r)?(s=r,i=Jt.replace(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Jt.replace(e,n,s)),this.edits.push(i),s!==void 0)return s}delete(e,n){let r,i;if(n===void 0?r=Ut.del(e):ze.is(n)?(i=n,r=Jt.del(e,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Jt.del(e,i)),this.edits.push(r),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 Yu{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,n){let r;if(ze.is(e)?r=e:(r=this.nextId(),n=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(n===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=n,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class PR{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Yu(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(n=>{if(Qi.is(n)){const r=new Bs(n.edits,this._changeAnnotations);this._textEditChanges[n.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(n=>{const r=new Bs(e.changes[n]);this._textEditChanges[n]=r})):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(Zi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const n={uri:e.uri,version:e.version};let r=this._textEditChanges[n.uri];if(!r){const i=[],s={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(s),r=new Bs(i,this._changeAnnotations),this._textEditChanges[n.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let n=this._textEditChanges[e];if(!n){let r=[];this._workspaceEdit.changes[e]=r,n=new Bs(r),this._textEditChanges[e]=n}return n}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Yu,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,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;qn.is(n)||ze.is(n)?i=n:r=n;let s,a;if(i===void 0?s=Hr.create(e,r):(a=ze.is(i)?i:this._changeAnnotations.manage(i),s=Hr.create(e,r,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}renameFile(e,n,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;qn.is(r)||ze.is(r)?s=r:i=r;let a,o;if(s===void 0?a=Yr.create(e,n,i):(o=ze.is(s)?s:this._changeAnnotations.manage(s),a=Yr.create(e,n,i,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;qn.is(n)||ze.is(n)?i=n:r=n;let s,a;if(i===void 0?s=Xr.create(e,r):(a=ze.is(i)?i:this._changeAnnotations.manage(i),s=Xr.create(e,r,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}}var mc;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return R.defined(i)&&R.string(i.uri)}t.is=n})(mc||(mc={}));var gc;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return R.defined(i)&&R.string(i.uri)&&R.integer(i.version)}t.is=n})(gc||(gc={}));var Zi;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return R.defined(i)&&R.string(i.uri)&&(i.version===null||R.integer(i.version))}t.is=n})(Zi||(Zi={}));var yc;(function(t){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}t.create=e;function n(r){let i=r;return R.defined(i)&&R.string(i.uri)&&R.string(i.languageId)&&R.integer(i.version)&&R.string(i.text)}t.is=n})(yc||(yc={}));var ba;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(ba||(ba={}));var Jr;(function(t){function e(n){const r=n;return R.objectLiteral(n)&&ba.is(r.kind)&&R.string(r.value)}t.is=e})(Jr||(Jr={}));var Tc;(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})(Tc||(Tc={}));var Rc;(function(t){t.PlainText=1,t.Snippet=2})(Rc||(Rc={}));var vc;(function(t){t.Deprecated=1})(vc||(vc={}));var Ec;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&R.string(i.newText)&&X.is(i.insert)&&X.is(i.replace)}t.is=n})(Ec||(Ec={}));var Ac;(function(t){t.asIs=1,t.adjustIndentation=2})(Ac||(Ac={}));var Sc;(function(t){function e(n){const r=n;return r&&(R.string(r.detail)||r.detail===void 0)&&(R.string(r.description)||r.description===void 0)}t.is=e})(Sc||(Sc={}));var Cc;(function(t){function e(n){return{label:n}}t.create=e})(Cc||(Cc={}));var kc;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(kc||(kc={}));var es;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return R.string(i)||R.objectLiteral(i)&&R.string(i.language)&&R.string(i.value)}t.is=n})(es||(es={}));var wc;(function(t){function e(n){let r=n;return!!r&&R.objectLiteral(r)&&(Jr.is(r.contents)||es.is(r.contents)||R.typedArray(r.contents,es.is))&&(n.range===void 0||X.is(n.range))}t.is=e})(wc||(wc={}));var Nc;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(Nc||(Nc={}));var bc;(function(t){function e(n,r,...i){let s={label:n};return R.defined(r)&&(s.documentation=r),R.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(bc||(bc={}));var _c;(function(t){t.Text=1,t.Read=2,t.Write=3})(_c||(_c={}));var Ic;(function(t){function e(n,r){let i={range:n};return R.number(r)&&(i.kind=r),i}t.create=e})(Ic||(Ic={}));var $c;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})($c||($c={}));var Pc;(function(t){t.Deprecated=1})(Pc||(Pc={}));var Lc;(function(t){function e(n,r,i,s,a){let o={name:n,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(Lc||(Lc={}));var Oc;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(Oc||(Oc={}));var xc;(function(t){function e(r,i,s,a,o,c){let l={name:r,detail:i,kind:s,range:a,selectionRange:o};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let i=r;return i&&R.string(i.name)&&R.number(i.kind)&&X.is(i.range)&&X.is(i.selectionRange)&&(i.detail===void 0||R.string(i.detail))&&(i.deprecated===void 0||R.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(xc||(xc={}));var Dc;(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"})(Dc||(Dc={}));var ts;(function(t){t.Invoked=1,t.Automatic=2})(ts||(ts={}));var Mc;(function(t){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function n(r){let i=r;return R.defined(i)&&R.typedArray(i.diagnostics,Ji.is)&&(i.only===void 0||R.typedArray(i.only,R.string))&&(i.triggerKind===void 0||i.triggerKind===ts.Invoked||i.triggerKind===ts.Automatic)}t.is=n})(Mc||(Mc={}));var Fc;(function(t){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):Xn.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function n(r){let i=r;return i&&R.string(i.title)&&(i.diagnostics===void 0||R.typedArray(i.diagnostics,Ji.is))&&(i.kind===void 0||R.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Xn.is(i.command))&&(i.isPreferred===void 0||R.boolean(i.isPreferred))&&(i.edit===void 0||Na.is(i.edit))}t.is=n})(Fc||(Fc={}));var Gc;(function(t){function e(r,i){let s={range:r};return R.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return R.defined(i)&&X.is(i.range)&&(R.undefined(i.command)||Xn.is(i.command))}t.is=n})(Gc||(Gc={}));var Uc;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return R.defined(i)&&R.uinteger(i.tabSize)&&R.boolean(i.insertSpaces)}t.is=n})(Uc||(Uc={}));var jc;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return R.defined(i)&&X.is(i.range)&&(R.undefined(i.target)||R.string(i.target))}t.is=n})(jc||(jc={}));var zc;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return R.objectLiteral(i)&&X.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(zc||(zc={}));var Bc;(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"})(Bc||(Bc={}));var qc;(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"})(qc||(qc={}));var Wc;(function(t){function e(n){const r=n;return R.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(Wc||(Wc={}));var Vc;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&X.is(i.range)&&R.string(i.text)}t.is=n})(Vc||(Vc={}));var Kc;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&X.is(i.range)&&R.boolean(i.caseSensitiveLookup)&&(R.string(i.variableName)||i.variableName===void 0)}t.is=n})(Kc||(Kc={}));var Hc;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&X.is(i.range)&&(R.string(i.expression)||i.expression===void 0)}t.is=n})(Hc||(Hc={}));var Yc;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return R.defined(i)&&X.is(r.stoppedLocation)}t.is=n})(Yc||(Yc={}));var _a;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(_a||(_a={}));var Ia;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return R.objectLiteral(i)&&(i.tooltip===void 0||R.string(i.tooltip)||Jr.is(i.tooltip))&&(i.location===void 0||Xi.is(i.location))&&(i.command===void 0||Xn.is(i.command))}t.is=n})(Ia||(Ia={}));var Xc;(function(t){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function n(r){const i=r;return R.objectLiteral(i)&&ee.is(i.position)&&(R.string(i.label)||R.typedArray(i.label,Ia.is))&&(i.kind===void 0||_a.is(i.kind))&&i.textEdits===void 0||R.typedArray(i.textEdits,Ut.is)&&(i.tooltip===void 0||R.string(i.tooltip)||Jr.is(i.tooltip))&&(i.paddingLeft===void 0||R.boolean(i.paddingLeft))&&(i.paddingRight===void 0||R.boolean(i.paddingRight))}t.is=n})(Xc||(Xc={}));var Jc;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(Jc||(Jc={}));var Qc;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(Qc||(Qc={}));var Zc;(function(t){function e(n){return{items:n}}t.create=e})(Zc||(Zc={}));var el;(function(t){t.Invoked=0,t.Automatic=1})(el||(el={}));var tl;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(tl||(tl={}));var nl;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(nl||(nl={}));var rl;(function(t){function e(n){const r=n;return R.objectLiteral(r)&&Ca.is(r.uri)&&R.string(r.name)}t.is=e})(rl||(rl={}));const LR=[`
115
- `,`\r
116
- `,"\r"];var il;(function(t){function e(s,a,o,c){return new OR(s,a,o,c)}t.create=e;function n(s){let a=s;return!!(R.defined(a)&&R.string(a.uri)&&(R.undefined(a.languageId)||R.string(a.languageId))&&R.uinteger(a.lineCount)&&R.func(a.getText)&&R.func(a.positionAt)&&R.func(a.offsetAt))}t.is=n;function r(s,a){let o=s.getText(),c=i(a,(d,h)=>{let p=d.range.start.line-h.range.start.line;return p===0?d.range.start.character-h.range.start.character:p}),l=o.length;for(let d=c.length-1;d>=0;d--){let h=c[d],p=s.offsetAt(h.range.start),g=s.offsetAt(h.range.end);if(g<=l)o=o.substring(0,p)+h.newText+o.substring(g,o.length);else throw new Error("Overlapping edit");l=p}return o}t.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,c=s.slice(0,o),l=s.slice(o);i(c,a),i(l,a);let d=0,h=0,p=0;for(;d<c.length&&h<l.length;)a(c[d],l[h])<=0?s[p++]=c[d++]:s[p++]=l[h++];for(;d<c.length;)s[p++]=c[d++];for(;h<l.length;)s[p++]=l[h++];return s}})(il||(il={}));let OR=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
117
- `,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
118
- `&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ee.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return ee.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var R;(function(t){const e=Object.prototype.toString;function n(g){return typeof g<"u"}t.defined=n;function r(g){return typeof g>"u"}t.undefined=r;function i(g){return g===!0||g===!1}t.boolean=i;function s(g){return e.call(g)==="[object String]"}t.string=s;function a(g){return e.call(g)==="[object Number]"}t.number=a;function o(g,C,N){return e.call(g)==="[object Number]"&&C<=g&&g<=N}t.numberRange=o;function c(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}t.integer=c;function l(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}t.uinteger=l;function d(g){return e.call(g)==="[object Function]"}t.func=d;function h(g){return g!==null&&typeof g=="object"}t.objectLiteral=h;function p(g,C){return Array.isArray(g)&&g.every(C)}t.typedArray=p})(R||(R={}));const xR=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Jt},get ChangeAnnotation(){return qn},get ChangeAnnotationIdentifier(){return ze},get CodeAction(){return Fc},get CodeActionContext(){return Mc},get CodeActionKind(){return Dc},get CodeActionTriggerKind(){return ts},get CodeDescription(){return pc},get CodeLens(){return Gc},get Color(){return ka},get ColorInformation(){return cc},get ColorPresentation(){return lc},get Command(){return Xn},get CompletionItem(){return Cc},get CompletionItemKind(){return Tc},get CompletionItemLabelDetails(){return Sc},get CompletionItemTag(){return vc},get CompletionList(){return kc},get CreateFile(){return Hr},get DeleteFile(){return Xr},get Diagnostic(){return Ji},get DiagnosticRelatedInformation(){return wa},get DiagnosticSeverity(){return fc},get DiagnosticTag(){return hc},get DocumentHighlight(){return Ic},get DocumentHighlightKind(){return _c},get DocumentLink(){return jc},get DocumentSymbol(){return xc},get DocumentUri(){return sc},EOL:LR,get FoldingRange(){return dc},get FoldingRangeKind(){return uc},get FormattingOptions(){return Uc},get Hover(){return wc},get InlayHint(){return Xc},get InlayHintKind(){return _a},get InlayHintLabelPart(){return Ia},get InlineCompletionContext(){return nl},get InlineCompletionItem(){return Qc},get InlineCompletionList(){return Zc},get InlineCompletionTriggerKind(){return el},get InlineValueContext(){return Yc},get InlineValueEvaluatableExpression(){return Hc},get InlineValueText(){return Vc},get InlineValueVariableLookup(){return Kc},get InsertReplaceEdit(){return Ec},get InsertTextFormat(){return Rc},get InsertTextMode(){return Ac},get Location(){return Xi},get LocationLink(){return oc},get MarkedString(){return es},get MarkupContent(){return Jr},get MarkupKind(){return ba},get OptionalVersionedTextDocumentIdentifier(){return Zi},get ParameterInformation(){return Nc},get Position(){return ee},get Range(){return X},get RenameFile(){return Yr},get SelectedCompletionInfo(){return tl},get SelectionRange(){return zc},get SemanticTokenModifiers(){return qc},get SemanticTokenTypes(){return Bc},get SemanticTokens(){return Wc},get SignatureInformation(){return bc},get StringValue(){return Jc},get SymbolInformation(){return Lc},get SymbolKind(){return $c},get SymbolTag(){return Pc},get TextDocument(){return il},get TextDocumentEdit(){return Qi},get TextDocumentIdentifier(){return mc},get TextDocumentItem(){return yc},get TextEdit(){return Ut},get URI(){return Ca},get VersionedTextDocumentIdentifier(){return gc},WorkspaceChange:PR,get WorkspaceEdit(){return Na},get WorkspaceFolder(){return rl},get WorkspaceSymbol(){return Oc},get integer(){return ac},get uinteger(){return Yi}},Symbol.toStringTag,{value:"Module"}));class DR{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new ip(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new Xl;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new sl(e.startOffset,e.image.length,Ko(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const a=new sl(s.startOffset,s.image.length,Ko(s),s.tokenType,!0);a.root=this.rootNode,n.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...n);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...n),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...n)}construct(e){const n=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();(r==null?void 0:r.content.length)===0&&this.removeNode(r)}}class rp{get hidden(){return!1}get astNode(){var n,r;const e=typeof((n=this._astNode)==null?void 0:n.$type)=="string"?this._astNode:(r=this.container)==null?void 0:r.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 sl extends rp{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class Xl extends rp{constructor(){super(...arguments),this.content=new Jl(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,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:ee.create(0,0),end:ee.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class Jl extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Jl.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class ip extends Xl{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const al=Symbol("Datatype");function No(t){return t.$type===al}const Xu="​",sp=t=>t.endsWith(Xu)?t:t+Xu;class ap{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new jR(n,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new cp(n,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class MR extends ap{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new DR,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,n){const r=this.computeRuleType(e);let i;da(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(sp(e.name),this.startImplementation(r,i,n).bind(this));return this.allRules.set(e.name,s),on(e)&&e.entry&&(this.mainRule=s),s}registerPrecedenceMap(e){const n=e.name,r=new Map;for(let i=0;i<e.operators.precedences.length;i++){const s=e.operators.precedences[i];for(const a of s.operators)r.set(a.value,{precedence:i,rightAssoc:s.associativity==="right"})}this.operatorPrecedence.set(n,r)}computeRuleType(e){return da(e)?Hi(e):e.fragment?void 0:uh(e)?al:Hi(e)}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=this.doParse(i);return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,Go(s,{deep:!0}),{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}doParse(e){let n=this.wrapper.rule(e);if(this.stack.length>0&&(n=this.construct()),n===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 n}startImplementation(e,n,r){return i=>{const s=!this.isRecording()&&e!==void 0;if(s){const a={$type:e};this.stack.push(a),e===al?a.value="":n!==void 0&&(a.$infixName=n)}return r(i),s?this.construct():void 0}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,crossRef:c}=this.getAssignment(r),l=this.current;if(o){const d=Kn(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,d,a,c)}else if(No(l)){let d=i.image;Kn(r)||(d=this.converter.convert(d,a).toString()),l.value+=d}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,n,s)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,i,a))}}performSubruleAssignment(e,n,r){const{assignment:i,crossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(No(a))a.value+=e.toString();else if(typeof e=="object"&&e){const c=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(c)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode)}else r.$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)):No(e)?this.converter.convert(e.value,e.$cstNode):(qm(this.astReflection,e),e)}constructInfix(e,n){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const i=e.operators;if(!Array.isArray(i)||r.length<2)return r[0];let s=0,a=-1;for(let N=0;N<i.length;N++){const x=i[N],w=n.get(x)??{precedence:1/0,rightAssoc:!1};w.precedence>a?(a=w.precedence,s=N):w.precedence===a&&(w.rightAssoc||(s=N))}const o=i.slice(0,s),c=i.slice(s+1),l=r.slice(0,s+1),d=r.slice(s+1),h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:o},p={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:d,operators:c},g=this.constructInfix(h,n),C=this.constructInfix(p,n);return{$type:e.$type,$cstNode:e.$cstNode,left:g,operator:i[s],right:C}}getAssignment(e){if(!this.assignmentMap.has(e)){const n=za(e,Vn);this.assignmentMap.set(e,{assignment:n,crossRef:n&&qa(n.terminal)?n.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const a=this.current;let o;switch(s==="single"&&typeof r=="string"?o=this.linker.buildReference(a,n,i,r):s==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(a,n,i,r):o=r,e){case"=":{a[n]=o;break}case"?=":{a[n]=!0;break}case"+=":Array.isArray(a[n])||(a[n]=[]),a[n].push(o)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class FR{buildMismatchTokenMessage(e){return kr.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return kr.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return kr.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return kr.buildEarlyExitMessage(e)}}class op extends FR{buildMismatchTokenMessage({expected:e,actual:n}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class GR extends ap{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(sp(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,n,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const UR={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new op};class cp extends WT{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,{...UR,lookaheadStrategy:r?new ql({maxLookahead:n.maxLookahead}):new fR({logging:n.skipValidations?()=>{}:void 0}),...n})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n,r){return this.RULE(e,n,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n,void 0)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}rule(e){return e.call(this,{})}}class jR extends cp{constructor(e,n,r){super(e,n),this.task=r}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,n,r){this.task.startSubTask(this.ruleName(n));try{return super.subrule(e,n,r)}finally{this.task.stopSubTask(this.ruleName(n))}}}function lp(t,e,n){return zR({parser:e,tokens:n,ruleNames:new Map},t),e}function zR(t,e){const n=sh(e,!1),r=pe(e.rules).filter(on).filter(s=>n.has(s));for(const s of r){const a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(s,Jn(a,s.definition))}const i=pe(e.rules).filter(da).filter(s=>n.has(s));for(const s of i)t.parser.rule(s,BR(t,s))}function BR(t,e){const n=e.call.rule.ref;if(!n)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(cn(n))throw new Error("Cannot use terminal rule in infix expression");const r=e.operators.precedences.flatMap(g=>g.operators),i={$type:"Group",elements:[]},s={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(s,a);const c={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:r}},l={...s,$container:a};a.elements.push(c,l);const h=r.map(g=>t.tokens[g.value]).map((g,C)=>({ALT:()=>t.parser.consume(C,g,c)}));let p;return g=>{p??(p=Ql(t,n)),t.parser.subrule(0,p,!1,s,g),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,h),t.parser.subrule(1,p,!1,l,g)}})}}function Jn(t,e,n=!1){let r;if(Kn(e))r=XR(t,e);else if(Ba(e))r=qR(t,e);else if(Vn(e))r=Jn(t,e.terminal);else if(qa(e))r=up(t,e);else if(Hn(e))r=WR(t,e);else if(Qf(e))r=KR(t,e);else if(eh(e))r=HR(t,e);else if(Dl(e))r=YR(t,e);else if(Xm(e)){const i=t.consume++;r=()=>t.parser.consume(i,Sn,e)}else throw new nh(e.$cstNode,`Unexpected element type: ${e.$type}`);return dp(t,n?void 0:$a(e),r,e.cardinality)}function qR(t,e){const n=Hi(e);return()=>t.parser.action(n,e)}function WR(t,e){const n=e.rule.ref;if(us(n)){const r=t.subrule++,i=on(n)&&n.fragment,s=e.arguments.length>0?VR(n,e.arguments):()=>({});let a;return o=>{a??(a=Ql(t,n)),t.parser.subrule(r,a,i,e,s(o))}}else if(cn(n)){const r=t.consume++,i=ol(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)ds();else throw new nh(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function VR(t,e){if(e.some(r=>r.calledByName)){const r=e.map(i=>{var s,a;return{parameterName:(a=(s=i.parameter)==null?void 0:s.ref)==null?void 0:a.name,predicate:Ft(i.value)}});return i=>{const s={};for(const{parameterName:a,predicate:o}of r)a&&(s[a]=o(i));return s}}else{const r=e.map(i=>Ft(i.value));return i=>{const s={};for(let a=0;a<r.length;a++)if(a<t.parameters.length){const o=t.parameters[a].name,c=r[a];s[o]=c(i)}return s}}}function Ft(t){if(Ym(t)){const e=Ft(t.left),n=Ft(t.right);return r=>e(r)||n(r)}else if(Hm(t)){const e=Ft(t.left),n=Ft(t.right);return r=>e(r)&&n(r)}else if(Zm(t)){const e=Ft(t.value);return n=>!e(n)}else if(eg(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(Vm(t)){const e=!!t.true;return()=>e}ds()}function KR(t,e){if(e.elements.length===1)return Jn(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:Jn(t,i,!0)},a=$a(i);a&&(s.GATE=Ft(a)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function HR(t,e){if(e.elements.length===1)return Jn(t,e.elements[0]);const n=[];for(const o of e.elements){const c={ALT:Jn(t,o,!0)},l=$a(o);l&&(c.GATE=Ft(l)),n.push(c)}const r=t.or++,i=(o,c)=>{const l=c.getRuleStack().join("-");return`uGroup_${o}_${l}`},s=o=>t.parser.alternatives(r,n.map((c,l)=>{const d={ALT:()=>!0},h=t.parser;d.ALT=()=>{if(c.ALT(o),!h.isRecording()){const g=i(r,h);h.unorderedGroups.get(g)||h.unorderedGroups.set(g,[]);const C=h.unorderedGroups.get(g);typeof(C==null?void 0:C[l])>"u"&&(C[l]=!0)}};const p=c.GATE;return p?d.GATE=()=>p(o):d.GATE=()=>{const g=h.unorderedGroups.get(i(r,h));return!(g!=null&&g[l])},d})),a=dp(t,$a(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function YR(t,e){const n=e.elements.map(r=>Jn(t,r));return r=>n.forEach(i=>i(r))}function $a(t){if(Dl(t))return t.guardCondition}function up(t,e,n=e.terminal){if(n)if(Hn(n)&&on(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;let s;return a=>{s??(s=Ql(t,r)),t.parser.subrule(i,s,!1,e,a)}}else if(Hn(n)&&cn(n.rule.ref)){const r=t.consume++,i=ol(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Kn(n)){const r=t.consume++,i=ol(t,n.value);return()=>t.parser.consume(r,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 r=ch(e.type.ref),i=r==null?void 0:r.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Hi(e.type.ref));return up(t,e,i)}}function XR(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function dp(t,e,n,r){const i=e&&Ft(e);if(!r)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>n(a),GATE:()=>i(a)},{ALT:Wu(),GATE:()=>!i(a)}])}else return n;if(r==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(o)}),GATE:()=>i(o)},{ALT:Wu(),GATE:()=>!i(o)}])}else return a=>t.parser.atLeastOne(s,{DEF:()=>n(a)})}else if(r==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else ds()}function Ql(t,e){const n=JR(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function JR(t,e){if(us(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!on(r);)(Dl(r)||Qf(r)||eh(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function ol(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function QR(t){const e=t.Grammar,n=t.parser.Lexer,r=new GR(t);return lp(e,r,n.definition),r.finalize(),r}function ZR(t){const e=ev(t);return e.finalize(),e}function ev(t){const e=t.Grammar,n=t.parser.Lexer,r=new MR(t);return lp(e,r,n.definition)}class fp{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=pe(sh(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(cn).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=Fl(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=ih(n)?st.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(us).flatMap(i=>ls(i).filter(Kn)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!(r!=null&&r.caseInsensitive)))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(Va(e.value),"i"):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i==null?void 0:i.PATTERN;return s!=null&&s.source&&Cg("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class hp{convert(e,n){let r=n.grammarSource;if(qa(r)&&(r=bg(r)),Hn(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return Ht.convertInt(n);case"STRING":return Ht.convertString(n);case"ID":return Ht.convertID(n)}switch((i=xg(e))==null?void 0:i.toLowerCase()){case"number":return Ht.convertNumber(n);case"boolean":return Ht.convertBoolean(n);case"bigint":return Ht.convertBigint(n);case"date":return Ht.convertDate(n);default:return n}}}var Ht;(function(t){function e(l){let d="";for(let h=1;h<l.length-1;h++){const p=l.charAt(h);if(p==="\\"){const g=l.charAt(++h);d+=n(g)}else d+=p}return d}t.convertString=e;function n(l){switch(l){case"b":return"\b";case"f":return"\f";case"n":return`
119
- `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return l}}function r(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=r;function i(l){return parseInt(l)}t.convertInt=i;function s(l){return BigInt(l)}t.convertBigint=s;function a(l){return new Date(l)}t.convertDate=a;function o(l){return Number(l)}t.convertNumber=o;function c(l){return l.toLowerCase()==="true"}t.convertBoolean=c})(Ht||(Ht={}));var kn={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});let cl;function ll(){if(cl===void 0)throw new Error("No runtime abstraction layer installed");return cl}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");cl=n}t.install=e})(ll||(ll={}));ln.default=ll;var be={};Object.defineProperty(be,"__esModule",{value:!0});be.stringArray=be.array=be.func=be.error=be.number=be.string=be.boolean=void 0;function tv(t){return t===!0||t===!1}be.boolean=tv;function pp(t){return typeof t=="string"||t instanceof String}be.string=pp;function nv(t){return typeof t=="number"||t instanceof Number}be.number=nv;function rv(t){return t instanceof Error}be.error=rv;function iv(t){return typeof t=="function"}be.func=iv;function mp(t){return Array.isArray(t)}be.array=mp;function sv(t){return mp(t)&&t.every(e=>pp(e))}be.stringArray=sv;var jt={};Object.defineProperty(jt,"__esModule",{value:!0});var gp=jt.Emitter=jt.Event=void 0;const av=ln;var Ju;(function(t){const e={dispose(){}};t.None=function(){return e}})(Ju||(jt.Event=Ju={}));class ov{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,a=r.length;s<a;s++)try{n.push(r[s].apply(i[s],e))}catch(o){(0,av.default)().console.error(o)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class eo{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new ov),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=eo._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}gp=jt.Emitter=eo;eo._noop=function(){};var ge;Object.defineProperty(kn,"__esModule",{value:!0});var Zl=kn.CancellationTokenSource=ge=kn.CancellationToken=void 0;const cv=ln,lv=be,ul=jt;var Pa;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ul.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ul.Event.None});function e(n){const r=n;return r&&(r===t.None||r===t.Cancelled||lv.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Pa||(ge=kn.CancellationToken=Pa={}));const uv=Object.freeze(function(t,e){const n=(0,cv.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}});class Qu{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?uv:(this._emitter||(this._emitter=new ul.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class dv{get token(){return this._token||(this._token=new Qu),this._token}cancel(){this._token?this._token.cancel():this._token=Pa.Cancelled}dispose(){this._token?this._token instanceof Qu&&this._token.dispose():this._token=Pa.None}}Zl=kn.CancellationTokenSource=dv;function fv(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let aa=0,hv=10;function pv(){return aa=performance.now(),new Zl}const wr=Symbol("OperationCancelled");function to(t){return t===wr}async function Qe(t){if(t===ge.None)return;const e=performance.now();if(e-aa>=hv&&(aa=e,await fv(),aa=performance.now()),t.isCancellationRequested)throw wr}class eu{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class ns{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(const r of e)if(ns.isIncremental(r)){const i=Tp(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),c=Math.max(i.end.line,0);let l=this._lineOffsets;const d=Zu(r.text,!1,s);if(c-o===d.length)for(let p=0,g=d.length;p<g;p++)l[p+o+1]=d[p];else d.length<1e4?l.splice(o+1,c-o,...d):this._lineOffsets=l=l.slice(0,o+1).concat(d,l.slice(c+1));const h=r.text.length-(a-s);if(h!==0)for(let p=o+1+d.length,g=l.length;p<g;p++)l[p]=l[p]+h}else if(ns.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Zu(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const n=this.getLineOffsets();let r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){const a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}const s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){const n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;const r=n[e.line];if(e.character<=0)return r;const i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&yp(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var dl;(function(t){function e(i,s,a,o){return new ns(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof ns)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){const a=i.getText(),o=fl(s.map(mv),(d,h)=>{const p=d.range.start.line-h.range.start.line;return p===0?d.range.start.character-h.range.start.character:p});let c=0;const l=[];for(const d of o){const h=i.offsetAt(d.range.start);if(h<c)throw new Error("Overlapping edit");h>c&&l.push(a.substring(c,h)),d.newText.length&&l.push(d.newText),c=i.offsetAt(d.range.end)}return l.push(a.substr(c)),l.join("")}t.applyEdits=r})(dl||(dl={}));function fl(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);fl(r,e),fl(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?t[o++]=r[s++]:t[o++]=i[a++];for(;s<r.length;)t[o++]=r[s++];for(;a<i.length;)t[o++]=i[a++];return t}function Zu(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);yp(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function yp(t){return t===13||t===10}function Tp(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function mv(t){const e=Tp(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Rp;(()=>{var t={975:k=>{function E(y){if(typeof y!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(y))}function m(y,T){for(var v,$="",O=0,P=-1,j=0,q=0;q<=y.length;++q){if(q<y.length)v=y.charCodeAt(q);else{if(v===47)break;v=47}if(v===47){if(!(P===q-1||j===1))if(P!==q-1&&j===2){if($.length<2||O!==2||$.charCodeAt($.length-1)!==46||$.charCodeAt($.length-2)!==46){if($.length>2){var se=$.lastIndexOf("/");if(se!==$.length-1){se===-1?($="",O=0):O=($=$.slice(0,se)).length-1-$.lastIndexOf("/"),P=q,j=0;continue}}else if($.length===2||$.length===1){$="",O=0,P=q,j=0;continue}}T&&($.length>0?$+="/..":$="..",O=2)}else $.length>0?$+="/"+y.slice(P+1,q):$=y.slice(P+1,q),O=q-P-1;P=q,j=0}else v===46&&j!==-1?++j:j=-1}return $}var S={resolve:function(){for(var y,T="",v=!1,$=arguments.length-1;$>=-1&&!v;$--){var O;$>=0?O=arguments[$]:(y===void 0&&(y=process.cwd()),O=y),E(O),O.length!==0&&(T=O+"/"+T,v=O.charCodeAt(0)===47)}return T=m(T,!v),v?T.length>0?"/"+T:"/":T.length>0?T:"."},normalize:function(y){if(E(y),y.length===0)return".";var T=y.charCodeAt(0)===47,v=y.charCodeAt(y.length-1)===47;return(y=m(y,!T)).length!==0||T||(y="."),y.length>0&&v&&(y+="/"),T?"/"+y:y},isAbsolute:function(y){return E(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 v=arguments[T];E(v),v.length>0&&(y===void 0?y=v:y+="/"+v)}return y===void 0?".":S.normalize(y)},relative:function(y,T){if(E(y),E(T),y===T||(y=S.resolve(y))===(T=S.resolve(T)))return"";for(var v=1;v<y.length&&y.charCodeAt(v)===47;++v);for(var $=y.length,O=$-v,P=1;P<T.length&&T.charCodeAt(P)===47;++P);for(var j=T.length-P,q=O<j?O:j,se=-1,V=0;V<=q;++V){if(V===q){if(j>q){if(T.charCodeAt(P+V)===47)return T.slice(P+V+1);if(V===0)return T.slice(P+V)}else O>q&&(y.charCodeAt(v+V)===47?se=V:V===0&&(se=0));break}var $e=y.charCodeAt(v+V);if($e!==T.charCodeAt(P+V))break;$e===47&&(se=V)}var te="";for(V=v+se+1;V<=$;++V)V!==$&&y.charCodeAt(V)!==47||(te.length===0?te+="..":te+="/..");return te.length>0?te+T.slice(P+se):(P+=se,T.charCodeAt(P)===47&&++P,T.slice(P))},_makeLong:function(y){return y},dirname:function(y){if(E(y),y.length===0)return".";for(var T=y.charCodeAt(0),v=T===47,$=-1,O=!0,P=y.length-1;P>=1;--P)if((T=y.charCodeAt(P))===47){if(!O){$=P;break}}else O=!1;return $===-1?v?"/":".":v&&$===1?"//":y.slice(0,$)},basename:function(y,T){if(T!==void 0&&typeof T!="string")throw new TypeError('"ext" argument must be a string');E(y);var v,$=0,O=-1,P=!0;if(T!==void 0&&T.length>0&&T.length<=y.length){if(T.length===y.length&&T===y)return"";var j=T.length-1,q=-1;for(v=y.length-1;v>=0;--v){var se=y.charCodeAt(v);if(se===47){if(!P){$=v+1;break}}else q===-1&&(P=!1,q=v+1),j>=0&&(se===T.charCodeAt(j)?--j==-1&&(O=v):(j=-1,O=q))}return $===O?O=q:O===-1&&(O=y.length),y.slice($,O)}for(v=y.length-1;v>=0;--v)if(y.charCodeAt(v)===47){if(!P){$=v+1;break}}else O===-1&&(P=!1,O=v+1);return O===-1?"":y.slice($,O)},extname:function(y){E(y);for(var T=-1,v=0,$=-1,O=!0,P=0,j=y.length-1;j>=0;--j){var q=y.charCodeAt(j);if(q!==47)$===-1&&(O=!1,$=j+1),q===46?T===-1?T=j:P!==1&&(P=1):T!==-1&&(P=-1);else if(!O){v=j+1;break}}return T===-1||$===-1||P===0||P===1&&T===$-1&&T===v+1?"":y.slice(T,$)},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,v){var $=v.dir||v.root,O=v.base||(v.name||"")+(v.ext||"");return $?$===v.root?$+O:$+"/"+O:O}(0,y)},parse:function(y){E(y);var T={root:"",dir:"",base:"",ext:"",name:""};if(y.length===0)return T;var v,$=y.charCodeAt(0),O=$===47;O?(T.root="/",v=1):v=0;for(var P=-1,j=0,q=-1,se=!0,V=y.length-1,$e=0;V>=v;--V)if(($=y.charCodeAt(V))!==47)q===-1&&(se=!1,q=V+1),$===46?P===-1?P=V:$e!==1&&($e=1):P!==-1&&($e=-1);else if(!se){j=V+1;break}return P===-1||q===-1||$e===0||$e===1&&P===q-1&&P===j+1?q!==-1&&(T.base=T.name=j===0&&O?y.slice(1,q):y.slice(j,q)):(j===0&&O?(T.name=y.slice(1,P),T.base=y.slice(1,q)):(T.name=y.slice(j,P),T.base=y.slice(j,q)),T.ext=y.slice(P,q)),j>0?T.dir=y.slice(0,j-1):O&&(T.dir="/"),T},sep:"/",delimiter:":",win32:null,posix:null};S.posix=S,k.exports=S}},e={};function n(k){var E=e[k];if(E!==void 0)return E.exports;var m=e[k]={exports:{}};return t[k](m,m.exports,n),m.exports}n.d=(k,E)=>{for(var m in E)n.o(E,m)&&!n.o(k,m)&&Object.defineProperty(k,m,{enumerable:!0,get:E[m]})},n.o=(k,E)=>Object.prototype.hasOwnProperty.call(k,E),n.r=k=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>p,Utils:()=>Ie}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function c(k,E){if(!k.scheme&&E)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${k.authority}", path: "${k.path}", query: "${k.query}", fragment: "${k.fragment}"}`);if(k.scheme&&!s.test(k.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(k.path){if(k.authority){if(!a.test(k.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(k.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const l="",d="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{constructor(E,m,S,y,T,v=!1){fn(this,"scheme");fn(this,"authority");fn(this,"path");fn(this,"query");fn(this,"fragment");typeof E=="object"?(this.scheme=E.scheme||l,this.authority=E.authority||l,this.path=E.path||l,this.query=E.query||l,this.fragment=E.fragment||l):(this.scheme=function($,O){return $||O?$:"file"}(E,v),this.authority=m||l,this.path=function($,O){switch($){case"https":case"http":case"file":O?O[0]!==d&&(O=d+O):O=d}return O}(this.scheme,S||l),this.query=y||l,this.fragment=T||l,c(this,v))}static isUri(E){return E instanceof p||!!E&&typeof E.authority=="string"&&typeof E.fragment=="string"&&typeof E.path=="string"&&typeof E.query=="string"&&typeof E.scheme=="string"&&typeof E.fsPath=="string"&&typeof E.with=="function"&&typeof E.toString=="function"}get fsPath(){return L(this)}with(E){if(!E)return this;let{scheme:m,authority:S,path:y,query:T,fragment:v}=E;return m===void 0?m=this.scheme:m===null&&(m=l),S===void 0?S=this.authority:S===null&&(S=l),y===void 0?y=this.path:y===null&&(y=l),T===void 0?T=this.query:T===null&&(T=l),v===void 0?v=this.fragment:v===null&&(v=l),m===this.scheme&&S===this.authority&&y===this.path&&T===this.query&&v===this.fragment?this:new C(m,S,y,T,v)}static parse(E,m=!1){const S=h.exec(E);return S?new C(S[2]||l,re(S[4]||l),re(S[5]||l),re(S[7]||l),re(S[9]||l),m):new C(l,l,l,l,l)}static file(E){let m=l;if(i&&(E=E.replace(/\\/g,d)),E[0]===d&&E[1]===d){const S=E.indexOf(d,2);S===-1?(m=E.substring(2),E=d):(m=E.substring(2,S),E=E.substring(S)||d)}return new C("file",m,E,l,l)}static from(E){const m=new C(E.scheme,E.authority,E.path,E.query,E.fragment);return c(m,!0),m}toString(E=!1){return b(this,E)}toJSON(){return this}static revive(E){if(E){if(E instanceof p)return E;{const m=new C(E);return m._formatted=E.external,m._fsPath=E._sep===g?E.fsPath:null,m}}return E}}const g=i?1:void 0;class C extends p{constructor(){super(...arguments);fn(this,"_formatted",null);fn(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=L(this)),this._fsPath}toString(m=!1){return m?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const m={$mid:1};return this._fsPath&&(m.fsPath=this._fsPath,m._sep=g),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 x(k,E,m){let S,y=-1;for(let T=0;T<k.length;T++){const v=k.charCodeAt(T);if(v>=97&&v<=122||v>=65&&v<=90||v>=48&&v<=57||v===45||v===46||v===95||v===126||E&&v===47||m&&v===91||m&&v===93||m&&v===58)y!==-1&&(S+=encodeURIComponent(k.substring(y,T)),y=-1),S!==void 0&&(S+=k.charAt(T));else{S===void 0&&(S=k.substr(0,T));const $=N[v];$!==void 0?(y!==-1&&(S+=encodeURIComponent(k.substring(y,T)),y=-1),S+=$):y===-1&&(y=T)}}return y!==-1&&(S+=encodeURIComponent(k.substring(y))),S!==void 0?S:k}function w(k){let E;for(let m=0;m<k.length;m++){const S=k.charCodeAt(m);S===35||S===63?(E===void 0&&(E=k.substr(0,m)),E+=N[S]):E!==void 0&&(E+=k[m])}return E!==void 0?E:k}function L(k,E){let m;return m=k.authority&&k.path.length>1&&k.scheme==="file"?`//${k.authority}${k.path}`:k.path.charCodeAt(0)===47&&(k.path.charCodeAt(1)>=65&&k.path.charCodeAt(1)<=90||k.path.charCodeAt(1)>=97&&k.path.charCodeAt(1)<=122)&&k.path.charCodeAt(2)===58?k.path[1].toLowerCase()+k.path.substr(2):k.path,i&&(m=m.replace(/\//g,"\\")),m}function b(k,E){const m=E?w:x;let S="",{scheme:y,authority:T,path:v,query:$,fragment:O}=k;if(y&&(S+=y,S+=":"),(T||y==="file")&&(S+=d,S+=d),T){let P=T.indexOf("@");if(P!==-1){const j=T.substr(0,P);T=T.substr(P+1),P=j.lastIndexOf(":"),P===-1?S+=m(j,!1,!1):(S+=m(j.substr(0,P),!1,!1),S+=":",S+=m(j.substr(P+1),!1,!0)),S+="@"}T=T.toLowerCase(),P=T.lastIndexOf(":"),P===-1?S+=m(T,!1,!0):(S+=m(T.substr(0,P),!1,!0),S+=T.substr(P))}if(v){if(v.length>=3&&v.charCodeAt(0)===47&&v.charCodeAt(2)===58){const P=v.charCodeAt(1);P>=65&&P<=90&&(v=`/${String.fromCharCode(P+32)}:${v.substr(3)}`)}else if(v.length>=2&&v.charCodeAt(1)===58){const P=v.charCodeAt(0);P>=65&&P<=90&&(v=`${String.fromCharCode(P+32)}:${v.substr(2)}`)}S+=m(v,!0,!1)}return $&&(S+="?",S+=m($,!1,!1)),O&&(S+="#",S+=E?O:x(O,!1,!1)),S}function M(k){try{return decodeURIComponent(k)}catch{return k.length>3?k.substr(0,3)+M(k.substr(3)):k}}const J=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function re(k){return k.match(J)?k.replace(J,E=>M(E)):k}var ie=n(975);const we=ie.posix||ie,_e="/";var Ie;(function(k){k.joinPath=function(E,...m){return E.with({path:we.join(E.path,...m)})},k.resolvePath=function(E,...m){let S=E.path,y=!1;S[0]!==_e&&(S=_e+S,y=!0);let T=we.resolve(S,...m);return y&&T[0]===_e&&!E.authority&&(T=T.substring(1)),E.with({path:T})},k.dirname=function(E){if(E.path.length===0||E.path===_e)return E;let m=we.dirname(E.path);return m.length===1&&m.charCodeAt(0)===46&&(m=""),E.with({path:m})},k.basename=function(E){return we.basename(E.path)},k.extname=function(E){return we.extname(E.path)}})(Ie||(Ie={})),Rp=r})();const{URI:It,Utils:$i}=Rp;var ft;(function(t){t.basename=$i.basename,t.dirname=$i.dirname,t.extname=$i.extname,t.joinPath=$i.joinPath,t.resolvePath=$i.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function n(a,o){return(a==null?void 0:a.toString())===(o==null?void 0:o.toString())}t.equals=n;function r(a,o){const c=typeof a=="string"?It.parse(a).path:a.path,l=typeof o=="string"?It.parse(o).path:o.path,d=c.split("/").filter(N=>N.length>0),h=l.split("/").filter(N=>N.length>0);if(e){const N=/^[A-Z]:$/;if(d[0]&&N.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]&&N.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]!==h[0])return l.substring(1)}let p=0;for(;p<d.length&&d[p]===h[p];p++);const g="../".repeat(d.length-p),C=h.slice(p).join("/");return g+C}t.relative=r;function i(a){return It.parse(a.toString()).toString()}t.normalize=i;function s(a,o){let c=typeof a=="string"?a:a.path,l=typeof o=="string"?o:o.path;return l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l===c?!0:l.length<c.length||l.charAt(c.length)!=="/"?!1:l.startsWith(c)}t.contains=s})(ft||(ft={}));class gv{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return ft.normalize(e)}clear(){this.root.children.clear()}insert(e,n){const r=this.getNode(this.normalizeUri(e),!0);r.element=n}delete(e){const n=this.getNode(this.normalizeUri(e),!1);n!=null&&n.parent&&n.parent.children.delete(n.name)}has(e){var n;return((n=this.getNode(this.normalizeUri(e),!1))==null?void 0:n.element)!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){var n;return(n=this.getNode(this.normalizeUri(e),!1))==null?void 0:n.element}findNode(e){const n=this.normalizeUri(e),r=this.getNode(n,!1);if(r)return{name:r.name,uri:ft.joinPath(It.parse(n),r.name).toString(),element:r.element}}findChildren(e){const n=this.normalizeUri(e),r=this.getNode(n,!1);return r?Array.from(r.children.values()).map(i=>({name:i.name,uri:ft.joinPath(It.parse(n),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const n=this.getNode(ft.normalize(e),!1);return n?this.collectValues(n):[]}getNode(e,n){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let i=this.root;for(const s of r){let a=i.children.get(s);if(!a)if(n)a={name:s,children:new Map,parent:i},i.children.set(s,a);else return;i=a}return i}collectValues(e){const n=[];e.element&&n.push(e.element);for(const r of e.children.values())n.push(...this.collectValues(r));return n}}var H;(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"})(H||(H={}));class yv{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=ge.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??It.parse(e.uri),ge.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return ge.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:H.Parsed,references:[],textDocument:r};else{const a=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:H.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,n){var a,o;const r=(a=e.parseResult.value.$cstNode)==null?void 0:a.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),s=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const c=this.createTextDocumentGetter(e.uri,s);Object.defineProperty(e,"textDocument",{get:c})}return r!==s&&(e.parseResult=await this.parseAsync(e.uri,s,n),e.parseResult.value.$document=e),e.state=H.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=dl.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class Tv{constructor(e){this.documentTrie=new gv,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return pe(this.documentTrie.all())}addDocument(e){const n=e.uri.toString();if(this.documentTrie.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentTrie.insert(n,e)}getDocument(e){const n=e.toString();return this.documentTrie.find(n)}getDocuments(e){const n=e.toString();return this.documentTrie.findAll(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentTrie.find(n);return r&&this.documentBuilder().resetToState(r,H.Changed),r}deleteDocument(e){const n=e.toString(),r=this.documentTrie.find(n);return r&&(r.state=H.Changed,this.documentTrie.delete(n)),r}deleteDocuments(e){const n=e.toString(),r=this.documentTrie.findAll(n);for(const i of r)i.state=H.Changed;return this.documentTrie.delete(n),r}}const or=Symbol("RefResolving");class Rv{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,n=ge.None){var r;if((r=this.profiler)!=null&&r.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const s of Zt(e.parseResult.value))await Qe(n),ua(s).forEach(a=>{const o=`${s.$type}:${a.property}`;i.startSubTask(o);try{this.doLink(a,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Zt(e.parseResult.value))await Qe(n),ua(i).forEach(s=>this.doLink(s,e))}doLink(e,n){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=or;try{const i=this.getCandidate(e);if(ki(i))r._ref=i;else{r._nodeDescription=i;const s=this.loadAstNode(i);r._ref=s??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${r.$refText}':`,i);const s=i.message??String(i);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${s}`}}n.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=or;try{const i=this.getCandidates(e),s=[];if(ki(i))r._linkingError=i;else for(const a of i){const o=this.loadAstNode(a);o&&s.push({ref:o,$nodeDescription:a})}r._items=s}catch(i){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${i}`},r._items=[]}n.references.push(r)}}unlink(e){for(const n of e.references)"_ref"in n?(n._ref=void 0,delete n._nodeDescription):"_items"in n&&(n._items=void 0,delete n._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,_ref:void 0,get ref(){if(He(this._ref))return this._ref;if(zm(this._nodeDescription)){const o=s.loadAstNode(this._nodeDescription);this._ref=o??s.createLinkingError({reference:a,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=or;const o=Hs(e).$document,c=s.getLinkedNode({reference:a,container:e,property:n});if(c.error&&o&&o.state<H.ComputedScopes)return this._ref=void 0;this._ref=c.node??c.error,this._nodeDescription=c.descr,o==null||o.references.push(this)}else this._ref===or&&s.throwCyclicReferenceError(e,n,i);return He(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return ki(this._ref)?this._ref:void 0}};return a}buildMultiReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=or;const o=Hs(e).$document,c=s.getCandidates({reference:a,container:e,property:n}),l=[];if(ki(c))this._linkingError=c;else for(const d of c){const h=s.loadAstNode(d);h&&l.push({ref:h,$nodeDescription:d})}this._items=l,o==null||o.references.push(this)}else this._items===or&&s.throwCyclicReferenceError(e,n,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=s.createLinkingError({reference:a,container:e,property:n})}};return a}throwCyclicReferenceError(e,n,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${r}')`)}getLinkedNode(e){try{const n=this.getCandidate(e);if(ki(n))return{error:n};const r=this.loadAstNode(n);return r?{node:r,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const r=n.message??String(n);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=Hs(e.container).$document;r&&r.state<H.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n}}}function vv(t){return typeof t.name=="string"}class Ev{getName(e){if(vv(e))return e.name}getNameNode(e){return oh(e.$cstNode,"name")}}class Av{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=Zt(e.Grammar).some(n=>qa(n)&&n.isMulti)}findDeclarations(e){if(e){const n=Lg(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(Nt(i)||pn(i))return uu(i);if(Array.isArray(i)){for(const s of i)if((Nt(s)||pn(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return uu(s)}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||ug(e,i)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(n.head());if(r){for(const i of ua(r))if(pn(i.reference)&&i.reference.items.some(s=>s.ref===e))return i.reference.items.map(s=>s.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const n=this.documents.getDocument(e.sourceUri);if(n)return this.nodeLocator.getAstNode(n.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const n=this.findDeclarations(e),r=[];for(const i of n){const s=this.nameProvider.getNameNode(i)??i.$cstNode;s&&r.push(s)}return r}findReferences(e,n){const r=[];n.includeDeclaration&&r.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>ft.equals(s.sourceUri,n.documentUri))),r.push(...i),pe(r)}getSelfReferences(e){const n=this.getSelfNodes(e),r=[];for(const i of n){const s=this.nameProvider.getNameNode(i);if(s){const a=Qt(i),o=this.nodeLocator.getAstNodePath(i);r.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:fa(s),local:!0})}}return r}}class rs{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return Fo.sum(pe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const n=this.map.get(e);return n?pe(n):Xf}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return pe(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return pe(this.map.keys())}values(){return pe(this.map.values()).flat()}entriesGroupedByKey(){return pe(this.map.entries())}}class ed{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class Sv{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,n=ge.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,n)}async collectExportedSymbolsForNode(e,n,r=xl,i=ge.None){const s=[];this.addExportedSymbol(e,s,n);for(const a of r(e))await Qe(i),this.addExportedSymbol(a,s,n);return s}addExportedSymbol(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async collectLocalSymbols(e,n=ge.None){const r=e.parseResult.value,i=new rs;for(const s of ls(r))await Qe(n),this.addLocalSymbol(s,e,i);return i}addLocalSymbol(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class td{constructor(e,n,r){this.elements=e,this.outerScope=n,this.caseInsensitive=(r==null?void 0:r.caseInsensitive)??!1,this.concatOuterScope=(r==null?void 0:r.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===n):this.elements.find(i=>i.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===n):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}}class Cv{constructor(e,n,r){this.elements=new rs,this.caseInsensitive=(r==null?void 0:r.caseInsensitive)??!1,this.concatOuterScope=(r==null?void 0:r.concatOuterScope)??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(s,i)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);return(this.concatOuterScope||r.length===0)&&this.outerScope?pe(r).concat(this.outerScope.getElements(e)):pe(r)}getAllElements(){let e=pe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class vp{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 kv extends vp{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class wv extends vp{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class Nv extends kv{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class bv{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 Nv(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=Qt(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&n.push(i.getStream(a).filter(o=>this.reflection.isSubtype(o.type,r))),a=a.$container;while(a)}let s=this.getGlobalScope(r,e);for(let a=n.length-1;a>=0;a--)s=this.createScope(n[a],s);return s}createScope(e,n,r){return new td(pe(e),n,r)}createScopeForNodes(e,n,r){const i=pe(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new td(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new Cv(this.indexManager.allElements(e)))}}function _v(t){return typeof t.$comment=="string"}function nd(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class Iv{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n==null?void 0:n.replacer,s=(o,c)=>this.replacer(o,c,r),a=i?(o,c)=>i(o,c,s):s;try{return this.currentDocument=Qt(e),JSON.stringify(e,a,n==null?void 0:n.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var c,l,d;if(!this.ignoreProperties.has(e))if(Nt(n)){const h=n.ref,p=r?n.$refText:void 0;if(h){const g=Qt(h);let C="";this.currentDocument&&this.currentDocument!==g&&(o?C=o(g.uri,h):C=g.uri.toString());const N=this.astNodeLocator.getAstNodePath(h);return{$ref:`${C}#${N}`,$refText:p}}else return{$error:((c=n.error)==null?void 0:c.message)??"Could not resolve reference",$refText:p}}else if(pn(n)){const h=r?n.$refText:void 0,p=[];for(const g of n.items){const C=g.ref,N=Qt(g.ref);let x="";this.currentDocument&&this.currentDocument!==N&&(o?x=o(N.uri,C):x=N.uri.toString());const w=this.astNodeLocator.getAstNodePath(C);p.push(`${x}#${w}`)}return{$refs:p,$refText:h}}else if(He(n)){let h;if(s&&(h=this.addAstNodeRegionWithAssignmentsTo({...n}),(!e||n.$document)&&(h!=null&&h.$textRegion)&&(h.$textRegion.documentURI=(l=this.currentDocument)==null?void 0:l.uri.toString())),i&&!e&&(h??(h={...n}),h.$sourceText=(d=n.$cstNode)==null?void 0:d.text),a){h??(h={...n});const p=this.commentProvider.getComment(n);p&&(h.$comment=p.replace(/\r/g,""))}return h??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=Ig(e.$cstNode,s).map(n);a.length!==0&&(i[s]=a)}),e}}linkNode(e,n,r,i,s,a){for(const[c,l]of Object.entries(e))if(Array.isArray(l))for(let d=0;d<l.length;d++){const h=l[d];nd(h)?l[d]=this.reviveReference(e,c,n,h,r):He(h)&&this.linkNode(h,n,r,e,c,d)}else nd(l)?e[c]=this.reviveReference(e,c,n,l,r):He(l)&&this.linkNode(l,n,r,e,c);const o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,n,r,i,s){let a=i.$refText,o=i.$error,c;if(i.$ref){const l=this.getRefNode(r,i.$ref,s.uriConverter);if(He(l))return a||(a=this.nameProvider.getName(l)),{$refText:a??"",ref:l};o=l}else if(i.$refs){const l=[];for(const d of i.$refs){const h=this.getRefNode(r,d,s.uriConverter);He(h)&&l.push({ref:h})}if(l.length===0)c={$refText:a??"",items:l},o??(o="Could not resolve multi-reference");else return{$refText:a??"",items:l}}if(o)return c??(c={$refText:a??"",ref:void 0}),c.error={info:{container:e,property:n,reference:c},message:o},c}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const c=this.astNodeLocator.getAstNode(e,n.substring(1));return c||"Could not resolve path: "+n}if(i<0){const c=r?r(n):It.parse(n),l=this.langiumDocuments.getDocument(c);return l?l.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):It.parse(n.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+n;if(i===n.length-1)return a.parseResult.value;const o=this.astNodeLocator.getAstNode(a.parseResult.value,n.substring(i+1));return o||"Could not resolve URI: "+n}catch(i){return String(i)}}}class $v{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 n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);if(n.fileNames)for(const r of n.fileNames)this.fileNameMap.has(r)&&console.warn(`The file name ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileNameMap.set(r,e);this.languageIdMap.set(n.languageId,e)}getServices(e){var a,o;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const n=(o=(a=this.textDocuments)==null?void 0:a.get(e))==null?void 0:o.languageId;if(n!==void 0){const c=this.languageIdMap.get(n);if(c)return c}const r=ft.extname(e),i=ft.basename(e),s=this.fileNameMap.get(i)??this.fileExtensionMap.get(r);if(!s)throw n?new Error(`The service registry contains no services for the extension '${r}' for language '${n}'.`):new Error(`The service registry contains no services for the extension '${r}'.`);return s}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 hl;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(hl||(hl={}));class Pv{constructor(e){this.entries=new rs,this.knownCategories=new Set(hl.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(r);for(const[i,s]of Object.entries(e)){const a=s;if(Array.isArray(a))for(const o of a){const c={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,c)}else if(typeof a=="function"){const o={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,o)}else ds()}}wrapValidationException(e,n){return async(r,i,s)=>{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(to(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${n}: ${a}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=pe(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}}const Lv=Object.freeze({validateNode:!0,validateChildren:!0});class Ov{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,n={},r=ge.None){const i=e.parseResult,s=[];if(await Qe(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===wt.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===wt.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===wt.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(a){if(to(a))throw a;console.error("An error occurred during validation:",a)}return await Qe(r),s}processLexingErrors(e,n,r){var s;const i=[...e.lexerErrors,...((s=e.lexerReport)==null?void 0:s.diagnostics)??[]];for(const a of i){const o=a.severity??"error",c={severity:bo(o),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:Dv(o),source:this.getSource()};n.push(c)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=Ko(i.token);if(s){const a={severity:bo("error"),range:s,message:i.message,data:ji(wt.ParsingError),source:this.getSource()};n.push(a)}}}processLinkingErrors(e,n,r){var i;for(const s of e.references){const a=s.error;if(a){const o={node:a.info.container,range:(i=s.$refNode)==null?void 0:i.range,property:a.info.property,index:a.info.index,data:{code:wt.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};n.push(this.toDiagnostic("error",a.message,o))}}}async validateAst(e,n,r=ge.None){const i=[],s=(a,o,c)=>{i.push(this.toDiagnostic(a,o,c))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=ge.None){const s=this.validationRegistry.checksBefore;for(const a of s)await Qe(i),await a(e,r,n.categories??[],i)}async validateAstNodes(e,n,r,i=ge.None){var s;if((s=this.profiler)!=null&&s.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const o=Zt(e).iterator();for(const c of o){a.startSubTask(c.$type);const l=this.validateSingleNodeOptions(c,n);if(l.validateNode)try{const d=this.validationRegistry.getChecks(c.$type,n.categories);for(const h of d)await h(c,r,i)}finally{a.stopSubTask(c.$type)}l.validateChildren||o.prune()}}finally{a.stop()}}else{const a=Zt(e).iterator();for(const o of a){await Qe(i);const c=this.validateSingleNodeOptions(o,n);if(c.validateNode){const l=this.validationRegistry.getChecks(o.$type,n.categories);for(const d of l)await d(o,r,i)}c.validateChildren||a.prune()}}}validateSingleNodeOptions(e,n){return Lv}async validateAstAfter(e,n,r,i=ge.None){const s=this.validationRegistry.checksAfter;for(const a of s)await Qe(i),await a(e,r,n.categories??[],i)}toDiagnostic(e,n,r){return{message:n,range:xv(r),severity:bo(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function xv(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=oh(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=$g(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 bo(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 Dv(t){switch(t){case"error":return ji(wt.LexingError);case"warning":return ji(wt.LexingWarning);case"info":return ji(wt.LexingInfo);case"hint":return ji(wt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var wt;(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"})(wt||(wt={}));class Mv{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??Qt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>a??(a=fa(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:n,get nameSegment(){return o()},selectionSegment:fa(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class Fv{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=ge.None){const r=[],i=e.parseResult.value;for(const s of Zt(i))await Qe(n),ua(s).forEach(a=>{a.reference.error||r.push(...this.createInfoDescriptions(a))});return r}createInfoDescriptions(e){const n=e.reference;if(n.error||!n.$refNode)return[];let r=[];Nt(n)&&n.$nodeDescription?r=[n.$nodeDescription]:pn(n)&&(r=n.items.map(c=>c.$nodeDescription).filter(c=>c!==void 0));const i=Qt(e.container).uri,s=this.nodeLocator.getAstNodePath(e.container),a=[],o=fa(n.$refNode);for(const c of r)a.push({sourceUri:i,sourcePath:s,targetUri:c.documentUri,targetPath:c.path,segment:o,local:ft.equals(c.documentUri,i)});return a}}class Gv{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),c=parseInt(s.substring(a+1)),l=i[o];return l==null?void 0:l[c]}return i[s]},e)}}class Uv{constructor(e){this._ready=new eu,this.onConfigurationSectionUpdateEmitter=new gp,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n;this.workspaceConfig=((n=e.capabilities.workspace)==null?void 0:n.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([n,r])=>{this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var zi={},er={},tu={},La={},G={};Object.defineProperty(G,"__esModule",{value:!0});G.Message=G.NotificationType9=G.NotificationType8=G.NotificationType7=G.NotificationType6=G.NotificationType5=G.NotificationType4=G.NotificationType3=G.NotificationType2=G.NotificationType1=G.NotificationType0=G.NotificationType=G.RequestType9=G.RequestType8=G.RequestType7=G.RequestType6=G.RequestType5=G.RequestType4=G.RequestType3=G.RequestType2=G.RequestType1=G.RequestType=G.RequestType0=G.AbstractMessageSignature=G.ParameterStructures=G.ResponseError=G.ErrorCodes=void 0;const Un=be;var pl;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(pl||(G.ErrorCodes=pl={}));class nu extends Error{constructor(e,n,r){super(n),this.code=Un.number(e)?e:pl.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,nu.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}G.ResponseError=nu;class Ye{constructor(e){this.kind=e}static is(e){return e===Ye.auto||e===Ye.byName||e===Ye.byPosition}toString(){return this.kind}}G.ParameterStructures=Ye;Ye.auto=new Ye("auto");Ye.byPosition=new Ye("byPosition");Ye.byName=new Ye("byName");class ye{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return Ye.auto}}G.AbstractMessageSignature=ye;class jv extends ye{constructor(e){super(e,0)}}G.RequestType0=jv;class zv extends ye{constructor(e,n=Ye.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}G.RequestType=zv;class Bv extends ye{constructor(e,n=Ye.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}G.RequestType1=Bv;class qv extends ye{constructor(e){super(e,2)}}G.RequestType2=qv;class Wv extends ye{constructor(e){super(e,3)}}G.RequestType3=Wv;class Vv extends ye{constructor(e){super(e,4)}}G.RequestType4=Vv;class Kv extends ye{constructor(e){super(e,5)}}G.RequestType5=Kv;class Hv extends ye{constructor(e){super(e,6)}}G.RequestType6=Hv;class Yv extends ye{constructor(e){super(e,7)}}G.RequestType7=Yv;class Xv extends ye{constructor(e){super(e,8)}}G.RequestType8=Xv;class Jv extends ye{constructor(e){super(e,9)}}G.RequestType9=Jv;class Qv extends ye{constructor(e,n=Ye.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}G.NotificationType=Qv;class Zv extends ye{constructor(e){super(e,0)}}G.NotificationType0=Zv;class eE extends ye{constructor(e,n=Ye.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}G.NotificationType1=eE;class tE extends ye{constructor(e){super(e,2)}}G.NotificationType2=tE;class nE extends ye{constructor(e){super(e,3)}}G.NotificationType3=nE;class rE extends ye{constructor(e){super(e,4)}}G.NotificationType4=rE;class iE extends ye{constructor(e){super(e,5)}}G.NotificationType5=iE;class sE extends ye{constructor(e){super(e,6)}}G.NotificationType6=sE;class aE extends ye{constructor(e){super(e,7)}}G.NotificationType7=aE;class oE extends ye{constructor(e){super(e,8)}}G.NotificationType8=oE;class cE extends ye{constructor(e){super(e,9)}}G.NotificationType9=cE;var rd;(function(t){function e(i){const s=i;return s&&Un.string(s.method)&&(Un.string(s.id)||Un.number(s.id))}t.isRequest=e;function n(i){const s=i;return s&&Un.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){const s=i;return s&&(s.result!==void 0||!!s.error)&&(Un.string(s.id)||Un.number(s.id)||s.id===null)}t.isResponse=r})(rd||(G.Message=rd={}));var tn={},id;Object.defineProperty(tn,"__esModule",{value:!0});tn.LRUCache=tn.LinkedMap=tn.Touch=void 0;var Ve;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ve||(tn.Touch=Ve={}));class Ep{constructor(){this[id]="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 e;return(e=this._head)==null?void 0:e.value}get last(){var e;return(e=this._tail)==null?void 0:e.value}has(e){return this._map.has(e)}get(e,n=Ve.None){const r=this._map.get(e);if(r)return n!==Ve.None&&this.touch(r,n),r.value}set(e,n,r=Ve.None){let i=this._map.get(e);if(i)i.value=n,r!==Ve.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Ve.None:this.addItemLast(i);break;case Ve.First:this.addItemFirst(i);break;case Ve.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){const r=this._state;let i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(id=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Ve.First&&n!==Ve.Last)){if(n===Ve.First){if(e===this._head)return;const r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Ve.Last){if(e===this._tail)return;const r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(const[n,r]of e)this.set(n,r)}}tn.LinkedMap=Ep;class lE extends Ep{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=Ve.AsNew){return super.get(e,n)}peek(e){return super.get(e,Ve.None)}set(e,n){return super.set(e,n,Ve.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}tn.LRUCache=lE;var no={};Object.defineProperty(no,"__esModule",{value:!0});no.Disposable=void 0;var sd;(function(t){function e(n){return{dispose:n}}t.create=e})(sd||(no.Disposable=sd={}));var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.SharedArrayReceiverStrategy=Qr.SharedArraySenderStrategy=void 0;const uE=kn;var is;(function(t){t.Continue=0,t.Cancelled=1})(is||(is={}));class dE{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=is.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(r===void 0)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,is.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}Qr.SharedArraySenderStrategy=dE;class fE{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===is.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class hE{constructor(e){this.token=new fE(e)}cancel(){}dispose(){}}class pE{constructor(){this.kind="request"}createCancellationTokenSource(e){const n=e.$cancellationData;return n===void 0?new uE.CancellationTokenSource:new hE(n)}}Qr.SharedArrayReceiverStrategy=pE;var mn={},ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.Semaphore=void 0;const mE=ln;class gE{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,mE.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}}ys.Semaphore=gE;Object.defineProperty(mn,"__esModule",{value:!0});mn.ReadableStreamMessageReader=mn.AbstractMessageReader=mn.MessageReader=void 0;const ml=ln,Rr=be,_o=jt,yE=ys;var ad;(function(t){function e(n){let r=n;return r&&Rr.func(r.listen)&&Rr.func(r.dispose)&&Rr.func(r.onError)&&Rr.func(r.onClose)&&Rr.func(r.onPartialMessage)}t.is=e})(ad||(mn.MessageReader=ad={}));class Ap{constructor(){this.errorEmitter=new _o.Emitter,this.closeEmitter=new _o.Emitter,this.partialMessageEmitter=new _o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Rr.string(e.message)?e.message:"unknown"}`)}}mn.AbstractMessageReader=Ap;var gl;(function(t){function e(n){let r,i;const s=new Map;let a;const o=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,s.set(i.name,i)),n.contentDecoders!==void 0)for(const c of n.contentDecoders)s.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,o.set(a.name,a)),n.contentTypeDecoders!==void 0)for(const c of n.contentTypeDecoders)o.set(c.name,c)}return a===void 0&&(a=(0,ml.default)().applicationJson.decoder,o.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:o}}t.fromOptions=e})(gl||(gl={}));class TE extends Ap{constructor(e,n){super(),this.readable=e,this.options=gl.fromOptions(n),this.buffer=(0,ml.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new yE.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const r=this.buffer.tryReadHeaders(!0);if(!r)return;const i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
120
- ${JSON.stringify(Object.fromEntries(r))}`));return}const s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}const n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ml.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}mn.ReadableStreamMessageReader=TE;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.WriteableStreamMessageWriter=gn.AbstractMessageWriter=gn.MessageWriter=void 0;const od=ln,Bi=be,RE=ys,cd=jt,vE="Content-Length: ",ld=`\r
121
- `;var ud;(function(t){function e(n){let r=n;return r&&Bi.func(r.dispose)&&Bi.func(r.onClose)&&Bi.func(r.onError)&&Bi.func(r.write)}t.is=e})(ud||(gn.MessageWriter=ud={}));class Sp{constructor(){this.errorEmitter=new cd.Emitter,this.closeEmitter=new cd.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Bi.string(e.message)?e.message:"unknown"}`)}}gn.AbstractMessageWriter=Sp;var yl;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,od.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,od.default)().applicationJson.encoder}}t.fromOptions=e})(yl||(yl={}));class EE extends Sp{constructor(e,n){super(),this.writable=e,this.options=yl.fromOptions(n),this.errorCount=0,this.writeSemaphore=new RE.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{const i=[];return i.push(vE,r.byteLength.toString(),ld),i.push(ld),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}}gn.WriteableStreamMessageWriter=EE;var ro={};Object.defineProperty(ro,"__esModule",{value:!0});ro.AbstractMessageBuffer=void 0;const AE=13,SE=10,CE=`\r
122
- `;class kE{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,s=0;e:for(;r<this._chunks.length;){const l=this._chunks[r];for(i=0;i<l.length;){switch(l[i]){case AE:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case SE:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=l.byteLength,r++}if(n!==4)return;const a=this._read(s+i),o=new Map,c=this.toString(a,"ascii").split(CE);if(c.length<2)return o;for(let l=0;l<c.length-2;l++){const d=c[l],h=d.indexOf(":");if(h===-1)throw new Error(`Message header must separate key and value using ':'
123
- ${d}`);const p=d.substr(0,h),g=d.substr(h+1).trim();o.set(e?p.toLowerCase():p,g)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){const s=this._chunks[0],a=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,a}const n=this.allocNative(e);let r=0,i=0;for(;e>0;){const s=this._chunks[i];if(s.byteLength>e){const a=s.slice(0,e);n.set(a,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}}ro.AbstractMessageBuffer=kE;var Cp={};(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=ln,n=be,r=G,i=tn,s=jt,a=kn;var o;(function(m){m.type=new r.NotificationType("$/cancelRequest")})(o||(o={}));var c;(function(m){function S(y){return typeof y=="string"||typeof y=="number"}m.is=S})(c||(t.ProgressToken=c={}));var l;(function(m){m.type=new r.NotificationType("$/progress")})(l||(l={}));class d{constructor(){}}t.ProgressType=d;var h;(function(m){function S(y){return n.func(y)}m.is=S})(h||(h={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var p;(function(m){m[m.Off=0]="Off",m[m.Messages=1]="Messages",m[m.Compact=2]="Compact",m[m.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var g;(function(m){m.Off="off",m.Messages="messages",m.Compact="compact",m.Verbose="verbose"})(g||(t.TraceValues=g={})),function(m){function S(T){if(!n.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=S;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}(p||(t.Trace=p={}));var C;(function(m){m.Text="text",m.JSON="json"})(C||(t.TraceFormat=C={})),function(m){function S(y){return n.string(y)?(y=y.toLowerCase(),y==="json"?m.JSON:m.Text):m.Text}m.fromString=S}(C||(t.TraceFormat=C={}));var N;(function(m){m.type=new r.NotificationType("$/setTrace")})(N||(t.SetTraceNotification=N={}));var x;(function(m){m.type=new r.NotificationType("$/logTrace")})(x||(t.LogTraceNotification=x={}));var w;(function(m){m[m.Closed=1]="Closed",m[m.Disposed=2]="Disposed",m[m.AlreadyListening=3]="AlreadyListening"})(w||(t.ConnectionErrors=w={}));class L extends Error{constructor(S,y){super(y),this.code=S,Object.setPrototypeOf(this,L.prototype)}}t.ConnectionError=L;var b;(function(m){function S(y){const T=y;return T&&n.func(T.cancelUndispatched)}m.is=S})(b||(t.ConnectionStrategy=b={}));var M;(function(m){function S(y){const T=y;return T&&(T.kind===void 0||T.kind==="id")&&n.func(T.createCancellationTokenSource)&&(T.dispose===void 0||n.func(T.dispose))}m.is=S})(M||(t.IdCancellationReceiverStrategy=M={}));var J;(function(m){function S(y){const T=y;return T&&T.kind==="request"&&n.func(T.createCancellationTokenSource)&&(T.dispose===void 0||n.func(T.dispose))}m.is=S})(J||(t.RequestCancellationReceiverStrategy=J={}));var re;(function(m){m.Message=Object.freeze({createCancellationTokenSource(y){return new a.CancellationTokenSource}});function S(y){return M.is(y)||J.is(y)}m.is=S})(re||(t.CancellationReceiverStrategy=re={}));var ie;(function(m){m.Message=Object.freeze({sendCancellation(y,T){return y.sendNotification(o.type,{id:T})},cleanup(y){}});function S(y){const T=y;return T&&n.func(T.sendCancellation)&&n.func(T.cleanup)}m.is=S})(ie||(t.CancellationSenderStrategy=ie={}));var we;(function(m){m.Message=Object.freeze({receiver:re.Message,sender:ie.Message});function S(y){const T=y;return T&&re.is(T.receiver)&&ie.is(T.sender)}m.is=S})(we||(t.CancellationStrategy=we={}));var _e;(function(m){function S(y){const T=y;return T&&n.func(T.handleMessage)}m.is=S})(_e||(t.MessageStrategy=_e={}));var Ie;(function(m){function S(y){const T=y;return T&&(we.is(T.cancellationStrategy)||b.is(T.connectionStrategy)||_e.is(T.messageStrategy))}m.is=S})(Ie||(t.ConnectionOptions=Ie={}));var k;(function(m){m[m.New=1]="New",m[m.Listening=2]="Listening",m[m.Closed=3]="Closed",m[m.Disposed=4]="Disposed"})(k||(k={}));function E(m,S,y,T){const v=y!==void 0?y:t.NullLogger;let $=0,O=0,P=0;const j="2.0";let q;const se=new Map;let V;const $e=new Map,te=new Map;let Pe,Fe=new i.LinkedMap,fe=new Map,Ge=new Set,Ae=new Map,K=p.Off,xe=C.Text,ce,rt=k.New;const rr=new s.Emitter,pi=new s.Emitter,mi=new s.Emitter,gi=new s.Emitter,yi=new s.Emitter,St=T&&T.cancellationStrategy?T.cancellationStrategy:we.Message;function Ti(f){if(f===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+f.toString()}function Ts(f){return f===null?"res-unknown-"+(++P).toString():"res-"+f.toString()}function Rs(){return"not-"+(++O).toString()}function vs(f,A){r.Message.isRequest(A)?f.set(Ti(A.id),A):r.Message.isResponse(A)?f.set(Ts(A.id),A):f.set(Rs(),A)}function Es(f){}function Ri(){return rt===k.Listening}function vi(){return rt===k.Closed}function qt(){return rt===k.Disposed}function Ei(){(rt===k.New||rt===k.Listening)&&(rt=k.Closed,pi.fire(void 0))}function As(f){rr.fire([f,void 0,void 0])}function Ss(f){rr.fire(f)}m.onClose(Ei),m.onError(As),S.onClose(Ei),S.onError(Ss);function Ai(){Pe||Fe.size===0||(Pe=(0,e.default)().timer.setImmediate(()=>{Pe=void 0,Cs()}))}function Si(f){r.Message.isRequest(f)?ws(f):r.Message.isNotification(f)?bs(f):r.Message.isResponse(f)?Ns(f):_s(f)}function Cs(){if(Fe.size===0)return;const f=Fe.shift();try{const A=T==null?void 0:T.messageStrategy;_e.is(A)?A.handleMessage(f,Si):Si(f)}finally{Ai()}}const ks=f=>{try{if(r.Message.isNotification(f)&&f.method===o.type.method){const A=f.params.id,I=Ti(A),F=Fe.get(I);if(r.Message.isRequest(F)){const ae=T==null?void 0:T.connectionStrategy,le=ae&&ae.cancelUndispatched?ae.cancelUndispatched(F,Es):void 0;if(le&&(le.error!==void 0||le.result!==void 0)){Fe.delete(I),Ae.delete(A),le.id=F.id,Pn(le,f.method,Date.now()),S.write(le).catch(()=>v.error("Sending response for canceled message failed."));return}}const ue=Ae.get(A);if(ue!==void 0){ue.cancel(),ir(f);return}else Ge.add(A)}vs(Fe,f)}finally{Ai()}};function ws(f){if(qt())return;function A(Q,he,ne){const Le={jsonrpc:j,id:f.id};Q instanceof r.ResponseError?Le.error=Q.toJson():Le.result=Q===void 0?null:Q,Pn(Le,he,ne),S.write(Le).catch(()=>v.error("Sending response failed."))}function I(Q,he,ne){const Le={jsonrpc:j,id:f.id,error:Q.toJson()};Pn(Le,he,ne),S.write(Le).catch(()=>v.error("Sending response failed."))}function F(Q,he,ne){Q===void 0&&(Q=null);const Le={jsonrpc:j,id:f.id,result:Q};Pn(Le,he,ne),S.write(Le).catch(()=>v.error("Sending response failed."))}Ps(f);const ue=se.get(f.method);let ae,le;ue&&(ae=ue.type,le=ue.handler);const ke=Date.now();if(le||q){const Q=f.id??String(Date.now()),he=M.is(St.receiver)?St.receiver.createCancellationTokenSource(Q):St.receiver.createCancellationTokenSource(f);f.id!==null&&Ge.has(f.id)&&he.cancel(),f.id!==null&&Ae.set(Q,he);try{let ne;if(le)if(f.params===void 0){if(ae!==void 0&&ae.numberOfParams!==0){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${f.method} defines ${ae.numberOfParams} params but received none.`),f.method,ke);return}ne=le(he.token)}else if(Array.isArray(f.params)){if(ae!==void 0&&ae.parameterStructures===r.ParameterStructures.byName){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${f.method} defines parameters by name but received parameters by position`),f.method,ke);return}ne=le(...f.params,he.token)}else{if(ae!==void 0&&ae.parameterStructures===r.ParameterStructures.byPosition){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${f.method} defines parameters by position but received parameters by name`),f.method,ke);return}ne=le(f.params,he.token)}else q&&(ne=q(f.method,f.params,he.token));const Le=ne;ne?Le.then?Le.then(Je=>{Ae.delete(Q),A(Je,f.method,ke)},Je=>{Ae.delete(Q),Je instanceof r.ResponseError?I(Je,f.method,ke):Je&&n.string(Je.message)?I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${f.method} failed with message: ${Je.message}`),f.method,ke):I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${f.method} failed unexpectedly without providing any details.`),f.method,ke)}):(Ae.delete(Q),A(ne,f.method,ke)):(Ae.delete(Q),F(ne,f.method,ke))}catch(ne){Ae.delete(Q),ne instanceof r.ResponseError?A(ne,f.method,ke):ne&&n.string(ne.message)?I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${f.method} failed with message: ${ne.message}`),f.method,ke):I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${f.method} failed unexpectedly without providing any details.`),f.method,ke)}}else I(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${f.method}`),f.method,ke)}function Ns(f){if(!qt())if(f.id===null)f.error?v.error(`Received response message without id: Error is:
124
- ${JSON.stringify(f.error,void 0,4)}`):v.error("Received response message without id. No further error information provided.");else{const A=f.id,I=fe.get(A);if(Ls(f,I),I!==void 0){fe.delete(A);try{if(f.error){const F=f.error;I.reject(new r.ResponseError(F.code,F.message,F.data))}else if(f.result!==void 0)I.resolve(f.result);else throw new Error("Should never happen.")}catch(F){F.message?v.error(`Response handler '${I.method}' failed with message: ${F.message}`):v.error(`Response handler '${I.method}' failed unexpectedly.`)}}}}function bs(f){if(qt())return;let A,I;if(f.method===o.type.method){const F=f.params.id;Ge.delete(F),ir(f);return}else{const F=$e.get(f.method);F&&(I=F.handler,A=F.type)}if(I||V)try{if(ir(f),I)if(f.params===void 0)A!==void 0&&A.numberOfParams!==0&&A.parameterStructures!==r.ParameterStructures.byName&&v.error(`Notification ${f.method} defines ${A.numberOfParams} params but received none.`),I();else if(Array.isArray(f.params)){const F=f.params;f.method===l.type.method&&F.length===2&&c.is(F[0])?I({token:F[0],value:F[1]}):(A!==void 0&&(A.parameterStructures===r.ParameterStructures.byName&&v.error(`Notification ${f.method} defines parameters by name but received parameters by position`),A.numberOfParams!==f.params.length&&v.error(`Notification ${f.method} defines ${A.numberOfParams} params but received ${F.length} arguments`)),I(...F))}else A!==void 0&&A.parameterStructures===r.ParameterStructures.byPosition&&v.error(`Notification ${f.method} defines parameters by position but received parameters by name`),I(f.params);else V&&V(f.method,f.params)}catch(F){F.message?v.error(`Notification handler '${f.method}' failed with message: ${F.message}`):v.error(`Notification handler '${f.method}' failed unexpectedly.`)}else mi.fire(f)}function _s(f){if(!f){v.error("Received empty message.");return}v.error(`Received message which is neither a response nor a notification message:
125
- ${JSON.stringify(f,null,4)}`);const A=f;if(n.string(A.id)||n.number(A.id)){const I=A.id,F=fe.get(I);F&&F.reject(new Error("The received response has neither a result nor an error property."))}}function Ct(f){if(f!=null)switch(K){case p.Verbose:return JSON.stringify(f,null,4);case p.Compact:return JSON.stringify(f);default:return}}function Is(f){if(!(K===p.Off||!ce))if(xe===C.Text){let A;(K===p.Verbose||K===p.Compact)&&f.params&&(A=`Params: ${Ct(f.params)}
126
-
127
- `),ce.log(`Sending request '${f.method} - (${f.id})'.`,A)}else Wt("send-request",f)}function $s(f){if(!(K===p.Off||!ce))if(xe===C.Text){let A;(K===p.Verbose||K===p.Compact)&&(f.params?A=`Params: ${Ct(f.params)}
128
-
129
- `:A=`No parameters provided.
130
-
131
- `),ce.log(`Sending notification '${f.method}'.`,A)}else Wt("send-notification",f)}function Pn(f,A,I){if(!(K===p.Off||!ce))if(xe===C.Text){let F;(K===p.Verbose||K===p.Compact)&&(f.error&&f.error.data?F=`Error data: ${Ct(f.error.data)}
132
-
133
- `:f.result?F=`Result: ${Ct(f.result)}
134
-
135
- `:f.error===void 0&&(F=`No result returned.
136
-
137
- `)),ce.log(`Sending response '${A} - (${f.id})'. Processing request took ${Date.now()-I}ms`,F)}else Wt("send-response",f)}function Ps(f){if(!(K===p.Off||!ce))if(xe===C.Text){let A;(K===p.Verbose||K===p.Compact)&&f.params&&(A=`Params: ${Ct(f.params)}
138
-
139
- `),ce.log(`Received request '${f.method} - (${f.id})'.`,A)}else Wt("receive-request",f)}function ir(f){if(!(K===p.Off||!ce||f.method===x.type.method))if(xe===C.Text){let A;(K===p.Verbose||K===p.Compact)&&(f.params?A=`Params: ${Ct(f.params)}
140
-
141
- `:A=`No parameters provided.
142
-
143
- `),ce.log(`Received notification '${f.method}'.`,A)}else Wt("receive-notification",f)}function Ls(f,A){if(!(K===p.Off||!ce))if(xe===C.Text){let I;if((K===p.Verbose||K===p.Compact)&&(f.error&&f.error.data?I=`Error data: ${Ct(f.error.data)}
144
-
145
- `:f.result?I=`Result: ${Ct(f.result)}
146
-
147
- `:f.error===void 0&&(I=`No result returned.
148
-
149
- `)),A){const F=f.error?` Request failed: ${f.error.message} (${f.error.code}).`:"";ce.log(`Received response '${A.method} - (${f.id})' in ${Date.now()-A.timerStart}ms.${F}`,I)}else ce.log(`Received response ${f.id} without active response promise.`,I)}else Wt("receive-response",f)}function Wt(f,A){if(!ce||K===p.Off)return;const I={isLSPMessage:!0,type:f,message:A,timestamp:Date.now()};ce.log(I)}function un(){if(vi())throw new L(w.Closed,"Connection is closed.");if(qt())throw new L(w.Disposed,"Connection is disposed.")}function Os(){if(Ri())throw new L(w.AlreadyListening,"Connection is already listening")}function xs(){if(!Ri())throw new Error("Call listen() first.")}function dn(f){return f===void 0?null:f}function Ci(f){if(f!==null)return f}function u(f){return f!=null&&!Array.isArray(f)&&typeof f=="object"}function Se(f,A){switch(f){case r.ParameterStructures.auto:return u(A)?Ci(A):[dn(A)];case r.ParameterStructures.byName:if(!u(A))throw new Error("Received parameters by name but param is not an object literal.");return Ci(A);case r.ParameterStructures.byPosition:return[dn(A)];default:throw new Error(`Unknown parameter structure ${f.toString()}`)}}function Ce(f,A){let I;const F=f.numberOfParams;switch(F){case 0:I=void 0;break;case 1:I=Se(f.parameterStructures,A[0]);break;default:I=[];for(let ue=0;ue<A.length&&ue<F;ue++)I.push(dn(A[ue]));if(A.length<F)for(let ue=A.length;ue<F;ue++)I.push(null);break}return I}const W={sendNotification:(f,...A)=>{un();let I,F;if(n.string(f)){I=f;const ae=A[0];let le=0,ke=r.ParameterStructures.auto;r.ParameterStructures.is(ae)&&(le=1,ke=ae);let Q=A.length;const he=Q-le;switch(he){case 0:F=void 0;break;case 1:F=Se(ke,A[le]);break;default:if(ke===r.ParameterStructures.byName)throw new Error(`Received ${he} parameters for 'by Name' notification parameter structure.`);F=A.slice(le,Q).map(ne=>dn(ne));break}}else{const ae=A;I=f.method,F=Ce(f,ae)}const ue={jsonrpc:j,method:I,params:F};return $s(ue),S.write(ue).catch(ae=>{throw v.error("Sending notification failed."),ae})},onNotification:(f,A)=>{un();let I;return n.func(f)?V=f:A&&(n.string(f)?(I=f,$e.set(f,{type:void 0,handler:A})):(I=f.method,$e.set(f.method,{type:f,handler:A}))),{dispose:()=>{I!==void 0?$e.delete(I):V=void 0}}},onProgress:(f,A,I)=>{if(te.has(A))throw new Error(`Progress handler for token ${A} already registered`);return te.set(A,I),{dispose:()=>{te.delete(A)}}},sendProgress:(f,A,I)=>W.sendNotification(l.type,{token:A,value:I}),onUnhandledProgress:gi.event,sendRequest:(f,...A)=>{un(),xs();let I,F,ue;if(n.string(f)){I=f;const Q=A[0],he=A[A.length-1];let ne=0,Le=r.ParameterStructures.auto;r.ParameterStructures.is(Q)&&(ne=1,Le=Q);let Je=A.length;a.CancellationToken.is(he)&&(Je=Je-1,ue=he);const Ot=Je-ne;switch(Ot){case 0:F=void 0;break;case 1:F=Se(Le,A[ne]);break;default:if(Le===r.ParameterStructures.byName)throw new Error(`Received ${Ot} parameters for 'by Name' request parameter structure.`);F=A.slice(ne,Je).map(em=>dn(em));break}}else{const Q=A;I=f.method,F=Ce(f,Q);const he=f.numberOfParams;ue=a.CancellationToken.is(Q[he])?Q[he]:void 0}const ae=$++;let le;ue&&(le=ue.onCancellationRequested(()=>{const Q=St.sender.sendCancellation(W,ae);return Q===void 0?(v.log(`Received no promise from cancellation strategy when cancelling id ${ae}`),Promise.resolve()):Q.catch(()=>{v.log(`Sending cancellation messages for id ${ae} failed`)})}));const ke={jsonrpc:j,id:ae,method:I,params:F};return Is(ke),typeof St.sender.enableCancellation=="function"&&St.sender.enableCancellation(ke),new Promise(async(Q,he)=>{const ne=Ot=>{Q(Ot),St.sender.cleanup(ae),le==null||le.dispose()},Le=Ot=>{he(Ot),St.sender.cleanup(ae),le==null||le.dispose()},Je={method:I,timerStart:Date.now(),resolve:ne,reject:Le};try{await S.write(ke),fe.set(ae,Je)}catch(Ot){throw v.error("Sending request failed."),Je.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Ot.message?Ot.message:"Unknown reason")),Ot}})},onRequest:(f,A)=>{un();let I=null;return h.is(f)?(I=void 0,q=f):n.string(f)?(I=null,A!==void 0&&(I=f,se.set(f,{handler:A,type:void 0}))):A!==void 0&&(I=f.method,se.set(f.method,{type:f,handler:A})),{dispose:()=>{I!==null&&(I!==void 0?se.delete(I):q=void 0)}}},hasPendingResponse:()=>fe.size>0,trace:async(f,A,I)=>{let F=!1,ue=C.Text;I!==void 0&&(n.boolean(I)?F=I:(F=I.sendNotification||!1,ue=I.traceFormat||C.Text)),K=f,xe=ue,K===p.Off?ce=void 0:ce=A,F&&!vi()&&!qt()&&await W.sendNotification(N.type,{value:p.toString(f)})},onError:rr.event,onClose:pi.event,onUnhandledNotification:mi.event,onDispose:yi.event,end:()=>{S.end()},dispose:()=>{if(qt())return;rt=k.Disposed,yi.fire(void 0);const f=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const A of fe.values())A.reject(f);fe=new Map,Ae=new Map,Ge=new Set,Fe=new i.LinkedMap,n.func(S.dispose)&&S.dispose(),n.func(m.dispose)&&m.dispose()},listen:()=>{un(),Os(),rt=k.Listening,m.listen(ks)},inspect:()=>{(0,e.default)().console.log("inspect")}};return W.onNotification(x.type,f=>{if(K===p.Off||!ce)return;const A=K===p.Verbose||K===p.Compact;ce.log(f.message,A?f.verbose:void 0)}),W.onNotification(l.type,f=>{const A=te.get(f.token);A?A(f.value):gi.fire(f)}),W}t.createMessageConnection=E})(Cp);(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=G;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 n=tn;Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=no;Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=jt;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=kn;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=Qr;Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return a.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return a.SharedArrayReceiverStrategy}});const o=mn;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 c=gn;Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=ro;Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=Cp;Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=ln;t.RAL=h.default})(La);Object.defineProperty(tu,"__esModule",{value:!0});const Gt=La;class io extends Gt.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return io.emptyBuffer}fromString(e,n){return new TextEncoder().encode(e)}toString(e,n){return n==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e:e.slice(0,n)}allocNative(e){return new Uint8Array(e)}}io.emptyBuffer=new Uint8Array(0);class wE{constructor(e){this.socket=e,this._onData=new Gt.Emitter,this._messageListener=n=>{n.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Gt.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Gt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Gt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Gt.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class NE{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Gt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Gt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Gt.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,n){if(typeof e=="string"){if(n!==void 0&&n!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${n}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const bE=new TextEncoder,kp=Object.freeze({messageBuffer:Object.freeze({create:t=>new io(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(bE.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new wE(t),asWritableStream:t=>new NE(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){const r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){const n=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(n)}},setInterval(t,e,...n){const r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function Tl(){return kp}(function(t){function e(){Gt.RAL.install(kp)}t.install=e})(Tl||(Tl={}));tu.default=Tl;(function(t){var e=vt&&vt.__createBinding||(Object.create?function(c,l,d,h){h===void 0&&(h=d);var p=Object.getOwnPropertyDescriptor(l,d);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(c,h,p)}:function(c,l,d,h){h===void 0&&(h=d),c[h]=l[d]}),n=vt&&vt.__exportStar||function(c,l){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(l,d)&&e(l,c,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,tu.default.install();const i=La;n(La,t);class s extends i.AbstractMessageReader{constructor(l){super(),this._onData=new i.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},l.addEventListener("error",d=>this.fireError(d)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}t.BrowserMessageReader=s;class a extends i.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",d=>this.fireError(d))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(d){return this.handleError(d,l),Promise.reject(d)}}handleError(l,d){this.errorCount++,this.fireError(l,d,this.errorCount)}end(){}}t.BrowserMessageWriter=a;function o(c,l,d,h){return d===void 0&&(d=i.NullLogger),i.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,i.createMessageConnection)(c,l,d,h)}t.createMessageConnection=o})(er);var dd=er,wp={};const ru=rm(xR);var Y={};Object.defineProperty(Y,"__esModule",{value:!0});Y.ProtocolNotificationType=Y.ProtocolNotificationType0=Y.ProtocolRequestType=Y.ProtocolRequestType0=Y.RegistrationType=Y.MessageDirection=void 0;const Zr=er;var fd;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(fd||(Y.MessageDirection=fd={}));class _E{constructor(e){this.method=e}}Y.RegistrationType=_E;class IE extends Zr.RequestType0{constructor(e){super(e)}}Y.ProtocolRequestType0=IE;class $E extends Zr.RequestType{constructor(e){super(e,Zr.ParameterStructures.byName)}}Y.ProtocolRequestType=$E;class PE extends Zr.NotificationType0{constructor(e){super(e)}}Y.ProtocolNotificationType0=PE;class LE extends Zr.NotificationType{constructor(e){super(e,Zr.ParameterStructures.byName)}}Y.ProtocolNotificationType=LE;var Np={},Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.objectLiteral=Re.typedArray=Re.stringArray=Re.array=Re.func=Re.error=Re.number=Re.string=Re.boolean=void 0;function OE(t){return t===!0||t===!1}Re.boolean=OE;function bp(t){return typeof t=="string"||t instanceof String}Re.string=bp;function xE(t){return typeof t=="number"||t instanceof Number}Re.number=xE;function DE(t){return t instanceof Error}Re.error=DE;function ME(t){return typeof t=="function"}Re.func=ME;function _p(t){return Array.isArray(t)}Re.array=_p;function FE(t){return _p(t)&&t.every(e=>bp(e))}Re.stringArray=FE;function GE(t,e){return Array.isArray(t)&&t.every(e)}Re.typedArray=GE;function UE(t){return t!==null&&typeof t=="object"}Re.objectLiteral=UE;var so={};Object.defineProperty(so,"__esModule",{value:!0});so.ImplementationRequest=void 0;const hd=Y;var pd;(function(t){t.method="textDocument/implementation",t.messageDirection=hd.MessageDirection.clientToServer,t.type=new hd.ProtocolRequestType(t.method)})(pd||(so.ImplementationRequest=pd={}));var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.TypeDefinitionRequest=void 0;const md=Y;var gd;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=md.MessageDirection.clientToServer,t.type=new md.ProtocolRequestType(t.method)})(gd||(ao.TypeDefinitionRequest=gd={}));var ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.DidChangeWorkspaceFoldersNotification=ei.WorkspaceFoldersRequest=void 0;const Oa=Y;var yd;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Oa.MessageDirection.serverToClient,t.type=new Oa.ProtocolRequestType0(t.method)})(yd||(ei.WorkspaceFoldersRequest=yd={}));var Td;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Oa.MessageDirection.clientToServer,t.type=new Oa.ProtocolNotificationType(t.method)})(Td||(ei.DidChangeWorkspaceFoldersNotification=Td={}));var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.ConfigurationRequest=void 0;const Rd=Y;var vd;(function(t){t.method="workspace/configuration",t.messageDirection=Rd.MessageDirection.serverToClient,t.type=new Rd.ProtocolRequestType(t.method)})(vd||(oo.ConfigurationRequest=vd={}));var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.ColorPresentationRequest=ti.DocumentColorRequest=void 0;const xa=Y;var Ed;(function(t){t.method="textDocument/documentColor",t.messageDirection=xa.MessageDirection.clientToServer,t.type=new xa.ProtocolRequestType(t.method)})(Ed||(ti.DocumentColorRequest=Ed={}));var Ad;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=xa.MessageDirection.clientToServer,t.type=new xa.ProtocolRequestType(t.method)})(Ad||(ti.ColorPresentationRequest=Ad={}));var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.FoldingRangeRefreshRequest=ni.FoldingRangeRequest=void 0;const Da=Y;var Sd;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Da.MessageDirection.clientToServer,t.type=new Da.ProtocolRequestType(t.method)})(Sd||(ni.FoldingRangeRequest=Sd={}));var Cd;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Da.MessageDirection.serverToClient,t.type=new Da.ProtocolRequestType0(t.method)})(Cd||(ni.FoldingRangeRefreshRequest=Cd={}));var co={};Object.defineProperty(co,"__esModule",{value:!0});co.DeclarationRequest=void 0;const kd=Y;var wd;(function(t){t.method="textDocument/declaration",t.messageDirection=kd.MessageDirection.clientToServer,t.type=new kd.ProtocolRequestType(t.method)})(wd||(co.DeclarationRequest=wd={}));var lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.SelectionRangeRequest=void 0;const Nd=Y;var bd;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Nd.MessageDirection.clientToServer,t.type=new Nd.ProtocolRequestType(t.method)})(bd||(lo.SelectionRangeRequest=bd={}));var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.WorkDoneProgressCancelNotification=yn.WorkDoneProgressCreateRequest=yn.WorkDoneProgress=void 0;const jE=er,Ma=Y;var _d;(function(t){t.type=new jE.ProgressType;function e(n){return n===t.type}t.is=e})(_d||(yn.WorkDoneProgress=_d={}));var Id;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Ma.MessageDirection.serverToClient,t.type=new Ma.ProtocolRequestType(t.method)})(Id||(yn.WorkDoneProgressCreateRequest=Id={}));var $d;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Ma.MessageDirection.clientToServer,t.type=new Ma.ProtocolNotificationType(t.method)})($d||(yn.WorkDoneProgressCancelNotification=$d={}));var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.CallHierarchyOutgoingCallsRequest=Tn.CallHierarchyIncomingCallsRequest=Tn.CallHierarchyPrepareRequest=void 0;const ri=Y;var Pd;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolRequestType(t.method)})(Pd||(Tn.CallHierarchyPrepareRequest=Pd={}));var Ld;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolRequestType(t.method)})(Ld||(Tn.CallHierarchyIncomingCallsRequest=Ld={}));var Od;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolRequestType(t.method)})(Od||(Tn.CallHierarchyOutgoingCallsRequest=Od={}));var it={};Object.defineProperty(it,"__esModule",{value:!0});it.SemanticTokensRefreshRequest=it.SemanticTokensRangeRequest=it.SemanticTokensDeltaRequest=it.SemanticTokensRequest=it.SemanticTokensRegistrationType=it.TokenFormat=void 0;const an=Y;var xd;(function(t){t.Relative="relative"})(xd||(it.TokenFormat=xd={}));var ss;(function(t){t.method="textDocument/semanticTokens",t.type=new an.RegistrationType(t.method)})(ss||(it.SemanticTokensRegistrationType=ss={}));var Dd;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=an.MessageDirection.clientToServer,t.type=new an.ProtocolRequestType(t.method),t.registrationMethod=ss.method})(Dd||(it.SemanticTokensRequest=Dd={}));var Md;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=an.MessageDirection.clientToServer,t.type=new an.ProtocolRequestType(t.method),t.registrationMethod=ss.method})(Md||(it.SemanticTokensDeltaRequest=Md={}));var Fd;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=an.MessageDirection.clientToServer,t.type=new an.ProtocolRequestType(t.method),t.registrationMethod=ss.method})(Fd||(it.SemanticTokensRangeRequest=Fd={}));var Gd;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=an.MessageDirection.serverToClient,t.type=new an.ProtocolRequestType0(t.method)})(Gd||(it.SemanticTokensRefreshRequest=Gd={}));var uo={};Object.defineProperty(uo,"__esModule",{value:!0});uo.ShowDocumentRequest=void 0;const Ud=Y;var jd;(function(t){t.method="window/showDocument",t.messageDirection=Ud.MessageDirection.serverToClient,t.type=new Ud.ProtocolRequestType(t.method)})(jd||(uo.ShowDocumentRequest=jd={}));var fo={};Object.defineProperty(fo,"__esModule",{value:!0});fo.LinkedEditingRangeRequest=void 0;const zd=Y;var Bd;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=zd.MessageDirection.clientToServer,t.type=new zd.ProtocolRequestType(t.method)})(Bd||(fo.LinkedEditingRangeRequest=Bd={}));var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.WillDeleteFilesRequest=Ke.DidDeleteFilesNotification=Ke.DidRenameFilesNotification=Ke.WillRenameFilesRequest=Ke.DidCreateFilesNotification=Ke.WillCreateFilesRequest=Ke.FileOperationPatternKind=void 0;const At=Y;var qd;(function(t){t.file="file",t.folder="folder"})(qd||(Ke.FileOperationPatternKind=qd={}));var Wd;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolRequestType(t.method)})(Wd||(Ke.WillCreateFilesRequest=Wd={}));var Vd;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method)})(Vd||(Ke.DidCreateFilesNotification=Vd={}));var Kd;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolRequestType(t.method)})(Kd||(Ke.WillRenameFilesRequest=Kd={}));var Hd;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method)})(Hd||(Ke.DidRenameFilesNotification=Hd={}));var Yd;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method)})(Yd||(Ke.DidDeleteFilesNotification=Yd={}));var Xd;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolRequestType(t.method)})(Xd||(Ke.WillDeleteFilesRequest=Xd={}));var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.MonikerRequest=Rn.MonikerKind=Rn.UniquenessLevel=void 0;const Jd=Y;var Qd;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Qd||(Rn.UniquenessLevel=Qd={}));var Zd;(function(t){t.$import="import",t.$export="export",t.local="local"})(Zd||(Rn.MonikerKind=Zd={}));var ef;(function(t){t.method="textDocument/moniker",t.messageDirection=Jd.MessageDirection.clientToServer,t.type=new Jd.ProtocolRequestType(t.method)})(ef||(Rn.MonikerRequest=ef={}));var vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.TypeHierarchySubtypesRequest=vn.TypeHierarchySupertypesRequest=vn.TypeHierarchyPrepareRequest=void 0;const ii=Y;var tf;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=ii.MessageDirection.clientToServer,t.type=new ii.ProtocolRequestType(t.method)})(tf||(vn.TypeHierarchyPrepareRequest=tf={}));var nf;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=ii.MessageDirection.clientToServer,t.type=new ii.ProtocolRequestType(t.method)})(nf||(vn.TypeHierarchySupertypesRequest=nf={}));var rf;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=ii.MessageDirection.clientToServer,t.type=new ii.ProtocolRequestType(t.method)})(rf||(vn.TypeHierarchySubtypesRequest=rf={}));var si={};Object.defineProperty(si,"__esModule",{value:!0});si.InlineValueRefreshRequest=si.InlineValueRequest=void 0;const Fa=Y;var sf;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Fa.MessageDirection.clientToServer,t.type=new Fa.ProtocolRequestType(t.method)})(sf||(si.InlineValueRequest=sf={}));var af;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Fa.MessageDirection.serverToClient,t.type=new Fa.ProtocolRequestType0(t.method)})(af||(si.InlineValueRefreshRequest=af={}));var En={};Object.defineProperty(En,"__esModule",{value:!0});En.InlayHintRefreshRequest=En.InlayHintResolveRequest=En.InlayHintRequest=void 0;const ai=Y;var of;(function(t){t.method="textDocument/inlayHint",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method)})(of||(En.InlayHintRequest=of={}));var cf;(function(t){t.method="inlayHint/resolve",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method)})(cf||(En.InlayHintResolveRequest=cf={}));var lf;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=ai.MessageDirection.serverToClient,t.type=new ai.ProtocolRequestType0(t.method)})(lf||(En.InlayHintRefreshRequest=lf={}));var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.DiagnosticRefreshRequest=Rt.WorkspaceDiagnosticRequest=Rt.DocumentDiagnosticRequest=Rt.DocumentDiagnosticReportKind=Rt.DiagnosticServerCancellationData=void 0;const Ip=er,zE=Re,oi=Y;var uf;(function(t){function e(n){const r=n;return r&&zE.boolean(r.retriggerRequest)}t.is=e})(uf||(Rt.DiagnosticServerCancellationData=uf={}));var df;(function(t){t.Full="full",t.Unchanged="unchanged"})(df||(Rt.DocumentDiagnosticReportKind=df={}));var ff;(function(t){t.method="textDocument/diagnostic",t.messageDirection=oi.MessageDirection.clientToServer,t.type=new oi.ProtocolRequestType(t.method),t.partialResult=new Ip.ProgressType})(ff||(Rt.DocumentDiagnosticRequest=ff={}));var hf;(function(t){t.method="workspace/diagnostic",t.messageDirection=oi.MessageDirection.clientToServer,t.type=new oi.ProtocolRequestType(t.method),t.partialResult=new Ip.ProgressType})(hf||(Rt.WorkspaceDiagnosticRequest=hf={}));var pf;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=oi.MessageDirection.serverToClient,t.type=new oi.ProtocolRequestType0(t.method)})(pf||(Rt.DiagnosticRefreshRequest=pf={}));var Te={};Object.defineProperty(Te,"__esModule",{value:!0});Te.DidCloseNotebookDocumentNotification=Te.DidSaveNotebookDocumentNotification=Te.DidChangeNotebookDocumentNotification=Te.NotebookCellArrayChange=Te.DidOpenNotebookDocumentNotification=Te.NotebookDocumentSyncRegistrationType=Te.NotebookDocument=Te.NotebookCell=Te.ExecutionSummary=Te.NotebookCellKind=void 0;const as=ru,bt=Re,zt=Y;var Rl;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Rl||(Te.NotebookCellKind=Rl={}));var vl;(function(t){function e(i,s){const a={executionOrder:i};return(s===!0||s===!1)&&(a.success=s),a}t.create=e;function n(i){const s=i;return bt.objectLiteral(s)&&as.uinteger.is(s.executionOrder)&&(s.success===void 0||bt.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(vl||(Te.ExecutionSummary=vl={}));var Ga;(function(t){function e(s,a){return{kind:s,document:a}}t.create=e;function n(s){const a=s;return bt.objectLiteral(a)&&Rl.is(a.kind)&&as.DocumentUri.is(a.document)&&(a.metadata===void 0||bt.objectLiteral(a.metadata))}t.is=n;function r(s,a){const o=new Set;return s.document!==a.document&&o.add("document"),s.kind!==a.kind&&o.add("kind"),s.executionSummary!==a.executionSummary&&o.add("executionSummary"),(s.metadata!==void 0||a.metadata!==void 0)&&!i(s.metadata,a.metadata)&&o.add("metadata"),(s.executionSummary!==void 0||a.executionSummary!==void 0)&&!vl.equals(s.executionSummary,a.executionSummary)&&o.add("executionSummary"),o}t.diff=r;function i(s,a){if(s===a)return!0;if(s==null||a===null||a===void 0||typeof s!=typeof a||typeof s!="object")return!1;const o=Array.isArray(s),c=Array.isArray(a);if(o!==c)return!1;if(o&&c){if(s.length!==a.length)return!1;for(let l=0;l<s.length;l++)if(!i(s[l],a[l]))return!1}if(bt.objectLiteral(s)&&bt.objectLiteral(a)){const l=Object.keys(s),d=Object.keys(a);if(l.length!==d.length||(l.sort(),d.sort(),!i(l,d)))return!1;for(let h=0;h<l.length;h++){const p=l[h];if(!i(s[p],a[p]))return!1}}return!0}})(Ga||(Te.NotebookCell=Ga={}));var mf;(function(t){function e(r,i,s,a){return{uri:r,notebookType:i,version:s,cells:a}}t.create=e;function n(r){const i=r;return bt.objectLiteral(i)&&bt.string(i.uri)&&as.integer.is(i.version)&&bt.typedArray(i.cells,Ga.is)}t.is=n})(mf||(Te.NotebookDocument=mf={}));var ci;(function(t){t.method="notebookDocument/sync",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.RegistrationType(t.method)})(ci||(Te.NotebookDocumentSyncRegistrationType=ci={}));var gf;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolNotificationType(t.method),t.registrationMethod=ci.method})(gf||(Te.DidOpenNotebookDocumentNotification=gf={}));var yf;(function(t){function e(r){const i=r;return bt.objectLiteral(i)&&as.uinteger.is(i.start)&&as.uinteger.is(i.deleteCount)&&(i.cells===void 0||bt.typedArray(i.cells,Ga.is))}t.is=e;function n(r,i,s){const a={start:r,deleteCount:i};return s!==void 0&&(a.cells=s),a}t.create=n})(yf||(Te.NotebookCellArrayChange=yf={}));var Tf;(function(t){t.method="notebookDocument/didChange",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolNotificationType(t.method),t.registrationMethod=ci.method})(Tf||(Te.DidChangeNotebookDocumentNotification=Tf={}));var Rf;(function(t){t.method="notebookDocument/didSave",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolNotificationType(t.method),t.registrationMethod=ci.method})(Rf||(Te.DidSaveNotebookDocumentNotification=Rf={}));var vf;(function(t){t.method="notebookDocument/didClose",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolNotificationType(t.method),t.registrationMethod=ci.method})(vf||(Te.DidCloseNotebookDocumentNotification=vf={}));var ho={};Object.defineProperty(ho,"__esModule",{value:!0});ho.InlineCompletionRequest=void 0;const Ef=Y;var Af;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Ef.MessageDirection.clientToServer,t.type=new Ef.ProtocolRequestType(t.method)})(Af||(ho.InlineCompletionRequest=Af={}));(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=Y,n=ru,r=Re,i=so;Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=ao;Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=ei;Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const o=oo;Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const c=ti;Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const l=ni;Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});const d=co;Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return d.DeclarationRequest}});const h=lo;Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const p=yn;Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return p.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return p.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return p.WorkDoneProgressCancelNotification}});const g=Tn;Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return g.CallHierarchyPrepareRequest}});const C=it;Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return C.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return C.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return C.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return C.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return C.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return C.SemanticTokensRegistrationType}});const N=uo;Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return N.ShowDocumentRequest}});const x=fo;Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return x.LinkedEditingRangeRequest}});const w=Ke;Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return w.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return w.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return w.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return w.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return w.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return w.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return w.WillDeleteFilesRequest}});const L=Rn;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return L.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return L.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return L.MonikerRequest}});const b=vn;Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});const M=si;Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return M.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return M.InlineValueRefreshRequest}});const J=En;Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return J.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return J.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return J.InlayHintRefreshRequest}});const re=Rt;Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return re.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return re.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return re.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return re.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return re.DiagnosticRefreshRequest}});const ie=Te;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return ie.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return ie.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return ie.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return ie.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ie.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ie.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidCloseNotebookDocumentNotification}});const we=ho;Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return we.InlineCompletionRequest}});var _e;(function(u){function Se(Ce){const W=Ce;return r.string(W)||r.string(W.language)||r.string(W.scheme)||r.string(W.pattern)}u.is=Se})(_e||(t.TextDocumentFilter=_e={}));var Ie;(function(u){function Se(Ce){const W=Ce;return r.objectLiteral(W)&&(r.string(W.notebookType)||r.string(W.scheme)||r.string(W.pattern))}u.is=Se})(Ie||(t.NotebookDocumentFilter=Ie={}));var k;(function(u){function Se(Ce){const W=Ce;return r.objectLiteral(W)&&(r.string(W.notebook)||Ie.is(W.notebook))&&(W.language===void 0||r.string(W.language))}u.is=Se})(k||(t.NotebookCellTextDocumentFilter=k={}));var E;(function(u){function Se(Ce){if(!Array.isArray(Ce))return!1;for(let W of Ce)if(!r.string(W)&&!_e.is(W)&&!k.is(W))return!1;return!0}u.is=Se})(E||(t.DocumentSelector=E={}));var m;(function(u){u.method="client/registerCapability",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})(m||(t.RegistrationRequest=m={}));var S;(function(u){u.method="client/unregisterCapability",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})(S||(t.UnregistrationRequest=S={}));var y;(function(u){u.Create="create",u.Rename="rename",u.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var T;(function(u){u.Abort="abort",u.Transactional="transactional",u.TextOnlyTransactional="textOnlyTransactional",u.Undo="undo"})(T||(t.FailureHandlingKind=T={}));var v;(function(u){u.UTF8="utf-8",u.UTF16="utf-16",u.UTF32="utf-32"})(v||(t.PositionEncodingKind=v={}));var $;(function(u){function Se(Ce){const W=Ce;return W&&r.string(W.id)&&W.id.length>0}u.hasId=Se})($||(t.StaticRegistrationOptions=$={}));var O;(function(u){function Se(Ce){const W=Ce;return W&&(W.documentSelector===null||E.is(W.documentSelector))}u.is=Se})(O||(t.TextDocumentRegistrationOptions=O={}));var P;(function(u){function Se(W){const f=W;return r.objectLiteral(f)&&(f.workDoneProgress===void 0||r.boolean(f.workDoneProgress))}u.is=Se;function Ce(W){const f=W;return f&&r.boolean(f.workDoneProgress)}u.hasWorkDoneProgress=Ce})(P||(t.WorkDoneProgressOptions=P={}));var j;(function(u){u.method="initialize",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(j||(t.InitializeRequest=j={}));var q;(function(u){u.unknownProtocolVersion=1})(q||(t.InitializeErrorCodes=q={}));var se;(function(u){u.method="initialized",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(se||(t.InitializedNotification=se={}));var V;(function(u){u.method="shutdown",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType0(u.method)})(V||(t.ShutdownRequest=V={}));var $e;(function(u){u.method="exit",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType0(u.method)})($e||(t.ExitNotification=$e={}));var te;(function(u){u.method="workspace/didChangeConfiguration",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(te||(t.DidChangeConfigurationNotification=te={}));var Pe;(function(u){u.Error=1,u.Warning=2,u.Info=3,u.Log=4,u.Debug=5})(Pe||(t.MessageType=Pe={}));var Fe;(function(u){u.method="window/showMessage",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(Fe||(t.ShowMessageNotification=Fe={}));var fe;(function(u){u.method="window/showMessageRequest",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})(fe||(t.ShowMessageRequest=fe={}));var Ge;(function(u){u.method="window/logMessage",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(Ge||(t.LogMessageNotification=Ge={}));var Ae;(function(u){u.method="telemetry/event",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(Ae||(t.TelemetryEventNotification=Ae={}));var K;(function(u){u.None=0,u.Full=1,u.Incremental=2})(K||(t.TextDocumentSyncKind=K={}));var xe;(function(u){u.method="textDocument/didOpen",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(xe||(t.DidOpenTextDocumentNotification=xe={}));var ce;(function(u){function Se(W){let f=W;return f!=null&&typeof f.text=="string"&&f.range!==void 0&&(f.rangeLength===void 0||typeof f.rangeLength=="number")}u.isIncremental=Se;function Ce(W){let f=W;return f!=null&&typeof f.text=="string"&&f.range===void 0&&f.rangeLength===void 0}u.isFull=Ce})(ce||(t.TextDocumentContentChangeEvent=ce={}));var rt;(function(u){u.method="textDocument/didChange",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(rt||(t.DidChangeTextDocumentNotification=rt={}));var rr;(function(u){u.method="textDocument/didClose",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(rr||(t.DidCloseTextDocumentNotification=rr={}));var pi;(function(u){u.method="textDocument/didSave",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(pi||(t.DidSaveTextDocumentNotification=pi={}));var mi;(function(u){u.Manual=1,u.AfterDelay=2,u.FocusOut=3})(mi||(t.TextDocumentSaveReason=mi={}));var gi;(function(u){u.method="textDocument/willSave",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(gi||(t.WillSaveTextDocumentNotification=gi={}));var yi;(function(u){u.method="textDocument/willSaveWaitUntil",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(yi||(t.WillSaveTextDocumentWaitUntilRequest=yi={}));var St;(function(u){u.method="workspace/didChangeWatchedFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(St||(t.DidChangeWatchedFilesNotification=St={}));var Ti;(function(u){u.Created=1,u.Changed=2,u.Deleted=3})(Ti||(t.FileChangeType=Ti={}));var Ts;(function(u){function Se(Ce){const W=Ce;return r.objectLiteral(W)&&(n.URI.is(W.baseUri)||n.WorkspaceFolder.is(W.baseUri))&&r.string(W.pattern)}u.is=Se})(Ts||(t.RelativePattern=Ts={}));var Rs;(function(u){u.Create=1,u.Change=2,u.Delete=4})(Rs||(t.WatchKind=Rs={}));var vs;(function(u){u.method="textDocument/publishDiagnostics",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(vs||(t.PublishDiagnosticsNotification=vs={}));var Es;(function(u){u.Invoked=1,u.TriggerCharacter=2,u.TriggerForIncompleteCompletions=3})(Es||(t.CompletionTriggerKind=Es={}));var Ri;(function(u){u.method="textDocument/completion",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ri||(t.CompletionRequest=Ri={}));var vi;(function(u){u.method="completionItem/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(vi||(t.CompletionResolveRequest=vi={}));var qt;(function(u){u.method="textDocument/hover",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(qt||(t.HoverRequest=qt={}));var Ei;(function(u){u.Invoked=1,u.TriggerCharacter=2,u.ContentChange=3})(Ei||(t.SignatureHelpTriggerKind=Ei={}));var As;(function(u){u.method="textDocument/signatureHelp",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(As||(t.SignatureHelpRequest=As={}));var Ss;(function(u){u.method="textDocument/definition",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ss||(t.DefinitionRequest=Ss={}));var Ai;(function(u){u.method="textDocument/references",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ai||(t.ReferencesRequest=Ai={}));var Si;(function(u){u.method="textDocument/documentHighlight",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Si||(t.DocumentHighlightRequest=Si={}));var Cs;(function(u){u.method="textDocument/documentSymbol",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Cs||(t.DocumentSymbolRequest=Cs={}));var ks;(function(u){u.method="textDocument/codeAction",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ks||(t.CodeActionRequest=ks={}));var ws;(function(u){u.method="codeAction/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ws||(t.CodeActionResolveRequest=ws={}));var Ns;(function(u){u.method="workspace/symbol",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ns||(t.WorkspaceSymbolRequest=Ns={}));var bs;(function(u){u.method="workspaceSymbol/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(bs||(t.WorkspaceSymbolResolveRequest=bs={}));var _s;(function(u){u.method="textDocument/codeLens",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(_s||(t.CodeLensRequest=_s={}));var Ct;(function(u){u.method="codeLens/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ct||(t.CodeLensResolveRequest=Ct={}));var Is;(function(u){u.method="workspace/codeLens/refresh",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType0(u.method)})(Is||(t.CodeLensRefreshRequest=Is={}));var $s;(function(u){u.method="textDocument/documentLink",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})($s||(t.DocumentLinkRequest=$s={}));var Pn;(function(u){u.method="documentLink/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Pn||(t.DocumentLinkResolveRequest=Pn={}));var Ps;(function(u){u.method="textDocument/formatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ps||(t.DocumentFormattingRequest=Ps={}));var ir;(function(u){u.method="textDocument/rangeFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ir||(t.DocumentRangeFormattingRequest=ir={}));var Ls;(function(u){u.method="textDocument/rangesFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ls||(t.DocumentRangesFormattingRequest=Ls={}));var Wt;(function(u){u.method="textDocument/onTypeFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Wt||(t.DocumentOnTypeFormattingRequest=Wt={}));var un;(function(u){u.Identifier=1})(un||(t.PrepareSupportDefaultBehavior=un={}));var Os;(function(u){u.method="textDocument/rename",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Os||(t.RenameRequest=Os={}));var xs;(function(u){u.method="textDocument/prepareRename",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(xs||(t.PrepareRenameRequest=xs={}));var dn;(function(u){u.method="workspace/executeCommand",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(dn||(t.ExecuteCommandRequest=dn={}));var Ci;(function(u){u.method="workspace/applyEdit",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType("workspace/applyEdit")})(Ci||(t.ApplyWorkspaceEditRequest=Ci={}))})(Np);var po={};Object.defineProperty(po,"__esModule",{value:!0});po.createProtocolConnection=void 0;const Sf=er;function BE(t,e,n,r){return Sf.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Sf.createMessageConnection)(t,e,n,r)}po.createProtocolConnection=BE;(function(t){var e=vt&&vt.__createBinding||(Object.create?function(s,a,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,c,l)}:function(s,a,o,c){c===void 0&&(c=o),s[c]=a[o]}),n=vt&&vt.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(er,t),n(ru,t),n(Y,t),n(Np,t);var r=po;Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))})(wp);(function(t){var e=vt&&vt.__createBinding||(Object.create?function(s,a,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,c,l)}:function(s,a,o,c){c===void 0&&(c=o),s[c]=a[o]}),n=vt&&vt.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=dd;n(dd,t),n(wp,t);function i(s,a,o,c){return(0,r.createMessageConnection)(s,a,o,c)}t.createProtocolConnection=i})(zi);var Wi;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(Wi||(Wi={}));class qE{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new rs,this.documentPhaseListeners=new rs,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=H.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,n={},r=ge.None){var i;for(const s of e){const a=s.uri.toString();if(s.state===H.Validated){if(typeof n.validation=="boolean"&&n.validation)this.resetToState(s,H.IndexedReferences);else if(typeof n.validation=="object"){const o=this.findMissingValidationCategories(s,n);o.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(a))==null?void 0:i.result}),s.state=H.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=H.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=ge.None){this.currentState=H.Changed;const i=[];for(const c of n){const l=this.langiumDocuments.deleteDocuments(c);for(const d of l)i.push(d.uri),this.cleanUpDeleted(d)}const s=(await Promise.all(e.map(c=>this.findChangedUris(c)))).flat();for(const c of s){let l=this.langiumDocuments.getDocument(c);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},c),l.state=H.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,H.Changed)}const a=pe(s).concat(i).map(c=>c.toString()).toSet();this.langiumDocuments.all.filter(c=>!a.has(c.uri.toString())&&this.shouldRelink(c,a)).forEach(c=>this.resetToState(c,H.ComputedScopes)),await this.emitUpdate(s,i),await Qe(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(c=>{var l;return c.state<H.Validated||!((l=this.buildState.get(c.uri.toString()))!=null&&l.completed)||this.resultsAreIncomplete(c,this.updateBuildOptions)}).toArray());await this.buildDocuments(o,this.updateBuildOptions,r)}resultsAreIncomplete(e,n){return this.findMissingValidationCategories(e,n).length>=1}findMissingValidationCategories(e,n){var o,c;const r=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),s=(o=r==null?void 0:r.result)!=null&&o.validationChecks?new Set((c=r==null?void 0:r.result)==null?void 0:c.validationChecks):r!=null&&r.completed?i:new Set,a=n===void 0||n.validation===!0?i:typeof n.validation=="object"?n.validation.categories??i:[];return pe(a).filter(l=>!s.has(l)).toArray()}async findChangedUris(e){var r;if(this.langiumDocuments.getDocument(e)??((r=this.textDocuments)==null?void 0:r.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,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return!!((n=this.textDocuments)!=null&&n.get(e.uri))}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),Wi.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}resetToState(e,n){switch(n){case H.Changed:case H.Parsed:this.indexManager.removeContent(e.uri);case H.IndexedContent:e.localSymbols=void 0;case H.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case H.Linked:this.indexManager.removeReferences(e.uri);case H.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case H.Validated:}e.state>n&&(e.state=n)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=H.Changed}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,H.Parsed,r,a=>this.langiumDocumentFactory.update(a,r)),await this.runCancelable(e,H.IndexedContent,r,a=>this.indexManager.updateContent(a,r)),await this.runCancelable(e,H.ComputedScopes,r,async a=>{const o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,r)});const i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,H.Linked,r,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,r)),await this.runCancelable(i,H.IndexedReferences,r,a=>this.indexManager.updateReferences(a,r));const s=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(s,H.Validated,r,async a=>{await this.validate(a,r),this.markAsCompleted(a)})}markAsCompleted(e){const n=this.buildState.get(e.uri.toString());n&&(n.completed=!0)}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s==null?void 0:s.result})}}async runCancelable(e,n,r,i){for(const a of e)a.state<n&&(await Qe(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r));const s=e.filter(a=>a.state===n);await this.notifyBuildPhase(s,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),Wi.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),Wi.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;return n&&"path"in n?i=n:r=n,r??(r=ge.None),i?this.awaitDocumentState(e,i,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,n,r){const i=this.langiumDocuments.getDocument(n);if(i){if(i.state>=e)return Promise.resolve(n);if(r.isCancellationRequested)return Promise.reject(wr);if(this.currentState>=e&&e>i.state)return Promise.reject(new zi.ResponseError(zi.LSPErrorCodes.RequestFailed,`Document state of ${n.toString()} is ${H[i.state]}, requiring ${H[e]}, but workspace state is already ${H[this.currentState]}. Returning undefined.`))}else return Promise.reject(new zi.ResponseError(zi.LSPErrorCodes.ServerCancelled,`No document found for URI: ${n.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,l=>{ft.equals(l.uri,n)&&(o.dispose(),c.dispose(),s(l.uri))}),c=r.onCancellationRequested(()=>{o.dispose(),c.dispose(),a(wr)})})}awaitBuilderState(e,n){return this.currentState>=e?Promise.resolve():n.isCancellationRequested?Promise.reject(wr):new Promise((r,i)=>{const s=this.onBuildPhase(e,()=>{s.dispose(),a.dispose(),r()}),a=n.onCancellationRequested(()=>{s.dispose(),a.dispose(),i(wr)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const a of s)try{await Qe(r),await a(e,r)}catch(o){if(!to(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const a of s)await Qe(r),await a(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),s=typeof i.validation=="object"?{...i.validation}:{};s.categories=this.findMissingValidationCategories(e,i);const a=await r.validateDocument(e,s,n);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=pe(o.result.validationChecks).concat(s.categories).distinct().toArray():o.result.validationChecks=[...s.categories])}getBuildOptions(e){var n;return((n=this.buildState.get(e.uri.toString()))==null?void 0:n.options)??{}}}class WE{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new wv,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=Qt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{ft.equals(a.targetUri,r)&&a.targetPath===n&&i.push(a)})}),pe(i)}allElements(e,n){let r=pe(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){return n?this.symbolByTypeIndex.get(e,n,()=>(this.symbolIndex.get(e)??[]).filter(s=>this.astReflection.isSubtype(s.type,n))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n)}removeReferences(e){const n=e.toString();this.referenceIndex.delete(n)}async updateContent(e,n=ge.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=ge.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class VE{constructor(e){this.initialBuildOptions={},this._ready=new eu,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(n=>this.initializeWorkspace(this.folders??[],n))}async initializeWorkspace(e,n=ge.None){const r=await this.performStartup(e);await Qe(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=[],r=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};await this.loadAdditionalDocuments(e,r);const i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));const s=pe(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(s,r),this._ready.resolve(),n}async loadWorkspaceDocuments(e,n){await Promise.all(e.map(async r=>{const i=await this.langiumDocuments.getOrCreateDocument(r);n(i)}))}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return It.parse(e.uri)}async traverseFolder(e,n){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,n):i.isFile&&n.push(i.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const n=[];return await this.traverseFolder(e,n),n}shouldIncludeEntry(e){const n=ft.basename(e.uri);return n.startsWith(".")?!1:e.isDirectory?n!=="node_modules"&&n!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class KE{buildUnexpectedCharactersMessage(e,n,r,i,s){return Jo.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return Jo.buildUnableToPopLexerModeMessage(e)}}const HE={mode:"full"};class YE{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=Cf(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new st(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=HE){var i,s;const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:(s=(i=this.tokenBuilder).flushLexingReport)==null?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(Cf(e))return e;const n=$p(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function XE(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function $p(t){return t&&"modes"in t&&"defaultMode"in t}function Cf(t){return!XE(t)&&!$p(t)}function JE(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=ee.create(0,0));const s=Pp(t),a=iu(r),o=eA({lines:s,position:i,options:a});return sA({index:0,tokens:o,position:i})}function QE(t,e){const n=iu(e),r=Pp(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=n.start,o=n.end;return!!(a!=null&&a.exec(i))&&!!(o!=null&&o.exec(s))}function Pp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Rg)}const kf=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,ZE=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function eA(t){var i,s,a;const e=[];let n=t.position.line,r=t.position.character;for(let o=0;o<t.lines.length;o++){const c=o===0,l=o===t.lines.length-1;let d=t.lines[o],h=0;if(c&&t.options.start){const g=(i=t.options.start)==null?void 0:i.exec(d);g&&(h=g.index+g[0].length)}else{const g=(s=t.options.line)==null?void 0:s.exec(d);g&&(h=g.index+g[0].length)}if(l){const g=(a=t.options.end)==null?void 0:a.exec(d);g&&(d=d.substring(0,g.index))}if(d=d.substring(0,iA(d)),El(d,h)>=d.length){if(e.length>0){const g=ee.create(n,r);e.push({type:"break",content:"",range:X.create(g,g)})}}else{kf.lastIndex=h;const g=kf.exec(d);if(g){const C=g[0],N=g[1],x=ee.create(n,r+h),w=ee.create(n,r+h+C.length);e.push({type:"tag",content:N,range:X.create(x,w)}),h+=C.length,h=El(d,h)}if(h<d.length){const C=d.substring(h),N=Array.from(C.matchAll(ZE));e.push(...tA(N,C,n,r+h))}}n++,r=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function tA(t,e,n,r){const i=[];if(t.length===0){const s=ee.create(n,r),a=ee.create(n,r+e.length);i.push({type:"text",content:e,range:X.create(s,a)})}else{let s=0;for(const o of t){const c=o.index,l=e.substring(s,c);l.length>0&&i.push({type:"text",content:e.substring(s,c),range:X.create(ee.create(n,s+r),ee.create(n,c+r))});let d=l.length+1;const h=o[1];if(i.push({type:"inline-tag",content:h,range:X.create(ee.create(n,s+d+r),ee.create(n,s+d+h.length+r))}),d+=h.length,o.length===4){d+=o[2].length;const p=o[3];i.push({type:"text",content:p,range:X.create(ee.create(n,s+d+r),ee.create(n,s+d+p.length+r))})}else i.push({type:"text",content:"",range:X.create(ee.create(n,s+d+r),ee.create(n,s+d+r))});s=c+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:X.create(ee.create(n,s+r),ee.create(n,s+r+a.length))})}return i}const nA=/\S/,rA=/\s*$/;function El(t,e){const n=t.substring(e).match(nA);return n?e+n.index:t.length}function iA(t){const e=t.match(rA);if(e&&typeof e.index=="number")return e.index}function sA(t){var s,a;const e=ee.create(t.position.line,t.position.character);if(t.tokens.length===0)return new wf([],X.create(e,e));const n=[];for(;t.index<t.tokens.length;){const o=aA(t,n[n.length-1]);o&&n.push(o)}const r=((s=n[0])==null?void 0:s.range.start)??e,i=((a=n[n.length-1])==null?void 0:a.range.end)??e;return new wf(n,X.create(r,i))}function aA(t,e){const n=t.tokens[t.index];if(n.type==="tag")return Op(t,!1);if(n.type==="text"||n.type==="inline-tag")return Lp(t);oA(n,e),t.index++}function oA(t,e){if(e){const n=new Dp("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function Lp(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(cA(t)),r=e,e=t.tokens[t.index];return new Al(i,X.create(n.range.start,r.range.end))}function cA(t){return t.tokens[t.index].type==="inline-tag"?Op(t,!0):xp(t)}function Op(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const s=xp(t);return new $o(r,new Al([s],s.range),e,X.create(n.range.start,s.range.end))}else{const s=Lp(t);return new $o(r,s,e,X.create(n.range.start,s.range.end))}else{const s=n.range;return new $o(r,new Al([],s),e,s)}}function xp(t){const e=t.tokens[t.index++];return new Dp(e.content,e.range)}function iu(t){if(!t)return iu({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:Io(e,!0),end:Io(n,!1),line:Io(r,!0)}}function Io(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?Va(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class wf{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=Nf(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=Nf(n)+i}return n.trim()}}class $o{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
150
- ${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n;return((n=e==null?void 0:e.renderTag)==null?void 0:n.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=lA(this.name,n,e??{});if(typeof s=="string")return s}let r="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?r="*":(e==null?void 0:e.tag)==="bold"?r="**":(e==null?void 0:e.tag)==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} — ${n}`:this.content.inlines.length>1&&(i=`${i}
151
- ${n}`),this.inline?`{${i}}`:i}}function lA(t,e,n){var r;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let s=e;if(i>0){const o=El(e,i);s=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(s=`\`${s}\``),((r=n.renderLink)==null?void 0:r.call(n,e,s))??uA(e,s)}}function uA(t,e){try{return It.parse(t,!0),`[${e}](${t})`}catch{return t}}class Al{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
152
- `)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
153
- `)}return n}}class Dp{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function Nf(t){return t.endsWith(`
154
- `)?`
155
- `:`
156
-
157
- `}class dA{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&QE(n))return JE(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){const i=this.findNameInLocalSymbols(e,n)??this.findNameInGlobalScope(e,n);if(i&&i.nameSegment){const s=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${s},${a}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,n){}findNameInLocalSymbols(e,n){const i=Qt(e).localSymbols;if(!i)return;let s=e;do{const o=i.getStream(s).find(c=>c.name===n);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class fA{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return _v(e)?e.$comment:(n=pg(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:n.text}}class hA{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class pA{constructor(){this.previousTokenSource=new Zl,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=pv();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=ge.None){const i=new eu,s={action:n,deferred:i,cancellationToken:r};return e.push(s),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:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){to(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class mA{constructor(e){this.grammarElementIdMap=new ed,this.tokenTypeIdMap=new ed,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>({...n,message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of Zt(e))n.set(i,{});if(e.$cstNode)for(const i of Vo(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)He(o)?a.push(this.dehydrateAstNode(o,n)):Nt(o)?a.push(this.dehydrateReference(o,n)):a.push(o)}else He(s)?r[i]=this.dehydrateAstNode(s,n):Nt(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return Yf(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Ki(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):Hf(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of Zt(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Vo(e.$cstNode)){let a;"fullText"in s?(a=new ip(s.fullText),i=a):"content"in s?a=new Xl:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)He(o)?a.push(this.setParent(this.hydrateAstNode(o,n),r)):Nt(o)?a.push(this.hydrateReference(o,r,i,n)):a.push(o)}else He(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):Nt(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),Ki(i))for(const s of e.content){const a=this.hydrateCstNode(s,n,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,c=e.endColumn,l=e.hidden;return new sl(r,i,{start:{line:s,character:a},end:{line:o,character:c}},n,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const n of Zt(this.grammar))Wm(n)&&this.grammarElementIdMap.set(n,e++)}}function bn(t){return{documentation:{CommentProvider:e=>new fA(e),DocumentationProvider:e=>new dA(e)},parser:{AsyncParser:e=>new hA(e),GrammarConfig:e=>jg(e),LangiumParser:e=>ZR(e),CompletionParser:e=>QR(e),ValueConverter:()=>new hp,TokenBuilder:()=>new fp,Lexer:e=>new YE(e),ParserErrorMessageProvider:()=>new op,LexerErrorMessageProvider:()=>new KE},workspace:{AstNodeLocator:()=>new Gv,AstNodeDescriptionProvider:e=>new Mv(e),ReferenceDescriptionProvider:e=>new Fv(e)},references:{Linker:e=>new Rv(e),NameProvider:()=>new Ev,ScopeProvider:e=>new bv(e),ScopeComputation:e=>new Sv(e),References:e=>new Av(e)},serializer:{Hydrator:e=>new mA(e),JsonSerializer:e=>new Iv(e)},validation:{DocumentValidator:e=>new Ov(e),ValidationRegistry:e=>new Pv(e)},shared:()=>t.shared}}function _n(t){return{ServiceRegistry:e=>new $v(e),workspace:{LangiumDocuments:e=>new Tv(e),LangiumDocumentFactory:e=>new yv(e),DocumentBuilder:e=>new qE(e),IndexManager:e=>new WE(e),WorkspaceManager:e=>new VE(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new pA,ConfigurationProvider:e=>new Uv(e)},profilers:{}}}var bf;(function(t){t.merge=(e,n)=>os(os({},e),n)})(bf||(bf={}));function Xe(t,e,n,r,i,s,a,o,c){const l=[t,e,n,r,i,s,a,o,c].reduce(os,{});return Mp(l)}const gA=Symbol("isProxy");function Mp(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===gA?!0:If(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(If(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const _f=Symbol();function If(t,e,n,r){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]===_f)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 n){const i=n[e];t[e]=_f;try{t[e]=typeof i=="function"?i(r):Mp(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function os(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!=null)if(typeof r=="object"){const i=t[n];typeof i=="object"&&i!==null?t[n]=os(i,r):t[n]=os({},r)}else t[n]=r}return t}class yA{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 In={fileSystemProvider:()=>new yA},TA={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},RA={AstReflection:()=>new th};function vA(){const t=Xe(_n(In),RA),e=Xe(bn({shared:t}),TA);return t.ServiceRegistry.register(e),e}function tr(t){const e=vA(),n=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(n,It.parse(`memory:/${n.name??"grammar"}.langium`)),n}var EA=Object.defineProperty,_=(t,e)=>EA(t,"name",{value:e,configurable:!0}),Sl;(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 ]+\]/}})(Sl||(Sl={}));var Cl;(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])?/}})(Cl||(Cl={}));var kl;(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]*/}})(kl||(kl={}));var wl;(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]*/}})(wl||(wl={}));var Nl;(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]*/}})(Nl||(Nl={}));var bl;(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]*/}})(bl||(bl={}));var _l;(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:/"[^"]*"|'[^']*'/}})(_l||(_l={}));({...Sl.Terminals,...Cl.Terminals,...kl.Terminals,...wl.Terminals,...Nl.Terminals,...bl.Terminals,..._l.Terminals});var Kt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function AA(t){return Lt.isInstance(t,Kt.$type)}_(AA,"isArchitecture");var qs={$type:"Axis",label:"label",name:"name"},oa={$type:"Branch",name:"name",order:"order"};function SA(t){return Lt.isInstance(t,oa.$type)}_(SA,"isBranch");var $f={$type:"Checkout",branch:"branch"},Ws={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},Po={$type:"ClassDefStatement",className:"className",styleText:"styleText"},vr={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function CA(t){return Lt.isInstance(t,vr.$type)}_(CA,"isCommit");var Vs={$type:"Curve",entries:"entries",label:"label",name:"name"},cr={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},xt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Lo={$type:"Entry",axis:"axis",value:"value"},jn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function kA(t){return Lt.isInstance(t,jn.$type)}_(kA,"isGitGraph");var Pi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},qi={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function wA(t){return Lt.isInstance(t,qi.$type)}_(wA,"isInfo");var Li={$type:"Item",classSelector:"classSelector",name:"name"},Oo={$type:"Junction",id:"id",in:"in"},Ks={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Er={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function NA(t){return Lt.isInstance(t,Er.$type)}_(NA,"isMerge");var xo={$type:"Option",name:"name",value:"value"},Ar={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function bA(t){return Lt.isInstance(t,Ar.$type)}_(bA,"isPacket");var Sr={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function _A(t){return Lt.isInstance(t,Sr.$type)}_(_A,"isPacketBlock");var zn={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function IA(t){return Lt.isInstance(t,zn.$type)}_(IA,"isPie");var ca={$type:"PieSection",label:"label",value:"value"};function $A(t){return Lt.isInstance(t,ca.$type)}_($A,"isPieSection");var xn={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Do={$type:"Section",classSelector:"classSelector",name:"name"},lr={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},ur={$type:"Statement"},Cr={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function PA(t){return Lt.isInstance(t,Cr.$type)}_(PA,"isTreemap");var Mo={$type:"TreemapRow",indent:"indent",item:"item"},br,Fp=(br=class extends Kf{constructor(){super(...arguments),this.types={Architecture:{name:Kt.$type,properties:{accDescr:{name:Kt.accDescr},accTitle:{name:Kt.accTitle},edges:{name:Kt.edges,defaultValue:[]},groups:{name:Kt.groups,defaultValue:[]},junctions:{name:Kt.junctions,defaultValue:[]},services:{name:Kt.services,defaultValue:[]},title:{name:Kt.title}},superTypes:[]},Axis:{name:qs.$type,properties:{label:{name:qs.label},name:{name:qs.name}},superTypes:[]},Branch:{name:oa.$type,properties:{name:{name:oa.name},order:{name:oa.order}},superTypes:[ur.$type]},Checkout:{name:$f.$type,properties:{branch:{name:$f.branch}},superTypes:[ur.$type]},CherryPicking:{name:Ws.$type,properties:{id:{name:Ws.id},parent:{name:Ws.parent},tags:{name:Ws.tags,defaultValue:[]}},superTypes:[ur.$type]},ClassDefStatement:{name:Po.$type,properties:{className:{name:Po.className},styleText:{name:Po.styleText}},superTypes:[]},Commit:{name:vr.$type,properties:{id:{name:vr.id},message:{name:vr.message},tags:{name:vr.tags,defaultValue:[]},type:{name:vr.type}},superTypes:[ur.$type]},Curve:{name:Vs.$type,properties:{entries:{name:Vs.entries,defaultValue:[]},label:{name:Vs.label},name:{name:Vs.name}},superTypes:[]},Direction:{name:cr.$type,properties:{accDescr:{name:cr.accDescr},accTitle:{name:cr.accTitle},dir:{name:cr.dir},statements:{name:cr.statements,defaultValue:[]},title:{name:cr.title}},superTypes:[jn.$type]},Edge:{name:xt.$type,properties:{lhsDir:{name:xt.lhsDir},lhsGroup:{name:xt.lhsGroup,defaultValue:!1},lhsId:{name:xt.lhsId},lhsInto:{name:xt.lhsInto,defaultValue:!1},rhsDir:{name:xt.rhsDir},rhsGroup:{name:xt.rhsGroup,defaultValue:!1},rhsId:{name:xt.rhsId},rhsInto:{name:xt.rhsInto,defaultValue:!1},title:{name:xt.title}},superTypes:[]},Entry:{name:Lo.$type,properties:{axis:{name:Lo.axis,referenceType:qs.$type},value:{name:Lo.value}},superTypes:[]},GitGraph:{name:jn.$type,properties:{accDescr:{name:jn.accDescr},accTitle:{name:jn.accTitle},statements:{name:jn.statements,defaultValue:[]},title:{name:jn.title}},superTypes:[]},Group:{name:Pi.$type,properties:{icon:{name:Pi.icon},id:{name:Pi.id},in:{name:Pi.in},title:{name:Pi.title}},superTypes:[]},Info:{name:qi.$type,properties:{accDescr:{name:qi.accDescr},accTitle:{name:qi.accTitle},title:{name:qi.title}},superTypes:[]},Item:{name:Li.$type,properties:{classSelector:{name:Li.classSelector},name:{name:Li.name}},superTypes:[]},Junction:{name:Oo.$type,properties:{id:{name:Oo.id},in:{name:Oo.in}},superTypes:[]},Leaf:{name:Ks.$type,properties:{classSelector:{name:Ks.classSelector},name:{name:Ks.name},value:{name:Ks.value}},superTypes:[Li.$type]},Merge:{name:Er.$type,properties:{branch:{name:Er.branch},id:{name:Er.id},tags:{name:Er.tags,defaultValue:[]},type:{name:Er.type}},superTypes:[ur.$type]},Option:{name:xo.$type,properties:{name:{name:xo.name},value:{name:xo.value,defaultValue:!1}},superTypes:[]},Packet:{name:Ar.$type,properties:{accDescr:{name:Ar.accDescr},accTitle:{name:Ar.accTitle},blocks:{name:Ar.blocks,defaultValue:[]},title:{name:Ar.title}},superTypes:[]},PacketBlock:{name:Sr.$type,properties:{bits:{name:Sr.bits},end:{name:Sr.end},label:{name:Sr.label},start:{name:Sr.start}},superTypes:[]},Pie:{name:zn.$type,properties:{accDescr:{name:zn.accDescr},accTitle:{name:zn.accTitle},sections:{name:zn.sections,defaultValue:[]},showData:{name:zn.showData,defaultValue:!1},title:{name:zn.title}},superTypes:[]},PieSection:{name:ca.$type,properties:{label:{name:ca.label},value:{name:ca.value}},superTypes:[]},Radar:{name:xn.$type,properties:{accDescr:{name:xn.accDescr},accTitle:{name:xn.accTitle},axes:{name:xn.axes,defaultValue:[]},curves:{name:xn.curves,defaultValue:[]},options:{name:xn.options,defaultValue:[]},title:{name:xn.title}},superTypes:[]},Section:{name:Do.$type,properties:{classSelector:{name:Do.classSelector},name:{name:Do.name}},superTypes:[Li.$type]},Service:{name:lr.$type,properties:{icon:{name:lr.icon},iconText:{name:lr.iconText},id:{name:lr.id},in:{name:lr.in},title:{name:lr.title}},superTypes:[]},Statement:{name:ur.$type,properties:{},superTypes:[]},Treemap:{name:Cr.$type,properties:{accDescr:{name:Cr.accDescr},accTitle:{name:Cr.accTitle},title:{name:Cr.title},TreemapRows:{name:Cr.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Mo.$type,properties:{indent:{name:Mo.indent},item:{name:Mo.item}},superTypes:[]}}}},_(br,"MermaidAstReflection"),br),Lt=new Fp,Pf,LA=_(()=>Pf??(Pf=tr(`{"$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"),Lf,OA=_(()=>Lf??(Lf=tr(`{"$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"),Of,xA=_(()=>Of??(Of=tr(`{"$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,DA=_(()=>xf??(xf=tr(`{"$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"),Df,MA=_(()=>Df??(Df=tr(`{"$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"),Mf,FA=_(()=>Mf??(Mf=tr(`{"$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"),Ff,GA=_(()=>Ff??(Ff=tr(`{"$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"),UA={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},jA={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zA={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},BA={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},qA={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},WA={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},VA={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nr={AstReflection:_(()=>new Fp,"AstReflection")},KA={Grammar:_(()=>LA(),"Grammar"),LanguageMetaData:_(()=>UA,"LanguageMetaData"),parser:{}},HA={Grammar:_(()=>OA(),"Grammar"),LanguageMetaData:_(()=>jA,"LanguageMetaData"),parser:{}},YA={Grammar:_(()=>xA(),"Grammar"),LanguageMetaData:_(()=>zA,"LanguageMetaData"),parser:{}},XA={Grammar:_(()=>DA(),"Grammar"),LanguageMetaData:_(()=>BA,"LanguageMetaData"),parser:{}},JA={Grammar:_(()=>MA(),"Grammar"),LanguageMetaData:_(()=>qA,"LanguageMetaData"),parser:{}},QA={Grammar:_(()=>FA(),"Grammar"),LanguageMetaData:_(()=>WA,"LanguageMetaData"),parser:{}},ZA={Grammar:_(()=>GA(),"Grammar"),LanguageMetaData:_(()=>VA,"LanguageMetaData"),parser:{}},eS=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,tS=/accTitle[\t ]*:([^\n\r]*)/,nS=/title([\t ][^\n\r]*|)/,rS={ACC_DESCR:eS,ACC_TITLE:tS,TITLE:nS},_r,mo=(_r=class extends hp{runConverter(e,n,r){let i=this.runCommonConverter(e,n,r);return i===void 0&&(i=this.runCustomConverter(e,n,r)),i===void 0?super.runConverter(e,n,r):i}runCommonConverter(e,n,r){const i=rS[e.name];if(i===void 0)return;const s=i.exec(n);if(s!==null){if(s[1]!==void 0)return s[1].trim().replace(/[\t ]{2,}/gm," ");if(s[2]!==void 0)return s[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
158
- `)}}},_(_r,"AbstractMermaidValueConverter"),_r),Ir,go=(Ir=class extends mo{runCustomConverter(e,n,r){}},_(Ir,"CommonValueConverter"),Ir),$r,$n=($r=class extends fp{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,n,r){const i=super.buildKeywordTokens(e,n,r);return i.forEach(s=>{this.keywords.has(s.name)&&s.PATTERN!==void 0&&(s.PATTERN=new RegExp(s.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},_($r,"AbstractMermaidTokenBuilder"),$r),Pr;Pr=class extends $n{},_(Pr,"CommonTokenBuilder");var Lr,iS=(Lr=class extends $n{constructor(){super(["gitGraph"])}},_(Lr,"GitGraphTokenBuilder"),Lr),Gp={parser:{TokenBuilder:_(()=>new iS,"TokenBuilder"),ValueConverter:_(()=>new go,"ValueConverter")}};function Up(t=In){const e=Xe(_n(t),nr),n=Xe(bn({shared:e}),HA,Gp);return e.ServiceRegistry.register(n),{shared:e,GitGraph:n}}_(Up,"createGitGraphServices");var Or,sS=(Or=class extends $n{constructor(){super(["info","showInfo"])}},_(Or,"InfoTokenBuilder"),Or),jp={parser:{TokenBuilder:_(()=>new sS,"TokenBuilder"),ValueConverter:_(()=>new go,"ValueConverter")}};function zp(t=In){const e=Xe(_n(t),nr),n=Xe(bn({shared:e}),YA,jp);return e.ServiceRegistry.register(n),{shared:e,Info:n}}_(zp,"createInfoServices");var xr,aS=(xr=class extends $n{constructor(){super(["packet"])}},_(xr,"PacketTokenBuilder"),xr),Bp={parser:{TokenBuilder:_(()=>new aS,"TokenBuilder"),ValueConverter:_(()=>new go,"ValueConverter")}};function qp(t=In){const e=Xe(_n(t),nr),n=Xe(bn({shared:e}),XA,Bp);return e.ServiceRegistry.register(n),{shared:e,Packet:n}}_(qp,"createPacketServices");var Dr,oS=(Dr=class extends $n{constructor(){super(["pie","showData"])}},_(Dr,"PieTokenBuilder"),Dr),Mr,cS=(Mr=class extends mo{runCustomConverter(e,n,r){if(e.name==="PIE_SECTION_LABEL")return n.replace(/"/g,"").trim()}},_(Mr,"PieValueConverter"),Mr),Wp={parser:{TokenBuilder:_(()=>new oS,"TokenBuilder"),ValueConverter:_(()=>new cS,"ValueConverter")}};function Vp(t=In){const e=Xe(_n(t),nr),n=Xe(bn({shared:e}),JA,Wp);return e.ServiceRegistry.register(n),{shared:e,Pie:n}}_(Vp,"createPieServices");var Fr,lS=(Fr=class extends $n{constructor(){super(["architecture"])}},_(Fr,"ArchitectureTokenBuilder"),Fr),Gr,uS=(Gr=class extends mo{runCustomConverter(e,n,r){if(e.name==="ARCH_ICON")return n.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return n.replace(/["()]/g,"");if(e.name==="ARCH_TITLE")return n.replace(/[[\]]/g,"").trim()}},_(Gr,"ArchitectureValueConverter"),Gr),Kp={parser:{TokenBuilder:_(()=>new lS,"TokenBuilder"),ValueConverter:_(()=>new uS,"ValueConverter")}};function Hp(t=In){const e=Xe(_n(t),nr),n=Xe(bn({shared:e}),KA,Kp);return e.ServiceRegistry.register(n),{shared:e,Architecture:n}}_(Hp,"createArchitectureServices");var Ur,dS=(Ur=class extends $n{constructor(){super(["radar-beta"])}},_(Ur,"RadarTokenBuilder"),Ur),Yp={parser:{TokenBuilder:_(()=>new dS,"TokenBuilder"),ValueConverter:_(()=>new go,"ValueConverter")}};function Xp(t=In){const e=Xe(_n(t),nr),n=Xe(bn({shared:e}),QA,Yp);return e.ServiceRegistry.register(n),{shared:e,Radar:n}}_(Xp,"createRadarServices");var jr,fS=(jr=class extends $n{constructor(){super(["treemap"])}},_(jr,"TreemapTokenBuilder"),jr),hS=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,zr,pS=(zr=class extends mo{runCustomConverter(e,n,r){if(e.name==="NUMBER2")return parseFloat(n.replace(/,/g,""));if(e.name==="SEPARATOR")return n.substring(1,n.length-1);if(e.name==="STRING2")return n.substring(1,n.length-1);if(e.name==="INDENTATION")return n.length;if(e.name==="ClassDef"){if(typeof n!="string")return n;const i=hS.exec(n);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},_(zr,"TreemapValueConverter"),zr);function Jp(t){const e=t.validation.TreemapValidator,n=t.validation.ValidationRegistry;if(n){const r={Treemap:e.checkSingleRoot.bind(e)};n.register(r,e)}}_(Jp,"registerValidationChecks");var Br,mS=(Br=class{checkSingleRoot(e,n){let r;for(const i of e.TreemapRows)i.item&&(r===void 0&&i.indent===void 0?r=0:i.indent===void 0?n("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):r!==void 0&&r>=parseInt(i.indent,10)&&n("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},_(Br,"TreemapValidator"),Br),Qp={parser:{TokenBuilder:_(()=>new fS,"TokenBuilder"),ValueConverter:_(()=>new pS,"ValueConverter")},validation:{TreemapValidator:_(()=>new mS,"TreemapValidator")}};function Zp(t=In){const e=Xe(_n(t),nr),n=Xe(bn({shared:e}),ZA,Qp);return e.ServiceRegistry.register(n),Jp(n),{shared:e,Treemap:n}}_(Zp,"createTreemapServices");var Yt={},gS={info:_(async()=>{const{createInfoServices:t}=await Ln(async()=>{const{createInfoServices:n}=await Promise.resolve().then(()=>RS);return{createInfoServices:n}},void 0),e=t().Info.parser.LangiumParser;Yt.info=e},"info"),packet:_(async()=>{const{createPacketServices:t}=await Ln(async()=>{const{createPacketServices:n}=await Promise.resolve().then(()=>vS);return{createPacketServices:n}},void 0),e=t().Packet.parser.LangiumParser;Yt.packet=e},"packet"),pie:_(async()=>{const{createPieServices:t}=await Ln(async()=>{const{createPieServices:n}=await Promise.resolve().then(()=>ES);return{createPieServices:n}},void 0),e=t().Pie.parser.LangiumParser;Yt.pie=e},"pie"),architecture:_(async()=>{const{createArchitectureServices:t}=await Ln(async()=>{const{createArchitectureServices:n}=await Promise.resolve().then(()=>AS);return{createArchitectureServices:n}},void 0),e=t().Architecture.parser.LangiumParser;Yt.architecture=e},"architecture"),gitGraph:_(async()=>{const{createGitGraphServices:t}=await Ln(async()=>{const{createGitGraphServices:n}=await Promise.resolve().then(()=>SS);return{createGitGraphServices:n}},void 0),e=t().GitGraph.parser.LangiumParser;Yt.gitGraph=e},"gitGraph"),radar:_(async()=>{const{createRadarServices:t}=await Ln(async()=>{const{createRadarServices:n}=await Promise.resolve().then(()=>CS);return{createRadarServices:n}},void 0),e=t().Radar.parser.LangiumParser;Yt.radar=e},"radar"),treemap:_(async()=>{const{createTreemapServices:t}=await Ln(async()=>{const{createTreemapServices:n}=await Promise.resolve().then(()=>kS);return{createTreemapServices:n}},void 0),e=t().Treemap.parser.LangiumParser;Yt.treemap=e},"treemap")};async function yS(t,e){const n=gS[t];if(!n)throw new Error(`Unknown diagram type: ${t}`);Yt[t]||await n();const i=Yt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new TS(i);return i.value}_(yS,"parse");var qr,TS=(qr=class extends Error{constructor(e){const n=e.lexerErrors.map(i=>i.message).join(`
159
- `),r=e.parserErrors.map(i=>i.message).join(`
160
- `);super(`Parsing failed: ${n} ${r}`),this.result=e}},_(qr,"MermaidParseError"),qr);const RS=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:jp,createInfoServices:zp},Symbol.toStringTag,{value:"Module"})),vS=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Bp,createPacketServices:qp},Symbol.toStringTag,{value:"Module"})),ES=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Wp,createPieServices:Vp},Symbol.toStringTag,{value:"Module"})),AS=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Kp,createArchitectureServices:Hp},Symbol.toStringTag,{value:"Module"})),SS=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Gp,createGitGraphServices:Up},Symbol.toStringTag,{value:"Module"})),CS=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Yp,createRadarServices:Xp},Symbol.toStringTag,{value:"Module"})),kS=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Qp,createTreemapServices:Zp},Symbol.toStringTag,{value:"Module"}));export{yS as p};